buzzcasting-storage 2.16.19 → 2.16.21
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.d.ts +5 -0
- package/dist/buzzcasting-storage.esm.js +1020 -1011
- package/package.json +13 -13
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var xi = Object.defineProperty;
|
|
2
2
|
var ki = (f, r, c) => r in f ? xi(f, r, { enumerable: !0, configurable: !0, writable: !0, value: c }) : f[r] = c;
|
|
3
3
|
var D = (f, r, c) => ki(f, typeof r != "symbol" ? r + "" : r, c);
|
|
4
|
-
var
|
|
5
|
-
const Ai = "2.16.
|
|
4
|
+
var j = /* @__PURE__ */ ((f) => (f.MESSAGES = "messages", f.CLOUD = "cloud", f.SERIES = "series", f.TOPICS = "topics", f.WIDGET = "widget", f.WIDGETS = "widgets", f.SLIDE = "slide", f))(j || {}), _ = /* @__PURE__ */ ((f) => (f.API = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;", f.APP = "color:white;background-color:navy;padding:0 4px 0 4px;border-radius:5px;", f.BROADCAST = "color:white;background-color:orange;padding:0 4px 0 4px;border-radius:5px;", f.DATA = "color:grey;background-color:lightskyblue;padding:0 4px 0 4px;border-radius:5px;", f.CLOUD = "color:grey;background-color:mistyrose;padding:0 4px 0 4px;border-radius:5px;", f.GET_DATA = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", f.HIDE = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", f.MESSAGES = "color:grey;background-color:tan;padding:0 4px 0 4px;border-radius:5px;", f.NO_UPDATES = "color:grey;border:1px solid grey;padding:0 4px 0 4px;border-radius:5px;", f.NONE = "color:transparent;background-color:transparent;", f.PRESENTATION = "color:white;background-color:darkred;padding:0 4px 0 4px;border-radius:5px;", f.SERIES = "color:grey;background-color:thistle;padding:0 4px 0 4px;border-radius:5px;", f.SLIDE = "color:black;background-color:yellow;padding:0 4px 0 4px;border-radius:5px;", f.STORAGE = "color:black;background-color:cyan;padding:0 4px 0 4px;border-radius:5px;", f.SUBSCRIBE = "color:white;background-color:dodgerblue;padding:0 4px 0 4px;border-radius:5px;", f.WIDGET = "color:gret;background-color:lemonchiffon;padding:0 4px 0 4px;border-radius:5px;", f.WS = "color:white;background-color:green;padding:0 4px 0 4px;border-radius:5px;", f))(_ || {}), re = /* @__PURE__ */ ((f) => (f.ADD_SLIDE = "addSlide", f.APP_READY = "appReady", f.API_UPDATE = "apiUpdate", f.APPROVE_MESSAGE = "approveMessage", f.CHANNEL = "channel", f.CLEAN_MESSAGES = "cleanMessages", f.CLOSE_MODAL = "closeModal", f.CLOSE_BUILDER_MODAL = "closeBuilderModal", f.ERROR = "error", f.HIDE_MESSAGE = "hideMessage", f.HIDE_LABELS = "hideLabels", f.PAUSE_PRESENTATION = "pausePresentation", f.PRESENTATION_READY = "presentationReady", f.PREV_SLIDE = "prevSlide", f.RELOAD_PRESENTATION = "reloadPresentation", f.SHOW_MODAL = "showModal", f.STAR_MESSAGE = "starMessage", f.GOTO_SLIDE = "gotoSlide", f.NEXT_SLIDE = "nextSlide", f.SHOW_BUILDER_MODAL = "showBuilderModal", f.SLIDE_DID_LOAD = "slideDidLoad", f.SLIDE_GOTO = "slideGoto", f.SLIDE_READY = "slideReady", f.SLIDE_LOAD = "loadSlide", f.SLIDE_STORE = "storeSlide", f.SLIDE_TRANSITIONER = "slideTransitioner", f.START_TRANSITIONER = "startTransitioner", f.STORAGE_INIT = "storageInit", f.SUBSCRIBE = "subscribe", f.SUSPEND_ACCOUNT = "suspendAccount", f.REMOVE_CLOUD = "removeCloud", f.UPDATE = "update", f.VERSION = "version", f.WIDGET_UPDATE = "widgetUpdate", f))(re || {}), Zt = /* @__PURE__ */ ((f) => (f.APPROVED = "approved", f.BEFORE = "before", f.DELAYED = "delayed", f.NONE = "none", f.REALTIME = "realtime", f))(Zt || {}), ge = /* @__PURE__ */ ((f) => (f.KEYVAL = "keyval", f.LOCAL = "local", f.SESSION = "session", f.DEXIE = "dexie", f.WINDOW = "window", f))(ge || {});
|
|
5
|
+
const Ai = "2.16.20";
|
|
6
6
|
class Di {
|
|
7
7
|
constructor(r) {
|
|
8
8
|
D(this, "options");
|
|
@@ -62,7 +62,7 @@ class Di {
|
|
|
62
62
|
r.widget,
|
|
63
63
|
r.id
|
|
64
64
|
), await fetch(
|
|
65
|
-
[this.url, "api", c,
|
|
65
|
+
[this.url, "api", c, "messages", r.id].join("/") + A,
|
|
66
66
|
{ ...l, method: "put" }
|
|
67
67
|
).then((k) => {
|
|
68
68
|
if (!k.ok)
|
|
@@ -72,8 +72,8 @@ class Di {
|
|
|
72
72
|
}
|
|
73
73
|
async hideLabels(r) {
|
|
74
74
|
const { version: c } = this.options, l = this.formHeaders(), A = new URLSearchParams(), k = r.labels || [];
|
|
75
|
-
for (const [N,
|
|
76
|
-
A.append(`custom_filters[${N}]`,
|
|
75
|
+
for (const [N, L] of k.entries())
|
|
76
|
+
A.append(`custom_filters[${N}]`, L);
|
|
77
77
|
return console.info(
|
|
78
78
|
"%capi%c %cput",
|
|
79
79
|
_.API,
|
|
@@ -141,7 +141,7 @@ var Rr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
141
141
|
function Pi(f) {
|
|
142
142
|
return f && f.__esModule && Object.prototype.hasOwnProperty.call(f, "default") ? f.default : f;
|
|
143
143
|
}
|
|
144
|
-
var
|
|
144
|
+
var Mr = { exports: {} };
|
|
145
145
|
(function(f, r) {
|
|
146
146
|
(function(c, l) {
|
|
147
147
|
f.exports = l();
|
|
@@ -162,16 +162,16 @@ var jr = { exports: {} };
|
|
|
162
162
|
for (var i, a = 0, o = t.length; a < o; a++) !i && a in t || ((i = i || Array.prototype.slice.call(t, 0, a))[a] = t[a]);
|
|
163
163
|
return e.concat(i || Array.prototype.slice.call(t));
|
|
164
164
|
}
|
|
165
|
-
var k = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Rr, N = Object.keys,
|
|
166
|
-
function
|
|
165
|
+
var k = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Rr, N = Object.keys, L = Array.isArray;
|
|
166
|
+
function J(e, t) {
|
|
167
167
|
return typeof t != "object" || N(t).forEach(function(n) {
|
|
168
168
|
e[n] = t[n];
|
|
169
169
|
}), e;
|
|
170
170
|
}
|
|
171
171
|
typeof Promise > "u" || k.Promise || (k.Promise = Promise);
|
|
172
|
-
var q = Object.getPrototypeOf,
|
|
172
|
+
var q = Object.getPrototypeOf, le = {}.hasOwnProperty;
|
|
173
173
|
function ne(e, t) {
|
|
174
|
-
return
|
|
174
|
+
return le.call(e, t);
|
|
175
175
|
}
|
|
176
176
|
function xe(e, t) {
|
|
177
177
|
typeof t == "function" && (t = t(q(e))), (typeof Reflect > "u" ? N : Reflect.ownKeys)(t).forEach(function(n) {
|
|
@@ -180,9 +180,9 @@ var jr = { exports: {} };
|
|
|
180
180
|
}
|
|
181
181
|
var zn = Object.defineProperty;
|
|
182
182
|
function ke(e, t, n, i) {
|
|
183
|
-
zn(e, t,
|
|
183
|
+
zn(e, t, J(n && ne(n, "get") && typeof n.get == "function" ? { get: n.get, set: n.set, configurable: !0 } : { value: n, configurable: !0, writable: !0 }, i));
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function He(e) {
|
|
186
186
|
return { from: function(t) {
|
|
187
187
|
return e.prototype = Object.create(t.prototype), ke(e.prototype, "constructor", e), { extend: xe.bind(null, e.prototype) };
|
|
188
188
|
} };
|
|
@@ -194,7 +194,7 @@ var jr = { exports: {} };
|
|
|
194
194
|
function Hn(e, t) {
|
|
195
195
|
return t(e);
|
|
196
196
|
}
|
|
197
|
-
function
|
|
197
|
+
function it(e) {
|
|
198
198
|
if (!e) throw new Error("Assertion Failed");
|
|
199
199
|
}
|
|
200
200
|
function Yn(e) {
|
|
@@ -218,11 +218,11 @@ var jr = { exports: {} };
|
|
|
218
218
|
}
|
|
219
219
|
function de(e, t, n) {
|
|
220
220
|
if (e && t !== void 0 && !("isFrozen" in Object && Object.isFrozen(e))) if (typeof t != "string" && "length" in t) {
|
|
221
|
-
|
|
221
|
+
it(typeof n != "string" && "length" in n);
|
|
222
222
|
for (var i = 0, a = t.length; i < a; ++i) de(e, t[i], n[i]);
|
|
223
223
|
} else {
|
|
224
224
|
var o, s, u = t.indexOf(".");
|
|
225
|
-
u !== -1 ? (o = t.substr(0, u), (s = t.substr(u + 1)) === "" ? n === void 0 ?
|
|
225
|
+
u !== -1 ? (o = t.substr(0, u), (s = t.substr(u + 1)) === "" ? n === void 0 ? L(e) && !isNaN(parseInt(o)) ? e.splice(o, 1) : delete e[o] : e[o] = n : de(u = !(u = e[o]) || !ne(e, o) ? e[o] = {} : u, s, n)) : n === void 0 ? L(e) && !isNaN(parseInt(t)) ? e.splice(t, 1) : delete e[t] : e[t] = n;
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
function Qn(e) {
|
|
@@ -240,24 +240,24 @@ var jr = { exports: {} };
|
|
|
240
240
|
});
|
|
241
241
|
}))).filter(function(e) {
|
|
242
242
|
return k[e];
|
|
243
|
-
}),
|
|
243
|
+
}), Jn = new Set(Se.map(function(e) {
|
|
244
244
|
return k[e];
|
|
245
|
-
})),
|
|
246
|
-
function
|
|
247
|
-
return
|
|
245
|
+
})), at = null;
|
|
246
|
+
function Me(e) {
|
|
247
|
+
return at = /* @__PURE__ */ new WeakMap(), e = function t(n) {
|
|
248
248
|
if (!n || typeof n != "object") return n;
|
|
249
|
-
var i =
|
|
249
|
+
var i = at.get(n);
|
|
250
250
|
if (i) return i;
|
|
251
|
-
if (
|
|
252
|
-
i = [],
|
|
251
|
+
if (L(n)) {
|
|
252
|
+
i = [], at.set(n, i);
|
|
253
253
|
for (var a = 0, o = n.length; a < o; ++a) i.push(t(n[a]));
|
|
254
|
-
} else if (
|
|
254
|
+
} else if (Jn.has(n.constructor)) i = n;
|
|
255
255
|
else {
|
|
256
256
|
var s, u = q(n);
|
|
257
|
-
for (s in i = u === Object.prototype ? {} : Object.create(u),
|
|
257
|
+
for (s in i = u === Object.prototype ? {} : Object.create(u), at.set(n, i), n) ne(n, s) && (i[s] = t(n[s]));
|
|
258
258
|
}
|
|
259
259
|
return i;
|
|
260
|
-
}(e),
|
|
260
|
+
}(e), at = null, e;
|
|
261
261
|
}
|
|
262
262
|
var zr = {}.toString;
|
|
263
263
|
function qt(e) {
|
|
@@ -269,15 +269,15 @@ var jr = { exports: {} };
|
|
|
269
269
|
} : function() {
|
|
270
270
|
return null;
|
|
271
271
|
};
|
|
272
|
-
function
|
|
272
|
+
function je(e, t) {
|
|
273
273
|
return t = e.indexOf(t), 0 <= t && e.splice(t, 1), 0 <= t;
|
|
274
274
|
}
|
|
275
|
-
var
|
|
275
|
+
var Ye = {};
|
|
276
276
|
function we(e) {
|
|
277
277
|
var t, n, i, a;
|
|
278
278
|
if (arguments.length === 1) {
|
|
279
|
-
if (
|
|
280
|
-
if (this ===
|
|
279
|
+
if (L(e)) return e.slice();
|
|
280
|
+
if (this === Ye && typeof e == "string") return [e];
|
|
281
281
|
if (a = Hr(e)) {
|
|
282
282
|
for (n = []; !(i = a.next()).done; ) n.push(i.value);
|
|
283
283
|
return n;
|
|
@@ -294,11 +294,11 @@ var jr = { exports: {} };
|
|
|
294
294
|
return e[Symbol.toStringTag] === "AsyncFunction";
|
|
295
295
|
} : function() {
|
|
296
296
|
return !1;
|
|
297
|
-
},
|
|
298
|
-
function
|
|
297
|
+
}, ct = ["Unknown", "Constraint", "Data", "TransactionInactive", "ReadOnly", "Version", "NotFound", "InvalidState", "InvalidAccess", "Abort", "Timeout", "QuotaExceeded", "Syntax", "DataClone"], pe = ["Modify", "Bulk", "OpenFailed", "VersionChange", "Schema", "Upgrade", "InvalidTable", "MissingAPI", "NoSuchDatabase", "InvalidArgument", "SubTransaction", "Unsupported", "Internal", "DatabaseClosed", "PrematureCommit", "ForeignAwait"].concat(ct), Yr = { VersionChanged: "Database version changed by other database connection", DatabaseClosed: "Database has been closed", Abort: "Transaction aborted", TransactionInactive: "Transaction has already completed or failed", MissingAPI: "IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb" };
|
|
298
|
+
function Qe(e, t) {
|
|
299
299
|
this.name = e, this.message = t;
|
|
300
300
|
}
|
|
301
|
-
function
|
|
301
|
+
function Vn(e, t) {
|
|
302
302
|
return e + ". Errors: " + Object.keys(t).map(function(n) {
|
|
303
303
|
return t[n].toString();
|
|
304
304
|
}).filter(function(n, i, a) {
|
|
@@ -307,39 +307,39 @@ var jr = { exports: {} };
|
|
|
307
307
|
`);
|
|
308
308
|
}
|
|
309
309
|
function Et(e, t, n, i) {
|
|
310
|
-
this.failures = t, this.failedKeys = i, this.successCount = n, this.message =
|
|
310
|
+
this.failures = t, this.failedKeys = i, this.successCount = n, this.message = Vn(e, t);
|
|
311
311
|
}
|
|
312
|
-
function
|
|
312
|
+
function Xe(e, t) {
|
|
313
313
|
this.name = "BulkError", this.failures = Object.keys(t).map(function(n) {
|
|
314
314
|
return t[n];
|
|
315
|
-
}), this.failuresByPos = t, this.message =
|
|
315
|
+
}), this.failuresByPos = t, this.message = Vn(e, this.failures);
|
|
316
316
|
}
|
|
317
|
-
|
|
317
|
+
He(Qe).from(Error).extend({ toString: function() {
|
|
318
318
|
return this.name + ": " + this.message;
|
|
319
|
-
} }),
|
|
320
|
-
var nn =
|
|
319
|
+
} }), He(Et).from(Qe), He(Xe).from(Qe);
|
|
320
|
+
var nn = pe.reduce(function(e, t) {
|
|
321
321
|
return e[t] = t + "Error", e;
|
|
322
|
-
}, {}), Qr =
|
|
322
|
+
}, {}), Qr = Qe, $ = pe.reduce(function(e, t) {
|
|
323
323
|
var n = t + "Error";
|
|
324
324
|
function i(a, o) {
|
|
325
325
|
this.name = n, a ? typeof a == "string" ? (this.message = "".concat(a).concat(o ? `
|
|
326
326
|
` + o : ""), this.inner = o || null) : typeof a == "object" && (this.message = "".concat(a.name, " ").concat(a.message), this.inner = a) : (this.message = Yr[t] || n, this.inner = null);
|
|
327
327
|
}
|
|
328
|
-
return
|
|
328
|
+
return He(i).from(Qr), e[t] = i, e;
|
|
329
329
|
}, {});
|
|
330
|
-
|
|
331
|
-
var Zn =
|
|
332
|
-
return e[t + "Error"] =
|
|
333
|
-
}, {}), Ot =
|
|
334
|
-
return ["Syntax", "Type", "Range"].indexOf(t) === -1 && (e[t + "Error"] =
|
|
330
|
+
$.Syntax = SyntaxError, $.Type = TypeError, $.Range = RangeError;
|
|
331
|
+
var Zn = ct.reduce(function(e, t) {
|
|
332
|
+
return e[t + "Error"] = $[t], e;
|
|
333
|
+
}, {}), Ot = pe.reduce(function(e, t) {
|
|
334
|
+
return ["Syntax", "Type", "Range"].indexOf(t) === -1 && (e[t + "Error"] = $[t]), e;
|
|
335
335
|
}, {});
|
|
336
336
|
function Q() {
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function ot(e) {
|
|
339
339
|
return e;
|
|
340
340
|
}
|
|
341
341
|
function Xr(e, t) {
|
|
342
|
-
return e == null || e ===
|
|
342
|
+
return e == null || e === ot ? t : function(n) {
|
|
343
343
|
return t(e(n));
|
|
344
344
|
};
|
|
345
345
|
}
|
|
@@ -348,7 +348,7 @@ var jr = { exports: {} };
|
|
|
348
348
|
e.apply(this, arguments), t.apply(this, arguments);
|
|
349
349
|
};
|
|
350
350
|
}
|
|
351
|
-
function
|
|
351
|
+
function Jr(e, t) {
|
|
352
352
|
return e === Q ? t : function() {
|
|
353
353
|
var n = e.apply(this, arguments);
|
|
354
354
|
n !== void 0 && (arguments[0] = n);
|
|
@@ -358,7 +358,7 @@ var jr = { exports: {} };
|
|
|
358
358
|
return i && (this.onsuccess = this.onsuccess ? Ke(i, this.onsuccess) : i), a && (this.onerror = this.onerror ? Ke(a, this.onerror) : a), o !== void 0 ? o : n;
|
|
359
359
|
};
|
|
360
360
|
}
|
|
361
|
-
function
|
|
361
|
+
function Vr(e, t) {
|
|
362
362
|
return e === Q ? t : function() {
|
|
363
363
|
e.apply(this, arguments);
|
|
364
364
|
var n = this.onsuccess, i = this.onerror;
|
|
@@ -368,9 +368,9 @@ var jr = { exports: {} };
|
|
|
368
368
|
function Zr(e, t) {
|
|
369
369
|
return e === Q ? t : function(n) {
|
|
370
370
|
var i = e.apply(this, arguments);
|
|
371
|
-
|
|
371
|
+
J(n, i);
|
|
372
372
|
var a = this.onsuccess, o = this.onerror;
|
|
373
|
-
return this.onsuccess = null, this.onerror = null, n = t.apply(this, arguments), a && (this.onsuccess = this.onsuccess ? Ke(a, this.onsuccess) : a), o && (this.onerror = this.onerror ? Ke(o, this.onerror) : o), i === void 0 ? n === void 0 ? void 0 : n :
|
|
373
|
+
return this.onsuccess = null, this.onerror = null, n = t.apply(this, arguments), a && (this.onsuccess = this.onsuccess ? Ke(a, this.onsuccess) : a), o && (this.onerror = this.onerror ? Ke(o, this.onerror) : o), i === void 0 ? n === void 0 ? void 0 : n : J(i, n);
|
|
374
374
|
};
|
|
375
375
|
}
|
|
376
376
|
function qr(e, t) {
|
|
@@ -390,25 +390,25 @@ var jr = { exports: {} };
|
|
|
390
390
|
return t.apply(this, arguments);
|
|
391
391
|
};
|
|
392
392
|
}
|
|
393
|
-
Ot.ModifyError = Et, Ot.DexieError =
|
|
393
|
+
Ot.ModifyError = Et, Ot.DexieError = Qe, Ot.BulkError = Xe;
|
|
394
394
|
var ye = typeof location < "u" && /^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);
|
|
395
395
|
function qn(e) {
|
|
396
396
|
ye = e;
|
|
397
397
|
}
|
|
398
|
-
var
|
|
398
|
+
var st = {}, er = 100, Se = typeof Promise > "u" ? [] : function() {
|
|
399
399
|
var e = Promise.resolve();
|
|
400
400
|
if (typeof crypto > "u" || !crypto.subtle) return [e, q(e), e];
|
|
401
401
|
var t = crypto.subtle.digest("SHA-512", new Uint8Array([0]));
|
|
402
402
|
return [t, q(t), e];
|
|
403
|
-
}(),
|
|
403
|
+
}(), ct = Se[0], pe = Se[1], Se = Se[2], pe = pe && pe.then, Ne = ct && ct.constructor, an = !!Se, ut = function(e, t) {
|
|
404
404
|
lt.push([e, t]), xt && (queueMicrotask(ti), xt = !1);
|
|
405
|
-
}, on = !0, xt = !0,
|
|
405
|
+
}, on = !0, xt = !0, Be = [], kt = [], sn = ot, Ae = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: Q, pgp: !1, env: {}, finalize: Q }, G = Ae, lt = [], Le = 0, At = [];
|
|
406
406
|
function K(e) {
|
|
407
407
|
if (typeof this != "object") throw new TypeError("Promises must be constructed via new");
|
|
408
408
|
this._listeners = [], this._lib = !1;
|
|
409
|
-
var t = this._PSD =
|
|
409
|
+
var t = this._PSD = G;
|
|
410
410
|
if (typeof e != "function") {
|
|
411
|
-
if (e !==
|
|
411
|
+
if (e !== st) throw new TypeError("Not a function");
|
|
412
412
|
return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 && un(this, this._value));
|
|
413
413
|
}
|
|
414
414
|
this._state = null, this._value = null, ++t.ref, function n(i, a) {
|
|
@@ -416,9 +416,9 @@ var jr = { exports: {} };
|
|
|
416
416
|
a(function(o) {
|
|
417
417
|
if (i._state === null) {
|
|
418
418
|
if (o === i) throw new TypeError("A promise cannot be resolved with itself.");
|
|
419
|
-
var s = i._lib &&
|
|
420
|
-
o && typeof o.then == "function" ? n(i, function(u,
|
|
421
|
-
o instanceof K ? o._then(u,
|
|
419
|
+
var s = i._lib && Je();
|
|
420
|
+
o && typeof o.then == "function" ? n(i, function(u, h) {
|
|
421
|
+
o instanceof K ? o._then(u, h) : o.then(u, h);
|
|
422
422
|
}) : (i._state = !0, i._value = o, nr(i)), s && Ve();
|
|
423
423
|
}
|
|
424
424
|
}, un.bind(null, i));
|
|
@@ -428,16 +428,16 @@ var jr = { exports: {} };
|
|
|
428
428
|
}(this, e);
|
|
429
429
|
}
|
|
430
430
|
var cn = { get: function() {
|
|
431
|
-
var e =
|
|
431
|
+
var e = G, t = Ct;
|
|
432
432
|
function n(i, a) {
|
|
433
|
-
var o = this, s = !e.global && (e !==
|
|
434
|
-
ln(o, new tr(ir(i, e, s, u), ir(a, e, s, u),
|
|
433
|
+
var o = this, s = !e.global && (e !== G || t !== Ct), u = s && !Pe(), h = new K(function(g, b) {
|
|
434
|
+
ln(o, new tr(ir(i, e, s, u), ir(a, e, s, u), g, b, e));
|
|
435
435
|
});
|
|
436
|
-
return this._consoleTask && (
|
|
436
|
+
return this._consoleTask && (h._consoleTask = this._consoleTask), h;
|
|
437
437
|
}
|
|
438
|
-
return n.prototype =
|
|
438
|
+
return n.prototype = st, n;
|
|
439
439
|
}, set: function(e) {
|
|
440
|
-
ke(this, "then", e && e.prototype ===
|
|
440
|
+
ke(this, "then", e && e.prototype === st ? cn : { get: function() {
|
|
441
441
|
return e;
|
|
442
442
|
}, set: cn.set });
|
|
443
443
|
} };
|
|
@@ -446,24 +446,24 @@ var jr = { exports: {} };
|
|
|
446
446
|
}
|
|
447
447
|
function un(e, t) {
|
|
448
448
|
var n, i;
|
|
449
|
-
kt.push(t), e._state === null && (n = e._lib &&
|
|
449
|
+
kt.push(t), e._state === null && (n = e._lib && Je(), t = sn(t), e._state = !1, e._value = t, i = e, Be.some(function(a) {
|
|
450
450
|
return a._value === i._value;
|
|
451
|
-
}) ||
|
|
451
|
+
}) || Be.push(i), nr(e), n && Ve());
|
|
452
452
|
}
|
|
453
453
|
function nr(e) {
|
|
454
454
|
var t = e._listeners;
|
|
455
455
|
e._listeners = [];
|
|
456
456
|
for (var n = 0, i = t.length; n < i; ++n) ln(e, t[n]);
|
|
457
457
|
var a = e._PSD;
|
|
458
|
-
--a.ref || a.finalize(),
|
|
459
|
-
--
|
|
458
|
+
--a.ref || a.finalize(), Le === 0 && (++Le, ut(function() {
|
|
459
|
+
--Le == 0 && dn();
|
|
460
460
|
}, []));
|
|
461
461
|
}
|
|
462
462
|
function ln(e, t) {
|
|
463
463
|
if (e._state !== null) {
|
|
464
464
|
var n = e._state ? t.onFulfilled : t.onRejected;
|
|
465
465
|
if (n === null) return (e._state ? t.resolve : t.reject)(e._value);
|
|
466
|
-
++t.psd.ref, ++
|
|
466
|
+
++t.psd.ref, ++Le, ut(ei, [n, e, t]);
|
|
467
467
|
} else e._listeners.push(t);
|
|
468
468
|
}
|
|
469
469
|
function ei(e, t, n) {
|
|
@@ -472,20 +472,20 @@ var jr = { exports: {} };
|
|
|
472
472
|
!t._state && kt.length && (kt = []), i = ye && t._consoleTask ? t._consoleTask.run(function() {
|
|
473
473
|
return e(a);
|
|
474
474
|
}) : e(a), t._state || kt.indexOf(a) !== -1 || function(o) {
|
|
475
|
-
for (var s =
|
|
475
|
+
for (var s = Be.length; s; ) if (Be[--s]._value === o._value) return Be.splice(s, 1);
|
|
476
476
|
}(t), n.resolve(i);
|
|
477
477
|
} catch (o) {
|
|
478
478
|
n.reject(o);
|
|
479
479
|
} finally {
|
|
480
|
-
--
|
|
480
|
+
--Le == 0 && dn(), --n.psd.ref || n.psd.finalize();
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
483
|
function ti() {
|
|
484
|
-
|
|
485
|
-
|
|
484
|
+
Ge(Ae, function() {
|
|
485
|
+
Je() && Ve();
|
|
486
486
|
});
|
|
487
487
|
}
|
|
488
|
-
function
|
|
488
|
+
function Je() {
|
|
489
489
|
var e = on;
|
|
490
490
|
return xt = on = !1, e;
|
|
491
491
|
}
|
|
@@ -500,19 +500,19 @@ var jr = { exports: {} };
|
|
|
500
500
|
xt = on = !0;
|
|
501
501
|
}
|
|
502
502
|
function dn() {
|
|
503
|
-
var e =
|
|
504
|
-
|
|
503
|
+
var e = Be;
|
|
504
|
+
Be = [], e.forEach(function(i) {
|
|
505
505
|
i._PSD.onunhandled.call(null, i._value, i);
|
|
506
506
|
});
|
|
507
507
|
for (var t = At.slice(0), n = t.length; n; ) t[--n]();
|
|
508
508
|
}
|
|
509
509
|
function Dt(e) {
|
|
510
|
-
return new K(
|
|
510
|
+
return new K(st, !1, e);
|
|
511
511
|
}
|
|
512
512
|
function Z(e, t) {
|
|
513
|
-
var n =
|
|
513
|
+
var n = G;
|
|
514
514
|
return function() {
|
|
515
|
-
var i =
|
|
515
|
+
var i = Je(), a = G;
|
|
516
516
|
try {
|
|
517
517
|
return Ie(n, !0), e.apply(this, arguments);
|
|
518
518
|
} catch (o) {
|
|
@@ -523,7 +523,7 @@ var jr = { exports: {} };
|
|
|
523
523
|
};
|
|
524
524
|
}
|
|
525
525
|
xe(K.prototype, { then: cn, _then: function(e, t) {
|
|
526
|
-
ln(this, new tr(null, null, e, t,
|
|
526
|
+
ln(this, new tr(null, null, e, t, G));
|
|
527
527
|
}, catch: function(e) {
|
|
528
528
|
if (arguments.length === 1) return this.then(null, e);
|
|
529
529
|
var t = e, n = arguments[1];
|
|
@@ -546,7 +546,7 @@ var jr = { exports: {} };
|
|
|
546
546
|
var n = this;
|
|
547
547
|
return e < 1 / 0 ? new K(function(i, a) {
|
|
548
548
|
var o = setTimeout(function() {
|
|
549
|
-
return a(new
|
|
549
|
+
return a(new $.Timeout(t));
|
|
550
550
|
}, e);
|
|
551
551
|
n.then(i, a).finally(clearTimeout.bind(null, o));
|
|
552
552
|
}) : this;
|
|
@@ -564,7 +564,7 @@ var jr = { exports: {} };
|
|
|
564
564
|
}, resolve: function(e) {
|
|
565
565
|
return e instanceof K ? e : e && typeof e.then == "function" ? new K(function(t, n) {
|
|
566
566
|
e.then(t, n);
|
|
567
|
-
}) : new K(
|
|
567
|
+
}) : new K(st, !0, e);
|
|
568
568
|
}, reject: Dt, race: function() {
|
|
569
569
|
var e = we.apply(null, arguments).map(Rt);
|
|
570
570
|
return new K(function(t, n) {
|
|
@@ -573,12 +573,12 @@ var jr = { exports: {} };
|
|
|
573
573
|
});
|
|
574
574
|
});
|
|
575
575
|
}, PSD: { get: function() {
|
|
576
|
-
return
|
|
576
|
+
return G;
|
|
577
577
|
}, set: function(e) {
|
|
578
|
-
return
|
|
578
|
+
return G = e;
|
|
579
579
|
} }, totalEchoes: { get: function() {
|
|
580
580
|
return Ct;
|
|
581
|
-
} }, newPSD: De, usePSD:
|
|
581
|
+
} }, newPSD: De, usePSD: Ge, scheduler: { get: function() {
|
|
582
582
|
return ut;
|
|
583
583
|
}, set: function(e) {
|
|
584
584
|
ut = e;
|
|
@@ -589,20 +589,20 @@ var jr = { exports: {} };
|
|
|
589
589
|
} }, follow: function(e, t) {
|
|
590
590
|
return new K(function(n, i) {
|
|
591
591
|
return De(function(a, o) {
|
|
592
|
-
var s =
|
|
592
|
+
var s = G;
|
|
593
593
|
s.unhandleds = [], s.onunhandled = o, s.finalize = Ke(function() {
|
|
594
|
-
var u,
|
|
594
|
+
var u, h = this;
|
|
595
595
|
u = function() {
|
|
596
|
-
|
|
597
|
-
}, At.push(function
|
|
598
|
-
u(), At.splice(At.indexOf(
|
|
599
|
-
}), ++
|
|
600
|
-
--
|
|
596
|
+
h.unhandleds.length === 0 ? a() : o(h.unhandleds[0]);
|
|
597
|
+
}, At.push(function g() {
|
|
598
|
+
u(), At.splice(At.indexOf(g), 1);
|
|
599
|
+
}), ++Le, ut(function() {
|
|
600
|
+
--Le == 0 && dn();
|
|
601
601
|
}, []);
|
|
602
602
|
}, s.finalize), e();
|
|
603
603
|
}, t, n, i);
|
|
604
604
|
});
|
|
605
|
-
} }),
|
|
605
|
+
} }), Ne && (Ne.allSettled && ke(K, "allSettled", function() {
|
|
606
606
|
var e = we.apply(null, arguments).map(Rt);
|
|
607
607
|
return new K(function(t) {
|
|
608
608
|
e.length === 0 && t([]);
|
|
@@ -617,7 +617,7 @@ var jr = { exports: {} };
|
|
|
617
617
|
});
|
|
618
618
|
});
|
|
619
619
|
});
|
|
620
|
-
}),
|
|
620
|
+
}), Ne.any && typeof AggregateError < "u" && ke(K, "any", function() {
|
|
621
621
|
var e = we.apply(null, arguments).map(Rt);
|
|
622
622
|
return new K(function(t, n) {
|
|
623
623
|
e.length === 0 && n(new AggregateError([]));
|
|
@@ -630,22 +630,22 @@ var jr = { exports: {} };
|
|
|
630
630
|
});
|
|
631
631
|
});
|
|
632
632
|
});
|
|
633
|
-
}));
|
|
633
|
+
}), Ne.withResolvers && (K.withResolvers = Ne.withResolvers));
|
|
634
634
|
var ie = { awaits: 0, echoes: 0, id: 0 }, ni = 0, Pt = [], It = 0, Ct = 0, ri = 0;
|
|
635
635
|
function De(e, t, n, i) {
|
|
636
|
-
var a =
|
|
637
|
-
return o.parent = a, o.ref = 0, o.global = !1, o.id = ++ri, Ae.env, o.env = an ? { Promise: K, PromiseProp: { value: K, configurable: !0, writable: !0 }, all: K.all, race: K.race, allSettled: K.allSettled, any: K.any, resolve: K.resolve, reject: K.reject } : {}, t &&
|
|
636
|
+
var a = G, o = Object.create(a);
|
|
637
|
+
return o.parent = a, o.ref = 0, o.global = !1, o.id = ++ri, Ae.env, o.env = an ? { Promise: K, PromiseProp: { value: K, configurable: !0, writable: !0 }, all: K.all, race: K.race, allSettled: K.allSettled, any: K.any, resolve: K.resolve, reject: K.reject } : {}, t && J(o, t), ++a.ref, o.finalize = function() {
|
|
638
638
|
--this.parent.ref || this.parent.finalize();
|
|
639
|
-
}, i =
|
|
639
|
+
}, i = Ge(o, e, n, i), o.ref === 0 && o.finalize(), i;
|
|
640
640
|
}
|
|
641
|
-
function
|
|
641
|
+
function Ze() {
|
|
642
642
|
return ie.id || (ie.id = ++ni), ++ie.awaits, ie.echoes += er, ie.id;
|
|
643
643
|
}
|
|
644
644
|
function Pe() {
|
|
645
645
|
return !!ie.awaits && (--ie.awaits == 0 && (ie.id = 0), ie.echoes = ie.awaits * er, !0);
|
|
646
646
|
}
|
|
647
647
|
function Rt(e) {
|
|
648
|
-
return ie.echoes && e && e.constructor ===
|
|
648
|
+
return ie.echoes && e && e.constructor === Ne ? (Ze(), e.then(function(t) {
|
|
649
649
|
return Pe(), t;
|
|
650
650
|
}, function(t) {
|
|
651
651
|
return Pe(), ee(t);
|
|
@@ -656,17 +656,17 @@ var jr = { exports: {} };
|
|
|
656
656
|
Pt.pop(), Ie(e, !1);
|
|
657
657
|
}
|
|
658
658
|
function Ie(e, t) {
|
|
659
|
-
var n, i =
|
|
660
|
-
(t ? !ie.echoes || It++ && e ===
|
|
661
|
-
++Ct, ie.echoes && --ie.echoes != 0 || (ie.echoes = ie.awaits = ie.id = 0), Pt.push(
|
|
662
|
-
}).bind(null, e) : ii), e !==
|
|
659
|
+
var n, i = G;
|
|
660
|
+
(t ? !ie.echoes || It++ && e === G : !It || --It && e === G) || queueMicrotask(t ? (function(a) {
|
|
661
|
+
++Ct, ie.echoes && --ie.echoes != 0 || (ie.echoes = ie.awaits = ie.id = 0), Pt.push(G), Ie(a, !0);
|
|
662
|
+
}).bind(null, e) : ii), e !== G && (G = e, i === Ae && (Ae.env = rr()), an && (n = Ae.env.Promise, t = e.env, (i.global || e.global) && (Object.defineProperty(k, "Promise", t.PromiseProp), n.all = t.all, n.race = t.race, n.resolve = t.resolve, n.reject = t.reject, t.allSettled && (n.allSettled = t.allSettled), t.any && (n.any = t.any))));
|
|
663
663
|
}
|
|
664
664
|
function rr() {
|
|
665
665
|
var e = k.Promise;
|
|
666
666
|
return an ? { Promise: e, PromiseProp: Object.getOwnPropertyDescriptor(k, "Promise"), all: e.all, race: e.race, allSettled: e.allSettled, any: e.any, resolve: e.resolve, reject: e.reject } : {};
|
|
667
667
|
}
|
|
668
|
-
function
|
|
669
|
-
var o =
|
|
668
|
+
function Ge(e, t, n, i, a) {
|
|
669
|
+
var o = G;
|
|
670
670
|
try {
|
|
671
671
|
return Ie(e, !0), t(n, i, a);
|
|
672
672
|
} finally {
|
|
@@ -675,8 +675,8 @@ var jr = { exports: {} };
|
|
|
675
675
|
}
|
|
676
676
|
function ir(e, t, n, i) {
|
|
677
677
|
return typeof e != "function" ? e : function() {
|
|
678
|
-
var a =
|
|
679
|
-
n &&
|
|
678
|
+
var a = G;
|
|
679
|
+
n && Ze(), Ie(t, !0);
|
|
680
680
|
try {
|
|
681
681
|
return e.apply(this, arguments);
|
|
682
682
|
} finally {
|
|
@@ -685,25 +685,25 @@ var jr = { exports: {} };
|
|
|
685
685
|
};
|
|
686
686
|
}
|
|
687
687
|
function fn(e) {
|
|
688
|
-
Promise ===
|
|
688
|
+
Promise === Ne && ie.echoes === 0 ? It === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
|
|
689
689
|
}
|
|
690
|
-
("" +
|
|
691
|
-
var ee = K.reject,
|
|
692
|
-
function
|
|
690
|
+
("" + pe).indexOf("[native code]") === -1 && (Ze = Pe = Q);
|
|
691
|
+
var ee = K.reject, $e = "", _e = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", ar = "String expected.", qe = [], Tt = "__dbnames", hn = "readonly", pn = "readwrite";
|
|
692
|
+
function Fe(e, t) {
|
|
693
693
|
return e ? t ? function() {
|
|
694
694
|
return e.apply(this, arguments) && t.apply(this, arguments);
|
|
695
695
|
} : e : t;
|
|
696
696
|
}
|
|
697
697
|
var or = { type: 3, lower: -1 / 0, lowerOpen: !1, upper: [[]], upperOpen: !1 };
|
|
698
|
-
function
|
|
698
|
+
function Mt(e) {
|
|
699
699
|
return typeof e != "string" || /\./.test(e) ? function(t) {
|
|
700
700
|
return t;
|
|
701
701
|
} : function(t) {
|
|
702
|
-
return t[e] === void 0 && e in t && delete (t =
|
|
702
|
+
return t[e] === void 0 && e in t && delete (t = Me(t))[e], t;
|
|
703
703
|
};
|
|
704
704
|
}
|
|
705
705
|
function sr() {
|
|
706
|
-
throw
|
|
706
|
+
throw $.Type();
|
|
707
707
|
}
|
|
708
708
|
function H(e, t) {
|
|
709
709
|
try {
|
|
@@ -716,13 +716,13 @@ var jr = { exports: {} };
|
|
|
716
716
|
return t < e ? 1 : e < t ? -1 : 0;
|
|
717
717
|
case "binary":
|
|
718
718
|
return function(a, o) {
|
|
719
|
-
for (var s = a.length, u = o.length,
|
|
719
|
+
for (var s = a.length, u = o.length, h = s < u ? s : u, g = 0; g < h; ++g) if (a[g] !== o[g]) return a[g] < o[g] ? -1 : 1;
|
|
720
720
|
return s === u ? 0 : s < u ? -1 : 1;
|
|
721
721
|
}(ur(e), ur(t));
|
|
722
722
|
case "Array":
|
|
723
723
|
return function(a, o) {
|
|
724
|
-
for (var s = a.length, u = o.length,
|
|
725
|
-
var b = H(a[
|
|
724
|
+
for (var s = a.length, u = o.length, h = s < u ? s : u, g = 0; g < h; ++g) {
|
|
725
|
+
var b = H(a[g], o[g]);
|
|
726
726
|
if (b !== 0) return b;
|
|
727
727
|
}
|
|
728
728
|
return s === u ? 0 : s < u ? -1 : 1;
|
|
@@ -739,154 +739,154 @@ var jr = { exports: {} };
|
|
|
739
739
|
function ur(e) {
|
|
740
740
|
return e instanceof Uint8Array ? e : ArrayBuffer.isView(e) ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : new Uint8Array(e);
|
|
741
741
|
}
|
|
742
|
-
var lr = (
|
|
743
|
-
var i = this._tx ||
|
|
744
|
-
function s(
|
|
745
|
-
if (!d.schema[a]) throw new
|
|
742
|
+
var lr = (V.prototype._trans = function(e, t, n) {
|
|
743
|
+
var i = this._tx || G.trans, a = this.name, o = ye && typeof console < "u" && console.createTask && console.createTask("Dexie: ".concat(e === "readonly" ? "read" : "write", " ").concat(this.name));
|
|
744
|
+
function s(g, b, d) {
|
|
745
|
+
if (!d.schema[a]) throw new $.NotFound("Table " + a + " not part of transaction");
|
|
746
746
|
return t(d.idbtrans, d);
|
|
747
747
|
}
|
|
748
|
-
var u =
|
|
748
|
+
var u = Je();
|
|
749
749
|
try {
|
|
750
|
-
var
|
|
750
|
+
var h = i && i.db._novip === this.db._novip ? i === G.trans ? i._promise(e, s, n) : De(function() {
|
|
751
751
|
return i._promise(e, s, n);
|
|
752
|
-
}, { trans: i, transless:
|
|
753
|
-
if (b.idbdb && (b._state.openComplete ||
|
|
754
|
-
var m = b._createTransaction(d,
|
|
752
|
+
}, { trans: i, transless: G.transless || G }) : function g(b, d, w, p) {
|
|
753
|
+
if (b.idbdb && (b._state.openComplete || G.letThrough || b._vip)) {
|
|
754
|
+
var m = b._createTransaction(d, w, b._dbSchema);
|
|
755
755
|
try {
|
|
756
756
|
m.create(), b._state.PR1398_maxLoop = 3;
|
|
757
|
-
} catch (
|
|
758
|
-
return
|
|
759
|
-
return
|
|
760
|
-
})) : ee(
|
|
757
|
+
} catch (v) {
|
|
758
|
+
return v.name === nn.InvalidState && b.isOpen() && 0 < --b._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), b.close({ disableAutoOpen: !1 }), b.open().then(function() {
|
|
759
|
+
return g(b, d, w, p);
|
|
760
|
+
})) : ee(v);
|
|
761
761
|
}
|
|
762
|
-
return m._promise(d, function(
|
|
762
|
+
return m._promise(d, function(v, y) {
|
|
763
763
|
return De(function() {
|
|
764
|
-
return
|
|
764
|
+
return G.trans = m, p(v, y, m);
|
|
765
765
|
});
|
|
766
|
-
}).then(function(
|
|
766
|
+
}).then(function(v) {
|
|
767
767
|
if (d === "readwrite") try {
|
|
768
768
|
m.idbtrans.commit();
|
|
769
769
|
} catch {
|
|
770
770
|
}
|
|
771
|
-
return d === "readonly" ?
|
|
772
|
-
return
|
|
771
|
+
return d === "readonly" ? v : m._completion.then(function() {
|
|
772
|
+
return v;
|
|
773
773
|
});
|
|
774
774
|
});
|
|
775
775
|
}
|
|
776
|
-
if (b._state.openComplete) return ee(new
|
|
776
|
+
if (b._state.openComplete) return ee(new $.DatabaseClosed(b._state.dbOpenError));
|
|
777
777
|
if (!b._state.isBeingOpened) {
|
|
778
|
-
if (!b._state.autoOpen) return ee(new
|
|
778
|
+
if (!b._state.autoOpen) return ee(new $.DatabaseClosed());
|
|
779
779
|
b.open().catch(Q);
|
|
780
780
|
}
|
|
781
781
|
return b._state.dbReadyPromise.then(function() {
|
|
782
|
-
return
|
|
782
|
+
return g(b, d, w, p);
|
|
783
783
|
});
|
|
784
784
|
}(this.db, e, [this.name], s);
|
|
785
|
-
return o && (
|
|
786
|
-
return console.trace(
|
|
787
|
-
})),
|
|
785
|
+
return o && (h._consoleTask = o, h = h.catch(function(g) {
|
|
786
|
+
return console.trace(g), ee(g);
|
|
787
|
+
})), h;
|
|
788
788
|
} finally {
|
|
789
789
|
u && Ve();
|
|
790
790
|
}
|
|
791
|
-
},
|
|
791
|
+
}, V.prototype.get = function(e, t) {
|
|
792
792
|
var n = this;
|
|
793
|
-
return e && e.constructor === Object ? this.where(e).first(t) : e == null ? ee(new
|
|
793
|
+
return e && e.constructor === Object ? this.where(e).first(t) : e == null ? ee(new $.Type("Invalid argument to Table.get()")) : this._trans("readonly", function(i) {
|
|
794
794
|
return n.core.get({ trans: i, key: e }).then(function(a) {
|
|
795
795
|
return n.hook.reading.fire(a);
|
|
796
796
|
});
|
|
797
797
|
}).then(t);
|
|
798
|
-
},
|
|
798
|
+
}, V.prototype.where = function(e) {
|
|
799
799
|
if (typeof e == "string") return new this.db.WhereClause(this, e);
|
|
800
|
-
if (
|
|
800
|
+
if (L(e)) return new this.db.WhereClause(this, "[".concat(e.join("+"), "]"));
|
|
801
801
|
var t = N(e);
|
|
802
802
|
if (t.length === 1) return this.where(t[0]).equals(e[t[0]]);
|
|
803
|
-
var n = this.schema.indexes.concat(this.schema.primKey).filter(function(
|
|
804
|
-
if (
|
|
805
|
-
return 0 <=
|
|
803
|
+
var n = this.schema.indexes.concat(this.schema.primKey).filter(function(u) {
|
|
804
|
+
if (u.compound && t.every(function(g) {
|
|
805
|
+
return 0 <= u.keyPath.indexOf(g);
|
|
806
806
|
})) {
|
|
807
|
-
for (var h = 0; h < t.length; ++h) if (t.indexOf(
|
|
807
|
+
for (var h = 0; h < t.length; ++h) if (t.indexOf(u.keyPath[h]) === -1) return !1;
|
|
808
808
|
return !0;
|
|
809
809
|
}
|
|
810
810
|
return !1;
|
|
811
|
-
}).sort(function(
|
|
812
|
-
return
|
|
811
|
+
}).sort(function(u, h) {
|
|
812
|
+
return u.keyPath.length - h.keyPath.length;
|
|
813
813
|
})[0];
|
|
814
|
-
if (n && this.db._maxKey !==
|
|
815
|
-
var
|
|
816
|
-
return this.where(
|
|
814
|
+
if (n && this.db._maxKey !== $e) {
|
|
815
|
+
var o = n.keyPath.slice(0, t.length);
|
|
816
|
+
return this.where(o).equals(o.map(function(h) {
|
|
817
817
|
return e[h];
|
|
818
818
|
}));
|
|
819
819
|
}
|
|
820
820
|
!n && ye && console.warn("The query ".concat(JSON.stringify(e), " on ").concat(this.name, " would benefit from a ") + "compound index [".concat(t.join("+"), "]"));
|
|
821
|
-
var i = this.schema.idxByName
|
|
822
|
-
function
|
|
823
|
-
return
|
|
821
|
+
var i = this.schema.idxByName;
|
|
822
|
+
function a(u, h) {
|
|
823
|
+
return H(u, h) === 0;
|
|
824
824
|
}
|
|
825
|
-
var
|
|
826
|
-
var
|
|
827
|
-
return [
|
|
828
|
-
return
|
|
829
|
-
return
|
|
825
|
+
var s = t.reduce(function(d, h) {
|
|
826
|
+
var g = d[0], b = d[1], d = i[h], w = e[h];
|
|
827
|
+
return [g || d, g || !d ? Fe(b, d && d.multi ? function(p) {
|
|
828
|
+
return p = ve(p, h), L(p) && p.some(function(m) {
|
|
829
|
+
return a(w, m);
|
|
830
830
|
});
|
|
831
|
-
} : function(
|
|
832
|
-
return
|
|
833
|
-
}) :
|
|
834
|
-
}, [null, null]),
|
|
835
|
-
return
|
|
836
|
-
},
|
|
831
|
+
} : function(p) {
|
|
832
|
+
return a(w, ve(p, h));
|
|
833
|
+
}) : b];
|
|
834
|
+
}, [null, null]), o = s[0], s = s[1];
|
|
835
|
+
return o ? this.where(o.name).equals(e[o.keyPath]).filter(s) : n ? this.filter(s) : this.where(t).equals("");
|
|
836
|
+
}, V.prototype.filter = function(e) {
|
|
837
837
|
return this.toCollection().and(e);
|
|
838
|
-
},
|
|
838
|
+
}, V.prototype.count = function(e) {
|
|
839
839
|
return this.toCollection().count(e);
|
|
840
|
-
},
|
|
840
|
+
}, V.prototype.offset = function(e) {
|
|
841
841
|
return this.toCollection().offset(e);
|
|
842
|
-
},
|
|
842
|
+
}, V.prototype.limit = function(e) {
|
|
843
843
|
return this.toCollection().limit(e);
|
|
844
|
-
},
|
|
844
|
+
}, V.prototype.each = function(e) {
|
|
845
845
|
return this.toCollection().each(e);
|
|
846
|
-
},
|
|
846
|
+
}, V.prototype.toArray = function(e) {
|
|
847
847
|
return this.toCollection().toArray(e);
|
|
848
|
-
},
|
|
848
|
+
}, V.prototype.toCollection = function() {
|
|
849
849
|
return new this.db.Collection(new this.db.WhereClause(this));
|
|
850
|
-
},
|
|
851
|
-
return new this.db.Collection(new this.db.WhereClause(this,
|
|
852
|
-
},
|
|
850
|
+
}, V.prototype.orderBy = function(e) {
|
|
851
|
+
return new this.db.Collection(new this.db.WhereClause(this, L(e) ? "[".concat(e.join("+"), "]") : e));
|
|
852
|
+
}, V.prototype.reverse = function() {
|
|
853
853
|
return this.toCollection().reverse();
|
|
854
|
-
},
|
|
854
|
+
}, V.prototype.mapToClass = function(e) {
|
|
855
855
|
var t, n = this.db, i = this.name;
|
|
856
856
|
function a() {
|
|
857
857
|
return t !== null && t.apply(this, arguments) || this;
|
|
858
858
|
}
|
|
859
|
-
(this.schema.mappedClass = e).prototype instanceof sr && (function(
|
|
860
|
-
if (typeof
|
|
859
|
+
(this.schema.mappedClass = e).prototype instanceof sr && (function(h, g) {
|
|
860
|
+
if (typeof g != "function" && g !== null) throw new TypeError("Class extends value " + String(g) + " is not a constructor or null");
|
|
861
861
|
function b() {
|
|
862
|
-
this.constructor =
|
|
862
|
+
this.constructor = h;
|
|
863
863
|
}
|
|
864
|
-
c(
|
|
864
|
+
c(h, g), h.prototype = g === null ? Object.create(g) : (b.prototype = g.prototype, new b());
|
|
865
865
|
}(a, t = e), Object.defineProperty(a.prototype, "db", { get: function() {
|
|
866
866
|
return n;
|
|
867
867
|
}, enumerable: !1, configurable: !0 }), a.prototype.table = function() {
|
|
868
868
|
return i;
|
|
869
869
|
}, e = a);
|
|
870
|
-
for (var o = /* @__PURE__ */ new Set(), s = e.prototype; s; s = q(s)) Object.getOwnPropertyNames(s).forEach(function(
|
|
871
|
-
return o.add(
|
|
870
|
+
for (var o = /* @__PURE__ */ new Set(), s = e.prototype; s; s = q(s)) Object.getOwnPropertyNames(s).forEach(function(h) {
|
|
871
|
+
return o.add(h);
|
|
872
872
|
});
|
|
873
|
-
function u(
|
|
874
|
-
if (!
|
|
875
|
-
var
|
|
876
|
-
for (
|
|
877
|
-
b[
|
|
873
|
+
function u(h) {
|
|
874
|
+
if (!h) return h;
|
|
875
|
+
var g, b = Object.create(e.prototype);
|
|
876
|
+
for (g in h) if (!o.has(g)) try {
|
|
877
|
+
b[g] = h[g];
|
|
878
878
|
} catch {
|
|
879
879
|
}
|
|
880
880
|
return b;
|
|
881
881
|
}
|
|
882
882
|
return this.schema.readHook && this.hook.reading.unsubscribe(this.schema.readHook), this.schema.readHook = u, this.hook("reading", u), e;
|
|
883
|
-
},
|
|
883
|
+
}, V.prototype.defineClass = function() {
|
|
884
884
|
return this.mapToClass(function(e) {
|
|
885
|
-
|
|
885
|
+
J(this, e);
|
|
886
886
|
});
|
|
887
|
-
},
|
|
887
|
+
}, V.prototype.add = function(e, t) {
|
|
888
888
|
var n = this, i = this.schema.primKey, a = i.auto, o = i.keyPath, s = e;
|
|
889
|
-
return o && a && (s =
|
|
889
|
+
return o && a && (s = Mt(o)(e)), this._trans("readwrite", function(u) {
|
|
890
890
|
return n.core.mutate({ trans: u, type: "add", keys: t != null ? [t] : null, values: [s] });
|
|
891
891
|
}).then(function(u) {
|
|
892
892
|
return u.numFailures ? K.reject(u.failures[0]) : u.lastResult;
|
|
@@ -897,11 +897,11 @@ var jr = { exports: {} };
|
|
|
897
897
|
}
|
|
898
898
|
return u;
|
|
899
899
|
});
|
|
900
|
-
},
|
|
901
|
-
return typeof e != "object" ||
|
|
902
|
-
},
|
|
900
|
+
}, V.prototype.update = function(e, t) {
|
|
901
|
+
return typeof e != "object" || L(e) ? this.where(":id").equals(e).modify(t) : (e = ve(e, this.schema.primKey.keyPath), e === void 0 ? ee(new $.InvalidArgument("Given object does not contain its primary key")) : this.where(":id").equals(e).modify(t));
|
|
902
|
+
}, V.prototype.put = function(e, t) {
|
|
903
903
|
var n = this, i = this.schema.primKey, a = i.auto, o = i.keyPath, s = e;
|
|
904
|
-
return o && a && (s =
|
|
904
|
+
return o && a && (s = Mt(o)(e)), this._trans("readwrite", function(u) {
|
|
905
905
|
return n.core.mutate({ trans: u, type: "put", values: [s], keys: t != null ? [t] : null });
|
|
906
906
|
}).then(function(u) {
|
|
907
907
|
return u.numFailures ? K.reject(u.failures[0]) : u.lastResult;
|
|
@@ -912,21 +912,21 @@ var jr = { exports: {} };
|
|
|
912
912
|
}
|
|
913
913
|
return u;
|
|
914
914
|
});
|
|
915
|
-
},
|
|
915
|
+
}, V.prototype.delete = function(e) {
|
|
916
916
|
var t = this;
|
|
917
917
|
return this._trans("readwrite", function(n) {
|
|
918
918
|
return t.core.mutate({ trans: n, type: "delete", keys: [e] });
|
|
919
919
|
}).then(function(n) {
|
|
920
920
|
return n.numFailures ? K.reject(n.failures[0]) : void 0;
|
|
921
921
|
});
|
|
922
|
-
},
|
|
922
|
+
}, V.prototype.clear = function() {
|
|
923
923
|
var e = this;
|
|
924
924
|
return this._trans("readwrite", function(t) {
|
|
925
925
|
return e.core.mutate({ trans: t, type: "deleteRange", range: or });
|
|
926
926
|
}).then(function(t) {
|
|
927
927
|
return t.numFailures ? K.reject(t.failures[0]) : void 0;
|
|
928
928
|
});
|
|
929
|
-
},
|
|
929
|
+
}, V.prototype.bulkGet = function(e) {
|
|
930
930
|
var t = this;
|
|
931
931
|
return this._trans("readonly", function(n) {
|
|
932
932
|
return t.core.getMany({ keys: e, trans: n }).then(function(i) {
|
|
@@ -935,33 +935,33 @@ var jr = { exports: {} };
|
|
|
935
935
|
});
|
|
936
936
|
});
|
|
937
937
|
});
|
|
938
|
-
},
|
|
938
|
+
}, V.prototype.bulkAdd = function(e, t, n) {
|
|
939
939
|
var i = this, a = Array.isArray(t) ? t : void 0, o = (n = n || (a ? void 0 : t)) ? n.allKeys : void 0;
|
|
940
940
|
return this._trans("readwrite", function(s) {
|
|
941
|
-
var
|
|
942
|
-
if (
|
|
943
|
-
if (a && a.length !== e.length) throw new
|
|
944
|
-
var
|
|
945
|
-
return i.core.mutate({ trans: s, type: "add", keys: a, values:
|
|
946
|
-
var d = m.numFailures,
|
|
947
|
-
if (d === 0) return o ?
|
|
948
|
-
throw new
|
|
941
|
+
var g = i.schema.primKey, u = g.auto, g = g.keyPath;
|
|
942
|
+
if (g && a) throw new $.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
|
|
943
|
+
if (a && a.length !== e.length) throw new $.InvalidArgument("Arguments objects and keys must have the same length");
|
|
944
|
+
var h = e.length, g = g && u ? e.map(Mt(g)) : e;
|
|
945
|
+
return i.core.mutate({ trans: s, type: "add", keys: a, values: g, wantResults: o }).then(function(m) {
|
|
946
|
+
var d = m.numFailures, w = m.results, p = m.lastResult, m = m.failures;
|
|
947
|
+
if (d === 0) return o ? w : p;
|
|
948
|
+
throw new Xe("".concat(i.name, ".bulkAdd(): ").concat(d, " of ").concat(h, " operations failed"), m);
|
|
949
949
|
});
|
|
950
950
|
});
|
|
951
|
-
},
|
|
951
|
+
}, V.prototype.bulkPut = function(e, t, n) {
|
|
952
952
|
var i = this, a = Array.isArray(t) ? t : void 0, o = (n = n || (a ? void 0 : t)) ? n.allKeys : void 0;
|
|
953
953
|
return this._trans("readwrite", function(s) {
|
|
954
|
-
var
|
|
955
|
-
if (
|
|
956
|
-
if (a && a.length !== e.length) throw new
|
|
957
|
-
var
|
|
958
|
-
return i.core.mutate({ trans: s, type: "put", keys: a, values:
|
|
959
|
-
var d = m.numFailures,
|
|
960
|
-
if (d === 0) return o ?
|
|
961
|
-
throw new
|
|
954
|
+
var g = i.schema.primKey, u = g.auto, g = g.keyPath;
|
|
955
|
+
if (g && a) throw new $.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
|
|
956
|
+
if (a && a.length !== e.length) throw new $.InvalidArgument("Arguments objects and keys must have the same length");
|
|
957
|
+
var h = e.length, g = g && u ? e.map(Mt(g)) : e;
|
|
958
|
+
return i.core.mutate({ trans: s, type: "put", keys: a, values: g, wantResults: o }).then(function(m) {
|
|
959
|
+
var d = m.numFailures, w = m.results, p = m.lastResult, m = m.failures;
|
|
960
|
+
if (d === 0) return o ? w : p;
|
|
961
|
+
throw new Xe("".concat(i.name, ".bulkPut(): ").concat(d, " of ").concat(h, " operations failed"), m);
|
|
962
962
|
});
|
|
963
963
|
});
|
|
964
|
-
},
|
|
964
|
+
}, V.prototype.bulkUpdate = function(e) {
|
|
965
965
|
var t = this, n = this.core, i = e.map(function(s) {
|
|
966
966
|
return s.key;
|
|
967
967
|
}), a = e.map(function(s) {
|
|
@@ -969,48 +969,48 @@ var jr = { exports: {} };
|
|
|
969
969
|
}), o = [];
|
|
970
970
|
return this._trans("readwrite", function(s) {
|
|
971
971
|
return n.getMany({ trans: s, keys: i, cache: "clone" }).then(function(u) {
|
|
972
|
-
var
|
|
973
|
-
e.forEach(function(d,
|
|
974
|
-
var p = d.key, m = d.changes,
|
|
975
|
-
if (
|
|
972
|
+
var h = [], g = [];
|
|
973
|
+
e.forEach(function(d, w) {
|
|
974
|
+
var p = d.key, m = d.changes, v = u[w];
|
|
975
|
+
if (v) {
|
|
976
976
|
for (var y = 0, S = Object.keys(m); y < S.length; y++) {
|
|
977
977
|
var E = S[y], O = m[E];
|
|
978
978
|
if (E === t.schema.primKey.keyPath) {
|
|
979
|
-
if (H(O, p) !== 0) throw new
|
|
980
|
-
} else de(
|
|
979
|
+
if (H(O, p) !== 0) throw new $.Constraint("Cannot update primary key in bulkUpdate()");
|
|
980
|
+
} else de(v, E, O);
|
|
981
981
|
}
|
|
982
|
-
o.push(
|
|
982
|
+
o.push(w), h.push(p), g.push(v);
|
|
983
983
|
}
|
|
984
984
|
});
|
|
985
|
-
var b =
|
|
986
|
-
return n.mutate({ trans: s, type: "put", keys:
|
|
987
|
-
var
|
|
988
|
-
if (
|
|
989
|
-
for (var m = 0,
|
|
990
|
-
var y, S =
|
|
985
|
+
var b = h.length;
|
|
986
|
+
return n.mutate({ trans: s, type: "put", keys: h, values: g, updates: { keys: i, changeSpecs: a } }).then(function(d) {
|
|
987
|
+
var w = d.numFailures, p = d.failures;
|
|
988
|
+
if (w === 0) return b;
|
|
989
|
+
for (var m = 0, v = Object.keys(p); m < v.length; m++) {
|
|
990
|
+
var y, S = v[m], E = o[Number(S)];
|
|
991
991
|
E != null && (y = p[S], delete p[S], p[E] = y);
|
|
992
992
|
}
|
|
993
|
-
throw new
|
|
993
|
+
throw new Xe("".concat(t.name, ".bulkUpdate(): ").concat(w, " of ").concat(b, " operations failed"), p);
|
|
994
994
|
});
|
|
995
995
|
});
|
|
996
996
|
});
|
|
997
|
-
},
|
|
997
|
+
}, V.prototype.bulkDelete = function(e) {
|
|
998
998
|
var t = this, n = e.length;
|
|
999
999
|
return this._trans("readwrite", function(i) {
|
|
1000
1000
|
return t.core.mutate({ trans: i, type: "delete", keys: e });
|
|
1001
1001
|
}).then(function(s) {
|
|
1002
1002
|
var a = s.numFailures, o = s.lastResult, s = s.failures;
|
|
1003
1003
|
if (a === 0) return o;
|
|
1004
|
-
throw new
|
|
1004
|
+
throw new Xe("".concat(t.name, ".bulkDelete(): ").concat(a, " of ").concat(n, " operations failed"), s);
|
|
1005
1005
|
});
|
|
1006
|
-
},
|
|
1007
|
-
function
|
|
1006
|
+
}, V);
|
|
1007
|
+
function V() {
|
|
1008
1008
|
}
|
|
1009
1009
|
function dt(e) {
|
|
1010
1010
|
function t(s, u) {
|
|
1011
1011
|
if (u) {
|
|
1012
|
-
for (var
|
|
1013
|
-
return n[s].subscribe.apply(null,
|
|
1012
|
+
for (var h = arguments.length, g = new Array(h - 1); --h; ) g[h - 1] = arguments[h];
|
|
1013
|
+
return n[s].subscribe.apply(null, g), e;
|
|
1014
1014
|
}
|
|
1015
1015
|
if (typeof s == "string") return n[s];
|
|
1016
1016
|
}
|
|
@@ -1018,29 +1018,29 @@ var jr = { exports: {} };
|
|
|
1018
1018
|
t.addEventType = o;
|
|
1019
1019
|
for (var i = 1, a = arguments.length; i < a; ++i) o(arguments[i]);
|
|
1020
1020
|
return t;
|
|
1021
|
-
function o(s, u,
|
|
1021
|
+
function o(s, u, h) {
|
|
1022
1022
|
if (typeof s != "object") {
|
|
1023
|
-
var
|
|
1023
|
+
var g;
|
|
1024
1024
|
u = u || qr;
|
|
1025
|
-
var b = { subscribers: [], fire:
|
|
1025
|
+
var b = { subscribers: [], fire: h = h || Q, subscribe: function(d) {
|
|
1026
1026
|
b.subscribers.indexOf(d) === -1 && (b.subscribers.push(d), b.fire = u(b.fire, d));
|
|
1027
1027
|
}, unsubscribe: function(d) {
|
|
1028
|
-
b.subscribers = b.subscribers.filter(function(
|
|
1029
|
-
return
|
|
1030
|
-
}), b.fire = b.subscribers.reduce(u,
|
|
1028
|
+
b.subscribers = b.subscribers.filter(function(w) {
|
|
1029
|
+
return w !== d;
|
|
1030
|
+
}), b.fire = b.subscribers.reduce(u, h);
|
|
1031
1031
|
} };
|
|
1032
1032
|
return n[s] = t[s] = b;
|
|
1033
1033
|
}
|
|
1034
|
-
N(
|
|
1035
|
-
var
|
|
1036
|
-
if (
|
|
1034
|
+
N(g = s).forEach(function(d) {
|
|
1035
|
+
var w = g[d];
|
|
1036
|
+
if (L(w)) o(d, g[d][0], g[d][1]);
|
|
1037
1037
|
else {
|
|
1038
|
-
if (
|
|
1039
|
-
var p = o(d,
|
|
1040
|
-
for (var m = arguments.length,
|
|
1038
|
+
if (w !== "asap") throw new $.InvalidArgument("Invalid event config");
|
|
1039
|
+
var p = o(d, ot, function() {
|
|
1040
|
+
for (var m = arguments.length, v = new Array(m); m--; ) v[m] = arguments[m];
|
|
1041
1041
|
p.subscribers.forEach(function(y) {
|
|
1042
1042
|
Yn(function() {
|
|
1043
|
-
y.apply(null,
|
|
1043
|
+
y.apply(null, v);
|
|
1044
1044
|
});
|
|
1045
1045
|
});
|
|
1046
1046
|
});
|
|
@@ -1049,44 +1049,44 @@ var jr = { exports: {} };
|
|
|
1049
1049
|
}
|
|
1050
1050
|
}
|
|
1051
1051
|
function ft(e, t) {
|
|
1052
|
-
return
|
|
1052
|
+
return He(t).from({ prototype: e }), t;
|
|
1053
1053
|
}
|
|
1054
|
-
function
|
|
1054
|
+
function et(e, t) {
|
|
1055
1055
|
return !(e.filter || e.algorithm || e.or) && (t ? e.justLimit : !e.replayFilter);
|
|
1056
1056
|
}
|
|
1057
1057
|
function gn(e, t) {
|
|
1058
|
-
e.filter =
|
|
1058
|
+
e.filter = Fe(e.filter, t);
|
|
1059
1059
|
}
|
|
1060
1060
|
function yn(e, t, n) {
|
|
1061
1061
|
var i = e.replayFilter;
|
|
1062
1062
|
e.replayFilter = i ? function() {
|
|
1063
|
-
return
|
|
1063
|
+
return Fe(i(), t());
|
|
1064
1064
|
} : t, e.justLimit = n && !i;
|
|
1065
1065
|
}
|
|
1066
|
-
function
|
|
1066
|
+
function jt(e, t) {
|
|
1067
1067
|
if (e.isPrimKey) return t.primaryKey;
|
|
1068
1068
|
var n = t.getIndexByKeyPath(e.index);
|
|
1069
|
-
if (!n) throw new
|
|
1069
|
+
if (!n) throw new $.Schema("KeyPath " + e.index + " on object store " + t.name + " is not indexed");
|
|
1070
1070
|
return n;
|
|
1071
1071
|
}
|
|
1072
1072
|
function dr(e, t, n) {
|
|
1073
|
-
var i =
|
|
1073
|
+
var i = jt(e, t.schema);
|
|
1074
1074
|
return t.openCursor({ trans: n, values: !e.keysOnly, reverse: e.dir === "prev", unique: !!e.unique, query: { index: i, range: e.range } });
|
|
1075
1075
|
}
|
|
1076
1076
|
function Kt(e, t, n, i) {
|
|
1077
|
-
var a = e.replayFilter ?
|
|
1077
|
+
var a = e.replayFilter ? Fe(e.filter, e.replayFilter()) : e.filter;
|
|
1078
1078
|
if (e.or) {
|
|
1079
|
-
var o = {}, s = function(u,
|
|
1079
|
+
var o = {}, s = function(u, h, g) {
|
|
1080
1080
|
var b, d;
|
|
1081
|
-
a && !a(
|
|
1082
|
-
return
|
|
1083
|
-
}, function(
|
|
1084
|
-
return
|
|
1085
|
-
}) || ((d = "" + (b =
|
|
1081
|
+
a && !a(h, g, function(w) {
|
|
1082
|
+
return h.stop(w);
|
|
1083
|
+
}, function(w) {
|
|
1084
|
+
return h.fail(w);
|
|
1085
|
+
}) || ((d = "" + (b = h.primaryKey)) == "[object ArrayBuffer]" && (d = "" + new Uint8Array(b)), ne(o, d) || (o[d] = !0, t(u, h, g)));
|
|
1086
1086
|
};
|
|
1087
1087
|
return Promise.all([e.or._iterate(s, n), fr(dr(e, i, n), e.algorithm, s, !e.keysOnly && e.valueMapper)]);
|
|
1088
1088
|
}
|
|
1089
|
-
return fr(dr(e, i, n),
|
|
1089
|
+
return fr(dr(e, i, n), Fe(e.algorithm, a), t, !e.keysOnly && e.valueMapper);
|
|
1090
1090
|
}
|
|
1091
1091
|
function fr(e, t, n, i) {
|
|
1092
1092
|
var a = Z(i ? function(o, s, u) {
|
|
@@ -1112,7 +1112,7 @@ var jr = { exports: {} };
|
|
|
1112
1112
|
var Se = Symbol(), ht = (hr.prototype.execute = function(e) {
|
|
1113
1113
|
if (this.add !== void 0) {
|
|
1114
1114
|
var t = this.add;
|
|
1115
|
-
if (
|
|
1115
|
+
if (L(t)) return A(A([], L(e) ? e : [], !0), t).sort();
|
|
1116
1116
|
if (typeof t == "number") return (Number(e) || 0) + t;
|
|
1117
1117
|
if (typeof t == "bigint") try {
|
|
1118
1118
|
return BigInt(e) + t;
|
|
@@ -1123,7 +1123,7 @@ var jr = { exports: {} };
|
|
|
1123
1123
|
}
|
|
1124
1124
|
if (this.remove !== void 0) {
|
|
1125
1125
|
var n = this.remove;
|
|
1126
|
-
if (
|
|
1126
|
+
if (L(n)) return L(e) ? e.filter(function(i) {
|
|
1127
1127
|
return !n.includes(i);
|
|
1128
1128
|
}).sort() : [];
|
|
1129
1129
|
if (typeof n == "number") return Number(e) - n;
|
|
@@ -1147,12 +1147,12 @@ var jr = { exports: {} };
|
|
|
1147
1147
|
return t.error ? t.table._trans(null, ee.bind(null, t.error)) : t.table._trans("readwrite", e, "locked");
|
|
1148
1148
|
}, Y.prototype._addAlgorithm = function(e) {
|
|
1149
1149
|
var t = this._ctx;
|
|
1150
|
-
t.algorithm =
|
|
1150
|
+
t.algorithm = Fe(t.algorithm, e);
|
|
1151
1151
|
}, Y.prototype._iterate = function(e, t) {
|
|
1152
1152
|
return Kt(this._ctx, e, t, this._ctx.table.core);
|
|
1153
1153
|
}, Y.prototype.clone = function(e) {
|
|
1154
1154
|
var t = Object.create(this.constructor.prototype), n = Object.create(this._ctx);
|
|
1155
|
-
return e &&
|
|
1155
|
+
return e && J(n, e), t._ctx = n, t;
|
|
1156
1156
|
}, Y.prototype.raw = function() {
|
|
1157
1157
|
return this._ctx.valueMapper = null, this;
|
|
1158
1158
|
}, Y.prototype.each = function(e) {
|
|
@@ -1164,7 +1164,7 @@ var jr = { exports: {} };
|
|
|
1164
1164
|
var t = this;
|
|
1165
1165
|
return this._read(function(n) {
|
|
1166
1166
|
var i = t._ctx, a = i.table.core;
|
|
1167
|
-
if (
|
|
1167
|
+
if (et(i, !0)) return a.count({ trans: n, query: { index: jt(i, a.schema), range: i.range } }).then(function(s) {
|
|
1168
1168
|
return Math.min(s, i.limit);
|
|
1169
1169
|
});
|
|
1170
1170
|
var o = 0;
|
|
@@ -1176,22 +1176,22 @@ var jr = { exports: {} };
|
|
|
1176
1176
|
}).then(e);
|
|
1177
1177
|
}, Y.prototype.sortBy = function(e, t) {
|
|
1178
1178
|
var n = e.split(".").reverse(), i = n[0], a = n.length - 1;
|
|
1179
|
-
function o(
|
|
1180
|
-
return
|
|
1179
|
+
function o(h, g) {
|
|
1180
|
+
return g ? o(h[n[g]], g - 1) : h[i];
|
|
1181
1181
|
}
|
|
1182
1182
|
var s = this._ctx.dir === "next" ? 1 : -1;
|
|
1183
|
-
function u(
|
|
1184
|
-
return
|
|
1183
|
+
function u(h, g) {
|
|
1184
|
+
return H(o(h, a), o(g, a)) * s;
|
|
1185
1185
|
}
|
|
1186
|
-
return this.toArray(function(
|
|
1187
|
-
return
|
|
1186
|
+
return this.toArray(function(h) {
|
|
1187
|
+
return h.sort(u);
|
|
1188
1188
|
}).then(t);
|
|
1189
1189
|
}, Y.prototype.toArray = function(e) {
|
|
1190
1190
|
var t = this;
|
|
1191
1191
|
return this._read(function(n) {
|
|
1192
1192
|
var i = t._ctx;
|
|
1193
|
-
if (i.dir === "next" &&
|
|
1194
|
-
var a = i.valueMapper, o =
|
|
1193
|
+
if (i.dir === "next" && et(i, !0) && 0 < i.limit) {
|
|
1194
|
+
var a = i.valueMapper, o = jt(i, i.table.core.schema);
|
|
1195
1195
|
return i.table.core.query({ trans: n, limit: i.limit, values: !0, query: { index: o, range: i.range } }).then(function(u) {
|
|
1196
1196
|
return u = u.result, a ? u.map(a) : u;
|
|
1197
1197
|
});
|
|
@@ -1205,7 +1205,7 @@ var jr = { exports: {} };
|
|
|
1205
1205
|
}, e);
|
|
1206
1206
|
}, Y.prototype.offset = function(e) {
|
|
1207
1207
|
var t = this._ctx;
|
|
1208
|
-
return e <= 0 || (t.offset += e,
|
|
1208
|
+
return e <= 0 || (t.offset += e, et(t) ? yn(t, function() {
|
|
1209
1209
|
var n = e;
|
|
1210
1210
|
return function(i, a) {
|
|
1211
1211
|
return n === 0 || (n === 1 ? --n : a(function() {
|
|
@@ -1239,7 +1239,7 @@ var jr = { exports: {} };
|
|
|
1239
1239
|
var t;
|
|
1240
1240
|
return gn(this._ctx, function(n) {
|
|
1241
1241
|
return e(n.value);
|
|
1242
|
-
}), (t = this._ctx).isMatch =
|
|
1242
|
+
}), (t = this._ctx).isMatch = Fe(t.isMatch, e), this;
|
|
1243
1243
|
}, Y.prototype.and = function(e) {
|
|
1244
1244
|
return this.filter(e);
|
|
1245
1245
|
}, Y.prototype.or = function(e) {
|
|
@@ -1271,8 +1271,8 @@ var jr = { exports: {} };
|
|
|
1271
1271
|
}).then(e);
|
|
1272
1272
|
}, Y.prototype.primaryKeys = function(e) {
|
|
1273
1273
|
var t = this._ctx;
|
|
1274
|
-
if (t.dir === "next" &&
|
|
1275
|
-
var a =
|
|
1274
|
+
if (t.dir === "next" && et(t, !0) && 0 < t.limit) return this._read(function(i) {
|
|
1275
|
+
var a = jt(t, t.table.core.schema);
|
|
1276
1276
|
return t.table.core.query({ trans: i, values: !1, limit: t.limit, query: { index: a, range: t.range } });
|
|
1277
1277
|
}).then(function(i) {
|
|
1278
1278
|
return i.result;
|
|
@@ -1306,60 +1306,62 @@ var jr = { exports: {} };
|
|
|
1306
1306
|
var a, o, s;
|
|
1307
1307
|
s = typeof e == "function" ? e : (a = N(e), o = a.length, function(y) {
|
|
1308
1308
|
for (var S = !1, E = 0; E < o; ++E) {
|
|
1309
|
-
var O = a[E], x = e[O],
|
|
1310
|
-
x instanceof ht ? (de(y, O, x.execute(
|
|
1309
|
+
var O = a[E], x = e[O], P = ve(y, O);
|
|
1310
|
+
x instanceof ht ? (de(y, O, x.execute(P)), S = !0) : P !== x && (de(y, O, x), S = !0);
|
|
1311
1311
|
}
|
|
1312
1312
|
return S;
|
|
1313
1313
|
});
|
|
1314
|
-
|
|
1314
|
+
var u = n.table.core, d = u.schema.primaryKey, h = d.outbound, g = d.extractKey, b = 200, d = t.db._options.modifyChunkSize;
|
|
1315
|
+
d && (b = typeof d == "object" ? d[u.name] || d["*"] || 200 : d);
|
|
1316
|
+
function w(y, O) {
|
|
1315
1317
|
var E = O.failures, O = O.numFailures;
|
|
1316
1318
|
m += y - O;
|
|
1317
|
-
for (var x = 0,
|
|
1318
|
-
var T =
|
|
1319
|
+
for (var x = 0, P = N(E); x < P.length; x++) {
|
|
1320
|
+
var T = P[x];
|
|
1319
1321
|
p.push(E[T]);
|
|
1320
1322
|
}
|
|
1321
1323
|
}
|
|
1322
|
-
var
|
|
1324
|
+
var p = [], m = 0, v = [];
|
|
1323
1325
|
return t.clone().primaryKeys().then(function(y) {
|
|
1324
1326
|
function S(O) {
|
|
1325
|
-
var x = Math.min(
|
|
1326
|
-
return
|
|
1327
|
-
for (var T = [],
|
|
1328
|
-
var
|
|
1329
|
-
s.call(
|
|
1327
|
+
var x = Math.min(b, y.length - O);
|
|
1328
|
+
return u.getMany({ trans: i, keys: y.slice(O, O + x), cache: "immutable" }).then(function(P) {
|
|
1329
|
+
for (var T = [], I = [], C = h ? [] : null, M = [], R = 0; R < x; ++R) {
|
|
1330
|
+
var B = P[R], U = { value: Me(B), primKey: y[O + R] };
|
|
1331
|
+
s.call(U, U.value, U) !== !1 && (U.value == null ? M.push(y[O + R]) : h || H(g(B), g(U.value)) === 0 ? (I.push(U.value), h && C.push(y[O + R])) : (M.push(y[O + R]), T.push(U.value)));
|
|
1330
1332
|
}
|
|
1331
|
-
return Promise.resolve(0 < T.length &&
|
|
1332
|
-
for (var
|
|
1333
|
-
|
|
1333
|
+
return Promise.resolve(0 < T.length && u.mutate({ trans: i, type: "add", values: T }).then(function(W) {
|
|
1334
|
+
for (var z in W.failures) M.splice(parseInt(z), 1);
|
|
1335
|
+
w(T.length, W);
|
|
1334
1336
|
})).then(function() {
|
|
1335
|
-
return (0 <
|
|
1336
|
-
return
|
|
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(W) {
|
|
1338
|
+
return w(I.length, W);
|
|
1337
1339
|
});
|
|
1338
1340
|
}).then(function() {
|
|
1339
|
-
return (0 <
|
|
1340
|
-
return
|
|
1341
|
+
return (0 < M.length || E && e === mn) && u.mutate({ trans: i, type: "delete", keys: M, criteria: E, isAdditionalChunk: 0 < O }).then(function(W) {
|
|
1342
|
+
return w(M.length, W);
|
|
1341
1343
|
});
|
|
1342
1344
|
}).then(function() {
|
|
1343
|
-
return y.length > O + x && S(O +
|
|
1345
|
+
return y.length > O + x && S(O + b);
|
|
1344
1346
|
});
|
|
1345
1347
|
});
|
|
1346
1348
|
}
|
|
1347
|
-
var E =
|
|
1349
|
+
var E = et(n) && n.limit === 1 / 0 && (typeof e != "function" || e === mn) && { index: n.index, range: n.range };
|
|
1348
1350
|
return S(0).then(function() {
|
|
1349
|
-
if (0 < p.length) throw new Et("Error modifying one or more objects", p, m,
|
|
1351
|
+
if (0 < p.length) throw new Et("Error modifying one or more objects", p, m, v);
|
|
1350
1352
|
return y.length;
|
|
1351
1353
|
});
|
|
1352
1354
|
});
|
|
1353
1355
|
});
|
|
1354
1356
|
}, Y.prototype.delete = function() {
|
|
1355
1357
|
var e = this._ctx, t = e.range;
|
|
1356
|
-
return
|
|
1358
|
+
return et(e) && (e.isPrimKey || t.type === 3) ? this._write(function(n) {
|
|
1357
1359
|
var i = e.table.core.schema.primaryKey, a = t;
|
|
1358
1360
|
return e.table.core.count({ trans: n, query: { index: i, range: a } }).then(function(o) {
|
|
1359
1361
|
return e.table.core.mutate({ trans: n, type: "deleteRange", range: a }).then(function(s) {
|
|
1360
1362
|
var u = s.failures;
|
|
1361
|
-
if (s.lastResult, s.results, s = s.numFailures, s) throw new Et("Could not delete some values", Object.keys(u).map(function(
|
|
1362
|
-
return u[
|
|
1363
|
+
if (s.lastResult, s.results, s = s.numFailures, s) throw new Et("Could not delete some values", Object.keys(u).map(function(h) {
|
|
1364
|
+
return u[h];
|
|
1363
1365
|
}), o - s);
|
|
1364
1366
|
return o - s;
|
|
1365
1367
|
});
|
|
@@ -1380,17 +1382,17 @@ var jr = { exports: {} };
|
|
|
1380
1382
|
function fe(e, t, n) {
|
|
1381
1383
|
return e = e instanceof gr ? new e.Collection(e) : e, e._ctx.error = new (n || TypeError)(t), e;
|
|
1382
1384
|
}
|
|
1383
|
-
function
|
|
1385
|
+
function tt(e) {
|
|
1384
1386
|
return new e.Collection(e, function() {
|
|
1385
1387
|
return pr("");
|
|
1386
1388
|
}).limit(0);
|
|
1387
1389
|
}
|
|
1388
1390
|
function Nt(e, t, n, i) {
|
|
1389
|
-
var a, o, s, u,
|
|
1391
|
+
var a, o, s, u, h, g, b, d = n.length;
|
|
1390
1392
|
if (!n.every(function(m) {
|
|
1391
1393
|
return typeof m == "string";
|
|
1392
1394
|
})) return fe(e, ar);
|
|
1393
|
-
function
|
|
1395
|
+
function w(m) {
|
|
1394
1396
|
a = m === "next" ? function(y) {
|
|
1395
1397
|
return y.toUpperCase();
|
|
1396
1398
|
} : function(y) {
|
|
@@ -1400,40 +1402,40 @@ var jr = { exports: {} };
|
|
|
1400
1402
|
} : function(y) {
|
|
1401
1403
|
return y.toUpperCase();
|
|
1402
1404
|
}, s = m === "next" ? oi : si;
|
|
1403
|
-
var
|
|
1405
|
+
var v = n.map(function(y) {
|
|
1404
1406
|
return { lower: o(y), upper: a(y) };
|
|
1405
1407
|
}).sort(function(y, S) {
|
|
1406
1408
|
return s(y.lower, S.lower);
|
|
1407
1409
|
});
|
|
1408
|
-
u =
|
|
1410
|
+
u = v.map(function(y) {
|
|
1409
1411
|
return y.upper;
|
|
1410
|
-
}),
|
|
1412
|
+
}), h = v.map(function(y) {
|
|
1411
1413
|
return y.lower;
|
|
1412
|
-
}), b = (
|
|
1414
|
+
}), b = (g = m) === "next" ? "" : i;
|
|
1413
1415
|
}
|
|
1414
|
-
|
|
1415
|
-
return Ce(u[0],
|
|
1416
|
+
w("next"), e = new e.Collection(e, function() {
|
|
1417
|
+
return Ce(u[0], h[d - 1] + i);
|
|
1416
1418
|
}), e._ondirectionchange = function(m) {
|
|
1417
|
-
|
|
1419
|
+
w(m);
|
|
1418
1420
|
};
|
|
1419
1421
|
var p = 0;
|
|
1420
|
-
return e._addAlgorithm(function(m,
|
|
1422
|
+
return e._addAlgorithm(function(m, v, y) {
|
|
1421
1423
|
var S = m.key;
|
|
1422
1424
|
if (typeof S != "string") return !1;
|
|
1423
1425
|
var E = o(S);
|
|
1424
|
-
if (t(E,
|
|
1426
|
+
if (t(E, h, p)) return !0;
|
|
1425
1427
|
for (var O = null, x = p; x < d; ++x) {
|
|
1426
|
-
var
|
|
1427
|
-
for (var
|
|
1428
|
-
var
|
|
1429
|
-
if (
|
|
1430
|
-
|
|
1428
|
+
var P = function(T, I, C, M, R, B) {
|
|
1429
|
+
for (var U = Math.min(T.length, M.length), W = -1, z = 0; z < U; ++z) {
|
|
1430
|
+
var he = I[z];
|
|
1431
|
+
if (he !== M[z]) return R(T[z], C[z]) < 0 ? T.substr(0, z) + C[z] + C.substr(z + 1) : R(T[z], M[z]) < 0 ? T.substr(0, z) + M[z] + C.substr(z + 1) : 0 <= W ? T.substr(0, W) + I[W] + C.substr(W + 1) : null;
|
|
1432
|
+
R(T[z], he) < 0 && (W = z);
|
|
1431
1433
|
}
|
|
1432
|
-
return
|
|
1433
|
-
}(S, E, u[x],
|
|
1434
|
-
|
|
1434
|
+
return U < M.length && B === "next" ? T + C.substr(T.length) : U < T.length && B === "prev" ? T.substr(0, C.length) : W < 0 ? null : T.substr(0, W) + M[W] + C.substr(W + 1);
|
|
1435
|
+
}(S, E, u[x], h[x], s, g);
|
|
1436
|
+
P === null && O === null ? p = x + 1 : (O === null || 0 < s(O, P)) && (O = P);
|
|
1435
1437
|
}
|
|
1436
|
-
return
|
|
1438
|
+
return v(O !== null ? function() {
|
|
1437
1439
|
m.continue(O + b);
|
|
1438
1440
|
} : y), !1;
|
|
1439
1441
|
}), e;
|
|
@@ -1449,7 +1451,7 @@ var jr = { exports: {} };
|
|
|
1449
1451
|
}, enumerable: !1, configurable: !0 }), ae.prototype.between = function(e, t, n, i) {
|
|
1450
1452
|
n = n !== !1, i = i === !0;
|
|
1451
1453
|
try {
|
|
1452
|
-
return 0 < this._cmp(e, t) || this._cmp(e, t) === 0 && (n || i) && (!n || !i) ?
|
|
1454
|
+
return 0 < this._cmp(e, t) || this._cmp(e, t) === 0 && (n || i) && (!n || !i) ? tt(this) : new this.Collection(this, function() {
|
|
1453
1455
|
return Ce(e, t, !n, !i);
|
|
1454
1456
|
});
|
|
1455
1457
|
} catch {
|
|
@@ -1476,35 +1478,35 @@ var jr = { exports: {} };
|
|
|
1476
1478
|
return Ce(void 0, e);
|
|
1477
1479
|
});
|
|
1478
1480
|
}, ae.prototype.startsWith = function(e) {
|
|
1479
|
-
return typeof e != "string" ? fe(this, ar) : this.between(e, e +
|
|
1481
|
+
return typeof e != "string" ? fe(this, ar) : this.between(e, e + $e, !0, !0);
|
|
1480
1482
|
}, ae.prototype.startsWithIgnoreCase = function(e) {
|
|
1481
1483
|
return e === "" ? this.startsWith(e) : Nt(this, function(t, n) {
|
|
1482
1484
|
return t.indexOf(n[0]) === 0;
|
|
1483
|
-
}, [e],
|
|
1485
|
+
}, [e], $e);
|
|
1484
1486
|
}, ae.prototype.equalsIgnoreCase = function(e) {
|
|
1485
1487
|
return Nt(this, function(t, n) {
|
|
1486
1488
|
return t === n[0];
|
|
1487
1489
|
}, [e], "");
|
|
1488
1490
|
}, ae.prototype.anyOfIgnoreCase = function() {
|
|
1489
|
-
var e = we.apply(
|
|
1490
|
-
return e.length === 0 ?
|
|
1491
|
+
var e = we.apply(Ye, arguments);
|
|
1492
|
+
return e.length === 0 ? tt(this) : Nt(this, function(t, n) {
|
|
1491
1493
|
return n.indexOf(t) !== -1;
|
|
1492
1494
|
}, e, "");
|
|
1493
1495
|
}, ae.prototype.startsWithAnyOfIgnoreCase = function() {
|
|
1494
|
-
var e = we.apply(
|
|
1495
|
-
return e.length === 0 ?
|
|
1496
|
+
var e = we.apply(Ye, arguments);
|
|
1497
|
+
return e.length === 0 ? tt(this) : Nt(this, function(t, n) {
|
|
1496
1498
|
return n.some(function(i) {
|
|
1497
1499
|
return t.indexOf(i) === 0;
|
|
1498
1500
|
});
|
|
1499
|
-
}, e,
|
|
1501
|
+
}, e, $e);
|
|
1500
1502
|
}, ae.prototype.anyOf = function() {
|
|
1501
|
-
var e = this, t = we.apply(
|
|
1503
|
+
var e = this, t = we.apply(Ye, arguments), n = this._cmp;
|
|
1502
1504
|
try {
|
|
1503
1505
|
t.sort(n);
|
|
1504
1506
|
} catch {
|
|
1505
1507
|
return fe(this, _e);
|
|
1506
1508
|
}
|
|
1507
|
-
if (t.length === 0) return
|
|
1509
|
+
if (t.length === 0) return tt(this);
|
|
1508
1510
|
var i = new this.Collection(this, function() {
|
|
1509
1511
|
return Ce(t[0], t[t.length - 1]);
|
|
1510
1512
|
});
|
|
@@ -1513,15 +1515,15 @@ var jr = { exports: {} };
|
|
|
1513
1515
|
};
|
|
1514
1516
|
var a = 0;
|
|
1515
1517
|
return i._addAlgorithm(function(o, s, u) {
|
|
1516
|
-
for (var
|
|
1517
|
-
return n(
|
|
1518
|
+
for (var h = o.key; 0 < n(h, t[a]); ) if (++a === t.length) return s(u), !1;
|
|
1519
|
+
return n(h, t[a]) === 0 || (s(function() {
|
|
1518
1520
|
o.continue(t[a]);
|
|
1519
1521
|
}), !1);
|
|
1520
1522
|
}), i;
|
|
1521
1523
|
}, ae.prototype.notEqual = function(e) {
|
|
1522
1524
|
return this.inAnyRange([[-1 / 0, e], [e, this.db._maxKey]], { includeLowers: !1, includeUppers: !1 });
|
|
1523
1525
|
}, ae.prototype.noneOf = function() {
|
|
1524
|
-
var e = we.apply(
|
|
1526
|
+
var e = we.apply(Ye, arguments);
|
|
1525
1527
|
if (e.length === 0) return new this.Collection(this);
|
|
1526
1528
|
try {
|
|
1527
1529
|
e.sort(this._ascending);
|
|
@@ -1534,53 +1536,53 @@ var jr = { exports: {} };
|
|
|
1534
1536
|
return t.push([e[e.length - 1], this.db._maxKey]), this.inAnyRange(t, { includeLowers: !1, includeUppers: !1 });
|
|
1535
1537
|
}, ae.prototype.inAnyRange = function(S, t) {
|
|
1536
1538
|
var n = this, i = this._cmp, a = this._ascending, o = this._descending, s = this._min, u = this._max;
|
|
1537
|
-
if (S.length === 0) return
|
|
1539
|
+
if (S.length === 0) return tt(this);
|
|
1538
1540
|
if (!S.every(function(E) {
|
|
1539
1541
|
return E[0] !== void 0 && E[1] !== void 0 && a(E[0], E[1]) <= 0;
|
|
1540
|
-
})) return fe(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",
|
|
1541
|
-
var
|
|
1542
|
-
function
|
|
1542
|
+
})) return fe(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, b, d = a;
|
|
1544
|
+
function w(E, O) {
|
|
1543
1545
|
return d(E[0], O[0]);
|
|
1544
1546
|
}
|
|
1545
1547
|
try {
|
|
1546
1548
|
(b = S.reduce(function(E, O) {
|
|
1547
|
-
for (var x = 0,
|
|
1549
|
+
for (var x = 0, P = E.length; x < P; ++x) {
|
|
1548
1550
|
var T = E[x];
|
|
1549
1551
|
if (i(O[0], T[1]) < 0 && 0 < i(O[1], T[0])) {
|
|
1550
1552
|
T[0] = s(T[0], O[0]), T[1] = u(T[1], O[1]);
|
|
1551
1553
|
break;
|
|
1552
1554
|
}
|
|
1553
1555
|
}
|
|
1554
|
-
return x ===
|
|
1555
|
-
}, [])).sort(
|
|
1556
|
+
return x === P && E.push(O), E;
|
|
1557
|
+
}, [])).sort(w);
|
|
1556
1558
|
} catch {
|
|
1557
1559
|
return fe(this, _e);
|
|
1558
1560
|
}
|
|
1559
|
-
var p = 0, m =
|
|
1561
|
+
var p = 0, m = g ? function(E) {
|
|
1560
1562
|
return 0 < a(E, b[p][1]);
|
|
1561
1563
|
} : function(E) {
|
|
1562
1564
|
return 0 <= a(E, b[p][1]);
|
|
1563
|
-
},
|
|
1565
|
+
}, v = h ? function(E) {
|
|
1564
1566
|
return 0 < o(E, b[p][0]);
|
|
1565
1567
|
} : function(E) {
|
|
1566
1568
|
return 0 <= o(E, b[p][0]);
|
|
1567
1569
|
}, y = m, S = new this.Collection(this, function() {
|
|
1568
|
-
return Ce(b[0][0], b[b.length - 1][1], !
|
|
1570
|
+
return Ce(b[0][0], b[b.length - 1][1], !h, !g);
|
|
1569
1571
|
});
|
|
1570
1572
|
return S._ondirectionchange = function(E) {
|
|
1571
|
-
d = E === "next" ? (y = m, a) : (y =
|
|
1573
|
+
d = E === "next" ? (y = m, a) : (y = v, o), b.sort(w);
|
|
1572
1574
|
}, S._addAlgorithm(function(E, O, x) {
|
|
1573
|
-
for (var
|
|
1574
|
-
return !m(
|
|
1575
|
+
for (var P, T = E.key; y(T); ) if (++p === b.length) return O(x), !1;
|
|
1576
|
+
return !m(P = T) && !v(P) || (n._cmp(T, b[p][1]) === 0 || n._cmp(T, b[p][0]) === 0 || O(function() {
|
|
1575
1577
|
d === a ? E.continue(b[p][0]) : E.continue(b[p][1]);
|
|
1576
1578
|
}), !1);
|
|
1577
1579
|
}), S;
|
|
1578
1580
|
}, ae.prototype.startsWithAnyOf = function() {
|
|
1579
|
-
var e = we.apply(
|
|
1581
|
+
var e = we.apply(Ye, arguments);
|
|
1580
1582
|
return e.every(function(t) {
|
|
1581
1583
|
return typeof t == "string";
|
|
1582
|
-
}) ? e.length === 0 ?
|
|
1583
|
-
return [t, t +
|
|
1584
|
+
}) ? e.length === 0 ? tt(this) : this.inAnyRange(e.map(function(t) {
|
|
1585
|
+
return [t, t + $e];
|
|
1584
1586
|
})) : fe(this, "startsWithAnyOf() only works with strings");
|
|
1585
1587
|
}, ae);
|
|
1586
1588
|
function ae() {
|
|
@@ -1594,52 +1596,52 @@ var jr = { exports: {} };
|
|
|
1594
1596
|
e.stopPropagation && e.stopPropagation(), e.preventDefault && e.preventDefault();
|
|
1595
1597
|
}
|
|
1596
1598
|
var gt = "storagemutated", bn = "x-storagemutated-1", Re = dt(null, gt), ci = (be.prototype._lock = function() {
|
|
1597
|
-
return
|
|
1599
|
+
return it(!G.global), ++this._reculock, this._reculock !== 1 || G.global || (G.lockOwnerFor = this), this;
|
|
1598
1600
|
}, be.prototype._unlock = function() {
|
|
1599
|
-
if (
|
|
1601
|
+
if (it(!G.global), --this._reculock == 0) for (G.global || (G.lockOwnerFor = null); 0 < this._blockedFuncs.length && !this._locked(); ) {
|
|
1600
1602
|
var e = this._blockedFuncs.shift();
|
|
1601
1603
|
try {
|
|
1602
|
-
|
|
1604
|
+
Ge(e[1], e[0]);
|
|
1603
1605
|
} catch {
|
|
1604
1606
|
}
|
|
1605
1607
|
}
|
|
1606
1608
|
return this;
|
|
1607
1609
|
}, be.prototype._locked = function() {
|
|
1608
|
-
return this._reculock &&
|
|
1610
|
+
return this._reculock && G.lockOwnerFor !== this;
|
|
1609
1611
|
}, be.prototype.create = function(e) {
|
|
1610
1612
|
var t = this;
|
|
1611
1613
|
if (!this.mode) return this;
|
|
1612
1614
|
var n = this.db.idbdb, i = this.db._state.dbOpenError;
|
|
1613
|
-
if (
|
|
1615
|
+
if (it(!this.idbtrans), !e && !n) switch (i && i.name) {
|
|
1614
1616
|
case "DatabaseClosedError":
|
|
1615
|
-
throw new
|
|
1617
|
+
throw new $.DatabaseClosed(i);
|
|
1616
1618
|
case "MissingAPIError":
|
|
1617
|
-
throw new
|
|
1619
|
+
throw new $.MissingAPI(i.message, i);
|
|
1618
1620
|
default:
|
|
1619
|
-
throw new
|
|
1621
|
+
throw new $.OpenFailed(i);
|
|
1620
1622
|
}
|
|
1621
|
-
if (!this.active) throw new
|
|
1622
|
-
return
|
|
1623
|
+
if (!this.active) throw new $.TransactionInactive();
|
|
1624
|
+
return it(this._completion._state === null), (e = this.idbtrans = e || (this.db.core || n).transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability })).onerror = Z(function(a) {
|
|
1623
1625
|
pt(a), t._reject(e.error);
|
|
1624
1626
|
}), e.onabort = Z(function(a) {
|
|
1625
|
-
pt(a), t.active && t._reject(new
|
|
1627
|
+
pt(a), t.active && t._reject(new $.Abort(e.error)), t.active = !1, t.on("abort").fire(a);
|
|
1626
1628
|
}), e.oncomplete = Z(function() {
|
|
1627
1629
|
t.active = !1, t._resolve(), "mutatedParts" in e && Re.storagemutated.fire(e.mutatedParts);
|
|
1628
1630
|
}), this;
|
|
1629
1631
|
}, be.prototype._promise = function(e, t, n) {
|
|
1630
1632
|
var i = this;
|
|
1631
|
-
if (e === "readwrite" && this.mode !== "readwrite") return ee(new
|
|
1632
|
-
if (!this.active) return ee(new
|
|
1633
|
+
if (e === "readwrite" && this.mode !== "readwrite") return ee(new $.ReadOnly("Transaction is readonly"));
|
|
1634
|
+
if (!this.active) return ee(new $.TransactionInactive());
|
|
1633
1635
|
if (this._locked()) return new K(function(o, s) {
|
|
1634
1636
|
i._blockedFuncs.push([function() {
|
|
1635
1637
|
i._promise(e, t, n).then(o, s);
|
|
1636
|
-
},
|
|
1638
|
+
}, G]);
|
|
1637
1639
|
});
|
|
1638
1640
|
if (n) return De(function() {
|
|
1639
1641
|
var o = new K(function(s, u) {
|
|
1640
1642
|
i._lock();
|
|
1641
|
-
var
|
|
1642
|
-
|
|
1643
|
+
var h = t(s, u, i);
|
|
1644
|
+
h && h.then && h.then(s, u);
|
|
1643
1645
|
});
|
|
1644
1646
|
return o.finally(function() {
|
|
1645
1647
|
return i._unlock();
|
|
@@ -1671,12 +1673,12 @@ var jr = { exports: {} };
|
|
|
1671
1673
|
});
|
|
1672
1674
|
});
|
|
1673
1675
|
}, be.prototype.abort = function() {
|
|
1674
|
-
this.active && (this.active = !1, this.idbtrans && this.idbtrans.abort(), this._reject(new
|
|
1676
|
+
this.active && (this.active = !1, this.idbtrans && this.idbtrans.abort(), this._reject(new $.Abort()));
|
|
1675
1677
|
}, be.prototype.table = function(e) {
|
|
1676
1678
|
var t = this._memoizedTables || (this._memoizedTables = {});
|
|
1677
1679
|
if (ne(t, e)) return t[e];
|
|
1678
1680
|
var n = this.schema[e];
|
|
1679
|
-
if (!n) throw new
|
|
1681
|
+
if (!n) throw new $.NotFound("Table " + e + " not part of transaction");
|
|
1680
1682
|
return n = new this.db.Table(e, n, this), n.core = this.db.core.table(e), t[e] = n;
|
|
1681
1683
|
}, be);
|
|
1682
1684
|
function be() {
|
|
@@ -1702,8 +1704,8 @@ var jr = { exports: {} };
|
|
|
1702
1704
|
}, [[]];
|
|
1703
1705
|
} catch {
|
|
1704
1706
|
return yt = function() {
|
|
1705
|
-
return
|
|
1706
|
-
},
|
|
1707
|
+
return $e;
|
|
1708
|
+
}, $e;
|
|
1707
1709
|
}
|
|
1708
1710
|
};
|
|
1709
1711
|
function _n(e) {
|
|
@@ -1724,146 +1726,146 @@ var jr = { exports: {} };
|
|
|
1724
1726
|
function mt(e) {
|
|
1725
1727
|
return e == null ? ":id" : typeof e == "string" ? e : "[".concat(e.join("+"), "]");
|
|
1726
1728
|
}
|
|
1727
|
-
function li(e, t,
|
|
1729
|
+
function li(e, t, h) {
|
|
1728
1730
|
function i(y) {
|
|
1729
1731
|
if (y.type === 3) return null;
|
|
1730
1732
|
if (y.type === 4) throw new Error("Cannot convert never type to IDBKeyRange");
|
|
1731
|
-
var p = y.lower, m = y.upper,
|
|
1732
|
-
return p === void 0 ? m === void 0 ? null : t.upperBound(m, !!y) : m === void 0 ? t.lowerBound(p, !!
|
|
1733
|
+
var p = y.lower, m = y.upper, v = y.lowerOpen, y = y.upperOpen;
|
|
1734
|
+
return p === void 0 ? m === void 0 ? null : t.upperBound(m, !!y) : m === void 0 ? t.lowerBound(p, !!v) : t.bound(p, m, !!v, !!y);
|
|
1733
1735
|
}
|
|
1734
|
-
function a(
|
|
1735
|
-
var p, m =
|
|
1736
|
-
return { name: m, schema:
|
|
1737
|
-
var y =
|
|
1738
|
-
return new Promise(function(
|
|
1739
|
-
|
|
1740
|
-
var
|
|
1741
|
-
if (!
|
|
1742
|
-
var
|
|
1736
|
+
function a(w) {
|
|
1737
|
+
var p, m = w.name;
|
|
1738
|
+
return { name: m, schema: w, mutate: function(v) {
|
|
1739
|
+
var y = v.trans, S = v.type, E = v.keys, O = v.values, x = v.range;
|
|
1740
|
+
return new Promise(function(P, T) {
|
|
1741
|
+
P = Z(P);
|
|
1742
|
+
var I = y.objectStore(m), C = I.keyPath == null, M = S === "put" || S === "add";
|
|
1743
|
+
if (!M && S !== "delete" && S !== "deleteRange") throw new Error("Invalid operation type: " + S);
|
|
1744
|
+
var R, B = (E || O || { length: 1 }).length;
|
|
1743
1745
|
if (E && O && E.length !== O.length) throw new Error("Given keys array must have same length as given values array.");
|
|
1744
|
-
if (
|
|
1745
|
-
function
|
|
1746
|
-
++
|
|
1746
|
+
if (B === 0) return P({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
|
|
1747
|
+
function U(ue) {
|
|
1748
|
+
++he, pt(ue);
|
|
1747
1749
|
}
|
|
1748
|
-
var
|
|
1750
|
+
var W = [], z = [], he = 0;
|
|
1749
1751
|
if (S === "deleteRange") {
|
|
1750
|
-
if (x.type === 4) return
|
|
1751
|
-
x.type === 3 ?
|
|
1752
|
+
if (x.type === 4) return P({ numFailures: he, failures: z, results: [], lastResult: void 0 });
|
|
1753
|
+
x.type === 3 ? W.push(R = I.clear()) : W.push(R = I.delete(i(x)));
|
|
1752
1754
|
} else {
|
|
1753
|
-
var
|
|
1754
|
-
if (
|
|
1755
|
-
else for (ce = 0; ce <
|
|
1755
|
+
var C = M ? C ? [O, E] : [O, null] : [E, null], F = C[0], se = C[1];
|
|
1756
|
+
if (M) for (var ce = 0; ce < B; ++ce) W.push(R = se && se[ce] !== void 0 ? I[S](F[ce], se[ce]) : I[S](F[ce])), R.onerror = U;
|
|
1757
|
+
else for (ce = 0; ce < B; ++ce) W.push(R = I[S](F[ce])), R.onerror = U;
|
|
1756
1758
|
}
|
|
1757
|
-
function
|
|
1758
|
-
|
|
1759
|
-
return
|
|
1760
|
-
}),
|
|
1761
|
-
return
|
|
1762
|
-
}), lastResult:
|
|
1759
|
+
function Jt(ue) {
|
|
1760
|
+
ue = ue.target.result, W.forEach(function(ze, Ln) {
|
|
1761
|
+
return ze.error != null && (z[Ln] = ze.error);
|
|
1762
|
+
}), P({ numFailures: he, failures: z, results: S === "delete" ? E : W.map(function(ze) {
|
|
1763
|
+
return ze.result;
|
|
1764
|
+
}), lastResult: ue });
|
|
1763
1765
|
}
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
},
|
|
1766
|
+
R.onerror = function(ue) {
|
|
1767
|
+
U(ue), Jt(ue);
|
|
1768
|
+
}, R.onsuccess = Jt;
|
|
1767
1769
|
});
|
|
1768
|
-
}, getMany: function(
|
|
1769
|
-
var y =
|
|
1770
|
+
}, getMany: function(v) {
|
|
1771
|
+
var y = v.trans, S = v.keys;
|
|
1770
1772
|
return new Promise(function(E, O) {
|
|
1771
1773
|
E = Z(E);
|
|
1772
|
-
for (var x,
|
|
1773
|
-
|
|
1774
|
-
},
|
|
1775
|
-
|
|
1774
|
+
for (var x, P = y.objectStore(m), T = S.length, I = new Array(T), C = 0, M = 0, R = function(W) {
|
|
1775
|
+
W = W.target, I[W._pos] = W.result, ++M === C && E(I);
|
|
1776
|
+
}, B = me(O), U = 0; U < T; ++U) S[U] != null && ((x = P.get(S[U]))._pos = U, x.onsuccess = R, x.onerror = B, ++C);
|
|
1777
|
+
C === 0 && E(I);
|
|
1776
1778
|
});
|
|
1777
|
-
}, get: function(
|
|
1778
|
-
var y =
|
|
1779
|
+
}, get: function(v) {
|
|
1780
|
+
var y = v.trans, S = v.key;
|
|
1779
1781
|
return new Promise(function(E, O) {
|
|
1780
1782
|
E = Z(E);
|
|
1781
1783
|
var x = y.objectStore(m).get(S);
|
|
1782
|
-
x.onsuccess = function(
|
|
1783
|
-
return E(
|
|
1784
|
+
x.onsuccess = function(P) {
|
|
1785
|
+
return E(P.target.result);
|
|
1784
1786
|
}, x.onerror = me(O);
|
|
1785
1787
|
});
|
|
1786
|
-
}, query: (p =
|
|
1788
|
+
}, query: (p = g, function(v) {
|
|
1787
1789
|
return new Promise(function(y, S) {
|
|
1788
1790
|
y = Z(y);
|
|
1789
|
-
var E, O, x,
|
|
1791
|
+
var E, O, x, C = v.trans, P = v.values, T = v.limit, R = v.query, I = T === 1 / 0 ? void 0 : T, M = R.index, R = R.range, C = C.objectStore(m), M = M.isPrimaryKey ? C : C.index(M.name), R = i(R);
|
|
1790
1792
|
if (T === 0) return y({ result: [] });
|
|
1791
|
-
p ? ((
|
|
1792
|
-
return y({ result:
|
|
1793
|
-
},
|
|
1794
|
-
var
|
|
1795
|
-
return
|
|
1793
|
+
p ? ((I = P ? M.getAll(R, I) : M.getAllKeys(R, I)).onsuccess = function(B) {
|
|
1794
|
+
return y({ result: B.target.result });
|
|
1795
|
+
}, I.onerror = me(S)) : (E = 0, O = !P && "openKeyCursor" in M ? M.openKeyCursor(R) : M.openCursor(R), x = [], O.onsuccess = function(B) {
|
|
1796
|
+
var U = O.result;
|
|
1797
|
+
return U ? (x.push(P ? U.value : U.primaryKey), ++E === T ? y({ result: x }) : void U.continue()) : y({ result: x });
|
|
1796
1798
|
}, O.onerror = me(S));
|
|
1797
1799
|
});
|
|
1798
|
-
}), openCursor: function(
|
|
1799
|
-
var y =
|
|
1800
|
-
return new Promise(function(
|
|
1801
|
-
|
|
1802
|
-
var
|
|
1803
|
-
|
|
1804
|
-
var
|
|
1805
|
-
|
|
1800
|
+
}), openCursor: function(v) {
|
|
1801
|
+
var y = v.trans, S = v.values, E = v.query, O = v.reverse, x = v.unique;
|
|
1802
|
+
return new Promise(function(P, T) {
|
|
1803
|
+
P = Z(P);
|
|
1804
|
+
var M = E.index, I = E.range, C = y.objectStore(m), C = M.isPrimaryKey ? C : C.index(M.name), M = O ? x ? "prevunique" : "prev" : x ? "nextunique" : "next", R = !S && "openKeyCursor" in C ? C.openKeyCursor(i(I), M) : C.openCursor(i(I), M);
|
|
1805
|
+
R.onerror = me(T), R.onsuccess = Z(function(B) {
|
|
1806
|
+
var U, W, z, he, F = R.result;
|
|
1807
|
+
F ? (F.___id = ++ui, F.done = !1, U = F.continue.bind(F), W = (W = F.continuePrimaryKey) && W.bind(F), z = F.advance.bind(F), he = function() {
|
|
1806
1808
|
throw new Error("Cursor not stopped");
|
|
1807
|
-
},
|
|
1809
|
+
}, F.trans = y, F.stop = F.continue = F.continuePrimaryKey = F.advance = function() {
|
|
1808
1810
|
throw new Error("Cursor not started");
|
|
1809
|
-
},
|
|
1811
|
+
}, F.fail = Z(T), F.next = function() {
|
|
1810
1812
|
var se = this, ce = 1;
|
|
1811
1813
|
return this.start(function() {
|
|
1812
1814
|
return ce-- ? se.continue() : se.stop();
|
|
1813
1815
|
}).then(function() {
|
|
1814
1816
|
return se;
|
|
1815
1817
|
});
|
|
1816
|
-
},
|
|
1818
|
+
}, F.start = function(se) {
|
|
1817
1819
|
function ce() {
|
|
1818
|
-
if (
|
|
1820
|
+
if (R.result) try {
|
|
1819
1821
|
se();
|
|
1820
|
-
} catch (
|
|
1821
|
-
|
|
1822
|
+
} catch (ue) {
|
|
1823
|
+
F.fail(ue);
|
|
1822
1824
|
}
|
|
1823
|
-
else
|
|
1825
|
+
else F.done = !0, F.start = function() {
|
|
1824
1826
|
throw new Error("Cursor behind last entry");
|
|
1825
|
-
},
|
|
1827
|
+
}, F.stop();
|
|
1826
1828
|
}
|
|
1827
|
-
var
|
|
1828
|
-
|
|
1829
|
-
|
|
1829
|
+
var Jt = new Promise(function(ue, ze) {
|
|
1830
|
+
ue = Z(ue), R.onerror = me(ze), F.fail = ze, F.stop = function(Ln) {
|
|
1831
|
+
F.stop = F.continue = F.continuePrimaryKey = F.advance = he, ue(Ln);
|
|
1830
1832
|
};
|
|
1831
1833
|
});
|
|
1832
|
-
return
|
|
1833
|
-
|
|
1834
|
-
}),
|
|
1835
|
-
},
|
|
1834
|
+
return R.onsuccess = Z(function(ue) {
|
|
1835
|
+
R.onsuccess = ce, ce();
|
|
1836
|
+
}), F.continue = U, F.continuePrimaryKey = W, F.advance = z, ce(), Jt;
|
|
1837
|
+
}, P(F)) : P(null);
|
|
1836
1838
|
}, T);
|
|
1837
1839
|
});
|
|
1838
|
-
}, count: function(
|
|
1839
|
-
var y =
|
|
1840
|
-
return new Promise(function(x,
|
|
1841
|
-
var T = S.objectStore(m),
|
|
1842
|
-
|
|
1843
|
-
return x(
|
|
1844
|
-
}),
|
|
1840
|
+
}, count: function(v) {
|
|
1841
|
+
var y = v.query, S = v.trans, E = y.index, O = y.range;
|
|
1842
|
+
return new Promise(function(x, P) {
|
|
1843
|
+
var T = S.objectStore(m), I = E.isPrimaryKey ? T : T.index(E.name), T = i(O), I = T ? I.count(T) : I.count();
|
|
1844
|
+
I.onsuccess = Z(function(C) {
|
|
1845
|
+
return x(C.target.result);
|
|
1846
|
+
}), I.onerror = me(P);
|
|
1845
1847
|
});
|
|
1846
1848
|
} };
|
|
1847
1849
|
}
|
|
1848
|
-
var o, s, u, b = (s =
|
|
1849
|
-
return s.objectStore(
|
|
1850
|
-
}).map(function(
|
|
1851
|
-
var p =
|
|
1852
|
-
return
|
|
1850
|
+
var o, s, u, b = (s = h, u = mr((o = e).objectStoreNames), { schema: { name: o.name, tables: u.map(function(w) {
|
|
1851
|
+
return s.objectStore(w);
|
|
1852
|
+
}).map(function(w) {
|
|
1853
|
+
var p = w.keyPath, y = w.autoIncrement, m = L(p), v = {}, y = { name: w.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: p == null, compound: m, keyPath: p, autoIncrement: y, unique: !0, extractKey: _n(p) }, indexes: mr(w.indexNames).map(function(S) {
|
|
1854
|
+
return w.index(S);
|
|
1853
1855
|
}).map(function(x) {
|
|
1854
|
-
var E = x.name, O = x.unique,
|
|
1855
|
-
return
|
|
1856
|
+
var E = x.name, O = x.unique, P = x.multiEntry, x = x.keyPath, P = { name: E, compound: L(x), keyPath: x, unique: O, multiEntry: P, extractKey: _n(x) };
|
|
1857
|
+
return v[mt(x)] = P;
|
|
1856
1858
|
}), getIndexByKeyPath: function(S) {
|
|
1857
|
-
return
|
|
1859
|
+
return v[mt(S)];
|
|
1858
1860
|
} };
|
|
1859
|
-
return
|
|
1860
|
-
}) }, hasGetAll: 0 < u.length && "getAll" in s.objectStore(u[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }),
|
|
1861
|
-
return b.forEach(function(
|
|
1862
|
-
return d[
|
|
1863
|
-
}), { stack: "dbcore", transaction: e.transaction.bind(e), table: function(
|
|
1864
|
-
if (!d[
|
|
1865
|
-
return d[
|
|
1866
|
-
}, MIN_KEY: -1 / 0, MAX_KEY: yt(t), schema:
|
|
1861
|
+
return v[":id"] = y.primaryKey, p != null && (v[mt(p)] = y.primaryKey), y;
|
|
1862
|
+
}) }, hasGetAll: 0 < u.length && "getAll" in s.objectStore(u[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }), h = b.schema, g = b.hasGetAll, b = h.tables.map(a), d = {};
|
|
1863
|
+
return b.forEach(function(w) {
|
|
1864
|
+
return d[w.name] = w;
|
|
1865
|
+
}), { stack: "dbcore", transaction: e.transaction.bind(e), table: function(w) {
|
|
1866
|
+
if (!d[w]) throw new Error("Table '".concat(w, "' not found"));
|
|
1867
|
+
return d[w];
|
|
1868
|
+
}, MIN_KEY: -1 / 0, MAX_KEY: yt(t), schema: h };
|
|
1867
1869
|
}
|
|
1868
1870
|
function di(e, t, n, i) {
|
|
1869
1871
|
var a = n.IDBKeyRange;
|
|
@@ -1884,13 +1886,13 @@ var jr = { exports: {} };
|
|
|
1884
1886
|
n.forEach(function(a) {
|
|
1885
1887
|
var o = i[a];
|
|
1886
1888
|
t.forEach(function(s) {
|
|
1887
|
-
var u = function g
|
|
1888
|
-
return Fr(
|
|
1889
|
+
var u = function h(g, b) {
|
|
1890
|
+
return Fr(g, b) || (g = q(g)) && h(g, b);
|
|
1889
1891
|
}(s, a);
|
|
1890
1892
|
(!u || "value" in u && u.value === void 0) && (s === e.Transaction.prototype || s instanceof e.Transaction ? ke(s, a, { get: function() {
|
|
1891
1893
|
return this.table(a);
|
|
1892
|
-
}, set: function(
|
|
1893
|
-
zn(this, a, { value:
|
|
1894
|
+
}, set: function(h) {
|
|
1895
|
+
zn(this, a, { value: h, writable: !0, configurable: !0, enumerable: !0 });
|
|
1894
1896
|
} }) : s[a] = new e.Table(a, o));
|
|
1895
1897
|
});
|
|
1896
1898
|
});
|
|
@@ -1908,68 +1910,68 @@ var jr = { exports: {} };
|
|
|
1908
1910
|
n.objectStoreNames.contains("$meta") && !a.$meta && (a.$meta = wn("$meta", vr("")[0], []), e._storeNames.push("$meta"));
|
|
1909
1911
|
var o = e._createTransaction("readwrite", e._storeNames, a);
|
|
1910
1912
|
o.create(n), o._completion.catch(i);
|
|
1911
|
-
var s = o._reject.bind(o), u =
|
|
1913
|
+
var s = o._reject.bind(o), u = G.transless || G;
|
|
1912
1914
|
De(function() {
|
|
1913
|
-
return
|
|
1914
|
-
return b ??
|
|
1915
|
-
}) : K.resolve(
|
|
1916
|
-
return
|
|
1917
|
-
return S._cfg.version >=
|
|
1915
|
+
return G.trans = o, G.transless = u, t !== 0 ? (Bt(e, n), g = t, ((h = o).storeNames.includes("$meta") ? h.table("$meta").get("version").then(function(b) {
|
|
1916
|
+
return b ?? g;
|
|
1917
|
+
}) : K.resolve(g)).then(function(b) {
|
|
1918
|
+
return w = b, p = o, m = n, v = [], b = (d = e)._versions, y = d._dbSchema = $t(0, d.idbdb, m), (b = b.filter(function(S) {
|
|
1919
|
+
return S._cfg.version >= w;
|
|
1918
1920
|
})).length !== 0 ? (b.forEach(function(S) {
|
|
1919
|
-
|
|
1921
|
+
v.push(function() {
|
|
1920
1922
|
var E = y, O = S._cfg.dbschema;
|
|
1921
1923
|
Ft(d, E, m), Ft(d, O, m), y = d._dbSchema = O;
|
|
1922
1924
|
var x = En(E, O);
|
|
1923
|
-
x.add.forEach(function(
|
|
1924
|
-
On(m,
|
|
1925
|
-
}), x.change.forEach(function(
|
|
1926
|
-
if (
|
|
1927
|
-
var
|
|
1928
|
-
|
|
1929
|
-
return Gt(
|
|
1930
|
-
}),
|
|
1931
|
-
|
|
1932
|
-
}),
|
|
1933
|
-
return
|
|
1925
|
+
x.add.forEach(function(M) {
|
|
1926
|
+
On(m, M[0], M[1].primKey, M[1].indexes);
|
|
1927
|
+
}), x.change.forEach(function(M) {
|
|
1928
|
+
if (M.recreate) throw new $.Upgrade("Not yet support for changing primary key");
|
|
1929
|
+
var R = m.objectStore(M.name);
|
|
1930
|
+
M.add.forEach(function(B) {
|
|
1931
|
+
return Gt(R, B);
|
|
1932
|
+
}), M.change.forEach(function(B) {
|
|
1933
|
+
R.deleteIndex(B.name), Gt(R, B);
|
|
1934
|
+
}), M.del.forEach(function(B) {
|
|
1935
|
+
return R.deleteIndex(B);
|
|
1934
1936
|
});
|
|
1935
1937
|
});
|
|
1936
|
-
var
|
|
1937
|
-
if (
|
|
1938
|
+
var P = S._cfg.contentUpgrade;
|
|
1939
|
+
if (P && S._cfg.version > w) {
|
|
1938
1940
|
Bt(d, m), p._memoizedTables = {};
|
|
1939
1941
|
var T = Qn(O);
|
|
1940
|
-
x.del.forEach(function(
|
|
1941
|
-
T[
|
|
1942
|
+
x.del.forEach(function(M) {
|
|
1943
|
+
T[M] = E[M];
|
|
1942
1944
|
}), Sn(d, [d.Transaction.prototype]), Lt(d, [d.Transaction.prototype], N(T), T), p.schema = T;
|
|
1943
|
-
var
|
|
1944
|
-
return
|
|
1945
|
-
var
|
|
1946
|
-
(
|
|
1947
|
-
}),
|
|
1948
|
-
return
|
|
1945
|
+
var I, C = tn(P);
|
|
1946
|
+
return C && Ze(), x = K.follow(function() {
|
|
1947
|
+
var M;
|
|
1948
|
+
(I = P(p)) && C && (M = Pe.bind(null, null), I.then(M, M));
|
|
1949
|
+
}), I && typeof I.then == "function" ? K.resolve(I) : x.then(function() {
|
|
1950
|
+
return I;
|
|
1949
1951
|
});
|
|
1950
1952
|
}
|
|
1951
|
-
}),
|
|
1952
|
-
var O, x,
|
|
1953
|
-
O =
|
|
1953
|
+
}), v.push(function(E) {
|
|
1954
|
+
var O, x, P = S._cfg.dbschema;
|
|
1955
|
+
O = P, x = E, [].slice.call(x.db.objectStoreNames).forEach(function(T) {
|
|
1954
1956
|
return O[T] == null && x.db.deleteObjectStore(T);
|
|
1955
1957
|
}), Sn(d, [d.Transaction.prototype]), Lt(d, [d.Transaction.prototype], d._storeNames, d._dbSchema), p.schema = d._dbSchema;
|
|
1956
|
-
}),
|
|
1958
|
+
}), v.push(function(E) {
|
|
1957
1959
|
d.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(d.idbdb.version / 10) === S._cfg.version ? (d.idbdb.deleteObjectStore("$meta"), delete d._dbSchema.$meta, d._storeNames = d._storeNames.filter(function(O) {
|
|
1958
1960
|
return O !== "$meta";
|
|
1959
1961
|
})) : E.objectStore("$meta").put(S._cfg.version, "version"));
|
|
1960
1962
|
});
|
|
1961
1963
|
}), function S() {
|
|
1962
|
-
return
|
|
1964
|
+
return v.length ? K.resolve(v.shift()(p.idbtrans)).then(S) : K.resolve();
|
|
1963
1965
|
}().then(function() {
|
|
1964
1966
|
br(y, m);
|
|
1965
1967
|
})) : K.resolve();
|
|
1966
|
-
var d,
|
|
1968
|
+
var d, w, p, m, v, y;
|
|
1967
1969
|
}).catch(s)) : (N(a).forEach(function(b) {
|
|
1968
1970
|
On(n, b, a[b].primKey, a[b].indexes);
|
|
1969
1971
|
}), Bt(e, n), void K.follow(function() {
|
|
1970
1972
|
return e.on.populate.fire(o);
|
|
1971
1973
|
}).catch(s));
|
|
1972
|
-
var
|
|
1974
|
+
var h, g;
|
|
1973
1975
|
});
|
|
1974
1976
|
}
|
|
1975
1977
|
function pi(e, t) {
|
|
@@ -1980,8 +1982,8 @@ var jr = { exports: {} };
|
|
|
1980
1982
|
var o = function(s) {
|
|
1981
1983
|
if (s.change.length || s.recreate) return console.warn("Unable to patch indexes of table ".concat(s.name, " because it has changes on the type of index or primary key.")), { value: void 0 };
|
|
1982
1984
|
var u = t.objectStore(s.name);
|
|
1983
|
-
s.add.forEach(function(
|
|
1984
|
-
ye && console.debug("Dexie upgrade patch: Creating missing index ".concat(s.name, ".").concat(
|
|
1985
|
+
s.add.forEach(function(h) {
|
|
1986
|
+
ye && console.debug("Dexie upgrade patch: Creating missing index ".concat(s.name, ".").concat(h.src)), Gt(u, h);
|
|
1985
1987
|
});
|
|
1986
1988
|
}(a[i]);
|
|
1987
1989
|
if (typeof o == "object") return o.value;
|
|
@@ -1996,10 +1998,10 @@ var jr = { exports: {} };
|
|
|
1996
1998
|
var s = { name: n, def: o, recreate: !1, del: [], add: [], change: [] };
|
|
1997
1999
|
if ("" + (a.primKey.keyPath || "") != "" + (o.primKey.keyPath || "") || a.primKey.auto !== o.primKey.auto) s.recreate = !0, i.change.push(s);
|
|
1998
2000
|
else {
|
|
1999
|
-
var u = a.idxByName,
|
|
2000
|
-
for (
|
|
2001
|
-
for (
|
|
2002
|
-
var b = u[
|
|
2001
|
+
var u = a.idxByName, h = o.idxByName, g = void 0;
|
|
2002
|
+
for (g in u) h[g] || s.del.push(g);
|
|
2003
|
+
for (g in h) {
|
|
2004
|
+
var b = u[g], d = h[g];
|
|
2003
2005
|
b ? b.src !== d.src && s.change.push(d) : s.add.push(d);
|
|
2004
2006
|
}
|
|
2005
2007
|
(0 < s.del.length || 0 < s.add.length || 0 < s.change.length) && i.change.push(s);
|
|
@@ -2025,8 +2027,8 @@ var jr = { exports: {} };
|
|
|
2025
2027
|
function $t(e, t, n) {
|
|
2026
2028
|
var i = {};
|
|
2027
2029
|
return St(t.objectStoreNames, 0).forEach(function(a) {
|
|
2028
|
-
for (var o = n.objectStore(a), s = vn(yr(
|
|
2029
|
-
var b = o.index(o.indexNames[
|
|
2030
|
+
for (var o = n.objectStore(a), s = vn(yr(g = o.keyPath), g || "", !0, !1, !!o.autoIncrement, g && typeof g != "string", !0), u = [], h = 0; h < o.indexNames.length; ++h) {
|
|
2031
|
+
var b = o.index(o.indexNames[h]), g = b.keyPath, b = vn(b.name, g, !!b.unique, !!b.multiEntry, !1, g && typeof g != "string", !1);
|
|
2030
2032
|
u.push(b);
|
|
2031
2033
|
}
|
|
2032
2034
|
i[a] = wn(a, s, u);
|
|
@@ -2037,8 +2039,8 @@ var jr = { exports: {} };
|
|
|
2037
2039
|
var o = i[a], s = n.objectStore(o);
|
|
2038
2040
|
e._hasGetAll = "getAll" in s;
|
|
2039
2041
|
for (var u = 0; u < s.indexNames.length; ++u) {
|
|
2040
|
-
var
|
|
2041
|
-
!t[o] || (
|
|
2042
|
+
var h = s.indexNames[u], g = s.index(h).keyPath, b = typeof g == "string" ? g : "[" + St(g).join("+") + "]";
|
|
2043
|
+
!t[o] || (g = t[o].idxByName[b]) && (g.name = h, delete t[o].idxByName[b], t[o].idxByName[h] = g);
|
|
2042
2044
|
}
|
|
2043
2045
|
}
|
|
2044
2046
|
typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && k.WorkerGlobalScope && k instanceof k.WorkerGlobalScope && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604 && (e._hasGetAll = !1);
|
|
@@ -2046,26 +2048,26 @@ var jr = { exports: {} };
|
|
|
2046
2048
|
function vr(e) {
|
|
2047
2049
|
return e.split(",").map(function(t, n) {
|
|
2048
2050
|
var i = (t = t.trim()).replace(/([&*]|\+\+)/g, ""), a = /^\[/.test(i) ? i.match(/^\[(.*)\]$/)[1].split("+") : i;
|
|
2049
|
-
return vn(i, a || null, /\&/.test(t), /\*/.test(t), /\+\+/.test(t),
|
|
2051
|
+
return vn(i, a || null, /\&/.test(t), /\*/.test(t), /\+\+/.test(t), L(a), n === 0);
|
|
2050
2052
|
});
|
|
2051
2053
|
}
|
|
2052
2054
|
var gi = (Ut.prototype._parseStoresSpec = function(e, t) {
|
|
2053
2055
|
N(e).forEach(function(n) {
|
|
2054
2056
|
if (e[n] !== null) {
|
|
2055
2057
|
var i = vr(e[n]), a = i.shift();
|
|
2056
|
-
if (a.unique = !0, a.multi) throw new
|
|
2058
|
+
if (a.unique = !0, a.multi) throw new $.Schema("Primary key cannot be multi-valued");
|
|
2057
2059
|
i.forEach(function(o) {
|
|
2058
|
-
if (o.auto) throw new
|
|
2059
|
-
if (!o.keyPath) throw new
|
|
2060
|
+
if (o.auto) throw new $.Schema("Only primary key can be marked as autoIncrement (++)");
|
|
2061
|
+
if (!o.keyPath) throw new $.Schema("Index must have a name and cannot be an empty string");
|
|
2060
2062
|
}), t[n] = wn(n, a, i);
|
|
2061
2063
|
}
|
|
2062
2064
|
});
|
|
2063
2065
|
}, Ut.prototype.stores = function(n) {
|
|
2064
2066
|
var t = this.db;
|
|
2065
|
-
this._cfg.storesSource = this._cfg.storesSource ?
|
|
2067
|
+
this._cfg.storesSource = this._cfg.storesSource ? J(this._cfg.storesSource, n) : n;
|
|
2066
2068
|
var n = t._versions, i = {}, a = {};
|
|
2067
2069
|
return n.forEach(function(o) {
|
|
2068
|
-
|
|
2070
|
+
J(i, o._cfg.storesSource), a = o._cfg.dbschema = {}, o._parseStoresSpec(i, a);
|
|
2069
2071
|
}), t._dbSchema = a, Sn(t, [t._allTables, t, t.Transaction.prototype]), Lt(t, [t._allTables, t, t.Transaction.prototype, this._cfg.tables], N(a), a), t._storeNames = N(a), this;
|
|
2070
2072
|
}, Ut.prototype.upgrade = function(e) {
|
|
2071
2073
|
return this._cfg.contentUpgrade = rn(this._cfg.contentUpgrade || Q, e), this;
|
|
@@ -2081,24 +2083,24 @@ var jr = { exports: {} };
|
|
|
2081
2083
|
}
|
|
2082
2084
|
function An(e) {
|
|
2083
2085
|
return De(function() {
|
|
2084
|
-
return
|
|
2086
|
+
return G.letThrough = !0, e();
|
|
2085
2087
|
});
|
|
2086
2088
|
}
|
|
2087
2089
|
function Dn(e) {
|
|
2088
2090
|
return !("from" in e);
|
|
2089
2091
|
}
|
|
2090
|
-
var
|
|
2092
|
+
var oe = function(e, t) {
|
|
2091
2093
|
if (!this) {
|
|
2092
|
-
var n = new
|
|
2093
|
-
return e && "d" in e &&
|
|
2094
|
+
var n = new oe();
|
|
2095
|
+
return e && "d" in e && J(n, e), n;
|
|
2094
2096
|
}
|
|
2095
|
-
|
|
2097
|
+
J(this, arguments.length ? { d: 1, from: e, to: 1 < arguments.length ? t : e } : { d: 0 });
|
|
2096
2098
|
};
|
|
2097
2099
|
function bt(e, t, n) {
|
|
2098
2100
|
var i = H(t, n);
|
|
2099
2101
|
if (!isNaN(i)) {
|
|
2100
2102
|
if (0 < i) throw RangeError();
|
|
2101
|
-
if (Dn(e)) return
|
|
2103
|
+
if (Dn(e)) return J(e, { from: t, to: n, d: 1 });
|
|
2102
2104
|
var a = e.l, i = e.r;
|
|
2103
2105
|
if (H(n, e.from) < 0) return a ? bt(a, t, n) : e.l = { from: t, to: n, d: 1, l: null, r: null }, _r(e);
|
|
2104
2106
|
if (0 < H(t, e.to)) return i ? bt(i, t, n) : e.r = { from: t, to: n, d: 1, l: null, r: null }, _r(e);
|
|
@@ -2106,9 +2108,9 @@ var jr = { exports: {} };
|
|
|
2106
2108
|
}
|
|
2107
2109
|
}
|
|
2108
2110
|
function vt(e, t) {
|
|
2109
|
-
Dn(t) || function n(i,
|
|
2110
|
-
var o =
|
|
2111
|
-
bt(i, o, s), u && n(i, u),
|
|
2111
|
+
Dn(t) || function n(i, h) {
|
|
2112
|
+
var o = h.from, s = h.to, u = h.l, h = h.r;
|
|
2113
|
+
bt(i, o, s), u && n(i, u), h && n(i, h);
|
|
2112
2114
|
}(e, t);
|
|
2113
2115
|
}
|
|
2114
2116
|
function wr(e, t) {
|
|
@@ -2152,7 +2154,7 @@ var jr = { exports: {} };
|
|
|
2152
2154
|
return N(t).forEach(function(n) {
|
|
2153
2155
|
e[n] ? vt(e[n], t[n]) : e[n] = function i(a) {
|
|
2154
2156
|
var o, s, u = {};
|
|
2155
|
-
for (o in a) ne(a, o) && (s = a[o], u[o] = !s || typeof s != "object" ||
|
|
2157
|
+
for (o in a) ne(a, o) && (s = a[o], u[o] = !s || typeof s != "object" || Jn.has(s.constructor) ? s : i(s));
|
|
2156
2158
|
return u;
|
|
2157
2159
|
}(t[n]);
|
|
2158
2160
|
}), e;
|
|
@@ -2162,7 +2164,7 @@ var jr = { exports: {} };
|
|
|
2162
2164
|
return t[n] && wr(t[n], e[n]);
|
|
2163
2165
|
});
|
|
2164
2166
|
}
|
|
2165
|
-
xe(
|
|
2167
|
+
xe(oe.prototype, ((pe = { add: function(e) {
|
|
2166
2168
|
return vt(this, e), this;
|
|
2167
2169
|
}, addKey: function(e) {
|
|
2168
2170
|
return bt(this, e, e), this;
|
|
@@ -2176,8 +2178,8 @@ var jr = { exports: {} };
|
|
|
2176
2178
|
return t && H(t.from, e) <= 0 && 0 <= H(t.to, e);
|
|
2177
2179
|
} })[en] = function() {
|
|
2178
2180
|
return Wt(this);
|
|
2179
|
-
},
|
|
2180
|
-
var
|
|
2181
|
+
}, pe));
|
|
2182
|
+
var Ue = {}, In = {}, Cn = !1;
|
|
2181
2183
|
function Ht(e) {
|
|
2182
2184
|
zt(In, e), Cn || (Cn = !0, setTimeout(function() {
|
|
2183
2185
|
Cn = !1, Rn(In, !(In = {}));
|
|
@@ -2186,28 +2188,28 @@ var jr = { exports: {} };
|
|
|
2186
2188
|
function Rn(e, t) {
|
|
2187
2189
|
t === void 0 && (t = !1);
|
|
2188
2190
|
var n = /* @__PURE__ */ new Set();
|
|
2189
|
-
if (e.all) for (var i = 0, a = Object.values(
|
|
2191
|
+
if (e.all) for (var i = 0, a = Object.values(Ue); i < a.length; i++) Er(s = a[i], e, n, t);
|
|
2190
2192
|
else for (var o in e) {
|
|
2191
2193
|
var s, u = /^idb\:\/\/(.*)\/(.*)\//.exec(o);
|
|
2192
|
-
u && (o = u[1], u = u[2], (s =
|
|
2194
|
+
u && (o = u[1], u = u[2], (s = Ue["idb://".concat(o, "/").concat(u)]) && Er(s, e, n, t));
|
|
2193
2195
|
}
|
|
2194
|
-
n.forEach(function(
|
|
2195
|
-
return
|
|
2196
|
+
n.forEach(function(h) {
|
|
2197
|
+
return h();
|
|
2196
2198
|
});
|
|
2197
2199
|
}
|
|
2198
2200
|
function Er(e, t, n, i) {
|
|
2199
2201
|
for (var a = [], o = 0, s = Object.entries(e.queries.query); o < s.length; o++) {
|
|
2200
|
-
for (var u = s[o],
|
|
2201
|
-
var
|
|
2202
|
-
Pn(t,
|
|
2202
|
+
for (var u = s[o], h = u[0], g = [], b = 0, d = u[1]; b < d.length; b++) {
|
|
2203
|
+
var w = d[b];
|
|
2204
|
+
Pn(t, w.obsSet) ? w.subscribers.forEach(function(y) {
|
|
2203
2205
|
return n.add(y);
|
|
2204
|
-
}) : i &&
|
|
2206
|
+
}) : i && g.push(w);
|
|
2205
2207
|
}
|
|
2206
|
-
i && a.push([
|
|
2208
|
+
i && a.push([h, g]);
|
|
2207
2209
|
}
|
|
2208
2210
|
if (i) for (var p = 0, m = a; p < m.length; p++) {
|
|
2209
|
-
var
|
|
2210
|
-
e.queries.query[
|
|
2211
|
+
var v = m[p], h = v[0], g = v[1];
|
|
2212
|
+
e.queries.query[h] = g;
|
|
2211
2213
|
}
|
|
2212
2214
|
}
|
|
2213
2215
|
function yi(e) {
|
|
@@ -2218,84 +2220,84 @@ var jr = { exports: {} };
|
|
|
2218
2220
|
t.isBeingOpened = !0, t.dbOpenError = null, t.openComplete = !1;
|
|
2219
2221
|
var i = t.openCanceller, a = Math.round(10 * e.verno), o = !1;
|
|
2220
2222
|
function s() {
|
|
2221
|
-
if (t.openCanceller !== i) throw new
|
|
2223
|
+
if (t.openCanceller !== i) throw new $.DatabaseClosed("db.open() was cancelled");
|
|
2222
2224
|
}
|
|
2223
2225
|
function u() {
|
|
2224
|
-
return new K(function(
|
|
2225
|
-
if (s(), !n) throw new
|
|
2226
|
-
var m = e.name,
|
|
2227
|
-
if (!
|
|
2228
|
-
|
|
2226
|
+
return new K(function(w, p) {
|
|
2227
|
+
if (s(), !n) throw new $.MissingAPI();
|
|
2228
|
+
var m = e.name, v = t.autoSchema || !a ? n.open(m) : n.open(m, a);
|
|
2229
|
+
if (!v) throw new $.MissingAPI();
|
|
2230
|
+
v.onerror = me(p), v.onblocked = Z(e._fireOnBlocked), v.onupgradeneeded = Z(function(y) {
|
|
2229
2231
|
var S;
|
|
2230
|
-
b =
|
|
2231
|
-
p(new
|
|
2232
|
-
})) : (b.onerror = me(p), y = y.oldVersion > Math.pow(2, 62) ? 0 : y.oldVersion, d = y < 1, e.idbdb =
|
|
2233
|
-
}, p),
|
|
2232
|
+
b = v.transaction, t.autoSchema && !e._options.allowEmptyDB ? (v.onerror = pt, b.abort(), v.result.close(), (S = n.deleteDatabase(m)).onsuccess = S.onerror = Z(function() {
|
|
2233
|
+
p(new $.NoSuchDatabase("Database ".concat(m, " doesnt exist")));
|
|
2234
|
+
})) : (b.onerror = me(p), y = y.oldVersion > Math.pow(2, 62) ? 0 : y.oldVersion, d = y < 1, e.idbdb = v.result, o && pi(e, b), hi(e, y / 10, b, p));
|
|
2235
|
+
}, p), v.onsuccess = Z(function() {
|
|
2234
2236
|
b = null;
|
|
2235
|
-
var y, S, E, O, x,
|
|
2237
|
+
var y, S, E, O, x, P = e.idbdb = v.result, T = St(P.objectStoreNames);
|
|
2236
2238
|
if (0 < T.length) try {
|
|
2237
|
-
var
|
|
2238
|
-
if (t.autoSchema) S =
|
|
2239
|
-
else if (Ft(e, e._dbSchema,
|
|
2240
|
-
return
|
|
2241
|
-
})) && !o) return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),
|
|
2242
|
-
Bt(e,
|
|
2239
|
+
var I = P.transaction((O = T).length === 1 ? O[0] : O, "readonly");
|
|
2240
|
+
if (t.autoSchema) S = P, E = I, (y = e).verno = S.version / 10, E = y._dbSchema = $t(0, S, E), y._storeNames = St(S.objectStoreNames, 0), Lt(y, [y._allTables], N(E), E);
|
|
2241
|
+
else if (Ft(e, e._dbSchema, I), ((x = En($t(0, (x = e).idbdb, I), x._dbSchema)).add.length || x.change.some(function(C) {
|
|
2242
|
+
return C.add.length || C.change.length;
|
|
2243
|
+
})) && !o) return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."), P.close(), a = P.version + 1, o = !0, w(u());
|
|
2244
|
+
Bt(e, I);
|
|
2243
2245
|
} catch {
|
|
2244
2246
|
}
|
|
2245
|
-
|
|
2246
|
-
t.vcFired = !0, e.on("versionchange").fire(
|
|
2247
|
-
}),
|
|
2248
|
-
e.on("close").fire(
|
|
2249
|
-
}), d && (x = e._deps,
|
|
2247
|
+
qe.push(e), P.onversionchange = Z(function(C) {
|
|
2248
|
+
t.vcFired = !0, e.on("versionchange").fire(C);
|
|
2249
|
+
}), P.onclose = Z(function(C) {
|
|
2250
|
+
e.on("close").fire(C);
|
|
2251
|
+
}), d && (x = e._deps, I = m, P = x.indexedDB, x = x.IDBKeyRange, kn(P) || I === Tt || xn(P, x).put({ name: I }).catch(Q)), w();
|
|
2250
2252
|
}, p);
|
|
2251
|
-
}).catch(function(
|
|
2252
|
-
switch (
|
|
2253
|
+
}).catch(function(w) {
|
|
2254
|
+
switch (w == null ? void 0 : w.name) {
|
|
2253
2255
|
case "UnknownError":
|
|
2254
2256
|
if (0 < t.PR1398_maxLoop) return t.PR1398_maxLoop--, console.warn("Dexie: Workaround for Chrome UnknownError on open()"), u();
|
|
2255
2257
|
break;
|
|
2256
2258
|
case "VersionError":
|
|
2257
2259
|
if (0 < a) return a = 0, u();
|
|
2258
2260
|
}
|
|
2259
|
-
return K.reject(
|
|
2261
|
+
return K.reject(w);
|
|
2260
2262
|
});
|
|
2261
2263
|
}
|
|
2262
|
-
var
|
|
2263
|
-
return K.race([i, (typeof navigator > "u" ? K.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(
|
|
2264
|
+
var h, g = t.dbReadyResolve, b = null, d = !1;
|
|
2265
|
+
return K.race([i, (typeof navigator > "u" ? K.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(w) {
|
|
2264
2266
|
function p() {
|
|
2265
|
-
return indexedDB.databases().finally(
|
|
2267
|
+
return indexedDB.databases().finally(w);
|
|
2266
2268
|
}
|
|
2267
|
-
|
|
2269
|
+
h = setInterval(p, 100), p();
|
|
2268
2270
|
}).finally(function() {
|
|
2269
|
-
return clearInterval(
|
|
2271
|
+
return clearInterval(h);
|
|
2270
2272
|
}) : Promise.resolve()).then(u)]).then(function() {
|
|
2271
2273
|
return s(), t.onReadyBeingFired = [], K.resolve(An(function() {
|
|
2272
2274
|
return e.on.ready.fire(e.vip);
|
|
2273
|
-
})).then(function
|
|
2275
|
+
})).then(function w() {
|
|
2274
2276
|
if (0 < t.onReadyBeingFired.length) {
|
|
2275
2277
|
var p = t.onReadyBeingFired.reduce(rn, Q);
|
|
2276
2278
|
return t.onReadyBeingFired = [], K.resolve(An(function() {
|
|
2277
2279
|
return p(e.vip);
|
|
2278
|
-
})).then(
|
|
2280
|
+
})).then(w);
|
|
2279
2281
|
}
|
|
2280
2282
|
});
|
|
2281
2283
|
}).finally(function() {
|
|
2282
2284
|
t.openCanceller === i && (t.onReadyBeingFired = null, t.isBeingOpened = !1);
|
|
2283
|
-
}).catch(function(
|
|
2284
|
-
t.dbOpenError =
|
|
2285
|
+
}).catch(function(w) {
|
|
2286
|
+
t.dbOpenError = w;
|
|
2285
2287
|
try {
|
|
2286
2288
|
b && b.abort();
|
|
2287
2289
|
} catch {
|
|
2288
2290
|
}
|
|
2289
|
-
return i === t.openCanceller && e._close(), ee(
|
|
2291
|
+
return i === t.openCanceller && e._close(), ee(w);
|
|
2290
2292
|
}).finally(function() {
|
|
2291
|
-
t.openComplete = !0,
|
|
2293
|
+
t.openComplete = !0, g();
|
|
2292
2294
|
}).then(function() {
|
|
2293
|
-
var
|
|
2294
|
-
return d && (
|
|
2295
|
+
var w;
|
|
2296
|
+
return d && (w = {}, e.tables.forEach(function(p) {
|
|
2295
2297
|
p.schema.indexes.forEach(function(m) {
|
|
2296
|
-
m.name && (
|
|
2297
|
-
}),
|
|
2298
|
-
}), Re(gt).fire(
|
|
2298
|
+
m.name && (w["idb://".concat(e.name, "/").concat(p.name, "/").concat(m.name)] = new oe(-1 / 0, [[[]]]));
|
|
2299
|
+
}), w["idb://".concat(e.name, "/").concat(p.name, "/")] = w["idb://".concat(e.name, "/").concat(p.name, "/:dels")] = new oe(-1 / 0, [[[]]]);
|
|
2300
|
+
}), Re(gt).fire(w), Rn(w, !0)), e;
|
|
2299
2301
|
});
|
|
2300
2302
|
}
|
|
2301
2303
|
function Tn(e) {
|
|
@@ -2306,34 +2308,34 @@ var jr = { exports: {} };
|
|
|
2306
2308
|
return e.throw(o);
|
|
2307
2309
|
});
|
|
2308
2310
|
function a(o) {
|
|
2309
|
-
return function(
|
|
2310
|
-
var u = o(
|
|
2311
|
-
return u.done ?
|
|
2311
|
+
return function(h) {
|
|
2312
|
+
var u = o(h), h = u.value;
|
|
2313
|
+
return u.done ? h : h && typeof h.then == "function" ? h.then(n, i) : L(h) ? Promise.all(h).then(n, i) : n(h);
|
|
2312
2314
|
};
|
|
2313
2315
|
}
|
|
2314
2316
|
return a(t)();
|
|
2315
2317
|
}
|
|
2316
2318
|
function Yt(e, t, n) {
|
|
2317
|
-
for (var i =
|
|
2319
|
+
for (var i = L(e) ? e.slice() : [e], a = 0; a < n; ++a) i.push(t);
|
|
2318
2320
|
return i;
|
|
2319
2321
|
}
|
|
2320
2322
|
var mi = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(e) {
|
|
2321
2323
|
return l(l({}, e), { table: function(t) {
|
|
2322
2324
|
var n = e.table(t), i = n.schema, a = {}, o = [];
|
|
2323
|
-
function s(d,
|
|
2324
|
-
var m = mt(d),
|
|
2325
|
-
return
|
|
2325
|
+
function s(d, w, p) {
|
|
2326
|
+
var m = mt(d), v = a[m] = a[m] || [], y = d == null ? 0 : typeof d == "string" ? 1 : d.length, S = 0 < w, S = l(l({}, p), { name: S ? "".concat(m, "(virtual-from:").concat(p.name, ")") : p.name, lowLevelIndex: p, isVirtual: S, keyTail: w, keyLength: y, extractKey: _n(d), unique: !S && p.unique });
|
|
2327
|
+
return v.push(S), S.isPrimaryKey || o.push(S), 1 < y && s(y === 2 ? d[0] : d.slice(0, y - 1), w + 1, p), v.sort(function(E, O) {
|
|
2326
2328
|
return E.keyTail - O.keyTail;
|
|
2327
2329
|
}), S;
|
|
2328
2330
|
}
|
|
2329
2331
|
t = s(i.primaryKey.keyPath, 0, i.primaryKey), a[":id"] = [t];
|
|
2330
|
-
for (var u = 0,
|
|
2331
|
-
var
|
|
2332
|
-
s(
|
|
2332
|
+
for (var u = 0, h = i.indexes; u < h.length; u++) {
|
|
2333
|
+
var g = h[u];
|
|
2334
|
+
s(g.keyPath, 0, g);
|
|
2333
2335
|
}
|
|
2334
2336
|
function b(d) {
|
|
2335
|
-
var
|
|
2336
|
-
return p.isVirtual ? l(l({}, d), { query: { index: p.lowLevelIndex, range: (
|
|
2337
|
+
var w, p = d.query.index;
|
|
2338
|
+
return p.isVirtual ? l(l({}, d), { query: { index: p.lowLevelIndex, range: (w = d.query.range, p = p.keyTail, { type: w.type === 1 ? 2 : w.type, lower: Yt(w.lower, w.lowerOpen ? e.MAX_KEY : e.MIN_KEY, p), lowerOpen: !0, upper: Yt(w.upper, w.upperOpen ? e.MIN_KEY : e.MAX_KEY, p), upperOpen: !0 }) } }) : d;
|
|
2337
2339
|
}
|
|
2338
2340
|
return l(l({}, n), { schema: l(l({}, i), { primaryKey: t, indexes: o, getIndexByKeyPath: function(d) {
|
|
2339
2341
|
return (d = a[mt(d)]) && d[0];
|
|
@@ -2342,20 +2344,20 @@ var jr = { exports: {} };
|
|
|
2342
2344
|
}, query: function(d) {
|
|
2343
2345
|
return n.query(b(d));
|
|
2344
2346
|
}, openCursor: function(d) {
|
|
2345
|
-
var
|
|
2347
|
+
var w = d.query.index, p = w.keyTail, m = w.isVirtual, v = w.keyLength;
|
|
2346
2348
|
return m ? n.openCursor(b(d)).then(function(S) {
|
|
2347
2349
|
return S && y(S);
|
|
2348
2350
|
}) : n.openCursor(d);
|
|
2349
2351
|
function y(S) {
|
|
2350
2352
|
return Object.create(S, { continue: { value: function(E) {
|
|
2351
|
-
E != null ? S.continue(Yt(E, d.reverse ? e.MAX_KEY : e.MIN_KEY, p)) : d.unique ? S.continue(S.key.slice(0,
|
|
2353
|
+
E != null ? S.continue(Yt(E, d.reverse ? e.MAX_KEY : e.MIN_KEY, p)) : d.unique ? S.continue(S.key.slice(0, v).concat(d.reverse ? e.MIN_KEY : e.MAX_KEY, p)) : S.continue();
|
|
2352
2354
|
} }, continuePrimaryKey: { value: function(E, O) {
|
|
2353
2355
|
S.continuePrimaryKey(Yt(E, e.MAX_KEY, p), O);
|
|
2354
2356
|
} }, primaryKey: { get: function() {
|
|
2355
2357
|
return S.primaryKey;
|
|
2356
2358
|
} }, key: { get: function() {
|
|
2357
2359
|
var E = S.key;
|
|
2358
|
-
return
|
|
2360
|
+
return v === 1 ? E[0] : E.slice(0, v);
|
|
2359
2361
|
} }, value: { get: function() {
|
|
2360
2362
|
return S.value;
|
|
2361
2363
|
} } });
|
|
@@ -2363,30 +2365,30 @@ var jr = { exports: {} };
|
|
|
2363
2365
|
} });
|
|
2364
2366
|
} });
|
|
2365
2367
|
} };
|
|
2366
|
-
function
|
|
2368
|
+
function Mn(e, t, n, i) {
|
|
2367
2369
|
return n = n || {}, i = i || "", N(e).forEach(function(a) {
|
|
2368
2370
|
var o, s, u;
|
|
2369
|
-
ne(t, a) ? (o = e[a], s = t[a], typeof o == "object" && typeof s == "object" && o && s ? (u = qt(o)) !== qt(s) ? n[i + a] = t[a] : u === "Object" ?
|
|
2371
|
+
ne(t, a) ? (o = e[a], s = t[a], typeof o == "object" && typeof s == "object" && o && s ? (u = qt(o)) !== qt(s) ? n[i + a] = t[a] : u === "Object" ? Mn(o, s, n, i + a + ".") : o !== s && (n[i + a] = t[a]) : o !== s && (n[i + a] = t[a])) : n[i + a] = void 0;
|
|
2370
2372
|
}), N(t).forEach(function(a) {
|
|
2371
2373
|
ne(e, a) || (n[i + a] = t[a]);
|
|
2372
2374
|
}), n;
|
|
2373
2375
|
}
|
|
2374
|
-
function
|
|
2376
|
+
function jn(e, t) {
|
|
2375
2377
|
return t.type === "delete" ? t.keys : t.keys || t.values.map(e.extractKey);
|
|
2376
2378
|
}
|
|
2377
2379
|
var bi = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: function(e) {
|
|
2378
2380
|
return l(l({}, e), { table: function(t) {
|
|
2379
2381
|
var n = e.table(t), i = n.schema.primaryKey;
|
|
2380
2382
|
return l(l({}, n), { mutate: function(a) {
|
|
2381
|
-
var o =
|
|
2383
|
+
var o = G.trans, s = o.table(t).hook, u = s.deleting, h = s.creating, g = s.updating;
|
|
2382
2384
|
switch (a.type) {
|
|
2383
2385
|
case "add":
|
|
2384
|
-
if (
|
|
2386
|
+
if (h.fire === Q) break;
|
|
2385
2387
|
return o._promise("readwrite", function() {
|
|
2386
2388
|
return b(a);
|
|
2387
2389
|
}, !0);
|
|
2388
2390
|
case "put":
|
|
2389
|
-
if (
|
|
2391
|
+
if (h.fire === Q && g.fire === Q) break;
|
|
2390
2392
|
return o._promise("readwrite", function() {
|
|
2391
2393
|
return b(a);
|
|
2392
2394
|
}, !0);
|
|
@@ -2398,11 +2400,11 @@ var jr = { exports: {} };
|
|
|
2398
2400
|
case "deleteRange":
|
|
2399
2401
|
if (u.fire === Q) break;
|
|
2400
2402
|
return o._promise("readwrite", function() {
|
|
2401
|
-
return function d(
|
|
2402
|
-
return n.query({ trans:
|
|
2403
|
-
var y =
|
|
2404
|
-
return b({ type: "delete", keys: y, trans:
|
|
2405
|
-
return 0 < S.numFailures ? Promise.reject(S.failures[0]) : y.length < m ? { failures: [], numFailures: 0, lastResult: void 0 } : d(
|
|
2403
|
+
return function d(w, p, m) {
|
|
2404
|
+
return n.query({ trans: w, values: !1, query: { index: i, range: p }, limit: m }).then(function(v) {
|
|
2405
|
+
var y = v.result;
|
|
2406
|
+
return b({ type: "delete", keys: y, trans: w }).then(function(S) {
|
|
2407
|
+
return 0 < S.numFailures ? Promise.reject(S.failures[0]) : y.length < m ? { failures: [], numFailures: 0, lastResult: void 0 } : d(w, l(l({}, p), { lower: y[y.length - 1], lowerOpen: !0 }), m);
|
|
2406
2408
|
});
|
|
2407
2409
|
});
|
|
2408
2410
|
}(a.trans, a.range, 1e4);
|
|
@@ -2410,21 +2412,21 @@ var jr = { exports: {} };
|
|
|
2410
2412
|
}
|
|
2411
2413
|
return n.mutate(a);
|
|
2412
2414
|
function b(d) {
|
|
2413
|
-
var
|
|
2415
|
+
var w, p, m, v = G.trans, y = d.keys || jn(i, d);
|
|
2414
2416
|
if (!y) throw new Error("Keys missing");
|
|
2415
|
-
return (d = d.type === "add" || d.type === "put" ? l(l({}, d), { keys: y }) : l({}, d)).type !== "delete" && (d.values = A([], d.values)), d.keys && (d.keys = A([], d.keys)),
|
|
2417
|
+
return (d = d.type === "add" || d.type === "put" ? l(l({}, d), { keys: y }) : l({}, d)).type !== "delete" && (d.values = A([], d.values)), d.keys && (d.keys = A([], d.keys)), w = n, m = y, ((p = d).type === "add" ? Promise.resolve([]) : w.getMany({ trans: p.trans, keys: m, cache: "immutable" })).then(function(S) {
|
|
2416
2418
|
var E = y.map(function(O, x) {
|
|
2417
|
-
var
|
|
2418
|
-
return d.type === "delete" ? u.fire.call(
|
|
2419
|
-
ne(
|
|
2420
|
-
}))),
|
|
2419
|
+
var P, T, I, C = S[x], M = { onerror: null, onsuccess: null };
|
|
2420
|
+
return d.type === "delete" ? u.fire.call(M, O, C, v) : d.type === "add" || C === void 0 ? (P = h.fire.call(M, O, d.values[x], v), O == null && P != null && (d.keys[x] = O = P, i.outbound || de(d.values[x], i.keyPath, O))) : (P = Mn(C, d.values[x]), (T = g.fire.call(M, P, O, C, v)) && (I = d.values[x], Object.keys(T).forEach(function(R) {
|
|
2421
|
+
ne(I, R) ? I[R] = T[R] : de(I, R, T[R]);
|
|
2422
|
+
}))), M;
|
|
2421
2423
|
});
|
|
2422
2424
|
return n.mutate(d).then(function(O) {
|
|
2423
|
-
for (var x = O.failures,
|
|
2424
|
-
var
|
|
2425
|
-
|
|
2425
|
+
for (var x = O.failures, P = O.results, T = O.numFailures, O = O.lastResult, I = 0; I < y.length; ++I) {
|
|
2426
|
+
var C = (P || y)[I], M = E[I];
|
|
2427
|
+
C == null ? M.onerror && M.onerror(x[I]) : M.onsuccess && M.onsuccess(d.type === "put" && S[I] ? d.values[I] : C);
|
|
2426
2428
|
}
|
|
2427
|
-
return { failures: x, results:
|
|
2429
|
+
return { failures: x, results: P, numFailures: T, lastResult: O };
|
|
2428
2430
|
}).catch(function(O) {
|
|
2429
2431
|
return E.forEach(function(x) {
|
|
2430
2432
|
return x.onerror && x.onerror(O);
|
|
@@ -2438,7 +2440,7 @@ var jr = { exports: {} };
|
|
|
2438
2440
|
function Or(e, t, n) {
|
|
2439
2441
|
try {
|
|
2440
2442
|
if (!t || t.keys.length < e.length) return null;
|
|
2441
|
-
for (var i = [], a = 0, o = 0; a < t.keys.length && o < e.length; ++a) H(t.keys[a], e[o]) === 0 && (i.push(n ?
|
|
2443
|
+
for (var i = [], a = 0, o = 0; a < t.keys.length && o < e.length; ++a) H(t.keys[a], e[o]) === 0 && (i.push(n ? Me(t.values[a]) : t.values[a]), ++o);
|
|
2442
2444
|
return i.length === e.length ? i : null;
|
|
2443
2445
|
} catch {
|
|
2444
2446
|
return null;
|
|
@@ -2451,7 +2453,7 @@ var jr = { exports: {} };
|
|
|
2451
2453
|
if (!i.cache) return n.getMany(i);
|
|
2452
2454
|
var a = Or(i.keys, i.trans._cache, i.cache === "clone");
|
|
2453
2455
|
return a ? K.resolve(a) : n.getMany(i).then(function(o) {
|
|
2454
|
-
return i.trans._cache = { keys: i.keys, values: i.cache === "clone" ?
|
|
2456
|
+
return i.trans._cache = { keys: i.keys, values: i.cache === "clone" ? Me(o) : o }, o;
|
|
2455
2457
|
});
|
|
2456
2458
|
}, mutate: function(i) {
|
|
2457
2459
|
return i.type !== "add" && (i.trans._cache = null), n.mutate(i);
|
|
@@ -2473,85 +2475,83 @@ var jr = { exports: {} };
|
|
|
2473
2475
|
}
|
|
2474
2476
|
}
|
|
2475
2477
|
var wi = { stack: "dbcore", level: 0, name: "Observability", create: function(e) {
|
|
2476
|
-
var t = e.schema.name, n = new
|
|
2478
|
+
var t = e.schema.name, n = new oe(e.MIN_KEY, e.MAX_KEY);
|
|
2477
2479
|
return l(l({}, e), { transaction: function(i, a, o) {
|
|
2478
|
-
if (
|
|
2480
|
+
if (G.subscr && a !== "readonly") throw new $.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(G.querier));
|
|
2479
2481
|
return e.transaction(i, a, o);
|
|
2480
2482
|
}, table: function(i) {
|
|
2481
|
-
var a = e.table(i), o = a.schema, s = o.primaryKey, d = o.indexes, u = s.extractKey,
|
|
2483
|
+
var a = e.table(i), o = a.schema, s = o.primaryKey, d = o.indexes, u = s.extractKey, h = s.outbound, g = s.autoIncrement && d.filter(function(p) {
|
|
2482
2484
|
return p.compound && p.keyPath.includes(s.keyPath);
|
|
2483
2485
|
}), b = l(l({}, a), { mutate: function(p) {
|
|
2484
|
-
function m(
|
|
2485
|
-
return
|
|
2486
|
+
function m(R) {
|
|
2487
|
+
return R = "idb://".concat(t, "/").concat(i, "/").concat(R), O[R] || (O[R] = new oe());
|
|
2486
2488
|
}
|
|
2487
|
-
var
|
|
2488
|
-
return
|
|
2489
|
-
}), p.values] : [],
|
|
2490
|
-
return
|
|
2491
|
-
var
|
|
2492
|
-
function
|
|
2493
|
-
return
|
|
2489
|
+
var v, y, S, E = p.trans, O = p.mutatedParts || (p.mutatedParts = {}), x = m(""), P = m(":dels"), T = p.type, M = p.type === "deleteRange" ? [p.range] : p.type === "delete" ? [p.keys] : p.values.length < 50 ? [jn(s, p).filter(function(R) {
|
|
2490
|
+
return R;
|
|
2491
|
+
}), p.values] : [], I = M[0], C = M[1], M = p.trans._cache;
|
|
2492
|
+
return L(I) ? (x.addKeys(I), (M = T === "delete" || I.length === C.length ? Or(I, M) : null) || P.addKeys(I), (M || C) && (v = m, y = M, S = C, o.indexes.forEach(function(R) {
|
|
2493
|
+
var B = v(R.name || "");
|
|
2494
|
+
function U(z) {
|
|
2495
|
+
return z != null ? R.extractKey(z) : null;
|
|
2494
2496
|
}
|
|
2495
|
-
function z
|
|
2496
|
-
return
|
|
2497
|
-
return
|
|
2498
|
-
}) :
|
|
2497
|
+
function W(z) {
|
|
2498
|
+
return R.multiEntry && L(z) ? z.forEach(function(he) {
|
|
2499
|
+
return B.addKey(he);
|
|
2500
|
+
}) : B.addKey(z);
|
|
2499
2501
|
}
|
|
2500
|
-
(y || S).forEach(function(
|
|
2501
|
-
var
|
|
2502
|
-
H(
|
|
2502
|
+
(y || S).forEach(function(z, se) {
|
|
2503
|
+
var F = y && U(y[se]), se = S && U(S[se]);
|
|
2504
|
+
H(F, se) !== 0 && (F != null && W(F), se != null && W(se));
|
|
2503
2505
|
});
|
|
2504
|
-
}))) :
|
|
2505
|
-
return m(
|
|
2506
|
-
})), a.mutate(p).then(function(
|
|
2507
|
-
return !
|
|
2508
|
-
var
|
|
2509
|
-
return
|
|
2510
|
-
}),
|
|
2511
|
-
return
|
|
2512
|
-
});
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
}), m($.name).addKeys(F);
|
|
2516
|
-
})), E.mutatedParts = zt(E.mutatedParts || {}, O), P;
|
|
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), x.add(C)) : (x.add(n), P.add(n), o.indexes.forEach(function(R) {
|
|
2507
|
+
return m(R.name).add(n);
|
|
2508
|
+
})), a.mutate(p).then(function(R) {
|
|
2509
|
+
return !I || p.type !== "add" && p.type !== "put" || (x.addKeys(R.results), g && g.forEach(function(B) {
|
|
2510
|
+
for (var U = p.values.map(function(F) {
|
|
2511
|
+
return B.extractKey(F);
|
|
2512
|
+
}), W = B.keyPath.findIndex(function(F) {
|
|
2513
|
+
return F === s.keyPath;
|
|
2514
|
+
}), z = 0, he = R.results.length; z < he; ++z) U[z][W] = R.results[z];
|
|
2515
|
+
m(B.name).addKeys(U);
|
|
2516
|
+
})), E.mutatedParts = zt(E.mutatedParts || {}, O), R;
|
|
2517
2517
|
});
|
|
2518
2518
|
} }), d = function(m) {
|
|
2519
|
-
var
|
|
2520
|
-
return [m, new
|
|
2521
|
-
},
|
|
2522
|
-
return [s, new
|
|
2519
|
+
var v = m.query, m = v.index, v = v.range;
|
|
2520
|
+
return [m, new oe((m = v.lower) !== null && m !== void 0 ? m : e.MIN_KEY, (v = v.upper) !== null && v !== void 0 ? v : e.MAX_KEY)];
|
|
2521
|
+
}, w = { get: function(p) {
|
|
2522
|
+
return [s, new oe(p.key)];
|
|
2523
2523
|
}, getMany: function(p) {
|
|
2524
|
-
return [s, new
|
|
2524
|
+
return [s, new oe().addKeys(p.keys)];
|
|
2525
2525
|
}, count: d, query: d, openCursor: d };
|
|
2526
|
-
return N(
|
|
2526
|
+
return N(w).forEach(function(p) {
|
|
2527
2527
|
b[p] = function(m) {
|
|
2528
|
-
var
|
|
2528
|
+
var v = G.subscr, y = !!v, S = xr(G, a) && kr(p, m) ? m.obsSet = {} : v;
|
|
2529
2529
|
if (y) {
|
|
2530
|
-
var E = function(
|
|
2531
|
-
return
|
|
2532
|
-
}, O = E(""), x = E(":dels"),
|
|
2533
|
-
if ((p === "query" && y.isPrimaryKey && !m.values ? x : E(y.name || "")).add(
|
|
2530
|
+
var E = function(C) {
|
|
2531
|
+
return C = "idb://".concat(t, "/").concat(i, "/").concat(C), S[C] || (S[C] = new oe());
|
|
2532
|
+
}, O = E(""), x = E(":dels"), v = w[p](m), y = v[0], v = v[1];
|
|
2533
|
+
if ((p === "query" && y.isPrimaryKey && !m.values ? x : E(y.name || "")).add(v), !y.isPrimaryKey) {
|
|
2534
2534
|
if (p !== "count") {
|
|
2535
|
-
var
|
|
2536
|
-
return a[p].apply(this, arguments).then(function(
|
|
2535
|
+
var P = p === "query" && h && m.values && a.query(l(l({}, m), { values: !1 }));
|
|
2536
|
+
return a[p].apply(this, arguments).then(function(C) {
|
|
2537
2537
|
if (p === "query") {
|
|
2538
|
-
if (
|
|
2539
|
-
return
|
|
2538
|
+
if (h && m.values) return P.then(function(U) {
|
|
2539
|
+
return U = U.result, O.addKeys(U), C;
|
|
2540
2540
|
});
|
|
2541
|
-
var
|
|
2542
|
-
(m.values ? O : x).addKeys(
|
|
2541
|
+
var M = m.values ? C.result.map(u) : C.result;
|
|
2542
|
+
(m.values ? O : x).addKeys(M);
|
|
2543
2543
|
} else if (p === "openCursor") {
|
|
2544
|
-
var
|
|
2545
|
-
return
|
|
2546
|
-
return x.addKey(
|
|
2544
|
+
var R = C, B = m.values;
|
|
2545
|
+
return R && Object.create(R, { key: { get: function() {
|
|
2546
|
+
return x.addKey(R.primaryKey), R.key;
|
|
2547
2547
|
} }, primaryKey: { get: function() {
|
|
2548
|
-
var
|
|
2549
|
-
return x.addKey(
|
|
2548
|
+
var U = R.primaryKey;
|
|
2549
|
+
return x.addKey(U), U;
|
|
2550
2550
|
} }, value: { get: function() {
|
|
2551
|
-
return
|
|
2551
|
+
return B && O.addKey(R.primaryKey), R.value;
|
|
2552
2552
|
} } });
|
|
2553
2553
|
}
|
|
2554
|
-
return
|
|
2554
|
+
return C;
|
|
2555
2555
|
});
|
|
2556
2556
|
}
|
|
2557
2557
|
x.add(n);
|
|
@@ -2566,9 +2566,9 @@ var jr = { exports: {} };
|
|
|
2566
2566
|
if (n.numFailures === 0) return t;
|
|
2567
2567
|
if (t.type === "deleteRange") return null;
|
|
2568
2568
|
var i = t.keys ? t.keys.length : "values" in t && t.values ? t.values.length : 1;
|
|
2569
|
-
return n.numFailures === i ? null : (t = l({}, t),
|
|
2569
|
+
return n.numFailures === i ? null : (t = l({}, t), L(t.keys) && (t.keys = t.keys.filter(function(a, o) {
|
|
2570
2570
|
return !(o in n.failures);
|
|
2571
|
-
})), "values" in t &&
|
|
2571
|
+
})), "values" in t && L(t.values) && (t.values = t.values.filter(function(a, o) {
|
|
2572
2572
|
return !(o in n.failures);
|
|
2573
2573
|
})), t);
|
|
2574
2574
|
}
|
|
@@ -2576,48 +2576,55 @@ var jr = { exports: {} };
|
|
|
2576
2576
|
return n = e, ((i = t).lower === void 0 || (i.lowerOpen ? 0 < H(n, i.lower) : 0 <= H(n, i.lower))) && (e = e, (t = t).upper === void 0 || (t.upperOpen ? H(e, t.upper) < 0 : H(e, t.upper) <= 0));
|
|
2577
2577
|
var n, i;
|
|
2578
2578
|
}
|
|
2579
|
-
function Dr(e, t,
|
|
2580
|
-
if (!
|
|
2581
|
-
var s = t.query.index, u = s.multiEntry,
|
|
2582
|
-
var
|
|
2583
|
-
if (m.type === "add" || m.type === "put") for (var S = new
|
|
2584
|
-
var O, x = m.values[E],
|
|
2585
|
-
S.hasKey(
|
|
2586
|
-
return Kn(
|
|
2587
|
-
}) : Kn(O,
|
|
2579
|
+
function Dr(e, t, w, i, a, o) {
|
|
2580
|
+
if (!w || w.length === 0) return e;
|
|
2581
|
+
var s = t.query.index, u = s.multiEntry, h = t.query.range, g = i.schema.primaryKey.extractKey, b = s.extractKey, d = (s.lowLevelIndex || s).extractKey, w = w.reduce(function(p, m) {
|
|
2582
|
+
var v = p, y = [];
|
|
2583
|
+
if (m.type === "add" || m.type === "put") for (var S = new oe(), E = m.values.length - 1; 0 <= E; --E) {
|
|
2584
|
+
var O, x = m.values[E], P = g(x);
|
|
2585
|
+
S.hasKey(P) || (O = b(x), (u && L(O) ? O.some(function(R) {
|
|
2586
|
+
return Kn(R, h);
|
|
2587
|
+
}) : Kn(O, h)) && (S.addKey(P), y.push(x)));
|
|
2588
2588
|
}
|
|
2589
2589
|
switch (m.type) {
|
|
2590
2590
|
case "add":
|
|
2591
|
-
|
|
2592
|
-
return
|
|
2591
|
+
var T = new oe().addKeys(t.values ? p.map(function(B) {
|
|
2592
|
+
return g(B);
|
|
2593
|
+
}) : p), v = p.concat(t.values ? y.filter(function(B) {
|
|
2594
|
+
return B = g(B), !T.hasKey(B) && (T.addKey(B), !0);
|
|
2595
|
+
}) : y.map(function(B) {
|
|
2596
|
+
return g(B);
|
|
2597
|
+
}).filter(function(B) {
|
|
2598
|
+
return !T.hasKey(B) && (T.addKey(B), !0);
|
|
2593
2599
|
}));
|
|
2594
2600
|
break;
|
|
2595
2601
|
case "put":
|
|
2596
|
-
var
|
|
2597
|
-
return
|
|
2598
|
-
}))
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
+
var I = new oe().addKeys(m.values.map(function(B) {
|
|
2603
|
+
return g(B);
|
|
2604
|
+
}));
|
|
2605
|
+
v = p.filter(function(B) {
|
|
2606
|
+
return !I.hasKey(t.values ? g(B) : B);
|
|
2607
|
+
}).concat(t.values ? y : y.map(function(B) {
|
|
2608
|
+
return g(B);
|
|
2602
2609
|
}));
|
|
2603
2610
|
break;
|
|
2604
2611
|
case "delete":
|
|
2605
|
-
var C = new
|
|
2606
|
-
|
|
2607
|
-
return !C.hasKey(t.values ?
|
|
2612
|
+
var C = new oe().addKeys(m.keys);
|
|
2613
|
+
v = p.filter(function(B) {
|
|
2614
|
+
return !C.hasKey(t.values ? g(B) : B);
|
|
2608
2615
|
});
|
|
2609
2616
|
break;
|
|
2610
2617
|
case "deleteRange":
|
|
2611
|
-
var
|
|
2612
|
-
|
|
2613
|
-
return !Kn(
|
|
2618
|
+
var M = m.range;
|
|
2619
|
+
v = p.filter(function(B) {
|
|
2620
|
+
return !Kn(g(B), M);
|
|
2614
2621
|
});
|
|
2615
2622
|
}
|
|
2616
|
-
return
|
|
2623
|
+
return v;
|
|
2617
2624
|
}, e);
|
|
2618
|
-
return
|
|
2619
|
-
return H(d(p), d(m)) || H(
|
|
2620
|
-
}), t.limit && t.limit < 1 / 0 && (
|
|
2625
|
+
return w === e ? e : (w.sort(function(p, m) {
|
|
2626
|
+
return H(d(p), d(m)) || H(g(p), g(m));
|
|
2627
|
+
}), t.limit && t.limit < 1 / 0 && (w.length > t.limit ? w.length = t.limit : e.length === t.limit && w.length < t.limit && (a.dirty = !0)), o ? Object.freeze(w) : w);
|
|
2621
2628
|
}
|
|
2622
2629
|
function Pr(e, t) {
|
|
2623
2630
|
return H(e.lower, t.lower) === 0 && H(e.upper, t.upper) === 0 && !!e.lowerOpen == !!t.lowerOpen && !!e.upperOpen == !!t.upperOpen;
|
|
@@ -2647,7 +2654,7 @@ var jr = { exports: {} };
|
|
|
2647
2654
|
e.subscribers.add(n), i.addEventListener("abort", function() {
|
|
2648
2655
|
var a, o;
|
|
2649
2656
|
e.subscribers.delete(n), e.subscribers.size === 0 && (a = e, o = t, setTimeout(function() {
|
|
2650
|
-
a.subscribers.size === 0 &&
|
|
2657
|
+
a.subscribers.size === 0 && je(o, a);
|
|
2651
2658
|
}, 3e3));
|
|
2652
2659
|
});
|
|
2653
2660
|
}
|
|
@@ -2655,32 +2662,32 @@ var jr = { exports: {} };
|
|
|
2655
2662
|
var t = e.schema.name;
|
|
2656
2663
|
return l(l({}, e), { transaction: function(n, i, a) {
|
|
2657
2664
|
var o, s, u = e.transaction(n, i, a);
|
|
2658
|
-
return i === "readwrite" && (s = (o = new AbortController()).signal, a = function(
|
|
2665
|
+
return i === "readwrite" && (s = (o = new AbortController()).signal, a = function(h) {
|
|
2659
2666
|
return function() {
|
|
2660
2667
|
if (o.abort(), i === "readwrite") {
|
|
2661
|
-
for (var
|
|
2662
|
-
var
|
|
2668
|
+
for (var g = /* @__PURE__ */ new Set(), b = 0, d = n; b < d.length; b++) {
|
|
2669
|
+
var w = d[b], p = Ue["idb://".concat(t, "/").concat(w)];
|
|
2663
2670
|
if (p) {
|
|
2664
|
-
var m = e.table(
|
|
2665
|
-
return
|
|
2671
|
+
var m = e.table(w), v = p.optimisticOps.filter(function(B) {
|
|
2672
|
+
return B.trans === u;
|
|
2666
2673
|
});
|
|
2667
|
-
if (u._explicit &&
|
|
2668
|
-
return
|
|
2674
|
+
if (u._explicit && h && u.mutatedParts) for (var y = 0, S = Object.values(p.queries.query); y < S.length; y++) for (var E = 0, O = (T = S[y]).slice(); E < O.length; E++) Pn((I = O[E]).obsSet, u.mutatedParts) && (je(T, I), I.subscribers.forEach(function(B) {
|
|
2675
|
+
return g.add(B);
|
|
2669
2676
|
}));
|
|
2670
|
-
else if (0 <
|
|
2671
|
-
p.optimisticOps = p.optimisticOps.filter(function(
|
|
2672
|
-
return
|
|
2677
|
+
else if (0 < v.length) {
|
|
2678
|
+
p.optimisticOps = p.optimisticOps.filter(function(B) {
|
|
2679
|
+
return B.trans !== u;
|
|
2673
2680
|
});
|
|
2674
|
-
for (var x = 0,
|
|
2675
|
-
return
|
|
2676
|
-
})) :
|
|
2677
|
-
return
|
|
2681
|
+
for (var x = 0, P = Object.values(p.queries.query); x < P.length; x++) for (var T, I, C, M = 0, R = (T = P[x]).slice(); M < R.length; M++) (I = R[M]).res != null && u.mutatedParts && (h && !I.dirty ? (C = Object.isFrozen(I.res), C = Dr(I.res, I.req, v, m, I, C), I.dirty ? (je(T, I), I.subscribers.forEach(function(B) {
|
|
2682
|
+
return g.add(B);
|
|
2683
|
+
})) : C !== I.res && (I.res = C, I.promise = K.resolve({ result: C }))) : (I.dirty && je(T, I), I.subscribers.forEach(function(B) {
|
|
2684
|
+
return g.add(B);
|
|
2678
2685
|
})));
|
|
2679
2686
|
}
|
|
2680
2687
|
}
|
|
2681
2688
|
}
|
|
2682
|
-
|
|
2683
|
-
return
|
|
2689
|
+
g.forEach(function(B) {
|
|
2690
|
+
return B();
|
|
2684
2691
|
});
|
|
2685
2692
|
}
|
|
2686
2693
|
};
|
|
@@ -2688,57 +2695,57 @@ var jr = { exports: {} };
|
|
|
2688
2695
|
}, table: function(n) {
|
|
2689
2696
|
var i = e.table(n), a = i.schema.primaryKey;
|
|
2690
2697
|
return l(l({}, i), { mutate: function(o) {
|
|
2691
|
-
var s =
|
|
2692
|
-
if (a.outbound || s.db._options.cache === "disabled" || s.explicit) return i.mutate(o);
|
|
2693
|
-
var u =
|
|
2694
|
-
return u ? (s = i.mutate(o), o.type !== "add" && o.type !== "put" || !(50 <= o.values.length ||
|
|
2695
|
-
return
|
|
2696
|
-
})) ? (u.optimisticOps.push(o), o.mutatedParts && Ht(o.mutatedParts), s.then(function(
|
|
2697
|
-
0 <
|
|
2698
|
+
var s = G.trans;
|
|
2699
|
+
if (a.outbound || s.db._options.cache === "disabled" || s.explicit || s.idbtrans.mode !== "readwrite") return i.mutate(o);
|
|
2700
|
+
var u = Ue["idb://".concat(t, "/").concat(n)];
|
|
2701
|
+
return u ? (s = i.mutate(o), o.type !== "add" && o.type !== "put" || !(50 <= o.values.length || jn(a, o).some(function(h) {
|
|
2702
|
+
return h == null;
|
|
2703
|
+
})) ? (u.optimisticOps.push(o), o.mutatedParts && Ht(o.mutatedParts), s.then(function(h) {
|
|
2704
|
+
0 < h.numFailures && (je(u.optimisticOps, o), (h = Ar(0, o, h)) && u.optimisticOps.push(h), o.mutatedParts && Ht(o.mutatedParts));
|
|
2698
2705
|
}), s.catch(function() {
|
|
2699
|
-
|
|
2700
|
-
})) : s.then(function(
|
|
2701
|
-
var
|
|
2702
|
-
var
|
|
2703
|
-
return de(
|
|
2704
|
-
}) }),
|
|
2705
|
-
u.optimisticOps.push(
|
|
2706
|
+
je(u.optimisticOps, o), o.mutatedParts && Ht(o.mutatedParts);
|
|
2707
|
+
})) : s.then(function(h) {
|
|
2708
|
+
var g = Ar(0, l(l({}, o), { values: o.values.map(function(b, d) {
|
|
2709
|
+
var w;
|
|
2710
|
+
return h.failures[d] ? b : (b = (w = a.keyPath) !== null && w !== void 0 && w.includes(".") ? Me(b) : l({}, b), de(b, a.keyPath, h.results[d]), b);
|
|
2711
|
+
}) }), h);
|
|
2712
|
+
u.optimisticOps.push(g), queueMicrotask(function() {
|
|
2706
2713
|
return o.mutatedParts && Ht(o.mutatedParts);
|
|
2707
2714
|
});
|
|
2708
2715
|
}), s) : i.mutate(o);
|
|
2709
2716
|
}, query: function(o) {
|
|
2710
|
-
if (!xr(
|
|
2711
|
-
var s = ((
|
|
2712
|
-
var E =
|
|
2717
|
+
if (!xr(G, i) || !kr("query", o)) return i.query(o);
|
|
2718
|
+
var s = ((g = G.trans) === null || g === void 0 ? void 0 : g.db._options.cache) === "immutable", d = G, u = d.requery, h = d.signal, g = function(m, v, y, S) {
|
|
2719
|
+
var E = Ue["idb://".concat(m, "/").concat(v)];
|
|
2713
2720
|
if (!E) return [];
|
|
2714
|
-
if (!(
|
|
2715
|
-
var O =
|
|
2721
|
+
if (!(v = E.queries[y])) return [null, !1, E, null];
|
|
2722
|
+
var O = v[(S.query ? S.query.index.name : null) || ""];
|
|
2716
2723
|
if (!O) return [null, !1, E, null];
|
|
2717
2724
|
switch (y) {
|
|
2718
2725
|
case "query":
|
|
2719
|
-
var x = O.find(function(
|
|
2720
|
-
return
|
|
2726
|
+
var x = O.find(function(P) {
|
|
2727
|
+
return P.req.limit === S.limit && P.req.values === S.values && Pr(P.req.query.range, S.query.range);
|
|
2721
2728
|
});
|
|
2722
|
-
return x ? [x, !0, E, O] : [O.find(function(
|
|
2723
|
-
return ("limit" in
|
|
2729
|
+
return x ? [x, !0, E, O] : [O.find(function(P) {
|
|
2730
|
+
return ("limit" in P.req ? P.req.limit : 1 / 0) >= S.limit && (!S.values || P.req.values) && _i(P.req.query.range, S.query.range);
|
|
2724
2731
|
}), !1, E, O];
|
|
2725
2732
|
case "count":
|
|
2726
|
-
return x = O.find(function(
|
|
2727
|
-
return Pr(
|
|
2733
|
+
return x = O.find(function(P) {
|
|
2734
|
+
return Pr(P.req.query.range, S.query.range);
|
|
2728
2735
|
}), [x, !!x, E, O];
|
|
2729
2736
|
}
|
|
2730
|
-
}(t, n, "query", o), b =
|
|
2737
|
+
}(t, n, "query", o), b = g[0], d = g[1], w = g[2], p = g[3];
|
|
2731
2738
|
return b && d ? b.obsSet = o.obsSet : (d = i.query(o).then(function(m) {
|
|
2732
|
-
var
|
|
2733
|
-
if (b && (b.res =
|
|
2734
|
-
for (var y = 0, S =
|
|
2735
|
-
Object.freeze(
|
|
2736
|
-
} else m.result =
|
|
2739
|
+
var v = m.result;
|
|
2740
|
+
if (b && (b.res = v), s) {
|
|
2741
|
+
for (var y = 0, S = v.length; y < S; ++y) Object.freeze(v[y]);
|
|
2742
|
+
Object.freeze(v);
|
|
2743
|
+
} else m.result = Me(v);
|
|
2737
2744
|
return m;
|
|
2738
2745
|
}).catch(function(m) {
|
|
2739
|
-
return p && b &&
|
|
2740
|
-
}), b = { obsSet: o.obsSet, promise: d, subscribers: /* @__PURE__ */ new Set(), type: "query", req: o, dirty: !1 }, p ? p.push(b) : (p = [b], (
|
|
2741
|
-
return { result: Dr(m.result, o,
|
|
2746
|
+
return p && b && je(p, b), Promise.reject(m);
|
|
2747
|
+
}), b = { obsSet: o.obsSet, promise: d, subscribers: /* @__PURE__ */ new Set(), type: "query", req: o, dirty: !1 }, p ? p.push(b) : (p = [b], (w = w || (Ue["idb://".concat(t, "/").concat(n)] = { queries: { query: {}, count: {} }, objs: /* @__PURE__ */ new Map(), optimisticOps: [], unsignaledParts: {} })).queries.query[o.query.index.name || ""] = p)), Si(b, p, u, h), b.promise.then(function(m) {
|
|
2748
|
+
return { result: Dr(m.result, o, w == null ? void 0 : w.optimisticOps, i, b, s) };
|
|
2742
2749
|
});
|
|
2743
2750
|
} });
|
|
2744
2751
|
} });
|
|
@@ -2749,8 +2756,8 @@ var jr = { exports: {} };
|
|
|
2749
2756
|
} });
|
|
2750
2757
|
}
|
|
2751
2758
|
var Ee = (te.prototype.version = function(e) {
|
|
2752
|
-
if (isNaN(e) || e < 0.1) throw new
|
|
2753
|
-
if (e = Math.round(10 * e) / 10, this.idbdb || this._state.isBeingOpened) throw new
|
|
2759
|
+
if (isNaN(e) || e < 0.1) throw new $.Type("Given version is not a positive number");
|
|
2760
|
+
if (e = Math.round(10 * e) / 10, this.idbdb || this._state.isBeingOpened) throw new $.Schema("Cannot add version when database is open");
|
|
2754
2761
|
this.verno = Math.max(this.verno, e);
|
|
2755
2762
|
var t = this._versions, n = t.filter(function(i) {
|
|
2756
2763
|
return i._cfg.version === e;
|
|
@@ -2758,10 +2765,10 @@ var jr = { exports: {} };
|
|
|
2758
2765
|
return n || (n = new this.Version(e), t.push(n), t.sort(fi), n.stores({}), this._state.autoSchema = !1, n);
|
|
2759
2766
|
}, te.prototype._whenReady = function(e) {
|
|
2760
2767
|
var t = this;
|
|
2761
|
-
return this.idbdb && (this._state.openComplete ||
|
|
2762
|
-
if (t._state.openComplete) return i(new
|
|
2768
|
+
return this.idbdb && (this._state.openComplete || G.letThrough || this._vip) ? e() : new K(function(n, i) {
|
|
2769
|
+
if (t._state.openComplete) return i(new $.DatabaseClosed(t._state.dbOpenError));
|
|
2763
2770
|
if (!t._state.isBeingOpened) {
|
|
2764
|
-
if (!t._state.autoOpen) return void i(new
|
|
2771
|
+
if (!t._state.autoOpen) return void i(new $.DatabaseClosed());
|
|
2765
2772
|
t.open().catch(Q);
|
|
2766
2773
|
}
|
|
2767
2774
|
t._state.dbReadyPromise.then(n, i);
|
|
@@ -2778,12 +2785,12 @@ var jr = { exports: {} };
|
|
|
2778
2785
|
})), this;
|
|
2779
2786
|
}, te.prototype.open = function() {
|
|
2780
2787
|
var e = this;
|
|
2781
|
-
return
|
|
2788
|
+
return Ge(Ae, function() {
|
|
2782
2789
|
return yi(e);
|
|
2783
2790
|
});
|
|
2784
2791
|
}, te.prototype._close = function() {
|
|
2785
|
-
var e = this._state, t =
|
|
2786
|
-
if (0 <= t &&
|
|
2792
|
+
var e = this._state, t = qe.indexOf(this);
|
|
2793
|
+
if (0 <= t && qe.splice(t, 1), this.idbdb) {
|
|
2787
2794
|
try {
|
|
2788
2795
|
this.idbdb.close();
|
|
2789
2796
|
} catch {
|
|
@@ -2797,7 +2804,7 @@ var jr = { exports: {} };
|
|
|
2797
2804
|
}));
|
|
2798
2805
|
}, te.prototype.close = function(n) {
|
|
2799
2806
|
var t = (n === void 0 ? { disableAutoOpen: !0 } : n).disableAutoOpen, n = this._state;
|
|
2800
|
-
t ? (n.isBeingOpened && n.cancelOpen(new
|
|
2807
|
+
t ? (n.isBeingOpened && n.cancelOpen(new $.DatabaseClosed()), this._close(), n.autoOpen = !1, n.dbOpenError = new $.DatabaseClosed()) : (this._close(), n.autoOpen = this._options.autoOpen || n.isBeingOpened, n.openComplete = !1, n.dbOpenError = null);
|
|
2801
2808
|
}, te.prototype.delete = function(e) {
|
|
2802
2809
|
var t = this;
|
|
2803
2810
|
e === void 0 && (e = { disableAutoOpen: !0 });
|
|
@@ -2807,11 +2814,11 @@ var jr = { exports: {} };
|
|
|
2807
2814
|
t.close(e);
|
|
2808
2815
|
var u = t._deps.indexedDB.deleteDatabase(t.name);
|
|
2809
2816
|
u.onsuccess = Z(function() {
|
|
2810
|
-
var
|
|
2811
|
-
|
|
2817
|
+
var h, g, b;
|
|
2818
|
+
h = t._deps, g = t.name, b = h.indexedDB, h = h.IDBKeyRange, kn(b) || g === Tt || xn(b, h).delete(g).catch(Q), a();
|
|
2812
2819
|
}), u.onerror = me(o), u.onblocked = t._fireOnBlocked;
|
|
2813
2820
|
}
|
|
2814
|
-
if (n) throw new
|
|
2821
|
+
if (n) throw new $.InvalidArgument("Invalid closeOptions argument to db.delete()");
|
|
2815
2822
|
i.isBeingOpened ? i.dbReadyPromise.then(s) : s();
|
|
2816
2823
|
});
|
|
2817
2824
|
}, te.prototype.backendDB = function() {
|
|
@@ -2833,60 +2840,60 @@ var jr = { exports: {} };
|
|
|
2833
2840
|
}, enumerable: !1, configurable: !0 }), te.prototype.transaction = function() {
|
|
2834
2841
|
var e = (function(t, n, i) {
|
|
2835
2842
|
var a = arguments.length;
|
|
2836
|
-
if (a < 2) throw new
|
|
2843
|
+
if (a < 2) throw new $.InvalidArgument("Too few arguments");
|
|
2837
2844
|
for (var o = new Array(a - 1); --a; ) o[a - 1] = arguments[a];
|
|
2838
2845
|
return i = o.pop(), [t, Xn(o), i];
|
|
2839
2846
|
}).apply(this, arguments);
|
|
2840
2847
|
return this._transaction.apply(this, e);
|
|
2841
2848
|
}, te.prototype._transaction = function(e, t, n) {
|
|
2842
|
-
var i = this, a =
|
|
2849
|
+
var i = this, a = G.trans;
|
|
2843
2850
|
a && a.db === this && e.indexOf("!") === -1 || (a = null);
|
|
2844
2851
|
var o, s, u = e.indexOf("?") !== -1;
|
|
2845
2852
|
e = e.replace("!", "").replace("?", "");
|
|
2846
2853
|
try {
|
|
2847
|
-
if (s = t.map(function(
|
|
2848
|
-
if (
|
|
2849
|
-
return
|
|
2854
|
+
if (s = t.map(function(g) {
|
|
2855
|
+
if (g = g instanceof i.Table ? g.name : g, typeof g != "string") throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");
|
|
2856
|
+
return g;
|
|
2850
2857
|
}), e == "r" || e === hn) o = hn;
|
|
2851
2858
|
else {
|
|
2852
|
-
if (e != "rw" && e != pn) throw new
|
|
2859
|
+
if (e != "rw" && e != pn) throw new $.InvalidArgument("Invalid transaction mode: " + e);
|
|
2853
2860
|
o = pn;
|
|
2854
2861
|
}
|
|
2855
2862
|
if (a) {
|
|
2856
2863
|
if (a.mode === hn && o === pn) {
|
|
2857
|
-
if (!u) throw new
|
|
2864
|
+
if (!u) throw new $.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");
|
|
2858
2865
|
a = null;
|
|
2859
2866
|
}
|
|
2860
|
-
a && s.forEach(function(
|
|
2861
|
-
if (a && a.storeNames.indexOf(
|
|
2862
|
-
if (!u) throw new
|
|
2867
|
+
a && s.forEach(function(g) {
|
|
2868
|
+
if (a && a.storeNames.indexOf(g) === -1) {
|
|
2869
|
+
if (!u) throw new $.SubTransaction("Table " + g + " not included in parent transaction.");
|
|
2863
2870
|
a = null;
|
|
2864
2871
|
}
|
|
2865
2872
|
}), u && a && !a.active && (a = null);
|
|
2866
2873
|
}
|
|
2867
|
-
} catch (
|
|
2874
|
+
} catch (g) {
|
|
2868
2875
|
return a ? a._promise(null, function(b, d) {
|
|
2869
|
-
d(
|
|
2870
|
-
}) : ee(
|
|
2876
|
+
d(g);
|
|
2877
|
+
}) : ee(g);
|
|
2871
2878
|
}
|
|
2872
|
-
var
|
|
2879
|
+
var h = (function g(b, d, w, p, m) {
|
|
2873
2880
|
return K.resolve().then(function() {
|
|
2874
|
-
var
|
|
2875
|
-
if (y.explicit = !0,
|
|
2881
|
+
var v = G.transless || G, y = b._createTransaction(d, w, b._dbSchema, p);
|
|
2882
|
+
if (y.explicit = !0, v = { trans: y, transless: v }, p) y.idbtrans = p.idbtrans;
|
|
2876
2883
|
else try {
|
|
2877
2884
|
y.create(), y.idbtrans._explicit = !0, b._state.PR1398_maxLoop = 3;
|
|
2878
2885
|
} catch (O) {
|
|
2879
2886
|
return O.name === nn.InvalidState && b.isOpen() && 0 < --b._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), b.close({ disableAutoOpen: !1 }), b.open().then(function() {
|
|
2880
|
-
return
|
|
2887
|
+
return g(b, d, w, null, m);
|
|
2881
2888
|
})) : ee(O);
|
|
2882
2889
|
}
|
|
2883
2890
|
var S, E = tn(m);
|
|
2884
|
-
return E &&
|
|
2891
|
+
return E && Ze(), v = K.follow(function() {
|
|
2885
2892
|
var O;
|
|
2886
2893
|
(S = m.call(y, y)) && (E ? (O = Pe.bind(null, null), S.then(O, O)) : typeof S.next == "function" && typeof S.throw == "function" && (S = Tn(S)));
|
|
2887
|
-
},
|
|
2888
|
-
return y.active ? O : ee(new
|
|
2889
|
-
}) :
|
|
2894
|
+
}, v), (S && typeof S.then == "function" ? K.resolve(S).then(function(O) {
|
|
2895
|
+
return y.active ? O : ee(new $.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
|
|
2896
|
+
}) : v.then(function() {
|
|
2890
2897
|
return S;
|
|
2891
2898
|
})).then(function(O) {
|
|
2892
2899
|
return p && y._resolve(), y._completion.then(function() {
|
|
@@ -2897,11 +2904,11 @@ var jr = { exports: {} };
|
|
|
2897
2904
|
});
|
|
2898
2905
|
});
|
|
2899
2906
|
}).bind(null, this, o, s, a, n);
|
|
2900
|
-
return a ? a._promise(o,
|
|
2901
|
-
return i._whenReady(
|
|
2902
|
-
}) : this._whenReady(
|
|
2907
|
+
return a ? a._promise(o, h, "lock") : G.trans ? Ge(G.transless, function() {
|
|
2908
|
+
return i._whenReady(h);
|
|
2909
|
+
}) : this._whenReady(h);
|
|
2903
2910
|
}, te.prototype.table = function(e) {
|
|
2904
|
-
if (!ne(this._allTables, e)) throw new
|
|
2911
|
+
if (!ne(this._allTables, e)) throw new $.InvalidTable("Table ".concat(e, " does not exist"));
|
|
2905
2912
|
return this._allTables[e];
|
|
2906
2913
|
}, te);
|
|
2907
2914
|
function te(e, t) {
|
|
@@ -2909,17 +2916,17 @@ var jr = { exports: {} };
|
|
|
2909
2916
|
this._middlewares = {}, this.verno = 0;
|
|
2910
2917
|
var i = te.dependencies;
|
|
2911
2918
|
this._options = t = l({ addons: te.addons, autoOpen: !0, indexedDB: i.indexedDB, IDBKeyRange: i.IDBKeyRange, cache: "cloned" }, t), this._deps = { indexedDB: t.indexedDB, IDBKeyRange: t.IDBKeyRange }, i = t.addons, this._dbSchema = {}, this._versions = [], this._storeNames = [], this._allTables = {}, this.idbdb = null, this._novip = this;
|
|
2912
|
-
var a, o, s, u,
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
}),
|
|
2916
|
-
|
|
2917
|
-
}), this._state =
|
|
2918
|
-
return function(
|
|
2919
|
+
var a, o, s, u, h, g = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: Q, dbReadyPromise: null, cancelOpen: Q, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: t.autoOpen };
|
|
2920
|
+
g.dbReadyPromise = new K(function(d) {
|
|
2921
|
+
g.dbReadyResolve = d;
|
|
2922
|
+
}), g.openCanceller = new K(function(d, w) {
|
|
2923
|
+
g.cancelOpen = w;
|
|
2924
|
+
}), this._state = g, this.name = e, this.on = dt(this, "populate", "blocked", "versionchange", "close", { ready: [rn, Q] }), this.on.ready.subscribe = Hn(this.on.ready.subscribe, function(d) {
|
|
2925
|
+
return function(w, p) {
|
|
2919
2926
|
te.vip(function() {
|
|
2920
|
-
var m,
|
|
2921
|
-
|
|
2922
|
-
m.on.ready.unsubscribe(
|
|
2927
|
+
var m, v = n._state;
|
|
2928
|
+
v.openComplete ? (v.dbOpenError || K.resolve().then(w), p && d(w)) : v.onReadyBeingFired ? (v.onReadyBeingFired.push(w), p && d(w)) : (d(w), m = n, p || d(function y() {
|
|
2929
|
+
m.on.ready.unsubscribe(w), m.on.ready.unsubscribe(y);
|
|
2923
2930
|
}));
|
|
2924
2931
|
});
|
|
2925
2932
|
};
|
|
@@ -2931,13 +2938,13 @@ var jr = { exports: {} };
|
|
|
2931
2938
|
} catch (E) {
|
|
2932
2939
|
m = E;
|
|
2933
2940
|
}
|
|
2934
|
-
var
|
|
2935
|
-
this._ctx = { table: y, index:
|
|
2936
|
-
})), this.Table = (o = this, ft(lr.prototype, function(d,
|
|
2937
|
-
this.db = o, this._tx = p, this.name = d, this.schema =
|
|
2938
|
-
})), this.Transaction = (s = this, ft(ci.prototype, function(d,
|
|
2941
|
+
var v = S._ctx, y = v.table, S = y.hook.reading.fire;
|
|
2942
|
+
this._ctx = { table: y, index: v.index, isPrimKey: !v.index || y.schema.primKey.keyPath && v.index === y.schema.primKey.name, range: p, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: m, or: v.or, valueMapper: S !== ot ? S : null };
|
|
2943
|
+
})), this.Table = (o = this, ft(lr.prototype, function(d, w, p) {
|
|
2944
|
+
this.db = o, this._tx = p, this.name = d, this.schema = w, this.hook = o._allTables[d] ? o._allTables[d].hook : dt(null, { creating: [Jr, Q], reading: [Xr, ot], updating: [Zr, Q], deleting: [Vr, Q] });
|
|
2945
|
+
})), this.Transaction = (s = this, ft(ci.prototype, function(d, w, p, m, v) {
|
|
2939
2946
|
var y = this;
|
|
2940
|
-
this.db = s, this.mode = d, this.storeNames =
|
|
2947
|
+
this.db = s, this.mode = d, this.storeNames = w, this.schema = p, this.chromeTransactionDurability = m, this.idbtrans = null, this.on = dt(this, "complete", "error", "abort"), this.parent = v || null, this.active = !0, this._reculock = 0, this._blockedFuncs = [], this._resolve = null, this._reject = null, this._waitingFor = null, this._waitingQueue = null, this._spinCount = 0, this._completion = new K(function(S, E) {
|
|
2941
2948
|
y._resolve = S, y._reject = E;
|
|
2942
2949
|
}), this._completion.then(function() {
|
|
2943
2950
|
y.active = !1, y.on.complete.fire();
|
|
@@ -2947,36 +2954,36 @@ var jr = { exports: {} };
|
|
|
2947
2954
|
});
|
|
2948
2955
|
})), this.Version = (u = this, ft(gi.prototype, function(d) {
|
|
2949
2956
|
this.db = u, this._cfg = { version: d, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
|
|
2950
|
-
})), this.WhereClause = (
|
|
2951
|
-
if (this.db =
|
|
2952
|
-
return H(
|
|
2953
|
-
}, this._max = function(m,
|
|
2954
|
-
return 0 < H(m,
|
|
2955
|
-
}, this._min = function(m,
|
|
2956
|
-
return H(m,
|
|
2957
|
-
}, this._IDBKeyRange =
|
|
2957
|
+
})), this.WhereClause = (h = this, ft(gr.prototype, function(d, w, p) {
|
|
2958
|
+
if (this.db = h, this._ctx = { table: d, index: w === ":id" ? null : w, or: p }, this._cmp = this._ascending = H, this._descending = function(m, v) {
|
|
2959
|
+
return H(v, m);
|
|
2960
|
+
}, this._max = function(m, v) {
|
|
2961
|
+
return 0 < H(m, v) ? m : v;
|
|
2962
|
+
}, this._min = function(m, v) {
|
|
2963
|
+
return H(m, v) < 0 ? m : v;
|
|
2964
|
+
}, this._IDBKeyRange = h._deps.IDBKeyRange, !this._IDBKeyRange) throw new $.MissingAPI();
|
|
2958
2965
|
})), this.on("versionchange", function(d) {
|
|
2959
2966
|
0 < d.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 });
|
|
2960
2967
|
}), this.on("blocked", function(d) {
|
|
2961
2968
|
!d.newVersion || d.newVersion < d.oldVersion ? console.warn("Dexie.delete('".concat(n.name, "') was blocked")) : console.warn("Upgrade '".concat(n.name, "' blocked by other connection holding version ").concat(d.oldVersion / 10));
|
|
2962
|
-
}), this._maxKey = yt(t.IDBKeyRange), this._createTransaction = function(d,
|
|
2963
|
-
return new n.Transaction(d,
|
|
2969
|
+
}), this._maxKey = yt(t.IDBKeyRange), this._createTransaction = function(d, w, p, m) {
|
|
2970
|
+
return new n.Transaction(d, w, p, n._options.chromeTransactionDurability, m);
|
|
2964
2971
|
}, this._fireOnBlocked = function(d) {
|
|
2965
|
-
n.on("blocked").fire(d),
|
|
2966
|
-
return
|
|
2967
|
-
}).map(function(
|
|
2968
|
-
return
|
|
2972
|
+
n.on("blocked").fire(d), qe.filter(function(w) {
|
|
2973
|
+
return w.name === n.name && w !== n && !w._state.vcFired;
|
|
2974
|
+
}).map(function(w) {
|
|
2975
|
+
return w.on("versionchange").fire(d);
|
|
2969
2976
|
});
|
|
2970
2977
|
}, this.use(vi), this.use(Ei), this.use(wi), this.use(mi), this.use(bi);
|
|
2971
|
-
var b = new Proxy(this, { get: function(d,
|
|
2972
|
-
if (
|
|
2973
|
-
if (
|
|
2974
|
-
return Qt(n.table(
|
|
2978
|
+
var b = new Proxy(this, { get: function(d, w, p) {
|
|
2979
|
+
if (w === "_vip") return !0;
|
|
2980
|
+
if (w === "table") return function(v) {
|
|
2981
|
+
return Qt(n.table(v), b);
|
|
2975
2982
|
};
|
|
2976
|
-
var m = Reflect.get(d,
|
|
2977
|
-
return m instanceof lr ? Qt(m, b) :
|
|
2978
|
-
return Qt(
|
|
2979
|
-
}) :
|
|
2983
|
+
var m = Reflect.get(d, w, p);
|
|
2984
|
+
return m instanceof lr ? Qt(m, b) : w === "tables" ? m.map(function(v) {
|
|
2985
|
+
return Qt(v, b);
|
|
2986
|
+
}) : w === "_createTransaction" ? function() {
|
|
2980
2987
|
return Qt(m.apply(this, arguments), b);
|
|
2981
2988
|
} : m;
|
|
2982
2989
|
} });
|
|
@@ -2984,9 +2991,9 @@ var jr = { exports: {} };
|
|
|
2984
2991
|
return d(n);
|
|
2985
2992
|
});
|
|
2986
2993
|
}
|
|
2987
|
-
var Xt,
|
|
2994
|
+
var Xt, pe = typeof Symbol < "u" && "observable" in Symbol ? Symbol.observable : "@@observable", Oi = (Nn.prototype.subscribe = function(e, t, n) {
|
|
2988
2995
|
return this._subscribe(e && typeof e != "function" ? e : { next: e, error: t, complete: n });
|
|
2989
|
-
}, Nn.prototype[
|
|
2996
|
+
}, Nn.prototype[pe] = function() {
|
|
2990
2997
|
return this;
|
|
2991
2998
|
}, Nn);
|
|
2992
2999
|
function Nn(e) {
|
|
@@ -2999,32 +3006,32 @@ var jr = { exports: {} };
|
|
|
2999
3006
|
}
|
|
3000
3007
|
function Ir(e) {
|
|
3001
3008
|
var t, n = !1, i = new Oi(function(a) {
|
|
3002
|
-
var o = tn(e), s, u = !1,
|
|
3009
|
+
var o = tn(e), s, u = !1, h = {}, g = {}, b = { get closed() {
|
|
3003
3010
|
return u;
|
|
3004
3011
|
}, unsubscribe: function() {
|
|
3005
3012
|
u || (u = !0, s && s.abort(), d && Re.storagemutated.unsubscribe(p));
|
|
3006
3013
|
} };
|
|
3007
3014
|
a.start && a.start(b);
|
|
3008
|
-
var d = !1,
|
|
3015
|
+
var d = !1, w = function() {
|
|
3009
3016
|
return fn(m);
|
|
3010
|
-
}, p = function(
|
|
3011
|
-
zt(
|
|
3017
|
+
}, p = function(v) {
|
|
3018
|
+
zt(h, v), Pn(g, h) && w();
|
|
3012
3019
|
}, m = function() {
|
|
3013
|
-
var
|
|
3014
|
-
!u && Xt.indexedDB && (
|
|
3015
|
-
var O =
|
|
3020
|
+
var v, y, S;
|
|
3021
|
+
!u && Xt.indexedDB && (h = {}, v = {}, s && s.abort(), s = new AbortController(), S = function(E) {
|
|
3022
|
+
var O = Je();
|
|
3016
3023
|
try {
|
|
3017
|
-
o &&
|
|
3024
|
+
o && Ze();
|
|
3018
3025
|
var x = De(e, E);
|
|
3019
3026
|
return x = o ? x.finally(Pe) : x;
|
|
3020
3027
|
} finally {
|
|
3021
3028
|
O && Ve();
|
|
3022
3029
|
}
|
|
3023
|
-
}(y = { subscr:
|
|
3024
|
-
n = !0, t = E, u || y.signal.aborted || (
|
|
3030
|
+
}(y = { subscr: v, signal: s.signal, requery: w, querier: e, trans: null }), Promise.resolve(S).then(function(E) {
|
|
3031
|
+
n = !0, t = E, u || y.signal.aborted || (h = {}, function(O) {
|
|
3025
3032
|
for (var x in O) if (ne(O, x)) return;
|
|
3026
3033
|
return 1;
|
|
3027
|
-
}(
|
|
3034
|
+
}(g = v) || d || (Re(gt, p), d = !0), fn(function() {
|
|
3028
3035
|
return !u && a.next && a.next(E);
|
|
3029
3036
|
}));
|
|
3030
3037
|
}, function(E) {
|
|
@@ -3033,7 +3040,7 @@ var jr = { exports: {} };
|
|
|
3033
3040
|
});
|
|
3034
3041
|
}));
|
|
3035
3042
|
};
|
|
3036
|
-
return setTimeout(
|
|
3043
|
+
return setTimeout(w, 0), b;
|
|
3037
3044
|
});
|
|
3038
3045
|
return i.hasValue = function() {
|
|
3039
3046
|
return n;
|
|
@@ -3041,7 +3048,7 @@ var jr = { exports: {} };
|
|
|
3041
3048
|
return t;
|
|
3042
3049
|
}, i;
|
|
3043
3050
|
}
|
|
3044
|
-
var
|
|
3051
|
+
var We = Ee;
|
|
3045
3052
|
function Bn(e) {
|
|
3046
3053
|
var t = Te;
|
|
3047
3054
|
try {
|
|
@@ -3050,17 +3057,17 @@ var jr = { exports: {} };
|
|
|
3050
3057
|
Te = t;
|
|
3051
3058
|
}
|
|
3052
3059
|
}
|
|
3053
|
-
xe(
|
|
3054
|
-
return new
|
|
3060
|
+
xe(We, l(l({}, Ot), { delete: function(e) {
|
|
3061
|
+
return new We(e, { addons: [] }).delete();
|
|
3055
3062
|
}, exists: function(e) {
|
|
3056
|
-
return new
|
|
3063
|
+
return new We(e, { addons: [] }).open().then(function(t) {
|
|
3057
3064
|
return t.close(), !0;
|
|
3058
3065
|
}).catch("NoSuchDatabaseError", function() {
|
|
3059
3066
|
return !1;
|
|
3060
3067
|
});
|
|
3061
3068
|
}, getDatabaseNames: function(e) {
|
|
3062
3069
|
try {
|
|
3063
|
-
return t =
|
|
3070
|
+
return t = We.dependencies, n = t.indexedDB, t = t.IDBKeyRange, (kn(n) ? Promise.resolve(n.databases()).then(function(i) {
|
|
3064
3071
|
return i.map(function(a) {
|
|
3065
3072
|
return a.name;
|
|
3066
3073
|
}).filter(function(a) {
|
|
@@ -3068,15 +3075,15 @@ var jr = { exports: {} };
|
|
|
3068
3075
|
});
|
|
3069
3076
|
}) : xn(n, t).toCollection().primaryKeys()).then(e);
|
|
3070
3077
|
} catch {
|
|
3071
|
-
return ee(new
|
|
3078
|
+
return ee(new $.MissingAPI());
|
|
3072
3079
|
}
|
|
3073
3080
|
var t, n;
|
|
3074
3081
|
}, defineClass: function() {
|
|
3075
3082
|
return function(e) {
|
|
3076
|
-
|
|
3083
|
+
J(this, e);
|
|
3077
3084
|
};
|
|
3078
3085
|
}, ignoreTransaction: function(e) {
|
|
3079
|
-
return
|
|
3086
|
+
return G.trans ? Ge(G.transless, e) : e();
|
|
3080
3087
|
}, vip: An, async: function(e) {
|
|
3081
3088
|
return function() {
|
|
3082
3089
|
try {
|
|
@@ -3094,43 +3101,43 @@ var jr = { exports: {} };
|
|
|
3094
3101
|
return ee(a);
|
|
3095
3102
|
}
|
|
3096
3103
|
}, currentTransaction: { get: function() {
|
|
3097
|
-
return
|
|
3104
|
+
return G.trans || null;
|
|
3098
3105
|
} }, waitFor: function(e, t) {
|
|
3099
|
-
return t = K.resolve(typeof e == "function" ?
|
|
3106
|
+
return t = K.resolve(typeof e == "function" ? We.ignoreTransaction(e) : e).timeout(t || 6e4), G.trans ? G.trans.waitFor(t) : t;
|
|
3100
3107
|
}, Promise: K, debug: { get: function() {
|
|
3101
3108
|
return ye;
|
|
3102
3109
|
}, set: function(e) {
|
|
3103
3110
|
qn(e);
|
|
3104
|
-
} }, derive:
|
|
3111
|
+
} }, derive: He, extend: J, props: xe, override: Hn, Events: dt, on: Re, liveQuery: Ir, extendObservabilitySet: zt, getByKeyPath: ve, setByKeyPath: de, delByKeyPath: function(e, t) {
|
|
3105
3112
|
typeof t == "string" ? de(e, t, void 0) : "length" in t && [].map.call(t, function(n) {
|
|
3106
3113
|
de(e, n, void 0);
|
|
3107
3114
|
});
|
|
3108
|
-
}, shallowClone: Qn, deepClone:
|
|
3115
|
+
}, shallowClone: Qn, deepClone: Me, getObjectDiff: Mn, cmp: H, asap: Yn, minKey: -1 / 0, addons: [], connections: qe, errnames: nn, dependencies: Xt, cache: Ue, semVer: "4.0.10", version: "4.0.10".split(".").map(function(e) {
|
|
3109
3116
|
return parseInt(e);
|
|
3110
3117
|
}).reduce(function(e, t, n) {
|
|
3111
3118
|
return e + t / Math.pow(10, 2 * n);
|
|
3112
|
-
}) })),
|
|
3119
|
+
}) })), We.maxKey = yt(We.dependencies.IDBKeyRange), typeof dispatchEvent < "u" && typeof addEventListener < "u" && (Re(gt, function(e) {
|
|
3113
3120
|
Te || (e = new CustomEvent(bn, { detail: e }), Te = !0, dispatchEvent(e), Te = !1);
|
|
3114
3121
|
}), addEventListener(bn, function(e) {
|
|
3115
3122
|
e = e.detail, Te || Bn(e);
|
|
3116
3123
|
}));
|
|
3117
|
-
var
|
|
3124
|
+
var nt, Te = !1, Cr = function() {
|
|
3118
3125
|
};
|
|
3119
3126
|
return typeof BroadcastChannel < "u" && ((Cr = function() {
|
|
3120
|
-
(
|
|
3127
|
+
(nt = new BroadcastChannel(bn)).onmessage = function(e) {
|
|
3121
3128
|
return e.data && Bn(e.data);
|
|
3122
3129
|
};
|
|
3123
|
-
})(), typeof
|
|
3124
|
-
Te ||
|
|
3130
|
+
})(), typeof nt.unref == "function" && nt.unref(), Re(gt, function(e) {
|
|
3131
|
+
Te || nt.postMessage(e);
|
|
3125
3132
|
})), typeof addEventListener < "u" && (addEventListener("pagehide", function(e) {
|
|
3126
3133
|
if (!Ee.disableBfCache && e.persisted) {
|
|
3127
|
-
ye && console.debug("Dexie: handling persisted pagehide"),
|
|
3128
|
-
for (var t = 0, n =
|
|
3134
|
+
ye && console.debug("Dexie: handling persisted pagehide"), nt != null && nt.close();
|
|
3135
|
+
for (var t = 0, n = qe; t < n.length; t++) n[t].close({ disableAutoOpen: !1 });
|
|
3129
3136
|
}
|
|
3130
3137
|
}), addEventListener("pageshow", function(e) {
|
|
3131
|
-
!Ee.disableBfCache && e.persisted && (ye && console.debug("Dexie: handling persisted pageshow"), Cr(), Bn({ all: new
|
|
3138
|
+
!Ee.disableBfCache && e.persisted && (ye && console.debug("Dexie: handling persisted pageshow"), Cr(), Bn({ all: new oe(-1 / 0, [[]]) }));
|
|
3132
3139
|
})), K.rejectionMapper = function(e, t) {
|
|
3133
|
-
return !e || e instanceof
|
|
3140
|
+
return !e || e instanceof Qe || e instanceof TypeError || e instanceof SyntaxError || !e.name || !Zn[e.name] ? e : (t = new Zn[e.name](t || e.message, e), "stack" in e && ke(t, "stack", { get: function() {
|
|
3134
3141
|
return this.inner.stack;
|
|
3135
3142
|
} }), t);
|
|
3136
3143
|
}, qn(ye), l(Ee, Object.freeze({ __proto__: null, Dexie: Ee, liveQuery: Ir, Entity: sr, cmp: H, PropModSymbol: Se, PropModification: ht, replacePrefix: function(e, t) {
|
|
@@ -3139,10 +3146,10 @@ var jr = { exports: {} };
|
|
|
3139
3146
|
return new ht({ add: e });
|
|
3140
3147
|
}, remove: function(e) {
|
|
3141
3148
|
return new ht({ remove: e });
|
|
3142
|
-
}, default: Ee, RangeSet:
|
|
3149
|
+
}, default: Ee, RangeSet: oe, mergeRanges: vt, rangesOverlap: wr }), { default: Ee }), Ee;
|
|
3143
3150
|
});
|
|
3144
|
-
})(
|
|
3145
|
-
var Ii =
|
|
3151
|
+
})(Mr);
|
|
3152
|
+
var Ii = Mr.exports;
|
|
3146
3153
|
const Fn = /* @__PURE__ */ Pi(Ii), Tr = Symbol.for("Dexie"), Un = globalThis[Tr] || (globalThis[Tr] = Fn);
|
|
3147
3154
|
if (Fn.semVer !== Un.semVer)
|
|
3148
3155
|
throw new Error(`Two different versions of Dexie loaded in the same app: ${Fn.semVer} and ${Un.semVer}`);
|
|
@@ -3150,7 +3157,7 @@ function X(f) {
|
|
|
3150
3157
|
let r = `${f.type}.${f.topics}`;
|
|
3151
3158
|
return f.order && (r += `.${f.order}`), f.period && (r += `.${f.period}`), r;
|
|
3152
3159
|
}
|
|
3153
|
-
function
|
|
3160
|
+
function rt(f) {
|
|
3154
3161
|
var r;
|
|
3155
3162
|
if (f.widget === void 0) {
|
|
3156
3163
|
const c = (r = f.topics) == null ? void 0 : r.split("-");
|
|
@@ -3159,11 +3166,11 @@ function nt(f) {
|
|
|
3159
3166
|
return f.topics === void 0 && (f.topics = `${f.dashboard}-${f.widget}`), f;
|
|
3160
3167
|
}
|
|
3161
3168
|
function _t(f, r) {
|
|
3162
|
-
var
|
|
3169
|
+
var L;
|
|
3163
3170
|
let c, l, A, k, N;
|
|
3164
3171
|
switch (f.moderation) {
|
|
3165
3172
|
case Zt.BEFORE:
|
|
3166
|
-
c = /* @__PURE__ */ new Date(), l = (
|
|
3173
|
+
c = /* @__PURE__ */ new Date(), l = (L = f.beforeTime) == null ? void 0 : L.split(":"), A = Number.parseInt(l ? l[0] : "00"), k = Number.parseInt(l ? l[1] : "00"), N = Number.parseInt(l ? l[2] : "00"), r.before = c.setHours(A, k, N, 0) / 1e3, r.period || (r.period = c.getDay() === 1 ? 72 : 24);
|
|
3167
3174
|
break;
|
|
3168
3175
|
case Zt.DELAYED:
|
|
3169
3176
|
f.delay && f.delay > 0 && (r.delay = `${f.delay}`);
|
|
@@ -3176,7 +3183,7 @@ function _t(f, r) {
|
|
|
3176
3183
|
}
|
|
3177
3184
|
return r;
|
|
3178
3185
|
}
|
|
3179
|
-
class
|
|
3186
|
+
class jr {
|
|
3180
3187
|
constructor(r) {
|
|
3181
3188
|
D(this, "db");
|
|
3182
3189
|
D(this, "subscribers", []);
|
|
@@ -3187,7 +3194,7 @@ class Mr {
|
|
|
3187
3194
|
* @returns IResponse
|
|
3188
3195
|
*/
|
|
3189
3196
|
D(this, "getCloud", async (r) => {
|
|
3190
|
-
const c = await this.db.table(
|
|
3197
|
+
const c = await this.db.table(j.CLOUD).where({ id: r.widget }).last().catch(() => {
|
|
3191
3198
|
console.warn(
|
|
3192
3199
|
"%capi%C %ccloud",
|
|
3193
3200
|
_.API,
|
|
@@ -3205,7 +3212,7 @@ class Mr {
|
|
|
3205
3212
|
* @returns IResponse
|
|
3206
3213
|
*/
|
|
3207
3214
|
D(this, "getSeries", async (r) => {
|
|
3208
|
-
const c = await this.db.table(
|
|
3215
|
+
const c = await this.db.table(j.SERIES).where({ id: r.widget }).last().catch(() => {
|
|
3209
3216
|
console.warn(
|
|
3210
3217
|
"%capi%c %cseries",
|
|
3211
3218
|
_.API,
|
|
@@ -3225,7 +3232,7 @@ class Mr {
|
|
|
3225
3232
|
D(this, "getMessages", async (r) => {
|
|
3226
3233
|
const c = (k) => k.widget_id === r.widget, l = (k) => k.utc > ((r == null ? void 0 : r.since) || 0), A = (k) => (k == null ? void 0 : k.visible) !== 0;
|
|
3227
3234
|
try {
|
|
3228
|
-
const k = await this.db.table(
|
|
3235
|
+
const k = await this.db.table(j.TOPICS).orderBy("utc").reverse().filter(c).filter(l).filter(A).limit((r == null ? void 0 : r.limit) ?? 25).toArray().catch(() => {
|
|
3229
3236
|
console.warn(
|
|
3230
3237
|
"%capi%c %cmessages",
|
|
3231
3238
|
_.API,
|
|
@@ -3237,10 +3244,10 @@ class Mr {
|
|
|
3237
3244
|
});
|
|
3238
3245
|
if (k.length === 0)
|
|
3239
3246
|
return { data: null, message: "No Messages error", success: !1 };
|
|
3240
|
-
const N = k[0] ? k[0].title : "No title",
|
|
3241
|
-
(
|
|
3242
|
-
), q = (await this.db.table(
|
|
3243
|
-
(
|
|
3247
|
+
const N = k[0] ? k[0].title : "No title", L = k.map(
|
|
3248
|
+
(le) => le.message_id
|
|
3249
|
+
), q = (await this.db.table(j.MESSAGES).where("id").anyOf(L).toArray().then((le) => le.sort((ne, xe) => xe.utc - ne.utc))).map(
|
|
3250
|
+
(le) => le.data
|
|
3244
3251
|
);
|
|
3245
3252
|
return {
|
|
3246
3253
|
data: {
|
|
@@ -3248,6 +3255,8 @@ class Mr {
|
|
|
3248
3255
|
slide: (r == null ? void 0 : r.slide) || "not set",
|
|
3249
3256
|
messages: q,
|
|
3250
3257
|
title: N,
|
|
3258
|
+
dashboard: r.dashboard,
|
|
3259
|
+
widget: r.widget,
|
|
3251
3260
|
topics: [r.dashboard, r.widget].join("-"),
|
|
3252
3261
|
query: r
|
|
3253
3262
|
},
|
|
@@ -3264,7 +3273,7 @@ class Mr {
|
|
|
3264
3273
|
* @param data
|
|
3265
3274
|
* @returns number
|
|
3266
3275
|
*/
|
|
3267
|
-
D(this, "setCloud", async (r, c) => r.type ===
|
|
3276
|
+
D(this, "setCloud", async (r, c) => r.type === j.CLOUD && c !== "" ? await this.db.table(j.CLOUD).put({
|
|
3268
3277
|
id: r.widget,
|
|
3269
3278
|
dashboard_id: r.dashboard,
|
|
3270
3279
|
data: c.data
|
|
@@ -3275,7 +3284,7 @@ class Mr {
|
|
|
3275
3284
|
* @param data
|
|
3276
3285
|
* @returns number
|
|
3277
3286
|
*/
|
|
3278
|
-
D(this, "setSeries", async (r, c) => r.type ===
|
|
3287
|
+
D(this, "setSeries", async (r, c) => r.type === j.SERIES && c !== "" ? await this.db.table(j.SERIES).put({
|
|
3279
3288
|
id: r.widget,
|
|
3280
3289
|
dashboard_id: r.dashboard,
|
|
3281
3290
|
data: c.data
|
|
@@ -3287,57 +3296,57 @@ class Mr {
|
|
|
3287
3296
|
* @returns number
|
|
3288
3297
|
*/
|
|
3289
3298
|
D(this, "setMessages", async (r, c) => {
|
|
3290
|
-
if (r.type !==
|
|
3299
|
+
if (r.type !== j.MESSAGES)
|
|
3291
3300
|
return 400;
|
|
3292
3301
|
const l = c.data.title;
|
|
3293
3302
|
let A = 0;
|
|
3294
3303
|
return c.data.messages.forEach(async (k) => {
|
|
3295
|
-
var N,
|
|
3296
|
-
k.id !== null && (await this.db.table(
|
|
3304
|
+
var N, L, J, q;
|
|
3305
|
+
k.id !== null && (await this.db.table(j.MESSAGES).put({
|
|
3297
3306
|
id: k.id,
|
|
3298
3307
|
utc: k.utc,
|
|
3299
3308
|
data: k,
|
|
3300
3309
|
expires: k.expires
|
|
3301
|
-
}).catch((
|
|
3310
|
+
}).catch((le) => {
|
|
3302
3311
|
A++, console.error(
|
|
3303
3312
|
"%cstorage",
|
|
3304
3313
|
_.STORAGE,
|
|
3305
3314
|
"set message",
|
|
3306
3315
|
`title: ${l}`,
|
|
3307
3316
|
k,
|
|
3308
|
-
|
|
3317
|
+
le.message
|
|
3309
3318
|
);
|
|
3310
|
-
}), await this.db.table(
|
|
3319
|
+
}), await this.db.table(j.TOPICS).put({
|
|
3320
|
+
title: l,
|
|
3311
3321
|
widget_id: r.widget,
|
|
3312
3322
|
message_id: k.id,
|
|
3313
3323
|
dashboard_id: r.dashboard,
|
|
3314
|
-
title: l,
|
|
3315
3324
|
engagement: (N = k.dynamics) == null ? void 0 : N.engagement,
|
|
3316
|
-
impressions: (
|
|
3317
|
-
reach: (
|
|
3325
|
+
impressions: (L = k.dynamics) == null ? void 0 : L.semrush_visits,
|
|
3326
|
+
reach: (J = k.dynamics) == null ? void 0 : J.potential_reach,
|
|
3318
3327
|
sentiment: ((q = k.topics[0]) == null ? void 0 : q.sentiment) || 0,
|
|
3319
3328
|
utc: k.utc,
|
|
3320
3329
|
expires: k.expires
|
|
3321
|
-
}).catch((
|
|
3330
|
+
}).catch((le) => {
|
|
3322
3331
|
A++, console.error(
|
|
3323
3332
|
"%cstorage",
|
|
3324
3333
|
_.STORAGE,
|
|
3325
3334
|
"set topic",
|
|
3326
3335
|
`title: ${l}`,
|
|
3327
3336
|
k,
|
|
3328
|
-
|
|
3337
|
+
le.message
|
|
3329
3338
|
);
|
|
3330
3339
|
}));
|
|
3331
3340
|
}), c.data.topics.forEach(async (k) => {
|
|
3332
|
-
const N = k.message_id,
|
|
3333
|
-
await this.db.table(
|
|
3341
|
+
const N = k.message_id, L = k.visible ? 1 : 0, J = k.title;
|
|
3342
|
+
await this.db.table(j.TOPICS).where("message_id").equals(N).modify({ visible: L }).catch((q) => {
|
|
3334
3343
|
A++, console.error(
|
|
3335
3344
|
"%cstorage",
|
|
3336
3345
|
_.STORAGE,
|
|
3337
3346
|
"update message visibility",
|
|
3338
|
-
`title: ${
|
|
3339
|
-
|
|
3340
|
-
|
|
3347
|
+
`title: ${J}`,
|
|
3348
|
+
`widget: ${k.widget_id}`,
|
|
3349
|
+
q.message
|
|
3341
3350
|
);
|
|
3342
3351
|
});
|
|
3343
3352
|
}), A === 0 ? 201 : 400;
|
|
@@ -3347,13 +3356,13 @@ class Mr {
|
|
|
3347
3356
|
*/
|
|
3348
3357
|
D(this, "cleanMessages", async () => {
|
|
3349
3358
|
const r = Date.now() / 1e3, c = (k) => k.expires < r, l = (k) => k.expires < r;
|
|
3350
|
-
return await this.db.table(
|
|
3359
|
+
return await this.db.table(j.TOPICS).orderBy("expires").filter(c).delete().catch((k) => (console.error(
|
|
3351
3360
|
"%cstorage%c %cclean",
|
|
3352
3361
|
_.STORAGE,
|
|
3353
3362
|
_.NONE,
|
|
3354
3363
|
_.MESSAGES,
|
|
3355
3364
|
k.message
|
|
3356
|
-
), 0)), await this.db.table(
|
|
3365
|
+
), 0)), await this.db.table(j.MESSAGES).orderBy("expires").filter(l).delete().catch((k) => (console.error(
|
|
3357
3366
|
"%cstorage%c %clean",
|
|
3358
3367
|
_.STORAGE,
|
|
3359
3368
|
_.NONE,
|
|
@@ -3362,7 +3371,7 @@ class Mr {
|
|
|
3362
3371
|
), 0));
|
|
3363
3372
|
});
|
|
3364
3373
|
D(this, "hideMessage", async (r, c) => {
|
|
3365
|
-
await this.db.table(
|
|
3374
|
+
await this.db.table(j.TOPICS).where("message_id").equals(r).modify({ visible: c ? 1 : 0 }).catch((l) => (console.error(
|
|
3366
3375
|
"%cstorage%c %chide",
|
|
3367
3376
|
_.STORAGE,
|
|
3368
3377
|
_.NONE,
|
|
@@ -3375,14 +3384,14 @@ class Mr {
|
|
|
3375
3384
|
* @param query IQuery
|
|
3376
3385
|
* @returns number
|
|
3377
3386
|
*/
|
|
3378
|
-
D(this, "setWidget", async (r) => await this.db.table(
|
|
3387
|
+
D(this, "setWidget", async (r) => await this.db.table(j.WIDGETS).put({
|
|
3379
3388
|
id: r.widget,
|
|
3380
3389
|
dashboard_id: r.dashboard,
|
|
3381
3390
|
type: r.type
|
|
3382
3391
|
}).then(() => 201).catch((c) => (console.error(
|
|
3383
3392
|
"%cstorage",
|
|
3384
3393
|
_.STORAGE,
|
|
3385
|
-
|
|
3394
|
+
j.WIDGET,
|
|
3386
3395
|
r,
|
|
3387
3396
|
c.message
|
|
3388
3397
|
), 400)));
|
|
@@ -3391,9 +3400,9 @@ class Mr {
|
|
|
3391
3400
|
* @param query IQuery
|
|
3392
3401
|
* @returns null
|
|
3393
3402
|
*/
|
|
3394
|
-
D(this, "subscribe", (r) => (r =
|
|
3403
|
+
D(this, "subscribe", (r) => (r = rt(r), this.subscribers.filter(
|
|
3395
3404
|
(l) => l.widget === r.widget
|
|
3396
|
-
).length > 0 || (r.type ===
|
|
3405
|
+
).length > 0 || (r.type === j.MESSAGES && (r = _t(this.options, r)), console.debug(
|
|
3397
3406
|
"%cstorage%c %csubscribe",
|
|
3398
3407
|
_.STORAGE,
|
|
3399
3408
|
_.NONE,
|
|
@@ -3412,7 +3421,7 @@ class Mr {
|
|
|
3412
3421
|
* @returns IResponse
|
|
3413
3422
|
*/
|
|
3414
3423
|
D(this, "loadSlide", async (r) => {
|
|
3415
|
-
const c = await this.db.table(
|
|
3424
|
+
const c = await this.db.table(j.SLIDE).where({ id: r.id }).last().catch(() => {
|
|
3416
3425
|
console.warn(
|
|
3417
3426
|
"%capi%c %cseries",
|
|
3418
3427
|
_.API,
|
|
@@ -3428,7 +3437,7 @@ class Mr {
|
|
|
3428
3437
|
* @param query IQuery
|
|
3429
3438
|
* @returns number
|
|
3430
3439
|
*/
|
|
3431
|
-
D(this, "storeSlide", async (r) => r.type ===
|
|
3440
|
+
D(this, "storeSlide", async (r) => r.type === j.SLIDE && r.data !== "" ? await this.db.table(j.SLIDE).put({
|
|
3432
3441
|
id: r.id,
|
|
3433
3442
|
title: r.data.title || "Not set",
|
|
3434
3443
|
json: r.data.json || {},
|
|
@@ -3471,7 +3480,7 @@ let Gn;
|
|
|
3471
3480
|
function Kr() {
|
|
3472
3481
|
return Gn || (Gn = Ci("keyval-store", "keyval")), Gn;
|
|
3473
3482
|
}
|
|
3474
|
-
function
|
|
3483
|
+
function Vt(f, r = Kr()) {
|
|
3475
3484
|
return r("readonly", (c) => Wn(c.get(f)));
|
|
3476
3485
|
}
|
|
3477
3486
|
function wt(f, r, c = Kr()) {
|
|
@@ -3483,15 +3492,15 @@ class Nr {
|
|
|
3483
3492
|
D(this, "options");
|
|
3484
3493
|
D(this, "getCloud", async (r) => {
|
|
3485
3494
|
const c = X(r);
|
|
3486
|
-
return await
|
|
3495
|
+
return await Vt(c).then((l) => l).catch(() => (console.warn("%capi", _.API, j.CLOUD, r.slide, r.widget), { data: null, message: "Cloud Data error", success: !1 }));
|
|
3487
3496
|
});
|
|
3488
3497
|
D(this, "getSeries", async (r) => {
|
|
3489
3498
|
const c = X(r);
|
|
3490
|
-
return await
|
|
3499
|
+
return await Vt(c).then((l) => l).catch(() => (console.warn("%capi", _.API, j.SERIES, r.slide, r.widget), { data: null, message: "Series Data error", success: !1 }));
|
|
3491
3500
|
});
|
|
3492
3501
|
D(this, "getMessages", async (r) => {
|
|
3493
3502
|
const c = X(r);
|
|
3494
|
-
return await
|
|
3503
|
+
return await Vt(c).then((l) => l).catch(() => (console.warn("%capi", _.API, j.MESSAGES, r.slide, r.widget), { data: null, message: "Messages Data error", success: !1 }));
|
|
3495
3504
|
});
|
|
3496
3505
|
/**
|
|
3497
3506
|
* Update Cloud
|
|
@@ -3503,7 +3512,7 @@ class Nr {
|
|
|
3503
3512
|
if (!c.success)
|
|
3504
3513
|
return 400;
|
|
3505
3514
|
const l = X(r);
|
|
3506
|
-
return delete c.success, delete c.message, await wt(l, c).then(() => 201).catch((A) => (console.error("%cstorage", _.STORAGE,
|
|
3515
|
+
return delete c.success, delete c.message, await wt(l, c).then(() => 201).catch((A) => (console.error("%cstorage", _.STORAGE, j.CLOUD, r, A.message), 400));
|
|
3507
3516
|
});
|
|
3508
3517
|
/**
|
|
3509
3518
|
* Update Series
|
|
@@ -3515,7 +3524,7 @@ class Nr {
|
|
|
3515
3524
|
if (!c.success)
|
|
3516
3525
|
return 400;
|
|
3517
3526
|
const l = X(r);
|
|
3518
|
-
return delete c.success, delete c.message, await wt(l, c).then(() => 201).catch((A) => (console.error("%cstorage", _.STORAGE,
|
|
3527
|
+
return delete c.success, delete c.message, await wt(l, c).then(() => 201).catch((A) => (console.error("%cstorage", _.STORAGE, j.SERIES, r, A.message), 400));
|
|
3519
3528
|
});
|
|
3520
3529
|
/**
|
|
3521
3530
|
* Update Messages
|
|
@@ -3527,7 +3536,7 @@ class Nr {
|
|
|
3527
3536
|
if (!c.success)
|
|
3528
3537
|
return 400;
|
|
3529
3538
|
const l = X(r);
|
|
3530
|
-
return delete c.success, delete c.message, await wt(l, c).then(() => 201).catch((A) => (console.error("%cstorage", _.STORAGE,
|
|
3539
|
+
return delete c.success, delete c.message, await wt(l, c).then(() => 201).catch((A) => (console.error("%cstorage", _.STORAGE, j.MESSAGES, r, A.message), 400));
|
|
3531
3540
|
});
|
|
3532
3541
|
D(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((c) => c(0))));
|
|
3533
3542
|
D(this, "hideMessage", async (r, c) => {
|
|
@@ -3546,14 +3555,14 @@ class Nr {
|
|
|
3546
3555
|
dashboard_id: r.dashboard,
|
|
3547
3556
|
type: r.type
|
|
3548
3557
|
};
|
|
3549
|
-
return await wt(c, l).then(() => 201).catch((A) => (console.error("%cstorage", _.STORAGE,
|
|
3558
|
+
return await wt(c, l).then(() => 201).catch((A) => (console.error("%cstorage", _.STORAGE, j.WIDGET, r, A.message), 400));
|
|
3550
3559
|
});
|
|
3551
3560
|
/**
|
|
3552
3561
|
* Add component subscriber
|
|
3553
3562
|
* @param query IQuery
|
|
3554
3563
|
* @returns null
|
|
3555
3564
|
*/
|
|
3556
|
-
D(this, "subscribe", (r) => (r =
|
|
3565
|
+
D(this, "subscribe", (r) => (r = rt(r), r.type === j.MESSAGES && (r = _t(this.options, r)), this.subscribers.filter(
|
|
3557
3566
|
(l) => l.widget === r.widget
|
|
3558
3567
|
).length > 0 || (console.debug(
|
|
3559
3568
|
"%cstorage%c %csubscribe",
|
|
@@ -3570,7 +3579,7 @@ class Nr {
|
|
|
3570
3579
|
D(this, "getSubscribers", async () => await new Promise((r) => r(this.subscribers)));
|
|
3571
3580
|
D(this, "loadSlide", async (r) => {
|
|
3572
3581
|
const c = X(r);
|
|
3573
|
-
return await
|
|
3582
|
+
return await Vt(c).then((l) => l).catch(() => (console.warn("%capi", _.API, j.SLIDE, r.slide), { data: null, message: "Slide Load error", success: !1 }));
|
|
3574
3583
|
});
|
|
3575
3584
|
/**
|
|
3576
3585
|
* Update Slide
|
|
@@ -3585,7 +3594,7 @@ class Nr {
|
|
|
3585
3594
|
html: r.data.html || "",
|
|
3586
3595
|
css: r.data.css || ""
|
|
3587
3596
|
};
|
|
3588
|
-
return await wt(c, l).then(() => 201).catch((A) => (console.error("%cstorage", _.STORAGE,
|
|
3597
|
+
return await wt(c, l).then(() => 201).catch((A) => (console.error("%cstorage", _.STORAGE, j.SLIDE, r, A.message), 400));
|
|
3589
3598
|
});
|
|
3590
3599
|
this.options = r;
|
|
3591
3600
|
}
|
|
@@ -3599,7 +3608,7 @@ class Br {
|
|
|
3599
3608
|
try {
|
|
3600
3609
|
return localStorage.getObject(c);
|
|
3601
3610
|
} catch (l) {
|
|
3602
|
-
return console.warn("%capi", _.API,
|
|
3611
|
+
return console.warn("%capi", _.API, j.CLOUD, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3603
3612
|
}
|
|
3604
3613
|
});
|
|
3605
3614
|
D(this, "getSeries", async (r) => {
|
|
@@ -3607,7 +3616,7 @@ class Br {
|
|
|
3607
3616
|
try {
|
|
3608
3617
|
return localStorage.getObject(c);
|
|
3609
3618
|
} catch (l) {
|
|
3610
|
-
return console.warn("%capi", _.API,
|
|
3619
|
+
return console.warn("%capi", _.API, j.SERIES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3611
3620
|
}
|
|
3612
3621
|
});
|
|
3613
3622
|
D(this, "getMessages", async (r) => {
|
|
@@ -3615,7 +3624,7 @@ class Br {
|
|
|
3615
3624
|
try {
|
|
3616
3625
|
return localStorage.getObject(c);
|
|
3617
3626
|
} catch (l) {
|
|
3618
|
-
return console.warn("%capi", _.API,
|
|
3627
|
+
return console.warn("%capi", _.API, j.MESSAGES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3619
3628
|
}
|
|
3620
3629
|
});
|
|
3621
3630
|
/**
|
|
@@ -3629,7 +3638,7 @@ class Br {
|
|
|
3629
3638
|
try {
|
|
3630
3639
|
return localStorage.setObject(l, c), 201;
|
|
3631
3640
|
} catch (A) {
|
|
3632
|
-
return console.error("%cstorage", _.STORAGE,
|
|
3641
|
+
return console.error("%cstorage", _.STORAGE, j.CLOUD, r, A), 400;
|
|
3633
3642
|
}
|
|
3634
3643
|
});
|
|
3635
3644
|
/**
|
|
@@ -3643,7 +3652,7 @@ class Br {
|
|
|
3643
3652
|
try {
|
|
3644
3653
|
return localStorage.setObject(l, c), 201;
|
|
3645
3654
|
} catch (A) {
|
|
3646
|
-
return console.error("%cstorage", _.STORAGE,
|
|
3655
|
+
return console.error("%cstorage", _.STORAGE, j.SERIES, r, A), 400;
|
|
3647
3656
|
}
|
|
3648
3657
|
});
|
|
3649
3658
|
/**
|
|
@@ -3657,7 +3666,7 @@ class Br {
|
|
|
3657
3666
|
try {
|
|
3658
3667
|
return localStorage.setObject(l, c), 200;
|
|
3659
3668
|
} catch (A) {
|
|
3660
|
-
return console.error("%cstorage", _.STORAGE,
|
|
3669
|
+
return console.error("%cstorage", _.STORAGE, j.MESSAGES, r, A), 400;
|
|
3661
3670
|
}
|
|
3662
3671
|
});
|
|
3663
3672
|
D(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((c) => c(0))));
|
|
@@ -3669,7 +3678,7 @@ class Br {
|
|
|
3669
3678
|
try {
|
|
3670
3679
|
return localStorage.setObject(c, r), 201;
|
|
3671
3680
|
} catch (l) {
|
|
3672
|
-
return console.error("%cstorage", _.STORAGE,
|
|
3681
|
+
return console.error("%cstorage", _.STORAGE, j.WIDGET, r, l), 400;
|
|
3673
3682
|
}
|
|
3674
3683
|
});
|
|
3675
3684
|
/**
|
|
@@ -3677,7 +3686,7 @@ class Br {
|
|
|
3677
3686
|
* @param query IQuery
|
|
3678
3687
|
* @returns null
|
|
3679
3688
|
*/
|
|
3680
|
-
D(this, "subscribe", (r) => (r =
|
|
3689
|
+
D(this, "subscribe", (r) => (r = rt(r), r.type === j.MESSAGES && (r = _t(this.options, r)), this.subscribers.filter(
|
|
3681
3690
|
(l) => l.widget === r.widget
|
|
3682
3691
|
).length || (console.debug(
|
|
3683
3692
|
"%cstorage%c %csubscribe",
|
|
@@ -3696,7 +3705,7 @@ class Br {
|
|
|
3696
3705
|
try {
|
|
3697
3706
|
return localStorage.getObject(`${r.type}.${r.id}`);
|
|
3698
3707
|
} catch (c) {
|
|
3699
|
-
return console.warn("%capi", _.API,
|
|
3708
|
+
return console.warn("%capi", _.API, j.SLIDE, r.id, c), { data: null, message: "Slide Load error", success: !1 };
|
|
3700
3709
|
}
|
|
3701
3710
|
});
|
|
3702
3711
|
D(this, "storeSlide", async (r) => {
|
|
@@ -3709,7 +3718,7 @@ class Br {
|
|
|
3709
3718
|
css: r.data.css || ""
|
|
3710
3719
|
}), 201;
|
|
3711
3720
|
} catch (c) {
|
|
3712
|
-
return console.error("%cstorage", _.STORAGE,
|
|
3721
|
+
return console.error("%cstorage", _.STORAGE, j.SLIDE, r, c), 400;
|
|
3713
3722
|
}
|
|
3714
3723
|
});
|
|
3715
3724
|
this.options = r, Storage.prototype.setObject = function(c, l) {
|
|
@@ -3729,7 +3738,7 @@ class Lr {
|
|
|
3729
3738
|
try {
|
|
3730
3739
|
return sessionStorage.getObject(c);
|
|
3731
3740
|
} catch (l) {
|
|
3732
|
-
return console.warn("%capi", _.API,
|
|
3741
|
+
return console.warn("%capi", _.API, j.CLOUD, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3733
3742
|
}
|
|
3734
3743
|
});
|
|
3735
3744
|
D(this, "getSeries", async (r) => {
|
|
@@ -3737,7 +3746,7 @@ class Lr {
|
|
|
3737
3746
|
try {
|
|
3738
3747
|
return sessionStorage.getObject(c);
|
|
3739
3748
|
} catch (l) {
|
|
3740
|
-
return console.warn("%capi", _.API,
|
|
3749
|
+
return console.warn("%capi", _.API, j.SERIES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3741
3750
|
}
|
|
3742
3751
|
});
|
|
3743
3752
|
D(this, "getMessages", async (r) => {
|
|
@@ -3745,7 +3754,7 @@ class Lr {
|
|
|
3745
3754
|
try {
|
|
3746
3755
|
return sessionStorage.getObject(c);
|
|
3747
3756
|
} catch (l) {
|
|
3748
|
-
return console.warn("%capi", _.API,
|
|
3757
|
+
return console.warn("%capi", _.API, j.MESSAGES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3749
3758
|
}
|
|
3750
3759
|
});
|
|
3751
3760
|
/**
|
|
@@ -3759,7 +3768,7 @@ class Lr {
|
|
|
3759
3768
|
try {
|
|
3760
3769
|
return sessionStorage.setObject(l, c), 201;
|
|
3761
3770
|
} catch (A) {
|
|
3762
|
-
return console.error("%cstorage", _.STORAGE,
|
|
3771
|
+
return console.error("%cstorage", _.STORAGE, j.CLOUD, r, A), 400;
|
|
3763
3772
|
}
|
|
3764
3773
|
});
|
|
3765
3774
|
/**
|
|
@@ -3773,7 +3782,7 @@ class Lr {
|
|
|
3773
3782
|
try {
|
|
3774
3783
|
return sessionStorage.setObject(l, c), 201;
|
|
3775
3784
|
} catch (A) {
|
|
3776
|
-
return console.error("%cstorage", _.STORAGE,
|
|
3785
|
+
return console.error("%cstorage", _.STORAGE, j.SERIES, r, A), 400;
|
|
3777
3786
|
}
|
|
3778
3787
|
});
|
|
3779
3788
|
/**
|
|
@@ -3787,7 +3796,7 @@ class Lr {
|
|
|
3787
3796
|
try {
|
|
3788
3797
|
return sessionStorage.setObject(l, c), 200;
|
|
3789
3798
|
} catch (A) {
|
|
3790
|
-
return console.error("%cstorage", _.STORAGE,
|
|
3799
|
+
return console.error("%cstorage", _.STORAGE, j.MESSAGES, r, A), 400;
|
|
3791
3800
|
}
|
|
3792
3801
|
});
|
|
3793
3802
|
D(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((c) => c(0))));
|
|
@@ -3799,7 +3808,7 @@ class Lr {
|
|
|
3799
3808
|
try {
|
|
3800
3809
|
return sessionStorage.setObject(c, r), 201;
|
|
3801
3810
|
} catch (l) {
|
|
3802
|
-
return console.error("%cstorage", _.STORAGE,
|
|
3811
|
+
return console.error("%cstorage", _.STORAGE, j.WIDGET, r, l), 400;
|
|
3803
3812
|
}
|
|
3804
3813
|
});
|
|
3805
3814
|
/**
|
|
@@ -3807,7 +3816,7 @@ class Lr {
|
|
|
3807
3816
|
* @param query IQuery
|
|
3808
3817
|
* @returns null
|
|
3809
3818
|
*/
|
|
3810
|
-
D(this, "subscribe", (r) => (r =
|
|
3819
|
+
D(this, "subscribe", (r) => (r = rt(r), r.type === j.MESSAGES && (r = _t(this.options, r)), this.subscribers.filter(
|
|
3811
3820
|
(l) => l.widget === r.widget
|
|
3812
3821
|
).length || (console.debug(
|
|
3813
3822
|
"%cstorage%c %csubscribe",
|
|
@@ -3826,7 +3835,7 @@ class Lr {
|
|
|
3826
3835
|
try {
|
|
3827
3836
|
return sessionStorage.getObject(`${r.type}.${r.id}`);
|
|
3828
3837
|
} catch (c) {
|
|
3829
|
-
return console.warn("%capi", _.API,
|
|
3838
|
+
return console.warn("%capi", _.API, j.SLIDE, r.id, c), { data: null, message: "Store Load error", success: !1 };
|
|
3830
3839
|
}
|
|
3831
3840
|
});
|
|
3832
3841
|
/**
|
|
@@ -3844,7 +3853,7 @@ class Lr {
|
|
|
3844
3853
|
css: r.data.css || ""
|
|
3845
3854
|
}), 200;
|
|
3846
3855
|
} catch (c) {
|
|
3847
|
-
return console.error("%cstorage", _.STORAGE,
|
|
3856
|
+
return console.error("%cstorage", _.STORAGE, j.SLIDE, r, c), 400;
|
|
3848
3857
|
}
|
|
3849
3858
|
});
|
|
3850
3859
|
this.options = r, Storage.prototype.setObject = function(c, l) {
|
|
@@ -3864,7 +3873,7 @@ class Gr {
|
|
|
3864
3873
|
try {
|
|
3865
3874
|
return window.BuzzCasting.WidgetData[c];
|
|
3866
3875
|
} catch (l) {
|
|
3867
|
-
return console.warn("%capi", _.API,
|
|
3876
|
+
return console.warn("%capi", _.API, j.CLOUD, r.slide, r.widget, l), { data: null, message: "Cloud Data error", success: !1 };
|
|
3868
3877
|
}
|
|
3869
3878
|
});
|
|
3870
3879
|
D(this, "getSeries", async (r) => {
|
|
@@ -3872,7 +3881,7 @@ class Gr {
|
|
|
3872
3881
|
try {
|
|
3873
3882
|
return window.BuzzCasting.WidgetData[c];
|
|
3874
3883
|
} catch (l) {
|
|
3875
|
-
return console.warn("%capi", _.API,
|
|
3884
|
+
return console.warn("%capi", _.API, j.SERIES, r.slide, r.widget, l), { data: null, message: "Series Data error", success: !1 };
|
|
3876
3885
|
}
|
|
3877
3886
|
});
|
|
3878
3887
|
D(this, "getMessages", async (r) => {
|
|
@@ -3880,7 +3889,7 @@ class Gr {
|
|
|
3880
3889
|
try {
|
|
3881
3890
|
return window.BuzzCasting.WidgetData[c];
|
|
3882
3891
|
} catch (l) {
|
|
3883
|
-
return console.warn("%capi", _.API,
|
|
3892
|
+
return console.warn("%capi", _.API, j.MESSAGES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3884
3893
|
}
|
|
3885
3894
|
});
|
|
3886
3895
|
/**
|
|
@@ -3934,7 +3943,7 @@ class Gr {
|
|
|
3934
3943
|
try {
|
|
3935
3944
|
return window.BuzzCasting.WidgetData[c] = r, 201;
|
|
3936
3945
|
} catch (l) {
|
|
3937
|
-
return console.error("%cstorage", _.STORAGE,
|
|
3946
|
+
return console.error("%cstorage", _.STORAGE, j.WIDGET, r, l), 400;
|
|
3938
3947
|
}
|
|
3939
3948
|
});
|
|
3940
3949
|
/**
|
|
@@ -3942,7 +3951,7 @@ class Gr {
|
|
|
3942
3951
|
* @param query IQuery
|
|
3943
3952
|
* @returns null
|
|
3944
3953
|
*/
|
|
3945
|
-
D(this, "subscribe", (r) => (r =
|
|
3954
|
+
D(this, "subscribe", (r) => (r = rt(r), r.type === j.MESSAGES && (r = _t(this.options, r)), this.subscribers.filter(
|
|
3946
3955
|
(l) => l.widget === r.widget
|
|
3947
3956
|
).length || (console.debug(
|
|
3948
3957
|
"%cstorage%c %csubscribe",
|
|
@@ -3961,7 +3970,7 @@ class Gr {
|
|
|
3961
3970
|
try {
|
|
3962
3971
|
return window.BuzzCasting.SlideData[r.id];
|
|
3963
3972
|
} catch (c) {
|
|
3964
|
-
return console.warn("%capi", _.API,
|
|
3973
|
+
return console.warn("%capi", _.API, j.SLIDE, r.id, c), { data: null, message: "Slide Load error", success: !1 };
|
|
3965
3974
|
}
|
|
3966
3975
|
});
|
|
3967
3976
|
D(this, "storeSlide", async (r) => {
|
|
@@ -3974,7 +3983,7 @@ class Gr {
|
|
|
3974
3983
|
css: r.data.css || ""
|
|
3975
3984
|
}, 201;
|
|
3976
3985
|
} catch (c) {
|
|
3977
|
-
return console.error("%cstorage", _.STORAGE,
|
|
3986
|
+
return console.error("%cstorage", _.STORAGE, j.SLIDE, r, c), 400;
|
|
3978
3987
|
}
|
|
3979
3988
|
});
|
|
3980
3989
|
this.options = r, window.BuzzCasting.WidgetData = /* @__PURE__ */ new Set();
|
|
@@ -4072,7 +4081,7 @@ function zi(f, r = "font-bold") {
|
|
|
4072
4081
|
return `${(f == null ? void 0 : f.title.length) > 0 ? `<div class="${r}">${f.title}</div>` : ""}${f != null && f.content ? f.content.replace(/\n\n/g, `
|
|
4073
4082
|
`).replace(/\n/g, "<br/>") : ""}`;
|
|
4074
4083
|
}
|
|
4075
|
-
function
|
|
4084
|
+
function Mi(f, r) {
|
|
4076
4085
|
for (; f.length < r; )
|
|
4077
4086
|
f = `0${f}`;
|
|
4078
4087
|
return f;
|
|
@@ -4085,7 +4094,7 @@ function Oe(f, r) {
|
|
|
4085
4094
|
l = r.charCodeAt(c), f = (f << 5) - f + l, f |= 0;
|
|
4086
4095
|
return f < 0 ? f * -2 : f;
|
|
4087
4096
|
}
|
|
4088
|
-
function
|
|
4097
|
+
function ji(f, r, c) {
|
|
4089
4098
|
return Object.keys(r).sort().reduce(l, f);
|
|
4090
4099
|
function l(A, k) {
|
|
4091
4100
|
return $r(A, r[k], k, c);
|
|
@@ -4101,7 +4110,7 @@ function $r(f, r, c, l) {
|
|
|
4101
4110
|
if (l.includes(r))
|
|
4102
4111
|
return Oe(A, `[Circular]${c}`);
|
|
4103
4112
|
l.push(r);
|
|
4104
|
-
const k =
|
|
4113
|
+
const k = ji(A, r, l);
|
|
4105
4114
|
if (!("valueOf" in r) || typeof r.valueOf != "function")
|
|
4106
4115
|
return k;
|
|
4107
4116
|
try {
|
|
@@ -4116,7 +4125,7 @@ function Ki(f) {
|
|
|
4116
4125
|
return Object.prototype.toString.call(f);
|
|
4117
4126
|
}
|
|
4118
4127
|
function $n(f) {
|
|
4119
|
-
return
|
|
4128
|
+
return Mi($r(0, f, "", []).toString(16), 8);
|
|
4120
4129
|
}
|
|
4121
4130
|
function Hi(f, r) {
|
|
4122
4131
|
if (f = f.toString().replace(/[^0-9.]/g, ""), f < 1e3)
|
|
@@ -4164,12 +4173,12 @@ function Xi(f) {
|
|
|
4164
4173
|
return f.forEach((r) => {
|
|
4165
4174
|
var c, l, A, k, N;
|
|
4166
4175
|
if (r.content = ((c = r.content) == null ? void 0 : c.replace(/(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)((\?.*)?)/g, "")) || "", r.sender !== null ? ((((l = r.sender) == null ? void 0 : l.title) === "Unknown author" || ((A = r.sender) == null ? void 0 : A.title) === null) && (r.sender.title = ""), ((k = r.sender) == null ? void 0 : k.name) !== "" && r.sender.title === "" && (r.sender.title = r.sender.name), ((N = r.sender) == null ? void 0 : N.name) !== "" && r.channel === "tw" && (r.sender.name = `@${r.sender.name}`)) : r.sender = { title: "", name: "", id: "", avatar: "default", bio: "", location: "", following: 0, verified: 0, listed: 0, followers: 0, favourites: 0, messages: 0, influence: 0 }, r.sender.title === "" && r.link !== "") {
|
|
4167
|
-
const
|
|
4168
|
-
r.sender.title =
|
|
4176
|
+
const L = new URL(r.link);
|
|
4177
|
+
r.sender.title = L.hostname.replace("www.", "");
|
|
4169
4178
|
}
|
|
4170
4179
|
}), f;
|
|
4171
4180
|
}
|
|
4172
|
-
function
|
|
4181
|
+
function Ji(f) {
|
|
4173
4182
|
const r = [...f];
|
|
4174
4183
|
for (let c = r.length - 1; c > 0; c--) {
|
|
4175
4184
|
const l = Math.floor(Math.random() * (c + 1));
|
|
@@ -4177,7 +4186,7 @@ function Vi(f) {
|
|
|
4177
4186
|
}
|
|
4178
4187
|
return r;
|
|
4179
4188
|
}
|
|
4180
|
-
class
|
|
4189
|
+
class Vi {
|
|
4181
4190
|
constructor(r) {
|
|
4182
4191
|
D(this, "sm");
|
|
4183
4192
|
D(this, "api");
|
|
@@ -4196,49 +4205,49 @@ class Ji {
|
|
|
4196
4205
|
(A) => A.forEach(async (k) => {
|
|
4197
4206
|
let N = 400;
|
|
4198
4207
|
if (k.status === "fulfilled") {
|
|
4199
|
-
const
|
|
4208
|
+
const L = k.value;
|
|
4200
4209
|
if (this.sm === null)
|
|
4201
4210
|
return 400;
|
|
4202
|
-
if (
|
|
4203
|
-
const
|
|
4204
|
-
(ne) => ne.widget ===
|
|
4211
|
+
if (L.success === !0) {
|
|
4212
|
+
const J = this.sm.subscribers.filter(
|
|
4213
|
+
(ne) => ne.widget === L.query.widget
|
|
4205
4214
|
)[0];
|
|
4206
|
-
let q = "",
|
|
4207
|
-
switch (
|
|
4208
|
-
case
|
|
4209
|
-
if (
|
|
4215
|
+
let q = "", le;
|
|
4216
|
+
switch (L.query.type) {
|
|
4217
|
+
case j.MESSAGES:
|
|
4218
|
+
if (le = L.data.messages.filter((ne) => ne.id !== null), L.data.messages = le, q = $n(L.data.messages), J.hash === q)
|
|
4210
4219
|
return console.debug(
|
|
4211
4220
|
"%capi%c %cno updates",
|
|
4212
4221
|
_.API,
|
|
4213
4222
|
_.NONE,
|
|
4214
4223
|
_.NO_UPDATES,
|
|
4215
|
-
|
|
4216
|
-
|
|
4217
|
-
|
|
4224
|
+
j.MESSAGES,
|
|
4225
|
+
L.query.slide,
|
|
4226
|
+
L.query.widget
|
|
4218
4227
|
), 204;
|
|
4219
|
-
|
|
4228
|
+
J.hash = q, N = await this.sm.setMessages(L.query, L);
|
|
4220
4229
|
break;
|
|
4221
|
-
case
|
|
4222
|
-
q = $n(
|
|
4230
|
+
case j.CLOUD:
|
|
4231
|
+
q = $n(L.data), J.hash === q ? (console.debug(
|
|
4223
4232
|
"%capi%c %cno updates",
|
|
4224
4233
|
_.API,
|
|
4225
4234
|
_.NONE,
|
|
4226
4235
|
_.NO_UPDATES,
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
), N = 204) : (
|
|
4236
|
+
j.CLOUD,
|
|
4237
|
+
L.query.slide,
|
|
4238
|
+
L.query.widget
|
|
4239
|
+
), N = 204) : (J.hash = q, N = await this.sm.setCloud(L.query, L));
|
|
4231
4240
|
break;
|
|
4232
|
-
case
|
|
4233
|
-
q = $n(
|
|
4241
|
+
case j.SERIES:
|
|
4242
|
+
q = $n(L.data), J.hash === q ? (console.debug(
|
|
4234
4243
|
"%capi%c %cno updates",
|
|
4235
4244
|
_.API,
|
|
4236
4245
|
_.NONE,
|
|
4237
4246
|
_.NO_UPDATES,
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
), N = 204) : (
|
|
4247
|
+
j.SERIES,
|
|
4248
|
+
L.query.slide,
|
|
4249
|
+
L.query.widget
|
|
4250
|
+
), N = 204) : (J.hash = q, N = await this.sm.setSeries(L.query, L));
|
|
4242
4251
|
break;
|
|
4243
4252
|
default:
|
|
4244
4253
|
console.warn(
|
|
@@ -4247,7 +4256,7 @@ class Ji {
|
|
|
4247
4256
|
_.NONE,
|
|
4248
4257
|
_.STORAGE,
|
|
4249
4258
|
"error",
|
|
4250
|
-
`data type ${
|
|
4259
|
+
`data type ${L.query.type} unknown`
|
|
4251
4260
|
);
|
|
4252
4261
|
}
|
|
4253
4262
|
} else
|
|
@@ -4259,9 +4268,9 @@ class Ji {
|
|
|
4259
4268
|
_.API,
|
|
4260
4269
|
_.NONE,
|
|
4261
4270
|
_.BROADCAST,
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
), this.bc.postMessage({ event: re.WIDGET_UPDATE, data:
|
|
4271
|
+
L.query.slide,
|
|
4272
|
+
L.data.title ?? L.query.widget
|
|
4273
|
+
), this.bc.postMessage({ event: re.WIDGET_UPDATE, data: L });
|
|
4265
4274
|
break;
|
|
4266
4275
|
case 400:
|
|
4267
4276
|
console.warn(
|
|
@@ -4269,8 +4278,8 @@ class Ji {
|
|
|
4269
4278
|
_.API,
|
|
4270
4279
|
_.NONE,
|
|
4271
4280
|
_.BROADCAST,
|
|
4272
|
-
|
|
4273
|
-
|
|
4281
|
+
L.query.slide,
|
|
4282
|
+
L.data.title ?? L.query.widget
|
|
4274
4283
|
);
|
|
4275
4284
|
break;
|
|
4276
4285
|
}
|
|
@@ -4364,7 +4373,7 @@ class Ji {
|
|
|
4364
4373
|
this.actions(l);
|
|
4365
4374
|
}, this.bc.postMessage({ event: re.STORAGE_INIT, data: {} }), this.api = new Di(r), r.storage) {
|
|
4366
4375
|
case ge.DEXIE:
|
|
4367
|
-
this.sm = new
|
|
4376
|
+
this.sm = new jr(r);
|
|
4368
4377
|
break;
|
|
4369
4378
|
case ge.LOCAL:
|
|
4370
4379
|
this.sm = new Lr(r);
|
|
@@ -4391,7 +4400,7 @@ class Ni {
|
|
|
4391
4400
|
*/
|
|
4392
4401
|
D(this, "getCloud", async (r) => {
|
|
4393
4402
|
var c;
|
|
4394
|
-
return r.type !==
|
|
4403
|
+
return r.type !== j.CLOUD ? (console.warn(
|
|
4395
4404
|
"%capp%c %get",
|
|
4396
4405
|
_.APP,
|
|
4397
4406
|
_.NONE,
|
|
@@ -4412,7 +4421,7 @@ class Ni {
|
|
|
4412
4421
|
*/
|
|
4413
4422
|
D(this, "getMessages", async (r) => {
|
|
4414
4423
|
var c;
|
|
4415
|
-
return r.type !==
|
|
4424
|
+
return r.type !== j.MESSAGES ? (console.warn(
|
|
4416
4425
|
"%capp%c %get",
|
|
4417
4426
|
_.APP,
|
|
4418
4427
|
_.NONE,
|
|
@@ -4433,7 +4442,7 @@ class Ni {
|
|
|
4433
4442
|
*/
|
|
4434
4443
|
D(this, "getSeries", async (r) => {
|
|
4435
4444
|
var c;
|
|
4436
|
-
return r.type !==
|
|
4445
|
+
return r.type !== j.SERIES ? (console.warn(
|
|
4437
4446
|
"%capp%c %get",
|
|
4438
4447
|
_.APP,
|
|
4439
4448
|
_.NONE,
|
|
@@ -4449,7 +4458,7 @@ class Ni {
|
|
|
4449
4458
|
});
|
|
4450
4459
|
switch (this.sm = null, r.storage) {
|
|
4451
4460
|
case ge.DEXIE:
|
|
4452
|
-
this.sm = new
|
|
4461
|
+
this.sm = new jr(r);
|
|
4453
4462
|
break;
|
|
4454
4463
|
case ge.LOCAL:
|
|
4455
4464
|
this.sm = new Lr(r);
|
|
@@ -4487,11 +4496,11 @@ class Zi {
|
|
|
4487
4496
|
*/
|
|
4488
4497
|
D(this, "getData", async () => {
|
|
4489
4498
|
switch (this.query.type) {
|
|
4490
|
-
case
|
|
4499
|
+
case j.CLOUD:
|
|
4491
4500
|
return await this.getCloud();
|
|
4492
|
-
case
|
|
4501
|
+
case j.MESSAGES:
|
|
4493
4502
|
return await this.getMessages();
|
|
4494
|
-
case
|
|
4503
|
+
case j.SERIES:
|
|
4495
4504
|
return await this.getSeries();
|
|
4496
4505
|
}
|
|
4497
4506
|
return {
|
|
@@ -4505,7 +4514,7 @@ class Zi {
|
|
|
4505
4514
|
*
|
|
4506
4515
|
* @returns IResponse
|
|
4507
4516
|
*/
|
|
4508
|
-
D(this, "getCloud", async () => this.query.type !==
|
|
4517
|
+
D(this, "getCloud", async () => this.query.type !== j.CLOUD ? (console.warn(
|
|
4509
4518
|
"%cstorage%c %cwidget",
|
|
4510
4519
|
_.STORAGE,
|
|
4511
4520
|
_.NONE,
|
|
@@ -4523,7 +4532,7 @@ class Zi {
|
|
|
4523
4532
|
*
|
|
4524
4533
|
* @returns IResponse
|
|
4525
4534
|
*/
|
|
4526
|
-
D(this, "getMessages", async () => this.query.type !==
|
|
4535
|
+
D(this, "getMessages", async () => this.query.type !== j.MESSAGES ? (console.warn(
|
|
4527
4536
|
"%cstorage%c %cwidget",
|
|
4528
4537
|
_.STORAGE,
|
|
4529
4538
|
_.NONE,
|
|
@@ -4541,7 +4550,7 @@ class Zi {
|
|
|
4541
4550
|
*
|
|
4542
4551
|
* @returns IResponse
|
|
4543
4552
|
*/
|
|
4544
|
-
D(this, "getSeries", async () => this.query.type !==
|
|
4553
|
+
D(this, "getSeries", async () => this.query.type !== j.SERIES ? (console.warn(
|
|
4545
4554
|
"%cstorage%c %cwidget",
|
|
4546
4555
|
_.STORAGE,
|
|
4547
4556
|
_.NONE,
|
|
@@ -4590,7 +4599,7 @@ class Zi {
|
|
|
4590
4599
|
var N;
|
|
4591
4600
|
this.element = r, this.listeners = c, l = typeof l < "u" ? l : "buzzcasting-slide";
|
|
4592
4601
|
let A;
|
|
4593
|
-
A = { ...r.dataset }, delete A.hmr, A.slide = ((N = r.closest(l.toUpperCase())) == null ? void 0 : N.id) ?? `${l} not found`, A =
|
|
4602
|
+
A = { ...r.dataset }, delete A.hmr, A.slide = ((N = r.closest(l.toUpperCase())) == null ? void 0 : N.id) ?? `${l} not found`, A = rt(A), this.query = A, Ti(r);
|
|
4594
4603
|
const k = window.BuzzCasting.getOptions();
|
|
4595
4604
|
this.storageReader = new Ni(k), this.broadcastChannel = new BroadcastChannel(A.slide), this.startListener();
|
|
4596
4605
|
}
|
|
@@ -4638,8 +4647,8 @@ class Zi {
|
|
|
4638
4647
|
}
|
|
4639
4648
|
}
|
|
4640
4649
|
export {
|
|
4641
|
-
|
|
4642
|
-
|
|
4650
|
+
j as API,
|
|
4651
|
+
Vi as BuzzcastingStorageManager,
|
|
4643
4652
|
Ni as BuzzcastingStorageReader,
|
|
4644
4653
|
_ as CSS,
|
|
4645
4654
|
re as EVENTS,
|
|
@@ -4659,6 +4668,6 @@ export {
|
|
|
4659
4668
|
Yi as numberFormatter,
|
|
4660
4669
|
Qi as rtl,
|
|
4661
4670
|
Xi as sanitize,
|
|
4662
|
-
|
|
4663
|
-
|
|
4671
|
+
Ji as shuffleMessages,
|
|
4672
|
+
rt as widgetParams
|
|
4664
4673
|
};
|