buzzcasting-storage 3.0.8 → 3.0.9
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 +770 -729
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var xi = Object.defineProperty;
|
|
2
2
|
var Ai = (d, r, s) => r in d ? xi(d, r, { enumerable: !0, configurable: !0, writable: !0, value: s }) : d[r] = s;
|
|
3
3
|
var k = (d, r, s) => Ai(d, typeof r != "symbol" ? r + "" : r, s);
|
|
4
|
-
var N = /* @__PURE__ */ ((d) => (d.MESSAGES = "messages", d.CLOUD = "cloud", d.SERIES = "series", d.TOPICS = "topics", d.WIDGET = "widget", d.WIDGETS = "widgets", d.SLIDE = "slide", d))(N || {}),
|
|
5
|
-
const ki = "3.0.
|
|
4
|
+
var N = /* @__PURE__ */ ((d) => (d.MESSAGES = "messages", d.CLOUD = "cloud", d.SERIES = "series", d.TOPICS = "topics", d.WIDGET = "widget", d.WIDGETS = "widgets", d.SLIDE = "slide", d))(N || {}), w = /* @__PURE__ */ ((d) => (d.API = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;", d.APP = "color:white;background-color:navy;padding:0 4px 0 4px;border-radius:5px;", d.BROADCAST = "color:white;background-color:orange;padding:0 4px 0 4px;border-radius:5px;", d.DATA = "color:grey;background-color:lightskyblue;padding:0 4px 0 4px;border-radius:5px;", d.CLOUD = "color:grey;background-color:mistyrose;padding:0 4px 0 4px;border-radius:5px;", d.GET_DATA = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", d.HIDE = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", d.MESSAGES = "color:white;background-color:darkslateblue;padding:0 4px 0 4px;border-radius:5px;", d.NO_UPDATES = "color:grey;border:1px solid grey;padding:0 4px 0 4px;border-radius:5px;", d.NONE = "color:transparent;background-color:transparent;", d.PRESENTATION = "color:white;background-color:darkred;padding:0 4px 0 4px;border-radius:5px;", d.SERIES = "color:grey;background-color:thistle;padding:0 4px 0 4px;border-radius:5px;", d.SLIDE = "color:black;background-color:yellow;padding:0 4px 0 4px;border-radius:5px;", d.STORAGE = "color:black;background-color:cyan;padding:0 4px 0 4px;border-radius:5px;", d.SUBSCRIBE = "color:white;background-color:dodgerblue;padding:0 4px 0 4px;border-radius:5px;", d.WIDGET = "color:gret;background-color:lemonchiffon;padding:0 4px 0 4px;border-radius:5px;", d.WS = "color:white;background-color:green;padding:0 4px 0 4px;border-radius:5px;", d))(w || {}), re = /* @__PURE__ */ ((d) => (d.ADD_SLIDE = "addSlide", d.APP_READY = "appReady", d.API_UPDATE = "apiUpdate", d.APPROVE_MESSAGE = "approveMessage", d.CHANNEL = "channel", d.CLEAN_MESSAGES = "cleanMessages", d.CLOSE_MODAL = "closeModal", d.CLOSE_BUILDER_MODAL = "closeBuilderModal", d.ERROR = "error", d.HIDE_MESSAGE = "hideMessage", d.HIDE_LABELS = "hideLabels", d.PAUSE_PRESENTATION = "pausePresentation", d.PRESENTATION_READY = "presentationReady", d.PREV_SLIDE = "prevSlide", d.RELOAD_PRESENTATION = "reloadPresentation", d.SHOW_MODAL = "showModal", d.STAR_MESSAGE = "starMessage", d.GOTO_SLIDE = "gotoSlide", d.NEXT_SLIDE = "nextSlide", d.SHOW_BUILDER_MODAL = "showBuilderModal", d.SLIDE_DID_LOAD = "slideDidLoad", d.SLIDE_GOTO = "slideGoto", d.SLIDE_READY = "slideReady", d.SLIDE_LOAD = "loadSlide", d.SLIDE_STORE = "storeSlide", d.SLIDE_TRANSITIONER = "slideTransitioner", d.START_TRANSITIONER = "startTransitioner", d.STORAGE_INIT = "storageInit", d.SUBSCRIBE = "subscribe", d.SUSPEND_ACCOUNT = "suspendAccount", d.REMOVE_CLOUD = "removeCloud", d.UPDATE = "update", d.VERSION = "version", d.WIDGET_UPDATE = "widgetUpdate", d))(re || {}), Zt = /* @__PURE__ */ ((d) => (d.APPROVED = "approved", d.BEFORE = "before", d.DELAYED = "delayed", d.NONE = "none", d.REALTIME = "realtime", d))(Zt || {}), ge = /* @__PURE__ */ ((d) => (d.KEYVAL = "keyval", d.LOCAL = "local", d.SESSION = "session", d.DEXIE = "dexie", d.WINDOW = "window", d))(ge || {});
|
|
5
|
+
const ki = "3.0.8";
|
|
6
6
|
class Di {
|
|
7
7
|
constructor(r) {
|
|
8
8
|
k(this, "options");
|
|
@@ -37,27 +37,26 @@ class Di {
|
|
|
37
37
|
const D = Object.keys(x).length > 0 ? `?${new URLSearchParams(x).toString()}` : "";
|
|
38
38
|
return console.info(
|
|
39
39
|
"%capi%c %cfetch",
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
r.slide,
|
|
40
|
+
w.API,
|
|
41
|
+
w.NONE,
|
|
42
|
+
w.GET_DATA,
|
|
44
43
|
r.widget
|
|
45
|
-
), console.debug(x), await fetch(
|
|
44
|
+
), console.debug("%capi%c %cfetch", w.API, w.NONE, w.GET_DATA, x), await fetch(
|
|
46
45
|
[this.url, "api", s, r.type].join("/") + D,
|
|
47
46
|
{ ...l, method: "get" }
|
|
48
|
-
).then(async (
|
|
49
|
-
if (!
|
|
50
|
-
throw new Error(`${
|
|
51
|
-
return
|
|
52
|
-
}).then((
|
|
47
|
+
).then(async (j) => {
|
|
48
|
+
if (!j.ok)
|
|
49
|
+
throw new Error(`${j.status}`);
|
|
50
|
+
return j;
|
|
51
|
+
}).then((j) => j.json()).then((j) => (j.query = r, j)).catch((j) => ({ success: !1, message: `${j}`, data: null }));
|
|
53
52
|
}
|
|
54
53
|
async hideMessage(r) {
|
|
55
54
|
const { version: s } = this.options, l = this.headers(), x = "?action=visible";
|
|
56
55
|
return console.info(
|
|
57
56
|
"%capi%c %cput",
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
w.API,
|
|
58
|
+
w.NONE,
|
|
59
|
+
w.GET_DATA,
|
|
61
60
|
re.HIDE_MESSAGE,
|
|
62
61
|
r.widget,
|
|
63
62
|
r.id
|
|
@@ -72,32 +71,32 @@ class Di {
|
|
|
72
71
|
}
|
|
73
72
|
async hideLabels(r) {
|
|
74
73
|
const { version: s } = this.options, l = this.formHeaders(), x = new URLSearchParams(), D = r.labels || [];
|
|
75
|
-
for (const [
|
|
76
|
-
x.append(`custom_filters[${
|
|
74
|
+
for (const [j, P] of D.entries())
|
|
75
|
+
x.append(`custom_filters[${j}]`, P);
|
|
77
76
|
return console.info(
|
|
78
77
|
"%capi%c %cput",
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
w.API,
|
|
79
|
+
w.NONE,
|
|
80
|
+
w.GET_DATA,
|
|
82
81
|
re.HIDE_LABELS,
|
|
83
82
|
r.widget,
|
|
84
83
|
D
|
|
85
84
|
), await fetch(
|
|
86
85
|
[this.url, "api", s, r.type, r.widget].join("/"),
|
|
87
86
|
{ ...l, body: x, method: "put" }
|
|
88
|
-
).then((
|
|
89
|
-
if (!
|
|
90
|
-
throw new Error(
|
|
91
|
-
return
|
|
92
|
-
}).then((
|
|
87
|
+
).then((j) => {
|
|
88
|
+
if (!j.ok)
|
|
89
|
+
throw new Error(j.statusText);
|
|
90
|
+
return j;
|
|
91
|
+
}).then((j) => j.json()).catch((j) => ({ succes: !1, message: j, data: [] }));
|
|
93
92
|
}
|
|
94
93
|
async loadSlide(r) {
|
|
95
94
|
const { version: s } = this.options, l = this.headers(), x = Object.assign({}, r);
|
|
96
95
|
return delete x.slide, delete x.type, delete x.hash, console.debug(
|
|
97
96
|
"%capi%c %cloadSlide",
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
97
|
+
w.API,
|
|
98
|
+
w.NONE,
|
|
99
|
+
w.SLIDE,
|
|
101
100
|
re.SLIDE_LOAD,
|
|
102
101
|
r.slide
|
|
103
102
|
), await fetch(
|
|
@@ -122,9 +121,9 @@ class Di {
|
|
|
122
121
|
const x = JSON.stringify(r);
|
|
123
122
|
return console.info(
|
|
124
123
|
"%capi%c %cput",
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
124
|
+
w.API,
|
|
125
|
+
w.NONE,
|
|
126
|
+
w.SLIDE,
|
|
128
127
|
re.SLIDE_STORE,
|
|
129
128
|
r.id
|
|
130
129
|
), await fetch(
|
|
@@ -141,7 +140,7 @@ var Cr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
141
140
|
function Pi(d) {
|
|
142
141
|
return d && d.__esModule && Object.prototype.hasOwnProperty.call(d, "default") ? d.default : d;
|
|
143
142
|
}
|
|
144
|
-
var
|
|
143
|
+
var Tr = { exports: {} };
|
|
145
144
|
(function(d, r) {
|
|
146
145
|
(function(s, l) {
|
|
147
146
|
d.exports = l();
|
|
@@ -162,25 +161,25 @@ var Mr = { exports: {} };
|
|
|
162
161
|
for (var i, o = 0, a = t.length; o < a; o++) !i && o in t || ((i = i || Array.prototype.slice.call(t, 0, o))[o] = t[o]);
|
|
163
162
|
return e.concat(i || Array.prototype.slice.call(t));
|
|
164
163
|
}
|
|
165
|
-
var D = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Cr,
|
|
166
|
-
function
|
|
167
|
-
return typeof t != "object" ||
|
|
164
|
+
var D = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Cr, j = Object.keys, P = Array.isArray;
|
|
165
|
+
function Y(e, t) {
|
|
166
|
+
return typeof t != "object" || j(t).forEach(function(n) {
|
|
168
167
|
e[n] = t[n];
|
|
169
168
|
}), e;
|
|
170
169
|
}
|
|
171
170
|
typeof Promise > "u" || D.Promise || (D.Promise = Promise);
|
|
172
|
-
var
|
|
173
|
-
function
|
|
171
|
+
var Z = Object.getPrototypeOf, ve = {}.hasOwnProperty;
|
|
172
|
+
function X(e, t) {
|
|
174
173
|
return ve.call(e, t);
|
|
175
174
|
}
|
|
176
175
|
function pe(e, t) {
|
|
177
|
-
typeof t == "function" && (t = t(
|
|
176
|
+
typeof t == "function" && (t = t(Z(e))), (typeof Reflect > "u" ? j : Reflect.ownKeys)(t).forEach(function(n) {
|
|
178
177
|
Ae(e, n, t[n]);
|
|
179
178
|
});
|
|
180
179
|
}
|
|
181
180
|
var He = Object.defineProperty;
|
|
182
181
|
function Ae(e, t, n, i) {
|
|
183
|
-
He(e, t,
|
|
182
|
+
He(e, t, Y(n && X(n, "get") && typeof n.get == "function" ? { get: n.get, set: n.set, configurable: !0 } : { value: n, configurable: !0, writable: !0 }, i));
|
|
184
183
|
}
|
|
185
184
|
function Ye(e) {
|
|
186
185
|
return { from: function(t) {
|
|
@@ -201,7 +200,7 @@ var Mr = { exports: {} };
|
|
|
201
200
|
D.setImmediate ? setImmediate(e) : setTimeout(e, 0);
|
|
202
201
|
}
|
|
203
202
|
function we(e, t) {
|
|
204
|
-
if (typeof t == "string" &&
|
|
203
|
+
if (typeof t == "string" && X(e, t)) return e[t];
|
|
205
204
|
if (!t) return e;
|
|
206
205
|
if (typeof t != "string") {
|
|
207
206
|
for (var n = [], i = 0, o = t.length; i < o; ++i) {
|
|
@@ -222,12 +221,12 @@ var Mr = { exports: {} };
|
|
|
222
221
|
for (var i = 0, o = t.length; i < o; ++i) le(e, t[i], n[i]);
|
|
223
222
|
} else {
|
|
224
223
|
var a, c, u = t.indexOf(".");
|
|
225
|
-
u !== -1 ? (a = t.substr(0, u), (c = t.substr(u + 1)) === "" ? n === void 0 ?
|
|
224
|
+
u !== -1 ? (a = t.substr(0, u), (c = t.substr(u + 1)) === "" ? n === void 0 ? P(e) && !isNaN(parseInt(a)) ? e.splice(a, 1) : delete e[a] : e[a] = n : le(u = !(u = e[a]) || !X(e, a) ? e[a] = {} : u, c, n)) : n === void 0 ? P(e) && !isNaN(parseInt(t)) ? e.splice(t, 1) : delete e[t] : e[t] = n;
|
|
226
225
|
}
|
|
227
226
|
}
|
|
228
227
|
function Yn(e) {
|
|
229
228
|
var t, n = {};
|
|
230
|
-
for (t in e)
|
|
229
|
+
for (t in e) X(e, t) && (n[t] = e[t]);
|
|
231
230
|
return n;
|
|
232
231
|
}
|
|
233
232
|
var Wr = [].concat;
|
|
@@ -243,18 +242,18 @@ var Mr = { exports: {} };
|
|
|
243
242
|
}), Xn = new Set(Ee.map(function(e) {
|
|
244
243
|
return D[e];
|
|
245
244
|
})), ot = null;
|
|
246
|
-
function
|
|
245
|
+
function Me(e) {
|
|
247
246
|
return ot = /* @__PURE__ */ new WeakMap(), e = function t(n) {
|
|
248
247
|
if (!n || typeof n != "object") return n;
|
|
249
248
|
var i = ot.get(n);
|
|
250
249
|
if (i) return i;
|
|
251
|
-
if (
|
|
250
|
+
if (P(n)) {
|
|
252
251
|
i = [], ot.set(n, i);
|
|
253
252
|
for (var o = 0, a = n.length; o < a; ++o) i.push(t(n[o]));
|
|
254
253
|
} else if (Xn.has(n.constructor)) i = n;
|
|
255
254
|
else {
|
|
256
|
-
var c, u =
|
|
257
|
-
for (c in i = u === Object.prototype ? {} : Object.create(u), ot.set(n, i), n)
|
|
255
|
+
var c, u = Z(n);
|
|
256
|
+
for (c in i = u === Object.prototype ? {} : Object.create(u), ot.set(n, i), n) X(n, c) && (i[c] = t(n[c]));
|
|
258
257
|
}
|
|
259
258
|
return i;
|
|
260
259
|
}(e), ot = null, e;
|
|
@@ -276,7 +275,7 @@ var Mr = { exports: {} };
|
|
|
276
275
|
function _e(e) {
|
|
277
276
|
var t, n, i, o;
|
|
278
277
|
if (arguments.length === 1) {
|
|
279
|
-
if (
|
|
278
|
+
if (P(e)) return e.slice();
|
|
280
279
|
if (this === Qe && typeof e == "string") return [e];
|
|
281
280
|
if (o = Hr(e)) {
|
|
282
281
|
for (n = []; !(i = o.next()).done; ) n.push(i.value);
|
|
@@ -333,7 +332,7 @@ var Mr = { exports: {} };
|
|
|
333
332
|
}, {}), Ot = he.reduce(function(e, t) {
|
|
334
333
|
return ["Syntax", "Type", "Range"].indexOf(t) === -1 && (e[t + "Error"] = $[t]), e;
|
|
335
334
|
}, {});
|
|
336
|
-
function
|
|
335
|
+
function J() {
|
|
337
336
|
}
|
|
338
337
|
function at(e) {
|
|
339
338
|
return e;
|
|
@@ -349,7 +348,7 @@ var Mr = { exports: {} };
|
|
|
349
348
|
};
|
|
350
349
|
}
|
|
351
350
|
function Jr(e, t) {
|
|
352
|
-
return e ===
|
|
351
|
+
return e === J ? t : function() {
|
|
353
352
|
var n = e.apply(this, arguments);
|
|
354
353
|
n !== void 0 && (arguments[0] = n);
|
|
355
354
|
var i = this.onsuccess, o = this.onerror;
|
|
@@ -359,27 +358,27 @@ var Mr = { exports: {} };
|
|
|
359
358
|
};
|
|
360
359
|
}
|
|
361
360
|
function Vr(e, t) {
|
|
362
|
-
return e ===
|
|
361
|
+
return e === J ? t : function() {
|
|
363
362
|
e.apply(this, arguments);
|
|
364
363
|
var n = this.onsuccess, i = this.onerror;
|
|
365
364
|
this.onsuccess = this.onerror = null, t.apply(this, arguments), n && (this.onsuccess = this.onsuccess ? Ke(n, this.onsuccess) : n), i && (this.onerror = this.onerror ? Ke(i, this.onerror) : i);
|
|
366
365
|
};
|
|
367
366
|
}
|
|
368
367
|
function Zr(e, t) {
|
|
369
|
-
return e ===
|
|
368
|
+
return e === J ? t : function(n) {
|
|
370
369
|
var i = e.apply(this, arguments);
|
|
371
|
-
|
|
370
|
+
Y(n, i);
|
|
372
371
|
var o = this.onsuccess, a = this.onerror;
|
|
373
|
-
return this.onsuccess = null, this.onerror = null, n = t.apply(this, arguments), o && (this.onsuccess = this.onsuccess ? Ke(o, this.onsuccess) : o), a && (this.onerror = this.onerror ? Ke(a, this.onerror) : a), i === void 0 ? n === void 0 ? void 0 : n :
|
|
372
|
+
return this.onsuccess = null, this.onerror = null, n = t.apply(this, arguments), o && (this.onsuccess = this.onsuccess ? Ke(o, this.onsuccess) : o), a && (this.onerror = this.onerror ? Ke(a, this.onerror) : a), i === void 0 ? n === void 0 ? void 0 : n : Y(i, n);
|
|
374
373
|
};
|
|
375
374
|
}
|
|
376
375
|
function qr(e, t) {
|
|
377
|
-
return e ===
|
|
376
|
+
return e === J ? t : function() {
|
|
378
377
|
return t.apply(this, arguments) !== !1 && e.apply(this, arguments);
|
|
379
378
|
};
|
|
380
379
|
}
|
|
381
380
|
function on(e, t) {
|
|
382
|
-
return e ===
|
|
381
|
+
return e === J ? t : function() {
|
|
383
382
|
var n = e.apply(this, arguments);
|
|
384
383
|
if (n && typeof n.then == "function") {
|
|
385
384
|
for (var i = this, o = arguments.length, a = new Array(o); o--; ) a[o] = arguments[o];
|
|
@@ -397,12 +396,12 @@ var Mr = { exports: {} };
|
|
|
397
396
|
}
|
|
398
397
|
var st = {}, qn = 100, Ee = typeof Promise > "u" ? [] : function() {
|
|
399
398
|
var e = Promise.resolve();
|
|
400
|
-
if (typeof crypto > "u" || !crypto.subtle) return [e,
|
|
399
|
+
if (typeof crypto > "u" || !crypto.subtle) return [e, Z(e), e];
|
|
401
400
|
var t = crypto.subtle.digest("SHA-512", new Uint8Array([0]));
|
|
402
|
-
return [t,
|
|
401
|
+
return [t, Z(t), e];
|
|
403
402
|
}(), ct = Ee[0], he = Ee[1], Ee = Ee[2], he = he && he.then, Ne = ct && ct.constructor, an = !!Ee, ut = function(e, t) {
|
|
404
403
|
lt.push([e, t]), xt && (queueMicrotask(ti), xt = !1);
|
|
405
|
-
}, sn = !0, xt = !0, Be = [], At = [], cn = at, ke = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled:
|
|
404
|
+
}, sn = !0, xt = !0, Be = [], At = [], cn = at, ke = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: J, pgp: !1, env: {}, finalize: J }, G = ke, lt = [], Le = 0, kt = [];
|
|
406
405
|
function B(e) {
|
|
407
406
|
if (typeof this != "object") throw new TypeError("Promises must be constructed via new");
|
|
408
407
|
this._listeners = [], this._lib = !1;
|
|
@@ -634,7 +633,7 @@ var Mr = { exports: {} };
|
|
|
634
633
|
var ie = { awaits: 0, echoes: 0, id: 0 }, ni = 0, Pt = [], It = 0, Ct = 0, ri = 0;
|
|
635
634
|
function De(e, t, n, i) {
|
|
636
635
|
var o = G, a = Object.create(o);
|
|
637
|
-
return a.parent = o, a.ref = 0, a.global = !1, a.id = ++ri, ke.env, a.env = an ? { Promise: B, PromiseProp: { value: B, configurable: !0, writable: !0 }, all: B.all, race: B.race, allSettled: B.allSettled, any: B.any, resolve: B.resolve, reject: B.reject } : {}, t &&
|
|
636
|
+
return a.parent = o, a.ref = 0, a.global = !1, a.id = ++ri, ke.env, a.env = an ? { Promise: B, PromiseProp: { value: B, configurable: !0, writable: !0 }, all: B.all, race: B.race, allSettled: B.allSettled, any: B.any, resolve: B.resolve, reject: B.reject } : {}, t && Y(a, t), ++o.ref, a.finalize = function() {
|
|
638
637
|
--this.parent.ref || this.parent.finalize();
|
|
639
638
|
}, i = Ge(a, e, n, i), a.ref === 0 && a.finalize(), i;
|
|
640
639
|
}
|
|
@@ -687,19 +686,19 @@ var Mr = { exports: {} };
|
|
|
687
686
|
function hn(e) {
|
|
688
687
|
Promise === Ne && ie.echoes === 0 ? It === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
|
|
689
688
|
}
|
|
690
|
-
("" + he).indexOf("[native code]") === -1 && (qe = Pe =
|
|
691
|
-
var te = B.reject, $e = "", Se = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", ir = "String expected.", et = [],
|
|
689
|
+
("" + he).indexOf("[native code]") === -1 && (qe = Pe = J);
|
|
690
|
+
var te = B.reject, $e = "", Se = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", ir = "String expected.", et = [], Tt = "__dbnames", pn = "readonly", gn = "readwrite";
|
|
692
691
|
function Fe(e, t) {
|
|
693
692
|
return e ? t ? function() {
|
|
694
693
|
return e.apply(this, arguments) && t.apply(this, arguments);
|
|
695
694
|
} : e : t;
|
|
696
695
|
}
|
|
697
696
|
var or = { type: 3, lower: -1 / 0, lowerOpen: !1, upper: [[]], upperOpen: !1 };
|
|
698
|
-
function
|
|
697
|
+
function Mt(e) {
|
|
699
698
|
return typeof e != "string" || /\./.test(e) ? function(t) {
|
|
700
699
|
return t;
|
|
701
700
|
} : function(t) {
|
|
702
|
-
return t[e] === void 0 && e in t && delete (t =
|
|
701
|
+
return t[e] === void 0 && e in t && delete (t = Me(t))[e], t;
|
|
703
702
|
};
|
|
704
703
|
}
|
|
705
704
|
function ar() {
|
|
@@ -739,7 +738,7 @@ var Mr = { exports: {} };
|
|
|
739
738
|
function cr(e) {
|
|
740
739
|
return e instanceof Uint8Array ? e : ArrayBuffer.isView(e) ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : new Uint8Array(e);
|
|
741
740
|
}
|
|
742
|
-
var ur = (
|
|
741
|
+
var ur = (q.prototype._trans = function(e, t, n) {
|
|
743
742
|
var i = this._tx || G.trans, o = this.name, a = ye && typeof console < "u" && console.createTask && console.createTask("Dexie: ".concat(e === "readonly" ? "read" : "write", " ").concat(this.name));
|
|
744
743
|
function c(g, b, f) {
|
|
745
744
|
if (!f.schema[o]) throw new $.NotFound("Table " + o + " not part of transaction");
|
|
@@ -749,14 +748,14 @@ var Mr = { exports: {} };
|
|
|
749
748
|
try {
|
|
750
749
|
var h = i && i.db._novip === this.db._novip ? i === G.trans ? i._promise(e, c, n) : De(function() {
|
|
751
750
|
return i._promise(e, c, n);
|
|
752
|
-
}, { trans: i, transless: G.transless || G }) : function g(b, f,
|
|
751
|
+
}, { trans: i, transless: G.transless || G }) : function g(b, f, _, p) {
|
|
753
752
|
if (b.idbdb && (b._state.openComplete || G.letThrough || b._vip)) {
|
|
754
|
-
var m = b._createTransaction(f,
|
|
753
|
+
var m = b._createTransaction(f, _, b._dbSchema);
|
|
755
754
|
try {
|
|
756
755
|
m.create(), b._state.PR1398_maxLoop = 3;
|
|
757
756
|
} catch (v) {
|
|
758
757
|
return v.name === rn.InvalidState && b.isOpen() && 0 < --b._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), b.close({ disableAutoOpen: !1 }), b.open().then(function() {
|
|
759
|
-
return g(b, f,
|
|
758
|
+
return g(b, f, _, p);
|
|
760
759
|
})) : te(v);
|
|
761
760
|
}
|
|
762
761
|
return m._promise(f, function(v, y) {
|
|
@@ -776,10 +775,10 @@ var Mr = { exports: {} };
|
|
|
776
775
|
if (b._state.openComplete) return te(new $.DatabaseClosed(b._state.dbOpenError));
|
|
777
776
|
if (!b._state.isBeingOpened) {
|
|
778
777
|
if (!b._state.autoOpen) return te(new $.DatabaseClosed());
|
|
779
|
-
b.open().catch(
|
|
778
|
+
b.open().catch(J);
|
|
780
779
|
}
|
|
781
780
|
return b._state.dbReadyPromise.then(function() {
|
|
782
|
-
return g(b, f,
|
|
781
|
+
return g(b, f, _, p);
|
|
783
782
|
});
|
|
784
783
|
}(this.db, e, [this.name], c);
|
|
785
784
|
return a && (h._consoleTask = a, h = h.catch(function(g) {
|
|
@@ -788,17 +787,17 @@ var Mr = { exports: {} };
|
|
|
788
787
|
} finally {
|
|
789
788
|
u && Ze();
|
|
790
789
|
}
|
|
791
|
-
},
|
|
790
|
+
}, q.prototype.get = function(e, t) {
|
|
792
791
|
var n = this;
|
|
793
792
|
return e && e.constructor === Object ? this.where(e).first(t) : e == null ? te(new $.Type("Invalid argument to Table.get()")) : this._trans("readonly", function(i) {
|
|
794
793
|
return n.core.get({ trans: i, key: e }).then(function(o) {
|
|
795
794
|
return n.hook.reading.fire(o);
|
|
796
795
|
});
|
|
797
796
|
}).then(t);
|
|
798
|
-
},
|
|
797
|
+
}, q.prototype.where = function(e) {
|
|
799
798
|
if (typeof e == "string") return new this.db.WhereClause(this, e);
|
|
800
|
-
if (
|
|
801
|
-
var t =
|
|
799
|
+
if (P(e)) return new this.db.WhereClause(this, "[".concat(e.join("+"), "]"));
|
|
800
|
+
var t = j(e);
|
|
802
801
|
if (t.length === 1) return this.where(t[0]).equals(e[t[0]]);
|
|
803
802
|
var n = this.schema.indexes.concat(this.schema.primKey).filter(function(u) {
|
|
804
803
|
if (u.compound && t.every(function(g) {
|
|
@@ -823,35 +822,35 @@ var Mr = { exports: {} };
|
|
|
823
822
|
return H(u, h) === 0;
|
|
824
823
|
}
|
|
825
824
|
var c = t.reduce(function(f, h) {
|
|
826
|
-
var g = f[0], b = f[1], f = i[h],
|
|
825
|
+
var g = f[0], b = f[1], f = i[h], _ = e[h];
|
|
827
826
|
return [g || f, g || !f ? Fe(b, f && f.multi ? function(p) {
|
|
828
|
-
return p = we(p, h),
|
|
829
|
-
return o(
|
|
827
|
+
return p = we(p, h), P(p) && p.some(function(m) {
|
|
828
|
+
return o(_, m);
|
|
830
829
|
});
|
|
831
830
|
} : function(p) {
|
|
832
|
-
return o(
|
|
831
|
+
return o(_, we(p, h));
|
|
833
832
|
}) : b];
|
|
834
833
|
}, [null, null]), a = c[0], c = c[1];
|
|
835
834
|
return a ? this.where(a.name).equals(e[a.keyPath]).filter(c) : n ? this.filter(c) : this.where(t).equals("");
|
|
836
|
-
},
|
|
835
|
+
}, q.prototype.filter = function(e) {
|
|
837
836
|
return this.toCollection().and(e);
|
|
838
|
-
},
|
|
837
|
+
}, q.prototype.count = function(e) {
|
|
839
838
|
return this.toCollection().count(e);
|
|
840
|
-
},
|
|
839
|
+
}, q.prototype.offset = function(e) {
|
|
841
840
|
return this.toCollection().offset(e);
|
|
842
|
-
},
|
|
841
|
+
}, q.prototype.limit = function(e) {
|
|
843
842
|
return this.toCollection().limit(e);
|
|
844
|
-
},
|
|
843
|
+
}, q.prototype.each = function(e) {
|
|
845
844
|
return this.toCollection().each(e);
|
|
846
|
-
},
|
|
845
|
+
}, q.prototype.toArray = function(e) {
|
|
847
846
|
return this.toCollection().toArray(e);
|
|
848
|
-
},
|
|
847
|
+
}, q.prototype.toCollection = function() {
|
|
849
848
|
return new this.db.Collection(new this.db.WhereClause(this));
|
|
850
|
-
},
|
|
851
|
-
return new this.db.Collection(new this.db.WhereClause(this,
|
|
852
|
-
},
|
|
849
|
+
}, q.prototype.orderBy = function(e) {
|
|
850
|
+
return new this.db.Collection(new this.db.WhereClause(this, P(e) ? "[".concat(e.join("+"), "]") : e));
|
|
851
|
+
}, q.prototype.reverse = function() {
|
|
853
852
|
return this.toCollection().reverse();
|
|
854
|
-
},
|
|
853
|
+
}, q.prototype.mapToClass = function(e) {
|
|
855
854
|
var t, n = this.db, i = this.name;
|
|
856
855
|
function o() {
|
|
857
856
|
return t !== null && t.apply(this, arguments) || this;
|
|
@@ -867,7 +866,7 @@ var Mr = { exports: {} };
|
|
|
867
866
|
}, enumerable: !1, configurable: !0 }), o.prototype.table = function() {
|
|
868
867
|
return i;
|
|
869
868
|
}, e = o);
|
|
870
|
-
for (var a = /* @__PURE__ */ new Set(), c = e.prototype; c; c =
|
|
869
|
+
for (var a = /* @__PURE__ */ new Set(), c = e.prototype; c; c = Z(c)) Object.getOwnPropertyNames(c).forEach(function(h) {
|
|
871
870
|
return a.add(h);
|
|
872
871
|
});
|
|
873
872
|
function u(h) {
|
|
@@ -880,13 +879,13 @@ var Mr = { exports: {} };
|
|
|
880
879
|
return b;
|
|
881
880
|
}
|
|
882
881
|
return this.schema.readHook && this.hook.reading.unsubscribe(this.schema.readHook), this.schema.readHook = u, this.hook("reading", u), e;
|
|
883
|
-
},
|
|
882
|
+
}, q.prototype.defineClass = function() {
|
|
884
883
|
return this.mapToClass(function(e) {
|
|
885
|
-
|
|
884
|
+
Y(this, e);
|
|
886
885
|
});
|
|
887
|
-
},
|
|
886
|
+
}, q.prototype.add = function(e, t) {
|
|
888
887
|
var n = this, i = this.schema.primKey, o = i.auto, a = i.keyPath, c = e;
|
|
889
|
-
return a && o && (c =
|
|
888
|
+
return a && o && (c = Mt(a)(e)), this._trans("readwrite", function(u) {
|
|
890
889
|
return n.core.mutate({ trans: u, type: "add", keys: t != null ? [t] : null, values: [c] });
|
|
891
890
|
}).then(function(u) {
|
|
892
891
|
return u.numFailures ? B.reject(u.failures[0]) : u.lastResult;
|
|
@@ -897,11 +896,11 @@ var Mr = { exports: {} };
|
|
|
897
896
|
}
|
|
898
897
|
return u;
|
|
899
898
|
});
|
|
900
|
-
},
|
|
901
|
-
return typeof e != "object" ||
|
|
902
|
-
},
|
|
899
|
+
}, q.prototype.update = function(e, t) {
|
|
900
|
+
return typeof e != "object" || P(e) ? this.where(":id").equals(e).modify(t) : (e = we(e, this.schema.primKey.keyPath), e === void 0 ? te(new $.InvalidArgument("Given object does not contain its primary key")) : this.where(":id").equals(e).modify(t));
|
|
901
|
+
}, q.prototype.put = function(e, t) {
|
|
903
902
|
var n = this, i = this.schema.primKey, o = i.auto, a = i.keyPath, c = e;
|
|
904
|
-
return a && o && (c =
|
|
903
|
+
return a && o && (c = Mt(a)(e)), this._trans("readwrite", function(u) {
|
|
905
904
|
return n.core.mutate({ trans: u, type: "put", values: [c], keys: t != null ? [t] : null });
|
|
906
905
|
}).then(function(u) {
|
|
907
906
|
return u.numFailures ? B.reject(u.failures[0]) : u.lastResult;
|
|
@@ -912,21 +911,21 @@ var Mr = { exports: {} };
|
|
|
912
911
|
}
|
|
913
912
|
return u;
|
|
914
913
|
});
|
|
915
|
-
},
|
|
914
|
+
}, q.prototype.delete = function(e) {
|
|
916
915
|
var t = this;
|
|
917
916
|
return this._trans("readwrite", function(n) {
|
|
918
917
|
return t.core.mutate({ trans: n, type: "delete", keys: [e] });
|
|
919
918
|
}).then(function(n) {
|
|
920
919
|
return n.numFailures ? B.reject(n.failures[0]) : void 0;
|
|
921
920
|
});
|
|
922
|
-
},
|
|
921
|
+
}, q.prototype.clear = function() {
|
|
923
922
|
var e = this;
|
|
924
923
|
return this._trans("readwrite", function(t) {
|
|
925
924
|
return e.core.mutate({ trans: t, type: "deleteRange", range: or });
|
|
926
925
|
}).then(function(t) {
|
|
927
926
|
return t.numFailures ? B.reject(t.failures[0]) : void 0;
|
|
928
927
|
});
|
|
929
|
-
},
|
|
928
|
+
}, q.prototype.bulkGet = function(e) {
|
|
930
929
|
var t = this;
|
|
931
930
|
return this._trans("readonly", function(n) {
|
|
932
931
|
return t.core.getMany({ keys: e, trans: n }).then(function(i) {
|
|
@@ -935,33 +934,33 @@ var Mr = { exports: {} };
|
|
|
935
934
|
});
|
|
936
935
|
});
|
|
937
936
|
});
|
|
938
|
-
},
|
|
937
|
+
}, q.prototype.bulkAdd = function(e, t, n) {
|
|
939
938
|
var i = this, o = Array.isArray(t) ? t : void 0, a = (n = n || (o ? void 0 : t)) ? n.allKeys : void 0;
|
|
940
939
|
return this._trans("readwrite", function(c) {
|
|
941
940
|
var g = i.schema.primKey, u = g.auto, g = g.keyPath;
|
|
942
941
|
if (g && o) throw new $.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
|
|
943
942
|
if (o && o.length !== e.length) throw new $.InvalidArgument("Arguments objects and keys must have the same length");
|
|
944
|
-
var h = e.length, g = g && u ? e.map(
|
|
943
|
+
var h = e.length, g = g && u ? e.map(Mt(g)) : e;
|
|
945
944
|
return i.core.mutate({ trans: c, type: "add", keys: o, values: g, wantResults: a }).then(function(m) {
|
|
946
|
-
var f = m.numFailures,
|
|
947
|
-
if (f === 0) return a ?
|
|
945
|
+
var f = m.numFailures, _ = m.results, p = m.lastResult, m = m.failures;
|
|
946
|
+
if (f === 0) return a ? _ : p;
|
|
948
947
|
throw new Je("".concat(i.name, ".bulkAdd(): ").concat(f, " of ").concat(h, " operations failed"), m);
|
|
949
948
|
});
|
|
950
949
|
});
|
|
951
|
-
},
|
|
950
|
+
}, q.prototype.bulkPut = function(e, t, n) {
|
|
952
951
|
var i = this, o = Array.isArray(t) ? t : void 0, a = (n = n || (o ? void 0 : t)) ? n.allKeys : void 0;
|
|
953
952
|
return this._trans("readwrite", function(c) {
|
|
954
953
|
var g = i.schema.primKey, u = g.auto, g = g.keyPath;
|
|
955
954
|
if (g && o) throw new $.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
|
|
956
955
|
if (o && o.length !== e.length) throw new $.InvalidArgument("Arguments objects and keys must have the same length");
|
|
957
|
-
var h = e.length, g = g && u ? e.map(
|
|
956
|
+
var h = e.length, g = g && u ? e.map(Mt(g)) : e;
|
|
958
957
|
return i.core.mutate({ trans: c, type: "put", keys: o, values: g, wantResults: a }).then(function(m) {
|
|
959
|
-
var f = m.numFailures,
|
|
960
|
-
if (f === 0) return a ?
|
|
958
|
+
var f = m.numFailures, _ = m.results, p = m.lastResult, m = m.failures;
|
|
959
|
+
if (f === 0) return a ? _ : p;
|
|
961
960
|
throw new Je("".concat(i.name, ".bulkPut(): ").concat(f, " of ").concat(h, " operations failed"), m);
|
|
962
961
|
});
|
|
963
962
|
});
|
|
964
|
-
},
|
|
963
|
+
}, q.prototype.bulkUpdate = function(e) {
|
|
965
964
|
var t = this, n = this.core, i = e.map(function(c) {
|
|
966
965
|
return c.key;
|
|
967
966
|
}), o = e.map(function(c) {
|
|
@@ -970,8 +969,8 @@ var Mr = { exports: {} };
|
|
|
970
969
|
return this._trans("readwrite", function(c) {
|
|
971
970
|
return n.getMany({ trans: c, keys: i, cache: "clone" }).then(function(u) {
|
|
972
971
|
var h = [], g = [];
|
|
973
|
-
e.forEach(function(f,
|
|
974
|
-
var p = f.key, m = f.changes, v = u[
|
|
972
|
+
e.forEach(function(f, _) {
|
|
973
|
+
var p = f.key, m = f.changes, v = u[_];
|
|
975
974
|
if (v) {
|
|
976
975
|
for (var y = 0, S = Object.keys(m); y < S.length; y++) {
|
|
977
976
|
var E = S[y], O = m[E];
|
|
@@ -979,22 +978,22 @@ var Mr = { exports: {} };
|
|
|
979
978
|
if (H(O, p) !== 0) throw new $.Constraint("Cannot update primary key in bulkUpdate()");
|
|
980
979
|
} else le(v, E, O);
|
|
981
980
|
}
|
|
982
|
-
a.push(
|
|
981
|
+
a.push(_), h.push(p), g.push(v);
|
|
983
982
|
}
|
|
984
983
|
});
|
|
985
984
|
var b = h.length;
|
|
986
985
|
return n.mutate({ trans: c, type: "put", keys: h, values: g, updates: { keys: i, changeSpecs: o } }).then(function(f) {
|
|
987
|
-
var
|
|
988
|
-
if (
|
|
986
|
+
var _ = f.numFailures, p = f.failures;
|
|
987
|
+
if (_ === 0) return b;
|
|
989
988
|
for (var m = 0, v = Object.keys(p); m < v.length; m++) {
|
|
990
989
|
var y, S = v[m], E = a[Number(S)];
|
|
991
990
|
E != null && (y = p[S], delete p[S], p[E] = y);
|
|
992
991
|
}
|
|
993
|
-
throw new Je("".concat(t.name, ".bulkUpdate(): ").concat(
|
|
992
|
+
throw new Je("".concat(t.name, ".bulkUpdate(): ").concat(_, " of ").concat(b, " operations failed"), p);
|
|
994
993
|
});
|
|
995
994
|
});
|
|
996
995
|
});
|
|
997
|
-
},
|
|
996
|
+
}, q.prototype.bulkDelete = function(e) {
|
|
998
997
|
var t = this, n = e.length;
|
|
999
998
|
return this._trans("readwrite", function(i) {
|
|
1000
999
|
return t.core.mutate({ trans: i, type: "delete", keys: e });
|
|
@@ -1003,8 +1002,8 @@ var Mr = { exports: {} };
|
|
|
1003
1002
|
if (o === 0) return a;
|
|
1004
1003
|
throw new Je("".concat(t.name, ".bulkDelete(): ").concat(o, " of ").concat(n, " operations failed"), c);
|
|
1005
1004
|
});
|
|
1006
|
-
},
|
|
1007
|
-
function
|
|
1005
|
+
}, q);
|
|
1006
|
+
function q() {
|
|
1008
1007
|
}
|
|
1009
1008
|
function dt(e) {
|
|
1010
1009
|
function t(c, u) {
|
|
@@ -1022,20 +1021,20 @@ var Mr = { exports: {} };
|
|
|
1022
1021
|
if (typeof c != "object") {
|
|
1023
1022
|
var g;
|
|
1024
1023
|
u = u || qr;
|
|
1025
|
-
var b = { subscribers: [], fire: h = h ||
|
|
1024
|
+
var b = { subscribers: [], fire: h = h || J, subscribe: function(f) {
|
|
1026
1025
|
b.subscribers.indexOf(f) === -1 && (b.subscribers.push(f), b.fire = u(b.fire, f));
|
|
1027
1026
|
}, unsubscribe: function(f) {
|
|
1028
|
-
b.subscribers = b.subscribers.filter(function(
|
|
1029
|
-
return
|
|
1027
|
+
b.subscribers = b.subscribers.filter(function(_) {
|
|
1028
|
+
return _ !== f;
|
|
1030
1029
|
}), b.fire = b.subscribers.reduce(u, h);
|
|
1031
1030
|
} };
|
|
1032
1031
|
return n[c] = t[c] = b;
|
|
1033
1032
|
}
|
|
1034
|
-
|
|
1035
|
-
var
|
|
1036
|
-
if (
|
|
1033
|
+
j(g = c).forEach(function(f) {
|
|
1034
|
+
var _ = g[f];
|
|
1035
|
+
if (P(_)) a(f, g[f][0], g[f][1]);
|
|
1037
1036
|
else {
|
|
1038
|
-
if (
|
|
1037
|
+
if (_ !== "asap") throw new $.InvalidArgument("Invalid event config");
|
|
1039
1038
|
var p = a(f, at, function() {
|
|
1040
1039
|
for (var m = arguments.length, v = new Array(m); m--; ) v[m] = arguments[m];
|
|
1041
1040
|
p.subscribers.forEach(function(y) {
|
|
@@ -1078,11 +1077,11 @@ var Mr = { exports: {} };
|
|
|
1078
1077
|
if (e.or) {
|
|
1079
1078
|
var a = {}, c = function(u, h, g) {
|
|
1080
1079
|
var b, f;
|
|
1081
|
-
o && !o(h, g, function(
|
|
1082
|
-
return h.stop(
|
|
1083
|
-
}, function(
|
|
1084
|
-
return h.fail(
|
|
1085
|
-
}) || ((f = "" + (b = h.primaryKey)) == "[object ArrayBuffer]" && (f = "" + new Uint8Array(b)),
|
|
1080
|
+
o && !o(h, g, function(_) {
|
|
1081
|
+
return h.stop(_);
|
|
1082
|
+
}, function(_) {
|
|
1083
|
+
return h.fail(_);
|
|
1084
|
+
}) || ((f = "" + (b = h.primaryKey)) == "[object ArrayBuffer]" && (f = "" + new Uint8Array(b)), X(a, f) || (a[f] = !0, t(u, h, g)));
|
|
1086
1085
|
};
|
|
1087
1086
|
return Promise.all([e.or._iterate(c, n), dr(lr(e, i, n), e.algorithm, c, !e.keysOnly && e.valueMapper)]);
|
|
1088
1087
|
}
|
|
@@ -1100,9 +1099,9 @@ var Mr = { exports: {} };
|
|
|
1100
1099
|
t && !t(a, function(u) {
|
|
1101
1100
|
return c = u;
|
|
1102
1101
|
}, function(u) {
|
|
1103
|
-
a.stop(u), c =
|
|
1102
|
+
a.stop(u), c = J;
|
|
1104
1103
|
}, function(u) {
|
|
1105
|
-
a.fail(u), c =
|
|
1104
|
+
a.fail(u), c = J;
|
|
1106
1105
|
}) || o(a.value, a, function(u) {
|
|
1107
1106
|
return c = u;
|
|
1108
1107
|
}), c();
|
|
@@ -1112,7 +1111,7 @@ var Mr = { exports: {} };
|
|
|
1112
1111
|
var Ee = Symbol(), ht = (fr.prototype.execute = function(e) {
|
|
1113
1112
|
if (this.add !== void 0) {
|
|
1114
1113
|
var t = this.add;
|
|
1115
|
-
if (
|
|
1114
|
+
if (P(t)) return x(x([], P(e) ? e : [], !0), t).sort();
|
|
1116
1115
|
if (typeof t == "number") return (Number(e) || 0) + t;
|
|
1117
1116
|
if (typeof t == "bigint") try {
|
|
1118
1117
|
return BigInt(e) + t;
|
|
@@ -1123,7 +1122,7 @@ var Mr = { exports: {} };
|
|
|
1123
1122
|
}
|
|
1124
1123
|
if (this.remove !== void 0) {
|
|
1125
1124
|
var n = this.remove;
|
|
1126
|
-
if (
|
|
1125
|
+
if (P(n)) return P(e) ? e.filter(function(i) {
|
|
1127
1126
|
return !n.includes(i);
|
|
1128
1127
|
}).sort() : [];
|
|
1129
1128
|
if (typeof n == "number") return Number(e) - n;
|
|
@@ -1139,28 +1138,28 @@ var Mr = { exports: {} };
|
|
|
1139
1138
|
function fr(e) {
|
|
1140
1139
|
Object.assign(this, e);
|
|
1141
1140
|
}
|
|
1142
|
-
var oi = (
|
|
1141
|
+
var oi = (Q.prototype._read = function(e, t) {
|
|
1143
1142
|
var n = this._ctx;
|
|
1144
1143
|
return n.error ? n.table._trans(null, te.bind(null, n.error)) : n.table._trans("readonly", e).then(t);
|
|
1145
|
-
},
|
|
1144
|
+
}, Q.prototype._write = function(e) {
|
|
1146
1145
|
var t = this._ctx;
|
|
1147
1146
|
return t.error ? t.table._trans(null, te.bind(null, t.error)) : t.table._trans("readwrite", e, "locked");
|
|
1148
|
-
},
|
|
1147
|
+
}, Q.prototype._addAlgorithm = function(e) {
|
|
1149
1148
|
var t = this._ctx;
|
|
1150
1149
|
t.algorithm = Fe(t.algorithm, e);
|
|
1151
|
-
},
|
|
1150
|
+
}, Q.prototype._iterate = function(e, t) {
|
|
1152
1151
|
return Kt(this._ctx, e, t, this._ctx.table.core);
|
|
1153
|
-
},
|
|
1152
|
+
}, Q.prototype.clone = function(e) {
|
|
1154
1153
|
var t = Object.create(this.constructor.prototype), n = Object.create(this._ctx);
|
|
1155
|
-
return e &&
|
|
1156
|
-
},
|
|
1154
|
+
return e && Y(n, e), t._ctx = n, t;
|
|
1155
|
+
}, Q.prototype.raw = function() {
|
|
1157
1156
|
return this._ctx.valueMapper = null, this;
|
|
1158
|
-
},
|
|
1157
|
+
}, Q.prototype.each = function(e) {
|
|
1159
1158
|
var t = this._ctx;
|
|
1160
1159
|
return this._read(function(n) {
|
|
1161
1160
|
return Kt(t, e, n, t.table.core);
|
|
1162
1161
|
});
|
|
1163
|
-
},
|
|
1162
|
+
}, Q.prototype.count = function(e) {
|
|
1164
1163
|
var t = this;
|
|
1165
1164
|
return this._read(function(n) {
|
|
1166
1165
|
var i = t._ctx, o = i.table.core;
|
|
@@ -1174,7 +1173,7 @@ var Mr = { exports: {} };
|
|
|
1174
1173
|
return a;
|
|
1175
1174
|
});
|
|
1176
1175
|
}).then(e);
|
|
1177
|
-
},
|
|
1176
|
+
}, Q.prototype.sortBy = function(e, t) {
|
|
1178
1177
|
var n = e.split(".").reverse(), i = n[0], o = n.length - 1;
|
|
1179
1178
|
function a(h, g) {
|
|
1180
1179
|
return g ? a(h[n[g]], g - 1) : h[i];
|
|
@@ -1186,7 +1185,7 @@ var Mr = { exports: {} };
|
|
|
1186
1185
|
return this.toArray(function(h) {
|
|
1187
1186
|
return h.sort(u);
|
|
1188
1187
|
}).then(t);
|
|
1189
|
-
},
|
|
1188
|
+
}, Q.prototype.toArray = function(e) {
|
|
1190
1189
|
var t = this;
|
|
1191
1190
|
return this._read(function(n) {
|
|
1192
1191
|
var i = t._ctx;
|
|
@@ -1203,7 +1202,7 @@ var Mr = { exports: {} };
|
|
|
1203
1202
|
return c;
|
|
1204
1203
|
});
|
|
1205
1204
|
}, e);
|
|
1206
|
-
},
|
|
1205
|
+
}, Q.prototype.offset = function(e) {
|
|
1207
1206
|
var t = this._ctx;
|
|
1208
1207
|
return e <= 0 || (t.offset += e, tt(t) ? mn(t, function() {
|
|
1209
1208
|
var n = e;
|
|
@@ -1218,49 +1217,49 @@ var Mr = { exports: {} };
|
|
|
1218
1217
|
return --n < 0;
|
|
1219
1218
|
};
|
|
1220
1219
|
})), this;
|
|
1221
|
-
},
|
|
1220
|
+
}, Q.prototype.limit = function(e) {
|
|
1222
1221
|
return this._ctx.limit = Math.min(this._ctx.limit, e), mn(this._ctx, function() {
|
|
1223
1222
|
var t = e;
|
|
1224
1223
|
return function(n, i, o) {
|
|
1225
1224
|
return --t <= 0 && i(o), 0 <= t;
|
|
1226
1225
|
};
|
|
1227
1226
|
}, !0), this;
|
|
1228
|
-
},
|
|
1227
|
+
}, Q.prototype.until = function(e, t) {
|
|
1229
1228
|
return yn(this._ctx, function(n, i, o) {
|
|
1230
1229
|
return !e(n.value) || (i(o), t);
|
|
1231
1230
|
}), this;
|
|
1232
|
-
},
|
|
1231
|
+
}, Q.prototype.first = function(e) {
|
|
1233
1232
|
return this.limit(1).toArray(function(t) {
|
|
1234
1233
|
return t[0];
|
|
1235
1234
|
}).then(e);
|
|
1236
|
-
},
|
|
1235
|
+
}, Q.prototype.last = function(e) {
|
|
1237
1236
|
return this.reverse().first(e);
|
|
1238
|
-
},
|
|
1237
|
+
}, Q.prototype.filter = function(e) {
|
|
1239
1238
|
var t;
|
|
1240
1239
|
return yn(this._ctx, function(n) {
|
|
1241
1240
|
return e(n.value);
|
|
1242
1241
|
}), (t = this._ctx).isMatch = Fe(t.isMatch, e), this;
|
|
1243
|
-
},
|
|
1242
|
+
}, Q.prototype.and = function(e) {
|
|
1244
1243
|
return this.filter(e);
|
|
1245
|
-
},
|
|
1244
|
+
}, Q.prototype.or = function(e) {
|
|
1246
1245
|
return new this.db.WhereClause(this._ctx.table, e, this);
|
|
1247
|
-
},
|
|
1246
|
+
}, Q.prototype.reverse = function() {
|
|
1248
1247
|
return this._ctx.dir = this._ctx.dir === "prev" ? "next" : "prev", this._ondirectionchange && this._ondirectionchange(this._ctx.dir), this;
|
|
1249
|
-
},
|
|
1248
|
+
}, Q.prototype.desc = function() {
|
|
1250
1249
|
return this.reverse();
|
|
1251
|
-
},
|
|
1250
|
+
}, Q.prototype.eachKey = function(e) {
|
|
1252
1251
|
var t = this._ctx;
|
|
1253
1252
|
return t.keysOnly = !t.isMatch, this.each(function(n, i) {
|
|
1254
1253
|
e(i.key, i);
|
|
1255
1254
|
});
|
|
1256
|
-
},
|
|
1255
|
+
}, Q.prototype.eachUniqueKey = function(e) {
|
|
1257
1256
|
return this._ctx.unique = "unique", this.eachKey(e);
|
|
1258
|
-
},
|
|
1257
|
+
}, Q.prototype.eachPrimaryKey = function(e) {
|
|
1259
1258
|
var t = this._ctx;
|
|
1260
1259
|
return t.keysOnly = !t.isMatch, this.each(function(n, i) {
|
|
1261
1260
|
e(i.primaryKey, i);
|
|
1262
1261
|
});
|
|
1263
|
-
},
|
|
1262
|
+
}, Q.prototype.keys = function(e) {
|
|
1264
1263
|
var t = this._ctx;
|
|
1265
1264
|
t.keysOnly = !t.isMatch;
|
|
1266
1265
|
var n = [];
|
|
@@ -1269,7 +1268,7 @@ var Mr = { exports: {} };
|
|
|
1269
1268
|
}).then(function() {
|
|
1270
1269
|
return n;
|
|
1271
1270
|
}).then(e);
|
|
1272
|
-
},
|
|
1271
|
+
}, Q.prototype.primaryKeys = function(e) {
|
|
1273
1272
|
var t = this._ctx;
|
|
1274
1273
|
if (t.dir === "next" && tt(t, !0) && 0 < t.limit) return this._read(function(i) {
|
|
1275
1274
|
var o = jt(t, t.table.core.schema);
|
|
@@ -1284,40 +1283,40 @@ var Mr = { exports: {} };
|
|
|
1284
1283
|
}).then(function() {
|
|
1285
1284
|
return n;
|
|
1286
1285
|
}).then(e);
|
|
1287
|
-
},
|
|
1286
|
+
}, Q.prototype.uniqueKeys = function(e) {
|
|
1288
1287
|
return this._ctx.unique = "unique", this.keys(e);
|
|
1289
|
-
},
|
|
1288
|
+
}, Q.prototype.firstKey = function(e) {
|
|
1290
1289
|
return this.limit(1).keys(function(t) {
|
|
1291
1290
|
return t[0];
|
|
1292
1291
|
}).then(e);
|
|
1293
|
-
},
|
|
1292
|
+
}, Q.prototype.lastKey = function(e) {
|
|
1294
1293
|
return this.reverse().firstKey(e);
|
|
1295
|
-
},
|
|
1294
|
+
}, Q.prototype.distinct = function() {
|
|
1296
1295
|
var e = this._ctx, e = e.index && e.table.schema.idxByName[e.index];
|
|
1297
1296
|
if (!e || !e.multi) return this;
|
|
1298
1297
|
var t = {};
|
|
1299
1298
|
return yn(this._ctx, function(o) {
|
|
1300
|
-
var i = o.primaryKey.toString(), o =
|
|
1299
|
+
var i = o.primaryKey.toString(), o = X(t, i);
|
|
1301
1300
|
return t[i] = !0, !o;
|
|
1302
1301
|
}), this;
|
|
1303
|
-
},
|
|
1302
|
+
}, Q.prototype.modify = function(e) {
|
|
1304
1303
|
var t = this, n = this._ctx;
|
|
1305
1304
|
return this._write(function(i) {
|
|
1306
1305
|
var o, a, c;
|
|
1307
|
-
c = typeof e == "function" ? e : (o =
|
|
1306
|
+
c = typeof e == "function" ? e : (o = j(e), a = o.length, function(y) {
|
|
1308
1307
|
for (var S = !1, E = 0; E < a; ++E) {
|
|
1309
|
-
var O = o[E], A = e[O],
|
|
1310
|
-
A instanceof ht ? (le(y, O, A.execute(
|
|
1308
|
+
var O = o[E], A = e[O], I = we(y, O);
|
|
1309
|
+
A instanceof ht ? (le(y, O, A.execute(I)), S = !0) : I !== A && (le(y, O, A), S = !0);
|
|
1311
1310
|
}
|
|
1312
1311
|
return S;
|
|
1313
1312
|
});
|
|
1314
1313
|
var u = n.table.core, f = u.schema.primaryKey, h = f.outbound, g = f.extractKey, b = 200, f = t.db._options.modifyChunkSize;
|
|
1315
1314
|
f && (b = typeof f == "object" ? f[u.name] || f["*"] || 200 : f);
|
|
1316
|
-
function
|
|
1315
|
+
function _(y, O) {
|
|
1317
1316
|
var E = O.failures, O = O.numFailures;
|
|
1318
1317
|
m += y - O;
|
|
1319
|
-
for (var A = 0,
|
|
1320
|
-
var M =
|
|
1318
|
+
for (var A = 0, I = j(E); A < I.length; A++) {
|
|
1319
|
+
var M = I[A];
|
|
1321
1320
|
p.push(E[M]);
|
|
1322
1321
|
}
|
|
1323
1322
|
}
|
|
@@ -1325,21 +1324,21 @@ var Mr = { exports: {} };
|
|
|
1325
1324
|
return t.clone().primaryKeys().then(function(y) {
|
|
1326
1325
|
function S(O) {
|
|
1327
1326
|
var A = Math.min(b, y.length - O);
|
|
1328
|
-
return u.getMany({ trans: i, keys: y.slice(O, O + A), cache: "immutable" }).then(function(
|
|
1329
|
-
for (var M = [],
|
|
1330
|
-
var L =
|
|
1331
|
-
c.call(U, U.value, U) !== !1 && (U.value == null ? K.push(y[O +
|
|
1327
|
+
return u.getMany({ trans: i, keys: y.slice(O, O + A), cache: "immutable" }).then(function(I) {
|
|
1328
|
+
for (var M = [], C = [], R = h ? [] : null, K = [], T = 0; T < A; ++T) {
|
|
1329
|
+
var L = I[T], U = { value: Me(L), primKey: y[O + T] };
|
|
1330
|
+
c.call(U, U.value, U) !== !1 && (U.value == null ? K.push(y[O + T]) : h || H(g(L), g(U.value)) === 0 ? (C.push(U.value), h && R.push(y[O + T])) : (K.push(y[O + T]), M.push(U.value)));
|
|
1332
1331
|
}
|
|
1333
1332
|
return Promise.resolve(0 < M.length && u.mutate({ trans: i, type: "add", values: M }).then(function(W) {
|
|
1334
1333
|
for (var z in W.failures) K.splice(parseInt(z), 1);
|
|
1335
|
-
|
|
1334
|
+
_(M.length, W);
|
|
1336
1335
|
})).then(function() {
|
|
1337
|
-
return (0 <
|
|
1338
|
-
return
|
|
1336
|
+
return (0 < C.length || E && typeof e == "object") && u.mutate({ trans: i, type: "put", keys: R, values: C, criteria: E, changeSpec: typeof e != "function" && e, isAdditionalChunk: 0 < O }).then(function(W) {
|
|
1337
|
+
return _(C.length, W);
|
|
1339
1338
|
});
|
|
1340
1339
|
}).then(function() {
|
|
1341
1340
|
return (0 < K.length || E && e === bn) && u.mutate({ trans: i, type: "delete", keys: K, criteria: E, isAdditionalChunk: 0 < O }).then(function(W) {
|
|
1342
|
-
return
|
|
1341
|
+
return _(K.length, W);
|
|
1343
1342
|
});
|
|
1344
1343
|
}).then(function() {
|
|
1345
1344
|
return y.length > O + A && S(O + b);
|
|
@@ -1353,7 +1352,7 @@ var Mr = { exports: {} };
|
|
|
1353
1352
|
});
|
|
1354
1353
|
});
|
|
1355
1354
|
});
|
|
1356
|
-
},
|
|
1355
|
+
}, Q.prototype.delete = function() {
|
|
1357
1356
|
var e = this._ctx, t = e.range;
|
|
1358
1357
|
return tt(e) && (e.isPrimKey || t.type === 3) ? this._write(function(n) {
|
|
1359
1358
|
var i = e.table.core.schema.primaryKey, o = t;
|
|
@@ -1367,8 +1366,8 @@ var Mr = { exports: {} };
|
|
|
1367
1366
|
});
|
|
1368
1367
|
});
|
|
1369
1368
|
}) : this.modify(bn);
|
|
1370
|
-
},
|
|
1371
|
-
function
|
|
1369
|
+
}, Q);
|
|
1370
|
+
function Q() {
|
|
1372
1371
|
}
|
|
1373
1372
|
var bn = function(e, t) {
|
|
1374
1373
|
return t.value = null;
|
|
@@ -1392,7 +1391,7 @@ var Mr = { exports: {} };
|
|
|
1392
1391
|
if (!n.every(function(m) {
|
|
1393
1392
|
return typeof m == "string";
|
|
1394
1393
|
})) return de(e, ir);
|
|
1395
|
-
function
|
|
1394
|
+
function _(m) {
|
|
1396
1395
|
o = m === "next" ? function(y) {
|
|
1397
1396
|
return y.toUpperCase();
|
|
1398
1397
|
} : function(y) {
|
|
@@ -1413,10 +1412,10 @@ var Mr = { exports: {} };
|
|
|
1413
1412
|
return y.lower;
|
|
1414
1413
|
}), b = (g = m) === "next" ? "" : i;
|
|
1415
1414
|
}
|
|
1416
|
-
|
|
1415
|
+
_("next"), e = new e.Collection(e, function() {
|
|
1417
1416
|
return Ce(u[0], h[f - 1] + i);
|
|
1418
1417
|
}), e._ondirectionchange = function(m) {
|
|
1419
|
-
|
|
1418
|
+
_(m);
|
|
1420
1419
|
};
|
|
1421
1420
|
var p = 0;
|
|
1422
1421
|
return e._addAlgorithm(function(m, v, y) {
|
|
@@ -1425,15 +1424,15 @@ var Mr = { exports: {} };
|
|
|
1425
1424
|
var E = a(S);
|
|
1426
1425
|
if (t(E, h, p)) return !0;
|
|
1427
1426
|
for (var O = null, A = p; A < f; ++A) {
|
|
1428
|
-
var
|
|
1427
|
+
var I = function(M, C, R, K, T, L) {
|
|
1429
1428
|
for (var U = Math.min(M.length, K.length), W = -1, z = 0; z < U; ++z) {
|
|
1430
|
-
var fe =
|
|
1431
|
-
if (fe !== K[z]) return
|
|
1432
|
-
|
|
1429
|
+
var fe = C[z];
|
|
1430
|
+
if (fe !== K[z]) return T(M[z], R[z]) < 0 ? M.substr(0, z) + R[z] + R.substr(z + 1) : T(M[z], K[z]) < 0 ? M.substr(0, z) + K[z] + R.substr(z + 1) : 0 <= W ? M.substr(0, W) + C[W] + R.substr(W + 1) : null;
|
|
1431
|
+
T(M[z], fe) < 0 && (W = z);
|
|
1433
1432
|
}
|
|
1434
|
-
return U < K.length && L === "next" ? M +
|
|
1433
|
+
return U < K.length && L === "next" ? M + R.substr(M.length) : U < M.length && L === "prev" ? M.substr(0, R.length) : W < 0 ? null : M.substr(0, W) + K[W] + R.substr(W + 1);
|
|
1435
1434
|
}(S, E, u[A], h[A], c, g);
|
|
1436
|
-
|
|
1435
|
+
I === null && O === null ? p = A + 1 : (O === null || 0 < c(O, I)) && (O = I);
|
|
1437
1436
|
}
|
|
1438
1437
|
return v(O !== null ? function() {
|
|
1439
1438
|
m.continue(O + b);
|
|
@@ -1541,20 +1540,20 @@ var Mr = { exports: {} };
|
|
|
1541
1540
|
return E[0] !== void 0 && E[1] !== void 0 && o(E[0], E[1]) <= 0;
|
|
1542
1541
|
})) return de(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", $.InvalidArgument);
|
|
1543
1542
|
var h = !t || t.includeLowers !== !1, g = t && t.includeUppers === !0, b, f = o;
|
|
1544
|
-
function
|
|
1543
|
+
function _(E, O) {
|
|
1545
1544
|
return f(E[0], O[0]);
|
|
1546
1545
|
}
|
|
1547
1546
|
try {
|
|
1548
1547
|
(b = S.reduce(function(E, O) {
|
|
1549
|
-
for (var A = 0,
|
|
1548
|
+
for (var A = 0, I = E.length; A < I; ++A) {
|
|
1550
1549
|
var M = E[A];
|
|
1551
1550
|
if (i(O[0], M[1]) < 0 && 0 < i(O[1], M[0])) {
|
|
1552
1551
|
M[0] = c(M[0], O[0]), M[1] = u(M[1], O[1]);
|
|
1553
1552
|
break;
|
|
1554
1553
|
}
|
|
1555
1554
|
}
|
|
1556
|
-
return A ===
|
|
1557
|
-
}, [])).sort(
|
|
1555
|
+
return A === I && E.push(O), E;
|
|
1556
|
+
}, [])).sort(_);
|
|
1558
1557
|
} catch {
|
|
1559
1558
|
return de(this, Se);
|
|
1560
1559
|
}
|
|
@@ -1570,10 +1569,10 @@ var Mr = { exports: {} };
|
|
|
1570
1569
|
return Ce(b[0][0], b[b.length - 1][1], !h, !g);
|
|
1571
1570
|
});
|
|
1572
1571
|
return S._ondirectionchange = function(E) {
|
|
1573
|
-
f = E === "next" ? (y = m, o) : (y = v, a), b.sort(
|
|
1572
|
+
f = E === "next" ? (y = m, o) : (y = v, a), b.sort(_);
|
|
1574
1573
|
}, S._addAlgorithm(function(E, O, A) {
|
|
1575
|
-
for (var
|
|
1576
|
-
return !m(
|
|
1574
|
+
for (var I, M = E.key; y(M); ) if (++p === b.length) return O(A), !1;
|
|
1575
|
+
return !m(I = M) && !v(I) || (n._cmp(M, b[p][1]) === 0 || n._cmp(M, b[p][0]) === 0 || O(function() {
|
|
1577
1576
|
f === o ? E.continue(b[p][0]) : E.continue(b[p][1]);
|
|
1578
1577
|
}), !1);
|
|
1579
1578
|
}), S;
|
|
@@ -1676,7 +1675,7 @@ var Mr = { exports: {} };
|
|
|
1676
1675
|
this.active && (this.active = !1, this.idbtrans && this.idbtrans.abort(), this._reject(new $.Abort()));
|
|
1677
1676
|
}, be.prototype.table = function(e) {
|
|
1678
1677
|
var t = this._memoizedTables || (this._memoizedTables = {});
|
|
1679
|
-
if (
|
|
1678
|
+
if (X(t, e)) return t[e];
|
|
1680
1679
|
var n = this.schema[e];
|
|
1681
1680
|
if (!n) throw new $.NotFound("Table " + e + " not part of transaction");
|
|
1682
1681
|
return n = new this.db.Table(e, n, this), n.core = this.db.core.table(e), t[e] = n;
|
|
@@ -1733,77 +1732,77 @@ var Mr = { exports: {} };
|
|
|
1733
1732
|
var p = y.lower, m = y.upper, v = y.lowerOpen, y = y.upperOpen;
|
|
1734
1733
|
return p === void 0 ? m === void 0 ? null : t.upperBound(m, !!y) : m === void 0 ? t.lowerBound(p, !!v) : t.bound(p, m, !!v, !!y);
|
|
1735
1734
|
}
|
|
1736
|
-
function o(
|
|
1737
|
-
var p, m =
|
|
1738
|
-
return { name: m, schema:
|
|
1735
|
+
function o(_) {
|
|
1736
|
+
var p, m = _.name;
|
|
1737
|
+
return { name: m, schema: _, mutate: function(v) {
|
|
1739
1738
|
var y = v.trans, S = v.type, E = v.keys, O = v.values, A = v.range;
|
|
1740
|
-
return new Promise(function(
|
|
1741
|
-
|
|
1742
|
-
var
|
|
1739
|
+
return new Promise(function(I, M) {
|
|
1740
|
+
I = ee(I);
|
|
1741
|
+
var C = y.objectStore(m), R = C.keyPath == null, K = S === "put" || S === "add";
|
|
1743
1742
|
if (!K && S !== "delete" && S !== "deleteRange") throw new Error("Invalid operation type: " + S);
|
|
1744
|
-
var
|
|
1743
|
+
var T, L = (E || O || { length: 1 }).length;
|
|
1745
1744
|
if (E && O && E.length !== O.length) throw new Error("Given keys array must have same length as given values array.");
|
|
1746
|
-
if (L === 0) return
|
|
1745
|
+
if (L === 0) return I({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
|
|
1747
1746
|
function U(ue) {
|
|
1748
1747
|
++fe, pt(ue);
|
|
1749
1748
|
}
|
|
1750
1749
|
var W = [], z = [], fe = 0;
|
|
1751
1750
|
if (S === "deleteRange") {
|
|
1752
|
-
if (A.type === 4) return
|
|
1753
|
-
A.type === 3 ? W.push(
|
|
1751
|
+
if (A.type === 4) return I({ numFailures: fe, failures: z, results: [], lastResult: void 0 });
|
|
1752
|
+
A.type === 3 ? W.push(T = C.clear()) : W.push(T = C.delete(i(A)));
|
|
1754
1753
|
} else {
|
|
1755
|
-
var
|
|
1756
|
-
if (K) for (var ce = 0; ce < L; ++ce) W.push(
|
|
1757
|
-
else for (ce = 0; ce < L; ++ce) W.push(
|
|
1754
|
+
var R = K ? R ? [O, E] : [O, null] : [E, null], F = R[0], se = R[1];
|
|
1755
|
+
if (K) for (var ce = 0; ce < L; ++ce) W.push(T = se && se[ce] !== void 0 ? C[S](F[ce], se[ce]) : C[S](F[ce])), T.onerror = U;
|
|
1756
|
+
else for (ce = 0; ce < L; ++ce) W.push(T = C[S](F[ce])), T.onerror = U;
|
|
1758
1757
|
}
|
|
1759
1758
|
function Jt(ue) {
|
|
1760
1759
|
ue = ue.target.result, W.forEach(function(ze, Gn) {
|
|
1761
1760
|
return ze.error != null && (z[Gn] = ze.error);
|
|
1762
|
-
}),
|
|
1761
|
+
}), I({ numFailures: fe, failures: z, results: S === "delete" ? E : W.map(function(ze) {
|
|
1763
1762
|
return ze.result;
|
|
1764
1763
|
}), lastResult: ue });
|
|
1765
1764
|
}
|
|
1766
|
-
|
|
1765
|
+
T.onerror = function(ue) {
|
|
1767
1766
|
U(ue), Jt(ue);
|
|
1768
|
-
},
|
|
1767
|
+
}, T.onsuccess = Jt;
|
|
1769
1768
|
});
|
|
1770
1769
|
}, getMany: function(v) {
|
|
1771
1770
|
var y = v.trans, S = v.keys;
|
|
1772
1771
|
return new Promise(function(E, O) {
|
|
1773
1772
|
E = ee(E);
|
|
1774
|
-
for (var A,
|
|
1775
|
-
W = W.target,
|
|
1776
|
-
}, L = me(O), U = 0; U < M; ++U) S[U] != null && ((A =
|
|
1777
|
-
|
|
1773
|
+
for (var A, I = y.objectStore(m), M = S.length, C = new Array(M), R = 0, K = 0, T = function(W) {
|
|
1774
|
+
W = W.target, C[W._pos] = W.result, ++K === R && E(C);
|
|
1775
|
+
}, L = me(O), U = 0; U < M; ++U) S[U] != null && ((A = I.get(S[U]))._pos = U, A.onsuccess = T, A.onerror = L, ++R);
|
|
1776
|
+
R === 0 && E(C);
|
|
1778
1777
|
});
|
|
1779
1778
|
}, get: function(v) {
|
|
1780
1779
|
var y = v.trans, S = v.key;
|
|
1781
1780
|
return new Promise(function(E, O) {
|
|
1782
1781
|
E = ee(E);
|
|
1783
1782
|
var A = y.objectStore(m).get(S);
|
|
1784
|
-
A.onsuccess = function(
|
|
1785
|
-
return E(
|
|
1783
|
+
A.onsuccess = function(I) {
|
|
1784
|
+
return E(I.target.result);
|
|
1786
1785
|
}, A.onerror = me(O);
|
|
1787
1786
|
});
|
|
1788
1787
|
}, query: (p = g, function(v) {
|
|
1789
1788
|
return new Promise(function(y, S) {
|
|
1790
1789
|
y = ee(y);
|
|
1791
|
-
var E, O, A,
|
|
1790
|
+
var E, O, A, R = v.trans, I = v.values, M = v.limit, T = v.query, C = M === 1 / 0 ? void 0 : M, K = T.index, T = T.range, R = R.objectStore(m), K = K.isPrimaryKey ? R : R.index(K.name), T = i(T);
|
|
1792
1791
|
if (M === 0) return y({ result: [] });
|
|
1793
|
-
p ? ((
|
|
1792
|
+
p ? ((C = I ? K.getAll(T, C) : K.getAllKeys(T, C)).onsuccess = function(L) {
|
|
1794
1793
|
return y({ result: L.target.result });
|
|
1795
|
-
},
|
|
1794
|
+
}, C.onerror = me(S)) : (E = 0, O = !I && "openKeyCursor" in K ? K.openKeyCursor(T) : K.openCursor(T), A = [], O.onsuccess = function(L) {
|
|
1796
1795
|
var U = O.result;
|
|
1797
|
-
return U ? (A.push(
|
|
1796
|
+
return U ? (A.push(I ? U.value : U.primaryKey), ++E === M ? y({ result: A }) : void U.continue()) : y({ result: A });
|
|
1798
1797
|
}, O.onerror = me(S));
|
|
1799
1798
|
});
|
|
1800
1799
|
}), openCursor: function(v) {
|
|
1801
1800
|
var y = v.trans, S = v.values, E = v.query, O = v.reverse, A = v.unique;
|
|
1802
|
-
return new Promise(function(
|
|
1803
|
-
|
|
1804
|
-
var K = E.index,
|
|
1805
|
-
|
|
1806
|
-
var U, W, z, fe, F =
|
|
1801
|
+
return new Promise(function(I, M) {
|
|
1802
|
+
I = ee(I);
|
|
1803
|
+
var K = E.index, C = E.range, R = y.objectStore(m), R = K.isPrimaryKey ? R : R.index(K.name), K = O ? A ? "prevunique" : "prev" : A ? "nextunique" : "next", T = !S && "openKeyCursor" in R ? R.openKeyCursor(i(C), K) : R.openCursor(i(C), K);
|
|
1804
|
+
T.onerror = me(M), T.onsuccess = ee(function(L) {
|
|
1805
|
+
var U, W, z, fe, F = T.result;
|
|
1807
1806
|
F ? (F.___id = ++ui, F.done = !1, U = F.continue.bind(F), W = (W = F.continuePrimaryKey) && W.bind(F), z = F.advance.bind(F), fe = function() {
|
|
1808
1807
|
throw new Error("Cursor not stopped");
|
|
1809
1808
|
}, F.trans = y, F.stop = F.continue = F.continuePrimaryKey = F.advance = function() {
|
|
@@ -1817,7 +1816,7 @@ var Mr = { exports: {} };
|
|
|
1817
1816
|
});
|
|
1818
1817
|
}, F.start = function(se) {
|
|
1819
1818
|
function ce() {
|
|
1820
|
-
if (
|
|
1819
|
+
if (T.result) try {
|
|
1821
1820
|
se();
|
|
1822
1821
|
} catch (ue) {
|
|
1823
1822
|
F.fail(ue);
|
|
@@ -1827,44 +1826,44 @@ var Mr = { exports: {} };
|
|
|
1827
1826
|
}, F.stop();
|
|
1828
1827
|
}
|
|
1829
1828
|
var Jt = new Promise(function(ue, ze) {
|
|
1830
|
-
ue = ee(ue),
|
|
1829
|
+
ue = ee(ue), T.onerror = me(ze), F.fail = ze, F.stop = function(Gn) {
|
|
1831
1830
|
F.stop = F.continue = F.continuePrimaryKey = F.advance = fe, ue(Gn);
|
|
1832
1831
|
};
|
|
1833
1832
|
});
|
|
1834
|
-
return
|
|
1835
|
-
|
|
1833
|
+
return T.onsuccess = ee(function(ue) {
|
|
1834
|
+
T.onsuccess = ce, ce();
|
|
1836
1835
|
}), F.continue = U, F.continuePrimaryKey = W, F.advance = z, ce(), Jt;
|
|
1837
|
-
},
|
|
1836
|
+
}, I(F)) : I(null);
|
|
1838
1837
|
}, M);
|
|
1839
1838
|
});
|
|
1840
1839
|
}, count: function(v) {
|
|
1841
1840
|
var y = v.query, S = v.trans, E = y.index, O = y.range;
|
|
1842
|
-
return new Promise(function(A,
|
|
1843
|
-
var M = S.objectStore(m),
|
|
1844
|
-
|
|
1845
|
-
return A(
|
|
1846
|
-
}),
|
|
1841
|
+
return new Promise(function(A, I) {
|
|
1842
|
+
var M = S.objectStore(m), C = E.isPrimaryKey ? M : M.index(E.name), M = i(O), C = M ? C.count(M) : C.count();
|
|
1843
|
+
C.onsuccess = ee(function(R) {
|
|
1844
|
+
return A(R.target.result);
|
|
1845
|
+
}), C.onerror = me(I);
|
|
1847
1846
|
});
|
|
1848
1847
|
} };
|
|
1849
1848
|
}
|
|
1850
|
-
var a, c, u, b = (c = h, u = yr((a = e).objectStoreNames), { schema: { name: a.name, tables: u.map(function(
|
|
1851
|
-
return c.objectStore(
|
|
1852
|
-
}).map(function(
|
|
1853
|
-
var p =
|
|
1854
|
-
return
|
|
1849
|
+
var a, c, u, b = (c = h, u = yr((a = e).objectStoreNames), { schema: { name: a.name, tables: u.map(function(_) {
|
|
1850
|
+
return c.objectStore(_);
|
|
1851
|
+
}).map(function(_) {
|
|
1852
|
+
var p = _.keyPath, y = _.autoIncrement, m = P(p), v = {}, y = { name: _.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: p == null, compound: m, keyPath: p, autoIncrement: y, unique: !0, extractKey: Sn(p) }, indexes: yr(_.indexNames).map(function(S) {
|
|
1853
|
+
return _.index(S);
|
|
1855
1854
|
}).map(function(A) {
|
|
1856
|
-
var E = A.name, O = A.unique,
|
|
1857
|
-
return v[mt(A)] =
|
|
1855
|
+
var E = A.name, O = A.unique, I = A.multiEntry, A = A.keyPath, I = { name: E, compound: P(A), keyPath: A, unique: O, multiEntry: I, extractKey: Sn(A) };
|
|
1856
|
+
return v[mt(A)] = I;
|
|
1858
1857
|
}), getIndexByKeyPath: function(S) {
|
|
1859
1858
|
return v[mt(S)];
|
|
1860
1859
|
} };
|
|
1861
1860
|
return v[":id"] = y.primaryKey, p != null && (v[mt(p)] = y.primaryKey), y;
|
|
1862
1861
|
}) }, hasGetAll: 0 < u.length && "getAll" in c.objectStore(u[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }), h = b.schema, g = b.hasGetAll, b = h.tables.map(o), f = {};
|
|
1863
|
-
return b.forEach(function(
|
|
1864
|
-
return f[
|
|
1865
|
-
}), { stack: "dbcore", transaction: e.transaction.bind(e), table: function(
|
|
1866
|
-
if (!f[
|
|
1867
|
-
return f[
|
|
1862
|
+
return b.forEach(function(_) {
|
|
1863
|
+
return f[_.name] = _;
|
|
1864
|
+
}), { stack: "dbcore", transaction: e.transaction.bind(e), table: function(_) {
|
|
1865
|
+
if (!f[_]) throw new Error("Table '".concat(_, "' not found"));
|
|
1866
|
+
return f[_];
|
|
1868
1867
|
}, MIN_KEY: -1 / 0, MAX_KEY: yt(t), schema: h };
|
|
1869
1868
|
}
|
|
1870
1869
|
function di(e, t, n, i) {
|
|
@@ -1887,7 +1886,7 @@ var Mr = { exports: {} };
|
|
|
1887
1886
|
var a = i[o];
|
|
1888
1887
|
t.forEach(function(c) {
|
|
1889
1888
|
var u = function h(g, b) {
|
|
1890
|
-
return Fr(g, b) || (g =
|
|
1889
|
+
return Fr(g, b) || (g = Z(g)) && h(g, b);
|
|
1891
1890
|
}(c, o);
|
|
1892
1891
|
(!u || "value" in u && u.value === void 0) && (c === e.Transaction.prototype || c instanceof e.Transaction ? Ae(c, o, { get: function() {
|
|
1893
1892
|
return this.table(o);
|
|
@@ -1915,8 +1914,8 @@ var Mr = { exports: {} };
|
|
|
1915
1914
|
return G.trans = a, G.transless = u, t !== 0 ? (Bt(e, n), g = t, ((h = a).storeNames.includes("$meta") ? h.table("$meta").get("version").then(function(b) {
|
|
1916
1915
|
return b ?? g;
|
|
1917
1916
|
}) : B.resolve(g)).then(function(b) {
|
|
1918
|
-
return
|
|
1919
|
-
return S._cfg.version >=
|
|
1917
|
+
return _ = b, p = a, m = n, v = [], b = (f = e)._versions, y = f._dbSchema = $t(0, f.idbdb, m), (b = b.filter(function(S) {
|
|
1918
|
+
return S._cfg.version >= _;
|
|
1920
1919
|
})).length !== 0 ? (b.forEach(function(S) {
|
|
1921
1920
|
v.push(function() {
|
|
1922
1921
|
var E = y, O = S._cfg.dbschema;
|
|
@@ -1926,33 +1925,33 @@ var Mr = { exports: {} };
|
|
|
1926
1925
|
xn(m, K[0], K[1].primKey, K[1].indexes);
|
|
1927
1926
|
}), A.change.forEach(function(K) {
|
|
1928
1927
|
if (K.recreate) throw new $.Upgrade("Not yet support for changing primary key");
|
|
1929
|
-
var
|
|
1928
|
+
var T = m.objectStore(K.name);
|
|
1930
1929
|
K.add.forEach(function(L) {
|
|
1931
|
-
return Gt(
|
|
1930
|
+
return Gt(T, L);
|
|
1932
1931
|
}), K.change.forEach(function(L) {
|
|
1933
|
-
|
|
1932
|
+
T.deleteIndex(L.name), Gt(T, L);
|
|
1934
1933
|
}), K.del.forEach(function(L) {
|
|
1935
|
-
return
|
|
1934
|
+
return T.deleteIndex(L);
|
|
1936
1935
|
});
|
|
1937
1936
|
});
|
|
1938
|
-
var
|
|
1939
|
-
if (
|
|
1937
|
+
var I = S._cfg.contentUpgrade;
|
|
1938
|
+
if (I && S._cfg.version > _) {
|
|
1940
1939
|
Bt(f, m), p._memoizedTables = {};
|
|
1941
1940
|
var M = Yn(O);
|
|
1942
1941
|
A.del.forEach(function(K) {
|
|
1943
1942
|
M[K] = E[K];
|
|
1944
|
-
}), En(f, [f.Transaction.prototype]), Lt(f, [f.Transaction.prototype],
|
|
1945
|
-
var
|
|
1946
|
-
return
|
|
1943
|
+
}), En(f, [f.Transaction.prototype]), Lt(f, [f.Transaction.prototype], j(M), M), p.schema = M;
|
|
1944
|
+
var C, R = nn(I);
|
|
1945
|
+
return R && qe(), A = B.follow(function() {
|
|
1947
1946
|
var K;
|
|
1948
|
-
(
|
|
1949
|
-
}),
|
|
1950
|
-
return
|
|
1947
|
+
(C = I(p)) && R && (K = Pe.bind(null, null), C.then(K, K));
|
|
1948
|
+
}), C && typeof C.then == "function" ? B.resolve(C) : A.then(function() {
|
|
1949
|
+
return C;
|
|
1951
1950
|
});
|
|
1952
1951
|
}
|
|
1953
1952
|
}), v.push(function(E) {
|
|
1954
|
-
var O, A,
|
|
1955
|
-
O =
|
|
1953
|
+
var O, A, I = S._cfg.dbschema;
|
|
1954
|
+
O = I, A = E, [].slice.call(A.db.objectStoreNames).forEach(function(M) {
|
|
1956
1955
|
return O[M] == null && A.db.deleteObjectStore(M);
|
|
1957
1956
|
}), En(f, [f.Transaction.prototype]), Lt(f, [f.Transaction.prototype], f._storeNames, f._dbSchema), p.schema = f._dbSchema;
|
|
1958
1957
|
}), v.push(function(E) {
|
|
@@ -1965,8 +1964,8 @@ var Mr = { exports: {} };
|
|
|
1965
1964
|
}().then(function() {
|
|
1966
1965
|
mr(y, m);
|
|
1967
1966
|
})) : B.resolve();
|
|
1968
|
-
var f,
|
|
1969
|
-
}).catch(c)) : (
|
|
1967
|
+
var f, _, p, m, v, y;
|
|
1968
|
+
}).catch(c)) : (j(o).forEach(function(b) {
|
|
1970
1969
|
xn(n, b, o[b].primKey, o[b].indexes);
|
|
1971
1970
|
}), Bt(e, n), void B.follow(function() {
|
|
1972
1971
|
return e.on.populate.fire(a);
|
|
@@ -2017,7 +2016,7 @@ var Mr = { exports: {} };
|
|
|
2017
2016
|
}), o;
|
|
2018
2017
|
}
|
|
2019
2018
|
function mr(e, t) {
|
|
2020
|
-
|
|
2019
|
+
j(e).forEach(function(n) {
|
|
2021
2020
|
t.db.objectStoreNames.contains(n) || (ye && console.debug("Dexie: Creating missing table", n), xn(t, n, e[n].primKey, e[n].indexes));
|
|
2022
2021
|
});
|
|
2023
2022
|
}
|
|
@@ -2048,11 +2047,11 @@ var Mr = { exports: {} };
|
|
|
2048
2047
|
function br(e) {
|
|
2049
2048
|
return e.split(",").map(function(t, n) {
|
|
2050
2049
|
var i = (t = t.trim()).replace(/([&*]|\+\+)/g, ""), o = /^\[/.test(i) ? i.match(/^\[(.*)\]$/)[1].split("+") : i;
|
|
2051
|
-
return wn(i, o || null, /\&/.test(t), /\*/.test(t), /\+\+/.test(t),
|
|
2050
|
+
return wn(i, o || null, /\&/.test(t), /\*/.test(t), /\+\+/.test(t), P(o), n === 0);
|
|
2052
2051
|
});
|
|
2053
2052
|
}
|
|
2054
2053
|
var gi = (Ut.prototype._parseStoresSpec = function(e, t) {
|
|
2055
|
-
|
|
2054
|
+
j(e).forEach(function(n) {
|
|
2056
2055
|
if (e[n] !== null) {
|
|
2057
2056
|
var i = br(e[n]), o = i.shift();
|
|
2058
2057
|
if (o.unique = !0, o.multi) throw new $.Schema("Primary key cannot be multi-valued");
|
|
@@ -2064,19 +2063,19 @@ var Mr = { exports: {} };
|
|
|
2064
2063
|
});
|
|
2065
2064
|
}, Ut.prototype.stores = function(n) {
|
|
2066
2065
|
var t = this.db;
|
|
2067
|
-
this._cfg.storesSource = this._cfg.storesSource ?
|
|
2066
|
+
this._cfg.storesSource = this._cfg.storesSource ? Y(this._cfg.storesSource, n) : n;
|
|
2068
2067
|
var n = t._versions, i = {}, o = {};
|
|
2069
2068
|
return n.forEach(function(a) {
|
|
2070
|
-
|
|
2071
|
-
}), t._dbSchema = o, En(t, [t._allTables, t, t.Transaction.prototype]), Lt(t, [t._allTables, t, t.Transaction.prototype, this._cfg.tables],
|
|
2069
|
+
Y(i, a._cfg.storesSource), o = a._cfg.dbschema = {}, a._parseStoresSpec(i, o);
|
|
2070
|
+
}), t._dbSchema = o, En(t, [t._allTables, t, t.Transaction.prototype]), Lt(t, [t._allTables, t, t.Transaction.prototype, this._cfg.tables], j(o), o), t._storeNames = j(o), this;
|
|
2072
2071
|
}, Ut.prototype.upgrade = function(e) {
|
|
2073
|
-
return this._cfg.contentUpgrade = on(this._cfg.contentUpgrade ||
|
|
2072
|
+
return this._cfg.contentUpgrade = on(this._cfg.contentUpgrade || J, e), this;
|
|
2074
2073
|
}, Ut);
|
|
2075
2074
|
function Ut() {
|
|
2076
2075
|
}
|
|
2077
2076
|
function An(e, t) {
|
|
2078
2077
|
var n = e._dbNamesDB;
|
|
2079
|
-
return n || (n = e._dbNamesDB = new Oe(
|
|
2078
|
+
return n || (n = e._dbNamesDB = new Oe(Tt, { addons: [], indexedDB: e, IDBKeyRange: t })).version(1).stores({ dbnames: "name" }), n.table("dbnames");
|
|
2080
2079
|
}
|
|
2081
2080
|
function kn(e) {
|
|
2082
2081
|
return e && typeof e.databases == "function";
|
|
@@ -2092,15 +2091,15 @@ var Mr = { exports: {} };
|
|
|
2092
2091
|
var ae = function(e, t) {
|
|
2093
2092
|
if (!this) {
|
|
2094
2093
|
var n = new ae();
|
|
2095
|
-
return e && "d" in e &&
|
|
2094
|
+
return e && "d" in e && Y(n, e), n;
|
|
2096
2095
|
}
|
|
2097
|
-
|
|
2096
|
+
Y(this, arguments.length ? { d: 1, from: e, to: 1 < arguments.length ? t : e } : { d: 0 });
|
|
2098
2097
|
};
|
|
2099
2098
|
function bt(e, t, n) {
|
|
2100
2099
|
var i = H(t, n);
|
|
2101
2100
|
if (!isNaN(i)) {
|
|
2102
2101
|
if (0 < i) throw RangeError();
|
|
2103
|
-
if (Pn(e)) return
|
|
2102
|
+
if (Pn(e)) return Y(e, { from: t, to: n, d: 1 });
|
|
2104
2103
|
var o = e.l, i = e.r;
|
|
2105
2104
|
if (H(n, e.from) < 0) return o ? bt(o, t, n) : e.l = { from: t, to: n, d: 1, l: null, r: null }, wr(e);
|
|
2106
2105
|
if (0 < H(t, e.to)) return i ? bt(i, t, n) : e.r = { from: t, to: n, d: 1, l: null, r: null }, wr(e);
|
|
@@ -2151,10 +2150,10 @@ var Mr = { exports: {} };
|
|
|
2151
2150
|
return (t ? n ? Math.max(t.d, n.d) : t.d : n ? n.d : 0) + 1;
|
|
2152
2151
|
}
|
|
2153
2152
|
function zt(e, t) {
|
|
2154
|
-
return
|
|
2153
|
+
return j(t).forEach(function(n) {
|
|
2155
2154
|
e[n] ? vt(e[n], t[n]) : e[n] = function i(o) {
|
|
2156
2155
|
var a, c, u = {};
|
|
2157
|
-
for (a in o)
|
|
2156
|
+
for (a in o) X(o, a) && (c = o[a], u[a] = !c || typeof c != "object" || Xn.has(c.constructor) ? c : i(c));
|
|
2158
2157
|
return u;
|
|
2159
2158
|
}(t[n]);
|
|
2160
2159
|
}), e;
|
|
@@ -2182,10 +2181,10 @@ var Mr = { exports: {} };
|
|
|
2182
2181
|
var Ue = {}, Cn = {}, Rn = !1;
|
|
2183
2182
|
function Ht(e) {
|
|
2184
2183
|
zt(Cn, e), Rn || (Rn = !0, setTimeout(function() {
|
|
2185
|
-
Rn = !1,
|
|
2184
|
+
Rn = !1, Tn(Cn, !(Cn = {}));
|
|
2186
2185
|
}, 0));
|
|
2187
2186
|
}
|
|
2188
|
-
function
|
|
2187
|
+
function Tn(e, t) {
|
|
2189
2188
|
t === void 0 && (t = !1);
|
|
2190
2189
|
var n = /* @__PURE__ */ new Set();
|
|
2191
2190
|
if (e.all) for (var i = 0, o = Object.values(Ue); i < o.length; i++) Sr(c = o[i], e, n, t);
|
|
@@ -2200,10 +2199,10 @@ var Mr = { exports: {} };
|
|
|
2200
2199
|
function Sr(e, t, n, i) {
|
|
2201
2200
|
for (var o = [], a = 0, c = Object.entries(e.queries.query); a < c.length; a++) {
|
|
2202
2201
|
for (var u = c[a], h = u[0], g = [], b = 0, f = u[1]; b < f.length; b++) {
|
|
2203
|
-
var
|
|
2204
|
-
In(t,
|
|
2202
|
+
var _ = f[b];
|
|
2203
|
+
In(t, _.obsSet) ? _.subscribers.forEach(function(y) {
|
|
2205
2204
|
return n.add(y);
|
|
2206
|
-
}) : i && g.push(
|
|
2205
|
+
}) : i && g.push(_);
|
|
2207
2206
|
}
|
|
2208
2207
|
i && o.push([h, g]);
|
|
2209
2208
|
}
|
|
@@ -2223,7 +2222,7 @@ var Mr = { exports: {} };
|
|
|
2223
2222
|
if (t.openCanceller !== i) throw new $.DatabaseClosed("db.open() was cancelled");
|
|
2224
2223
|
}
|
|
2225
2224
|
function u() {
|
|
2226
|
-
return new B(function(
|
|
2225
|
+
return new B(function(_, p) {
|
|
2227
2226
|
if (c(), !n) throw new $.MissingAPI();
|
|
2228
2227
|
var m = e.name, v = t.autoSchema || !o ? n.open(m) : n.open(m, o);
|
|
2229
2228
|
if (!v) throw new $.MissingAPI();
|
|
@@ -2234,37 +2233,37 @@ var Mr = { exports: {} };
|
|
|
2234
2233
|
})) : (b.onerror = me(p), y = y.oldVersion > Math.pow(2, 62) ? 0 : y.oldVersion, f = y < 1, e.idbdb = v.result, a && pi(e, b), hi(e, y / 10, b, p));
|
|
2235
2234
|
}, p), v.onsuccess = ee(function() {
|
|
2236
2235
|
b = null;
|
|
2237
|
-
var y, S, E, O, A,
|
|
2236
|
+
var y, S, E, O, A, I = e.idbdb = v.result, M = St(I.objectStoreNames);
|
|
2238
2237
|
if (0 < M.length) try {
|
|
2239
|
-
var
|
|
2240
|
-
if (t.autoSchema) S =
|
|
2241
|
-
else if (Ft(e, e._dbSchema,
|
|
2242
|
-
return
|
|
2243
|
-
})) && !a) return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),
|
|
2244
|
-
Bt(e,
|
|
2238
|
+
var C = I.transaction((O = M).length === 1 ? O[0] : O, "readonly");
|
|
2239
|
+
if (t.autoSchema) S = I, E = C, (y = e).verno = S.version / 10, E = y._dbSchema = $t(0, S, E), y._storeNames = St(S.objectStoreNames, 0), Lt(y, [y._allTables], j(E), E);
|
|
2240
|
+
else if (Ft(e, e._dbSchema, C), ((A = On($t(0, (A = e).idbdb, C), A._dbSchema)).add.length || A.change.some(function(R) {
|
|
2241
|
+
return R.add.length || R.change.length;
|
|
2242
|
+
})) && !a) return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."), I.close(), o = I.version + 1, a = !0, _(u());
|
|
2243
|
+
Bt(e, C);
|
|
2245
2244
|
} catch {
|
|
2246
2245
|
}
|
|
2247
|
-
et.push(e),
|
|
2248
|
-
t.vcFired = !0, e.on("versionchange").fire(
|
|
2249
|
-
}),
|
|
2250
|
-
e.on("close").fire(
|
|
2251
|
-
}), f && (A = e._deps,
|
|
2246
|
+
et.push(e), I.onversionchange = ee(function(R) {
|
|
2247
|
+
t.vcFired = !0, e.on("versionchange").fire(R);
|
|
2248
|
+
}), I.onclose = ee(function(R) {
|
|
2249
|
+
e.on("close").fire(R);
|
|
2250
|
+
}), f && (A = e._deps, C = m, I = A.indexedDB, A = A.IDBKeyRange, kn(I) || C === Tt || An(I, A).put({ name: C }).catch(J)), _();
|
|
2252
2251
|
}, p);
|
|
2253
|
-
}).catch(function(
|
|
2254
|
-
switch (
|
|
2252
|
+
}).catch(function(_) {
|
|
2253
|
+
switch (_ == null ? void 0 : _.name) {
|
|
2255
2254
|
case "UnknownError":
|
|
2256
2255
|
if (0 < t.PR1398_maxLoop) return t.PR1398_maxLoop--, console.warn("Dexie: Workaround for Chrome UnknownError on open()"), u();
|
|
2257
2256
|
break;
|
|
2258
2257
|
case "VersionError":
|
|
2259
2258
|
if (0 < o) return o = 0, u();
|
|
2260
2259
|
}
|
|
2261
|
-
return B.reject(
|
|
2260
|
+
return B.reject(_);
|
|
2262
2261
|
});
|
|
2263
2262
|
}
|
|
2264
2263
|
var h, g = t.dbReadyResolve, b = null, f = !1;
|
|
2265
|
-
return B.race([i, (typeof navigator > "u" ? B.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(
|
|
2264
|
+
return B.race([i, (typeof navigator > "u" ? B.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(_) {
|
|
2266
2265
|
function p() {
|
|
2267
|
-
return indexedDB.databases().finally(
|
|
2266
|
+
return indexedDB.databases().finally(_);
|
|
2268
2267
|
}
|
|
2269
2268
|
h = setInterval(p, 100), p();
|
|
2270
2269
|
}).finally(function() {
|
|
@@ -2272,35 +2271,35 @@ var Mr = { exports: {} };
|
|
|
2272
2271
|
}) : Promise.resolve()).then(u)]).then(function() {
|
|
2273
2272
|
return c(), t.onReadyBeingFired = [], B.resolve(Dn(function() {
|
|
2274
2273
|
return e.on.ready.fire(e.vip);
|
|
2275
|
-
})).then(function
|
|
2274
|
+
})).then(function _() {
|
|
2276
2275
|
if (0 < t.onReadyBeingFired.length) {
|
|
2277
|
-
var p = t.onReadyBeingFired.reduce(on,
|
|
2276
|
+
var p = t.onReadyBeingFired.reduce(on, J);
|
|
2278
2277
|
return t.onReadyBeingFired = [], B.resolve(Dn(function() {
|
|
2279
2278
|
return p(e.vip);
|
|
2280
|
-
})).then(
|
|
2279
|
+
})).then(_);
|
|
2281
2280
|
}
|
|
2282
2281
|
});
|
|
2283
2282
|
}).finally(function() {
|
|
2284
2283
|
t.openCanceller === i && (t.onReadyBeingFired = null, t.isBeingOpened = !1);
|
|
2285
|
-
}).catch(function(
|
|
2286
|
-
t.dbOpenError =
|
|
2284
|
+
}).catch(function(_) {
|
|
2285
|
+
t.dbOpenError = _;
|
|
2287
2286
|
try {
|
|
2288
2287
|
b && b.abort();
|
|
2289
2288
|
} catch {
|
|
2290
2289
|
}
|
|
2291
|
-
return i === t.openCanceller && e._close(), te(
|
|
2290
|
+
return i === t.openCanceller && e._close(), te(_);
|
|
2292
2291
|
}).finally(function() {
|
|
2293
2292
|
t.openComplete = !0, g();
|
|
2294
2293
|
}).then(function() {
|
|
2295
|
-
var
|
|
2296
|
-
return f && (
|
|
2294
|
+
var _;
|
|
2295
|
+
return f && (_ = {}, e.tables.forEach(function(p) {
|
|
2297
2296
|
p.schema.indexes.forEach(function(m) {
|
|
2298
|
-
m.name && (
|
|
2299
|
-
}),
|
|
2300
|
-
}), Re(gt).fire(
|
|
2297
|
+
m.name && (_["idb://".concat(e.name, "/").concat(p.name, "/").concat(m.name)] = new ae(-1 / 0, [[[]]]));
|
|
2298
|
+
}), _["idb://".concat(e.name, "/").concat(p.name, "/")] = _["idb://".concat(e.name, "/").concat(p.name, "/:dels")] = new ae(-1 / 0, [[[]]]);
|
|
2299
|
+
}), Re(gt).fire(_), Tn(_, !0)), e;
|
|
2301
2300
|
});
|
|
2302
2301
|
}
|
|
2303
|
-
function
|
|
2302
|
+
function Mn(e) {
|
|
2304
2303
|
function t(a) {
|
|
2305
2304
|
return e.next(a);
|
|
2306
2305
|
}
|
|
@@ -2310,21 +2309,21 @@ var Mr = { exports: {} };
|
|
|
2310
2309
|
function o(a) {
|
|
2311
2310
|
return function(h) {
|
|
2312
2311
|
var u = a(h), h = u.value;
|
|
2313
|
-
return u.done ? h : h && typeof h.then == "function" ? h.then(n, i) :
|
|
2312
|
+
return u.done ? h : h && typeof h.then == "function" ? h.then(n, i) : P(h) ? Promise.all(h).then(n, i) : n(h);
|
|
2314
2313
|
};
|
|
2315
2314
|
}
|
|
2316
2315
|
return o(t)();
|
|
2317
2316
|
}
|
|
2318
2317
|
function Yt(e, t, n) {
|
|
2319
|
-
for (var i =
|
|
2318
|
+
for (var i = P(e) ? e.slice() : [e], o = 0; o < n; ++o) i.push(t);
|
|
2320
2319
|
return i;
|
|
2321
2320
|
}
|
|
2322
2321
|
var mi = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(e) {
|
|
2323
2322
|
return l(l({}, e), { table: function(t) {
|
|
2324
2323
|
var n = e.table(t), i = n.schema, o = {}, a = [];
|
|
2325
|
-
function c(f,
|
|
2326
|
-
var m = mt(f), v = o[m] = o[m] || [], y = f == null ? 0 : typeof f == "string" ? 1 : f.length, S = 0 <
|
|
2327
|
-
return v.push(S), S.isPrimaryKey || a.push(S), 1 < y && c(y === 2 ? f[0] : f.slice(0, y - 1),
|
|
2324
|
+
function c(f, _, p) {
|
|
2325
|
+
var m = mt(f), v = o[m] = o[m] || [], y = f == null ? 0 : typeof f == "string" ? 1 : f.length, S = 0 < _, S = l(l({}, p), { name: S ? "".concat(m, "(virtual-from:").concat(p.name, ")") : p.name, lowLevelIndex: p, isVirtual: S, keyTail: _, keyLength: y, extractKey: Sn(f), unique: !S && p.unique });
|
|
2326
|
+
return v.push(S), S.isPrimaryKey || a.push(S), 1 < y && c(y === 2 ? f[0] : f.slice(0, y - 1), _ + 1, p), v.sort(function(E, O) {
|
|
2328
2327
|
return E.keyTail - O.keyTail;
|
|
2329
2328
|
}), S;
|
|
2330
2329
|
}
|
|
@@ -2334,8 +2333,8 @@ var Mr = { exports: {} };
|
|
|
2334
2333
|
c(g.keyPath, 0, g);
|
|
2335
2334
|
}
|
|
2336
2335
|
function b(f) {
|
|
2337
|
-
var
|
|
2338
|
-
return p.isVirtual ? l(l({}, f), { query: { index: p.lowLevelIndex, range: (
|
|
2336
|
+
var _, p = f.query.index;
|
|
2337
|
+
return p.isVirtual ? l(l({}, f), { query: { index: p.lowLevelIndex, range: (_ = f.query.range, p = p.keyTail, { type: _.type === 1 ? 2 : _.type, lower: Yt(_.lower, _.lowerOpen ? e.MAX_KEY : e.MIN_KEY, p), lowerOpen: !0, upper: Yt(_.upper, _.upperOpen ? e.MIN_KEY : e.MAX_KEY, p), upperOpen: !0 }) } }) : f;
|
|
2339
2338
|
}
|
|
2340
2339
|
return l(l({}, n), { schema: l(l({}, i), { primaryKey: t, indexes: a, getIndexByKeyPath: function(f) {
|
|
2341
2340
|
return (f = o[mt(f)]) && f[0];
|
|
@@ -2344,7 +2343,7 @@ var Mr = { exports: {} };
|
|
|
2344
2343
|
}, query: function(f) {
|
|
2345
2344
|
return n.query(b(f));
|
|
2346
2345
|
}, openCursor: function(f) {
|
|
2347
|
-
var
|
|
2346
|
+
var _ = f.query.index, p = _.keyTail, m = _.isVirtual, v = _.keyLength;
|
|
2348
2347
|
return m ? n.openCursor(b(f)).then(function(S) {
|
|
2349
2348
|
return S && y(S);
|
|
2350
2349
|
}) : n.openCursor(f);
|
|
@@ -2366,11 +2365,11 @@ var Mr = { exports: {} };
|
|
|
2366
2365
|
} });
|
|
2367
2366
|
} };
|
|
2368
2367
|
function jn(e, t, n, i) {
|
|
2369
|
-
return n = n || {}, i = i || "",
|
|
2368
|
+
return n = n || {}, i = i || "", j(e).forEach(function(o) {
|
|
2370
2369
|
var a, c, u;
|
|
2371
|
-
|
|
2372
|
-
}),
|
|
2373
|
-
|
|
2370
|
+
X(t, o) ? (a = e[o], c = t[o], typeof a == "object" && typeof c == "object" && a && c ? (u = en(a)) !== en(c) ? n[i + o] = t[o] : u === "Object" ? jn(a, c, n, i + o + ".") : a !== c && (n[i + o] = t[o]) : a !== c && (n[i + o] = t[o])) : n[i + o] = void 0;
|
|
2371
|
+
}), j(t).forEach(function(o) {
|
|
2372
|
+
X(e, o) || (n[i + o] = t[o]);
|
|
2374
2373
|
}), n;
|
|
2375
2374
|
}
|
|
2376
2375
|
function Kn(e, t) {
|
|
@@ -2383,28 +2382,28 @@ var Mr = { exports: {} };
|
|
|
2383
2382
|
var a = G.trans, c = a.table(t).hook, u = c.deleting, h = c.creating, g = c.updating;
|
|
2384
2383
|
switch (o.type) {
|
|
2385
2384
|
case "add":
|
|
2386
|
-
if (h.fire ===
|
|
2385
|
+
if (h.fire === J) break;
|
|
2387
2386
|
return a._promise("readwrite", function() {
|
|
2388
2387
|
return b(o);
|
|
2389
2388
|
}, !0);
|
|
2390
2389
|
case "put":
|
|
2391
|
-
if (h.fire ===
|
|
2390
|
+
if (h.fire === J && g.fire === J) break;
|
|
2392
2391
|
return a._promise("readwrite", function() {
|
|
2393
2392
|
return b(o);
|
|
2394
2393
|
}, !0);
|
|
2395
2394
|
case "delete":
|
|
2396
|
-
if (u.fire ===
|
|
2395
|
+
if (u.fire === J) break;
|
|
2397
2396
|
return a._promise("readwrite", function() {
|
|
2398
2397
|
return b(o);
|
|
2399
2398
|
}, !0);
|
|
2400
2399
|
case "deleteRange":
|
|
2401
|
-
if (u.fire ===
|
|
2400
|
+
if (u.fire === J) break;
|
|
2402
2401
|
return a._promise("readwrite", function() {
|
|
2403
|
-
return function f(
|
|
2404
|
-
return n.query({ trans:
|
|
2402
|
+
return function f(_, p, m) {
|
|
2403
|
+
return n.query({ trans: _, values: !1, query: { index: i, range: p }, limit: m }).then(function(v) {
|
|
2405
2404
|
var y = v.result;
|
|
2406
|
-
return b({ type: "delete", keys: y, trans:
|
|
2407
|
-
return 0 < S.numFailures ? Promise.reject(S.failures[0]) : y.length < m ? { failures: [], numFailures: 0, lastResult: void 0 } : f(
|
|
2405
|
+
return b({ type: "delete", keys: y, trans: _ }).then(function(S) {
|
|
2406
|
+
return 0 < S.numFailures ? Promise.reject(S.failures[0]) : y.length < m ? { failures: [], numFailures: 0, lastResult: void 0 } : f(_, l(l({}, p), { lower: y[y.length - 1], lowerOpen: !0 }), m);
|
|
2408
2407
|
});
|
|
2409
2408
|
});
|
|
2410
2409
|
}(o.trans, o.range, 1e4);
|
|
@@ -2412,21 +2411,21 @@ var Mr = { exports: {} };
|
|
|
2412
2411
|
}
|
|
2413
2412
|
return n.mutate(o);
|
|
2414
2413
|
function b(f) {
|
|
2415
|
-
var
|
|
2414
|
+
var _, p, m, v = G.trans, y = f.keys || Kn(i, f);
|
|
2416
2415
|
if (!y) throw new Error("Keys missing");
|
|
2417
|
-
return (f = f.type === "add" || f.type === "put" ? l(l({}, f), { keys: y }) : l({}, f)).type !== "delete" && (f.values = x([], f.values)), f.keys && (f.keys = x([], f.keys)),
|
|
2416
|
+
return (f = f.type === "add" || f.type === "put" ? l(l({}, f), { keys: y }) : l({}, f)).type !== "delete" && (f.values = x([], f.values)), f.keys && (f.keys = x([], f.keys)), _ = n, m = y, ((p = f).type === "add" ? Promise.resolve([]) : _.getMany({ trans: p.trans, keys: m, cache: "immutable" })).then(function(S) {
|
|
2418
2417
|
var E = y.map(function(O, A) {
|
|
2419
|
-
var
|
|
2420
|
-
return f.type === "delete" ? u.fire.call(K, O,
|
|
2421
|
-
|
|
2418
|
+
var I, M, C, R = S[A], K = { onerror: null, onsuccess: null };
|
|
2419
|
+
return f.type === "delete" ? u.fire.call(K, O, R, v) : f.type === "add" || R === void 0 ? (I = h.fire.call(K, O, f.values[A], v), O == null && I != null && (f.keys[A] = O = I, i.outbound || le(f.values[A], i.keyPath, O))) : (I = jn(R, f.values[A]), (M = g.fire.call(K, I, O, R, v)) && (C = f.values[A], Object.keys(M).forEach(function(T) {
|
|
2420
|
+
X(C, T) ? C[T] = M[T] : le(C, T, M[T]);
|
|
2422
2421
|
}))), K;
|
|
2423
2422
|
});
|
|
2424
2423
|
return n.mutate(f).then(function(O) {
|
|
2425
|
-
for (var A = O.failures,
|
|
2426
|
-
var
|
|
2427
|
-
|
|
2424
|
+
for (var A = O.failures, I = O.results, M = O.numFailures, O = O.lastResult, C = 0; C < y.length; ++C) {
|
|
2425
|
+
var R = (I || y)[C], K = E[C];
|
|
2426
|
+
R == null ? K.onerror && K.onerror(A[C]) : K.onsuccess && K.onsuccess(f.type === "put" && S[C] ? f.values[C] : R);
|
|
2428
2427
|
}
|
|
2429
|
-
return { failures: A, results:
|
|
2428
|
+
return { failures: A, results: I, numFailures: M, lastResult: O };
|
|
2430
2429
|
}).catch(function(O) {
|
|
2431
2430
|
return E.forEach(function(A) {
|
|
2432
2431
|
return A.onerror && A.onerror(O);
|
|
@@ -2440,7 +2439,7 @@ var Mr = { exports: {} };
|
|
|
2440
2439
|
function Er(e, t, n) {
|
|
2441
2440
|
try {
|
|
2442
2441
|
if (!t || t.keys.length < e.length) return null;
|
|
2443
|
-
for (var i = [], o = 0, a = 0; o < t.keys.length && a < e.length; ++o) H(t.keys[o], e[a]) === 0 && (i.push(n ?
|
|
2442
|
+
for (var i = [], o = 0, a = 0; o < t.keys.length && a < e.length; ++o) H(t.keys[o], e[a]) === 0 && (i.push(n ? Me(t.values[o]) : t.values[o]), ++a);
|
|
2444
2443
|
return i.length === e.length ? i : null;
|
|
2445
2444
|
} catch {
|
|
2446
2445
|
return null;
|
|
@@ -2453,7 +2452,7 @@ var Mr = { exports: {} };
|
|
|
2453
2452
|
if (!i.cache) return n.getMany(i);
|
|
2454
2453
|
var o = Er(i.keys, i.trans._cache, i.cache === "clone");
|
|
2455
2454
|
return o ? B.resolve(o) : n.getMany(i).then(function(a) {
|
|
2456
|
-
return i.trans._cache = { keys: i.keys, values: i.cache === "clone" ?
|
|
2455
|
+
return i.trans._cache = { keys: i.keys, values: i.cache === "clone" ? Me(a) : a }, a;
|
|
2457
2456
|
});
|
|
2458
2457
|
}, mutate: function(i) {
|
|
2459
2458
|
return i.type !== "add" && (i.trans._cache = null), n.mutate(i);
|
|
@@ -2483,19 +2482,19 @@ var Mr = { exports: {} };
|
|
|
2483
2482
|
var o = e.table(i), a = o.schema, c = a.primaryKey, f = a.indexes, u = c.extractKey, h = c.outbound, g = c.autoIncrement && f.filter(function(p) {
|
|
2484
2483
|
return p.compound && p.keyPath.includes(c.keyPath);
|
|
2485
2484
|
}), b = l(l({}, o), { mutate: function(p) {
|
|
2486
|
-
function m(
|
|
2487
|
-
return
|
|
2485
|
+
function m(T) {
|
|
2486
|
+
return T = "idb://".concat(t, "/").concat(i, "/").concat(T), O[T] || (O[T] = new ae());
|
|
2488
2487
|
}
|
|
2489
|
-
var v, y, S, E = p.trans, O = p.mutatedParts || (p.mutatedParts = {}), A = m(""),
|
|
2490
|
-
return
|
|
2491
|
-
}), p.values] : [],
|
|
2492
|
-
return
|
|
2493
|
-
var L = v(
|
|
2488
|
+
var v, y, S, E = p.trans, O = p.mutatedParts || (p.mutatedParts = {}), A = m(""), I = m(":dels"), M = p.type, K = p.type === "deleteRange" ? [p.range] : p.type === "delete" ? [p.keys] : p.values.length < 50 ? [Kn(c, p).filter(function(T) {
|
|
2489
|
+
return T;
|
|
2490
|
+
}), p.values] : [], C = K[0], R = K[1], K = p.trans._cache;
|
|
2491
|
+
return P(C) ? (A.addKeys(C), (K = M === "delete" || C.length === R.length ? Er(C, K) : null) || I.addKeys(C), (K || R) && (v = m, y = K, S = R, a.indexes.forEach(function(T) {
|
|
2492
|
+
var L = v(T.name || "");
|
|
2494
2493
|
function U(z) {
|
|
2495
|
-
return z != null ?
|
|
2494
|
+
return z != null ? T.extractKey(z) : null;
|
|
2496
2495
|
}
|
|
2497
2496
|
function W(z) {
|
|
2498
|
-
return
|
|
2497
|
+
return T.multiEntry && P(z) ? z.forEach(function(fe) {
|
|
2499
2498
|
return L.addKey(fe);
|
|
2500
2499
|
}) : L.addKey(z);
|
|
2501
2500
|
}
|
|
@@ -2503,55 +2502,55 @@ var Mr = { exports: {} };
|
|
|
2503
2502
|
var F = y && U(y[se]), se = S && U(S[se]);
|
|
2504
2503
|
H(F, se) !== 0 && (F != null && W(F), se != null && W(se));
|
|
2505
2504
|
});
|
|
2506
|
-
}))) :
|
|
2507
|
-
return m(
|
|
2508
|
-
})), o.mutate(p).then(function(
|
|
2509
|
-
return !
|
|
2505
|
+
}))) : C ? (R = { from: (R = C.lower) !== null && R !== void 0 ? R : e.MIN_KEY, to: (R = C.upper) !== null && R !== void 0 ? R : e.MAX_KEY }, I.add(R), A.add(R)) : (A.add(n), I.add(n), a.indexes.forEach(function(T) {
|
|
2506
|
+
return m(T.name).add(n);
|
|
2507
|
+
})), o.mutate(p).then(function(T) {
|
|
2508
|
+
return !C || p.type !== "add" && p.type !== "put" || (A.addKeys(T.results), g && g.forEach(function(L) {
|
|
2510
2509
|
for (var U = p.values.map(function(F) {
|
|
2511
2510
|
return L.extractKey(F);
|
|
2512
2511
|
}), W = L.keyPath.findIndex(function(F) {
|
|
2513
2512
|
return F === c.keyPath;
|
|
2514
|
-
}), z = 0, fe =
|
|
2513
|
+
}), z = 0, fe = T.results.length; z < fe; ++z) U[z][W] = T.results[z];
|
|
2515
2514
|
m(L.name).addKeys(U);
|
|
2516
|
-
})), E.mutatedParts = zt(E.mutatedParts || {}, O),
|
|
2515
|
+
})), E.mutatedParts = zt(E.mutatedParts || {}, O), T;
|
|
2517
2516
|
});
|
|
2518
2517
|
} }), f = function(m) {
|
|
2519
2518
|
var v = m.query, m = v.index, v = v.range;
|
|
2520
2519
|
return [m, new ae((m = v.lower) !== null && m !== void 0 ? m : e.MIN_KEY, (v = v.upper) !== null && v !== void 0 ? v : e.MAX_KEY)];
|
|
2521
|
-
},
|
|
2520
|
+
}, _ = { get: function(p) {
|
|
2522
2521
|
return [c, new ae(p.key)];
|
|
2523
2522
|
}, getMany: function(p) {
|
|
2524
2523
|
return [c, new ae().addKeys(p.keys)];
|
|
2525
2524
|
}, count: f, query: f, openCursor: f };
|
|
2526
|
-
return
|
|
2525
|
+
return j(_).forEach(function(p) {
|
|
2527
2526
|
b[p] = function(m) {
|
|
2528
2527
|
var v = G.subscr, y = !!v, S = Or(G, o) && xr(p, m) ? m.obsSet = {} : v;
|
|
2529
2528
|
if (y) {
|
|
2530
|
-
var E = function(
|
|
2531
|
-
return
|
|
2532
|
-
}, O = E(""), A = E(":dels"), v =
|
|
2529
|
+
var E = function(R) {
|
|
2530
|
+
return R = "idb://".concat(t, "/").concat(i, "/").concat(R), S[R] || (S[R] = new ae());
|
|
2531
|
+
}, O = E(""), A = E(":dels"), v = _[p](m), y = v[0], v = v[1];
|
|
2533
2532
|
if ((p === "query" && y.isPrimaryKey && !m.values ? A : E(y.name || "")).add(v), !y.isPrimaryKey) {
|
|
2534
2533
|
if (p !== "count") {
|
|
2535
|
-
var
|
|
2536
|
-
return o[p].apply(this, arguments).then(function(
|
|
2534
|
+
var I = p === "query" && h && m.values && o.query(l(l({}, m), { values: !1 }));
|
|
2535
|
+
return o[p].apply(this, arguments).then(function(R) {
|
|
2537
2536
|
if (p === "query") {
|
|
2538
|
-
if (h && m.values) return
|
|
2539
|
-
return U = U.result, O.addKeys(U),
|
|
2537
|
+
if (h && m.values) return I.then(function(U) {
|
|
2538
|
+
return U = U.result, O.addKeys(U), R;
|
|
2540
2539
|
});
|
|
2541
|
-
var K = m.values ?
|
|
2540
|
+
var K = m.values ? R.result.map(u) : R.result;
|
|
2542
2541
|
(m.values ? O : A).addKeys(K);
|
|
2543
2542
|
} else if (p === "openCursor") {
|
|
2544
|
-
var
|
|
2545
|
-
return
|
|
2546
|
-
return A.addKey(
|
|
2543
|
+
var T = R, L = m.values;
|
|
2544
|
+
return T && Object.create(T, { key: { get: function() {
|
|
2545
|
+
return A.addKey(T.primaryKey), T.key;
|
|
2547
2546
|
} }, primaryKey: { get: function() {
|
|
2548
|
-
var U =
|
|
2547
|
+
var U = T.primaryKey;
|
|
2549
2548
|
return A.addKey(U), U;
|
|
2550
2549
|
} }, value: { get: function() {
|
|
2551
|
-
return L && O.addKey(
|
|
2550
|
+
return L && O.addKey(T.primaryKey), T.value;
|
|
2552
2551
|
} } });
|
|
2553
2552
|
}
|
|
2554
|
-
return
|
|
2553
|
+
return R;
|
|
2555
2554
|
});
|
|
2556
2555
|
}
|
|
2557
2556
|
A.add(n);
|
|
@@ -2566,9 +2565,9 @@ var Mr = { exports: {} };
|
|
|
2566
2565
|
if (n.numFailures === 0) return t;
|
|
2567
2566
|
if (t.type === "deleteRange") return null;
|
|
2568
2567
|
var i = t.keys ? t.keys.length : "values" in t && t.values ? t.values.length : 1;
|
|
2569
|
-
return n.numFailures === i ? null : (t = l({}, t),
|
|
2568
|
+
return n.numFailures === i ? null : (t = l({}, t), P(t.keys) && (t.keys = t.keys.filter(function(o, a) {
|
|
2570
2569
|
return !(a in n.failures);
|
|
2571
|
-
})), "values" in t &&
|
|
2570
|
+
})), "values" in t && P(t.values) && (t.values = t.values.filter(function(o, a) {
|
|
2572
2571
|
return !(a in n.failures);
|
|
2573
2572
|
})), t);
|
|
2574
2573
|
}
|
|
@@ -2576,15 +2575,15 @@ var Mr = { exports: {} };
|
|
|
2576
2575
|
return n = e, ((i = t).lower === void 0 || (i.lowerOpen ? 0 < H(n, i.lower) : 0 <= H(n, i.lower))) && (e = e, (t = t).upper === void 0 || (t.upperOpen ? H(e, t.upper) < 0 : H(e, t.upper) <= 0));
|
|
2577
2576
|
var n, i;
|
|
2578
2577
|
}
|
|
2579
|
-
function kr(e, t,
|
|
2580
|
-
if (!
|
|
2581
|
-
var c = t.query.index, u = c.multiEntry, h = t.query.range, g = i.schema.primaryKey.extractKey, b = c.extractKey, f = (c.lowLevelIndex || c).extractKey,
|
|
2578
|
+
function kr(e, t, _, i, o, a) {
|
|
2579
|
+
if (!_ || _.length === 0) return e;
|
|
2580
|
+
var c = t.query.index, u = c.multiEntry, h = t.query.range, g = i.schema.primaryKey.extractKey, b = c.extractKey, f = (c.lowLevelIndex || c).extractKey, _ = _.reduce(function(p, m) {
|
|
2582
2581
|
var v = p, y = [];
|
|
2583
2582
|
if (m.type === "add" || m.type === "put") for (var S = new ae(), E = m.values.length - 1; 0 <= E; --E) {
|
|
2584
|
-
var O, A = m.values[E],
|
|
2585
|
-
S.hasKey(
|
|
2586
|
-
return Nn(
|
|
2587
|
-
}) : Nn(O, h)) && (S.addKey(
|
|
2583
|
+
var O, A = m.values[E], I = g(A);
|
|
2584
|
+
S.hasKey(I) || (O = b(A), (u && P(O) ? O.some(function(T) {
|
|
2585
|
+
return Nn(T, h);
|
|
2586
|
+
}) : Nn(O, h)) && (S.addKey(I), y.push(A)));
|
|
2588
2587
|
}
|
|
2589
2588
|
switch (m.type) {
|
|
2590
2589
|
case "add":
|
|
@@ -2599,19 +2598,19 @@ var Mr = { exports: {} };
|
|
|
2599
2598
|
}));
|
|
2600
2599
|
break;
|
|
2601
2600
|
case "put":
|
|
2602
|
-
var
|
|
2601
|
+
var C = new ae().addKeys(m.values.map(function(L) {
|
|
2603
2602
|
return g(L);
|
|
2604
2603
|
}));
|
|
2605
2604
|
v = p.filter(function(L) {
|
|
2606
|
-
return !
|
|
2605
|
+
return !C.hasKey(t.values ? g(L) : L);
|
|
2607
2606
|
}).concat(t.values ? y : y.map(function(L) {
|
|
2608
2607
|
return g(L);
|
|
2609
2608
|
}));
|
|
2610
2609
|
break;
|
|
2611
2610
|
case "delete":
|
|
2612
|
-
var
|
|
2611
|
+
var R = new ae().addKeys(m.keys);
|
|
2613
2612
|
v = p.filter(function(L) {
|
|
2614
|
-
return !
|
|
2613
|
+
return !R.hasKey(t.values ? g(L) : L);
|
|
2615
2614
|
});
|
|
2616
2615
|
break;
|
|
2617
2616
|
case "deleteRange":
|
|
@@ -2622,9 +2621,9 @@ var Mr = { exports: {} };
|
|
|
2622
2621
|
}
|
|
2623
2622
|
return v;
|
|
2624
2623
|
}, e);
|
|
2625
|
-
return
|
|
2624
|
+
return _ === e ? e : (_.sort(function(p, m) {
|
|
2626
2625
|
return H(f(p), f(m)) || H(g(p), g(m));
|
|
2627
|
-
}), t.limit && t.limit < 1 / 0 && (
|
|
2626
|
+
}), t.limit && t.limit < 1 / 0 && (_.length > t.limit ? _.length = t.limit : e.length === t.limit && _.length < t.limit && (o.dirty = !0)), a ? Object.freeze(_) : _);
|
|
2628
2627
|
}
|
|
2629
2628
|
function Dr(e, t) {
|
|
2630
2629
|
return H(e.lower, t.lower) === 0 && H(e.upper, t.upper) === 0 && !!e.lowerOpen == !!t.lowerOpen && !!e.upperOpen == !!t.upperOpen;
|
|
@@ -2666,21 +2665,21 @@ var Mr = { exports: {} };
|
|
|
2666
2665
|
return function() {
|
|
2667
2666
|
if (a.abort(), i === "readwrite") {
|
|
2668
2667
|
for (var g = /* @__PURE__ */ new Set(), b = 0, f = n; b < f.length; b++) {
|
|
2669
|
-
var
|
|
2668
|
+
var _ = f[b], p = Ue["idb://".concat(t, "/").concat(_)];
|
|
2670
2669
|
if (p) {
|
|
2671
|
-
var m = e.table(
|
|
2670
|
+
var m = e.table(_), v = p.optimisticOps.filter(function(L) {
|
|
2672
2671
|
return L.trans === u;
|
|
2673
2672
|
});
|
|
2674
|
-
if (u._explicit && h && u.mutatedParts) for (var y = 0, S = Object.values(p.queries.query); y < S.length; y++) for (var E = 0, O = (M = S[y]).slice(); E < O.length; E++) In((
|
|
2673
|
+
if (u._explicit && h && u.mutatedParts) for (var y = 0, S = Object.values(p.queries.query); y < S.length; y++) for (var E = 0, O = (M = S[y]).slice(); E < O.length; E++) In((C = O[E]).obsSet, u.mutatedParts) && (je(M, C), C.subscribers.forEach(function(L) {
|
|
2675
2674
|
return g.add(L);
|
|
2676
2675
|
}));
|
|
2677
2676
|
else if (0 < v.length) {
|
|
2678
2677
|
p.optimisticOps = p.optimisticOps.filter(function(L) {
|
|
2679
2678
|
return L.trans !== u;
|
|
2680
2679
|
});
|
|
2681
|
-
for (var A = 0,
|
|
2680
|
+
for (var A = 0, I = Object.values(p.queries.query); A < I.length; A++) for (var M, C, R, K = 0, T = (M = I[A]).slice(); K < T.length; K++) (C = T[K]).res != null && u.mutatedParts && (h && !C.dirty ? (R = Object.isFrozen(C.res), R = kr(C.res, C.req, v, m, C, R), C.dirty ? (je(M, C), C.subscribers.forEach(function(L) {
|
|
2682
2681
|
return g.add(L);
|
|
2683
|
-
})) :
|
|
2682
|
+
})) : R !== C.res && (C.res = R, C.promise = B.resolve({ result: R }))) : (C.dirty && je(M, C), C.subscribers.forEach(function(L) {
|
|
2684
2683
|
return g.add(L);
|
|
2685
2684
|
})));
|
|
2686
2685
|
}
|
|
@@ -2706,8 +2705,8 @@ var Mr = { exports: {} };
|
|
|
2706
2705
|
je(u.optimisticOps, a), a.mutatedParts && Ht(a.mutatedParts);
|
|
2707
2706
|
})) : c.then(function(h) {
|
|
2708
2707
|
var g = Ar(0, l(l({}, a), { values: a.values.map(function(b, f) {
|
|
2709
|
-
var
|
|
2710
|
-
return h.failures[f] ? b : (b = (
|
|
2708
|
+
var _;
|
|
2709
|
+
return h.failures[f] ? b : (b = (_ = o.keyPath) !== null && _ !== void 0 && _.includes(".") ? Me(b) : l({}, b), le(b, o.keyPath, h.results[f]), b);
|
|
2711
2710
|
}) }), h);
|
|
2712
2711
|
u.optimisticOps.push(g), queueMicrotask(function() {
|
|
2713
2712
|
return a.mutatedParts && Ht(a.mutatedParts);
|
|
@@ -2723,29 +2722,29 @@ var Mr = { exports: {} };
|
|
|
2723
2722
|
if (!O) return [null, !1, E, null];
|
|
2724
2723
|
switch (y) {
|
|
2725
2724
|
case "query":
|
|
2726
|
-
var A = O.find(function(
|
|
2727
|
-
return
|
|
2725
|
+
var A = O.find(function(I) {
|
|
2726
|
+
return I.req.limit === S.limit && I.req.values === S.values && Dr(I.req.query.range, S.query.range);
|
|
2728
2727
|
});
|
|
2729
|
-
return A ? [A, !0, E, O] : [O.find(function(
|
|
2730
|
-
return ("limit" in
|
|
2728
|
+
return A ? [A, !0, E, O] : [O.find(function(I) {
|
|
2729
|
+
return ("limit" in I.req ? I.req.limit : 1 / 0) >= S.limit && (!S.values || I.req.values) && _i(I.req.query.range, S.query.range);
|
|
2731
2730
|
}), !1, E, O];
|
|
2732
2731
|
case "count":
|
|
2733
|
-
return A = O.find(function(
|
|
2734
|
-
return Dr(
|
|
2732
|
+
return A = O.find(function(I) {
|
|
2733
|
+
return Dr(I.req.query.range, S.query.range);
|
|
2735
2734
|
}), [A, !!A, E, O];
|
|
2736
2735
|
}
|
|
2737
|
-
}(t, n, "query", a), b = g[0], f = g[1],
|
|
2736
|
+
}(t, n, "query", a), b = g[0], f = g[1], _ = g[2], p = g[3];
|
|
2738
2737
|
return b && f ? b.obsSet = a.obsSet : (f = i.query(a).then(function(m) {
|
|
2739
2738
|
var v = m.result;
|
|
2740
2739
|
if (b && (b.res = v), c) {
|
|
2741
2740
|
for (var y = 0, S = v.length; y < S; ++y) Object.freeze(v[y]);
|
|
2742
2741
|
Object.freeze(v);
|
|
2743
|
-
} else m.result =
|
|
2742
|
+
} else m.result = Me(v);
|
|
2744
2743
|
return m;
|
|
2745
2744
|
}).catch(function(m) {
|
|
2746
2745
|
return p && b && je(p, b), Promise.reject(m);
|
|
2747
|
-
}), b = { obsSet: a.obsSet, promise: f, subscribers: /* @__PURE__ */ new Set(), type: "query", req: a, dirty: !1 }, p ? p.push(b) : (p = [b], (
|
|
2748
|
-
return { result: kr(m.result, a,
|
|
2746
|
+
}), b = { obsSet: a.obsSet, promise: f, subscribers: /* @__PURE__ */ new Set(), type: "query", req: a, dirty: !1 }, p ? p.push(b) : (p = [b], (_ = _ || (Ue["idb://".concat(t, "/").concat(n)] = { queries: { query: {}, count: {} }, objs: /* @__PURE__ */ new Map(), optimisticOps: [], unsignaledParts: {} })).queries.query[a.query.index.name || ""] = p)), Si(b, p, u, h), b.promise.then(function(m) {
|
|
2747
|
+
return { result: kr(m.result, a, _ == null ? void 0 : _.optimisticOps, i, b, c) };
|
|
2749
2748
|
});
|
|
2750
2749
|
} });
|
|
2751
2750
|
} });
|
|
@@ -2769,7 +2768,7 @@ var Mr = { exports: {} };
|
|
|
2769
2768
|
if (t._state.openComplete) return i(new $.DatabaseClosed(t._state.dbOpenError));
|
|
2770
2769
|
if (!t._state.isBeingOpened) {
|
|
2771
2770
|
if (!t._state.autoOpen) return void i(new $.DatabaseClosed());
|
|
2772
|
-
t.open().catch(
|
|
2771
|
+
t.open().catch(J);
|
|
2773
2772
|
}
|
|
2774
2773
|
t._state.dbReadyPromise.then(n, i);
|
|
2775
2774
|
}).then(e);
|
|
@@ -2815,7 +2814,7 @@ var Mr = { exports: {} };
|
|
|
2815
2814
|
var u = t._deps.indexedDB.deleteDatabase(t.name);
|
|
2816
2815
|
u.onsuccess = ee(function() {
|
|
2817
2816
|
var h, g, b;
|
|
2818
|
-
h = t._deps, g = t.name, b = h.indexedDB, h = h.IDBKeyRange, kn(b) || g ===
|
|
2817
|
+
h = t._deps, g = t.name, b = h.indexedDB, h = h.IDBKeyRange, kn(b) || g === Tt || An(b, h).delete(g).catch(J), o();
|
|
2819
2818
|
}), u.onerror = me(a), u.onblocked = t._fireOnBlocked;
|
|
2820
2819
|
}
|
|
2821
2820
|
if (n) throw new $.InvalidArgument("Invalid closeOptions argument to db.delete()");
|
|
@@ -2834,7 +2833,7 @@ var Mr = { exports: {} };
|
|
|
2834
2833
|
return this._state.autoSchema;
|
|
2835
2834
|
}, Object.defineProperty(ne.prototype, "tables", { get: function() {
|
|
2836
2835
|
var e = this;
|
|
2837
|
-
return
|
|
2836
|
+
return j(this._allTables).map(function(t) {
|
|
2838
2837
|
return e._allTables[t];
|
|
2839
2838
|
});
|
|
2840
2839
|
}, enumerable: !1, configurable: !0 }), ne.prototype.transaction = function() {
|
|
@@ -2876,21 +2875,21 @@ var Mr = { exports: {} };
|
|
|
2876
2875
|
f(g);
|
|
2877
2876
|
}) : te(g);
|
|
2878
2877
|
}
|
|
2879
|
-
var h = (function g(b, f,
|
|
2878
|
+
var h = (function g(b, f, _, p, m) {
|
|
2880
2879
|
return B.resolve().then(function() {
|
|
2881
|
-
var v = G.transless || G, y = b._createTransaction(f,
|
|
2880
|
+
var v = G.transless || G, y = b._createTransaction(f, _, b._dbSchema, p);
|
|
2882
2881
|
if (y.explicit = !0, v = { trans: y, transless: v }, p) y.idbtrans = p.idbtrans;
|
|
2883
2882
|
else try {
|
|
2884
2883
|
y.create(), y.idbtrans._explicit = !0, b._state.PR1398_maxLoop = 3;
|
|
2885
2884
|
} catch (O) {
|
|
2886
2885
|
return O.name === rn.InvalidState && b.isOpen() && 0 < --b._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), b.close({ disableAutoOpen: !1 }), b.open().then(function() {
|
|
2887
|
-
return g(b, f,
|
|
2886
|
+
return g(b, f, _, null, m);
|
|
2888
2887
|
})) : te(O);
|
|
2889
2888
|
}
|
|
2890
2889
|
var S, E = nn(m);
|
|
2891
2890
|
return E && qe(), v = B.follow(function() {
|
|
2892
2891
|
var O;
|
|
2893
|
-
(S = m.call(y, y)) && (E ? (O = Pe.bind(null, null), S.then(O, O)) : typeof S.next == "function" && typeof S.throw == "function" && (S =
|
|
2892
|
+
(S = m.call(y, y)) && (E ? (O = Pe.bind(null, null), S.then(O, O)) : typeof S.next == "function" && typeof S.throw == "function" && (S = Mn(S)));
|
|
2894
2893
|
}, v), (S && typeof S.then == "function" ? B.resolve(S).then(function(O) {
|
|
2895
2894
|
return y.active ? O : te(new $.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
|
|
2896
2895
|
}) : v.then(function() {
|
|
@@ -2908,7 +2907,7 @@ var Mr = { exports: {} };
|
|
|
2908
2907
|
return i._whenReady(h);
|
|
2909
2908
|
}) : this._whenReady(h);
|
|
2910
2909
|
}, ne.prototype.table = function(e) {
|
|
2911
|
-
if (!
|
|
2910
|
+
if (!X(this._allTables, e)) throw new $.InvalidTable("Table ".concat(e, " does not exist"));
|
|
2912
2911
|
return this._allTables[e];
|
|
2913
2912
|
}, ne);
|
|
2914
2913
|
function ne(e, t) {
|
|
@@ -2916,17 +2915,17 @@ var Mr = { exports: {} };
|
|
|
2916
2915
|
this._middlewares = {}, this.verno = 0;
|
|
2917
2916
|
var i = ne.dependencies;
|
|
2918
2917
|
this._options = t = l({ addons: ne.addons, autoOpen: !0, indexedDB: i.indexedDB, IDBKeyRange: i.IDBKeyRange, cache: "cloned" }, t), this._deps = { indexedDB: t.indexedDB, IDBKeyRange: t.IDBKeyRange }, i = t.addons, this._dbSchema = {}, this._versions = [], this._storeNames = [], this._allTables = {}, this.idbdb = null, this._novip = this;
|
|
2919
|
-
var o, a, c, u, h, g = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve:
|
|
2918
|
+
var o, a, c, u, h, g = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: J, dbReadyPromise: null, cancelOpen: J, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: t.autoOpen };
|
|
2920
2919
|
g.dbReadyPromise = new B(function(f) {
|
|
2921
2920
|
g.dbReadyResolve = f;
|
|
2922
|
-
}), g.openCanceller = new B(function(f,
|
|
2923
|
-
g.cancelOpen =
|
|
2924
|
-
}), this._state = g, this.name = e, this.on = dt(this, "populate", "blocked", "versionchange", "close", { ready: [on,
|
|
2925
|
-
return function(
|
|
2921
|
+
}), g.openCanceller = new B(function(f, _) {
|
|
2922
|
+
g.cancelOpen = _;
|
|
2923
|
+
}), this._state = g, this.name = e, this.on = dt(this, "populate", "blocked", "versionchange", "close", { ready: [on, J] }), this.on.ready.subscribe = zn(this.on.ready.subscribe, function(f) {
|
|
2924
|
+
return function(_, p) {
|
|
2926
2925
|
ne.vip(function() {
|
|
2927
2926
|
var m, v = n._state;
|
|
2928
|
-
v.openComplete ? (v.dbOpenError || B.resolve().then(
|
|
2929
|
-
m.on.ready.unsubscribe(
|
|
2927
|
+
v.openComplete ? (v.dbOpenError || B.resolve().then(_), p && f(_)) : v.onReadyBeingFired ? (v.onReadyBeingFired.push(_), p && f(_)) : (f(_), m = n, p || f(function y() {
|
|
2928
|
+
m.on.ready.unsubscribe(_), m.on.ready.unsubscribe(y);
|
|
2930
2929
|
}));
|
|
2931
2930
|
});
|
|
2932
2931
|
};
|
|
@@ -2940,11 +2939,11 @@ var Mr = { exports: {} };
|
|
|
2940
2939
|
}
|
|
2941
2940
|
var v = S._ctx, y = v.table, S = y.hook.reading.fire;
|
|
2942
2941
|
this._ctx = { table: y, index: v.index, isPrimKey: !v.index || y.schema.primKey.keyPath && v.index === y.schema.primKey.name, range: p, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: m, or: v.or, valueMapper: S !== at ? S : null };
|
|
2943
|
-
})), this.Table = (a = this, ft(ur.prototype, function(f,
|
|
2944
|
-
this.db = a, this._tx = p, this.name = f, this.schema =
|
|
2945
|
-
})), this.Transaction = (c = this, ft(ci.prototype, function(f,
|
|
2942
|
+
})), this.Table = (a = this, ft(ur.prototype, function(f, _, p) {
|
|
2943
|
+
this.db = a, this._tx = p, this.name = f, this.schema = _, this.hook = a._allTables[f] ? a._allTables[f].hook : dt(null, { creating: [Jr, J], reading: [Xr, at], updating: [Zr, J], deleting: [Vr, J] });
|
|
2944
|
+
})), this.Transaction = (c = this, ft(ci.prototype, function(f, _, p, m, v) {
|
|
2946
2945
|
var y = this;
|
|
2947
|
-
this.db = c, this.mode = f, this.storeNames =
|
|
2946
|
+
this.db = c, this.mode = f, this.storeNames = _, this.schema = p, this.chromeTransactionDurability = m, this.idbtrans = null, this.on = dt(this, "complete", "error", "abort"), this.parent = v || null, this.active = !0, this._reculock = 0, this._blockedFuncs = [], this._resolve = null, this._reject = null, this._waitingFor = null, this._waitingQueue = null, this._spinCount = 0, this._completion = new B(function(S, E) {
|
|
2948
2947
|
y._resolve = S, y._reject = E;
|
|
2949
2948
|
}), this._completion.then(function() {
|
|
2950
2949
|
y.active = !1, y.on.complete.fire();
|
|
@@ -2954,8 +2953,8 @@ var Mr = { exports: {} };
|
|
|
2954
2953
|
});
|
|
2955
2954
|
})), this.Version = (u = this, ft(gi.prototype, function(f) {
|
|
2956
2955
|
this.db = u, this._cfg = { version: f, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
|
|
2957
|
-
})), this.WhereClause = (h = this, ft(pr.prototype, function(f,
|
|
2958
|
-
if (this.db = h, this._ctx = { table: f, index:
|
|
2956
|
+
})), this.WhereClause = (h = this, ft(pr.prototype, function(f, _, p) {
|
|
2957
|
+
if (this.db = h, this._ctx = { table: f, index: _ === ":id" ? null : _, or: p }, this._cmp = this._ascending = H, this._descending = function(m, v) {
|
|
2959
2958
|
return H(v, m);
|
|
2960
2959
|
}, this._max = function(m, v) {
|
|
2961
2960
|
return 0 < H(m, v) ? m : v;
|
|
@@ -2966,24 +2965,24 @@ var Mr = { exports: {} };
|
|
|
2966
2965
|
0 < f.newVersion ? console.warn("Another connection wants to upgrade database '".concat(n.name, "'. Closing db now to resume the upgrade.")) : console.warn("Another connection wants to delete database '".concat(n.name, "'. Closing db now to resume the delete request.")), n.close({ disableAutoOpen: !1 });
|
|
2967
2966
|
}), this.on("blocked", function(f) {
|
|
2968
2967
|
!f.newVersion || f.newVersion < f.oldVersion ? console.warn("Dexie.delete('".concat(n.name, "') was blocked")) : console.warn("Upgrade '".concat(n.name, "' blocked by other connection holding version ").concat(f.oldVersion / 10));
|
|
2969
|
-
}), this._maxKey = yt(t.IDBKeyRange), this._createTransaction = function(f,
|
|
2970
|
-
return new n.Transaction(f,
|
|
2968
|
+
}), this._maxKey = yt(t.IDBKeyRange), this._createTransaction = function(f, _, p, m) {
|
|
2969
|
+
return new n.Transaction(f, _, p, n._options.chromeTransactionDurability, m);
|
|
2971
2970
|
}, this._fireOnBlocked = function(f) {
|
|
2972
|
-
n.on("blocked").fire(f), et.filter(function(
|
|
2973
|
-
return
|
|
2974
|
-
}).map(function(
|
|
2975
|
-
return
|
|
2971
|
+
n.on("blocked").fire(f), et.filter(function(_) {
|
|
2972
|
+
return _.name === n.name && _ !== n && !_._state.vcFired;
|
|
2973
|
+
}).map(function(_) {
|
|
2974
|
+
return _.on("versionchange").fire(f);
|
|
2976
2975
|
});
|
|
2977
2976
|
}, this.use(vi), this.use(Ei), this.use(wi), this.use(mi), this.use(bi);
|
|
2978
|
-
var b = new Proxy(this, { get: function(f,
|
|
2979
|
-
if (
|
|
2980
|
-
if (
|
|
2977
|
+
var b = new Proxy(this, { get: function(f, _, p) {
|
|
2978
|
+
if (_ === "_vip") return !0;
|
|
2979
|
+
if (_ === "table") return function(v) {
|
|
2981
2980
|
return Qt(n.table(v), b);
|
|
2982
2981
|
};
|
|
2983
|
-
var m = Reflect.get(f,
|
|
2984
|
-
return m instanceof ur ? Qt(m, b) :
|
|
2982
|
+
var m = Reflect.get(f, _, p);
|
|
2983
|
+
return m instanceof ur ? Qt(m, b) : _ === "tables" ? m.map(function(v) {
|
|
2985
2984
|
return Qt(v, b);
|
|
2986
|
-
}) :
|
|
2985
|
+
}) : _ === "_createTransaction" ? function() {
|
|
2987
2986
|
return Qt(m.apply(this, arguments), b);
|
|
2988
2987
|
} : m;
|
|
2989
2988
|
} });
|
|
@@ -3012,10 +3011,10 @@ var Mr = { exports: {} };
|
|
|
3012
3011
|
u || (u = !0, c && c.abort(), f && Re.storagemutated.unsubscribe(p));
|
|
3013
3012
|
} };
|
|
3014
3013
|
o.start && o.start(b);
|
|
3015
|
-
var f = !1,
|
|
3014
|
+
var f = !1, _ = function() {
|
|
3016
3015
|
return hn(m);
|
|
3017
3016
|
}, p = function(v) {
|
|
3018
|
-
zt(h, v), In(g, h) &&
|
|
3017
|
+
zt(h, v), In(g, h) && _();
|
|
3019
3018
|
}, m = function() {
|
|
3020
3019
|
var v, y, S;
|
|
3021
3020
|
!u && Xt.indexedDB && (h = {}, v = {}, c && c.abort(), c = new AbortController(), S = function(E) {
|
|
@@ -3027,9 +3026,9 @@ var Mr = { exports: {} };
|
|
|
3027
3026
|
} finally {
|
|
3028
3027
|
O && Ze();
|
|
3029
3028
|
}
|
|
3030
|
-
}(y = { subscr: v, signal: c.signal, requery:
|
|
3029
|
+
}(y = { subscr: v, signal: c.signal, requery: _, querier: e, trans: null }), Promise.resolve(S).then(function(E) {
|
|
3031
3030
|
n = !0, t = E, u || y.signal.aborted || (h = {}, function(O) {
|
|
3032
|
-
for (var A in O) if (
|
|
3031
|
+
for (var A in O) if (X(O, A)) return;
|
|
3033
3032
|
return 1;
|
|
3034
3033
|
}(g = v) || f || (Re(gt, p), f = !0), hn(function() {
|
|
3035
3034
|
return !u && o.next && o.next(E);
|
|
@@ -3040,7 +3039,7 @@ var Mr = { exports: {} };
|
|
|
3040
3039
|
});
|
|
3041
3040
|
}));
|
|
3042
3041
|
};
|
|
3043
|
-
return setTimeout(
|
|
3042
|
+
return setTimeout(_, 0), b;
|
|
3044
3043
|
});
|
|
3045
3044
|
return i.hasValue = function() {
|
|
3046
3045
|
return n;
|
|
@@ -3050,11 +3049,11 @@ var Mr = { exports: {} };
|
|
|
3050
3049
|
}
|
|
3051
3050
|
var We = Oe;
|
|
3052
3051
|
function Ln(e) {
|
|
3053
|
-
var t =
|
|
3052
|
+
var t = Te;
|
|
3054
3053
|
try {
|
|
3055
|
-
|
|
3054
|
+
Te = !0, Re.storagemutated.fire(e), Tn(e, !0);
|
|
3056
3055
|
} finally {
|
|
3057
|
-
|
|
3056
|
+
Te = t;
|
|
3058
3057
|
}
|
|
3059
3058
|
}
|
|
3060
3059
|
pe(We, l(l({}, Ot), { delete: function(e) {
|
|
@@ -3071,7 +3070,7 @@ var Mr = { exports: {} };
|
|
|
3071
3070
|
return i.map(function(o) {
|
|
3072
3071
|
return o.name;
|
|
3073
3072
|
}).filter(function(o) {
|
|
3074
|
-
return o !==
|
|
3073
|
+
return o !== Tt;
|
|
3075
3074
|
});
|
|
3076
3075
|
}) : An(n, t).toCollection().primaryKeys()).then(e);
|
|
3077
3076
|
} catch {
|
|
@@ -3080,14 +3079,14 @@ var Mr = { exports: {} };
|
|
|
3080
3079
|
var t, n;
|
|
3081
3080
|
}, defineClass: function() {
|
|
3082
3081
|
return function(e) {
|
|
3083
|
-
|
|
3082
|
+
Y(this, e);
|
|
3084
3083
|
};
|
|
3085
3084
|
}, ignoreTransaction: function(e) {
|
|
3086
3085
|
return G.trans ? Ge(G.transless, e) : e();
|
|
3087
3086
|
}, vip: Dn, async: function(e) {
|
|
3088
3087
|
return function() {
|
|
3089
3088
|
try {
|
|
3090
|
-
var t =
|
|
3089
|
+
var t = Mn(e.apply(this, arguments));
|
|
3091
3090
|
return t && typeof t.then == "function" ? t : B.resolve(t);
|
|
3092
3091
|
} catch (n) {
|
|
3093
3092
|
return te(n);
|
|
@@ -3095,7 +3094,7 @@ var Mr = { exports: {} };
|
|
|
3095
3094
|
};
|
|
3096
3095
|
}, spawn: function(e, t, n) {
|
|
3097
3096
|
try {
|
|
3098
|
-
var i =
|
|
3097
|
+
var i = Mn(e.apply(n, t || []));
|
|
3099
3098
|
return i && typeof i.then == "function" ? i : B.resolve(i);
|
|
3100
3099
|
} catch (o) {
|
|
3101
3100
|
return te(o);
|
|
@@ -3108,27 +3107,27 @@ var Mr = { exports: {} };
|
|
|
3108
3107
|
return ye;
|
|
3109
3108
|
}, set: function(e) {
|
|
3110
3109
|
Zn(e);
|
|
3111
|
-
} }, derive: Ye, extend:
|
|
3110
|
+
} }, derive: Ye, extend: Y, props: pe, override: zn, Events: dt, on: Re, liveQuery: Pr, extendObservabilitySet: zt, getByKeyPath: we, setByKeyPath: le, delByKeyPath: function(e, t) {
|
|
3112
3111
|
typeof t == "string" ? le(e, t, void 0) : "length" in t && [].map.call(t, function(n) {
|
|
3113
3112
|
le(e, n, void 0);
|
|
3114
3113
|
});
|
|
3115
|
-
}, shallowClone: Yn, deepClone:
|
|
3114
|
+
}, shallowClone: Yn, deepClone: Me, getObjectDiff: jn, cmp: H, asap: Hn, minKey: -1 / 0, addons: [], connections: et, errnames: rn, dependencies: Xt, cache: Ue, semVer: "4.0.10", version: "4.0.10".split(".").map(function(e) {
|
|
3116
3115
|
return parseInt(e);
|
|
3117
3116
|
}).reduce(function(e, t, n) {
|
|
3118
3117
|
return e + t / Math.pow(10, 2 * n);
|
|
3119
3118
|
}) })), We.maxKey = yt(We.dependencies.IDBKeyRange), typeof dispatchEvent < "u" && typeof addEventListener < "u" && (Re(gt, function(e) {
|
|
3120
|
-
|
|
3119
|
+
Te || (e = new CustomEvent(vn, { detail: e }), Te = !0, dispatchEvent(e), Te = !1);
|
|
3121
3120
|
}), addEventListener(vn, function(e) {
|
|
3122
|
-
e = e.detail,
|
|
3121
|
+
e = e.detail, Te || Ln(e);
|
|
3123
3122
|
}));
|
|
3124
|
-
var rt,
|
|
3123
|
+
var rt, Te = !1, Ir = function() {
|
|
3125
3124
|
};
|
|
3126
3125
|
return typeof BroadcastChannel < "u" && ((Ir = function() {
|
|
3127
3126
|
(rt = new BroadcastChannel(vn)).onmessage = function(e) {
|
|
3128
3127
|
return e.data && Ln(e.data);
|
|
3129
3128
|
};
|
|
3130
3129
|
})(), typeof rt.unref == "function" && rt.unref(), Re(gt, function(e) {
|
|
3131
|
-
|
|
3130
|
+
Te || rt.postMessage(e);
|
|
3132
3131
|
})), typeof addEventListener < "u" && (addEventListener("pagehide", function(e) {
|
|
3133
3132
|
if (!Oe.disableBfCache && e.persisted) {
|
|
3134
3133
|
ye && console.debug("Dexie: handling persisted pagehide"), rt != null && rt.close();
|
|
@@ -3148,16 +3147,16 @@ var Mr = { exports: {} };
|
|
|
3148
3147
|
return new ht({ remove: e });
|
|
3149
3148
|
}, default: Oe, RangeSet: ae, mergeRanges: vt, rangesOverlap: vr }), { default: Oe }), Oe;
|
|
3150
3149
|
});
|
|
3151
|
-
})(
|
|
3152
|
-
var Ii =
|
|
3150
|
+
})(Tr);
|
|
3151
|
+
var Ii = Tr.exports;
|
|
3153
3152
|
const Un = /* @__PURE__ */ Pi(Ii), Rr = Symbol.for("Dexie"), qt = globalThis[Rr] || (globalThis[Rr] = Un);
|
|
3154
3153
|
if (Un.semVer !== qt.semVer)
|
|
3155
3154
|
throw new Error(`Two different versions of Dexie loaded in the same app: ${Un.semVer} and ${qt.semVer}`);
|
|
3156
|
-
function
|
|
3155
|
+
function V(d) {
|
|
3157
3156
|
let r = `${d.type}.${d.topics}`;
|
|
3158
3157
|
return d.order && (r += `.${d.order}`), d.period && (r += `.${d.period}`), r;
|
|
3159
3158
|
}
|
|
3160
|
-
function
|
|
3159
|
+
function Mr(d) {
|
|
3161
3160
|
var r;
|
|
3162
3161
|
if (d.widget === void 0) {
|
|
3163
3162
|
const s = (r = d.topics) == null ? void 0 : r.split("-");
|
|
@@ -3166,11 +3165,11 @@ function Tr(d) {
|
|
|
3166
3165
|
return d.topics === void 0 && (d.topics = `${d.dashboard}-${d.widget}`), d;
|
|
3167
3166
|
}
|
|
3168
3167
|
function _t(d, r) {
|
|
3169
|
-
var
|
|
3170
|
-
let s, l, x, D,
|
|
3168
|
+
var P;
|
|
3169
|
+
let s, l, x, D, j;
|
|
3171
3170
|
switch (d.moderation) {
|
|
3172
3171
|
case Zt.BEFORE:
|
|
3173
|
-
s = /* @__PURE__ */ new Date(), l = (
|
|
3172
|
+
s = /* @__PURE__ */ new Date(), l = (P = d.beforeTime) == null ? void 0 : P.split(":"), x = Number.parseInt(l ? l[0] : "00"), D = Number.parseInt(l ? l[1] : "00"), j = Number.parseInt(l ? l[2] : "00"), r.before = s.setHours(x, D, j, 0) / 1e3, r.period || (r.period = s.getDay() === 1 ? 72 : 24);
|
|
3174
3173
|
break;
|
|
3175
3174
|
case Zt.DELAYED:
|
|
3176
3175
|
d.delay && d.delay > 0 && (r.delay = `${d.delay}`);
|
|
@@ -3197,14 +3196,14 @@ class jr {
|
|
|
3197
3196
|
const s = await this.db.table(N.CLOUD).where({ id: r.widget }).last().catch(() => {
|
|
3198
3197
|
console.warn(
|
|
3199
3198
|
"%capi%C %ccloud",
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3199
|
+
w.API,
|
|
3200
|
+
w.NONE,
|
|
3201
|
+
w.CLOUD,
|
|
3203
3202
|
r.slide,
|
|
3204
3203
|
r.widget
|
|
3205
3204
|
);
|
|
3206
3205
|
});
|
|
3207
|
-
return s
|
|
3206
|
+
return typeof s > "u" ? { data: null, message: "Cloud Data error", success: !1 } : (s.data.presentation = (r == null ? void 0 : r.presentation) || "not set", s.data.slide = (r == null ? void 0 : r.slide) || "not set", s.message = "Messages retrieved successfully", s.success = !0, s);
|
|
3208
3207
|
});
|
|
3209
3208
|
/**
|
|
3210
3209
|
* Retrieve Cloud Data
|
|
@@ -3215,9 +3214,9 @@ class jr {
|
|
|
3215
3214
|
const s = await this.db.table(N.SERIES).where({ id: r.widget }).last().catch(() => {
|
|
3216
3215
|
console.warn(
|
|
3217
3216
|
"%capi%c %cseries",
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3217
|
+
w.API,
|
|
3218
|
+
w.NONE,
|
|
3219
|
+
w.SERIES,
|
|
3221
3220
|
r.slide,
|
|
3222
3221
|
r.widget
|
|
3223
3222
|
);
|
|
@@ -3232,14 +3231,14 @@ class jr {
|
|
|
3232
3231
|
k(this, "getMessages", async (r) => {
|
|
3233
3232
|
const s = (r == null ? void 0 : r.order) ?? "utc";
|
|
3234
3233
|
s !== "utc" && (r.since = Math.floor(Date.now() / 1e3) - 60 * 60 * 24 * 7), this.options.delay != 0 ? r.before = Math.floor(Date.now() / 1e3) - (this.options.delay || 0) : r.before = Math.floor(Date.now() / 1e3);
|
|
3235
|
-
const l = (
|
|
3234
|
+
const l = (j) => j.utc > ((r == null ? void 0 : r.since) || 0), x = (j) => j.utc < ((r == null ? void 0 : r.before) || Date.now() / 1e3), D = (j) => (j == null ? void 0 : j.visible) !== 0;
|
|
3236
3235
|
try {
|
|
3237
|
-
const
|
|
3238
|
-
if (
|
|
3236
|
+
const P = await this.db.table(N.TOPICS).where("widget_id").equals(r.widget).filter(D).filter(l).filter(x).reverse().limit((r == null ? void 0 : r.limit) ?? 25).sortBy(s);
|
|
3237
|
+
if (P.length === 0)
|
|
3239
3238
|
return { data: null, message: "No Messages error", success: !1 };
|
|
3240
|
-
let
|
|
3241
|
-
return qt.Promise.all(
|
|
3242
|
-
const ve =
|
|
3239
|
+
let Y = P.map((Z) => this.db.table(N.MESSAGES).get({ id: Z.message_id }));
|
|
3240
|
+
return qt.Promise.all(Y).then(async (Z) => {
|
|
3241
|
+
const ve = Z.map((pe) => pe.data), X = {
|
|
3243
3242
|
data: {
|
|
3244
3243
|
presentation: (r == null ? void 0 : r.presentation) || "not set",
|
|
3245
3244
|
slide: (r == null ? void 0 : r.slide) || "not set",
|
|
@@ -3253,20 +3252,20 @@ class jr {
|
|
|
3253
3252
|
};
|
|
3254
3253
|
return console.debug(
|
|
3255
3254
|
"%cstorage%c %cmessages",
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
),
|
|
3255
|
+
w.STORAGE,
|
|
3256
|
+
w.NONE,
|
|
3257
|
+
w.MESSAGES,
|
|
3258
|
+
X
|
|
3259
|
+
), X;
|
|
3261
3260
|
});
|
|
3262
|
-
} catch (
|
|
3261
|
+
} catch (j) {
|
|
3263
3262
|
return console.warn(
|
|
3264
3263
|
"%cstorage%c %cmessages",
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3264
|
+
w.STORAGE,
|
|
3265
|
+
w.NONE,
|
|
3266
|
+
w.MESSAGES,
|
|
3268
3267
|
r,
|
|
3269
|
-
|
|
3268
|
+
j
|
|
3270
3269
|
), { data: null, message: "Messages Data error", success: !1 };
|
|
3271
3270
|
}
|
|
3272
3271
|
});
|
|
@@ -3279,8 +3278,9 @@ class jr {
|
|
|
3279
3278
|
k(this, "setCloud", async (r, s) => r.type === N.CLOUD && s !== "" ? await this.db.table(N.CLOUD).put({
|
|
3280
3279
|
id: r.widget,
|
|
3281
3280
|
dashboard_id: r.dashboard,
|
|
3282
|
-
data:
|
|
3283
|
-
|
|
3281
|
+
//data: data.data,
|
|
3282
|
+
data: s
|
|
3283
|
+
}).then(() => 201).catch((l) => (console.error("%cstorage", w.STORAGE, "set", r, l.message), 400)) : 400);
|
|
3284
3284
|
/**
|
|
3285
3285
|
* Update Series
|
|
3286
3286
|
* @param query IQuery
|
|
@@ -3290,8 +3290,9 @@ class jr {
|
|
|
3290
3290
|
k(this, "setSeries", async (r, s) => r.type === N.SERIES && s !== "" ? await this.db.table(N.SERIES).put({
|
|
3291
3291
|
id: r.widget,
|
|
3292
3292
|
dashboard_id: r.dashboard,
|
|
3293
|
-
data:
|
|
3294
|
-
|
|
3293
|
+
//data: data.data,
|
|
3294
|
+
data: s
|
|
3295
|
+
}).then(() => 201).catch((l) => (console.error("%cstorage", w.STORAGE, "set", r, l.message), 400)) : 400);
|
|
3295
3296
|
/**
|
|
3296
3297
|
* Update Messages
|
|
3297
3298
|
* @param query IQuery
|
|
@@ -3304,7 +3305,7 @@ class jr {
|
|
|
3304
3305
|
const l = s.data.title;
|
|
3305
3306
|
let x = 0;
|
|
3306
3307
|
return s.data.messages.forEach(async (D) => {
|
|
3307
|
-
var
|
|
3308
|
+
var j, P, Y, Z, ve, X, pe;
|
|
3308
3309
|
D.id !== null && (await this.db.table(N.MESSAGES).put({
|
|
3309
3310
|
id: D.id,
|
|
3310
3311
|
utc: D.utc,
|
|
@@ -3313,7 +3314,7 @@ class jr {
|
|
|
3313
3314
|
}).catch((He) => {
|
|
3314
3315
|
x++, console.error(
|
|
3315
3316
|
"%cstorage",
|
|
3316
|
-
|
|
3317
|
+
w.STORAGE,
|
|
3317
3318
|
"set message",
|
|
3318
3319
|
`title: ${l}`,
|
|
3319
3320
|
D,
|
|
@@ -3324,16 +3325,16 @@ class jr {
|
|
|
3324
3325
|
widget_id: r.widget,
|
|
3325
3326
|
message_id: D.id,
|
|
3326
3327
|
dashboard_id: r.dashboard,
|
|
3327
|
-
engagement: ((
|
|
3328
|
-
impressions: ((
|
|
3329
|
-
reach: ((ve = D.topics[0]) == null ? void 0 : ve.reach) || ((
|
|
3328
|
+
engagement: ((j = D.topics[0]) == null ? void 0 : j.engagement) || ((P = D.dynamics) == null ? void 0 : P.engagement) || 0,
|
|
3329
|
+
impressions: ((Y = D.topics[0]) == null ? void 0 : Y.impressions) || ((Z = D.dynamics) == null ? void 0 : Z.semrush_visits) || 0,
|
|
3330
|
+
reach: ((ve = D.topics[0]) == null ? void 0 : ve.reach) || ((X = D.dynamics) == null ? void 0 : X.potential_reach) || 0,
|
|
3330
3331
|
sentiment: ((pe = D.topics[0]) == null ? void 0 : pe.sentiment) || 0,
|
|
3331
3332
|
utc: D.utc,
|
|
3332
3333
|
expires: D.expires
|
|
3333
3334
|
}).catch((He) => {
|
|
3334
3335
|
x++, console.error(
|
|
3335
3336
|
"%cstorage",
|
|
3336
|
-
|
|
3337
|
+
w.STORAGE,
|
|
3337
3338
|
"set topic",
|
|
3338
3339
|
`title: ${l}`,
|
|
3339
3340
|
D,
|
|
@@ -3341,15 +3342,15 @@ class jr {
|
|
|
3341
3342
|
);
|
|
3342
3343
|
}));
|
|
3343
3344
|
}), s.data.topics.forEach(async (D) => {
|
|
3344
|
-
const
|
|
3345
|
-
await this.db.table(N.TOPICS).where("message_id").equals(
|
|
3345
|
+
const j = D.message_id, P = D.visible ? 1 : 0, Y = D.title;
|
|
3346
|
+
await this.db.table(N.TOPICS).where("message_id").equals(j).modify({ visible: P }).catch((Z) => {
|
|
3346
3347
|
x++, console.error(
|
|
3347
3348
|
"%cstorage",
|
|
3348
|
-
|
|
3349
|
+
w.STORAGE,
|
|
3349
3350
|
"update message visibility",
|
|
3350
|
-
`title: ${
|
|
3351
|
+
`title: ${Y}`,
|
|
3351
3352
|
`widget: ${D.widget_id}`,
|
|
3352
|
-
|
|
3353
|
+
Z.message
|
|
3353
3354
|
);
|
|
3354
3355
|
});
|
|
3355
3356
|
}), x === 0 ? 201 : 400;
|
|
@@ -3361,24 +3362,24 @@ class jr {
|
|
|
3361
3362
|
const r = Date.now() / 1e3, s = (D) => D.expires < r, l = (D) => D.expires < r;
|
|
3362
3363
|
return await this.db.table(N.TOPICS).orderBy("expires").filter(s).delete().catch((D) => (console.error(
|
|
3363
3364
|
"%cstorage%c %cclean",
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3365
|
+
w.STORAGE,
|
|
3366
|
+
w.NONE,
|
|
3367
|
+
w.MESSAGES,
|
|
3367
3368
|
D.message
|
|
3368
3369
|
), 0)), await this.db.table(N.MESSAGES).orderBy("expires").filter(l).delete().catch((D) => (console.error(
|
|
3369
3370
|
"%cstorage%c %clean",
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3371
|
+
w.STORAGE,
|
|
3372
|
+
w.NONE,
|
|
3373
|
+
w.MESSAGES,
|
|
3373
3374
|
D.message
|
|
3374
3375
|
), 0));
|
|
3375
3376
|
});
|
|
3376
3377
|
k(this, "hideMessage", async (r, s) => {
|
|
3377
3378
|
await this.db.table(N.TOPICS).where("message_id").equals(r).modify({ visible: s ? 1 : 0 }).catch((l) => (console.error(
|
|
3378
3379
|
"%cstorage%c %chide",
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3380
|
+
w.STORAGE,
|
|
3381
|
+
w.NONE,
|
|
3382
|
+
w.HIDE,
|
|
3382
3383
|
l.message
|
|
3383
3384
|
), 0));
|
|
3384
3385
|
});
|
|
@@ -3393,7 +3394,7 @@ class jr {
|
|
|
3393
3394
|
type: r.type
|
|
3394
3395
|
}).then(() => 201).catch((s) => (console.error(
|
|
3395
3396
|
"%cstorage",
|
|
3396
|
-
|
|
3397
|
+
w.STORAGE,
|
|
3397
3398
|
N.WIDGET,
|
|
3398
3399
|
r,
|
|
3399
3400
|
s.message
|
|
@@ -3403,13 +3404,13 @@ class jr {
|
|
|
3403
3404
|
* @param query IQuery
|
|
3404
3405
|
* @returns null
|
|
3405
3406
|
*/
|
|
3406
|
-
k(this, "subscribe", (r) => (r =
|
|
3407
|
+
k(this, "subscribe", (r) => (r = Mr(r), this.subscribers.filter(
|
|
3407
3408
|
(l) => l.widget === r.widget
|
|
3408
3409
|
).length > 0 || (r.type === N.MESSAGES && (r = _t(this.options, r)), console.debug(
|
|
3409
3410
|
"%cstorage%c %csubscribe",
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3411
|
+
w.STORAGE,
|
|
3412
|
+
w.NONE,
|
|
3413
|
+
w.SUBSCRIBE,
|
|
3413
3414
|
r.slide,
|
|
3414
3415
|
r.widget
|
|
3415
3416
|
), this.subscribers.push(r)), null));
|
|
@@ -3427,9 +3428,9 @@ class jr {
|
|
|
3427
3428
|
const s = await this.db.table(N.SLIDE).where({ id: r.id }).last().catch(() => {
|
|
3428
3429
|
console.warn(
|
|
3429
3430
|
"%capi%c %cseries",
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3431
|
+
w.API,
|
|
3432
|
+
w.NONE,
|
|
3433
|
+
w.SERIES,
|
|
3433
3434
|
r.id
|
|
3434
3435
|
);
|
|
3435
3436
|
});
|
|
@@ -3448,7 +3449,7 @@ class jr {
|
|
|
3448
3449
|
css: r.data.css || ""
|
|
3449
3450
|
}).then(() => 200).catch((s) => (console.error(
|
|
3450
3451
|
"%cstorage",
|
|
3451
|
-
|
|
3452
|
+
w.STORAGE,
|
|
3452
3453
|
re.SLIDE_STORE,
|
|
3453
3454
|
r,
|
|
3454
3455
|
s.message
|
|
@@ -3477,7 +3478,7 @@ function Ci(d, r) {
|
|
|
3477
3478
|
const s = indexedDB.open(d);
|
|
3478
3479
|
s.onupgradeneeded = () => s.result.createObjectStore(r);
|
|
3479
3480
|
const l = Wn(s);
|
|
3480
|
-
return (x, D) => l.then((
|
|
3481
|
+
return (x, D) => l.then((j) => D(j.transaction(r, x).objectStore(r)));
|
|
3481
3482
|
}
|
|
3482
3483
|
let $n;
|
|
3483
3484
|
function Kr() {
|
|
@@ -3494,16 +3495,16 @@ class Nr {
|
|
|
3494
3495
|
k(this, "subscribers", []);
|
|
3495
3496
|
k(this, "options");
|
|
3496
3497
|
k(this, "getCloud", async (r) => {
|
|
3497
|
-
const s =
|
|
3498
|
-
return await Vt(s).then((l) => l).catch(() => (console.warn("%capi",
|
|
3498
|
+
const s = V(r);
|
|
3499
|
+
return await Vt(s).then((l) => l).catch(() => (console.warn("%capi", w.API, N.CLOUD, r.slide, r.widget), { data: null, message: "Cloud Data error", success: !1 }));
|
|
3499
3500
|
});
|
|
3500
3501
|
k(this, "getSeries", async (r) => {
|
|
3501
|
-
const s =
|
|
3502
|
-
return await Vt(s).then((l) => l).catch(() => (console.warn("%capi",
|
|
3502
|
+
const s = V(r);
|
|
3503
|
+
return await Vt(s).then((l) => l).catch(() => (console.warn("%capi", w.API, N.SERIES, r.slide, r.widget), { data: null, message: "Series Data error", success: !1 }));
|
|
3503
3504
|
});
|
|
3504
3505
|
k(this, "getMessages", async (r) => {
|
|
3505
|
-
const s =
|
|
3506
|
-
return await Vt(s).then((l) => l).catch(() => (console.warn("%capi",
|
|
3506
|
+
const s = V(r);
|
|
3507
|
+
return await Vt(s).then((l) => l).catch(() => (console.warn("%capi", w.API, N.MESSAGES, r.slide, r.widget), { data: null, message: "Messages Data error", success: !1 }));
|
|
3507
3508
|
});
|
|
3508
3509
|
/**
|
|
3509
3510
|
* Update Cloud
|
|
@@ -3514,8 +3515,8 @@ class Nr {
|
|
|
3514
3515
|
k(this, "setCloud", async (r, s) => {
|
|
3515
3516
|
if (!s.success)
|
|
3516
3517
|
return 400;
|
|
3517
|
-
const l =
|
|
3518
|
-
return delete s.success, delete s.message, await wt(l, s).then(() => 201).catch((x) => (console.error("%cstorage",
|
|
3518
|
+
const l = V(r);
|
|
3519
|
+
return delete s.success, delete s.message, await wt(l, s).then(() => 201).catch((x) => (console.error("%cstorage", w.STORAGE, N.CLOUD, r, x.message), 400));
|
|
3519
3520
|
});
|
|
3520
3521
|
/**
|
|
3521
3522
|
* Update Series
|
|
@@ -3526,8 +3527,8 @@ class Nr {
|
|
|
3526
3527
|
k(this, "setSeries", async (r, s) => {
|
|
3527
3528
|
if (!s.success)
|
|
3528
3529
|
return 400;
|
|
3529
|
-
const l =
|
|
3530
|
-
return delete s.success, delete s.message, await wt(l, s).then(() => 201).catch((x) => (console.error("%cstorage",
|
|
3530
|
+
const l = V(r);
|
|
3531
|
+
return delete s.success, delete s.message, await wt(l, s).then(() => 201).catch((x) => (console.error("%cstorage", w.STORAGE, N.SERIES, r, x.message), 400));
|
|
3531
3532
|
});
|
|
3532
3533
|
/**
|
|
3533
3534
|
* Update Messages
|
|
@@ -3538,8 +3539,8 @@ class Nr {
|
|
|
3538
3539
|
k(this, "setMessages", async (r, s) => {
|
|
3539
3540
|
if (!s.success)
|
|
3540
3541
|
return 400;
|
|
3541
|
-
const l =
|
|
3542
|
-
return delete s.success, delete s.message, await wt(l, s).then(() => 201).catch((x) => (console.error("%cstorage",
|
|
3542
|
+
const l = V(r);
|
|
3543
|
+
return delete s.success, delete s.message, await wt(l, s).then(() => 201).catch((x) => (console.error("%cstorage", w.STORAGE, N.MESSAGES, r, x.message), 400));
|
|
3543
3544
|
});
|
|
3544
3545
|
k(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((s) => s(0))));
|
|
3545
3546
|
k(this, "hideMessage", async (r, s) => {
|
|
@@ -3553,12 +3554,12 @@ class Nr {
|
|
|
3553
3554
|
* @returns number
|
|
3554
3555
|
*/
|
|
3555
3556
|
k(this, "setWidget", async (r) => {
|
|
3556
|
-
const s =
|
|
3557
|
+
const s = V(r), l = {
|
|
3557
3558
|
id: r.widget,
|
|
3558
3559
|
dashboard_id: r.dashboard,
|
|
3559
3560
|
type: r.type
|
|
3560
3561
|
};
|
|
3561
|
-
return await wt(s, l).then(() => 201).catch((x) => (console.error("%cstorage",
|
|
3562
|
+
return await wt(s, l).then(() => 201).catch((x) => (console.error("%cstorage", w.STORAGE, N.WIDGET, r, x.message), 400));
|
|
3562
3563
|
});
|
|
3563
3564
|
/**
|
|
3564
3565
|
* Add component subscriber
|
|
@@ -3569,9 +3570,9 @@ class Nr {
|
|
|
3569
3570
|
(l) => l.widget === r.widget
|
|
3570
3571
|
).length > 0 || (console.debug(
|
|
3571
3572
|
"%cstorage%c %csubscribe",
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3573
|
+
w.STORAGE,
|
|
3574
|
+
w.NONE,
|
|
3575
|
+
w.SUBSCRIBE,
|
|
3575
3576
|
r.slide,
|
|
3576
3577
|
r.widget
|
|
3577
3578
|
), this.subscribers.push(r)), null));
|
|
@@ -3581,8 +3582,8 @@ class Nr {
|
|
|
3581
3582
|
*/
|
|
3582
3583
|
k(this, "getSubscribers", async () => await new Promise((r) => r(this.subscribers)));
|
|
3583
3584
|
k(this, "loadSlide", async (r) => {
|
|
3584
|
-
const s =
|
|
3585
|
-
return await Vt(s).then((l) => l).catch(() => (console.warn("%capi",
|
|
3585
|
+
const s = V(r);
|
|
3586
|
+
return await Vt(s).then((l) => l).catch(() => (console.warn("%capi", w.API, N.SLIDE, r.slide), { data: null, message: "Slide Load error", success: !1 }));
|
|
3586
3587
|
});
|
|
3587
3588
|
/**
|
|
3588
3589
|
* Update Slide
|
|
@@ -3590,14 +3591,14 @@ class Nr {
|
|
|
3590
3591
|
* @returns number
|
|
3591
3592
|
*/
|
|
3592
3593
|
k(this, "storeSlide", async (r) => {
|
|
3593
|
-
const s =
|
|
3594
|
+
const s = V(r), l = {
|
|
3594
3595
|
id: r.id,
|
|
3595
3596
|
title: r.data.title || "Not set",
|
|
3596
3597
|
json: r.data.json || {},
|
|
3597
3598
|
html: r.data.html || "",
|
|
3598
3599
|
css: r.data.css || ""
|
|
3599
3600
|
};
|
|
3600
|
-
return await wt(s, l).then(() => 201).catch((x) => (console.error("%cstorage",
|
|
3601
|
+
return await wt(s, l).then(() => 201).catch((x) => (console.error("%cstorage", w.STORAGE, N.SLIDE, r, x.message), 400));
|
|
3601
3602
|
});
|
|
3602
3603
|
this.options = r;
|
|
3603
3604
|
}
|
|
@@ -3607,27 +3608,27 @@ class Br {
|
|
|
3607
3608
|
k(this, "subscribers", []);
|
|
3608
3609
|
k(this, "options");
|
|
3609
3610
|
k(this, "getCloud", async (r) => {
|
|
3610
|
-
const s =
|
|
3611
|
+
const s = V(r);
|
|
3611
3612
|
try {
|
|
3612
3613
|
return localStorage.getObject(s);
|
|
3613
3614
|
} catch (l) {
|
|
3614
|
-
return console.warn("%capi",
|
|
3615
|
+
return console.warn("%capi", w.API, N.CLOUD, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3615
3616
|
}
|
|
3616
3617
|
});
|
|
3617
3618
|
k(this, "getSeries", async (r) => {
|
|
3618
|
-
const s =
|
|
3619
|
+
const s = V(r);
|
|
3619
3620
|
try {
|
|
3620
3621
|
return localStorage.getObject(s);
|
|
3621
3622
|
} catch (l) {
|
|
3622
|
-
return console.warn("%capi",
|
|
3623
|
+
return console.warn("%capi", w.API, N.SERIES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3623
3624
|
}
|
|
3624
3625
|
});
|
|
3625
3626
|
k(this, "getMessages", async (r) => {
|
|
3626
|
-
const s =
|
|
3627
|
+
const s = V(r);
|
|
3627
3628
|
try {
|
|
3628
3629
|
return localStorage.getObject(s);
|
|
3629
3630
|
} catch (l) {
|
|
3630
|
-
return console.warn("%capi",
|
|
3631
|
+
return console.warn("%capi", w.API, N.MESSAGES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3631
3632
|
}
|
|
3632
3633
|
});
|
|
3633
3634
|
/**
|
|
@@ -3637,11 +3638,11 @@ class Br {
|
|
|
3637
3638
|
* @returns number
|
|
3638
3639
|
*/
|
|
3639
3640
|
k(this, "setCloud", async (r, s) => {
|
|
3640
|
-
const l =
|
|
3641
|
+
const l = V(r);
|
|
3641
3642
|
try {
|
|
3642
3643
|
return localStorage.setObject(l, s), 201;
|
|
3643
3644
|
} catch (x) {
|
|
3644
|
-
return console.error("%cstorage",
|
|
3645
|
+
return console.error("%cstorage", w.STORAGE, N.CLOUD, r, x), 400;
|
|
3645
3646
|
}
|
|
3646
3647
|
});
|
|
3647
3648
|
/**
|
|
@@ -3651,11 +3652,11 @@ class Br {
|
|
|
3651
3652
|
* @returns number
|
|
3652
3653
|
*/
|
|
3653
3654
|
k(this, "setSeries", async (r, s) => {
|
|
3654
|
-
const l =
|
|
3655
|
+
const l = V(r);
|
|
3655
3656
|
try {
|
|
3656
3657
|
return localStorage.setObject(l, s), 201;
|
|
3657
3658
|
} catch (x) {
|
|
3658
|
-
return console.error("%cstorage",
|
|
3659
|
+
return console.error("%cstorage", w.STORAGE, N.SERIES, r, x), 400;
|
|
3659
3660
|
}
|
|
3660
3661
|
});
|
|
3661
3662
|
/**
|
|
@@ -3665,11 +3666,11 @@ class Br {
|
|
|
3665
3666
|
* @returns number
|
|
3666
3667
|
*/
|
|
3667
3668
|
k(this, "setMessages", async (r, s) => {
|
|
3668
|
-
const l =
|
|
3669
|
+
const l = V(r);
|
|
3669
3670
|
try {
|
|
3670
3671
|
return localStorage.setObject(l, s), 200;
|
|
3671
3672
|
} catch (x) {
|
|
3672
|
-
return console.error("%cstorage",
|
|
3673
|
+
return console.error("%cstorage", w.STORAGE, N.MESSAGES, r, x), 400;
|
|
3673
3674
|
}
|
|
3674
3675
|
});
|
|
3675
3676
|
k(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((s) => s(0))));
|
|
@@ -3681,7 +3682,7 @@ class Br {
|
|
|
3681
3682
|
try {
|
|
3682
3683
|
return localStorage.setObject(s, r), 201;
|
|
3683
3684
|
} catch (l) {
|
|
3684
|
-
return console.error("%cstorage",
|
|
3685
|
+
return console.error("%cstorage", w.STORAGE, N.WIDGET, r, l), 400;
|
|
3685
3686
|
}
|
|
3686
3687
|
});
|
|
3687
3688
|
/**
|
|
@@ -3693,9 +3694,9 @@ class Br {
|
|
|
3693
3694
|
(l) => l.widget === r.widget
|
|
3694
3695
|
).length || (console.debug(
|
|
3695
3696
|
"%cstorage%c %csubscribe",
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3697
|
+
w.STORAGE,
|
|
3698
|
+
w.NONE,
|
|
3699
|
+
w.SUBSCRIBE,
|
|
3699
3700
|
r.slide,
|
|
3700
3701
|
r.widget
|
|
3701
3702
|
), this.subscribers.push(r)), null));
|
|
@@ -3708,7 +3709,7 @@ class Br {
|
|
|
3708
3709
|
try {
|
|
3709
3710
|
return localStorage.getObject(`${r.type}.${r.id}`);
|
|
3710
3711
|
} catch (s) {
|
|
3711
|
-
return console.warn("%capi",
|
|
3712
|
+
return console.warn("%capi", w.API, N.SLIDE, r.id, s), { data: null, message: "Slide Load error", success: !1 };
|
|
3712
3713
|
}
|
|
3713
3714
|
});
|
|
3714
3715
|
k(this, "storeSlide", async (r) => {
|
|
@@ -3721,7 +3722,7 @@ class Br {
|
|
|
3721
3722
|
css: r.data.css || ""
|
|
3722
3723
|
}), 201;
|
|
3723
3724
|
} catch (s) {
|
|
3724
|
-
return console.error("%cstorage",
|
|
3725
|
+
return console.error("%cstorage", w.STORAGE, N.SLIDE, r, s), 400;
|
|
3725
3726
|
}
|
|
3726
3727
|
});
|
|
3727
3728
|
this.options = r, Storage.prototype.setObject = function(s, l) {
|
|
@@ -3737,27 +3738,27 @@ class Lr {
|
|
|
3737
3738
|
k(this, "subscribers", []);
|
|
3738
3739
|
k(this, "options");
|
|
3739
3740
|
k(this, "getCloud", async (r) => {
|
|
3740
|
-
const s =
|
|
3741
|
+
const s = V(r);
|
|
3741
3742
|
try {
|
|
3742
3743
|
return sessionStorage.getObject(s);
|
|
3743
3744
|
} catch (l) {
|
|
3744
|
-
return console.warn("%capi",
|
|
3745
|
+
return console.warn("%capi", w.API, N.CLOUD, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3745
3746
|
}
|
|
3746
3747
|
});
|
|
3747
3748
|
k(this, "getSeries", async (r) => {
|
|
3748
|
-
const s =
|
|
3749
|
+
const s = V(r);
|
|
3749
3750
|
try {
|
|
3750
3751
|
return sessionStorage.getObject(s);
|
|
3751
3752
|
} catch (l) {
|
|
3752
|
-
return console.warn("%capi",
|
|
3753
|
+
return console.warn("%capi", w.API, N.SERIES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3753
3754
|
}
|
|
3754
3755
|
});
|
|
3755
3756
|
k(this, "getMessages", async (r) => {
|
|
3756
|
-
const s =
|
|
3757
|
+
const s = V(r);
|
|
3757
3758
|
try {
|
|
3758
3759
|
return sessionStorage.getObject(s);
|
|
3759
3760
|
} catch (l) {
|
|
3760
|
-
return console.warn("%capi",
|
|
3761
|
+
return console.warn("%capi", w.API, N.MESSAGES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3761
3762
|
}
|
|
3762
3763
|
});
|
|
3763
3764
|
/**
|
|
@@ -3767,11 +3768,11 @@ class Lr {
|
|
|
3767
3768
|
* @returns number
|
|
3768
3769
|
*/
|
|
3769
3770
|
k(this, "setCloud", async (r, s) => {
|
|
3770
|
-
const l =
|
|
3771
|
+
const l = V(r);
|
|
3771
3772
|
try {
|
|
3772
3773
|
return sessionStorage.setObject(l, s), 201;
|
|
3773
3774
|
} catch (x) {
|
|
3774
|
-
return console.error("%cstorage",
|
|
3775
|
+
return console.error("%cstorage", w.STORAGE, N.CLOUD, r, x), 400;
|
|
3775
3776
|
}
|
|
3776
3777
|
});
|
|
3777
3778
|
/**
|
|
@@ -3781,11 +3782,11 @@ class Lr {
|
|
|
3781
3782
|
* @returns number
|
|
3782
3783
|
*/
|
|
3783
3784
|
k(this, "setSeries", async (r, s) => {
|
|
3784
|
-
const l =
|
|
3785
|
+
const l = V(r);
|
|
3785
3786
|
try {
|
|
3786
3787
|
return sessionStorage.setObject(l, s), 201;
|
|
3787
3788
|
} catch (x) {
|
|
3788
|
-
return console.error("%cstorage",
|
|
3789
|
+
return console.error("%cstorage", w.STORAGE, N.SERIES, r, x), 400;
|
|
3789
3790
|
}
|
|
3790
3791
|
});
|
|
3791
3792
|
/**
|
|
@@ -3795,11 +3796,11 @@ class Lr {
|
|
|
3795
3796
|
* @returns number
|
|
3796
3797
|
*/
|
|
3797
3798
|
k(this, "setMessages", async (r, s) => {
|
|
3798
|
-
const l =
|
|
3799
|
+
const l = V(r);
|
|
3799
3800
|
try {
|
|
3800
3801
|
return sessionStorage.setObject(l, s), 200;
|
|
3801
3802
|
} catch (x) {
|
|
3802
|
-
return console.error("%cstorage",
|
|
3803
|
+
return console.error("%cstorage", w.STORAGE, N.MESSAGES, r, x), 400;
|
|
3803
3804
|
}
|
|
3804
3805
|
});
|
|
3805
3806
|
k(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((s) => s(0))));
|
|
@@ -3811,7 +3812,7 @@ class Lr {
|
|
|
3811
3812
|
try {
|
|
3812
3813
|
return sessionStorage.setObject(s, r), 201;
|
|
3813
3814
|
} catch (l) {
|
|
3814
|
-
return console.error("%cstorage",
|
|
3815
|
+
return console.error("%cstorage", w.STORAGE, N.WIDGET, r, l), 400;
|
|
3815
3816
|
}
|
|
3816
3817
|
});
|
|
3817
3818
|
/**
|
|
@@ -3823,9 +3824,9 @@ class Lr {
|
|
|
3823
3824
|
(l) => l.widget === r.widget
|
|
3824
3825
|
).length || (console.debug(
|
|
3825
3826
|
"%cstorage%c %csubscribe",
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3827
|
+
w.STORAGE,
|
|
3828
|
+
w.NONE,
|
|
3829
|
+
w.SUBSCRIBE,
|
|
3829
3830
|
r.slide,
|
|
3830
3831
|
r.widget
|
|
3831
3832
|
), this.subscribers.push(r)), null));
|
|
@@ -3838,7 +3839,7 @@ class Lr {
|
|
|
3838
3839
|
try {
|
|
3839
3840
|
return sessionStorage.getObject(`${r.type}.${r.id}`);
|
|
3840
3841
|
} catch (s) {
|
|
3841
|
-
return console.warn("%capi",
|
|
3842
|
+
return console.warn("%capi", w.API, N.SLIDE, r.id, s), { data: null, message: "Store Load error", success: !1 };
|
|
3842
3843
|
}
|
|
3843
3844
|
});
|
|
3844
3845
|
/**
|
|
@@ -3856,7 +3857,7 @@ class Lr {
|
|
|
3856
3857
|
css: r.data.css || ""
|
|
3857
3858
|
}), 200;
|
|
3858
3859
|
} catch (s) {
|
|
3859
|
-
return console.error("%cstorage",
|
|
3860
|
+
return console.error("%cstorage", w.STORAGE, N.SLIDE, r, s), 400;
|
|
3860
3861
|
}
|
|
3861
3862
|
});
|
|
3862
3863
|
this.options = r, Storage.prototype.setObject = function(s, l) {
|
|
@@ -3872,27 +3873,27 @@ class Gr {
|
|
|
3872
3873
|
k(this, "subscribers", []);
|
|
3873
3874
|
k(this, "options");
|
|
3874
3875
|
k(this, "getCloud", async (r) => {
|
|
3875
|
-
const s =
|
|
3876
|
+
const s = V(r);
|
|
3876
3877
|
try {
|
|
3877
3878
|
return window.BuzzCasting.WidgetData[s];
|
|
3878
3879
|
} catch (l) {
|
|
3879
|
-
return console.warn("%capi",
|
|
3880
|
+
return console.warn("%capi", w.API, N.CLOUD, r.slide, r.widget, l), { data: null, message: "Cloud Data error", success: !1 };
|
|
3880
3881
|
}
|
|
3881
3882
|
});
|
|
3882
3883
|
k(this, "getSeries", async (r) => {
|
|
3883
|
-
const s =
|
|
3884
|
+
const s = V(r);
|
|
3884
3885
|
try {
|
|
3885
3886
|
return window.BuzzCasting.WidgetData[s];
|
|
3886
3887
|
} catch (l) {
|
|
3887
|
-
return console.warn("%capi",
|
|
3888
|
+
return console.warn("%capi", w.API, N.SERIES, r.slide, r.widget, l), { data: null, message: "Series Data error", success: !1 };
|
|
3888
3889
|
}
|
|
3889
3890
|
});
|
|
3890
3891
|
k(this, "getMessages", async (r) => {
|
|
3891
|
-
const s =
|
|
3892
|
+
const s = V(r);
|
|
3892
3893
|
try {
|
|
3893
3894
|
return window.BuzzCasting.WidgetData[s];
|
|
3894
3895
|
} catch (l) {
|
|
3895
|
-
return console.warn("%capi",
|
|
3896
|
+
return console.warn("%capi", w.API, N.MESSAGES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3896
3897
|
}
|
|
3897
3898
|
});
|
|
3898
3899
|
/**
|
|
@@ -3902,11 +3903,11 @@ class Gr {
|
|
|
3902
3903
|
* @returns number
|
|
3903
3904
|
*/
|
|
3904
3905
|
k(this, "setCloud", async (r, s) => {
|
|
3905
|
-
const l =
|
|
3906
|
+
const l = V(r);
|
|
3906
3907
|
try {
|
|
3907
3908
|
return window.BuzzCasting.WidgetData[l] = s, 201;
|
|
3908
3909
|
} catch (x) {
|
|
3909
|
-
return console.error("%cstorage",
|
|
3910
|
+
return console.error("%cstorage", w.STORAGE, "set", r, x), 400;
|
|
3910
3911
|
}
|
|
3911
3912
|
});
|
|
3912
3913
|
/**
|
|
@@ -3916,11 +3917,11 @@ class Gr {
|
|
|
3916
3917
|
* @returns number
|
|
3917
3918
|
*/
|
|
3918
3919
|
k(this, "setSeries", async (r, s) => {
|
|
3919
|
-
const l =
|
|
3920
|
+
const l = V(r);
|
|
3920
3921
|
try {
|
|
3921
3922
|
return window.BuzzCasting.WidgetData[l] = s, 201;
|
|
3922
3923
|
} catch (x) {
|
|
3923
|
-
return console.error("%cstorage",
|
|
3924
|
+
return console.error("%cstorage", w.STORAGE, "set", r, x), 400;
|
|
3924
3925
|
}
|
|
3925
3926
|
});
|
|
3926
3927
|
/**
|
|
@@ -3930,11 +3931,11 @@ class Gr {
|
|
|
3930
3931
|
* @returns number
|
|
3931
3932
|
*/
|
|
3932
3933
|
k(this, "setMessages", async (r, s) => {
|
|
3933
|
-
const l =
|
|
3934
|
+
const l = V(r);
|
|
3934
3935
|
try {
|
|
3935
3936
|
return window.BuzzCasting.WidgetData[l] = s, 201;
|
|
3936
3937
|
} catch (x) {
|
|
3937
|
-
return console.error("%cstorage",
|
|
3938
|
+
return console.error("%cstorage", w.STORAGE, "set", r, x), 400;
|
|
3938
3939
|
}
|
|
3939
3940
|
});
|
|
3940
3941
|
k(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((s) => s(0))));
|
|
@@ -3946,7 +3947,7 @@ class Gr {
|
|
|
3946
3947
|
try {
|
|
3947
3948
|
return window.BuzzCasting.WidgetData[s] = r, 201;
|
|
3948
3949
|
} catch (l) {
|
|
3949
|
-
return console.error("%cstorage",
|
|
3950
|
+
return console.error("%cstorage", w.STORAGE, N.WIDGET, r, l), 400;
|
|
3950
3951
|
}
|
|
3951
3952
|
});
|
|
3952
3953
|
/**
|
|
@@ -3958,9 +3959,9 @@ class Gr {
|
|
|
3958
3959
|
(l) => l.widget === r.widget
|
|
3959
3960
|
).length || (console.debug(
|
|
3960
3961
|
"%cstorage%c %csubscribe",
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3962
|
+
w.STORAGE,
|
|
3963
|
+
w.NONE,
|
|
3964
|
+
w.SUBSCRIBE,
|
|
3964
3965
|
r.slide,
|
|
3965
3966
|
r.widget
|
|
3966
3967
|
), this.subscribers.push(r)), null));
|
|
@@ -3973,7 +3974,7 @@ class Gr {
|
|
|
3973
3974
|
try {
|
|
3974
3975
|
return window.BuzzCasting.SlideData[r.id];
|
|
3975
3976
|
} catch (s) {
|
|
3976
|
-
return console.warn("%capi",
|
|
3977
|
+
return console.warn("%capi", w.API, N.SLIDE, r.id, s), { data: null, message: "Slide Load error", success: !1 };
|
|
3977
3978
|
}
|
|
3978
3979
|
});
|
|
3979
3980
|
k(this, "storeSlide", async (r) => {
|
|
@@ -3986,7 +3987,7 @@ class Gr {
|
|
|
3986
3987
|
css: r.data.css || ""
|
|
3987
3988
|
}, 201;
|
|
3988
3989
|
} catch (s) {
|
|
3989
|
-
return console.error("%cstorage",
|
|
3990
|
+
return console.error("%cstorage", w.STORAGE, N.SLIDE, r, s), 400;
|
|
3990
3991
|
}
|
|
3991
3992
|
});
|
|
3992
3993
|
this.options = r, window.BuzzCasting.WidgetData = /* @__PURE__ */ new Set();
|
|
@@ -4077,16 +4078,16 @@ function zi(d) {
|
|
|
4077
4078
|
return d.toLowerCase().split("-").reduce((r, s) => r + (s.charAt(0).toUpperCase() + s.slice(1)));
|
|
4078
4079
|
}
|
|
4079
4080
|
const Hi = (d) => d.charAt(0).toUpperCase() + d.slice(1);
|
|
4080
|
-
function
|
|
4081
|
+
function Ti(d) {
|
|
4081
4082
|
const r = document.createRange();
|
|
4082
4083
|
r.selectNodeContents(d), r.deleteContents();
|
|
4083
4084
|
}
|
|
4084
|
-
function
|
|
4085
|
+
function Mi(d) {
|
|
4085
4086
|
d.reduce(
|
|
4086
4087
|
(r, s) => Object.keys(s).reduce(
|
|
4087
4088
|
(l, x) => ({
|
|
4088
4089
|
...l,
|
|
4089
|
-
[x]: x in r && typeof r[x] == "object" && r[x] !== null && typeof s[x] == "object" && s[x] !== null ?
|
|
4090
|
+
[x]: x in r && typeof r[x] == "object" && r[x] !== null && typeof s[x] == "object" && s[x] !== null ? Mi([r[x], s[x]]) : s[x]
|
|
4090
4091
|
}),
|
|
4091
4092
|
r
|
|
4092
4093
|
),
|
|
@@ -4131,8 +4132,8 @@ function $r(d, r, s, l) {
|
|
|
4131
4132
|
return D;
|
|
4132
4133
|
try {
|
|
4133
4134
|
return xe(D, String(r.valueOf()));
|
|
4134
|
-
} catch (
|
|
4135
|
-
return xe(D, `[valueOf exception]${
|
|
4135
|
+
} catch (j) {
|
|
4136
|
+
return xe(D, `[valueOf exception]${j.stack || j.message}`);
|
|
4136
4137
|
}
|
|
4137
4138
|
}
|
|
4138
4139
|
return xe(x, r.toString());
|
|
@@ -4188,10 +4189,10 @@ function Ji(d) {
|
|
|
4188
4189
|
function Vi(d) {
|
|
4189
4190
|
const r = window.BuzzCasting.getOptions().suspended ?? !1;
|
|
4190
4191
|
return d.forEach((s) => {
|
|
4191
|
-
var l, x, D,
|
|
4192
|
-
if (r ? s.content = "License suspended, please contact your Sales Representative to restore service" : s.content = ((l = s.content) == null ? void 0 : l.replace(/(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)((\?.*)?)/g, "")) || "", s.sender !== null ? ((((x = s.sender) == null ? void 0 : x.title) === "Unknown author" || ((D = s.sender) == null ? void 0 : D.title) === null) && (s.sender.title = ""), ((
|
|
4193
|
-
const
|
|
4194
|
-
s.sender.title =
|
|
4192
|
+
var l, x, D, j, P;
|
|
4193
|
+
if (r ? s.content = "License suspended, please contact your Sales Representative to restore service" : s.content = ((l = s.content) == null ? void 0 : l.replace(/(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)((\?.*)?)/g, "")) || "", s.sender !== null ? ((((x = s.sender) == null ? void 0 : x.title) === "Unknown author" || ((D = s.sender) == null ? void 0 : D.title) === null) && (s.sender.title = ""), ((j = s.sender) == null ? void 0 : j.name) !== "" && s.sender.title === "" && (s.sender.title = s.sender.name), ((P = s.sender) == null ? void 0 : P.name) !== "" && s.channel === "tw" && (s.sender.name = `@${s.sender.name}`)) : s.sender = { title: "", name: "", id: "", avatar: "default", bio: "", location: "", following: 0, verified: 0, listed: 0, followers: 0, favourites: 0, messages: 0, influence: 0 }, s.sender.title === "" && s.link !== "") {
|
|
4194
|
+
const Y = new URL(s.link);
|
|
4195
|
+
s.sender.title = Y.hostname.replace("www.", "");
|
|
4195
4196
|
}
|
|
4196
4197
|
}), d;
|
|
4197
4198
|
}
|
|
@@ -4245,119 +4246,153 @@ class ro {
|
|
|
4245
4246
|
l.push(this.api.get(x));
|
|
4246
4247
|
}), await Promise.allSettled(l).then(
|
|
4247
4248
|
(x) => x.forEach(async (D) => {
|
|
4248
|
-
let
|
|
4249
|
+
let j = 400;
|
|
4249
4250
|
if (D.status === "fulfilled") {
|
|
4250
|
-
let
|
|
4251
|
+
let P = D.value;
|
|
4251
4252
|
if (this.sm === null)
|
|
4252
4253
|
return 400;
|
|
4253
|
-
if (
|
|
4254
|
-
const
|
|
4255
|
-
(
|
|
4254
|
+
if (P.success === !0) {
|
|
4255
|
+
const Y = this.sm.subscribers.filter(
|
|
4256
|
+
(X) => X.widget === P.query.widget
|
|
4256
4257
|
)[0];
|
|
4257
|
-
let
|
|
4258
|
-
switch (
|
|
4258
|
+
let Z = "", ve;
|
|
4259
|
+
switch (P.query.type) {
|
|
4259
4260
|
case N.MESSAGES:
|
|
4260
|
-
if (ve =
|
|
4261
|
-
(
|
|
4262
|
-
),
|
|
4261
|
+
if (ve = P.data.messages.filter(
|
|
4262
|
+
(X) => X.id !== null
|
|
4263
|
+
), P.data.messages = ve, Z = Fn(P.data.messages), Y.hash === Z)
|
|
4263
4264
|
return console.debug(
|
|
4264
4265
|
"%capi%c %cno updates",
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4266
|
+
w.API,
|
|
4267
|
+
w.NONE,
|
|
4268
|
+
w.NO_UPDATES,
|
|
4268
4269
|
N.MESSAGES,
|
|
4269
|
-
|
|
4270
|
-
|
|
4270
|
+
P.query.slide,
|
|
4271
|
+
P.query.widget
|
|
4271
4272
|
), 204;
|
|
4272
|
-
|
|
4273
|
+
Y.hash = Z, j = await this.sm.setMessages(P.query, P);
|
|
4273
4274
|
break;
|
|
4274
4275
|
case N.CLOUD:
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4276
|
+
if (Z = Fn(P.data), Y.hash === Z)
|
|
4277
|
+
console.debug(
|
|
4278
|
+
"%capi%c %cno updates",
|
|
4279
|
+
w.API,
|
|
4280
|
+
w.NONE,
|
|
4281
|
+
w.NO_UPDATES,
|
|
4282
|
+
N.CLOUD,
|
|
4283
|
+
P.query.slide,
|
|
4284
|
+
P.query.widget
|
|
4285
|
+
), j = 204;
|
|
4286
|
+
else {
|
|
4287
|
+
Y.hash = Z;
|
|
4288
|
+
const X = {
|
|
4289
|
+
data: {
|
|
4290
|
+
dashboard: P.query.dashboard,
|
|
4291
|
+
cloud: P.data,
|
|
4292
|
+
query: P.query,
|
|
4293
|
+
slide: P.query.slide
|
|
4294
|
+
},
|
|
4295
|
+
query: P.query,
|
|
4296
|
+
message: P.message,
|
|
4297
|
+
success: P.success
|
|
4298
|
+
};
|
|
4299
|
+
j = await this.sm.setCloud(P.query, X.data.cloud);
|
|
4300
|
+
}
|
|
4284
4301
|
break;
|
|
4285
4302
|
case N.SERIES:
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4303
|
+
if (Z = Fn(P.data), Y.hash === Z)
|
|
4304
|
+
console.debug(
|
|
4305
|
+
"%capi%c %cno updates",
|
|
4306
|
+
w.API,
|
|
4307
|
+
w.NONE,
|
|
4308
|
+
w.NO_UPDATES,
|
|
4309
|
+
N.SERIES,
|
|
4310
|
+
P.query.slide,
|
|
4311
|
+
P.query.widget
|
|
4312
|
+
), j = 204;
|
|
4313
|
+
else {
|
|
4314
|
+
Y.hash = Z;
|
|
4315
|
+
const X = {
|
|
4316
|
+
data: {
|
|
4317
|
+
dashboard: P.query.dashboard,
|
|
4318
|
+
series: P.data,
|
|
4319
|
+
query: P.query,
|
|
4320
|
+
slide: P.query.slide
|
|
4321
|
+
},
|
|
4322
|
+
query: P.query,
|
|
4323
|
+
message: P.message,
|
|
4324
|
+
success: P.success
|
|
4325
|
+
};
|
|
4326
|
+
j = await this.sm.setSeries(P.query, X.data.series);
|
|
4327
|
+
}
|
|
4295
4328
|
break;
|
|
4296
4329
|
default:
|
|
4297
4330
|
console.warn(
|
|
4298
4331
|
"%capi%c %cstorage",
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4332
|
+
w.API,
|
|
4333
|
+
w.NONE,
|
|
4334
|
+
w.STORAGE,
|
|
4302
4335
|
"error",
|
|
4303
|
-
`data type ${
|
|
4336
|
+
`data type ${P.query.type} unknown`
|
|
4304
4337
|
);
|
|
4305
4338
|
}
|
|
4306
4339
|
} else
|
|
4307
|
-
|
|
4308
|
-
switch (
|
|
4340
|
+
j = 401;
|
|
4341
|
+
switch (j) {
|
|
4309
4342
|
case 201:
|
|
4310
|
-
|
|
4343
|
+
console.info(
|
|
4311
4344
|
"%capp%c %cbroadcast",
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
)
|
|
4345
|
+
w.API,
|
|
4346
|
+
w.NONE,
|
|
4347
|
+
w.BROADCAST,
|
|
4348
|
+
P.query.slide,
|
|
4349
|
+
P.data.title ?? P.query.widget
|
|
4350
|
+
);
|
|
4351
|
+
const Y = structuredClone(P.query);
|
|
4352
|
+
switch (console.log("status", j, Y), P.query.type) {
|
|
4318
4353
|
case "messages":
|
|
4319
|
-
|
|
4354
|
+
P = await this.sm.getMessages(P.query);
|
|
4320
4355
|
break;
|
|
4321
4356
|
case "cloud":
|
|
4322
|
-
|
|
4357
|
+
P = await this.sm.getCloud(P.query), P && (P.query = Y);
|
|
4323
4358
|
break;
|
|
4324
4359
|
case "series":
|
|
4325
|
-
|
|
4360
|
+
P = await this.sm.getSeries(P.query), P && (P.query = Y);
|
|
4326
4361
|
break;
|
|
4327
4362
|
default:
|
|
4328
4363
|
console.warn(
|
|
4329
4364
|
"%capp%c %cbroadcast",
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4365
|
+
w.API,
|
|
4366
|
+
w.NONE,
|
|
4367
|
+
w.BROADCAST,
|
|
4333
4368
|
"Unhandled data type",
|
|
4334
|
-
|
|
4369
|
+
P.query
|
|
4335
4370
|
);
|
|
4336
4371
|
}
|
|
4337
|
-
|
|
4372
|
+
P && this.bc.postMessage({
|
|
4338
4373
|
event: re.WIDGET_UPDATE,
|
|
4339
|
-
data:
|
|
4374
|
+
data: P.data
|
|
4340
4375
|
});
|
|
4341
4376
|
break;
|
|
4342
4377
|
default:
|
|
4343
4378
|
console.warn(
|
|
4344
4379
|
"%capp%c %cbroadcast",
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4380
|
+
w.API,
|
|
4381
|
+
w.NONE,
|
|
4382
|
+
w.BROADCAST,
|
|
4348
4383
|
"Fetch error",
|
|
4349
|
-
|
|
4350
|
-
|
|
4384
|
+
P.query.slide,
|
|
4385
|
+
P.data.title ?? P.query.widget
|
|
4351
4386
|
);
|
|
4352
4387
|
break;
|
|
4353
4388
|
}
|
|
4354
|
-
return
|
|
4389
|
+
return j;
|
|
4355
4390
|
} else
|
|
4356
4391
|
return console.warn(
|
|
4357
4392
|
"%capi%c %cstorage",
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4393
|
+
w.API,
|
|
4394
|
+
w.NONE,
|
|
4395
|
+
w.STORAGE,
|
|
4361
4396
|
re.ERROR
|
|
4362
4397
|
), 400;
|
|
4363
4398
|
})
|
|
@@ -4375,9 +4410,9 @@ class ro {
|
|
|
4375
4410
|
case re.UPDATE:
|
|
4376
4411
|
console.debug(
|
|
4377
4412
|
"%capi%c %cstorage",
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4413
|
+
w.API,
|
|
4414
|
+
w.NONE,
|
|
4415
|
+
w.STORAGE,
|
|
4381
4416
|
re.UPDATE,
|
|
4382
4417
|
r.data
|
|
4383
4418
|
), await this.update();
|
|
@@ -4389,9 +4424,9 @@ class ro {
|
|
|
4389
4424
|
if ((l = this.options) != null && l.suspended) {
|
|
4390
4425
|
console.info(
|
|
4391
4426
|
"%cstorage%c %cstorage",
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4427
|
+
w.STORAGE,
|
|
4428
|
+
w.NONE,
|
|
4429
|
+
w.MESSAGES,
|
|
4395
4430
|
"Account suspended"
|
|
4396
4431
|
);
|
|
4397
4432
|
return;
|
|
@@ -4401,9 +4436,9 @@ class ro {
|
|
|
4401
4436
|
));
|
|
4402
4437
|
console.info(
|
|
4403
4438
|
"%cstorage%c %cstorage",
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4439
|
+
w.STORAGE,
|
|
4440
|
+
w.NONE,
|
|
4441
|
+
w.MESSAGES,
|
|
4407
4442
|
`${s} messages deleted`
|
|
4408
4443
|
);
|
|
4409
4444
|
});
|
|
@@ -4412,9 +4447,9 @@ class ro {
|
|
|
4412
4447
|
const s = await ((l = this.sm) == null ? void 0 : l.hideMessage(r.id, 0));
|
|
4413
4448
|
return console.info(
|
|
4414
4449
|
"%cstorage%c %cstorage",
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4450
|
+
w.STORAGE,
|
|
4451
|
+
w.NONE,
|
|
4452
|
+
w.HIDE,
|
|
4418
4453
|
`${s} messages hidden`
|
|
4419
4454
|
), await this.api.hideMessage(r);
|
|
4420
4455
|
});
|
|
@@ -4432,9 +4467,9 @@ class ro {
|
|
|
4432
4467
|
});
|
|
4433
4468
|
console.info(
|
|
4434
4469
|
"%cstorage%c %cslide",
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4470
|
+
w.STORAGE,
|
|
4471
|
+
w.NONE,
|
|
4472
|
+
w.SLIDE,
|
|
4438
4473
|
r.slide,
|
|
4439
4474
|
re.VERSION,
|
|
4440
4475
|
ki
|
|
@@ -4442,9 +4477,9 @@ class ro {
|
|
|
4442
4477
|
const s = (r == null ? void 0 : r.slide) || r.app;
|
|
4443
4478
|
switch (this.bc = new BroadcastChannel(s), console.info(
|
|
4444
4479
|
"%capi%c %cbroadcast",
|
|
4445
|
-
|
|
4446
|
-
|
|
4447
|
-
|
|
4480
|
+
w.API,
|
|
4481
|
+
w.NONE,
|
|
4482
|
+
w.BROADCAST,
|
|
4448
4483
|
re.CHANNEL,
|
|
4449
4484
|
s
|
|
4450
4485
|
), this.bc.onmessage = (l) => {
|
|
@@ -4480,9 +4515,9 @@ class Bi {
|
|
|
4480
4515
|
var s;
|
|
4481
4516
|
return r.type !== N.CLOUD ? (console.warn(
|
|
4482
4517
|
"%capp%c %get",
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4518
|
+
w.APP,
|
|
4519
|
+
w.NONE,
|
|
4520
|
+
w.GET_DATA,
|
|
4486
4521
|
r.widget,
|
|
4487
4522
|
"wrong method call for getMessages, type used is",
|
|
4488
4523
|
r.type
|
|
@@ -4501,9 +4536,9 @@ class Bi {
|
|
|
4501
4536
|
var s;
|
|
4502
4537
|
return r.type !== N.MESSAGES ? (console.warn(
|
|
4503
4538
|
"%capp%c %get",
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4539
|
+
w.APP,
|
|
4540
|
+
w.NONE,
|
|
4541
|
+
w.GET_DATA,
|
|
4507
4542
|
r.widget,
|
|
4508
4543
|
"wrong method call for getMessages, type used is",
|
|
4509
4544
|
r.type
|
|
@@ -4522,9 +4557,9 @@ class Bi {
|
|
|
4522
4557
|
var s;
|
|
4523
4558
|
return r.type !== N.SERIES ? (console.warn(
|
|
4524
4559
|
"%capp%c %get",
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
|
|
4560
|
+
w.APP,
|
|
4561
|
+
w.NONE,
|
|
4562
|
+
w.GET_DATA,
|
|
4528
4563
|
r.widget,
|
|
4529
4564
|
"wrong method call for getMessages, type used is",
|
|
4530
4565
|
r.type
|
|
@@ -4594,9 +4629,9 @@ class io {
|
|
|
4594
4629
|
*/
|
|
4595
4630
|
k(this, "getCloud", async () => this.query.type !== N.CLOUD ? (console.warn(
|
|
4596
4631
|
"%cstorage%c %cwidget",
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
|
|
4632
|
+
w.STORAGE,
|
|
4633
|
+
w.NONE,
|
|
4634
|
+
w.WIDGET,
|
|
4600
4635
|
this.query.widget,
|
|
4601
4636
|
"Wrong method call for getCloud, expected type is",
|
|
4602
4637
|
this.query.type
|
|
@@ -4612,9 +4647,9 @@ class io {
|
|
|
4612
4647
|
*/
|
|
4613
4648
|
k(this, "getMessages", async () => this.query.type !== N.MESSAGES ? (console.warn(
|
|
4614
4649
|
"%cstorage%c %cwidget",
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
|
|
4650
|
+
w.STORAGE,
|
|
4651
|
+
w.NONE,
|
|
4652
|
+
w.WIDGET,
|
|
4618
4653
|
this.query.widget,
|
|
4619
4654
|
"Wrong method call for getMessages, expected type is",
|
|
4620
4655
|
this.query.type
|
|
@@ -4624,9 +4659,9 @@ class io {
|
|
|
4624
4659
|
success: !1
|
|
4625
4660
|
}) : (console.debug(
|
|
4626
4661
|
"%cstorage%c %cwidget",
|
|
4627
|
-
|
|
4628
|
-
|
|
4629
|
-
|
|
4662
|
+
w.API,
|
|
4663
|
+
w.NONE,
|
|
4664
|
+
w.MESSAGES,
|
|
4630
4665
|
this.query
|
|
4631
4666
|
), await this.storageReader.getMessages(this.query)));
|
|
4632
4667
|
/**
|
|
@@ -4636,9 +4671,9 @@ class io {
|
|
|
4636
4671
|
*/
|
|
4637
4672
|
k(this, "getSeries", async () => this.query.type !== N.SERIES ? (console.warn(
|
|
4638
4673
|
"%cstorage%c %cwidget",
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4674
|
+
w.STORAGE,
|
|
4675
|
+
w.NONE,
|
|
4676
|
+
w.WIDGET,
|
|
4642
4677
|
this.query.widget,
|
|
4643
4678
|
"Wrong method call for getSeries, expected type is",
|
|
4644
4679
|
this.query.type
|
|
@@ -4656,7 +4691,7 @@ class io {
|
|
|
4656
4691
|
k(this, "showModal", (r) => {
|
|
4657
4692
|
console.debug(
|
|
4658
4693
|
"%cwidget",
|
|
4659
|
-
|
|
4694
|
+
w.WIDGET,
|
|
4660
4695
|
re.SHOW_MODAL,
|
|
4661
4696
|
r.showComponent,
|
|
4662
4697
|
// @ts-ignore
|
|
@@ -4676,10 +4711,10 @@ class io {
|
|
|
4676
4711
|
});
|
|
4677
4712
|
window.dispatchEvent(s);
|
|
4678
4713
|
});
|
|
4679
|
-
var
|
|
4714
|
+
var j;
|
|
4680
4715
|
this.element = r, this.listeners = s, l = typeof l < "u" ? l : "buzzcasting-slide";
|
|
4681
4716
|
let x;
|
|
4682
|
-
x = { ...r.dataset }, delete x.hmr, x.slide = ((
|
|
4717
|
+
x = { ...r.dataset }, delete x.hmr, x.slide = ((j = r.closest(l.toUpperCase())) == null ? void 0 : j.id) ?? `${l} not found`, x = Mr(x), this.query = x, Ti(r);
|
|
4683
4718
|
const D = window.BuzzCasting.getOptions();
|
|
4684
4719
|
this.storageReader = new Bi(D), this.broadcastChannel = new BroadcastChannel(x.slide), this.startListener();
|
|
4685
4720
|
}
|
|
@@ -4693,7 +4728,7 @@ class io {
|
|
|
4693
4728
|
const r = this.query;
|
|
4694
4729
|
this.broadcastChannel.onmessage = async (s) => {
|
|
4695
4730
|
const l = s.data.data;
|
|
4696
|
-
switch (s.data.event) {
|
|
4731
|
+
switch (console.debug(s.data.event, s.data), s.data.event) {
|
|
4697
4732
|
case re.WIDGET_UPDATE:
|
|
4698
4733
|
l.query.slide === r.slide && l.query.widget === r.widget && this.listeners.forEach((x) => {
|
|
4699
4734
|
x(s.data);
|
|
@@ -4710,13 +4745,19 @@ class io {
|
|
|
4710
4745
|
* This takes place when the container indicates it has finished loading (ready)
|
|
4711
4746
|
*/
|
|
4712
4747
|
subscribe() {
|
|
4713
|
-
console.
|
|
4748
|
+
console.info(
|
|
4714
4749
|
"%cwidget%c %csubscribe",
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
4750
|
+
w.WIDGET,
|
|
4751
|
+
w.NONE,
|
|
4752
|
+
w.SUBSCRIBE,
|
|
4718
4753
|
this.query.slide,
|
|
4719
4754
|
this.query.widget
|
|
4755
|
+
), console.debug(
|
|
4756
|
+
"%cwidget%c %csubscribe",
|
|
4757
|
+
w.WIDGET,
|
|
4758
|
+
w.NONE,
|
|
4759
|
+
w.SUBSCRIBE,
|
|
4760
|
+
this.query
|
|
4720
4761
|
), this.broadcastChannel.postMessage({
|
|
4721
4762
|
event: re.SUBSCRIBE,
|
|
4722
4763
|
data: this.query
|
|
@@ -4730,7 +4771,7 @@ export {
|
|
|
4730
4771
|
N as API,
|
|
4731
4772
|
ro as BuzzcastingStorageManager,
|
|
4732
4773
|
Bi as BuzzcastingStorageReader,
|
|
4733
|
-
|
|
4774
|
+
w as CSS,
|
|
4734
4775
|
re as EVENTS,
|
|
4735
4776
|
Zt as MODERATION,
|
|
4736
4777
|
ge as STORAGE,
|
|
@@ -4742,8 +4783,8 @@ export {
|
|
|
4742
4783
|
zi as camelCase,
|
|
4743
4784
|
Wi as camelize,
|
|
4744
4785
|
Hi as capitalizeFirstLetter,
|
|
4745
|
-
|
|
4746
|
-
|
|
4786
|
+
Ti as clearContents,
|
|
4787
|
+
Mi as deepMerge,
|
|
4747
4788
|
Fi as filterAttributes,
|
|
4748
4789
|
Yi as formatContent,
|
|
4749
4790
|
Fn as hashSum,
|
|
@@ -4756,5 +4797,5 @@ export {
|
|
|
4756
4797
|
qi as shuffleMessages,
|
|
4757
4798
|
eo as stringGen,
|
|
4758
4799
|
no as upDownColor,
|
|
4759
|
-
|
|
4800
|
+
Mr as widgetParams
|
|
4760
4801
|
};
|