buzzcasting-storage 2.15.2 → 2.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/buzzcasting-storage.esm.js +955 -957
- package/package.json +14 -13
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var A = (
|
|
4
|
-
var K = /* @__PURE__ */ ((
|
|
5
|
-
const
|
|
6
|
-
class
|
|
1
|
+
var xi = Object.defineProperty;
|
|
2
|
+
var ki = (f, r, c) => r in f ? xi(f, r, { enumerable: !0, configurable: !0, writable: !0, value: c }) : f[r] = c;
|
|
3
|
+
var A = (f, r, c) => ki(f, typeof r != "symbol" ? r + "" : r, c);
|
|
4
|
+
var K = /* @__PURE__ */ ((f) => (f.MESSAGES = "messages", f.CLOUD = "cloud", f.SERIES = "series", f.TOPICS = "topics", f.WIDGET = "widget", f.WIDGETS = "widgets", f.SLIDE = "slide", f))(K || {}), _ = /* @__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.ERROR = "error", f.HIDE_MESSAGE = "hideMessage", f.HIDE_LABELS = "hideLabels", f.PAUSE_PRESENTATION = "pausePresentation", f.PRESENTATION_READY = "presentationReady", f.PREV_SLIDE = "prevSlide", f.RELOAD_PRESENTATION = "reloadPresentation", f.SHOW_MODAL = "showModal", f.STAR_MESSAGE = "starMessage", f.GOTO_SLIDE = "gotoSlide", f.NEXT_SLIDE = "nextSlide", f.SLIDE_DID_LOAD = "slideDidLoad", f.SLIDE_GOTO = "slideGoto", f.SLIDE_READY = "slideReady", f.SLIDE_LOAD = "loadSlide", f.SLIDE_STORE = "storeSlide", f.SLIDE_TRANSITIONER = "slideTransitioner", f.START_TRANSITIONER = "startTransitioner", f.STORAGE_INIT = "storageInit", f.SUBSCRIBE = "subscribe", f.REMOVE_CLOUD = "removeCloud", f.UPDATE = "update", f.VERSION = "version", f.WIDGET_UPDATE = "widgetUpdate", f))(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.0";
|
|
6
|
+
class Di {
|
|
7
7
|
constructor(r) {
|
|
8
8
|
A(this, "options");
|
|
9
9
|
A(this, "url");
|
|
@@ -44,11 +44,11 @@ class Da {
|
|
|
44
44
|
), await fetch(
|
|
45
45
|
[this.url, "api", c, r.type].join("/") + D,
|
|
46
46
|
{ ...l, method: "get" }
|
|
47
|
-
).then(async (
|
|
48
|
-
if (!
|
|
49
|
-
throw new Error(`${
|
|
50
|
-
return
|
|
51
|
-
}).then((
|
|
47
|
+
).then(async (R) => {
|
|
48
|
+
if (!R.ok)
|
|
49
|
+
throw new Error(`${R.status}`);
|
|
50
|
+
return R;
|
|
51
|
+
}).then((R) => R.json()).then((R) => (R.query = r, R)).catch((R) => ({ success: !1, message: `${R}`, data: null }));
|
|
52
52
|
}
|
|
53
53
|
async hideMessage(r) {
|
|
54
54
|
const { version: c } = this.options, l = this.headers(), k = "?action=visible";
|
|
@@ -71,8 +71,8 @@ class Da {
|
|
|
71
71
|
}
|
|
72
72
|
async hideLabels(r) {
|
|
73
73
|
const { version: c } = this.options, l = this.formHeaders(), k = new URLSearchParams(), D = r.labels || [];
|
|
74
|
-
for (const [
|
|
75
|
-
k.append(`custom_filters[${
|
|
74
|
+
for (const [R, B] of D.entries())
|
|
75
|
+
k.append(`custom_filters[${R}]`, B);
|
|
76
76
|
return console.info(
|
|
77
77
|
"%capi%c %cput",
|
|
78
78
|
_.API,
|
|
@@ -84,17 +84,15 @@ class Da {
|
|
|
84
84
|
), await fetch(
|
|
85
85
|
[this.url, "api", c, r.type, r.widget].join("/"),
|
|
86
86
|
{ ...l, body: k, method: "put" }
|
|
87
|
-
).then((
|
|
88
|
-
if (!
|
|
89
|
-
throw new Error(
|
|
90
|
-
return
|
|
91
|
-
}).then((
|
|
87
|
+
).then((R) => {
|
|
88
|
+
if (!R.ok)
|
|
89
|
+
throw new Error(R.statusText);
|
|
90
|
+
return R;
|
|
91
|
+
}).then((R) => R.json()).catch((R) => ({ succes: !1, message: R, data: [] }));
|
|
92
92
|
}
|
|
93
93
|
async loadSlide(r) {
|
|
94
94
|
const { version: c } = this.options, l = this.headers(), k = Object.assign({}, r);
|
|
95
|
-
delete k.slide, delete k.type, delete k.hash
|
|
96
|
-
const D = Object.keys(k).length > 0 ? `?${new URLSearchParams(k).toString()}` : "";
|
|
97
|
-
return console.debug(
|
|
95
|
+
return delete k.slide, delete k.type, delete k.hash, console.debug(
|
|
98
96
|
"%capi%c %cget",
|
|
99
97
|
_.API,
|
|
100
98
|
_.NONE,
|
|
@@ -102,13 +100,13 @@ class Da {
|
|
|
102
100
|
re.SLIDE_LOAD,
|
|
103
101
|
r.slide
|
|
104
102
|
), await fetch(
|
|
105
|
-
[this.url, "api", c, "slides"].join("/")
|
|
103
|
+
[this.url, "api", c, "slides", r.id].join("/"),
|
|
106
104
|
{ ...l, method: "get" }
|
|
107
|
-
).then(async (
|
|
108
|
-
if (!
|
|
109
|
-
throw new Error(`${
|
|
110
|
-
return
|
|
111
|
-
}).then((
|
|
105
|
+
).then(async (D) => {
|
|
106
|
+
if (!D.ok)
|
|
107
|
+
throw new Error(`${D.status}`);
|
|
108
|
+
return D;
|
|
109
|
+
}).then((D) => D.json()).then((D) => (D.query = r, D)).catch((D) => ({ success: !1, message: `${D}`, data: null }));
|
|
112
110
|
}
|
|
113
111
|
/**
|
|
114
112
|
* Store slide definition
|
|
@@ -137,33 +135,33 @@ class Da {
|
|
|
137
135
|
}
|
|
138
136
|
}
|
|
139
137
|
var Rr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
140
|
-
function
|
|
141
|
-
return
|
|
138
|
+
function Pi(f) {
|
|
139
|
+
return f && f.__esModule && Object.prototype.hasOwnProperty.call(f, "default") ? f.default : f;
|
|
142
140
|
}
|
|
143
141
|
var jr = { exports: {} };
|
|
144
|
-
(function(
|
|
142
|
+
(function(f, r) {
|
|
145
143
|
(function(c, l) {
|
|
146
|
-
|
|
144
|
+
f.exports = l();
|
|
147
145
|
})(Rr, function() {
|
|
148
146
|
var c = function(e, t) {
|
|
149
|
-
return (c = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n,
|
|
150
|
-
n.__proto__ =
|
|
151
|
-
} || function(n,
|
|
152
|
-
for (var
|
|
147
|
+
return (c = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, i) {
|
|
148
|
+
n.__proto__ = i;
|
|
149
|
+
} || function(n, i) {
|
|
150
|
+
for (var a in i) Object.prototype.hasOwnProperty.call(i, a) && (n[a] = i[a]);
|
|
153
151
|
})(e, t);
|
|
154
152
|
}, l = function() {
|
|
155
153
|
return (l = Object.assign || function(e) {
|
|
156
|
-
for (var t, n = 1,
|
|
154
|
+
for (var t, n = 1, i = arguments.length; n < i; n++) for (var a in t = arguments[n]) Object.prototype.hasOwnProperty.call(t, a) && (e[a] = t[a]);
|
|
157
155
|
return e;
|
|
158
156
|
}).apply(this, arguments);
|
|
159
157
|
};
|
|
160
158
|
function k(e, t, n) {
|
|
161
|
-
for (var
|
|
162
|
-
return e.concat(
|
|
159
|
+
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]);
|
|
160
|
+
return e.concat(i || Array.prototype.slice.call(t));
|
|
163
161
|
}
|
|
164
|
-
var D = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Rr,
|
|
162
|
+
var D = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Rr, R = Object.keys, B = Array.isArray;
|
|
165
163
|
function J(e, t) {
|
|
166
|
-
return typeof t != "object" ||
|
|
164
|
+
return typeof t != "object" || R(t).forEach(function(n) {
|
|
167
165
|
e[n] = t[n];
|
|
168
166
|
}), e;
|
|
169
167
|
}
|
|
@@ -173,13 +171,13 @@ var jr = { exports: {} };
|
|
|
173
171
|
return fe.call(e, t);
|
|
174
172
|
}
|
|
175
173
|
function xe(e, t) {
|
|
176
|
-
typeof t == "function" && (t = t(ee(e))), (typeof Reflect > "u" ?
|
|
174
|
+
typeof t == "function" && (t = t(ee(e))), (typeof Reflect > "u" ? R : Reflect.ownKeys)(t).forEach(function(n) {
|
|
177
175
|
ke(e, n, t[n]);
|
|
178
176
|
});
|
|
179
177
|
}
|
|
180
178
|
var zn = Object.defineProperty;
|
|
181
|
-
function ke(e, t, n,
|
|
182
|
-
zn(e, t, J(n && q(n, "get") && typeof n.get == "function" ? { get: n.get, set: n.set, configurable: !0 } : { value: n, configurable: !0, writable: !0 },
|
|
179
|
+
function ke(e, t, n, i) {
|
|
180
|
+
zn(e, t, J(n && q(n, "get") && typeof n.get == "function" ? { get: n.get, set: n.set, configurable: !0 } : { value: n, configurable: !0, writable: !0 }, i));
|
|
183
181
|
}
|
|
184
182
|
function ze(e) {
|
|
185
183
|
return { from: function(t) {
|
|
@@ -203,8 +201,8 @@ var jr = { exports: {} };
|
|
|
203
201
|
if (typeof t == "string" && q(e, t)) return e[t];
|
|
204
202
|
if (!t) return e;
|
|
205
203
|
if (typeof t != "string") {
|
|
206
|
-
for (var n = [],
|
|
207
|
-
var o = ve(e, t[
|
|
204
|
+
for (var n = [], i = 0, a = t.length; i < a; ++i) {
|
|
205
|
+
var o = ve(e, t[i]);
|
|
208
206
|
n.push(o);
|
|
209
207
|
}
|
|
210
208
|
return n;
|
|
@@ -218,7 +216,7 @@ var jr = { exports: {} };
|
|
|
218
216
|
function le(e, t, n) {
|
|
219
217
|
if (e && t !== void 0 && !("isFrozen" in Object && Object.isFrozen(e))) if (typeof t != "string" && "length" in t) {
|
|
220
218
|
rt(typeof n != "string" && "length" in n);
|
|
221
|
-
for (var
|
|
219
|
+
for (var i = 0, a = t.length; i < a; ++i) le(e, t[i], n[i]);
|
|
222
220
|
} else {
|
|
223
221
|
var o, s, u = t.indexOf(".");
|
|
224
222
|
u !== -1 ? (o = t.substr(0, u), (s = t.substr(u + 1)) === "" ? n === void 0 ? B(e) && !isNaN(parseInt(o)) ? e.splice(o, 1) : delete e[o] : e[o] = n : le(u = !(u = e[o]) || !q(e, o) ? e[o] = {} : u, s, n)) : n === void 0 ? B(e) && !isNaN(parseInt(t)) ? e.splice(t, 1) : delete e[t] : e[t] = n;
|
|
@@ -241,22 +239,22 @@ var jr = { exports: {} };
|
|
|
241
239
|
return D[e];
|
|
242
240
|
}), Vn = new Set(Se.map(function(e) {
|
|
243
241
|
return D[e];
|
|
244
|
-
})),
|
|
242
|
+
})), it = null;
|
|
245
243
|
function je(e) {
|
|
246
|
-
return
|
|
244
|
+
return it = /* @__PURE__ */ new WeakMap(), e = function t(n) {
|
|
247
245
|
if (!n || typeof n != "object") return n;
|
|
248
|
-
var
|
|
249
|
-
if (
|
|
246
|
+
var i = it.get(n);
|
|
247
|
+
if (i) return i;
|
|
250
248
|
if (B(n)) {
|
|
251
|
-
|
|
252
|
-
for (var
|
|
253
|
-
} else if (Vn.has(n.constructor))
|
|
249
|
+
i = [], it.set(n, i);
|
|
250
|
+
for (var a = 0, o = n.length; a < o; ++a) i.push(t(n[a]));
|
|
251
|
+
} else if (Vn.has(n.constructor)) i = n;
|
|
254
252
|
else {
|
|
255
253
|
var s, u = ee(n);
|
|
256
|
-
for (s in
|
|
254
|
+
for (s in i = u === Object.prototype ? {} : Object.create(u), it.set(n, i), n) q(n, s) && (i[s] = t(n[s]));
|
|
257
255
|
}
|
|
258
|
-
return
|
|
259
|
-
}(e),
|
|
256
|
+
return i;
|
|
257
|
+
}(e), it = null, e;
|
|
260
258
|
}
|
|
261
259
|
var zr = {}.toString;
|
|
262
260
|
function qt(e) {
|
|
@@ -273,12 +271,12 @@ var jr = { exports: {} };
|
|
|
273
271
|
}
|
|
274
272
|
var He = {};
|
|
275
273
|
function we(e) {
|
|
276
|
-
var t, n,
|
|
274
|
+
var t, n, i, a;
|
|
277
275
|
if (arguments.length === 1) {
|
|
278
276
|
if (B(e)) return e.slice();
|
|
279
277
|
if (this === He && typeof e == "string") return [e];
|
|
280
|
-
if (
|
|
281
|
-
for (n = []; !(
|
|
278
|
+
if (a = Hr(e)) {
|
|
279
|
+
for (n = []; !(i = a.next()).done; ) n.push(i.value);
|
|
282
280
|
return n;
|
|
283
281
|
}
|
|
284
282
|
if (e == null) return [e];
|
|
@@ -300,13 +298,13 @@ var jr = { exports: {} };
|
|
|
300
298
|
function Jn(e, t) {
|
|
301
299
|
return e + ". Errors: " + Object.keys(t).map(function(n) {
|
|
302
300
|
return t[n].toString();
|
|
303
|
-
}).filter(function(n,
|
|
304
|
-
return
|
|
301
|
+
}).filter(function(n, i, a) {
|
|
302
|
+
return a.indexOf(n) === i;
|
|
305
303
|
}).join(`
|
|
306
304
|
`);
|
|
307
305
|
}
|
|
308
|
-
function Et(e, t, n,
|
|
309
|
-
this.failures = t, this.failedKeys =
|
|
306
|
+
function Et(e, t, n, i) {
|
|
307
|
+
this.failures = t, this.failedKeys = i, this.successCount = n, this.message = Jn(e, t);
|
|
310
308
|
}
|
|
311
309
|
function Qe(e, t) {
|
|
312
310
|
this.name = "BulkError", this.failures = Object.keys(t).map(function(n) {
|
|
@@ -320,11 +318,11 @@ var jr = { exports: {} };
|
|
|
320
318
|
return e[t] = t + "Error", e;
|
|
321
319
|
}, {}), Qr = Ye, G = he.reduce(function(e, t) {
|
|
322
320
|
var n = t + "Error";
|
|
323
|
-
function a
|
|
324
|
-
this.name = n,
|
|
325
|
-
` + o : ""), this.inner = o || null) : typeof
|
|
321
|
+
function i(a, o) {
|
|
322
|
+
this.name = n, a ? typeof a == "string" ? (this.message = "".concat(a).concat(o ? `
|
|
323
|
+
` + 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);
|
|
326
324
|
}
|
|
327
|
-
return ze(
|
|
325
|
+
return ze(i).from(Qr), e[t] = i, e;
|
|
328
326
|
}, {});
|
|
329
327
|
G.Syntax = SyntaxError, G.Type = TypeError, G.Range = RangeError;
|
|
330
328
|
var Zn = st.reduce(function(e, t) {
|
|
@@ -334,11 +332,11 @@ var jr = { exports: {} };
|
|
|
334
332
|
}, {});
|
|
335
333
|
function Q() {
|
|
336
334
|
}
|
|
337
|
-
function
|
|
335
|
+
function at(e) {
|
|
338
336
|
return e;
|
|
339
337
|
}
|
|
340
338
|
function Xr(e, t) {
|
|
341
|
-
return e == null || e ===
|
|
339
|
+
return e == null || e === at ? t : function(n) {
|
|
342
340
|
return t(e(n));
|
|
343
341
|
};
|
|
344
342
|
}
|
|
@@ -351,25 +349,25 @@ var jr = { exports: {} };
|
|
|
351
349
|
return e === Q ? t : function() {
|
|
352
350
|
var n = e.apply(this, arguments);
|
|
353
351
|
n !== void 0 && (arguments[0] = n);
|
|
354
|
-
var
|
|
352
|
+
var i = this.onsuccess, a = this.onerror;
|
|
355
353
|
this.onsuccess = null, this.onerror = null;
|
|
356
354
|
var o = t.apply(this, arguments);
|
|
357
|
-
return
|
|
355
|
+
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;
|
|
358
356
|
};
|
|
359
357
|
}
|
|
360
358
|
function Jr(e, t) {
|
|
361
359
|
return e === Q ? t : function() {
|
|
362
360
|
e.apply(this, arguments);
|
|
363
|
-
var n = this.onsuccess,
|
|
364
|
-
this.onsuccess = this.onerror = null, t.apply(this, arguments), n && (this.onsuccess = this.onsuccess ? Ke(n, this.onsuccess) : n),
|
|
361
|
+
var n = this.onsuccess, i = this.onerror;
|
|
362
|
+
this.onsuccess = this.onerror = null, t.apply(this, arguments), n && (this.onsuccess = this.onsuccess ? Ke(n, this.onsuccess) : n), i && (this.onerror = this.onerror ? Ke(i, this.onerror) : i);
|
|
365
363
|
};
|
|
366
364
|
}
|
|
367
365
|
function Zr(e, t) {
|
|
368
366
|
return e === Q ? t : function(n) {
|
|
369
|
-
var
|
|
370
|
-
J(n,
|
|
371
|
-
var
|
|
372
|
-
return this.onsuccess = null, this.onerror = null, n = t.apply(this, arguments),
|
|
367
|
+
var i = e.apply(this, arguments);
|
|
368
|
+
J(n, i);
|
|
369
|
+
var a = this.onsuccess, o = this.onerror;
|
|
370
|
+
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);
|
|
373
371
|
};
|
|
374
372
|
}
|
|
375
373
|
function qr(e, t) {
|
|
@@ -381,9 +379,9 @@ var jr = { exports: {} };
|
|
|
381
379
|
return e === Q ? t : function() {
|
|
382
380
|
var n = e.apply(this, arguments);
|
|
383
381
|
if (n && typeof n.then == "function") {
|
|
384
|
-
for (var
|
|
382
|
+
for (var i = this, a = arguments.length, o = new Array(a); a--; ) o[a] = arguments[a];
|
|
385
383
|
return n.then(function() {
|
|
386
|
-
return t.apply(
|
|
384
|
+
return t.apply(i, o);
|
|
387
385
|
});
|
|
388
386
|
}
|
|
389
387
|
return t.apply(this, arguments);
|
|
@@ -400,8 +398,8 @@ var jr = { exports: {} };
|
|
|
400
398
|
var t = crypto.subtle.digest("SHA-512", new Uint8Array([0]));
|
|
401
399
|
return [t, ee(t), e];
|
|
402
400
|
}(), st = Se[0], he = Se[1], Se = Se[2], he = he && he.then, ct = st && st.constructor, an = !!Se, ut = function(e, t) {
|
|
403
|
-
lt.push([e, t]), xt && (queueMicrotask(
|
|
404
|
-
}, on = !0, xt = !0, Ne = [], kt = [], sn =
|
|
401
|
+
lt.push([e, t]), xt && (queueMicrotask(ti), xt = !1);
|
|
402
|
+
}, on = !0, xt = !0, Ne = [], kt = [], sn = at, Ae = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: Q, pgp: !1, env: {}, finalize: Q }, L = Ae, lt = [], Be = 0, At = [];
|
|
405
403
|
function N(e) {
|
|
406
404
|
if (typeof this != "object") throw new TypeError("Promises must be constructed via new");
|
|
407
405
|
this._listeners = [], this._lib = !1;
|
|
@@ -410,27 +408,27 @@ var jr = { exports: {} };
|
|
|
410
408
|
if (e !== ot) throw new TypeError("Not a function");
|
|
411
409
|
return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 && un(this, this._value));
|
|
412
410
|
}
|
|
413
|
-
this._state = null, this._value = null, ++t.ref, function n(
|
|
411
|
+
this._state = null, this._value = null, ++t.ref, function n(i, a) {
|
|
414
412
|
try {
|
|
415
|
-
|
|
416
|
-
if (
|
|
417
|
-
if (o ===
|
|
418
|
-
var s =
|
|
419
|
-
o && typeof o.then == "function" ? n(
|
|
413
|
+
a(function(o) {
|
|
414
|
+
if (i._state === null) {
|
|
415
|
+
if (o === i) throw new TypeError("A promise cannot be resolved with itself.");
|
|
416
|
+
var s = i._lib && Xe();
|
|
417
|
+
o && typeof o.then == "function" ? n(i, function(u, g) {
|
|
420
418
|
o instanceof N ? o._then(u, g) : o.then(u, g);
|
|
421
|
-
}) : (
|
|
419
|
+
}) : (i._state = !0, i._value = o, nr(i)), s && Ve();
|
|
422
420
|
}
|
|
423
|
-
}, un.bind(null,
|
|
421
|
+
}, un.bind(null, i));
|
|
424
422
|
} catch (o) {
|
|
425
|
-
un(
|
|
423
|
+
un(i, o);
|
|
426
424
|
}
|
|
427
425
|
}(this, e);
|
|
428
426
|
}
|
|
429
427
|
var cn = { get: function() {
|
|
430
428
|
var e = L, t = Ct;
|
|
431
|
-
function n(
|
|
432
|
-
var o = this, s = !e.global && (e !== L || t !== Ct), u = s && !Pe(), g = new N(function(
|
|
433
|
-
ln(o, new tr(
|
|
429
|
+
function n(i, a) {
|
|
430
|
+
var o = this, s = !e.global && (e !== L || t !== Ct), u = s && !Pe(), g = new N(function(h, b) {
|
|
431
|
+
ln(o, new tr(ir(i, e, s, u), ir(a, e, s, u), h, b, e));
|
|
434
432
|
});
|
|
435
433
|
return this._consoleTask && (g._consoleTask = this._consoleTask), g;
|
|
436
434
|
}
|
|
@@ -440,21 +438,21 @@ var jr = { exports: {} };
|
|
|
440
438
|
return e;
|
|
441
439
|
}, set: cn.set });
|
|
442
440
|
} };
|
|
443
|
-
function tr(e, t, n,
|
|
444
|
-
this.onFulfilled = typeof e == "function" ? e : null, this.onRejected = typeof t == "function" ? t : null, this.resolve = n, this.reject =
|
|
441
|
+
function tr(e, t, n, i, a) {
|
|
442
|
+
this.onFulfilled = typeof e == "function" ? e : null, this.onRejected = typeof t == "function" ? t : null, this.resolve = n, this.reject = i, this.psd = a;
|
|
445
443
|
}
|
|
446
444
|
function un(e, t) {
|
|
447
|
-
var n,
|
|
448
|
-
kt.push(t), e._state === null && (n = e._lib && Xe(), t = sn(t), e._state = !1, e._value = t,
|
|
449
|
-
return
|
|
450
|
-
}) || Ne.push(
|
|
445
|
+
var n, i;
|
|
446
|
+
kt.push(t), e._state === null && (n = e._lib && Xe(), t = sn(t), e._state = !1, e._value = t, i = e, Ne.some(function(a) {
|
|
447
|
+
return a._value === i._value;
|
|
448
|
+
}) || Ne.push(i), nr(e), n && Ve());
|
|
451
449
|
}
|
|
452
450
|
function nr(e) {
|
|
453
451
|
var t = e._listeners;
|
|
454
452
|
e._listeners = [];
|
|
455
|
-
for (var n = 0,
|
|
456
|
-
var
|
|
457
|
-
--
|
|
453
|
+
for (var n = 0, i = t.length; n < i; ++n) ln(e, t[n]);
|
|
454
|
+
var a = e._PSD;
|
|
455
|
+
--a.ref || a.finalize(), Be === 0 && (++Be, ut(function() {
|
|
458
456
|
--Be == 0 && dn();
|
|
459
457
|
}, []));
|
|
460
458
|
}
|
|
@@ -462,24 +460,24 @@ var jr = { exports: {} };
|
|
|
462
460
|
if (e._state !== null) {
|
|
463
461
|
var n = e._state ? t.onFulfilled : t.onRejected;
|
|
464
462
|
if (n === null) return (e._state ? t.resolve : t.reject)(e._value);
|
|
465
|
-
++t.psd.ref, ++Be, ut(
|
|
463
|
+
++t.psd.ref, ++Be, ut(ei, [n, e, t]);
|
|
466
464
|
} else e._listeners.push(t);
|
|
467
465
|
}
|
|
468
|
-
function
|
|
466
|
+
function ei(e, t, n) {
|
|
469
467
|
try {
|
|
470
|
-
var
|
|
471
|
-
!t._state && kt.length && (kt = []),
|
|
472
|
-
return e(
|
|
473
|
-
}) : e(
|
|
468
|
+
var i, a = t._value;
|
|
469
|
+
!t._state && kt.length && (kt = []), i = ye && t._consoleTask ? t._consoleTask.run(function() {
|
|
470
|
+
return e(a);
|
|
471
|
+
}) : e(a), t._state || kt.indexOf(a) !== -1 || function(o) {
|
|
474
472
|
for (var s = Ne.length; s; ) if (Ne[--s]._value === o._value) return Ne.splice(s, 1);
|
|
475
|
-
}(t), n.resolve(
|
|
473
|
+
}(t), n.resolve(i);
|
|
476
474
|
} catch (o) {
|
|
477
475
|
n.reject(o);
|
|
478
476
|
} finally {
|
|
479
477
|
--Be == 0 && dn(), --n.psd.ref || n.psd.finalize();
|
|
480
478
|
}
|
|
481
479
|
}
|
|
482
|
-
function
|
|
480
|
+
function ti() {
|
|
483
481
|
Le(Ae, function() {
|
|
484
482
|
Xe() && Ve();
|
|
485
483
|
});
|
|
@@ -492,16 +490,16 @@ var jr = { exports: {} };
|
|
|
492
490
|
var e, t, n;
|
|
493
491
|
do
|
|
494
492
|
for (; 0 < lt.length; ) for (e = lt, lt = [], n = e.length, t = 0; t < n; ++t) {
|
|
495
|
-
var
|
|
496
|
-
|
|
493
|
+
var i = e[t];
|
|
494
|
+
i[0].apply(null, i[1]);
|
|
497
495
|
}
|
|
498
496
|
while (0 < lt.length);
|
|
499
497
|
xt = on = !0;
|
|
500
498
|
}
|
|
501
499
|
function dn() {
|
|
502
500
|
var e = Ne;
|
|
503
|
-
Ne = [], e.forEach(function(
|
|
504
|
-
|
|
501
|
+
Ne = [], e.forEach(function(i) {
|
|
502
|
+
i._PSD.onunhandled.call(null, i._value, i);
|
|
505
503
|
});
|
|
506
504
|
for (var t = At.slice(0), n = t.length; n; ) t[--n]();
|
|
507
505
|
}
|
|
@@ -511,13 +509,13 @@ var jr = { exports: {} };
|
|
|
511
509
|
function Z(e, t) {
|
|
512
510
|
var n = L;
|
|
513
511
|
return function() {
|
|
514
|
-
var
|
|
512
|
+
var i = Xe(), a = L;
|
|
515
513
|
try {
|
|
516
514
|
return Ie(n, !0), e.apply(this, arguments);
|
|
517
515
|
} catch (o) {
|
|
518
516
|
t && t(o);
|
|
519
517
|
} finally {
|
|
520
|
-
Ie(
|
|
518
|
+
Ie(a, !1), i && Ve();
|
|
521
519
|
}
|
|
522
520
|
};
|
|
523
521
|
}
|
|
@@ -526,10 +524,10 @@ var jr = { exports: {} };
|
|
|
526
524
|
}, catch: function(e) {
|
|
527
525
|
if (arguments.length === 1) return this.then(null, e);
|
|
528
526
|
var t = e, n = arguments[1];
|
|
529
|
-
return typeof t == "function" ? this.then(null, function(
|
|
530
|
-
return (
|
|
531
|
-
}) : this.then(null, function(
|
|
532
|
-
return (
|
|
527
|
+
return typeof t == "function" ? this.then(null, function(i) {
|
|
528
|
+
return (i instanceof t ? n : Dt)(i);
|
|
529
|
+
}) : this.then(null, function(i) {
|
|
530
|
+
return (i && i.name === t ? n : Dt)(i);
|
|
533
531
|
});
|
|
534
532
|
}, finally: function(e) {
|
|
535
533
|
return this.then(function(t) {
|
|
@@ -543,20 +541,20 @@ var jr = { exports: {} };
|
|
|
543
541
|
});
|
|
544
542
|
}, timeout: function(e, t) {
|
|
545
543
|
var n = this;
|
|
546
|
-
return e < 1 / 0 ? new N(function(
|
|
544
|
+
return e < 1 / 0 ? new N(function(i, a) {
|
|
547
545
|
var o = setTimeout(function() {
|
|
548
|
-
return
|
|
546
|
+
return a(new G.Timeout(t));
|
|
549
547
|
}, e);
|
|
550
|
-
n.then(
|
|
548
|
+
n.then(i, a).finally(clearTimeout.bind(null, o));
|
|
551
549
|
}) : this;
|
|
552
550
|
} }), typeof Symbol < "u" && Symbol.toStringTag && ke(N.prototype, Symbol.toStringTag, "Dexie.Promise"), Ae.env = rr(), xe(N, { all: function() {
|
|
553
551
|
var e = we.apply(null, arguments).map(Rt);
|
|
554
552
|
return new N(function(t, n) {
|
|
555
553
|
e.length === 0 && t([]);
|
|
556
|
-
var
|
|
557
|
-
e.forEach(function(
|
|
558
|
-
return N.resolve(
|
|
559
|
-
e[o] = s, --
|
|
554
|
+
var i = e.length;
|
|
555
|
+
e.forEach(function(a, o) {
|
|
556
|
+
return N.resolve(a).then(function(s) {
|
|
557
|
+
e[o] = s, --i || t(e);
|
|
560
558
|
}, n);
|
|
561
559
|
});
|
|
562
560
|
});
|
|
@@ -567,8 +565,8 @@ var jr = { exports: {} };
|
|
|
567
565
|
}, reject: Dt, race: function() {
|
|
568
566
|
var e = we.apply(null, arguments).map(Rt);
|
|
569
567
|
return new N(function(t, n) {
|
|
570
|
-
e.map(function(
|
|
571
|
-
return N.resolve(
|
|
568
|
+
e.map(function(i) {
|
|
569
|
+
return N.resolve(i).then(t, n);
|
|
572
570
|
});
|
|
573
571
|
});
|
|
574
572
|
}, PSD: { get: function() {
|
|
@@ -586,33 +584,33 @@ var jr = { exports: {} };
|
|
|
586
584
|
}, set: function(e) {
|
|
587
585
|
sn = e;
|
|
588
586
|
} }, follow: function(e, t) {
|
|
589
|
-
return new N(function(n,
|
|
590
|
-
return De(function(
|
|
587
|
+
return new N(function(n, i) {
|
|
588
|
+
return De(function(a, o) {
|
|
591
589
|
var s = L;
|
|
592
590
|
s.unhandleds = [], s.onunhandled = o, s.finalize = Ke(function() {
|
|
593
591
|
var u, g = this;
|
|
594
592
|
u = function() {
|
|
595
|
-
g.unhandleds.length === 0 ?
|
|
596
|
-
}, At.push(function
|
|
597
|
-
u(), At.splice(At.indexOf(
|
|
593
|
+
g.unhandleds.length === 0 ? a() : o(g.unhandleds[0]);
|
|
594
|
+
}, At.push(function h() {
|
|
595
|
+
u(), At.splice(At.indexOf(h), 1);
|
|
598
596
|
}), ++Be, ut(function() {
|
|
599
597
|
--Be == 0 && dn();
|
|
600
598
|
}, []);
|
|
601
599
|
}, s.finalize), e();
|
|
602
|
-
}, t, n,
|
|
600
|
+
}, t, n, i);
|
|
603
601
|
});
|
|
604
602
|
} }), ct && (ct.allSettled && ke(N, "allSettled", function() {
|
|
605
603
|
var e = we.apply(null, arguments).map(Rt);
|
|
606
604
|
return new N(function(t) {
|
|
607
605
|
e.length === 0 && t([]);
|
|
608
|
-
var n = e.length,
|
|
609
|
-
e.forEach(function(
|
|
610
|
-
return N.resolve(
|
|
611
|
-
return
|
|
606
|
+
var n = e.length, i = new Array(n);
|
|
607
|
+
e.forEach(function(a, o) {
|
|
608
|
+
return N.resolve(a).then(function(s) {
|
|
609
|
+
return i[o] = { status: "fulfilled", value: s };
|
|
612
610
|
}, function(s) {
|
|
613
|
-
return
|
|
611
|
+
return i[o] = { status: "rejected", reason: s };
|
|
614
612
|
}).then(function() {
|
|
615
|
-
return --n || t(
|
|
613
|
+
return --n || t(i);
|
|
616
614
|
});
|
|
617
615
|
});
|
|
618
616
|
});
|
|
@@ -620,74 +618,74 @@ var jr = { exports: {} };
|
|
|
620
618
|
var e = we.apply(null, arguments).map(Rt);
|
|
621
619
|
return new N(function(t, n) {
|
|
622
620
|
e.length === 0 && n(new AggregateError([]));
|
|
623
|
-
var
|
|
621
|
+
var i = e.length, a = new Array(i);
|
|
624
622
|
e.forEach(function(o, s) {
|
|
625
623
|
return N.resolve(o).then(function(u) {
|
|
626
624
|
return t(u);
|
|
627
625
|
}, function(u) {
|
|
628
|
-
|
|
626
|
+
a[s] = u, --i || n(new AggregateError(a));
|
|
629
627
|
});
|
|
630
628
|
});
|
|
631
629
|
});
|
|
632
630
|
}));
|
|
633
|
-
var
|
|
634
|
-
function De(e, t, n,
|
|
635
|
-
var
|
|
636
|
-
return o.parent =
|
|
631
|
+
var ie = { awaits: 0, echoes: 0, id: 0 }, ni = 0, Pt = [], It = 0, Ct = 0, ri = 0;
|
|
632
|
+
function De(e, t, n, i) {
|
|
633
|
+
var a = L, o = Object.create(a);
|
|
634
|
+
return o.parent = a, o.ref = 0, o.global = !1, o.id = ++ri, Ae.env, o.env = an ? { Promise: N, PromiseProp: { value: N, configurable: !0, writable: !0 }, all: N.all, race: N.race, allSettled: N.allSettled, any: N.any, resolve: N.resolve, reject: N.reject } : {}, t && J(o, t), ++a.ref, o.finalize = function() {
|
|
637
635
|
--this.parent.ref || this.parent.finalize();
|
|
638
|
-
},
|
|
636
|
+
}, i = Le(o, e, n, i), o.ref === 0 && o.finalize(), i;
|
|
639
637
|
}
|
|
640
638
|
function Je() {
|
|
641
|
-
return
|
|
639
|
+
return ie.id || (ie.id = ++ni), ++ie.awaits, ie.echoes += er, ie.id;
|
|
642
640
|
}
|
|
643
641
|
function Pe() {
|
|
644
|
-
return !!
|
|
642
|
+
return !!ie.awaits && (--ie.awaits == 0 && (ie.id = 0), ie.echoes = ie.awaits * er, !0);
|
|
645
643
|
}
|
|
646
644
|
function Rt(e) {
|
|
647
|
-
return
|
|
645
|
+
return ie.echoes && e && e.constructor === ct ? (Je(), e.then(function(t) {
|
|
648
646
|
return Pe(), t;
|
|
649
647
|
}, function(t) {
|
|
650
648
|
return Pe(), te(t);
|
|
651
649
|
})) : e;
|
|
652
650
|
}
|
|
653
|
-
function
|
|
651
|
+
function ii() {
|
|
654
652
|
var e = Pt[Pt.length - 1];
|
|
655
653
|
Pt.pop(), Ie(e, !1);
|
|
656
654
|
}
|
|
657
655
|
function Ie(e, t) {
|
|
658
|
-
var n,
|
|
659
|
-
(t ? !
|
|
660
|
-
++Ct,
|
|
661
|
-
}).bind(null, e) :
|
|
656
|
+
var n, i = L;
|
|
657
|
+
(t ? !ie.echoes || It++ && e === L : !It || --It && e === L) || queueMicrotask(t ? (function(a) {
|
|
658
|
+
++Ct, ie.echoes && --ie.echoes != 0 || (ie.echoes = ie.awaits = ie.id = 0), Pt.push(L), Ie(a, !0);
|
|
659
|
+
}).bind(null, e) : ii), e !== L && (L = e, i === Ae && (Ae.env = rr()), an && (n = Ae.env.Promise, t = e.env, (i.global || e.global) && (Object.defineProperty(D, "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))));
|
|
662
660
|
}
|
|
663
661
|
function rr() {
|
|
664
662
|
var e = D.Promise;
|
|
665
663
|
return an ? { Promise: e, PromiseProp: Object.getOwnPropertyDescriptor(D, "Promise"), all: e.all, race: e.race, allSettled: e.allSettled, any: e.any, resolve: e.resolve, reject: e.reject } : {};
|
|
666
664
|
}
|
|
667
|
-
function Le(e, t, n,
|
|
665
|
+
function Le(e, t, n, i, a) {
|
|
668
666
|
var o = L;
|
|
669
667
|
try {
|
|
670
|
-
return Ie(e, !0), t(n,
|
|
668
|
+
return Ie(e, !0), t(n, i, a);
|
|
671
669
|
} finally {
|
|
672
670
|
Ie(o, !1);
|
|
673
671
|
}
|
|
674
672
|
}
|
|
675
|
-
function
|
|
673
|
+
function ir(e, t, n, i) {
|
|
676
674
|
return typeof e != "function" ? e : function() {
|
|
677
|
-
var
|
|
675
|
+
var a = L;
|
|
678
676
|
n && Je(), Ie(t, !0);
|
|
679
677
|
try {
|
|
680
678
|
return e.apply(this, arguments);
|
|
681
679
|
} finally {
|
|
682
|
-
Ie(
|
|
680
|
+
Ie(a, !1), i && queueMicrotask(Pe);
|
|
683
681
|
}
|
|
684
682
|
};
|
|
685
683
|
}
|
|
686
684
|
function fn(e) {
|
|
687
|
-
Promise === ct &&
|
|
685
|
+
Promise === ct && ie.echoes === 0 ? It === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
|
|
688
686
|
}
|
|
689
687
|
("" + he).indexOf("[native code]") === -1 && (Je = Pe = Q);
|
|
690
|
-
var te = N.reject, Ge = "", _e = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",
|
|
688
|
+
var te = N.reject, Ge = "", _e = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", ar = "String expected.", Ze = [], Tt = "__dbnames", hn = "readonly", pn = "readwrite";
|
|
691
689
|
function $e(e, t) {
|
|
692
690
|
return e ? t ? function() {
|
|
693
691
|
return e.apply(this, arguments) && t.apply(this, arguments);
|
|
@@ -706,22 +704,22 @@ var jr = { exports: {} };
|
|
|
706
704
|
}
|
|
707
705
|
function H(e, t) {
|
|
708
706
|
try {
|
|
709
|
-
var n = cr(e),
|
|
710
|
-
if (n !==
|
|
707
|
+
var n = cr(e), i = cr(t);
|
|
708
|
+
if (n !== i) return n === "Array" ? 1 : i === "Array" ? -1 : n === "binary" ? 1 : i === "binary" ? -1 : n === "string" ? 1 : i === "string" ? -1 : n === "Date" ? 1 : i !== "Date" ? NaN : -1;
|
|
711
709
|
switch (n) {
|
|
712
710
|
case "number":
|
|
713
711
|
case "Date":
|
|
714
712
|
case "string":
|
|
715
713
|
return t < e ? 1 : e < t ? -1 : 0;
|
|
716
714
|
case "binary":
|
|
717
|
-
return function(
|
|
718
|
-
for (var s =
|
|
715
|
+
return function(a, o) {
|
|
716
|
+
for (var s = a.length, u = o.length, g = s < u ? s : u, h = 0; h < g; ++h) if (a[h] !== o[h]) return a[h] < o[h] ? -1 : 1;
|
|
719
717
|
return s === u ? 0 : s < u ? -1 : 1;
|
|
720
718
|
}(ur(e), ur(t));
|
|
721
719
|
case "Array":
|
|
722
|
-
return function(
|
|
723
|
-
for (var s =
|
|
724
|
-
var b = H(
|
|
720
|
+
return function(a, o) {
|
|
721
|
+
for (var s = a.length, u = o.length, g = s < u ? s : u, h = 0; h < g; ++h) {
|
|
722
|
+
var b = H(a[h], o[h]);
|
|
725
723
|
if (b !== 0) return b;
|
|
726
724
|
}
|
|
727
725
|
return s === u ? 0 : s < u ? -1 : 1;
|
|
@@ -739,23 +737,23 @@ var jr = { exports: {} };
|
|
|
739
737
|
return e instanceof Uint8Array ? e : ArrayBuffer.isView(e) ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : new Uint8Array(e);
|
|
740
738
|
}
|
|
741
739
|
var lr = (V.prototype._trans = function(e, t, n) {
|
|
742
|
-
var
|
|
743
|
-
function s(
|
|
744
|
-
if (!d.schema[
|
|
740
|
+
var i = this._tx || L.trans, a = this.name, o = ye && typeof console < "u" && console.createTask && console.createTask("Dexie: ".concat(e === "readonly" ? "read" : "write", " ").concat(this.name));
|
|
741
|
+
function s(h, b, d) {
|
|
742
|
+
if (!d.schema[a]) throw new G.NotFound("Table " + a + " not part of transaction");
|
|
745
743
|
return t(d.idbtrans, d);
|
|
746
744
|
}
|
|
747
745
|
var u = Xe();
|
|
748
746
|
try {
|
|
749
|
-
var g =
|
|
750
|
-
return
|
|
751
|
-
}, { trans:
|
|
747
|
+
var g = i && i.db._novip === this.db._novip ? i === L.trans ? i._promise(e, s, n) : De(function() {
|
|
748
|
+
return i._promise(e, s, n);
|
|
749
|
+
}, { trans: i, transless: L.transless || L }) : function h(b, d, v, p) {
|
|
752
750
|
if (b.idbdb && (b._state.openComplete || L.letThrough || b._vip)) {
|
|
753
751
|
var m = b._createTransaction(d, v, b._dbSchema);
|
|
754
752
|
try {
|
|
755
753
|
m.create(), b._state.PR1398_maxLoop = 3;
|
|
756
754
|
} catch (w) {
|
|
757
755
|
return w.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() {
|
|
758
|
-
return
|
|
756
|
+
return h(b, d, v, p);
|
|
759
757
|
})) : te(w);
|
|
760
758
|
}
|
|
761
759
|
return m._promise(d, function(w, y) {
|
|
@@ -778,57 +776,57 @@ var jr = { exports: {} };
|
|
|
778
776
|
b.open().catch(Q);
|
|
779
777
|
}
|
|
780
778
|
return b._state.dbReadyPromise.then(function() {
|
|
781
|
-
return
|
|
779
|
+
return h(b, d, v, p);
|
|
782
780
|
});
|
|
783
781
|
}(this.db, e, [this.name], s);
|
|
784
|
-
return o && (g._consoleTask = o, g = g.catch(function(
|
|
785
|
-
return console.trace(
|
|
782
|
+
return o && (g._consoleTask = o, g = g.catch(function(h) {
|
|
783
|
+
return console.trace(h), te(h);
|
|
786
784
|
})), g;
|
|
787
785
|
} finally {
|
|
788
786
|
u && Ve();
|
|
789
787
|
}
|
|
790
788
|
}, V.prototype.get = function(e, t) {
|
|
791
789
|
var n = this;
|
|
792
|
-
return e && e.constructor === Object ? this.where(e).first(t) : e == null ? te(new G.Type("Invalid argument to Table.get()")) : this._trans("readonly", function(
|
|
793
|
-
return n.core.get({ trans:
|
|
794
|
-
return n.hook.reading.fire(
|
|
790
|
+
return e && e.constructor === Object ? this.where(e).first(t) : e == null ? te(new G.Type("Invalid argument to Table.get()")) : this._trans("readonly", function(i) {
|
|
791
|
+
return n.core.get({ trans: i, key: e }).then(function(a) {
|
|
792
|
+
return n.hook.reading.fire(a);
|
|
795
793
|
});
|
|
796
794
|
}).then(t);
|
|
797
795
|
}, V.prototype.where = function(e) {
|
|
798
796
|
if (typeof e == "string") return new this.db.WhereClause(this, e);
|
|
799
797
|
if (B(e)) return new this.db.WhereClause(this, "[".concat(e.join("+"), "]"));
|
|
800
|
-
var t =
|
|
798
|
+
var t = R(e);
|
|
801
799
|
if (t.length === 1) return this.where(t[0]).equals(e[t[0]]);
|
|
802
800
|
var n = this.schema.indexes.concat(this.schema.primKey).filter(function(g) {
|
|
803
801
|
if (g.compound && t.every(function(b) {
|
|
804
802
|
return 0 <= g.keyPath.indexOf(b);
|
|
805
803
|
})) {
|
|
806
|
-
for (var
|
|
804
|
+
for (var h = 0; h < t.length; ++h) if (t.indexOf(g.keyPath[h]) === -1) return !1;
|
|
807
805
|
return !0;
|
|
808
806
|
}
|
|
809
807
|
return !1;
|
|
810
|
-
}).sort(function(g,
|
|
811
|
-
return g.keyPath.length -
|
|
808
|
+
}).sort(function(g, h) {
|
|
809
|
+
return g.keyPath.length - h.keyPath.length;
|
|
812
810
|
})[0];
|
|
813
811
|
if (n && this.db._maxKey !== Ge) {
|
|
814
812
|
var s = n.keyPath.slice(0, t.length);
|
|
815
|
-
return this.where(s).equals(s.map(function(
|
|
816
|
-
return e[
|
|
813
|
+
return this.where(s).equals(s.map(function(h) {
|
|
814
|
+
return e[h];
|
|
817
815
|
}));
|
|
818
816
|
}
|
|
819
817
|
!n && ye && console.warn("The query ".concat(JSON.stringify(e), " on ").concat(this.name, " would benefit from a ") + "compound index [".concat(t.join("+"), "]"));
|
|
820
|
-
var
|
|
821
|
-
function o(g,
|
|
822
|
-
return
|
|
818
|
+
var i = this.schema.idxByName, a = this.db._deps.indexedDB;
|
|
819
|
+
function o(g, h) {
|
|
820
|
+
return a.cmp(g, h) === 0;
|
|
823
821
|
}
|
|
824
|
-
var u = t.reduce(function(v,
|
|
825
|
-
var b = v[0], d = v[1], v =
|
|
822
|
+
var u = t.reduce(function(v, h) {
|
|
823
|
+
var b = v[0], d = v[1], v = i[h], p = e[h];
|
|
826
824
|
return [b || v, b || !v ? $e(d, v && v.multi ? function(m) {
|
|
827
|
-
return m = ve(m,
|
|
825
|
+
return m = ve(m, h), B(m) && m.some(function(w) {
|
|
828
826
|
return o(p, w);
|
|
829
827
|
});
|
|
830
828
|
} : function(m) {
|
|
831
|
-
return o(p, ve(m,
|
|
829
|
+
return o(p, ve(m, h));
|
|
832
830
|
}) : d];
|
|
833
831
|
}, [null, null]), s = u[0], u = u[1];
|
|
834
832
|
return s ? this.where(s.name).equals(e[s.keyPath]).filter(u) : n ? this.filter(u) : this.where(t).equals("");
|
|
@@ -851,29 +849,29 @@ var jr = { exports: {} };
|
|
|
851
849
|
}, V.prototype.reverse = function() {
|
|
852
850
|
return this.toCollection().reverse();
|
|
853
851
|
}, V.prototype.mapToClass = function(e) {
|
|
854
|
-
var t, n = this.db,
|
|
855
|
-
function
|
|
852
|
+
var t, n = this.db, i = this.name;
|
|
853
|
+
function a() {
|
|
856
854
|
return t !== null && t.apply(this, arguments) || this;
|
|
857
855
|
}
|
|
858
|
-
(this.schema.mappedClass = e).prototype instanceof sr && (function(g,
|
|
859
|
-
if (typeof
|
|
856
|
+
(this.schema.mappedClass = e).prototype instanceof sr && (function(g, h) {
|
|
857
|
+
if (typeof h != "function" && h !== null) throw new TypeError("Class extends value " + String(h) + " is not a constructor or null");
|
|
860
858
|
function b() {
|
|
861
859
|
this.constructor = g;
|
|
862
860
|
}
|
|
863
|
-
c(g,
|
|
864
|
-
}(
|
|
861
|
+
c(g, h), g.prototype = h === null ? Object.create(h) : (b.prototype = h.prototype, new b());
|
|
862
|
+
}(a, t = e), Object.defineProperty(a.prototype, "db", { get: function() {
|
|
865
863
|
return n;
|
|
866
|
-
}, enumerable: !1, configurable: !0 }),
|
|
867
|
-
return
|
|
868
|
-
}, e =
|
|
864
|
+
}, enumerable: !1, configurable: !0 }), a.prototype.table = function() {
|
|
865
|
+
return i;
|
|
866
|
+
}, e = a);
|
|
869
867
|
for (var o = /* @__PURE__ */ new Set(), s = e.prototype; s; s = ee(s)) Object.getOwnPropertyNames(s).forEach(function(g) {
|
|
870
868
|
return o.add(g);
|
|
871
869
|
});
|
|
872
870
|
function u(g) {
|
|
873
871
|
if (!g) return g;
|
|
874
|
-
var
|
|
875
|
-
for (
|
|
876
|
-
b[
|
|
872
|
+
var h, b = Object.create(e.prototype);
|
|
873
|
+
for (h in g) if (!o.has(h)) try {
|
|
874
|
+
b[h] = g[h];
|
|
877
875
|
} catch {
|
|
878
876
|
}
|
|
879
877
|
return b;
|
|
@@ -884,8 +882,8 @@ var jr = { exports: {} };
|
|
|
884
882
|
J(this, e);
|
|
885
883
|
});
|
|
886
884
|
}, V.prototype.add = function(e, t) {
|
|
887
|
-
var n = this,
|
|
888
|
-
return o &&
|
|
885
|
+
var n = this, i = this.schema.primKey, a = i.auto, o = i.keyPath, s = e;
|
|
886
|
+
return o && a && (s = jt(o)(e)), this._trans("readwrite", function(u) {
|
|
889
887
|
return n.core.mutate({ trans: u, type: "add", keys: t != null ? [t] : null, values: [s] });
|
|
890
888
|
}).then(function(u) {
|
|
891
889
|
return u.numFailures ? N.reject(u.failures[0]) : u.lastResult;
|
|
@@ -899,8 +897,8 @@ var jr = { exports: {} };
|
|
|
899
897
|
}, V.prototype.update = function(e, t) {
|
|
900
898
|
return typeof e != "object" || B(e) ? this.where(":id").equals(e).modify(t) : (e = ve(e, this.schema.primKey.keyPath), e === void 0 ? te(new G.InvalidArgument("Given object does not contain its primary key")) : this.where(":id").equals(e).modify(t));
|
|
901
899
|
}, V.prototype.put = function(e, t) {
|
|
902
|
-
var n = this,
|
|
903
|
-
return o &&
|
|
900
|
+
var n = this, i = this.schema.primKey, a = i.auto, o = i.keyPath, s = e;
|
|
901
|
+
return o && a && (s = jt(o)(e)), this._trans("readwrite", function(u) {
|
|
904
902
|
return n.core.mutate({ trans: u, type: "put", values: [s], keys: t != null ? [t] : null });
|
|
905
903
|
}).then(function(u) {
|
|
906
904
|
return u.numFailures ? N.reject(u.failures[0]) : u.lastResult;
|
|
@@ -928,47 +926,47 @@ var jr = { exports: {} };
|
|
|
928
926
|
}, V.prototype.bulkGet = function(e) {
|
|
929
927
|
var t = this;
|
|
930
928
|
return this._trans("readonly", function(n) {
|
|
931
|
-
return t.core.getMany({ keys: e, trans: n }).then(function(
|
|
932
|
-
return
|
|
933
|
-
return t.hook.reading.fire(
|
|
929
|
+
return t.core.getMany({ keys: e, trans: n }).then(function(i) {
|
|
930
|
+
return i.map(function(a) {
|
|
931
|
+
return t.hook.reading.fire(a);
|
|
934
932
|
});
|
|
935
933
|
});
|
|
936
934
|
});
|
|
937
935
|
}, V.prototype.bulkAdd = function(e, t, n) {
|
|
938
|
-
var
|
|
936
|
+
var i = this, a = Array.isArray(t) ? t : void 0, o = (n = n || (a ? void 0 : t)) ? n.allKeys : void 0;
|
|
939
937
|
return this._trans("readwrite", function(s) {
|
|
940
|
-
var
|
|
941
|
-
if (
|
|
942
|
-
if (
|
|
943
|
-
var g = e.length,
|
|
944
|
-
return
|
|
938
|
+
var h = i.schema.primKey, u = h.auto, h = h.keyPath;
|
|
939
|
+
if (h && a) throw new G.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
|
|
940
|
+
if (a && a.length !== e.length) throw new G.InvalidArgument("Arguments objects and keys must have the same length");
|
|
941
|
+
var g = e.length, h = h && u ? e.map(jt(h)) : e;
|
|
942
|
+
return i.core.mutate({ trans: s, type: "add", keys: a, values: h, wantResults: o }).then(function(m) {
|
|
945
943
|
var d = m.numFailures, v = m.results, p = m.lastResult, m = m.failures;
|
|
946
944
|
if (d === 0) return o ? v : p;
|
|
947
|
-
throw new Qe("".concat(
|
|
945
|
+
throw new Qe("".concat(i.name, ".bulkAdd(): ").concat(d, " of ").concat(g, " operations failed"), m);
|
|
948
946
|
});
|
|
949
947
|
});
|
|
950
948
|
}, V.prototype.bulkPut = function(e, t, n) {
|
|
951
|
-
var
|
|
949
|
+
var i = this, a = Array.isArray(t) ? t : void 0, o = (n = n || (a ? void 0 : t)) ? n.allKeys : void 0;
|
|
952
950
|
return this._trans("readwrite", function(s) {
|
|
953
|
-
var
|
|
954
|
-
if (
|
|
955
|
-
if (
|
|
956
|
-
var g = e.length,
|
|
957
|
-
return
|
|
951
|
+
var h = i.schema.primKey, u = h.auto, h = h.keyPath;
|
|
952
|
+
if (h && a) throw new G.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
|
|
953
|
+
if (a && a.length !== e.length) throw new G.InvalidArgument("Arguments objects and keys must have the same length");
|
|
954
|
+
var g = e.length, h = h && u ? e.map(jt(h)) : e;
|
|
955
|
+
return i.core.mutate({ trans: s, type: "put", keys: a, values: h, wantResults: o }).then(function(m) {
|
|
958
956
|
var d = m.numFailures, v = m.results, p = m.lastResult, m = m.failures;
|
|
959
957
|
if (d === 0) return o ? v : p;
|
|
960
|
-
throw new Qe("".concat(
|
|
958
|
+
throw new Qe("".concat(i.name, ".bulkPut(): ").concat(d, " of ").concat(g, " operations failed"), m);
|
|
961
959
|
});
|
|
962
960
|
});
|
|
963
961
|
}, V.prototype.bulkUpdate = function(e) {
|
|
964
|
-
var t = this, n = this.core,
|
|
962
|
+
var t = this, n = this.core, i = e.map(function(s) {
|
|
965
963
|
return s.key;
|
|
966
|
-
}),
|
|
964
|
+
}), a = e.map(function(s) {
|
|
967
965
|
return s.changes;
|
|
968
966
|
}), o = [];
|
|
969
967
|
return this._trans("readwrite", function(s) {
|
|
970
|
-
return n.getMany({ trans: s, keys:
|
|
971
|
-
var g = [],
|
|
968
|
+
return n.getMany({ trans: s, keys: i, cache: "clone" }).then(function(u) {
|
|
969
|
+
var g = [], h = [];
|
|
972
970
|
e.forEach(function(d, v) {
|
|
973
971
|
var p = d.key, m = d.changes, w = u[v];
|
|
974
972
|
if (w) {
|
|
@@ -978,11 +976,11 @@ var jr = { exports: {} };
|
|
|
978
976
|
if (H(O, p) !== 0) throw new G.Constraint("Cannot update primary key in bulkUpdate()");
|
|
979
977
|
} else le(w, E, O);
|
|
980
978
|
}
|
|
981
|
-
o.push(v), g.push(p),
|
|
979
|
+
o.push(v), g.push(p), h.push(w);
|
|
982
980
|
}
|
|
983
981
|
});
|
|
984
982
|
var b = g.length;
|
|
985
|
-
return n.mutate({ trans: s, type: "put", keys: g, values:
|
|
983
|
+
return n.mutate({ trans: s, type: "put", keys: g, values: h, updates: { keys: i, changeSpecs: a } }).then(function(d) {
|
|
986
984
|
var v = d.numFailures, p = d.failures;
|
|
987
985
|
if (v === 0) return b;
|
|
988
986
|
for (var m = 0, w = Object.keys(p); m < w.length; m++) {
|
|
@@ -995,12 +993,12 @@ var jr = { exports: {} };
|
|
|
995
993
|
});
|
|
996
994
|
}, V.prototype.bulkDelete = function(e) {
|
|
997
995
|
var t = this, n = e.length;
|
|
998
|
-
return this._trans("readwrite", function(
|
|
999
|
-
return t.core.mutate({ trans:
|
|
996
|
+
return this._trans("readwrite", function(i) {
|
|
997
|
+
return t.core.mutate({ trans: i, type: "delete", keys: e });
|
|
1000
998
|
}).then(function(s) {
|
|
1001
|
-
var
|
|
1002
|
-
if (
|
|
1003
|
-
throw new Qe("".concat(t.name, ".bulkDelete(): ").concat(
|
|
999
|
+
var a = s.numFailures, o = s.lastResult, s = s.failures;
|
|
1000
|
+
if (a === 0) return o;
|
|
1001
|
+
throw new Qe("".concat(t.name, ".bulkDelete(): ").concat(a, " of ").concat(n, " operations failed"), s);
|
|
1004
1002
|
});
|
|
1005
1003
|
}, V);
|
|
1006
1004
|
function V() {
|
|
@@ -1008,18 +1006,18 @@ var jr = { exports: {} };
|
|
|
1008
1006
|
function dt(e) {
|
|
1009
1007
|
function t(s, u) {
|
|
1010
1008
|
if (u) {
|
|
1011
|
-
for (var g = arguments.length,
|
|
1012
|
-
return n[s].subscribe.apply(null,
|
|
1009
|
+
for (var g = arguments.length, h = new Array(g - 1); --g; ) h[g - 1] = arguments[g];
|
|
1010
|
+
return n[s].subscribe.apply(null, h), e;
|
|
1013
1011
|
}
|
|
1014
1012
|
if (typeof s == "string") return n[s];
|
|
1015
1013
|
}
|
|
1016
1014
|
var n = {};
|
|
1017
1015
|
t.addEventType = o;
|
|
1018
|
-
for (var
|
|
1016
|
+
for (var i = 1, a = arguments.length; i < a; ++i) o(arguments[i]);
|
|
1019
1017
|
return t;
|
|
1020
1018
|
function o(s, u, g) {
|
|
1021
1019
|
if (typeof s != "object") {
|
|
1022
|
-
var
|
|
1020
|
+
var h;
|
|
1023
1021
|
u = u || qr;
|
|
1024
1022
|
var b = { subscribers: [], fire: g = g || Q, subscribe: function(d) {
|
|
1025
1023
|
b.subscribers.indexOf(d) === -1 && (b.subscribers.push(d), b.fire = u(b.fire, d));
|
|
@@ -1030,12 +1028,12 @@ var jr = { exports: {} };
|
|
|
1030
1028
|
} };
|
|
1031
1029
|
return n[s] = t[s] = b;
|
|
1032
1030
|
}
|
|
1033
|
-
|
|
1034
|
-
var v =
|
|
1035
|
-
if (B(v)) o(d,
|
|
1031
|
+
R(h = s).forEach(function(d) {
|
|
1032
|
+
var v = h[d];
|
|
1033
|
+
if (B(v)) o(d, h[d][0], h[d][1]);
|
|
1036
1034
|
else {
|
|
1037
1035
|
if (v !== "asap") throw new G.InvalidArgument("Invalid event config");
|
|
1038
|
-
var p = o(d,
|
|
1036
|
+
var p = o(d, at, function() {
|
|
1039
1037
|
for (var m = arguments.length, w = new Array(m); m--; ) w[m] = arguments[m];
|
|
1040
1038
|
p.subscribers.forEach(function(y) {
|
|
1041
1039
|
Yn(function() {
|
|
@@ -1057,10 +1055,10 @@ var jr = { exports: {} };
|
|
|
1057
1055
|
e.filter = $e(e.filter, t);
|
|
1058
1056
|
}
|
|
1059
1057
|
function yn(e, t, n) {
|
|
1060
|
-
var
|
|
1061
|
-
e.replayFilter =
|
|
1062
|
-
return $e(
|
|
1063
|
-
} : t, e.justLimit = n && !
|
|
1058
|
+
var i = e.replayFilter;
|
|
1059
|
+
e.replayFilter = i ? function() {
|
|
1060
|
+
return $e(i(), t());
|
|
1061
|
+
} : t, e.justLimit = n && !i;
|
|
1064
1062
|
}
|
|
1065
1063
|
function Mt(e, t) {
|
|
1066
1064
|
if (e.isPrimKey) return t.primaryKey;
|
|
@@ -1069,27 +1067,27 @@ var jr = { exports: {} };
|
|
|
1069
1067
|
return n;
|
|
1070
1068
|
}
|
|
1071
1069
|
function dr(e, t, n) {
|
|
1072
|
-
var
|
|
1073
|
-
return t.openCursor({ trans: n, values: !e.keysOnly, reverse: e.dir === "prev", unique: !!e.unique, query: { index:
|
|
1070
|
+
var i = Mt(e, t.schema);
|
|
1071
|
+
return t.openCursor({ trans: n, values: !e.keysOnly, reverse: e.dir === "prev", unique: !!e.unique, query: { index: i, range: e.range } });
|
|
1074
1072
|
}
|
|
1075
|
-
function Kt(e, t, n,
|
|
1076
|
-
var
|
|
1073
|
+
function Kt(e, t, n, i) {
|
|
1074
|
+
var a = e.replayFilter ? $e(e.filter, e.replayFilter()) : e.filter;
|
|
1077
1075
|
if (e.or) {
|
|
1078
|
-
var o = {}, s = function(u, g,
|
|
1076
|
+
var o = {}, s = function(u, g, h) {
|
|
1079
1077
|
var b, d;
|
|
1080
|
-
|
|
1078
|
+
a && !a(g, h, function(v) {
|
|
1081
1079
|
return g.stop(v);
|
|
1082
1080
|
}, function(v) {
|
|
1083
1081
|
return g.fail(v);
|
|
1084
|
-
}) || ((d = "" + (b = g.primaryKey)) == "[object ArrayBuffer]" && (d = "" + new Uint8Array(b)), q(o, d) || (o[d] = !0, t(u, g,
|
|
1082
|
+
}) || ((d = "" + (b = g.primaryKey)) == "[object ArrayBuffer]" && (d = "" + new Uint8Array(b)), q(o, d) || (o[d] = !0, t(u, g, h)));
|
|
1085
1083
|
};
|
|
1086
|
-
return Promise.all([e.or._iterate(s, n), fr(dr(e,
|
|
1084
|
+
return Promise.all([e.or._iterate(s, n), fr(dr(e, i, n), e.algorithm, s, !e.keysOnly && e.valueMapper)]);
|
|
1087
1085
|
}
|
|
1088
|
-
return fr(dr(e,
|
|
1086
|
+
return fr(dr(e, i, n), $e(e.algorithm, a), t, !e.keysOnly && e.valueMapper);
|
|
1089
1087
|
}
|
|
1090
|
-
function fr(e, t, n,
|
|
1091
|
-
var
|
|
1092
|
-
return n(
|
|
1088
|
+
function fr(e, t, n, i) {
|
|
1089
|
+
var a = Z(i ? function(o, s, u) {
|
|
1090
|
+
return n(i(o), s, u);
|
|
1093
1091
|
} : n);
|
|
1094
1092
|
return e.then(function(o) {
|
|
1095
1093
|
if (o) return o.start(function() {
|
|
@@ -1102,7 +1100,7 @@ var jr = { exports: {} };
|
|
|
1102
1100
|
o.stop(u), s = Q;
|
|
1103
1101
|
}, function(u) {
|
|
1104
1102
|
o.fail(u), s = Q;
|
|
1105
|
-
}) ||
|
|
1103
|
+
}) || a(o.value, o, function(u) {
|
|
1106
1104
|
return s = u;
|
|
1107
1105
|
}), s();
|
|
1108
1106
|
});
|
|
@@ -1122,8 +1120,8 @@ var jr = { exports: {} };
|
|
|
1122
1120
|
}
|
|
1123
1121
|
if (this.remove !== void 0) {
|
|
1124
1122
|
var n = this.remove;
|
|
1125
|
-
if (B(n)) return B(e) ? e.filter(function(
|
|
1126
|
-
return !n.includes(
|
|
1123
|
+
if (B(n)) return B(e) ? e.filter(function(i) {
|
|
1124
|
+
return !n.includes(i);
|
|
1127
1125
|
}).sort() : [];
|
|
1128
1126
|
if (typeof n == "number") return Number(e) - n;
|
|
1129
1127
|
if (typeof n == "bigint") try {
|
|
@@ -1138,7 +1136,7 @@ var jr = { exports: {} };
|
|
|
1138
1136
|
function hr(e) {
|
|
1139
1137
|
Object.assign(this, e);
|
|
1140
1138
|
}
|
|
1141
|
-
var
|
|
1139
|
+
var ai = (Y.prototype._read = function(e, t) {
|
|
1142
1140
|
var n = this._ctx;
|
|
1143
1141
|
return n.error ? n.table._trans(null, te.bind(null, n.error)) : n.table._trans("readonly", e).then(t);
|
|
1144
1142
|
}, Y.prototype._write = function(e) {
|
|
@@ -1162,25 +1160,25 @@ var jr = { exports: {} };
|
|
|
1162
1160
|
}, Y.prototype.count = function(e) {
|
|
1163
1161
|
var t = this;
|
|
1164
1162
|
return this._read(function(n) {
|
|
1165
|
-
var
|
|
1166
|
-
if (qe(
|
|
1167
|
-
return Math.min(s,
|
|
1163
|
+
var i = t._ctx, a = i.table.core;
|
|
1164
|
+
if (qe(i, !0)) return a.count({ trans: n, query: { index: Mt(i, a.schema), range: i.range } }).then(function(s) {
|
|
1165
|
+
return Math.min(s, i.limit);
|
|
1168
1166
|
});
|
|
1169
1167
|
var o = 0;
|
|
1170
|
-
return Kt(
|
|
1168
|
+
return Kt(i, function() {
|
|
1171
1169
|
return ++o, !1;
|
|
1172
|
-
}, n,
|
|
1170
|
+
}, n, a).then(function() {
|
|
1173
1171
|
return o;
|
|
1174
1172
|
});
|
|
1175
1173
|
}).then(e);
|
|
1176
1174
|
}, Y.prototype.sortBy = function(e, t) {
|
|
1177
|
-
var n = e.split(".").reverse(),
|
|
1178
|
-
function o(g,
|
|
1179
|
-
return
|
|
1175
|
+
var n = e.split(".").reverse(), i = n[0], a = n.length - 1;
|
|
1176
|
+
function o(g, h) {
|
|
1177
|
+
return h ? o(g[n[h]], h - 1) : g[i];
|
|
1180
1178
|
}
|
|
1181
1179
|
var s = this._ctx.dir === "next" ? 1 : -1;
|
|
1182
|
-
function u(g,
|
|
1183
|
-
return g = o(g,
|
|
1180
|
+
function u(g, h) {
|
|
1181
|
+
return g = o(g, a), h = o(h, a), g < h ? -s : h < g ? s : 0;
|
|
1184
1182
|
}
|
|
1185
1183
|
return this.toArray(function(g) {
|
|
1186
1184
|
return g.sort(u);
|
|
@@ -1188,17 +1186,17 @@ var jr = { exports: {} };
|
|
|
1188
1186
|
}, Y.prototype.toArray = function(e) {
|
|
1189
1187
|
var t = this;
|
|
1190
1188
|
return this._read(function(n) {
|
|
1191
|
-
var
|
|
1192
|
-
if (
|
|
1193
|
-
var
|
|
1194
|
-
return
|
|
1195
|
-
return u = u.result,
|
|
1189
|
+
var i = t._ctx;
|
|
1190
|
+
if (i.dir === "next" && qe(i, !0) && 0 < i.limit) {
|
|
1191
|
+
var a = i.valueMapper, o = Mt(i, i.table.core.schema);
|
|
1192
|
+
return i.table.core.query({ trans: n, limit: i.limit, values: !0, query: { index: o, range: i.range } }).then(function(u) {
|
|
1193
|
+
return u = u.result, a ? u.map(a) : u;
|
|
1196
1194
|
});
|
|
1197
1195
|
}
|
|
1198
1196
|
var s = [];
|
|
1199
|
-
return Kt(
|
|
1197
|
+
return Kt(i, function(u) {
|
|
1200
1198
|
return s.push(u);
|
|
1201
|
-
}, n,
|
|
1199
|
+
}, n, i.table.core).then(function() {
|
|
1202
1200
|
return s;
|
|
1203
1201
|
});
|
|
1204
1202
|
}, e);
|
|
@@ -1206,9 +1204,9 @@ var jr = { exports: {} };
|
|
|
1206
1204
|
var t = this._ctx;
|
|
1207
1205
|
return e <= 0 || (t.offset += e, qe(t) ? yn(t, function() {
|
|
1208
1206
|
var n = e;
|
|
1209
|
-
return function(
|
|
1210
|
-
return n === 0 || (n === 1 ? --n :
|
|
1211
|
-
|
|
1207
|
+
return function(i, a) {
|
|
1208
|
+
return n === 0 || (n === 1 ? --n : a(function() {
|
|
1209
|
+
i.advance(n), n = 0;
|
|
1212
1210
|
}), !1);
|
|
1213
1211
|
};
|
|
1214
1212
|
}) : yn(t, function() {
|
|
@@ -1220,13 +1218,13 @@ var jr = { exports: {} };
|
|
|
1220
1218
|
}, Y.prototype.limit = function(e) {
|
|
1221
1219
|
return this._ctx.limit = Math.min(this._ctx.limit, e), yn(this._ctx, function() {
|
|
1222
1220
|
var t = e;
|
|
1223
|
-
return function(n,
|
|
1224
|
-
return --t <= 0 && a
|
|
1221
|
+
return function(n, i, a) {
|
|
1222
|
+
return --t <= 0 && i(a), 0 <= t;
|
|
1225
1223
|
};
|
|
1226
1224
|
}, !0), this;
|
|
1227
1225
|
}, Y.prototype.until = function(e, t) {
|
|
1228
|
-
return gn(this._ctx, function(n,
|
|
1229
|
-
return !e(n.value) || (a
|
|
1226
|
+
return gn(this._ctx, function(n, i, a) {
|
|
1227
|
+
return !e(n.value) || (i(a), t);
|
|
1230
1228
|
}), this;
|
|
1231
1229
|
}, Y.prototype.first = function(e) {
|
|
1232
1230
|
return this.limit(1).toArray(function(t) {
|
|
@@ -1249,37 +1247,37 @@ var jr = { exports: {} };
|
|
|
1249
1247
|
return this.reverse();
|
|
1250
1248
|
}, Y.prototype.eachKey = function(e) {
|
|
1251
1249
|
var t = this._ctx;
|
|
1252
|
-
return t.keysOnly = !t.isMatch, this.each(function(n,
|
|
1253
|
-
e(
|
|
1250
|
+
return t.keysOnly = !t.isMatch, this.each(function(n, i) {
|
|
1251
|
+
e(i.key, i);
|
|
1254
1252
|
});
|
|
1255
1253
|
}, Y.prototype.eachUniqueKey = function(e) {
|
|
1256
1254
|
return this._ctx.unique = "unique", this.eachKey(e);
|
|
1257
1255
|
}, Y.prototype.eachPrimaryKey = function(e) {
|
|
1258
1256
|
var t = this._ctx;
|
|
1259
|
-
return t.keysOnly = !t.isMatch, this.each(function(n,
|
|
1260
|
-
e(
|
|
1257
|
+
return t.keysOnly = !t.isMatch, this.each(function(n, i) {
|
|
1258
|
+
e(i.primaryKey, i);
|
|
1261
1259
|
});
|
|
1262
1260
|
}, Y.prototype.keys = function(e) {
|
|
1263
1261
|
var t = this._ctx;
|
|
1264
1262
|
t.keysOnly = !t.isMatch;
|
|
1265
1263
|
var n = [];
|
|
1266
|
-
return this.each(function(
|
|
1267
|
-
n.push(
|
|
1264
|
+
return this.each(function(i, a) {
|
|
1265
|
+
n.push(a.key);
|
|
1268
1266
|
}).then(function() {
|
|
1269
1267
|
return n;
|
|
1270
1268
|
}).then(e);
|
|
1271
1269
|
}, Y.prototype.primaryKeys = function(e) {
|
|
1272
1270
|
var t = this._ctx;
|
|
1273
|
-
if (t.dir === "next" && qe(t, !0) && 0 < t.limit) return this._read(function(
|
|
1274
|
-
var
|
|
1275
|
-
return t.table.core.query({ trans:
|
|
1276
|
-
}).then(function(
|
|
1277
|
-
return
|
|
1271
|
+
if (t.dir === "next" && qe(t, !0) && 0 < t.limit) return this._read(function(i) {
|
|
1272
|
+
var a = Mt(t, t.table.core.schema);
|
|
1273
|
+
return t.table.core.query({ trans: i, values: !1, limit: t.limit, query: { index: a, range: t.range } });
|
|
1274
|
+
}).then(function(i) {
|
|
1275
|
+
return i.result;
|
|
1278
1276
|
}).then(e);
|
|
1279
1277
|
t.keysOnly = !t.isMatch;
|
|
1280
1278
|
var n = [];
|
|
1281
|
-
return this.each(function(
|
|
1282
|
-
n.push(
|
|
1279
|
+
return this.each(function(i, a) {
|
|
1280
|
+
n.push(a.primaryKey);
|
|
1283
1281
|
}).then(function() {
|
|
1284
1282
|
return n;
|
|
1285
1283
|
}).then(e);
|
|
@@ -1295,47 +1293,47 @@ var jr = { exports: {} };
|
|
|
1295
1293
|
var e = this._ctx, e = e.index && e.table.schema.idxByName[e.index];
|
|
1296
1294
|
if (!e || !e.multi) return this;
|
|
1297
1295
|
var t = {};
|
|
1298
|
-
return gn(this._ctx, function(
|
|
1299
|
-
var
|
|
1300
|
-
return t[
|
|
1296
|
+
return gn(this._ctx, function(a) {
|
|
1297
|
+
var i = a.primaryKey.toString(), a = q(t, i);
|
|
1298
|
+
return t[i] = !0, !a;
|
|
1301
1299
|
}), this;
|
|
1302
1300
|
}, Y.prototype.modify = function(e) {
|
|
1303
1301
|
var t = this, n = this._ctx;
|
|
1304
|
-
return this._write(function(
|
|
1305
|
-
var
|
|
1306
|
-
s = typeof e == "function" ? e : (
|
|
1302
|
+
return this._write(function(i) {
|
|
1303
|
+
var a, o, s;
|
|
1304
|
+
s = typeof e == "function" ? e : (a = R(e), o = a.length, function(y) {
|
|
1307
1305
|
for (var S = !1, E = 0; E < o; ++E) {
|
|
1308
|
-
var O =
|
|
1309
|
-
x instanceof ht ? (le(y, O, x.execute(
|
|
1306
|
+
var O = a[E], x = e[O], I = ve(y, O);
|
|
1307
|
+
x instanceof ht ? (le(y, O, x.execute(I)), S = !0) : I !== x && (le(y, O, x), S = !0);
|
|
1310
1308
|
}
|
|
1311
1309
|
return S;
|
|
1312
1310
|
});
|
|
1313
1311
|
function u(y, O) {
|
|
1314
1312
|
var E = O.failures, O = O.numFailures;
|
|
1315
1313
|
m += y - O;
|
|
1316
|
-
for (var x = 0,
|
|
1317
|
-
var j =
|
|
1314
|
+
for (var x = 0, I = R(E); x < I.length; x++) {
|
|
1315
|
+
var j = I[x];
|
|
1318
1316
|
p.push(E[j]);
|
|
1319
1317
|
}
|
|
1320
1318
|
}
|
|
1321
|
-
var g = n.table.core,
|
|
1319
|
+
var g = n.table.core, h = g.schema.primaryKey, b = h.outbound, d = h.extractKey, v = t.db._options.modifyChunkSize || 200, p = [], m = 0, w = [];
|
|
1322
1320
|
return t.clone().primaryKeys().then(function(y) {
|
|
1323
1321
|
function S(O) {
|
|
1324
1322
|
var x = Math.min(v, y.length - O);
|
|
1325
|
-
return g.getMany({ trans:
|
|
1326
|
-
for (var j = [],
|
|
1327
|
-
var $ =
|
|
1328
|
-
s.call(F, F.value, F) !== !1 && (F.value == null ? M.push(y[O + P]) : b || H(d($), d(F.value)) === 0 ? (
|
|
1323
|
+
return g.getMany({ trans: i, keys: y.slice(O, O + x), cache: "immutable" }).then(function(I) {
|
|
1324
|
+
for (var j = [], C = [], T = b ? [] : null, M = [], P = 0; P < x; ++P) {
|
|
1325
|
+
var $ = I[P], F = { value: je($), primKey: y[O + P] };
|
|
1326
|
+
s.call(F, F.value, F) !== !1 && (F.value == null ? M.push(y[O + P]) : b || H(d($), d(F.value)) === 0 ? (C.push(F.value), b && T.push(y[O + P])) : (M.push(y[O + P]), j.push(F.value)));
|
|
1329
1327
|
}
|
|
1330
|
-
return Promise.resolve(0 < j.length && g.mutate({ trans:
|
|
1328
|
+
return Promise.resolve(0 < j.length && g.mutate({ trans: i, type: "add", values: j }).then(function(z) {
|
|
1331
1329
|
for (var U in z.failures) M.splice(parseInt(U), 1);
|
|
1332
1330
|
u(j.length, z);
|
|
1333
1331
|
})).then(function() {
|
|
1334
|
-
return (0 <
|
|
1335
|
-
return u(
|
|
1332
|
+
return (0 < C.length || E && typeof e == "object") && g.mutate({ trans: i, type: "put", keys: T, values: C, criteria: E, changeSpec: typeof e != "function" && e, isAdditionalChunk: 0 < O }).then(function(z) {
|
|
1333
|
+
return u(C.length, z);
|
|
1336
1334
|
});
|
|
1337
1335
|
}).then(function() {
|
|
1338
|
-
return (0 < M.length || E && e === mn) && g.mutate({ trans:
|
|
1336
|
+
return (0 < M.length || E && e === mn) && g.mutate({ trans: i, type: "delete", keys: M, criteria: E, isAdditionalChunk: 0 < O }).then(function(z) {
|
|
1339
1337
|
return u(M.length, z);
|
|
1340
1338
|
});
|
|
1341
1339
|
}).then(function() {
|
|
@@ -1353,9 +1351,9 @@ var jr = { exports: {} };
|
|
|
1353
1351
|
}, Y.prototype.delete = function() {
|
|
1354
1352
|
var e = this._ctx, t = e.range;
|
|
1355
1353
|
return qe(e) && (e.isPrimKey || t.type === 3) ? this._write(function(n) {
|
|
1356
|
-
var
|
|
1357
|
-
return e.table.core.count({ trans: n, query: { index:
|
|
1358
|
-
return e.table.core.mutate({ trans: n, type: "deleteRange", range:
|
|
1354
|
+
var i = e.table.core.schema.primaryKey, a = t;
|
|
1355
|
+
return e.table.core.count({ trans: n, query: { index: i, range: a } }).then(function(o) {
|
|
1356
|
+
return e.table.core.mutate({ trans: n, type: "deleteRange", range: a }).then(function(s) {
|
|
1359
1357
|
var u = s.failures;
|
|
1360
1358
|
if (s.lastResult, s.results, s = s.numFailures, s) throw new Et("Could not delete some values", Object.keys(u).map(function(g) {
|
|
1361
1359
|
return u[g];
|
|
@@ -1370,10 +1368,10 @@ var jr = { exports: {} };
|
|
|
1370
1368
|
var mn = function(e, t) {
|
|
1371
1369
|
return t.value = null;
|
|
1372
1370
|
};
|
|
1373
|
-
function
|
|
1371
|
+
function oi(e, t) {
|
|
1374
1372
|
return e < t ? -1 : e === t ? 0 : 1;
|
|
1375
1373
|
}
|
|
1376
|
-
function
|
|
1374
|
+
function si(e, t) {
|
|
1377
1375
|
return t < e ? -1 : e === t ? 0 : 1;
|
|
1378
1376
|
}
|
|
1379
1377
|
function de(e, t, n) {
|
|
@@ -1384,13 +1382,13 @@ var jr = { exports: {} };
|
|
|
1384
1382
|
return pr("");
|
|
1385
1383
|
}).limit(0);
|
|
1386
1384
|
}
|
|
1387
|
-
function Nt(e, t, n,
|
|
1388
|
-
var
|
|
1385
|
+
function Nt(e, t, n, i) {
|
|
1386
|
+
var a, o, s, u, g, h, b, d = n.length;
|
|
1389
1387
|
if (!n.every(function(m) {
|
|
1390
1388
|
return typeof m == "string";
|
|
1391
|
-
})) return de(e,
|
|
1389
|
+
})) return de(e, ar);
|
|
1392
1390
|
function v(m) {
|
|
1393
|
-
|
|
1391
|
+
a = m === "next" ? function(y) {
|
|
1394
1392
|
return y.toUpperCase();
|
|
1395
1393
|
} : function(y) {
|
|
1396
1394
|
return y.toLowerCase();
|
|
@@ -1398,9 +1396,9 @@ var jr = { exports: {} };
|
|
|
1398
1396
|
return y.toLowerCase();
|
|
1399
1397
|
} : function(y) {
|
|
1400
1398
|
return y.toUpperCase();
|
|
1401
|
-
}, s = m === "next" ?
|
|
1399
|
+
}, s = m === "next" ? oi : si;
|
|
1402
1400
|
var w = n.map(function(y) {
|
|
1403
|
-
return { lower: o(y), upper:
|
|
1401
|
+
return { lower: o(y), upper: a(y) };
|
|
1404
1402
|
}).sort(function(y, S) {
|
|
1405
1403
|
return s(y.lower, S.lower);
|
|
1406
1404
|
});
|
|
@@ -1408,10 +1406,10 @@ var jr = { exports: {} };
|
|
|
1408
1406
|
return y.upper;
|
|
1409
1407
|
}), g = w.map(function(y) {
|
|
1410
1408
|
return y.lower;
|
|
1411
|
-
}), b = (
|
|
1409
|
+
}), b = (h = m) === "next" ? "" : i;
|
|
1412
1410
|
}
|
|
1413
1411
|
v("next"), e = new e.Collection(e, function() {
|
|
1414
|
-
return Ce(u[0], g[d - 1] +
|
|
1412
|
+
return Ce(u[0], g[d - 1] + i);
|
|
1415
1413
|
}), e._ondirectionchange = function(m) {
|
|
1416
1414
|
v(m);
|
|
1417
1415
|
};
|
|
@@ -1422,81 +1420,81 @@ var jr = { exports: {} };
|
|
|
1422
1420
|
var E = o(S);
|
|
1423
1421
|
if (t(E, g, p)) return !0;
|
|
1424
1422
|
for (var O = null, x = p; x < d; ++x) {
|
|
1425
|
-
var
|
|
1423
|
+
var I = function(j, C, T, M, P, $) {
|
|
1426
1424
|
for (var F = Math.min(j.length, M.length), z = -1, U = 0; U < F; ++U) {
|
|
1427
|
-
var pe =
|
|
1428
|
-
if (pe !== M[U]) return P(j[U], T[U]) < 0 ? j.substr(0, U) + T[U] + T.substr(U + 1) : P(j[U], M[U]) < 0 ? j.substr(0, U) + M[U] + T.substr(U + 1) : 0 <= z ? j.substr(0, z) +
|
|
1425
|
+
var pe = C[U];
|
|
1426
|
+
if (pe !== M[U]) return P(j[U], T[U]) < 0 ? j.substr(0, U) + T[U] + T.substr(U + 1) : P(j[U], M[U]) < 0 ? j.substr(0, U) + M[U] + T.substr(U + 1) : 0 <= z ? j.substr(0, z) + C[z] + T.substr(z + 1) : null;
|
|
1429
1427
|
P(j[U], pe) < 0 && (z = U);
|
|
1430
1428
|
}
|
|
1431
1429
|
return F < M.length && $ === "next" ? j + T.substr(j.length) : F < j.length && $ === "prev" ? j.substr(0, T.length) : z < 0 ? null : j.substr(0, z) + M[z] + T.substr(z + 1);
|
|
1432
|
-
}(S, E, u[x], g[x], s,
|
|
1433
|
-
|
|
1430
|
+
}(S, E, u[x], g[x], s, h);
|
|
1431
|
+
I === null && O === null ? p = x + 1 : (O === null || 0 < s(O, I)) && (O = I);
|
|
1434
1432
|
}
|
|
1435
1433
|
return w(O !== null ? function() {
|
|
1436
1434
|
m.continue(O + b);
|
|
1437
1435
|
} : y), !1;
|
|
1438
1436
|
}), e;
|
|
1439
1437
|
}
|
|
1440
|
-
function Ce(e, t, n,
|
|
1441
|
-
return { type: 2, lower: e, upper: t, lowerOpen: n, upperOpen:
|
|
1438
|
+
function Ce(e, t, n, i) {
|
|
1439
|
+
return { type: 2, lower: e, upper: t, lowerOpen: n, upperOpen: i };
|
|
1442
1440
|
}
|
|
1443
1441
|
function pr(e) {
|
|
1444
1442
|
return { type: 1, lower: e, upper: e };
|
|
1445
1443
|
}
|
|
1446
|
-
var gr = (Object.defineProperty(
|
|
1444
|
+
var gr = (Object.defineProperty(ae.prototype, "Collection", { get: function() {
|
|
1447
1445
|
return this._ctx.table.db.Collection;
|
|
1448
|
-
}, enumerable: !1, configurable: !0 }),
|
|
1449
|
-
n = n !== !1,
|
|
1446
|
+
}, enumerable: !1, configurable: !0 }), ae.prototype.between = function(e, t, n, i) {
|
|
1447
|
+
n = n !== !1, i = i === !0;
|
|
1450
1448
|
try {
|
|
1451
|
-
return 0 < this._cmp(e, t) || this._cmp(e, t) === 0 && (n ||
|
|
1452
|
-
return Ce(e, t, !n, !
|
|
1449
|
+
return 0 < this._cmp(e, t) || this._cmp(e, t) === 0 && (n || i) && (!n || !i) ? et(this) : new this.Collection(this, function() {
|
|
1450
|
+
return Ce(e, t, !n, !i);
|
|
1453
1451
|
});
|
|
1454
1452
|
} catch {
|
|
1455
1453
|
return de(this, _e);
|
|
1456
1454
|
}
|
|
1457
|
-
},
|
|
1455
|
+
}, ae.prototype.equals = function(e) {
|
|
1458
1456
|
return e == null ? de(this, _e) : new this.Collection(this, function() {
|
|
1459
1457
|
return pr(e);
|
|
1460
1458
|
});
|
|
1461
|
-
},
|
|
1459
|
+
}, ae.prototype.above = function(e) {
|
|
1462
1460
|
return e == null ? de(this, _e) : new this.Collection(this, function() {
|
|
1463
1461
|
return Ce(e, void 0, !0);
|
|
1464
1462
|
});
|
|
1465
|
-
},
|
|
1463
|
+
}, ae.prototype.aboveOrEqual = function(e) {
|
|
1466
1464
|
return e == null ? de(this, _e) : new this.Collection(this, function() {
|
|
1467
1465
|
return Ce(e, void 0, !1);
|
|
1468
1466
|
});
|
|
1469
|
-
},
|
|
1467
|
+
}, ae.prototype.below = function(e) {
|
|
1470
1468
|
return e == null ? de(this, _e) : new this.Collection(this, function() {
|
|
1471
1469
|
return Ce(void 0, e, !1, !0);
|
|
1472
1470
|
});
|
|
1473
|
-
},
|
|
1471
|
+
}, ae.prototype.belowOrEqual = function(e) {
|
|
1474
1472
|
return e == null ? de(this, _e) : new this.Collection(this, function() {
|
|
1475
1473
|
return Ce(void 0, e);
|
|
1476
1474
|
});
|
|
1477
|
-
},
|
|
1478
|
-
return typeof e != "string" ? de(this,
|
|
1479
|
-
},
|
|
1475
|
+
}, ae.prototype.startsWith = function(e) {
|
|
1476
|
+
return typeof e != "string" ? de(this, ar) : this.between(e, e + Ge, !0, !0);
|
|
1477
|
+
}, ae.prototype.startsWithIgnoreCase = function(e) {
|
|
1480
1478
|
return e === "" ? this.startsWith(e) : Nt(this, function(t, n) {
|
|
1481
1479
|
return t.indexOf(n[0]) === 0;
|
|
1482
1480
|
}, [e], Ge);
|
|
1483
|
-
},
|
|
1481
|
+
}, ae.prototype.equalsIgnoreCase = function(e) {
|
|
1484
1482
|
return Nt(this, function(t, n) {
|
|
1485
1483
|
return t === n[0];
|
|
1486
1484
|
}, [e], "");
|
|
1487
|
-
},
|
|
1485
|
+
}, ae.prototype.anyOfIgnoreCase = function() {
|
|
1488
1486
|
var e = we.apply(He, arguments);
|
|
1489
1487
|
return e.length === 0 ? et(this) : Nt(this, function(t, n) {
|
|
1490
1488
|
return n.indexOf(t) !== -1;
|
|
1491
1489
|
}, e, "");
|
|
1492
|
-
},
|
|
1490
|
+
}, ae.prototype.startsWithAnyOfIgnoreCase = function() {
|
|
1493
1491
|
var e = we.apply(He, arguments);
|
|
1494
1492
|
return e.length === 0 ? et(this) : Nt(this, function(t, n) {
|
|
1495
|
-
return n.some(function(
|
|
1496
|
-
return t.indexOf(
|
|
1493
|
+
return n.some(function(i) {
|
|
1494
|
+
return t.indexOf(i) === 0;
|
|
1497
1495
|
});
|
|
1498
1496
|
}, e, Ge);
|
|
1499
|
-
},
|
|
1497
|
+
}, ae.prototype.anyOf = function() {
|
|
1500
1498
|
var e = this, t = we.apply(He, arguments), n = this._cmp;
|
|
1501
1499
|
try {
|
|
1502
1500
|
t.sort(n);
|
|
@@ -1504,22 +1502,22 @@ var jr = { exports: {} };
|
|
|
1504
1502
|
return de(this, _e);
|
|
1505
1503
|
}
|
|
1506
1504
|
if (t.length === 0) return et(this);
|
|
1507
|
-
var
|
|
1505
|
+
var i = new this.Collection(this, function() {
|
|
1508
1506
|
return Ce(t[0], t[t.length - 1]);
|
|
1509
1507
|
});
|
|
1510
|
-
|
|
1508
|
+
i._ondirectionchange = function(o) {
|
|
1511
1509
|
n = o === "next" ? e._ascending : e._descending, t.sort(n);
|
|
1512
1510
|
};
|
|
1513
|
-
var
|
|
1514
|
-
return
|
|
1515
|
-
for (var g = o.key; 0 < n(g, t[
|
|
1516
|
-
return n(g, t[
|
|
1517
|
-
o.continue(t[
|
|
1511
|
+
var a = 0;
|
|
1512
|
+
return i._addAlgorithm(function(o, s, u) {
|
|
1513
|
+
for (var g = o.key; 0 < n(g, t[a]); ) if (++a === t.length) return s(u), !1;
|
|
1514
|
+
return n(g, t[a]) === 0 || (s(function() {
|
|
1515
|
+
o.continue(t[a]);
|
|
1518
1516
|
}), !1);
|
|
1519
|
-
}),
|
|
1520
|
-
},
|
|
1517
|
+
}), i;
|
|
1518
|
+
}, ae.prototype.notEqual = function(e) {
|
|
1521
1519
|
return this.inAnyRange([[-1 / 0, e], [e, this.db._maxKey]], { includeLowers: !1, includeUppers: !1 });
|
|
1522
|
-
},
|
|
1520
|
+
}, ae.prototype.noneOf = function() {
|
|
1523
1521
|
var e = we.apply(He, arguments);
|
|
1524
1522
|
if (e.length === 0) return new this.Collection(this);
|
|
1525
1523
|
try {
|
|
@@ -1527,62 +1525,62 @@ var jr = { exports: {} };
|
|
|
1527
1525
|
} catch {
|
|
1528
1526
|
return de(this, _e);
|
|
1529
1527
|
}
|
|
1530
|
-
var t = e.reduce(function(n,
|
|
1531
|
-
return n ? n.concat([[n[n.length - 1][1],
|
|
1528
|
+
var t = e.reduce(function(n, i) {
|
|
1529
|
+
return n ? n.concat([[n[n.length - 1][1], i]]) : [[-1 / 0, i]];
|
|
1532
1530
|
}, null);
|
|
1533
1531
|
return t.push([e[e.length - 1], this.db._maxKey]), this.inAnyRange(t, { includeLowers: !1, includeUppers: !1 });
|
|
1534
|
-
},
|
|
1535
|
-
var n = this,
|
|
1532
|
+
}, ae.prototype.inAnyRange = function(S, t) {
|
|
1533
|
+
var n = this, i = this._cmp, a = this._ascending, o = this._descending, s = this._min, u = this._max;
|
|
1536
1534
|
if (S.length === 0) return et(this);
|
|
1537
1535
|
if (!S.every(function(E) {
|
|
1538
|
-
return E[0] !== void 0 && E[1] !== void 0 &&
|
|
1536
|
+
return E[0] !== void 0 && E[1] !== void 0 && a(E[0], E[1]) <= 0;
|
|
1539
1537
|
})) return de(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", G.InvalidArgument);
|
|
1540
|
-
var g = !t || t.includeLowers !== !1,
|
|
1538
|
+
var g = !t || t.includeLowers !== !1, h = t && t.includeUppers === !0, b, d = a;
|
|
1541
1539
|
function v(E, O) {
|
|
1542
1540
|
return d(E[0], O[0]);
|
|
1543
1541
|
}
|
|
1544
1542
|
try {
|
|
1545
1543
|
(b = S.reduce(function(E, O) {
|
|
1546
|
-
for (var x = 0,
|
|
1544
|
+
for (var x = 0, I = E.length; x < I; ++x) {
|
|
1547
1545
|
var j = E[x];
|
|
1548
|
-
if (
|
|
1546
|
+
if (i(O[0], j[1]) < 0 && 0 < i(O[1], j[0])) {
|
|
1549
1547
|
j[0] = s(j[0], O[0]), j[1] = u(j[1], O[1]);
|
|
1550
1548
|
break;
|
|
1551
1549
|
}
|
|
1552
1550
|
}
|
|
1553
|
-
return x ===
|
|
1551
|
+
return x === I && E.push(O), E;
|
|
1554
1552
|
}, [])).sort(v);
|
|
1555
1553
|
} catch {
|
|
1556
1554
|
return de(this, _e);
|
|
1557
1555
|
}
|
|
1558
|
-
var p = 0, m =
|
|
1559
|
-
return 0 <
|
|
1556
|
+
var p = 0, m = h ? function(E) {
|
|
1557
|
+
return 0 < a(E, b[p][1]);
|
|
1560
1558
|
} : function(E) {
|
|
1561
|
-
return 0 <=
|
|
1559
|
+
return 0 <= a(E, b[p][1]);
|
|
1562
1560
|
}, w = g ? function(E) {
|
|
1563
1561
|
return 0 < o(E, b[p][0]);
|
|
1564
1562
|
} : function(E) {
|
|
1565
1563
|
return 0 <= o(E, b[p][0]);
|
|
1566
1564
|
}, y = m, S = new this.Collection(this, function() {
|
|
1567
|
-
return Ce(b[0][0], b[b.length - 1][1], !g, !
|
|
1565
|
+
return Ce(b[0][0], b[b.length - 1][1], !g, !h);
|
|
1568
1566
|
});
|
|
1569
1567
|
return S._ondirectionchange = function(E) {
|
|
1570
|
-
d = E === "next" ? (y = m,
|
|
1568
|
+
d = E === "next" ? (y = m, a) : (y = w, o), b.sort(v);
|
|
1571
1569
|
}, S._addAlgorithm(function(E, O, x) {
|
|
1572
|
-
for (var
|
|
1573
|
-
return !m(
|
|
1574
|
-
d ===
|
|
1570
|
+
for (var I, j = E.key; y(j); ) if (++p === b.length) return O(x), !1;
|
|
1571
|
+
return !m(I = j) && !w(I) || (n._cmp(j, b[p][1]) === 0 || n._cmp(j, b[p][0]) === 0 || O(function() {
|
|
1572
|
+
d === a ? E.continue(b[p][0]) : E.continue(b[p][1]);
|
|
1575
1573
|
}), !1);
|
|
1576
1574
|
}), S;
|
|
1577
|
-
},
|
|
1575
|
+
}, ae.prototype.startsWithAnyOf = function() {
|
|
1578
1576
|
var e = we.apply(He, arguments);
|
|
1579
1577
|
return e.every(function(t) {
|
|
1580
1578
|
return typeof t == "string";
|
|
1581
1579
|
}) ? e.length === 0 ? et(this) : this.inAnyRange(e.map(function(t) {
|
|
1582
1580
|
return [t, t + Ge];
|
|
1583
1581
|
})) : de(this, "startsWithAnyOf() only works with strings");
|
|
1584
|
-
},
|
|
1585
|
-
function
|
|
1582
|
+
}, ae);
|
|
1583
|
+
function ae() {
|
|
1586
1584
|
}
|
|
1587
1585
|
function me(e) {
|
|
1588
1586
|
return Z(function(t) {
|
|
@@ -1592,7 +1590,7 @@ var jr = { exports: {} };
|
|
|
1592
1590
|
function pt(e) {
|
|
1593
1591
|
e.stopPropagation && e.stopPropagation(), e.preventDefault && e.preventDefault();
|
|
1594
1592
|
}
|
|
1595
|
-
var gt = "storagemutated", bn = "x-storagemutated-1", Re = dt(null, gt),
|
|
1593
|
+
var gt = "storagemutated", bn = "x-storagemutated-1", Re = dt(null, gt), ci = (be.prototype._lock = function() {
|
|
1596
1594
|
return rt(!L.global), ++this._reculock, this._reculock !== 1 || L.global || (L.lockOwnerFor = this), this;
|
|
1597
1595
|
}, be.prototype._unlock = function() {
|
|
1598
1596
|
if (rt(!L.global), --this._reculock == 0) for (L.global || (L.lockOwnerFor = null); 0 < this._blockedFuncs.length && !this._locked(); ) {
|
|
@@ -1608,65 +1606,65 @@ var jr = { exports: {} };
|
|
|
1608
1606
|
}, be.prototype.create = function(e) {
|
|
1609
1607
|
var t = this;
|
|
1610
1608
|
if (!this.mode) return this;
|
|
1611
|
-
var n = this.db.idbdb,
|
|
1612
|
-
if (rt(!this.idbtrans), !e && !n) switch (
|
|
1609
|
+
var n = this.db.idbdb, i = this.db._state.dbOpenError;
|
|
1610
|
+
if (rt(!this.idbtrans), !e && !n) switch (i && i.name) {
|
|
1613
1611
|
case "DatabaseClosedError":
|
|
1614
|
-
throw new G.DatabaseClosed(
|
|
1612
|
+
throw new G.DatabaseClosed(i);
|
|
1615
1613
|
case "MissingAPIError":
|
|
1616
|
-
throw new G.MissingAPI(
|
|
1614
|
+
throw new G.MissingAPI(i.message, i);
|
|
1617
1615
|
default:
|
|
1618
|
-
throw new G.OpenFailed(
|
|
1616
|
+
throw new G.OpenFailed(i);
|
|
1619
1617
|
}
|
|
1620
1618
|
if (!this.active) throw new G.TransactionInactive();
|
|
1621
|
-
return rt(this._completion._state === null), (e = this.idbtrans = e || (this.db.core || n).transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability })).onerror = Z(function(
|
|
1622
|
-
pt(
|
|
1623
|
-
}), e.onabort = Z(function(
|
|
1624
|
-
pt(
|
|
1619
|
+
return rt(this._completion._state === null), (e = this.idbtrans = e || (this.db.core || n).transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability })).onerror = Z(function(a) {
|
|
1620
|
+
pt(a), t._reject(e.error);
|
|
1621
|
+
}), e.onabort = Z(function(a) {
|
|
1622
|
+
pt(a), t.active && t._reject(new G.Abort(e.error)), t.active = !1, t.on("abort").fire(a);
|
|
1625
1623
|
}), e.oncomplete = Z(function() {
|
|
1626
1624
|
t.active = !1, t._resolve(), "mutatedParts" in e && Re.storagemutated.fire(e.mutatedParts);
|
|
1627
1625
|
}), this;
|
|
1628
1626
|
}, be.prototype._promise = function(e, t, n) {
|
|
1629
|
-
var
|
|
1627
|
+
var i = this;
|
|
1630
1628
|
if (e === "readwrite" && this.mode !== "readwrite") return te(new G.ReadOnly("Transaction is readonly"));
|
|
1631
1629
|
if (!this.active) return te(new G.TransactionInactive());
|
|
1632
1630
|
if (this._locked()) return new N(function(o, s) {
|
|
1633
|
-
|
|
1634
|
-
|
|
1631
|
+
i._blockedFuncs.push([function() {
|
|
1632
|
+
i._promise(e, t, n).then(o, s);
|
|
1635
1633
|
}, L]);
|
|
1636
1634
|
});
|
|
1637
1635
|
if (n) return De(function() {
|
|
1638
1636
|
var o = new N(function(s, u) {
|
|
1639
|
-
|
|
1640
|
-
var g = t(s, u,
|
|
1637
|
+
i._lock();
|
|
1638
|
+
var g = t(s, u, i);
|
|
1641
1639
|
g && g.then && g.then(s, u);
|
|
1642
1640
|
});
|
|
1643
1641
|
return o.finally(function() {
|
|
1644
|
-
return
|
|
1642
|
+
return i._unlock();
|
|
1645
1643
|
}), o._lib = !0, o;
|
|
1646
1644
|
});
|
|
1647
|
-
var
|
|
1648
|
-
var u = t(o, s,
|
|
1645
|
+
var a = new N(function(o, s) {
|
|
1646
|
+
var u = t(o, s, i);
|
|
1649
1647
|
u && u.then && u.then(o, s);
|
|
1650
1648
|
});
|
|
1651
|
-
return
|
|
1649
|
+
return a._lib = !0, a;
|
|
1652
1650
|
}, be.prototype._root = function() {
|
|
1653
1651
|
return this.parent ? this.parent._root() : this;
|
|
1654
1652
|
}, be.prototype.waitFor = function(e) {
|
|
1655
|
-
var t, n = this._root(),
|
|
1653
|
+
var t, n = this._root(), i = N.resolve(e);
|
|
1656
1654
|
n._waitingFor ? n._waitingFor = n._waitingFor.then(function() {
|
|
1657
|
-
return
|
|
1658
|
-
}) : (n._waitingFor =
|
|
1655
|
+
return i;
|
|
1656
|
+
}) : (n._waitingFor = i, n._waitingQueue = [], t = n.idbtrans.objectStore(n.storeNames[0]), function o() {
|
|
1659
1657
|
for (++n._spinCount; n._waitingQueue.length; ) n._waitingQueue.shift()();
|
|
1660
1658
|
n._waitingFor && (t.get(-1 / 0).onsuccess = o);
|
|
1661
1659
|
}());
|
|
1662
|
-
var
|
|
1660
|
+
var a = n._waitingFor;
|
|
1663
1661
|
return new N(function(o, s) {
|
|
1664
|
-
|
|
1662
|
+
i.then(function(u) {
|
|
1665
1663
|
return n._waitingQueue.push(Z(o.bind(null, u)));
|
|
1666
1664
|
}, function(u) {
|
|
1667
1665
|
return n._waitingQueue.push(Z(s.bind(null, u)));
|
|
1668
1666
|
}).finally(function() {
|
|
1669
|
-
n._waitingFor ===
|
|
1667
|
+
n._waitingFor === a && (n._waitingFor = null);
|
|
1670
1668
|
});
|
|
1671
1669
|
});
|
|
1672
1670
|
}, be.prototype.abort = function() {
|
|
@@ -1680,19 +1678,19 @@ var jr = { exports: {} };
|
|
|
1680
1678
|
}, be);
|
|
1681
1679
|
function be() {
|
|
1682
1680
|
}
|
|
1683
|
-
function vn(e, t, n,
|
|
1684
|
-
return { name: e, keyPath: t, unique: n, multi:
|
|
1681
|
+
function vn(e, t, n, i, a, o, s) {
|
|
1682
|
+
return { name: e, keyPath: t, unique: n, multi: i, auto: a, compound: o, src: (n && !s ? "&" : "") + (i ? "*" : "") + (a ? "++" : "") + yr(t) };
|
|
1685
1683
|
}
|
|
1686
1684
|
function yr(e) {
|
|
1687
1685
|
return typeof e == "string" ? e : e ? "[" + [].join.call(e, "+") + "]" : "";
|
|
1688
1686
|
}
|
|
1689
1687
|
function wn(e, t, n) {
|
|
1690
|
-
return { name: e, primKey: t, indexes: n, mappedClass: null, idxByName: (
|
|
1691
|
-
return [
|
|
1692
|
-
}, n.reduce(function(
|
|
1693
|
-
return s =
|
|
1688
|
+
return { name: e, primKey: t, indexes: n, mappedClass: null, idxByName: (i = function(a) {
|
|
1689
|
+
return [a.name, a];
|
|
1690
|
+
}, n.reduce(function(a, o, s) {
|
|
1691
|
+
return s = i(o, s), s && (a[s[0]] = s[1]), a;
|
|
1694
1692
|
}, {})) };
|
|
1695
|
-
var
|
|
1693
|
+
var i;
|
|
1696
1694
|
}
|
|
1697
1695
|
var yt = function(e) {
|
|
1698
1696
|
try {
|
|
@@ -1719,44 +1717,44 @@ var jr = { exports: {} };
|
|
|
1719
1717
|
function mr(e) {
|
|
1720
1718
|
return [].slice.call(e);
|
|
1721
1719
|
}
|
|
1722
|
-
var
|
|
1720
|
+
var ui = 0;
|
|
1723
1721
|
function mt(e) {
|
|
1724
1722
|
return e == null ? ":id" : typeof e == "string" ? e : "[".concat(e.join("+"), "]");
|
|
1725
1723
|
}
|
|
1726
|
-
function
|
|
1727
|
-
function
|
|
1724
|
+
function li(e, t, g) {
|
|
1725
|
+
function i(y) {
|
|
1728
1726
|
if (y.type === 3) return null;
|
|
1729
1727
|
if (y.type === 4) throw new Error("Cannot convert never type to IDBKeyRange");
|
|
1730
1728
|
var p = y.lower, m = y.upper, w = y.lowerOpen, y = y.upperOpen;
|
|
1731
1729
|
return p === void 0 ? m === void 0 ? null : t.upperBound(m, !!y) : m === void 0 ? t.lowerBound(p, !!w) : t.bound(p, m, !!w, !!y);
|
|
1732
1730
|
}
|
|
1733
|
-
function
|
|
1731
|
+
function a(v) {
|
|
1734
1732
|
var p, m = v.name;
|
|
1735
1733
|
return { name: m, schema: v, mutate: function(w) {
|
|
1736
1734
|
var y = w.trans, S = w.type, E = w.keys, O = w.values, x = w.range;
|
|
1737
|
-
return new Promise(function(
|
|
1738
|
-
|
|
1739
|
-
var
|
|
1735
|
+
return new Promise(function(I, j) {
|
|
1736
|
+
I = Z(I);
|
|
1737
|
+
var C = y.objectStore(m), T = C.keyPath == null, M = S === "put" || S === "add";
|
|
1740
1738
|
if (!M && S !== "delete" && S !== "deleteRange") throw new Error("Invalid operation type: " + S);
|
|
1741
1739
|
var P, $ = (E || O || { length: 1 }).length;
|
|
1742
1740
|
if (E && O && E.length !== O.length) throw new Error("Given keys array must have same length as given values array.");
|
|
1743
|
-
if ($ === 0) return
|
|
1741
|
+
if ($ === 0) return I({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
|
|
1744
1742
|
function F(ue) {
|
|
1745
1743
|
++pe, pt(ue);
|
|
1746
1744
|
}
|
|
1747
1745
|
var z = [], U = [], pe = 0;
|
|
1748
1746
|
if (S === "deleteRange") {
|
|
1749
|
-
if (x.type === 4) return
|
|
1750
|
-
x.type === 3 ? z.push(P =
|
|
1747
|
+
if (x.type === 4) return I({ numFailures: pe, failures: U, results: [], lastResult: void 0 });
|
|
1748
|
+
x.type === 3 ? z.push(P = C.clear()) : z.push(P = C.delete(i(x)));
|
|
1751
1749
|
} else {
|
|
1752
1750
|
var T = M ? T ? [O, E] : [O, null] : [E, null], W = T[0], oe = T[1];
|
|
1753
|
-
if (M) for (var se = 0; se < $; ++se) z.push(P = oe && oe[se] !== void 0 ?
|
|
1754
|
-
else for (se = 0; se < $; ++se) z.push(P =
|
|
1751
|
+
if (M) for (var se = 0; se < $; ++se) z.push(P = oe && oe[se] !== void 0 ? C[S](W[se], oe[se]) : C[S](W[se])), P.onerror = F;
|
|
1752
|
+
else for (se = 0; se < $; ++se) z.push(P = C[S](W[se])), P.onerror = F;
|
|
1755
1753
|
}
|
|
1756
1754
|
function Vt(ue) {
|
|
1757
1755
|
ue = ue.target.result, z.forEach(function(We, Ln) {
|
|
1758
1756
|
return We.error != null && (U[Ln] = We.error);
|
|
1759
|
-
}),
|
|
1757
|
+
}), I({ numFailures: pe, failures: U, results: S === "delete" ? E : z.map(function(We) {
|
|
1760
1758
|
return We.result;
|
|
1761
1759
|
}), lastResult: ue });
|
|
1762
1760
|
}
|
|
@@ -1768,40 +1766,40 @@ var jr = { exports: {} };
|
|
|
1768
1766
|
var y = w.trans, S = w.keys;
|
|
1769
1767
|
return new Promise(function(E, O) {
|
|
1770
1768
|
E = Z(E);
|
|
1771
|
-
for (var x,
|
|
1772
|
-
z = z.target,
|
|
1773
|
-
}, $ = me(O), F = 0; F < j; ++F) S[F] != null && ((x =
|
|
1774
|
-
T === 0 && E(
|
|
1769
|
+
for (var x, I = y.objectStore(m), j = S.length, C = new Array(j), T = 0, M = 0, P = function(z) {
|
|
1770
|
+
z = z.target, C[z._pos] = z.result, ++M === T && E(C);
|
|
1771
|
+
}, $ = me(O), F = 0; F < j; ++F) S[F] != null && ((x = I.get(S[F]))._pos = F, x.onsuccess = P, x.onerror = $, ++T);
|
|
1772
|
+
T === 0 && E(C);
|
|
1775
1773
|
});
|
|
1776
1774
|
}, get: function(w) {
|
|
1777
1775
|
var y = w.trans, S = w.key;
|
|
1778
1776
|
return new Promise(function(E, O) {
|
|
1779
1777
|
E = Z(E);
|
|
1780
1778
|
var x = y.objectStore(m).get(S);
|
|
1781
|
-
x.onsuccess = function(
|
|
1782
|
-
return E(
|
|
1779
|
+
x.onsuccess = function(I) {
|
|
1780
|
+
return E(I.target.result);
|
|
1783
1781
|
}, x.onerror = me(O);
|
|
1784
1782
|
});
|
|
1785
|
-
}, query: (p =
|
|
1783
|
+
}, query: (p = h, function(w) {
|
|
1786
1784
|
return new Promise(function(y, S) {
|
|
1787
1785
|
y = Z(y);
|
|
1788
|
-
var E, O, x, T = w.trans,
|
|
1786
|
+
var E, O, x, T = w.trans, I = w.values, j = w.limit, P = w.query, C = j === 1 / 0 ? void 0 : j, M = P.index, P = P.range, T = T.objectStore(m), M = M.isPrimaryKey ? T : T.index(M.name), P = i(P);
|
|
1789
1787
|
if (j === 0) return y({ result: [] });
|
|
1790
|
-
p ? ((
|
|
1788
|
+
p ? ((C = I ? M.getAll(P, C) : M.getAllKeys(P, C)).onsuccess = function($) {
|
|
1791
1789
|
return y({ result: $.target.result });
|
|
1792
|
-
},
|
|
1790
|
+
}, C.onerror = me(S)) : (E = 0, O = !I && "openKeyCursor" in M ? M.openKeyCursor(P) : M.openCursor(P), x = [], O.onsuccess = function($) {
|
|
1793
1791
|
var F = O.result;
|
|
1794
|
-
return F ? (x.push(
|
|
1792
|
+
return F ? (x.push(I ? F.value : F.primaryKey), ++E === j ? y({ result: x }) : void F.continue()) : y({ result: x });
|
|
1795
1793
|
}, O.onerror = me(S));
|
|
1796
1794
|
});
|
|
1797
1795
|
}), openCursor: function(w) {
|
|
1798
1796
|
var y = w.trans, S = w.values, E = w.query, O = w.reverse, x = w.unique;
|
|
1799
|
-
return new Promise(function(
|
|
1800
|
-
|
|
1801
|
-
var M = E.index,
|
|
1797
|
+
return new Promise(function(I, j) {
|
|
1798
|
+
I = Z(I);
|
|
1799
|
+
var M = E.index, C = E.range, T = y.objectStore(m), T = M.isPrimaryKey ? T : T.index(M.name), M = O ? x ? "prevunique" : "prev" : x ? "nextunique" : "next", P = !S && "openKeyCursor" in T ? T.openKeyCursor(i(C), M) : T.openCursor(i(C), M);
|
|
1802
1800
|
P.onerror = me(j), P.onsuccess = Z(function($) {
|
|
1803
1801
|
var F, z, U, pe, W = P.result;
|
|
1804
|
-
W ? (W.___id = ++
|
|
1802
|
+
W ? (W.___id = ++ui, W.done = !1, F = W.continue.bind(W), z = (z = W.continuePrimaryKey) && z.bind(W), U = W.advance.bind(W), pe = function() {
|
|
1805
1803
|
throw new Error("Cursor not stopped");
|
|
1806
1804
|
}, W.trans = y, W.stop = W.continue = W.continuePrimaryKey = W.advance = function() {
|
|
1807
1805
|
throw new Error("Cursor not started");
|
|
@@ -1831,16 +1829,16 @@ var jr = { exports: {} };
|
|
|
1831
1829
|
return P.onsuccess = Z(function(ue) {
|
|
1832
1830
|
P.onsuccess = se, se();
|
|
1833
1831
|
}), W.continue = F, W.continuePrimaryKey = z, W.advance = U, se(), Vt;
|
|
1834
|
-
},
|
|
1832
|
+
}, I(W)) : I(null);
|
|
1835
1833
|
}, j);
|
|
1836
1834
|
});
|
|
1837
1835
|
}, count: function(w) {
|
|
1838
1836
|
var y = w.query, S = w.trans, E = y.index, O = y.range;
|
|
1839
|
-
return new Promise(function(x,
|
|
1840
|
-
var j = S.objectStore(m),
|
|
1841
|
-
|
|
1837
|
+
return new Promise(function(x, I) {
|
|
1838
|
+
var j = S.objectStore(m), C = E.isPrimaryKey ? j : j.index(E.name), j = i(O), C = j ? C.count(j) : C.count();
|
|
1839
|
+
C.onsuccess = Z(function(T) {
|
|
1842
1840
|
return x(T.target.result);
|
|
1843
|
-
}),
|
|
1841
|
+
}), C.onerror = me(I);
|
|
1844
1842
|
});
|
|
1845
1843
|
} };
|
|
1846
1844
|
}
|
|
@@ -1850,13 +1848,13 @@ var jr = { exports: {} };
|
|
|
1850
1848
|
var p = v.keyPath, y = v.autoIncrement, m = B(p), w = {}, y = { name: v.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: p == null, compound: m, keyPath: p, autoIncrement: y, unique: !0, extractKey: _n(p) }, indexes: mr(v.indexNames).map(function(S) {
|
|
1851
1849
|
return v.index(S);
|
|
1852
1850
|
}).map(function(x) {
|
|
1853
|
-
var E = x.name, O = x.unique,
|
|
1854
|
-
return w[mt(x)] =
|
|
1851
|
+
var E = x.name, O = x.unique, I = x.multiEntry, x = x.keyPath, I = { name: E, compound: B(x), keyPath: x, unique: O, multiEntry: I, extractKey: _n(x) };
|
|
1852
|
+
return w[mt(x)] = I;
|
|
1855
1853
|
}), getIndexByKeyPath: function(S) {
|
|
1856
1854
|
return w[mt(S)];
|
|
1857
1855
|
} };
|
|
1858
1856
|
return w[":id"] = y.primaryKey, p != null && (w[mt(p)] = y.primaryKey), y;
|
|
1859
|
-
}) }, 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) }), g = b.schema,
|
|
1857
|
+
}) }, 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) }), g = b.schema, h = b.hasGetAll, b = g.tables.map(a), d = {};
|
|
1860
1858
|
return b.forEach(function(v) {
|
|
1861
1859
|
return d[v.name] = v;
|
|
1862
1860
|
}), { stack: "dbcore", transaction: e.transaction.bind(e), table: function(v) {
|
|
@@ -1864,54 +1862,54 @@ var jr = { exports: {} };
|
|
|
1864
1862
|
return d[v];
|
|
1865
1863
|
}, MIN_KEY: -1 / 0, MAX_KEY: yt(t), schema: g };
|
|
1866
1864
|
}
|
|
1867
|
-
function
|
|
1868
|
-
var
|
|
1869
|
-
return n.indexedDB, { dbcore: (
|
|
1865
|
+
function di(e, t, n, i) {
|
|
1866
|
+
var a = n.IDBKeyRange;
|
|
1867
|
+
return n.indexedDB, { dbcore: (i = li(t, a, i), e.dbcore.reduce(function(o, s) {
|
|
1870
1868
|
return s = s.create, l(l({}, o), s(o));
|
|
1871
|
-
},
|
|
1869
|
+
}, i)) };
|
|
1872
1870
|
}
|
|
1873
|
-
function Bt(e,
|
|
1874
|
-
var n =
|
|
1875
|
-
e.core =
|
|
1876
|
-
var o =
|
|
1871
|
+
function Bt(e, i) {
|
|
1872
|
+
var n = i.db, i = di(e._middlewares, n, e._deps, i);
|
|
1873
|
+
e.core = i.dbcore, e.tables.forEach(function(a) {
|
|
1874
|
+
var o = a.name;
|
|
1877
1875
|
e.core.schema.tables.some(function(s) {
|
|
1878
1876
|
return s.name === o;
|
|
1879
|
-
}) && (
|
|
1877
|
+
}) && (a.core = e.core.table(o), e[o] instanceof e.Table && (e[o].core = a.core));
|
|
1880
1878
|
});
|
|
1881
1879
|
}
|
|
1882
|
-
function Lt(e, t, n,
|
|
1883
|
-
n.forEach(function(
|
|
1884
|
-
var o = a
|
|
1880
|
+
function Lt(e, t, n, i) {
|
|
1881
|
+
n.forEach(function(a) {
|
|
1882
|
+
var o = i[a];
|
|
1885
1883
|
t.forEach(function(s) {
|
|
1886
|
-
var u = function g(
|
|
1887
|
-
return Fr(
|
|
1888
|
-
}(s,
|
|
1889
|
-
(!u || "value" in u && u.value === void 0) && (s === e.Transaction.prototype || s instanceof e.Transaction ? ke(s,
|
|
1890
|
-
return this.table(
|
|
1884
|
+
var u = function g(h, b) {
|
|
1885
|
+
return Fr(h, b) || (h = ee(h)) && g(h, b);
|
|
1886
|
+
}(s, a);
|
|
1887
|
+
(!u || "value" in u && u.value === void 0) && (s === e.Transaction.prototype || s instanceof e.Transaction ? ke(s, a, { get: function() {
|
|
1888
|
+
return this.table(a);
|
|
1891
1889
|
}, set: function(g) {
|
|
1892
|
-
zn(this,
|
|
1893
|
-
} }) : s[
|
|
1890
|
+
zn(this, a, { value: g, writable: !0, configurable: !0, enumerable: !0 });
|
|
1891
|
+
} }) : s[a] = new e.Table(a, o));
|
|
1894
1892
|
});
|
|
1895
1893
|
});
|
|
1896
1894
|
}
|
|
1897
1895
|
function Sn(e, t) {
|
|
1898
1896
|
t.forEach(function(n) {
|
|
1899
|
-
for (var
|
|
1897
|
+
for (var i in n) n[i] instanceof e.Table && delete n[i];
|
|
1900
1898
|
});
|
|
1901
1899
|
}
|
|
1902
|
-
function
|
|
1900
|
+
function fi(e, t) {
|
|
1903
1901
|
return e._cfg.version - t._cfg.version;
|
|
1904
1902
|
}
|
|
1905
|
-
function
|
|
1906
|
-
var
|
|
1907
|
-
n.objectStoreNames.contains("$meta") && !
|
|
1908
|
-
var o = e._createTransaction("readwrite", e._storeNames,
|
|
1909
|
-
o.create(n), o._completion.catch(
|
|
1903
|
+
function hi(e, t, n, i) {
|
|
1904
|
+
var a = e._dbSchema;
|
|
1905
|
+
n.objectStoreNames.contains("$meta") && !a.$meta && (a.$meta = wn("$meta", vr("")[0], []), e._storeNames.push("$meta"));
|
|
1906
|
+
var o = e._createTransaction("readwrite", e._storeNames, a);
|
|
1907
|
+
o.create(n), o._completion.catch(i);
|
|
1910
1908
|
var s = o._reject.bind(o), u = L.transless || L;
|
|
1911
1909
|
De(function() {
|
|
1912
|
-
return L.trans = o, L.transless = u, t !== 0 ? (Bt(e, n),
|
|
1913
|
-
return b ??
|
|
1914
|
-
}) : N.resolve(
|
|
1910
|
+
return L.trans = o, L.transless = u, t !== 0 ? (Bt(e, n), h = t, ((g = o).storeNames.includes("$meta") ? g.table("$meta").get("version").then(function(b) {
|
|
1911
|
+
return b ?? h;
|
|
1912
|
+
}) : N.resolve(h)).then(function(b) {
|
|
1915
1913
|
return v = b, p = o, m = n, w = [], b = (d = e)._versions, y = d._dbSchema = $t(0, d.idbdb, m), (b = b.filter(function(S) {
|
|
1916
1914
|
return S._cfg.version >= v;
|
|
1917
1915
|
})).length !== 0 ? (b.forEach(function(S) {
|
|
@@ -1932,24 +1930,24 @@ var jr = { exports: {} };
|
|
|
1932
1930
|
return P.deleteIndex($);
|
|
1933
1931
|
});
|
|
1934
1932
|
});
|
|
1935
|
-
var
|
|
1936
|
-
if (
|
|
1933
|
+
var I = S._cfg.contentUpgrade;
|
|
1934
|
+
if (I && S._cfg.version > v) {
|
|
1937
1935
|
Bt(d, m), p._memoizedTables = {};
|
|
1938
1936
|
var j = Qn(O);
|
|
1939
1937
|
x.del.forEach(function(M) {
|
|
1940
1938
|
j[M] = E[M];
|
|
1941
|
-
}), Sn(d, [d.Transaction.prototype]), Lt(d, [d.Transaction.prototype],
|
|
1942
|
-
var
|
|
1939
|
+
}), Sn(d, [d.Transaction.prototype]), Lt(d, [d.Transaction.prototype], R(j), j), p.schema = j;
|
|
1940
|
+
var C, T = tn(I);
|
|
1943
1941
|
return T && Je(), x = N.follow(function() {
|
|
1944
1942
|
var M;
|
|
1945
|
-
(
|
|
1946
|
-
}),
|
|
1947
|
-
return
|
|
1943
|
+
(C = I(p)) && T && (M = Pe.bind(null, null), C.then(M, M));
|
|
1944
|
+
}), C && typeof C.then == "function" ? N.resolve(C) : x.then(function() {
|
|
1945
|
+
return C;
|
|
1948
1946
|
});
|
|
1949
1947
|
}
|
|
1950
1948
|
}), w.push(function(E) {
|
|
1951
|
-
var O, x,
|
|
1952
|
-
O =
|
|
1949
|
+
var O, x, I = S._cfg.dbschema;
|
|
1950
|
+
O = I, x = E, [].slice.call(x.db.objectStoreNames).forEach(function(j) {
|
|
1953
1951
|
return O[j] == null && x.db.deleteObjectStore(j);
|
|
1954
1952
|
}), Sn(d, [d.Transaction.prototype]), Lt(d, [d.Transaction.prototype], d._storeNames, d._dbSchema), p.schema = d._dbSchema;
|
|
1955
1953
|
}), w.push(function(E) {
|
|
@@ -1963,58 +1961,58 @@ var jr = { exports: {} };
|
|
|
1963
1961
|
br(y, m);
|
|
1964
1962
|
})) : N.resolve();
|
|
1965
1963
|
var d, v, p, m, w, y;
|
|
1966
|
-
}).catch(s)) : (
|
|
1967
|
-
On(n, b,
|
|
1964
|
+
}).catch(s)) : (R(a).forEach(function(b) {
|
|
1965
|
+
On(n, b, a[b].primKey, a[b].indexes);
|
|
1968
1966
|
}), Bt(e, n), void N.follow(function() {
|
|
1969
1967
|
return e.on.populate.fire(o);
|
|
1970
1968
|
}).catch(s));
|
|
1971
|
-
var g,
|
|
1969
|
+
var g, h;
|
|
1972
1970
|
});
|
|
1973
1971
|
}
|
|
1974
|
-
function
|
|
1972
|
+
function pi(e, t) {
|
|
1975
1973
|
br(e._dbSchema, t), t.db.version % 10 != 0 || t.objectStoreNames.contains("$meta") || t.db.createObjectStore("$meta").add(Math.ceil(t.db.version / 10 - 1), "version");
|
|
1976
1974
|
var n = $t(0, e.idbdb, t);
|
|
1977
1975
|
Ft(e, e._dbSchema, t);
|
|
1978
|
-
for (var
|
|
1976
|
+
for (var i = 0, a = En(n, e._dbSchema).change; i < a.length; i++) {
|
|
1979
1977
|
var o = function(s) {
|
|
1980
1978
|
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 };
|
|
1981
1979
|
var u = t.objectStore(s.name);
|
|
1982
1980
|
s.add.forEach(function(g) {
|
|
1983
1981
|
ye && console.debug("Dexie upgrade patch: Creating missing index ".concat(s.name, ".").concat(g.src)), Gt(u, g);
|
|
1984
1982
|
});
|
|
1985
|
-
}(i
|
|
1983
|
+
}(a[i]);
|
|
1986
1984
|
if (typeof o == "object") return o.value;
|
|
1987
1985
|
}
|
|
1988
1986
|
}
|
|
1989
1987
|
function En(e, t) {
|
|
1990
|
-
var n,
|
|
1991
|
-
for (n in e) t[n] ||
|
|
1988
|
+
var n, i = { del: [], add: [], change: [] };
|
|
1989
|
+
for (n in e) t[n] || i.del.push(n);
|
|
1992
1990
|
for (n in t) {
|
|
1993
|
-
var
|
|
1994
|
-
if (
|
|
1991
|
+
var a = e[n], o = t[n];
|
|
1992
|
+
if (a) {
|
|
1995
1993
|
var s = { name: n, def: o, recreate: !1, del: [], add: [], change: [] };
|
|
1996
|
-
if ("" + (
|
|
1994
|
+
if ("" + (a.primKey.keyPath || "") != "" + (o.primKey.keyPath || "") || a.primKey.auto !== o.primKey.auto) s.recreate = !0, i.change.push(s);
|
|
1997
1995
|
else {
|
|
1998
|
-
var u =
|
|
1999
|
-
for (
|
|
2000
|
-
for (
|
|
2001
|
-
var b = u[
|
|
1996
|
+
var u = a.idxByName, g = o.idxByName, h = void 0;
|
|
1997
|
+
for (h in u) g[h] || s.del.push(h);
|
|
1998
|
+
for (h in g) {
|
|
1999
|
+
var b = u[h], d = g[h];
|
|
2002
2000
|
b ? b.src !== d.src && s.change.push(d) : s.add.push(d);
|
|
2003
2001
|
}
|
|
2004
|
-
(0 < s.del.length || 0 < s.add.length || 0 < s.change.length) &&
|
|
2002
|
+
(0 < s.del.length || 0 < s.add.length || 0 < s.change.length) && i.change.push(s);
|
|
2005
2003
|
}
|
|
2006
|
-
} else
|
|
2004
|
+
} else i.add.push([n, o]);
|
|
2007
2005
|
}
|
|
2008
|
-
return
|
|
2006
|
+
return i;
|
|
2009
2007
|
}
|
|
2010
|
-
function On(e, t, n,
|
|
2011
|
-
var
|
|
2012
|
-
return
|
|
2013
|
-
return Gt(
|
|
2014
|
-
}),
|
|
2008
|
+
function On(e, t, n, i) {
|
|
2009
|
+
var a = e.db.createObjectStore(t, n.keyPath ? { keyPath: n.keyPath, autoIncrement: n.auto } : { autoIncrement: n.auto });
|
|
2010
|
+
return i.forEach(function(o) {
|
|
2011
|
+
return Gt(a, o);
|
|
2012
|
+
}), a;
|
|
2015
2013
|
}
|
|
2016
2014
|
function br(e, t) {
|
|
2017
|
-
|
|
2015
|
+
R(e).forEach(function(n) {
|
|
2018
2016
|
t.db.objectStoreNames.contains(n) || (ye && console.debug("Dexie: Creating missing table", n), On(t, n, e[n].primKey, e[n].indexes));
|
|
2019
2017
|
});
|
|
2020
2018
|
}
|
|
@@ -2022,50 +2020,50 @@ var jr = { exports: {} };
|
|
|
2022
2020
|
e.createIndex(t.name, t.keyPath, { unique: t.unique, multiEntry: t.multi });
|
|
2023
2021
|
}
|
|
2024
2022
|
function $t(e, t, n) {
|
|
2025
|
-
var
|
|
2026
|
-
return St(t.objectStoreNames, 0).forEach(function(
|
|
2027
|
-
for (var o = n.objectStore(
|
|
2028
|
-
var b = o.index(o.indexNames[g]),
|
|
2023
|
+
var i = {};
|
|
2024
|
+
return St(t.objectStoreNames, 0).forEach(function(a) {
|
|
2025
|
+
for (var o = n.objectStore(a), s = vn(yr(h = o.keyPath), h || "", !0, !1, !!o.autoIncrement, h && typeof h != "string", !0), u = [], g = 0; g < o.indexNames.length; ++g) {
|
|
2026
|
+
var b = o.index(o.indexNames[g]), h = b.keyPath, b = vn(b.name, h, !!b.unique, !!b.multiEntry, !1, h && typeof h != "string", !1);
|
|
2029
2027
|
u.push(b);
|
|
2030
2028
|
}
|
|
2031
|
-
a
|
|
2032
|
-
}),
|
|
2029
|
+
i[a] = wn(a, s, u);
|
|
2030
|
+
}), i;
|
|
2033
2031
|
}
|
|
2034
2032
|
function Ft(e, t, n) {
|
|
2035
|
-
for (var
|
|
2036
|
-
var o = a
|
|
2033
|
+
for (var i = n.db.objectStoreNames, a = 0; a < i.length; ++a) {
|
|
2034
|
+
var o = i[a], s = n.objectStore(o);
|
|
2037
2035
|
e._hasGetAll = "getAll" in s;
|
|
2038
2036
|
for (var u = 0; u < s.indexNames.length; ++u) {
|
|
2039
|
-
var g = s.indexNames[u],
|
|
2040
|
-
!t[o] || (
|
|
2037
|
+
var g = s.indexNames[u], h = s.index(g).keyPath, b = typeof h == "string" ? h : "[" + St(h).join("+") + "]";
|
|
2038
|
+
!t[o] || (h = t[o].idxByName[b]) && (h.name = g, delete t[o].idxByName[b], t[o].idxByName[g] = h);
|
|
2041
2039
|
}
|
|
2042
2040
|
}
|
|
2043
2041
|
typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && D.WorkerGlobalScope && D instanceof D.WorkerGlobalScope && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604 && (e._hasGetAll = !1);
|
|
2044
2042
|
}
|
|
2045
2043
|
function vr(e) {
|
|
2046
2044
|
return e.split(",").map(function(t, n) {
|
|
2047
|
-
var
|
|
2048
|
-
return vn(
|
|
2045
|
+
var i = (t = t.trim()).replace(/([&*]|\+\+)/g, ""), a = /^\[/.test(i) ? i.match(/^\[(.*)\]$/)[1].split("+") : i;
|
|
2046
|
+
return vn(i, a || null, /\&/.test(t), /\*/.test(t), /\+\+/.test(t), B(a), n === 0);
|
|
2049
2047
|
});
|
|
2050
2048
|
}
|
|
2051
|
-
var
|
|
2052
|
-
|
|
2049
|
+
var gi = (Ut.prototype._parseStoresSpec = function(e, t) {
|
|
2050
|
+
R(e).forEach(function(n) {
|
|
2053
2051
|
if (e[n] !== null) {
|
|
2054
|
-
var
|
|
2055
|
-
if (
|
|
2056
|
-
|
|
2052
|
+
var i = vr(e[n]), a = i.shift();
|
|
2053
|
+
if (a.unique = !0, a.multi) throw new G.Schema("Primary key cannot be multi-valued");
|
|
2054
|
+
i.forEach(function(o) {
|
|
2057
2055
|
if (o.auto) throw new G.Schema("Only primary key can be marked as autoIncrement (++)");
|
|
2058
2056
|
if (!o.keyPath) throw new G.Schema("Index must have a name and cannot be an empty string");
|
|
2059
|
-
}), t[n] = wn(n,
|
|
2057
|
+
}), t[n] = wn(n, a, i);
|
|
2060
2058
|
}
|
|
2061
2059
|
});
|
|
2062
2060
|
}, Ut.prototype.stores = function(n) {
|
|
2063
2061
|
var t = this.db;
|
|
2064
2062
|
this._cfg.storesSource = this._cfg.storesSource ? J(this._cfg.storesSource, n) : n;
|
|
2065
|
-
var n = t._versions,
|
|
2063
|
+
var n = t._versions, i = {}, a = {};
|
|
2066
2064
|
return n.forEach(function(o) {
|
|
2067
|
-
J(
|
|
2068
|
-
}), t._dbSchema =
|
|
2065
|
+
J(i, o._cfg.storesSource), a = o._cfg.dbschema = {}, o._parseStoresSpec(i, a);
|
|
2066
|
+
}), t._dbSchema = a, Sn(t, [t._allTables, t, t.Transaction.prototype]), Lt(t, [t._allTables, t, t.Transaction.prototype, this._cfg.tables], R(a), a), t._storeNames = R(a), this;
|
|
2069
2067
|
}, Ut.prototype.upgrade = function(e) {
|
|
2070
2068
|
return this._cfg.contentUpgrade = rn(this._cfg.contentUpgrade || Q, e), this;
|
|
2071
2069
|
}, Ut);
|
|
@@ -2094,40 +2092,40 @@ var jr = { exports: {} };
|
|
|
2094
2092
|
J(this, arguments.length ? { d: 1, from: e, to: 1 < arguments.length ? t : e } : { d: 0 });
|
|
2095
2093
|
};
|
|
2096
2094
|
function bt(e, t, n) {
|
|
2097
|
-
var
|
|
2098
|
-
if (!isNaN(
|
|
2099
|
-
if (0 <
|
|
2095
|
+
var i = H(t, n);
|
|
2096
|
+
if (!isNaN(i)) {
|
|
2097
|
+
if (0 < i) throw RangeError();
|
|
2100
2098
|
if (Dn(e)) return J(e, { from: t, to: n, d: 1 });
|
|
2101
|
-
var
|
|
2102
|
-
if (H(n, e.from) < 0) return
|
|
2103
|
-
if (0 < H(t, e.to)) return
|
|
2104
|
-
H(t, e.from) < 0 && (e.from = t, e.l = null, e.d =
|
|
2099
|
+
var a = e.l, i = e.r;
|
|
2100
|
+
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);
|
|
2101
|
+
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);
|
|
2102
|
+
H(t, e.from) < 0 && (e.from = t, e.l = null, e.d = i ? i.d + 1 : 1), 0 < H(n, e.to) && (e.to = n, e.r = null, e.d = e.l ? e.l.d + 1 : 1), n = !e.r, a && !e.l && vt(e, a), i && n && vt(e, i);
|
|
2105
2103
|
}
|
|
2106
2104
|
}
|
|
2107
2105
|
function vt(e, t) {
|
|
2108
|
-
Dn(t) || function n(
|
|
2106
|
+
Dn(t) || function n(i, g) {
|
|
2109
2107
|
var o = g.from, s = g.to, u = g.l, g = g.r;
|
|
2110
|
-
bt(
|
|
2108
|
+
bt(i, o, s), u && n(i, u), g && n(i, g);
|
|
2111
2109
|
}(e, t);
|
|
2112
2110
|
}
|
|
2113
2111
|
function wr(e, t) {
|
|
2114
|
-
var n = Wt(t),
|
|
2115
|
-
if (
|
|
2116
|
-
for (var
|
|
2117
|
-
if (H(u.from,
|
|
2118
|
-
H(
|
|
2112
|
+
var n = Wt(t), i = n.next();
|
|
2113
|
+
if (i.done) return !1;
|
|
2114
|
+
for (var a = i.value, o = Wt(e), s = o.next(a.from), u = s.value; !i.done && !s.done; ) {
|
|
2115
|
+
if (H(u.from, a.to) <= 0 && 0 <= H(u.to, a.from)) return !0;
|
|
2116
|
+
H(a.from, u.from) < 0 ? a = (i = n.next(u.from)).value : u = (s = o.next(a.from)).value;
|
|
2119
2117
|
}
|
|
2120
2118
|
return !1;
|
|
2121
2119
|
}
|
|
2122
2120
|
function Wt(e) {
|
|
2123
2121
|
var t = Dn(e) ? null : { s: 0, n: e };
|
|
2124
2122
|
return { next: function(n) {
|
|
2125
|
-
for (var
|
|
2123
|
+
for (var i = 0 < arguments.length; t; ) switch (t.s) {
|
|
2126
2124
|
case 0:
|
|
2127
|
-
if (t.s = 1,
|
|
2125
|
+
if (t.s = 1, i) for (; t.n.l && H(n, t.n.from) < 0; ) t = { up: t, n: t.n.l, s: 1 };
|
|
2128
2126
|
else for (; t.n.l; ) t = { up: t, n: t.n.l, s: 1 };
|
|
2129
2127
|
case 1:
|
|
2130
|
-
if (t.s = 2, !
|
|
2128
|
+
if (t.s = 2, !i || H(n, t.n.to) <= 0) return { value: t.n, done: !1 };
|
|
2131
2129
|
case 2:
|
|
2132
2130
|
if (t.n.r) {
|
|
2133
2131
|
t.s = 3, t = { up: t, n: t.n.r, s: 0 };
|
|
@@ -2140,18 +2138,18 @@ var jr = { exports: {} };
|
|
|
2140
2138
|
} };
|
|
2141
2139
|
}
|
|
2142
2140
|
function _r(e) {
|
|
2143
|
-
var t, n,
|
|
2144
|
-
|
|
2141
|
+
var t, n, i = (((t = e.r) === null || t === void 0 ? void 0 : t.d) || 0) - (((n = e.l) === null || n === void 0 ? void 0 : n.d) || 0), a = 1 < i ? "r" : i < -1 ? "l" : "";
|
|
2142
|
+
a && (t = a == "r" ? "l" : "r", n = l({}, e), i = e[a], e.from = i.from, e.to = i.to, e[a] = i[a], n[a] = i[t], (e[t] = n).d = Sr(n)), e.d = Sr(e);
|
|
2145
2143
|
}
|
|
2146
2144
|
function Sr(n) {
|
|
2147
2145
|
var t = n.r, n = n.l;
|
|
2148
2146
|
return (t ? n ? Math.max(t.d, n.d) : t.d : n ? n.d : 0) + 1;
|
|
2149
2147
|
}
|
|
2150
2148
|
function zt(e, t) {
|
|
2151
|
-
return
|
|
2152
|
-
e[n] ? vt(e[n], t[n]) : e[n] = function a
|
|
2149
|
+
return R(t).forEach(function(n) {
|
|
2150
|
+
e[n] ? vt(e[n], t[n]) : e[n] = function i(a) {
|
|
2153
2151
|
var o, s, u = {};
|
|
2154
|
-
for (o in
|
|
2152
|
+
for (o in a) q(a, o) && (s = a[o], u[o] = !s || typeof s != "object" || Vn.has(s.constructor) ? s : i(s));
|
|
2155
2153
|
return u;
|
|
2156
2154
|
}(t[n]);
|
|
2157
2155
|
}), e;
|
|
@@ -2185,7 +2183,7 @@ var jr = { exports: {} };
|
|
|
2185
2183
|
function Rn(e, t) {
|
|
2186
2184
|
t === void 0 && (t = !1);
|
|
2187
2185
|
var n = /* @__PURE__ */ new Set();
|
|
2188
|
-
if (e.all) for (var
|
|
2186
|
+
if (e.all) for (var i = 0, a = Object.values(Fe); i < a.length; i++) Er(s = a[i], e, n, t);
|
|
2189
2187
|
else for (var o in e) {
|
|
2190
2188
|
var s, u = /^idb\:\/\/(.*)\/(.*)\//.exec(o);
|
|
2191
2189
|
u && (o = u[1], u = u[2], (s = Fe["idb://".concat(o, "/").concat(u)]) && Er(s, e, n, t));
|
|
@@ -2194,58 +2192,58 @@ var jr = { exports: {} };
|
|
|
2194
2192
|
return g();
|
|
2195
2193
|
});
|
|
2196
2194
|
}
|
|
2197
|
-
function Er(e, t, n,
|
|
2198
|
-
for (var
|
|
2199
|
-
for (var u = s[o], g = u[0],
|
|
2195
|
+
function Er(e, t, n, i) {
|
|
2196
|
+
for (var a = [], o = 0, s = Object.entries(e.queries.query); o < s.length; o++) {
|
|
2197
|
+
for (var u = s[o], g = u[0], h = [], b = 0, d = u[1]; b < d.length; b++) {
|
|
2200
2198
|
var v = d[b];
|
|
2201
2199
|
Pn(t, v.obsSet) ? v.subscribers.forEach(function(y) {
|
|
2202
2200
|
return n.add(y);
|
|
2203
|
-
}) :
|
|
2201
|
+
}) : i && h.push(v);
|
|
2204
2202
|
}
|
|
2205
|
-
|
|
2203
|
+
i && a.push([g, h]);
|
|
2206
2204
|
}
|
|
2207
|
-
if (
|
|
2208
|
-
var w = m[p], g = w[0],
|
|
2209
|
-
e.queries.query[g] =
|
|
2205
|
+
if (i) for (var p = 0, m = a; p < m.length; p++) {
|
|
2206
|
+
var w = m[p], g = w[0], h = w[1];
|
|
2207
|
+
e.queries.query[g] = h;
|
|
2210
2208
|
}
|
|
2211
2209
|
}
|
|
2212
|
-
function
|
|
2210
|
+
function yi(e) {
|
|
2213
2211
|
var t = e._state, n = e._deps.indexedDB;
|
|
2214
2212
|
if (t.isBeingOpened || e.idbdb) return t.dbReadyPromise.then(function() {
|
|
2215
2213
|
return t.dbOpenError ? te(t.dbOpenError) : e;
|
|
2216
2214
|
});
|
|
2217
2215
|
t.isBeingOpened = !0, t.dbOpenError = null, t.openComplete = !1;
|
|
2218
|
-
var
|
|
2216
|
+
var i = t.openCanceller, a = Math.round(10 * e.verno), o = !1;
|
|
2219
2217
|
function s() {
|
|
2220
|
-
if (t.openCanceller !==
|
|
2218
|
+
if (t.openCanceller !== i) throw new G.DatabaseClosed("db.open() was cancelled");
|
|
2221
2219
|
}
|
|
2222
2220
|
function u() {
|
|
2223
2221
|
return new N(function(v, p) {
|
|
2224
2222
|
if (s(), !n) throw new G.MissingAPI();
|
|
2225
|
-
var m = e.name, w = t.autoSchema || !
|
|
2223
|
+
var m = e.name, w = t.autoSchema || !a ? n.open(m) : n.open(m, a);
|
|
2226
2224
|
if (!w) throw new G.MissingAPI();
|
|
2227
2225
|
w.onerror = me(p), w.onblocked = Z(e._fireOnBlocked), w.onupgradeneeded = Z(function(y) {
|
|
2228
2226
|
var S;
|
|
2229
2227
|
b = w.transaction, t.autoSchema && !e._options.allowEmptyDB ? (w.onerror = pt, b.abort(), w.result.close(), (S = n.deleteDatabase(m)).onsuccess = S.onerror = Z(function() {
|
|
2230
2228
|
p(new G.NoSuchDatabase("Database ".concat(m, " doesnt exist")));
|
|
2231
|
-
})) : (b.onerror = me(p), y = y.oldVersion > Math.pow(2, 62) ? 0 : y.oldVersion, d = y < 1, e.idbdb = w.result, o &&
|
|
2229
|
+
})) : (b.onerror = me(p), y = y.oldVersion > Math.pow(2, 62) ? 0 : y.oldVersion, d = y < 1, e.idbdb = w.result, o && pi(e, b), hi(e, y / 10, b, p));
|
|
2232
2230
|
}, p), w.onsuccess = Z(function() {
|
|
2233
2231
|
b = null;
|
|
2234
|
-
var y, S, E, O, x,
|
|
2232
|
+
var y, S, E, O, x, I = e.idbdb = w.result, j = St(I.objectStoreNames);
|
|
2235
2233
|
if (0 < j.length) try {
|
|
2236
|
-
var
|
|
2237
|
-
if (t.autoSchema) S =
|
|
2238
|
-
else if (Ft(e, e._dbSchema,
|
|
2234
|
+
var C = I.transaction((O = j).length === 1 ? O[0] : O, "readonly");
|
|
2235
|
+
if (t.autoSchema) S = I, E = C, (y = e).verno = S.version / 10, E = y._dbSchema = $t(0, S, E), y._storeNames = St(S.objectStoreNames, 0), Lt(y, [y._allTables], R(E), E);
|
|
2236
|
+
else if (Ft(e, e._dbSchema, C), ((x = En($t(0, (x = e).idbdb, C), x._dbSchema)).add.length || x.change.some(function(T) {
|
|
2239
2237
|
return T.add.length || T.change.length;
|
|
2240
|
-
})) && !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."),
|
|
2241
|
-
Bt(e,
|
|
2238
|
+
})) && !o) return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."), I.close(), a = I.version + 1, o = !0, v(u());
|
|
2239
|
+
Bt(e, C);
|
|
2242
2240
|
} catch {
|
|
2243
2241
|
}
|
|
2244
|
-
Ze.push(e),
|
|
2242
|
+
Ze.push(e), I.onversionchange = Z(function(T) {
|
|
2245
2243
|
t.vcFired = !0, e.on("versionchange").fire(T);
|
|
2246
|
-
}),
|
|
2244
|
+
}), I.onclose = Z(function(T) {
|
|
2247
2245
|
e.on("close").fire(T);
|
|
2248
|
-
}), d && (x = e._deps,
|
|
2246
|
+
}), d && (x = e._deps, C = m, I = x.indexedDB, x = x.IDBKeyRange, kn(I) || C === Tt || xn(I, x).put({ name: C }).catch(Q)), v();
|
|
2249
2247
|
}, p);
|
|
2250
2248
|
}).catch(function(v) {
|
|
2251
2249
|
switch (v == null ? void 0 : v.name) {
|
|
@@ -2253,13 +2251,13 @@ var jr = { exports: {} };
|
|
|
2253
2251
|
if (0 < t.PR1398_maxLoop) return t.PR1398_maxLoop--, console.warn("Dexie: Workaround for Chrome UnknownError on open()"), u();
|
|
2254
2252
|
break;
|
|
2255
2253
|
case "VersionError":
|
|
2256
|
-
if (0 <
|
|
2254
|
+
if (0 < a) return a = 0, u();
|
|
2257
2255
|
}
|
|
2258
2256
|
return N.reject(v);
|
|
2259
2257
|
});
|
|
2260
2258
|
}
|
|
2261
|
-
var g,
|
|
2262
|
-
return N.race([
|
|
2259
|
+
var g, h = t.dbReadyResolve, b = null, d = !1;
|
|
2260
|
+
return N.race([i, (typeof navigator > "u" ? N.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(v) {
|
|
2263
2261
|
function p() {
|
|
2264
2262
|
return indexedDB.databases().finally(v);
|
|
2265
2263
|
}
|
|
@@ -2278,16 +2276,16 @@ var jr = { exports: {} };
|
|
|
2278
2276
|
}
|
|
2279
2277
|
});
|
|
2280
2278
|
}).finally(function() {
|
|
2281
|
-
t.openCanceller ===
|
|
2279
|
+
t.openCanceller === i && (t.onReadyBeingFired = null, t.isBeingOpened = !1);
|
|
2282
2280
|
}).catch(function(v) {
|
|
2283
2281
|
t.dbOpenError = v;
|
|
2284
2282
|
try {
|
|
2285
2283
|
b && b.abort();
|
|
2286
2284
|
} catch {
|
|
2287
2285
|
}
|
|
2288
|
-
return
|
|
2286
|
+
return i === t.openCanceller && e._close(), te(v);
|
|
2289
2287
|
}).finally(function() {
|
|
2290
|
-
t.openComplete = !0,
|
|
2288
|
+
t.openComplete = !0, h();
|
|
2291
2289
|
}).then(function() {
|
|
2292
2290
|
var v;
|
|
2293
2291
|
return d && (v = {}, e.tables.forEach(function(p) {
|
|
@@ -2301,41 +2299,41 @@ var jr = { exports: {} };
|
|
|
2301
2299
|
function t(o) {
|
|
2302
2300
|
return e.next(o);
|
|
2303
2301
|
}
|
|
2304
|
-
var n =
|
|
2302
|
+
var n = a(t), i = a(function(o) {
|
|
2305
2303
|
return e.throw(o);
|
|
2306
2304
|
});
|
|
2307
|
-
function
|
|
2305
|
+
function a(o) {
|
|
2308
2306
|
return function(g) {
|
|
2309
2307
|
var u = o(g), g = u.value;
|
|
2310
|
-
return u.done ? g : g && typeof g.then == "function" ? g.then(n,
|
|
2308
|
+
return u.done ? g : g && typeof g.then == "function" ? g.then(n, i) : B(g) ? Promise.all(g).then(n, i) : n(g);
|
|
2311
2309
|
};
|
|
2312
2310
|
}
|
|
2313
|
-
return
|
|
2311
|
+
return a(t)();
|
|
2314
2312
|
}
|
|
2315
2313
|
function Yt(e, t, n) {
|
|
2316
|
-
for (var
|
|
2317
|
-
return
|
|
2314
|
+
for (var i = B(e) ? e.slice() : [e], a = 0; a < n; ++a) i.push(t);
|
|
2315
|
+
return i;
|
|
2318
2316
|
}
|
|
2319
|
-
var
|
|
2317
|
+
var mi = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(e) {
|
|
2320
2318
|
return l(l({}, e), { table: function(t) {
|
|
2321
|
-
var n = e.table(t),
|
|
2319
|
+
var n = e.table(t), i = n.schema, a = {}, o = [];
|
|
2322
2320
|
function s(d, v, p) {
|
|
2323
|
-
var m = mt(d), w =
|
|
2321
|
+
var m = mt(d), w = a[m] = a[m] || [], y = d == null ? 0 : typeof d == "string" ? 1 : d.length, S = 0 < v, S = l(l({}, p), { name: S ? "".concat(m, "(virtual-from:").concat(p.name, ")") : p.name, lowLevelIndex: p, isVirtual: S, keyTail: v, keyLength: y, extractKey: _n(d), unique: !S && p.unique });
|
|
2324
2322
|
return w.push(S), S.isPrimaryKey || o.push(S), 1 < y && s(y === 2 ? d[0] : d.slice(0, y - 1), v + 1, p), w.sort(function(E, O) {
|
|
2325
2323
|
return E.keyTail - O.keyTail;
|
|
2326
2324
|
}), S;
|
|
2327
2325
|
}
|
|
2328
|
-
t = s(
|
|
2329
|
-
for (var u = 0, g =
|
|
2330
|
-
var
|
|
2331
|
-
s(
|
|
2326
|
+
t = s(i.primaryKey.keyPath, 0, i.primaryKey), a[":id"] = [t];
|
|
2327
|
+
for (var u = 0, g = i.indexes; u < g.length; u++) {
|
|
2328
|
+
var h = g[u];
|
|
2329
|
+
s(h.keyPath, 0, h);
|
|
2332
2330
|
}
|
|
2333
2331
|
function b(d) {
|
|
2334
2332
|
var v, p = d.query.index;
|
|
2335
2333
|
return p.isVirtual ? l(l({}, d), { query: { index: p.lowLevelIndex, range: (v = d.query.range, p = p.keyTail, { type: v.type === 1 ? 2 : v.type, lower: Yt(v.lower, v.lowerOpen ? e.MAX_KEY : e.MIN_KEY, p), lowerOpen: !0, upper: Yt(v.upper, v.upperOpen ? e.MIN_KEY : e.MAX_KEY, p), upperOpen: !0 }) } }) : d;
|
|
2336
2334
|
}
|
|
2337
|
-
return l(l({}, n), { schema: l(l({},
|
|
2338
|
-
return (d =
|
|
2335
|
+
return l(l({}, n), { schema: l(l({}, i), { primaryKey: t, indexes: o, getIndexByKeyPath: function(d) {
|
|
2336
|
+
return (d = a[mt(d)]) && d[0];
|
|
2339
2337
|
} }), count: function(d) {
|
|
2340
2338
|
return n.count(b(d));
|
|
2341
2339
|
}, query: function(d) {
|
|
@@ -2362,68 +2360,68 @@ var jr = { exports: {} };
|
|
|
2362
2360
|
} });
|
|
2363
2361
|
} });
|
|
2364
2362
|
} };
|
|
2365
|
-
function jn(e, t, n,
|
|
2366
|
-
return n = n || {},
|
|
2363
|
+
function jn(e, t, n, i) {
|
|
2364
|
+
return n = n || {}, i = i || "", R(e).forEach(function(a) {
|
|
2367
2365
|
var o, s, u;
|
|
2368
|
-
q(t,
|
|
2369
|
-
}),
|
|
2370
|
-
q(e,
|
|
2366
|
+
q(t, a) ? (o = e[a], s = t[a], typeof o == "object" && typeof s == "object" && o && s ? (u = qt(o)) !== qt(s) ? n[i + a] = t[a] : u === "Object" ? jn(o, s, n, i + a + ".") : o !== s && (n[i + a] = t[a]) : o !== s && (n[i + a] = t[a])) : n[i + a] = void 0;
|
|
2367
|
+
}), R(t).forEach(function(a) {
|
|
2368
|
+
q(e, a) || (n[i + a] = t[a]);
|
|
2371
2369
|
}), n;
|
|
2372
2370
|
}
|
|
2373
2371
|
function Mn(e, t) {
|
|
2374
2372
|
return t.type === "delete" ? t.keys : t.keys || t.values.map(e.extractKey);
|
|
2375
2373
|
}
|
|
2376
|
-
var
|
|
2374
|
+
var bi = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: function(e) {
|
|
2377
2375
|
return l(l({}, e), { table: function(t) {
|
|
2378
|
-
var n = e.table(t),
|
|
2379
|
-
return l(l({}, n), { mutate: function(
|
|
2380
|
-
var o = L.trans, s = o.table(t).hook, u = s.deleting, g = s.creating,
|
|
2381
|
-
switch (
|
|
2376
|
+
var n = e.table(t), i = n.schema.primaryKey;
|
|
2377
|
+
return l(l({}, n), { mutate: function(a) {
|
|
2378
|
+
var o = L.trans, s = o.table(t).hook, u = s.deleting, g = s.creating, h = s.updating;
|
|
2379
|
+
switch (a.type) {
|
|
2382
2380
|
case "add":
|
|
2383
2381
|
if (g.fire === Q) break;
|
|
2384
2382
|
return o._promise("readwrite", function() {
|
|
2385
|
-
return b(
|
|
2383
|
+
return b(a);
|
|
2386
2384
|
}, !0);
|
|
2387
2385
|
case "put":
|
|
2388
|
-
if (g.fire === Q &&
|
|
2386
|
+
if (g.fire === Q && h.fire === Q) break;
|
|
2389
2387
|
return o._promise("readwrite", function() {
|
|
2390
|
-
return b(
|
|
2388
|
+
return b(a);
|
|
2391
2389
|
}, !0);
|
|
2392
2390
|
case "delete":
|
|
2393
2391
|
if (u.fire === Q) break;
|
|
2394
2392
|
return o._promise("readwrite", function() {
|
|
2395
|
-
return b(
|
|
2393
|
+
return b(a);
|
|
2396
2394
|
}, !0);
|
|
2397
2395
|
case "deleteRange":
|
|
2398
2396
|
if (u.fire === Q) break;
|
|
2399
2397
|
return o._promise("readwrite", function() {
|
|
2400
2398
|
return function d(v, p, m) {
|
|
2401
|
-
return n.query({ trans: v, values: !1, query: { index:
|
|
2399
|
+
return n.query({ trans: v, values: !1, query: { index: i, range: p }, limit: m }).then(function(w) {
|
|
2402
2400
|
var y = w.result;
|
|
2403
2401
|
return b({ type: "delete", keys: y, trans: v }).then(function(S) {
|
|
2404
2402
|
return 0 < S.numFailures ? Promise.reject(S.failures[0]) : y.length < m ? { failures: [], numFailures: 0, lastResult: void 0 } : d(v, l(l({}, p), { lower: y[y.length - 1], lowerOpen: !0 }), m);
|
|
2405
2403
|
});
|
|
2406
2404
|
});
|
|
2407
|
-
}(
|
|
2405
|
+
}(a.trans, a.range, 1e4);
|
|
2408
2406
|
}, !0);
|
|
2409
2407
|
}
|
|
2410
|
-
return n.mutate(
|
|
2408
|
+
return n.mutate(a);
|
|
2411
2409
|
function b(d) {
|
|
2412
|
-
var v, p, m, w = L.trans, y = d.keys || Mn(
|
|
2410
|
+
var v, p, m, w = L.trans, y = d.keys || Mn(i, d);
|
|
2413
2411
|
if (!y) throw new Error("Keys missing");
|
|
2414
2412
|
return (d = d.type === "add" || d.type === "put" ? l(l({}, d), { keys: y }) : l({}, d)).type !== "delete" && (d.values = k([], d.values)), d.keys && (d.keys = k([], d.keys)), v = n, m = y, ((p = d).type === "add" ? Promise.resolve([]) : v.getMany({ trans: p.trans, keys: m, cache: "immutable" })).then(function(S) {
|
|
2415
2413
|
var E = y.map(function(O, x) {
|
|
2416
|
-
var
|
|
2417
|
-
return d.type === "delete" ? u.fire.call(M, O, T, w) : d.type === "add" || T === void 0 ? (
|
|
2418
|
-
q(
|
|
2414
|
+
var I, j, C, T = S[x], M = { onerror: null, onsuccess: null };
|
|
2415
|
+
return d.type === "delete" ? u.fire.call(M, O, T, w) : d.type === "add" || T === void 0 ? (I = g.fire.call(M, O, d.values[x], w), O == null && I != null && (d.keys[x] = O = I, i.outbound || le(d.values[x], i.keyPath, O))) : (I = jn(T, d.values[x]), (j = h.fire.call(M, I, O, T, w)) && (C = d.values[x], Object.keys(j).forEach(function(P) {
|
|
2416
|
+
q(C, P) ? C[P] = j[P] : le(C, P, j[P]);
|
|
2419
2417
|
}))), M;
|
|
2420
2418
|
});
|
|
2421
2419
|
return n.mutate(d).then(function(O) {
|
|
2422
|
-
for (var x = O.failures,
|
|
2423
|
-
var T = (
|
|
2424
|
-
T == null ? M.onerror && M.onerror(x[
|
|
2420
|
+
for (var x = O.failures, I = O.results, j = O.numFailures, O = O.lastResult, C = 0; C < y.length; ++C) {
|
|
2421
|
+
var T = (I || y)[C], M = E[C];
|
|
2422
|
+
T == null ? M.onerror && M.onerror(x[C]) : M.onsuccess && M.onsuccess(d.type === "put" && S[C] ? d.values[C] : T);
|
|
2425
2423
|
}
|
|
2426
|
-
return { failures: x, results:
|
|
2424
|
+
return { failures: x, results: I, numFailures: j, lastResult: O };
|
|
2427
2425
|
}).catch(function(O) {
|
|
2428
2426
|
return E.forEach(function(x) {
|
|
2429
2427
|
return x.onerror && x.onerror(O);
|
|
@@ -2437,23 +2435,23 @@ var jr = { exports: {} };
|
|
|
2437
2435
|
function Or(e, t, n) {
|
|
2438
2436
|
try {
|
|
2439
2437
|
if (!t || t.keys.length < e.length) return null;
|
|
2440
|
-
for (var
|
|
2441
|
-
return
|
|
2438
|
+
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 ? je(t.values[a]) : t.values[a]), ++o);
|
|
2439
|
+
return i.length === e.length ? i : null;
|
|
2442
2440
|
} catch {
|
|
2443
2441
|
return null;
|
|
2444
2442
|
}
|
|
2445
2443
|
}
|
|
2446
|
-
var
|
|
2444
|
+
var vi = { stack: "dbcore", level: -1, create: function(e) {
|
|
2447
2445
|
return { table: function(t) {
|
|
2448
2446
|
var n = e.table(t);
|
|
2449
|
-
return l(l({}, n), { getMany: function(
|
|
2450
|
-
if (!
|
|
2451
|
-
var
|
|
2452
|
-
return
|
|
2453
|
-
return
|
|
2447
|
+
return l(l({}, n), { getMany: function(i) {
|
|
2448
|
+
if (!i.cache) return n.getMany(i);
|
|
2449
|
+
var a = Or(i.keys, i.trans._cache, i.cache === "clone");
|
|
2450
|
+
return a ? N.resolve(a) : n.getMany(i).then(function(o) {
|
|
2451
|
+
return i.trans._cache = { keys: i.keys, values: i.cache === "clone" ? je(o) : o }, o;
|
|
2454
2452
|
});
|
|
2455
|
-
}, mutate: function(
|
|
2456
|
-
return
|
|
2453
|
+
}, mutate: function(i) {
|
|
2454
|
+
return i.type !== "add" && (i.trans._cache = null), n.mutate(i);
|
|
2457
2455
|
} });
|
|
2458
2456
|
} };
|
|
2459
2457
|
} };
|
|
@@ -2471,22 +2469,22 @@ var jr = { exports: {} };
|
|
|
2471
2469
|
return !1;
|
|
2472
2470
|
}
|
|
2473
2471
|
}
|
|
2474
|
-
var
|
|
2472
|
+
var wi = { stack: "dbcore", level: 0, name: "Observability", create: function(e) {
|
|
2475
2473
|
var t = e.schema.name, n = new ce(e.MIN_KEY, e.MAX_KEY);
|
|
2476
|
-
return l(l({}, e), { transaction: function(
|
|
2477
|
-
if (L.subscr &&
|
|
2478
|
-
return e.transaction(
|
|
2479
|
-
}, table: function(
|
|
2480
|
-
var
|
|
2474
|
+
return l(l({}, e), { transaction: function(i, a, o) {
|
|
2475
|
+
if (L.subscr && a !== "readonly") throw new G.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(L.querier));
|
|
2476
|
+
return e.transaction(i, a, o);
|
|
2477
|
+
}, table: function(i) {
|
|
2478
|
+
var a = e.table(i), o = a.schema, s = o.primaryKey, d = o.indexes, u = s.extractKey, g = s.outbound, h = s.autoIncrement && d.filter(function(p) {
|
|
2481
2479
|
return p.compound && p.keyPath.includes(s.keyPath);
|
|
2482
|
-
}), b = l(l({},
|
|
2480
|
+
}), b = l(l({}, a), { mutate: function(p) {
|
|
2483
2481
|
function m(P) {
|
|
2484
|
-
return P = "idb://".concat(t, "/").concat(
|
|
2482
|
+
return P = "idb://".concat(t, "/").concat(i, "/").concat(P), O[P] || (O[P] = new ce());
|
|
2485
2483
|
}
|
|
2486
|
-
var w, y, S, E = p.trans, O = p.mutatedParts || (p.mutatedParts = {}), x = m(""),
|
|
2484
|
+
var w, y, S, E = p.trans, O = p.mutatedParts || (p.mutatedParts = {}), x = m(""), I = m(":dels"), j = p.type, M = p.type === "deleteRange" ? [p.range] : p.type === "delete" ? [p.keys] : p.values.length < 50 ? [Mn(s, p).filter(function(P) {
|
|
2487
2485
|
return P;
|
|
2488
|
-
}), p.values] : [],
|
|
2489
|
-
return B(
|
|
2486
|
+
}), p.values] : [], C = M[0], T = M[1], M = p.trans._cache;
|
|
2487
|
+
return B(C) ? (x.addKeys(C), (M = j === "delete" || C.length === T.length ? Or(C, M) : null) || I.addKeys(C), (M || T) && (w = m, y = M, S = T, o.indexes.forEach(function(P) {
|
|
2490
2488
|
var $ = w(P.name || "");
|
|
2491
2489
|
function F(U) {
|
|
2492
2490
|
return U != null ? P.extractKey(U) : null;
|
|
@@ -2500,10 +2498,10 @@ var jr = { exports: {} };
|
|
|
2500
2498
|
var W = y && F(y[oe]), oe = S && F(S[oe]);
|
|
2501
2499
|
H(W, oe) !== 0 && (W != null && z(W), oe != null && z(oe));
|
|
2502
2500
|
});
|
|
2503
|
-
}))) :
|
|
2501
|
+
}))) : C ? (T = { from: C.lower, to: C.upper }, I.add(T), x.add(T)) : (x.add(n), I.add(n), o.indexes.forEach(function(P) {
|
|
2504
2502
|
return m(P.name).add(n);
|
|
2505
|
-
})),
|
|
2506
|
-
return !
|
|
2503
|
+
})), a.mutate(p).then(function(P) {
|
|
2504
|
+
return !C || p.type !== "add" && p.type !== "put" || (x.addKeys(P.results), h && h.forEach(function($) {
|
|
2507
2505
|
var F = p.values.map(function(U) {
|
|
2508
2506
|
return $.extractKey(U);
|
|
2509
2507
|
}), z = $.keyPath.findIndex(function(U) {
|
|
@@ -2522,19 +2520,19 @@ var jr = { exports: {} };
|
|
|
2522
2520
|
}, getMany: function(p) {
|
|
2523
2521
|
return [s, new ce().addKeys(p.keys)];
|
|
2524
2522
|
}, count: d, query: d, openCursor: d };
|
|
2525
|
-
return
|
|
2523
|
+
return R(v).forEach(function(p) {
|
|
2526
2524
|
b[p] = function(m) {
|
|
2527
|
-
var w = L.subscr, y = !!w, S = xr(L,
|
|
2525
|
+
var w = L.subscr, y = !!w, S = xr(L, a) && kr(p, m) ? m.obsSet = {} : w;
|
|
2528
2526
|
if (y) {
|
|
2529
2527
|
var E = function(T) {
|
|
2530
|
-
return T = "idb://".concat(t, "/").concat(
|
|
2528
|
+
return T = "idb://".concat(t, "/").concat(i, "/").concat(T), S[T] || (S[T] = new ce());
|
|
2531
2529
|
}, O = E(""), x = E(":dels"), w = v[p](m), y = w[0], w = w[1];
|
|
2532
2530
|
if ((p === "query" && y.isPrimaryKey && !m.values ? x : E(y.name || "")).add(w), !y.isPrimaryKey) {
|
|
2533
2531
|
if (p !== "count") {
|
|
2534
|
-
var
|
|
2535
|
-
return
|
|
2532
|
+
var I = p === "query" && g && m.values && a.query(l(l({}, m), { values: !1 }));
|
|
2533
|
+
return a[p].apply(this, arguments).then(function(T) {
|
|
2536
2534
|
if (p === "query") {
|
|
2537
|
-
if (g && m.values) return
|
|
2535
|
+
if (g && m.values) return I.then(function(F) {
|
|
2538
2536
|
return F = F.result, O.addKeys(F), T;
|
|
2539
2537
|
});
|
|
2540
2538
|
var M = m.values ? T.result.map(u) : T.result;
|
|
@@ -2556,7 +2554,7 @@ var jr = { exports: {} };
|
|
|
2556
2554
|
x.add(n);
|
|
2557
2555
|
}
|
|
2558
2556
|
}
|
|
2559
|
-
return
|
|
2557
|
+
return a[p].apply(this, arguments);
|
|
2560
2558
|
};
|
|
2561
2559
|
}), b;
|
|
2562
2560
|
} });
|
|
@@ -2564,150 +2562,150 @@ var jr = { exports: {} };
|
|
|
2564
2562
|
function Ar(e, t, n) {
|
|
2565
2563
|
if (n.numFailures === 0) return t;
|
|
2566
2564
|
if (t.type === "deleteRange") return null;
|
|
2567
|
-
var
|
|
2568
|
-
return n.numFailures ===
|
|
2565
|
+
var i = t.keys ? t.keys.length : "values" in t && t.values ? t.values.length : 1;
|
|
2566
|
+
return n.numFailures === i ? null : (t = l({}, t), B(t.keys) && (t.keys = t.keys.filter(function(a, o) {
|
|
2569
2567
|
return !(o in n.failures);
|
|
2570
|
-
})), "values" in t && B(t.values) && (t.values = t.values.filter(function(
|
|
2568
|
+
})), "values" in t && B(t.values) && (t.values = t.values.filter(function(a, o) {
|
|
2571
2569
|
return !(o in n.failures);
|
|
2572
2570
|
})), t);
|
|
2573
2571
|
}
|
|
2574
2572
|
function Kn(e, t) {
|
|
2575
|
-
return n = e, ((
|
|
2576
|
-
var n,
|
|
2573
|
+
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));
|
|
2574
|
+
var n, i;
|
|
2577
2575
|
}
|
|
2578
|
-
function Dr(e, t, v,
|
|
2576
|
+
function Dr(e, t, v, i, a, o) {
|
|
2579
2577
|
if (!v || v.length === 0) return e;
|
|
2580
|
-
var s = t.query.index, u = s.multiEntry, g = t.query.range,
|
|
2578
|
+
var s = t.query.index, u = s.multiEntry, g = t.query.range, h = i.schema.primaryKey.extractKey, b = s.extractKey, d = (s.lowLevelIndex || s).extractKey, v = v.reduce(function(p, m) {
|
|
2581
2579
|
var w = p, y = [];
|
|
2582
2580
|
if (m.type === "add" || m.type === "put") for (var S = new ce(), E = m.values.length - 1; 0 <= E; --E) {
|
|
2583
|
-
var O, x = m.values[E],
|
|
2584
|
-
S.hasKey(
|
|
2581
|
+
var O, x = m.values[E], I = h(x);
|
|
2582
|
+
S.hasKey(I) || (O = b(x), (u && B(O) ? O.some(function(M) {
|
|
2585
2583
|
return Kn(M, g);
|
|
2586
|
-
}) : Kn(O, g)) && (S.addKey(
|
|
2584
|
+
}) : Kn(O, g)) && (S.addKey(I), y.push(x)));
|
|
2587
2585
|
}
|
|
2588
2586
|
switch (m.type) {
|
|
2589
2587
|
case "add":
|
|
2590
2588
|
w = p.concat(t.values ? y : y.map(function(P) {
|
|
2591
|
-
return
|
|
2589
|
+
return h(P);
|
|
2592
2590
|
}));
|
|
2593
2591
|
break;
|
|
2594
2592
|
case "put":
|
|
2595
2593
|
var j = new ce().addKeys(m.values.map(function(P) {
|
|
2596
|
-
return
|
|
2594
|
+
return h(P);
|
|
2597
2595
|
})), w = p.filter(function(P) {
|
|
2598
|
-
return !j.hasKey(t.values ?
|
|
2596
|
+
return !j.hasKey(t.values ? h(P) : P);
|
|
2599
2597
|
}).concat(t.values ? y : y.map(function(P) {
|
|
2600
|
-
return
|
|
2598
|
+
return h(P);
|
|
2601
2599
|
}));
|
|
2602
2600
|
break;
|
|
2603
2601
|
case "delete":
|
|
2604
|
-
var
|
|
2602
|
+
var C = new ce().addKeys(m.keys);
|
|
2605
2603
|
w = p.filter(function(P) {
|
|
2606
|
-
return !
|
|
2604
|
+
return !C.hasKey(t.values ? h(P) : P);
|
|
2607
2605
|
});
|
|
2608
2606
|
break;
|
|
2609
2607
|
case "deleteRange":
|
|
2610
2608
|
var T = m.range;
|
|
2611
2609
|
w = p.filter(function(P) {
|
|
2612
|
-
return !Kn(
|
|
2610
|
+
return !Kn(h(P), T);
|
|
2613
2611
|
});
|
|
2614
2612
|
}
|
|
2615
2613
|
return w;
|
|
2616
2614
|
}, e);
|
|
2617
2615
|
return v === e ? e : (v.sort(function(p, m) {
|
|
2618
|
-
return H(d(p), d(m)) || H(
|
|
2619
|
-
}), t.limit && t.limit < 1 / 0 && (v.length > t.limit ? v.length = t.limit : e.length === t.limit && v.length < t.limit && (
|
|
2616
|
+
return H(d(p), d(m)) || H(h(p), h(m));
|
|
2617
|
+
}), t.limit && t.limit < 1 / 0 && (v.length > t.limit ? v.length = t.limit : e.length === t.limit && v.length < t.limit && (a.dirty = !0)), o ? Object.freeze(v) : v);
|
|
2620
2618
|
}
|
|
2621
2619
|
function Pr(e, t) {
|
|
2622
2620
|
return H(e.lower, t.lower) === 0 && H(e.upper, t.upper) === 0 && !!e.lowerOpen == !!t.lowerOpen && !!e.upperOpen == !!t.upperOpen;
|
|
2623
2621
|
}
|
|
2624
|
-
function
|
|
2625
|
-
return function(n,
|
|
2626
|
-
if (n === void 0) return
|
|
2627
|
-
if (
|
|
2628
|
-
if ((
|
|
2629
|
-
if (
|
|
2630
|
-
if (
|
|
2622
|
+
function _i(e, t) {
|
|
2623
|
+
return function(n, i, a, o) {
|
|
2624
|
+
if (n === void 0) return i !== void 0 ? -1 : 0;
|
|
2625
|
+
if (i === void 0) return 1;
|
|
2626
|
+
if ((i = H(n, i)) === 0) {
|
|
2627
|
+
if (a && o) return 0;
|
|
2628
|
+
if (a) return 1;
|
|
2631
2629
|
if (o) return -1;
|
|
2632
2630
|
}
|
|
2633
|
-
return
|
|
2634
|
-
}(e.lower, t.lower, e.lowerOpen, t.lowerOpen) <= 0 && 0 <= function(n,
|
|
2635
|
-
if (n === void 0) return
|
|
2636
|
-
if (
|
|
2637
|
-
if ((
|
|
2638
|
-
if (
|
|
2639
|
-
if (
|
|
2631
|
+
return i;
|
|
2632
|
+
}(e.lower, t.lower, e.lowerOpen, t.lowerOpen) <= 0 && 0 <= function(n, i, a, o) {
|
|
2633
|
+
if (n === void 0) return i !== void 0 ? 1 : 0;
|
|
2634
|
+
if (i === void 0) return -1;
|
|
2635
|
+
if ((i = H(n, i)) === 0) {
|
|
2636
|
+
if (a && o) return 0;
|
|
2637
|
+
if (a) return -1;
|
|
2640
2638
|
if (o) return 1;
|
|
2641
2639
|
}
|
|
2642
|
-
return
|
|
2640
|
+
return i;
|
|
2643
2641
|
}(e.upper, t.upper, e.upperOpen, t.upperOpen);
|
|
2644
2642
|
}
|
|
2645
|
-
function
|
|
2646
|
-
e.subscribers.add(n),
|
|
2647
|
-
var
|
|
2648
|
-
e.subscribers.delete(n), e.subscribers.size === 0 && (
|
|
2649
|
-
|
|
2643
|
+
function Si(e, t, n, i) {
|
|
2644
|
+
e.subscribers.add(n), i.addEventListener("abort", function() {
|
|
2645
|
+
var a, o;
|
|
2646
|
+
e.subscribers.delete(n), e.subscribers.size === 0 && (a = e, o = t, setTimeout(function() {
|
|
2647
|
+
a.subscribers.size === 0 && Me(o, a);
|
|
2650
2648
|
}, 3e3));
|
|
2651
2649
|
});
|
|
2652
2650
|
}
|
|
2653
|
-
var
|
|
2651
|
+
var Ei = { stack: "dbcore", level: 0, name: "Cache", create: function(e) {
|
|
2654
2652
|
var t = e.schema.name;
|
|
2655
|
-
return l(l({}, e), { transaction: function(n,
|
|
2656
|
-
var o, s, u = e.transaction(n,
|
|
2657
|
-
return
|
|
2653
|
+
return l(l({}, e), { transaction: function(n, i, a) {
|
|
2654
|
+
var o, s, u = e.transaction(n, i, a);
|
|
2655
|
+
return i === "readwrite" && (s = (o = new AbortController()).signal, a = function(g) {
|
|
2658
2656
|
return function() {
|
|
2659
|
-
if (o.abort(),
|
|
2660
|
-
for (var
|
|
2657
|
+
if (o.abort(), i === "readwrite") {
|
|
2658
|
+
for (var h = /* @__PURE__ */ new Set(), b = 0, d = n; b < d.length; b++) {
|
|
2661
2659
|
var v = d[b], p = Fe["idb://".concat(t, "/").concat(v)];
|
|
2662
2660
|
if (p) {
|
|
2663
2661
|
var m = e.table(v), w = p.optimisticOps.filter(function($) {
|
|
2664
2662
|
return $.trans === u;
|
|
2665
2663
|
});
|
|
2666
|
-
if (u._explicit && g && u.mutatedParts) for (var y = 0, S = Object.values(p.queries.query); y < S.length; y++) for (var E = 0, O = (j = S[y]).slice(); E < O.length; E++) Pn((
|
|
2667
|
-
return
|
|
2664
|
+
if (u._explicit && g && u.mutatedParts) for (var y = 0, S = Object.values(p.queries.query); y < S.length; y++) for (var E = 0, O = (j = S[y]).slice(); E < O.length; E++) Pn((C = O[E]).obsSet, u.mutatedParts) && (Me(j, C), C.subscribers.forEach(function($) {
|
|
2665
|
+
return h.add($);
|
|
2668
2666
|
}));
|
|
2669
2667
|
else if (0 < w.length) {
|
|
2670
2668
|
p.optimisticOps = p.optimisticOps.filter(function($) {
|
|
2671
2669
|
return $.trans !== u;
|
|
2672
2670
|
});
|
|
2673
|
-
for (var x = 0,
|
|
2674
|
-
return
|
|
2675
|
-
})) : T !==
|
|
2676
|
-
return
|
|
2671
|
+
for (var x = 0, I = Object.values(p.queries.query); x < I.length; x++) for (var j, C, T, M = 0, P = (j = I[x]).slice(); M < P.length; M++) (C = P[M]).res != null && u.mutatedParts && (g && !C.dirty ? (T = Object.isFrozen(C.res), T = Dr(C.res, C.req, w, m, C, T), C.dirty ? (Me(j, C), C.subscribers.forEach(function($) {
|
|
2672
|
+
return h.add($);
|
|
2673
|
+
})) : T !== C.res && (C.res = T, C.promise = N.resolve({ result: T }))) : (C.dirty && Me(j, C), C.subscribers.forEach(function($) {
|
|
2674
|
+
return h.add($);
|
|
2677
2675
|
})));
|
|
2678
2676
|
}
|
|
2679
2677
|
}
|
|
2680
2678
|
}
|
|
2681
|
-
|
|
2679
|
+
h.forEach(function($) {
|
|
2682
2680
|
return $();
|
|
2683
2681
|
});
|
|
2684
2682
|
}
|
|
2685
2683
|
};
|
|
2686
|
-
}, u.addEventListener("abort",
|
|
2684
|
+
}, u.addEventListener("abort", a(!1), { signal: s }), u.addEventListener("error", a(!1), { signal: s }), u.addEventListener("complete", a(!0), { signal: s })), u;
|
|
2687
2685
|
}, table: function(n) {
|
|
2688
|
-
var
|
|
2689
|
-
return l(l({},
|
|
2686
|
+
var i = e.table(n), a = i.schema.primaryKey;
|
|
2687
|
+
return l(l({}, i), { mutate: function(o) {
|
|
2690
2688
|
var s = L.trans;
|
|
2691
|
-
if (
|
|
2689
|
+
if (a.outbound || s.db._options.cache === "disabled" || s.explicit) return i.mutate(o);
|
|
2692
2690
|
var u = Fe["idb://".concat(t, "/").concat(n)];
|
|
2693
|
-
return u ? (s =
|
|
2691
|
+
return u ? (s = i.mutate(o), o.type !== "add" && o.type !== "put" || !(50 <= o.values.length || Mn(a, o).some(function(g) {
|
|
2694
2692
|
return g == null;
|
|
2695
2693
|
})) ? (u.optimisticOps.push(o), o.mutatedParts && Ht(o.mutatedParts), s.then(function(g) {
|
|
2696
2694
|
0 < g.numFailures && (Me(u.optimisticOps, o), (g = Ar(0, o, g)) && u.optimisticOps.push(g), o.mutatedParts && Ht(o.mutatedParts));
|
|
2697
2695
|
}), s.catch(function() {
|
|
2698
2696
|
Me(u.optimisticOps, o), o.mutatedParts && Ht(o.mutatedParts);
|
|
2699
2697
|
})) : s.then(function(g) {
|
|
2700
|
-
var
|
|
2701
|
-
var v, p = (v =
|
|
2702
|
-
return le(p,
|
|
2698
|
+
var h = Ar(0, l(l({}, o), { values: o.values.map(function(p, d) {
|
|
2699
|
+
var v, p = (v = a.keyPath) !== null && v !== void 0 && v.includes(".") ? je(p) : l({}, p);
|
|
2700
|
+
return le(p, a.keyPath, g.results[d]), p;
|
|
2703
2701
|
}) }), g);
|
|
2704
|
-
u.optimisticOps.push(
|
|
2702
|
+
u.optimisticOps.push(h), queueMicrotask(function() {
|
|
2705
2703
|
return o.mutatedParts && Ht(o.mutatedParts);
|
|
2706
2704
|
});
|
|
2707
|
-
}), s) :
|
|
2705
|
+
}), s) : i.mutate(o);
|
|
2708
2706
|
}, query: function(o) {
|
|
2709
|
-
if (!xr(L,
|
|
2710
|
-
var s = ((
|
|
2707
|
+
if (!xr(L, i) || !kr("query", o)) return i.query(o);
|
|
2708
|
+
var s = ((h = L.trans) === null || h === void 0 ? void 0 : h.db._options.cache) === "immutable", d = L, u = d.requery, g = d.signal, h = function(m, w, y, S) {
|
|
2711
2709
|
var E = Fe["idb://".concat(m, "/").concat(w)];
|
|
2712
2710
|
if (!E) return [];
|
|
2713
2711
|
if (!(w = E.queries[y])) return [null, !1, E, null];
|
|
@@ -2715,19 +2713,19 @@ var jr = { exports: {} };
|
|
|
2715
2713
|
if (!O) return [null, !1, E, null];
|
|
2716
2714
|
switch (y) {
|
|
2717
2715
|
case "query":
|
|
2718
|
-
var x = O.find(function(
|
|
2719
|
-
return
|
|
2716
|
+
var x = O.find(function(I) {
|
|
2717
|
+
return I.req.limit === S.limit && I.req.values === S.values && Pr(I.req.query.range, S.query.range);
|
|
2720
2718
|
});
|
|
2721
|
-
return x ? [x, !0, E, O] : [O.find(function(
|
|
2722
|
-
return ("limit" in
|
|
2719
|
+
return x ? [x, !0, E, O] : [O.find(function(I) {
|
|
2720
|
+
return ("limit" in I.req ? I.req.limit : 1 / 0) >= S.limit && (!S.values || I.req.values) && _i(I.req.query.range, S.query.range);
|
|
2723
2721
|
}), !1, E, O];
|
|
2724
2722
|
case "count":
|
|
2725
|
-
return x = O.find(function(
|
|
2726
|
-
return Pr(
|
|
2723
|
+
return x = O.find(function(I) {
|
|
2724
|
+
return Pr(I.req.query.range, S.query.range);
|
|
2727
2725
|
}), [x, !!x, E, O];
|
|
2728
2726
|
}
|
|
2729
|
-
}(t, n, "query", o), b =
|
|
2730
|
-
return b && d ? b.obsSet = o.obsSet : (d =
|
|
2727
|
+
}(t, n, "query", o), b = h[0], d = h[1], v = h[2], p = h[3];
|
|
2728
|
+
return b && d ? b.obsSet = o.obsSet : (d = i.query(o).then(function(m) {
|
|
2731
2729
|
var w = m.result;
|
|
2732
2730
|
if (b && (b.res = w), s) {
|
|
2733
2731
|
for (var y = 0, S = w.length; y < S; ++y) Object.freeze(w[y]);
|
|
@@ -2736,49 +2734,49 @@ var jr = { exports: {} };
|
|
|
2736
2734
|
return m;
|
|
2737
2735
|
}).catch(function(m) {
|
|
2738
2736
|
return p && b && Me(p, b), Promise.reject(m);
|
|
2739
|
-
}), b = { obsSet: o.obsSet, promise: d, subscribers: /* @__PURE__ */ new Set(), type: "query", req: o, dirty: !1 }, p ? p.push(b) : (p = [b], (v = v || (Fe["idb://".concat(t, "/").concat(n)] = { queries: { query: {}, count: {} }, objs: /* @__PURE__ */ new Map(), optimisticOps: [], unsignaledParts: {} })).queries.query[o.query.index.name || ""] = p)),
|
|
2740
|
-
return { result: Dr(m.result, o, v == null ? void 0 : v.optimisticOps,
|
|
2737
|
+
}), b = { obsSet: o.obsSet, promise: d, subscribers: /* @__PURE__ */ new Set(), type: "query", req: o, dirty: !1 }, p ? p.push(b) : (p = [b], (v = v || (Fe["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, g), b.promise.then(function(m) {
|
|
2738
|
+
return { result: Dr(m.result, o, v == null ? void 0 : v.optimisticOps, i, b, s) };
|
|
2741
2739
|
});
|
|
2742
2740
|
} });
|
|
2743
2741
|
} });
|
|
2744
2742
|
} };
|
|
2745
2743
|
function Qt(e, t) {
|
|
2746
|
-
return new Proxy(e, { get: function(n,
|
|
2747
|
-
return
|
|
2744
|
+
return new Proxy(e, { get: function(n, i, a) {
|
|
2745
|
+
return i === "db" ? t : Reflect.get(n, i, a);
|
|
2748
2746
|
} });
|
|
2749
2747
|
}
|
|
2750
2748
|
var Ee = (ne.prototype.version = function(e) {
|
|
2751
2749
|
if (isNaN(e) || e < 0.1) throw new G.Type("Given version is not a positive number");
|
|
2752
2750
|
if (e = Math.round(10 * e) / 10, this.idbdb || this._state.isBeingOpened) throw new G.Schema("Cannot add version when database is open");
|
|
2753
2751
|
this.verno = Math.max(this.verno, e);
|
|
2754
|
-
var t = this._versions, n = t.filter(function(
|
|
2755
|
-
return
|
|
2752
|
+
var t = this._versions, n = t.filter(function(i) {
|
|
2753
|
+
return i._cfg.version === e;
|
|
2756
2754
|
})[0];
|
|
2757
|
-
return n || (n = new this.Version(e), t.push(n), t.sort(
|
|
2755
|
+
return n || (n = new this.Version(e), t.push(n), t.sort(fi), n.stores({}), this._state.autoSchema = !1, n);
|
|
2758
2756
|
}, ne.prototype._whenReady = function(e) {
|
|
2759
2757
|
var t = this;
|
|
2760
|
-
return this.idbdb && (this._state.openComplete || L.letThrough || this._vip) ? e() : new N(function(n,
|
|
2761
|
-
if (t._state.openComplete) return
|
|
2758
|
+
return this.idbdb && (this._state.openComplete || L.letThrough || this._vip) ? e() : new N(function(n, i) {
|
|
2759
|
+
if (t._state.openComplete) return i(new G.DatabaseClosed(t._state.dbOpenError));
|
|
2762
2760
|
if (!t._state.isBeingOpened) {
|
|
2763
|
-
if (!t._state.autoOpen) return void
|
|
2761
|
+
if (!t._state.autoOpen) return void i(new G.DatabaseClosed());
|
|
2764
2762
|
t.open().catch(Q);
|
|
2765
2763
|
}
|
|
2766
|
-
t._state.dbReadyPromise.then(n,
|
|
2764
|
+
t._state.dbReadyPromise.then(n, i);
|
|
2767
2765
|
}).then(e);
|
|
2768
2766
|
}, ne.prototype.use = function(e) {
|
|
2769
|
-
var t = e.stack, n = e.create,
|
|
2770
|
-
return
|
|
2767
|
+
var t = e.stack, n = e.create, i = e.level, a = e.name;
|
|
2768
|
+
return a && this.unuse({ stack: t, name: a }), e = this._middlewares[t] || (this._middlewares[t] = []), e.push({ stack: t, create: n, level: i ?? 10, name: a }), e.sort(function(o, s) {
|
|
2771
2769
|
return o.level - s.level;
|
|
2772
2770
|
}), this;
|
|
2773
2771
|
}, ne.prototype.unuse = function(e) {
|
|
2774
|
-
var t = e.stack, n = e.name,
|
|
2775
|
-
return t && this._middlewares[t] && (this._middlewares[t] = this._middlewares[t].filter(function(
|
|
2776
|
-
return
|
|
2772
|
+
var t = e.stack, n = e.name, i = e.create;
|
|
2773
|
+
return t && this._middlewares[t] && (this._middlewares[t] = this._middlewares[t].filter(function(a) {
|
|
2774
|
+
return i ? a.create !== i : !!n && a.name !== n;
|
|
2777
2775
|
})), this;
|
|
2778
2776
|
}, ne.prototype.open = function() {
|
|
2779
2777
|
var e = this;
|
|
2780
2778
|
return Le(Ae, function() {
|
|
2781
|
-
return
|
|
2779
|
+
return yi(e);
|
|
2782
2780
|
});
|
|
2783
2781
|
}, ne.prototype._close = function() {
|
|
2784
2782
|
var e = this._state, t = Ze.indexOf(this);
|
|
@@ -2791,8 +2789,8 @@ var jr = { exports: {} };
|
|
|
2791
2789
|
}
|
|
2792
2790
|
e.isBeingOpened || (e.dbReadyPromise = new N(function(n) {
|
|
2793
2791
|
e.dbReadyResolve = n;
|
|
2794
|
-
}), e.openCanceller = new N(function(n,
|
|
2795
|
-
e.cancelOpen =
|
|
2792
|
+
}), e.openCanceller = new N(function(n, i) {
|
|
2793
|
+
e.cancelOpen = i;
|
|
2796
2794
|
}));
|
|
2797
2795
|
}, ne.prototype.close = function(n) {
|
|
2798
2796
|
var t = (n === void 0 ? { disableAutoOpen: !0 } : n).disableAutoOpen, n = this._state;
|
|
@@ -2800,18 +2798,18 @@ var jr = { exports: {} };
|
|
|
2800
2798
|
}, ne.prototype.delete = function(e) {
|
|
2801
2799
|
var t = this;
|
|
2802
2800
|
e === void 0 && (e = { disableAutoOpen: !0 });
|
|
2803
|
-
var n = 0 < arguments.length && typeof arguments[0] != "object",
|
|
2804
|
-
return new N(function(
|
|
2801
|
+
var n = 0 < arguments.length && typeof arguments[0] != "object", i = this._state;
|
|
2802
|
+
return new N(function(a, o) {
|
|
2805
2803
|
function s() {
|
|
2806
2804
|
t.close(e);
|
|
2807
2805
|
var u = t._deps.indexedDB.deleteDatabase(t.name);
|
|
2808
2806
|
u.onsuccess = Z(function() {
|
|
2809
|
-
var g,
|
|
2810
|
-
g = t._deps,
|
|
2807
|
+
var g, h, b;
|
|
2808
|
+
g = t._deps, h = t.name, b = g.indexedDB, g = g.IDBKeyRange, kn(b) || h === Tt || xn(b, g).delete(h).catch(Q), a();
|
|
2811
2809
|
}), u.onerror = me(o), u.onblocked = t._fireOnBlocked;
|
|
2812
2810
|
}
|
|
2813
2811
|
if (n) throw new G.InvalidArgument("Invalid closeOptions argument to db.delete()");
|
|
2814
|
-
|
|
2812
|
+
i.isBeingOpened ? i.dbReadyPromise.then(s) : s();
|
|
2815
2813
|
});
|
|
2816
2814
|
}, ne.prototype.backendDB = function() {
|
|
2817
2815
|
return this.idbdb;
|
|
@@ -2826,49 +2824,49 @@ var jr = { exports: {} };
|
|
|
2826
2824
|
return this._state.autoSchema;
|
|
2827
2825
|
}, Object.defineProperty(ne.prototype, "tables", { get: function() {
|
|
2828
2826
|
var e = this;
|
|
2829
|
-
return
|
|
2827
|
+
return R(this._allTables).map(function(t) {
|
|
2830
2828
|
return e._allTables[t];
|
|
2831
2829
|
});
|
|
2832
2830
|
}, enumerable: !1, configurable: !0 }), ne.prototype.transaction = function() {
|
|
2833
|
-
var e = (function(t, n,
|
|
2834
|
-
var
|
|
2835
|
-
if (
|
|
2836
|
-
for (var o = new Array(
|
|
2837
|
-
return
|
|
2831
|
+
var e = (function(t, n, i) {
|
|
2832
|
+
var a = arguments.length;
|
|
2833
|
+
if (a < 2) throw new G.InvalidArgument("Too few arguments");
|
|
2834
|
+
for (var o = new Array(a - 1); --a; ) o[a - 1] = arguments[a];
|
|
2835
|
+
return i = o.pop(), [t, Xn(o), i];
|
|
2838
2836
|
}).apply(this, arguments);
|
|
2839
2837
|
return this._transaction.apply(this, e);
|
|
2840
2838
|
}, ne.prototype._transaction = function(e, t, n) {
|
|
2841
|
-
var
|
|
2842
|
-
|
|
2839
|
+
var i = this, a = L.trans;
|
|
2840
|
+
a && a.db === this && e.indexOf("!") === -1 || (a = null);
|
|
2843
2841
|
var o, s, u = e.indexOf("?") !== -1;
|
|
2844
2842
|
e = e.replace("!", "").replace("?", "");
|
|
2845
2843
|
try {
|
|
2846
|
-
if (s = t.map(function(
|
|
2847
|
-
if (
|
|
2848
|
-
return
|
|
2844
|
+
if (s = t.map(function(h) {
|
|
2845
|
+
if (h = h instanceof i.Table ? h.name : h, typeof h != "string") throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");
|
|
2846
|
+
return h;
|
|
2849
2847
|
}), e == "r" || e === hn) o = hn;
|
|
2850
2848
|
else {
|
|
2851
2849
|
if (e != "rw" && e != pn) throw new G.InvalidArgument("Invalid transaction mode: " + e);
|
|
2852
2850
|
o = pn;
|
|
2853
2851
|
}
|
|
2854
|
-
if (
|
|
2855
|
-
if (
|
|
2852
|
+
if (a) {
|
|
2853
|
+
if (a.mode === hn && o === pn) {
|
|
2856
2854
|
if (!u) throw new G.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");
|
|
2857
|
-
|
|
2855
|
+
a = null;
|
|
2858
2856
|
}
|
|
2859
|
-
|
|
2860
|
-
if (
|
|
2861
|
-
if (!u) throw new G.SubTransaction("Table " +
|
|
2862
|
-
|
|
2857
|
+
a && s.forEach(function(h) {
|
|
2858
|
+
if (a && a.storeNames.indexOf(h) === -1) {
|
|
2859
|
+
if (!u) throw new G.SubTransaction("Table " + h + " not included in parent transaction.");
|
|
2860
|
+
a = null;
|
|
2863
2861
|
}
|
|
2864
|
-
}), u &&
|
|
2862
|
+
}), u && a && !a.active && (a = null);
|
|
2865
2863
|
}
|
|
2866
|
-
} catch (
|
|
2867
|
-
return
|
|
2868
|
-
d(
|
|
2869
|
-
}) : te(
|
|
2864
|
+
} catch (h) {
|
|
2865
|
+
return a ? a._promise(null, function(b, d) {
|
|
2866
|
+
d(h);
|
|
2867
|
+
}) : te(h);
|
|
2870
2868
|
}
|
|
2871
|
-
var g = (function
|
|
2869
|
+
var g = (function h(b, d, v, p, m) {
|
|
2872
2870
|
return N.resolve().then(function() {
|
|
2873
2871
|
var w = L.transless || L, y = b._createTransaction(d, v, b._dbSchema, p);
|
|
2874
2872
|
if (y.explicit = !0, w = { trans: y, transless: w }, p) y.idbtrans = p.idbtrans;
|
|
@@ -2876,7 +2874,7 @@ var jr = { exports: {} };
|
|
|
2876
2874
|
y.create(), y.idbtrans._explicit = !0, b._state.PR1398_maxLoop = 3;
|
|
2877
2875
|
} catch (O) {
|
|
2878
2876
|
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() {
|
|
2879
|
-
return
|
|
2877
|
+
return h(b, d, v, null, m);
|
|
2880
2878
|
})) : te(O);
|
|
2881
2879
|
}
|
|
2882
2880
|
var S, E = tn(m);
|
|
@@ -2895,9 +2893,9 @@ var jr = { exports: {} };
|
|
|
2895
2893
|
return y._reject(O), te(O);
|
|
2896
2894
|
});
|
|
2897
2895
|
});
|
|
2898
|
-
}).bind(null, this, o, s,
|
|
2899
|
-
return
|
|
2900
|
-
return
|
|
2896
|
+
}).bind(null, this, o, s, a, n);
|
|
2897
|
+
return a ? a._promise(o, g, "lock") : L.trans ? Le(L.transless, function() {
|
|
2898
|
+
return i._whenReady(g);
|
|
2901
2899
|
}) : this._whenReady(g);
|
|
2902
2900
|
}, ne.prototype.table = function(e) {
|
|
2903
2901
|
if (!q(this._allTables, e)) throw new G.InvalidTable("Table ".concat(e, " does not exist"));
|
|
@@ -2906,14 +2904,14 @@ var jr = { exports: {} };
|
|
|
2906
2904
|
function ne(e, t) {
|
|
2907
2905
|
var n = this;
|
|
2908
2906
|
this._middlewares = {}, this.verno = 0;
|
|
2909
|
-
var
|
|
2910
|
-
this._options = t = l({ addons: ne.addons, autoOpen: !0, indexedDB:
|
|
2911
|
-
var
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
}),
|
|
2915
|
-
|
|
2916
|
-
}), this._state =
|
|
2907
|
+
var i = ne.dependencies;
|
|
2908
|
+
this._options = t = l({ addons: ne.addons, autoOpen: !0, indexedDB: i.indexedDB, IDBKeyRange: i.IDBKeyRange, cache: "cloned" }, t), this._deps = { indexedDB: t.indexedDB, IDBKeyRange: t.IDBKeyRange }, i = t.addons, this._dbSchema = {}, this._versions = [], this._storeNames = [], this._allTables = {}, this.idbdb = null, this._novip = this;
|
|
2909
|
+
var a, o, s, u, g, h = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: Q, dbReadyPromise: null, cancelOpen: Q, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: t.autoOpen };
|
|
2910
|
+
h.dbReadyPromise = new N(function(d) {
|
|
2911
|
+
h.dbReadyResolve = d;
|
|
2912
|
+
}), h.openCanceller = new N(function(d, v) {
|
|
2913
|
+
h.cancelOpen = v;
|
|
2914
|
+
}), this._state = h, this.name = e, this.on = dt(this, "populate", "blocked", "versionchange", "close", { ready: [rn, Q] }), this.on.ready.subscribe = Hn(this.on.ready.subscribe, function(d) {
|
|
2917
2915
|
return function(v, p) {
|
|
2918
2916
|
ne.vip(function() {
|
|
2919
2917
|
var m, w = n._state;
|
|
@@ -2922,8 +2920,8 @@ var jr = { exports: {} };
|
|
|
2922
2920
|
}));
|
|
2923
2921
|
});
|
|
2924
2922
|
};
|
|
2925
|
-
}), this.Collection = (
|
|
2926
|
-
this.db =
|
|
2923
|
+
}), this.Collection = (a = this, ft(ai.prototype, function(S, y) {
|
|
2924
|
+
this.db = a;
|
|
2927
2925
|
var p = or, m = null;
|
|
2928
2926
|
if (y) try {
|
|
2929
2927
|
p = y();
|
|
@@ -2931,10 +2929,10 @@ var jr = { exports: {} };
|
|
|
2931
2929
|
m = E;
|
|
2932
2930
|
}
|
|
2933
2931
|
var w = S._ctx, y = w.table, S = y.hook.reading.fire;
|
|
2934
|
-
this._ctx = { table: y, index: w.index, isPrimKey: !w.index || y.schema.primKey.keyPath && w.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: w.or, valueMapper: S !==
|
|
2932
|
+
this._ctx = { table: y, index: w.index, isPrimKey: !w.index || y.schema.primKey.keyPath && w.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: w.or, valueMapper: S !== at ? S : null };
|
|
2935
2933
|
})), this.Table = (o = this, ft(lr.prototype, function(d, v, p) {
|
|
2936
|
-
this.db = o, this._tx = p, this.name = d, this.schema = v, this.hook = o._allTables[d] ? o._allTables[d].hook : dt(null, { creating: [Vr, Q], reading: [Xr,
|
|
2937
|
-
})), this.Transaction = (s = this, ft(
|
|
2934
|
+
this.db = o, this._tx = p, this.name = d, this.schema = v, this.hook = o._allTables[d] ? o._allTables[d].hook : dt(null, { creating: [Vr, Q], reading: [Xr, at], updating: [Zr, Q], deleting: [Jr, Q] });
|
|
2935
|
+
})), this.Transaction = (s = this, ft(ci.prototype, function(d, v, p, m, w) {
|
|
2938
2936
|
var y = this;
|
|
2939
2937
|
this.db = s, this.mode = d, this.storeNames = v, this.schema = p, this.chromeTransactionDurability = m, this.idbtrans = null, this.on = dt(this, "complete", "error", "abort"), this.parent = w || null, this.active = !0, this._reculock = 0, this._blockedFuncs = [], this._resolve = null, this._reject = null, this._waitingFor = null, this._waitingQueue = null, this._spinCount = 0, this._completion = new N(function(S, E) {
|
|
2940
2938
|
y._resolve = S, y._reject = E;
|
|
@@ -2944,7 +2942,7 @@ var jr = { exports: {} };
|
|
|
2944
2942
|
var E = y.active;
|
|
2945
2943
|
return y.active = !1, y.on.error.fire(S), y.parent ? y.parent._reject(S) : E && y.idbtrans && y.idbtrans.abort(), te(S);
|
|
2946
2944
|
});
|
|
2947
|
-
})), this.Version = (u = this, ft(
|
|
2945
|
+
})), this.Version = (u = this, ft(gi.prototype, function(d) {
|
|
2948
2946
|
this.db = u, this._cfg = { version: d, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
|
|
2949
2947
|
})), this.WhereClause = (g = this, ft(gr.prototype, function(d, v, p) {
|
|
2950
2948
|
if (this.db = g, this._ctx = { table: d, index: v === ":id" ? null : v, or: p }, this._cmp = this._ascending = H, this._descending = function(m, w) {
|
|
@@ -2966,7 +2964,7 @@ var jr = { exports: {} };
|
|
|
2966
2964
|
}).map(function(v) {
|
|
2967
2965
|
return v.on("versionchange").fire(d);
|
|
2968
2966
|
});
|
|
2969
|
-
}, this.use(
|
|
2967
|
+
}, this.use(vi), this.use(Ei), this.use(wi), this.use(mi), this.use(bi);
|
|
2970
2968
|
var b = new Proxy(this, { get: function(d, v, p) {
|
|
2971
2969
|
if (v === "_vip") return !0;
|
|
2972
2970
|
if (v === "table") return function(w) {
|
|
@@ -2979,11 +2977,11 @@ var jr = { exports: {} };
|
|
|
2979
2977
|
return Qt(m.apply(this, arguments), b);
|
|
2980
2978
|
} : m;
|
|
2981
2979
|
} });
|
|
2982
|
-
this.vip = b,
|
|
2980
|
+
this.vip = b, i.forEach(function(d) {
|
|
2983
2981
|
return d(n);
|
|
2984
2982
|
});
|
|
2985
2983
|
}
|
|
2986
|
-
var Xt, he = typeof Symbol < "u" && "observable" in Symbol ? Symbol.observable : "@@observable",
|
|
2984
|
+
var Xt, he = typeof Symbol < "u" && "observable" in Symbol ? Symbol.observable : "@@observable", Oi = (Nn.prototype.subscribe = function(e, t, n) {
|
|
2987
2985
|
return this._subscribe(e && typeof e != "function" ? e : { next: e, error: t, complete: n });
|
|
2988
2986
|
}, Nn.prototype[he] = function() {
|
|
2989
2987
|
return this;
|
|
@@ -2997,17 +2995,17 @@ var jr = { exports: {} };
|
|
|
2997
2995
|
Xt = { indexedDB: null, IDBKeyRange: null };
|
|
2998
2996
|
}
|
|
2999
2997
|
function Ir(e) {
|
|
3000
|
-
var t, n = !1,
|
|
3001
|
-
var o = tn(e), s, u = !1, g = {},
|
|
2998
|
+
var t, n = !1, i = new Oi(function(a) {
|
|
2999
|
+
var o = tn(e), s, u = !1, g = {}, h = {}, b = { get closed() {
|
|
3002
3000
|
return u;
|
|
3003
3001
|
}, unsubscribe: function() {
|
|
3004
3002
|
u || (u = !0, s && s.abort(), d && Re.storagemutated.unsubscribe(p));
|
|
3005
3003
|
} };
|
|
3006
|
-
|
|
3004
|
+
a.start && a.start(b);
|
|
3007
3005
|
var d = !1, v = function() {
|
|
3008
3006
|
return fn(m);
|
|
3009
3007
|
}, p = function(w) {
|
|
3010
|
-
zt(g, w), Pn(
|
|
3008
|
+
zt(g, w), Pn(h, g) && v();
|
|
3011
3009
|
}, m = function() {
|
|
3012
3010
|
var w, y, S;
|
|
3013
3011
|
!u && Xt.indexedDB && (g = {}, w = {}, s && s.abort(), s = new AbortController(), S = function(E) {
|
|
@@ -3023,22 +3021,22 @@ var jr = { exports: {} };
|
|
|
3023
3021
|
n = !0, t = E, u || y.signal.aborted || (g = {}, function(O) {
|
|
3024
3022
|
for (var x in O) if (q(O, x)) return;
|
|
3025
3023
|
return 1;
|
|
3026
|
-
}(
|
|
3027
|
-
return !u &&
|
|
3024
|
+
}(h = w) || d || (Re(gt, p), d = !0), fn(function() {
|
|
3025
|
+
return !u && a.next && a.next(E);
|
|
3028
3026
|
}));
|
|
3029
3027
|
}, function(E) {
|
|
3030
3028
|
n = !1, ["DatabaseClosedError", "AbortError"].includes(E == null ? void 0 : E.name) || u || fn(function() {
|
|
3031
|
-
u ||
|
|
3029
|
+
u || a.error && a.error(E);
|
|
3032
3030
|
});
|
|
3033
3031
|
}));
|
|
3034
3032
|
};
|
|
3035
3033
|
return setTimeout(v, 0), b;
|
|
3036
3034
|
});
|
|
3037
|
-
return
|
|
3035
|
+
return i.hasValue = function() {
|
|
3038
3036
|
return n;
|
|
3039
|
-
},
|
|
3037
|
+
}, i.getValue = function() {
|
|
3040
3038
|
return t;
|
|
3041
|
-
},
|
|
3039
|
+
}, i;
|
|
3042
3040
|
}
|
|
3043
3041
|
var Ue = Ee;
|
|
3044
3042
|
function Bn(e) {
|
|
@@ -3059,11 +3057,11 @@ var jr = { exports: {} };
|
|
|
3059
3057
|
});
|
|
3060
3058
|
}, getDatabaseNames: function(e) {
|
|
3061
3059
|
try {
|
|
3062
|
-
return t = Ue.dependencies, n = t.indexedDB, t = t.IDBKeyRange, (kn(n) ? Promise.resolve(n.databases()).then(function(
|
|
3063
|
-
return
|
|
3064
|
-
return
|
|
3065
|
-
}).filter(function(
|
|
3066
|
-
return
|
|
3060
|
+
return t = Ue.dependencies, n = t.indexedDB, t = t.IDBKeyRange, (kn(n) ? Promise.resolve(n.databases()).then(function(i) {
|
|
3061
|
+
return i.map(function(a) {
|
|
3062
|
+
return a.name;
|
|
3063
|
+
}).filter(function(a) {
|
|
3064
|
+
return a !== Tt;
|
|
3067
3065
|
});
|
|
3068
3066
|
}) : xn(n, t).toCollection().primaryKeys()).then(e);
|
|
3069
3067
|
} catch {
|
|
@@ -3087,10 +3085,10 @@ var jr = { exports: {} };
|
|
|
3087
3085
|
};
|
|
3088
3086
|
}, spawn: function(e, t, n) {
|
|
3089
3087
|
try {
|
|
3090
|
-
var
|
|
3091
|
-
return
|
|
3092
|
-
} catch (
|
|
3093
|
-
return te(
|
|
3088
|
+
var i = Tn(e.apply(n, t || []));
|
|
3089
|
+
return i && typeof i.then == "function" ? i : N.resolve(i);
|
|
3090
|
+
} catch (a) {
|
|
3091
|
+
return te(a);
|
|
3094
3092
|
}
|
|
3095
3093
|
}, currentTransaction: { get: function() {
|
|
3096
3094
|
return L.trans || null;
|
|
@@ -3141,37 +3139,37 @@ var jr = { exports: {} };
|
|
|
3141
3139
|
}, default: Ee, RangeSet: ce, mergeRanges: vt, rangesOverlap: wr }), { default: Ee }), Ee;
|
|
3142
3140
|
});
|
|
3143
3141
|
})(jr);
|
|
3144
|
-
var
|
|
3145
|
-
const Fn = /* @__PURE__ */
|
|
3142
|
+
var Ii = jr.exports;
|
|
3143
|
+
const Fn = /* @__PURE__ */ Pi(Ii), Tr = Symbol.for("Dexie"), Un = globalThis[Tr] || (globalThis[Tr] = Fn);
|
|
3146
3144
|
if (Fn.semVer !== Un.semVer)
|
|
3147
3145
|
throw new Error(`Two different versions of Dexie loaded in the same app: ${Fn.semVer} and ${Un.semVer}`);
|
|
3148
|
-
function X(
|
|
3149
|
-
let r = `${
|
|
3150
|
-
return
|
|
3146
|
+
function X(f) {
|
|
3147
|
+
let r = `${f.type}.${f.topics}`;
|
|
3148
|
+
return f.order && (r += `.${f.order}`), f.period && (r += `.${f.period}`), r;
|
|
3151
3149
|
}
|
|
3152
|
-
function nt(
|
|
3150
|
+
function nt(f) {
|
|
3153
3151
|
var r;
|
|
3154
|
-
if (
|
|
3155
|
-
const c = (r =
|
|
3156
|
-
c && c.length > 1 ? (
|
|
3152
|
+
if (f.widget === void 0) {
|
|
3153
|
+
const c = (r = f.topics) == null ? void 0 : r.split("-");
|
|
3154
|
+
c && c.length > 1 ? (f.dashboard = c ? c[0] : "", f.widget = c ? c[1] : "") : (f.widget = f.topics, f.dashboard = f.slide);
|
|
3157
3155
|
}
|
|
3158
|
-
return
|
|
3156
|
+
return f.topics === void 0 && (f.topics = `${f.dashboard}-${f.widget}`), f;
|
|
3159
3157
|
}
|
|
3160
|
-
function _t(
|
|
3158
|
+
function _t(f, r) {
|
|
3161
3159
|
var B;
|
|
3162
|
-
let c, l, k, D,
|
|
3163
|
-
switch (
|
|
3160
|
+
let c, l, k, D, R;
|
|
3161
|
+
switch (f.moderation) {
|
|
3164
3162
|
case Zt.BEFORE:
|
|
3165
|
-
c = /* @__PURE__ */ new Date(), l = (B =
|
|
3163
|
+
c = /* @__PURE__ */ new Date(), l = (B = f.beforeTime) == null ? void 0 : B.split(":"), k = Number.parseInt(l ? l[0] : "00"), D = Number.parseInt(l ? l[1] : "00"), R = Number.parseInt(l ? l[2] : "00"), r.before = c.setHours(k, D, R, 0) / 1e3, r.period || (r.period = c.getDay() === 1 ? 72 : 24);
|
|
3166
3164
|
break;
|
|
3167
3165
|
case Zt.DELAYED:
|
|
3168
|
-
|
|
3166
|
+
f.delay && f.delay > 0 && (r.delay = `${f.delay}`);
|
|
3169
3167
|
break;
|
|
3170
3168
|
case Zt.APPROVED:
|
|
3171
3169
|
r.approved = "1";
|
|
3172
3170
|
break;
|
|
3173
3171
|
default:
|
|
3174
|
-
|
|
3172
|
+
f.period !== 0 && (r.period = f.period);
|
|
3175
3173
|
}
|
|
3176
3174
|
return r;
|
|
3177
3175
|
}
|
|
@@ -3236,7 +3234,7 @@ class Mr {
|
|
|
3236
3234
|
});
|
|
3237
3235
|
if (D.length === 0)
|
|
3238
3236
|
return { data: null, message: "No Messages error", success: !1 };
|
|
3239
|
-
const
|
|
3237
|
+
const R = D[0] ? D[0].title : "No title", B = D.map(
|
|
3240
3238
|
(fe) => fe.message_id
|
|
3241
3239
|
), ee = (await this.db.table(K.MESSAGES).where("id").anyOf(B).toArray().then((fe) => fe.sort((q, xe) => xe.utc - q.utc))).map(
|
|
3242
3240
|
(fe) => fe.data
|
|
@@ -3246,7 +3244,7 @@ class Mr {
|
|
|
3246
3244
|
presentation: (r == null ? void 0 : r.presentation) || "not set",
|
|
3247
3245
|
slide: (r == null ? void 0 : r.slide) || "not set",
|
|
3248
3246
|
messages: ee,
|
|
3249
|
-
title:
|
|
3247
|
+
title: R,
|
|
3250
3248
|
topics: [r.dashboard, r.widget].join("-"),
|
|
3251
3249
|
query: r
|
|
3252
3250
|
},
|
|
@@ -3290,16 +3288,16 @@ class Mr {
|
|
|
3290
3288
|
return 400;
|
|
3291
3289
|
const l = c.data.title, k = c.data.topics;
|
|
3292
3290
|
let D = 0;
|
|
3293
|
-
return c.data.messages.forEach(async (
|
|
3291
|
+
return c.data.messages.forEach(async (R) => {
|
|
3294
3292
|
var B, J, ee, fe;
|
|
3295
|
-
|
|
3293
|
+
R != null && R.id && (await this.db.table(K.MESSAGES).put({ id: R.id, utc: R.utc, data: R }).catch((q) => {
|
|
3296
3294
|
D++, console.error(
|
|
3297
3295
|
"%cstorage",
|
|
3298
3296
|
_.STORAGE,
|
|
3299
3297
|
"set message",
|
|
3300
3298
|
l,
|
|
3301
3299
|
k,
|
|
3302
|
-
|
|
3300
|
+
R,
|
|
3303
3301
|
q.message
|
|
3304
3302
|
);
|
|
3305
3303
|
}).catch((q) => {
|
|
@@ -3308,26 +3306,26 @@ class Mr {
|
|
|
3308
3306
|
_.STORAGE,
|
|
3309
3307
|
"set message",
|
|
3310
3308
|
`title: ${l}`,
|
|
3311
|
-
|
|
3309
|
+
R,
|
|
3312
3310
|
q.message
|
|
3313
3311
|
);
|
|
3314
3312
|
}), await this.db.table(K.TOPICS).put({
|
|
3315
3313
|
widget_id: r.widget,
|
|
3316
|
-
message_id:
|
|
3314
|
+
message_id: R.id,
|
|
3317
3315
|
dashboard_id: r.dashboard,
|
|
3318
3316
|
title: l,
|
|
3319
|
-
engagement: (B =
|
|
3320
|
-
impressions: (J =
|
|
3321
|
-
reach: (ee =
|
|
3322
|
-
sentiment: ((fe =
|
|
3323
|
-
utc:
|
|
3317
|
+
engagement: (B = R.dynamics) == null ? void 0 : B.engagement,
|
|
3318
|
+
impressions: (J = R.dynamics) == null ? void 0 : J.semrush_visits,
|
|
3319
|
+
reach: (ee = R.dynamics) == null ? void 0 : ee.potential_reach,
|
|
3320
|
+
sentiment: ((fe = R.topics[0]) == null ? void 0 : fe.sentiment) || 0,
|
|
3321
|
+
utc: R.utc
|
|
3324
3322
|
}).catch((q) => {
|
|
3325
3323
|
D++, console.error(
|
|
3326
3324
|
"%cstorage",
|
|
3327
3325
|
_.STORAGE,
|
|
3328
3326
|
"set topic",
|
|
3329
3327
|
`title: ${l}`,
|
|
3330
|
-
|
|
3328
|
+
R,
|
|
3331
3329
|
q.message
|
|
3332
3330
|
);
|
|
3333
3331
|
}));
|
|
@@ -3339,16 +3337,16 @@ class Mr {
|
|
|
3339
3337
|
*/
|
|
3340
3338
|
A(this, "cleanMessages", async (r) => {
|
|
3341
3339
|
const c = Date.now() / 1e3, l = (D) => D.utc < c - r, k = (D) => D.utc < c - r;
|
|
3342
|
-
return await this.db.table(K.TOPICS).orderBy("utc").filter(l).modify((D,
|
|
3343
|
-
delete
|
|
3340
|
+
return await this.db.table(K.TOPICS).orderBy("utc").filter(l).modify((D, R) => {
|
|
3341
|
+
delete R.value;
|
|
3344
3342
|
}).catch((D) => (console.error(
|
|
3345
3343
|
"%cstorage%c %clean",
|
|
3346
3344
|
_.STORAGE,
|
|
3347
3345
|
_.NONE,
|
|
3348
3346
|
_.MESSAGES,
|
|
3349
3347
|
D.message
|
|
3350
|
-
), 0)), await this.db.table(K.MESSAGES).orderBy("utc").filter(k).modify((D,
|
|
3351
|
-
delete
|
|
3348
|
+
), 0)), await this.db.table(K.MESSAGES).orderBy("utc").filter(k).modify((D, R) => {
|
|
3349
|
+
delete R.value;
|
|
3352
3350
|
}).catch((D) => (console.error(
|
|
3353
3351
|
"%cstorage%c %clean",
|
|
3354
3352
|
_.STORAGE,
|
|
@@ -3452,26 +3450,26 @@ class Mr {
|
|
|
3452
3450
|
}), this.db.open();
|
|
3453
3451
|
}
|
|
3454
3452
|
}
|
|
3455
|
-
function Wn(
|
|
3453
|
+
function Wn(f) {
|
|
3456
3454
|
return new Promise((r, c) => {
|
|
3457
|
-
|
|
3455
|
+
f.oncomplete = f.onsuccess = () => r(f.result), f.onabort = f.onerror = () => c(f.error);
|
|
3458
3456
|
});
|
|
3459
3457
|
}
|
|
3460
|
-
function
|
|
3461
|
-
const c = indexedDB.open(
|
|
3458
|
+
function Ci(f, r) {
|
|
3459
|
+
const c = indexedDB.open(f);
|
|
3462
3460
|
c.onupgradeneeded = () => c.result.createObjectStore(r);
|
|
3463
3461
|
const l = Wn(c);
|
|
3464
|
-
return (k, D) => l.then((
|
|
3462
|
+
return (k, D) => l.then((R) => D(R.transaction(r, k).objectStore(r)));
|
|
3465
3463
|
}
|
|
3466
3464
|
let Gn;
|
|
3467
3465
|
function Kr() {
|
|
3468
|
-
return Gn || (Gn =
|
|
3466
|
+
return Gn || (Gn = Ci("keyval-store", "keyval")), Gn;
|
|
3469
3467
|
}
|
|
3470
|
-
function Jt(
|
|
3471
|
-
return r("readonly", (c) => Wn(c.get(
|
|
3468
|
+
function Jt(f, r = Kr()) {
|
|
3469
|
+
return r("readonly", (c) => Wn(c.get(f)));
|
|
3472
3470
|
}
|
|
3473
|
-
function wt(
|
|
3474
|
-
return c("readwrite", (l) => (l.put(r,
|
|
3471
|
+
function wt(f, r, c = Kr()) {
|
|
3472
|
+
return c("readwrite", (l) => (l.put(r, f), Wn(l.transaction)));
|
|
3475
3473
|
}
|
|
3476
3474
|
class Nr {
|
|
3477
3475
|
constructor(r) {
|
|
@@ -3976,17 +3974,17 @@ class Gr {
|
|
|
3976
3974
|
this.options = r, window.BuzzCasting.WidgetData = /* @__PURE__ */ new Set();
|
|
3977
3975
|
}
|
|
3978
3976
|
}
|
|
3979
|
-
function
|
|
3980
|
-
const r =
|
|
3977
|
+
function Li(f) {
|
|
3978
|
+
const r = f.toUpperCase().split(/[\s_-]+/);
|
|
3981
3979
|
return r.length > 0 ? (r.forEach((c, l) => {
|
|
3982
3980
|
r[l] = `${c.charAt(0)}.`;
|
|
3983
3981
|
}), r.join(" ")) : "";
|
|
3984
3982
|
}
|
|
3985
|
-
function
|
|
3983
|
+
function Gi(f) {
|
|
3986
3984
|
let r = "", c = "", l = {
|
|
3987
3985
|
backgroundImage: ""
|
|
3988
3986
|
};
|
|
3989
|
-
return typeof
|
|
3987
|
+
return typeof f.media < "u" && f.media.forEach((k) => {
|
|
3990
3988
|
(k.type === "photo" || k.type === "image") && (l = {
|
|
3991
3989
|
backgroundImage: `url(${k.url})`
|
|
3992
3990
|
}, c = k.url), k.type === "video" && (r = k.url);
|
|
@@ -3996,24 +3994,24 @@ function Ga(h) {
|
|
|
3996
3994
|
video: r
|
|
3997
3995
|
};
|
|
3998
3996
|
}
|
|
3999
|
-
function
|
|
3997
|
+
function Ri(f) {
|
|
4000
3998
|
const r = {};
|
|
4001
|
-
for (let c = 0; c <
|
|
4002
|
-
const l =
|
|
3999
|
+
for (let c = 0; c < f.length; c++) {
|
|
4000
|
+
const l = f.item(c);
|
|
4003
4001
|
l != null && l.name && (r[l.name] = l.value);
|
|
4004
4002
|
}
|
|
4005
4003
|
return r;
|
|
4006
4004
|
}
|
|
4007
|
-
function $
|
|
4005
|
+
function $i(f) {
|
|
4008
4006
|
const r = {};
|
|
4009
|
-
for (let c = 0; c <
|
|
4010
|
-
const l =
|
|
4007
|
+
for (let c = 0; c < f.length; c++) {
|
|
4008
|
+
const l = f[c];
|
|
4011
4009
|
l.name !== "class" && !l.name.includes("data") && (r[l.name] = l.value);
|
|
4012
4010
|
}
|
|
4013
4011
|
return r;
|
|
4014
4012
|
}
|
|
4015
|
-
function
|
|
4016
|
-
switch (
|
|
4013
|
+
function Fi(f, r) {
|
|
4014
|
+
switch (f) {
|
|
4017
4015
|
case "bl":
|
|
4018
4016
|
return `text-blue fa-solid fa-rss fa-${r}`;
|
|
4019
4017
|
case "co":
|
|
@@ -4054,41 +4052,41 @@ function Fa(h, r) {
|
|
|
4054
4052
|
return "";
|
|
4055
4053
|
}
|
|
4056
4054
|
}
|
|
4057
|
-
function
|
|
4058
|
-
return
|
|
4055
|
+
function Ui(f) {
|
|
4056
|
+
return f.replace(/^\w|[A-Z]|\b\w/g, (r, c) => c === 0 ? r.toLowerCase() : r.toUpperCase()).replace(/\s+/g, "");
|
|
4059
4057
|
}
|
|
4060
|
-
function
|
|
4061
|
-
return
|
|
4058
|
+
function Wi(f) {
|
|
4059
|
+
return f.toLowerCase().split("-").reduce((r, c) => r + (c.charAt(0).toUpperCase() + c.slice(1)));
|
|
4062
4060
|
}
|
|
4063
|
-
function
|
|
4061
|
+
function Ti(f) {
|
|
4064
4062
|
const r = document.createRange();
|
|
4065
|
-
r.selectNodeContents(
|
|
4063
|
+
r.selectNodeContents(f), r.deleteContents();
|
|
4066
4064
|
}
|
|
4067
|
-
function
|
|
4068
|
-
return `${
|
|
4069
|
-
`).replace(/\n/g, "<br/>")}`;
|
|
4065
|
+
function zi(f) {
|
|
4066
|
+
return `${(f == null ? void 0 : f.title.length) > 0 ? `<p><strong>${f.title}</strong></p>` : ""}${f != null && f.content ? f.content.replace(/\n\n/g, `
|
|
4067
|
+
`).replace(/\n/g, "<br/>") : ""}`;
|
|
4070
4068
|
}
|
|
4071
|
-
function
|
|
4072
|
-
for (;
|
|
4073
|
-
|
|
4074
|
-
return
|
|
4069
|
+
function ji(f, r) {
|
|
4070
|
+
for (; f.length < r; )
|
|
4071
|
+
f = `0${f}`;
|
|
4072
|
+
return f;
|
|
4075
4073
|
}
|
|
4076
|
-
function Oe(
|
|
4074
|
+
function Oe(f, r) {
|
|
4077
4075
|
let c, l, k;
|
|
4078
4076
|
if (r.length === 0)
|
|
4079
|
-
return
|
|
4077
|
+
return f;
|
|
4080
4078
|
for (c = 0, k = r.length; c < k; c++)
|
|
4081
|
-
l = r.charCodeAt(c),
|
|
4082
|
-
return
|
|
4079
|
+
l = r.charCodeAt(c), f = (f << 5) - f + l, f |= 0;
|
|
4080
|
+
return f < 0 ? f * -2 : f;
|
|
4083
4081
|
}
|
|
4084
|
-
function
|
|
4085
|
-
return Object.keys(r).sort().reduce(l,
|
|
4082
|
+
function Mi(f, r, c) {
|
|
4083
|
+
return Object.keys(r).sort().reduce(l, f);
|
|
4086
4084
|
function l(k, D) {
|
|
4087
4085
|
return $r(k, r[D], D, c);
|
|
4088
4086
|
}
|
|
4089
4087
|
}
|
|
4090
|
-
function $r(
|
|
4091
|
-
const k = Oe(Oe(Oe(
|
|
4088
|
+
function $r(f, r, c, l) {
|
|
4089
|
+
const k = Oe(Oe(Oe(f, c), Ki(r)), typeof r);
|
|
4092
4090
|
if (r === null)
|
|
4093
4091
|
return Oe(k, "null");
|
|
4094
4092
|
if (r === void 0)
|
|
@@ -4097,26 +4095,26 @@ function $r(h, r, c, l) {
|
|
|
4097
4095
|
if (l.includes(r))
|
|
4098
4096
|
return Oe(k, `[Circular]${c}`);
|
|
4099
4097
|
l.push(r);
|
|
4100
|
-
const D =
|
|
4098
|
+
const D = Mi(k, r, l);
|
|
4101
4099
|
if (!("valueOf" in r) || typeof r.valueOf != "function")
|
|
4102
4100
|
return D;
|
|
4103
4101
|
try {
|
|
4104
4102
|
return Oe(D, String(r.valueOf()));
|
|
4105
|
-
} catch (
|
|
4106
|
-
return Oe(D, `[valueOf exception]${
|
|
4103
|
+
} catch (R) {
|
|
4104
|
+
return Oe(D, `[valueOf exception]${R.stack || R.message}`);
|
|
4107
4105
|
}
|
|
4108
4106
|
}
|
|
4109
4107
|
return Oe(k, r.toString());
|
|
4110
4108
|
}
|
|
4111
|
-
function
|
|
4112
|
-
return Object.prototype.toString.call(
|
|
4109
|
+
function Ki(f) {
|
|
4110
|
+
return Object.prototype.toString.call(f);
|
|
4113
4111
|
}
|
|
4114
|
-
function $n(
|
|
4115
|
-
return
|
|
4112
|
+
function $n(f) {
|
|
4113
|
+
return ji($r(0, f, "", []).toString(16), 8);
|
|
4116
4114
|
}
|
|
4117
|
-
function
|
|
4118
|
-
if (
|
|
4119
|
-
return
|
|
4115
|
+
function Hi(f, r) {
|
|
4116
|
+
if (f = f.toString().replace(/[^0-9.]/g, ""), f < 1e3)
|
|
4117
|
+
return f;
|
|
4120
4118
|
const c = [
|
|
4121
4119
|
{ v: 1e3, s: "K" },
|
|
4122
4120
|
{ v: 1e6, s: "M" },
|
|
@@ -4126,11 +4124,11 @@ function Ha(h, r) {
|
|
|
4126
4124
|
{ v: 1e18, s: "E" }
|
|
4127
4125
|
];
|
|
4128
4126
|
let l;
|
|
4129
|
-
for (l = c.length - 1; l > 0 && !(
|
|
4127
|
+
for (l = c.length - 1; l > 0 && !(f >= c[l].v); l--)
|
|
4130
4128
|
;
|
|
4131
|
-
return (
|
|
4129
|
+
return (f / c[l].v).toFixed(r).replace(/\.0+$|(\.\d*[1-9])0+$/, "$1") + c[l].s;
|
|
4132
4130
|
}
|
|
4133
|
-
function
|
|
4131
|
+
function Yi(f, r) {
|
|
4134
4132
|
const c = [
|
|
4135
4133
|
{ value: 1, symbol: "" },
|
|
4136
4134
|
{ value: 1e3, symbol: "K" },
|
|
@@ -4141,12 +4139,12 @@ function Ya(h, r) {
|
|
|
4141
4139
|
{ value: 1e18, symbol: "E" }
|
|
4142
4140
|
], l = /\.0+$|(\.\d*[1-9])0+$/;
|
|
4143
4141
|
let k;
|
|
4144
|
-
for (k = c.length - 1; k > 0 && !(
|
|
4142
|
+
for (k = c.length - 1; k > 0 && !(f >= c[k].value); k--)
|
|
4145
4143
|
;
|
|
4146
|
-
return (
|
|
4144
|
+
return (f / c[k].value).toFixed(r).replace(l, "$1") + c[k].symbol;
|
|
4147
4145
|
}
|
|
4148
|
-
function
|
|
4149
|
-
switch (
|
|
4146
|
+
function Qi(f) {
|
|
4147
|
+
switch (f.language) {
|
|
4150
4148
|
case "ar":
|
|
4151
4149
|
return {
|
|
4152
4150
|
direction: "rtl",
|
|
@@ -4156,24 +4154,24 @@ function Qa(h) {
|
|
|
4156
4154
|
return {};
|
|
4157
4155
|
}
|
|
4158
4156
|
}
|
|
4159
|
-
function
|
|
4160
|
-
return
|
|
4157
|
+
function Xi(f) {
|
|
4158
|
+
return f.forEach((r) => {
|
|
4161
4159
|
var c, l, k;
|
|
4162
4160
|
if (r.content = r.content.replace(/(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)((\?.*)?)/g, ""), r.sender !== null ? (((c = r.sender) == null ? void 0 : c.title) === "Unknown author" && (r.sender.title = ""), ((l = r.sender) == null ? void 0 : l.name) !== "" && r.sender.title === "" && (r.sender.title = r.sender.name), ((k = r.sender) == null ? void 0 : k.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 !== "") {
|
|
4163
4161
|
const D = new URL(r.link);
|
|
4164
4162
|
r.sender.title = D.hostname.replace("www.", "");
|
|
4165
4163
|
}
|
|
4166
|
-
}),
|
|
4164
|
+
}), f;
|
|
4167
4165
|
}
|
|
4168
|
-
function
|
|
4169
|
-
const r = [...
|
|
4166
|
+
function Vi(f) {
|
|
4167
|
+
const r = [...f];
|
|
4170
4168
|
for (let c = r.length - 1; c > 0; c--) {
|
|
4171
4169
|
const l = Math.floor(Math.random() * (c + 1));
|
|
4172
4170
|
[r[c], r[l]] = [r[l], r[c]];
|
|
4173
4171
|
}
|
|
4174
4172
|
return r;
|
|
4175
4173
|
}
|
|
4176
|
-
class
|
|
4174
|
+
class Ji {
|
|
4177
4175
|
constructor(r) {
|
|
4178
4176
|
A(this, "sm");
|
|
4179
4177
|
A(this, "api");
|
|
@@ -4190,7 +4188,7 @@ class Ja {
|
|
|
4190
4188
|
l.push(this.api.get(k));
|
|
4191
4189
|
}), await Promise.allSettled(l).then(
|
|
4192
4190
|
(k) => k.forEach(async (D) => {
|
|
4193
|
-
let
|
|
4191
|
+
let R = 400;
|
|
4194
4192
|
if (D.status === "fulfilled") {
|
|
4195
4193
|
const B = D.value;
|
|
4196
4194
|
if (this.sm === null)
|
|
@@ -4212,7 +4210,7 @@ class Ja {
|
|
|
4212
4210
|
B.query.slide,
|
|
4213
4211
|
B.query.widget
|
|
4214
4212
|
), 204;
|
|
4215
|
-
J.hash = ee,
|
|
4213
|
+
J.hash = ee, R = await this.sm.setMessages(B.query, B);
|
|
4216
4214
|
break;
|
|
4217
4215
|
case K.CLOUD:
|
|
4218
4216
|
ee = $n(B.data), J.hash === ee ? (console.debug(
|
|
@@ -4223,7 +4221,7 @@ class Ja {
|
|
|
4223
4221
|
K.CLOUD,
|
|
4224
4222
|
B.query.slide,
|
|
4225
4223
|
B.query.widget
|
|
4226
|
-
),
|
|
4224
|
+
), R = 204) : (J.hash = ee, R = await this.sm.setCloud(B.query, B));
|
|
4227
4225
|
break;
|
|
4228
4226
|
case K.SERIES:
|
|
4229
4227
|
ee = $n(B.data), J.hash === ee ? (console.debug(
|
|
@@ -4234,7 +4232,7 @@ class Ja {
|
|
|
4234
4232
|
K.SERIES,
|
|
4235
4233
|
B.query.slide,
|
|
4236
4234
|
B.query.widget
|
|
4237
|
-
),
|
|
4235
|
+
), R = 204) : (J.hash = ee, R = await this.sm.setSeries(B.query, B));
|
|
4238
4236
|
break;
|
|
4239
4237
|
default:
|
|
4240
4238
|
console.warn(
|
|
@@ -4247,8 +4245,8 @@ class Ja {
|
|
|
4247
4245
|
);
|
|
4248
4246
|
}
|
|
4249
4247
|
} else
|
|
4250
|
-
|
|
4251
|
-
switch (
|
|
4248
|
+
R = 401;
|
|
4249
|
+
switch (R) {
|
|
4252
4250
|
case 201:
|
|
4253
4251
|
console.info(
|
|
4254
4252
|
"%capp%c %cbroadcast",
|
|
@@ -4270,7 +4268,7 @@ class Ja {
|
|
|
4270
4268
|
);
|
|
4271
4269
|
break;
|
|
4272
4270
|
}
|
|
4273
|
-
return
|
|
4271
|
+
return R;
|
|
4274
4272
|
} else
|
|
4275
4273
|
return console.warn(
|
|
4276
4274
|
"%capi%c %cstorage",
|
|
@@ -4346,7 +4344,7 @@ class Ja {
|
|
|
4346
4344
|
_.SLIDE,
|
|
4347
4345
|
r.slide,
|
|
4348
4346
|
re.VERSION,
|
|
4349
|
-
|
|
4347
|
+
Ai
|
|
4350
4348
|
), this.options = r, this.sm = null;
|
|
4351
4349
|
const c = (r == null ? void 0 : r.slide) || r.app;
|
|
4352
4350
|
switch (this.bc = new BroadcastChannel(c), console.info(
|
|
@@ -4358,7 +4356,7 @@ class Ja {
|
|
|
4358
4356
|
c
|
|
4359
4357
|
), this.bc.onmessage = (l) => {
|
|
4360
4358
|
this.actions(l);
|
|
4361
|
-
}, this.bc.postMessage({ event: re.STORAGE_INIT, data: {} }), this.api = new
|
|
4359
|
+
}, this.bc.postMessage({ event: re.STORAGE_INIT, data: {} }), this.api = new Di(r), r.storage) {
|
|
4362
4360
|
case ge.DEXIE:
|
|
4363
4361
|
this.sm = new Mr(r);
|
|
4364
4362
|
break;
|
|
@@ -4377,7 +4375,7 @@ class Ja {
|
|
|
4377
4375
|
}
|
|
4378
4376
|
}
|
|
4379
4377
|
}
|
|
4380
|
-
class
|
|
4378
|
+
class Ni {
|
|
4381
4379
|
constructor(r) {
|
|
4382
4380
|
A(this, "sm");
|
|
4383
4381
|
/**
|
|
@@ -4462,7 +4460,7 @@ class Na {
|
|
|
4462
4460
|
}
|
|
4463
4461
|
}
|
|
4464
4462
|
}
|
|
4465
|
-
class
|
|
4463
|
+
class Zi {
|
|
4466
4464
|
/**
|
|
4467
4465
|
* Main container for managing widgets and data updates
|
|
4468
4466
|
*
|
|
@@ -4557,7 +4555,7 @@ class Za {
|
|
|
4557
4555
|
* @param modal IModal
|
|
4558
4556
|
*/
|
|
4559
4557
|
A(this, "showModal", (r) => {
|
|
4560
|
-
const c =
|
|
4558
|
+
const c = Ri(this.element.attributes);
|
|
4561
4559
|
if (Object.prototype.hasOwnProperty.call(c, "data-topics")) {
|
|
4562
4560
|
const D = c["data-topics"].split("-");
|
|
4563
4561
|
D.length > 1 ? (c["data-widget"] = D[1], c["data-dashboard"] = D[0]) : (c["data-widget"] = D[0], c["data-dashboard"] = this.query.slide);
|
|
@@ -4583,12 +4581,12 @@ class Za {
|
|
|
4583
4581
|
});
|
|
4584
4582
|
window.dispatchEvent(k);
|
|
4585
4583
|
});
|
|
4586
|
-
var
|
|
4584
|
+
var R;
|
|
4587
4585
|
this.element = r, this.listeners = c, l = typeof l < "u" ? l : "buzzcasting-slide";
|
|
4588
4586
|
let k;
|
|
4589
|
-
k = { ...r.dataset }, delete k.hmr, k.slide = ((
|
|
4587
|
+
k = { ...r.dataset }, delete k.hmr, k.slide = ((R = r.closest(l.toUpperCase())) == null ? void 0 : R.id) ?? `${l} not found`, k = nt(k), this.query = k, Ti(r);
|
|
4590
4588
|
const D = window.BuzzCasting.getOptions();
|
|
4591
|
-
this.storageReader = new
|
|
4589
|
+
this.storageReader = new Ni(D), this.broadcastChannel = new BroadcastChannel(k.slide), this.startListener();
|
|
4592
4590
|
}
|
|
4593
4591
|
addListener(r) {
|
|
4594
4592
|
this.listeners.push(r);
|
|
@@ -4635,26 +4633,26 @@ class Za {
|
|
|
4635
4633
|
}
|
|
4636
4634
|
export {
|
|
4637
4635
|
K as API,
|
|
4638
|
-
|
|
4639
|
-
|
|
4636
|
+
Ji as BuzzcastingStorageManager,
|
|
4637
|
+
Ni as BuzzcastingStorageReader,
|
|
4640
4638
|
_ as CSS,
|
|
4641
4639
|
re as EVENTS,
|
|
4642
4640
|
Zt as MODERATION,
|
|
4643
4641
|
ge as STORAGE,
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
$
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4642
|
+
Zi as Widget,
|
|
4643
|
+
Li as anonymize,
|
|
4644
|
+
Gi as attachedMedia,
|
|
4645
|
+
Ri as attrs,
|
|
4646
|
+
Fi as brandLogo,
|
|
4647
|
+
Wi as camelCase,
|
|
4648
|
+
Ui as camelize,
|
|
4649
|
+
Ti as clearContents,
|
|
4650
|
+
$i as filterAttributes,
|
|
4651
|
+
zi as formatContent,
|
|
4652
|
+
Hi as intToString,
|
|
4653
|
+
Yi as numberFormatter,
|
|
4654
|
+
Qi as rtl,
|
|
4655
|
+
Xi as sanitize,
|
|
4656
|
+
Vi as shuffleMessages,
|
|
4659
4657
|
nt as widgetParams
|
|
4660
4658
|
};
|