buzzcasting-storage 2.16.9 → 2.16.11
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 +470 -470
- package/package.json +2 -2
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
var xi = Object.defineProperty;
|
|
2
2
|
var ki = (f, r, c) => r in f ? xi(f, r, { enumerable: !0, configurable: !0, writable: !0, value: c }) : f[r] = c;
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
const Ai = "2.16.
|
|
3
|
+
var D = (f, r, c) => ki(f, typeof r != "symbol" ? r + "" : r, c);
|
|
4
|
+
var M = /* @__PURE__ */ ((f) => (f.MESSAGES = "messages", f.CLOUD = "cloud", f.SERIES = "series", f.TOPICS = "topics", f.WIDGET = "widget", f.WIDGETS = "widgets", f.SLIDE = "slide", f))(M || {}), S = /* @__PURE__ */ ((f) => (f.API = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;", f.APP = "color:white;background-color:navy;padding:0 4px 0 4px;border-radius:5px;", f.BROADCAST = "color:white;background-color:orange;padding:0 4px 0 4px;border-radius:5px;", f.DATA = "color:grey;background-color:lightskyblue;padding:0 4px 0 4px;border-radius:5px;", f.CLOUD = "color:grey;background-color:mistyrose;padding:0 4px 0 4px;border-radius:5px;", f.GET_DATA = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", f.HIDE = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", f.MESSAGES = "color:grey;background-color:tan;padding:0 4px 0 4px;border-radius:5px;", f.NO_UPDATES = "color:grey;border:1px solid grey;padding:0 4px 0 4px;border-radius:5px;", f.NONE = "color:transparent;background-color:transparent;", f.PRESENTATION = "color:white;background-color:darkred;padding:0 4px 0 4px;border-radius:5px;", f.SERIES = "color:grey;background-color:thistle;padding:0 4px 0 4px;border-radius:5px;", f.SLIDE = "color:black;background-color:yellow;padding:0 4px 0 4px;border-radius:5px;", f.STORAGE = "color:black;background-color:cyan;padding:0 4px 0 4px;border-radius:5px;", f.SUBSCRIBE = "color:white;background-color:dodgerblue;padding:0 4px 0 4px;border-radius:5px;", f.WIDGET = "color:gret;background-color:lemonchiffon;padding:0 4px 0 4px;border-radius:5px;", f.WS = "color:white;background-color:green;padding:0 4px 0 4px;border-radius:5px;", f))(S || {}), ne = /* @__PURE__ */ ((f) => (f.ADD_SLIDE = "addSlide", f.APP_READY = "appReady", f.API_UPDATE = "apiUpdate", f.APPROVE_MESSAGE = "approveMessage", f.CHANNEL = "channel", f.CLEAN_MESSAGES = "cleanMessages", f.CLOSE_MODAL = "closeModal", f.ERROR = "error", f.HIDE_MESSAGE = "hideMessage", f.HIDE_LABELS = "hideLabels", f.PAUSE_PRESENTATION = "pausePresentation", f.PRESENTATION_READY = "presentationReady", f.PREV_SLIDE = "prevSlide", f.RELOAD_PRESENTATION = "reloadPresentation", f.SHOW_MODAL = "showModal", f.STAR_MESSAGE = "starMessage", f.GOTO_SLIDE = "gotoSlide", f.NEXT_SLIDE = "nextSlide", f.SLIDE_DID_LOAD = "slideDidLoad", f.SLIDE_GOTO = "slideGoto", f.SLIDE_READY = "slideReady", f.SLIDE_LOAD = "loadSlide", f.SLIDE_STORE = "storeSlide", f.SLIDE_TRANSITIONER = "slideTransitioner", f.START_TRANSITIONER = "startTransitioner", f.STORAGE_INIT = "storageInit", f.SUBSCRIBE = "subscribe", f.REMOVE_CLOUD = "removeCloud", f.UPDATE = "update", f.VERSION = "version", f.WIDGET_UPDATE = "widgetUpdate", f))(ne || {}), Zt = /* @__PURE__ */ ((f) => (f.APPROVED = "approved", f.BEFORE = "before", f.DELAYED = "delayed", f.NONE = "none", f.REALTIME = "realtime", f))(Zt || {}), ge = /* @__PURE__ */ ((f) => (f.KEYVAL = "keyval", f.LOCAL = "local", f.SESSION = "session", f.DEXIE = "dexie", f.WINDOW = "window", f))(ge || {});
|
|
5
|
+
const Ai = "2.16.10";
|
|
6
6
|
class Di {
|
|
7
7
|
constructor(r) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
D(this, "options");
|
|
9
|
+
D(this, "url");
|
|
10
|
+
D(this, "headers", () => {
|
|
11
11
|
const r = `Bearer ${this.options.bearer}`;
|
|
12
12
|
return {
|
|
13
13
|
headers: new Headers({
|
|
@@ -18,7 +18,7 @@ class Di {
|
|
|
18
18
|
})
|
|
19
19
|
};
|
|
20
20
|
});
|
|
21
|
-
|
|
21
|
+
D(this, "formHeaders", () => {
|
|
22
22
|
const r = `Bearer ${this.options.bearer}`;
|
|
23
23
|
return {
|
|
24
24
|
headers: new Headers({
|
|
@@ -32,9 +32,9 @@ class Di {
|
|
|
32
32
|
this.options = r, this.url = `https://${r.app}.buzzcasting.net`;
|
|
33
33
|
}
|
|
34
34
|
async get(r) {
|
|
35
|
-
const { version: c } = this.options, l = this.headers(),
|
|
36
|
-
delete
|
|
37
|
-
const
|
|
35
|
+
const { version: c } = this.options, l = this.headers(), A = Object.assign({}, r);
|
|
36
|
+
delete A.slide, delete A.type, delete A.hash;
|
|
37
|
+
const k = Object.keys(A).length > 0 ? `?${new URLSearchParams(A).toString()}` : "";
|
|
38
38
|
return console.debug(
|
|
39
39
|
"%capi%c %cget",
|
|
40
40
|
S.API,
|
|
@@ -43,16 +43,16 @@ class Di {
|
|
|
43
43
|
r.slide,
|
|
44
44
|
r.widget
|
|
45
45
|
), await fetch(
|
|
46
|
-
[this.url, "api", c, r.type].join("/") +
|
|
46
|
+
[this.url, "api", c, r.type].join("/") + k,
|
|
47
47
|
{ ...l, method: "get" }
|
|
48
|
-
).then(async (
|
|
49
|
-
if (!
|
|
50
|
-
throw new Error(`${
|
|
51
|
-
return
|
|
52
|
-
}).then((
|
|
48
|
+
).then(async (N) => {
|
|
49
|
+
if (!N.ok)
|
|
50
|
+
throw new Error(`${N.status}`);
|
|
51
|
+
return N;
|
|
52
|
+
}).then((N) => N.json()).then((N) => (N.query = r, N)).catch((N) => ({ success: !1, message: `${N}`, data: null }));
|
|
53
53
|
}
|
|
54
54
|
async hideMessage(r) {
|
|
55
|
-
const { version: c } = this.options, l = this.headers(),
|
|
55
|
+
const { version: c } = this.options, l = this.headers(), A = "?action=visible";
|
|
56
56
|
return console.info(
|
|
57
57
|
"%capi%c %cput",
|
|
58
58
|
S.API,
|
|
@@ -62,18 +62,18 @@ class Di {
|
|
|
62
62
|
r.widget,
|
|
63
63
|
r.id
|
|
64
64
|
), await fetch(
|
|
65
|
-
[this.url, "api", c, r.type, r.id].join("/") +
|
|
65
|
+
[this.url, "api", c, r.type, r.id].join("/") + A,
|
|
66
66
|
{ ...l, method: "put" }
|
|
67
|
-
).then((
|
|
68
|
-
if (!
|
|
69
|
-
throw new Error(
|
|
70
|
-
return
|
|
71
|
-
}).then((
|
|
67
|
+
).then((k) => {
|
|
68
|
+
if (!k.ok)
|
|
69
|
+
throw new Error(k.statusText);
|
|
70
|
+
return k;
|
|
71
|
+
}).then((k) => k.json()).catch((k) => ({ succes: !1, message: k, data: [] }));
|
|
72
72
|
}
|
|
73
73
|
async hideLabels(r) {
|
|
74
|
-
const { version: c } = this.options, l = this.formHeaders(),
|
|
75
|
-
for (const [
|
|
76
|
-
|
|
74
|
+
const { version: c } = this.options, l = this.formHeaders(), A = new URLSearchParams(), k = r.labels || [];
|
|
75
|
+
for (const [N, B] of k.entries())
|
|
76
|
+
A.append(`custom_filters[${N}]`, B);
|
|
77
77
|
return console.info(
|
|
78
78
|
"%capi%c %cput",
|
|
79
79
|
S.API,
|
|
@@ -81,19 +81,19 @@ class Di {
|
|
|
81
81
|
S.GET_DATA,
|
|
82
82
|
ne.HIDE_LABELS,
|
|
83
83
|
r.widget,
|
|
84
|
-
|
|
84
|
+
k
|
|
85
85
|
), await fetch(
|
|
86
86
|
[this.url, "api", c, r.type, r.widget].join("/"),
|
|
87
|
-
{ ...l, body:
|
|
88
|
-
).then((
|
|
89
|
-
if (!
|
|
90
|
-
throw new Error(
|
|
91
|
-
return
|
|
92
|
-
}).then((
|
|
87
|
+
{ ...l, body: A, method: "put" }
|
|
88
|
+
).then((N) => {
|
|
89
|
+
if (!N.ok)
|
|
90
|
+
throw new Error(N.statusText);
|
|
91
|
+
return N;
|
|
92
|
+
}).then((N) => N.json()).catch((N) => ({ succes: !1, message: N, data: [] }));
|
|
93
93
|
}
|
|
94
94
|
async loadSlide(r) {
|
|
95
|
-
const { version: c } = this.options, l = this.headers(),
|
|
96
|
-
return delete
|
|
95
|
+
const { version: c } = this.options, l = this.headers(), A = Object.assign({}, r);
|
|
96
|
+
return delete A.slide, delete A.type, delete A.hash, console.debug(
|
|
97
97
|
"%capi%c %cget",
|
|
98
98
|
S.API,
|
|
99
99
|
S.NONE,
|
|
@@ -103,11 +103,11 @@ class Di {
|
|
|
103
103
|
), await fetch(
|
|
104
104
|
[this.url, "api", c, "slides", r.id].join("/"),
|
|
105
105
|
{ ...l, method: "get" }
|
|
106
|
-
).then(async (
|
|
107
|
-
if (!
|
|
108
|
-
throw new Error(`${
|
|
109
|
-
return
|
|
110
|
-
}).then((
|
|
106
|
+
).then(async (k) => {
|
|
107
|
+
if (!k.ok)
|
|
108
|
+
throw new Error(`${k.status}`);
|
|
109
|
+
return k;
|
|
110
|
+
}).then((k) => k.json()).then((k) => (k.query = r, k)).catch((k) => ({ success: !1, message: `${k}`, data: null }));
|
|
111
111
|
}
|
|
112
112
|
/**
|
|
113
113
|
* Store slide definition
|
|
@@ -119,7 +119,7 @@ class Di {
|
|
|
119
119
|
async storeSlide(r) {
|
|
120
120
|
const { version: c } = this.options, l = this.formHeaders();
|
|
121
121
|
delete r.update, delete r.type;
|
|
122
|
-
const
|
|
122
|
+
const A = JSON.stringify(r);
|
|
123
123
|
return console.info(
|
|
124
124
|
"%capi%c %cput",
|
|
125
125
|
S.API,
|
|
@@ -129,12 +129,12 @@ class Di {
|
|
|
129
129
|
r.id
|
|
130
130
|
), await fetch(
|
|
131
131
|
[this.url, "api", c, "slides", r.id].join("/"),
|
|
132
|
-
{ ...l, body:
|
|
133
|
-
).then((
|
|
134
|
-
if (!
|
|
135
|
-
throw new Error(
|
|
136
|
-
return
|
|
137
|
-
}).then((
|
|
132
|
+
{ ...l, body: A, method: "put" }
|
|
133
|
+
).then((k) => {
|
|
134
|
+
if (!k.ok)
|
|
135
|
+
throw new Error(k.statusText);
|
|
136
|
+
return k;
|
|
137
|
+
}).then((k) => k.json()).catch((k) => ({ succes: !1, message: k, data: [] }));
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
var Rr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
@@ -158,29 +158,29 @@ var jr = { exports: {} };
|
|
|
158
158
|
return e;
|
|
159
159
|
}).apply(this, arguments);
|
|
160
160
|
};
|
|
161
|
-
function
|
|
161
|
+
function A(e, t, n) {
|
|
162
162
|
for (var i, a = 0, o = t.length; a < o; a++) !i && a in t || ((i = i || Array.prototype.slice.call(t, 0, a))[a] = t[a]);
|
|
163
163
|
return e.concat(i || Array.prototype.slice.call(t));
|
|
164
164
|
}
|
|
165
|
-
var
|
|
165
|
+
var k = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Rr, N = Object.keys, B = Array.isArray;
|
|
166
166
|
function J(e, t) {
|
|
167
|
-
return typeof t != "object" ||
|
|
167
|
+
return typeof t != "object" || N(t).forEach(function(n) {
|
|
168
168
|
e[n] = t[n];
|
|
169
169
|
}), e;
|
|
170
170
|
}
|
|
171
|
-
typeof Promise > "u" ||
|
|
172
|
-
var q = Object.getPrototypeOf,
|
|
173
|
-
function
|
|
174
|
-
return
|
|
171
|
+
typeof Promise > "u" || k.Promise || (k.Promise = Promise);
|
|
172
|
+
var q = Object.getPrototypeOf, ce = {}.hasOwnProperty;
|
|
173
|
+
function re(e, t) {
|
|
174
|
+
return ce.call(e, t);
|
|
175
175
|
}
|
|
176
176
|
function xe(e, t) {
|
|
177
|
-
typeof t == "function" && (t = t(q(e))), (typeof Reflect > "u" ?
|
|
177
|
+
typeof t == "function" && (t = t(q(e))), (typeof Reflect > "u" ? N : Reflect.ownKeys)(t).forEach(function(n) {
|
|
178
178
|
ke(e, n, t[n]);
|
|
179
179
|
});
|
|
180
180
|
}
|
|
181
181
|
var zn = Object.defineProperty;
|
|
182
182
|
function ke(e, t, n, i) {
|
|
183
|
-
zn(e, t, J(n &&
|
|
183
|
+
zn(e, t, J(n && re(n, "get") && typeof n.get == "function" ? { get: n.get, set: n.set, configurable: !0 } : { value: n, configurable: !0, writable: !0 }, i));
|
|
184
184
|
}
|
|
185
185
|
function ze(e) {
|
|
186
186
|
return { from: function(t) {
|
|
@@ -198,10 +198,10 @@ var jr = { exports: {} };
|
|
|
198
198
|
if (!e) throw new Error("Assertion Failed");
|
|
199
199
|
}
|
|
200
200
|
function Yn(e) {
|
|
201
|
-
|
|
201
|
+
k.setImmediate ? setImmediate(e) : setTimeout(e, 0);
|
|
202
202
|
}
|
|
203
203
|
function ve(e, t) {
|
|
204
|
-
if (typeof t == "string" &&
|
|
204
|
+
if (typeof t == "string" && re(e, t)) return e[t];
|
|
205
205
|
if (!t) return e;
|
|
206
206
|
if (typeof t != "string") {
|
|
207
207
|
for (var n = [], i = 0, a = t.length; i < a; ++i) {
|
|
@@ -222,12 +222,12 @@ var jr = { exports: {} };
|
|
|
222
222
|
for (var i = 0, a = t.length; i < a; ++i) de(e, t[i], n[i]);
|
|
223
223
|
} else {
|
|
224
224
|
var o, s, u = t.indexOf(".");
|
|
225
|
-
u !== -1 ? (o = t.substr(0, u), (s = t.substr(u + 1)) === "" ? n === void 0 ? B(e) && !isNaN(parseInt(o)) ? e.splice(o, 1) : delete e[o] : e[o] = n : de(u = !(u = e[o]) || !
|
|
225
|
+
u !== -1 ? (o = t.substr(0, u), (s = t.substr(u + 1)) === "" ? n === void 0 ? B(e) && !isNaN(parseInt(o)) ? e.splice(o, 1) : delete e[o] : e[o] = n : de(u = !(u = e[o]) || !re(e, o) ? e[o] = {} : u, s, n)) : n === void 0 ? B(e) && !isNaN(parseInt(t)) ? e.splice(t, 1) : delete e[t] : e[t] = n;
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
function Qn(e) {
|
|
229
229
|
var t, n = {};
|
|
230
|
-
for (t in e)
|
|
230
|
+
for (t in e) re(e, t) && (n[t] = e[t]);
|
|
231
231
|
return n;
|
|
232
232
|
}
|
|
233
233
|
var Wr = [].concat;
|
|
@@ -239,9 +239,9 @@ var jr = { exports: {} };
|
|
|
239
239
|
return t + e + "Array";
|
|
240
240
|
});
|
|
241
241
|
}))).filter(function(e) {
|
|
242
|
-
return
|
|
242
|
+
return k[e];
|
|
243
243
|
}), Vn = new Set(Se.map(function(e) {
|
|
244
|
-
return
|
|
244
|
+
return k[e];
|
|
245
245
|
})), it = null;
|
|
246
246
|
function je(e) {
|
|
247
247
|
return it = /* @__PURE__ */ new WeakMap(), e = function t(n) {
|
|
@@ -254,7 +254,7 @@ var jr = { exports: {} };
|
|
|
254
254
|
} else if (Vn.has(n.constructor)) i = n;
|
|
255
255
|
else {
|
|
256
256
|
var s, u = q(n);
|
|
257
|
-
for (s in i = u === Object.prototype ? {} : Object.create(u), it.set(n, i), n)
|
|
257
|
+
for (s in i = u === Object.prototype ? {} : Object.create(u), it.set(n, i), n) re(n, s) && (i[s] = t(n[s]));
|
|
258
258
|
}
|
|
259
259
|
return i;
|
|
260
260
|
}(e), it = null, e;
|
|
@@ -403,7 +403,7 @@ var jr = { exports: {} };
|
|
|
403
403
|
}(), st = Se[0], he = Se[1], Se = Se[2], he = he && he.then, ct = st && st.constructor, an = !!Se, ut = function(e, t) {
|
|
404
404
|
lt.push([e, t]), xt && (queueMicrotask(ti), xt = !1);
|
|
405
405
|
}, on = !0, xt = !0, Ne = [], kt = [], sn = at, Ae = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: Q, pgp: !1, env: {}, finalize: Q }, L = Ae, lt = [], Be = 0, At = [];
|
|
406
|
-
function
|
|
406
|
+
function K(e) {
|
|
407
407
|
if (typeof this != "object") throw new TypeError("Promises must be constructed via new");
|
|
408
408
|
this._listeners = [], this._lib = !1;
|
|
409
409
|
var t = this._PSD = L;
|
|
@@ -418,7 +418,7 @@ var jr = { exports: {} };
|
|
|
418
418
|
if (o === i) throw new TypeError("A promise cannot be resolved with itself.");
|
|
419
419
|
var s = i._lib && Xe();
|
|
420
420
|
o && typeof o.then == "function" ? n(i, function(u, g) {
|
|
421
|
-
o instanceof
|
|
421
|
+
o instanceof K ? o._then(u, g) : o.then(u, g);
|
|
422
422
|
}) : (i._state = !0, i._value = o, nr(i)), s && Ve();
|
|
423
423
|
}
|
|
424
424
|
}, un.bind(null, i));
|
|
@@ -430,7 +430,7 @@ var jr = { exports: {} };
|
|
|
430
430
|
var cn = { get: function() {
|
|
431
431
|
var e = L, t = Ct;
|
|
432
432
|
function n(i, a) {
|
|
433
|
-
var o = this, s = !e.global && (e !== L || t !== Ct), u = s && !Pe(), g = new
|
|
433
|
+
var o = this, s = !e.global && (e !== L || t !== Ct), u = s && !Pe(), g = new K(function(h, b) {
|
|
434
434
|
ln(o, new tr(ir(i, e, s, u), ir(a, e, s, u), h, b, e));
|
|
435
435
|
});
|
|
436
436
|
return this._consoleTask && (g._consoleTask = this._consoleTask), g;
|
|
@@ -507,7 +507,7 @@ var jr = { exports: {} };
|
|
|
507
507
|
for (var t = At.slice(0), n = t.length; n; ) t[--n]();
|
|
508
508
|
}
|
|
509
509
|
function Dt(e) {
|
|
510
|
-
return new
|
|
510
|
+
return new K(ot, !1, e);
|
|
511
511
|
}
|
|
512
512
|
function Z(e, t) {
|
|
513
513
|
var n = L;
|
|
@@ -522,7 +522,7 @@ var jr = { exports: {} };
|
|
|
522
522
|
}
|
|
523
523
|
};
|
|
524
524
|
}
|
|
525
|
-
xe(
|
|
525
|
+
xe(K.prototype, { then: cn, _then: function(e, t) {
|
|
526
526
|
ln(this, new tr(null, null, e, t, L));
|
|
527
527
|
}, catch: function(e) {
|
|
528
528
|
if (arguments.length === 1) return this.then(null, e);
|
|
@@ -534,42 +534,42 @@ var jr = { exports: {} };
|
|
|
534
534
|
});
|
|
535
535
|
}, finally: function(e) {
|
|
536
536
|
return this.then(function(t) {
|
|
537
|
-
return
|
|
537
|
+
return K.resolve(e()).then(function() {
|
|
538
538
|
return t;
|
|
539
539
|
});
|
|
540
540
|
}, function(t) {
|
|
541
|
-
return
|
|
541
|
+
return K.resolve(e()).then(function() {
|
|
542
542
|
return Dt(t);
|
|
543
543
|
});
|
|
544
544
|
});
|
|
545
545
|
}, timeout: function(e, t) {
|
|
546
546
|
var n = this;
|
|
547
|
-
return e < 1 / 0 ? new
|
|
547
|
+
return e < 1 / 0 ? new K(function(i, a) {
|
|
548
548
|
var o = setTimeout(function() {
|
|
549
549
|
return a(new G.Timeout(t));
|
|
550
550
|
}, e);
|
|
551
551
|
n.then(i, a).finally(clearTimeout.bind(null, o));
|
|
552
552
|
}) : this;
|
|
553
|
-
} }), typeof Symbol < "u" && Symbol.toStringTag && ke(
|
|
553
|
+
} }), typeof Symbol < "u" && Symbol.toStringTag && ke(K.prototype, Symbol.toStringTag, "Dexie.Promise"), Ae.env = rr(), xe(K, { all: function() {
|
|
554
554
|
var e = we.apply(null, arguments).map(Rt);
|
|
555
|
-
return new
|
|
555
|
+
return new K(function(t, n) {
|
|
556
556
|
e.length === 0 && t([]);
|
|
557
557
|
var i = e.length;
|
|
558
558
|
e.forEach(function(a, o) {
|
|
559
|
-
return
|
|
559
|
+
return K.resolve(a).then(function(s) {
|
|
560
560
|
e[o] = s, --i || t(e);
|
|
561
561
|
}, n);
|
|
562
562
|
});
|
|
563
563
|
});
|
|
564
564
|
}, resolve: function(e) {
|
|
565
|
-
return e instanceof
|
|
565
|
+
return e instanceof K ? e : e && typeof e.then == "function" ? new K(function(t, n) {
|
|
566
566
|
e.then(t, n);
|
|
567
|
-
}) : new
|
|
567
|
+
}) : new K(ot, !0, e);
|
|
568
568
|
}, reject: Dt, race: function() {
|
|
569
569
|
var e = we.apply(null, arguments).map(Rt);
|
|
570
|
-
return new
|
|
570
|
+
return new K(function(t, n) {
|
|
571
571
|
e.map(function(i) {
|
|
572
|
-
return
|
|
572
|
+
return K.resolve(i).then(t, n);
|
|
573
573
|
});
|
|
574
574
|
});
|
|
575
575
|
}, PSD: { get: function() {
|
|
@@ -587,7 +587,7 @@ var jr = { exports: {} };
|
|
|
587
587
|
}, set: function(e) {
|
|
588
588
|
sn = e;
|
|
589
589
|
} }, follow: function(e, t) {
|
|
590
|
-
return new
|
|
590
|
+
return new K(function(n, i) {
|
|
591
591
|
return De(function(a, o) {
|
|
592
592
|
var s = L;
|
|
593
593
|
s.unhandleds = [], s.onunhandled = o, s.finalize = Ke(function() {
|
|
@@ -602,13 +602,13 @@ var jr = { exports: {} };
|
|
|
602
602
|
}, s.finalize), e();
|
|
603
603
|
}, t, n, i);
|
|
604
604
|
});
|
|
605
|
-
} }), ct && (ct.allSettled && ke(
|
|
605
|
+
} }), ct && (ct.allSettled && ke(K, "allSettled", function() {
|
|
606
606
|
var e = we.apply(null, arguments).map(Rt);
|
|
607
|
-
return new
|
|
607
|
+
return new K(function(t) {
|
|
608
608
|
e.length === 0 && t([]);
|
|
609
609
|
var n = e.length, i = new Array(n);
|
|
610
610
|
e.forEach(function(a, o) {
|
|
611
|
-
return
|
|
611
|
+
return K.resolve(a).then(function(s) {
|
|
612
612
|
return i[o] = { status: "fulfilled", value: s };
|
|
613
613
|
}, function(s) {
|
|
614
614
|
return i[o] = { status: "rejected", reason: s };
|
|
@@ -617,13 +617,13 @@ var jr = { exports: {} };
|
|
|
617
617
|
});
|
|
618
618
|
});
|
|
619
619
|
});
|
|
620
|
-
}), ct.any && typeof AggregateError < "u" && ke(
|
|
620
|
+
}), ct.any && typeof AggregateError < "u" && ke(K, "any", function() {
|
|
621
621
|
var e = we.apply(null, arguments).map(Rt);
|
|
622
|
-
return new
|
|
622
|
+
return new K(function(t, n) {
|
|
623
623
|
e.length === 0 && n(new AggregateError([]));
|
|
624
624
|
var i = e.length, a = new Array(i);
|
|
625
625
|
e.forEach(function(o, s) {
|
|
626
|
-
return
|
|
626
|
+
return K.resolve(o).then(function(u) {
|
|
627
627
|
return t(u);
|
|
628
628
|
}, function(u) {
|
|
629
629
|
a[s] = u, --i || n(new AggregateError(a));
|
|
@@ -631,21 +631,21 @@ var jr = { exports: {} };
|
|
|
631
631
|
});
|
|
632
632
|
});
|
|
633
633
|
}));
|
|
634
|
-
var
|
|
634
|
+
var ie = { awaits: 0, echoes: 0, id: 0 }, ni = 0, Pt = [], It = 0, Ct = 0, ri = 0;
|
|
635
635
|
function De(e, t, n, i) {
|
|
636
636
|
var a = L, o = Object.create(a);
|
|
637
|
-
return o.parent = a, o.ref = 0, o.global = !1, o.id = ++ri, Ae.env, o.env = an ? { Promise:
|
|
637
|
+
return o.parent = a, o.ref = 0, o.global = !1, o.id = ++ri, Ae.env, o.env = an ? { Promise: K, PromiseProp: { value: K, configurable: !0, writable: !0 }, all: K.all, race: K.race, allSettled: K.allSettled, any: K.any, resolve: K.resolve, reject: K.reject } : {}, t && J(o, t), ++a.ref, o.finalize = function() {
|
|
638
638
|
--this.parent.ref || this.parent.finalize();
|
|
639
639
|
}, i = Le(o, e, n, i), o.ref === 0 && o.finalize(), i;
|
|
640
640
|
}
|
|
641
641
|
function Je() {
|
|
642
|
-
return
|
|
642
|
+
return ie.id || (ie.id = ++ni), ++ie.awaits, ie.echoes += er, ie.id;
|
|
643
643
|
}
|
|
644
644
|
function Pe() {
|
|
645
|
-
return !!
|
|
645
|
+
return !!ie.awaits && (--ie.awaits == 0 && (ie.id = 0), ie.echoes = ie.awaits * er, !0);
|
|
646
646
|
}
|
|
647
647
|
function Rt(e) {
|
|
648
|
-
return
|
|
648
|
+
return ie.echoes && e && e.constructor === ct ? (Je(), e.then(function(t) {
|
|
649
649
|
return Pe(), t;
|
|
650
650
|
}, function(t) {
|
|
651
651
|
return Pe(), ee(t);
|
|
@@ -657,13 +657,13 @@ var jr = { exports: {} };
|
|
|
657
657
|
}
|
|
658
658
|
function Ie(e, t) {
|
|
659
659
|
var n, i = L;
|
|
660
|
-
(t ? !
|
|
661
|
-
++Ct,
|
|
662
|
-
}).bind(null, e) : ii), e !== L && (L = e, i === Ae && (Ae.env = rr()), an && (n = Ae.env.Promise, t = e.env, (i.global || e.global) && (Object.defineProperty(
|
|
660
|
+
(t ? !ie.echoes || It++ && e === L : !It || --It && e === L) || queueMicrotask(t ? (function(a) {
|
|
661
|
+
++Ct, ie.echoes && --ie.echoes != 0 || (ie.echoes = ie.awaits = ie.id = 0), Pt.push(L), Ie(a, !0);
|
|
662
|
+
}).bind(null, e) : ii), e !== L && (L = e, i === Ae && (Ae.env = rr()), an && (n = Ae.env.Promise, t = e.env, (i.global || e.global) && (Object.defineProperty(k, "Promise", t.PromiseProp), n.all = t.all, n.race = t.race, n.resolve = t.resolve, n.reject = t.reject, t.allSettled && (n.allSettled = t.allSettled), t.any && (n.any = t.any))));
|
|
663
663
|
}
|
|
664
664
|
function rr() {
|
|
665
|
-
var e =
|
|
666
|
-
return an ? { Promise: e, PromiseProp: Object.getOwnPropertyDescriptor(
|
|
665
|
+
var e = k.Promise;
|
|
666
|
+
return an ? { Promise: e, PromiseProp: Object.getOwnPropertyDescriptor(k, "Promise"), all: e.all, race: e.race, allSettled: e.allSettled, any: e.any, resolve: e.resolve, reject: e.reject } : {};
|
|
667
667
|
}
|
|
668
668
|
function Le(e, t, n, i, a) {
|
|
669
669
|
var o = L;
|
|
@@ -685,10 +685,10 @@ var jr = { exports: {} };
|
|
|
685
685
|
};
|
|
686
686
|
}
|
|
687
687
|
function fn(e) {
|
|
688
|
-
Promise === ct &&
|
|
688
|
+
Promise === ct && ie.echoes === 0 ? It === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
|
|
689
689
|
}
|
|
690
690
|
("" + he).indexOf("[native code]") === -1 && (Je = Pe = Q);
|
|
691
|
-
var ee =
|
|
691
|
+
var ee = K.reject, Ge = "", _e = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", ar = "String expected.", Ze = [], Tt = "__dbnames", hn = "readonly", pn = "readwrite";
|
|
692
692
|
function $e(e, t) {
|
|
693
693
|
return e ? t ? function() {
|
|
694
694
|
return e.apply(this, arguments) && t.apply(this, arguments);
|
|
@@ -798,7 +798,7 @@ var jr = { exports: {} };
|
|
|
798
798
|
}, V.prototype.where = function(e) {
|
|
799
799
|
if (typeof e == "string") return new this.db.WhereClause(this, e);
|
|
800
800
|
if (B(e)) return new this.db.WhereClause(this, "[".concat(e.join("+"), "]"));
|
|
801
|
-
var t =
|
|
801
|
+
var t = N(e);
|
|
802
802
|
if (t.length === 1) return this.where(t[0]).equals(e[t[0]]);
|
|
803
803
|
var n = this.schema.indexes.concat(this.schema.primKey).filter(function(g) {
|
|
804
804
|
if (g.compound && t.every(function(b) {
|
|
@@ -889,7 +889,7 @@ var jr = { exports: {} };
|
|
|
889
889
|
return o && a && (s = jt(o)(e)), this._trans("readwrite", function(u) {
|
|
890
890
|
return n.core.mutate({ trans: u, type: "add", keys: t != null ? [t] : null, values: [s] });
|
|
891
891
|
}).then(function(u) {
|
|
892
|
-
return u.numFailures ?
|
|
892
|
+
return u.numFailures ? K.reject(u.failures[0]) : u.lastResult;
|
|
893
893
|
}).then(function(u) {
|
|
894
894
|
if (o) try {
|
|
895
895
|
de(e, o, u);
|
|
@@ -904,7 +904,7 @@ var jr = { exports: {} };
|
|
|
904
904
|
return o && a && (s = jt(o)(e)), this._trans("readwrite", function(u) {
|
|
905
905
|
return n.core.mutate({ trans: u, type: "put", values: [s], keys: t != null ? [t] : null });
|
|
906
906
|
}).then(function(u) {
|
|
907
|
-
return u.numFailures ?
|
|
907
|
+
return u.numFailures ? K.reject(u.failures[0]) : u.lastResult;
|
|
908
908
|
}).then(function(u) {
|
|
909
909
|
if (o) try {
|
|
910
910
|
de(e, o, u);
|
|
@@ -917,14 +917,14 @@ var jr = { exports: {} };
|
|
|
917
917
|
return this._trans("readwrite", function(n) {
|
|
918
918
|
return t.core.mutate({ trans: n, type: "delete", keys: [e] });
|
|
919
919
|
}).then(function(n) {
|
|
920
|
-
return n.numFailures ?
|
|
920
|
+
return n.numFailures ? K.reject(n.failures[0]) : void 0;
|
|
921
921
|
});
|
|
922
922
|
}, V.prototype.clear = function() {
|
|
923
923
|
var e = this;
|
|
924
924
|
return this._trans("readwrite", function(t) {
|
|
925
925
|
return e.core.mutate({ trans: t, type: "deleteRange", range: or });
|
|
926
926
|
}).then(function(t) {
|
|
927
|
-
return t.numFailures ?
|
|
927
|
+
return t.numFailures ? K.reject(t.failures[0]) : void 0;
|
|
928
928
|
});
|
|
929
929
|
}, V.prototype.bulkGet = function(e) {
|
|
930
930
|
var t = this;
|
|
@@ -1031,7 +1031,7 @@ var jr = { exports: {} };
|
|
|
1031
1031
|
} };
|
|
1032
1032
|
return n[s] = t[s] = b;
|
|
1033
1033
|
}
|
|
1034
|
-
|
|
1034
|
+
N(h = s).forEach(function(d) {
|
|
1035
1035
|
var v = h[d];
|
|
1036
1036
|
if (B(v)) o(d, h[d][0], h[d][1]);
|
|
1037
1037
|
else {
|
|
@@ -1082,7 +1082,7 @@ var jr = { exports: {} };
|
|
|
1082
1082
|
return g.stop(v);
|
|
1083
1083
|
}, function(v) {
|
|
1084
1084
|
return g.fail(v);
|
|
1085
|
-
}) || ((d = "" + (b = g.primaryKey)) == "[object ArrayBuffer]" && (d = "" + new Uint8Array(b)),
|
|
1085
|
+
}) || ((d = "" + (b = g.primaryKey)) == "[object ArrayBuffer]" && (d = "" + new Uint8Array(b)), re(o, d) || (o[d] = !0, t(u, g, h)));
|
|
1086
1086
|
};
|
|
1087
1087
|
return Promise.all([e.or._iterate(s, n), fr(dr(e, i, n), e.algorithm, s, !e.keysOnly && e.valueMapper)]);
|
|
1088
1088
|
}
|
|
@@ -1112,7 +1112,7 @@ var jr = { exports: {} };
|
|
|
1112
1112
|
var Se = Symbol(), ht = (hr.prototype.execute = function(e) {
|
|
1113
1113
|
if (this.add !== void 0) {
|
|
1114
1114
|
var t = this.add;
|
|
1115
|
-
if (B(t)) return
|
|
1115
|
+
if (B(t)) return A(A([], B(e) ? e : [], !0), t).sort();
|
|
1116
1116
|
if (typeof t == "number") return (Number(e) || 0) + t;
|
|
1117
1117
|
if (typeof t == "bigint") try {
|
|
1118
1118
|
return BigInt(e) + t;
|
|
@@ -1297,14 +1297,14 @@ var jr = { exports: {} };
|
|
|
1297
1297
|
if (!e || !e.multi) return this;
|
|
1298
1298
|
var t = {};
|
|
1299
1299
|
return gn(this._ctx, function(a) {
|
|
1300
|
-
var i = a.primaryKey.toString(), a =
|
|
1300
|
+
var i = a.primaryKey.toString(), a = re(t, i);
|
|
1301
1301
|
return t[i] = !0, !a;
|
|
1302
1302
|
}), this;
|
|
1303
1303
|
}, Y.prototype.modify = function(e) {
|
|
1304
1304
|
var t = this, n = this._ctx;
|
|
1305
1305
|
return this._write(function(i) {
|
|
1306
1306
|
var a, o, s;
|
|
1307
|
-
s = typeof e == "function" ? e : (a =
|
|
1307
|
+
s = typeof e == "function" ? e : (a = N(e), o = a.length, function(y) {
|
|
1308
1308
|
for (var _ = !1, E = 0; E < o; ++E) {
|
|
1309
1309
|
var O = a[E], x = e[O], I = ve(y, O);
|
|
1310
1310
|
x instanceof ht ? (de(y, O, x.execute(I)), _ = !0) : I !== x && (de(y, O, x), _ = !0);
|
|
@@ -1314,7 +1314,7 @@ var jr = { exports: {} };
|
|
|
1314
1314
|
function u(y, O) {
|
|
1315
1315
|
var E = O.failures, O = O.numFailures;
|
|
1316
1316
|
m += y - O;
|
|
1317
|
-
for (var x = 0, I =
|
|
1317
|
+
for (var x = 0, I = N(E); x < I.length; x++) {
|
|
1318
1318
|
var T = I[x];
|
|
1319
1319
|
p.push(E[T]);
|
|
1320
1320
|
}
|
|
@@ -1444,9 +1444,9 @@ var jr = { exports: {} };
|
|
|
1444
1444
|
function pr(e) {
|
|
1445
1445
|
return { type: 1, lower: e, upper: e };
|
|
1446
1446
|
}
|
|
1447
|
-
var gr = (Object.defineProperty(
|
|
1447
|
+
var gr = (Object.defineProperty(ae.prototype, "Collection", { get: function() {
|
|
1448
1448
|
return this._ctx.table.db.Collection;
|
|
1449
|
-
}, enumerable: !1, configurable: !0 }),
|
|
1449
|
+
}, enumerable: !1, configurable: !0 }), ae.prototype.between = function(e, t, n, i) {
|
|
1450
1450
|
n = n !== !1, i = i === !0;
|
|
1451
1451
|
try {
|
|
1452
1452
|
return 0 < this._cmp(e, t) || this._cmp(e, t) === 0 && (n || i) && (!n || !i) ? et(this) : new this.Collection(this, function() {
|
|
@@ -1455,49 +1455,49 @@ var jr = { exports: {} };
|
|
|
1455
1455
|
} catch {
|
|
1456
1456
|
return fe(this, _e);
|
|
1457
1457
|
}
|
|
1458
|
-
},
|
|
1458
|
+
}, ae.prototype.equals = function(e) {
|
|
1459
1459
|
return e == null ? fe(this, _e) : new this.Collection(this, function() {
|
|
1460
1460
|
return pr(e);
|
|
1461
1461
|
});
|
|
1462
|
-
},
|
|
1462
|
+
}, ae.prototype.above = function(e) {
|
|
1463
1463
|
return e == null ? fe(this, _e) : new this.Collection(this, function() {
|
|
1464
1464
|
return Ce(e, void 0, !0);
|
|
1465
1465
|
});
|
|
1466
|
-
},
|
|
1466
|
+
}, ae.prototype.aboveOrEqual = function(e) {
|
|
1467
1467
|
return e == null ? fe(this, _e) : new this.Collection(this, function() {
|
|
1468
1468
|
return Ce(e, void 0, !1);
|
|
1469
1469
|
});
|
|
1470
|
-
},
|
|
1470
|
+
}, ae.prototype.below = function(e) {
|
|
1471
1471
|
return e == null ? fe(this, _e) : new this.Collection(this, function() {
|
|
1472
1472
|
return Ce(void 0, e, !1, !0);
|
|
1473
1473
|
});
|
|
1474
|
-
},
|
|
1474
|
+
}, ae.prototype.belowOrEqual = function(e) {
|
|
1475
1475
|
return e == null ? fe(this, _e) : new this.Collection(this, function() {
|
|
1476
1476
|
return Ce(void 0, e);
|
|
1477
1477
|
});
|
|
1478
|
-
},
|
|
1478
|
+
}, ae.prototype.startsWith = function(e) {
|
|
1479
1479
|
return typeof e != "string" ? fe(this, ar) : this.between(e, e + Ge, !0, !0);
|
|
1480
|
-
},
|
|
1480
|
+
}, ae.prototype.startsWithIgnoreCase = function(e) {
|
|
1481
1481
|
return e === "" ? this.startsWith(e) : Nt(this, function(t, n) {
|
|
1482
1482
|
return t.indexOf(n[0]) === 0;
|
|
1483
1483
|
}, [e], Ge);
|
|
1484
|
-
},
|
|
1484
|
+
}, ae.prototype.equalsIgnoreCase = function(e) {
|
|
1485
1485
|
return Nt(this, function(t, n) {
|
|
1486
1486
|
return t === n[0];
|
|
1487
1487
|
}, [e], "");
|
|
1488
|
-
},
|
|
1488
|
+
}, ae.prototype.anyOfIgnoreCase = function() {
|
|
1489
1489
|
var e = we.apply(He, arguments);
|
|
1490
1490
|
return e.length === 0 ? et(this) : Nt(this, function(t, n) {
|
|
1491
1491
|
return n.indexOf(t) !== -1;
|
|
1492
1492
|
}, e, "");
|
|
1493
|
-
},
|
|
1493
|
+
}, ae.prototype.startsWithAnyOfIgnoreCase = function() {
|
|
1494
1494
|
var e = we.apply(He, arguments);
|
|
1495
1495
|
return e.length === 0 ? et(this) : Nt(this, function(t, n) {
|
|
1496
1496
|
return n.some(function(i) {
|
|
1497
1497
|
return t.indexOf(i) === 0;
|
|
1498
1498
|
});
|
|
1499
1499
|
}, e, Ge);
|
|
1500
|
-
},
|
|
1500
|
+
}, ae.prototype.anyOf = function() {
|
|
1501
1501
|
var e = this, t = we.apply(He, arguments), n = this._cmp;
|
|
1502
1502
|
try {
|
|
1503
1503
|
t.sort(n);
|
|
@@ -1518,9 +1518,9 @@ var jr = { exports: {} };
|
|
|
1518
1518
|
o.continue(t[a]);
|
|
1519
1519
|
}), !1);
|
|
1520
1520
|
}), i;
|
|
1521
|
-
},
|
|
1521
|
+
}, ae.prototype.notEqual = function(e) {
|
|
1522
1522
|
return this.inAnyRange([[-1 / 0, e], [e, this.db._maxKey]], { includeLowers: !1, includeUppers: !1 });
|
|
1523
|
-
},
|
|
1523
|
+
}, ae.prototype.noneOf = function() {
|
|
1524
1524
|
var e = we.apply(He, arguments);
|
|
1525
1525
|
if (e.length === 0) return new this.Collection(this);
|
|
1526
1526
|
try {
|
|
@@ -1532,7 +1532,7 @@ var jr = { exports: {} };
|
|
|
1532
1532
|
return n ? n.concat([[n[n.length - 1][1], i]]) : [[-1 / 0, i]];
|
|
1533
1533
|
}, null);
|
|
1534
1534
|
return t.push([e[e.length - 1], this.db._maxKey]), this.inAnyRange(t, { includeLowers: !1, includeUppers: !1 });
|
|
1535
|
-
},
|
|
1535
|
+
}, ae.prototype.inAnyRange = function(_, t) {
|
|
1536
1536
|
var n = this, i = this._cmp, a = this._ascending, o = this._descending, s = this._min, u = this._max;
|
|
1537
1537
|
if (_.length === 0) return et(this);
|
|
1538
1538
|
if (!_.every(function(E) {
|
|
@@ -1575,15 +1575,15 @@ var jr = { exports: {} };
|
|
|
1575
1575
|
d === a ? E.continue(b[p][0]) : E.continue(b[p][1]);
|
|
1576
1576
|
}), !1);
|
|
1577
1577
|
}), _;
|
|
1578
|
-
},
|
|
1578
|
+
}, ae.prototype.startsWithAnyOf = function() {
|
|
1579
1579
|
var e = we.apply(He, arguments);
|
|
1580
1580
|
return e.every(function(t) {
|
|
1581
1581
|
return typeof t == "string";
|
|
1582
1582
|
}) ? e.length === 0 ? et(this) : this.inAnyRange(e.map(function(t) {
|
|
1583
1583
|
return [t, t + Ge];
|
|
1584
1584
|
})) : fe(this, "startsWithAnyOf() only works with strings");
|
|
1585
|
-
},
|
|
1586
|
-
function
|
|
1585
|
+
}, ae);
|
|
1586
|
+
function ae() {
|
|
1587
1587
|
}
|
|
1588
1588
|
function me(e) {
|
|
1589
1589
|
return Z(function(t) {
|
|
@@ -1630,13 +1630,13 @@ var jr = { exports: {} };
|
|
|
1630
1630
|
var i = this;
|
|
1631
1631
|
if (e === "readwrite" && this.mode !== "readwrite") return ee(new G.ReadOnly("Transaction is readonly"));
|
|
1632
1632
|
if (!this.active) return ee(new G.TransactionInactive());
|
|
1633
|
-
if (this._locked()) return new
|
|
1633
|
+
if (this._locked()) return new K(function(o, s) {
|
|
1634
1634
|
i._blockedFuncs.push([function() {
|
|
1635
1635
|
i._promise(e, t, n).then(o, s);
|
|
1636
1636
|
}, L]);
|
|
1637
1637
|
});
|
|
1638
1638
|
if (n) return De(function() {
|
|
1639
|
-
var o = new
|
|
1639
|
+
var o = new K(function(s, u) {
|
|
1640
1640
|
i._lock();
|
|
1641
1641
|
var g = t(s, u, i);
|
|
1642
1642
|
g && g.then && g.then(s, u);
|
|
@@ -1645,7 +1645,7 @@ var jr = { exports: {} };
|
|
|
1645
1645
|
return i._unlock();
|
|
1646
1646
|
}), o._lib = !0, o;
|
|
1647
1647
|
});
|
|
1648
|
-
var a = new
|
|
1648
|
+
var a = new K(function(o, s) {
|
|
1649
1649
|
var u = t(o, s, i);
|
|
1650
1650
|
u && u.then && u.then(o, s);
|
|
1651
1651
|
});
|
|
@@ -1653,7 +1653,7 @@ var jr = { exports: {} };
|
|
|
1653
1653
|
}, be.prototype._root = function() {
|
|
1654
1654
|
return this.parent ? this.parent._root() : this;
|
|
1655
1655
|
}, be.prototype.waitFor = function(e) {
|
|
1656
|
-
var t, n = this._root(), i =
|
|
1656
|
+
var t, n = this._root(), i = K.resolve(e);
|
|
1657
1657
|
n._waitingFor ? n._waitingFor = n._waitingFor.then(function() {
|
|
1658
1658
|
return i;
|
|
1659
1659
|
}) : (n._waitingFor = i, n._waitingQueue = [], t = n.idbtrans.objectStore(n.storeNames[0]), function o() {
|
|
@@ -1661,7 +1661,7 @@ var jr = { exports: {} };
|
|
|
1661
1661
|
n._waitingFor && (t.get(-1 / 0).onsuccess = o);
|
|
1662
1662
|
}());
|
|
1663
1663
|
var a = n._waitingFor;
|
|
1664
|
-
return new
|
|
1664
|
+
return new K(function(o, s) {
|
|
1665
1665
|
i.then(function(u) {
|
|
1666
1666
|
return n._waitingQueue.push(Z(o.bind(null, u)));
|
|
1667
1667
|
}, function(u) {
|
|
@@ -1674,7 +1674,7 @@ var jr = { exports: {} };
|
|
|
1674
1674
|
this.active && (this.active = !1, this.idbtrans && this.idbtrans.abort(), this._reject(new G.Abort()));
|
|
1675
1675
|
}, be.prototype.table = function(e) {
|
|
1676
1676
|
var t = this._memoizedTables || (this._memoizedTables = {});
|
|
1677
|
-
if (
|
|
1677
|
+
if (re(t, e)) return t[e];
|
|
1678
1678
|
var n = this.schema[e];
|
|
1679
1679
|
if (!n) throw new G.NotFound("Table " + e + " not part of transaction");
|
|
1680
1680
|
return n = new this.db.Table(e, n, this), n.core = this.db.core.table(e), t[e] = n;
|
|
@@ -1742,8 +1742,8 @@ var jr = { exports: {} };
|
|
|
1742
1742
|
var P, $ = (E || O || { length: 1 }).length;
|
|
1743
1743
|
if (E && O && E.length !== O.length) throw new Error("Given keys array must have same length as given values array.");
|
|
1744
1744
|
if ($ === 0) return I({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
|
|
1745
|
-
function F(
|
|
1746
|
-
++pe, pt(
|
|
1745
|
+
function F(le) {
|
|
1746
|
+
++pe, pt(le);
|
|
1747
1747
|
}
|
|
1748
1748
|
var z = [], U = [], pe = 0;
|
|
1749
1749
|
if (_ === "deleteRange") {
|
|
@@ -1754,15 +1754,15 @@ var jr = { exports: {} };
|
|
|
1754
1754
|
if (j) for (var se = 0; se < $; ++se) z.push(P = oe && oe[se] !== void 0 ? C[_](W[se], oe[se]) : C[_](W[se])), P.onerror = F;
|
|
1755
1755
|
else for (se = 0; se < $; ++se) z.push(P = C[_](W[se])), P.onerror = F;
|
|
1756
1756
|
}
|
|
1757
|
-
function Vt(
|
|
1758
|
-
|
|
1757
|
+
function Vt(le) {
|
|
1758
|
+
le = le.target.result, z.forEach(function(We, Ln) {
|
|
1759
1759
|
return We.error != null && (U[Ln] = We.error);
|
|
1760
1760
|
}), I({ numFailures: pe, failures: U, results: _ === "delete" ? E : z.map(function(We) {
|
|
1761
1761
|
return We.result;
|
|
1762
|
-
}), lastResult:
|
|
1762
|
+
}), lastResult: le });
|
|
1763
1763
|
}
|
|
1764
|
-
P.onerror = function(
|
|
1765
|
-
F(
|
|
1764
|
+
P.onerror = function(le) {
|
|
1765
|
+
F(le), Vt(le);
|
|
1766
1766
|
}, P.onsuccess = Vt;
|
|
1767
1767
|
});
|
|
1768
1768
|
}, getMany: function(w) {
|
|
@@ -1817,19 +1817,19 @@ var jr = { exports: {} };
|
|
|
1817
1817
|
function se() {
|
|
1818
1818
|
if (P.result) try {
|
|
1819
1819
|
oe();
|
|
1820
|
-
} catch (
|
|
1821
|
-
W.fail(
|
|
1820
|
+
} catch (le) {
|
|
1821
|
+
W.fail(le);
|
|
1822
1822
|
}
|
|
1823
1823
|
else W.done = !0, W.start = function() {
|
|
1824
1824
|
throw new Error("Cursor behind last entry");
|
|
1825
1825
|
}, W.stop();
|
|
1826
1826
|
}
|
|
1827
|
-
var Vt = new Promise(function(
|
|
1828
|
-
|
|
1829
|
-
W.stop = W.continue = W.continuePrimaryKey = W.advance = pe,
|
|
1827
|
+
var Vt = new Promise(function(le, We) {
|
|
1828
|
+
le = Z(le), P.onerror = me(We), W.fail = We, W.stop = function(Ln) {
|
|
1829
|
+
W.stop = W.continue = W.continuePrimaryKey = W.advance = pe, le(Ln);
|
|
1830
1830
|
};
|
|
1831
1831
|
});
|
|
1832
|
-
return P.onsuccess = Z(function(
|
|
1832
|
+
return P.onsuccess = Z(function(le) {
|
|
1833
1833
|
P.onsuccess = se, se();
|
|
1834
1834
|
}), W.continue = F, W.continuePrimaryKey = z, W.advance = U, se(), Vt;
|
|
1835
1835
|
}, I(W)) : I(null);
|
|
@@ -1912,7 +1912,7 @@ var jr = { exports: {} };
|
|
|
1912
1912
|
De(function() {
|
|
1913
1913
|
return L.trans = o, L.transless = u, t !== 0 ? (Bt(e, n), h = t, ((g = o).storeNames.includes("$meta") ? g.table("$meta").get("version").then(function(b) {
|
|
1914
1914
|
return b ?? h;
|
|
1915
|
-
}) :
|
|
1915
|
+
}) : K.resolve(h)).then(function(b) {
|
|
1916
1916
|
return v = b, p = o, m = n, w = [], b = (d = e)._versions, y = d._dbSchema = $t(0, d.idbdb, m), (b = b.filter(function(_) {
|
|
1917
1917
|
return _._cfg.version >= v;
|
|
1918
1918
|
})).length !== 0 ? (b.forEach(function(_) {
|
|
@@ -1939,12 +1939,12 @@ var jr = { exports: {} };
|
|
|
1939
1939
|
var T = Qn(O);
|
|
1940
1940
|
x.del.forEach(function(j) {
|
|
1941
1941
|
T[j] = E[j];
|
|
1942
|
-
}), Sn(d, [d.Transaction.prototype]), Lt(d, [d.Transaction.prototype],
|
|
1942
|
+
}), Sn(d, [d.Transaction.prototype]), Lt(d, [d.Transaction.prototype], N(T), T), p.schema = T;
|
|
1943
1943
|
var C, R = tn(I);
|
|
1944
|
-
return R && Je(), x =
|
|
1944
|
+
return R && Je(), x = K.follow(function() {
|
|
1945
1945
|
var j;
|
|
1946
1946
|
(C = I(p)) && R && (j = Pe.bind(null, null), C.then(j, j));
|
|
1947
|
-
}), C && typeof C.then == "function" ?
|
|
1947
|
+
}), C && typeof C.then == "function" ? K.resolve(C) : x.then(function() {
|
|
1948
1948
|
return C;
|
|
1949
1949
|
});
|
|
1950
1950
|
}
|
|
@@ -1959,14 +1959,14 @@ var jr = { exports: {} };
|
|
|
1959
1959
|
})) : E.objectStore("$meta").put(_._cfg.version, "version"));
|
|
1960
1960
|
});
|
|
1961
1961
|
}), function _() {
|
|
1962
|
-
return w.length ?
|
|
1962
|
+
return w.length ? K.resolve(w.shift()(p.idbtrans)).then(_) : K.resolve();
|
|
1963
1963
|
}().then(function() {
|
|
1964
1964
|
br(y, m);
|
|
1965
|
-
})) :
|
|
1965
|
+
})) : K.resolve();
|
|
1966
1966
|
var d, v, p, m, w, y;
|
|
1967
|
-
}).catch(s)) : (
|
|
1967
|
+
}).catch(s)) : (N(a).forEach(function(b) {
|
|
1968
1968
|
On(n, b, a[b].primKey, a[b].indexes);
|
|
1969
|
-
}), Bt(e, n), void
|
|
1969
|
+
}), Bt(e, n), void K.follow(function() {
|
|
1970
1970
|
return e.on.populate.fire(o);
|
|
1971
1971
|
}).catch(s));
|
|
1972
1972
|
var g, h;
|
|
@@ -2015,7 +2015,7 @@ var jr = { exports: {} };
|
|
|
2015
2015
|
}), a;
|
|
2016
2016
|
}
|
|
2017
2017
|
function br(e, t) {
|
|
2018
|
-
|
|
2018
|
+
N(e).forEach(function(n) {
|
|
2019
2019
|
t.db.objectStoreNames.contains(n) || (ye && console.debug("Dexie: Creating missing table", n), On(t, n, e[n].primKey, e[n].indexes));
|
|
2020
2020
|
});
|
|
2021
2021
|
}
|
|
@@ -2041,7 +2041,7 @@ var jr = { exports: {} };
|
|
|
2041
2041
|
!t[o] || (h = t[o].idxByName[b]) && (h.name = g, delete t[o].idxByName[b], t[o].idxByName[g] = h);
|
|
2042
2042
|
}
|
|
2043
2043
|
}
|
|
2044
|
-
typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) &&
|
|
2044
|
+
typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && k.WorkerGlobalScope && k instanceof k.WorkerGlobalScope && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604 && (e._hasGetAll = !1);
|
|
2045
2045
|
}
|
|
2046
2046
|
function vr(e) {
|
|
2047
2047
|
return e.split(",").map(function(t, n) {
|
|
@@ -2050,7 +2050,7 @@ var jr = { exports: {} };
|
|
|
2050
2050
|
});
|
|
2051
2051
|
}
|
|
2052
2052
|
var gi = (Ut.prototype._parseStoresSpec = function(e, t) {
|
|
2053
|
-
|
|
2053
|
+
N(e).forEach(function(n) {
|
|
2054
2054
|
if (e[n] !== null) {
|
|
2055
2055
|
var i = vr(e[n]), a = i.shift();
|
|
2056
2056
|
if (a.unique = !0, a.multi) throw new G.Schema("Primary key cannot be multi-valued");
|
|
@@ -2066,7 +2066,7 @@ var jr = { exports: {} };
|
|
|
2066
2066
|
var n = t._versions, i = {}, a = {};
|
|
2067
2067
|
return n.forEach(function(o) {
|
|
2068
2068
|
J(i, o._cfg.storesSource), a = o._cfg.dbschema = {}, o._parseStoresSpec(i, a);
|
|
2069
|
-
}), t._dbSchema = a, Sn(t, [t._allTables, t, t.Transaction.prototype]), Lt(t, [t._allTables, t, t.Transaction.prototype, this._cfg.tables],
|
|
2069
|
+
}), t._dbSchema = a, Sn(t, [t._allTables, t, t.Transaction.prototype]), Lt(t, [t._allTables, t, t.Transaction.prototype, this._cfg.tables], N(a), a), t._storeNames = N(a), this;
|
|
2070
2070
|
}, Ut.prototype.upgrade = function(e) {
|
|
2071
2071
|
return this._cfg.contentUpgrade = rn(this._cfg.contentUpgrade || Q, e), this;
|
|
2072
2072
|
}, Ut);
|
|
@@ -2087,9 +2087,9 @@ var jr = { exports: {} };
|
|
|
2087
2087
|
function Dn(e) {
|
|
2088
2088
|
return !("from" in e);
|
|
2089
2089
|
}
|
|
2090
|
-
var
|
|
2090
|
+
var ue = function(e, t) {
|
|
2091
2091
|
if (!this) {
|
|
2092
|
-
var n = new
|
|
2092
|
+
var n = new ue();
|
|
2093
2093
|
return e && "d" in e && J(n, e), n;
|
|
2094
2094
|
}
|
|
2095
2095
|
J(this, arguments.length ? { d: 1, from: e, to: 1 < arguments.length ? t : e } : { d: 0 });
|
|
@@ -2149,10 +2149,10 @@ var jr = { exports: {} };
|
|
|
2149
2149
|
return (t ? n ? Math.max(t.d, n.d) : t.d : n ? n.d : 0) + 1;
|
|
2150
2150
|
}
|
|
2151
2151
|
function zt(e, t) {
|
|
2152
|
-
return
|
|
2152
|
+
return N(t).forEach(function(n) {
|
|
2153
2153
|
e[n] ? vt(e[n], t[n]) : e[n] = function i(a) {
|
|
2154
2154
|
var o, s, u = {};
|
|
2155
|
-
for (o in a)
|
|
2155
|
+
for (o in a) re(a, o) && (s = a[o], u[o] = !s || typeof s != "object" || Vn.has(s.constructor) ? s : i(s));
|
|
2156
2156
|
return u;
|
|
2157
2157
|
}(t[n]);
|
|
2158
2158
|
}), e;
|
|
@@ -2162,7 +2162,7 @@ var jr = { exports: {} };
|
|
|
2162
2162
|
return t[n] && wr(t[n], e[n]);
|
|
2163
2163
|
});
|
|
2164
2164
|
}
|
|
2165
|
-
xe(
|
|
2165
|
+
xe(ue.prototype, ((he = { add: function(e) {
|
|
2166
2166
|
return vt(this, e), this;
|
|
2167
2167
|
}, addKey: function(e) {
|
|
2168
2168
|
return bt(this, e, e), this;
|
|
@@ -2221,7 +2221,7 @@ var jr = { exports: {} };
|
|
|
2221
2221
|
if (t.openCanceller !== i) throw new G.DatabaseClosed("db.open() was cancelled");
|
|
2222
2222
|
}
|
|
2223
2223
|
function u() {
|
|
2224
|
-
return new
|
|
2224
|
+
return new K(function(v, p) {
|
|
2225
2225
|
if (s(), !n) throw new G.MissingAPI();
|
|
2226
2226
|
var m = e.name, w = t.autoSchema || !a ? n.open(m) : n.open(m, a);
|
|
2227
2227
|
if (!w) throw new G.MissingAPI();
|
|
@@ -2235,7 +2235,7 @@ var jr = { exports: {} };
|
|
|
2235
2235
|
var y, _, E, O, x, I = e.idbdb = w.result, T = St(I.objectStoreNames);
|
|
2236
2236
|
if (0 < T.length) try {
|
|
2237
2237
|
var C = I.transaction((O = T).length === 1 ? O[0] : O, "readonly");
|
|
2238
|
-
if (t.autoSchema) _ = I, E = C, (y = e).verno = _.version / 10, E = y._dbSchema = $t(0, _, E), y._storeNames = St(_.objectStoreNames, 0), Lt(y, [y._allTables],
|
|
2238
|
+
if (t.autoSchema) _ = I, E = C, (y = e).verno = _.version / 10, E = y._dbSchema = $t(0, _, E), y._storeNames = St(_.objectStoreNames, 0), Lt(y, [y._allTables], N(E), E);
|
|
2239
2239
|
else if (Ft(e, e._dbSchema, C), ((x = En($t(0, (x = e).idbdb, C), x._dbSchema)).add.length || x.change.some(function(R) {
|
|
2240
2240
|
return R.add.length || R.change.length;
|
|
2241
2241
|
})) && !o) 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(), a = I.version + 1, o = !0, v(u());
|
|
@@ -2256,11 +2256,11 @@ var jr = { exports: {} };
|
|
|
2256
2256
|
case "VersionError":
|
|
2257
2257
|
if (0 < a) return a = 0, u();
|
|
2258
2258
|
}
|
|
2259
|
-
return
|
|
2259
|
+
return K.reject(v);
|
|
2260
2260
|
});
|
|
2261
2261
|
}
|
|
2262
2262
|
var g, h = t.dbReadyResolve, b = null, d = !1;
|
|
2263
|
-
return
|
|
2263
|
+
return K.race([i, (typeof navigator > "u" ? K.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(v) {
|
|
2264
2264
|
function p() {
|
|
2265
2265
|
return indexedDB.databases().finally(v);
|
|
2266
2266
|
}
|
|
@@ -2268,12 +2268,12 @@ var jr = { exports: {} };
|
|
|
2268
2268
|
}).finally(function() {
|
|
2269
2269
|
return clearInterval(g);
|
|
2270
2270
|
}) : Promise.resolve()).then(u)]).then(function() {
|
|
2271
|
-
return s(), t.onReadyBeingFired = [],
|
|
2271
|
+
return s(), t.onReadyBeingFired = [], K.resolve(An(function() {
|
|
2272
2272
|
return e.on.ready.fire(e.vip);
|
|
2273
2273
|
})).then(function v() {
|
|
2274
2274
|
if (0 < t.onReadyBeingFired.length) {
|
|
2275
2275
|
var p = t.onReadyBeingFired.reduce(rn, Q);
|
|
2276
|
-
return t.onReadyBeingFired = [],
|
|
2276
|
+
return t.onReadyBeingFired = [], K.resolve(An(function() {
|
|
2277
2277
|
return p(e.vip);
|
|
2278
2278
|
})).then(v);
|
|
2279
2279
|
}
|
|
@@ -2293,8 +2293,8 @@ var jr = { exports: {} };
|
|
|
2293
2293
|
var v;
|
|
2294
2294
|
return d && (v = {}, e.tables.forEach(function(p) {
|
|
2295
2295
|
p.schema.indexes.forEach(function(m) {
|
|
2296
|
-
m.name && (v["idb://".concat(e.name, "/").concat(p.name, "/").concat(m.name)] = new
|
|
2297
|
-
}), v["idb://".concat(e.name, "/").concat(p.name, "/")] = v["idb://".concat(e.name, "/").concat(p.name, "/:dels")] = new
|
|
2296
|
+
m.name && (v["idb://".concat(e.name, "/").concat(p.name, "/").concat(m.name)] = new ue(-1 / 0, [[[]]]));
|
|
2297
|
+
}), v["idb://".concat(e.name, "/").concat(p.name, "/")] = v["idb://".concat(e.name, "/").concat(p.name, "/:dels")] = new ue(-1 / 0, [[[]]]);
|
|
2298
2298
|
}), Re(gt).fire(v), Rn(v, !0)), e;
|
|
2299
2299
|
});
|
|
2300
2300
|
}
|
|
@@ -2364,11 +2364,11 @@ var jr = { exports: {} };
|
|
|
2364
2364
|
} });
|
|
2365
2365
|
} };
|
|
2366
2366
|
function jn(e, t, n, i) {
|
|
2367
|
-
return n = n || {}, i = i || "",
|
|
2367
|
+
return n = n || {}, i = i || "", N(e).forEach(function(a) {
|
|
2368
2368
|
var o, s, u;
|
|
2369
|
-
|
|
2370
|
-
}),
|
|
2371
|
-
|
|
2369
|
+
re(t, a) ? (o = e[a], s = t[a], typeof o == "object" && typeof s == "object" && o && s ? (u = qt(o)) !== qt(s) ? n[i + a] = t[a] : u === "Object" ? jn(o, s, n, i + a + ".") : o !== s && (n[i + a] = t[a]) : o !== s && (n[i + a] = t[a])) : n[i + a] = void 0;
|
|
2370
|
+
}), N(t).forEach(function(a) {
|
|
2371
|
+
re(e, a) || (n[i + a] = t[a]);
|
|
2372
2372
|
}), n;
|
|
2373
2373
|
}
|
|
2374
2374
|
function Mn(e, t) {
|
|
@@ -2412,11 +2412,11 @@ var jr = { exports: {} };
|
|
|
2412
2412
|
function b(d) {
|
|
2413
2413
|
var v, p, m, w = L.trans, y = d.keys || Mn(i, d);
|
|
2414
2414
|
if (!y) throw new Error("Keys missing");
|
|
2415
|
-
return (d = d.type === "add" || d.type === "put" ? l(l({}, d), { keys: y }) : l({}, d)).type !== "delete" && (d.values =
|
|
2415
|
+
return (d = d.type === "add" || d.type === "put" ? l(l({}, d), { keys: y }) : l({}, d)).type !== "delete" && (d.values = A([], d.values)), d.keys && (d.keys = A([], d.keys)), v = n, m = y, ((p = d).type === "add" ? Promise.resolve([]) : v.getMany({ trans: p.trans, keys: m, cache: "immutable" })).then(function(_) {
|
|
2416
2416
|
var E = y.map(function(O, x) {
|
|
2417
2417
|
var I, T, C, R = _[x], j = { onerror: null, onsuccess: null };
|
|
2418
2418
|
return d.type === "delete" ? u.fire.call(j, O, R, w) : d.type === "add" || R === void 0 ? (I = g.fire.call(j, O, d.values[x], w), O == null && I != null && (d.keys[x] = O = I, i.outbound || de(d.values[x], i.keyPath, O))) : (I = jn(R, d.values[x]), (T = h.fire.call(j, I, O, R, w)) && (C = d.values[x], Object.keys(T).forEach(function(P) {
|
|
2419
|
-
|
|
2419
|
+
re(C, P) ? C[P] = T[P] : de(C, P, T[P]);
|
|
2420
2420
|
}))), j;
|
|
2421
2421
|
});
|
|
2422
2422
|
return n.mutate(d).then(function(O) {
|
|
@@ -2450,7 +2450,7 @@ var jr = { exports: {} };
|
|
|
2450
2450
|
return l(l({}, n), { getMany: function(i) {
|
|
2451
2451
|
if (!i.cache) return n.getMany(i);
|
|
2452
2452
|
var a = Or(i.keys, i.trans._cache, i.cache === "clone");
|
|
2453
|
-
return a ?
|
|
2453
|
+
return a ? K.resolve(a) : n.getMany(i).then(function(o) {
|
|
2454
2454
|
return i.trans._cache = { keys: i.keys, values: i.cache === "clone" ? je(o) : o }, o;
|
|
2455
2455
|
});
|
|
2456
2456
|
}, mutate: function(i) {
|
|
@@ -2473,7 +2473,7 @@ var jr = { exports: {} };
|
|
|
2473
2473
|
}
|
|
2474
2474
|
}
|
|
2475
2475
|
var wi = { stack: "dbcore", level: 0, name: "Observability", create: function(e) {
|
|
2476
|
-
var t = e.schema.name, n = new
|
|
2476
|
+
var t = e.schema.name, n = new ue(e.MIN_KEY, e.MAX_KEY);
|
|
2477
2477
|
return l(l({}, e), { transaction: function(i, a, o) {
|
|
2478
2478
|
if (L.subscr && a !== "readonly") throw new G.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(L.querier));
|
|
2479
2479
|
return e.transaction(i, a, o);
|
|
@@ -2482,7 +2482,7 @@ var jr = { exports: {} };
|
|
|
2482
2482
|
return p.compound && p.keyPath.includes(s.keyPath);
|
|
2483
2483
|
}), b = l(l({}, a), { mutate: function(p) {
|
|
2484
2484
|
function m(P) {
|
|
2485
|
-
return P = "idb://".concat(t, "/").concat(i, "/").concat(P), O[P] || (O[P] = new
|
|
2485
|
+
return P = "idb://".concat(t, "/").concat(i, "/").concat(P), O[P] || (O[P] = new ue());
|
|
2486
2486
|
}
|
|
2487
2487
|
var w, y, _, E = p.trans, O = p.mutatedParts || (p.mutatedParts = {}), x = m(""), I = m(":dels"), T = p.type, j = p.type === "deleteRange" ? [p.range] : p.type === "delete" ? [p.keys] : p.values.length < 50 ? [Mn(s, p).filter(function(P) {
|
|
2488
2488
|
return P;
|
|
@@ -2517,18 +2517,18 @@ var jr = { exports: {} };
|
|
|
2517
2517
|
});
|
|
2518
2518
|
} }), d = function(m) {
|
|
2519
2519
|
var w = m.query, m = w.index, w = w.range;
|
|
2520
|
-
return [m, new
|
|
2520
|
+
return [m, new ue((m = w.lower) !== null && m !== void 0 ? m : e.MIN_KEY, (w = w.upper) !== null && w !== void 0 ? w : e.MAX_KEY)];
|
|
2521
2521
|
}, v = { get: function(p) {
|
|
2522
|
-
return [s, new
|
|
2522
|
+
return [s, new ue(p.key)];
|
|
2523
2523
|
}, getMany: function(p) {
|
|
2524
|
-
return [s, new
|
|
2524
|
+
return [s, new ue().addKeys(p.keys)];
|
|
2525
2525
|
}, count: d, query: d, openCursor: d };
|
|
2526
|
-
return
|
|
2526
|
+
return N(v).forEach(function(p) {
|
|
2527
2527
|
b[p] = function(m) {
|
|
2528
2528
|
var w = L.subscr, y = !!w, _ = xr(L, a) && kr(p, m) ? m.obsSet = {} : w;
|
|
2529
2529
|
if (y) {
|
|
2530
2530
|
var E = function(R) {
|
|
2531
|
-
return R = "idb://".concat(t, "/").concat(i, "/").concat(R), _[R] || (_[R] = new
|
|
2531
|
+
return R = "idb://".concat(t, "/").concat(i, "/").concat(R), _[R] || (_[R] = new ue());
|
|
2532
2532
|
}, O = E(""), x = E(":dels"), w = v[p](m), y = w[0], w = w[1];
|
|
2533
2533
|
if ((p === "query" && y.isPrimaryKey && !m.values ? x : E(y.name || "")).add(w), !y.isPrimaryKey) {
|
|
2534
2534
|
if (p !== "count") {
|
|
@@ -2580,7 +2580,7 @@ var jr = { exports: {} };
|
|
|
2580
2580
|
if (!v || v.length === 0) return e;
|
|
2581
2581
|
var s = t.query.index, u = s.multiEntry, g = t.query.range, h = i.schema.primaryKey.extractKey, b = s.extractKey, d = (s.lowLevelIndex || s).extractKey, v = v.reduce(function(p, m) {
|
|
2582
2582
|
var w = p, y = [];
|
|
2583
|
-
if (m.type === "add" || m.type === "put") for (var _ = new
|
|
2583
|
+
if (m.type === "add" || m.type === "put") for (var _ = new ue(), E = m.values.length - 1; 0 <= E; --E) {
|
|
2584
2584
|
var O, x = m.values[E], I = h(x);
|
|
2585
2585
|
_.hasKey(I) || (O = b(x), (u && B(O) ? O.some(function(j) {
|
|
2586
2586
|
return Kn(j, g);
|
|
@@ -2593,7 +2593,7 @@ var jr = { exports: {} };
|
|
|
2593
2593
|
}));
|
|
2594
2594
|
break;
|
|
2595
2595
|
case "put":
|
|
2596
|
-
var T = new
|
|
2596
|
+
var T = new ue().addKeys(m.values.map(function(P) {
|
|
2597
2597
|
return h(P);
|
|
2598
2598
|
})), w = p.filter(function(P) {
|
|
2599
2599
|
return !T.hasKey(t.values ? h(P) : P);
|
|
@@ -2602,7 +2602,7 @@ var jr = { exports: {} };
|
|
|
2602
2602
|
}));
|
|
2603
2603
|
break;
|
|
2604
2604
|
case "delete":
|
|
2605
|
-
var C = new
|
|
2605
|
+
var C = new ue().addKeys(m.keys);
|
|
2606
2606
|
w = p.filter(function(P) {
|
|
2607
2607
|
return !C.hasKey(t.values ? h(P) : P);
|
|
2608
2608
|
});
|
|
@@ -2673,7 +2673,7 @@ var jr = { exports: {} };
|
|
|
2673
2673
|
});
|
|
2674
2674
|
for (var x = 0, I = Object.values(p.queries.query); x < I.length; x++) for (var T, C, R, j = 0, P = (T = I[x]).slice(); j < P.length; j++) (C = P[j]).res != null && u.mutatedParts && (g && !C.dirty ? (R = Object.isFrozen(C.res), R = Dr(C.res, C.req, w, m, C, R), C.dirty ? (Me(T, C), C.subscribers.forEach(function($) {
|
|
2675
2675
|
return h.add($);
|
|
2676
|
-
})) : R !== C.res && (C.res = R, C.promise =
|
|
2676
|
+
})) : R !== C.res && (C.res = R, C.promise = K.resolve({ result: R }))) : (C.dirty && Me(T, C), C.subscribers.forEach(function($) {
|
|
2677
2677
|
return h.add($);
|
|
2678
2678
|
})));
|
|
2679
2679
|
}
|
|
@@ -2758,7 +2758,7 @@ var jr = { exports: {} };
|
|
|
2758
2758
|
return n || (n = new this.Version(e), t.push(n), t.sort(fi), n.stores({}), this._state.autoSchema = !1, n);
|
|
2759
2759
|
}, te.prototype._whenReady = function(e) {
|
|
2760
2760
|
var t = this;
|
|
2761
|
-
return this.idbdb && (this._state.openComplete || L.letThrough || this._vip) ? e() : new
|
|
2761
|
+
return this.idbdb && (this._state.openComplete || L.letThrough || this._vip) ? e() : new K(function(n, i) {
|
|
2762
2762
|
if (t._state.openComplete) return i(new G.DatabaseClosed(t._state.dbOpenError));
|
|
2763
2763
|
if (!t._state.isBeingOpened) {
|
|
2764
2764
|
if (!t._state.autoOpen) return void i(new G.DatabaseClosed());
|
|
@@ -2790,9 +2790,9 @@ var jr = { exports: {} };
|
|
|
2790
2790
|
}
|
|
2791
2791
|
this.idbdb = null;
|
|
2792
2792
|
}
|
|
2793
|
-
e.isBeingOpened || (e.dbReadyPromise = new
|
|
2793
|
+
e.isBeingOpened || (e.dbReadyPromise = new K(function(n) {
|
|
2794
2794
|
e.dbReadyResolve = n;
|
|
2795
|
-
}), e.openCanceller = new
|
|
2795
|
+
}), e.openCanceller = new K(function(n, i) {
|
|
2796
2796
|
e.cancelOpen = i;
|
|
2797
2797
|
}));
|
|
2798
2798
|
}, te.prototype.close = function(n) {
|
|
@@ -2802,7 +2802,7 @@ var jr = { exports: {} };
|
|
|
2802
2802
|
var t = this;
|
|
2803
2803
|
e === void 0 && (e = { disableAutoOpen: !0 });
|
|
2804
2804
|
var n = 0 < arguments.length && typeof arguments[0] != "object", i = this._state;
|
|
2805
|
-
return new
|
|
2805
|
+
return new K(function(a, o) {
|
|
2806
2806
|
function s() {
|
|
2807
2807
|
t.close(e);
|
|
2808
2808
|
var u = t._deps.indexedDB.deleteDatabase(t.name);
|
|
@@ -2827,7 +2827,7 @@ var jr = { exports: {} };
|
|
|
2827
2827
|
return this._state.autoSchema;
|
|
2828
2828
|
}, Object.defineProperty(te.prototype, "tables", { get: function() {
|
|
2829
2829
|
var e = this;
|
|
2830
|
-
return
|
|
2830
|
+
return N(this._allTables).map(function(t) {
|
|
2831
2831
|
return e._allTables[t];
|
|
2832
2832
|
});
|
|
2833
2833
|
}, enumerable: !1, configurable: !0 }), te.prototype.transaction = function() {
|
|
@@ -2870,7 +2870,7 @@ var jr = { exports: {} };
|
|
|
2870
2870
|
}) : ee(h);
|
|
2871
2871
|
}
|
|
2872
2872
|
var g = (function h(b, d, v, p, m) {
|
|
2873
|
-
return
|
|
2873
|
+
return K.resolve().then(function() {
|
|
2874
2874
|
var w = L.transless || L, y = b._createTransaction(d, v, b._dbSchema, p);
|
|
2875
2875
|
if (y.explicit = !0, w = { trans: y, transless: w }, p) y.idbtrans = p.idbtrans;
|
|
2876
2876
|
else try {
|
|
@@ -2881,10 +2881,10 @@ var jr = { exports: {} };
|
|
|
2881
2881
|
})) : ee(O);
|
|
2882
2882
|
}
|
|
2883
2883
|
var _, E = tn(m);
|
|
2884
|
-
return E && Je(), w =
|
|
2884
|
+
return E && Je(), w = K.follow(function() {
|
|
2885
2885
|
var O;
|
|
2886
2886
|
(_ = m.call(y, y)) && (E ? (O = Pe.bind(null, null), _.then(O, O)) : typeof _.next == "function" && typeof _.throw == "function" && (_ = Tn(_)));
|
|
2887
|
-
}, w), (_ && typeof _.then == "function" ?
|
|
2887
|
+
}, w), (_ && typeof _.then == "function" ? K.resolve(_).then(function(O) {
|
|
2888
2888
|
return y.active ? O : ee(new G.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
|
|
2889
2889
|
}) : w.then(function() {
|
|
2890
2890
|
return _;
|
|
@@ -2901,7 +2901,7 @@ var jr = { exports: {} };
|
|
|
2901
2901
|
return i._whenReady(g);
|
|
2902
2902
|
}) : this._whenReady(g);
|
|
2903
2903
|
}, te.prototype.table = function(e) {
|
|
2904
|
-
if (!
|
|
2904
|
+
if (!re(this._allTables, e)) throw new G.InvalidTable("Table ".concat(e, " does not exist"));
|
|
2905
2905
|
return this._allTables[e];
|
|
2906
2906
|
}, te);
|
|
2907
2907
|
function te(e, t) {
|
|
@@ -2910,15 +2910,15 @@ var jr = { exports: {} };
|
|
|
2910
2910
|
var i = te.dependencies;
|
|
2911
2911
|
this._options = t = l({ addons: te.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;
|
|
2912
2912
|
var a, o, s, u, g, h = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: Q, dbReadyPromise: null, cancelOpen: Q, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: t.autoOpen };
|
|
2913
|
-
h.dbReadyPromise = new
|
|
2913
|
+
h.dbReadyPromise = new K(function(d) {
|
|
2914
2914
|
h.dbReadyResolve = d;
|
|
2915
|
-
}), h.openCanceller = new
|
|
2915
|
+
}), h.openCanceller = new K(function(d, v) {
|
|
2916
2916
|
h.cancelOpen = v;
|
|
2917
2917
|
}), this._state = h, this.name = e, this.on = dt(this, "populate", "blocked", "versionchange", "close", { ready: [rn, Q] }), this.on.ready.subscribe = Hn(this.on.ready.subscribe, function(d) {
|
|
2918
2918
|
return function(v, p) {
|
|
2919
2919
|
te.vip(function() {
|
|
2920
2920
|
var m, w = n._state;
|
|
2921
|
-
w.openComplete ? (w.dbOpenError ||
|
|
2921
|
+
w.openComplete ? (w.dbOpenError || K.resolve().then(v), p && d(v)) : w.onReadyBeingFired ? (w.onReadyBeingFired.push(v), p && d(v)) : (d(v), m = n, p || d(function y() {
|
|
2922
2922
|
m.on.ready.unsubscribe(v), m.on.ready.unsubscribe(y);
|
|
2923
2923
|
}));
|
|
2924
2924
|
});
|
|
@@ -2937,7 +2937,7 @@ var jr = { exports: {} };
|
|
|
2937
2937
|
this.db = o, this._tx = p, this.name = d, this.schema = v, this.hook = o._allTables[d] ? o._allTables[d].hook : dt(null, { creating: [Vr, Q], reading: [Xr, at], updating: [Zr, Q], deleting: [Jr, Q] });
|
|
2938
2938
|
})), this.Transaction = (s = this, ft(ci.prototype, function(d, v, p, m, w) {
|
|
2939
2939
|
var y = this;
|
|
2940
|
-
this.db = s, this.mode = d, this.storeNames = v, this.schema = p, this.chromeTransactionDurability = m, this.idbtrans = null, this.on = dt(this, "complete", "error", "abort"), this.parent = w || null, this.active = !0, this._reculock = 0, this._blockedFuncs = [], this._resolve = null, this._reject = null, this._waitingFor = null, this._waitingQueue = null, this._spinCount = 0, this._completion = new
|
|
2940
|
+
this.db = s, this.mode = d, this.storeNames = v, this.schema = p, this.chromeTransactionDurability = m, this.idbtrans = null, this.on = dt(this, "complete", "error", "abort"), this.parent = w || null, this.active = !0, this._reculock = 0, this._blockedFuncs = [], this._resolve = null, this._reject = null, this._waitingFor = null, this._waitingQueue = null, this._spinCount = 0, this._completion = new K(function(_, E) {
|
|
2941
2941
|
y._resolve = _, y._reject = E;
|
|
2942
2942
|
}), this._completion.then(function() {
|
|
2943
2943
|
y.active = !1, y.on.complete.fire();
|
|
@@ -2993,7 +2993,7 @@ var jr = { exports: {} };
|
|
|
2993
2993
|
this._subscribe = e;
|
|
2994
2994
|
}
|
|
2995
2995
|
try {
|
|
2996
|
-
Xt = { indexedDB:
|
|
2996
|
+
Xt = { indexedDB: k.indexedDB || k.mozIndexedDB || k.webkitIndexedDB || k.msIndexedDB, IDBKeyRange: k.IDBKeyRange || k.webkitIDBKeyRange };
|
|
2997
2997
|
} catch {
|
|
2998
2998
|
Xt = { indexedDB: null, IDBKeyRange: null };
|
|
2999
2999
|
}
|
|
@@ -3022,7 +3022,7 @@ var jr = { exports: {} };
|
|
|
3022
3022
|
}
|
|
3023
3023
|
}(y = { subscr: w, signal: s.signal, requery: v, querier: e, trans: null }), Promise.resolve(_).then(function(E) {
|
|
3024
3024
|
n = !0, t = E, u || y.signal.aborted || (g = {}, function(O) {
|
|
3025
|
-
for (var x in O) if (
|
|
3025
|
+
for (var x in O) if (re(O, x)) return;
|
|
3026
3026
|
return 1;
|
|
3027
3027
|
}(h = w) || d || (Re(gt, p), d = !0), fn(function() {
|
|
3028
3028
|
return !u && a.next && a.next(E);
|
|
@@ -3081,7 +3081,7 @@ var jr = { exports: {} };
|
|
|
3081
3081
|
return function() {
|
|
3082
3082
|
try {
|
|
3083
3083
|
var t = Tn(e.apply(this, arguments));
|
|
3084
|
-
return t && typeof t.then == "function" ? t :
|
|
3084
|
+
return t && typeof t.then == "function" ? t : K.resolve(t);
|
|
3085
3085
|
} catch (n) {
|
|
3086
3086
|
return ee(n);
|
|
3087
3087
|
}
|
|
@@ -3089,15 +3089,15 @@ var jr = { exports: {} };
|
|
|
3089
3089
|
}, spawn: function(e, t, n) {
|
|
3090
3090
|
try {
|
|
3091
3091
|
var i = Tn(e.apply(n, t || []));
|
|
3092
|
-
return i && typeof i.then == "function" ? i :
|
|
3092
|
+
return i && typeof i.then == "function" ? i : K.resolve(i);
|
|
3093
3093
|
} catch (a) {
|
|
3094
3094
|
return ee(a);
|
|
3095
3095
|
}
|
|
3096
3096
|
}, currentTransaction: { get: function() {
|
|
3097
3097
|
return L.trans || null;
|
|
3098
3098
|
} }, waitFor: function(e, t) {
|
|
3099
|
-
return t =
|
|
3100
|
-
}, Promise:
|
|
3099
|
+
return t = K.resolve(typeof e == "function" ? Ue.ignoreTransaction(e) : e).timeout(t || 6e4), L.trans ? L.trans.waitFor(t) : t;
|
|
3100
|
+
}, Promise: K, debug: { get: function() {
|
|
3101
3101
|
return ye;
|
|
3102
3102
|
}, set: function(e) {
|
|
3103
3103
|
qn(e);
|
|
@@ -3128,8 +3128,8 @@ var jr = { exports: {} };
|
|
|
3128
3128
|
for (var t = 0, n = Ze; t < n.length; t++) n[t].close({ disableAutoOpen: !1 });
|
|
3129
3129
|
}
|
|
3130
3130
|
}), addEventListener("pageshow", function(e) {
|
|
3131
|
-
!Ee.disableBfCache && e.persisted && (ye && console.debug("Dexie: handling persisted pageshow"), Cr(), Bn({ all: new
|
|
3132
|
-
})),
|
|
3131
|
+
!Ee.disableBfCache && e.persisted && (ye && console.debug("Dexie: handling persisted pageshow"), Cr(), Bn({ all: new ue(-1 / 0, [[]]) }));
|
|
3132
|
+
})), K.rejectionMapper = function(e, t) {
|
|
3133
3133
|
return !e || e instanceof Ye || e instanceof TypeError || e instanceof SyntaxError || !e.name || !Zn[e.name] ? e : (t = new Zn[e.name](t || e.message, e), "stack" in e && ke(t, "stack", { get: function() {
|
|
3134
3134
|
return this.inner.stack;
|
|
3135
3135
|
} }), t);
|
|
@@ -3139,7 +3139,7 @@ var jr = { exports: {} };
|
|
|
3139
3139
|
return new ht({ add: e });
|
|
3140
3140
|
}, remove: function(e) {
|
|
3141
3141
|
return new ht({ remove: e });
|
|
3142
|
-
}, default: Ee, RangeSet:
|
|
3142
|
+
}, default: Ee, RangeSet: ue, mergeRanges: vt, rangesOverlap: wr }), { default: Ee }), Ee;
|
|
3143
3143
|
});
|
|
3144
3144
|
})(jr);
|
|
3145
3145
|
var Ii = jr.exports;
|
|
@@ -3160,10 +3160,10 @@ function nt(f) {
|
|
|
3160
3160
|
}
|
|
3161
3161
|
function _t(f, r) {
|
|
3162
3162
|
var B;
|
|
3163
|
-
let c, l,
|
|
3163
|
+
let c, l, A, k, N;
|
|
3164
3164
|
switch (f.moderation) {
|
|
3165
3165
|
case Zt.BEFORE:
|
|
3166
|
-
c = /* @__PURE__ */ new Date(), l = (B = f.beforeTime) == null ? void 0 : B.split(":"),
|
|
3166
|
+
c = /* @__PURE__ */ new Date(), l = (B = f.beforeTime) == null ? void 0 : B.split(":"), A = Number.parseInt(l ? l[0] : "00"), k = Number.parseInt(l ? l[1] : "00"), N = Number.parseInt(l ? l[2] : "00"), r.before = c.setHours(A, k, N, 0) / 1e3, r.period || (r.period = c.getDay() === 1 ? 72 : 24);
|
|
3167
3167
|
break;
|
|
3168
3168
|
case Zt.DELAYED:
|
|
3169
3169
|
f.delay && f.delay > 0 && (r.delay = `${f.delay}`);
|
|
@@ -3178,16 +3178,16 @@ function _t(f, r) {
|
|
|
3178
3178
|
}
|
|
3179
3179
|
class Mr {
|
|
3180
3180
|
constructor(r) {
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3181
|
+
D(this, "db");
|
|
3182
|
+
D(this, "subscribers", []);
|
|
3183
|
+
D(this, "options");
|
|
3184
3184
|
/**
|
|
3185
3185
|
* Retrieve Cloud Data
|
|
3186
3186
|
* @param query IQuery
|
|
3187
3187
|
* @returns IResponse
|
|
3188
3188
|
*/
|
|
3189
|
-
|
|
3190
|
-
const c = await this.db.table(
|
|
3189
|
+
D(this, "getCloud", async (r) => {
|
|
3190
|
+
const c = await this.db.table(M.CLOUD).where({ id: r.widget }).last().catch(() => {
|
|
3191
3191
|
console.warn(
|
|
3192
3192
|
"%capi%C %ccloud",
|
|
3193
3193
|
S.API,
|
|
@@ -3204,8 +3204,8 @@ class Mr {
|
|
|
3204
3204
|
* @param query IQuery
|
|
3205
3205
|
* @returns IResponse
|
|
3206
3206
|
*/
|
|
3207
|
-
|
|
3208
|
-
const c = await this.db.table(
|
|
3207
|
+
D(this, "getSeries", async (r) => {
|
|
3208
|
+
const c = await this.db.table(M.SERIES).where({ id: r.widget }).last().catch(() => {
|
|
3209
3209
|
console.warn(
|
|
3210
3210
|
"%capi%c %cseries",
|
|
3211
3211
|
S.API,
|
|
@@ -3222,10 +3222,10 @@ class Mr {
|
|
|
3222
3222
|
* @param query IQuery
|
|
3223
3223
|
* @returns IResponse
|
|
3224
3224
|
*/
|
|
3225
|
-
|
|
3226
|
-
const c = (
|
|
3225
|
+
D(this, "getMessages", async (r) => {
|
|
3226
|
+
const c = (k) => k.widget_id === r.widget, l = (k) => k.utc > ((r == null ? void 0 : r.since) || 0), A = (k) => (k == null ? void 0 : k.visible) !== 0;
|
|
3227
3227
|
try {
|
|
3228
|
-
const
|
|
3228
|
+
const k = await this.db.table(M.TOPICS).orderBy("utc").reverse().filter(c).filter(l).filter(A).limit((r == null ? void 0 : r.limit) ?? 25).toArray().catch(() => {
|
|
3229
3229
|
console.warn(
|
|
3230
3230
|
"%capi%c %cmessages",
|
|
3231
3231
|
S.API,
|
|
@@ -3235,27 +3235,27 @@ class Mr {
|
|
|
3235
3235
|
r.widget
|
|
3236
3236
|
);
|
|
3237
3237
|
});
|
|
3238
|
-
if (
|
|
3238
|
+
if (k.length === 0)
|
|
3239
3239
|
return { data: null, message: "No Messages error", success: !1 };
|
|
3240
|
-
const
|
|
3241
|
-
(
|
|
3242
|
-
), q = (await this.db.table(
|
|
3243
|
-
(
|
|
3240
|
+
const N = k[0] ? k[0].title : "No title", B = k.map(
|
|
3241
|
+
(ce) => ce.message_id
|
|
3242
|
+
), q = (await this.db.table(M.MESSAGES).where("id").anyOf(B).toArray().then((ce) => ce.sort((re, xe) => xe.utc - re.utc))).map(
|
|
3243
|
+
(ce) => ce.data
|
|
3244
3244
|
);
|
|
3245
3245
|
return {
|
|
3246
3246
|
data: {
|
|
3247
3247
|
presentation: (r == null ? void 0 : r.presentation) || "not set",
|
|
3248
3248
|
slide: (r == null ? void 0 : r.slide) || "not set",
|
|
3249
3249
|
messages: q,
|
|
3250
|
-
title:
|
|
3250
|
+
title: N,
|
|
3251
3251
|
topics: [r.dashboard, r.widget].join("-"),
|
|
3252
3252
|
query: r
|
|
3253
3253
|
},
|
|
3254
3254
|
message: "Messages retrieved successfully",
|
|
3255
3255
|
success: !0
|
|
3256
3256
|
};
|
|
3257
|
-
} catch (
|
|
3258
|
-
return console.error("%cstorage", S.STORAGE, "set", r,
|
|
3257
|
+
} catch (k) {
|
|
3258
|
+
return console.error("%cstorage", S.STORAGE, "set", r, k), { data: null, message: "Messages Data error", success: !1 };
|
|
3259
3259
|
}
|
|
3260
3260
|
});
|
|
3261
3261
|
/**
|
|
@@ -3264,7 +3264,7 @@ class Mr {
|
|
|
3264
3264
|
* @param data
|
|
3265
3265
|
* @returns number
|
|
3266
3266
|
*/
|
|
3267
|
-
|
|
3267
|
+
D(this, "setCloud", async (r, c) => r.type === M.CLOUD && c !== "" ? await this.db.table(M.CLOUD).put({
|
|
3268
3268
|
id: r.widget,
|
|
3269
3269
|
dashboard_id: r.dashboard,
|
|
3270
3270
|
data: c.data
|
|
@@ -3275,7 +3275,7 @@ class Mr {
|
|
|
3275
3275
|
* @param data
|
|
3276
3276
|
* @returns number
|
|
3277
3277
|
*/
|
|
3278
|
-
|
|
3278
|
+
D(this, "setSeries", async (r, c) => r.type === M.SERIES && c !== "" ? await this.db.table(M.SERIES).put({
|
|
3279
3279
|
id: r.widget,
|
|
3280
3280
|
dashboard_id: r.dashboard,
|
|
3281
3281
|
data: c.data
|
|
@@ -3286,67 +3286,66 @@ class Mr {
|
|
|
3286
3286
|
* @param data any
|
|
3287
3287
|
* @returns number
|
|
3288
3288
|
*/
|
|
3289
|
-
|
|
3290
|
-
if (r.type !==
|
|
3289
|
+
D(this, "setMessages", async (r, c) => {
|
|
3290
|
+
if (r.type !== M.MESSAGES)
|
|
3291
3291
|
return 400;
|
|
3292
3292
|
const l = c.data.title;
|
|
3293
|
-
let
|
|
3294
|
-
return c.data.messages.forEach(async (
|
|
3295
|
-
var
|
|
3296
|
-
|
|
3297
|
-
|
|
3293
|
+
let A = 0;
|
|
3294
|
+
return c.data.messages.forEach(async (k) => {
|
|
3295
|
+
var N, B, J, q;
|
|
3296
|
+
k.id !== null && (await this.db.table(M.MESSAGES).put({ id: k.id, utc: k.utc, data: k, expires: k.expires }).catch((ce) => {
|
|
3297
|
+
A++, console.error(
|
|
3298
3298
|
"%cstorage",
|
|
3299
3299
|
S.STORAGE,
|
|
3300
3300
|
"set message",
|
|
3301
3301
|
`title: ${l}`,
|
|
3302
|
-
|
|
3303
|
-
|
|
3302
|
+
k,
|
|
3303
|
+
ce.message
|
|
3304
3304
|
);
|
|
3305
|
-
}), await this.db.table(
|
|
3305
|
+
}), await this.db.table(M.TOPICS).put({
|
|
3306
3306
|
widget_id: r.widget,
|
|
3307
|
-
message_id:
|
|
3307
|
+
message_id: k.id,
|
|
3308
3308
|
dashboard_id: r.dashboard,
|
|
3309
3309
|
title: l,
|
|
3310
|
-
engagement: (
|
|
3311
|
-
impressions: (B =
|
|
3312
|
-
reach: (J =
|
|
3313
|
-
sentiment: ((q =
|
|
3314
|
-
utc:
|
|
3315
|
-
expires:
|
|
3316
|
-
}).catch((
|
|
3317
|
-
|
|
3310
|
+
engagement: (N = k.dynamics) == null ? void 0 : N.engagement,
|
|
3311
|
+
impressions: (B = k.dynamics) == null ? void 0 : B.semrush_visits,
|
|
3312
|
+
reach: (J = k.dynamics) == null ? void 0 : J.potential_reach,
|
|
3313
|
+
sentiment: ((q = k.topics[0]) == null ? void 0 : q.sentiment) || 0,
|
|
3314
|
+
utc: k.utc,
|
|
3315
|
+
expires: k.expires
|
|
3316
|
+
}).catch((ce) => {
|
|
3317
|
+
A++, console.error(
|
|
3318
3318
|
"%cstorage",
|
|
3319
3319
|
S.STORAGE,
|
|
3320
3320
|
"set topic",
|
|
3321
3321
|
`title: ${l}`,
|
|
3322
|
-
|
|
3323
|
-
|
|
3322
|
+
k,
|
|
3323
|
+
ce.message
|
|
3324
3324
|
);
|
|
3325
3325
|
}));
|
|
3326
|
-
}),
|
|
3326
|
+
}), A === 0 ? 201 : 400;
|
|
3327
3327
|
});
|
|
3328
3328
|
/**
|
|
3329
|
-
* Wipe Message data after
|
|
3330
|
-
* @param retentionDuration
|
|
3329
|
+
* Wipe Message data after expires timestamp
|
|
3331
3330
|
*/
|
|
3332
|
-
|
|
3333
|
-
const
|
|
3334
|
-
return await this.db.table(
|
|
3331
|
+
D(this, "cleanMessages", async () => {
|
|
3332
|
+
const r = Date.now() / 1e3, c = (k) => k.expires < r, l = (k) => k.expires < r;
|
|
3333
|
+
return await this.db.table(M.TOPICS).orderBy("expires").filter(c).delete().catch((k) => (console.error(
|
|
3335
3334
|
"%cstorage%c %cclean",
|
|
3336
3335
|
S.STORAGE,
|
|
3337
3336
|
S.NONE,
|
|
3338
3337
|
S.MESSAGES,
|
|
3339
|
-
|
|
3340
|
-
), 0)), await this.db.table(
|
|
3338
|
+
k.message
|
|
3339
|
+
), 0)), await this.db.table(M.MESSAGES).orderBy("expires").filter(l).delete().catch((k) => (console.error(
|
|
3341
3340
|
"%cstorage%c %clean",
|
|
3342
3341
|
S.STORAGE,
|
|
3343
3342
|
S.NONE,
|
|
3344
3343
|
S.MESSAGES,
|
|
3345
|
-
|
|
3344
|
+
k.message
|
|
3346
3345
|
), 0));
|
|
3347
3346
|
});
|
|
3348
|
-
|
|
3349
|
-
await this.db.table(
|
|
3347
|
+
D(this, "hideMessage", async (r, c) => {
|
|
3348
|
+
await this.db.table(M.TOPICS).where("message_id").equals(r).modify({ visible: c }).catch((l) => (console.error(
|
|
3350
3349
|
"%cstorage%c %chide",
|
|
3351
3350
|
S.STORAGE,
|
|
3352
3351
|
S.NONE,
|
|
@@ -3359,14 +3358,14 @@ class Mr {
|
|
|
3359
3358
|
* @param query IQuery
|
|
3360
3359
|
* @returns number
|
|
3361
3360
|
*/
|
|
3362
|
-
|
|
3361
|
+
D(this, "setWidget", async (r) => await this.db.table(M.WIDGETS).put({
|
|
3363
3362
|
id: r.widget,
|
|
3364
3363
|
dashboard_id: r.dashboard,
|
|
3365
3364
|
type: r.type
|
|
3366
3365
|
}).then(() => 201).catch((c) => (console.error(
|
|
3367
3366
|
"%cstorage",
|
|
3368
3367
|
S.STORAGE,
|
|
3369
|
-
|
|
3368
|
+
M.WIDGET,
|
|
3370
3369
|
r,
|
|
3371
3370
|
c.message
|
|
3372
3371
|
), 400)));
|
|
@@ -3375,9 +3374,9 @@ class Mr {
|
|
|
3375
3374
|
* @param query IQuery
|
|
3376
3375
|
* @returns null
|
|
3377
3376
|
*/
|
|
3378
|
-
|
|
3377
|
+
D(this, "subscribe", (r) => (r = nt(r), this.subscribers.filter(
|
|
3379
3378
|
(l) => l.widget === r.widget
|
|
3380
|
-
).length > 0 || (r.type ===
|
|
3379
|
+
).length > 0 || (r.type === M.MESSAGES && (r = _t(this.options, r)), console.debug(
|
|
3381
3380
|
"%cstorage%c %csubscribe",
|
|
3382
3381
|
S.STORAGE,
|
|
3383
3382
|
S.NONE,
|
|
@@ -3389,14 +3388,14 @@ class Mr {
|
|
|
3389
3388
|
* Get current subscribers
|
|
3390
3389
|
* @returns IQuery[]
|
|
3391
3390
|
*/
|
|
3392
|
-
|
|
3391
|
+
D(this, "getSubscribers", async () => await new Promise((r) => r(this.subscribers)));
|
|
3393
3392
|
/**
|
|
3394
3393
|
* Retrieve Cloud Data
|
|
3395
3394
|
* @param query IQuery
|
|
3396
3395
|
* @returns IResponse
|
|
3397
3396
|
*/
|
|
3398
|
-
|
|
3399
|
-
const c = await this.db.table(
|
|
3397
|
+
D(this, "loadSlide", async (r) => {
|
|
3398
|
+
const c = await this.db.table(M.SLIDE).where({ id: r.id }).last().catch(() => {
|
|
3400
3399
|
console.warn(
|
|
3401
3400
|
"%capi%c %cseries",
|
|
3402
3401
|
S.API,
|
|
@@ -3412,7 +3411,7 @@ class Mr {
|
|
|
3412
3411
|
* @param query IQuery
|
|
3413
3412
|
* @returns number
|
|
3414
3413
|
*/
|
|
3415
|
-
|
|
3414
|
+
D(this, "storeSlide", async (r) => r.type === M.SLIDE && r.data !== "" ? await this.db.table(M.SLIDE).put({
|
|
3416
3415
|
id: r.id,
|
|
3417
3416
|
title: r.data.title || "Not set",
|
|
3418
3417
|
json: r.data.json || {},
|
|
@@ -3449,7 +3448,7 @@ function Ci(f, r) {
|
|
|
3449
3448
|
const c = indexedDB.open(f);
|
|
3450
3449
|
c.onupgradeneeded = () => c.result.createObjectStore(r);
|
|
3451
3450
|
const l = Wn(c);
|
|
3452
|
-
return (
|
|
3451
|
+
return (A, k) => l.then((N) => k(N.transaction(r, A).objectStore(r)));
|
|
3453
3452
|
}
|
|
3454
3453
|
let Gn;
|
|
3455
3454
|
function Kr() {
|
|
@@ -3463,19 +3462,19 @@ function wt(f, r, c = Kr()) {
|
|
|
3463
3462
|
}
|
|
3464
3463
|
class Nr {
|
|
3465
3464
|
constructor(r) {
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3465
|
+
D(this, "subscribers", []);
|
|
3466
|
+
D(this, "options");
|
|
3467
|
+
D(this, "getCloud", async (r) => {
|
|
3469
3468
|
const c = X(r);
|
|
3470
|
-
return await Jt(c).then((l) => l).catch(() => (console.warn("%capi", S.API,
|
|
3469
|
+
return await Jt(c).then((l) => l).catch(() => (console.warn("%capi", S.API, M.CLOUD, r.slide, r.widget), { data: null, message: "Cloud Data error", success: !1 }));
|
|
3471
3470
|
});
|
|
3472
|
-
|
|
3471
|
+
D(this, "getSeries", async (r) => {
|
|
3473
3472
|
const c = X(r);
|
|
3474
|
-
return await Jt(c).then((l) => l).catch(() => (console.warn("%capi", S.API,
|
|
3473
|
+
return await Jt(c).then((l) => l).catch(() => (console.warn("%capi", S.API, M.SERIES, r.slide, r.widget), { data: null, message: "Series Data error", success: !1 }));
|
|
3475
3474
|
});
|
|
3476
|
-
|
|
3475
|
+
D(this, "getMessages", async (r) => {
|
|
3477
3476
|
const c = X(r);
|
|
3478
|
-
return await Jt(c).then((l) => l).catch(() => (console.warn("%capi", S.API,
|
|
3477
|
+
return await Jt(c).then((l) => l).catch(() => (console.warn("%capi", S.API, M.MESSAGES, r.slide, r.widget), { data: null, message: "Messages Data error", success: !1 }));
|
|
3479
3478
|
});
|
|
3480
3479
|
/**
|
|
3481
3480
|
* Update Cloud
|
|
@@ -3483,11 +3482,11 @@ class Nr {
|
|
|
3483
3482
|
* @param data
|
|
3484
3483
|
* @returns number
|
|
3485
3484
|
*/
|
|
3486
|
-
|
|
3485
|
+
D(this, "setCloud", async (r, c) => {
|
|
3487
3486
|
if (!c.success)
|
|
3488
3487
|
return 400;
|
|
3489
3488
|
const l = X(r);
|
|
3490
|
-
return delete c.success, delete c.message, await wt(l, c).then(() => 201).catch((
|
|
3489
|
+
return delete c.success, delete c.message, await wt(l, c).then(() => 201).catch((A) => (console.error("%cstorage", S.STORAGE, M.CLOUD, r, A.message), 400));
|
|
3491
3490
|
});
|
|
3492
3491
|
/**
|
|
3493
3492
|
* Update Series
|
|
@@ -3495,11 +3494,11 @@ class Nr {
|
|
|
3495
3494
|
* @param data
|
|
3496
3495
|
* @returns bumber
|
|
3497
3496
|
*/
|
|
3498
|
-
|
|
3497
|
+
D(this, "setSeries", async (r, c) => {
|
|
3499
3498
|
if (!c.success)
|
|
3500
3499
|
return 400;
|
|
3501
3500
|
const l = X(r);
|
|
3502
|
-
return delete c.success, delete c.message, await wt(l, c).then(() => 201).catch((
|
|
3501
|
+
return delete c.success, delete c.message, await wt(l, c).then(() => 201).catch((A) => (console.error("%cstorage", S.STORAGE, M.SERIES, r, A.message), 400));
|
|
3503
3502
|
});
|
|
3504
3503
|
/**
|
|
3505
3504
|
* Update Messages
|
|
@@ -3507,14 +3506,14 @@ class Nr {
|
|
|
3507
3506
|
* @param data
|
|
3508
3507
|
* @returns number
|
|
3509
3508
|
*/
|
|
3510
|
-
|
|
3509
|
+
D(this, "setMessages", async (r, c) => {
|
|
3511
3510
|
if (!c.success)
|
|
3512
3511
|
return 400;
|
|
3513
3512
|
const l = X(r);
|
|
3514
|
-
return delete c.success, delete c.message, await wt(l, c).then(() => 201).catch((
|
|
3513
|
+
return delete c.success, delete c.message, await wt(l, c).then(() => 201).catch((A) => (console.error("%cstorage", S.STORAGE, M.MESSAGES, r, A.message), 400));
|
|
3515
3514
|
});
|
|
3516
|
-
|
|
3517
|
-
|
|
3515
|
+
D(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((c) => c(0))));
|
|
3516
|
+
D(this, "hideMessage", async (r, c) => {
|
|
3518
3517
|
console.debug(
|
|
3519
3518
|
`hideMessage ${r} ${c} not implemented for ${this.options.storage}`
|
|
3520
3519
|
);
|
|
@@ -3524,20 +3523,20 @@ class Nr {
|
|
|
3524
3523
|
* @param query IQuery
|
|
3525
3524
|
* @returns number
|
|
3526
3525
|
*/
|
|
3527
|
-
|
|
3526
|
+
D(this, "setWidget", async (r) => {
|
|
3528
3527
|
const c = X(r), l = {
|
|
3529
3528
|
id: r.widget,
|
|
3530
3529
|
dashboard_id: r.dashboard,
|
|
3531
3530
|
type: r.type
|
|
3532
3531
|
};
|
|
3533
|
-
return await wt(c, l).then(() => 201).catch((
|
|
3532
|
+
return await wt(c, l).then(() => 201).catch((A) => (console.error("%cstorage", S.STORAGE, M.WIDGET, r, A.message), 400));
|
|
3534
3533
|
});
|
|
3535
3534
|
/**
|
|
3536
3535
|
* Add component subscriber
|
|
3537
3536
|
* @param query IQuery
|
|
3538
3537
|
* @returns null
|
|
3539
3538
|
*/
|
|
3540
|
-
|
|
3539
|
+
D(this, "subscribe", (r) => (r = nt(r), r.type === M.MESSAGES && (r = _t(this.options, r)), this.subscribers.filter(
|
|
3541
3540
|
(l) => l.widget === r.widget
|
|
3542
3541
|
).length > 0 || (console.debug(
|
|
3543
3542
|
"%cstorage%c %csubscribe",
|
|
@@ -3551,17 +3550,17 @@ class Nr {
|
|
|
3551
3550
|
* Get current subscribers
|
|
3552
3551
|
* @returns IQuery[]
|
|
3553
3552
|
*/
|
|
3554
|
-
|
|
3555
|
-
|
|
3553
|
+
D(this, "getSubscribers", async () => await new Promise((r) => r(this.subscribers)));
|
|
3554
|
+
D(this, "loadSlide", async (r) => {
|
|
3556
3555
|
const c = X(r);
|
|
3557
|
-
return await Jt(c).then((l) => l).catch(() => (console.warn("%capi", S.API,
|
|
3556
|
+
return await Jt(c).then((l) => l).catch(() => (console.warn("%capi", S.API, M.SLIDE, r.slide), { data: null, message: "Slide Load error", success: !1 }));
|
|
3558
3557
|
});
|
|
3559
3558
|
/**
|
|
3560
3559
|
* Update Slide
|
|
3561
3560
|
* @param query IQuery
|
|
3562
3561
|
* @returns number
|
|
3563
3562
|
*/
|
|
3564
|
-
|
|
3563
|
+
D(this, "storeSlide", async (r) => {
|
|
3565
3564
|
const c = X(r), l = {
|
|
3566
3565
|
id: r.id,
|
|
3567
3566
|
title: r.data.title || "Not set",
|
|
@@ -3569,37 +3568,37 @@ class Nr {
|
|
|
3569
3568
|
html: r.data.html || "",
|
|
3570
3569
|
css: r.data.css || ""
|
|
3571
3570
|
};
|
|
3572
|
-
return await wt(c, l).then(() => 201).catch((
|
|
3571
|
+
return await wt(c, l).then(() => 201).catch((A) => (console.error("%cstorage", S.STORAGE, M.SLIDE, r, A.message), 400));
|
|
3573
3572
|
});
|
|
3574
3573
|
this.options = r;
|
|
3575
3574
|
}
|
|
3576
3575
|
}
|
|
3577
3576
|
class Br {
|
|
3578
3577
|
constructor(r) {
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3578
|
+
D(this, "subscribers", []);
|
|
3579
|
+
D(this, "options");
|
|
3580
|
+
D(this, "getCloud", async (r) => {
|
|
3582
3581
|
const c = X(r);
|
|
3583
3582
|
try {
|
|
3584
3583
|
return localStorage.getObject(c);
|
|
3585
3584
|
} catch (l) {
|
|
3586
|
-
return console.warn("%capi", S.API,
|
|
3585
|
+
return console.warn("%capi", S.API, M.CLOUD, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3587
3586
|
}
|
|
3588
3587
|
});
|
|
3589
|
-
|
|
3588
|
+
D(this, "getSeries", async (r) => {
|
|
3590
3589
|
const c = X(r);
|
|
3591
3590
|
try {
|
|
3592
3591
|
return localStorage.getObject(c);
|
|
3593
3592
|
} catch (l) {
|
|
3594
|
-
return console.warn("%capi", S.API,
|
|
3593
|
+
return console.warn("%capi", S.API, M.SERIES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3595
3594
|
}
|
|
3596
3595
|
});
|
|
3597
|
-
|
|
3596
|
+
D(this, "getMessages", async (r) => {
|
|
3598
3597
|
const c = X(r);
|
|
3599
3598
|
try {
|
|
3600
3599
|
return localStorage.getObject(c);
|
|
3601
3600
|
} catch (l) {
|
|
3602
|
-
return console.warn("%capi", S.API,
|
|
3601
|
+
return console.warn("%capi", S.API, M.MESSAGES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3603
3602
|
}
|
|
3604
3603
|
});
|
|
3605
3604
|
/**
|
|
@@ -3608,12 +3607,12 @@ class Br {
|
|
|
3608
3607
|
* @param data
|
|
3609
3608
|
* @returns number
|
|
3610
3609
|
*/
|
|
3611
|
-
|
|
3610
|
+
D(this, "setCloud", async (r, c) => {
|
|
3612
3611
|
const l = X(r);
|
|
3613
3612
|
try {
|
|
3614
3613
|
return localStorage.setObject(l, c), 201;
|
|
3615
|
-
} catch (
|
|
3616
|
-
return console.error("%cstorage", S.STORAGE,
|
|
3614
|
+
} catch (A) {
|
|
3615
|
+
return console.error("%cstorage", S.STORAGE, M.CLOUD, r, A), 400;
|
|
3617
3616
|
}
|
|
3618
3617
|
});
|
|
3619
3618
|
/**
|
|
@@ -3622,12 +3621,12 @@ class Br {
|
|
|
3622
3621
|
* @param data
|
|
3623
3622
|
* @returns number
|
|
3624
3623
|
*/
|
|
3625
|
-
|
|
3624
|
+
D(this, "setSeries", async (r, c) => {
|
|
3626
3625
|
const l = X(r);
|
|
3627
3626
|
try {
|
|
3628
3627
|
return localStorage.setObject(l, c), 201;
|
|
3629
|
-
} catch (
|
|
3630
|
-
return console.error("%cstorage", S.STORAGE,
|
|
3628
|
+
} catch (A) {
|
|
3629
|
+
return console.error("%cstorage", S.STORAGE, M.SERIES, r, A), 400;
|
|
3631
3630
|
}
|
|
3632
3631
|
});
|
|
3633
3632
|
/**
|
|
@@ -3636,24 +3635,24 @@ class Br {
|
|
|
3636
3635
|
* @param data
|
|
3637
3636
|
* @returns number
|
|
3638
3637
|
*/
|
|
3639
|
-
|
|
3638
|
+
D(this, "setMessages", async (r, c) => {
|
|
3640
3639
|
const l = X(r);
|
|
3641
3640
|
try {
|
|
3642
3641
|
return localStorage.setObject(l, c), 200;
|
|
3643
|
-
} catch (
|
|
3644
|
-
return console.error("%cstorage", S.STORAGE,
|
|
3642
|
+
} catch (A) {
|
|
3643
|
+
return console.error("%cstorage", S.STORAGE, M.MESSAGES, r, A), 400;
|
|
3645
3644
|
}
|
|
3646
3645
|
});
|
|
3647
|
-
|
|
3648
|
-
|
|
3646
|
+
D(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((c) => c(0))));
|
|
3647
|
+
D(this, "hideMessage", async (r, c) => {
|
|
3649
3648
|
console.debug(`hideMessage ${r} ${c} not implemented for ${this.options.storage}`);
|
|
3650
3649
|
});
|
|
3651
|
-
|
|
3650
|
+
D(this, "setWidget", async (r) => {
|
|
3652
3651
|
const c = `widget.${r.widget}`;
|
|
3653
3652
|
try {
|
|
3654
3653
|
return localStorage.setObject(c, r), 201;
|
|
3655
3654
|
} catch (l) {
|
|
3656
|
-
return console.error("%cstorage", S.STORAGE,
|
|
3655
|
+
return console.error("%cstorage", S.STORAGE, M.WIDGET, r, l), 400;
|
|
3657
3656
|
}
|
|
3658
3657
|
});
|
|
3659
3658
|
/**
|
|
@@ -3661,7 +3660,7 @@ class Br {
|
|
|
3661
3660
|
* @param query IQuery
|
|
3662
3661
|
* @returns null
|
|
3663
3662
|
*/
|
|
3664
|
-
|
|
3663
|
+
D(this, "subscribe", (r) => (r = nt(r), r.type === M.MESSAGES && (r = _t(this.options, r)), this.subscribers.filter(
|
|
3665
3664
|
(l) => l.widget === r.widget
|
|
3666
3665
|
).length || (console.debug(
|
|
3667
3666
|
"%cstorage%c %csubscribe",
|
|
@@ -3675,15 +3674,15 @@ class Br {
|
|
|
3675
3674
|
* Get current subscribers
|
|
3676
3675
|
* @returns IQuery[]
|
|
3677
3676
|
*/
|
|
3678
|
-
|
|
3679
|
-
|
|
3677
|
+
D(this, "getSubscribers", async () => await new Promise((r) => r(this.subscribers)));
|
|
3678
|
+
D(this, "loadSlide", async (r) => {
|
|
3680
3679
|
try {
|
|
3681
3680
|
return localStorage.getObject(`${r.type}.${r.id}`);
|
|
3682
3681
|
} catch (c) {
|
|
3683
|
-
return console.warn("%capi", S.API,
|
|
3682
|
+
return console.warn("%capi", S.API, M.SLIDE, r.id, c), { data: null, message: "Slide Load error", success: !1 };
|
|
3684
3683
|
}
|
|
3685
3684
|
});
|
|
3686
|
-
|
|
3685
|
+
D(this, "storeSlide", async (r) => {
|
|
3687
3686
|
try {
|
|
3688
3687
|
return localStorage.setObject(`${r.type}.${r.id}`, {
|
|
3689
3688
|
id: r.id,
|
|
@@ -3693,7 +3692,7 @@ class Br {
|
|
|
3693
3692
|
css: r.data.css || ""
|
|
3694
3693
|
}), 201;
|
|
3695
3694
|
} catch (c) {
|
|
3696
|
-
return console.error("%cstorage", S.STORAGE,
|
|
3695
|
+
return console.error("%cstorage", S.STORAGE, M.SLIDE, r, c), 400;
|
|
3697
3696
|
}
|
|
3698
3697
|
});
|
|
3699
3698
|
this.options = r, Storage.prototype.setObject = function(c, l) {
|
|
@@ -3706,30 +3705,30 @@ class Br {
|
|
|
3706
3705
|
}
|
|
3707
3706
|
class Lr {
|
|
3708
3707
|
constructor(r) {
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3708
|
+
D(this, "subscribers", []);
|
|
3709
|
+
D(this, "options");
|
|
3710
|
+
D(this, "getCloud", async (r) => {
|
|
3712
3711
|
const c = X(r);
|
|
3713
3712
|
try {
|
|
3714
3713
|
return sessionStorage.getObject(c);
|
|
3715
3714
|
} catch (l) {
|
|
3716
|
-
return console.warn("%capi", S.API,
|
|
3715
|
+
return console.warn("%capi", S.API, M.CLOUD, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3717
3716
|
}
|
|
3718
3717
|
});
|
|
3719
|
-
|
|
3718
|
+
D(this, "getSeries", async (r) => {
|
|
3720
3719
|
const c = X(r);
|
|
3721
3720
|
try {
|
|
3722
3721
|
return sessionStorage.getObject(c);
|
|
3723
3722
|
} catch (l) {
|
|
3724
|
-
return console.warn("%capi", S.API,
|
|
3723
|
+
return console.warn("%capi", S.API, M.SERIES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3725
3724
|
}
|
|
3726
3725
|
});
|
|
3727
|
-
|
|
3726
|
+
D(this, "getMessages", async (r) => {
|
|
3728
3727
|
const c = X(r);
|
|
3729
3728
|
try {
|
|
3730
3729
|
return sessionStorage.getObject(c);
|
|
3731
3730
|
} catch (l) {
|
|
3732
|
-
return console.warn("%capi", S.API,
|
|
3731
|
+
return console.warn("%capi", S.API, M.MESSAGES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3733
3732
|
}
|
|
3734
3733
|
});
|
|
3735
3734
|
/**
|
|
@@ -3738,12 +3737,12 @@ class Lr {
|
|
|
3738
3737
|
* @param data
|
|
3739
3738
|
* @returns number
|
|
3740
3739
|
*/
|
|
3741
|
-
|
|
3740
|
+
D(this, "setCloud", async (r, c) => {
|
|
3742
3741
|
const l = X(r);
|
|
3743
3742
|
try {
|
|
3744
3743
|
return sessionStorage.setObject(l, c), 201;
|
|
3745
|
-
} catch (
|
|
3746
|
-
return console.error("%cstorage", S.STORAGE,
|
|
3744
|
+
} catch (A) {
|
|
3745
|
+
return console.error("%cstorage", S.STORAGE, M.CLOUD, r, A), 400;
|
|
3747
3746
|
}
|
|
3748
3747
|
});
|
|
3749
3748
|
/**
|
|
@@ -3752,12 +3751,12 @@ class Lr {
|
|
|
3752
3751
|
* @param data
|
|
3753
3752
|
* @returns number
|
|
3754
3753
|
*/
|
|
3755
|
-
|
|
3754
|
+
D(this, "setSeries", async (r, c) => {
|
|
3756
3755
|
const l = X(r);
|
|
3757
3756
|
try {
|
|
3758
3757
|
return sessionStorage.setObject(l, c), 201;
|
|
3759
|
-
} catch (
|
|
3760
|
-
return console.error("%cstorage", S.STORAGE,
|
|
3758
|
+
} catch (A) {
|
|
3759
|
+
return console.error("%cstorage", S.STORAGE, M.SERIES, r, A), 400;
|
|
3761
3760
|
}
|
|
3762
3761
|
});
|
|
3763
3762
|
/**
|
|
@@ -3766,24 +3765,24 @@ class Lr {
|
|
|
3766
3765
|
* @param data
|
|
3767
3766
|
* @returns number
|
|
3768
3767
|
*/
|
|
3769
|
-
|
|
3768
|
+
D(this, "setMessages", async (r, c) => {
|
|
3770
3769
|
const l = X(r);
|
|
3771
3770
|
try {
|
|
3772
3771
|
return sessionStorage.setObject(l, c), 200;
|
|
3773
|
-
} catch (
|
|
3774
|
-
return console.error("%cstorage", S.STORAGE,
|
|
3772
|
+
} catch (A) {
|
|
3773
|
+
return console.error("%cstorage", S.STORAGE, M.MESSAGES, r, A), 400;
|
|
3775
3774
|
}
|
|
3776
3775
|
});
|
|
3777
|
-
|
|
3778
|
-
|
|
3776
|
+
D(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((c) => c(0))));
|
|
3777
|
+
D(this, "hideMessage", async (r, c) => {
|
|
3779
3778
|
console.debug(`hideMessage ${r} ${c} not implemented for ${this.options.storage}`);
|
|
3780
3779
|
});
|
|
3781
|
-
|
|
3780
|
+
D(this, "setWidget", async (r) => {
|
|
3782
3781
|
const c = `widget.${r.widget}`;
|
|
3783
3782
|
try {
|
|
3784
3783
|
return sessionStorage.setObject(c, r), 201;
|
|
3785
3784
|
} catch (l) {
|
|
3786
|
-
return console.error("%cstorage", S.STORAGE,
|
|
3785
|
+
return console.error("%cstorage", S.STORAGE, M.WIDGET, r, l), 400;
|
|
3787
3786
|
}
|
|
3788
3787
|
});
|
|
3789
3788
|
/**
|
|
@@ -3791,7 +3790,7 @@ class Lr {
|
|
|
3791
3790
|
* @param query IQuery
|
|
3792
3791
|
* @returns null
|
|
3793
3792
|
*/
|
|
3794
|
-
|
|
3793
|
+
D(this, "subscribe", (r) => (r = nt(r), r.type === M.MESSAGES && (r = _t(this.options, r)), this.subscribers.filter(
|
|
3795
3794
|
(l) => l.widget === r.widget
|
|
3796
3795
|
).length || (console.debug(
|
|
3797
3796
|
"%cstorage%c %csubscribe",
|
|
@@ -3805,12 +3804,12 @@ class Lr {
|
|
|
3805
3804
|
* Get current subscribers
|
|
3806
3805
|
* @returns IQuery[]
|
|
3807
3806
|
*/
|
|
3808
|
-
|
|
3809
|
-
|
|
3807
|
+
D(this, "getSubscribers", async () => await new Promise((r) => r(this.subscribers)));
|
|
3808
|
+
D(this, "loadSlide", async (r) => {
|
|
3810
3809
|
try {
|
|
3811
3810
|
return sessionStorage.getObject(`${r.type}.${r.id}`);
|
|
3812
3811
|
} catch (c) {
|
|
3813
|
-
return console.warn("%capi", S.API,
|
|
3812
|
+
return console.warn("%capi", S.API, M.SLIDE, r.id, c), { data: null, message: "Store Load error", success: !1 };
|
|
3814
3813
|
}
|
|
3815
3814
|
});
|
|
3816
3815
|
/**
|
|
@@ -3818,7 +3817,7 @@ class Lr {
|
|
|
3818
3817
|
* @param query IQuery
|
|
3819
3818
|
* @returns number
|
|
3820
3819
|
*/
|
|
3821
|
-
|
|
3820
|
+
D(this, "storeSlide", async (r) => {
|
|
3822
3821
|
try {
|
|
3823
3822
|
return sessionStorage.setObject(`${r.type}.${r.id}`, {
|
|
3824
3823
|
id: r.id,
|
|
@@ -3828,7 +3827,7 @@ class Lr {
|
|
|
3828
3827
|
css: r.data.css || ""
|
|
3829
3828
|
}), 200;
|
|
3830
3829
|
} catch (c) {
|
|
3831
|
-
return console.error("%cstorage", S.STORAGE,
|
|
3830
|
+
return console.error("%cstorage", S.STORAGE, M.SLIDE, r, c), 400;
|
|
3832
3831
|
}
|
|
3833
3832
|
});
|
|
3834
3833
|
this.options = r, Storage.prototype.setObject = function(c, l) {
|
|
@@ -3841,30 +3840,30 @@ class Lr {
|
|
|
3841
3840
|
}
|
|
3842
3841
|
class Gr {
|
|
3843
3842
|
constructor(r) {
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3843
|
+
D(this, "subscribers", []);
|
|
3844
|
+
D(this, "options");
|
|
3845
|
+
D(this, "getCloud", async (r) => {
|
|
3847
3846
|
const c = X(r);
|
|
3848
3847
|
try {
|
|
3849
3848
|
return window.BuzzCasting.WidgetData[c];
|
|
3850
3849
|
} catch (l) {
|
|
3851
|
-
return console.warn("%capi", S.API,
|
|
3850
|
+
return console.warn("%capi", S.API, M.CLOUD, r.slide, r.widget, l), { data: null, message: "Cloud Data error", success: !1 };
|
|
3852
3851
|
}
|
|
3853
3852
|
});
|
|
3854
|
-
|
|
3853
|
+
D(this, "getSeries", async (r) => {
|
|
3855
3854
|
const c = X(r);
|
|
3856
3855
|
try {
|
|
3857
3856
|
return window.BuzzCasting.WidgetData[c];
|
|
3858
3857
|
} catch (l) {
|
|
3859
|
-
return console.warn("%capi", S.API,
|
|
3858
|
+
return console.warn("%capi", S.API, M.SERIES, r.slide, r.widget, l), { data: null, message: "Series Data error", success: !1 };
|
|
3860
3859
|
}
|
|
3861
3860
|
});
|
|
3862
|
-
|
|
3861
|
+
D(this, "getMessages", async (r) => {
|
|
3863
3862
|
const c = X(r);
|
|
3864
3863
|
try {
|
|
3865
3864
|
return window.BuzzCasting.WidgetData[c];
|
|
3866
3865
|
} catch (l) {
|
|
3867
|
-
return console.warn("%capi", S.API,
|
|
3866
|
+
return console.warn("%capi", S.API, M.MESSAGES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3868
3867
|
}
|
|
3869
3868
|
});
|
|
3870
3869
|
/**
|
|
@@ -3873,12 +3872,12 @@ class Gr {
|
|
|
3873
3872
|
* @param data
|
|
3874
3873
|
* @returns number
|
|
3875
3874
|
*/
|
|
3876
|
-
|
|
3875
|
+
D(this, "setCloud", async (r, c) => {
|
|
3877
3876
|
const l = X(r);
|
|
3878
3877
|
try {
|
|
3879
3878
|
return window.BuzzCasting.WidgetData[l] = c, 201;
|
|
3880
|
-
} catch (
|
|
3881
|
-
return console.error("%cstorage", S.STORAGE, "set", r,
|
|
3879
|
+
} catch (A) {
|
|
3880
|
+
return console.error("%cstorage", S.STORAGE, "set", r, A), 400;
|
|
3882
3881
|
}
|
|
3883
3882
|
});
|
|
3884
3883
|
/**
|
|
@@ -3887,12 +3886,12 @@ class Gr {
|
|
|
3887
3886
|
* @param data
|
|
3888
3887
|
* @returns number
|
|
3889
3888
|
*/
|
|
3890
|
-
|
|
3889
|
+
D(this, "setSeries", async (r, c) => {
|
|
3891
3890
|
const l = X(r);
|
|
3892
3891
|
try {
|
|
3893
3892
|
return window.BuzzCasting.WidgetData[l] = c, 201;
|
|
3894
|
-
} catch (
|
|
3895
|
-
return console.error("%cstorage", S.STORAGE, "set", r,
|
|
3893
|
+
} catch (A) {
|
|
3894
|
+
return console.error("%cstorage", S.STORAGE, "set", r, A), 400;
|
|
3896
3895
|
}
|
|
3897
3896
|
});
|
|
3898
3897
|
/**
|
|
@@ -3901,24 +3900,24 @@ class Gr {
|
|
|
3901
3900
|
* @param data
|
|
3902
3901
|
* @returns number
|
|
3903
3902
|
*/
|
|
3904
|
-
|
|
3903
|
+
D(this, "setMessages", async (r, c) => {
|
|
3905
3904
|
const l = X(r);
|
|
3906
3905
|
try {
|
|
3907
3906
|
return window.BuzzCasting.WidgetData[l] = c, 201;
|
|
3908
|
-
} catch (
|
|
3909
|
-
return console.error("%cstorage", S.STORAGE, "set", r,
|
|
3907
|
+
} catch (A) {
|
|
3908
|
+
return console.error("%cstorage", S.STORAGE, "set", r, A), 400;
|
|
3910
3909
|
}
|
|
3911
3910
|
});
|
|
3912
|
-
|
|
3913
|
-
|
|
3911
|
+
D(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((c) => c(0))));
|
|
3912
|
+
D(this, "hideMessage", async (r, c) => {
|
|
3914
3913
|
console.debug(`hideMessage ${r} ${c} not implemented for ${this.options.storage}`);
|
|
3915
3914
|
});
|
|
3916
|
-
|
|
3915
|
+
D(this, "setWidget", async (r) => {
|
|
3917
3916
|
const c = `widget.${r.widget}`;
|
|
3918
3917
|
try {
|
|
3919
3918
|
return window.BuzzCasting.WidgetData[c] = r, 201;
|
|
3920
3919
|
} catch (l) {
|
|
3921
|
-
return console.error("%cstorage", S.STORAGE,
|
|
3920
|
+
return console.error("%cstorage", S.STORAGE, M.WIDGET, r, l), 400;
|
|
3922
3921
|
}
|
|
3923
3922
|
});
|
|
3924
3923
|
/**
|
|
@@ -3926,7 +3925,7 @@ class Gr {
|
|
|
3926
3925
|
* @param query IQuery
|
|
3927
3926
|
* @returns null
|
|
3928
3927
|
*/
|
|
3929
|
-
|
|
3928
|
+
D(this, "subscribe", (r) => (r = nt(r), r.type === M.MESSAGES && (r = _t(this.options, r)), this.subscribers.filter(
|
|
3930
3929
|
(l) => l.widget === r.widget
|
|
3931
3930
|
).length || (console.debug(
|
|
3932
3931
|
"%cstorage%c %csubscribe",
|
|
@@ -3940,15 +3939,15 @@ class Gr {
|
|
|
3940
3939
|
* Get current subscribers
|
|
3941
3940
|
* @returns IQuery[]
|
|
3942
3941
|
*/
|
|
3943
|
-
|
|
3944
|
-
|
|
3942
|
+
D(this, "getSubscribers", async () => await new Promise((r) => r(this.subscribers)));
|
|
3943
|
+
D(this, "loadSlide", async (r) => {
|
|
3945
3944
|
try {
|
|
3946
3945
|
return window.BuzzCasting.SlideData[r.id];
|
|
3947
3946
|
} catch (c) {
|
|
3948
|
-
return console.warn("%capi", S.API,
|
|
3947
|
+
return console.warn("%capi", S.API, M.SLIDE, r.id, c), { data: null, message: "Slide Load error", success: !1 };
|
|
3949
3948
|
}
|
|
3950
3949
|
});
|
|
3951
|
-
|
|
3950
|
+
D(this, "storeSlide", async (r) => {
|
|
3952
3951
|
try {
|
|
3953
3952
|
return window.BuzzCasting.SlideData[r.id] = {
|
|
3954
3953
|
id: r.slide,
|
|
@@ -3958,7 +3957,7 @@ class Gr {
|
|
|
3958
3957
|
css: r.data.css || ""
|
|
3959
3958
|
}, 201;
|
|
3960
3959
|
} catch (c) {
|
|
3961
|
-
return console.error("%cstorage", S.STORAGE,
|
|
3960
|
+
return console.error("%cstorage", S.STORAGE, M.SLIDE, r, c), 400;
|
|
3962
3961
|
}
|
|
3963
3962
|
});
|
|
3964
3963
|
this.options = r, window.BuzzCasting.WidgetData = /* @__PURE__ */ new Set();
|
|
@@ -3974,10 +3973,10 @@ function Gi(f) {
|
|
|
3974
3973
|
let r = "", c = "", l = {
|
|
3975
3974
|
backgroundImage: ""
|
|
3976
3975
|
};
|
|
3977
|
-
return typeof f.media < "u" && f.media.forEach((
|
|
3978
|
-
(
|
|
3979
|
-
backgroundImage: `url(${
|
|
3980
|
-
}, c =
|
|
3976
|
+
return typeof f.media < "u" && f.media.forEach((A) => {
|
|
3977
|
+
(A.type === "photo" || A.type === "image") && (l = {
|
|
3978
|
+
backgroundImage: `url(${A.url})`
|
|
3979
|
+
}, c = A.url), A.type === "video" && (r = A.url);
|
|
3981
3980
|
}), {
|
|
3982
3981
|
image: c,
|
|
3983
3982
|
background: l || null,
|
|
@@ -4062,39 +4061,39 @@ function ji(f, r) {
|
|
|
4062
4061
|
return f;
|
|
4063
4062
|
}
|
|
4064
4063
|
function Oe(f, r) {
|
|
4065
|
-
let c, l,
|
|
4064
|
+
let c, l, A;
|
|
4066
4065
|
if (r.length === 0)
|
|
4067
4066
|
return f;
|
|
4068
|
-
for (c = 0,
|
|
4067
|
+
for (c = 0, A = r.length; c < A; c++)
|
|
4069
4068
|
l = r.charCodeAt(c), f = (f << 5) - f + l, f |= 0;
|
|
4070
4069
|
return f < 0 ? f * -2 : f;
|
|
4071
4070
|
}
|
|
4072
4071
|
function Mi(f, r, c) {
|
|
4073
4072
|
return Object.keys(r).sort().reduce(l, f);
|
|
4074
|
-
function l(
|
|
4075
|
-
return $r(
|
|
4073
|
+
function l(A, k) {
|
|
4074
|
+
return $r(A, r[k], k, c);
|
|
4076
4075
|
}
|
|
4077
4076
|
}
|
|
4078
4077
|
function $r(f, r, c, l) {
|
|
4079
|
-
const
|
|
4078
|
+
const A = Oe(Oe(Oe(f, c), Ki(r)), typeof r);
|
|
4080
4079
|
if (r === null)
|
|
4081
|
-
return Oe(
|
|
4080
|
+
return Oe(A, "null");
|
|
4082
4081
|
if (r === void 0)
|
|
4083
|
-
return Oe(
|
|
4082
|
+
return Oe(A, "undefined");
|
|
4084
4083
|
if (typeof r == "object" || typeof r == "function") {
|
|
4085
4084
|
if (l.includes(r))
|
|
4086
|
-
return Oe(
|
|
4085
|
+
return Oe(A, `[Circular]${c}`);
|
|
4087
4086
|
l.push(r);
|
|
4088
|
-
const
|
|
4087
|
+
const k = Mi(A, r, l);
|
|
4089
4088
|
if (!("valueOf" in r) || typeof r.valueOf != "function")
|
|
4090
|
-
return
|
|
4089
|
+
return k;
|
|
4091
4090
|
try {
|
|
4092
|
-
return Oe(
|
|
4093
|
-
} catch (
|
|
4094
|
-
return Oe(
|
|
4091
|
+
return Oe(k, String(r.valueOf()));
|
|
4092
|
+
} catch (N) {
|
|
4093
|
+
return Oe(k, `[valueOf exception]${N.stack || N.message}`);
|
|
4095
4094
|
}
|
|
4096
4095
|
}
|
|
4097
|
-
return Oe(
|
|
4096
|
+
return Oe(A, r.toString());
|
|
4098
4097
|
}
|
|
4099
4098
|
function Ki(f) {
|
|
4100
4099
|
return Object.prototype.toString.call(f);
|
|
@@ -4128,10 +4127,10 @@ function Yi(f, r) {
|
|
|
4128
4127
|
{ value: 1e15, symbol: "P" },
|
|
4129
4128
|
{ value: 1e18, symbol: "E" }
|
|
4130
4129
|
], l = /\.0+$|(\.\d*[1-9])0+$/;
|
|
4131
|
-
let
|
|
4132
|
-
for (
|
|
4130
|
+
let A;
|
|
4131
|
+
for (A = c.length - 1; A > 0 && !(f >= c[A].value); A--)
|
|
4133
4132
|
;
|
|
4134
|
-
return (f / c[
|
|
4133
|
+
return (f / c[A].value).toFixed(r).replace(l, "$1") + c[A].symbol;
|
|
4135
4134
|
}
|
|
4136
4135
|
function Qi(f) {
|
|
4137
4136
|
switch (f.language) {
|
|
@@ -4146,8 +4145,8 @@ function Qi(f) {
|
|
|
4146
4145
|
}
|
|
4147
4146
|
function Xi(f) {
|
|
4148
4147
|
return f.forEach((r) => {
|
|
4149
|
-
var c, l,
|
|
4150
|
-
if (r.content = ((c = r.content) == null ? void 0 : c.replace(/(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)((\?.*)?)/g, "")) || "", r.sender !== null ? ((((l = r.sender) == null ? void 0 : l.title) === "Unknown author" || ((
|
|
4148
|
+
var c, l, A, k, N;
|
|
4149
|
+
if (r.content = ((c = r.content) == null ? void 0 : c.replace(/(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)((\?.*)?)/g, "")) || "", r.sender !== null ? ((((l = r.sender) == null ? void 0 : l.title) === "Unknown author" || ((A = r.sender) == null ? void 0 : A.title) === null) && (r.sender.title = ""), ((k = r.sender) == null ? void 0 : k.name) !== "" && r.sender.title === "" && (r.sender.title = r.sender.name), ((N = r.sender) == null ? void 0 : N.name) !== "" && r.channel === "tw" && (r.sender.name = `@${r.sender.name}`)) : r.sender = { title: "", name: "", id: "", avatar: "default", bio: "", location: "", following: 0, verified: 0, listed: 0, followers: 0, favourites: 0, messages: 0, influence: 0 }, r.sender.title === "" && r.link !== "") {
|
|
4151
4150
|
const B = new URL(r.link);
|
|
4152
4151
|
r.sender.title = B.hostname.replace("www.", "");
|
|
4153
4152
|
}
|
|
@@ -4163,66 +4162,67 @@ function Vi(f) {
|
|
|
4163
4162
|
}
|
|
4164
4163
|
class Ji {
|
|
4165
4164
|
constructor(r) {
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4165
|
+
D(this, "sm");
|
|
4166
|
+
D(this, "api");
|
|
4167
|
+
D(this, "bc");
|
|
4168
|
+
D(this, "options");
|
|
4169
|
+
D(this, "update", async (r) => {
|
|
4171
4170
|
if (this.sm === null)
|
|
4172
4171
|
return;
|
|
4173
4172
|
const c = await this.sm.getSubscribers();
|
|
4174
4173
|
if (c.length === 0)
|
|
4175
4174
|
return;
|
|
4176
4175
|
const l = [];
|
|
4177
|
-
r ? l.push(this.api.get(r)) : c == null || c.forEach((
|
|
4178
|
-
l.push(this.api.get(
|
|
4176
|
+
r ? l.push(this.api.get(r)) : c == null || c.forEach((A) => {
|
|
4177
|
+
l.push(this.api.get(A));
|
|
4179
4178
|
}), await Promise.allSettled(l).then(
|
|
4180
|
-
(
|
|
4181
|
-
let
|
|
4182
|
-
if (
|
|
4183
|
-
const B =
|
|
4179
|
+
(A) => A.forEach(async (k) => {
|
|
4180
|
+
let N = 400;
|
|
4181
|
+
if (k.status === "fulfilled") {
|
|
4182
|
+
const B = k.value;
|
|
4184
4183
|
if (this.sm === null)
|
|
4185
4184
|
return 400;
|
|
4186
4185
|
if (B.success === !0) {
|
|
4187
4186
|
const J = this.sm.subscribers.filter(
|
|
4188
|
-
(
|
|
4187
|
+
(ce) => ce.widget === B.query.widget
|
|
4189
4188
|
)[0];
|
|
4190
4189
|
let q = "";
|
|
4191
4190
|
switch (B.query.type) {
|
|
4192
|
-
case
|
|
4193
|
-
|
|
4191
|
+
case M.MESSAGES:
|
|
4192
|
+
let ce = B.data.messages.filter((re) => re.id !== null);
|
|
4193
|
+
if (B.data.messages = ce, q = $n(B.data.messages), J.hash === q)
|
|
4194
4194
|
return console.debug(
|
|
4195
4195
|
"%capi%c %cno updates",
|
|
4196
4196
|
S.API,
|
|
4197
4197
|
S.NONE,
|
|
4198
4198
|
S.NO_UPDATES,
|
|
4199
|
-
|
|
4199
|
+
M.MESSAGES,
|
|
4200
4200
|
B.query.slide,
|
|
4201
4201
|
B.query.widget
|
|
4202
4202
|
), 204;
|
|
4203
|
-
J.hash = q,
|
|
4203
|
+
J.hash = q, N = await this.sm.setMessages(B.query, B);
|
|
4204
4204
|
break;
|
|
4205
|
-
case
|
|
4205
|
+
case M.CLOUD:
|
|
4206
4206
|
q = $n(B.data), J.hash === q ? (console.debug(
|
|
4207
4207
|
"%capi%c %cno updates",
|
|
4208
4208
|
S.API,
|
|
4209
4209
|
S.NONE,
|
|
4210
4210
|
S.NO_UPDATES,
|
|
4211
|
-
|
|
4211
|
+
M.CLOUD,
|
|
4212
4212
|
B.query.slide,
|
|
4213
4213
|
B.query.widget
|
|
4214
|
-
),
|
|
4214
|
+
), N = 204) : (J.hash = q, N = await this.sm.setCloud(B.query, B));
|
|
4215
4215
|
break;
|
|
4216
|
-
case
|
|
4216
|
+
case M.SERIES:
|
|
4217
4217
|
q = $n(B.data), J.hash === q ? (console.debug(
|
|
4218
4218
|
"%capi%c %cno updates",
|
|
4219
4219
|
S.API,
|
|
4220
4220
|
S.NONE,
|
|
4221
4221
|
S.NO_UPDATES,
|
|
4222
|
-
|
|
4222
|
+
M.SERIES,
|
|
4223
4223
|
B.query.slide,
|
|
4224
4224
|
B.query.widget
|
|
4225
|
-
),
|
|
4225
|
+
), N = 204) : (J.hash = q, N = await this.sm.setSeries(B.query, B));
|
|
4226
4226
|
break;
|
|
4227
4227
|
default:
|
|
4228
4228
|
console.warn(
|
|
@@ -4235,8 +4235,8 @@ class Ji {
|
|
|
4235
4235
|
);
|
|
4236
4236
|
}
|
|
4237
4237
|
} else
|
|
4238
|
-
|
|
4239
|
-
switch (
|
|
4238
|
+
N = 401;
|
|
4239
|
+
switch (N) {
|
|
4240
4240
|
case 201:
|
|
4241
4241
|
console.info(
|
|
4242
4242
|
"%capp%c %cbroadcast",
|
|
@@ -4258,7 +4258,7 @@ class Ji {
|
|
|
4258
4258
|
);
|
|
4259
4259
|
break;
|
|
4260
4260
|
}
|
|
4261
|
-
return
|
|
4261
|
+
return N;
|
|
4262
4262
|
} else
|
|
4263
4263
|
return console.warn(
|
|
4264
4264
|
"%capi%c %cstorage",
|
|
@@ -4270,10 +4270,10 @@ class Ji {
|
|
|
4270
4270
|
})
|
|
4271
4271
|
);
|
|
4272
4272
|
});
|
|
4273
|
-
|
|
4273
|
+
D(this, "hide", (r) => {
|
|
4274
4274
|
this.api.hideMessage(r);
|
|
4275
4275
|
});
|
|
4276
|
-
|
|
4276
|
+
D(this, "actions", async (r) => {
|
|
4277
4277
|
var c;
|
|
4278
4278
|
switch (r.data.event) {
|
|
4279
4279
|
case ne.SUBSCRIBE:
|
|
@@ -4291,9 +4291,9 @@ class Ji {
|
|
|
4291
4291
|
break;
|
|
4292
4292
|
}
|
|
4293
4293
|
});
|
|
4294
|
-
|
|
4295
|
-
var l,
|
|
4296
|
-
const r = ((l = this.options) == null ? void 0 : l.retention) || 345600, c = await ((
|
|
4294
|
+
D(this, "cleanMessages", async () => {
|
|
4295
|
+
var l, A;
|
|
4296
|
+
const r = ((l = this.options) == null ? void 0 : l.retention) || 345600, c = await ((A = this.sm) == null ? void 0 : A.cleanMessages(
|
|
4297
4297
|
r
|
|
4298
4298
|
));
|
|
4299
4299
|
console.info(
|
|
@@ -4304,7 +4304,7 @@ class Ji {
|
|
|
4304
4304
|
`${c} messages deleted`
|
|
4305
4305
|
);
|
|
4306
4306
|
});
|
|
4307
|
-
|
|
4307
|
+
D(this, "hideMessage", async (r) => {
|
|
4308
4308
|
var l;
|
|
4309
4309
|
const c = await ((l = this.sm) == null ? void 0 : l.hideMessage(r.id, 0));
|
|
4310
4310
|
return console.info(
|
|
@@ -4315,15 +4315,15 @@ class Ji {
|
|
|
4315
4315
|
`${c} messages hidden`
|
|
4316
4316
|
), await this.api.hideMessage(r);
|
|
4317
4317
|
});
|
|
4318
|
-
|
|
4319
|
-
|
|
4318
|
+
D(this, "hideLabels", async (r) => await this.api.hideLabels(r));
|
|
4319
|
+
D(this, "getSubscribers", async () => {
|
|
4320
4320
|
var r;
|
|
4321
4321
|
return await ((r = this.sm) == null ? void 0 : r.getSubscribers());
|
|
4322
4322
|
});
|
|
4323
|
-
|
|
4324
|
-
|
|
4323
|
+
D(this, "loadSlide", async (r) => await this.api.loadSlide(r));
|
|
4324
|
+
D(this, "storeSlide", async (r) => {
|
|
4325
4325
|
var c;
|
|
4326
|
-
return console.log(r), await ((c = this.sm) == null ? void 0 : c.storeSlide(r).then(async () => r != null && r.update && r.update ? await this.api.storeSlide(r) : new Promise((l,
|
|
4326
|
+
return console.log(r), await ((c = this.sm) == null ? void 0 : c.storeSlide(r).then(async () => r != null && r.update && r.update ? await this.api.storeSlide(r) : new Promise((l, A) => {
|
|
4327
4327
|
l(201);
|
|
4328
4328
|
})));
|
|
4329
4329
|
});
|
|
@@ -4367,15 +4367,15 @@ class Ji {
|
|
|
4367
4367
|
}
|
|
4368
4368
|
class Ni {
|
|
4369
4369
|
constructor(r) {
|
|
4370
|
-
|
|
4370
|
+
D(this, "sm");
|
|
4371
4371
|
/**
|
|
4372
4372
|
* Retieve Cloud Data
|
|
4373
4373
|
* @param query Widgets parameters, type "cloud"
|
|
4374
4374
|
* @returns IResponse
|
|
4375
4375
|
*/
|
|
4376
|
-
|
|
4376
|
+
D(this, "getCloud", async (r) => {
|
|
4377
4377
|
var c;
|
|
4378
|
-
return r.type !==
|
|
4378
|
+
return r.type !== M.CLOUD ? (console.warn(
|
|
4379
4379
|
"%capp%c %get",
|
|
4380
4380
|
S.APP,
|
|
4381
4381
|
S.NONE,
|
|
@@ -4394,9 +4394,9 @@ class Ni {
|
|
|
4394
4394
|
* @param query Widgets parameters, type "messages"
|
|
4395
4395
|
* @returns IResponse
|
|
4396
4396
|
*/
|
|
4397
|
-
|
|
4397
|
+
D(this, "getMessages", async (r) => {
|
|
4398
4398
|
var c;
|
|
4399
|
-
return r.type !==
|
|
4399
|
+
return r.type !== M.MESSAGES ? (console.warn(
|
|
4400
4400
|
"%capp%c %get",
|
|
4401
4401
|
S.APP,
|
|
4402
4402
|
S.NONE,
|
|
@@ -4415,9 +4415,9 @@ class Ni {
|
|
|
4415
4415
|
* @param query Widgets parameters, type "series"
|
|
4416
4416
|
* @returns IResponse
|
|
4417
4417
|
*/
|
|
4418
|
-
|
|
4418
|
+
D(this, "getSeries", async (r) => {
|
|
4419
4419
|
var c;
|
|
4420
|
-
return r.type !==
|
|
4420
|
+
return r.type !== M.SERIES ? (console.warn(
|
|
4421
4421
|
"%capp%c %get",
|
|
4422
4422
|
S.APP,
|
|
4423
4423
|
S.NONE,
|
|
@@ -4459,23 +4459,23 @@ class Zi {
|
|
|
4459
4459
|
* @param selector container for the element - by default buzzcasting-slide (optional)
|
|
4460
4460
|
*/
|
|
4461
4461
|
constructor(r, c, l) {
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4462
|
+
D(this, "storageReader");
|
|
4463
|
+
D(this, "broadcastChannel");
|
|
4464
|
+
D(this, "element");
|
|
4465
|
+
D(this, "query");
|
|
4466
|
+
D(this, "listeners");
|
|
4467
4467
|
/**
|
|
4468
4468
|
* Generic call to any query type
|
|
4469
4469
|
*
|
|
4470
4470
|
* @returns IResponse
|
|
4471
4471
|
*/
|
|
4472
|
-
|
|
4472
|
+
D(this, "getData", async () => {
|
|
4473
4473
|
switch (this.query.type) {
|
|
4474
|
-
case
|
|
4474
|
+
case M.CLOUD:
|
|
4475
4475
|
return await this.getCloud();
|
|
4476
|
-
case
|
|
4476
|
+
case M.MESSAGES:
|
|
4477
4477
|
return await this.getMessages();
|
|
4478
|
-
case
|
|
4478
|
+
case M.SERIES:
|
|
4479
4479
|
return await this.getSeries();
|
|
4480
4480
|
}
|
|
4481
4481
|
return {
|
|
@@ -4489,7 +4489,7 @@ class Zi {
|
|
|
4489
4489
|
*
|
|
4490
4490
|
* @returns IResponse
|
|
4491
4491
|
*/
|
|
4492
|
-
|
|
4492
|
+
D(this, "getCloud", async () => this.query.type !== M.CLOUD ? (console.warn(
|
|
4493
4493
|
"%cstorage%c %cwidget",
|
|
4494
4494
|
S.STORAGE,
|
|
4495
4495
|
S.NONE,
|
|
@@ -4507,7 +4507,7 @@ class Zi {
|
|
|
4507
4507
|
*
|
|
4508
4508
|
* @returns IResponse
|
|
4509
4509
|
*/
|
|
4510
|
-
|
|
4510
|
+
D(this, "getMessages", async () => this.query.type !== M.MESSAGES ? (console.warn(
|
|
4511
4511
|
"%cstorage%c %cwidget",
|
|
4512
4512
|
S.STORAGE,
|
|
4513
4513
|
S.NONE,
|
|
@@ -4525,7 +4525,7 @@ class Zi {
|
|
|
4525
4525
|
*
|
|
4526
4526
|
* @returns IResponse
|
|
4527
4527
|
*/
|
|
4528
|
-
|
|
4528
|
+
D(this, "getSeries", async () => this.query.type !== M.SERIES ? (console.warn(
|
|
4529
4529
|
"%cstorage%c %cwidget",
|
|
4530
4530
|
S.STORAGE,
|
|
4531
4531
|
S.NONE,
|
|
@@ -4544,11 +4544,11 @@ class Zi {
|
|
|
4544
4544
|
*
|
|
4545
4545
|
* @param modal IModal
|
|
4546
4546
|
*/
|
|
4547
|
-
|
|
4547
|
+
D(this, "showModal", (r) => {
|
|
4548
4548
|
const c = Ri(this.element.attributes);
|
|
4549
4549
|
if (Object.prototype.hasOwnProperty.call(c, "data-topics")) {
|
|
4550
|
-
const
|
|
4551
|
-
|
|
4550
|
+
const k = c["data-topics"].split("-");
|
|
4551
|
+
k.length > 1 ? (c["data-widget"] = k[1], c["data-dashboard"] = k[0]) : (c["data-widget"] = k[0], c["data-dashboard"] = this.query.slide);
|
|
4552
4552
|
}
|
|
4553
4553
|
const l = { ...r.props, ...c };
|
|
4554
4554
|
console.debug(
|
|
@@ -4559,7 +4559,7 @@ class Zi {
|
|
|
4559
4559
|
// @ts-expect-error cannot get string type out of IFilteredAttributes props
|
|
4560
4560
|
c["data-widget"]
|
|
4561
4561
|
);
|
|
4562
|
-
const
|
|
4562
|
+
const A = new CustomEvent(ne.SHOW_MODAL, {
|
|
4563
4563
|
detail: {
|
|
4564
4564
|
component: r.showComponent,
|
|
4565
4565
|
props: l,
|
|
@@ -4569,14 +4569,14 @@ class Zi {
|
|
|
4569
4569
|
cancelable: !0,
|
|
4570
4570
|
composed: !0
|
|
4571
4571
|
});
|
|
4572
|
-
window.dispatchEvent(
|
|
4572
|
+
window.dispatchEvent(A);
|
|
4573
4573
|
});
|
|
4574
|
-
var
|
|
4574
|
+
var N;
|
|
4575
4575
|
this.element = r, this.listeners = c, l = typeof l < "u" ? l : "buzzcasting-slide";
|
|
4576
|
-
let
|
|
4577
|
-
|
|
4578
|
-
const
|
|
4579
|
-
this.storageReader = new Ni(
|
|
4576
|
+
let A;
|
|
4577
|
+
A = { ...r.dataset }, delete A.hmr, A.slide = ((N = r.closest(l.toUpperCase())) == null ? void 0 : N.id) ?? `${l} not found`, A = nt(A), this.query = A, Ti(r);
|
|
4578
|
+
const k = window.BuzzCasting.getOptions();
|
|
4579
|
+
this.storageReader = new Ni(k), this.broadcastChannel = new BroadcastChannel(A.slide), this.startListener();
|
|
4580
4580
|
}
|
|
4581
4581
|
addListener(r) {
|
|
4582
4582
|
this.listeners.push(r);
|
|
@@ -4590,8 +4590,8 @@ class Zi {
|
|
|
4590
4590
|
const l = c.data.data;
|
|
4591
4591
|
switch (c.data.event) {
|
|
4592
4592
|
case ne.WIDGET_UPDATE:
|
|
4593
|
-
l.query.slide === r.slide && l.query.widget === r.widget && this.listeners.forEach((
|
|
4594
|
-
|
|
4593
|
+
l.query.slide === r.slide && l.query.widget === r.widget && this.listeners.forEach((A) => {
|
|
4594
|
+
A(c.data.data);
|
|
4595
4595
|
});
|
|
4596
4596
|
break;
|
|
4597
4597
|
case ne.SLIDE_READY:
|
|
@@ -4622,7 +4622,7 @@ class Zi {
|
|
|
4622
4622
|
}
|
|
4623
4623
|
}
|
|
4624
4624
|
export {
|
|
4625
|
-
|
|
4625
|
+
M as API,
|
|
4626
4626
|
Ji as BuzzcastingStorageManager,
|
|
4627
4627
|
Ni as BuzzcastingStorageReader,
|
|
4628
4628
|
S as CSS,
|