buzzcasting-storage 3.0.13 → 3.0.14
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 +855 -826
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var xi = Object.defineProperty;
|
|
2
2
|
var Ai = (d, r, s) => r in d ? xi(d, r, { enumerable: !0, configurable: !0, writable: !0, value: s }) : d[r] = s;
|
|
3
3
|
var k = (d, r, s) => Ai(d, typeof r != "symbol" ? r + "" : r, s);
|
|
4
|
-
var
|
|
5
|
-
const ki = "3.0.
|
|
4
|
+
var N = /* @__PURE__ */ ((d) => (d.MESSAGES = "messages", d.CLOUD = "cloud", d.SERIES = "series", d.TOPICS = "topics", d.WIDGET = "widget", d.WIDGETS = "widgets", d.SLIDE = "slide", d))(N || {}), y = /* @__PURE__ */ ((d) => (d.API = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;", d.APP = "color:white;background-color:navy;padding:0 4px 0 4px;border-radius:5px;", d.BROADCAST = "color:white;background-color:orange;padding:0 4px 0 4px;border-radius:5px;", d.DATA = "color:grey;background-color:lightskyblue;padding:0 4px 0 4px;border-radius:5px;", d.CLOUD = "color:grey;background-color:mistyrose;padding:0 4px 0 4px;border-radius:5px;", d.GET_DATA = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", d.HIDE = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", d.MESSAGES = "color:white;background-color:darkslateblue;padding:0 4px 0 4px;border-radius:5px;", d.NO_UPDATES = "color:grey;border:1px solid grey;padding:0 4px 0 4px;border-radius:5px;", d.NONE = "color:transparent;background-color:transparent;", d.PRESENTATION = "color:white;background-color:darkred;padding:0 4px 0 4px;border-radius:5px;", d.SERIES = "color:grey;background-color:thistle;padding:0 4px 0 4px;border-radius:5px;", d.SLIDE = "color:black;background-color:yellow;padding:0 4px 0 4px;border-radius:5px;", d.STORAGE = "color:black;background-color:cyan;padding:0 4px 0 4px;border-radius:5px;", d.SUBSCRIBE = "color:white;background-color:dodgerblue;padding:0 4px 0 4px;border-radius:5px;", d.WIDGET = "color:gret;background-color:lemonchiffon;padding:0 4px 0 4px;border-radius:5px;", d.WS = "color:white;background-color:green;padding:0 4px 0 4px;border-radius:5px;", d))(y || {}), re = /* @__PURE__ */ ((d) => (d.ADD_SLIDE = "addSlide", d.APP_READY = "appReady", d.API_UPDATE = "apiUpdate", d.APPROVE_MESSAGE = "approveMessage", d.CHANNEL = "channel", d.CLEAN_MESSAGES = "cleanMessages", d.CLOSE_MODAL = "closeModal", d.CLOSE_BUILDER_MODAL = "closeBuilderModal", d.ERROR = "error", d.HIDE_MESSAGE = "hideMessage", d.HIDE_LABELS = "hideLabels", d.MAUPPUT_UPDATE = "layoutUpdate", d.PAUSE_PRESENTATION = "pausePresentation", d.PRESENTATION_READY = "presentationReady", d.PREV_SLIDE = "prevSlide", d.RELOAD_PRESENTATION = "reloadPresentation", d.SHOW_MODAL = "showModal", d.STAR_MESSAGE = "starMessage", d.GOTO_SLIDE = "gotoSlide", d.NEXT_SLIDE = "nextSlide", d.SHOW_BUILDER_MODAL = "showBuilderModal", d.SLIDE_DID_LOAD = "slideDidLoad", d.SLIDE_GOTO = "slideGoto", d.SLIDE_READY = "slideReady", d.SLIDE_LOAD = "loadSlide", d.SLIDE_STORE = "storeSlide", d.SLIDE_TRANSITIONER = "slideTransitioner", d.START_TRANSITIONER = "startTransitioner", d.STORAGE_INIT = "storageInit", d.SUBSCRIBE = "subscribe", d.SUSPEND_ACCOUNT = "suspendAccount", d.REMOVE_CLOUD = "removeCloud", d.UPDATE = "update", d.VERSION = "version", d.WIDGET_UPDATE = "widgetUpdate", d))(re || {}), Zt = /* @__PURE__ */ ((d) => (d.APPROVED = "approved", d.BEFORE = "before", d.DELAYED = "delayed", d.NONE = "none", d.REALTIME = "realtime", d))(Zt || {}), ye = /* @__PURE__ */ ((d) => (d.KEYVAL = "keyval", d.LOCAL = "local", d.SESSION = "session", d.DEXIE = "dexie", d.WINDOW = "window", d))(ye || {});
|
|
5
|
+
const ki = "3.0.13";
|
|
6
6
|
class Di {
|
|
7
7
|
constructor(r) {
|
|
8
8
|
k(this, "options");
|
|
@@ -37,26 +37,26 @@ class Di {
|
|
|
37
37
|
const D = Object.keys(x).length > 0 ? `?${new URLSearchParams(x).toString()}` : "";
|
|
38
38
|
return console.info(
|
|
39
39
|
"%capi%c %cfetch",
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
y.API,
|
|
41
|
+
y.NONE,
|
|
42
|
+
y.GET_DATA,
|
|
43
43
|
r.widget
|
|
44
|
-
), console.debug("%capi%c %cfetch",
|
|
44
|
+
), console.debug("%capi%c %cfetch", y.API, y.NONE, y.GET_DATA, x), await fetch(
|
|
45
45
|
[this.url, "api", s, r.type].join("/") + D,
|
|
46
46
|
{ ...l, method: "get" }
|
|
47
|
-
).then(async (
|
|
48
|
-
if (!
|
|
49
|
-
throw new Error(`${
|
|
50
|
-
return
|
|
51
|
-
}).then((
|
|
47
|
+
).then(async (K) => {
|
|
48
|
+
if (!K.ok)
|
|
49
|
+
throw new Error(`${K.status}`);
|
|
50
|
+
return K;
|
|
51
|
+
}).then((K) => K.json()).then((K) => (K.query = r, K)).catch((K) => ({ success: !1, message: `${K}`, data: null }));
|
|
52
52
|
}
|
|
53
53
|
async hideMessage(r) {
|
|
54
54
|
const { version: s } = this.options, l = this.headers(), x = "?action=visible";
|
|
55
55
|
return console.info(
|
|
56
56
|
"%capi%c %cput",
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
y.API,
|
|
58
|
+
y.NONE,
|
|
59
|
+
y.GET_DATA,
|
|
60
60
|
re.HIDE_MESSAGE,
|
|
61
61
|
r.widget,
|
|
62
62
|
r.id
|
|
@@ -71,32 +71,32 @@ class Di {
|
|
|
71
71
|
}
|
|
72
72
|
async hideLabels(r) {
|
|
73
73
|
const { version: s } = this.options, l = this.formHeaders(), x = new URLSearchParams(), D = r.labels || [];
|
|
74
|
-
for (const [
|
|
75
|
-
x.append(`custom_filters[${
|
|
74
|
+
for (const [K, U] of D.entries())
|
|
75
|
+
x.append(`custom_filters[${K}]`, U);
|
|
76
76
|
return console.info(
|
|
77
77
|
"%capi%c %cput",
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
y.API,
|
|
79
|
+
y.NONE,
|
|
80
|
+
y.GET_DATA,
|
|
81
81
|
re.HIDE_LABELS,
|
|
82
82
|
r.widget,
|
|
83
83
|
D
|
|
84
84
|
), await fetch(
|
|
85
85
|
[this.url, "api", s, r.type, r.widget].join("/"),
|
|
86
86
|
{ ...l, body: x, method: "put" }
|
|
87
|
-
).then((
|
|
88
|
-
if (!
|
|
89
|
-
throw new Error(
|
|
90
|
-
return
|
|
91
|
-
}).then((
|
|
87
|
+
).then((K) => {
|
|
88
|
+
if (!K.ok)
|
|
89
|
+
throw new Error(K.statusText);
|
|
90
|
+
return K;
|
|
91
|
+
}).then((K) => K.json()).catch((K) => ({ succes: !1, message: K, data: [] }));
|
|
92
92
|
}
|
|
93
93
|
async loadSlide(r) {
|
|
94
94
|
const { version: s } = this.options, l = this.headers(), x = Object.assign({}, r);
|
|
95
95
|
return delete x.slide, delete x.type, delete x.hash, console.debug(
|
|
96
96
|
"%capi%c %cloadSlide",
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
y.API,
|
|
98
|
+
y.NONE,
|
|
99
|
+
y.SLIDE,
|
|
100
100
|
re.SLIDE_LOAD,
|
|
101
101
|
r.slide
|
|
102
102
|
), await fetch(
|
|
@@ -121,9 +121,9 @@ class Di {
|
|
|
121
121
|
const x = JSON.stringify(r);
|
|
122
122
|
return console.info(
|
|
123
123
|
"%capi%c %cput",
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
124
|
+
y.API,
|
|
125
|
+
y.NONE,
|
|
126
|
+
y.SLIDE,
|
|
127
127
|
re.SLIDE_STORE,
|
|
128
128
|
r.id
|
|
129
129
|
), await fetch(
|
|
@@ -161,9 +161,9 @@ var Tr = { exports: {} };
|
|
|
161
161
|
for (var i, o = 0, a = t.length; o < a; o++) !i && o in t || ((i = i || Array.prototype.slice.call(t, 0, o))[o] = t[o]);
|
|
162
162
|
return e.concat(i || Array.prototype.slice.call(t));
|
|
163
163
|
}
|
|
164
|
-
var D = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Cr,
|
|
165
|
-
function
|
|
166
|
-
return typeof t != "object" ||
|
|
164
|
+
var D = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Cr, K = Object.keys, U = Array.isArray;
|
|
165
|
+
function M(e, t) {
|
|
166
|
+
return typeof t != "object" || K(t).forEach(function(n) {
|
|
167
167
|
e[n] = t[n];
|
|
168
168
|
}), e;
|
|
169
169
|
}
|
|
@@ -173,13 +173,13 @@ var Tr = { exports: {} };
|
|
|
173
173
|
return ae.call(e, t);
|
|
174
174
|
}
|
|
175
175
|
function le(e, t) {
|
|
176
|
-
typeof t == "function" && (t = t(X(e))), (typeof Reflect > "u" ?
|
|
176
|
+
typeof t == "function" && (t = t(X(e))), (typeof Reflect > "u" ? K : Reflect.ownKeys)(t).forEach(function(n) {
|
|
177
177
|
xe(e, n, t[n]);
|
|
178
178
|
});
|
|
179
179
|
}
|
|
180
180
|
var He = Object.defineProperty;
|
|
181
181
|
function xe(e, t, n, i) {
|
|
182
|
-
He(e, t,
|
|
182
|
+
He(e, t, M(n && ee(n, "get") && typeof n.get == "function" ? { get: n.get, set: n.set, configurable: !0 } : { value: n, configurable: !0, writable: !0 }, i));
|
|
183
183
|
}
|
|
184
184
|
function Ye(e) {
|
|
185
185
|
return { from: function(t) {
|
|
@@ -187,7 +187,7 @@ var Tr = { exports: {} };
|
|
|
187
187
|
} };
|
|
188
188
|
}
|
|
189
189
|
var Ur = Object.getOwnPropertyDescriptor, Fr = [].slice;
|
|
190
|
-
function
|
|
190
|
+
function _t(e, t, n) {
|
|
191
191
|
return Fr.call(e, t, n);
|
|
192
192
|
}
|
|
193
193
|
function zn(e, t) {
|
|
@@ -272,7 +272,7 @@ var Tr = { exports: {} };
|
|
|
272
272
|
return t = e.indexOf(t), 0 <= t && e.splice(t, 1), 0 <= t;
|
|
273
273
|
}
|
|
274
274
|
var Qe = {};
|
|
275
|
-
function
|
|
275
|
+
function Se(e) {
|
|
276
276
|
var t, n, i, o;
|
|
277
277
|
if (arguments.length === 1) {
|
|
278
278
|
if (U(e)) return e.slice();
|
|
@@ -367,9 +367,9 @@ var Tr = { exports: {} };
|
|
|
367
367
|
function Zr(e, t) {
|
|
368
368
|
return e === J ? t : function(n) {
|
|
369
369
|
var i = e.apply(this, arguments);
|
|
370
|
-
|
|
370
|
+
M(n, i);
|
|
371
371
|
var o = this.onsuccess, a = this.onerror;
|
|
372
|
-
return this.onsuccess = null, this.onerror = null, n = t.apply(this, arguments), o && (this.onsuccess = this.onsuccess ? je(o, this.onsuccess) : o), a && (this.onerror = this.onerror ? je(a, this.onerror) : a), i === void 0 ? n === void 0 ? void 0 : n :
|
|
372
|
+
return this.onsuccess = null, this.onerror = null, n = t.apply(this, arguments), o && (this.onsuccess = this.onsuccess ? je(o, this.onsuccess) : o), a && (this.onerror = this.onerror ? je(a, this.onerror) : a), i === void 0 ? n === void 0 ? void 0 : n : M(i, n);
|
|
373
373
|
};
|
|
374
374
|
}
|
|
375
375
|
function qr(e, t) {
|
|
@@ -429,8 +429,8 @@ var Tr = { exports: {} };
|
|
|
429
429
|
var un = { get: function() {
|
|
430
430
|
var e = G, t = Ct;
|
|
431
431
|
function n(i, o) {
|
|
432
|
-
var a = this, c = !e.global && (e !== G || t !== Ct), u = c && !De(), h = new B(function(g,
|
|
433
|
-
dn(a, new er(rr(i, e, c, u), rr(o, e, c, u), g,
|
|
432
|
+
var a = this, c = !e.global && (e !== G || t !== Ct), u = c && !De(), h = new B(function(g, v) {
|
|
433
|
+
dn(a, new er(rr(i, e, c, u), rr(o, e, c, u), g, v, e));
|
|
434
434
|
});
|
|
435
435
|
return this._consoleTask && (h._consoleTask = this._consoleTask), h;
|
|
436
436
|
}
|
|
@@ -550,7 +550,7 @@ var Tr = { exports: {} };
|
|
|
550
550
|
n.then(i, o).finally(clearTimeout.bind(null, a));
|
|
551
551
|
}) : this;
|
|
552
552
|
} }), typeof Symbol < "u" && Symbol.toStringTag && xe(B.prototype, Symbol.toStringTag, "Dexie.Promise"), Ae.env = nr(), le(B, { all: function() {
|
|
553
|
-
var e =
|
|
553
|
+
var e = Se.apply(null, arguments).map(Rt);
|
|
554
554
|
return new B(function(t, n) {
|
|
555
555
|
e.length === 0 && t([]);
|
|
556
556
|
var i = e.length;
|
|
@@ -565,7 +565,7 @@ var Tr = { exports: {} };
|
|
|
565
565
|
e.then(t, n);
|
|
566
566
|
}) : new B(st, !0, e);
|
|
567
567
|
}, reject: Dt, race: function() {
|
|
568
|
-
var e =
|
|
568
|
+
var e = Se.apply(null, arguments).map(Rt);
|
|
569
569
|
return new B(function(t, n) {
|
|
570
570
|
e.map(function(i) {
|
|
571
571
|
return B.resolve(i).then(t, n);
|
|
@@ -602,7 +602,7 @@ var Tr = { exports: {} };
|
|
|
602
602
|
}, t, n, i);
|
|
603
603
|
});
|
|
604
604
|
} }), Ke && (Ke.allSettled && xe(B, "allSettled", function() {
|
|
605
|
-
var e =
|
|
605
|
+
var e = Se.apply(null, arguments).map(Rt);
|
|
606
606
|
return new B(function(t) {
|
|
607
607
|
e.length === 0 && t([]);
|
|
608
608
|
var n = e.length, i = new Array(n);
|
|
@@ -617,7 +617,7 @@ var Tr = { exports: {} };
|
|
|
617
617
|
});
|
|
618
618
|
});
|
|
619
619
|
}), Ke.any && typeof AggregateError < "u" && xe(B, "any", function() {
|
|
620
|
-
var e =
|
|
620
|
+
var e = Se.apply(null, arguments).map(Rt);
|
|
621
621
|
return new B(function(t, n) {
|
|
622
622
|
e.length === 0 && n(new AggregateError([]));
|
|
623
623
|
var i = e.length, o = new Array(i);
|
|
@@ -633,7 +633,7 @@ var Tr = { exports: {} };
|
|
|
633
633
|
var ie = { awaits: 0, echoes: 0, id: 0 }, ni = 0, Pt = [], It = 0, Ct = 0, ri = 0;
|
|
634
634
|
function ke(e, t, n, i) {
|
|
635
635
|
var o = G, a = Object.create(o);
|
|
636
|
-
return a.parent = o, a.ref = 0, a.global = !1, a.id = ++ri, Ae.env, a.env = an ? { Promise: B, PromiseProp: { value: B, configurable: !0, writable: !0 }, all: B.all, race: B.race, allSettled: B.allSettled, any: B.any, resolve: B.resolve, reject: B.reject } : {}, t &&
|
|
636
|
+
return a.parent = o, a.ref = 0, a.global = !1, a.id = ++ri, Ae.env, a.env = an ? { Promise: B, PromiseProp: { value: B, configurable: !0, writable: !0 }, all: B.all, race: B.race, allSettled: B.allSettled, any: B.any, resolve: B.resolve, reject: B.reject } : {}, t && M(a, t), ++o.ref, a.finalize = function() {
|
|
637
637
|
--this.parent.ref || this.parent.finalize();
|
|
638
638
|
}, i = Ge(a, e, n, i), a.ref === 0 && a.finalize(), i;
|
|
639
639
|
}
|
|
@@ -687,7 +687,7 @@ var Tr = { exports: {} };
|
|
|
687
687
|
Promise === Ke && ie.echoes === 0 ? It === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
|
|
688
688
|
}
|
|
689
689
|
("" + ge).indexOf("[native code]") === -1 && (qe = De = J);
|
|
690
|
-
var te = B.reject, $e = "",
|
|
690
|
+
var te = B.reject, $e = "", _e = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", ir = "String expected.", et = [], Tt = "__dbnames", pn = "readonly", gn = "readwrite";
|
|
691
691
|
function Ue(e, t) {
|
|
692
692
|
return e ? t ? function() {
|
|
693
693
|
return e.apply(this, arguments) && t.apply(this, arguments);
|
|
@@ -721,8 +721,8 @@ var Tr = { exports: {} };
|
|
|
721
721
|
case "Array":
|
|
722
722
|
return function(o, a) {
|
|
723
723
|
for (var c = o.length, u = a.length, h = c < u ? c : u, g = 0; g < h; ++g) {
|
|
724
|
-
var
|
|
725
|
-
if (
|
|
724
|
+
var v = Y(o[g], a[g]);
|
|
725
|
+
if (v !== 0) return v;
|
|
726
726
|
}
|
|
727
727
|
return c === u ? 0 : c < u ? -1 : 1;
|
|
728
728
|
}(e, t);
|
|
@@ -740,7 +740,7 @@ var Tr = { exports: {} };
|
|
|
740
740
|
}
|
|
741
741
|
var ur = (Z.prototype._trans = function(e, t, n) {
|
|
742
742
|
var i = this._tx || G.trans, o = this.name, a = me && typeof console < "u" && console.createTask && console.createTask("Dexie: ".concat(e === "readonly" ? "read" : "write", " ").concat(this.name));
|
|
743
|
-
function c(g,
|
|
743
|
+
function c(g, v, f) {
|
|
744
744
|
if (!f.schema[o]) throw new $.NotFound("Table " + o + " not part of transaction");
|
|
745
745
|
return t(f.idbtrans, f);
|
|
746
746
|
}
|
|
@@ -748,37 +748,37 @@ var Tr = { exports: {} };
|
|
|
748
748
|
try {
|
|
749
749
|
var h = i && i.db._novip === this.db._novip ? i === G.trans ? i._promise(e, c, n) : ke(function() {
|
|
750
750
|
return i._promise(e, c, n);
|
|
751
|
-
}, { trans: i, transless: G.transless || G }) : function g(
|
|
752
|
-
if (
|
|
753
|
-
var
|
|
751
|
+
}, { trans: i, transless: G.transless || G }) : function g(v, f, S, p) {
|
|
752
|
+
if (v.idbdb && (v._state.openComplete || G.letThrough || v._vip)) {
|
|
753
|
+
var b = v._createTransaction(f, S, v._dbSchema);
|
|
754
754
|
try {
|
|
755
|
-
|
|
755
|
+
b.create(), v._state.PR1398_maxLoop = 3;
|
|
756
756
|
} catch (w) {
|
|
757
|
-
return w.name === rn.InvalidState &&
|
|
758
|
-
return g(
|
|
757
|
+
return w.name === rn.InvalidState && v.isOpen() && 0 < --v._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), v.close({ disableAutoOpen: !1 }), v.open().then(function() {
|
|
758
|
+
return g(v, f, S, p);
|
|
759
759
|
})) : te(w);
|
|
760
760
|
}
|
|
761
|
-
return
|
|
761
|
+
return b._promise(f, function(w, m) {
|
|
762
762
|
return ke(function() {
|
|
763
|
-
return G.trans =
|
|
763
|
+
return G.trans = b, p(w, m, b);
|
|
764
764
|
});
|
|
765
765
|
}).then(function(w) {
|
|
766
766
|
if (f === "readwrite") try {
|
|
767
|
-
|
|
767
|
+
b.idbtrans.commit();
|
|
768
768
|
} catch {
|
|
769
769
|
}
|
|
770
|
-
return f === "readonly" ? w :
|
|
770
|
+
return f === "readonly" ? w : b._completion.then(function() {
|
|
771
771
|
return w;
|
|
772
772
|
});
|
|
773
773
|
});
|
|
774
774
|
}
|
|
775
|
-
if (
|
|
776
|
-
if (!
|
|
777
|
-
if (!
|
|
778
|
-
|
|
775
|
+
if (v._state.openComplete) return te(new $.DatabaseClosed(v._state.dbOpenError));
|
|
776
|
+
if (!v._state.isBeingOpened) {
|
|
777
|
+
if (!v._state.autoOpen) return te(new $.DatabaseClosed());
|
|
778
|
+
v.open().catch(J);
|
|
779
779
|
}
|
|
780
|
-
return
|
|
781
|
-
return g(
|
|
780
|
+
return v._state.dbReadyPromise.then(function() {
|
|
781
|
+
return g(v, f, S, p);
|
|
782
782
|
});
|
|
783
783
|
}(this.db, e, [this.name], c);
|
|
784
784
|
return a && (h._consoleTask = a, h = h.catch(function(g) {
|
|
@@ -797,7 +797,7 @@ var Tr = { exports: {} };
|
|
|
797
797
|
}, Z.prototype.where = function(e) {
|
|
798
798
|
if (typeof e == "string") return new this.db.WhereClause(this, e);
|
|
799
799
|
if (U(e)) return new this.db.WhereClause(this, "[".concat(e.join("+"), "]"));
|
|
800
|
-
var t =
|
|
800
|
+
var t = K(e);
|
|
801
801
|
if (t.length === 1) return this.where(t[0]).equals(e[t[0]]);
|
|
802
802
|
var n = this.schema.indexes.concat(this.schema.primKey).filter(function(u) {
|
|
803
803
|
if (u.compound && t.every(function(g) {
|
|
@@ -822,14 +822,14 @@ var Tr = { exports: {} };
|
|
|
822
822
|
return Y(u, h) === 0;
|
|
823
823
|
}
|
|
824
824
|
var c = t.reduce(function(f, h) {
|
|
825
|
-
var g = f[0],
|
|
826
|
-
return [g || f, g || !f ? Ue(
|
|
827
|
-
return p = we(p, h), U(p) && p.some(function(
|
|
828
|
-
return o(
|
|
825
|
+
var g = f[0], v = f[1], f = i[h], S = e[h];
|
|
826
|
+
return [g || f, g || !f ? Ue(v, f && f.multi ? function(p) {
|
|
827
|
+
return p = we(p, h), U(p) && p.some(function(b) {
|
|
828
|
+
return o(S, b);
|
|
829
829
|
});
|
|
830
830
|
} : function(p) {
|
|
831
|
-
return o(
|
|
832
|
-
}) :
|
|
831
|
+
return o(S, we(p, h));
|
|
832
|
+
}) : v];
|
|
833
833
|
}, [null, null]), a = c[0], c = c[1];
|
|
834
834
|
return a ? this.where(a.name).equals(e[a.keyPath]).filter(c) : n ? this.filter(c) : this.where(t).equals("");
|
|
835
835
|
}, Z.prototype.filter = function(e) {
|
|
@@ -857,10 +857,10 @@ var Tr = { exports: {} };
|
|
|
857
857
|
}
|
|
858
858
|
(this.schema.mappedClass = e).prototype instanceof ar && (function(h, g) {
|
|
859
859
|
if (typeof g != "function" && g !== null) throw new TypeError("Class extends value " + String(g) + " is not a constructor or null");
|
|
860
|
-
function
|
|
860
|
+
function v() {
|
|
861
861
|
this.constructor = h;
|
|
862
862
|
}
|
|
863
|
-
s(h, g), h.prototype = g === null ? Object.create(g) : (
|
|
863
|
+
s(h, g), h.prototype = g === null ? Object.create(g) : (v.prototype = g.prototype, new v());
|
|
864
864
|
}(o, t = e), Object.defineProperty(o.prototype, "db", { get: function() {
|
|
865
865
|
return n;
|
|
866
866
|
}, enumerable: !1, configurable: !0 }), o.prototype.table = function() {
|
|
@@ -871,17 +871,17 @@ var Tr = { exports: {} };
|
|
|
871
871
|
});
|
|
872
872
|
function u(h) {
|
|
873
873
|
if (!h) return h;
|
|
874
|
-
var g,
|
|
874
|
+
var g, v = Object.create(e.prototype);
|
|
875
875
|
for (g in h) if (!a.has(g)) try {
|
|
876
|
-
|
|
876
|
+
v[g] = h[g];
|
|
877
877
|
} catch {
|
|
878
878
|
}
|
|
879
|
-
return
|
|
879
|
+
return v;
|
|
880
880
|
}
|
|
881
881
|
return this.schema.readHook && this.hook.reading.unsubscribe(this.schema.readHook), this.schema.readHook = u, this.hook("reading", u), e;
|
|
882
882
|
}, Z.prototype.defineClass = function() {
|
|
883
883
|
return this.mapToClass(function(e) {
|
|
884
|
-
|
|
884
|
+
M(this, e);
|
|
885
885
|
});
|
|
886
886
|
}, Z.prototype.add = function(e, t) {
|
|
887
887
|
var n = this, i = this.schema.primKey, o = i.auto, a = i.keyPath, c = e;
|
|
@@ -941,10 +941,10 @@ var Tr = { exports: {} };
|
|
|
941
941
|
if (g && o) throw new $.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
|
|
942
942
|
if (o && o.length !== e.length) throw new $.InvalidArgument("Arguments objects and keys must have the same length");
|
|
943
943
|
var h = e.length, g = g && u ? e.map(Mt(g)) : e;
|
|
944
|
-
return i.core.mutate({ trans: c, type: "add", keys: o, values: g, wantResults: a }).then(function(
|
|
945
|
-
var f =
|
|
946
|
-
if (f === 0) return a ?
|
|
947
|
-
throw new Je("".concat(i.name, ".bulkAdd(): ").concat(f, " of ").concat(h, " operations failed"),
|
|
944
|
+
return i.core.mutate({ trans: c, type: "add", keys: o, values: g, wantResults: a }).then(function(b) {
|
|
945
|
+
var f = b.numFailures, S = b.results, p = b.lastResult, b = b.failures;
|
|
946
|
+
if (f === 0) return a ? S : p;
|
|
947
|
+
throw new Je("".concat(i.name, ".bulkAdd(): ").concat(f, " of ").concat(h, " operations failed"), b);
|
|
948
948
|
});
|
|
949
949
|
});
|
|
950
950
|
}, Z.prototype.bulkPut = function(e, t, n) {
|
|
@@ -954,10 +954,10 @@ var Tr = { exports: {} };
|
|
|
954
954
|
if (g && o) throw new $.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
|
|
955
955
|
if (o && o.length !== e.length) throw new $.InvalidArgument("Arguments objects and keys must have the same length");
|
|
956
956
|
var h = e.length, g = g && u ? e.map(Mt(g)) : e;
|
|
957
|
-
return i.core.mutate({ trans: c, type: "put", keys: o, values: g, wantResults: a }).then(function(
|
|
958
|
-
var f =
|
|
959
|
-
if (f === 0) return a ?
|
|
960
|
-
throw new Je("".concat(i.name, ".bulkPut(): ").concat(f, " of ").concat(h, " operations failed"),
|
|
957
|
+
return i.core.mutate({ trans: c, type: "put", keys: o, values: g, wantResults: a }).then(function(b) {
|
|
958
|
+
var f = b.numFailures, S = b.results, p = b.lastResult, b = b.failures;
|
|
959
|
+
if (f === 0) return a ? S : p;
|
|
960
|
+
throw new Je("".concat(i.name, ".bulkPut(): ").concat(f, " of ").concat(h, " operations failed"), b);
|
|
961
961
|
});
|
|
962
962
|
});
|
|
963
963
|
}, Z.prototype.bulkUpdate = function(e) {
|
|
@@ -969,27 +969,27 @@ var Tr = { exports: {} };
|
|
|
969
969
|
return this._trans("readwrite", function(c) {
|
|
970
970
|
return n.getMany({ trans: c, keys: i, cache: "clone" }).then(function(u) {
|
|
971
971
|
var h = [], g = [];
|
|
972
|
-
e.forEach(function(f,
|
|
973
|
-
var p = f.key,
|
|
972
|
+
e.forEach(function(f, S) {
|
|
973
|
+
var p = f.key, b = f.changes, w = u[S];
|
|
974
974
|
if (w) {
|
|
975
|
-
for (var
|
|
976
|
-
var E =
|
|
975
|
+
for (var m = 0, _ = Object.keys(b); m < _.length; m++) {
|
|
976
|
+
var E = _[m], O = b[E];
|
|
977
977
|
if (E === t.schema.primKey.keyPath) {
|
|
978
978
|
if (Y(O, p) !== 0) throw new $.Constraint("Cannot update primary key in bulkUpdate()");
|
|
979
979
|
} else fe(w, E, O);
|
|
980
980
|
}
|
|
981
|
-
a.push(
|
|
981
|
+
a.push(S), h.push(p), g.push(w);
|
|
982
982
|
}
|
|
983
983
|
});
|
|
984
|
-
var
|
|
984
|
+
var v = h.length;
|
|
985
985
|
return n.mutate({ trans: c, type: "put", keys: h, values: g, updates: { keys: i, changeSpecs: o } }).then(function(f) {
|
|
986
|
-
var
|
|
987
|
-
if (
|
|
988
|
-
for (var
|
|
989
|
-
var
|
|
990
|
-
E != null && (
|
|
986
|
+
var S = f.numFailures, p = f.failures;
|
|
987
|
+
if (S === 0) return v;
|
|
988
|
+
for (var b = 0, w = Object.keys(p); b < w.length; b++) {
|
|
989
|
+
var m, _ = w[b], E = a[Number(_)];
|
|
990
|
+
E != null && (m = p[_], delete p[_], p[E] = m);
|
|
991
991
|
}
|
|
992
|
-
throw new Je("".concat(t.name, ".bulkUpdate(): ").concat(
|
|
992
|
+
throw new Je("".concat(t.name, ".bulkUpdate(): ").concat(S, " of ").concat(v, " operations failed"), p);
|
|
993
993
|
});
|
|
994
994
|
});
|
|
995
995
|
});
|
|
@@ -1021,25 +1021,25 @@ var Tr = { exports: {} };
|
|
|
1021
1021
|
if (typeof c != "object") {
|
|
1022
1022
|
var g;
|
|
1023
1023
|
u = u || qr;
|
|
1024
|
-
var
|
|
1025
|
-
|
|
1024
|
+
var v = { subscribers: [], fire: h = h || J, subscribe: function(f) {
|
|
1025
|
+
v.subscribers.indexOf(f) === -1 && (v.subscribers.push(f), v.fire = u(v.fire, f));
|
|
1026
1026
|
}, unsubscribe: function(f) {
|
|
1027
|
-
|
|
1028
|
-
return
|
|
1029
|
-
}),
|
|
1027
|
+
v.subscribers = v.subscribers.filter(function(S) {
|
|
1028
|
+
return S !== f;
|
|
1029
|
+
}), v.fire = v.subscribers.reduce(u, h);
|
|
1030
1030
|
} };
|
|
1031
|
-
return n[c] = t[c] =
|
|
1031
|
+
return n[c] = t[c] = v;
|
|
1032
1032
|
}
|
|
1033
|
-
|
|
1034
|
-
var
|
|
1035
|
-
if (U(
|
|
1033
|
+
K(g = c).forEach(function(f) {
|
|
1034
|
+
var S = g[f];
|
|
1035
|
+
if (U(S)) a(f, g[f][0], g[f][1]);
|
|
1036
1036
|
else {
|
|
1037
|
-
if (
|
|
1037
|
+
if (S !== "asap") throw new $.InvalidArgument("Invalid event config");
|
|
1038
1038
|
var p = a(f, at, function() {
|
|
1039
|
-
for (var
|
|
1040
|
-
p.subscribers.forEach(function(
|
|
1039
|
+
for (var b = arguments.length, w = new Array(b); b--; ) w[b] = arguments[b];
|
|
1040
|
+
p.subscribers.forEach(function(m) {
|
|
1041
1041
|
Hn(function() {
|
|
1042
|
-
|
|
1042
|
+
m.apply(null, w);
|
|
1043
1043
|
});
|
|
1044
1044
|
});
|
|
1045
1045
|
});
|
|
@@ -1076,12 +1076,12 @@ var Tr = { exports: {} };
|
|
|
1076
1076
|
var o = e.replayFilter ? Ue(e.filter, e.replayFilter()) : e.filter;
|
|
1077
1077
|
if (e.or) {
|
|
1078
1078
|
var a = {}, c = function(u, h, g) {
|
|
1079
|
-
var
|
|
1080
|
-
o && !o(h, g, function(
|
|
1081
|
-
return h.stop(
|
|
1082
|
-
}, function(
|
|
1083
|
-
return h.fail(
|
|
1084
|
-
}) || ((f = "" + (
|
|
1079
|
+
var v, f;
|
|
1080
|
+
o && !o(h, g, function(S) {
|
|
1081
|
+
return h.stop(S);
|
|
1082
|
+
}, function(S) {
|
|
1083
|
+
return h.fail(S);
|
|
1084
|
+
}) || ((f = "" + (v = h.primaryKey)) == "[object ArrayBuffer]" && (f = "" + new Uint8Array(v)), ee(a, f) || (a[f] = !0, t(u, h, g)));
|
|
1085
1085
|
};
|
|
1086
1086
|
return Promise.all([e.or._iterate(c, n), dr(lr(e, i, n), e.algorithm, c, !e.keysOnly && e.valueMapper)]);
|
|
1087
1087
|
}
|
|
@@ -1152,7 +1152,7 @@ var Tr = { exports: {} };
|
|
|
1152
1152
|
return Nt(this._ctx, e, t, this._ctx.table.core);
|
|
1153
1153
|
}, Q.prototype.clone = function(e) {
|
|
1154
1154
|
var t = Object.create(this.constructor.prototype), n = Object.create(this._ctx);
|
|
1155
|
-
return e &&
|
|
1155
|
+
return e && M(n, e), t._ctx = n, t;
|
|
1156
1156
|
}, Q.prototype.raw = function() {
|
|
1157
1157
|
return this._ctx.valueMapper = null, this;
|
|
1158
1158
|
}, Q.prototype.each = function(e) {
|
|
@@ -1304,52 +1304,52 @@ var Tr = { exports: {} };
|
|
|
1304
1304
|
var t = this, n = this._ctx;
|
|
1305
1305
|
return this._write(function(i) {
|
|
1306
1306
|
var o, a, c;
|
|
1307
|
-
c = typeof e == "function" ? e : (o =
|
|
1308
|
-
for (var
|
|
1309
|
-
var O = o[E], A = e[O], P = we(
|
|
1310
|
-
A instanceof ht ? (fe(
|
|
1307
|
+
c = typeof e == "function" ? e : (o = K(e), a = o.length, function(m) {
|
|
1308
|
+
for (var _ = !1, E = 0; E < a; ++E) {
|
|
1309
|
+
var O = o[E], A = e[O], P = we(m, O);
|
|
1310
|
+
A instanceof ht ? (fe(m, O, A.execute(P)), _ = !0) : P !== A && (fe(m, O, A), _ = !0);
|
|
1311
1311
|
}
|
|
1312
|
-
return
|
|
1312
|
+
return _;
|
|
1313
1313
|
});
|
|
1314
|
-
var u = n.table.core, f = u.schema.primaryKey, h = f.outbound, g = f.extractKey,
|
|
1315
|
-
f && (
|
|
1316
|
-
function
|
|
1314
|
+
var u = n.table.core, f = u.schema.primaryKey, h = f.outbound, g = f.extractKey, v = 200, f = t.db._options.modifyChunkSize;
|
|
1315
|
+
f && (v = typeof f == "object" ? f[u.name] || f["*"] || 200 : f);
|
|
1316
|
+
function S(m, O) {
|
|
1317
1317
|
var E = O.failures, O = O.numFailures;
|
|
1318
|
-
|
|
1319
|
-
for (var A = 0, P =
|
|
1318
|
+
b += m - O;
|
|
1319
|
+
for (var A = 0, P = K(E); A < P.length; A++) {
|
|
1320
1320
|
var T = P[A];
|
|
1321
1321
|
p.push(E[T]);
|
|
1322
1322
|
}
|
|
1323
1323
|
}
|
|
1324
|
-
var p = [],
|
|
1325
|
-
return t.clone().primaryKeys().then(function(
|
|
1326
|
-
function
|
|
1327
|
-
var A = Math.min(
|
|
1328
|
-
return u.getMany({ trans: i, keys:
|
|
1329
|
-
for (var T = [], I = [], C = h ? [] : null,
|
|
1330
|
-
var L = P[R], W = { value: Te(L), primKey:
|
|
1331
|
-
c.call(W, W.value, W) !== !1 && (W.value == null ?
|
|
1324
|
+
var p = [], b = 0, w = [];
|
|
1325
|
+
return t.clone().primaryKeys().then(function(m) {
|
|
1326
|
+
function _(O) {
|
|
1327
|
+
var A = Math.min(v, m.length - O);
|
|
1328
|
+
return u.getMany({ trans: i, keys: m.slice(O, O + A), cache: "immutable" }).then(function(P) {
|
|
1329
|
+
for (var T = [], I = [], C = h ? [] : null, j = [], R = 0; R < A; ++R) {
|
|
1330
|
+
var L = P[R], W = { value: Te(L), primKey: m[O + R] };
|
|
1331
|
+
c.call(W, W.value, W) !== !1 && (W.value == null ? j.push(m[O + R]) : h || Y(g(L), g(W.value)) === 0 ? (I.push(W.value), h && C.push(m[O + R])) : (j.push(m[O + R]), T.push(W.value)));
|
|
1332
1332
|
}
|
|
1333
1333
|
return Promise.resolve(0 < T.length && u.mutate({ trans: i, type: "add", values: T }).then(function(z) {
|
|
1334
|
-
for (var H in z.failures)
|
|
1335
|
-
|
|
1334
|
+
for (var H in z.failures) j.splice(parseInt(H), 1);
|
|
1335
|
+
S(T.length, z);
|
|
1336
1336
|
})).then(function() {
|
|
1337
1337
|
return (0 < I.length || E && typeof e == "object") && u.mutate({ trans: i, type: "put", keys: C, values: I, criteria: E, changeSpec: typeof e != "function" && e, isAdditionalChunk: 0 < O }).then(function(z) {
|
|
1338
|
-
return
|
|
1338
|
+
return S(I.length, z);
|
|
1339
1339
|
});
|
|
1340
1340
|
}).then(function() {
|
|
1341
|
-
return (0 <
|
|
1342
|
-
return
|
|
1341
|
+
return (0 < j.length || E && e === bn) && u.mutate({ trans: i, type: "delete", keys: j, criteria: E, isAdditionalChunk: 0 < O }).then(function(z) {
|
|
1342
|
+
return S(j.length, z);
|
|
1343
1343
|
});
|
|
1344
1344
|
}).then(function() {
|
|
1345
|
-
return
|
|
1345
|
+
return m.length > O + A && _(O + v);
|
|
1346
1346
|
});
|
|
1347
1347
|
});
|
|
1348
1348
|
}
|
|
1349
1349
|
var E = tt(n) && n.limit === 1 / 0 && (typeof e != "function" || e === bn) && { index: n.index, range: n.range };
|
|
1350
|
-
return
|
|
1351
|
-
if (0 < p.length) throw new Et("Error modifying one or more objects", p,
|
|
1352
|
-
return
|
|
1350
|
+
return _(0).then(function() {
|
|
1351
|
+
if (0 < p.length) throw new Et("Error modifying one or more objects", p, b, w);
|
|
1352
|
+
return m.length;
|
|
1353
1353
|
});
|
|
1354
1354
|
});
|
|
1355
1355
|
});
|
|
@@ -1388,56 +1388,56 @@ var Tr = { exports: {} };
|
|
|
1388
1388
|
}).limit(0);
|
|
1389
1389
|
}
|
|
1390
1390
|
function Kt(e, t, n, i) {
|
|
1391
|
-
var o, a, c, u, h, g,
|
|
1392
|
-
if (!n.every(function(
|
|
1393
|
-
return typeof
|
|
1391
|
+
var o, a, c, u, h, g, v, f = n.length;
|
|
1392
|
+
if (!n.every(function(b) {
|
|
1393
|
+
return typeof b == "string";
|
|
1394
1394
|
})) return he(e, ir);
|
|
1395
|
-
function
|
|
1396
|
-
o =
|
|
1397
|
-
return
|
|
1398
|
-
} : function(
|
|
1399
|
-
return
|
|
1400
|
-
}, a =
|
|
1401
|
-
return
|
|
1402
|
-
} : function(
|
|
1403
|
-
return
|
|
1404
|
-
}, c =
|
|
1405
|
-
var w = n.map(function(
|
|
1406
|
-
return { lower: a(
|
|
1407
|
-
}).sort(function(
|
|
1408
|
-
return c(
|
|
1395
|
+
function S(b) {
|
|
1396
|
+
o = b === "next" ? function(m) {
|
|
1397
|
+
return m.toUpperCase();
|
|
1398
|
+
} : function(m) {
|
|
1399
|
+
return m.toLowerCase();
|
|
1400
|
+
}, a = b === "next" ? function(m) {
|
|
1401
|
+
return m.toLowerCase();
|
|
1402
|
+
} : function(m) {
|
|
1403
|
+
return m.toUpperCase();
|
|
1404
|
+
}, c = b === "next" ? ai : si;
|
|
1405
|
+
var w = n.map(function(m) {
|
|
1406
|
+
return { lower: a(m), upper: o(m) };
|
|
1407
|
+
}).sort(function(m, _) {
|
|
1408
|
+
return c(m.lower, _.lower);
|
|
1409
1409
|
});
|
|
1410
|
-
u = w.map(function(
|
|
1411
|
-
return
|
|
1412
|
-
}), h = w.map(function(
|
|
1413
|
-
return
|
|
1414
|
-
}),
|
|
1410
|
+
u = w.map(function(m) {
|
|
1411
|
+
return m.upper;
|
|
1412
|
+
}), h = w.map(function(m) {
|
|
1413
|
+
return m.lower;
|
|
1414
|
+
}), v = (g = b) === "next" ? "" : i;
|
|
1415
1415
|
}
|
|
1416
|
-
|
|
1416
|
+
S("next"), e = new e.Collection(e, function() {
|
|
1417
1417
|
return Ie(u[0], h[f - 1] + i);
|
|
1418
|
-
}), e._ondirectionchange = function(
|
|
1419
|
-
|
|
1418
|
+
}), e._ondirectionchange = function(b) {
|
|
1419
|
+
S(b);
|
|
1420
1420
|
};
|
|
1421
1421
|
var p = 0;
|
|
1422
|
-
return e._addAlgorithm(function(
|
|
1423
|
-
var
|
|
1424
|
-
if (typeof
|
|
1425
|
-
var E = a(
|
|
1422
|
+
return e._addAlgorithm(function(b, w, m) {
|
|
1423
|
+
var _ = b.key;
|
|
1424
|
+
if (typeof _ != "string") return !1;
|
|
1425
|
+
var E = a(_);
|
|
1426
1426
|
if (t(E, h, p)) return !0;
|
|
1427
1427
|
for (var O = null, A = p; A < f; ++A) {
|
|
1428
|
-
var P = function(T, I, C,
|
|
1429
|
-
for (var W = Math.min(T.length,
|
|
1428
|
+
var P = function(T, I, C, j, R, L) {
|
|
1429
|
+
for (var W = Math.min(T.length, j.length), z = -1, H = 0; H < W; ++H) {
|
|
1430
1430
|
var pe = I[H];
|
|
1431
|
-
if (pe !==
|
|
1431
|
+
if (pe !== j[H]) return R(T[H], C[H]) < 0 ? T.substr(0, H) + C[H] + C.substr(H + 1) : R(T[H], j[H]) < 0 ? T.substr(0, H) + j[H] + C.substr(H + 1) : 0 <= z ? T.substr(0, z) + I[z] + C.substr(z + 1) : null;
|
|
1432
1432
|
R(T[H], pe) < 0 && (z = H);
|
|
1433
1433
|
}
|
|
1434
|
-
return W <
|
|
1435
|
-
}(
|
|
1434
|
+
return W < j.length && L === "next" ? T + C.substr(T.length) : W < T.length && L === "prev" ? T.substr(0, C.length) : z < 0 ? null : T.substr(0, z) + j[z] + C.substr(z + 1);
|
|
1435
|
+
}(_, E, u[A], h[A], c, g);
|
|
1436
1436
|
P === null && O === null ? p = A + 1 : (O === null || 0 < c(O, P)) && (O = P);
|
|
1437
1437
|
}
|
|
1438
1438
|
return w(O !== null ? function() {
|
|
1439
|
-
|
|
1440
|
-
} :
|
|
1439
|
+
b.continue(O + v);
|
|
1440
|
+
} : m), !1;
|
|
1441
1441
|
}), e;
|
|
1442
1442
|
}
|
|
1443
1443
|
function Ie(e, t, n, i) {
|
|
@@ -1455,26 +1455,26 @@ var Tr = { exports: {} };
|
|
|
1455
1455
|
return Ie(e, t, !n, !i);
|
|
1456
1456
|
});
|
|
1457
1457
|
} catch {
|
|
1458
|
-
return he(this,
|
|
1458
|
+
return he(this, _e);
|
|
1459
1459
|
}
|
|
1460
1460
|
}, oe.prototype.equals = function(e) {
|
|
1461
|
-
return e == null ? he(this,
|
|
1461
|
+
return e == null ? he(this, _e) : new this.Collection(this, function() {
|
|
1462
1462
|
return hr(e);
|
|
1463
1463
|
});
|
|
1464
1464
|
}, oe.prototype.above = function(e) {
|
|
1465
|
-
return e == null ? he(this,
|
|
1465
|
+
return e == null ? he(this, _e) : new this.Collection(this, function() {
|
|
1466
1466
|
return Ie(e, void 0, !0);
|
|
1467
1467
|
});
|
|
1468
1468
|
}, oe.prototype.aboveOrEqual = function(e) {
|
|
1469
|
-
return e == null ? he(this,
|
|
1469
|
+
return e == null ? he(this, _e) : new this.Collection(this, function() {
|
|
1470
1470
|
return Ie(e, void 0, !1);
|
|
1471
1471
|
});
|
|
1472
1472
|
}, oe.prototype.below = function(e) {
|
|
1473
|
-
return e == null ? he(this,
|
|
1473
|
+
return e == null ? he(this, _e) : new this.Collection(this, function() {
|
|
1474
1474
|
return Ie(void 0, e, !1, !0);
|
|
1475
1475
|
});
|
|
1476
1476
|
}, oe.prototype.belowOrEqual = function(e) {
|
|
1477
|
-
return e == null ? he(this,
|
|
1477
|
+
return e == null ? he(this, _e) : new this.Collection(this, function() {
|
|
1478
1478
|
return Ie(void 0, e);
|
|
1479
1479
|
});
|
|
1480
1480
|
}, oe.prototype.startsWith = function(e) {
|
|
@@ -1488,23 +1488,23 @@ var Tr = { exports: {} };
|
|
|
1488
1488
|
return t === n[0];
|
|
1489
1489
|
}, [e], "");
|
|
1490
1490
|
}, oe.prototype.anyOfIgnoreCase = function() {
|
|
1491
|
-
var e =
|
|
1491
|
+
var e = Se.apply(Qe, arguments);
|
|
1492
1492
|
return e.length === 0 ? nt(this) : Kt(this, function(t, n) {
|
|
1493
1493
|
return n.indexOf(t) !== -1;
|
|
1494
1494
|
}, e, "");
|
|
1495
1495
|
}, oe.prototype.startsWithAnyOfIgnoreCase = function() {
|
|
1496
|
-
var e =
|
|
1496
|
+
var e = Se.apply(Qe, arguments);
|
|
1497
1497
|
return e.length === 0 ? nt(this) : Kt(this, function(t, n) {
|
|
1498
1498
|
return n.some(function(i) {
|
|
1499
1499
|
return t.indexOf(i) === 0;
|
|
1500
1500
|
});
|
|
1501
1501
|
}, e, $e);
|
|
1502
1502
|
}, oe.prototype.anyOf = function() {
|
|
1503
|
-
var e = this, t =
|
|
1503
|
+
var e = this, t = Se.apply(Qe, arguments), n = this._cmp;
|
|
1504
1504
|
try {
|
|
1505
1505
|
t.sort(n);
|
|
1506
1506
|
} catch {
|
|
1507
|
-
return he(this,
|
|
1507
|
+
return he(this, _e);
|
|
1508
1508
|
}
|
|
1509
1509
|
if (t.length === 0) return nt(this);
|
|
1510
1510
|
var i = new this.Collection(this, function() {
|
|
@@ -1523,29 +1523,29 @@ var Tr = { exports: {} };
|
|
|
1523
1523
|
}, oe.prototype.notEqual = function(e) {
|
|
1524
1524
|
return this.inAnyRange([[-1 / 0, e], [e, this.db._maxKey]], { includeLowers: !1, includeUppers: !1 });
|
|
1525
1525
|
}, oe.prototype.noneOf = function() {
|
|
1526
|
-
var e =
|
|
1526
|
+
var e = Se.apply(Qe, arguments);
|
|
1527
1527
|
if (e.length === 0) return new this.Collection(this);
|
|
1528
1528
|
try {
|
|
1529
1529
|
e.sort(this._ascending);
|
|
1530
1530
|
} catch {
|
|
1531
|
-
return he(this,
|
|
1531
|
+
return he(this, _e);
|
|
1532
1532
|
}
|
|
1533
1533
|
var t = e.reduce(function(n, i) {
|
|
1534
1534
|
return n ? n.concat([[n[n.length - 1][1], i]]) : [[-1 / 0, i]];
|
|
1535
1535
|
}, null);
|
|
1536
1536
|
return t.push([e[e.length - 1], this.db._maxKey]), this.inAnyRange(t, { includeLowers: !1, includeUppers: !1 });
|
|
1537
|
-
}, oe.prototype.inAnyRange = function(
|
|
1537
|
+
}, oe.prototype.inAnyRange = function(_, t) {
|
|
1538
1538
|
var n = this, i = this._cmp, o = this._ascending, a = this._descending, c = this._min, u = this._max;
|
|
1539
|
-
if (
|
|
1540
|
-
if (!
|
|
1539
|
+
if (_.length === 0) return nt(this);
|
|
1540
|
+
if (!_.every(function(E) {
|
|
1541
1541
|
return E[0] !== void 0 && E[1] !== void 0 && o(E[0], E[1]) <= 0;
|
|
1542
1542
|
})) return he(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", $.InvalidArgument);
|
|
1543
|
-
var h = !t || t.includeLowers !== !1, g = t && t.includeUppers === !0,
|
|
1544
|
-
function
|
|
1543
|
+
var h = !t || t.includeLowers !== !1, g = t && t.includeUppers === !0, v, f = o;
|
|
1544
|
+
function S(E, O) {
|
|
1545
1545
|
return f(E[0], O[0]);
|
|
1546
1546
|
}
|
|
1547
1547
|
try {
|
|
1548
|
-
(
|
|
1548
|
+
(v = _.reduce(function(E, O) {
|
|
1549
1549
|
for (var A = 0, P = E.length; A < P; ++A) {
|
|
1550
1550
|
var T = E[A];
|
|
1551
1551
|
if (i(O[0], T[1]) < 0 && 0 < i(O[1], T[0])) {
|
|
@@ -1554,31 +1554,31 @@ var Tr = { exports: {} };
|
|
|
1554
1554
|
}
|
|
1555
1555
|
}
|
|
1556
1556
|
return A === P && E.push(O), E;
|
|
1557
|
-
}, [])).sort(
|
|
1557
|
+
}, [])).sort(S);
|
|
1558
1558
|
} catch {
|
|
1559
|
-
return he(this,
|
|
1559
|
+
return he(this, _e);
|
|
1560
1560
|
}
|
|
1561
|
-
var p = 0,
|
|
1562
|
-
return 0 < o(E,
|
|
1561
|
+
var p = 0, b = g ? function(E) {
|
|
1562
|
+
return 0 < o(E, v[p][1]);
|
|
1563
1563
|
} : function(E) {
|
|
1564
|
-
return 0 <= o(E,
|
|
1564
|
+
return 0 <= o(E, v[p][1]);
|
|
1565
1565
|
}, w = h ? function(E) {
|
|
1566
|
-
return 0 < a(E,
|
|
1566
|
+
return 0 < a(E, v[p][0]);
|
|
1567
1567
|
} : function(E) {
|
|
1568
|
-
return 0 <= a(E,
|
|
1569
|
-
},
|
|
1570
|
-
return Ie(
|
|
1568
|
+
return 0 <= a(E, v[p][0]);
|
|
1569
|
+
}, m = b, _ = new this.Collection(this, function() {
|
|
1570
|
+
return Ie(v[0][0], v[v.length - 1][1], !h, !g);
|
|
1571
1571
|
});
|
|
1572
|
-
return
|
|
1573
|
-
f = E === "next" ? (
|
|
1574
|
-
},
|
|
1575
|
-
for (var P, T = E.key;
|
|
1576
|
-
return !
|
|
1577
|
-
f === o ? E.continue(
|
|
1572
|
+
return _._ondirectionchange = function(E) {
|
|
1573
|
+
f = E === "next" ? (m = b, o) : (m = w, a), v.sort(S);
|
|
1574
|
+
}, _._addAlgorithm(function(E, O, A) {
|
|
1575
|
+
for (var P, T = E.key; m(T); ) if (++p === v.length) return O(A), !1;
|
|
1576
|
+
return !b(P = T) && !w(P) || (n._cmp(T, v[p][1]) === 0 || n._cmp(T, v[p][0]) === 0 || O(function() {
|
|
1577
|
+
f === o ? E.continue(v[p][0]) : E.continue(v[p][1]);
|
|
1578
1578
|
}), !1);
|
|
1579
|
-
}),
|
|
1579
|
+
}), _;
|
|
1580
1580
|
}, oe.prototype.startsWithAnyOf = function() {
|
|
1581
|
-
var e =
|
|
1581
|
+
var e = Se.apply(Qe, arguments);
|
|
1582
1582
|
return e.every(function(t) {
|
|
1583
1583
|
return typeof t == "string";
|
|
1584
1584
|
}) ? e.length === 0 ? nt(this) : this.inAnyRange(e.map(function(t) {
|
|
@@ -1689,7 +1689,7 @@ var Tr = { exports: {} };
|
|
|
1689
1689
|
function gr(e) {
|
|
1690
1690
|
return typeof e == "string" ? e : e ? "[" + [].join.call(e, "+") + "]" : "";
|
|
1691
1691
|
}
|
|
1692
|
-
function
|
|
1692
|
+
function Sn(e, t, n) {
|
|
1693
1693
|
return { name: e, primKey: t, indexes: n, mappedClass: null, idxByName: (i = function(o) {
|
|
1694
1694
|
return [o.name, o];
|
|
1695
1695
|
}, n.reduce(function(o, a, c) {
|
|
@@ -1708,7 +1708,7 @@ var Tr = { exports: {} };
|
|
|
1708
1708
|
}, $e;
|
|
1709
1709
|
}
|
|
1710
1710
|
};
|
|
1711
|
-
function
|
|
1711
|
+
function _n(e) {
|
|
1712
1712
|
return e == null ? function() {
|
|
1713
1713
|
} : typeof e == "string" ? (t = e).split(".").length === 1 ? function(n) {
|
|
1714
1714
|
return n[t];
|
|
@@ -1727,20 +1727,20 @@ var Tr = { exports: {} };
|
|
|
1727
1727
|
return e == null ? ":id" : typeof e == "string" ? e : "[".concat(e.join("+"), "]");
|
|
1728
1728
|
}
|
|
1729
1729
|
function li(e, t, h) {
|
|
1730
|
-
function i(
|
|
1731
|
-
if (
|
|
1732
|
-
if (
|
|
1733
|
-
var p =
|
|
1734
|
-
return p === void 0 ?
|
|
1730
|
+
function i(m) {
|
|
1731
|
+
if (m.type === 3) return null;
|
|
1732
|
+
if (m.type === 4) throw new Error("Cannot convert never type to IDBKeyRange");
|
|
1733
|
+
var p = m.lower, b = m.upper, w = m.lowerOpen, m = m.upperOpen;
|
|
1734
|
+
return p === void 0 ? b === void 0 ? null : t.upperBound(b, !!m) : b === void 0 ? t.lowerBound(p, !!w) : t.bound(p, b, !!w, !!m);
|
|
1735
1735
|
}
|
|
1736
|
-
function o(
|
|
1737
|
-
var p,
|
|
1738
|
-
return { name:
|
|
1739
|
-
var
|
|
1736
|
+
function o(S) {
|
|
1737
|
+
var p, b = S.name;
|
|
1738
|
+
return { name: b, schema: S, mutate: function(w) {
|
|
1739
|
+
var m = w.trans, _ = w.type, E = w.keys, O = w.values, A = w.range;
|
|
1740
1740
|
return new Promise(function(P, T) {
|
|
1741
1741
|
P = q(P);
|
|
1742
|
-
var I =
|
|
1743
|
-
if (!
|
|
1742
|
+
var I = m.objectStore(b), C = I.keyPath == null, j = _ === "put" || _ === "add";
|
|
1743
|
+
if (!j && _ !== "delete" && _ !== "deleteRange") throw new Error("Invalid operation type: " + _);
|
|
1744
1744
|
var R, L = (E || O || { length: 1 }).length;
|
|
1745
1745
|
if (E && O && E.length !== O.length) throw new Error("Given keys array must have same length as given values array.");
|
|
1746
1746
|
if (L === 0) return P({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
|
|
@@ -1748,18 +1748,18 @@ var Tr = { exports: {} };
|
|
|
1748
1748
|
++pe, pt(de);
|
|
1749
1749
|
}
|
|
1750
1750
|
var z = [], H = [], pe = 0;
|
|
1751
|
-
if (
|
|
1751
|
+
if (_ === "deleteRange") {
|
|
1752
1752
|
if (A.type === 4) return P({ numFailures: pe, failures: H, results: [], lastResult: void 0 });
|
|
1753
1753
|
A.type === 3 ? z.push(R = I.clear()) : z.push(R = I.delete(i(A)));
|
|
1754
1754
|
} else {
|
|
1755
|
-
var C =
|
|
1756
|
-
if (
|
|
1757
|
-
else for (ue = 0; ue < L; ++ue) z.push(R = I[
|
|
1755
|
+
var C = j ? C ? [O, E] : [O, null] : [E, null], F = C[0], ce = C[1];
|
|
1756
|
+
if (j) for (var ue = 0; ue < L; ++ue) z.push(R = ce && ce[ue] !== void 0 ? I[_](F[ue], ce[ue]) : I[_](F[ue])), R.onerror = W;
|
|
1757
|
+
else for (ue = 0; ue < L; ++ue) z.push(R = I[_](F[ue])), R.onerror = W;
|
|
1758
1758
|
}
|
|
1759
1759
|
function Jt(de) {
|
|
1760
1760
|
de = de.target.result, z.forEach(function(ze, Gn) {
|
|
1761
1761
|
return ze.error != null && (H[Gn] = ze.error);
|
|
1762
|
-
}), P({ numFailures: pe, failures: H, results:
|
|
1762
|
+
}), P({ numFailures: pe, failures: H, results: _ === "delete" ? E : z.map(function(ze) {
|
|
1763
1763
|
return ze.result;
|
|
1764
1764
|
}), lastResult: de });
|
|
1765
1765
|
}
|
|
@@ -1768,45 +1768,45 @@ var Tr = { exports: {} };
|
|
|
1768
1768
|
}, R.onsuccess = Jt;
|
|
1769
1769
|
});
|
|
1770
1770
|
}, getMany: function(w) {
|
|
1771
|
-
var
|
|
1771
|
+
var m = w.trans, _ = w.keys;
|
|
1772
1772
|
return new Promise(function(E, O) {
|
|
1773
1773
|
E = q(E);
|
|
1774
|
-
for (var A, P =
|
|
1775
|
-
z = z.target, I[z._pos] = z.result, ++
|
|
1776
|
-
}, L = be(O), W = 0; W < T; ++W)
|
|
1774
|
+
for (var A, P = m.objectStore(b), T = _.length, I = new Array(T), C = 0, j = 0, R = function(z) {
|
|
1775
|
+
z = z.target, I[z._pos] = z.result, ++j === C && E(I);
|
|
1776
|
+
}, L = be(O), W = 0; W < T; ++W) _[W] != null && ((A = P.get(_[W]))._pos = W, A.onsuccess = R, A.onerror = L, ++C);
|
|
1777
1777
|
C === 0 && E(I);
|
|
1778
1778
|
});
|
|
1779
1779
|
}, get: function(w) {
|
|
1780
|
-
var
|
|
1780
|
+
var m = w.trans, _ = w.key;
|
|
1781
1781
|
return new Promise(function(E, O) {
|
|
1782
1782
|
E = q(E);
|
|
1783
|
-
var A =
|
|
1783
|
+
var A = m.objectStore(b).get(_);
|
|
1784
1784
|
A.onsuccess = function(P) {
|
|
1785
1785
|
return E(P.target.result);
|
|
1786
1786
|
}, A.onerror = be(O);
|
|
1787
1787
|
});
|
|
1788
1788
|
}, query: (p = g, function(w) {
|
|
1789
|
-
return new Promise(function(
|
|
1790
|
-
|
|
1791
|
-
var E, O, A, C = w.trans, P = w.values, T = w.limit, R = w.query, I = T === 1 / 0 ? void 0 : T,
|
|
1792
|
-
if (T === 0) return
|
|
1793
|
-
p ? ((I = P ?
|
|
1794
|
-
return
|
|
1795
|
-
}, I.onerror = be(
|
|
1789
|
+
return new Promise(function(m, _) {
|
|
1790
|
+
m = q(m);
|
|
1791
|
+
var E, O, A, C = w.trans, P = w.values, T = w.limit, R = w.query, I = T === 1 / 0 ? void 0 : T, j = R.index, R = R.range, C = C.objectStore(b), j = j.isPrimaryKey ? C : C.index(j.name), R = i(R);
|
|
1792
|
+
if (T === 0) return m({ result: [] });
|
|
1793
|
+
p ? ((I = P ? j.getAll(R, I) : j.getAllKeys(R, I)).onsuccess = function(L) {
|
|
1794
|
+
return m({ result: L.target.result });
|
|
1795
|
+
}, I.onerror = be(_)) : (E = 0, O = !P && "openKeyCursor" in j ? j.openKeyCursor(R) : j.openCursor(R), A = [], O.onsuccess = function(L) {
|
|
1796
1796
|
var W = O.result;
|
|
1797
|
-
return W ? (A.push(P ? W.value : W.primaryKey), ++E === T ?
|
|
1798
|
-
}, O.onerror = be(
|
|
1797
|
+
return W ? (A.push(P ? W.value : W.primaryKey), ++E === T ? m({ result: A }) : void W.continue()) : m({ result: A });
|
|
1798
|
+
}, O.onerror = be(_));
|
|
1799
1799
|
});
|
|
1800
1800
|
}), openCursor: function(w) {
|
|
1801
|
-
var
|
|
1801
|
+
var m = w.trans, _ = w.values, E = w.query, O = w.reverse, A = w.unique;
|
|
1802
1802
|
return new Promise(function(P, T) {
|
|
1803
1803
|
P = q(P);
|
|
1804
|
-
var
|
|
1804
|
+
var j = E.index, I = E.range, C = m.objectStore(b), C = j.isPrimaryKey ? C : C.index(j.name), j = O ? A ? "prevunique" : "prev" : A ? "nextunique" : "next", R = !_ && "openKeyCursor" in C ? C.openKeyCursor(i(I), j) : C.openCursor(i(I), j);
|
|
1805
1805
|
R.onerror = be(T), R.onsuccess = q(function(L) {
|
|
1806
1806
|
var W, z, H, pe, F = R.result;
|
|
1807
1807
|
F ? (F.___id = ++ui, F.done = !1, W = F.continue.bind(F), z = (z = F.continuePrimaryKey) && z.bind(F), H = F.advance.bind(F), pe = function() {
|
|
1808
1808
|
throw new Error("Cursor not stopped");
|
|
1809
|
-
}, F.trans =
|
|
1809
|
+
}, F.trans = m, F.stop = F.continue = F.continuePrimaryKey = F.advance = function() {
|
|
1810
1810
|
throw new Error("Cursor not started");
|
|
1811
1811
|
}, F.fail = q(T), F.next = function() {
|
|
1812
1812
|
var ce = this, ue = 1;
|
|
@@ -1838,33 +1838,33 @@ var Tr = { exports: {} };
|
|
|
1838
1838
|
}, T);
|
|
1839
1839
|
});
|
|
1840
1840
|
}, count: function(w) {
|
|
1841
|
-
var
|
|
1841
|
+
var m = w.query, _ = w.trans, E = m.index, O = m.range;
|
|
1842
1842
|
return new Promise(function(A, P) {
|
|
1843
|
-
var T =
|
|
1843
|
+
var T = _.objectStore(b), I = E.isPrimaryKey ? T : T.index(E.name), T = i(O), I = T ? I.count(T) : I.count();
|
|
1844
1844
|
I.onsuccess = q(function(C) {
|
|
1845
1845
|
return A(C.target.result);
|
|
1846
1846
|
}), I.onerror = be(P);
|
|
1847
1847
|
});
|
|
1848
1848
|
} };
|
|
1849
1849
|
}
|
|
1850
|
-
var a, c, u,
|
|
1851
|
-
return c.objectStore(
|
|
1852
|
-
}).map(function(
|
|
1853
|
-
var p =
|
|
1854
|
-
return
|
|
1850
|
+
var a, c, u, v = (c = h, u = yr((a = e).objectStoreNames), { schema: { name: a.name, tables: u.map(function(S) {
|
|
1851
|
+
return c.objectStore(S);
|
|
1852
|
+
}).map(function(S) {
|
|
1853
|
+
var p = S.keyPath, m = S.autoIncrement, b = U(p), w = {}, m = { name: S.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: p == null, compound: b, keyPath: p, autoIncrement: m, unique: !0, extractKey: _n(p) }, indexes: yr(S.indexNames).map(function(_) {
|
|
1854
|
+
return S.index(_);
|
|
1855
1855
|
}).map(function(A) {
|
|
1856
|
-
var E = A.name, O = A.unique, P = A.multiEntry, A = A.keyPath, P = { name: E, compound: U(A), keyPath: A, unique: O, multiEntry: P, extractKey:
|
|
1856
|
+
var E = A.name, O = A.unique, P = A.multiEntry, A = A.keyPath, P = { name: E, compound: U(A), keyPath: A, unique: O, multiEntry: P, extractKey: _n(A) };
|
|
1857
1857
|
return w[mt(A)] = P;
|
|
1858
|
-
}), getIndexByKeyPath: function(
|
|
1859
|
-
return w[mt(
|
|
1858
|
+
}), getIndexByKeyPath: function(_) {
|
|
1859
|
+
return w[mt(_)];
|
|
1860
1860
|
} };
|
|
1861
|
-
return w[":id"] =
|
|
1862
|
-
}) }, hasGetAll: 0 < u.length && "getAll" in c.objectStore(u[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }), h =
|
|
1863
|
-
return
|
|
1864
|
-
return f[
|
|
1865
|
-
}), { stack: "dbcore", transaction: e.transaction.bind(e), table: function(
|
|
1866
|
-
if (!f[
|
|
1867
|
-
return f[
|
|
1861
|
+
return w[":id"] = m.primaryKey, p != null && (w[mt(p)] = m.primaryKey), m;
|
|
1862
|
+
}) }, hasGetAll: 0 < u.length && "getAll" in c.objectStore(u[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }), h = v.schema, g = v.hasGetAll, v = h.tables.map(o), f = {};
|
|
1863
|
+
return v.forEach(function(S) {
|
|
1864
|
+
return f[S.name] = S;
|
|
1865
|
+
}), { stack: "dbcore", transaction: e.transaction.bind(e), table: function(S) {
|
|
1866
|
+
if (!f[S]) throw new Error("Table '".concat(S, "' not found"));
|
|
1867
|
+
return f[S];
|
|
1868
1868
|
}, MIN_KEY: -1 / 0, MAX_KEY: yt(t), schema: h };
|
|
1869
1869
|
}
|
|
1870
1870
|
function di(e, t, n, i) {
|
|
@@ -1886,8 +1886,8 @@ var Tr = { exports: {} };
|
|
|
1886
1886
|
n.forEach(function(o) {
|
|
1887
1887
|
var a = i[o];
|
|
1888
1888
|
t.forEach(function(c) {
|
|
1889
|
-
var u = function h(g,
|
|
1890
|
-
return Ur(g,
|
|
1889
|
+
var u = function h(g, v) {
|
|
1890
|
+
return Ur(g, v) || (g = X(g)) && h(g, v);
|
|
1891
1891
|
}(c, o);
|
|
1892
1892
|
(!u || "value" in u && u.value === void 0) && (c === e.Transaction.prototype || c instanceof e.Transaction ? xe(c, o, { get: function() {
|
|
1893
1893
|
return this.table(o);
|
|
@@ -1907,67 +1907,67 @@ var Tr = { exports: {} };
|
|
|
1907
1907
|
}
|
|
1908
1908
|
function hi(e, t, n, i) {
|
|
1909
1909
|
var o = e._dbSchema;
|
|
1910
|
-
n.objectStoreNames.contains("$meta") && !o.$meta && (o.$meta =
|
|
1910
|
+
n.objectStoreNames.contains("$meta") && !o.$meta && (o.$meta = Sn("$meta", br("")[0], []), e._storeNames.push("$meta"));
|
|
1911
1911
|
var a = e._createTransaction("readwrite", e._storeNames, o);
|
|
1912
1912
|
a.create(n), a._completion.catch(i);
|
|
1913
1913
|
var c = a._reject.bind(a), u = G.transless || G;
|
|
1914
1914
|
ke(function() {
|
|
1915
|
-
return G.trans = a, G.transless = u, t !== 0 ? (Bt(e, n), g = t, ((h = a).storeNames.includes("$meta") ? h.table("$meta").get("version").then(function(
|
|
1916
|
-
return
|
|
1917
|
-
}) : B.resolve(g)).then(function(
|
|
1918
|
-
return
|
|
1919
|
-
return
|
|
1920
|
-
})).length !== 0 ? (
|
|
1915
|
+
return G.trans = a, G.transless = u, t !== 0 ? (Bt(e, n), g = t, ((h = a).storeNames.includes("$meta") ? h.table("$meta").get("version").then(function(v) {
|
|
1916
|
+
return v ?? g;
|
|
1917
|
+
}) : B.resolve(g)).then(function(v) {
|
|
1918
|
+
return S = v, p = a, b = n, w = [], v = (f = e)._versions, m = f._dbSchema = $t(0, f.idbdb, b), (v = v.filter(function(_) {
|
|
1919
|
+
return _._cfg.version >= S;
|
|
1920
|
+
})).length !== 0 ? (v.forEach(function(_) {
|
|
1921
1921
|
w.push(function() {
|
|
1922
|
-
var E =
|
|
1923
|
-
Ut(f, E,
|
|
1922
|
+
var E = m, O = _._cfg.dbschema;
|
|
1923
|
+
Ut(f, E, b), Ut(f, O, b), m = f._dbSchema = O;
|
|
1924
1924
|
var A = On(E, O);
|
|
1925
|
-
A.add.forEach(function(
|
|
1926
|
-
xn(
|
|
1927
|
-
}), A.change.forEach(function(
|
|
1928
|
-
if (
|
|
1929
|
-
var R =
|
|
1930
|
-
|
|
1925
|
+
A.add.forEach(function(j) {
|
|
1926
|
+
xn(b, j[0], j[1].primKey, j[1].indexes);
|
|
1927
|
+
}), A.change.forEach(function(j) {
|
|
1928
|
+
if (j.recreate) throw new $.Upgrade("Not yet support for changing primary key");
|
|
1929
|
+
var R = b.objectStore(j.name);
|
|
1930
|
+
j.add.forEach(function(L) {
|
|
1931
1931
|
return Gt(R, L);
|
|
1932
|
-
}),
|
|
1932
|
+
}), j.change.forEach(function(L) {
|
|
1933
1933
|
R.deleteIndex(L.name), Gt(R, L);
|
|
1934
|
-
}),
|
|
1934
|
+
}), j.del.forEach(function(L) {
|
|
1935
1935
|
return R.deleteIndex(L);
|
|
1936
1936
|
});
|
|
1937
1937
|
});
|
|
1938
|
-
var P =
|
|
1939
|
-
if (P &&
|
|
1940
|
-
Bt(f,
|
|
1938
|
+
var P = _._cfg.contentUpgrade;
|
|
1939
|
+
if (P && _._cfg.version > S) {
|
|
1940
|
+
Bt(f, b), p._memoizedTables = {};
|
|
1941
1941
|
var T = Yn(O);
|
|
1942
|
-
A.del.forEach(function(
|
|
1943
|
-
T[
|
|
1944
|
-
}), En(f, [f.Transaction.prototype]), Lt(f, [f.Transaction.prototype],
|
|
1942
|
+
A.del.forEach(function(j) {
|
|
1943
|
+
T[j] = E[j];
|
|
1944
|
+
}), En(f, [f.Transaction.prototype]), Lt(f, [f.Transaction.prototype], K(T), T), p.schema = T;
|
|
1945
1945
|
var I, C = nn(P);
|
|
1946
1946
|
return C && qe(), A = B.follow(function() {
|
|
1947
|
-
var
|
|
1948
|
-
(I = P(p)) && C && (
|
|
1947
|
+
var j;
|
|
1948
|
+
(I = P(p)) && C && (j = De.bind(null, null), I.then(j, j));
|
|
1949
1949
|
}), I && typeof I.then == "function" ? B.resolve(I) : A.then(function() {
|
|
1950
1950
|
return I;
|
|
1951
1951
|
});
|
|
1952
1952
|
}
|
|
1953
1953
|
}), w.push(function(E) {
|
|
1954
|
-
var O, A, P =
|
|
1954
|
+
var O, A, P = _._cfg.dbschema;
|
|
1955
1955
|
O = P, A = E, [].slice.call(A.db.objectStoreNames).forEach(function(T) {
|
|
1956
1956
|
return O[T] == null && A.db.deleteObjectStore(T);
|
|
1957
1957
|
}), En(f, [f.Transaction.prototype]), Lt(f, [f.Transaction.prototype], f._storeNames, f._dbSchema), p.schema = f._dbSchema;
|
|
1958
1958
|
}), w.push(function(E) {
|
|
1959
|
-
f.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(f.idbdb.version / 10) ===
|
|
1959
|
+
f.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(f.idbdb.version / 10) === _._cfg.version ? (f.idbdb.deleteObjectStore("$meta"), delete f._dbSchema.$meta, f._storeNames = f._storeNames.filter(function(O) {
|
|
1960
1960
|
return O !== "$meta";
|
|
1961
|
-
})) : E.objectStore("$meta").put(
|
|
1961
|
+
})) : E.objectStore("$meta").put(_._cfg.version, "version"));
|
|
1962
1962
|
});
|
|
1963
|
-
}), function
|
|
1964
|
-
return w.length ? B.resolve(w.shift()(p.idbtrans)).then(
|
|
1963
|
+
}), function _() {
|
|
1964
|
+
return w.length ? B.resolve(w.shift()(p.idbtrans)).then(_) : B.resolve();
|
|
1965
1965
|
}().then(function() {
|
|
1966
|
-
mr(
|
|
1966
|
+
mr(m, b);
|
|
1967
1967
|
})) : B.resolve();
|
|
1968
|
-
var f,
|
|
1969
|
-
}).catch(c)) : (
|
|
1970
|
-
xn(n,
|
|
1968
|
+
var f, S, p, b, w, m;
|
|
1969
|
+
}).catch(c)) : (K(o).forEach(function(v) {
|
|
1970
|
+
xn(n, v, o[v].primKey, o[v].indexes);
|
|
1971
1971
|
}), Bt(e, n), void B.follow(function() {
|
|
1972
1972
|
return e.on.populate.fire(a);
|
|
1973
1973
|
}).catch(c));
|
|
@@ -2001,8 +2001,8 @@ var Tr = { exports: {} };
|
|
|
2001
2001
|
var u = o.idxByName, h = a.idxByName, g = void 0;
|
|
2002
2002
|
for (g in u) h[g] || c.del.push(g);
|
|
2003
2003
|
for (g in h) {
|
|
2004
|
-
var
|
|
2005
|
-
|
|
2004
|
+
var v = u[g], f = h[g];
|
|
2005
|
+
v ? v.src !== f.src && c.change.push(f) : c.add.push(f);
|
|
2006
2006
|
}
|
|
2007
2007
|
(0 < c.del.length || 0 < c.add.length || 0 < c.change.length) && i.change.push(c);
|
|
2008
2008
|
}
|
|
@@ -2017,7 +2017,7 @@ var Tr = { exports: {} };
|
|
|
2017
2017
|
}), o;
|
|
2018
2018
|
}
|
|
2019
2019
|
function mr(e, t) {
|
|
2020
|
-
|
|
2020
|
+
K(e).forEach(function(n) {
|
|
2021
2021
|
t.db.objectStoreNames.contains(n) || (me && console.debug("Dexie: Creating missing table", n), xn(t, n, e[n].primKey, e[n].indexes));
|
|
2022
2022
|
});
|
|
2023
2023
|
}
|
|
@@ -2026,12 +2026,12 @@ var Tr = { exports: {} };
|
|
|
2026
2026
|
}
|
|
2027
2027
|
function $t(e, t, n) {
|
|
2028
2028
|
var i = {};
|
|
2029
|
-
return
|
|
2029
|
+
return _t(t.objectStoreNames, 0).forEach(function(o) {
|
|
2030
2030
|
for (var a = n.objectStore(o), c = wn(gr(g = a.keyPath), g || "", !0, !1, !!a.autoIncrement, g && typeof g != "string", !0), u = [], h = 0; h < a.indexNames.length; ++h) {
|
|
2031
|
-
var
|
|
2032
|
-
u.push(
|
|
2031
|
+
var v = a.index(a.indexNames[h]), g = v.keyPath, v = wn(v.name, g, !!v.unique, !!v.multiEntry, !1, g && typeof g != "string", !1);
|
|
2032
|
+
u.push(v);
|
|
2033
2033
|
}
|
|
2034
|
-
i[o] =
|
|
2034
|
+
i[o] = Sn(o, c, u);
|
|
2035
2035
|
}), i;
|
|
2036
2036
|
}
|
|
2037
2037
|
function Ut(e, t, n) {
|
|
@@ -2039,8 +2039,8 @@ var Tr = { exports: {} };
|
|
|
2039
2039
|
var a = i[o], c = n.objectStore(a);
|
|
2040
2040
|
e._hasGetAll = "getAll" in c;
|
|
2041
2041
|
for (var u = 0; u < c.indexNames.length; ++u) {
|
|
2042
|
-
var h = c.indexNames[u], g = c.index(h).keyPath,
|
|
2043
|
-
!t[a] || (g = t[a].idxByName[
|
|
2042
|
+
var h = c.indexNames[u], g = c.index(h).keyPath, v = typeof g == "string" ? g : "[" + _t(g).join("+") + "]";
|
|
2043
|
+
!t[a] || (g = t[a].idxByName[v]) && (g.name = h, delete t[a].idxByName[v], t[a].idxByName[h] = g);
|
|
2044
2044
|
}
|
|
2045
2045
|
}
|
|
2046
2046
|
typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && D.WorkerGlobalScope && D instanceof D.WorkerGlobalScope && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604 && (e._hasGetAll = !1);
|
|
@@ -2052,23 +2052,23 @@ var Tr = { exports: {} };
|
|
|
2052
2052
|
});
|
|
2053
2053
|
}
|
|
2054
2054
|
var gi = (Ft.prototype._parseStoresSpec = function(e, t) {
|
|
2055
|
-
|
|
2055
|
+
K(e).forEach(function(n) {
|
|
2056
2056
|
if (e[n] !== null) {
|
|
2057
2057
|
var i = br(e[n]), o = i.shift();
|
|
2058
2058
|
if (o.unique = !0, o.multi) throw new $.Schema("Primary key cannot be multi-valued");
|
|
2059
2059
|
i.forEach(function(a) {
|
|
2060
2060
|
if (a.auto) throw new $.Schema("Only primary key can be marked as autoIncrement (++)");
|
|
2061
2061
|
if (!a.keyPath) throw new $.Schema("Index must have a name and cannot be an empty string");
|
|
2062
|
-
}), t[n] =
|
|
2062
|
+
}), t[n] = Sn(n, o, i);
|
|
2063
2063
|
}
|
|
2064
2064
|
});
|
|
2065
2065
|
}, Ft.prototype.stores = function(n) {
|
|
2066
2066
|
var t = this.db;
|
|
2067
|
-
this._cfg.storesSource = this._cfg.storesSource ?
|
|
2067
|
+
this._cfg.storesSource = this._cfg.storesSource ? M(this._cfg.storesSource, n) : n;
|
|
2068
2068
|
var n = t._versions, i = {}, o = {};
|
|
2069
2069
|
return n.forEach(function(a) {
|
|
2070
|
-
|
|
2071
|
-
}), t._dbSchema = o, En(t, [t._allTables, t, t.Transaction.prototype]), Lt(t, [t._allTables, t, t.Transaction.prototype, this._cfg.tables],
|
|
2070
|
+
M(i, a._cfg.storesSource), o = a._cfg.dbschema = {}, a._parseStoresSpec(i, o);
|
|
2071
|
+
}), t._dbSchema = o, En(t, [t._allTables, t, t.Transaction.prototype]), Lt(t, [t._allTables, t, t.Transaction.prototype, this._cfg.tables], K(o), o), t._storeNames = K(o), this;
|
|
2072
2072
|
}, Ft.prototype.upgrade = function(e) {
|
|
2073
2073
|
return this._cfg.contentUpgrade = on(this._cfg.contentUpgrade || J, e), this;
|
|
2074
2074
|
}, Ft);
|
|
@@ -2092,15 +2092,15 @@ var Tr = { exports: {} };
|
|
|
2092
2092
|
var se = function(e, t) {
|
|
2093
2093
|
if (!this) {
|
|
2094
2094
|
var n = new se();
|
|
2095
|
-
return e && "d" in e &&
|
|
2095
|
+
return e && "d" in e && M(n, e), n;
|
|
2096
2096
|
}
|
|
2097
|
-
|
|
2097
|
+
M(this, arguments.length ? { d: 1, from: e, to: 1 < arguments.length ? t : e } : { d: 0 });
|
|
2098
2098
|
};
|
|
2099
2099
|
function bt(e, t, n) {
|
|
2100
2100
|
var i = Y(t, n);
|
|
2101
2101
|
if (!isNaN(i)) {
|
|
2102
2102
|
if (0 < i) throw RangeError();
|
|
2103
|
-
if (Pn(e)) return
|
|
2103
|
+
if (Pn(e)) return M(e, { from: t, to: n, d: 1 });
|
|
2104
2104
|
var o = e.l, i = e.r;
|
|
2105
2105
|
if (Y(n, e.from) < 0) return o ? bt(o, t, n) : e.l = { from: t, to: n, d: 1, l: null, r: null }, wr(e);
|
|
2106
2106
|
if (0 < Y(t, e.to)) return i ? bt(i, t, n) : e.r = { from: t, to: n, d: 1, l: null, r: null }, wr(e);
|
|
@@ -2144,14 +2144,14 @@ var Tr = { exports: {} };
|
|
|
2144
2144
|
}
|
|
2145
2145
|
function wr(e) {
|
|
2146
2146
|
var t, n, i = (((t = e.r) === null || t === void 0 ? void 0 : t.d) || 0) - (((n = e.l) === null || n === void 0 ? void 0 : n.d) || 0), o = 1 < i ? "r" : i < -1 ? "l" : "";
|
|
2147
|
-
o && (t = o == "r" ? "l" : "r", n = l({}, e), i = e[o], e.from = i.from, e.to = i.to, e[o] = i[o], n[o] = i[t], (e[t] = n).d =
|
|
2147
|
+
o && (t = o == "r" ? "l" : "r", n = l({}, e), i = e[o], e.from = i.from, e.to = i.to, e[o] = i[o], n[o] = i[t], (e[t] = n).d = Sr(n)), e.d = Sr(e);
|
|
2148
2148
|
}
|
|
2149
|
-
function
|
|
2149
|
+
function Sr(n) {
|
|
2150
2150
|
var t = n.r, n = n.l;
|
|
2151
2151
|
return (t ? n ? Math.max(t.d, n.d) : t.d : n ? n.d : 0) + 1;
|
|
2152
2152
|
}
|
|
2153
2153
|
function zt(e, t) {
|
|
2154
|
-
return
|
|
2154
|
+
return K(t).forEach(function(n) {
|
|
2155
2155
|
e[n] ? vt(e[n], t[n]) : e[n] = function i(o) {
|
|
2156
2156
|
var a, c, u = {};
|
|
2157
2157
|
for (a in o) ee(o, a) && (c = o[a], u[a] = !c || typeof c != "object" || Xn.has(c.constructor) ? c : i(c));
|
|
@@ -2188,27 +2188,27 @@ var Tr = { exports: {} };
|
|
|
2188
2188
|
function Tn(e, t) {
|
|
2189
2189
|
t === void 0 && (t = !1);
|
|
2190
2190
|
var n = /* @__PURE__ */ new Set();
|
|
2191
|
-
if (e.all) for (var i = 0, o = Object.values(Fe); i < o.length; i++)
|
|
2191
|
+
if (e.all) for (var i = 0, o = Object.values(Fe); i < o.length; i++) _r(c = o[i], e, n, t);
|
|
2192
2192
|
else for (var a in e) {
|
|
2193
2193
|
var c, u = /^idb\:\/\/(.*)\/(.*)\//.exec(a);
|
|
2194
|
-
u && (a = u[1], u = u[2], (c = Fe["idb://".concat(a, "/").concat(u)]) &&
|
|
2194
|
+
u && (a = u[1], u = u[2], (c = Fe["idb://".concat(a, "/").concat(u)]) && _r(c, e, n, t));
|
|
2195
2195
|
}
|
|
2196
2196
|
n.forEach(function(h) {
|
|
2197
2197
|
return h();
|
|
2198
2198
|
});
|
|
2199
2199
|
}
|
|
2200
|
-
function
|
|
2200
|
+
function _r(e, t, n, i) {
|
|
2201
2201
|
for (var o = [], a = 0, c = Object.entries(e.queries.query); a < c.length; a++) {
|
|
2202
|
-
for (var u = c[a], h = u[0], g = [],
|
|
2203
|
-
var
|
|
2204
|
-
In(t,
|
|
2205
|
-
return n.add(
|
|
2206
|
-
}) : i && g.push(
|
|
2202
|
+
for (var u = c[a], h = u[0], g = [], v = 0, f = u[1]; v < f.length; v++) {
|
|
2203
|
+
var S = f[v];
|
|
2204
|
+
In(t, S.obsSet) ? S.subscribers.forEach(function(m) {
|
|
2205
|
+
return n.add(m);
|
|
2206
|
+
}) : i && g.push(S);
|
|
2207
2207
|
}
|
|
2208
2208
|
i && o.push([h, g]);
|
|
2209
2209
|
}
|
|
2210
|
-
if (i) for (var p = 0,
|
|
2211
|
-
var w =
|
|
2210
|
+
if (i) for (var p = 0, b = o; p < b.length; p++) {
|
|
2211
|
+
var w = b[p], h = w[0], g = w[1];
|
|
2212
2212
|
e.queries.query[h] = g;
|
|
2213
2213
|
}
|
|
2214
2214
|
}
|
|
@@ -2223,24 +2223,24 @@ var Tr = { exports: {} };
|
|
|
2223
2223
|
if (t.openCanceller !== i) throw new $.DatabaseClosed("db.open() was cancelled");
|
|
2224
2224
|
}
|
|
2225
2225
|
function u() {
|
|
2226
|
-
return new B(function(
|
|
2226
|
+
return new B(function(S, p) {
|
|
2227
2227
|
if (c(), !n) throw new $.MissingAPI();
|
|
2228
|
-
var
|
|
2228
|
+
var b = e.name, w = t.autoSchema || !o ? n.open(b) : n.open(b, o);
|
|
2229
2229
|
if (!w) throw new $.MissingAPI();
|
|
2230
|
-
w.onerror = be(p), w.onblocked = q(e._fireOnBlocked), w.onupgradeneeded = q(function(
|
|
2231
|
-
var
|
|
2232
|
-
|
|
2233
|
-
p(new $.NoSuchDatabase("Database ".concat(
|
|
2234
|
-
})) : (
|
|
2230
|
+
w.onerror = be(p), w.onblocked = q(e._fireOnBlocked), w.onupgradeneeded = q(function(m) {
|
|
2231
|
+
var _;
|
|
2232
|
+
v = w.transaction, t.autoSchema && !e._options.allowEmptyDB ? (w.onerror = pt, v.abort(), w.result.close(), (_ = n.deleteDatabase(b)).onsuccess = _.onerror = q(function() {
|
|
2233
|
+
p(new $.NoSuchDatabase("Database ".concat(b, " doesnt exist")));
|
|
2234
|
+
})) : (v.onerror = be(p), m = m.oldVersion > Math.pow(2, 62) ? 0 : m.oldVersion, f = m < 1, e.idbdb = w.result, a && pi(e, v), hi(e, m / 10, v, p));
|
|
2235
2235
|
}, p), w.onsuccess = q(function() {
|
|
2236
|
-
|
|
2237
|
-
var
|
|
2236
|
+
v = null;
|
|
2237
|
+
var m, _, E, O, A, P = e.idbdb = w.result, T = _t(P.objectStoreNames);
|
|
2238
2238
|
if (0 < T.length) try {
|
|
2239
2239
|
var I = P.transaction((O = T).length === 1 ? O[0] : O, "readonly");
|
|
2240
|
-
if (t.autoSchema)
|
|
2240
|
+
if (t.autoSchema) _ = P, E = I, (m = e).verno = _.version / 10, E = m._dbSchema = $t(0, _, E), m._storeNames = _t(_.objectStoreNames, 0), Lt(m, [m._allTables], K(E), E);
|
|
2241
2241
|
else if (Ut(e, e._dbSchema, I), ((A = On($t(0, (A = e).idbdb, I), A._dbSchema)).add.length || A.change.some(function(C) {
|
|
2242
2242
|
return C.add.length || C.change.length;
|
|
2243
|
-
})) && !a) return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."), P.close(), o = P.version + 1, a = !0,
|
|
2243
|
+
})) && !a) return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."), P.close(), o = P.version + 1, a = !0, S(u());
|
|
2244
2244
|
Bt(e, I);
|
|
2245
2245
|
} catch {
|
|
2246
2246
|
}
|
|
@@ -2248,23 +2248,23 @@ var Tr = { exports: {} };
|
|
|
2248
2248
|
t.vcFired = !0, e.on("versionchange").fire(C);
|
|
2249
2249
|
}), P.onclose = q(function(C) {
|
|
2250
2250
|
e.on("close").fire(C);
|
|
2251
|
-
}), f && (A = e._deps, I =
|
|
2251
|
+
}), f && (A = e._deps, I = b, P = A.indexedDB, A = A.IDBKeyRange, kn(P) || I === Tt || An(P, A).put({ name: I }).catch(J)), S();
|
|
2252
2252
|
}, p);
|
|
2253
|
-
}).catch(function(
|
|
2254
|
-
switch (
|
|
2253
|
+
}).catch(function(S) {
|
|
2254
|
+
switch (S == null ? void 0 : S.name) {
|
|
2255
2255
|
case "UnknownError":
|
|
2256
2256
|
if (0 < t.PR1398_maxLoop) return t.PR1398_maxLoop--, console.warn("Dexie: Workaround for Chrome UnknownError on open()"), u();
|
|
2257
2257
|
break;
|
|
2258
2258
|
case "VersionError":
|
|
2259
2259
|
if (0 < o) return o = 0, u();
|
|
2260
2260
|
}
|
|
2261
|
-
return B.reject(
|
|
2261
|
+
return B.reject(S);
|
|
2262
2262
|
});
|
|
2263
2263
|
}
|
|
2264
|
-
var h, g = t.dbReadyResolve,
|
|
2265
|
-
return B.race([i, (typeof navigator > "u" ? B.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(
|
|
2264
|
+
var h, g = t.dbReadyResolve, v = null, f = !1;
|
|
2265
|
+
return B.race([i, (typeof navigator > "u" ? B.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(S) {
|
|
2266
2266
|
function p() {
|
|
2267
|
-
return indexedDB.databases().finally(
|
|
2267
|
+
return indexedDB.databases().finally(S);
|
|
2268
2268
|
}
|
|
2269
2269
|
h = setInterval(p, 100), p();
|
|
2270
2270
|
}).finally(function() {
|
|
@@ -2272,32 +2272,32 @@ var Tr = { exports: {} };
|
|
|
2272
2272
|
}) : Promise.resolve()).then(u)]).then(function() {
|
|
2273
2273
|
return c(), t.onReadyBeingFired = [], B.resolve(Dn(function() {
|
|
2274
2274
|
return e.on.ready.fire(e.vip);
|
|
2275
|
-
})).then(function
|
|
2275
|
+
})).then(function S() {
|
|
2276
2276
|
if (0 < t.onReadyBeingFired.length) {
|
|
2277
2277
|
var p = t.onReadyBeingFired.reduce(on, J);
|
|
2278
2278
|
return t.onReadyBeingFired = [], B.resolve(Dn(function() {
|
|
2279
2279
|
return p(e.vip);
|
|
2280
|
-
})).then(
|
|
2280
|
+
})).then(S);
|
|
2281
2281
|
}
|
|
2282
2282
|
});
|
|
2283
2283
|
}).finally(function() {
|
|
2284
2284
|
t.openCanceller === i && (t.onReadyBeingFired = null, t.isBeingOpened = !1);
|
|
2285
|
-
}).catch(function(
|
|
2286
|
-
t.dbOpenError =
|
|
2285
|
+
}).catch(function(S) {
|
|
2286
|
+
t.dbOpenError = S;
|
|
2287
2287
|
try {
|
|
2288
|
-
|
|
2288
|
+
v && v.abort();
|
|
2289
2289
|
} catch {
|
|
2290
2290
|
}
|
|
2291
|
-
return i === t.openCanceller && e._close(), te(
|
|
2291
|
+
return i === t.openCanceller && e._close(), te(S);
|
|
2292
2292
|
}).finally(function() {
|
|
2293
2293
|
t.openComplete = !0, g();
|
|
2294
2294
|
}).then(function() {
|
|
2295
|
-
var
|
|
2296
|
-
return f && (
|
|
2297
|
-
p.schema.indexes.forEach(function(
|
|
2298
|
-
|
|
2299
|
-
}),
|
|
2300
|
-
}), Ce(gt).fire(
|
|
2295
|
+
var S;
|
|
2296
|
+
return f && (S = {}, e.tables.forEach(function(p) {
|
|
2297
|
+
p.schema.indexes.forEach(function(b) {
|
|
2298
|
+
b.name && (S["idb://".concat(e.name, "/").concat(p.name, "/").concat(b.name)] = new se(-1 / 0, [[[]]]));
|
|
2299
|
+
}), S["idb://".concat(e.name, "/").concat(p.name, "/")] = S["idb://".concat(e.name, "/").concat(p.name, "/:dels")] = new se(-1 / 0, [[[]]]);
|
|
2300
|
+
}), Ce(gt).fire(S), Tn(S, !0)), e;
|
|
2301
2301
|
});
|
|
2302
2302
|
}
|
|
2303
2303
|
function Mn(e) {
|
|
@@ -2322,54 +2322,54 @@ var Tr = { exports: {} };
|
|
|
2322
2322
|
var mi = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(e) {
|
|
2323
2323
|
return l(l({}, e), { table: function(t) {
|
|
2324
2324
|
var n = e.table(t), i = n.schema, o = {}, a = [];
|
|
2325
|
-
function c(f,
|
|
2326
|
-
var
|
|
2327
|
-
return w.push(
|
|
2325
|
+
function c(f, S, p) {
|
|
2326
|
+
var b = mt(f), w = o[b] = o[b] || [], m = f == null ? 0 : typeof f == "string" ? 1 : f.length, _ = 0 < S, _ = l(l({}, p), { name: _ ? "".concat(b, "(virtual-from:").concat(p.name, ")") : p.name, lowLevelIndex: p, isVirtual: _, keyTail: S, keyLength: m, extractKey: _n(f), unique: !_ && p.unique });
|
|
2327
|
+
return w.push(_), _.isPrimaryKey || a.push(_), 1 < m && c(m === 2 ? f[0] : f.slice(0, m - 1), S + 1, p), w.sort(function(E, O) {
|
|
2328
2328
|
return E.keyTail - O.keyTail;
|
|
2329
|
-
}),
|
|
2329
|
+
}), _;
|
|
2330
2330
|
}
|
|
2331
2331
|
t = c(i.primaryKey.keyPath, 0, i.primaryKey), o[":id"] = [t];
|
|
2332
2332
|
for (var u = 0, h = i.indexes; u < h.length; u++) {
|
|
2333
2333
|
var g = h[u];
|
|
2334
2334
|
c(g.keyPath, 0, g);
|
|
2335
2335
|
}
|
|
2336
|
-
function
|
|
2337
|
-
var
|
|
2338
|
-
return p.isVirtual ? l(l({}, f), { query: { index: p.lowLevelIndex, range: (
|
|
2336
|
+
function v(f) {
|
|
2337
|
+
var S, p = f.query.index;
|
|
2338
|
+
return p.isVirtual ? l(l({}, f), { query: { index: p.lowLevelIndex, range: (S = f.query.range, p = p.keyTail, { type: S.type === 1 ? 2 : S.type, lower: Yt(S.lower, S.lowerOpen ? e.MAX_KEY : e.MIN_KEY, p), lowerOpen: !0, upper: Yt(S.upper, S.upperOpen ? e.MIN_KEY : e.MAX_KEY, p), upperOpen: !0 }) } }) : f;
|
|
2339
2339
|
}
|
|
2340
2340
|
return l(l({}, n), { schema: l(l({}, i), { primaryKey: t, indexes: a, getIndexByKeyPath: function(f) {
|
|
2341
2341
|
return (f = o[mt(f)]) && f[0];
|
|
2342
2342
|
} }), count: function(f) {
|
|
2343
|
-
return n.count(
|
|
2343
|
+
return n.count(v(f));
|
|
2344
2344
|
}, query: function(f) {
|
|
2345
|
-
return n.query(
|
|
2345
|
+
return n.query(v(f));
|
|
2346
2346
|
}, openCursor: function(f) {
|
|
2347
|
-
var
|
|
2348
|
-
return
|
|
2349
|
-
return
|
|
2347
|
+
var S = f.query.index, p = S.keyTail, b = S.isVirtual, w = S.keyLength;
|
|
2348
|
+
return b ? n.openCursor(v(f)).then(function(_) {
|
|
2349
|
+
return _ && m(_);
|
|
2350
2350
|
}) : n.openCursor(f);
|
|
2351
|
-
function
|
|
2352
|
-
return Object.create(
|
|
2353
|
-
E != null ?
|
|
2351
|
+
function m(_) {
|
|
2352
|
+
return Object.create(_, { continue: { value: function(E) {
|
|
2353
|
+
E != null ? _.continue(Yt(E, f.reverse ? e.MAX_KEY : e.MIN_KEY, p)) : f.unique ? _.continue(_.key.slice(0, w).concat(f.reverse ? e.MIN_KEY : e.MAX_KEY, p)) : _.continue();
|
|
2354
2354
|
} }, continuePrimaryKey: { value: function(E, O) {
|
|
2355
|
-
|
|
2355
|
+
_.continuePrimaryKey(Yt(E, e.MAX_KEY, p), O);
|
|
2356
2356
|
} }, primaryKey: { get: function() {
|
|
2357
|
-
return
|
|
2357
|
+
return _.primaryKey;
|
|
2358
2358
|
} }, key: { get: function() {
|
|
2359
|
-
var E =
|
|
2359
|
+
var E = _.key;
|
|
2360
2360
|
return w === 1 ? E[0] : E.slice(0, w);
|
|
2361
2361
|
} }, value: { get: function() {
|
|
2362
|
-
return
|
|
2362
|
+
return _.value;
|
|
2363
2363
|
} } });
|
|
2364
2364
|
}
|
|
2365
2365
|
} });
|
|
2366
2366
|
} });
|
|
2367
2367
|
} };
|
|
2368
2368
|
function jn(e, t, n, i) {
|
|
2369
|
-
return n = n || {}, i = i || "",
|
|
2369
|
+
return n = n || {}, i = i || "", K(e).forEach(function(o) {
|
|
2370
2370
|
var a, c, u;
|
|
2371
2371
|
ee(t, o) ? (a = e[o], c = t[o], typeof a == "object" && typeof c == "object" && a && c ? (u = en(a)) !== en(c) ? n[i + o] = t[o] : u === "Object" ? jn(a, c, n, i + o + ".") : a !== c && (n[i + o] = t[o]) : a !== c && (n[i + o] = t[o])) : n[i + o] = void 0;
|
|
2372
|
-
}),
|
|
2372
|
+
}), K(t).forEach(function(o) {
|
|
2373
2373
|
ee(e, o) || (n[i + o] = t[o]);
|
|
2374
2374
|
}), n;
|
|
2375
2375
|
}
|
|
@@ -2385,46 +2385,46 @@ var Tr = { exports: {} };
|
|
|
2385
2385
|
case "add":
|
|
2386
2386
|
if (h.fire === J) break;
|
|
2387
2387
|
return a._promise("readwrite", function() {
|
|
2388
|
-
return
|
|
2388
|
+
return v(o);
|
|
2389
2389
|
}, !0);
|
|
2390
2390
|
case "put":
|
|
2391
2391
|
if (h.fire === J && g.fire === J) break;
|
|
2392
2392
|
return a._promise("readwrite", function() {
|
|
2393
|
-
return
|
|
2393
|
+
return v(o);
|
|
2394
2394
|
}, !0);
|
|
2395
2395
|
case "delete":
|
|
2396
2396
|
if (u.fire === J) break;
|
|
2397
2397
|
return a._promise("readwrite", function() {
|
|
2398
|
-
return
|
|
2398
|
+
return v(o);
|
|
2399
2399
|
}, !0);
|
|
2400
2400
|
case "deleteRange":
|
|
2401
2401
|
if (u.fire === J) break;
|
|
2402
2402
|
return a._promise("readwrite", function() {
|
|
2403
|
-
return function f(
|
|
2404
|
-
return n.query({ trans:
|
|
2405
|
-
var
|
|
2406
|
-
return
|
|
2407
|
-
return 0 <
|
|
2403
|
+
return function f(S, p, b) {
|
|
2404
|
+
return n.query({ trans: S, values: !1, query: { index: i, range: p }, limit: b }).then(function(w) {
|
|
2405
|
+
var m = w.result;
|
|
2406
|
+
return v({ type: "delete", keys: m, trans: S }).then(function(_) {
|
|
2407
|
+
return 0 < _.numFailures ? Promise.reject(_.failures[0]) : m.length < b ? { failures: [], numFailures: 0, lastResult: void 0 } : f(S, l(l({}, p), { lower: m[m.length - 1], lowerOpen: !0 }), b);
|
|
2408
2408
|
});
|
|
2409
2409
|
});
|
|
2410
2410
|
}(o.trans, o.range, 1e4);
|
|
2411
2411
|
}, !0);
|
|
2412
2412
|
}
|
|
2413
2413
|
return n.mutate(o);
|
|
2414
|
-
function
|
|
2415
|
-
var
|
|
2416
|
-
if (!
|
|
2417
|
-
return (f = f.type === "add" || f.type === "put" ? l(l({}, f), { keys:
|
|
2418
|
-
var E =
|
|
2419
|
-
var P, T, I, C =
|
|
2420
|
-
return f.type === "delete" ? u.fire.call(
|
|
2414
|
+
function v(f) {
|
|
2415
|
+
var S, p, b, w = G.trans, m = f.keys || Nn(i, f);
|
|
2416
|
+
if (!m) throw new Error("Keys missing");
|
|
2417
|
+
return (f = f.type === "add" || f.type === "put" ? l(l({}, f), { keys: m }) : l({}, f)).type !== "delete" && (f.values = x([], f.values)), f.keys && (f.keys = x([], f.keys)), S = n, b = m, ((p = f).type === "add" ? Promise.resolve([]) : S.getMany({ trans: p.trans, keys: b, cache: "immutable" })).then(function(_) {
|
|
2418
|
+
var E = m.map(function(O, A) {
|
|
2419
|
+
var P, T, I, C = _[A], j = { onerror: null, onsuccess: null };
|
|
2420
|
+
return f.type === "delete" ? u.fire.call(j, O, C, w) : f.type === "add" || C === void 0 ? (P = h.fire.call(j, O, f.values[A], w), O == null && P != null && (f.keys[A] = O = P, i.outbound || fe(f.values[A], i.keyPath, O))) : (P = jn(C, f.values[A]), (T = g.fire.call(j, P, O, C, w)) && (I = f.values[A], Object.keys(T).forEach(function(R) {
|
|
2421
2421
|
ee(I, R) ? I[R] = T[R] : fe(I, R, T[R]);
|
|
2422
|
-
}))),
|
|
2422
|
+
}))), j;
|
|
2423
2423
|
});
|
|
2424
2424
|
return n.mutate(f).then(function(O) {
|
|
2425
|
-
for (var A = O.failures, P = O.results, T = O.numFailures, O = O.lastResult, I = 0; I <
|
|
2426
|
-
var C = (P ||
|
|
2427
|
-
C == null ?
|
|
2425
|
+
for (var A = O.failures, P = O.results, T = O.numFailures, O = O.lastResult, I = 0; I < m.length; ++I) {
|
|
2426
|
+
var C = (P || m)[I], j = E[I];
|
|
2427
|
+
C == null ? j.onerror && j.onerror(A[I]) : j.onsuccess && j.onsuccess(f.type === "put" && _[I] ? f.values[I] : C);
|
|
2428
2428
|
}
|
|
2429
2429
|
return { failures: A, results: P, numFailures: T, lastResult: O };
|
|
2430
2430
|
}).catch(function(O) {
|
|
@@ -2482,14 +2482,14 @@ var Tr = { exports: {} };
|
|
|
2482
2482
|
}, table: function(i) {
|
|
2483
2483
|
var o = e.table(i), a = o.schema, c = a.primaryKey, f = a.indexes, u = c.extractKey, h = c.outbound, g = c.autoIncrement && f.filter(function(p) {
|
|
2484
2484
|
return p.compound && p.keyPath.includes(c.keyPath);
|
|
2485
|
-
}),
|
|
2486
|
-
function
|
|
2485
|
+
}), v = l(l({}, o), { mutate: function(p) {
|
|
2486
|
+
function b(R) {
|
|
2487
2487
|
return R = "idb://".concat(t, "/").concat(i, "/").concat(R), O[R] || (O[R] = new se());
|
|
2488
2488
|
}
|
|
2489
|
-
var w,
|
|
2489
|
+
var w, m, _, E = p.trans, O = p.mutatedParts || (p.mutatedParts = {}), A = b(""), P = b(":dels"), T = p.type, j = p.type === "deleteRange" ? [p.range] : p.type === "delete" ? [p.keys] : p.values.length < 50 ? [Nn(c, p).filter(function(R) {
|
|
2490
2490
|
return R;
|
|
2491
|
-
}), p.values] : [], I =
|
|
2492
|
-
return U(I) ? (A.addKeys(I), (
|
|
2491
|
+
}), p.values] : [], I = j[0], C = j[1], j = p.trans._cache;
|
|
2492
|
+
return U(I) ? (A.addKeys(I), (j = T === "delete" || I.length === C.length ? Er(I, j) : null) || P.addKeys(I), (j || C) && (w = b, m = j, _ = C, a.indexes.forEach(function(R) {
|
|
2493
2493
|
var L = w(R.name || "");
|
|
2494
2494
|
function W(H) {
|
|
2495
2495
|
return H != null ? R.extractKey(H) : null;
|
|
@@ -2499,12 +2499,12 @@ var Tr = { exports: {} };
|
|
|
2499
2499
|
return L.addKey(pe);
|
|
2500
2500
|
}) : L.addKey(H);
|
|
2501
2501
|
}
|
|
2502
|
-
(
|
|
2503
|
-
var F =
|
|
2502
|
+
(m || _).forEach(function(H, ce) {
|
|
2503
|
+
var F = m && W(m[ce]), ce = _ && W(_[ce]);
|
|
2504
2504
|
Y(F, ce) !== 0 && (F != null && z(F), ce != null && z(ce));
|
|
2505
2505
|
});
|
|
2506
2506
|
}))) : I ? (C = { from: (C = I.lower) !== null && C !== void 0 ? C : e.MIN_KEY, to: (C = I.upper) !== null && C !== void 0 ? C : e.MAX_KEY }, P.add(C), A.add(C)) : (A.add(n), P.add(n), a.indexes.forEach(function(R) {
|
|
2507
|
-
return
|
|
2507
|
+
return b(R.name).add(n);
|
|
2508
2508
|
})), o.mutate(p).then(function(R) {
|
|
2509
2509
|
return !I || p.type !== "add" && p.type !== "put" || (A.addKeys(R.results), g && g.forEach(function(L) {
|
|
2510
2510
|
for (var W = p.values.map(function(F) {
|
|
@@ -2512,36 +2512,36 @@ var Tr = { exports: {} };
|
|
|
2512
2512
|
}), z = L.keyPath.findIndex(function(F) {
|
|
2513
2513
|
return F === c.keyPath;
|
|
2514
2514
|
}), H = 0, pe = R.results.length; H < pe; ++H) W[H][z] = R.results[H];
|
|
2515
|
-
|
|
2515
|
+
b(L.name).addKeys(W);
|
|
2516
2516
|
})), E.mutatedParts = zt(E.mutatedParts || {}, O), R;
|
|
2517
2517
|
});
|
|
2518
|
-
} }), f = function(
|
|
2519
|
-
var w =
|
|
2520
|
-
return [
|
|
2521
|
-
},
|
|
2518
|
+
} }), f = function(b) {
|
|
2519
|
+
var w = b.query, b = w.index, w = w.range;
|
|
2520
|
+
return [b, new se((b = w.lower) !== null && b !== void 0 ? b : e.MIN_KEY, (w = w.upper) !== null && w !== void 0 ? w : e.MAX_KEY)];
|
|
2521
|
+
}, S = { get: function(p) {
|
|
2522
2522
|
return [c, new se(p.key)];
|
|
2523
2523
|
}, getMany: function(p) {
|
|
2524
2524
|
return [c, new se().addKeys(p.keys)];
|
|
2525
2525
|
}, count: f, query: f, openCursor: f };
|
|
2526
|
-
return
|
|
2527
|
-
|
|
2528
|
-
var w = G.subscr,
|
|
2529
|
-
if (
|
|
2526
|
+
return K(S).forEach(function(p) {
|
|
2527
|
+
v[p] = function(b) {
|
|
2528
|
+
var w = G.subscr, m = !!w, _ = Or(G, o) && xr(p, b) ? b.obsSet = {} : w;
|
|
2529
|
+
if (m) {
|
|
2530
2530
|
var E = function(C) {
|
|
2531
|
-
return C = "idb://".concat(t, "/").concat(i, "/").concat(C),
|
|
2532
|
-
}, O = E(""), A = E(":dels"), w =
|
|
2533
|
-
if ((p === "query" &&
|
|
2531
|
+
return C = "idb://".concat(t, "/").concat(i, "/").concat(C), _[C] || (_[C] = new se());
|
|
2532
|
+
}, O = E(""), A = E(":dels"), w = S[p](b), m = w[0], w = w[1];
|
|
2533
|
+
if ((p === "query" && m.isPrimaryKey && !b.values ? A : E(m.name || "")).add(w), !m.isPrimaryKey) {
|
|
2534
2534
|
if (p !== "count") {
|
|
2535
|
-
var P = p === "query" && h &&
|
|
2535
|
+
var P = p === "query" && h && b.values && o.query(l(l({}, b), { values: !1 }));
|
|
2536
2536
|
return o[p].apply(this, arguments).then(function(C) {
|
|
2537
2537
|
if (p === "query") {
|
|
2538
|
-
if (h &&
|
|
2538
|
+
if (h && b.values) return P.then(function(W) {
|
|
2539
2539
|
return W = W.result, O.addKeys(W), C;
|
|
2540
2540
|
});
|
|
2541
|
-
var
|
|
2542
|
-
(
|
|
2541
|
+
var j = b.values ? C.result.map(u) : C.result;
|
|
2542
|
+
(b.values ? O : A).addKeys(j);
|
|
2543
2543
|
} else if (p === "openCursor") {
|
|
2544
|
-
var R = C, L =
|
|
2544
|
+
var R = C, L = b.values;
|
|
2545
2545
|
return R && Object.create(R, { key: { get: function() {
|
|
2546
2546
|
return A.addKey(R.primaryKey), R.key;
|
|
2547
2547
|
} }, primaryKey: { get: function() {
|
|
@@ -2559,7 +2559,7 @@ var Tr = { exports: {} };
|
|
|
2559
2559
|
}
|
|
2560
2560
|
return o[p].apply(this, arguments);
|
|
2561
2561
|
};
|
|
2562
|
-
}),
|
|
2562
|
+
}), v;
|
|
2563
2563
|
} });
|
|
2564
2564
|
} };
|
|
2565
2565
|
function Ar(e, t, n) {
|
|
@@ -2576,60 +2576,60 @@ var Tr = { exports: {} };
|
|
|
2576
2576
|
return n = e, ((i = t).lower === void 0 || (i.lowerOpen ? 0 < Y(n, i.lower) : 0 <= Y(n, i.lower))) && (e = e, (t = t).upper === void 0 || (t.upperOpen ? Y(e, t.upper) < 0 : Y(e, t.upper) <= 0));
|
|
2577
2577
|
var n, i;
|
|
2578
2578
|
}
|
|
2579
|
-
function kr(e, t,
|
|
2580
|
-
if (!
|
|
2581
|
-
var c = t.query.index, u = c.multiEntry, h = t.query.range, g = i.schema.primaryKey.extractKey,
|
|
2582
|
-
var w = p,
|
|
2583
|
-
if (
|
|
2584
|
-
var O, A =
|
|
2585
|
-
|
|
2579
|
+
function kr(e, t, S, i, o, a) {
|
|
2580
|
+
if (!S || S.length === 0) return e;
|
|
2581
|
+
var c = t.query.index, u = c.multiEntry, h = t.query.range, g = i.schema.primaryKey.extractKey, v = c.extractKey, f = (c.lowLevelIndex || c).extractKey, S = S.reduce(function(p, b) {
|
|
2582
|
+
var w = p, m = [];
|
|
2583
|
+
if (b.type === "add" || b.type === "put") for (var _ = new se(), E = b.values.length - 1; 0 <= E; --E) {
|
|
2584
|
+
var O, A = b.values[E], P = g(A);
|
|
2585
|
+
_.hasKey(P) || (O = v(A), (u && U(O) ? O.some(function(R) {
|
|
2586
2586
|
return Kn(R, h);
|
|
2587
|
-
}) : Kn(O, h)) && (
|
|
2587
|
+
}) : Kn(O, h)) && (_.addKey(P), m.push(A)));
|
|
2588
2588
|
}
|
|
2589
|
-
switch (
|
|
2589
|
+
switch (b.type) {
|
|
2590
2590
|
case "add":
|
|
2591
2591
|
var T = new se().addKeys(t.values ? p.map(function(L) {
|
|
2592
2592
|
return g(L);
|
|
2593
|
-
}) : p), w = p.concat(t.values ?
|
|
2593
|
+
}) : p), w = p.concat(t.values ? m.filter(function(L) {
|
|
2594
2594
|
return L = g(L), !T.hasKey(L) && (T.addKey(L), !0);
|
|
2595
|
-
}) :
|
|
2595
|
+
}) : m.map(function(L) {
|
|
2596
2596
|
return g(L);
|
|
2597
2597
|
}).filter(function(L) {
|
|
2598
2598
|
return !T.hasKey(L) && (T.addKey(L), !0);
|
|
2599
2599
|
}));
|
|
2600
2600
|
break;
|
|
2601
2601
|
case "put":
|
|
2602
|
-
var I = new se().addKeys(
|
|
2602
|
+
var I = new se().addKeys(b.values.map(function(L) {
|
|
2603
2603
|
return g(L);
|
|
2604
2604
|
}));
|
|
2605
2605
|
w = p.filter(function(L) {
|
|
2606
2606
|
return !I.hasKey(t.values ? g(L) : L);
|
|
2607
|
-
}).concat(t.values ?
|
|
2607
|
+
}).concat(t.values ? m : m.map(function(L) {
|
|
2608
2608
|
return g(L);
|
|
2609
2609
|
}));
|
|
2610
2610
|
break;
|
|
2611
2611
|
case "delete":
|
|
2612
|
-
var C = new se().addKeys(
|
|
2612
|
+
var C = new se().addKeys(b.keys);
|
|
2613
2613
|
w = p.filter(function(L) {
|
|
2614
2614
|
return !C.hasKey(t.values ? g(L) : L);
|
|
2615
2615
|
});
|
|
2616
2616
|
break;
|
|
2617
2617
|
case "deleteRange":
|
|
2618
|
-
var
|
|
2618
|
+
var j = b.range;
|
|
2619
2619
|
w = p.filter(function(L) {
|
|
2620
|
-
return !Kn(g(L),
|
|
2620
|
+
return !Kn(g(L), j);
|
|
2621
2621
|
});
|
|
2622
2622
|
}
|
|
2623
2623
|
return w;
|
|
2624
2624
|
}, e);
|
|
2625
|
-
return
|
|
2626
|
-
return Y(f(p), f(
|
|
2627
|
-
}), t.limit && t.limit < 1 / 0 && (
|
|
2625
|
+
return S === e ? e : (S.sort(function(p, b) {
|
|
2626
|
+
return Y(f(p), f(b)) || Y(g(p), g(b));
|
|
2627
|
+
}), t.limit && t.limit < 1 / 0 && (S.length > t.limit ? S.length = t.limit : e.length === t.limit && S.length < t.limit && (o.dirty = !0)), a ? Object.freeze(S) : S);
|
|
2628
2628
|
}
|
|
2629
2629
|
function Dr(e, t) {
|
|
2630
2630
|
return Y(e.lower, t.lower) === 0 && Y(e.upper, t.upper) === 0 && !!e.lowerOpen == !!t.lowerOpen && !!e.upperOpen == !!t.upperOpen;
|
|
2631
2631
|
}
|
|
2632
|
-
function
|
|
2632
|
+
function Si(e, t) {
|
|
2633
2633
|
return function(n, i, o, a) {
|
|
2634
2634
|
if (n === void 0) return i !== void 0 ? -1 : 0;
|
|
2635
2635
|
if (i === void 0) return 1;
|
|
@@ -2650,7 +2650,7 @@ var Tr = { exports: {} };
|
|
|
2650
2650
|
return i;
|
|
2651
2651
|
}(e.upper, t.upper, e.upperOpen, t.upperOpen);
|
|
2652
2652
|
}
|
|
2653
|
-
function
|
|
2653
|
+
function _i(e, t, n, i) {
|
|
2654
2654
|
e.subscribers.add(n), i.addEventListener("abort", function() {
|
|
2655
2655
|
var o, a;
|
|
2656
2656
|
e.subscribers.delete(n), e.subscribers.size === 0 && (o = e, a = t, setTimeout(function() {
|
|
@@ -2665,20 +2665,20 @@ var Tr = { exports: {} };
|
|
|
2665
2665
|
return i === "readwrite" && (c = (a = new AbortController()).signal, o = function(h) {
|
|
2666
2666
|
return function() {
|
|
2667
2667
|
if (a.abort(), i === "readwrite") {
|
|
2668
|
-
for (var g = /* @__PURE__ */ new Set(),
|
|
2669
|
-
var
|
|
2668
|
+
for (var g = /* @__PURE__ */ new Set(), v = 0, f = n; v < f.length; v++) {
|
|
2669
|
+
var S = f[v], p = Fe["idb://".concat(t, "/").concat(S)];
|
|
2670
2670
|
if (p) {
|
|
2671
|
-
var
|
|
2671
|
+
var b = e.table(S), w = p.optimisticOps.filter(function(L) {
|
|
2672
2672
|
return L.trans === u;
|
|
2673
2673
|
});
|
|
2674
|
-
if (u._explicit && h && u.mutatedParts) for (var
|
|
2674
|
+
if (u._explicit && h && u.mutatedParts) for (var m = 0, _ = Object.values(p.queries.query); m < _.length; m++) for (var E = 0, O = (T = _[m]).slice(); E < O.length; E++) In((I = O[E]).obsSet, u.mutatedParts) && (Me(T, I), I.subscribers.forEach(function(L) {
|
|
2675
2675
|
return g.add(L);
|
|
2676
2676
|
}));
|
|
2677
2677
|
else if (0 < w.length) {
|
|
2678
2678
|
p.optimisticOps = p.optimisticOps.filter(function(L) {
|
|
2679
2679
|
return L.trans !== u;
|
|
2680
2680
|
});
|
|
2681
|
-
for (var A = 0, P = Object.values(p.queries.query); A < P.length; A++) for (var T, I, C,
|
|
2681
|
+
for (var A = 0, P = Object.values(p.queries.query); A < P.length; A++) for (var T, I, C, j = 0, R = (T = P[A]).slice(); j < R.length; j++) (I = R[j]).res != null && u.mutatedParts && (h && !I.dirty ? (C = Object.isFrozen(I.res), C = kr(I.res, I.req, w, b, I, C), I.dirty ? (Me(T, I), I.subscribers.forEach(function(L) {
|
|
2682
2682
|
return g.add(L);
|
|
2683
2683
|
})) : C !== I.res && (I.res = C, I.promise = B.resolve({ result: C }))) : (I.dirty && Me(T, I), I.subscribers.forEach(function(L) {
|
|
2684
2684
|
return g.add(L);
|
|
@@ -2705,9 +2705,9 @@ var Tr = { exports: {} };
|
|
|
2705
2705
|
}), c.catch(function() {
|
|
2706
2706
|
Me(u.optimisticOps, a), a.mutatedParts && Ht(a.mutatedParts);
|
|
2707
2707
|
})) : c.then(function(h) {
|
|
2708
|
-
var g = Ar(0, l(l({}, a), { values: a.values.map(function(
|
|
2709
|
-
var
|
|
2710
|
-
return h.failures[f] ?
|
|
2708
|
+
var g = Ar(0, l(l({}, a), { values: a.values.map(function(v, f) {
|
|
2709
|
+
var S;
|
|
2710
|
+
return h.failures[f] ? v : (v = (S = o.keyPath) !== null && S !== void 0 && S.includes(".") ? Te(v) : l({}, v), fe(v, o.keyPath, h.results[f]), v);
|
|
2711
2711
|
}) }), h);
|
|
2712
2712
|
u.optimisticOps.push(g), queueMicrotask(function() {
|
|
2713
2713
|
return a.mutatedParts && Ht(a.mutatedParts);
|
|
@@ -2715,37 +2715,37 @@ var Tr = { exports: {} };
|
|
|
2715
2715
|
}), c) : i.mutate(a);
|
|
2716
2716
|
}, query: function(a) {
|
|
2717
2717
|
if (!Or(G, i) || !xr("query", a)) return i.query(a);
|
|
2718
|
-
var c = ((g = G.trans) === null || g === void 0 ? void 0 : g.db._options.cache) === "immutable", f = G, u = f.requery, h = f.signal, g = function(
|
|
2719
|
-
var E = Fe["idb://".concat(
|
|
2718
|
+
var c = ((g = G.trans) === null || g === void 0 ? void 0 : g.db._options.cache) === "immutable", f = G, u = f.requery, h = f.signal, g = function(b, w, m, _) {
|
|
2719
|
+
var E = Fe["idb://".concat(b, "/").concat(w)];
|
|
2720
2720
|
if (!E) return [];
|
|
2721
|
-
if (!(w = E.queries[
|
|
2722
|
-
var O = w[(
|
|
2721
|
+
if (!(w = E.queries[m])) return [null, !1, E, null];
|
|
2722
|
+
var O = w[(_.query ? _.query.index.name : null) || ""];
|
|
2723
2723
|
if (!O) return [null, !1, E, null];
|
|
2724
|
-
switch (
|
|
2724
|
+
switch (m) {
|
|
2725
2725
|
case "query":
|
|
2726
2726
|
var A = O.find(function(P) {
|
|
2727
|
-
return P.req.limit ===
|
|
2727
|
+
return P.req.limit === _.limit && P.req.values === _.values && Dr(P.req.query.range, _.query.range);
|
|
2728
2728
|
});
|
|
2729
2729
|
return A ? [A, !0, E, O] : [O.find(function(P) {
|
|
2730
|
-
return ("limit" in P.req ? P.req.limit : 1 / 0) >=
|
|
2730
|
+
return ("limit" in P.req ? P.req.limit : 1 / 0) >= _.limit && (!_.values || P.req.values) && Si(P.req.query.range, _.query.range);
|
|
2731
2731
|
}), !1, E, O];
|
|
2732
2732
|
case "count":
|
|
2733
2733
|
return A = O.find(function(P) {
|
|
2734
|
-
return Dr(P.req.query.range,
|
|
2734
|
+
return Dr(P.req.query.range, _.query.range);
|
|
2735
2735
|
}), [A, !!A, E, O];
|
|
2736
2736
|
}
|
|
2737
|
-
}(t, n, "query", a),
|
|
2738
|
-
return
|
|
2739
|
-
var w =
|
|
2740
|
-
if (
|
|
2741
|
-
for (var
|
|
2737
|
+
}(t, n, "query", a), v = g[0], f = g[1], S = g[2], p = g[3];
|
|
2738
|
+
return v && f ? v.obsSet = a.obsSet : (f = i.query(a).then(function(b) {
|
|
2739
|
+
var w = b.result;
|
|
2740
|
+
if (v && (v.res = w), c) {
|
|
2741
|
+
for (var m = 0, _ = w.length; m < _; ++m) Object.freeze(w[m]);
|
|
2742
2742
|
Object.freeze(w);
|
|
2743
|
-
} else
|
|
2744
|
-
return
|
|
2745
|
-
}).catch(function(
|
|
2746
|
-
return p &&
|
|
2747
|
-
}),
|
|
2748
|
-
return { result: kr(
|
|
2743
|
+
} else b.result = Te(w);
|
|
2744
|
+
return b;
|
|
2745
|
+
}).catch(function(b) {
|
|
2746
|
+
return p && v && Me(p, v), Promise.reject(b);
|
|
2747
|
+
}), v = { obsSet: a.obsSet, promise: f, subscribers: /* @__PURE__ */ new Set(), type: "query", req: a, dirty: !1 }, p ? p.push(v) : (p = [v], (S = S || (Fe["idb://".concat(t, "/").concat(n)] = { queries: { query: {}, count: {} }, objs: /* @__PURE__ */ new Map(), optimisticOps: [], unsignaledParts: {} })).queries.query[a.query.index.name || ""] = p)), _i(v, p, u, h), v.promise.then(function(b) {
|
|
2748
|
+
return { result: kr(b.result, a, S == null ? void 0 : S.optimisticOps, i, v, c) };
|
|
2749
2749
|
});
|
|
2750
2750
|
} });
|
|
2751
2751
|
} });
|
|
@@ -2814,8 +2814,8 @@ var Tr = { exports: {} };
|
|
|
2814
2814
|
t.close(e);
|
|
2815
2815
|
var u = t._deps.indexedDB.deleteDatabase(t.name);
|
|
2816
2816
|
u.onsuccess = q(function() {
|
|
2817
|
-
var h, g,
|
|
2818
|
-
h = t._deps, g = t.name,
|
|
2817
|
+
var h, g, v;
|
|
2818
|
+
h = t._deps, g = t.name, v = h.indexedDB, h = h.IDBKeyRange, kn(v) || g === Tt || An(v, h).delete(g).catch(J), o();
|
|
2819
2819
|
}), u.onerror = be(a), u.onblocked = t._fireOnBlocked;
|
|
2820
2820
|
}
|
|
2821
2821
|
if (n) throw new $.InvalidArgument("Invalid closeOptions argument to db.delete()");
|
|
@@ -2834,7 +2834,7 @@ var Tr = { exports: {} };
|
|
|
2834
2834
|
return this._state.autoSchema;
|
|
2835
2835
|
}, Object.defineProperty(ne.prototype, "tables", { get: function() {
|
|
2836
2836
|
var e = this;
|
|
2837
|
-
return
|
|
2837
|
+
return K(this._allTables).map(function(t) {
|
|
2838
2838
|
return e._allTables[t];
|
|
2839
2839
|
});
|
|
2840
2840
|
}, enumerable: !1, configurable: !0 }), ne.prototype.transaction = function() {
|
|
@@ -2872,35 +2872,35 @@ var Tr = { exports: {} };
|
|
|
2872
2872
|
}), u && o && !o.active && (o = null);
|
|
2873
2873
|
}
|
|
2874
2874
|
} catch (g) {
|
|
2875
|
-
return o ? o._promise(null, function(
|
|
2875
|
+
return o ? o._promise(null, function(v, f) {
|
|
2876
2876
|
f(g);
|
|
2877
2877
|
}) : te(g);
|
|
2878
2878
|
}
|
|
2879
|
-
var h = (function g(
|
|
2879
|
+
var h = (function g(v, f, S, p, b) {
|
|
2880
2880
|
return B.resolve().then(function() {
|
|
2881
|
-
var w = G.transless || G,
|
|
2882
|
-
if (
|
|
2881
|
+
var w = G.transless || G, m = v._createTransaction(f, S, v._dbSchema, p);
|
|
2882
|
+
if (m.explicit = !0, w = { trans: m, transless: w }, p) m.idbtrans = p.idbtrans;
|
|
2883
2883
|
else try {
|
|
2884
|
-
|
|
2884
|
+
m.create(), m.idbtrans._explicit = !0, v._state.PR1398_maxLoop = 3;
|
|
2885
2885
|
} catch (O) {
|
|
2886
|
-
return O.name === rn.InvalidState &&
|
|
2887
|
-
return g(
|
|
2886
|
+
return O.name === rn.InvalidState && v.isOpen() && 0 < --v._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), v.close({ disableAutoOpen: !1 }), v.open().then(function() {
|
|
2887
|
+
return g(v, f, S, null, b);
|
|
2888
2888
|
})) : te(O);
|
|
2889
2889
|
}
|
|
2890
|
-
var
|
|
2890
|
+
var _, E = nn(b);
|
|
2891
2891
|
return E && qe(), w = B.follow(function() {
|
|
2892
2892
|
var O;
|
|
2893
|
-
(
|
|
2894
|
-
}, w), (
|
|
2895
|
-
return
|
|
2893
|
+
(_ = b.call(m, m)) && (E ? (O = De.bind(null, null), _.then(O, O)) : typeof _.next == "function" && typeof _.throw == "function" && (_ = Mn(_)));
|
|
2894
|
+
}, w), (_ && typeof _.then == "function" ? B.resolve(_).then(function(O) {
|
|
2895
|
+
return m.active ? O : te(new $.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
|
|
2896
2896
|
}) : w.then(function() {
|
|
2897
|
-
return
|
|
2897
|
+
return _;
|
|
2898
2898
|
})).then(function(O) {
|
|
2899
|
-
return p &&
|
|
2899
|
+
return p && m._resolve(), m._completion.then(function() {
|
|
2900
2900
|
return O;
|
|
2901
2901
|
});
|
|
2902
2902
|
}).catch(function(O) {
|
|
2903
|
-
return
|
|
2903
|
+
return m._reject(O), te(O);
|
|
2904
2904
|
});
|
|
2905
2905
|
});
|
|
2906
2906
|
}).bind(null, this, a, c, o, n);
|
|
@@ -2919,75 +2919,75 @@ var Tr = { exports: {} };
|
|
|
2919
2919
|
var o, a, c, u, h, g = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: J, dbReadyPromise: null, cancelOpen: J, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: t.autoOpen };
|
|
2920
2920
|
g.dbReadyPromise = new B(function(f) {
|
|
2921
2921
|
g.dbReadyResolve = f;
|
|
2922
|
-
}), g.openCanceller = new B(function(f,
|
|
2923
|
-
g.cancelOpen =
|
|
2922
|
+
}), g.openCanceller = new B(function(f, S) {
|
|
2923
|
+
g.cancelOpen = S;
|
|
2924
2924
|
}), this._state = g, this.name = e, this.on = dt(this, "populate", "blocked", "versionchange", "close", { ready: [on, J] }), this.on.ready.subscribe = zn(this.on.ready.subscribe, function(f) {
|
|
2925
|
-
return function(
|
|
2925
|
+
return function(S, p) {
|
|
2926
2926
|
ne.vip(function() {
|
|
2927
|
-
var
|
|
2928
|
-
w.openComplete ? (w.dbOpenError || B.resolve().then(
|
|
2929
|
-
|
|
2927
|
+
var b, w = n._state;
|
|
2928
|
+
w.openComplete ? (w.dbOpenError || B.resolve().then(S), p && f(S)) : w.onReadyBeingFired ? (w.onReadyBeingFired.push(S), p && f(S)) : (f(S), b = n, p || f(function m() {
|
|
2929
|
+
b.on.ready.unsubscribe(S), b.on.ready.unsubscribe(m);
|
|
2930
2930
|
}));
|
|
2931
2931
|
});
|
|
2932
2932
|
};
|
|
2933
|
-
}), this.Collection = (o = this, ft(oi.prototype, function(
|
|
2933
|
+
}), this.Collection = (o = this, ft(oi.prototype, function(_, m) {
|
|
2934
2934
|
this.db = o;
|
|
2935
|
-
var p = or,
|
|
2936
|
-
if (
|
|
2937
|
-
p =
|
|
2935
|
+
var p = or, b = null;
|
|
2936
|
+
if (m) try {
|
|
2937
|
+
p = m();
|
|
2938
2938
|
} catch (E) {
|
|
2939
|
-
|
|
2939
|
+
b = E;
|
|
2940
2940
|
}
|
|
2941
|
-
var w =
|
|
2942
|
-
this._ctx = { table:
|
|
2943
|
-
})), this.Table = (a = this, ft(ur.prototype, function(f,
|
|
2944
|
-
this.db = a, this._tx = p, this.name = f, this.schema =
|
|
2945
|
-
})), this.Transaction = (c = this, ft(ci.prototype, function(f,
|
|
2946
|
-
var
|
|
2947
|
-
this.db = c, this.mode = f, this.storeNames =
|
|
2948
|
-
|
|
2941
|
+
var w = _._ctx, m = w.table, _ = m.hook.reading.fire;
|
|
2942
|
+
this._ctx = { table: m, index: w.index, isPrimKey: !w.index || m.schema.primKey.keyPath && w.index === m.schema.primKey.name, range: p, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: b, or: w.or, valueMapper: _ !== at ? _ : null };
|
|
2943
|
+
})), this.Table = (a = this, ft(ur.prototype, function(f, S, p) {
|
|
2944
|
+
this.db = a, this._tx = p, this.name = f, this.schema = S, this.hook = a._allTables[f] ? a._allTables[f].hook : dt(null, { creating: [Jr, J], reading: [Xr, at], updating: [Zr, J], deleting: [Vr, J] });
|
|
2945
|
+
})), this.Transaction = (c = this, ft(ci.prototype, function(f, S, p, b, w) {
|
|
2946
|
+
var m = this;
|
|
2947
|
+
this.db = c, this.mode = f, this.storeNames = S, this.schema = p, this.chromeTransactionDurability = b, 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 B(function(_, E) {
|
|
2948
|
+
m._resolve = _, m._reject = E;
|
|
2949
2949
|
}), this._completion.then(function() {
|
|
2950
|
-
|
|
2951
|
-
}, function(
|
|
2952
|
-
var E =
|
|
2953
|
-
return
|
|
2950
|
+
m.active = !1, m.on.complete.fire();
|
|
2951
|
+
}, function(_) {
|
|
2952
|
+
var E = m.active;
|
|
2953
|
+
return m.active = !1, m.on.error.fire(_), m.parent ? m.parent._reject(_) : E && m.idbtrans && m.idbtrans.abort(), te(_);
|
|
2954
2954
|
});
|
|
2955
2955
|
})), this.Version = (u = this, ft(gi.prototype, function(f) {
|
|
2956
2956
|
this.db = u, this._cfg = { version: f, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
|
|
2957
|
-
})), this.WhereClause = (h = this, ft(pr.prototype, function(f,
|
|
2958
|
-
if (this.db = h, this._ctx = { table: f, index:
|
|
2959
|
-
return Y(w,
|
|
2960
|
-
}, this._max = function(
|
|
2961
|
-
return 0 < Y(
|
|
2962
|
-
}, this._min = function(
|
|
2963
|
-
return Y(
|
|
2957
|
+
})), this.WhereClause = (h = this, ft(pr.prototype, function(f, S, p) {
|
|
2958
|
+
if (this.db = h, this._ctx = { table: f, index: S === ":id" ? null : S, or: p }, this._cmp = this._ascending = Y, this._descending = function(b, w) {
|
|
2959
|
+
return Y(w, b);
|
|
2960
|
+
}, this._max = function(b, w) {
|
|
2961
|
+
return 0 < Y(b, w) ? b : w;
|
|
2962
|
+
}, this._min = function(b, w) {
|
|
2963
|
+
return Y(b, w) < 0 ? b : w;
|
|
2964
2964
|
}, this._IDBKeyRange = h._deps.IDBKeyRange, !this._IDBKeyRange) throw new $.MissingAPI();
|
|
2965
2965
|
})), this.on("versionchange", function(f) {
|
|
2966
2966
|
0 < f.newVersion ? console.warn("Another connection wants to upgrade database '".concat(n.name, "'. Closing db now to resume the upgrade.")) : console.warn("Another connection wants to delete database '".concat(n.name, "'. Closing db now to resume the delete request.")), n.close({ disableAutoOpen: !1 });
|
|
2967
2967
|
}), this.on("blocked", function(f) {
|
|
2968
2968
|
!f.newVersion || f.newVersion < f.oldVersion ? console.warn("Dexie.delete('".concat(n.name, "') was blocked")) : console.warn("Upgrade '".concat(n.name, "' blocked by other connection holding version ").concat(f.oldVersion / 10));
|
|
2969
|
-
}), this._maxKey = yt(t.IDBKeyRange), this._createTransaction = function(f,
|
|
2970
|
-
return new n.Transaction(f,
|
|
2969
|
+
}), this._maxKey = yt(t.IDBKeyRange), this._createTransaction = function(f, S, p, b) {
|
|
2970
|
+
return new n.Transaction(f, S, p, n._options.chromeTransactionDurability, b);
|
|
2971
2971
|
}, this._fireOnBlocked = function(f) {
|
|
2972
|
-
n.on("blocked").fire(f), et.filter(function(
|
|
2973
|
-
return
|
|
2974
|
-
}).map(function(
|
|
2975
|
-
return
|
|
2972
|
+
n.on("blocked").fire(f), et.filter(function(S) {
|
|
2973
|
+
return S.name === n.name && S !== n && !S._state.vcFired;
|
|
2974
|
+
}).map(function(S) {
|
|
2975
|
+
return S.on("versionchange").fire(f);
|
|
2976
2976
|
});
|
|
2977
2977
|
}, this.use(vi), this.use(Ei), this.use(wi), this.use(mi), this.use(bi);
|
|
2978
|
-
var
|
|
2979
|
-
if (
|
|
2980
|
-
if (
|
|
2981
|
-
return Qt(n.table(w),
|
|
2978
|
+
var v = new Proxy(this, { get: function(f, S, p) {
|
|
2979
|
+
if (S === "_vip") return !0;
|
|
2980
|
+
if (S === "table") return function(w) {
|
|
2981
|
+
return Qt(n.table(w), v);
|
|
2982
2982
|
};
|
|
2983
|
-
var
|
|
2984
|
-
return
|
|
2985
|
-
return Qt(w,
|
|
2986
|
-
}) :
|
|
2987
|
-
return Qt(
|
|
2988
|
-
} :
|
|
2983
|
+
var b = Reflect.get(f, S, p);
|
|
2984
|
+
return b instanceof ur ? Qt(b, v) : S === "tables" ? b.map(function(w) {
|
|
2985
|
+
return Qt(w, v);
|
|
2986
|
+
}) : S === "_createTransaction" ? function() {
|
|
2987
|
+
return Qt(b.apply(this, arguments), v);
|
|
2988
|
+
} : b;
|
|
2989
2989
|
} });
|
|
2990
|
-
this.vip =
|
|
2990
|
+
this.vip = v, i.forEach(function(f) {
|
|
2991
2991
|
return f(n);
|
|
2992
2992
|
});
|
|
2993
2993
|
}
|
|
@@ -3006,19 +3006,19 @@ var Tr = { exports: {} };
|
|
|
3006
3006
|
}
|
|
3007
3007
|
function Pr(e) {
|
|
3008
3008
|
var t, n = !1, i = new Oi(function(o) {
|
|
3009
|
-
var a = nn(e), c, u = !1, h = {}, g = {},
|
|
3009
|
+
var a = nn(e), c, u = !1, h = {}, g = {}, v = { get closed() {
|
|
3010
3010
|
return u;
|
|
3011
3011
|
}, unsubscribe: function() {
|
|
3012
3012
|
u || (u = !0, c && c.abort(), f && Ce.storagemutated.unsubscribe(p));
|
|
3013
3013
|
} };
|
|
3014
|
-
o.start && o.start(
|
|
3015
|
-
var f = !1,
|
|
3016
|
-
return hn(
|
|
3014
|
+
o.start && o.start(v);
|
|
3015
|
+
var f = !1, S = function() {
|
|
3016
|
+
return hn(b);
|
|
3017
3017
|
}, p = function(w) {
|
|
3018
|
-
zt(h, w), In(g, h) &&
|
|
3019
|
-
},
|
|
3020
|
-
var w,
|
|
3021
|
-
!u && Xt.indexedDB && (h = {}, w = {}, c && c.abort(), c = new AbortController(),
|
|
3018
|
+
zt(h, w), In(g, h) && S();
|
|
3019
|
+
}, b = function() {
|
|
3020
|
+
var w, m, _;
|
|
3021
|
+
!u && Xt.indexedDB && (h = {}, w = {}, c && c.abort(), c = new AbortController(), _ = function(E) {
|
|
3022
3022
|
var O = Ve();
|
|
3023
3023
|
try {
|
|
3024
3024
|
a && qe();
|
|
@@ -3027,8 +3027,8 @@ var Tr = { exports: {} };
|
|
|
3027
3027
|
} finally {
|
|
3028
3028
|
O && Ze();
|
|
3029
3029
|
}
|
|
3030
|
-
}(
|
|
3031
|
-
n = !0, t = E, u ||
|
|
3030
|
+
}(m = { subscr: w, signal: c.signal, requery: S, querier: e, trans: null }), Promise.resolve(_).then(function(E) {
|
|
3031
|
+
n = !0, t = E, u || m.signal.aborted || (h = {}, function(O) {
|
|
3032
3032
|
for (var A in O) if (ee(O, A)) return;
|
|
3033
3033
|
return 1;
|
|
3034
3034
|
}(g = w) || f || (Ce(gt, p), f = !0), hn(function() {
|
|
@@ -3040,7 +3040,7 @@ var Tr = { exports: {} };
|
|
|
3040
3040
|
});
|
|
3041
3041
|
}));
|
|
3042
3042
|
};
|
|
3043
|
-
return setTimeout(
|
|
3043
|
+
return setTimeout(S, 0), v;
|
|
3044
3044
|
});
|
|
3045
3045
|
return i.hasValue = function() {
|
|
3046
3046
|
return n;
|
|
@@ -3080,7 +3080,7 @@ var Tr = { exports: {} };
|
|
|
3080
3080
|
var t, n;
|
|
3081
3081
|
}, defineClass: function() {
|
|
3082
3082
|
return function(e) {
|
|
3083
|
-
|
|
3083
|
+
M(this, e);
|
|
3084
3084
|
};
|
|
3085
3085
|
}, ignoreTransaction: function(e) {
|
|
3086
3086
|
return G.trans ? Ge(G.transless, e) : e();
|
|
@@ -3108,7 +3108,7 @@ var Tr = { exports: {} };
|
|
|
3108
3108
|
return me;
|
|
3109
3109
|
}, set: function(e) {
|
|
3110
3110
|
Zn(e);
|
|
3111
|
-
} }, derive: Ye, extend:
|
|
3111
|
+
} }, derive: Ye, extend: M, props: le, override: zn, Events: dt, on: Ce, liveQuery: Pr, extendObservabilitySet: zt, getByKeyPath: we, setByKeyPath: fe, delByKeyPath: function(e, t) {
|
|
3112
3112
|
typeof t == "string" ? fe(e, t, void 0) : "length" in t && [].map.call(t, function(n) {
|
|
3113
3113
|
fe(e, n, void 0);
|
|
3114
3114
|
});
|
|
@@ -3165,12 +3165,12 @@ function Mr(d) {
|
|
|
3165
3165
|
}
|
|
3166
3166
|
return d.topics === void 0 && (d.topics = `${d.dashboard}-${d.widget}`), d;
|
|
3167
3167
|
}
|
|
3168
|
-
function
|
|
3168
|
+
function St(d, r) {
|
|
3169
3169
|
var U;
|
|
3170
|
-
let s, l, x, D,
|
|
3170
|
+
let s, l, x, D, K;
|
|
3171
3171
|
switch (d.moderation) {
|
|
3172
3172
|
case Zt.BEFORE:
|
|
3173
|
-
s = /* @__PURE__ */ new Date(), l = (U = d.beforeTime) == null ? void 0 : U.split(":"), x = Number.parseInt(l ? l[0] : "00"), D = Number.parseInt(l ? l[1] : "00"),
|
|
3173
|
+
s = /* @__PURE__ */ new Date(), l = (U = d.beforeTime) == null ? void 0 : U.split(":"), x = Number.parseInt(l ? l[0] : "00"), D = Number.parseInt(l ? l[1] : "00"), K = Number.parseInt(l ? l[2] : "00"), r.before = s.setHours(x, D, K, 0) / 1e3, r.period || (r.period = s.getDay() === 1 ? 72 : 24);
|
|
3174
3174
|
break;
|
|
3175
3175
|
case Zt.DELAYED:
|
|
3176
3176
|
d.delay && d.delay > 0 && (r.delay = `${d.delay}`);
|
|
@@ -3194,12 +3194,12 @@ class jr {
|
|
|
3194
3194
|
* @returns IResponse
|
|
3195
3195
|
*/
|
|
3196
3196
|
k(this, "getCloud", async (r) => {
|
|
3197
|
-
const s = await this.db.table(
|
|
3197
|
+
const s = await this.db.table(N.CLOUD).where({ id: r.widget }).last().catch(() => {
|
|
3198
3198
|
console.warn(
|
|
3199
3199
|
"%capi%C %ccloud",
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3200
|
+
y.API,
|
|
3201
|
+
y.NONE,
|
|
3202
|
+
y.CLOUD,
|
|
3203
3203
|
r.slide,
|
|
3204
3204
|
r.widget
|
|
3205
3205
|
);
|
|
@@ -3212,12 +3212,12 @@ class jr {
|
|
|
3212
3212
|
* @returns IResponse
|
|
3213
3213
|
*/
|
|
3214
3214
|
k(this, "getSeries", async (r) => {
|
|
3215
|
-
const s = await this.db.table(
|
|
3215
|
+
const s = await this.db.table(N.SERIES).where({ id: r.widget }).last().catch(() => {
|
|
3216
3216
|
console.warn(
|
|
3217
3217
|
"%capi%c %cseries",
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3218
|
+
y.API,
|
|
3219
|
+
y.NONE,
|
|
3220
|
+
y.SERIES,
|
|
3221
3221
|
r.slide,
|
|
3222
3222
|
r.widget
|
|
3223
3223
|
);
|
|
@@ -3232,13 +3232,13 @@ class jr {
|
|
|
3232
3232
|
k(this, "getMessages", async (r) => {
|
|
3233
3233
|
const s = (r == null ? void 0 : r.order) ?? "utc";
|
|
3234
3234
|
s !== "utc" && (r.since = Math.floor(Date.now() / 1e3) - 60 * 60 * 24 * 7), this.options.delay != 0 ? r.before = Math.floor(Date.now() / 1e3) - (this.options.delay || 0) : r.before = Math.floor(Date.now() / 1e3);
|
|
3235
|
-
const l = (
|
|
3235
|
+
const l = (K) => K.utc > ((r == null ? void 0 : r.since) || 0), x = (K) => K.utc < ((r == null ? void 0 : r.before) || Date.now() / 1e3), D = (K) => (K == null ? void 0 : K.visible) !== 0;
|
|
3236
3236
|
try {
|
|
3237
|
-
const U = await this.db.table(
|
|
3237
|
+
const U = await this.db.table(N.TOPICS).where("widget_id").equals(r.widget).filter(D).filter(l).filter(x).reverse().limit((r == null ? void 0 : r.limit) ?? 25).sortBy(s);
|
|
3238
3238
|
if (U.length === 0)
|
|
3239
3239
|
return { data: null, message: "No Messages error", success: !1 };
|
|
3240
|
-
let
|
|
3241
|
-
return qt.Promise.all(
|
|
3240
|
+
let M = U.map((X) => this.db.table(N.MESSAGES).get({ id: X.message_id }));
|
|
3241
|
+
return qt.Promise.all(M).then(async (X) => {
|
|
3242
3242
|
const ae = X.map((le) => le.data), ee = {
|
|
3243
3243
|
data: {
|
|
3244
3244
|
presentation: (r == null ? void 0 : r.presentation) || "not set",
|
|
@@ -3253,20 +3253,20 @@ class jr {
|
|
|
3253
3253
|
};
|
|
3254
3254
|
return console.debug(
|
|
3255
3255
|
"%cstorage%c %cmessages",
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3256
|
+
y.STORAGE,
|
|
3257
|
+
y.NONE,
|
|
3258
|
+
y.MESSAGES,
|
|
3259
3259
|
ee
|
|
3260
3260
|
), ee;
|
|
3261
3261
|
});
|
|
3262
|
-
} catch (
|
|
3262
|
+
} catch (K) {
|
|
3263
3263
|
return console.warn(
|
|
3264
3264
|
"%cstorage%c %cmessages",
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3265
|
+
y.STORAGE,
|
|
3266
|
+
y.NONE,
|
|
3267
|
+
y.MESSAGES,
|
|
3268
3268
|
r,
|
|
3269
|
-
|
|
3269
|
+
K
|
|
3270
3270
|
), { data: null, message: "Messages Data error", success: !1 };
|
|
3271
3271
|
}
|
|
3272
3272
|
});
|
|
@@ -3276,24 +3276,24 @@ class jr {
|
|
|
3276
3276
|
* @param data
|
|
3277
3277
|
* @returns number
|
|
3278
3278
|
*/
|
|
3279
|
-
k(this, "setCloud", async (r, s) => r.type ===
|
|
3279
|
+
k(this, "setCloud", async (r, s) => r.type === N.CLOUD && s !== "" ? await this.db.table(N.CLOUD).put({
|
|
3280
3280
|
id: r.widget,
|
|
3281
3281
|
dashboard_id: r.dashboard,
|
|
3282
3282
|
//data: data.data,
|
|
3283
3283
|
data: s
|
|
3284
|
-
}).then(() => 201).catch((l) => (console.error("%cstorage",
|
|
3284
|
+
}).then(() => 201).catch((l) => (console.error("%cstorage", y.STORAGE, "set", r, l.message), 400)) : 400);
|
|
3285
3285
|
/**
|
|
3286
3286
|
* Update Series
|
|
3287
3287
|
* @param query IQuery
|
|
3288
3288
|
* @param data
|
|
3289
3289
|
* @returns number
|
|
3290
3290
|
*/
|
|
3291
|
-
k(this, "setSeries", async (r, s) => r.type ===
|
|
3291
|
+
k(this, "setSeries", async (r, s) => r.type === N.SERIES && s !== "" ? await this.db.table(N.SERIES).put({
|
|
3292
3292
|
id: r.widget,
|
|
3293
3293
|
dashboard_id: r.dashboard,
|
|
3294
3294
|
//data: data.data,
|
|
3295
3295
|
data: s
|
|
3296
|
-
}).then(() => 201).catch((l) => (console.error("%cstorage",
|
|
3296
|
+
}).then(() => 201).catch((l) => (console.error("%cstorage", y.STORAGE, "set", r, l.message), 400)) : 400);
|
|
3297
3297
|
/**
|
|
3298
3298
|
* Update Messages
|
|
3299
3299
|
* @param query IQuery
|
|
@@ -3301,13 +3301,13 @@ class jr {
|
|
|
3301
3301
|
* @returns number
|
|
3302
3302
|
*/
|
|
3303
3303
|
k(this, "setMessages", async (r, s) => {
|
|
3304
|
-
if (r.type !==
|
|
3304
|
+
if (r.type !== N.MESSAGES)
|
|
3305
3305
|
return 400;
|
|
3306
3306
|
const l = s.data.title;
|
|
3307
3307
|
let x = 0;
|
|
3308
3308
|
return s.data.messages.forEach(async (D) => {
|
|
3309
|
-
var
|
|
3310
|
-
D.id !== null && (await this.db.table(
|
|
3309
|
+
var K, U, M, X, ae, ee, le;
|
|
3310
|
+
D.id !== null && (await this.db.table(N.MESSAGES).put({
|
|
3311
3311
|
id: D.id,
|
|
3312
3312
|
utc: D.utc,
|
|
3313
3313
|
data: D,
|
|
@@ -3315,19 +3315,19 @@ class jr {
|
|
|
3315
3315
|
}).catch((He) => {
|
|
3316
3316
|
x++, console.error(
|
|
3317
3317
|
"%cstorage",
|
|
3318
|
-
|
|
3318
|
+
y.STORAGE,
|
|
3319
3319
|
"set message",
|
|
3320
3320
|
`title: ${l}`,
|
|
3321
3321
|
D,
|
|
3322
3322
|
He.message
|
|
3323
3323
|
);
|
|
3324
|
-
}), await this.db.table(
|
|
3324
|
+
}), await this.db.table(N.TOPICS).put({
|
|
3325
3325
|
title: l,
|
|
3326
3326
|
widget_id: r.widget,
|
|
3327
3327
|
message_id: D.id,
|
|
3328
3328
|
dashboard_id: r.dashboard,
|
|
3329
|
-
engagement: ((
|
|
3330
|
-
impressions: ((
|
|
3329
|
+
engagement: ((K = D.topics[0]) == null ? void 0 : K.engagement) || ((U = D.dynamics) == null ? void 0 : U.engagement) || 0,
|
|
3330
|
+
impressions: ((M = D.topics[0]) == null ? void 0 : M.impressions) || ((X = D.dynamics) == null ? void 0 : X.semrush_visits) || 0,
|
|
3331
3331
|
reach: ((ae = D.topics[0]) == null ? void 0 : ae.reach) || ((ee = D.dynamics) == null ? void 0 : ee.potential_reach) || 0,
|
|
3332
3332
|
sentiment: ((le = D.topics[0]) == null ? void 0 : le.sentiment) || 0,
|
|
3333
3333
|
utc: D.utc,
|
|
@@ -3335,7 +3335,7 @@ class jr {
|
|
|
3335
3335
|
}).catch((He) => {
|
|
3336
3336
|
x++, console.error(
|
|
3337
3337
|
"%cstorage",
|
|
3338
|
-
|
|
3338
|
+
y.STORAGE,
|
|
3339
3339
|
"set topic",
|
|
3340
3340
|
`title: ${l}`,
|
|
3341
3341
|
D,
|
|
@@ -3343,13 +3343,13 @@ class jr {
|
|
|
3343
3343
|
);
|
|
3344
3344
|
}));
|
|
3345
3345
|
}), s.data.topics.forEach(async (D) => {
|
|
3346
|
-
const
|
|
3347
|
-
await this.db.table(
|
|
3346
|
+
const K = D.message_id, U = D.visible ? 1 : 0, M = D.title;
|
|
3347
|
+
await this.db.table(N.TOPICS).where("message_id").equals(K).modify({ visible: U }).catch((X) => {
|
|
3348
3348
|
x++, console.error(
|
|
3349
3349
|
"%cstorage",
|
|
3350
|
-
|
|
3350
|
+
y.STORAGE,
|
|
3351
3351
|
"update message visibility",
|
|
3352
|
-
`title: ${
|
|
3352
|
+
`title: ${M}`,
|
|
3353
3353
|
`widget: ${D.widget_id}`,
|
|
3354
3354
|
X.message
|
|
3355
3355
|
);
|
|
@@ -3361,26 +3361,26 @@ class jr {
|
|
|
3361
3361
|
*/
|
|
3362
3362
|
k(this, "cleanMessages", async () => {
|
|
3363
3363
|
const r = Date.now() / 1e3, s = (D) => D.expires < r, l = (D) => D.expires < r;
|
|
3364
|
-
return await this.db.table(
|
|
3364
|
+
return await this.db.table(N.TOPICS).orderBy("expires").filter(s).delete().catch((D) => (console.error(
|
|
3365
3365
|
"%cstorage%c %cclean",
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3366
|
+
y.STORAGE,
|
|
3367
|
+
y.NONE,
|
|
3368
|
+
y.MESSAGES,
|
|
3369
3369
|
D.message
|
|
3370
|
-
), 0)), await this.db.table(
|
|
3370
|
+
), 0)), await this.db.table(N.MESSAGES).orderBy("expires").filter(l).delete().catch((D) => (console.error(
|
|
3371
3371
|
"%cstorage%c %clean",
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3372
|
+
y.STORAGE,
|
|
3373
|
+
y.NONE,
|
|
3374
|
+
y.MESSAGES,
|
|
3375
3375
|
D.message
|
|
3376
3376
|
), 0));
|
|
3377
3377
|
});
|
|
3378
3378
|
k(this, "hideMessage", async (r, s) => {
|
|
3379
|
-
await this.db.table(
|
|
3379
|
+
await this.db.table(N.TOPICS).where("message_id").equals(r).modify({ visible: s ? 1 : 0 }).catch((l) => (console.error(
|
|
3380
3380
|
"%cstorage%c %chide",
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3381
|
+
y.STORAGE,
|
|
3382
|
+
y.NONE,
|
|
3383
|
+
y.HIDE,
|
|
3384
3384
|
l.message
|
|
3385
3385
|
), 0));
|
|
3386
3386
|
});
|
|
@@ -3389,14 +3389,14 @@ class jr {
|
|
|
3389
3389
|
* @param query IQuery
|
|
3390
3390
|
* @returns number
|
|
3391
3391
|
*/
|
|
3392
|
-
k(this, "setWidget", async (r) => await this.db.table(
|
|
3392
|
+
k(this, "setWidget", async (r) => await this.db.table(N.WIDGETS).put({
|
|
3393
3393
|
id: r.widget,
|
|
3394
3394
|
dashboard_id: r.dashboard,
|
|
3395
3395
|
type: r.type
|
|
3396
3396
|
}).then(() => 201).catch((s) => (console.error(
|
|
3397
3397
|
"%cstorage",
|
|
3398
|
-
|
|
3399
|
-
|
|
3398
|
+
y.STORAGE,
|
|
3399
|
+
N.WIDGET,
|
|
3400
3400
|
r,
|
|
3401
3401
|
s.message
|
|
3402
3402
|
), 400)));
|
|
@@ -3407,18 +3407,18 @@ class jr {
|
|
|
3407
3407
|
*/
|
|
3408
3408
|
k(this, "subscribe", (r) => (r = Mr(r), this.subscribers.filter(
|
|
3409
3409
|
(l) => l.widget === r.widget
|
|
3410
|
-
).length > 0 || (r.type ===
|
|
3410
|
+
).length > 0 || (r.type === N.MESSAGES && (r = St(this.options, r)), console.info(
|
|
3411
3411
|
"%cstorage%c %csubscribe",
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3412
|
+
y.STORAGE,
|
|
3413
|
+
y.NONE,
|
|
3414
|
+
y.SUBSCRIBE,
|
|
3415
3415
|
r.slide,
|
|
3416
3416
|
r.widget
|
|
3417
3417
|
), console.debug(
|
|
3418
3418
|
"%cstorage%c %csubscribe",
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3419
|
+
y.STORAGE,
|
|
3420
|
+
y.NONE,
|
|
3421
|
+
y.SUBSCRIBE,
|
|
3422
3422
|
r
|
|
3423
3423
|
), this.subscribers.push(r)), null));
|
|
3424
3424
|
/**
|
|
@@ -3432,12 +3432,12 @@ class jr {
|
|
|
3432
3432
|
* @returns IResponse
|
|
3433
3433
|
*/
|
|
3434
3434
|
k(this, "loadSlide", async (r) => {
|
|
3435
|
-
const s = await this.db.table(
|
|
3435
|
+
const s = await this.db.table(N.SLIDE).where({ id: r.id }).last().catch(() => {
|
|
3436
3436
|
console.warn(
|
|
3437
3437
|
"%capi%c %cseries",
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3438
|
+
y.API,
|
|
3439
|
+
y.NONE,
|
|
3440
|
+
y.SERIES,
|
|
3441
3441
|
r.id
|
|
3442
3442
|
);
|
|
3443
3443
|
});
|
|
@@ -3448,7 +3448,7 @@ class jr {
|
|
|
3448
3448
|
* @param query IQuery
|
|
3449
3449
|
* @returns number
|
|
3450
3450
|
*/
|
|
3451
|
-
k(this, "storeSlide", async (r) => r.type ===
|
|
3451
|
+
k(this, "storeSlide", async (r) => r.type === N.SLIDE && r.data !== "" ? await this.db.table(N.SLIDE).put({
|
|
3452
3452
|
id: r.id,
|
|
3453
3453
|
title: r.data.title || "Not set",
|
|
3454
3454
|
json: r.data.json || {},
|
|
@@ -3456,7 +3456,7 @@ class jr {
|
|
|
3456
3456
|
css: r.data.css || ""
|
|
3457
3457
|
}).then(() => 200).catch((s) => (console.error(
|
|
3458
3458
|
"%cstorage",
|
|
3459
|
-
|
|
3459
|
+
y.STORAGE,
|
|
3460
3460
|
re.SLIDE_STORE,
|
|
3461
3461
|
r,
|
|
3462
3462
|
s.message
|
|
@@ -3485,7 +3485,7 @@ function Ci(d, r) {
|
|
|
3485
3485
|
const s = indexedDB.open(d);
|
|
3486
3486
|
s.onupgradeneeded = () => s.result.createObjectStore(r);
|
|
3487
3487
|
const l = Wn(s);
|
|
3488
|
-
return (x, D) => l.then((
|
|
3488
|
+
return (x, D) => l.then((K) => D(K.transaction(r, x).objectStore(r)));
|
|
3489
3489
|
}
|
|
3490
3490
|
let $n;
|
|
3491
3491
|
function Nr() {
|
|
@@ -3503,15 +3503,15 @@ class Kr {
|
|
|
3503
3503
|
k(this, "options");
|
|
3504
3504
|
k(this, "getCloud", async (r) => {
|
|
3505
3505
|
const s = V(r);
|
|
3506
|
-
return await Vt(s).then((l) => l).catch(() => (console.warn("%capi",
|
|
3506
|
+
return await Vt(s).then((l) => l).catch(() => (console.warn("%capi", y.API, N.CLOUD, r.slide, r.widget), { data: null, message: "Cloud Data error", success: !1 }));
|
|
3507
3507
|
});
|
|
3508
3508
|
k(this, "getSeries", async (r) => {
|
|
3509
3509
|
const s = V(r);
|
|
3510
|
-
return await Vt(s).then((l) => l).catch(() => (console.warn("%capi",
|
|
3510
|
+
return await Vt(s).then((l) => l).catch(() => (console.warn("%capi", y.API, N.SERIES, r.slide, r.widget), { data: null, message: "Series Data error", success: !1 }));
|
|
3511
3511
|
});
|
|
3512
3512
|
k(this, "getMessages", async (r) => {
|
|
3513
3513
|
const s = V(r);
|
|
3514
|
-
return await Vt(s).then((l) => l).catch(() => (console.warn("%capi",
|
|
3514
|
+
return await Vt(s).then((l) => l).catch(() => (console.warn("%capi", y.API, N.MESSAGES, r.slide, r.widget), { data: null, message: "Messages Data error", success: !1 }));
|
|
3515
3515
|
});
|
|
3516
3516
|
/**
|
|
3517
3517
|
* Update Cloud
|
|
@@ -3523,7 +3523,7 @@ class Kr {
|
|
|
3523
3523
|
if (!s.success)
|
|
3524
3524
|
return 400;
|
|
3525
3525
|
const l = V(r);
|
|
3526
|
-
return delete s.success, delete s.message, await wt(l, s).then(() => 201).catch((x) => (console.error("%cstorage",
|
|
3526
|
+
return delete s.success, delete s.message, await wt(l, s).then(() => 201).catch((x) => (console.error("%cstorage", y.STORAGE, N.CLOUD, r, x.message), 400));
|
|
3527
3527
|
});
|
|
3528
3528
|
/**
|
|
3529
3529
|
* Update Series
|
|
@@ -3535,7 +3535,7 @@ class Kr {
|
|
|
3535
3535
|
if (!s.success)
|
|
3536
3536
|
return 400;
|
|
3537
3537
|
const l = V(r);
|
|
3538
|
-
return delete s.success, delete s.message, await wt(l, s).then(() => 201).catch((x) => (console.error("%cstorage",
|
|
3538
|
+
return delete s.success, delete s.message, await wt(l, s).then(() => 201).catch((x) => (console.error("%cstorage", y.STORAGE, N.SERIES, r, x.message), 400));
|
|
3539
3539
|
});
|
|
3540
3540
|
/**
|
|
3541
3541
|
* Update Messages
|
|
@@ -3547,7 +3547,7 @@ class Kr {
|
|
|
3547
3547
|
if (!s.success)
|
|
3548
3548
|
return 400;
|
|
3549
3549
|
const l = V(r);
|
|
3550
|
-
return delete s.success, delete s.message, await wt(l, s).then(() => 201).catch((x) => (console.error("%cstorage",
|
|
3550
|
+
return delete s.success, delete s.message, await wt(l, s).then(() => 201).catch((x) => (console.error("%cstorage", y.STORAGE, N.MESSAGES, r, x.message), 400));
|
|
3551
3551
|
});
|
|
3552
3552
|
k(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((s) => s(0))));
|
|
3553
3553
|
k(this, "hideMessage", async (r, s) => {
|
|
@@ -3566,20 +3566,20 @@ class Kr {
|
|
|
3566
3566
|
dashboard_id: r.dashboard,
|
|
3567
3567
|
type: r.type
|
|
3568
3568
|
};
|
|
3569
|
-
return await wt(s, l).then(() => 201).catch((x) => (console.error("%cstorage",
|
|
3569
|
+
return await wt(s, l).then(() => 201).catch((x) => (console.error("%cstorage", y.STORAGE, N.WIDGET, r, x.message), 400));
|
|
3570
3570
|
});
|
|
3571
3571
|
/**
|
|
3572
3572
|
* Add component subscriber
|
|
3573
3573
|
* @param query IQuery
|
|
3574
3574
|
* @returns null
|
|
3575
3575
|
*/
|
|
3576
|
-
k(this, "subscribe", (r) => (r.type ===
|
|
3576
|
+
k(this, "subscribe", (r) => (r.type === N.MESSAGES && (r = St(this.options, r)), this.subscribers.filter(
|
|
3577
3577
|
(l) => l.widget === r.widget
|
|
3578
3578
|
).length > 0 || (console.debug(
|
|
3579
3579
|
"%cstorage%c %csubscribe",
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3580
|
+
y.STORAGE,
|
|
3581
|
+
y.NONE,
|
|
3582
|
+
y.SUBSCRIBE,
|
|
3583
3583
|
r.slide,
|
|
3584
3584
|
r.widget
|
|
3585
3585
|
), this.subscribers.push(r)), null));
|
|
@@ -3590,7 +3590,7 @@ class Kr {
|
|
|
3590
3590
|
k(this, "getSubscribers", async () => await new Promise((r) => r(this.subscribers)));
|
|
3591
3591
|
k(this, "loadSlide", async (r) => {
|
|
3592
3592
|
const s = V(r);
|
|
3593
|
-
return await Vt(s).then((l) => l).catch(() => (console.warn("%capi",
|
|
3593
|
+
return await Vt(s).then((l) => l).catch(() => (console.warn("%capi", y.API, N.SLIDE, r.slide), { data: null, message: "Slide Load error", success: !1 }));
|
|
3594
3594
|
});
|
|
3595
3595
|
/**
|
|
3596
3596
|
* Update Slide
|
|
@@ -3605,7 +3605,7 @@ class Kr {
|
|
|
3605
3605
|
html: r.data.html || "",
|
|
3606
3606
|
css: r.data.css || ""
|
|
3607
3607
|
};
|
|
3608
|
-
return await wt(s, l).then(() => 201).catch((x) => (console.error("%cstorage",
|
|
3608
|
+
return await wt(s, l).then(() => 201).catch((x) => (console.error("%cstorage", y.STORAGE, N.SLIDE, r, x.message), 400));
|
|
3609
3609
|
});
|
|
3610
3610
|
this.options = r;
|
|
3611
3611
|
}
|
|
@@ -3619,7 +3619,7 @@ class Br {
|
|
|
3619
3619
|
try {
|
|
3620
3620
|
return localStorage.getObject(s);
|
|
3621
3621
|
} catch (l) {
|
|
3622
|
-
return console.warn("%capi",
|
|
3622
|
+
return console.warn("%capi", y.API, N.CLOUD, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3623
3623
|
}
|
|
3624
3624
|
});
|
|
3625
3625
|
k(this, "getSeries", async (r) => {
|
|
@@ -3627,7 +3627,7 @@ class Br {
|
|
|
3627
3627
|
try {
|
|
3628
3628
|
return localStorage.getObject(s);
|
|
3629
3629
|
} catch (l) {
|
|
3630
|
-
return console.warn("%capi",
|
|
3630
|
+
return console.warn("%capi", y.API, N.SERIES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3631
3631
|
}
|
|
3632
3632
|
});
|
|
3633
3633
|
k(this, "getMessages", async (r) => {
|
|
@@ -3635,7 +3635,7 @@ class Br {
|
|
|
3635
3635
|
try {
|
|
3636
3636
|
return localStorage.getObject(s);
|
|
3637
3637
|
} catch (l) {
|
|
3638
|
-
return console.warn("%capi",
|
|
3638
|
+
return console.warn("%capi", y.API, N.MESSAGES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3639
3639
|
}
|
|
3640
3640
|
});
|
|
3641
3641
|
/**
|
|
@@ -3649,7 +3649,7 @@ class Br {
|
|
|
3649
3649
|
try {
|
|
3650
3650
|
return localStorage.setObject(l, s), 201;
|
|
3651
3651
|
} catch (x) {
|
|
3652
|
-
return console.error("%cstorage",
|
|
3652
|
+
return console.error("%cstorage", y.STORAGE, N.CLOUD, r, x), 400;
|
|
3653
3653
|
}
|
|
3654
3654
|
});
|
|
3655
3655
|
/**
|
|
@@ -3663,7 +3663,7 @@ class Br {
|
|
|
3663
3663
|
try {
|
|
3664
3664
|
return localStorage.setObject(l, s), 201;
|
|
3665
3665
|
} catch (x) {
|
|
3666
|
-
return console.error("%cstorage",
|
|
3666
|
+
return console.error("%cstorage", y.STORAGE, N.SERIES, r, x), 400;
|
|
3667
3667
|
}
|
|
3668
3668
|
});
|
|
3669
3669
|
/**
|
|
@@ -3677,7 +3677,7 @@ class Br {
|
|
|
3677
3677
|
try {
|
|
3678
3678
|
return localStorage.setObject(l, s), 200;
|
|
3679
3679
|
} catch (x) {
|
|
3680
|
-
return console.error("%cstorage",
|
|
3680
|
+
return console.error("%cstorage", y.STORAGE, N.MESSAGES, r, x), 400;
|
|
3681
3681
|
}
|
|
3682
3682
|
});
|
|
3683
3683
|
k(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((s) => s(0))));
|
|
@@ -3689,7 +3689,7 @@ class Br {
|
|
|
3689
3689
|
try {
|
|
3690
3690
|
return localStorage.setObject(s, r), 201;
|
|
3691
3691
|
} catch (l) {
|
|
3692
|
-
return console.error("%cstorage",
|
|
3692
|
+
return console.error("%cstorage", y.STORAGE, N.WIDGET, r, l), 400;
|
|
3693
3693
|
}
|
|
3694
3694
|
});
|
|
3695
3695
|
/**
|
|
@@ -3697,13 +3697,13 @@ class Br {
|
|
|
3697
3697
|
* @param query IQuery
|
|
3698
3698
|
* @returns null
|
|
3699
3699
|
*/
|
|
3700
|
-
k(this, "subscribe", (r) => (r.type ===
|
|
3700
|
+
k(this, "subscribe", (r) => (r.type === N.MESSAGES && (r = St(this.options, r)), this.subscribers.filter(
|
|
3701
3701
|
(l) => l.widget === r.widget
|
|
3702
3702
|
).length || (console.debug(
|
|
3703
3703
|
"%cstorage%c %csubscribe",
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3704
|
+
y.STORAGE,
|
|
3705
|
+
y.NONE,
|
|
3706
|
+
y.SUBSCRIBE,
|
|
3707
3707
|
r.slide,
|
|
3708
3708
|
r.widget
|
|
3709
3709
|
), this.subscribers.push(r)), null));
|
|
@@ -3716,7 +3716,7 @@ class Br {
|
|
|
3716
3716
|
try {
|
|
3717
3717
|
return localStorage.getObject(`${r.type}.${r.id}`);
|
|
3718
3718
|
} catch (s) {
|
|
3719
|
-
return console.warn("%capi",
|
|
3719
|
+
return console.warn("%capi", y.API, N.SLIDE, r.id, s), { data: null, message: "Slide Load error", success: !1 };
|
|
3720
3720
|
}
|
|
3721
3721
|
});
|
|
3722
3722
|
k(this, "storeSlide", async (r) => {
|
|
@@ -3729,7 +3729,7 @@ class Br {
|
|
|
3729
3729
|
css: r.data.css || ""
|
|
3730
3730
|
}), 201;
|
|
3731
3731
|
} catch (s) {
|
|
3732
|
-
return console.error("%cstorage",
|
|
3732
|
+
return console.error("%cstorage", y.STORAGE, N.SLIDE, r, s), 400;
|
|
3733
3733
|
}
|
|
3734
3734
|
});
|
|
3735
3735
|
this.options = r, Storage.prototype.setObject = function(s, l) {
|
|
@@ -3749,7 +3749,7 @@ class Lr {
|
|
|
3749
3749
|
try {
|
|
3750
3750
|
return sessionStorage.getObject(s);
|
|
3751
3751
|
} catch (l) {
|
|
3752
|
-
return console.warn("%capi",
|
|
3752
|
+
return console.warn("%capi", y.API, N.CLOUD, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3753
3753
|
}
|
|
3754
3754
|
});
|
|
3755
3755
|
k(this, "getSeries", async (r) => {
|
|
@@ -3757,7 +3757,7 @@ class Lr {
|
|
|
3757
3757
|
try {
|
|
3758
3758
|
return sessionStorage.getObject(s);
|
|
3759
3759
|
} catch (l) {
|
|
3760
|
-
return console.warn("%capi",
|
|
3760
|
+
return console.warn("%capi", y.API, N.SERIES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3761
3761
|
}
|
|
3762
3762
|
});
|
|
3763
3763
|
k(this, "getMessages", async (r) => {
|
|
@@ -3765,7 +3765,7 @@ class Lr {
|
|
|
3765
3765
|
try {
|
|
3766
3766
|
return sessionStorage.getObject(s);
|
|
3767
3767
|
} catch (l) {
|
|
3768
|
-
return console.warn("%capi",
|
|
3768
|
+
return console.warn("%capi", y.API, N.MESSAGES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3769
3769
|
}
|
|
3770
3770
|
});
|
|
3771
3771
|
/**
|
|
@@ -3779,7 +3779,7 @@ class Lr {
|
|
|
3779
3779
|
try {
|
|
3780
3780
|
return sessionStorage.setObject(l, s), 201;
|
|
3781
3781
|
} catch (x) {
|
|
3782
|
-
return console.error("%cstorage",
|
|
3782
|
+
return console.error("%cstorage", y.STORAGE, N.CLOUD, r, x), 400;
|
|
3783
3783
|
}
|
|
3784
3784
|
});
|
|
3785
3785
|
/**
|
|
@@ -3793,7 +3793,7 @@ class Lr {
|
|
|
3793
3793
|
try {
|
|
3794
3794
|
return sessionStorage.setObject(l, s), 201;
|
|
3795
3795
|
} catch (x) {
|
|
3796
|
-
return console.error("%cstorage",
|
|
3796
|
+
return console.error("%cstorage", y.STORAGE, N.SERIES, r, x), 400;
|
|
3797
3797
|
}
|
|
3798
3798
|
});
|
|
3799
3799
|
/**
|
|
@@ -3807,7 +3807,7 @@ class Lr {
|
|
|
3807
3807
|
try {
|
|
3808
3808
|
return sessionStorage.setObject(l, s), 200;
|
|
3809
3809
|
} catch (x) {
|
|
3810
|
-
return console.error("%cstorage",
|
|
3810
|
+
return console.error("%cstorage", y.STORAGE, N.MESSAGES, r, x), 400;
|
|
3811
3811
|
}
|
|
3812
3812
|
});
|
|
3813
3813
|
k(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((s) => s(0))));
|
|
@@ -3819,7 +3819,7 @@ class Lr {
|
|
|
3819
3819
|
try {
|
|
3820
3820
|
return sessionStorage.setObject(s, r), 201;
|
|
3821
3821
|
} catch (l) {
|
|
3822
|
-
return console.error("%cstorage",
|
|
3822
|
+
return console.error("%cstorage", y.STORAGE, N.WIDGET, r, l), 400;
|
|
3823
3823
|
}
|
|
3824
3824
|
});
|
|
3825
3825
|
/**
|
|
@@ -3827,13 +3827,13 @@ class Lr {
|
|
|
3827
3827
|
* @param query IQuery
|
|
3828
3828
|
* @returns null
|
|
3829
3829
|
*/
|
|
3830
|
-
k(this, "subscribe", (r) => (r.type ===
|
|
3830
|
+
k(this, "subscribe", (r) => (r.type === N.MESSAGES && (r = St(this.options, r)), this.subscribers.filter(
|
|
3831
3831
|
(l) => l.widget === r.widget
|
|
3832
3832
|
).length || (console.debug(
|
|
3833
3833
|
"%cstorage%c %csubscribe",
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3834
|
+
y.STORAGE,
|
|
3835
|
+
y.NONE,
|
|
3836
|
+
y.SUBSCRIBE,
|
|
3837
3837
|
r.slide,
|
|
3838
3838
|
r.widget
|
|
3839
3839
|
), this.subscribers.push(r)), null));
|
|
@@ -3846,7 +3846,7 @@ class Lr {
|
|
|
3846
3846
|
try {
|
|
3847
3847
|
return sessionStorage.getObject(`${r.type}.${r.id}`);
|
|
3848
3848
|
} catch (s) {
|
|
3849
|
-
return console.warn("%capi",
|
|
3849
|
+
return console.warn("%capi", y.API, N.SLIDE, r.id, s), { data: null, message: "Store Load error", success: !1 };
|
|
3850
3850
|
}
|
|
3851
3851
|
});
|
|
3852
3852
|
/**
|
|
@@ -3864,7 +3864,7 @@ class Lr {
|
|
|
3864
3864
|
css: r.data.css || ""
|
|
3865
3865
|
}), 200;
|
|
3866
3866
|
} catch (s) {
|
|
3867
|
-
return console.error("%cstorage",
|
|
3867
|
+
return console.error("%cstorage", y.STORAGE, N.SLIDE, r, s), 400;
|
|
3868
3868
|
}
|
|
3869
3869
|
});
|
|
3870
3870
|
this.options = r, Storage.prototype.setObject = function(s, l) {
|
|
@@ -3884,7 +3884,7 @@ class Gr {
|
|
|
3884
3884
|
try {
|
|
3885
3885
|
return window.BuzzCasting.WidgetData[s];
|
|
3886
3886
|
} catch (l) {
|
|
3887
|
-
return console.warn("%capi",
|
|
3887
|
+
return console.warn("%capi", y.API, N.CLOUD, r.slide, r.widget, l), { data: null, message: "Cloud Data error", success: !1 };
|
|
3888
3888
|
}
|
|
3889
3889
|
});
|
|
3890
3890
|
k(this, "getSeries", async (r) => {
|
|
@@ -3892,7 +3892,7 @@ class Gr {
|
|
|
3892
3892
|
try {
|
|
3893
3893
|
return window.BuzzCasting.WidgetData[s];
|
|
3894
3894
|
} catch (l) {
|
|
3895
|
-
return console.warn("%capi",
|
|
3895
|
+
return console.warn("%capi", y.API, N.SERIES, r.slide, r.widget, l), { data: null, message: "Series Data error", success: !1 };
|
|
3896
3896
|
}
|
|
3897
3897
|
});
|
|
3898
3898
|
k(this, "getMessages", async (r) => {
|
|
@@ -3900,7 +3900,7 @@ class Gr {
|
|
|
3900
3900
|
try {
|
|
3901
3901
|
return window.BuzzCasting.WidgetData[s];
|
|
3902
3902
|
} catch (l) {
|
|
3903
|
-
return console.warn("%capi",
|
|
3903
|
+
return console.warn("%capi", y.API, N.MESSAGES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3904
3904
|
}
|
|
3905
3905
|
});
|
|
3906
3906
|
/**
|
|
@@ -3914,7 +3914,7 @@ class Gr {
|
|
|
3914
3914
|
try {
|
|
3915
3915
|
return window.BuzzCasting.WidgetData[l] = s, 201;
|
|
3916
3916
|
} catch (x) {
|
|
3917
|
-
return console.error("%cstorage",
|
|
3917
|
+
return console.error("%cstorage", y.STORAGE, "set", r, x), 400;
|
|
3918
3918
|
}
|
|
3919
3919
|
});
|
|
3920
3920
|
/**
|
|
@@ -3928,7 +3928,7 @@ class Gr {
|
|
|
3928
3928
|
try {
|
|
3929
3929
|
return window.BuzzCasting.WidgetData[l] = s, 201;
|
|
3930
3930
|
} catch (x) {
|
|
3931
|
-
return console.error("%cstorage",
|
|
3931
|
+
return console.error("%cstorage", y.STORAGE, "set", r, x), 400;
|
|
3932
3932
|
}
|
|
3933
3933
|
});
|
|
3934
3934
|
/**
|
|
@@ -3942,7 +3942,7 @@ class Gr {
|
|
|
3942
3942
|
try {
|
|
3943
3943
|
return window.BuzzCasting.WidgetData[l] = s, 201;
|
|
3944
3944
|
} catch (x) {
|
|
3945
|
-
return console.error("%cstorage",
|
|
3945
|
+
return console.error("%cstorage", y.STORAGE, "set", r, x), 400;
|
|
3946
3946
|
}
|
|
3947
3947
|
});
|
|
3948
3948
|
k(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((s) => s(0))));
|
|
@@ -3954,7 +3954,7 @@ class Gr {
|
|
|
3954
3954
|
try {
|
|
3955
3955
|
return window.BuzzCasting.WidgetData[s] = r, 201;
|
|
3956
3956
|
} catch (l) {
|
|
3957
|
-
return console.error("%cstorage",
|
|
3957
|
+
return console.error("%cstorage", y.STORAGE, N.WIDGET, r, l), 400;
|
|
3958
3958
|
}
|
|
3959
3959
|
});
|
|
3960
3960
|
/**
|
|
@@ -3962,13 +3962,13 @@ class Gr {
|
|
|
3962
3962
|
* @param query IQuery
|
|
3963
3963
|
* @returns null
|
|
3964
3964
|
*/
|
|
3965
|
-
k(this, "subscribe", (r) => (r.type ===
|
|
3965
|
+
k(this, "subscribe", (r) => (r.type === N.MESSAGES && (r = St(this.options, r)), this.subscribers.filter(
|
|
3966
3966
|
(l) => l.widget === r.widget
|
|
3967
3967
|
).length || (console.debug(
|
|
3968
3968
|
"%cstorage%c %csubscribe",
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3969
|
+
y.STORAGE,
|
|
3970
|
+
y.NONE,
|
|
3971
|
+
y.SUBSCRIBE,
|
|
3972
3972
|
r.slide,
|
|
3973
3973
|
r.widget
|
|
3974
3974
|
), this.subscribers.push(r)), null));
|
|
@@ -3981,7 +3981,7 @@ class Gr {
|
|
|
3981
3981
|
try {
|
|
3982
3982
|
return window.BuzzCasting.SlideData[r.id];
|
|
3983
3983
|
} catch (s) {
|
|
3984
|
-
return console.warn("%capi",
|
|
3984
|
+
return console.warn("%capi", y.API, N.SLIDE, r.id, s), { data: null, message: "Slide Load error", success: !1 };
|
|
3985
3985
|
}
|
|
3986
3986
|
});
|
|
3987
3987
|
k(this, "storeSlide", async (r) => {
|
|
@@ -3994,7 +3994,7 @@ class Gr {
|
|
|
3994
3994
|
css: r.data.css || ""
|
|
3995
3995
|
}, 201;
|
|
3996
3996
|
} catch (s) {
|
|
3997
|
-
return console.error("%cstorage",
|
|
3997
|
+
return console.error("%cstorage", y.STORAGE, N.SLIDE, r, s), 400;
|
|
3998
3998
|
}
|
|
3999
3999
|
});
|
|
4000
4000
|
this.options = r, window.BuzzCasting.WidgetData = /* @__PURE__ */ new Set();
|
|
@@ -4139,8 +4139,8 @@ function $r(d, r, s, l) {
|
|
|
4139
4139
|
return D;
|
|
4140
4140
|
try {
|
|
4141
4141
|
return Oe(D, String(r.valueOf()));
|
|
4142
|
-
} catch (
|
|
4143
|
-
return Oe(D, `[valueOf exception]${
|
|
4142
|
+
} catch (K) {
|
|
4143
|
+
return Oe(D, `[valueOf exception]${K.stack || K.message}`);
|
|
4144
4144
|
}
|
|
4145
4145
|
}
|
|
4146
4146
|
return Oe(x, r.toString());
|
|
@@ -4196,10 +4196,10 @@ function Ji(d) {
|
|
|
4196
4196
|
function Vi(d) {
|
|
4197
4197
|
const r = window.BuzzCasting.getOptions().suspended ?? !1;
|
|
4198
4198
|
return d.forEach((s) => {
|
|
4199
|
-
var l, x, D,
|
|
4200
|
-
if (r ? s.content = "License suspended, please contact your Sales Representative to restore service" : s.content = ((l = s.content) == null ? void 0 : l.replace(/(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)((\?.*)?)/g, "")) || "", s.sender !== null ? ((((x = s.sender) == null ? void 0 : x.title) === "Unknown author" || ((D = s.sender) == null ? void 0 : D.title) === null) && (s.sender.title = ""), ((
|
|
4201
|
-
const
|
|
4202
|
-
s.sender.title =
|
|
4199
|
+
var l, x, D, K, U;
|
|
4200
|
+
if (r ? s.content = "License suspended, please contact your Sales Representative to restore service" : s.content = ((l = s.content) == null ? void 0 : l.replace(/(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)((\?.*)?)/g, "")) || "", s.sender !== null ? ((((x = s.sender) == null ? void 0 : x.title) === "Unknown author" || ((D = s.sender) == null ? void 0 : D.title) === null) && (s.sender.title = ""), ((K = s.sender) == null ? void 0 : K.name) !== "" && s.sender.title === "" && (s.sender.title = s.sender.name), ((U = s.sender) == null ? void 0 : U.name) !== "" && s.channel === "tw" && (s.sender.name = `@${s.sender.name}`)) : s.sender = { title: "", name: "", id: "", avatar: "default", bio: "", location: "", following: 0, verified: 0, listed: 0, followers: 0, favourites: 0, messages: 0, influence: 0 }, s.sender.title === "" && s.link !== "") {
|
|
4201
|
+
const M = new URL(s.link);
|
|
4202
|
+
s.sender.title = M.hostname.replace("www.", "");
|
|
4203
4203
|
}
|
|
4204
4204
|
}), d;
|
|
4205
4205
|
}
|
|
@@ -4253,82 +4253,103 @@ class ro {
|
|
|
4253
4253
|
l.push(this.api.get(x));
|
|
4254
4254
|
}), await Promise.allSettled(l).then(
|
|
4255
4255
|
(x) => x.forEach(async (D) => {
|
|
4256
|
-
let
|
|
4256
|
+
let K, U = 400;
|
|
4257
4257
|
if (D.status === "fulfilled") {
|
|
4258
|
-
let
|
|
4258
|
+
let M = D.value;
|
|
4259
4259
|
if (this.sm === null)
|
|
4260
4260
|
return 400;
|
|
4261
|
-
if (
|
|
4261
|
+
if (M.success === !0) {
|
|
4262
4262
|
const X = this.sm.subscribers.filter(
|
|
4263
|
-
(le) => le.widget ===
|
|
4263
|
+
(le) => le.widget === M.query.widget
|
|
4264
4264
|
)[0];
|
|
4265
4265
|
let ae = "", ee;
|
|
4266
|
-
switch (
|
|
4267
|
-
case
|
|
4268
|
-
if (ee =
|
|
4266
|
+
switch (M.query.type) {
|
|
4267
|
+
case N.MESSAGES:
|
|
4268
|
+
if (ee = M.data.messages.filter(
|
|
4269
4269
|
(le) => le.id !== null
|
|
4270
|
-
),
|
|
4271
|
-
return console.
|
|
4270
|
+
), M.data.messages = ee, ae = Un(M.data.messages), X.hash === ae)
|
|
4271
|
+
return console.info(
|
|
4272
4272
|
"%capi%c %cno updates",
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4273
|
+
y.API,
|
|
4274
|
+
y.NONE,
|
|
4275
|
+
y.NO_UPDATES,
|
|
4276
|
+
N.MESSAGES,
|
|
4277
|
+
M.query.slide,
|
|
4278
|
+
M.query.widget
|
|
4279
|
+
), console.debug(
|
|
4280
|
+
"%capi%c %cno updates",
|
|
4281
|
+
y.API,
|
|
4282
|
+
y.NONE,
|
|
4283
|
+
y.NO_UPDATES,
|
|
4284
|
+
N.MESSAGES,
|
|
4285
|
+
M
|
|
4279
4286
|
), 204;
|
|
4280
|
-
|
|
4287
|
+
K = M, X.hash = ae, U = await this.sm.setMessages(M.query, M);
|
|
4281
4288
|
break;
|
|
4282
|
-
case
|
|
4283
|
-
ae = Un(
|
|
4289
|
+
case N.CLOUD:
|
|
4290
|
+
ae = Un(M.data), X.hash === ae ? (console.info(
|
|
4291
|
+
"%capi%c %cno updates",
|
|
4292
|
+
y.API,
|
|
4293
|
+
y.NONE,
|
|
4294
|
+
y.NO_UPDATES,
|
|
4295
|
+
N.CLOUD,
|
|
4296
|
+
M.query.slide,
|
|
4297
|
+
M.query.widget
|
|
4298
|
+
), console.debug(
|
|
4284
4299
|
"%capi%c %cno updates",
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
), U = 204) : (X.hash = ae, j = {
|
|
4300
|
+
y.API,
|
|
4301
|
+
y.NONE,
|
|
4302
|
+
y.NO_UPDATES,
|
|
4303
|
+
N.CLOUD,
|
|
4304
|
+
M
|
|
4305
|
+
), U = 204) : (X.hash = ae, K = {
|
|
4292
4306
|
data: {
|
|
4293
|
-
dashboard:
|
|
4294
|
-
cloud:
|
|
4295
|
-
query:
|
|
4296
|
-
slide:
|
|
4307
|
+
dashboard: M.query.dashboard,
|
|
4308
|
+
cloud: M.data,
|
|
4309
|
+
query: M.query,
|
|
4310
|
+
slide: M.query.slide
|
|
4297
4311
|
},
|
|
4298
|
-
query:
|
|
4299
|
-
message:
|
|
4300
|
-
success:
|
|
4301
|
-
}, U = await this.sm.setCloud(
|
|
4312
|
+
query: M.query,
|
|
4313
|
+
message: M.message,
|
|
4314
|
+
success: M.success
|
|
4315
|
+
}, U = await this.sm.setCloud(M.query, K.data.cloud));
|
|
4302
4316
|
break;
|
|
4303
|
-
case
|
|
4304
|
-
ae = Un(
|
|
4317
|
+
case N.SERIES:
|
|
4318
|
+
ae = Un(M.data), X.hash === ae ? (console.info(
|
|
4319
|
+
"%capi%c %cno updates",
|
|
4320
|
+
y.API,
|
|
4321
|
+
y.NONE,
|
|
4322
|
+
y.NO_UPDATES,
|
|
4323
|
+
N.SERIES,
|
|
4324
|
+
M.query.slide,
|
|
4325
|
+
M.query.widget
|
|
4326
|
+
), console.debug(
|
|
4305
4327
|
"%capi%c %cno updates",
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
), U = 204) : (X.hash = ae, j = {
|
|
4328
|
+
y.API,
|
|
4329
|
+
y.NONE,
|
|
4330
|
+
y.NO_UPDATES,
|
|
4331
|
+
N.SERIES,
|
|
4332
|
+
M
|
|
4333
|
+
), U = 204) : (X.hash = ae, K = {
|
|
4313
4334
|
data: {
|
|
4314
|
-
dashboard:
|
|
4315
|
-
series:
|
|
4316
|
-
query:
|
|
4317
|
-
slide:
|
|
4335
|
+
dashboard: M.query.dashboard,
|
|
4336
|
+
series: M.data,
|
|
4337
|
+
query: M.query,
|
|
4338
|
+
slide: M.query.slide
|
|
4318
4339
|
},
|
|
4319
|
-
query:
|
|
4320
|
-
message:
|
|
4321
|
-
success:
|
|
4322
|
-
}, U = await this.sm.setSeries(
|
|
4340
|
+
query: M.query,
|
|
4341
|
+
message: M.message,
|
|
4342
|
+
success: M.success
|
|
4343
|
+
}, U = await this.sm.setSeries(M.query, K.data.series));
|
|
4323
4344
|
break;
|
|
4324
4345
|
default:
|
|
4325
4346
|
console.warn(
|
|
4326
4347
|
"%capi%c %cstorage",
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4348
|
+
y.API,
|
|
4349
|
+
y.NONE,
|
|
4350
|
+
y.STORAGE,
|
|
4330
4351
|
"error",
|
|
4331
|
-
`data type ${
|
|
4352
|
+
`data type ${M.query.type} unknown`
|
|
4332
4353
|
);
|
|
4333
4354
|
}
|
|
4334
4355
|
} else
|
|
@@ -4337,53 +4358,53 @@ class ro {
|
|
|
4337
4358
|
case 201:
|
|
4338
4359
|
console.info(
|
|
4339
4360
|
"%capp%c %cbroadcast",
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4361
|
+
y.API,
|
|
4362
|
+
y.NONE,
|
|
4363
|
+
y.BROADCAST,
|
|
4364
|
+
M.query.slide,
|
|
4365
|
+
M.data.title ?? M.query.widget
|
|
4345
4366
|
), console.debug(
|
|
4346
4367
|
"%capp%c %cbroadcast",
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4368
|
+
y.API,
|
|
4369
|
+
y.NONE,
|
|
4370
|
+
y.BROADCAST,
|
|
4371
|
+
M
|
|
4351
4372
|
);
|
|
4352
|
-
const X = structuredClone(
|
|
4353
|
-
switch (
|
|
4373
|
+
const X = structuredClone(K.query);
|
|
4374
|
+
switch (M.query.type) {
|
|
4354
4375
|
case "messages":
|
|
4355
|
-
|
|
4376
|
+
M = await this.sm.getMessages(X);
|
|
4356
4377
|
break;
|
|
4357
4378
|
case "cloud":
|
|
4358
|
-
|
|
4379
|
+
M = await this.sm.getCloud(X), M && (M.query = X);
|
|
4359
4380
|
break;
|
|
4360
4381
|
case "series":
|
|
4361
|
-
|
|
4382
|
+
M = await this.sm.getSeries(X), M && (M.query = X);
|
|
4362
4383
|
break;
|
|
4363
4384
|
default:
|
|
4364
4385
|
console.warn(
|
|
4365
4386
|
"%capp%c %cbroadcast",
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4387
|
+
y.API,
|
|
4388
|
+
y.NONE,
|
|
4389
|
+
y.BROADCAST,
|
|
4369
4390
|
"Unhandled data type",
|
|
4370
|
-
|
|
4391
|
+
M.query
|
|
4371
4392
|
);
|
|
4372
4393
|
}
|
|
4373
|
-
|
|
4394
|
+
M && this.bc.postMessage({
|
|
4374
4395
|
event: re.WIDGET_UPDATE,
|
|
4375
|
-
data:
|
|
4396
|
+
data: M.data
|
|
4376
4397
|
});
|
|
4377
4398
|
break;
|
|
4378
4399
|
default:
|
|
4379
4400
|
console.warn(
|
|
4380
4401
|
"%capp%c %cbroadcast",
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4402
|
+
y.API,
|
|
4403
|
+
y.NONE,
|
|
4404
|
+
y.BROADCAST,
|
|
4384
4405
|
"Fetch error",
|
|
4385
|
-
|
|
4386
|
-
|
|
4406
|
+
M.query.slide,
|
|
4407
|
+
M.data.title ?? M.query.widget
|
|
4387
4408
|
);
|
|
4388
4409
|
break;
|
|
4389
4410
|
}
|
|
@@ -4391,10 +4412,11 @@ class ro {
|
|
|
4391
4412
|
} else
|
|
4392
4413
|
return console.warn(
|
|
4393
4414
|
"%capi%c %cstorage",
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
re.ERROR
|
|
4415
|
+
y.API,
|
|
4416
|
+
y.NONE,
|
|
4417
|
+
y.STORAGE,
|
|
4418
|
+
re.ERROR,
|
|
4419
|
+
D.status
|
|
4398
4420
|
), 400;
|
|
4399
4421
|
})
|
|
4400
4422
|
);
|
|
@@ -4409,11 +4431,18 @@ class ro {
|
|
|
4409
4431
|
(s = this.sm) == null || s.subscribe(r.data.data);
|
|
4410
4432
|
break;
|
|
4411
4433
|
case re.UPDATE:
|
|
4412
|
-
console.
|
|
4434
|
+
console.info(
|
|
4435
|
+
"%capi%c %cstorage",
|
|
4436
|
+
y.API,
|
|
4437
|
+
y.NONE,
|
|
4438
|
+
y.STORAGE,
|
|
4439
|
+
re.UPDATE,
|
|
4440
|
+
r.data.data.query.widget
|
|
4441
|
+
), console.debug(
|
|
4413
4442
|
"%capi%c %cstorage",
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4443
|
+
y.API,
|
|
4444
|
+
y.NONE,
|
|
4445
|
+
y.STORAGE,
|
|
4417
4446
|
re.UPDATE,
|
|
4418
4447
|
r.data
|
|
4419
4448
|
), await this.update();
|
|
@@ -4425,9 +4454,9 @@ class ro {
|
|
|
4425
4454
|
if ((l = this.options) != null && l.suspended) {
|
|
4426
4455
|
console.info(
|
|
4427
4456
|
"%cstorage%c %cstorage",
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
|
|
4457
|
+
y.STORAGE,
|
|
4458
|
+
y.NONE,
|
|
4459
|
+
y.MESSAGES,
|
|
4431
4460
|
"Account suspended"
|
|
4432
4461
|
);
|
|
4433
4462
|
return;
|
|
@@ -4437,9 +4466,9 @@ class ro {
|
|
|
4437
4466
|
));
|
|
4438
4467
|
console.info(
|
|
4439
4468
|
"%cstorage%c %cstorage",
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4469
|
+
y.STORAGE,
|
|
4470
|
+
y.NONE,
|
|
4471
|
+
y.MESSAGES,
|
|
4443
4472
|
`${s} messages deleted`
|
|
4444
4473
|
);
|
|
4445
4474
|
});
|
|
@@ -4448,9 +4477,9 @@ class ro {
|
|
|
4448
4477
|
const s = await ((l = this.sm) == null ? void 0 : l.hideMessage(r.id, 0));
|
|
4449
4478
|
return console.info(
|
|
4450
4479
|
"%cstorage%c %cstorage",
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4480
|
+
y.STORAGE,
|
|
4481
|
+
y.NONE,
|
|
4482
|
+
y.HIDE,
|
|
4454
4483
|
`${s} messages hidden`
|
|
4455
4484
|
), await this.api.hideMessage(r);
|
|
4456
4485
|
});
|
|
@@ -4468,9 +4497,9 @@ class ro {
|
|
|
4468
4497
|
});
|
|
4469
4498
|
console.info(
|
|
4470
4499
|
"%cstorage%c %cslide",
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4500
|
+
y.STORAGE,
|
|
4501
|
+
y.NONE,
|
|
4502
|
+
y.SLIDE,
|
|
4474
4503
|
r.slide,
|
|
4475
4504
|
re.VERSION,
|
|
4476
4505
|
ki
|
|
@@ -4478,9 +4507,9 @@ class ro {
|
|
|
4478
4507
|
const s = (r == null ? void 0 : r.slide) || r.app;
|
|
4479
4508
|
switch (this.bc = new BroadcastChannel(s), console.info(
|
|
4480
4509
|
"%capi%c %cbroadcast",
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4510
|
+
y.API,
|
|
4511
|
+
y.NONE,
|
|
4512
|
+
y.BROADCAST,
|
|
4484
4513
|
re.CHANNEL,
|
|
4485
4514
|
s
|
|
4486
4515
|
), this.bc.onmessage = (l) => {
|
|
@@ -4514,11 +4543,11 @@ class Bi {
|
|
|
4514
4543
|
*/
|
|
4515
4544
|
k(this, "getCloud", async (r) => {
|
|
4516
4545
|
var s;
|
|
4517
|
-
return r.type !==
|
|
4546
|
+
return r.type !== N.CLOUD ? (console.warn(
|
|
4518
4547
|
"%capp%c %get",
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4548
|
+
y.APP,
|
|
4549
|
+
y.NONE,
|
|
4550
|
+
y.GET_DATA,
|
|
4522
4551
|
r.widget,
|
|
4523
4552
|
"wrong method call for getMessages, type used is",
|
|
4524
4553
|
r.type
|
|
@@ -4535,11 +4564,11 @@ class Bi {
|
|
|
4535
4564
|
*/
|
|
4536
4565
|
k(this, "getMessages", async (r) => {
|
|
4537
4566
|
var s;
|
|
4538
|
-
return r.type !==
|
|
4567
|
+
return r.type !== N.MESSAGES ? (console.warn(
|
|
4539
4568
|
"%capp%c %get",
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4569
|
+
y.APP,
|
|
4570
|
+
y.NONE,
|
|
4571
|
+
y.GET_DATA,
|
|
4543
4572
|
r.widget,
|
|
4544
4573
|
"wrong method call for getMessages, type used is",
|
|
4545
4574
|
r.type
|
|
@@ -4556,11 +4585,11 @@ class Bi {
|
|
|
4556
4585
|
*/
|
|
4557
4586
|
k(this, "getSeries", async (r) => {
|
|
4558
4587
|
var s;
|
|
4559
|
-
return r.type !==
|
|
4588
|
+
return r.type !== N.SERIES ? (console.warn(
|
|
4560
4589
|
"%capp%c %get",
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4590
|
+
y.APP,
|
|
4591
|
+
y.NONE,
|
|
4592
|
+
y.GET_DATA,
|
|
4564
4593
|
r.widget,
|
|
4565
4594
|
"wrong method call for getMessages, type used is",
|
|
4566
4595
|
r.type
|
|
@@ -4610,11 +4639,11 @@ class io {
|
|
|
4610
4639
|
*/
|
|
4611
4640
|
k(this, "getData", async () => {
|
|
4612
4641
|
switch (this.query.type) {
|
|
4613
|
-
case
|
|
4642
|
+
case N.CLOUD:
|
|
4614
4643
|
return await this.getCloud();
|
|
4615
|
-
case
|
|
4644
|
+
case N.MESSAGES:
|
|
4616
4645
|
return await this.getMessages();
|
|
4617
|
-
case
|
|
4646
|
+
case N.SERIES:
|
|
4618
4647
|
return await this.getSeries();
|
|
4619
4648
|
}
|
|
4620
4649
|
return {
|
|
@@ -4628,11 +4657,11 @@ class io {
|
|
|
4628
4657
|
*
|
|
4629
4658
|
* @returns IResponse
|
|
4630
4659
|
*/
|
|
4631
|
-
k(this, "getCloud", async () => this.query.type !==
|
|
4660
|
+
k(this, "getCloud", async () => this.query.type !== N.CLOUD ? (console.warn(
|
|
4632
4661
|
"%cstorage%c %cwidget",
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4662
|
+
y.STORAGE,
|
|
4663
|
+
y.NONE,
|
|
4664
|
+
y.WIDGET,
|
|
4636
4665
|
this.query.widget,
|
|
4637
4666
|
"Wrong method call for getCloud, expected type is",
|
|
4638
4667
|
this.query.type
|
|
@@ -4646,11 +4675,11 @@ class io {
|
|
|
4646
4675
|
*
|
|
4647
4676
|
* @returns IResponse
|
|
4648
4677
|
*/
|
|
4649
|
-
k(this, "getMessages", async () => this.query.type !==
|
|
4678
|
+
k(this, "getMessages", async () => this.query.type !== N.MESSAGES ? (console.warn(
|
|
4650
4679
|
"%cstorage%c %cwidget",
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4680
|
+
y.STORAGE,
|
|
4681
|
+
y.NONE,
|
|
4682
|
+
y.WIDGET,
|
|
4654
4683
|
this.query.widget,
|
|
4655
4684
|
"Wrong method call for getMessages, expected type is",
|
|
4656
4685
|
this.query.type
|
|
@@ -4660,9 +4689,9 @@ class io {
|
|
|
4660
4689
|
success: !1
|
|
4661
4690
|
}) : (console.debug(
|
|
4662
4691
|
"%cstorage%c %cwidget",
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
|
|
4692
|
+
y.API,
|
|
4693
|
+
y.NONE,
|
|
4694
|
+
y.MESSAGES,
|
|
4666
4695
|
this.query
|
|
4667
4696
|
), await this.storageReader.getMessages(this.query)));
|
|
4668
4697
|
/**
|
|
@@ -4670,11 +4699,11 @@ class io {
|
|
|
4670
4699
|
*
|
|
4671
4700
|
* @returns IResponse
|
|
4672
4701
|
*/
|
|
4673
|
-
k(this, "getSeries", async () => this.query.type !==
|
|
4702
|
+
k(this, "getSeries", async () => this.query.type !== N.SERIES ? (console.warn(
|
|
4674
4703
|
"%cstorage%c %cwidget",
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4704
|
+
y.STORAGE,
|
|
4705
|
+
y.NONE,
|
|
4706
|
+
y.WIDGET,
|
|
4678
4707
|
this.query.widget,
|
|
4679
4708
|
"Wrong method call for getSeries, expected type is",
|
|
4680
4709
|
this.query.type
|
|
@@ -4692,7 +4721,7 @@ class io {
|
|
|
4692
4721
|
k(this, "showModal", (r) => {
|
|
4693
4722
|
console.debug(
|
|
4694
4723
|
"%cwidget",
|
|
4695
|
-
|
|
4724
|
+
y.WIDGET,
|
|
4696
4725
|
re.SHOW_MODAL,
|
|
4697
4726
|
r.showComponent,
|
|
4698
4727
|
// @ts-ignore
|
|
@@ -4712,10 +4741,10 @@ class io {
|
|
|
4712
4741
|
});
|
|
4713
4742
|
window.dispatchEvent(s);
|
|
4714
4743
|
});
|
|
4715
|
-
var
|
|
4744
|
+
var K;
|
|
4716
4745
|
this.element = r, this.listeners = s, l = typeof l < "u" ? l : "buzzcasting-slide";
|
|
4717
4746
|
let x;
|
|
4718
|
-
x = { ...r.dataset }, delete x.hmr, x.slide = ((
|
|
4747
|
+
x = { ...r.dataset }, delete x.hmr, x.slide = ((K = r.closest(l.toUpperCase())) == null ? void 0 : K.id) ?? `${l} not found`, x = Mr(x), this.query = x, Ti(r);
|
|
4719
4748
|
const D = window.BuzzCasting.getOptions();
|
|
4720
4749
|
this.storageReader = new Bi(D), this.broadcastChannel = new BroadcastChannel(x.slide), this.startListener();
|
|
4721
4750
|
}
|
|
@@ -4748,16 +4777,16 @@ class io {
|
|
|
4748
4777
|
subscribe() {
|
|
4749
4778
|
console.info(
|
|
4750
4779
|
"%cwidget%c %csubscribe",
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
|
|
4780
|
+
y.WIDGET,
|
|
4781
|
+
y.NONE,
|
|
4782
|
+
y.SUBSCRIBE,
|
|
4754
4783
|
this.query.slide,
|
|
4755
4784
|
this.query.widget
|
|
4756
4785
|
), console.debug(
|
|
4757
4786
|
"%cwidget%c %csubscribe",
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
|
|
4787
|
+
y.WIDGET,
|
|
4788
|
+
y.NONE,
|
|
4789
|
+
y.SUBSCRIBE,
|
|
4761
4790
|
this.query
|
|
4762
4791
|
), this.broadcastChannel.postMessage({
|
|
4763
4792
|
event: re.SUBSCRIBE,
|
|
@@ -4769,10 +4798,10 @@ class io {
|
|
|
4769
4798
|
}
|
|
4770
4799
|
}
|
|
4771
4800
|
export {
|
|
4772
|
-
|
|
4801
|
+
N as API,
|
|
4773
4802
|
ro as BuzzcastingStorageManager,
|
|
4774
4803
|
Bi as BuzzcastingStorageReader,
|
|
4775
|
-
|
|
4804
|
+
y as CSS,
|
|
4776
4805
|
re as EVENTS,
|
|
4777
4806
|
Zt as MODERATION,
|
|
4778
4807
|
ye as STORAGE,
|