buzzcasting-storage 3.11.4 → 3.11.6
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 +471 -464
- package/package.json +9 -9
|
@@ -17,39 +17,39 @@ function Ia(h, t) {
|
|
|
17
17
|
return h;
|
|
18
18
|
}
|
|
19
19
|
function Oe(h, t) {
|
|
20
|
-
let o, l,
|
|
20
|
+
let o, l, p;
|
|
21
21
|
if (t.length === 0)
|
|
22
22
|
return h;
|
|
23
|
-
for (o = 0,
|
|
23
|
+
for (o = 0, p = t.length; o < p; o++)
|
|
24
24
|
l = t.charCodeAt(o), h = (h << 5) - h + l, h |= 0;
|
|
25
25
|
return h < 0 ? h * -2 : h;
|
|
26
26
|
}
|
|
27
27
|
function Na(h, t, o) {
|
|
28
28
|
return Object.keys(t).sort().reduce(l, h);
|
|
29
|
-
function l(
|
|
30
|
-
return jr(
|
|
29
|
+
function l(p, E) {
|
|
30
|
+
return jr(p, t[E], E, o);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
function jr(h, t, o, l) {
|
|
34
|
-
const
|
|
34
|
+
const p = Oe(Oe(Oe(h, o), Ra(t)), typeof t);
|
|
35
35
|
if (t === null)
|
|
36
|
-
return Oe(
|
|
36
|
+
return Oe(p, "null");
|
|
37
37
|
if (t === void 0)
|
|
38
|
-
return Oe(
|
|
38
|
+
return Oe(p, "undefined");
|
|
39
39
|
if (typeof t == "object" || typeof t == "function") {
|
|
40
40
|
if (l.includes(t))
|
|
41
|
-
return Oe(
|
|
41
|
+
return Oe(p, `[Circular]${o}`);
|
|
42
42
|
l.push(t);
|
|
43
|
-
const
|
|
43
|
+
const E = Na(p, t, l);
|
|
44
44
|
if (!("valueOf" in t) || typeof t.valueOf != "function")
|
|
45
|
-
return
|
|
45
|
+
return E;
|
|
46
46
|
try {
|
|
47
|
-
return Oe(
|
|
47
|
+
return Oe(E, String(t.valueOf()));
|
|
48
48
|
} catch (C) {
|
|
49
|
-
return Oe(
|
|
49
|
+
return Oe(E, `[valueOf exception]${C.stack || C.message}`);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
return Oe(
|
|
52
|
+
return Oe(p, t.toString());
|
|
53
53
|
}
|
|
54
54
|
function Ra(h) {
|
|
55
55
|
return Object.prototype.toString.call(h);
|
|
@@ -117,10 +117,10 @@ function Ta(h) {
|
|
|
117
117
|
}
|
|
118
118
|
function Ot(h, t) {
|
|
119
119
|
var o;
|
|
120
|
-
let l,
|
|
120
|
+
let l, p, E, C, K;
|
|
121
121
|
switch (h.moderation) {
|
|
122
122
|
case en.BEFORE:
|
|
123
|
-
l = /* @__PURE__ */ new Date(),
|
|
123
|
+
l = /* @__PURE__ */ new Date(), p = (o = h.beforeTime) == null ? void 0 : o.split(":"), E = Number.parseInt(p ? p[0] : "00"), C = Number.parseInt(p ? p[1] : "00"), K = Number.parseInt(p ? p[2] : "00"), t.before = l.setHours(E, C, K, 0) / 1e3, t.period || (t.period = l.getDay() === 1 ? 72 : 24);
|
|
124
124
|
break;
|
|
125
125
|
case en.DELAYED:
|
|
126
126
|
h.delay && h.delay > 0 && (t.delay = `${h.delay}`);
|
|
@@ -133,7 +133,7 @@ function Ot(h, t) {
|
|
|
133
133
|
}
|
|
134
134
|
return t;
|
|
135
135
|
}
|
|
136
|
-
const xa = "3.11.
|
|
136
|
+
const xa = "3.11.5";
|
|
137
137
|
class ka {
|
|
138
138
|
options;
|
|
139
139
|
url;
|
|
@@ -171,9 +171,9 @@ class ka {
|
|
|
171
171
|
};
|
|
172
172
|
};
|
|
173
173
|
async get(t) {
|
|
174
|
-
const { version: o } = this.options, l = this.headers(),
|
|
175
|
-
delete
|
|
176
|
-
const
|
|
174
|
+
const { version: o } = this.options, l = this.headers(), p = Object.assign({}, t);
|
|
175
|
+
delete p.type, delete p.hash, delete p.order, p.topics = `${p.dashboard}-${p.widget}`, delete p.presentation;
|
|
176
|
+
const E = Object.keys(p).length > 0 ? `?${new URLSearchParams(p).toString()}` : "";
|
|
177
177
|
let C = "";
|
|
178
178
|
switch (t.type) {
|
|
179
179
|
case _.MESSAGES:
|
|
@@ -194,8 +194,8 @@ class ka {
|
|
|
194
194
|
c.NONE,
|
|
195
195
|
C,
|
|
196
196
|
t.widget
|
|
197
|
-
]), G(4, [t.type,
|
|
198
|
-
[this.url, "api", o, t.type].join("/") +
|
|
197
|
+
]), G(4, [t.type, p]), await fetch(
|
|
198
|
+
[this.url, "api", o, t.type].join("/") + E,
|
|
199
199
|
{ ...l, method: "get" }
|
|
200
200
|
).then(async (K) => {
|
|
201
201
|
if (!K.ok)
|
|
@@ -204,7 +204,7 @@ class ka {
|
|
|
204
204
|
}).then((K) => K.json()).then((K) => (K.query = t, K)).catch((K) => ({ success: !1, message: `${K}`, data: null, query: t }));
|
|
205
205
|
}
|
|
206
206
|
async hideMessage(t) {
|
|
207
|
-
const { version: o } = this.options, l = this.headers(),
|
|
207
|
+
const { version: o } = this.options, l = this.headers(), p = "?action=visible";
|
|
208
208
|
return console.info(
|
|
209
209
|
"%capi%c %cput",
|
|
210
210
|
c.API,
|
|
@@ -214,18 +214,18 @@ class ka {
|
|
|
214
214
|
t.widget,
|
|
215
215
|
t.id
|
|
216
216
|
), await fetch(
|
|
217
|
-
[this.url, "api", o, "messages", t.id].join("/") +
|
|
217
|
+
[this.url, "api", o, "messages", t.id].join("/") + p,
|
|
218
218
|
{ ...l, method: "put" }
|
|
219
|
-
).then((
|
|
220
|
-
if (!
|
|
221
|
-
throw new Error(
|
|
222
|
-
return
|
|
223
|
-
}).then((
|
|
219
|
+
).then((E) => {
|
|
220
|
+
if (!E.ok)
|
|
221
|
+
throw new Error(E.statusText);
|
|
222
|
+
return E;
|
|
223
|
+
}).then((E) => E.json()).catch((E) => ({ succes: !1, message: E, data: [] }));
|
|
224
224
|
}
|
|
225
225
|
async hideLabels(t) {
|
|
226
|
-
const { version: o } = this.options, l = this.formHeaders(),
|
|
227
|
-
for (const [C, K] of
|
|
228
|
-
|
|
226
|
+
const { version: o } = this.options, l = this.formHeaders(), p = new URLSearchParams(), E = t.labels || [];
|
|
227
|
+
for (const [C, K] of E.entries())
|
|
228
|
+
p.append(`custom_filters[${C}]`, K);
|
|
229
229
|
return console.info(
|
|
230
230
|
"%capi%c %cput",
|
|
231
231
|
c.API,
|
|
@@ -233,10 +233,10 @@ class ka {
|
|
|
233
233
|
c.GET_DATA,
|
|
234
234
|
X.HIDE_LABELS,
|
|
235
235
|
t.widget,
|
|
236
|
-
|
|
236
|
+
E
|
|
237
237
|
), await fetch(
|
|
238
238
|
[this.url, "api", o, t.type, t.widget].join("/"),
|
|
239
|
-
{ ...l, body:
|
|
239
|
+
{ ...l, body: p, method: "put" }
|
|
240
240
|
).then((C) => {
|
|
241
241
|
if (!C.ok)
|
|
242
242
|
throw new Error(C.statusText);
|
|
@@ -244,15 +244,15 @@ class ka {
|
|
|
244
244
|
}).then((C) => C.json()).catch((C) => ({ succes: !1, message: C, data: [] }));
|
|
245
245
|
}
|
|
246
246
|
async loadSlide(t) {
|
|
247
|
-
const { version: o } = this.options, l = this.headers(),
|
|
248
|
-
return delete
|
|
247
|
+
const { version: o } = this.options, l = this.headers(), p = Object.assign({}, t);
|
|
248
|
+
return delete p.type, delete p.hash, G(3, ["%capi%c %cloadSlide", c.API, c.NONE, c.SLIDE, t.id]), await fetch(
|
|
249
249
|
[this.url, "api", o, "slides", t.id].join("/"),
|
|
250
250
|
{ ...l, method: "get" }
|
|
251
|
-
).then(async (
|
|
252
|
-
if (!
|
|
253
|
-
throw new Error(`${
|
|
254
|
-
return
|
|
255
|
-
}).then((
|
|
251
|
+
).then(async (E) => {
|
|
252
|
+
if (!E.ok)
|
|
253
|
+
throw new Error(`${E.status}`);
|
|
254
|
+
return E;
|
|
255
|
+
}).then((E) => E.json()).then((E) => (E.query = t, E.data && E.data.json && (E.data.json = JSON.parse(E.data.json)), E)).catch((E) => ({ success: !1, message: `${E}`, data: null }));
|
|
256
256
|
}
|
|
257
257
|
/**
|
|
258
258
|
* Store slide definition
|
|
@@ -264,7 +264,7 @@ class ka {
|
|
|
264
264
|
async storeSlide(t) {
|
|
265
265
|
const { version: o } = this.options, l = this.formHeaders();
|
|
266
266
|
delete t.update, delete t.type;
|
|
267
|
-
const
|
|
267
|
+
const p = JSON.stringify(t);
|
|
268
268
|
return G(3, [
|
|
269
269
|
"%cput%c %capi%c %cslide",
|
|
270
270
|
c.OK,
|
|
@@ -276,12 +276,12 @@ class ka {
|
|
|
276
276
|
t.id
|
|
277
277
|
]), await fetch(
|
|
278
278
|
[this.url, "api", o, "slides", t.id].join("/"),
|
|
279
|
-
{ ...l, body:
|
|
280
|
-
).then((
|
|
281
|
-
if (!
|
|
282
|
-
throw new Error(
|
|
283
|
-
return
|
|
284
|
-
}).then((
|
|
279
|
+
{ ...l, body: p, method: "put" }
|
|
280
|
+
).then((E) => {
|
|
281
|
+
if (!E.ok)
|
|
282
|
+
throw new Error(E.statusText);
|
|
283
|
+
return E;
|
|
284
|
+
}).then((E) => E.json()).catch((E) => ({ succes: !1, message: E, data: [] }));
|
|
285
285
|
}
|
|
286
286
|
async loadPresentation(t) {
|
|
287
287
|
const { version: o } = this.options, l = this.headers();
|
|
@@ -296,11 +296,11 @@ class ka {
|
|
|
296
296
|
]), await fetch(
|
|
297
297
|
[this.url, "api", o, _.PRESENTATIONS, t.id].join("/"),
|
|
298
298
|
{ ...l, method: "get" }
|
|
299
|
-
).then(async (
|
|
300
|
-
if (!
|
|
301
|
-
throw new Error(`${
|
|
302
|
-
return
|
|
303
|
-
}).then((
|
|
299
|
+
).then(async (p) => {
|
|
300
|
+
if (!p.ok)
|
|
301
|
+
throw new Error(`${p.status}`);
|
|
302
|
+
return p;
|
|
303
|
+
}).then((p) => p.json()).then((p) => (p.query = t, p)).catch((p) => ({ success: !1, message: `${p}`, data: null }));
|
|
304
304
|
}
|
|
305
305
|
/**
|
|
306
306
|
* Store slide definition
|
|
@@ -312,15 +312,15 @@ class ka {
|
|
|
312
312
|
async storePresentation(t) {
|
|
313
313
|
const { version: o } = this.options, l = this.formHeaders();
|
|
314
314
|
delete t.update;
|
|
315
|
-
const
|
|
315
|
+
const p = JSON.stringify(t);
|
|
316
316
|
return G(2, ["%capi%c %cput", c.API, c.NONE, c.PRESENTATION, t.name]), await fetch(
|
|
317
317
|
[this.url, "api", o, _.PRESENTATIONS, t.id].join("/"),
|
|
318
|
-
{ ...l, body:
|
|
319
|
-
).then((
|
|
320
|
-
if (!
|
|
321
|
-
throw new Error(
|
|
322
|
-
return
|
|
323
|
-
}).then((
|
|
318
|
+
{ ...l, body: p, method: "put" }
|
|
319
|
+
).then((E) => {
|
|
320
|
+
if (!E.ok)
|
|
321
|
+
throw new Error(E.statusText);
|
|
322
|
+
return E;
|
|
323
|
+
}).then((E) => E.json()).catch((E) => ({ succes: !1, message: E, data: [] }));
|
|
324
324
|
}
|
|
325
325
|
async loadPreference(t) {
|
|
326
326
|
const { version: o } = this.options, l = this.headers();
|
|
@@ -333,16 +333,16 @@ class ka {
|
|
|
333
333
|
]), await fetch(
|
|
334
334
|
[this.url, "api", o, _.PREFERENCES, t.id].join("/"),
|
|
335
335
|
{ ...l, method: "get" }
|
|
336
|
-
).then(async (
|
|
337
|
-
if (!
|
|
338
|
-
throw new Error(`${
|
|
339
|
-
return
|
|
340
|
-
}).then((
|
|
336
|
+
).then(async (p) => {
|
|
337
|
+
if (!p.ok)
|
|
338
|
+
throw new Error(`${p.status}`);
|
|
339
|
+
return p;
|
|
340
|
+
}).then((p) => p.json()).then((p) => p).catch((p) => ({ success: !1, message: `${p}`, data: null }));
|
|
341
341
|
}
|
|
342
342
|
async storePreference(t) {
|
|
343
343
|
const { version: o } = this.options, l = this.formHeaders();
|
|
344
344
|
delete t.update;
|
|
345
|
-
const
|
|
345
|
+
const p = JSON.stringify({ data: t });
|
|
346
346
|
return console.info(
|
|
347
347
|
"%capi%c %cstorePreference",
|
|
348
348
|
c.API,
|
|
@@ -351,12 +351,12 @@ class ka {
|
|
|
351
351
|
t.id
|
|
352
352
|
), await fetch(
|
|
353
353
|
[this.url, "api", o, _.PREFERENCES, t.id].join("/"),
|
|
354
|
-
{ ...l, body:
|
|
355
|
-
).then((
|
|
356
|
-
if (!
|
|
357
|
-
throw new Error(
|
|
358
|
-
return
|
|
359
|
-
}).then((
|
|
354
|
+
{ ...l, body: p, method: "put" }
|
|
355
|
+
).then((E) => {
|
|
356
|
+
if (!E.ok)
|
|
357
|
+
throw new Error(E.statusText);
|
|
358
|
+
return E;
|
|
359
|
+
}).then((E) => E.json()).catch((E) => ({ succes: !1, message: E, data: [] }));
|
|
360
360
|
}
|
|
361
361
|
/*public async loadDashboardWidgets(query: IQuery): Promise<any> {
|
|
362
362
|
if (query?.dashboard === undefined)
|
|
@@ -403,15 +403,15 @@ class ka {
|
|
|
403
403
|
...l,
|
|
404
404
|
method: "get"
|
|
405
405
|
}
|
|
406
|
-
).then(async (
|
|
407
|
-
if (!
|
|
408
|
-
throw new Error(`${
|
|
409
|
-
return
|
|
410
|
-
}).then((
|
|
411
|
-
data: { dashboards:
|
|
406
|
+
).then(async (p) => {
|
|
407
|
+
if (!p.ok)
|
|
408
|
+
throw new Error(`${p.status}`);
|
|
409
|
+
return p;
|
|
410
|
+
}).then((p) => p.json()).then((p) => ({
|
|
411
|
+
data: { dashboards: p },
|
|
412
412
|
message: "Dashboard Widgets loaded from api",
|
|
413
413
|
success: !0
|
|
414
|
-
})).catch((
|
|
414
|
+
})).catch((p) => ({ success: !1, message: `${p}`, data: null }));
|
|
415
415
|
}
|
|
416
416
|
async loadImages() {
|
|
417
417
|
const { version: t } = this.options, o = this.headers();
|
|
@@ -429,7 +429,7 @@ class ka {
|
|
|
429
429
|
})).catch((l) => ({ success: !1, message: `${l}`, data: null }));
|
|
430
430
|
}
|
|
431
431
|
async storeImage(t) {
|
|
432
|
-
const { version: o } = this.options, l = this.fileHeaders(),
|
|
432
|
+
const { version: o } = this.options, l = this.fileHeaders(), p = t;
|
|
433
433
|
return console.info(
|
|
434
434
|
"%capi%c %cstoreImage",
|
|
435
435
|
c.API,
|
|
@@ -438,12 +438,12 @@ class ka {
|
|
|
438
438
|
t.get("name")
|
|
439
439
|
), await fetch(
|
|
440
440
|
[this.url, "api", o, _.IMAGES].join("/"),
|
|
441
|
-
{ ...l, body:
|
|
442
|
-
).then((
|
|
443
|
-
if (!
|
|
444
|
-
throw new Error(
|
|
445
|
-
return
|
|
446
|
-
}).then((
|
|
441
|
+
{ ...l, body: p, method: "post" }
|
|
442
|
+
).then((E) => {
|
|
443
|
+
if (!E.ok)
|
|
444
|
+
throw new Error(E.statusText);
|
|
445
|
+
return E;
|
|
446
|
+
}).then((E) => E.json()).catch((E) => ({ succes: !1, message: E, data: [] }));
|
|
447
447
|
}
|
|
448
448
|
async deleteImage(t) {
|
|
449
449
|
const { version: o } = this.options, l = this.formHeaders();
|
|
@@ -456,11 +456,11 @@ class ka {
|
|
|
456
456
|
), await fetch(
|
|
457
457
|
[this.url, "api", o, _.IMAGES, t].join("/"),
|
|
458
458
|
{ ...l, method: "delete" }
|
|
459
|
-
).then((
|
|
460
|
-
if (!
|
|
461
|
-
throw new Error(
|
|
462
|
-
return
|
|
463
|
-
}).then((
|
|
459
|
+
).then((p) => {
|
|
460
|
+
if (!p.ok)
|
|
461
|
+
throw new Error(p.statusText);
|
|
462
|
+
return p;
|
|
463
|
+
}).then((p) => p.json()).catch((p) => ({ succes: !1, message: p, data: [] }));
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
466
|
var Ca = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
@@ -485,17 +485,17 @@ function Ma() {
|
|
|
485
485
|
return e;
|
|
486
486
|
}).apply(this, arguments);
|
|
487
487
|
};
|
|
488
|
-
function
|
|
488
|
+
function p(e, n, r) {
|
|
489
489
|
for (var a, s = 0, i = n.length; s < i; s++) !a && s in n || ((a = a || Array.prototype.slice.call(n, 0, s))[s] = n[s]);
|
|
490
490
|
return e.concat(a || Array.prototype.slice.call(n));
|
|
491
491
|
}
|
|
492
|
-
var
|
|
492
|
+
var E = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Ca, C = Object.keys, K = Array.isArray;
|
|
493
493
|
function te(e, n) {
|
|
494
494
|
return typeof n != "object" || C(n).forEach(function(r) {
|
|
495
495
|
e[r] = n[r];
|
|
496
496
|
}), e;
|
|
497
497
|
}
|
|
498
|
-
typeof Promise > "u" ||
|
|
498
|
+
typeof Promise > "u" || E.Promise || (E.Promise = Promise);
|
|
499
499
|
var ge = Object.getPrototypeOf, Ce = {}.hasOwnProperty;
|
|
500
500
|
function ie(e, n) {
|
|
501
501
|
return Ce.call(e, n);
|
|
@@ -525,7 +525,7 @@ function Ma() {
|
|
|
525
525
|
if (!e) throw new Error("Assertion Failed");
|
|
526
526
|
}
|
|
527
527
|
function Yn(e) {
|
|
528
|
-
|
|
528
|
+
E.setImmediate ? setImmediate(e) : setTimeout(e, 0);
|
|
529
529
|
}
|
|
530
530
|
function ve(e, n) {
|
|
531
531
|
if (typeof n == "string" && ie(e, n)) return e[n];
|
|
@@ -566,9 +566,9 @@ function Ma() {
|
|
|
566
566
|
return n + e + "Array";
|
|
567
567
|
});
|
|
568
568
|
}))).filter(function(e) {
|
|
569
|
-
return
|
|
569
|
+
return E[e];
|
|
570
570
|
}), Jn = new Set(Ge.map(function(e) {
|
|
571
|
-
return
|
|
571
|
+
return E[e];
|
|
572
572
|
})), it = null;
|
|
573
573
|
function $e(e) {
|
|
574
574
|
return it = /* @__PURE__ */ new WeakMap(), e = function n(r) {
|
|
@@ -757,8 +757,8 @@ function Ma() {
|
|
|
757
757
|
var dn = { get: function() {
|
|
758
758
|
var e = B, n = Ct;
|
|
759
759
|
function r(a, s) {
|
|
760
|
-
var i = this, u = !e.global && (e !== B || n !== Ct), d = u && !Ie(), g = new j(function(y,
|
|
761
|
-
hn(i, new nr(sr(a, e, u, d), sr(s, e, u, d), y,
|
|
760
|
+
var i = this, u = !e.global && (e !== B || n !== Ct), d = u && !Ie(), g = new j(function(y, w) {
|
|
761
|
+
hn(i, new nr(sr(a, e, u, d), sr(s, e, u, d), y, w, e));
|
|
762
762
|
});
|
|
763
763
|
return this._consoleTask && (g._consoleTask = this._consoleTask), g;
|
|
764
764
|
}
|
|
@@ -986,11 +986,11 @@ function Ma() {
|
|
|
986
986
|
var r, a = B;
|
|
987
987
|
(n ? !ne.echoes || kt++ && e === B : !kt || --kt && e === B) || queueMicrotask(n ? function(s) {
|
|
988
988
|
++Ct, ne.echoes && --ne.echoes != 0 || (ne.echoes = ne.awaits = ne.id = 0), xt.push(B), Ne(s, !0);
|
|
989
|
-
}.bind(null, e) : sa), e !== B && (B = e, a === Pe && (Pe.env = ar()), cn && (r = Pe.env.Promise, n = e.env, (a.global || e.global) && (Object.defineProperty(
|
|
989
|
+
}.bind(null, e) : sa), e !== B && (B = e, a === Pe && (Pe.env = ar()), cn && (r = Pe.env.Promise, n = e.env, (a.global || e.global) && (Object.defineProperty(E, "Promise", n.PromiseProp), r.all = n.all, r.race = n.race, r.resolve = n.resolve, r.reject = n.reject, n.allSettled && (r.allSettled = n.allSettled), n.any && (r.any = n.any))));
|
|
990
990
|
}
|
|
991
991
|
function ar() {
|
|
992
|
-
var e =
|
|
993
|
-
return cn ? { Promise: e, PromiseProp: Object.getOwnPropertyDescriptor(
|
|
992
|
+
var e = E.Promise;
|
|
993
|
+
return cn ? { Promise: e, PromiseProp: Object.getOwnPropertyDescriptor(E, "Promise"), all: e.all, race: e.race, allSettled: e.allSettled, any: e.any, resolve: e.resolve, reject: e.reject } : {};
|
|
994
994
|
}
|
|
995
995
|
function We(e, n, r, a, s) {
|
|
996
996
|
var i = B;
|
|
@@ -1049,8 +1049,8 @@ function Ma() {
|
|
|
1049
1049
|
case "Array":
|
|
1050
1050
|
return function(s, i) {
|
|
1051
1051
|
for (var u = s.length, d = i.length, g = u < d ? u : d, y = 0; y < g; ++y) {
|
|
1052
|
-
var
|
|
1053
|
-
if (
|
|
1052
|
+
var w = H(s[y], i[y]);
|
|
1053
|
+
if (w !== 0) return w;
|
|
1054
1054
|
}
|
|
1055
1055
|
return u === d ? 0 : u < d ? -1 : 1;
|
|
1056
1056
|
}(e, n);
|
|
@@ -1068,7 +1068,7 @@ function Ma() {
|
|
|
1068
1068
|
}
|
|
1069
1069
|
var dr = (J.prototype._trans = function(e, n, r) {
|
|
1070
1070
|
var a = this._tx || B.trans, s = this.name, i = pe && typeof console < "u" && console.createTask && console.createTask("Dexie: ".concat(e === "readonly" ? "read" : "write", " ").concat(this.name));
|
|
1071
|
-
function u(y,
|
|
1071
|
+
function u(y, w, f) {
|
|
1072
1072
|
if (!f.schema[s]) throw new L.NotFound("Table " + s + " not part of transaction");
|
|
1073
1073
|
return n(f.idbtrans, f);
|
|
1074
1074
|
}
|
|
@@ -1076,19 +1076,19 @@ function Ma() {
|
|
|
1076
1076
|
try {
|
|
1077
1077
|
var g = a && a.db._novip === this.db._novip ? a === B.trans ? a._promise(e, u, r) : De(function() {
|
|
1078
1078
|
return a._promise(e, u, r);
|
|
1079
|
-
}, { trans: a, transless: B.transless || B }) : function y(
|
|
1080
|
-
if (
|
|
1081
|
-
var v =
|
|
1079
|
+
}, { trans: a, transless: B.transless || B }) : function y(w, f, O, m) {
|
|
1080
|
+
if (w.idbdb && (w._state.openComplete || B.letThrough || w._vip)) {
|
|
1081
|
+
var v = w._createTransaction(f, O, w._dbSchema);
|
|
1082
1082
|
try {
|
|
1083
|
-
v.create(),
|
|
1083
|
+
v.create(), w._state.PR1398_maxLoop = 3;
|
|
1084
1084
|
} catch (S) {
|
|
1085
|
-
return S.name === sn.InvalidState &&
|
|
1086
|
-
return y(
|
|
1085
|
+
return S.name === sn.InvalidState && w.isOpen() && 0 < --w._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), w.close({ disableAutoOpen: !1 }), w.open().then(function() {
|
|
1086
|
+
return y(w, f, O, m);
|
|
1087
1087
|
})) : q(S);
|
|
1088
1088
|
}
|
|
1089
1089
|
return v._promise(f, function(S, b) {
|
|
1090
1090
|
return De(function() {
|
|
1091
|
-
return B.trans = v,
|
|
1091
|
+
return B.trans = v, m(S, b, v);
|
|
1092
1092
|
});
|
|
1093
1093
|
}).then(function(S) {
|
|
1094
1094
|
if (f === "readwrite") try {
|
|
@@ -1100,13 +1100,13 @@ function Ma() {
|
|
|
1100
1100
|
});
|
|
1101
1101
|
});
|
|
1102
1102
|
}
|
|
1103
|
-
if (
|
|
1104
|
-
if (!
|
|
1105
|
-
if (!
|
|
1106
|
-
|
|
1103
|
+
if (w._state.openComplete) return q(new L.DatabaseClosed(w._state.dbOpenError));
|
|
1104
|
+
if (!w._state.isBeingOpened) {
|
|
1105
|
+
if (!w._state.autoOpen) return q(new L.DatabaseClosed());
|
|
1106
|
+
w.open().catch(Q);
|
|
1107
1107
|
}
|
|
1108
|
-
return
|
|
1109
|
-
return y(
|
|
1108
|
+
return w._state.dbReadyPromise.then(function() {
|
|
1109
|
+
return y(w, f, O, m);
|
|
1110
1110
|
});
|
|
1111
1111
|
}(this.db, e, [this.name], u);
|
|
1112
1112
|
return i && (g._consoleTask = i, g = g.catch(function(y) {
|
|
@@ -1150,14 +1150,14 @@ function Ma() {
|
|
|
1150
1150
|
return H(d, g) === 0;
|
|
1151
1151
|
}
|
|
1152
1152
|
var u = n.reduce(function(f, g) {
|
|
1153
|
-
var y = f[0],
|
|
1154
|
-
return [y || f, y || !f ? Ue(
|
|
1155
|
-
return
|
|
1153
|
+
var y = f[0], w = f[1], f = a[g], O = e[g];
|
|
1154
|
+
return [y || f, y || !f ? Ue(w, f && f.multi ? function(m) {
|
|
1155
|
+
return m = ve(m, g), K(m) && m.some(function(v) {
|
|
1156
1156
|
return s(O, v);
|
|
1157
1157
|
});
|
|
1158
|
-
} : function(
|
|
1159
|
-
return s(O, ve(
|
|
1160
|
-
}) :
|
|
1158
|
+
} : function(m) {
|
|
1159
|
+
return s(O, ve(m, g));
|
|
1160
|
+
}) : w];
|
|
1161
1161
|
}, [null, null]), i = u[0], u = u[1];
|
|
1162
1162
|
return i ? this.where(i.name).equals(e[i.keyPath]).filter(u) : r ? this.filter(u) : this.where(n).equals("");
|
|
1163
1163
|
}, J.prototype.filter = function(e) {
|
|
@@ -1185,10 +1185,10 @@ function Ma() {
|
|
|
1185
1185
|
}
|
|
1186
1186
|
(this.schema.mappedClass = e).prototype instanceof cr && (function(g, y) {
|
|
1187
1187
|
if (typeof y != "function" && y !== null) throw new TypeError("Class extends value " + String(y) + " is not a constructor or null");
|
|
1188
|
-
function
|
|
1188
|
+
function w() {
|
|
1189
1189
|
this.constructor = g;
|
|
1190
1190
|
}
|
|
1191
|
-
o(g, y), g.prototype = y === null ? Object.create(y) : (
|
|
1191
|
+
o(g, y), g.prototype = y === null ? Object.create(y) : (w.prototype = y.prototype, new w());
|
|
1192
1192
|
}(s, n = e), Object.defineProperty(s.prototype, "db", { get: function() {
|
|
1193
1193
|
return r;
|
|
1194
1194
|
}, enumerable: !1, configurable: !0 }), s.prototype.table = function() {
|
|
@@ -1199,12 +1199,12 @@ function Ma() {
|
|
|
1199
1199
|
});
|
|
1200
1200
|
function d(g) {
|
|
1201
1201
|
if (!g) return g;
|
|
1202
|
-
var y,
|
|
1202
|
+
var y, w = Object.create(e.prototype);
|
|
1203
1203
|
for (y in g) if (!i.has(y)) try {
|
|
1204
|
-
|
|
1204
|
+
w[y] = g[y];
|
|
1205
1205
|
} catch {
|
|
1206
1206
|
}
|
|
1207
|
-
return
|
|
1207
|
+
return w;
|
|
1208
1208
|
}
|
|
1209
1209
|
return this.schema.readHook && this.hook.reading.unsubscribe(this.schema.readHook), this.schema.readHook = d, this.hook("reading", d), e;
|
|
1210
1210
|
}, J.prototype.defineClass = function() {
|
|
@@ -1270,8 +1270,8 @@ function Ma() {
|
|
|
1270
1270
|
if (s && s.length !== e.length) throw new L.InvalidArgument("Arguments objects and keys must have the same length");
|
|
1271
1271
|
var g = e.length, y = y && d ? e.map(Mt(y)) : e;
|
|
1272
1272
|
return a.core.mutate({ trans: u, type: "add", keys: s, values: y, wantResults: i }).then(function(v) {
|
|
1273
|
-
var f = v.numFailures, O = v.results,
|
|
1274
|
-
if (f === 0) return i ? O :
|
|
1273
|
+
var f = v.numFailures, O = v.results, m = v.lastResult, v = v.failures;
|
|
1274
|
+
if (f === 0) return i ? O : m;
|
|
1275
1275
|
throw new Je("".concat(a.name, ".bulkAdd(): ").concat(f, " of ").concat(g, " operations failed"), v);
|
|
1276
1276
|
});
|
|
1277
1277
|
});
|
|
@@ -1283,8 +1283,8 @@ function Ma() {
|
|
|
1283
1283
|
if (s && s.length !== e.length) throw new L.InvalidArgument("Arguments objects and keys must have the same length");
|
|
1284
1284
|
var g = e.length, y = y && d ? e.map(Mt(y)) : e;
|
|
1285
1285
|
return a.core.mutate({ trans: u, type: "put", keys: s, values: y, wantResults: i }).then(function(v) {
|
|
1286
|
-
var f = v.numFailures, O = v.results,
|
|
1287
|
-
if (f === 0) return i ? O :
|
|
1286
|
+
var f = v.numFailures, O = v.results, m = v.lastResult, v = v.failures;
|
|
1287
|
+
if (f === 0) return i ? O : m;
|
|
1288
1288
|
throw new Je("".concat(a.name, ".bulkPut(): ").concat(f, " of ").concat(g, " operations failed"), v);
|
|
1289
1289
|
});
|
|
1290
1290
|
});
|
|
@@ -1298,26 +1298,26 @@ function Ma() {
|
|
|
1298
1298
|
return r.getMany({ trans: u, keys: a, cache: "clone" }).then(function(d) {
|
|
1299
1299
|
var g = [], y = [];
|
|
1300
1300
|
e.forEach(function(f, O) {
|
|
1301
|
-
var
|
|
1301
|
+
var m = f.key, v = f.changes, S = d[O];
|
|
1302
1302
|
if (S) {
|
|
1303
1303
|
for (var b = 0, A = Object.keys(v); b < A.length; b++) {
|
|
1304
1304
|
var P = A[b], D = v[P];
|
|
1305
1305
|
if (P === n.schema.primKey.keyPath) {
|
|
1306
|
-
if (H(D,
|
|
1306
|
+
if (H(D, m) !== 0) throw new L.Constraint("Cannot update primary key in bulkUpdate()");
|
|
1307
1307
|
} else ue(S, P, D);
|
|
1308
1308
|
}
|
|
1309
|
-
i.push(O), g.push(
|
|
1309
|
+
i.push(O), g.push(m), y.push(S);
|
|
1310
1310
|
}
|
|
1311
1311
|
});
|
|
1312
|
-
var
|
|
1312
|
+
var w = g.length;
|
|
1313
1313
|
return r.mutate({ trans: u, type: "put", keys: g, values: y, updates: { keys: a, changeSpecs: s } }).then(function(f) {
|
|
1314
|
-
var O = f.numFailures,
|
|
1315
|
-
if (O === 0) return
|
|
1316
|
-
for (var v = 0, S = Object.keys(
|
|
1314
|
+
var O = f.numFailures, m = f.failures;
|
|
1315
|
+
if (O === 0) return w;
|
|
1316
|
+
for (var v = 0, S = Object.keys(m); v < S.length; v++) {
|
|
1317
1317
|
var b, A = S[v], P = i[Number(A)];
|
|
1318
|
-
P != null && (b =
|
|
1318
|
+
P != null && (b = m[A], delete m[A], m[P] = b);
|
|
1319
1319
|
}
|
|
1320
|
-
throw new Je("".concat(n.name, ".bulkUpdate(): ").concat(O, " of ").concat(
|
|
1320
|
+
throw new Je("".concat(n.name, ".bulkUpdate(): ").concat(O, " of ").concat(w, " operations failed"), m);
|
|
1321
1321
|
});
|
|
1322
1322
|
});
|
|
1323
1323
|
});
|
|
@@ -1349,23 +1349,23 @@ function Ma() {
|
|
|
1349
1349
|
if (typeof u != "object") {
|
|
1350
1350
|
var y;
|
|
1351
1351
|
d = d || ea;
|
|
1352
|
-
var
|
|
1353
|
-
|
|
1352
|
+
var w = { subscribers: [], fire: g = g || Q, subscribe: function(f) {
|
|
1353
|
+
w.subscribers.indexOf(f) === -1 && (w.subscribers.push(f), w.fire = d(w.fire, f));
|
|
1354
1354
|
}, unsubscribe: function(f) {
|
|
1355
|
-
|
|
1355
|
+
w.subscribers = w.subscribers.filter(function(O) {
|
|
1356
1356
|
return O !== f;
|
|
1357
|
-
}),
|
|
1357
|
+
}), w.fire = w.subscribers.reduce(d, g);
|
|
1358
1358
|
} };
|
|
1359
|
-
return r[u] = n[u] =
|
|
1359
|
+
return r[u] = n[u] = w;
|
|
1360
1360
|
}
|
|
1361
1361
|
C(y = u).forEach(function(f) {
|
|
1362
1362
|
var O = y[f];
|
|
1363
1363
|
if (K(O)) i(f, y[f][0], y[f][1]);
|
|
1364
1364
|
else {
|
|
1365
1365
|
if (O !== "asap") throw new L.InvalidArgument("Invalid event config");
|
|
1366
|
-
var
|
|
1366
|
+
var m = i(f, ct, function() {
|
|
1367
1367
|
for (var v = arguments.length, S = new Array(v); v--; ) S[v] = arguments[v];
|
|
1368
|
-
|
|
1368
|
+
m.subscribers.forEach(function(b) {
|
|
1369
1369
|
Yn(function() {
|
|
1370
1370
|
b.apply(null, S);
|
|
1371
1371
|
});
|
|
@@ -1404,12 +1404,12 @@ function Ma() {
|
|
|
1404
1404
|
var s = e.replayFilter ? Ue(e.filter, e.replayFilter()) : e.filter;
|
|
1405
1405
|
if (e.or) {
|
|
1406
1406
|
var i = {}, u = function(d, g, y) {
|
|
1407
|
-
var
|
|
1407
|
+
var w, f;
|
|
1408
1408
|
s && !s(g, y, function(O) {
|
|
1409
1409
|
return g.stop(O);
|
|
1410
1410
|
}, function(O) {
|
|
1411
1411
|
return g.fail(O);
|
|
1412
|
-
}) || ((f = "" + (
|
|
1412
|
+
}) || ((f = "" + (w = g.primaryKey)) == "[object ArrayBuffer]" && (f = "" + new Uint8Array(w)), ie(i, f) || (i[f] = !0, n(d, g, y)));
|
|
1413
1413
|
};
|
|
1414
1414
|
return Promise.all([e.or._iterate(u, r), hr(fr(e, a, r), e.algorithm, u, !e.keysOnly && e.valueMapper)]);
|
|
1415
1415
|
}
|
|
@@ -1440,7 +1440,7 @@ function Ma() {
|
|
|
1440
1440
|
var n = this["@@propmod"];
|
|
1441
1441
|
if (n.add !== void 0) {
|
|
1442
1442
|
var r = n.add;
|
|
1443
|
-
if (K(r)) return
|
|
1443
|
+
if (K(r)) return p(p([], K(e) ? e : [], !0), r).sort();
|
|
1444
1444
|
if (typeof r == "number") return (Number(e) || 0) + r;
|
|
1445
1445
|
if (typeof r == "bigint") try {
|
|
1446
1446
|
return BigInt(e) + r;
|
|
@@ -1639,20 +1639,20 @@ function Ma() {
|
|
|
1639
1639
|
}
|
|
1640
1640
|
return A;
|
|
1641
1641
|
});
|
|
1642
|
-
var d = r.table.core, f = d.schema.primaryKey, g = f.outbound, y = f.extractKey,
|
|
1643
|
-
f && (
|
|
1642
|
+
var d = r.table.core, f = d.schema.primaryKey, g = f.outbound, y = f.extractKey, w = 200, f = n.db._options.modifyChunkSize;
|
|
1643
|
+
f && (w = typeof f == "object" ? f[d.name] || f["*"] || 200 : f);
|
|
1644
1644
|
function O(b, D) {
|
|
1645
1645
|
var P = D.failures, D = D.numFailures;
|
|
1646
1646
|
v += b - D;
|
|
1647
1647
|
for (var I = 0, N = C(P); I < N.length; I++) {
|
|
1648
1648
|
var k = N[I];
|
|
1649
|
-
|
|
1649
|
+
m.push(P[k]);
|
|
1650
1650
|
}
|
|
1651
1651
|
}
|
|
1652
|
-
var
|
|
1652
|
+
var m = [], v = 0, S = [];
|
|
1653
1653
|
return n.clone().primaryKeys().then(function(b) {
|
|
1654
1654
|
function A(D) {
|
|
1655
|
-
var I = Math.min(
|
|
1655
|
+
var I = Math.min(w, b.length - D);
|
|
1656
1656
|
return d.getMany({ trans: a, keys: b.slice(D, D + I), cache: "immutable" }).then(function(N) {
|
|
1657
1657
|
for (var k = [], R = [], T = g ? [] : null, $ = [], x = 0; x < I; ++x) {
|
|
1658
1658
|
var M = N[x], F = { value: $e(M), primKey: b[D + x] };
|
|
@@ -1670,13 +1670,13 @@ function Ma() {
|
|
|
1670
1670
|
return O($.length, U);
|
|
1671
1671
|
});
|
|
1672
1672
|
}).then(function() {
|
|
1673
|
-
return b.length > D + I && A(D +
|
|
1673
|
+
return b.length > D + I && A(D + w);
|
|
1674
1674
|
});
|
|
1675
1675
|
});
|
|
1676
1676
|
}
|
|
1677
1677
|
var P = nt(r) && r.limit === 1 / 0 && (typeof e != "function" || e === En) && { index: r.index, range: r.range };
|
|
1678
1678
|
return A(0).then(function() {
|
|
1679
|
-
if (0 <
|
|
1679
|
+
if (0 < m.length) throw new Pt("Error modifying one or more objects", m, v, S);
|
|
1680
1680
|
return b.length;
|
|
1681
1681
|
});
|
|
1682
1682
|
});
|
|
@@ -1716,7 +1716,7 @@ function Ma() {
|
|
|
1716
1716
|
}).limit(0);
|
|
1717
1717
|
}
|
|
1718
1718
|
function Bt(e, n, r, a) {
|
|
1719
|
-
var s, i, u, d, g, y,
|
|
1719
|
+
var s, i, u, d, g, y, w, f = r.length;
|
|
1720
1720
|
if (!r.every(function(v) {
|
|
1721
1721
|
return typeof v == "string";
|
|
1722
1722
|
})) return le(e, or);
|
|
@@ -1739,20 +1739,20 @@ function Ma() {
|
|
|
1739
1739
|
return b.upper;
|
|
1740
1740
|
}), g = S.map(function(b) {
|
|
1741
1741
|
return b.lower;
|
|
1742
|
-
}),
|
|
1742
|
+
}), w = (y = v) === "next" ? "" : a;
|
|
1743
1743
|
}
|
|
1744
1744
|
O("next"), e = new e.Collection(e, function() {
|
|
1745
1745
|
return Re(d[0], g[f - 1] + a);
|
|
1746
1746
|
}), e._ondirectionchange = function(v) {
|
|
1747
1747
|
O(v);
|
|
1748
1748
|
};
|
|
1749
|
-
var
|
|
1749
|
+
var m = 0;
|
|
1750
1750
|
return e._addAlgorithm(function(v, S, b) {
|
|
1751
1751
|
var A = v.key;
|
|
1752
1752
|
if (typeof A != "string") return !1;
|
|
1753
1753
|
var P = i(A);
|
|
1754
|
-
if (n(P, g,
|
|
1755
|
-
for (var D = null, I =
|
|
1754
|
+
if (n(P, g, m)) return !0;
|
|
1755
|
+
for (var D = null, I = m; I < f; ++I) {
|
|
1756
1756
|
var N = function(k, R, T, $, x, M) {
|
|
1757
1757
|
for (var F = Math.min(k.length, $.length), U = -1, z = 0; z < F; ++z) {
|
|
1758
1758
|
var de = R[z];
|
|
@@ -1761,10 +1761,10 @@ function Ma() {
|
|
|
1761
1761
|
}
|
|
1762
1762
|
return F < $.length && M === "next" ? k + T.substr(k.length) : F < k.length && M === "prev" ? k.substr(0, T.length) : U < 0 ? null : k.substr(0, U) + $[U] + T.substr(U + 1);
|
|
1763
1763
|
}(A, P, d[I], g[I], u, y);
|
|
1764
|
-
N === null && D === null ?
|
|
1764
|
+
N === null && D === null ? m = I + 1 : (D === null || 0 < u(D, N)) && (D = N);
|
|
1765
1765
|
}
|
|
1766
1766
|
return S(D !== null ? function() {
|
|
1767
|
-
v.continue(D +
|
|
1767
|
+
v.continue(D + w);
|
|
1768
1768
|
} : b), !1;
|
|
1769
1769
|
}), e;
|
|
1770
1770
|
}
|
|
@@ -1868,12 +1868,12 @@ function Ma() {
|
|
|
1868
1868
|
if (!A.every(function(P) {
|
|
1869
1869
|
return P[0] !== void 0 && P[1] !== void 0 && s(P[0], P[1]) <= 0;
|
|
1870
1870
|
})) return le(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", L.InvalidArgument);
|
|
1871
|
-
var g = !n || n.includeLowers !== !1, y = n && n.includeUppers === !0,
|
|
1871
|
+
var g = !n || n.includeLowers !== !1, y = n && n.includeUppers === !0, w, f = s;
|
|
1872
1872
|
function O(P, D) {
|
|
1873
1873
|
return f(P[0], D[0]);
|
|
1874
1874
|
}
|
|
1875
1875
|
try {
|
|
1876
|
-
(
|
|
1876
|
+
(w = A.reduce(function(P, D) {
|
|
1877
1877
|
for (var I = 0, N = P.length; I < N; ++I) {
|
|
1878
1878
|
var k = P[I];
|
|
1879
1879
|
if (a(D[0], k[1]) < 0 && 0 < a(D[1], k[0])) {
|
|
@@ -1886,23 +1886,23 @@ function Ma() {
|
|
|
1886
1886
|
} catch {
|
|
1887
1887
|
return le(this, we);
|
|
1888
1888
|
}
|
|
1889
|
-
var
|
|
1890
|
-
return 0 < s(P,
|
|
1889
|
+
var m = 0, v = y ? function(P) {
|
|
1890
|
+
return 0 < s(P, w[m][1]);
|
|
1891
1891
|
} : function(P) {
|
|
1892
|
-
return 0 <= s(P,
|
|
1892
|
+
return 0 <= s(P, w[m][1]);
|
|
1893
1893
|
}, S = g ? function(P) {
|
|
1894
|
-
return 0 < i(P,
|
|
1894
|
+
return 0 < i(P, w[m][0]);
|
|
1895
1895
|
} : function(P) {
|
|
1896
|
-
return 0 <= i(P,
|
|
1896
|
+
return 0 <= i(P, w[m][0]);
|
|
1897
1897
|
}, b = v, A = new this.Collection(this, function() {
|
|
1898
|
-
return Re(
|
|
1898
|
+
return Re(w[0][0], w[w.length - 1][1], !g, !y);
|
|
1899
1899
|
});
|
|
1900
1900
|
return A._ondirectionchange = function(P) {
|
|
1901
|
-
f = P === "next" ? (b = v, s) : (b = S, i),
|
|
1901
|
+
f = P === "next" ? (b = v, s) : (b = S, i), w.sort(O);
|
|
1902
1902
|
}, A._addAlgorithm(function(P, D, I) {
|
|
1903
|
-
for (var N, k = P.key; b(k); ) if (++
|
|
1904
|
-
return !v(N = k) && !S(N) || (r._cmp(k,
|
|
1905
|
-
f === s ? P.continue(
|
|
1903
|
+
for (var N, k = P.key; b(k); ) if (++m === w.length) return D(I), !1;
|
|
1904
|
+
return !v(N = k) && !S(N) || (r._cmp(k, w[m][1]) === 0 || r._cmp(k, w[m][0]) === 0 || D(function() {
|
|
1905
|
+
f === s ? P.continue(w[m][0]) : P.continue(w[m][1]);
|
|
1906
1906
|
}), !1);
|
|
1907
1907
|
}), A;
|
|
1908
1908
|
}, re.prototype.startsWithAnyOf = function() {
|
|
@@ -2058,11 +2058,11 @@ function Ma() {
|
|
|
2058
2058
|
function a(b) {
|
|
2059
2059
|
if (b.type === 3) return null;
|
|
2060
2060
|
if (b.type === 4) throw new Error("Cannot convert never type to IDBKeyRange");
|
|
2061
|
-
var
|
|
2062
|
-
return
|
|
2061
|
+
var m = b.lower, v = b.upper, S = b.lowerOpen, b = b.upperOpen;
|
|
2062
|
+
return m === void 0 ? v === void 0 ? null : n.upperBound(v, !!b) : v === void 0 ? n.lowerBound(m, !!S) : n.bound(m, v, !!S, !!b);
|
|
2063
2063
|
}
|
|
2064
2064
|
function s(O) {
|
|
2065
|
-
var
|
|
2065
|
+
var m, v = O.name;
|
|
2066
2066
|
return { name: v, schema: O, mutate: function(S) {
|
|
2067
2067
|
var b = S.trans, A = S.type, P = S.keys, D = S.values, I = S.range;
|
|
2068
2068
|
return new Promise(function(N, k) {
|
|
@@ -2113,12 +2113,12 @@ function Ma() {
|
|
|
2113
2113
|
return P(N.target.result);
|
|
2114
2114
|
}, I.onerror = me(D);
|
|
2115
2115
|
});
|
|
2116
|
-
}, query: (
|
|
2116
|
+
}, query: (m = y, function(S) {
|
|
2117
2117
|
return new Promise(function(b, A) {
|
|
2118
2118
|
b = Z(b);
|
|
2119
2119
|
var P, D, I, T = S.trans, N = S.values, k = S.limit, x = S.query, R = k === 1 / 0 ? void 0 : k, $ = x.index, x = x.range, T = T.objectStore(v), $ = $.isPrimaryKey ? T : T.index($.name), x = a(x);
|
|
2120
2120
|
if (k === 0) return b({ result: [] });
|
|
2121
|
-
|
|
2121
|
+
m ? ((R = N ? $.getAll(x, R) : $.getAllKeys(x, R)).onsuccess = function(M) {
|
|
2122
2122
|
return b({ result: M.target.result });
|
|
2123
2123
|
}, R.onerror = me(A)) : (P = 0, D = !N && "openKeyCursor" in $ ? $.openKeyCursor(x) : $.openCursor(x), I = [], D.onsuccess = function(M) {
|
|
2124
2124
|
var F = D.result;
|
|
@@ -2175,10 +2175,10 @@ function Ma() {
|
|
|
2175
2175
|
});
|
|
2176
2176
|
} };
|
|
2177
2177
|
}
|
|
2178
|
-
var i, u, d,
|
|
2178
|
+
var i, u, d, w = (u = g, d = br((i = e).objectStoreNames), { schema: { name: i.name, tables: d.map(function(O) {
|
|
2179
2179
|
return u.objectStore(O);
|
|
2180
2180
|
}).map(function(O) {
|
|
2181
|
-
var
|
|
2181
|
+
var m = O.keyPath, b = O.autoIncrement, v = K(m), S = {}, b = { name: O.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: m == null, compound: v, keyPath: m, autoIncrement: b, unique: !0, extractKey: _n(m) }, indexes: br(O.indexNames).map(function(A) {
|
|
2182
2182
|
return O.index(A);
|
|
2183
2183
|
}).map(function(I) {
|
|
2184
2184
|
var P = I.name, D = I.unique, N = I.multiEntry, I = I.keyPath, N = { name: P, compound: K(I), keyPath: I, unique: D, multiEntry: N, extractKey: _n(I) };
|
|
@@ -2186,9 +2186,9 @@ function Ma() {
|
|
|
2186
2186
|
}), getIndexByKeyPath: function(A) {
|
|
2187
2187
|
return S[vt(A)];
|
|
2188
2188
|
} };
|
|
2189
|
-
return S[":id"] = b.primaryKey,
|
|
2190
|
-
}) }, hasGetAll: 0 < d.length && "getAll" in u.objectStore(d[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }), g =
|
|
2191
|
-
return
|
|
2189
|
+
return S[":id"] = b.primaryKey, m != null && (S[vt(m)] = b.primaryKey), b;
|
|
2190
|
+
}) }, hasGetAll: 0 < d.length && "getAll" in u.objectStore(d[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }), g = w.schema, y = w.hasGetAll, w = g.tables.map(s), f = {};
|
|
2191
|
+
return w.forEach(function(O) {
|
|
2192
2192
|
return f[O.name] = O;
|
|
2193
2193
|
}), { stack: "dbcore", transaction: e.transaction.bind(e), table: function(O) {
|
|
2194
2194
|
if (!f[O]) throw new Error("Table '".concat(O, "' not found"));
|
|
@@ -2214,8 +2214,8 @@ function Ma() {
|
|
|
2214
2214
|
r.forEach(function(s) {
|
|
2215
2215
|
var i = a[s];
|
|
2216
2216
|
n.forEach(function(u) {
|
|
2217
|
-
var d = function g(y,
|
|
2218
|
-
return Fr(y,
|
|
2217
|
+
var d = function g(y, w) {
|
|
2218
|
+
return Fr(y, w) || (y = ge(y)) && g(y, w);
|
|
2219
2219
|
}(u, s);
|
|
2220
2220
|
(!d || "value" in d && d.value === void 0) && (u === e.Transaction.prototype || u instanceof e.Transaction ? Ae(u, s, { get: function() {
|
|
2221
2221
|
return this.table(s);
|
|
@@ -2240,12 +2240,12 @@ function Ma() {
|
|
|
2240
2240
|
i.create(r), i._completion.catch(a);
|
|
2241
2241
|
var u = i._reject.bind(i), d = B.transless || B;
|
|
2242
2242
|
De(function() {
|
|
2243
|
-
return B.trans = i, B.transless = d, n !== 0 ? (Lt(e, r), y = n, ((g = i).storeNames.includes("$meta") ? g.table("$meta").get("version").then(function(
|
|
2244
|
-
return
|
|
2245
|
-
}) : j.resolve(y)).then(function(
|
|
2246
|
-
return O =
|
|
2243
|
+
return B.trans = i, B.transless = d, n !== 0 ? (Lt(e, r), y = n, ((g = i).storeNames.includes("$meta") ? g.table("$meta").get("version").then(function(w) {
|
|
2244
|
+
return w ?? y;
|
|
2245
|
+
}) : j.resolve(y)).then(function(w) {
|
|
2246
|
+
return O = w, m = i, v = r, S = [], w = (f = e)._versions, b = f._dbSchema = Ut(0, f.idbdb, v), (w = w.filter(function(A) {
|
|
2247
2247
|
return A._cfg.version >= O;
|
|
2248
|
-
})).length !== 0 ? (
|
|
2248
|
+
})).length !== 0 ? (w.forEach(function(A) {
|
|
2249
2249
|
S.push(function() {
|
|
2250
2250
|
var P = b, D = A._cfg.dbschema;
|
|
2251
2251
|
zt(f, P, v), zt(f, D, v), b = f._dbSchema = D;
|
|
@@ -2265,15 +2265,15 @@ function Ma() {
|
|
|
2265
2265
|
});
|
|
2266
2266
|
var N = A._cfg.contentUpgrade;
|
|
2267
2267
|
if (N && A._cfg.version > O) {
|
|
2268
|
-
Lt(f, v),
|
|
2268
|
+
Lt(f, v), m._memoizedTables = {};
|
|
2269
2269
|
var k = Qn(D);
|
|
2270
2270
|
I.del.forEach(function($) {
|
|
2271
2271
|
k[$] = P[$];
|
|
2272
|
-
}), An(f, [f.Transaction.prototype]), Wt(f, [f.Transaction.prototype], C(k), k),
|
|
2272
|
+
}), An(f, [f.Transaction.prototype]), Wt(f, [f.Transaction.prototype], C(k), k), m.schema = k;
|
|
2273
2273
|
var R, T = an(N);
|
|
2274
2274
|
return T && et(), I = j.follow(function() {
|
|
2275
2275
|
var $;
|
|
2276
|
-
(R = N(
|
|
2276
|
+
(R = N(m)) && T && ($ = Ie.bind(null, null), R.then($, $));
|
|
2277
2277
|
}), R && typeof R.then == "function" ? j.resolve(R) : I.then(function() {
|
|
2278
2278
|
return R;
|
|
2279
2279
|
});
|
|
@@ -2282,20 +2282,20 @@ function Ma() {
|
|
|
2282
2282
|
var D, I, N = A._cfg.dbschema;
|
|
2283
2283
|
D = N, I = P, [].slice.call(I.db.objectStoreNames).forEach(function(k) {
|
|
2284
2284
|
return D[k] == null && I.db.deleteObjectStore(k);
|
|
2285
|
-
}), An(f, [f.Transaction.prototype]), Wt(f, [f.Transaction.prototype], f._storeNames, f._dbSchema),
|
|
2285
|
+
}), An(f, [f.Transaction.prototype]), Wt(f, [f.Transaction.prototype], f._storeNames, f._dbSchema), m.schema = f._dbSchema;
|
|
2286
2286
|
}), S.push(function(P) {
|
|
2287
2287
|
f.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(f.idbdb.version / 10) === A._cfg.version ? (f.idbdb.deleteObjectStore("$meta"), delete f._dbSchema.$meta, f._storeNames = f._storeNames.filter(function(D) {
|
|
2288
2288
|
return D !== "$meta";
|
|
2289
2289
|
})) : P.objectStore("$meta").put(A._cfg.version, "version"));
|
|
2290
2290
|
});
|
|
2291
2291
|
}), function A() {
|
|
2292
|
-
return S.length ? j.resolve(S.shift()(
|
|
2292
|
+
return S.length ? j.resolve(S.shift()(m.idbtrans)).then(A) : j.resolve();
|
|
2293
2293
|
}().then(function() {
|
|
2294
2294
|
vr(b, v);
|
|
2295
2295
|
})) : j.resolve();
|
|
2296
|
-
var f, O,
|
|
2297
|
-
}).catch(u)) : (C(s).forEach(function(
|
|
2298
|
-
Dn(r,
|
|
2296
|
+
var f, O, m, v, S, b;
|
|
2297
|
+
}).catch(u)) : (C(s).forEach(function(w) {
|
|
2298
|
+
Dn(r, w, s[w].primKey, s[w].indexes);
|
|
2299
2299
|
}), Lt(e, r), void j.follow(function() {
|
|
2300
2300
|
return e.on.populate.fire(i);
|
|
2301
2301
|
}).catch(u));
|
|
@@ -2329,8 +2329,8 @@ function Ma() {
|
|
|
2329
2329
|
var d = s.idxByName, g = i.idxByName, y = void 0;
|
|
2330
2330
|
for (y in d) g[y] || u.del.push(y);
|
|
2331
2331
|
for (y in g) {
|
|
2332
|
-
var
|
|
2333
|
-
|
|
2332
|
+
var w = d[y], f = g[y];
|
|
2333
|
+
w ? w.src !== f.src && u.change.push(f) : u.add.push(f);
|
|
2334
2334
|
}
|
|
2335
2335
|
(0 < u.del.length || 0 < u.add.length || 0 < u.change.length) && a.change.push(u);
|
|
2336
2336
|
}
|
|
@@ -2356,8 +2356,8 @@ function Ma() {
|
|
|
2356
2356
|
var a = {};
|
|
2357
2357
|
return At(n.objectStoreNames, 0).forEach(function(s) {
|
|
2358
2358
|
for (var i = r.objectStore(s), u = Sn(yr(y = i.keyPath), y || "", !0, !1, !!i.autoIncrement, y && typeof y != "string", !0), d = [], g = 0; g < i.indexNames.length; ++g) {
|
|
2359
|
-
var
|
|
2360
|
-
d.push(
|
|
2359
|
+
var w = i.index(i.indexNames[g]), y = w.keyPath, w = Sn(w.name, y, !!w.unique, !!w.multiEntry, !1, y && typeof y != "string", !1);
|
|
2360
|
+
d.push(w);
|
|
2361
2361
|
}
|
|
2362
2362
|
a[s] = On(s, u, d);
|
|
2363
2363
|
}), a;
|
|
@@ -2367,11 +2367,11 @@ function Ma() {
|
|
|
2367
2367
|
var i = a[s], u = r.objectStore(i);
|
|
2368
2368
|
e._hasGetAll = "getAll" in u;
|
|
2369
2369
|
for (var d = 0; d < u.indexNames.length; ++d) {
|
|
2370
|
-
var g = u.indexNames[d], y = u.index(g).keyPath,
|
|
2371
|
-
!n[i] || (y = n[i].idxByName[
|
|
2370
|
+
var g = u.indexNames[d], y = u.index(g).keyPath, w = typeof y == "string" ? y : "[" + At(y).join("+") + "]";
|
|
2371
|
+
!n[i] || (y = n[i].idxByName[w]) && (y.name = g, delete n[i].idxByName[w], n[i].idxByName[g] = y);
|
|
2372
2372
|
}
|
|
2373
2373
|
}
|
|
2374
|
-
typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) &&
|
|
2374
|
+
typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && E.WorkerGlobalScope && E instanceof E.WorkerGlobalScope && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604 && (e._hasGetAll = !1);
|
|
2375
2375
|
}
|
|
2376
2376
|
function Er(e) {
|
|
2377
2377
|
return e.split(",").map(function(n, r) {
|
|
@@ -2527,16 +2527,16 @@ function Ma() {
|
|
|
2527
2527
|
}
|
|
2528
2528
|
function _r(e, n, r, a) {
|
|
2529
2529
|
for (var s = [], i = 0, u = Object.entries(e.queries.query); i < u.length; i++) {
|
|
2530
|
-
for (var d = u[i], g = d[0], y = [],
|
|
2531
|
-
var O = f[
|
|
2530
|
+
for (var d = u[i], g = d[0], y = [], w = 0, f = d[1]; w < f.length; w++) {
|
|
2531
|
+
var O = f[w];
|
|
2532
2532
|
xn(n, O.obsSet) ? O.subscribers.forEach(function(b) {
|
|
2533
2533
|
return r.add(b);
|
|
2534
2534
|
}) : a && y.push(O);
|
|
2535
2535
|
}
|
|
2536
2536
|
a && s.push([g, y]);
|
|
2537
2537
|
}
|
|
2538
|
-
if (a) for (var
|
|
2539
|
-
var S = v[
|
|
2538
|
+
if (a) for (var m = 0, v = s; m < v.length; m++) {
|
|
2539
|
+
var S = v[m], g = S[0], y = S[1];
|
|
2540
2540
|
e.queries.query[g] = y;
|
|
2541
2541
|
}
|
|
2542
2542
|
}
|
|
@@ -2551,17 +2551,17 @@ function Ma() {
|
|
|
2551
2551
|
if (n.openCanceller !== a) throw new L.DatabaseClosed("db.open() was cancelled");
|
|
2552
2552
|
}
|
|
2553
2553
|
function d() {
|
|
2554
|
-
return new j(function(O,
|
|
2554
|
+
return new j(function(O, m) {
|
|
2555
2555
|
if (u(), !r) throw new L.MissingAPI();
|
|
2556
2556
|
var v = e.name, S = n.autoSchema || !s ? r.open(v) : r.open(v, s);
|
|
2557
2557
|
if (!S) throw new L.MissingAPI();
|
|
2558
|
-
S.onerror = me(
|
|
2558
|
+
S.onerror = me(m), S.onblocked = Z(e._fireOnBlocked), S.onupgradeneeded = Z(function(b) {
|
|
2559
2559
|
var A;
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
})) : (
|
|
2563
|
-
},
|
|
2564
|
-
|
|
2560
|
+
w = S.transaction, n.autoSchema && !e._options.allowEmptyDB ? (S.onerror = mt, w.abort(), S.result.close(), (A = r.deleteDatabase(v)).onsuccess = A.onerror = Z(function() {
|
|
2561
|
+
m(new L.NoSuchDatabase("Database ".concat(v, " doesnt exist")));
|
|
2562
|
+
})) : (w.onerror = me(m), b = b.oldVersion > Math.pow(2, 62) ? 0 : b.oldVersion, f = b < 1, e.idbdb = S.result, i && pa(e, w), ga(e, b / 10, w, m));
|
|
2563
|
+
}, m), S.onsuccess = Z(function() {
|
|
2564
|
+
w = null;
|
|
2565
2565
|
var b, A, P, D, I, N = e.idbdb = S.result, k = At(N.objectStoreNames);
|
|
2566
2566
|
if (0 < k.length) try {
|
|
2567
2567
|
var R = N.transaction((D = k).length === 1 ? D[0] : D, "readonly");
|
|
@@ -2577,7 +2577,7 @@ function Ma() {
|
|
|
2577
2577
|
}), N.onclose = Z(function(T) {
|
|
2578
2578
|
e.on("close").fire(T);
|
|
2579
2579
|
}), f && (I = e._deps, R = v, N = I.indexedDB, I = I.IDBKeyRange, Nn(N) || R === jt || In(N, I).put({ name: R }).catch(Q)), O();
|
|
2580
|
-
},
|
|
2580
|
+
}, m);
|
|
2581
2581
|
}).catch(function(O) {
|
|
2582
2582
|
switch (O?.name) {
|
|
2583
2583
|
case "UnknownError":
|
|
@@ -2589,12 +2589,12 @@ function Ma() {
|
|
|
2589
2589
|
return j.reject(O);
|
|
2590
2590
|
});
|
|
2591
2591
|
}
|
|
2592
|
-
var g, y = n.dbReadyResolve,
|
|
2592
|
+
var g, y = n.dbReadyResolve, w = null, f = !1;
|
|
2593
2593
|
return j.race([a, (typeof navigator > "u" ? j.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(O) {
|
|
2594
|
-
function
|
|
2594
|
+
function m() {
|
|
2595
2595
|
return indexedDB.databases().finally(O);
|
|
2596
2596
|
}
|
|
2597
|
-
g = setInterval(
|
|
2597
|
+
g = setInterval(m, 100), m();
|
|
2598
2598
|
}).finally(function() {
|
|
2599
2599
|
return clearInterval(g);
|
|
2600
2600
|
}) : Promise.resolve()).then(d)]).then(function() {
|
|
@@ -2602,9 +2602,9 @@ function Ma() {
|
|
|
2602
2602
|
return e.on.ready.fire(e.vip);
|
|
2603
2603
|
})).then(function O() {
|
|
2604
2604
|
if (0 < n.onReadyBeingFired.length) {
|
|
2605
|
-
var
|
|
2605
|
+
var m = n.onReadyBeingFired.reduce(on, Q);
|
|
2606
2606
|
return n.onReadyBeingFired = [], j.resolve(Rn(function() {
|
|
2607
|
-
return
|
|
2607
|
+
return m(e.vip);
|
|
2608
2608
|
})).then(O);
|
|
2609
2609
|
}
|
|
2610
2610
|
});
|
|
@@ -2613,7 +2613,7 @@ function Ma() {
|
|
|
2613
2613
|
}).catch(function(O) {
|
|
2614
2614
|
n.dbOpenError = O;
|
|
2615
2615
|
try {
|
|
2616
|
-
|
|
2616
|
+
w && w.abort();
|
|
2617
2617
|
} catch {
|
|
2618
2618
|
}
|
|
2619
2619
|
return a === n.openCanceller && e._close(), q(O);
|
|
@@ -2621,10 +2621,10 @@ function Ma() {
|
|
|
2621
2621
|
n.openComplete = !0, y();
|
|
2622
2622
|
}).then(function() {
|
|
2623
2623
|
var O;
|
|
2624
|
-
return f && (O = {}, e.tables.forEach(function(
|
|
2625
|
-
|
|
2626
|
-
v.name && (O["idb://".concat(e.name, "/").concat(
|
|
2627
|
-
}), O["idb://".concat(e.name, "/").concat(
|
|
2624
|
+
return f && (O = {}, e.tables.forEach(function(m) {
|
|
2625
|
+
m.schema.indexes.forEach(function(v) {
|
|
2626
|
+
v.name && (O["idb://".concat(e.name, "/").concat(m.name, "/").concat(v.name)] = new ae(-1 / 0, [[[]]]));
|
|
2627
|
+
}), O["idb://".concat(e.name, "/").concat(m.name, "/")] = O["idb://".concat(e.name, "/").concat(m.name, "/:dels")] = new ae(-1 / 0, [[[]]]);
|
|
2628
2628
|
}), Te(yt).fire(O), $n(O, !0)), e;
|
|
2629
2629
|
});
|
|
2630
2630
|
}
|
|
@@ -2650,9 +2650,9 @@ function Ma() {
|
|
|
2650
2650
|
var ba = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(e) {
|
|
2651
2651
|
return l(l({}, e), { table: function(n) {
|
|
2652
2652
|
var r = e.table(n), a = r.schema, s = {}, i = [];
|
|
2653
|
-
function u(f, O,
|
|
2654
|
-
var v = vt(f), S = s[v] = s[v] || [], b = f == null ? 0 : typeof f == "string" ? 1 : f.length, A = 0 < O, A = l(l({},
|
|
2655
|
-
return S.push(A), A.isPrimaryKey || i.push(A), 1 < b && u(b === 2 ? f[0] : f.slice(0, b - 1), O + 1,
|
|
2653
|
+
function u(f, O, m) {
|
|
2654
|
+
var v = vt(f), S = s[v] = s[v] || [], b = f == null ? 0 : typeof f == "string" ? 1 : f.length, A = 0 < O, A = l(l({}, m), { name: A ? "".concat(v, "(virtual-from:").concat(m.name, ")") : m.name, lowLevelIndex: m, isVirtual: A, keyTail: O, keyLength: b, extractKey: _n(f), unique: !A && m.unique });
|
|
2655
|
+
return S.push(A), A.isPrimaryKey || i.push(A), 1 < b && u(b === 2 ? f[0] : f.slice(0, b - 1), O + 1, m), S.sort(function(P, D) {
|
|
2656
2656
|
return P.keyTail - D.keyTail;
|
|
2657
2657
|
}), A;
|
|
2658
2658
|
}
|
|
@@ -2661,26 +2661,26 @@ function Ma() {
|
|
|
2661
2661
|
var y = g[d];
|
|
2662
2662
|
u(y.keyPath, 0, y);
|
|
2663
2663
|
}
|
|
2664
|
-
function
|
|
2665
|
-
var O,
|
|
2666
|
-
return
|
|
2664
|
+
function w(f) {
|
|
2665
|
+
var O, m = f.query.index;
|
|
2666
|
+
return m.isVirtual ? l(l({}, f), { query: { index: m.lowLevelIndex, range: (O = f.query.range, m = m.keyTail, { type: O.type === 1 ? 2 : O.type, lower: Xt(O.lower, O.lowerOpen ? e.MAX_KEY : e.MIN_KEY, m), lowerOpen: !0, upper: Xt(O.upper, O.upperOpen ? e.MIN_KEY : e.MAX_KEY, m), upperOpen: !0 }) } }) : f;
|
|
2667
2667
|
}
|
|
2668
2668
|
return l(l({}, r), { schema: l(l({}, a), { primaryKey: n, indexes: i, getIndexByKeyPath: function(f) {
|
|
2669
2669
|
return (f = s[vt(f)]) && f[0];
|
|
2670
2670
|
} }), count: function(f) {
|
|
2671
|
-
return r.count(
|
|
2671
|
+
return r.count(w(f));
|
|
2672
2672
|
}, query: function(f) {
|
|
2673
|
-
return r.query(
|
|
2673
|
+
return r.query(w(f));
|
|
2674
2674
|
}, openCursor: function(f) {
|
|
2675
|
-
var O = f.query.index,
|
|
2676
|
-
return v ? r.openCursor(
|
|
2675
|
+
var O = f.query.index, m = O.keyTail, v = O.isVirtual, S = O.keyLength;
|
|
2676
|
+
return v ? r.openCursor(w(f)).then(function(A) {
|
|
2677
2677
|
return A && b(A);
|
|
2678
2678
|
}) : r.openCursor(f);
|
|
2679
2679
|
function b(A) {
|
|
2680
2680
|
return Object.create(A, { continue: { value: function(P) {
|
|
2681
|
-
P != null ? A.continue(Xt(P, f.reverse ? e.MAX_KEY : e.MIN_KEY,
|
|
2681
|
+
P != null ? A.continue(Xt(P, f.reverse ? e.MAX_KEY : e.MIN_KEY, m)) : f.unique ? A.continue(A.key.slice(0, S).concat(f.reverse ? e.MIN_KEY : e.MAX_KEY, m)) : A.continue();
|
|
2682
2682
|
} }, continuePrimaryKey: { value: function(P, D) {
|
|
2683
|
-
A.continuePrimaryKey(Xt(P, e.MAX_KEY,
|
|
2683
|
+
A.continuePrimaryKey(Xt(P, e.MAX_KEY, m), D);
|
|
2684
2684
|
} }, primaryKey: { get: function() {
|
|
2685
2685
|
return A.primaryKey;
|
|
2686
2686
|
} }, key: { get: function() {
|
|
@@ -2713,36 +2713,36 @@ function Ma() {
|
|
|
2713
2713
|
case "add":
|
|
2714
2714
|
if (g.fire === Q) break;
|
|
2715
2715
|
return i._promise("readwrite", function() {
|
|
2716
|
-
return
|
|
2716
|
+
return w(s);
|
|
2717
2717
|
}, !0);
|
|
2718
2718
|
case "put":
|
|
2719
2719
|
if (g.fire === Q && y.fire === Q) break;
|
|
2720
2720
|
return i._promise("readwrite", function() {
|
|
2721
|
-
return
|
|
2721
|
+
return w(s);
|
|
2722
2722
|
}, !0);
|
|
2723
2723
|
case "delete":
|
|
2724
2724
|
if (d.fire === Q) break;
|
|
2725
2725
|
return i._promise("readwrite", function() {
|
|
2726
|
-
return
|
|
2726
|
+
return w(s);
|
|
2727
2727
|
}, !0);
|
|
2728
2728
|
case "deleteRange":
|
|
2729
2729
|
if (d.fire === Q) break;
|
|
2730
2730
|
return i._promise("readwrite", function() {
|
|
2731
|
-
return function f(O,
|
|
2732
|
-
return r.query({ trans: O, values: !1, query: { index: a, range:
|
|
2731
|
+
return function f(O, m, v) {
|
|
2732
|
+
return r.query({ trans: O, values: !1, query: { index: a, range: m }, limit: v }).then(function(S) {
|
|
2733
2733
|
var b = S.result;
|
|
2734
|
-
return
|
|
2735
|
-
return 0 < A.numFailures ? Promise.reject(A.failures[0]) : b.length < v ? { failures: [], numFailures: 0, lastResult: void 0 } : f(O, l(l({},
|
|
2734
|
+
return w({ type: "delete", keys: b, trans: O }).then(function(A) {
|
|
2735
|
+
return 0 < A.numFailures ? Promise.reject(A.failures[0]) : b.length < v ? { failures: [], numFailures: 0, lastResult: void 0 } : f(O, l(l({}, m), { lower: b[b.length - 1], lowerOpen: !0 }), v);
|
|
2736
2736
|
});
|
|
2737
2737
|
});
|
|
2738
2738
|
}(s.trans, s.range, 1e4);
|
|
2739
2739
|
}, !0);
|
|
2740
2740
|
}
|
|
2741
2741
|
return r.mutate(s);
|
|
2742
|
-
function
|
|
2743
|
-
var O,
|
|
2742
|
+
function w(f) {
|
|
2743
|
+
var O, m, v, S = B.trans, b = f.keys || Gn(a, f);
|
|
2744
2744
|
if (!b) throw new Error("Keys missing");
|
|
2745
|
-
return (f = f.type === "add" || f.type === "put" ? l(l({}, f), { keys: b }) : l({}, f)).type !== "delete" && (f.values =
|
|
2745
|
+
return (f = f.type === "add" || f.type === "put" ? l(l({}, f), { keys: b }) : l({}, f)).type !== "delete" && (f.values = p([], f.values)), f.keys && (f.keys = p([], f.keys)), O = r, v = b, ((m = f).type === "add" ? Promise.resolve([]) : O.getMany({ trans: m.trans, keys: v, cache: "immutable" })).then(function(A) {
|
|
2746
2746
|
var P = b.map(function(D, I) {
|
|
2747
2747
|
var N, k, R, T = A[I], $ = { onerror: null, onsuccess: null };
|
|
2748
2748
|
return f.type === "delete" ? d.fire.call($, D, T, S) : f.type === "add" || T === void 0 ? (N = g.fire.call($, D, f.values[I], S), D == null && N != null && (f.keys[I] = D = N, a.outbound || ue(f.values[I], a.keyPath, D))) : (N = Mn(T, f.values[I]), (k = y.fire.call($, N, D, T, S)) && (R = f.values[I], Object.keys(k).forEach(function(x) {
|
|
@@ -2808,15 +2808,15 @@ function Ma() {
|
|
|
2808
2808
|
if (B.subscr && s !== "readonly") throw new L.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(B.querier));
|
|
2809
2809
|
return e.transaction(a, s, i);
|
|
2810
2810
|
}, table: function(a) {
|
|
2811
|
-
var s = e.table(a), i = s.schema, u = i.primaryKey, f = i.indexes, d = u.extractKey, g = u.outbound, y = u.autoIncrement && f.filter(function(
|
|
2812
|
-
return
|
|
2813
|
-
}),
|
|
2811
|
+
var s = e.table(a), i = s.schema, u = i.primaryKey, f = i.indexes, d = u.extractKey, g = u.outbound, y = u.autoIncrement && f.filter(function(m) {
|
|
2812
|
+
return m.compound && m.keyPath.includes(u.keyPath);
|
|
2813
|
+
}), w = l(l({}, s), { mutate: function(m) {
|
|
2814
2814
|
function v(x) {
|
|
2815
2815
|
return x = "idb://".concat(n, "/").concat(a, "/").concat(x), D[x] || (D[x] = new ae());
|
|
2816
2816
|
}
|
|
2817
|
-
var S, b, A, P =
|
|
2817
|
+
var S, b, A, P = m.trans, D = m.mutatedParts || (m.mutatedParts = {}), I = v(""), N = v(":dels"), k = m.type, $ = m.type === "deleteRange" ? [m.range] : m.type === "delete" ? [m.keys] : m.values.length < 50 ? [Gn(u, m).filter(function(x) {
|
|
2818
2818
|
return x;
|
|
2819
|
-
}),
|
|
2819
|
+
}), m.values] : [], R = $[0], T = $[1], $ = m.trans._cache;
|
|
2820
2820
|
return K(R) ? (I.addKeys(R), ($ = k === "delete" || R.length === T.length ? Ar(R, $) : null) || N.addKeys(R), ($ || T) && (S = v, b = $, A = T, i.indexes.forEach(function(x) {
|
|
2821
2821
|
var M = S(x.name || "");
|
|
2822
2822
|
function F(z) {
|
|
@@ -2833,9 +2833,9 @@ function Ma() {
|
|
|
2833
2833
|
});
|
|
2834
2834
|
}))) : R ? (T = { from: (T = R.lower) !== null && T !== void 0 ? T : e.MIN_KEY, to: (T = R.upper) !== null && T !== void 0 ? T : e.MAX_KEY }, N.add(T), I.add(T)) : (I.add(r), N.add(r), i.indexes.forEach(function(x) {
|
|
2835
2835
|
return v(x.name).add(r);
|
|
2836
|
-
})), s.mutate(
|
|
2837
|
-
return !R ||
|
|
2838
|
-
for (var F =
|
|
2836
|
+
})), s.mutate(m).then(function(x) {
|
|
2837
|
+
return !R || m.type !== "add" && m.type !== "put" || (I.addKeys(x.results), y && y.forEach(function(M) {
|
|
2838
|
+
for (var F = m.values.map(function(W) {
|
|
2839
2839
|
return M.extractKey(W);
|
|
2840
2840
|
}), U = M.keyPath.findIndex(function(W) {
|
|
2841
2841
|
return W === u.keyPath;
|
|
@@ -2846,29 +2846,29 @@ function Ma() {
|
|
|
2846
2846
|
} }), f = function(v) {
|
|
2847
2847
|
var S = v.query, v = S.index, S = S.range;
|
|
2848
2848
|
return [v, new ae((v = S.lower) !== null && v !== void 0 ? v : e.MIN_KEY, (S = S.upper) !== null && S !== void 0 ? S : e.MAX_KEY)];
|
|
2849
|
-
}, O = { get: function(
|
|
2850
|
-
return [u, new ae(
|
|
2851
|
-
}, getMany: function(
|
|
2852
|
-
return [u, new ae().addKeys(
|
|
2849
|
+
}, O = { get: function(m) {
|
|
2850
|
+
return [u, new ae(m.key)];
|
|
2851
|
+
}, getMany: function(m) {
|
|
2852
|
+
return [u, new ae().addKeys(m.keys)];
|
|
2853
2853
|
}, count: f, query: f, openCursor: f };
|
|
2854
|
-
return C(O).forEach(function(
|
|
2855
|
-
|
|
2856
|
-
var S = B.subscr, b = !!S, A = Pr(B, s) && Dr(
|
|
2854
|
+
return C(O).forEach(function(m) {
|
|
2855
|
+
w[m] = function(v) {
|
|
2856
|
+
var S = B.subscr, b = !!S, A = Pr(B, s) && Dr(m, v) ? v.obsSet = {} : S;
|
|
2857
2857
|
if (b) {
|
|
2858
2858
|
var P = function(T) {
|
|
2859
2859
|
return T = "idb://".concat(n, "/").concat(a, "/").concat(T), A[T] || (A[T] = new ae());
|
|
2860
|
-
}, D = P(""), I = P(":dels"), S = O[
|
|
2861
|
-
if ((
|
|
2862
|
-
if (
|
|
2863
|
-
var N =
|
|
2864
|
-
return s[
|
|
2865
|
-
if (
|
|
2860
|
+
}, D = P(""), I = P(":dels"), S = O[m](v), b = S[0], S = S[1];
|
|
2861
|
+
if ((m === "query" && b.isPrimaryKey && !v.values ? I : P(b.name || "")).add(S), !b.isPrimaryKey) {
|
|
2862
|
+
if (m !== "count") {
|
|
2863
|
+
var N = m === "query" && g && v.values && s.query(l(l({}, v), { values: !1 }));
|
|
2864
|
+
return s[m].apply(this, arguments).then(function(T) {
|
|
2865
|
+
if (m === "query") {
|
|
2866
2866
|
if (g && v.values) return N.then(function(F) {
|
|
2867
2867
|
return F = F.result, D.addKeys(F), T;
|
|
2868
2868
|
});
|
|
2869
2869
|
var $ = v.values ? T.result.map(d) : T.result;
|
|
2870
2870
|
(v.values ? D : I).addKeys($);
|
|
2871
|
-
} else if (
|
|
2871
|
+
} else if (m === "openCursor") {
|
|
2872
2872
|
var x = T, M = v.values;
|
|
2873
2873
|
return x && Object.create(x, { key: { get: function() {
|
|
2874
2874
|
return I.addKey(x.primaryKey), x.key;
|
|
@@ -2885,9 +2885,9 @@ function Ma() {
|
|
|
2885
2885
|
I.add(r);
|
|
2886
2886
|
}
|
|
2887
2887
|
}
|
|
2888
|
-
return s[
|
|
2888
|
+
return s[m].apply(this, arguments);
|
|
2889
2889
|
};
|
|
2890
|
-
}),
|
|
2890
|
+
}), w;
|
|
2891
2891
|
} });
|
|
2892
2892
|
} };
|
|
2893
2893
|
function Ir(e, n, r) {
|
|
@@ -2906,19 +2906,19 @@ function Ma() {
|
|
|
2906
2906
|
}
|
|
2907
2907
|
function Nr(e, n, O, a, s, i) {
|
|
2908
2908
|
if (!O || O.length === 0) return e;
|
|
2909
|
-
var u = n.query.index, d = u.multiEntry, g = n.query.range, y = a.schema.primaryKey.extractKey,
|
|
2910
|
-
var S =
|
|
2909
|
+
var u = n.query.index, d = u.multiEntry, g = n.query.range, y = a.schema.primaryKey.extractKey, w = u.extractKey, f = (u.lowLevelIndex || u).extractKey, O = O.reduce(function(m, v) {
|
|
2910
|
+
var S = m, b = [];
|
|
2911
2911
|
if (v.type === "add" || v.type === "put") for (var A = new ae(), P = v.values.length - 1; 0 <= P; --P) {
|
|
2912
2912
|
var D, I = v.values[P], N = y(I);
|
|
2913
|
-
A.hasKey(N) || (D =
|
|
2913
|
+
A.hasKey(N) || (D = w(I), (d && K(D) ? D.some(function(x) {
|
|
2914
2914
|
return Kn(x, g);
|
|
2915
2915
|
}) : Kn(D, g)) && (A.addKey(N), b.push(I)));
|
|
2916
2916
|
}
|
|
2917
2917
|
switch (v.type) {
|
|
2918
2918
|
case "add":
|
|
2919
|
-
var k = new ae().addKeys(n.values ?
|
|
2919
|
+
var k = new ae().addKeys(n.values ? m.map(function(M) {
|
|
2920
2920
|
return y(M);
|
|
2921
|
-
}) :
|
|
2921
|
+
}) : m), S = m.concat(n.values ? b.filter(function(M) {
|
|
2922
2922
|
return M = y(M), !k.hasKey(M) && (k.addKey(M), !0);
|
|
2923
2923
|
}) : b.map(function(M) {
|
|
2924
2924
|
return y(M);
|
|
@@ -2930,7 +2930,7 @@ function Ma() {
|
|
|
2930
2930
|
var R = new ae().addKeys(v.values.map(function(M) {
|
|
2931
2931
|
return y(M);
|
|
2932
2932
|
}));
|
|
2933
|
-
S =
|
|
2933
|
+
S = m.filter(function(M) {
|
|
2934
2934
|
return !R.hasKey(n.values ? y(M) : M);
|
|
2935
2935
|
}).concat(n.values ? b : b.map(function(M) {
|
|
2936
2936
|
return y(M);
|
|
@@ -2938,20 +2938,20 @@ function Ma() {
|
|
|
2938
2938
|
break;
|
|
2939
2939
|
case "delete":
|
|
2940
2940
|
var T = new ae().addKeys(v.keys);
|
|
2941
|
-
S =
|
|
2941
|
+
S = m.filter(function(M) {
|
|
2942
2942
|
return !T.hasKey(n.values ? y(M) : M);
|
|
2943
2943
|
});
|
|
2944
2944
|
break;
|
|
2945
2945
|
case "deleteRange":
|
|
2946
2946
|
var $ = v.range;
|
|
2947
|
-
S =
|
|
2947
|
+
S = m.filter(function(M) {
|
|
2948
2948
|
return !Kn(y(M), $);
|
|
2949
2949
|
});
|
|
2950
2950
|
}
|
|
2951
2951
|
return S;
|
|
2952
2952
|
}, e);
|
|
2953
|
-
return O === e ? e : (O.sort(function(
|
|
2954
|
-
return H(f(
|
|
2953
|
+
return O === e ? e : (O.sort(function(m, v) {
|
|
2954
|
+
return H(f(m), f(v)) || H(y(m), y(v));
|
|
2955
2955
|
}), n.limit && n.limit < 1 / 0 && (O.length > n.limit ? O.length = n.limit : e.length === n.limit && O.length < n.limit && (s.dirty = !0)), i ? Object.freeze(O) : O);
|
|
2956
2956
|
}
|
|
2957
2957
|
function Rr(e, n) {
|
|
@@ -2993,20 +2993,20 @@ function Ma() {
|
|
|
2993
2993
|
return a === "readwrite" && (u = (i = new AbortController()).signal, s = function(g) {
|
|
2994
2994
|
return function() {
|
|
2995
2995
|
if (i.abort(), a === "readwrite") {
|
|
2996
|
-
for (var y = /* @__PURE__ */ new Set(),
|
|
2997
|
-
var O = f[
|
|
2998
|
-
if (
|
|
2999
|
-
var v = e.table(O), S =
|
|
2996
|
+
for (var y = /* @__PURE__ */ new Set(), w = 0, f = r; w < f.length; w++) {
|
|
2997
|
+
var O = f[w], m = ze["idb://".concat(n, "/").concat(O)];
|
|
2998
|
+
if (m) {
|
|
2999
|
+
var v = e.table(O), S = m.optimisticOps.filter(function(M) {
|
|
3000
3000
|
return M.trans === d;
|
|
3001
3001
|
});
|
|
3002
|
-
if (d._explicit && g && d.mutatedParts) for (var b = 0, A = Object.values(
|
|
3002
|
+
if (d._explicit && g && d.mutatedParts) for (var b = 0, A = Object.values(m.queries.query); b < A.length; b++) for (var P = 0, D = (k = A[b]).slice(); P < D.length; P++) xn((R = D[P]).obsSet, d.mutatedParts) && (je(k, R), R.subscribers.forEach(function(M) {
|
|
3003
3003
|
return y.add(M);
|
|
3004
3004
|
}));
|
|
3005
3005
|
else if (0 < S.length) {
|
|
3006
|
-
|
|
3006
|
+
m.optimisticOps = m.optimisticOps.filter(function(M) {
|
|
3007
3007
|
return M.trans !== d;
|
|
3008
3008
|
});
|
|
3009
|
-
for (var I = 0, N = Object.values(
|
|
3009
|
+
for (var I = 0, N = Object.values(m.queries.query); I < N.length; I++) for (var k, R, T, $ = 0, x = (k = N[I]).slice(); $ < x.length; $++) (R = x[$]).res != null && d.mutatedParts && (g && !R.dirty ? (T = Object.isFrozen(R.res), T = Nr(R.res, R.req, S, v, R, T), R.dirty ? (je(k, R), R.subscribers.forEach(function(M) {
|
|
3010
3010
|
return y.add(M);
|
|
3011
3011
|
})) : T !== R.res && (R.res = T, R.promise = j.resolve({ result: T }))) : (R.dirty && je(k, R), R.subscribers.forEach(function(M) {
|
|
3012
3012
|
return y.add(M);
|
|
@@ -3033,9 +3033,9 @@ function Ma() {
|
|
|
3033
3033
|
}), u.catch(function() {
|
|
3034
3034
|
je(d.optimisticOps, i), i.mutatedParts && Qt(i.mutatedParts);
|
|
3035
3035
|
})) : u.then(function(g) {
|
|
3036
|
-
var y = Ir(0, l(l({}, i), { values: i.values.map(function(
|
|
3036
|
+
var y = Ir(0, l(l({}, i), { values: i.values.map(function(w, f) {
|
|
3037
3037
|
var O;
|
|
3038
|
-
return g.failures[f] ?
|
|
3038
|
+
return g.failures[f] ? w : (w = (O = s.keyPath) !== null && O !== void 0 && O.includes(".") ? $e(w) : l({}, w), ue(w, s.keyPath, g.results[f]), w);
|
|
3039
3039
|
}) }), g);
|
|
3040
3040
|
d.optimisticOps.push(y), queueMicrotask(function() {
|
|
3041
3041
|
return i.mutatedParts && Qt(i.mutatedParts);
|
|
@@ -3062,18 +3062,18 @@ function Ma() {
|
|
|
3062
3062
|
return Rr(N.req.query.range, A.query.range);
|
|
3063
3063
|
}), [I, !!I, P, D];
|
|
3064
3064
|
}
|
|
3065
|
-
}(n, r, "query", i),
|
|
3066
|
-
return
|
|
3065
|
+
}(n, r, "query", i), w = y[0], f = y[1], O = y[2], m = y[3];
|
|
3066
|
+
return w && f ? w.obsSet = i.obsSet : (f = a.query(i).then(function(v) {
|
|
3067
3067
|
var S = v.result;
|
|
3068
|
-
if (
|
|
3068
|
+
if (w && (w.res = S), u) {
|
|
3069
3069
|
for (var b = 0, A = S.length; b < A; ++b) Object.freeze(S[b]);
|
|
3070
3070
|
Object.freeze(S);
|
|
3071
3071
|
} else v.result = $e(S);
|
|
3072
3072
|
return v;
|
|
3073
3073
|
}).catch(function(v) {
|
|
3074
|
-
return
|
|
3075
|
-
}),
|
|
3076
|
-
return { result: Nr(v.result, i, O?.optimisticOps, a,
|
|
3074
|
+
return m && w && je(m, w), Promise.reject(v);
|
|
3075
|
+
}), w = { obsSet: i.obsSet, promise: f, subscribers: /* @__PURE__ */ new Set(), type: "query", req: i, dirty: !1 }, m ? m.push(w) : (m = [w], (O = O || (ze["idb://".concat(n, "/").concat(r)] = { queries: { query: {}, count: {} }, objs: /* @__PURE__ */ new Map(), optimisticOps: [], unsignaledParts: {} })).queries.query[i.query.index.name || ""] = m)), Oa(w, m, d, g), w.promise.then(function(v) {
|
|
3076
|
+
return { result: Nr(v.result, i, O?.optimisticOps, a, w, u) };
|
|
3077
3077
|
});
|
|
3078
3078
|
} });
|
|
3079
3079
|
} });
|
|
@@ -3142,8 +3142,8 @@ function Ma() {
|
|
|
3142
3142
|
n.close(e);
|
|
3143
3143
|
var d = n._deps.indexedDB.deleteDatabase(n.name);
|
|
3144
3144
|
d.onsuccess = Z(function() {
|
|
3145
|
-
var g, y,
|
|
3146
|
-
g = n._deps, y = n.name,
|
|
3145
|
+
var g, y, w;
|
|
3146
|
+
g = n._deps, y = n.name, w = g.indexedDB, g = g.IDBKeyRange, Nn(w) || y === jt || In(w, g).delete(y).catch(Q), s();
|
|
3147
3147
|
}), d.onerror = me(i), d.onblocked = n._fireOnBlocked;
|
|
3148
3148
|
}
|
|
3149
3149
|
if (r) throw new L.InvalidArgument("Invalid closeOptions argument to db.delete()");
|
|
@@ -3200,19 +3200,19 @@ function Ma() {
|
|
|
3200
3200
|
}), d && s && !s.active && (s = null);
|
|
3201
3201
|
}
|
|
3202
3202
|
} catch (y) {
|
|
3203
|
-
return s ? s._promise(null, function(
|
|
3203
|
+
return s ? s._promise(null, function(w, f) {
|
|
3204
3204
|
f(y);
|
|
3205
3205
|
}) : q(y);
|
|
3206
3206
|
}
|
|
3207
|
-
var g = function y(
|
|
3207
|
+
var g = function y(w, f, O, m, v) {
|
|
3208
3208
|
return j.resolve().then(function() {
|
|
3209
|
-
var S = B.transless || B, b =
|
|
3210
|
-
if (b.explicit = !0, S = { trans: b, transless: S },
|
|
3209
|
+
var S = B.transless || B, b = w._createTransaction(f, O, w._dbSchema, m);
|
|
3210
|
+
if (b.explicit = !0, S = { trans: b, transless: S }, m) b.idbtrans = m.idbtrans;
|
|
3211
3211
|
else try {
|
|
3212
|
-
b.create(), b.idbtrans._explicit = !0,
|
|
3212
|
+
b.create(), b.idbtrans._explicit = !0, w._state.PR1398_maxLoop = 3;
|
|
3213
3213
|
} catch (D) {
|
|
3214
|
-
return D.name === sn.InvalidState &&
|
|
3215
|
-
return y(
|
|
3214
|
+
return D.name === sn.InvalidState && w.isOpen() && 0 < --w._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), w.close({ disableAutoOpen: !1 }), w.open().then(function() {
|
|
3215
|
+
return y(w, f, O, null, v);
|
|
3216
3216
|
})) : q(D);
|
|
3217
3217
|
}
|
|
3218
3218
|
var A, P = an(v);
|
|
@@ -3224,7 +3224,7 @@ function Ma() {
|
|
|
3224
3224
|
}) : S.then(function() {
|
|
3225
3225
|
return A;
|
|
3226
3226
|
})).then(function(D) {
|
|
3227
|
-
return
|
|
3227
|
+
return m && b._resolve(), b._completion.then(function() {
|
|
3228
3228
|
return D;
|
|
3229
3229
|
});
|
|
3230
3230
|
}).catch(function(D) {
|
|
@@ -3250,29 +3250,29 @@ function Ma() {
|
|
|
3250
3250
|
}), y.openCanceller = new j(function(f, O) {
|
|
3251
3251
|
y.cancelOpen = O;
|
|
3252
3252
|
}), this._state = y, this.name = e, this.on = ht(this, "populate", "blocked", "versionchange", "close", { ready: [on, Q] }), this.on.ready.subscribe = Vn(this.on.ready.subscribe, function(f) {
|
|
3253
|
-
return function(O,
|
|
3253
|
+
return function(O, m) {
|
|
3254
3254
|
ee.vip(function() {
|
|
3255
3255
|
var v, S = r._state;
|
|
3256
|
-
S.openComplete ? (S.dbOpenError || j.resolve().then(O),
|
|
3256
|
+
S.openComplete ? (S.dbOpenError || j.resolve().then(O), m && f(O)) : S.onReadyBeingFired ? (S.onReadyBeingFired.push(O), m && f(O)) : (f(O), v = r, m || f(function b() {
|
|
3257
3257
|
v.on.ready.unsubscribe(O), v.on.ready.unsubscribe(b);
|
|
3258
3258
|
}));
|
|
3259
3259
|
});
|
|
3260
3260
|
};
|
|
3261
3261
|
}), this.Collection = (s = this, gt(oa.prototype, function(A, b) {
|
|
3262
3262
|
this.db = s;
|
|
3263
|
-
var
|
|
3263
|
+
var m = ir, v = null;
|
|
3264
3264
|
if (b) try {
|
|
3265
|
-
|
|
3265
|
+
m = b();
|
|
3266
3266
|
} catch (P) {
|
|
3267
3267
|
v = P;
|
|
3268
3268
|
}
|
|
3269
3269
|
var S = A._ctx, b = S.table, A = b.hook.reading.fire;
|
|
3270
|
-
this._ctx = { table: b, index: S.index, isPrimKey: !S.index || b.schema.primKey.keyPath && S.index === b.schema.primKey.name, range:
|
|
3271
|
-
})), this.Table = (i = this, gt(dr.prototype, function(f, O,
|
|
3272
|
-
this.db = i, this._tx =
|
|
3273
|
-
})), this.Transaction = (u = this, gt(ua.prototype, function(f, O,
|
|
3270
|
+
this._ctx = { table: b, index: S.index, isPrimKey: !S.index || b.schema.primKey.keyPath && S.index === b.schema.primKey.name, range: m, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: v, or: S.or, valueMapper: A !== ct ? A : null };
|
|
3271
|
+
})), this.Table = (i = this, gt(dr.prototype, function(f, O, m) {
|
|
3272
|
+
this.db = i, this._tx = m, this.name = f, this.schema = O, this.hook = i._allTables[f] ? i._allTables[f].hook : ht(null, { creating: [Jr, Q], reading: [Xr, ct], updating: [qr, Q], deleting: [Zr, Q] });
|
|
3273
|
+
})), this.Transaction = (u = this, gt(ua.prototype, function(f, O, m, v, S) {
|
|
3274
3274
|
var b = this;
|
|
3275
|
-
this.db = u, this.mode = f, this.storeNames = O, this.schema =
|
|
3275
|
+
this.db = u, this.mode = f, this.storeNames = O, this.schema = m, this.chromeTransactionDurability = v, this.idbtrans = null, this.on = ht(this, "complete", "error", "abort"), this.parent = S || null, this.active = !0, this._reculock = 0, this._blockedFuncs = [], this._resolve = null, this._reject = null, this._waitingFor = null, this._waitingQueue = null, this._spinCount = 0, this._completion = new j(function(A, P) {
|
|
3276
3276
|
b._resolve = A, b._reject = P;
|
|
3277
3277
|
}), this._completion.then(function() {
|
|
3278
3278
|
b.active = !1, b.on.complete.fire();
|
|
@@ -3282,8 +3282,8 @@ function Ma() {
|
|
|
3282
3282
|
});
|
|
3283
3283
|
})), this.Version = (d = this, gt(ma.prototype, function(f) {
|
|
3284
3284
|
this.db = d, this._cfg = { version: f, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
|
|
3285
|
-
})), this.WhereClause = (g = this, gt(mr.prototype, function(f, O,
|
|
3286
|
-
if (this.db = g, this._ctx = { table: f, index: O === ":id" ? null : O, or:
|
|
3285
|
+
})), this.WhereClause = (g = this, gt(mr.prototype, function(f, O, m) {
|
|
3286
|
+
if (this.db = g, this._ctx = { table: f, index: O === ":id" ? null : O, or: m }, this._cmp = this._ascending = H, this._descending = function(v, S) {
|
|
3287
3287
|
return H(S, v);
|
|
3288
3288
|
}, this._max = function(v, S) {
|
|
3289
3289
|
return 0 < H(v, S) ? v : S;
|
|
@@ -3294,8 +3294,8 @@ function Ma() {
|
|
|
3294
3294
|
0 < f.newVersion ? console.warn("Another connection wants to upgrade database '".concat(r.name, "'. Closing db now to resume the upgrade.")) : console.warn("Another connection wants to delete database '".concat(r.name, "'. Closing db now to resume the delete request.")), r.close({ disableAutoOpen: !1 });
|
|
3295
3295
|
}), this.on("blocked", function(f) {
|
|
3296
3296
|
!f.newVersion || f.newVersion < f.oldVersion ? console.warn("Dexie.delete('".concat(r.name, "') was blocked")) : console.warn("Upgrade '".concat(r.name, "' blocked by other connection holding version ").concat(f.oldVersion / 10));
|
|
3297
|
-
}), this._maxKey = bt(n.IDBKeyRange), this._createTransaction = function(f, O,
|
|
3298
|
-
return new r.Transaction(f, O,
|
|
3297
|
+
}), this._maxKey = bt(n.IDBKeyRange), this._createTransaction = function(f, O, m, v) {
|
|
3298
|
+
return new r.Transaction(f, O, m, r._options.chromeTransactionDurability, v);
|
|
3299
3299
|
}, this._fireOnBlocked = function(f) {
|
|
3300
3300
|
r.on("blocked").fire(f), tt.filter(function(O) {
|
|
3301
3301
|
return O.name === r.name && O !== r && !O._state.vcFired;
|
|
@@ -3303,19 +3303,19 @@ function Ma() {
|
|
|
3303
3303
|
return O.on("versionchange").fire(f);
|
|
3304
3304
|
});
|
|
3305
3305
|
}, this.use(Ea), this.use(_a), this.use(wa), this.use(ba), this.use(va);
|
|
3306
|
-
var
|
|
3306
|
+
var w = new Proxy(this, { get: function(f, O, m) {
|
|
3307
3307
|
if (O === "_vip") return !0;
|
|
3308
3308
|
if (O === "table") return function(S) {
|
|
3309
|
-
return Jt(r.table(S),
|
|
3309
|
+
return Jt(r.table(S), w);
|
|
3310
3310
|
};
|
|
3311
|
-
var v = Reflect.get(f, O,
|
|
3312
|
-
return v instanceof dr ? Jt(v,
|
|
3313
|
-
return Jt(S,
|
|
3311
|
+
var v = Reflect.get(f, O, m);
|
|
3312
|
+
return v instanceof dr ? Jt(v, w) : O === "tables" ? v.map(function(S) {
|
|
3313
|
+
return Jt(S, w);
|
|
3314
3314
|
}) : O === "_createTransaction" ? function() {
|
|
3315
|
-
return Jt(v.apply(this, arguments),
|
|
3315
|
+
return Jt(v.apply(this, arguments), w);
|
|
3316
3316
|
} : v;
|
|
3317
3317
|
} });
|
|
3318
|
-
this.vip =
|
|
3318
|
+
this.vip = w, a.forEach(function(f) {
|
|
3319
3319
|
return f(r);
|
|
3320
3320
|
});
|
|
3321
3321
|
}
|
|
@@ -3328,21 +3328,21 @@ function Ma() {
|
|
|
3328
3328
|
this._subscribe = e;
|
|
3329
3329
|
}
|
|
3330
3330
|
try {
|
|
3331
|
-
Zt = { indexedDB:
|
|
3331
|
+
Zt = { indexedDB: E.indexedDB || E.mozIndexedDB || E.webkitIndexedDB || E.msIndexedDB, IDBKeyRange: E.IDBKeyRange || E.webkitIDBKeyRange };
|
|
3332
3332
|
} catch {
|
|
3333
3333
|
Zt = { indexedDB: null, IDBKeyRange: null };
|
|
3334
3334
|
}
|
|
3335
3335
|
function Tr(e) {
|
|
3336
3336
|
var n, r = !1, a = new Aa(function(s) {
|
|
3337
|
-
var i = an(e), u, d = !1, g = {}, y = {},
|
|
3337
|
+
var i = an(e), u, d = !1, g = {}, y = {}, w = { get closed() {
|
|
3338
3338
|
return d;
|
|
3339
3339
|
}, unsubscribe: function() {
|
|
3340
|
-
d || (d = !0, u && u.abort(), f && Te.storagemutated.unsubscribe(
|
|
3340
|
+
d || (d = !0, u && u.abort(), f && Te.storagemutated.unsubscribe(m));
|
|
3341
3341
|
} };
|
|
3342
|
-
s.start && s.start(
|
|
3342
|
+
s.start && s.start(w);
|
|
3343
3343
|
var f = !1, O = function() {
|
|
3344
3344
|
return pn(v);
|
|
3345
|
-
},
|
|
3345
|
+
}, m = function(S) {
|
|
3346
3346
|
Yt(g, S), xn(y, g) && O();
|
|
3347
3347
|
}, v = function() {
|
|
3348
3348
|
var S, b, A;
|
|
@@ -3359,7 +3359,7 @@ function Ma() {
|
|
|
3359
3359
|
r = !0, n = P, d || b.signal.aborted || (g = {}, function(D) {
|
|
3360
3360
|
for (var I in D) if (ie(D, I)) return;
|
|
3361
3361
|
return 1;
|
|
3362
|
-
}(y = S) || f || (Te(yt,
|
|
3362
|
+
}(y = S) || f || (Te(yt, m), f = !0), pn(function() {
|
|
3363
3363
|
return !d && s.next && s.next(P);
|
|
3364
3364
|
}));
|
|
3365
3365
|
}, function(P) {
|
|
@@ -3368,7 +3368,7 @@ function Ma() {
|
|
|
3368
3368
|
});
|
|
3369
3369
|
}));
|
|
3370
3370
|
};
|
|
3371
|
-
return setTimeout(O, 0),
|
|
3371
|
+
return setTimeout(O, 0), w;
|
|
3372
3372
|
});
|
|
3373
3373
|
return a.hasValue = function() {
|
|
3374
3374
|
return r;
|
|
@@ -3590,10 +3590,10 @@ class Mr {
|
|
|
3590
3590
|
} : (o.message = `Dashboard ${t.id} retrieved from storage`, o.success = !0, o);
|
|
3591
3591
|
};
|
|
3592
3592
|
getDashboards = async (t) => {
|
|
3593
|
-
const o = (
|
|
3593
|
+
const o = (E) => t?.id === E.id, l = (E) => t?.name ? E.name.includes(t?.name) : !1, p = await this.db.table(_.DASHBOARD).toArray().then((E) => t?.id ? E.filter(o) : E).then((E) => t?.name ? E.filter(l) : E).catch(() => {
|
|
3594
3594
|
G(2, ["%cstorage", c.STORAGE, X.DASHBOARD_LOAD, t]);
|
|
3595
3595
|
});
|
|
3596
|
-
return
|
|
3596
|
+
return p !== void 0 && G(3, [
|
|
3597
3597
|
"%cstorage%c %cdashboards",
|
|
3598
3598
|
c.STORAGE,
|
|
3599
3599
|
c.NONE,
|
|
@@ -3601,9 +3601,9 @@ class Mr {
|
|
|
3601
3601
|
t
|
|
3602
3602
|
]), {
|
|
3603
3603
|
// @ts-ignore
|
|
3604
|
-
data:
|
|
3605
|
-
message:
|
|
3606
|
-
success:
|
|
3604
|
+
data: p !== void 0 ? { dashboards: p, query: t } : null,
|
|
3605
|
+
message: p !== void 0 ? "Dashboards loaded from storage" : "Dashboards load error",
|
|
3606
|
+
success: p !== void 0
|
|
3607
3607
|
};
|
|
3608
3608
|
};
|
|
3609
3609
|
/**
|
|
@@ -3632,21 +3632,21 @@ class Mr {
|
|
|
3632
3632
|
* Wipe Message data after expires timestamp
|
|
3633
3633
|
*/
|
|
3634
3634
|
cleanMessages = async () => {
|
|
3635
|
-
const t = Date.now() / 1e3, o = (
|
|
3636
|
-
return await this.db.table(_.TOPICS).orderBy("expires").filter(o).delete().catch((
|
|
3635
|
+
const t = Date.now() / 1e3, o = (E) => E.expires < t, l = (E) => E.expires < t;
|
|
3636
|
+
return await this.db.table(_.TOPICS).orderBy("expires").filter(o).delete().catch((E) => (console.error(
|
|
3637
3637
|
"%cstorage%c %cclean",
|
|
3638
3638
|
c.STORAGE,
|
|
3639
3639
|
c.NONE,
|
|
3640
3640
|
c.MESSAGES,
|
|
3641
|
-
|
|
3642
|
-
), 0)), await this.db.table(_.MESSAGES).orderBy("expires").filter(l).delete().catch((
|
|
3641
|
+
E.message
|
|
3642
|
+
), 0)), await this.db.table(_.MESSAGES).orderBy("expires").filter(l).delete().catch((E) => (console.error(
|
|
3643
3643
|
"%clean%c %cstorage%c %cmessages",
|
|
3644
3644
|
c.OK,
|
|
3645
3645
|
c.NONE,
|
|
3646
3646
|
c.STORAGE,
|
|
3647
3647
|
c.NONE,
|
|
3648
3648
|
c.MESSAGES,
|
|
3649
|
-
|
|
3649
|
+
E.message
|
|
3650
3650
|
), 0));
|
|
3651
3651
|
};
|
|
3652
3652
|
/**
|
|
@@ -3672,9 +3672,9 @@ class Mr {
|
|
|
3672
3672
|
};
|
|
3673
3673
|
const o = t?.order ?? "utc", l = Math.floor(Date.now() / 1e3);
|
|
3674
3674
|
o !== "utc" && (t.since = l - 60 * 60 * 24 * 30), this.options.delay != 0 ? t.before = l - (this.options.delay || 0) : t.before = l;
|
|
3675
|
-
const
|
|
3675
|
+
const p = (K) => K.utc > (t?.since || 0), E = (K) => K.utc < (t?.before || l), C = (K) => K?.visible !== 0;
|
|
3676
3676
|
try {
|
|
3677
|
-
const te = await this.db.table(_.TOPICS).where("widget_id").equals(t.widget).filter(C).filter(
|
|
3677
|
+
const te = await this.db.table(_.TOPICS).where("widget_id").equals(t.widget).filter(C).filter(p).filter(E).reverse().limit(t?.limit ?? 25).sortBy(o);
|
|
3678
3678
|
if (te.length === 0)
|
|
3679
3679
|
return {
|
|
3680
3680
|
data: null,
|
|
@@ -3736,56 +3736,56 @@ class Mr {
|
|
|
3736
3736
|
if (t.type !== _.MESSAGES)
|
|
3737
3737
|
return 400;
|
|
3738
3738
|
const l = o.data.title;
|
|
3739
|
-
let
|
|
3740
|
-
return await o.data.messages.forEach(async (
|
|
3741
|
-
|
|
3742
|
-
message_id:
|
|
3743
|
-
engagement:
|
|
3744
|
-
impressions:
|
|
3745
|
-
reach:
|
|
3746
|
-
sentiment:
|
|
3739
|
+
let p = 0;
|
|
3740
|
+
return await o.data.messages.forEach(async (E) => {
|
|
3741
|
+
E.id !== null && (E.topics[0] = {
|
|
3742
|
+
message_id: E.id,
|
|
3743
|
+
engagement: E.topics[0]?.engagement || E.dynamics?.engagement || 0,
|
|
3744
|
+
impressions: E.topics[0]?.impressions || E.dynamics?.semrush_visits || 0,
|
|
3745
|
+
reach: E.topics[0]?.reach || E.dynamics?.potential_reach || 0,
|
|
3746
|
+
sentiment: E.topics[0]?.sentiment || 0
|
|
3747
3747
|
}, await this.db.table(_.MESSAGES).put({
|
|
3748
|
-
id:
|
|
3749
|
-
utc:
|
|
3750
|
-
data:
|
|
3751
|
-
expires:
|
|
3748
|
+
id: E.id,
|
|
3749
|
+
utc: E.utc,
|
|
3750
|
+
data: E,
|
|
3751
|
+
expires: E.expires
|
|
3752
3752
|
}).catch((C) => {
|
|
3753
|
-
|
|
3753
|
+
p++, G(4, [
|
|
3754
3754
|
"%cset%c %cstorage",
|
|
3755
3755
|
c.KO,
|
|
3756
3756
|
c.NONE,
|
|
3757
3757
|
c.STORAGE,
|
|
3758
3758
|
"set message",
|
|
3759
3759
|
`title: ${l}`,
|
|
3760
|
-
|
|
3760
|
+
E,
|
|
3761
3761
|
C.message
|
|
3762
3762
|
]);
|
|
3763
3763
|
}), await this.db.table(_.TOPICS).put({
|
|
3764
3764
|
title: l,
|
|
3765
3765
|
widget_id: t.widget,
|
|
3766
|
-
message_id:
|
|
3766
|
+
message_id: E.id,
|
|
3767
3767
|
dashboard_id: t.dashboard,
|
|
3768
|
-
engagement:
|
|
3769
|
-
impressions:
|
|
3770
|
-
reach:
|
|
3771
|
-
sentiment:
|
|
3772
|
-
utc:
|
|
3773
|
-
expires:
|
|
3768
|
+
engagement: E.topics[0]?.engagement || E.dynamics?.engagement || 0,
|
|
3769
|
+
impressions: E.topics[0]?.impressions || E.dynamics?.semrush_visits || 0,
|
|
3770
|
+
reach: E.topics[0]?.reach || E.dynamics?.potential_reach || 0,
|
|
3771
|
+
sentiment: E.topics[0]?.sentiment || 0,
|
|
3772
|
+
utc: E.utc,
|
|
3773
|
+
expires: E.expires
|
|
3774
3774
|
}).catch((C) => {
|
|
3775
|
-
|
|
3775
|
+
p++, G(4, [
|
|
3776
3776
|
"%cset%c %cstorage",
|
|
3777
3777
|
c.KO,
|
|
3778
3778
|
c.NONE,
|
|
3779
3779
|
c.STORAGE,
|
|
3780
3780
|
"set topic",
|
|
3781
3781
|
`title: ${l}`,
|
|
3782
|
-
|
|
3782
|
+
E,
|
|
3783
3783
|
C.message
|
|
3784
3784
|
]);
|
|
3785
3785
|
}), await o.data.topics.forEach(async (C) => {
|
|
3786
3786
|
const K = C.message_id, te = C.visible ? 1 : 0, ge = C.title;
|
|
3787
3787
|
await this.db.table(_.TOPICS).where("message_id").equals(K).modify({ visible: te }).catch((Ce) => {
|
|
3788
|
-
|
|
3788
|
+
p++, G(4, [
|
|
3789
3789
|
"%cset%c %cstorage",
|
|
3790
3790
|
c.KO,
|
|
3791
3791
|
c.NONE,
|
|
@@ -3797,7 +3797,7 @@ class Mr {
|
|
|
3797
3797
|
]);
|
|
3798
3798
|
});
|
|
3799
3799
|
}));
|
|
3800
|
-
}),
|
|
3800
|
+
}), p === 0 ? 201 : 400;
|
|
3801
3801
|
};
|
|
3802
3802
|
/**
|
|
3803
3803
|
* Retrieve Series Data
|
|
@@ -3903,10 +3903,10 @@ class Mr {
|
|
|
3903
3903
|
* @returns IResponse
|
|
3904
3904
|
*/
|
|
3905
3905
|
getWidgets = async (t) => {
|
|
3906
|
-
const o = (C) => t?.dashboard === C.dashboard_id, l = (C) => t?.type === C.type,
|
|
3906
|
+
const o = (C) => t?.dashboard === C.dashboard_id, l = (C) => t?.type === C.type, p = (C) => t?.name ? C.name.includes(t?.name) : !1, E = await this.db.table(_.WIDGET).toArray().then((C) => t?.dashboard ? C.filter(o) : C).then((C) => t?.type ? C.filter(l) : C).then((C) => t?.name ? C.filter(p) : C).catch(() => {
|
|
3907
3907
|
G(2, ["%cstorage", c.STORAGE, X.WIDGET_LOAD, t]);
|
|
3908
3908
|
});
|
|
3909
|
-
return
|
|
3909
|
+
return E !== void 0 && G(3, [
|
|
3910
3910
|
"%cstorage%c %cwidgets",
|
|
3911
3911
|
c.STORAGE,
|
|
3912
3912
|
c.NONE,
|
|
@@ -3914,9 +3914,9 @@ class Mr {
|
|
|
3914
3914
|
t
|
|
3915
3915
|
]), {
|
|
3916
3916
|
// @ts-ignore
|
|
3917
|
-
data:
|
|
3918
|
-
message:
|
|
3919
|
-
success:
|
|
3917
|
+
data: E !== void 0 ? { data: E, query: t } : null,
|
|
3918
|
+
message: E !== void 0 ? "Widgets loaded from storage" : "Widgets load error",
|
|
3919
|
+
success: E !== void 0
|
|
3920
3920
|
};
|
|
3921
3921
|
};
|
|
3922
3922
|
/**
|
|
@@ -3993,12 +3993,12 @@ class Mr {
|
|
|
3993
3993
|
* @returns IResponse
|
|
3994
3994
|
*/
|
|
3995
3995
|
getSlides = async (t) => {
|
|
3996
|
-
const o = (C) => t?.id ? t.id = C.id : !1, l = (C) => t?.name ? C.name.includes(t?.name) : !1,
|
|
3997
|
-
return
|
|
3996
|
+
const o = (C) => t?.id ? t.id = C.id : !1, l = (C) => t?.name ? C.name.includes(t?.name) : !1, E = await this.db.table(_.SLIDE).toArray().then((C) => t?.id ? C.filter(o) : C).then((C) => t?.name ? C.filter(l) : C);
|
|
3997
|
+
return E !== void 0 && G(3, ["%cstorage%c %cslides", c.STORAGE, c.NONE, c.SLIDE, t]), {
|
|
3998
3998
|
// @ts-ignore
|
|
3999
|
-
data:
|
|
4000
|
-
message:
|
|
4001
|
-
success:
|
|
3999
|
+
data: E !== void 0 ? { slides: E, query: t } : null,
|
|
4000
|
+
message: E !== void 0 ? "Slides loaded from storage" : "Slides load error",
|
|
4001
|
+
success: E !== void 0
|
|
4002
4002
|
};
|
|
4003
4003
|
};
|
|
4004
4004
|
/**
|
|
@@ -4055,8 +4055,8 @@ class Mr {
|
|
|
4055
4055
|
* @returns IResponse
|
|
4056
4056
|
*/
|
|
4057
4057
|
getPresentations = async (t) => {
|
|
4058
|
-
const o = (
|
|
4059
|
-
return
|
|
4058
|
+
const o = (E) => t?.name ? E.name.includes(t?.name) : !1, p = await this.db.table(_.PRESENTATION).toArray().then((E) => t?.name ? E.filter(o) : E);
|
|
4059
|
+
return p !== void 0 && G(3, [
|
|
4060
4060
|
"%cstorage%c %cpresentations",
|
|
4061
4061
|
c.STORAGE,
|
|
4062
4062
|
c.NONE,
|
|
@@ -4064,9 +4064,9 @@ class Mr {
|
|
|
4064
4064
|
t
|
|
4065
4065
|
]), {
|
|
4066
4066
|
// @ts-ignore
|
|
4067
|
-
data:
|
|
4068
|
-
message:
|
|
4069
|
-
success:
|
|
4067
|
+
data: p !== void 0 ? { presentations: p, query: t } : null,
|
|
4068
|
+
message: p !== void 0 ? "Presentations loaded from storage" : "Presentations load error",
|
|
4069
|
+
success: p !== void 0
|
|
4070
4070
|
};
|
|
4071
4071
|
};
|
|
4072
4072
|
/**
|
|
@@ -4123,8 +4123,8 @@ class Mr {
|
|
|
4123
4123
|
* @returns IResponse
|
|
4124
4124
|
*/
|
|
4125
4125
|
getPreferences = async (t) => {
|
|
4126
|
-
const o = (
|
|
4127
|
-
return
|
|
4126
|
+
const o = (E) => t?.id ? t.id = E.id : !1, p = await this.db.table(_.SLIDE).toArray().then((E) => t?.id ? E.filter(o) : E);
|
|
4127
|
+
return p !== void 0 && G(3, [
|
|
4128
4128
|
"%cstorage%c %cpreferences",
|
|
4129
4129
|
c.STORAGE,
|
|
4130
4130
|
c.NONE,
|
|
@@ -4132,9 +4132,9 @@ class Mr {
|
|
|
4132
4132
|
t
|
|
4133
4133
|
]), {
|
|
4134
4134
|
// @ts-ignore
|
|
4135
|
-
data:
|
|
4136
|
-
message:
|
|
4137
|
-
success:
|
|
4135
|
+
data: p !== void 0 ? { prefrences: p, query: t } : null,
|
|
4136
|
+
message: p !== void 0 ? "Preferences loaded from storage" : "Preferences load error",
|
|
4137
|
+
success: p !== void 0
|
|
4138
4138
|
};
|
|
4139
4139
|
};
|
|
4140
4140
|
/**
|
|
@@ -4166,8 +4166,8 @@ class Mr {
|
|
|
4166
4166
|
* @returns IResponse
|
|
4167
4167
|
*/
|
|
4168
4168
|
getImages = async (t) => {
|
|
4169
|
-
const o = (
|
|
4170
|
-
return
|
|
4169
|
+
const o = (E) => t?.id ? E.includes(t.id) : !1, p = await this.db.table(_.IMAGES).toArray().then((E) => t?.id ? E.filter(o) : E);
|
|
4170
|
+
return p !== void 0 && G(3, [
|
|
4171
4171
|
"%cstorage%c %cimages",
|
|
4172
4172
|
c.STORAGE,
|
|
4173
4173
|
c.NONE,
|
|
@@ -4175,9 +4175,9 @@ class Mr {
|
|
|
4175
4175
|
t
|
|
4176
4176
|
]), {
|
|
4177
4177
|
// @ts-ignore
|
|
4178
|
-
data:
|
|
4179
|
-
message:
|
|
4180
|
-
success:
|
|
4178
|
+
data: p !== void 0 ? { images: p, query: t } : null,
|
|
4179
|
+
message: p !== void 0 ? "Images loaded from storage" : "Images load error",
|
|
4180
|
+
success: p !== void 0
|
|
4181
4181
|
};
|
|
4182
4182
|
};
|
|
4183
4183
|
/**
|
|
@@ -4214,10 +4214,17 @@ function Hn(h) {
|
|
|
4214
4214
|
});
|
|
4215
4215
|
}
|
|
4216
4216
|
function Ka(h, t) {
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4217
|
+
let o;
|
|
4218
|
+
const l = () => {
|
|
4219
|
+
if (o)
|
|
4220
|
+
return o;
|
|
4221
|
+
const p = indexedDB.open(h);
|
|
4222
|
+
return p.onupgradeneeded = () => p.result.createObjectStore(t), o = Hn(p), o.then((E) => {
|
|
4223
|
+
E.onclose = () => o = void 0;
|
|
4224
|
+
}, () => {
|
|
4225
|
+
}), o;
|
|
4226
|
+
};
|
|
4227
|
+
return (p, E) => l().then((C) => E(C.transaction(t, p).objectStore(t)));
|
|
4221
4228
|
}
|
|
4222
4229
|
let Un;
|
|
4223
4230
|
function Gr() {
|
|
@@ -4257,12 +4264,12 @@ class Kr {
|
|
|
4257
4264
|
if (!o.success)
|
|
4258
4265
|
return 400;
|
|
4259
4266
|
const l = Y(t);
|
|
4260
|
-
return delete o.success, delete o.message, await ke(l, o).then(() => 201).catch((
|
|
4267
|
+
return delete o.success, delete o.message, await ke(l, o).then(() => 201).catch((p) => (console.error(
|
|
4261
4268
|
"%cstorage",
|
|
4262
4269
|
c.STORAGE,
|
|
4263
4270
|
_.CLOUD,
|
|
4264
4271
|
t,
|
|
4265
|
-
|
|
4272
|
+
p.message
|
|
4266
4273
|
), 400));
|
|
4267
4274
|
};
|
|
4268
4275
|
/**
|
|
@@ -4275,12 +4282,12 @@ class Kr {
|
|
|
4275
4282
|
if (!o.success)
|
|
4276
4283
|
return 400;
|
|
4277
4284
|
const l = Y(t);
|
|
4278
|
-
return delete o.success, delete o.message, await ke(l, o).then(() => 201).catch((
|
|
4285
|
+
return delete o.success, delete o.message, await ke(l, o).then(() => 201).catch((p) => (console.error(
|
|
4279
4286
|
"%cstorage",
|
|
4280
4287
|
c.STORAGE,
|
|
4281
4288
|
_.SERIES,
|
|
4282
4289
|
t,
|
|
4283
|
-
|
|
4290
|
+
p.message
|
|
4284
4291
|
), 400));
|
|
4285
4292
|
};
|
|
4286
4293
|
/**
|
|
@@ -4293,12 +4300,12 @@ class Kr {
|
|
|
4293
4300
|
if (!o.success)
|
|
4294
4301
|
return 400;
|
|
4295
4302
|
const l = Y(t);
|
|
4296
|
-
return delete o.success, delete o.message, await ke(l, o).then(() => 201).catch((
|
|
4303
|
+
return delete o.success, delete o.message, await ke(l, o).then(() => 201).catch((p) => (console.error(
|
|
4297
4304
|
"%cstorage",
|
|
4298
4305
|
c.STORAGE,
|
|
4299
4306
|
_.MESSAGES,
|
|
4300
4307
|
t,
|
|
4301
|
-
|
|
4308
|
+
p.message
|
|
4302
4309
|
), 400));
|
|
4303
4310
|
};
|
|
4304
4311
|
cleanMessages = async (t) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((o) => o(0)));
|
|
@@ -4334,15 +4341,15 @@ class Kr {
|
|
|
4334
4341
|
data: null,
|
|
4335
4342
|
message: `Dashboard ${t.data.id} saved to storage`,
|
|
4336
4343
|
success: !0
|
|
4337
|
-
})).catch((
|
|
4344
|
+
})).catch((p) => (console.error(
|
|
4338
4345
|
"%cstorage",
|
|
4339
4346
|
c.STORAGE,
|
|
4340
4347
|
_.WIDGET,
|
|
4341
4348
|
t,
|
|
4342
|
-
|
|
4349
|
+
p.message
|
|
4343
4350
|
), {
|
|
4344
4351
|
data: null,
|
|
4345
|
-
message: `Slide ${t.data.id} save error: ${
|
|
4352
|
+
message: `Slide ${t.data.id} save error: ${p.message}`,
|
|
4346
4353
|
success: !1
|
|
4347
4354
|
}));
|
|
4348
4355
|
};
|
|
@@ -4375,15 +4382,15 @@ class Kr {
|
|
|
4375
4382
|
data: null,
|
|
4376
4383
|
message: `Widget ${t.data.id} saved to storage`,
|
|
4377
4384
|
success: !0
|
|
4378
|
-
})).catch((
|
|
4385
|
+
})).catch((p) => (console.error(
|
|
4379
4386
|
"%cstorage",
|
|
4380
4387
|
c.STORAGE,
|
|
4381
4388
|
_.WIDGET,
|
|
4382
4389
|
t,
|
|
4383
|
-
|
|
4390
|
+
p.message
|
|
4384
4391
|
), {
|
|
4385
4392
|
data: null,
|
|
4386
|
-
message: `Slide ${t.data.id} save error: ${
|
|
4393
|
+
message: `Slide ${t.data.id} save error: ${p.message}`,
|
|
4387
4394
|
success: !1
|
|
4388
4395
|
}));
|
|
4389
4396
|
};
|
|
@@ -4436,15 +4443,15 @@ class Kr {
|
|
|
4436
4443
|
data: null,
|
|
4437
4444
|
message: `Slide ${t.data.id} saved to storage`,
|
|
4438
4445
|
success: !0
|
|
4439
|
-
})).catch((
|
|
4446
|
+
})).catch((p) => (console.error(
|
|
4440
4447
|
"%cstorage",
|
|
4441
4448
|
c.STORAGE,
|
|
4442
4449
|
_.SLIDE,
|
|
4443
4450
|
t,
|
|
4444
|
-
|
|
4451
|
+
p.message
|
|
4445
4452
|
), {
|
|
4446
4453
|
data: null,
|
|
4447
|
-
message: `Slide ${t.data.id} save error: ${
|
|
4454
|
+
message: `Slide ${t.data.id} save error: ${p.message}`,
|
|
4448
4455
|
success: !1
|
|
4449
4456
|
}));
|
|
4450
4457
|
};
|
|
@@ -4472,15 +4479,15 @@ class Kr {
|
|
|
4472
4479
|
data: null,
|
|
4473
4480
|
message: `Presentation ${t.data.id} saved to storage`,
|
|
4474
4481
|
success: !0
|
|
4475
|
-
})).catch((
|
|
4482
|
+
})).catch((p) => (console.error(
|
|
4476
4483
|
"%cstorage",
|
|
4477
4484
|
c.STORAGE,
|
|
4478
4485
|
_.PRESENTATION,
|
|
4479
4486
|
t,
|
|
4480
|
-
|
|
4487
|
+
p.message
|
|
4481
4488
|
), {
|
|
4482
4489
|
data: null,
|
|
4483
|
-
message: `Presentation ${t.data.id} save error: ${
|
|
4490
|
+
message: `Presentation ${t.data.id} save error: ${p.message}`,
|
|
4484
4491
|
success: !1
|
|
4485
4492
|
}));
|
|
4486
4493
|
};
|
|
@@ -4591,8 +4598,8 @@ class Br {
|
|
|
4591
4598
|
const l = Y(t);
|
|
4592
4599
|
try {
|
|
4593
4600
|
return localStorage.setObject(l, o), 201;
|
|
4594
|
-
} catch (
|
|
4595
|
-
return console.error("%cstorage", c.STORAGE, _.CLOUD, t,
|
|
4601
|
+
} catch (p) {
|
|
4602
|
+
return console.error("%cstorage", c.STORAGE, _.CLOUD, t, p), 400;
|
|
4596
4603
|
}
|
|
4597
4604
|
};
|
|
4598
4605
|
/**
|
|
@@ -4605,8 +4612,8 @@ class Br {
|
|
|
4605
4612
|
const l = Y(t);
|
|
4606
4613
|
try {
|
|
4607
4614
|
return localStorage.setObject(l, o), 201;
|
|
4608
|
-
} catch (
|
|
4609
|
-
return console.error("%cstorage", c.STORAGE, _.SERIES, t,
|
|
4615
|
+
} catch (p) {
|
|
4616
|
+
return console.error("%cstorage", c.STORAGE, _.SERIES, t, p), 400;
|
|
4610
4617
|
}
|
|
4611
4618
|
};
|
|
4612
4619
|
/**
|
|
@@ -4619,8 +4626,8 @@ class Br {
|
|
|
4619
4626
|
const l = Y(t);
|
|
4620
4627
|
try {
|
|
4621
4628
|
return localStorage.setObject(l, o), 200;
|
|
4622
|
-
} catch (
|
|
4623
|
-
return console.error("%cstorage", c.STORAGE, _.MESSAGES, t,
|
|
4629
|
+
} catch (p) {
|
|
4630
|
+
return console.error("%cstorage", c.STORAGE, _.MESSAGES, t, p), 400;
|
|
4624
4631
|
}
|
|
4625
4632
|
};
|
|
4626
4633
|
cleanMessages = async (t) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((o) => o(0)));
|
|
@@ -4926,8 +4933,8 @@ class Lr {
|
|
|
4926
4933
|
const l = Y(t);
|
|
4927
4934
|
try {
|
|
4928
4935
|
return sessionStorage.setObject(l, o), 201;
|
|
4929
|
-
} catch (
|
|
4930
|
-
return console.error("%cstorage", c.STORAGE, _.CLOUD, t,
|
|
4936
|
+
} catch (p) {
|
|
4937
|
+
return console.error("%cstorage", c.STORAGE, _.CLOUD, t, p), 400;
|
|
4931
4938
|
}
|
|
4932
4939
|
};
|
|
4933
4940
|
/**
|
|
@@ -4940,8 +4947,8 @@ class Lr {
|
|
|
4940
4947
|
const l = Y(t);
|
|
4941
4948
|
try {
|
|
4942
4949
|
return sessionStorage.setObject(l, o), 201;
|
|
4943
|
-
} catch (
|
|
4944
|
-
return console.error("%cstorage", c.STORAGE, _.SERIES, t,
|
|
4950
|
+
} catch (p) {
|
|
4951
|
+
return console.error("%cstorage", c.STORAGE, _.SERIES, t, p), 400;
|
|
4945
4952
|
}
|
|
4946
4953
|
};
|
|
4947
4954
|
/**
|
|
@@ -4954,8 +4961,8 @@ class Lr {
|
|
|
4954
4961
|
const l = Y(t);
|
|
4955
4962
|
try {
|
|
4956
4963
|
return sessionStorage.setObject(l, o), 200;
|
|
4957
|
-
} catch (
|
|
4958
|
-
return console.error("%cstorage", c.STORAGE, _.MESSAGES, t,
|
|
4964
|
+
} catch (p) {
|
|
4965
|
+
return console.error("%cstorage", c.STORAGE, _.MESSAGES, t, p), 400;
|
|
4959
4966
|
}
|
|
4960
4967
|
};
|
|
4961
4968
|
cleanMessages = async (t) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((o) => o(0)));
|
|
@@ -5261,8 +5268,8 @@ class Wr {
|
|
|
5261
5268
|
const l = Y(t);
|
|
5262
5269
|
try {
|
|
5263
5270
|
return window.BuzzCasting.WidgetData[l] = o, 201;
|
|
5264
|
-
} catch (
|
|
5265
|
-
return console.error("%cstorage", c.STORAGE, "set", t,
|
|
5271
|
+
} catch (p) {
|
|
5272
|
+
return console.error("%cstorage", c.STORAGE, "set", t, p), 400;
|
|
5266
5273
|
}
|
|
5267
5274
|
};
|
|
5268
5275
|
/**
|
|
@@ -5275,8 +5282,8 @@ class Wr {
|
|
|
5275
5282
|
const l = Y(t);
|
|
5276
5283
|
try {
|
|
5277
5284
|
return window.BuzzCasting.WidgetData[l] = o, 201;
|
|
5278
|
-
} catch (
|
|
5279
|
-
return console.error("%cstorage", c.STORAGE, "set", t,
|
|
5285
|
+
} catch (p) {
|
|
5286
|
+
return console.error("%cstorage", c.STORAGE, "set", t, p), 400;
|
|
5280
5287
|
}
|
|
5281
5288
|
};
|
|
5282
5289
|
/**
|
|
@@ -5289,8 +5296,8 @@ class Wr {
|
|
|
5289
5296
|
const l = Y(t);
|
|
5290
5297
|
try {
|
|
5291
5298
|
return window.BuzzCasting.WidgetData[l] = o, 201;
|
|
5292
|
-
} catch (
|
|
5293
|
-
return console.error("%cstorage", c.STORAGE, "set", t,
|
|
5299
|
+
} catch (p) {
|
|
5300
|
+
return console.error("%cstorage", c.STORAGE, "set", t, p), 400;
|
|
5294
5301
|
}
|
|
5295
5302
|
};
|
|
5296
5303
|
cleanMessages = async (t) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((o) => o(0)));
|
|
@@ -5578,21 +5585,21 @@ class Ja {
|
|
|
5578
5585
|
o.push(this.api.get(l));
|
|
5579
5586
|
}), o.forEach(async (l) => {
|
|
5580
5587
|
await l.then(
|
|
5581
|
-
async (
|
|
5588
|
+
async (p) => await this.processResponse(p)
|
|
5582
5589
|
);
|
|
5583
5590
|
});
|
|
5584
5591
|
};
|
|
5585
5592
|
processResponse = async (t) => {
|
|
5586
5593
|
let o, l = 400;
|
|
5587
5594
|
if (t.success === !0) {
|
|
5588
|
-
const
|
|
5589
|
-
let
|
|
5595
|
+
const p = this.subscribers[t.query.widget];
|
|
5596
|
+
let E = "";
|
|
5590
5597
|
switch (t.query.type) {
|
|
5591
5598
|
case _.MESSAGES:
|
|
5592
5599
|
let C;
|
|
5593
5600
|
C = t.data.messages.filter(
|
|
5594
5601
|
(K) => K.id !== null
|
|
5595
|
-
), t.data.messages = C,
|
|
5602
|
+
), t.data.messages = C, E = t.data.messages.length > 0 ? Fn(t.data.messages[0].utc) : "none", p?.hash && p.hash === E ? (G(3, [
|
|
5596
5603
|
"%cload%c %cmessages%c %cno updates",
|
|
5597
5604
|
c.OK,
|
|
5598
5605
|
c.NONE,
|
|
@@ -5600,10 +5607,10 @@ class Ja {
|
|
|
5600
5607
|
c.NONE,
|
|
5601
5608
|
c.NO_UPDATES,
|
|
5602
5609
|
t.query.widget
|
|
5603
|
-
]), G(4, ["%cmessages", c.MESSAGES, t]), l = 204) : (o = t,
|
|
5610
|
+
]), G(4, ["%cmessages", c.MESSAGES, t]), l = 204) : (o = t, p.hash = E, l = await this.sm?.setMessages(t.query, t).then(async (K) => (K = 201, this.broadcastUpdate(K, t))));
|
|
5604
5611
|
break;
|
|
5605
5612
|
case _.CLOUD:
|
|
5606
|
-
|
|
5613
|
+
E = Fn(t.data.cloud), p?.hash && p.hash === E ? (G(3, [
|
|
5607
5614
|
"%cload%c %ccloud%c %cno updates",
|
|
5608
5615
|
c.OK,
|
|
5609
5616
|
c.NONE,
|
|
@@ -5611,7 +5618,7 @@ class Ja {
|
|
|
5611
5618
|
c.NONE,
|
|
5612
5619
|
c.NO_UPDATES,
|
|
5613
5620
|
t.query.widget
|
|
5614
|
-
]), G(4, ["%ccloud", c.CLOUD, t.query]), l = 204) : (
|
|
5621
|
+
]), G(4, ["%ccloud", c.CLOUD, t.query]), l = 204) : (p.hash = E, o = {
|
|
5615
5622
|
data: {
|
|
5616
5623
|
cloud: t.data
|
|
5617
5624
|
},
|
|
@@ -5621,7 +5628,7 @@ class Ja {
|
|
|
5621
5628
|
}, l = await this.sm?.setCloud(t.query, o.data).then((K) => this.broadcastUpdate(K, t)));
|
|
5622
5629
|
break;
|
|
5623
5630
|
case _.SERIES:
|
|
5624
|
-
|
|
5631
|
+
E = Fn(t.data.series), p?.hash && p.hash === E ? (G(3, [
|
|
5625
5632
|
"%cload%c %cseries%c %cno updates",
|
|
5626
5633
|
c.OK,
|
|
5627
5634
|
c.NONE,
|
|
@@ -5629,7 +5636,7 @@ class Ja {
|
|
|
5629
5636
|
c.NONE,
|
|
5630
5637
|
c.NO_UPDATES,
|
|
5631
5638
|
t.query.widget
|
|
5632
|
-
]), G(4, ["%cseries", c.SERIES, t]), l = 204) : (
|
|
5639
|
+
]), G(4, ["%cseries", c.SERIES, t]), l = 204) : (p.hash = E, o = {
|
|
5633
5640
|
data: t.data,
|
|
5634
5641
|
message: t.message,
|
|
5635
5642
|
success: t.success,
|
|
@@ -5658,16 +5665,16 @@ class Ja {
|
|
|
5658
5665
|
t.query
|
|
5659
5666
|
]), t.query.type) {
|
|
5660
5667
|
case _.MESSAGES:
|
|
5661
|
-
return await this.sm?.getMessages(t.query).then((
|
|
5662
|
-
this.broadcastUpdate(201,
|
|
5668
|
+
return await this.sm?.getMessages(t.query).then((p) => {
|
|
5669
|
+
this.broadcastUpdate(201, p);
|
|
5663
5670
|
});
|
|
5664
5671
|
case _.CLOUD:
|
|
5665
|
-
return await this.sm?.getCloud(t.query).then((
|
|
5666
|
-
this.broadcastUpdate(201,
|
|
5672
|
+
return await this.sm?.getCloud(t.query).then((p) => {
|
|
5673
|
+
this.broadcastUpdate(201, p);
|
|
5667
5674
|
});
|
|
5668
5675
|
case _.SERIES:
|
|
5669
|
-
return await this.sm?.getSeries(t.query).then((
|
|
5670
|
-
this.broadcastUpdate(201,
|
|
5676
|
+
return await this.sm?.getSeries(t.query).then((p) => {
|
|
5677
|
+
this.broadcastUpdate(201, p);
|
|
5671
5678
|
});
|
|
5672
5679
|
}
|
|
5673
5680
|
return l;
|
|
@@ -5900,10 +5907,10 @@ class Za {
|
|
|
5900
5907
|
*/
|
|
5901
5908
|
constructor(t, o, l) {
|
|
5902
5909
|
this.element = t, this.callbacks = o, l = typeof l < "u" ? l : "buzzcasting-app";
|
|
5903
|
-
let
|
|
5904
|
-
|
|
5905
|
-
const
|
|
5906
|
-
this.storageReader = new Ba(
|
|
5910
|
+
let p;
|
|
5911
|
+
p = { ...t.dataset }, delete p.hmr, p.presentation = window.BuzzCasting.getOptions()?.presentation ?? `${l} not found`, this.query = p, Da(t);
|
|
5912
|
+
const E = window.BuzzCasting.getOptions();
|
|
5913
|
+
this.storageReader = new Ba(E), this.broadcastChannel = new BroadcastChannel(p.presentation), this.broadcastListener();
|
|
5907
5914
|
}
|
|
5908
5915
|
addCallbackListener(t) {
|
|
5909
5916
|
this.callbacks.push(t);
|
|
@@ -5920,8 +5927,8 @@ class Za {
|
|
|
5920
5927
|
case X.WIDGET_UPDATE:
|
|
5921
5928
|
try {
|
|
5922
5929
|
if (l.dashboard === t.dashboard && l.widget === t.widget) {
|
|
5923
|
-
const
|
|
5924
|
-
|
|
5930
|
+
const p = await this.getData();
|
|
5931
|
+
p?.success && (G(4, [
|
|
5925
5932
|
"%cset%c %cbroadcast%c %cwidget",
|
|
5926
5933
|
c.OK,
|
|
5927
5934
|
c.NONE,
|
|
@@ -5929,8 +5936,8 @@ class Za {
|
|
|
5929
5936
|
c.NONE,
|
|
5930
5937
|
c.WIDGET,
|
|
5931
5938
|
this.query
|
|
5932
|
-
]), this.callbacks.forEach(async (
|
|
5933
|
-
|
|
5939
|
+
]), this.callbacks.forEach(async (E) => {
|
|
5940
|
+
E(p);
|
|
5934
5941
|
}));
|
|
5935
5942
|
}
|
|
5936
5943
|
} catch {
|