buzzcasting-storage 3.9.2 → 3.9.4
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 +1121 -1066
- package/package.json +10 -10
|
@@ -1,101 +1,98 @@
|
|
|
1
|
-
var O = /* @__PURE__ */ ((
|
|
2
|
-
function Pa(
|
|
1
|
+
var O = /* @__PURE__ */ ((p) => (p.MESSAGES = "messages", p.CLOUD = "cloud", p.SERIES = "series", p.TOPICS = "topics", p.WIDGET = "widget", p.WIDGETS = "widgets", p.DASHBOARD = "dashboard", p.DASHBOARDS = "dashboards", p.SLIDE = "slide", p.SLIDES = "slides", p.PRESENTATION = "presentation", p.PRESENTATIONS = "presentations", p.PREFERENCE = "preference", p.PREFERENCES = "preferences", p))(O || {}), c = /* @__PURE__ */ ((p) => (p.API = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;", p.APP = "color:white;background-color:navy;padding:0 4px 0 4px;border-radius:5px;", p.BROADCAST = "color:navy;background-color:orange;padding:0 4px 0 4px;border-radius:5px;", p.CLOUD = "color:purple;background-color:mistyrose;padding:0 4px 0 4px;border-radius:5px;", p.DATA = "color:grey;background-color:lightskyblue;padding:0 4px 0 4px;border-radius:5px;", p.ERROR = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", p.GET_DATA = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", p.HIDE = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", p.KO = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", p.MESSAGES = "color:white;background-color:darkslateblue;padding:0 4px 0 4px;border-radius:5px;", p.NO_UPDATES = "color:grey;border:1px solid grey;padding:0 4px 0 4px;border-radius:5px;", p.NONE = "color:transparent;background-color:transparent;", p.OK = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", p.PRESENTATION = "color:white;background-color:darkred;padding:0 4px 0 4px;border-radius:5px;", p.SERIES = "color:purple;background-color:thistle;padding:0 4px 0 4px;border-radius:5px;", p.SLIDE = "color:black;background-color:yellow;padding:0 4px 0 4px;border-radius:5px;", p.STORAGE = "color:black;background-color:cyan;padding:0 4px 0 4px;border-radius:5px;", p.SUBSCRIBE = "color:white;background-color:dodgerblue;padding:0 4px 0 4px;border-radius:5px;", p.WIDGET = "color:gret;background-color:lemonchiffon;padding:0 4px 0 4px;border-radius:5px;", p.WS = "color:white;background-color:green;padding:0 4px 0 4px;border-radius:5px;", p))(c || {}), J = /* @__PURE__ */ ((p) => (p.ADD_SLIDE = "addSlide", p.APP_READY = "appReady", p.API_UPDATE = "apiUpdate", p.WS_API_REQUEST = "wsApiRequest", p.WS_API_RESPONSE = "wsApiResponse", p.WS_API_UPDATE = "wsApiRUpdate", p.APPROVE_MESSAGE = "approveMessage", p.CHANNEL = "channel", p.CLEAN_MESSAGES = "cleanMessages", p.CLOSE_MODAL = "closeModal", p.CLOSE_BUILDER_MODAL = "closeBuilderModal", p.DASHBOARD_LOAD = "loadDashboard", p.DASHBOARD_STORE = "storeDashboard", p.ERROR = "error", p.HIDE_MESSAGE = "hideMessage", p.HIDE_LABELS = "hideLabels", p.MAUPPUT_UPDATE = "layoutUpdate", p.PREV_SLIDE = "prevSlide", p.RELOAD_PRESENTATION = "reloadPresentation", p.SHOW_MODAL = "showModal", p.STAR_MESSAGE = "starMessage", p.GOTO_SLIDE = "gotoSlide", p.NEXT_SLIDE = "nextSlide", p.PREFERENCE_LOAD = "loadPreference", p.PREFERENCE_STORE = "storePreference", p.PAUSE_PRESENTATION = "pausePresentation", p.PRESENTATION_READY = "presentationReady", p.PRESENTATION_LOAD = "loadPresentation", p.PRESENTATION_STORE = "storePresentation", p.SHOW_BUILDER_MODAL = "showBuilderModal", p.SLIDE_DID_LOAD = "slideDidLoad", p.SLIDE_GOTO = "slideGoto", p.SLIDE_READY = "slideReady", p.SLIDE_LOAD = "loadSlide", p.SLIDE_STORE = "storeSlide", p.SLIDE_TRANSITIONER = "slideTransitioner", p.START_TRANSITIONER = "startTransitioner", p.STORAGE_INIT = "storageInit", p.SUBSCRIBE = "subscribe", p.SUSPEND_ACCOUNT = "suspendAccount", p.SWITCH_PRESENTATION = "switchPresentation", p.REMOVE_CLOUD = "removeCloud", p.UPDATE = "update", p.VERSION = "version", p.WIDGETS_CLEAR = "widgetsClear", p.WIDGET_LOAD = "widgetLoad", p.WIDGET_STORE = "widgetStore", p.WIDGET_UPDATE = "widgetUpdate", p))(J || {}), qt = /* @__PURE__ */ ((p) => (p.APPROVED = "approved", p.BEFORE = "before", p.DELAYED = "delayed", p.NONE = "none", p.REALTIME = "realtime", p))(qt || {}), he = /* @__PURE__ */ ((p) => (p.KEYVAL = "keyval", p.LOCAL = "local", p.SESSION = "session", p.DEXIE = "dexie", p.WINDOW = "window", p))(he || {});
|
|
2
|
+
function Pa(p) {
|
|
3
3
|
const n = {};
|
|
4
|
-
for (let i = 0; i <
|
|
5
|
-
const l =
|
|
4
|
+
for (let i = 0; i < p.length; i++) {
|
|
5
|
+
const l = p.item(i);
|
|
6
6
|
l != null && l.name && (n[l.name] = l.value);
|
|
7
7
|
}
|
|
8
8
|
return n;
|
|
9
9
|
}
|
|
10
|
-
function Da(
|
|
10
|
+
function Da(p) {
|
|
11
11
|
const n = document.createRange();
|
|
12
|
-
n.selectNodeContents(
|
|
12
|
+
n.selectNodeContents(p), n.deleteContents();
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
for (;
|
|
16
|
-
|
|
17
|
-
return
|
|
14
|
+
function Na(p, n) {
|
|
15
|
+
for (; p.length < n; )
|
|
16
|
+
p = `0${p}`;
|
|
17
|
+
return p;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function Oe(p, n) {
|
|
20
20
|
let i, l, E;
|
|
21
21
|
if (n.length === 0)
|
|
22
|
-
return
|
|
22
|
+
return p;
|
|
23
23
|
for (i = 0, E = n.length; i < E; i++)
|
|
24
|
-
l = n.charCodeAt(i),
|
|
25
|
-
return
|
|
24
|
+
l = n.charCodeAt(i), p = (p << 5) - p + l, p |= 0;
|
|
25
|
+
return p < 0 ? p * -2 : p;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
return Object.keys(n).sort().reduce(l,
|
|
27
|
+
function Ra(p, n, i) {
|
|
28
|
+
return Object.keys(n).sort().reduce(l, p);
|
|
29
29
|
function l(E, _) {
|
|
30
30
|
return jr(E, n[_], _, i);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
function jr(
|
|
34
|
-
const E =
|
|
33
|
+
function jr(p, n, i, l) {
|
|
34
|
+
const E = Oe(Oe(Oe(p, i), Ta(n)), typeof n);
|
|
35
35
|
if (n === null)
|
|
36
|
-
return
|
|
36
|
+
return Oe(E, "null");
|
|
37
37
|
if (n === void 0)
|
|
38
|
-
return
|
|
38
|
+
return Oe(E, "undefined");
|
|
39
39
|
if (typeof n == "object" || typeof n == "function") {
|
|
40
40
|
if (l.includes(n))
|
|
41
|
-
return
|
|
41
|
+
return Oe(E, `[Circular]${i}`);
|
|
42
42
|
l.push(n);
|
|
43
|
-
const _ =
|
|
43
|
+
const _ = Ra(E, n, l);
|
|
44
44
|
if (!("valueOf" in n) || typeof n.valueOf != "function")
|
|
45
45
|
return _;
|
|
46
46
|
try {
|
|
47
|
-
return
|
|
48
|
-
} catch (
|
|
49
|
-
return
|
|
47
|
+
return Oe(_, String(n.valueOf()));
|
|
48
|
+
} catch (C) {
|
|
49
|
+
return Oe(_, `[valueOf exception]${C.stack || C.message}`);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
return
|
|
52
|
+
return Oe(E, n.toString());
|
|
53
53
|
}
|
|
54
|
-
function Ta(
|
|
55
|
-
return Object.prototype.toString.call(
|
|
54
|
+
function Ta(p) {
|
|
55
|
+
return Object.prototype.toString.call(p);
|
|
56
56
|
}
|
|
57
|
-
function Fn(
|
|
58
|
-
return
|
|
57
|
+
function Fn(p) {
|
|
58
|
+
return Na(jr(0, p, "", []).toString(16), 8);
|
|
59
59
|
}
|
|
60
|
-
const
|
|
61
|
-
let n = {}, i =
|
|
60
|
+
const st = (p) => {
|
|
61
|
+
let n = {}, i = p.split(",");
|
|
62
62
|
for (let l = 0; l < i.length; l++) n[i[l]] = !0;
|
|
63
63
|
return n;
|
|
64
64
|
};
|
|
65
|
-
|
|
65
|
+
st(
|
|
66
66
|
"area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr"
|
|
67
67
|
);
|
|
68
|
-
|
|
68
|
+
st(
|
|
69
69
|
"a,address,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video"
|
|
70
70
|
);
|
|
71
|
-
|
|
71
|
+
st(
|
|
72
72
|
"abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var"
|
|
73
73
|
);
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
st("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr");
|
|
75
|
+
st(
|
|
76
76
|
"checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"
|
|
77
77
|
);
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
return this[this.length - 1];
|
|
81
|
-
};
|
|
82
|
-
const B = (g = 0, n) => {
|
|
78
|
+
st("script,style");
|
|
79
|
+
const K = (p = 0, n) => {
|
|
83
80
|
switch (!0) {
|
|
84
|
-
case
|
|
81
|
+
case p > 3:
|
|
85
82
|
console.debug(...n);
|
|
86
83
|
break;
|
|
87
|
-
case
|
|
84
|
+
case p > 2:
|
|
88
85
|
console.info(...n);
|
|
89
86
|
break;
|
|
90
|
-
case
|
|
87
|
+
case p > 1:
|
|
91
88
|
console.warn(...n);
|
|
92
89
|
break;
|
|
93
|
-
case
|
|
90
|
+
case p > 0:
|
|
94
91
|
console.error(...n);
|
|
95
92
|
break;
|
|
96
93
|
}
|
|
97
|
-
}, kr = (
|
|
98
|
-
switch (
|
|
94
|
+
}, kr = (p) => {
|
|
95
|
+
switch (p?.type) {
|
|
99
96
|
case O.MESSAGES:
|
|
100
97
|
return c.MESSAGES;
|
|
101
98
|
case O.SERIES:
|
|
@@ -106,37 +103,37 @@ const B = (g = 0, n) => {
|
|
|
106
103
|
return c.NO_UPDATES;
|
|
107
104
|
}
|
|
108
105
|
};
|
|
109
|
-
function Y(
|
|
110
|
-
let n = `${
|
|
111
|
-
return
|
|
106
|
+
function Y(p) {
|
|
107
|
+
let n = `${p.type}.${p.topics}`;
|
|
108
|
+
return p.order && (n += `.${p.order}`), p.period && (n += `.${p.period}`), n;
|
|
112
109
|
}
|
|
113
|
-
function Ia(
|
|
110
|
+
function Ia(p) {
|
|
114
111
|
var n;
|
|
115
|
-
if (
|
|
116
|
-
const i = (n =
|
|
117
|
-
i && i.length > 1 ? (
|
|
112
|
+
if (p.widget === void 0) {
|
|
113
|
+
const i = (n = p.topics) == null ? void 0 : n.split("-");
|
|
114
|
+
i && i.length > 1 ? (p.dashboard = i ? i[0] : "", p.widget = i ? i[1] : "") : (p.widget = p.topics, p.dashboard = p.slide);
|
|
118
115
|
}
|
|
119
|
-
return
|
|
116
|
+
return p;
|
|
120
117
|
}
|
|
121
|
-
function
|
|
118
|
+
function St(p, n) {
|
|
122
119
|
var i;
|
|
123
|
-
let l, E, _,
|
|
124
|
-
switch (
|
|
125
|
-
case
|
|
126
|
-
l = /* @__PURE__ */ new Date(), E = (i =
|
|
120
|
+
let l, E, _, C, G;
|
|
121
|
+
switch (p.moderation) {
|
|
122
|
+
case qt.BEFORE:
|
|
123
|
+
l = /* @__PURE__ */ new Date(), E = (i = p.beforeTime) == null ? void 0 : i.split(":"), _ = Number.parseInt(E ? E[0] : "00"), C = Number.parseInt(E ? E[1] : "00"), G = Number.parseInt(E ? E[2] : "00"), n.before = l.setHours(_, C, G, 0) / 1e3, n.period || (n.period = l.getDay() === 1 ? 72 : 24);
|
|
127
124
|
break;
|
|
128
|
-
case
|
|
129
|
-
|
|
125
|
+
case qt.DELAYED:
|
|
126
|
+
p.delay && p.delay > 0 && (n.delay = `${p.delay}`);
|
|
130
127
|
break;
|
|
131
|
-
case
|
|
128
|
+
case qt.APPROVED:
|
|
132
129
|
n.approved = "1";
|
|
133
130
|
break;
|
|
134
131
|
default:
|
|
135
|
-
|
|
132
|
+
p.period !== 0 && (n.period = p.period);
|
|
136
133
|
}
|
|
137
134
|
return n;
|
|
138
135
|
}
|
|
139
|
-
const xa = "3.9.
|
|
136
|
+
const xa = "3.9.3";
|
|
140
137
|
class ka {
|
|
141
138
|
options;
|
|
142
139
|
url;
|
|
@@ -169,27 +166,27 @@ class ka {
|
|
|
169
166
|
const { version: i } = this.options, l = this.headers(), E = Object.assign({}, n);
|
|
170
167
|
delete E.type, delete E.hash, delete E.order, E.topics = `${E.dashboard}-${E.widget}`, delete E.presentation;
|
|
171
168
|
const _ = Object.keys(E).length > 0 ? `?${new URLSearchParams(E).toString()}` : "";
|
|
172
|
-
let
|
|
169
|
+
let C = "";
|
|
173
170
|
switch (n.type) {
|
|
174
171
|
case O.MESSAGES:
|
|
175
|
-
|
|
172
|
+
C = c.MESSAGES;
|
|
176
173
|
break;
|
|
177
174
|
case O.SERIES:
|
|
178
|
-
|
|
175
|
+
C = c.SERIES;
|
|
179
176
|
break;
|
|
180
177
|
case O.CLOUD:
|
|
181
|
-
|
|
178
|
+
C = c.CLOUD;
|
|
182
179
|
break;
|
|
183
180
|
}
|
|
184
|
-
return
|
|
181
|
+
return K(3, [
|
|
185
182
|
`%cfetch%c %capi%c %c${n.type}`,
|
|
186
183
|
c.OK,
|
|
187
184
|
c.NONE,
|
|
188
185
|
c.API,
|
|
189
186
|
c.NONE,
|
|
190
|
-
|
|
187
|
+
C,
|
|
191
188
|
n.widget
|
|
192
|
-
]),
|
|
189
|
+
]), K(4, [n.type, E]), await fetch(
|
|
193
190
|
[this.url, "api", i, n.type].join("/") + _,
|
|
194
191
|
{ ...l, method: "get" }
|
|
195
192
|
).then(async (G) => {
|
|
@@ -219,8 +216,8 @@ class ka {
|
|
|
219
216
|
}
|
|
220
217
|
async hideLabels(n) {
|
|
221
218
|
const { version: i } = this.options, l = this.formHeaders(), E = new URLSearchParams(), _ = n.labels || [];
|
|
222
|
-
for (const [
|
|
223
|
-
E.append(`custom_filters[${
|
|
219
|
+
for (const [C, G] of _.entries())
|
|
220
|
+
E.append(`custom_filters[${C}]`, G);
|
|
224
221
|
return console.info(
|
|
225
222
|
"%capi%c %cput",
|
|
226
223
|
c.API,
|
|
@@ -232,15 +229,15 @@ class ka {
|
|
|
232
229
|
), await fetch(
|
|
233
230
|
[this.url, "api", i, n.type, n.widget].join("/"),
|
|
234
231
|
{ ...l, body: E, method: "put" }
|
|
235
|
-
).then((
|
|
236
|
-
if (!
|
|
237
|
-
throw new Error(
|
|
238
|
-
return
|
|
239
|
-
}).then((
|
|
232
|
+
).then((C) => {
|
|
233
|
+
if (!C.ok)
|
|
234
|
+
throw new Error(C.statusText);
|
|
235
|
+
return C;
|
|
236
|
+
}).then((C) => C.json()).catch((C) => ({ succes: !1, message: C, data: [] }));
|
|
240
237
|
}
|
|
241
238
|
async loadSlide(n) {
|
|
242
239
|
const { version: i } = this.options, l = this.headers(), E = Object.assign({}, n);
|
|
243
|
-
return delete E.type, delete E.hash,
|
|
240
|
+
return delete E.type, delete E.hash, K(3, ["%capi%c %cloadSlide", c.API, c.NONE, c.SLIDE, n.id]), await fetch(
|
|
244
241
|
[this.url, "api", i, "slides", n.id].join("/"),
|
|
245
242
|
{ ...l, method: "get" }
|
|
246
243
|
).then(async (_) => {
|
|
@@ -260,7 +257,7 @@ class ka {
|
|
|
260
257
|
const { version: i } = this.options, l = this.formHeaders();
|
|
261
258
|
delete n.update, delete n.type;
|
|
262
259
|
const E = JSON.stringify(n);
|
|
263
|
-
return
|
|
260
|
+
return K(3, [
|
|
264
261
|
"%cput%c %capi%c %cslide",
|
|
265
262
|
c.OK,
|
|
266
263
|
c.NONE,
|
|
@@ -280,7 +277,7 @@ class ka {
|
|
|
280
277
|
}
|
|
281
278
|
async loadPresentation(n) {
|
|
282
279
|
const { version: i } = this.options, l = this.headers();
|
|
283
|
-
return delete n.update,
|
|
280
|
+
return delete n.update, K(3, [
|
|
284
281
|
"%cload%c %capi%c %cloadPresentation",
|
|
285
282
|
c.OK,
|
|
286
283
|
c.NONE,
|
|
@@ -308,7 +305,7 @@ class ka {
|
|
|
308
305
|
const { version: i } = this.options, l = this.formHeaders();
|
|
309
306
|
delete n.update;
|
|
310
307
|
const E = JSON.stringify(n);
|
|
311
|
-
return
|
|
308
|
+
return K(2, ["%capi%c %cput", c.API, c.NONE, c.PRESENTATION, n.name]), await fetch(
|
|
312
309
|
[this.url, "api", i, O.PRESENTATIONS, n.id].join("/"),
|
|
313
310
|
{ ...l, body: E, method: "put" }
|
|
314
311
|
).then((_) => {
|
|
@@ -319,7 +316,7 @@ class ka {
|
|
|
319
316
|
}
|
|
320
317
|
async loadPreference(n) {
|
|
321
318
|
const { version: i } = this.options, l = this.headers();
|
|
322
|
-
return
|
|
319
|
+
return K(3, [
|
|
323
320
|
"%capi%c %cloadPreference",
|
|
324
321
|
c.API,
|
|
325
322
|
c.NONE,
|
|
@@ -392,7 +389,7 @@ class ka {
|
|
|
392
389
|
}*/
|
|
393
390
|
async loadDashboards(n) {
|
|
394
391
|
const { version: i } = this.options, l = this.headers();
|
|
395
|
-
return
|
|
392
|
+
return K(3, ["%capi%c %dashboards", c.API, c.NONE, c.WIDGET]), await fetch(
|
|
396
393
|
[this.url, "api", i, O.WIDGETS, n?.id || ""].join("/"),
|
|
397
394
|
{
|
|
398
395
|
...l,
|
|
@@ -410,14 +407,14 @@ class ka {
|
|
|
410
407
|
}
|
|
411
408
|
}
|
|
412
409
|
var Ca = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
413
|
-
function $a(
|
|
414
|
-
return
|
|
410
|
+
function $a(p) {
|
|
411
|
+
return p && p.__esModule && Object.prototype.hasOwnProperty.call(p, "default") ? p.default : p;
|
|
415
412
|
}
|
|
416
|
-
var
|
|
413
|
+
var en = { exports: {} }, ja = en.exports, Cr;
|
|
417
414
|
function Ma() {
|
|
418
|
-
return Cr || (Cr = 1, function(
|
|
415
|
+
return Cr || (Cr = 1, function(p, n) {
|
|
419
416
|
(function(i, l) {
|
|
420
|
-
|
|
417
|
+
p.exports = l();
|
|
421
418
|
})(ja, function() {
|
|
422
419
|
var i = function(e, t) {
|
|
423
420
|
return (i = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, a) {
|
|
@@ -435,50 +432,50 @@ function Ma() {
|
|
|
435
432
|
for (var a, s = 0, o = t.length; s < o; s++) !a && s in t || ((a = a || Array.prototype.slice.call(t, 0, s))[s] = t[s]);
|
|
436
433
|
return e.concat(a || Array.prototype.slice.call(t));
|
|
437
434
|
}
|
|
438
|
-
var _ = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Ca,
|
|
439
|
-
function
|
|
440
|
-
return typeof t != "object" ||
|
|
435
|
+
var _ = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Ca, C = Object.keys, G = Array.isArray;
|
|
436
|
+
function te(e, t) {
|
|
437
|
+
return typeof t != "object" || C(t).forEach(function(r) {
|
|
441
438
|
e[r] = t[r];
|
|
442
439
|
}), e;
|
|
443
440
|
}
|
|
444
441
|
typeof Promise > "u" || _.Promise || (_.Promise = Promise);
|
|
445
|
-
var
|
|
446
|
-
function
|
|
447
|
-
return
|
|
442
|
+
var ge = Object.getPrototypeOf, Ce = {}.hasOwnProperty;
|
|
443
|
+
function oe(e, t) {
|
|
444
|
+
return Ce.call(e, t);
|
|
448
445
|
}
|
|
449
|
-
function
|
|
450
|
-
typeof t == "function" && (t = t(
|
|
446
|
+
function be(e, t) {
|
|
447
|
+
typeof t == "function" && (t = t(ge(e))), (typeof Reflect > "u" ? C : Reflect.ownKeys)(t).forEach(function(r) {
|
|
451
448
|
Ae(e, r, t[r]);
|
|
452
449
|
});
|
|
453
450
|
}
|
|
454
|
-
var
|
|
451
|
+
var Ot = Object.defineProperty;
|
|
455
452
|
function Ae(e, t, r, a) {
|
|
456
|
-
|
|
453
|
+
Ot(e, t, te(r && oe(r, "get") && typeof r.get == "function" ? { get: r.get, set: r.set, configurable: !0 } : { value: r, configurable: !0, writable: !0 }, a));
|
|
457
454
|
}
|
|
458
|
-
function
|
|
455
|
+
function Ye(e) {
|
|
459
456
|
return { from: function(t) {
|
|
460
|
-
return e.prototype = Object.create(t.prototype), Ae(e.prototype, "constructor", e), { extend:
|
|
457
|
+
return e.prototype = Object.create(t.prototype), Ae(e.prototype, "constructor", e), { extend: be.bind(null, e.prototype) };
|
|
461
458
|
} };
|
|
462
459
|
}
|
|
463
|
-
var
|
|
464
|
-
function
|
|
460
|
+
var Fr = Object.getOwnPropertyDescriptor, Ur = [].slice;
|
|
461
|
+
function _t(e, t, r) {
|
|
465
462
|
return Ur.call(e, t, r);
|
|
466
463
|
}
|
|
467
464
|
function Vn(e, t) {
|
|
468
465
|
return t(e);
|
|
469
466
|
}
|
|
470
|
-
function
|
|
467
|
+
function it(e) {
|
|
471
468
|
if (!e) throw new Error("Assertion Failed");
|
|
472
469
|
}
|
|
473
470
|
function Yn(e) {
|
|
474
471
|
_.setImmediate ? setImmediate(e) : setTimeout(e, 0);
|
|
475
472
|
}
|
|
476
|
-
function
|
|
477
|
-
if (typeof t == "string" &&
|
|
473
|
+
function ve(e, t) {
|
|
474
|
+
if (typeof t == "string" && oe(e, t)) return e[t];
|
|
478
475
|
if (!t) return e;
|
|
479
476
|
if (typeof t != "string") {
|
|
480
477
|
for (var r = [], a = 0, s = t.length; a < s; ++a) {
|
|
481
|
-
var o =
|
|
478
|
+
var o = ve(e, t[a]);
|
|
482
479
|
r.push(o);
|
|
483
480
|
}
|
|
484
481
|
return r;
|
|
@@ -486,71 +483,71 @@ function Ma() {
|
|
|
486
483
|
var u = t.indexOf(".");
|
|
487
484
|
if (u !== -1) {
|
|
488
485
|
var d = e[t.substr(0, u)];
|
|
489
|
-
return d == null ? void 0 :
|
|
486
|
+
return d == null ? void 0 : ve(d, t.substr(u + 1));
|
|
490
487
|
}
|
|
491
488
|
}
|
|
492
489
|
function ue(e, t, r) {
|
|
493
490
|
if (e && t !== void 0 && !("isFrozen" in Object && Object.isFrozen(e))) if (typeof t != "string" && "length" in t) {
|
|
494
|
-
|
|
491
|
+
it(typeof r != "string" && "length" in r);
|
|
495
492
|
for (var a = 0, s = t.length; a < s; ++a) ue(e, t[a], r[a]);
|
|
496
493
|
} else {
|
|
497
494
|
var o, u, d = t.indexOf(".");
|
|
498
|
-
d !== -1 ? (o = t.substr(0, d), (u = t.substr(d + 1)) === "" ? r === void 0 ? G(e) && !isNaN(parseInt(o)) ? e.splice(o, 1) : delete e[o] : e[o] = r : ue(d = !(d = e[o]) || !
|
|
495
|
+
d !== -1 ? (o = t.substr(0, d), (u = t.substr(d + 1)) === "" ? r === void 0 ? G(e) && !isNaN(parseInt(o)) ? e.splice(o, 1) : delete e[o] : e[o] = r : ue(d = !(d = e[o]) || !oe(e, o) ? e[o] = {} : d, u, r)) : r === void 0 ? G(e) && !isNaN(parseInt(t)) ? e.splice(t, 1) : delete e[t] : e[t] = r;
|
|
499
496
|
}
|
|
500
497
|
}
|
|
501
498
|
function Qn(e) {
|
|
502
499
|
var t, r = {};
|
|
503
|
-
for (t in e)
|
|
500
|
+
for (t in e) oe(e, t) && (r[t] = e[t]);
|
|
504
501
|
return r;
|
|
505
502
|
}
|
|
506
503
|
var zr = [].concat;
|
|
507
504
|
function Xn(e) {
|
|
508
505
|
return zr.apply([], e);
|
|
509
506
|
}
|
|
510
|
-
var
|
|
507
|
+
var Ke = "BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(Xn([8, 16, 32, 64].map(function(e) {
|
|
511
508
|
return ["Int", "Uint", "Float"].map(function(t) {
|
|
512
509
|
return t + e + "Array";
|
|
513
510
|
});
|
|
514
511
|
}))).filter(function(e) {
|
|
515
512
|
return _[e];
|
|
516
|
-
}), Jn = new Set(
|
|
513
|
+
}), Jn = new Set(Ke.map(function(e) {
|
|
517
514
|
return _[e];
|
|
518
|
-
})),
|
|
519
|
-
function
|
|
520
|
-
return
|
|
515
|
+
})), ot = null;
|
|
516
|
+
function $e(e) {
|
|
517
|
+
return ot = /* @__PURE__ */ new WeakMap(), e = function t(r) {
|
|
521
518
|
if (!r || typeof r != "object") return r;
|
|
522
|
-
var a =
|
|
519
|
+
var a = ot.get(r);
|
|
523
520
|
if (a) return a;
|
|
524
521
|
if (G(r)) {
|
|
525
|
-
a = [],
|
|
522
|
+
a = [], ot.set(r, a);
|
|
526
523
|
for (var s = 0, o = r.length; s < o; ++s) a.push(t(r[s]));
|
|
527
524
|
} else if (Jn.has(r.constructor)) a = r;
|
|
528
525
|
else {
|
|
529
|
-
var u, d =
|
|
530
|
-
for (u in a = d === Object.prototype ? {} : Object.create(d),
|
|
526
|
+
var u, d = ge(r);
|
|
527
|
+
for (u in a = d === Object.prototype ? {} : Object.create(d), ot.set(r, a), r) oe(r, u) && (a[u] = t(r[u]));
|
|
531
528
|
}
|
|
532
529
|
return a;
|
|
533
|
-
}(e),
|
|
530
|
+
}(e), ot = null, e;
|
|
534
531
|
}
|
|
535
532
|
var Hr = {}.toString;
|
|
536
|
-
function
|
|
533
|
+
function nn(e) {
|
|
537
534
|
return Hr.call(e).slice(8, -1);
|
|
538
535
|
}
|
|
539
|
-
var
|
|
536
|
+
var rn = typeof Symbol < "u" ? Symbol.iterator : "@@iterator", Vr = typeof rn == "symbol" ? function(e) {
|
|
540
537
|
var t;
|
|
541
|
-
return e != null && (t = e[
|
|
538
|
+
return e != null && (t = e[rn]) && t.apply(e);
|
|
542
539
|
} : function() {
|
|
543
540
|
return null;
|
|
544
541
|
};
|
|
545
|
-
function
|
|
542
|
+
function je(e, t) {
|
|
546
543
|
return t = e.indexOf(t), 0 <= t && e.splice(t, 1), 0 <= t;
|
|
547
544
|
}
|
|
548
|
-
var
|
|
549
|
-
function
|
|
545
|
+
var Qe = {};
|
|
546
|
+
function Ee(e) {
|
|
550
547
|
var t, r, a, s;
|
|
551
548
|
if (arguments.length === 1) {
|
|
552
549
|
if (G(e)) return e.slice();
|
|
553
|
-
if (this ===
|
|
550
|
+
if (this === Qe && typeof e == "string") return [e];
|
|
554
551
|
if (s = Vr(e)) {
|
|
555
552
|
for (r = []; !(a = s.next()).done; ) r.push(a.value);
|
|
556
553
|
return r;
|
|
@@ -563,12 +560,12 @@ function Ma() {
|
|
|
563
560
|
for (t = arguments.length, r = new Array(t); t--; ) r[t] = arguments[t];
|
|
564
561
|
return r;
|
|
565
562
|
}
|
|
566
|
-
var
|
|
563
|
+
var an = typeof Symbol < "u" ? function(e) {
|
|
567
564
|
return e[Symbol.toStringTag] === "AsyncFunction";
|
|
568
565
|
} : function() {
|
|
569
566
|
return !1;
|
|
570
|
-
},
|
|
571
|
-
function
|
|
567
|
+
}, lt = ["Unknown", "Constraint", "Data", "TransactionInactive", "ReadOnly", "Version", "NotFound", "InvalidState", "InvalidAccess", "Abort", "Timeout", "QuotaExceeded", "Syntax", "DataClone"], fe = ["Modify", "Bulk", "OpenFailed", "VersionChange", "Schema", "Upgrade", "InvalidTable", "MissingAPI", "NoSuchDatabase", "InvalidArgument", "SubTransaction", "Unsupported", "Internal", "DatabaseClosed", "PrematureCommit", "ForeignAwait"].concat(lt), Yr = { VersionChanged: "Database version changed by other database connection", DatabaseClosed: "Database has been closed", Abort: "Transaction aborted", TransactionInactive: "Transaction has already completed or failed", MissingAPI: "IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb" };
|
|
568
|
+
function Xe(e, t) {
|
|
572
569
|
this.name = e, this.message = t;
|
|
573
570
|
}
|
|
574
571
|
function Zn(e, t) {
|
|
@@ -579,44 +576,44 @@ function Ma() {
|
|
|
579
576
|
}).join(`
|
|
580
577
|
`);
|
|
581
578
|
}
|
|
582
|
-
function
|
|
579
|
+
function At(e, t, r, a) {
|
|
583
580
|
this.failures = t, this.failedKeys = a, this.successCount = r, this.message = Zn(e, t);
|
|
584
581
|
}
|
|
585
|
-
function
|
|
582
|
+
function Je(e, t) {
|
|
586
583
|
this.name = "BulkError", this.failures = Object.keys(t).map(function(r) {
|
|
587
584
|
return t[r];
|
|
588
585
|
}), this.failuresByPos = t, this.message = Zn(e, this.failures);
|
|
589
586
|
}
|
|
590
|
-
|
|
587
|
+
Ye(Xe).from(Error).extend({ toString: function() {
|
|
591
588
|
return this.name + ": " + this.message;
|
|
592
|
-
} }),
|
|
593
|
-
var
|
|
589
|
+
} }), Ye(At).from(Xe), Ye(Je).from(Xe);
|
|
590
|
+
var sn = fe.reduce(function(e, t) {
|
|
594
591
|
return e[t] = t + "Error", e;
|
|
595
|
-
}, {}), Qr =
|
|
592
|
+
}, {}), Qr = Xe, L = fe.reduce(function(e, t) {
|
|
596
593
|
var r = t + "Error";
|
|
597
594
|
function a(s, o) {
|
|
598
595
|
this.name = r, s ? typeof s == "string" ? (this.message = "".concat(s).concat(o ? `
|
|
599
596
|
` + o : ""), this.inner = o || null) : typeof s == "object" && (this.message = "".concat(s.name, " ").concat(s.message), this.inner = s) : (this.message = Yr[t] || r, this.inner = null);
|
|
600
597
|
}
|
|
601
|
-
return
|
|
598
|
+
return Ye(a).from(Qr), e[t] = a, e;
|
|
602
599
|
}, {});
|
|
603
600
|
L.Syntax = SyntaxError, L.Type = TypeError, L.Range = RangeError;
|
|
604
|
-
var qn =
|
|
601
|
+
var qn = lt.reduce(function(e, t) {
|
|
605
602
|
return e[t + "Error"] = L[t], e;
|
|
606
|
-
}, {}),
|
|
603
|
+
}, {}), Pt = fe.reduce(function(e, t) {
|
|
607
604
|
return ["Syntax", "Type", "Range"].indexOf(t) === -1 && (e[t + "Error"] = L[t]), e;
|
|
608
605
|
}, {});
|
|
609
606
|
function Q() {
|
|
610
607
|
}
|
|
611
|
-
function
|
|
608
|
+
function ct(e) {
|
|
612
609
|
return e;
|
|
613
610
|
}
|
|
614
611
|
function Xr(e, t) {
|
|
615
|
-
return e == null || e ===
|
|
612
|
+
return e == null || e === ct ? t : function(r) {
|
|
616
613
|
return t(e(r));
|
|
617
614
|
};
|
|
618
615
|
}
|
|
619
|
-
function
|
|
616
|
+
function Me(e, t) {
|
|
620
617
|
return function() {
|
|
621
618
|
e.apply(this, arguments), t.apply(this, arguments);
|
|
622
619
|
};
|
|
@@ -628,22 +625,22 @@ function Ma() {
|
|
|
628
625
|
var a = this.onsuccess, s = this.onerror;
|
|
629
626
|
this.onsuccess = null, this.onerror = null;
|
|
630
627
|
var o = t.apply(this, arguments);
|
|
631
|
-
return a && (this.onsuccess = this.onsuccess ?
|
|
628
|
+
return a && (this.onsuccess = this.onsuccess ? Me(a, this.onsuccess) : a), s && (this.onerror = this.onerror ? Me(s, this.onerror) : s), o !== void 0 ? o : r;
|
|
632
629
|
};
|
|
633
630
|
}
|
|
634
631
|
function Zr(e, t) {
|
|
635
632
|
return e === Q ? t : function() {
|
|
636
633
|
e.apply(this, arguments);
|
|
637
634
|
var r = this.onsuccess, a = this.onerror;
|
|
638
|
-
this.onsuccess = this.onerror = null, t.apply(this, arguments), r && (this.onsuccess = this.onsuccess ?
|
|
635
|
+
this.onsuccess = this.onerror = null, t.apply(this, arguments), r && (this.onsuccess = this.onsuccess ? Me(r, this.onsuccess) : r), a && (this.onerror = this.onerror ? Me(a, this.onerror) : a);
|
|
639
636
|
};
|
|
640
637
|
}
|
|
641
638
|
function qr(e, t) {
|
|
642
639
|
return e === Q ? t : function(r) {
|
|
643
640
|
var a = e.apply(this, arguments);
|
|
644
|
-
|
|
641
|
+
te(r, a);
|
|
645
642
|
var s = this.onsuccess, o = this.onerror;
|
|
646
|
-
return this.onsuccess = null, this.onerror = null, r = t.apply(this, arguments), s && (this.onsuccess = this.onsuccess ?
|
|
643
|
+
return this.onsuccess = null, this.onerror = null, r = t.apply(this, arguments), s && (this.onsuccess = this.onsuccess ? Me(s, this.onsuccess) : s), o && (this.onerror = this.onerror ? Me(o, this.onerror) : o), a === void 0 ? r === void 0 ? void 0 : r : te(a, r);
|
|
647
644
|
};
|
|
648
645
|
}
|
|
649
646
|
function ea(e, t) {
|
|
@@ -651,7 +648,7 @@ function Ma() {
|
|
|
651
648
|
return t.apply(this, arguments) !== !1 && e.apply(this, arguments);
|
|
652
649
|
};
|
|
653
650
|
}
|
|
654
|
-
function
|
|
651
|
+
function on(e, t) {
|
|
655
652
|
return e === Q ? t : function() {
|
|
656
653
|
var r = e.apply(this, arguments);
|
|
657
654
|
if (r && typeof r.then == "function") {
|
|
@@ -663,147 +660,147 @@ function Ma() {
|
|
|
663
660
|
return t.apply(this, arguments);
|
|
664
661
|
};
|
|
665
662
|
}
|
|
666
|
-
|
|
667
|
-
var
|
|
663
|
+
Pt.ModifyError = At, Pt.DexieError = Xe, Pt.BulkError = Je;
|
|
664
|
+
var pe = typeof location < "u" && /^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);
|
|
668
665
|
function er(e) {
|
|
669
|
-
|
|
666
|
+
pe = e;
|
|
670
667
|
}
|
|
671
|
-
var
|
|
668
|
+
var ut = {}, tr = 100, Ke = typeof Promise > "u" ? [] : function() {
|
|
672
669
|
var e = Promise.resolve();
|
|
673
|
-
if (typeof crypto > "u" || !crypto.subtle) return [e,
|
|
670
|
+
if (typeof crypto > "u" || !crypto.subtle) return [e, ge(e), e];
|
|
674
671
|
var t = crypto.subtle.digest("SHA-512", new Uint8Array([0]));
|
|
675
|
-
return [t,
|
|
676
|
-
}(),
|
|
677
|
-
|
|
678
|
-
},
|
|
672
|
+
return [t, ge(t), e];
|
|
673
|
+
}(), lt = Ke[0], fe = Ke[1], Ke = Ke[2], fe = fe && fe.then, Ge = lt && lt.constructor, cn = !!Ke, dt = function(e, t) {
|
|
674
|
+
ft.push([e, t]), Dt && (queueMicrotask(na), Dt = !1);
|
|
675
|
+
}, un = !0, Dt = !0, Be = [], Nt = [], ln = ct, Pe = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: Q, pgp: !1, env: {}, finalize: Q }, B = Pe, ft = [], Le = 0, Rt = [];
|
|
679
676
|
function j(e) {
|
|
680
677
|
if (typeof this != "object") throw new TypeError("Promises must be constructed via new");
|
|
681
678
|
this._listeners = [], this._lib = !1;
|
|
682
|
-
var t = this._PSD =
|
|
679
|
+
var t = this._PSD = B;
|
|
683
680
|
if (typeof e != "function") {
|
|
684
|
-
if (e !==
|
|
685
|
-
return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 &&
|
|
681
|
+
if (e !== ut) throw new TypeError("Not a function");
|
|
682
|
+
return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 && fn(this, this._value));
|
|
686
683
|
}
|
|
687
684
|
this._state = null, this._value = null, ++t.ref, function r(a, s) {
|
|
688
685
|
try {
|
|
689
686
|
s(function(o) {
|
|
690
687
|
if (a._state === null) {
|
|
691
688
|
if (o === a) throw new TypeError("A promise cannot be resolved with itself.");
|
|
692
|
-
var u = a._lib &&
|
|
689
|
+
var u = a._lib && Ze();
|
|
693
690
|
o && typeof o.then == "function" ? r(a, function(d, h) {
|
|
694
691
|
o instanceof j ? o._then(d, h) : o.then(d, h);
|
|
695
|
-
}) : (a._state = !0, a._value = o, rr(a)), u &&
|
|
692
|
+
}) : (a._state = !0, a._value = o, rr(a)), u && qe();
|
|
696
693
|
}
|
|
697
|
-
},
|
|
694
|
+
}, fn.bind(null, a));
|
|
698
695
|
} catch (o) {
|
|
699
|
-
|
|
696
|
+
fn(a, o);
|
|
700
697
|
}
|
|
701
698
|
}(this, e);
|
|
702
699
|
}
|
|
703
|
-
var
|
|
704
|
-
var e =
|
|
700
|
+
var dn = { get: function() {
|
|
701
|
+
var e = B, t = kt;
|
|
705
702
|
function r(a, s) {
|
|
706
|
-
var o = this, u = !e.global && (e !==
|
|
707
|
-
|
|
703
|
+
var o = this, u = !e.global && (e !== B || t !== kt), d = u && !Ne(), h = new j(function(m, v) {
|
|
704
|
+
hn(o, new nr(sr(a, e, u, d), sr(s, e, u, d), m, v, e));
|
|
708
705
|
});
|
|
709
706
|
return this._consoleTask && (h._consoleTask = this._consoleTask), h;
|
|
710
707
|
}
|
|
711
|
-
return r.prototype =
|
|
708
|
+
return r.prototype = ut, r;
|
|
712
709
|
}, set: function(e) {
|
|
713
|
-
Ae(this, "then", e && e.prototype ===
|
|
710
|
+
Ae(this, "then", e && e.prototype === ut ? dn : { get: function() {
|
|
714
711
|
return e;
|
|
715
|
-
}, set:
|
|
712
|
+
}, set: dn.set });
|
|
716
713
|
} };
|
|
717
714
|
function nr(e, t, r, a, s) {
|
|
718
715
|
this.onFulfilled = typeof e == "function" ? e : null, this.onRejected = typeof t == "function" ? t : null, this.resolve = r, this.reject = a, this.psd = s;
|
|
719
716
|
}
|
|
720
|
-
function
|
|
717
|
+
function fn(e, t) {
|
|
721
718
|
var r, a;
|
|
722
|
-
|
|
719
|
+
Nt.push(t), e._state === null && (r = e._lib && Ze(), t = ln(t), e._state = !1, e._value = t, a = e, Be.some(function(s) {
|
|
723
720
|
return s._value === a._value;
|
|
724
|
-
}) || Be.push(a), rr(e), r &&
|
|
721
|
+
}) || Be.push(a), rr(e), r && qe());
|
|
725
722
|
}
|
|
726
723
|
function rr(e) {
|
|
727
724
|
var t = e._listeners;
|
|
728
725
|
e._listeners = [];
|
|
729
|
-
for (var r = 0, a = t.length; r < a; ++r)
|
|
726
|
+
for (var r = 0, a = t.length; r < a; ++r) hn(e, t[r]);
|
|
730
727
|
var s = e._PSD;
|
|
731
|
-
--s.ref || s.finalize(),
|
|
732
|
-
--
|
|
728
|
+
--s.ref || s.finalize(), Le === 0 && (++Le, dt(function() {
|
|
729
|
+
--Le == 0 && gn();
|
|
733
730
|
}, []));
|
|
734
731
|
}
|
|
735
|
-
function
|
|
732
|
+
function hn(e, t) {
|
|
736
733
|
if (e._state !== null) {
|
|
737
734
|
var r = e._state ? t.onFulfilled : t.onRejected;
|
|
738
735
|
if (r === null) return (e._state ? t.resolve : t.reject)(e._value);
|
|
739
|
-
++t.psd.ref, ++
|
|
736
|
+
++t.psd.ref, ++Le, dt(ta, [r, e, t]);
|
|
740
737
|
} else e._listeners.push(t);
|
|
741
738
|
}
|
|
742
739
|
function ta(e, t, r) {
|
|
743
740
|
try {
|
|
744
741
|
var a, s = t._value;
|
|
745
|
-
!t._state &&
|
|
742
|
+
!t._state && Nt.length && (Nt = []), a = pe && t._consoleTask ? t._consoleTask.run(function() {
|
|
746
743
|
return e(s);
|
|
747
|
-
}) : e(s), t._state ||
|
|
744
|
+
}) : e(s), t._state || Nt.indexOf(s) !== -1 || function(o) {
|
|
748
745
|
for (var u = Be.length; u; ) if (Be[--u]._value === o._value) return Be.splice(u, 1);
|
|
749
746
|
}(t), r.resolve(a);
|
|
750
747
|
} catch (o) {
|
|
751
748
|
r.reject(o);
|
|
752
749
|
} finally {
|
|
753
|
-
--
|
|
750
|
+
--Le == 0 && gn(), --r.psd.ref || r.psd.finalize();
|
|
754
751
|
}
|
|
755
752
|
}
|
|
756
753
|
function na() {
|
|
757
|
-
|
|
758
|
-
|
|
754
|
+
We(Pe, function() {
|
|
755
|
+
Ze() && qe();
|
|
759
756
|
});
|
|
760
757
|
}
|
|
761
|
-
function Je() {
|
|
762
|
-
var e = cn;
|
|
763
|
-
return Pt = cn = !1, e;
|
|
764
|
-
}
|
|
765
758
|
function Ze() {
|
|
759
|
+
var e = un;
|
|
760
|
+
return Dt = un = !1, e;
|
|
761
|
+
}
|
|
762
|
+
function qe() {
|
|
766
763
|
var e, t, r;
|
|
767
764
|
do
|
|
768
|
-
for (; 0 <
|
|
765
|
+
for (; 0 < ft.length; ) for (e = ft, ft = [], r = e.length, t = 0; t < r; ++t) {
|
|
769
766
|
var a = e[t];
|
|
770
767
|
a[0].apply(null, a[1]);
|
|
771
768
|
}
|
|
772
|
-
while (0 <
|
|
773
|
-
|
|
769
|
+
while (0 < ft.length);
|
|
770
|
+
Dt = un = !0;
|
|
774
771
|
}
|
|
775
|
-
function
|
|
772
|
+
function gn() {
|
|
776
773
|
var e = Be;
|
|
777
774
|
Be = [], e.forEach(function(a) {
|
|
778
775
|
a._PSD.onunhandled.call(null, a._value, a);
|
|
779
776
|
});
|
|
780
777
|
for (var t = Rt.slice(0), r = t.length; r; ) t[--r]();
|
|
781
778
|
}
|
|
782
|
-
function
|
|
783
|
-
return new j(
|
|
779
|
+
function Tt(e) {
|
|
780
|
+
return new j(ut, !1, e);
|
|
784
781
|
}
|
|
785
782
|
function Z(e, t) {
|
|
786
|
-
var r =
|
|
783
|
+
var r = B;
|
|
787
784
|
return function() {
|
|
788
|
-
var a =
|
|
785
|
+
var a = Ze(), s = B;
|
|
789
786
|
try {
|
|
790
|
-
return
|
|
787
|
+
return Re(r, !0), e.apply(this, arguments);
|
|
791
788
|
} catch (o) {
|
|
792
789
|
t && t(o);
|
|
793
790
|
} finally {
|
|
794
|
-
|
|
791
|
+
Re(s, !1), a && qe();
|
|
795
792
|
}
|
|
796
793
|
};
|
|
797
794
|
}
|
|
798
|
-
|
|
799
|
-
|
|
795
|
+
be(j.prototype, { then: dn, _then: function(e, t) {
|
|
796
|
+
hn(this, new nr(null, null, e, t, B));
|
|
800
797
|
}, catch: function(e) {
|
|
801
798
|
if (arguments.length === 1) return this.then(null, e);
|
|
802
799
|
var t = e, r = arguments[1];
|
|
803
800
|
return typeof t == "function" ? this.then(null, function(a) {
|
|
804
|
-
return (a instanceof t ? r :
|
|
801
|
+
return (a instanceof t ? r : Tt)(a);
|
|
805
802
|
}) : this.then(null, function(a) {
|
|
806
|
-
return (a && a.name === t ? r :
|
|
803
|
+
return (a && a.name === t ? r : Tt)(a);
|
|
807
804
|
});
|
|
808
805
|
}, finally: function(e) {
|
|
809
806
|
return this.then(function(t) {
|
|
@@ -812,7 +809,7 @@ function Ma() {
|
|
|
812
809
|
});
|
|
813
810
|
}, function(t) {
|
|
814
811
|
return j.resolve(e()).then(function() {
|
|
815
|
-
return
|
|
812
|
+
return Tt(t);
|
|
816
813
|
});
|
|
817
814
|
});
|
|
818
815
|
}, timeout: function(e, t) {
|
|
@@ -823,8 +820,8 @@ function Ma() {
|
|
|
823
820
|
}, e);
|
|
824
821
|
r.then(a, s).finally(clearTimeout.bind(null, o));
|
|
825
822
|
}) : this;
|
|
826
|
-
} }), typeof Symbol < "u" && Symbol.toStringTag && Ae(j.prototype, Symbol.toStringTag, "Dexie.Promise"), Pe.env = ar(),
|
|
827
|
-
var e =
|
|
823
|
+
} }), typeof Symbol < "u" && Symbol.toStringTag && Ae(j.prototype, Symbol.toStringTag, "Dexie.Promise"), Pe.env = ar(), be(j, { all: function() {
|
|
824
|
+
var e = Ee.apply(null, arguments).map(Ct);
|
|
828
825
|
return new j(function(t, r) {
|
|
829
826
|
e.length === 0 && t([]);
|
|
830
827
|
var a = e.length;
|
|
@@ -837,46 +834,46 @@ function Ma() {
|
|
|
837
834
|
}, resolve: function(e) {
|
|
838
835
|
return e instanceof j ? e : e && typeof e.then == "function" ? new j(function(t, r) {
|
|
839
836
|
e.then(t, r);
|
|
840
|
-
}) : new j(
|
|
841
|
-
}, reject:
|
|
842
|
-
var e =
|
|
837
|
+
}) : new j(ut, !0, e);
|
|
838
|
+
}, reject: Tt, race: function() {
|
|
839
|
+
var e = Ee.apply(null, arguments).map(Ct);
|
|
843
840
|
return new j(function(t, r) {
|
|
844
841
|
e.map(function(a) {
|
|
845
842
|
return j.resolve(a).then(t, r);
|
|
846
843
|
});
|
|
847
844
|
});
|
|
848
845
|
}, PSD: { get: function() {
|
|
849
|
-
return
|
|
846
|
+
return B;
|
|
850
847
|
}, set: function(e) {
|
|
851
|
-
return
|
|
848
|
+
return B = e;
|
|
852
849
|
} }, totalEchoes: { get: function() {
|
|
853
|
-
return
|
|
854
|
-
} }, newPSD: De, usePSD:
|
|
855
|
-
return
|
|
850
|
+
return kt;
|
|
851
|
+
} }, newPSD: De, usePSD: We, scheduler: { get: function() {
|
|
852
|
+
return dt;
|
|
856
853
|
}, set: function(e) {
|
|
857
|
-
|
|
854
|
+
dt = e;
|
|
858
855
|
} }, rejectionMapper: { get: function() {
|
|
859
|
-
return
|
|
856
|
+
return ln;
|
|
860
857
|
}, set: function(e) {
|
|
861
|
-
|
|
858
|
+
ln = e;
|
|
862
859
|
} }, follow: function(e, t) {
|
|
863
860
|
return new j(function(r, a) {
|
|
864
861
|
return De(function(s, o) {
|
|
865
|
-
var u =
|
|
866
|
-
u.unhandleds = [], u.onunhandled = o, u.finalize =
|
|
862
|
+
var u = B;
|
|
863
|
+
u.unhandleds = [], u.onunhandled = o, u.finalize = Me(function() {
|
|
867
864
|
var d, h = this;
|
|
868
865
|
d = function() {
|
|
869
866
|
h.unhandleds.length === 0 ? s() : o(h.unhandleds[0]);
|
|
870
867
|
}, Rt.push(function m() {
|
|
871
868
|
d(), Rt.splice(Rt.indexOf(m), 1);
|
|
872
|
-
}), ++
|
|
873
|
-
--
|
|
869
|
+
}), ++Le, dt(function() {
|
|
870
|
+
--Le == 0 && gn();
|
|
874
871
|
}, []);
|
|
875
872
|
}, u.finalize), e();
|
|
876
873
|
}, t, r, a);
|
|
877
874
|
});
|
|
878
|
-
} }),
|
|
879
|
-
var e =
|
|
875
|
+
} }), Ge && (Ge.allSettled && Ae(j, "allSettled", function() {
|
|
876
|
+
var e = Ee.apply(null, arguments).map(Ct);
|
|
880
877
|
return new j(function(t) {
|
|
881
878
|
e.length === 0 && t([]);
|
|
882
879
|
var r = e.length, a = new Array(r);
|
|
@@ -890,8 +887,8 @@ function Ma() {
|
|
|
890
887
|
});
|
|
891
888
|
});
|
|
892
889
|
});
|
|
893
|
-
}),
|
|
894
|
-
var e =
|
|
890
|
+
}), Ge.any && typeof AggregateError < "u" && Ae(j, "any", function() {
|
|
891
|
+
var e = Ee.apply(null, arguments).map(Ct);
|
|
895
892
|
return new j(function(t, r) {
|
|
896
893
|
e.length === 0 && r(new AggregateError([]));
|
|
897
894
|
var a = e.length, s = new Array(a);
|
|
@@ -903,76 +900,76 @@ function Ma() {
|
|
|
903
900
|
});
|
|
904
901
|
});
|
|
905
902
|
});
|
|
906
|
-
}),
|
|
907
|
-
var
|
|
903
|
+
}), Ge.withResolvers && (j.withResolvers = Ge.withResolvers));
|
|
904
|
+
var ne = { awaits: 0, echoes: 0, id: 0 }, ra = 0, It = [], xt = 0, kt = 0, aa = 0;
|
|
908
905
|
function De(e, t, r, a) {
|
|
909
|
-
var s =
|
|
910
|
-
return o.parent = s, o.ref = 0, o.global = !1, o.id = ++aa, Pe.env, o.env =
|
|
906
|
+
var s = B, o = Object.create(s);
|
|
907
|
+
return o.parent = s, o.ref = 0, o.global = !1, o.id = ++aa, Pe.env, o.env = cn ? { Promise: j, PromiseProp: { value: j, configurable: !0, writable: !0 }, all: j.all, race: j.race, allSettled: j.allSettled, any: j.any, resolve: j.resolve, reject: j.reject } : {}, t && te(o, t), ++s.ref, o.finalize = function() {
|
|
911
908
|
--this.parent.ref || this.parent.finalize();
|
|
912
|
-
}, a =
|
|
909
|
+
}, a = We(o, e, r, a), o.ref === 0 && o.finalize(), a;
|
|
913
910
|
}
|
|
914
|
-
function
|
|
915
|
-
return
|
|
911
|
+
function et() {
|
|
912
|
+
return ne.id || (ne.id = ++ra), ++ne.awaits, ne.echoes += tr, ne.id;
|
|
916
913
|
}
|
|
917
|
-
function
|
|
918
|
-
return !!
|
|
914
|
+
function Ne() {
|
|
915
|
+
return !!ne.awaits && (--ne.awaits == 0 && (ne.id = 0), ne.echoes = ne.awaits * tr, !0);
|
|
919
916
|
}
|
|
920
|
-
function
|
|
921
|
-
return
|
|
922
|
-
return
|
|
917
|
+
function Ct(e) {
|
|
918
|
+
return ne.echoes && e && e.constructor === Ge ? (et(), e.then(function(t) {
|
|
919
|
+
return Ne(), t;
|
|
923
920
|
}, function(t) {
|
|
924
|
-
return
|
|
921
|
+
return Ne(), q(t);
|
|
925
922
|
})) : e;
|
|
926
923
|
}
|
|
927
924
|
function sa() {
|
|
928
|
-
var e =
|
|
929
|
-
|
|
925
|
+
var e = It[It.length - 1];
|
|
926
|
+
It.pop(), Re(e, !1);
|
|
930
927
|
}
|
|
931
|
-
function
|
|
932
|
-
var r, a =
|
|
933
|
-
(t ? !
|
|
934
|
-
++
|
|
935
|
-
}.bind(null, e) : sa), e !==
|
|
928
|
+
function Re(e, t) {
|
|
929
|
+
var r, a = B;
|
|
930
|
+
(t ? !ne.echoes || xt++ && e === B : !xt || --xt && e === B) || queueMicrotask(t ? function(s) {
|
|
931
|
+
++kt, ne.echoes && --ne.echoes != 0 || (ne.echoes = ne.awaits = ne.id = 0), It.push(B), Re(s, !0);
|
|
932
|
+
}.bind(null, e) : sa), e !== B && (B = e, a === Pe && (Pe.env = ar()), cn && (r = Pe.env.Promise, t = e.env, (a.global || e.global) && (Object.defineProperty(_, "Promise", t.PromiseProp), r.all = t.all, r.race = t.race, r.resolve = t.resolve, r.reject = t.reject, t.allSettled && (r.allSettled = t.allSettled), t.any && (r.any = t.any))));
|
|
936
933
|
}
|
|
937
934
|
function ar() {
|
|
938
935
|
var e = _.Promise;
|
|
939
|
-
return
|
|
936
|
+
return cn ? { Promise: e, PromiseProp: Object.getOwnPropertyDescriptor(_, "Promise"), all: e.all, race: e.race, allSettled: e.allSettled, any: e.any, resolve: e.resolve, reject: e.reject } : {};
|
|
940
937
|
}
|
|
941
|
-
function
|
|
942
|
-
var o =
|
|
938
|
+
function We(e, t, r, a, s) {
|
|
939
|
+
var o = B;
|
|
943
940
|
try {
|
|
944
|
-
return
|
|
941
|
+
return Re(e, !0), t(r, a, s);
|
|
945
942
|
} finally {
|
|
946
|
-
|
|
943
|
+
Re(o, !1);
|
|
947
944
|
}
|
|
948
945
|
}
|
|
949
946
|
function sr(e, t, r, a) {
|
|
950
947
|
return typeof e != "function" ? e : function() {
|
|
951
|
-
var s =
|
|
952
|
-
r &&
|
|
948
|
+
var s = B;
|
|
949
|
+
r && et(), Re(t, !0);
|
|
953
950
|
try {
|
|
954
951
|
return e.apply(this, arguments);
|
|
955
952
|
} finally {
|
|
956
|
-
|
|
953
|
+
Re(s, !1), a && queueMicrotask(Ne);
|
|
957
954
|
}
|
|
958
955
|
};
|
|
959
956
|
}
|
|
960
957
|
function pn(e) {
|
|
961
|
-
Promise ===
|
|
958
|
+
Promise === Ge && ne.echoes === 0 ? xt === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
|
|
962
959
|
}
|
|
963
|
-
("" +
|
|
964
|
-
var q = j.reject, Fe = "",
|
|
965
|
-
function
|
|
960
|
+
("" + fe).indexOf("[native code]") === -1 && (et = Ne = Q);
|
|
961
|
+
var q = j.reject, Fe = "", we = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", ir = "String expected.", tt = [], $t = "__dbnames", mn = "readonly", yn = "readwrite";
|
|
962
|
+
function Ue(e, t) {
|
|
966
963
|
return e ? t ? function() {
|
|
967
964
|
return e.apply(this, arguments) && t.apply(this, arguments);
|
|
968
965
|
} : e : t;
|
|
969
966
|
}
|
|
970
967
|
var or = { type: 3, lower: -1 / 0, lowerOpen: !1, upper: [[]], upperOpen: !1 };
|
|
971
|
-
function
|
|
968
|
+
function jt(e) {
|
|
972
969
|
return typeof e != "string" || /\./.test(e) ? function(t) {
|
|
973
970
|
return t;
|
|
974
971
|
} : function(t) {
|
|
975
|
-
return t[e] === void 0 && e in t && delete (t =
|
|
972
|
+
return t[e] === void 0 && e in t && delete (t = $e(t))[e], t;
|
|
976
973
|
};
|
|
977
974
|
}
|
|
978
975
|
function cr() {
|
|
@@ -1007,34 +1004,34 @@ function Ma() {
|
|
|
1007
1004
|
}
|
|
1008
1005
|
function ur(e) {
|
|
1009
1006
|
var t = typeof e;
|
|
1010
|
-
return t != "object" ? t : ArrayBuffer.isView(e) ? "binary" : (e =
|
|
1007
|
+
return t != "object" ? t : ArrayBuffer.isView(e) ? "binary" : (e = nn(e), e === "ArrayBuffer" ? "binary" : e);
|
|
1011
1008
|
}
|
|
1012
1009
|
function lr(e) {
|
|
1013
1010
|
return e instanceof Uint8Array ? e : ArrayBuffer.isView(e) ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : new Uint8Array(e);
|
|
1014
1011
|
}
|
|
1015
1012
|
var dr = (X.prototype._trans = function(e, t, r) {
|
|
1016
|
-
var a = this._tx ||
|
|
1013
|
+
var a = this._tx || B.trans, s = this.name, o = pe && typeof console < "u" && console.createTask && console.createTask("Dexie: ".concat(e === "readonly" ? "read" : "write", " ").concat(this.name));
|
|
1017
1014
|
function u(m, v, f) {
|
|
1018
1015
|
if (!f.schema[s]) throw new L.NotFound("Table " + s + " not part of transaction");
|
|
1019
1016
|
return t(f.idbtrans, f);
|
|
1020
1017
|
}
|
|
1021
|
-
var d =
|
|
1018
|
+
var d = Ze();
|
|
1022
1019
|
try {
|
|
1023
|
-
var h = a && a.db._novip === this.db._novip ? a ===
|
|
1020
|
+
var h = a && a.db._novip === this.db._novip ? a === B.trans ? a._promise(e, u, r) : De(function() {
|
|
1024
1021
|
return a._promise(e, u, r);
|
|
1025
|
-
}, { trans: a, transless:
|
|
1026
|
-
if (v.idbdb && (v._state.openComplete ||
|
|
1022
|
+
}, { trans: a, transless: B.transless || B }) : function m(v, f, S, g) {
|
|
1023
|
+
if (v.idbdb && (v._state.openComplete || B.letThrough || v._vip)) {
|
|
1027
1024
|
var b = v._createTransaction(f, S, v._dbSchema);
|
|
1028
1025
|
try {
|
|
1029
1026
|
b.create(), v._state.PR1398_maxLoop = 3;
|
|
1030
1027
|
} catch (w) {
|
|
1031
|
-
return w.name ===
|
|
1032
|
-
return m(v, f, S,
|
|
1028
|
+
return w.name === sn.InvalidState && v.isOpen() && 0 < --v._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), v.close({ disableAutoOpen: !1 }), v.open().then(function() {
|
|
1029
|
+
return m(v, f, S, g);
|
|
1033
1030
|
})) : q(w);
|
|
1034
1031
|
}
|
|
1035
1032
|
return b._promise(f, function(w, y) {
|
|
1036
1033
|
return De(function() {
|
|
1037
|
-
return
|
|
1034
|
+
return B.trans = b, g(w, y, b);
|
|
1038
1035
|
});
|
|
1039
1036
|
}).then(function(w) {
|
|
1040
1037
|
if (f === "readwrite") try {
|
|
@@ -1052,14 +1049,14 @@ function Ma() {
|
|
|
1052
1049
|
v.open().catch(Q);
|
|
1053
1050
|
}
|
|
1054
1051
|
return v._state.dbReadyPromise.then(function() {
|
|
1055
|
-
return m(v, f, S,
|
|
1052
|
+
return m(v, f, S, g);
|
|
1056
1053
|
});
|
|
1057
1054
|
}(this.db, e, [this.name], u);
|
|
1058
1055
|
return o && (h._consoleTask = o, h = h.catch(function(m) {
|
|
1059
1056
|
return console.trace(m), q(m);
|
|
1060
1057
|
})), h;
|
|
1061
1058
|
} finally {
|
|
1062
|
-
d &&
|
|
1059
|
+
d && qe();
|
|
1063
1060
|
}
|
|
1064
1061
|
}, X.prototype.get = function(e, t) {
|
|
1065
1062
|
var r = this;
|
|
@@ -1071,7 +1068,7 @@ function Ma() {
|
|
|
1071
1068
|
}, X.prototype.where = function(e) {
|
|
1072
1069
|
if (typeof e == "string") return new this.db.WhereClause(this, e);
|
|
1073
1070
|
if (G(e)) return new this.db.WhereClause(this, "[".concat(e.join("+"), "]"));
|
|
1074
|
-
var t =
|
|
1071
|
+
var t = C(e);
|
|
1075
1072
|
if (t.length === 1) return this.where(t[0]).equals(e[t[0]]);
|
|
1076
1073
|
var r = this.schema.indexes.concat(this.schema.primKey).filter(function(d) {
|
|
1077
1074
|
if (d.compound && t.every(function(m) {
|
|
@@ -1090,19 +1087,19 @@ function Ma() {
|
|
|
1090
1087
|
return e[h];
|
|
1091
1088
|
}));
|
|
1092
1089
|
}
|
|
1093
|
-
!r &&
|
|
1090
|
+
!r && pe && console.warn("The query ".concat(JSON.stringify(e), " on ").concat(this.name, " would benefit from a ") + "compound index [".concat(t.join("+"), "]"));
|
|
1094
1091
|
var a = this.schema.idxByName;
|
|
1095
1092
|
function s(d, h) {
|
|
1096
1093
|
return H(d, h) === 0;
|
|
1097
1094
|
}
|
|
1098
1095
|
var u = t.reduce(function(f, h) {
|
|
1099
1096
|
var m = f[0], v = f[1], f = a[h], S = e[h];
|
|
1100
|
-
return [m || f, m || !f ?
|
|
1101
|
-
return
|
|
1097
|
+
return [m || f, m || !f ? Ue(v, f && f.multi ? function(g) {
|
|
1098
|
+
return g = ve(g, h), G(g) && g.some(function(b) {
|
|
1102
1099
|
return s(S, b);
|
|
1103
1100
|
});
|
|
1104
|
-
} : function(
|
|
1105
|
-
return s(S,
|
|
1101
|
+
} : function(g) {
|
|
1102
|
+
return s(S, ve(g, h));
|
|
1106
1103
|
}) : v];
|
|
1107
1104
|
}, [null, null]), o = u[0], u = u[1];
|
|
1108
1105
|
return o ? this.where(o.name).equals(e[o.keyPath]).filter(u) : r ? this.filter(u) : this.where(t).equals("");
|
|
@@ -1140,7 +1137,7 @@ function Ma() {
|
|
|
1140
1137
|
}, enumerable: !1, configurable: !0 }), s.prototype.table = function() {
|
|
1141
1138
|
return a;
|
|
1142
1139
|
}, e = s);
|
|
1143
|
-
for (var o = /* @__PURE__ */ new Set(), u = e.prototype; u; u =
|
|
1140
|
+
for (var o = /* @__PURE__ */ new Set(), u = e.prototype; u; u = ge(u)) Object.getOwnPropertyNames(u).forEach(function(h) {
|
|
1144
1141
|
return o.add(h);
|
|
1145
1142
|
});
|
|
1146
1143
|
function d(h) {
|
|
@@ -1155,11 +1152,11 @@ function Ma() {
|
|
|
1155
1152
|
return this.schema.readHook && this.hook.reading.unsubscribe(this.schema.readHook), this.schema.readHook = d, this.hook("reading", d), e;
|
|
1156
1153
|
}, X.prototype.defineClass = function() {
|
|
1157
1154
|
return this.mapToClass(function(e) {
|
|
1158
|
-
|
|
1155
|
+
te(this, e);
|
|
1159
1156
|
});
|
|
1160
1157
|
}, X.prototype.add = function(e, t) {
|
|
1161
1158
|
var r = this, a = this.schema.primKey, s = a.auto, o = a.keyPath, u = e;
|
|
1162
|
-
return o && s && (u =
|
|
1159
|
+
return o && s && (u = jt(o)(e)), this._trans("readwrite", function(d) {
|
|
1163
1160
|
return r.core.mutate({ trans: d, type: "add", keys: t != null ? [t] : null, values: [u] });
|
|
1164
1161
|
}).then(function(d) {
|
|
1165
1162
|
return d.numFailures ? j.reject(d.failures[0]) : d.lastResult;
|
|
@@ -1171,10 +1168,10 @@ function Ma() {
|
|
|
1171
1168
|
return d;
|
|
1172
1169
|
});
|
|
1173
1170
|
}, X.prototype.update = function(e, t) {
|
|
1174
|
-
return typeof e != "object" || G(e) ? this.where(":id").equals(e).modify(t) : (e =
|
|
1171
|
+
return typeof e != "object" || G(e) ? this.where(":id").equals(e).modify(t) : (e = ve(e, this.schema.primKey.keyPath), e === void 0 ? q(new L.InvalidArgument("Given object does not contain its primary key")) : this.where(":id").equals(e).modify(t));
|
|
1175
1172
|
}, X.prototype.put = function(e, t) {
|
|
1176
1173
|
var r = this, a = this.schema.primKey, s = a.auto, o = a.keyPath, u = e;
|
|
1177
|
-
return o && s && (u =
|
|
1174
|
+
return o && s && (u = jt(o)(e)), this._trans("readwrite", function(d) {
|
|
1178
1175
|
return r.core.mutate({ trans: d, type: "put", values: [u], keys: t != null ? [t] : null });
|
|
1179
1176
|
}).then(function(d) {
|
|
1180
1177
|
return d.numFailures ? j.reject(d.failures[0]) : d.lastResult;
|
|
@@ -1214,11 +1211,11 @@ function Ma() {
|
|
|
1214
1211
|
var m = a.schema.primKey, d = m.auto, m = m.keyPath;
|
|
1215
1212
|
if (m && s) throw new L.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
|
|
1216
1213
|
if (s && s.length !== e.length) throw new L.InvalidArgument("Arguments objects and keys must have the same length");
|
|
1217
|
-
var h = e.length, m = m && d ? e.map(
|
|
1214
|
+
var h = e.length, m = m && d ? e.map(jt(m)) : e;
|
|
1218
1215
|
return a.core.mutate({ trans: u, type: "add", keys: s, values: m, wantResults: o }).then(function(b) {
|
|
1219
|
-
var f = b.numFailures, S = b.results,
|
|
1220
|
-
if (f === 0) return o ? S :
|
|
1221
|
-
throw new
|
|
1216
|
+
var f = b.numFailures, S = b.results, g = b.lastResult, b = b.failures;
|
|
1217
|
+
if (f === 0) return o ? S : g;
|
|
1218
|
+
throw new Je("".concat(a.name, ".bulkAdd(): ").concat(f, " of ").concat(h, " operations failed"), b);
|
|
1222
1219
|
});
|
|
1223
1220
|
});
|
|
1224
1221
|
}, X.prototype.bulkPut = function(e, t, r) {
|
|
@@ -1227,11 +1224,11 @@ function Ma() {
|
|
|
1227
1224
|
var m = a.schema.primKey, d = m.auto, m = m.keyPath;
|
|
1228
1225
|
if (m && s) throw new L.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
|
|
1229
1226
|
if (s && s.length !== e.length) throw new L.InvalidArgument("Arguments objects and keys must have the same length");
|
|
1230
|
-
var h = e.length, m = m && d ? e.map(
|
|
1227
|
+
var h = e.length, m = m && d ? e.map(jt(m)) : e;
|
|
1231
1228
|
return a.core.mutate({ trans: u, type: "put", keys: s, values: m, wantResults: o }).then(function(b) {
|
|
1232
|
-
var f = b.numFailures, S = b.results,
|
|
1233
|
-
if (f === 0) return o ? S :
|
|
1234
|
-
throw new
|
|
1229
|
+
var f = b.numFailures, S = b.results, g = b.lastResult, b = b.failures;
|
|
1230
|
+
if (f === 0) return o ? S : g;
|
|
1231
|
+
throw new Je("".concat(a.name, ".bulkPut(): ").concat(f, " of ").concat(h, " operations failed"), b);
|
|
1235
1232
|
});
|
|
1236
1233
|
});
|
|
1237
1234
|
}, X.prototype.bulkUpdate = function(e) {
|
|
@@ -1244,26 +1241,26 @@ function Ma() {
|
|
|
1244
1241
|
return r.getMany({ trans: u, keys: a, cache: "clone" }).then(function(d) {
|
|
1245
1242
|
var h = [], m = [];
|
|
1246
1243
|
e.forEach(function(f, S) {
|
|
1247
|
-
var
|
|
1244
|
+
var g = f.key, b = f.changes, w = d[S];
|
|
1248
1245
|
if (w) {
|
|
1249
1246
|
for (var y = 0, A = Object.keys(b); y < A.length; y++) {
|
|
1250
1247
|
var P = A[y], D = b[P];
|
|
1251
1248
|
if (P === t.schema.primKey.keyPath) {
|
|
1252
|
-
if (H(D,
|
|
1249
|
+
if (H(D, g) !== 0) throw new L.Constraint("Cannot update primary key in bulkUpdate()");
|
|
1253
1250
|
} else ue(w, P, D);
|
|
1254
1251
|
}
|
|
1255
|
-
o.push(S), h.push(
|
|
1252
|
+
o.push(S), h.push(g), m.push(w);
|
|
1256
1253
|
}
|
|
1257
1254
|
});
|
|
1258
1255
|
var v = h.length;
|
|
1259
1256
|
return r.mutate({ trans: u, type: "put", keys: h, values: m, updates: { keys: a, changeSpecs: s } }).then(function(f) {
|
|
1260
|
-
var S = f.numFailures,
|
|
1257
|
+
var S = f.numFailures, g = f.failures;
|
|
1261
1258
|
if (S === 0) return v;
|
|
1262
|
-
for (var b = 0, w = Object.keys(
|
|
1259
|
+
for (var b = 0, w = Object.keys(g); b < w.length; b++) {
|
|
1263
1260
|
var y, A = w[b], P = o[Number(A)];
|
|
1264
|
-
P != null && (y =
|
|
1261
|
+
P != null && (y = g[A], delete g[A], g[P] = y);
|
|
1265
1262
|
}
|
|
1266
|
-
throw new
|
|
1263
|
+
throw new Je("".concat(t.name, ".bulkUpdate(): ").concat(S, " of ").concat(v, " operations failed"), g);
|
|
1267
1264
|
});
|
|
1268
1265
|
});
|
|
1269
1266
|
});
|
|
@@ -1274,12 +1271,12 @@ function Ma() {
|
|
|
1274
1271
|
}).then(function(u) {
|
|
1275
1272
|
var s = u.numFailures, o = u.lastResult, u = u.failures;
|
|
1276
1273
|
if (s === 0) return o;
|
|
1277
|
-
throw new
|
|
1274
|
+
throw new Je("".concat(t.name, ".bulkDelete(): ").concat(s, " of ").concat(r, " operations failed"), u);
|
|
1278
1275
|
});
|
|
1279
1276
|
}, X);
|
|
1280
1277
|
function X() {
|
|
1281
1278
|
}
|
|
1282
|
-
function
|
|
1279
|
+
function ht(e) {
|
|
1283
1280
|
function t(u, d) {
|
|
1284
1281
|
if (d) {
|
|
1285
1282
|
for (var h = arguments.length, m = new Array(h - 1); --h; ) m[h - 1] = arguments[h];
|
|
@@ -1304,14 +1301,14 @@ function Ma() {
|
|
|
1304
1301
|
} };
|
|
1305
1302
|
return r[u] = t[u] = v;
|
|
1306
1303
|
}
|
|
1307
|
-
|
|
1304
|
+
C(m = u).forEach(function(f) {
|
|
1308
1305
|
var S = m[f];
|
|
1309
1306
|
if (G(S)) o(f, m[f][0], m[f][1]);
|
|
1310
1307
|
else {
|
|
1311
1308
|
if (S !== "asap") throw new L.InvalidArgument("Invalid event config");
|
|
1312
|
-
var
|
|
1309
|
+
var g = o(f, ct, function() {
|
|
1313
1310
|
for (var b = arguments.length, w = new Array(b); b--; ) w[b] = arguments[b];
|
|
1314
|
-
|
|
1311
|
+
g.subscribers.forEach(function(y) {
|
|
1315
1312
|
Yn(function() {
|
|
1316
1313
|
y.apply(null, w);
|
|
1317
1314
|
});
|
|
@@ -1321,33 +1318,33 @@ function Ma() {
|
|
|
1321
1318
|
});
|
|
1322
1319
|
}
|
|
1323
1320
|
}
|
|
1324
|
-
function
|
|
1325
|
-
return
|
|
1321
|
+
function gt(e, t) {
|
|
1322
|
+
return Ye(t).from({ prototype: e }), t;
|
|
1326
1323
|
}
|
|
1327
|
-
function
|
|
1324
|
+
function nt(e, t) {
|
|
1328
1325
|
return !(e.filter || e.algorithm || e.or) && (t ? e.justLimit : !e.replayFilter);
|
|
1329
1326
|
}
|
|
1330
|
-
function
|
|
1331
|
-
e.filter =
|
|
1327
|
+
function bn(e, t) {
|
|
1328
|
+
e.filter = Ue(e.filter, t);
|
|
1332
1329
|
}
|
|
1333
|
-
function
|
|
1330
|
+
function vn(e, t, r) {
|
|
1334
1331
|
var a = e.replayFilter;
|
|
1335
1332
|
e.replayFilter = a ? function() {
|
|
1336
|
-
return
|
|
1333
|
+
return Ue(a(), t());
|
|
1337
1334
|
} : t, e.justLimit = r && !a;
|
|
1338
1335
|
}
|
|
1339
|
-
function
|
|
1336
|
+
function Mt(e, t) {
|
|
1340
1337
|
if (e.isPrimKey) return t.primaryKey;
|
|
1341
1338
|
var r = t.getIndexByKeyPath(e.index);
|
|
1342
1339
|
if (!r) throw new L.Schema("KeyPath " + e.index + " on object store " + t.name + " is not indexed");
|
|
1343
1340
|
return r;
|
|
1344
1341
|
}
|
|
1345
1342
|
function fr(e, t, r) {
|
|
1346
|
-
var a =
|
|
1343
|
+
var a = Mt(e, t.schema);
|
|
1347
1344
|
return t.openCursor({ trans: r, values: !e.keysOnly, reverse: e.dir === "prev", unique: !!e.unique, query: { index: a, range: e.range } });
|
|
1348
1345
|
}
|
|
1349
|
-
function
|
|
1350
|
-
var s = e.replayFilter ?
|
|
1346
|
+
function Kt(e, t, r, a) {
|
|
1347
|
+
var s = e.replayFilter ? Ue(e.filter, e.replayFilter()) : e.filter;
|
|
1351
1348
|
if (e.or) {
|
|
1352
1349
|
var o = {}, u = function(d, h, m) {
|
|
1353
1350
|
var v, f;
|
|
@@ -1355,11 +1352,11 @@ function Ma() {
|
|
|
1355
1352
|
return h.stop(S);
|
|
1356
1353
|
}, function(S) {
|
|
1357
1354
|
return h.fail(S);
|
|
1358
|
-
}) || ((f = "" + (v = h.primaryKey)) == "[object ArrayBuffer]" && (f = "" + new Uint8Array(v)),
|
|
1355
|
+
}) || ((f = "" + (v = h.primaryKey)) == "[object ArrayBuffer]" && (f = "" + new Uint8Array(v)), oe(o, f) || (o[f] = !0, t(d, h, m)));
|
|
1359
1356
|
};
|
|
1360
1357
|
return Promise.all([e.or._iterate(u, r), hr(fr(e, a, r), e.algorithm, u, !e.keysOnly && e.valueMapper)]);
|
|
1361
1358
|
}
|
|
1362
|
-
return hr(fr(e, a, r),
|
|
1359
|
+
return hr(fr(e, a, r), Ue(e.algorithm, s), t, !e.keysOnly && e.valueMapper);
|
|
1363
1360
|
}
|
|
1364
1361
|
function hr(e, t, r, a) {
|
|
1365
1362
|
var s = Z(a ? function(o, u, d) {
|
|
@@ -1382,7 +1379,7 @@ function Ma() {
|
|
|
1382
1379
|
});
|
|
1383
1380
|
});
|
|
1384
1381
|
}
|
|
1385
|
-
var pt = (
|
|
1382
|
+
var pt = (gr.prototype.execute = function(e) {
|
|
1386
1383
|
var t = this["@@propmod"];
|
|
1387
1384
|
if (t.add !== void 0) {
|
|
1388
1385
|
var r = t.add;
|
|
@@ -1409,8 +1406,8 @@ function Ma() {
|
|
|
1409
1406
|
throw new TypeError("Invalid subtrahend ".concat(a));
|
|
1410
1407
|
}
|
|
1411
1408
|
return r = (r = t.replacePrefix) === null || r === void 0 ? void 0 : r[0], r && typeof e == "string" && e.startsWith(r) ? t.replacePrefix[1] + e.substring(r.length) : e;
|
|
1412
|
-
},
|
|
1413
|
-
function
|
|
1409
|
+
}, gr);
|
|
1410
|
+
function gr(e) {
|
|
1414
1411
|
this["@@propmod"] = e;
|
|
1415
1412
|
}
|
|
1416
1413
|
var ia = (V.prototype._read = function(e, t) {
|
|
@@ -1421,28 +1418,28 @@ function Ma() {
|
|
|
1421
1418
|
return t.error ? t.table._trans(null, q.bind(null, t.error)) : t.table._trans("readwrite", e, "locked");
|
|
1422
1419
|
}, V.prototype._addAlgorithm = function(e) {
|
|
1423
1420
|
var t = this._ctx;
|
|
1424
|
-
t.algorithm =
|
|
1421
|
+
t.algorithm = Ue(t.algorithm, e);
|
|
1425
1422
|
}, V.prototype._iterate = function(e, t) {
|
|
1426
|
-
return
|
|
1423
|
+
return Kt(this._ctx, e, t, this._ctx.table.core);
|
|
1427
1424
|
}, V.prototype.clone = function(e) {
|
|
1428
1425
|
var t = Object.create(this.constructor.prototype), r = Object.create(this._ctx);
|
|
1429
|
-
return e &&
|
|
1426
|
+
return e && te(r, e), t._ctx = r, t;
|
|
1430
1427
|
}, V.prototype.raw = function() {
|
|
1431
1428
|
return this._ctx.valueMapper = null, this;
|
|
1432
1429
|
}, V.prototype.each = function(e) {
|
|
1433
1430
|
var t = this._ctx;
|
|
1434
1431
|
return this._read(function(r) {
|
|
1435
|
-
return
|
|
1432
|
+
return Kt(t, e, r, t.table.core);
|
|
1436
1433
|
});
|
|
1437
1434
|
}, V.prototype.count = function(e) {
|
|
1438
1435
|
var t = this;
|
|
1439
1436
|
return this._read(function(r) {
|
|
1440
1437
|
var a = t._ctx, s = a.table.core;
|
|
1441
|
-
if (
|
|
1438
|
+
if (nt(a, !0)) return s.count({ trans: r, query: { index: Mt(a, s.schema), range: a.range } }).then(function(u) {
|
|
1442
1439
|
return Math.min(u, a.limit);
|
|
1443
1440
|
});
|
|
1444
1441
|
var o = 0;
|
|
1445
|
-
return
|
|
1442
|
+
return Kt(a, function() {
|
|
1446
1443
|
return ++o, !1;
|
|
1447
1444
|
}, r, s).then(function() {
|
|
1448
1445
|
return o;
|
|
@@ -1464,14 +1461,14 @@ function Ma() {
|
|
|
1464
1461
|
var t = this;
|
|
1465
1462
|
return this._read(function(r) {
|
|
1466
1463
|
var a = t._ctx;
|
|
1467
|
-
if (a.dir === "next" &&
|
|
1468
|
-
var s = a.valueMapper, o =
|
|
1464
|
+
if (a.dir === "next" && nt(a, !0) && 0 < a.limit) {
|
|
1465
|
+
var s = a.valueMapper, o = Mt(a, a.table.core.schema);
|
|
1469
1466
|
return a.table.core.query({ trans: r, limit: a.limit, values: !0, query: { index: o, range: a.range } }).then(function(d) {
|
|
1470
1467
|
return d = d.result, s ? d.map(s) : d;
|
|
1471
1468
|
});
|
|
1472
1469
|
}
|
|
1473
1470
|
var u = [];
|
|
1474
|
-
return
|
|
1471
|
+
return Kt(a, function(d) {
|
|
1475
1472
|
return u.push(d);
|
|
1476
1473
|
}, r, a.table.core).then(function() {
|
|
1477
1474
|
return u;
|
|
@@ -1479,28 +1476,28 @@ function Ma() {
|
|
|
1479
1476
|
}, e);
|
|
1480
1477
|
}, V.prototype.offset = function(e) {
|
|
1481
1478
|
var t = this._ctx;
|
|
1482
|
-
return e <= 0 || (t.offset += e,
|
|
1479
|
+
return e <= 0 || (t.offset += e, nt(t) ? vn(t, function() {
|
|
1483
1480
|
var r = e;
|
|
1484
1481
|
return function(a, s) {
|
|
1485
1482
|
return r === 0 || (r === 1 ? --r : s(function() {
|
|
1486
1483
|
a.advance(r), r = 0;
|
|
1487
1484
|
}), !1);
|
|
1488
1485
|
};
|
|
1489
|
-
}) :
|
|
1486
|
+
}) : vn(t, function() {
|
|
1490
1487
|
var r = e;
|
|
1491
1488
|
return function() {
|
|
1492
1489
|
return --r < 0;
|
|
1493
1490
|
};
|
|
1494
1491
|
})), this;
|
|
1495
1492
|
}, V.prototype.limit = function(e) {
|
|
1496
|
-
return this._ctx.limit = Math.min(this._ctx.limit, e),
|
|
1493
|
+
return this._ctx.limit = Math.min(this._ctx.limit, e), vn(this._ctx, function() {
|
|
1497
1494
|
var t = e;
|
|
1498
1495
|
return function(r, a, s) {
|
|
1499
1496
|
return --t <= 0 && a(s), 0 <= t;
|
|
1500
1497
|
};
|
|
1501
1498
|
}, !0), this;
|
|
1502
1499
|
}, V.prototype.until = function(e, t) {
|
|
1503
|
-
return
|
|
1500
|
+
return bn(this._ctx, function(r, a, s) {
|
|
1504
1501
|
return !e(r.value) || (a(s), t);
|
|
1505
1502
|
}), this;
|
|
1506
1503
|
}, V.prototype.first = function(e) {
|
|
@@ -1511,9 +1508,9 @@ function Ma() {
|
|
|
1511
1508
|
return this.reverse().first(e);
|
|
1512
1509
|
}, V.prototype.filter = function(e) {
|
|
1513
1510
|
var t;
|
|
1514
|
-
return
|
|
1511
|
+
return bn(this._ctx, function(r) {
|
|
1515
1512
|
return e(r.value);
|
|
1516
|
-
}), (t = this._ctx).isMatch =
|
|
1513
|
+
}), (t = this._ctx).isMatch = Ue(t.isMatch, e), this;
|
|
1517
1514
|
}, V.prototype.and = function(e) {
|
|
1518
1515
|
return this.filter(e);
|
|
1519
1516
|
}, V.prototype.or = function(e) {
|
|
@@ -1545,8 +1542,8 @@ function Ma() {
|
|
|
1545
1542
|
}).then(e);
|
|
1546
1543
|
}, V.prototype.primaryKeys = function(e) {
|
|
1547
1544
|
var t = this._ctx;
|
|
1548
|
-
if (t.dir === "next" &&
|
|
1549
|
-
var s =
|
|
1545
|
+
if (t.dir === "next" && nt(t, !0) && 0 < t.limit) return this._read(function(a) {
|
|
1546
|
+
var s = Mt(t, t.table.core.schema);
|
|
1550
1547
|
return t.table.core.query({ trans: a, values: !1, limit: t.limit, query: { index: s, range: t.range } });
|
|
1551
1548
|
}).then(function(a) {
|
|
1552
1549
|
return a.result;
|
|
@@ -1570,18 +1567,18 @@ function Ma() {
|
|
|
1570
1567
|
var e = this._ctx, e = e.index && e.table.schema.idxByName[e.index];
|
|
1571
1568
|
if (!e || !e.multi) return this;
|
|
1572
1569
|
var t = {};
|
|
1573
|
-
return
|
|
1574
|
-
var a = s.primaryKey.toString(), s =
|
|
1570
|
+
return bn(this._ctx, function(s) {
|
|
1571
|
+
var a = s.primaryKey.toString(), s = oe(t, a);
|
|
1575
1572
|
return t[a] = !0, !s;
|
|
1576
1573
|
}), this;
|
|
1577
1574
|
}, V.prototype.modify = function(e) {
|
|
1578
1575
|
var t = this, r = this._ctx;
|
|
1579
1576
|
return this._write(function(a) {
|
|
1580
1577
|
var s, o, u;
|
|
1581
|
-
u = typeof e == "function" ? e : (s =
|
|
1578
|
+
u = typeof e == "function" ? e : (s = C(e), o = s.length, function(y) {
|
|
1582
1579
|
for (var A = !1, P = 0; P < o; ++P) {
|
|
1583
|
-
var D = s[P],
|
|
1584
|
-
|
|
1580
|
+
var D = s[P], N = e[D], R = ve(y, D);
|
|
1581
|
+
N instanceof pt ? (ue(y, D, N.execute(R)), A = !0) : R !== N && (ue(y, D, N), A = !0);
|
|
1585
1582
|
}
|
|
1586
1583
|
return A;
|
|
1587
1584
|
});
|
|
@@ -1590,61 +1587,61 @@ function Ma() {
|
|
|
1590
1587
|
function S(y, D) {
|
|
1591
1588
|
var P = D.failures, D = D.numFailures;
|
|
1592
1589
|
b += y - D;
|
|
1593
|
-
for (var
|
|
1594
|
-
var
|
|
1595
|
-
|
|
1590
|
+
for (var N = 0, R = C(P); N < R.length; N++) {
|
|
1591
|
+
var k = R[N];
|
|
1592
|
+
g.push(P[k]);
|
|
1596
1593
|
}
|
|
1597
1594
|
}
|
|
1598
|
-
var
|
|
1595
|
+
var g = [], b = 0, w = [];
|
|
1599
1596
|
return t.clone().primaryKeys().then(function(y) {
|
|
1600
1597
|
function A(D) {
|
|
1601
|
-
var
|
|
1602
|
-
return d.getMany({ trans: a, keys: y.slice(D, D +
|
|
1603
|
-
for (var
|
|
1604
|
-
var M =
|
|
1605
|
-
u.call(
|
|
1598
|
+
var N = Math.min(v, y.length - D);
|
|
1599
|
+
return d.getMany({ trans: a, keys: y.slice(D, D + N), cache: "immutable" }).then(function(R) {
|
|
1600
|
+
for (var k = [], T = [], I = h ? [] : null, $ = [], x = 0; x < N; ++x) {
|
|
1601
|
+
var M = R[x], F = { value: $e(M), primKey: y[D + x] };
|
|
1602
|
+
u.call(F, F.value, F) !== !1 && (F.value == null ? $.push(y[D + x]) : h || H(m(M), m(F.value)) === 0 ? (T.push(F.value), h && I.push(y[D + x])) : ($.push(y[D + x]), k.push(F.value)));
|
|
1606
1603
|
}
|
|
1607
|
-
return Promise.resolve(0 <
|
|
1604
|
+
return Promise.resolve(0 < k.length && d.mutate({ trans: a, type: "add", values: k }).then(function(U) {
|
|
1608
1605
|
for (var z in U.failures) $.splice(parseInt(z), 1);
|
|
1609
|
-
S(
|
|
1606
|
+
S(k.length, U);
|
|
1610
1607
|
})).then(function() {
|
|
1611
|
-
return (0 < T.length || P && typeof e == "object") && d.mutate({ trans: a, type: "put", keys:
|
|
1608
|
+
return (0 < T.length || P && typeof e == "object") && d.mutate({ trans: a, type: "put", keys: I, values: T, criteria: P, changeSpec: typeof e != "function" && e, isAdditionalChunk: 0 < D }).then(function(U) {
|
|
1612
1609
|
return S(T.length, U);
|
|
1613
1610
|
});
|
|
1614
1611
|
}).then(function() {
|
|
1615
|
-
return (0 < $.length || P && e ===
|
|
1612
|
+
return (0 < $.length || P && e === En) && d.mutate({ trans: a, type: "delete", keys: $, criteria: P, isAdditionalChunk: 0 < D }).then(function(U) {
|
|
1616
1613
|
return S($.length, U);
|
|
1617
1614
|
});
|
|
1618
1615
|
}).then(function() {
|
|
1619
|
-
return y.length > D +
|
|
1616
|
+
return y.length > D + N && A(D + v);
|
|
1620
1617
|
});
|
|
1621
1618
|
});
|
|
1622
1619
|
}
|
|
1623
|
-
var P =
|
|
1620
|
+
var P = nt(r) && r.limit === 1 / 0 && (typeof e != "function" || e === En) && { index: r.index, range: r.range };
|
|
1624
1621
|
return A(0).then(function() {
|
|
1625
|
-
if (0 <
|
|
1622
|
+
if (0 < g.length) throw new At("Error modifying one or more objects", g, b, w);
|
|
1626
1623
|
return y.length;
|
|
1627
1624
|
});
|
|
1628
1625
|
});
|
|
1629
1626
|
});
|
|
1630
1627
|
}, V.prototype.delete = function() {
|
|
1631
1628
|
var e = this._ctx, t = e.range;
|
|
1632
|
-
return
|
|
1629
|
+
return nt(e) && (e.isPrimKey || t.type === 3) ? this._write(function(r) {
|
|
1633
1630
|
var a = e.table.core.schema.primaryKey, s = t;
|
|
1634
1631
|
return e.table.core.count({ trans: r, query: { index: a, range: s } }).then(function(o) {
|
|
1635
1632
|
return e.table.core.mutate({ trans: r, type: "deleteRange", range: s }).then(function(u) {
|
|
1636
1633
|
var d = u.failures;
|
|
1637
|
-
if (u.lastResult, u.results, u = u.numFailures, u) throw new
|
|
1634
|
+
if (u.lastResult, u.results, u = u.numFailures, u) throw new At("Could not delete some values", Object.keys(d).map(function(h) {
|
|
1638
1635
|
return d[h];
|
|
1639
1636
|
}), o - u);
|
|
1640
1637
|
return o - u;
|
|
1641
1638
|
});
|
|
1642
1639
|
});
|
|
1643
|
-
}) : this.modify(
|
|
1640
|
+
}) : this.modify(En);
|
|
1644
1641
|
}, V);
|
|
1645
1642
|
function V() {
|
|
1646
1643
|
}
|
|
1647
|
-
var
|
|
1644
|
+
var En = function(e, t) {
|
|
1648
1645
|
return t.value = null;
|
|
1649
1646
|
};
|
|
1650
1647
|
function oa(e, t) {
|
|
@@ -1656,12 +1653,12 @@ function Ma() {
|
|
|
1656
1653
|
function le(e, t, r) {
|
|
1657
1654
|
return e = e instanceof mr ? new e.Collection(e) : e, e._ctx.error = new (r || TypeError)(t), e;
|
|
1658
1655
|
}
|
|
1659
|
-
function
|
|
1656
|
+
function rt(e) {
|
|
1660
1657
|
return new e.Collection(e, function() {
|
|
1661
|
-
return
|
|
1658
|
+
return pr("");
|
|
1662
1659
|
}).limit(0);
|
|
1663
1660
|
}
|
|
1664
|
-
function
|
|
1661
|
+
function Gt(e, t, r, a) {
|
|
1665
1662
|
var s, o, u, d, h, m, v, f = r.length;
|
|
1666
1663
|
if (!r.every(function(b) {
|
|
1667
1664
|
return typeof b == "string";
|
|
@@ -1692,22 +1689,22 @@ function Ma() {
|
|
|
1692
1689
|
}), e._ondirectionchange = function(b) {
|
|
1693
1690
|
S(b);
|
|
1694
1691
|
};
|
|
1695
|
-
var
|
|
1692
|
+
var g = 0;
|
|
1696
1693
|
return e._addAlgorithm(function(b, w, y) {
|
|
1697
1694
|
var A = b.key;
|
|
1698
1695
|
if (typeof A != "string") return !1;
|
|
1699
1696
|
var P = o(A);
|
|
1700
|
-
if (t(P, h,
|
|
1701
|
-
for (var D = null,
|
|
1702
|
-
var
|
|
1703
|
-
for (var
|
|
1697
|
+
if (t(P, h, g)) return !0;
|
|
1698
|
+
for (var D = null, N = g; N < f; ++N) {
|
|
1699
|
+
var R = function(k, T, I, $, x, M) {
|
|
1700
|
+
for (var F = Math.min(k.length, $.length), U = -1, z = 0; z < F; ++z) {
|
|
1704
1701
|
var de = T[z];
|
|
1705
|
-
if (de !== $[z]) return k
|
|
1706
|
-
k
|
|
1702
|
+
if (de !== $[z]) return x(k[z], I[z]) < 0 ? k.substr(0, z) + I[z] + I.substr(z + 1) : x(k[z], $[z]) < 0 ? k.substr(0, z) + $[z] + I.substr(z + 1) : 0 <= U ? k.substr(0, U) + T[U] + I.substr(U + 1) : null;
|
|
1703
|
+
x(k[z], de) < 0 && (U = z);
|
|
1707
1704
|
}
|
|
1708
|
-
return
|
|
1709
|
-
}(A, P, d[
|
|
1710
|
-
|
|
1705
|
+
return F < $.length && M === "next" ? k + I.substr(k.length) : F < k.length && M === "prev" ? k.substr(0, I.length) : U < 0 ? null : k.substr(0, U) + $[U] + I.substr(U + 1);
|
|
1706
|
+
}(A, P, d[N], h[N], u, m);
|
|
1707
|
+
R === null && D === null ? g = N + 1 : (D === null || 0 < u(D, R)) && (D = R);
|
|
1711
1708
|
}
|
|
1712
1709
|
return w(D !== null ? function() {
|
|
1713
1710
|
b.continue(D + v);
|
|
@@ -1717,70 +1714,70 @@ function Ma() {
|
|
|
1717
1714
|
function Te(e, t, r, a) {
|
|
1718
1715
|
return { type: 2, lower: e, upper: t, lowerOpen: r, upperOpen: a };
|
|
1719
1716
|
}
|
|
1720
|
-
function
|
|
1717
|
+
function pr(e) {
|
|
1721
1718
|
return { type: 1, lower: e, upper: e };
|
|
1722
1719
|
}
|
|
1723
|
-
var mr = (Object.defineProperty(
|
|
1720
|
+
var mr = (Object.defineProperty(re.prototype, "Collection", { get: function() {
|
|
1724
1721
|
return this._ctx.table.db.Collection;
|
|
1725
|
-
}, enumerable: !1, configurable: !0 }),
|
|
1722
|
+
}, enumerable: !1, configurable: !0 }), re.prototype.between = function(e, t, r, a) {
|
|
1726
1723
|
r = r !== !1, a = a === !0;
|
|
1727
1724
|
try {
|
|
1728
|
-
return 0 < this._cmp(e, t) || this._cmp(e, t) === 0 && (r || a) && (!r || !a) ?
|
|
1725
|
+
return 0 < this._cmp(e, t) || this._cmp(e, t) === 0 && (r || a) && (!r || !a) ? rt(this) : new this.Collection(this, function() {
|
|
1729
1726
|
return Te(e, t, !r, !a);
|
|
1730
1727
|
});
|
|
1731
1728
|
} catch {
|
|
1732
|
-
return le(this,
|
|
1729
|
+
return le(this, we);
|
|
1733
1730
|
}
|
|
1734
|
-
},
|
|
1735
|
-
return e == null ? le(this,
|
|
1736
|
-
return
|
|
1731
|
+
}, re.prototype.equals = function(e) {
|
|
1732
|
+
return e == null ? le(this, we) : new this.Collection(this, function() {
|
|
1733
|
+
return pr(e);
|
|
1737
1734
|
});
|
|
1738
|
-
},
|
|
1739
|
-
return e == null ? le(this,
|
|
1735
|
+
}, re.prototype.above = function(e) {
|
|
1736
|
+
return e == null ? le(this, we) : new this.Collection(this, function() {
|
|
1740
1737
|
return Te(e, void 0, !0);
|
|
1741
1738
|
});
|
|
1742
|
-
},
|
|
1743
|
-
return e == null ? le(this,
|
|
1739
|
+
}, re.prototype.aboveOrEqual = function(e) {
|
|
1740
|
+
return e == null ? le(this, we) : new this.Collection(this, function() {
|
|
1744
1741
|
return Te(e, void 0, !1);
|
|
1745
1742
|
});
|
|
1746
|
-
},
|
|
1747
|
-
return e == null ? le(this,
|
|
1743
|
+
}, re.prototype.below = function(e) {
|
|
1744
|
+
return e == null ? le(this, we) : new this.Collection(this, function() {
|
|
1748
1745
|
return Te(void 0, e, !1, !0);
|
|
1749
1746
|
});
|
|
1750
|
-
},
|
|
1751
|
-
return e == null ? le(this,
|
|
1747
|
+
}, re.prototype.belowOrEqual = function(e) {
|
|
1748
|
+
return e == null ? le(this, we) : new this.Collection(this, function() {
|
|
1752
1749
|
return Te(void 0, e);
|
|
1753
1750
|
});
|
|
1754
|
-
},
|
|
1751
|
+
}, re.prototype.startsWith = function(e) {
|
|
1755
1752
|
return typeof e != "string" ? le(this, ir) : this.between(e, e + Fe, !0, !0);
|
|
1756
|
-
},
|
|
1757
|
-
return e === "" ? this.startsWith(e) :
|
|
1753
|
+
}, re.prototype.startsWithIgnoreCase = function(e) {
|
|
1754
|
+
return e === "" ? this.startsWith(e) : Gt(this, function(t, r) {
|
|
1758
1755
|
return t.indexOf(r[0]) === 0;
|
|
1759
1756
|
}, [e], Fe);
|
|
1760
|
-
},
|
|
1761
|
-
return
|
|
1757
|
+
}, re.prototype.equalsIgnoreCase = function(e) {
|
|
1758
|
+
return Gt(this, function(t, r) {
|
|
1762
1759
|
return t === r[0];
|
|
1763
1760
|
}, [e], "");
|
|
1764
|
-
},
|
|
1765
|
-
var e =
|
|
1766
|
-
return e.length === 0 ?
|
|
1761
|
+
}, re.prototype.anyOfIgnoreCase = function() {
|
|
1762
|
+
var e = Ee.apply(Qe, arguments);
|
|
1763
|
+
return e.length === 0 ? rt(this) : Gt(this, function(t, r) {
|
|
1767
1764
|
return r.indexOf(t) !== -1;
|
|
1768
1765
|
}, e, "");
|
|
1769
|
-
},
|
|
1770
|
-
var e =
|
|
1771
|
-
return e.length === 0 ?
|
|
1766
|
+
}, re.prototype.startsWithAnyOfIgnoreCase = function() {
|
|
1767
|
+
var e = Ee.apply(Qe, arguments);
|
|
1768
|
+
return e.length === 0 ? rt(this) : Gt(this, function(t, r) {
|
|
1772
1769
|
return r.some(function(a) {
|
|
1773
1770
|
return t.indexOf(a) === 0;
|
|
1774
1771
|
});
|
|
1775
1772
|
}, e, Fe);
|
|
1776
|
-
},
|
|
1777
|
-
var e = this, t =
|
|
1773
|
+
}, re.prototype.anyOf = function() {
|
|
1774
|
+
var e = this, t = Ee.apply(Qe, arguments), r = this._cmp;
|
|
1778
1775
|
try {
|
|
1779
1776
|
t.sort(r);
|
|
1780
1777
|
} catch {
|
|
1781
|
-
return le(this,
|
|
1778
|
+
return le(this, we);
|
|
1782
1779
|
}
|
|
1783
|
-
if (t.length === 0) return
|
|
1780
|
+
if (t.length === 0) return rt(this);
|
|
1784
1781
|
var a = new this.Collection(this, function() {
|
|
1785
1782
|
return Te(t[0], t[t.length - 1]);
|
|
1786
1783
|
});
|
|
@@ -1794,23 +1791,23 @@ function Ma() {
|
|
|
1794
1791
|
o.continue(t[s]);
|
|
1795
1792
|
}), !1);
|
|
1796
1793
|
}), a;
|
|
1797
|
-
},
|
|
1794
|
+
}, re.prototype.notEqual = function(e) {
|
|
1798
1795
|
return this.inAnyRange([[-1 / 0, e], [e, this.db._maxKey]], { includeLowers: !1, includeUppers: !1 });
|
|
1799
|
-
},
|
|
1800
|
-
var e =
|
|
1796
|
+
}, re.prototype.noneOf = function() {
|
|
1797
|
+
var e = Ee.apply(Qe, arguments);
|
|
1801
1798
|
if (e.length === 0) return new this.Collection(this);
|
|
1802
1799
|
try {
|
|
1803
1800
|
e.sort(this._ascending);
|
|
1804
1801
|
} catch {
|
|
1805
|
-
return le(this,
|
|
1802
|
+
return le(this, we);
|
|
1806
1803
|
}
|
|
1807
1804
|
var t = e.reduce(function(r, a) {
|
|
1808
1805
|
return r ? r.concat([[r[r.length - 1][1], a]]) : [[-1 / 0, a]];
|
|
1809
1806
|
}, null);
|
|
1810
1807
|
return t.push([e[e.length - 1], this.db._maxKey]), this.inAnyRange(t, { includeLowers: !1, includeUppers: !1 });
|
|
1811
|
-
},
|
|
1808
|
+
}, re.prototype.inAnyRange = function(A, t) {
|
|
1812
1809
|
var r = this, a = this._cmp, s = this._ascending, o = this._descending, u = this._min, d = this._max;
|
|
1813
|
-
if (A.length === 0) return
|
|
1810
|
+
if (A.length === 0) return rt(this);
|
|
1814
1811
|
if (!A.every(function(P) {
|
|
1815
1812
|
return P[0] !== void 0 && P[1] !== void 0 && s(P[0], P[1]) <= 0;
|
|
1816
1813
|
})) return le(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", L.InvalidArgument);
|
|
@@ -1820,73 +1817,73 @@ function Ma() {
|
|
|
1820
1817
|
}
|
|
1821
1818
|
try {
|
|
1822
1819
|
(v = A.reduce(function(P, D) {
|
|
1823
|
-
for (var
|
|
1824
|
-
var
|
|
1825
|
-
if (a(D[0],
|
|
1826
|
-
|
|
1820
|
+
for (var N = 0, R = P.length; N < R; ++N) {
|
|
1821
|
+
var k = P[N];
|
|
1822
|
+
if (a(D[0], k[1]) < 0 && 0 < a(D[1], k[0])) {
|
|
1823
|
+
k[0] = u(k[0], D[0]), k[1] = d(k[1], D[1]);
|
|
1827
1824
|
break;
|
|
1828
1825
|
}
|
|
1829
1826
|
}
|
|
1830
|
-
return
|
|
1827
|
+
return N === R && P.push(D), P;
|
|
1831
1828
|
}, [])).sort(S);
|
|
1832
1829
|
} catch {
|
|
1833
|
-
return le(this,
|
|
1830
|
+
return le(this, we);
|
|
1834
1831
|
}
|
|
1835
|
-
var
|
|
1836
|
-
return 0 < s(P, v[
|
|
1832
|
+
var g = 0, b = m ? function(P) {
|
|
1833
|
+
return 0 < s(P, v[g][1]);
|
|
1837
1834
|
} : function(P) {
|
|
1838
|
-
return 0 <= s(P, v[
|
|
1835
|
+
return 0 <= s(P, v[g][1]);
|
|
1839
1836
|
}, w = h ? function(P) {
|
|
1840
|
-
return 0 < o(P, v[
|
|
1837
|
+
return 0 < o(P, v[g][0]);
|
|
1841
1838
|
} : function(P) {
|
|
1842
|
-
return 0 <= o(P, v[
|
|
1839
|
+
return 0 <= o(P, v[g][0]);
|
|
1843
1840
|
}, y = b, A = new this.Collection(this, function() {
|
|
1844
1841
|
return Te(v[0][0], v[v.length - 1][1], !h, !m);
|
|
1845
1842
|
});
|
|
1846
1843
|
return A._ondirectionchange = function(P) {
|
|
1847
1844
|
f = P === "next" ? (y = b, s) : (y = w, o), v.sort(S);
|
|
1848
|
-
}, A._addAlgorithm(function(P, D,
|
|
1849
|
-
for (var
|
|
1850
|
-
return !b(
|
|
1851
|
-
f === s ? P.continue(v[
|
|
1845
|
+
}, A._addAlgorithm(function(P, D, N) {
|
|
1846
|
+
for (var R, k = P.key; y(k); ) if (++g === v.length) return D(N), !1;
|
|
1847
|
+
return !b(R = k) && !w(R) || (r._cmp(k, v[g][1]) === 0 || r._cmp(k, v[g][0]) === 0 || D(function() {
|
|
1848
|
+
f === s ? P.continue(v[g][0]) : P.continue(v[g][1]);
|
|
1852
1849
|
}), !1);
|
|
1853
1850
|
}), A;
|
|
1854
|
-
},
|
|
1855
|
-
var e =
|
|
1851
|
+
}, re.prototype.startsWithAnyOf = function() {
|
|
1852
|
+
var e = Ee.apply(Qe, arguments);
|
|
1856
1853
|
return e.every(function(t) {
|
|
1857
1854
|
return typeof t == "string";
|
|
1858
|
-
}) ? e.length === 0 ?
|
|
1855
|
+
}) ? e.length === 0 ? rt(this) : this.inAnyRange(e.map(function(t) {
|
|
1859
1856
|
return [t, t + Fe];
|
|
1860
1857
|
})) : le(this, "startsWithAnyOf() only works with strings");
|
|
1861
|
-
},
|
|
1862
|
-
function
|
|
1858
|
+
}, re);
|
|
1859
|
+
function re() {
|
|
1863
1860
|
}
|
|
1864
1861
|
function me(e) {
|
|
1865
1862
|
return Z(function(t) {
|
|
1866
|
-
return
|
|
1863
|
+
return mt(t), e(t.target.error), !1;
|
|
1867
1864
|
});
|
|
1868
1865
|
}
|
|
1869
|
-
function
|
|
1866
|
+
function mt(e) {
|
|
1870
1867
|
e.stopPropagation && e.stopPropagation(), e.preventDefault && e.preventDefault();
|
|
1871
1868
|
}
|
|
1872
|
-
var
|
|
1873
|
-
return
|
|
1869
|
+
var yt = "storagemutated", wn = "x-storagemutated-1", Ie = ht(null, yt), ua = (ye.prototype._lock = function() {
|
|
1870
|
+
return it(!B.global), ++this._reculock, this._reculock !== 1 || B.global || (B.lockOwnerFor = this), this;
|
|
1874
1871
|
}, ye.prototype._unlock = function() {
|
|
1875
|
-
if (
|
|
1872
|
+
if (it(!B.global), --this._reculock == 0) for (B.global || (B.lockOwnerFor = null); 0 < this._blockedFuncs.length && !this._locked(); ) {
|
|
1876
1873
|
var e = this._blockedFuncs.shift();
|
|
1877
1874
|
try {
|
|
1878
|
-
|
|
1875
|
+
We(e[1], e[0]);
|
|
1879
1876
|
} catch {
|
|
1880
1877
|
}
|
|
1881
1878
|
}
|
|
1882
1879
|
return this;
|
|
1883
1880
|
}, ye.prototype._locked = function() {
|
|
1884
|
-
return this._reculock &&
|
|
1881
|
+
return this._reculock && B.lockOwnerFor !== this;
|
|
1885
1882
|
}, ye.prototype.create = function(e) {
|
|
1886
1883
|
var t = this;
|
|
1887
1884
|
if (!this.mode) return this;
|
|
1888
1885
|
var r = this.db.idbdb, a = this.db._state.dbOpenError;
|
|
1889
|
-
if (
|
|
1886
|
+
if (it(!this.idbtrans), !e && !r) switch (a && a.name) {
|
|
1890
1887
|
case "DatabaseClosedError":
|
|
1891
1888
|
throw new L.DatabaseClosed(a);
|
|
1892
1889
|
case "MissingAPIError":
|
|
@@ -1895,10 +1892,10 @@ function Ma() {
|
|
|
1895
1892
|
throw new L.OpenFailed(a);
|
|
1896
1893
|
}
|
|
1897
1894
|
if (!this.active) throw new L.TransactionInactive();
|
|
1898
|
-
return
|
|
1899
|
-
|
|
1895
|
+
return it(this._completion._state === null), (e = this.idbtrans = e || (this.db.core || r).transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability })).onerror = Z(function(s) {
|
|
1896
|
+
mt(s), t._reject(e.error);
|
|
1900
1897
|
}), e.onabort = Z(function(s) {
|
|
1901
|
-
|
|
1898
|
+
mt(s), t.active && t._reject(new L.Abort(e.error)), t.active = !1, t.on("abort").fire(s);
|
|
1902
1899
|
}), e.oncomplete = Z(function() {
|
|
1903
1900
|
t.active = !1, t._resolve(), "mutatedParts" in e && Ie.storagemutated.fire(e.mutatedParts);
|
|
1904
1901
|
}), this;
|
|
@@ -1909,7 +1906,7 @@ function Ma() {
|
|
|
1909
1906
|
if (this._locked()) return new j(function(o, u) {
|
|
1910
1907
|
a._blockedFuncs.push([function() {
|
|
1911
1908
|
a._promise(e, t, r).then(o, u);
|
|
1912
|
-
},
|
|
1909
|
+
}, B]);
|
|
1913
1910
|
});
|
|
1914
1911
|
if (r) return De(function() {
|
|
1915
1912
|
var o = new j(function(u, d) {
|
|
@@ -1950,20 +1947,20 @@ function Ma() {
|
|
|
1950
1947
|
this.active && (this.active = !1, this.idbtrans && this.idbtrans.abort(), this._reject(new L.Abort()));
|
|
1951
1948
|
}, ye.prototype.table = function(e) {
|
|
1952
1949
|
var t = this._memoizedTables || (this._memoizedTables = {});
|
|
1953
|
-
if (
|
|
1950
|
+
if (oe(t, e)) return t[e];
|
|
1954
1951
|
var r = this.schema[e];
|
|
1955
1952
|
if (!r) throw new L.NotFound("Table " + e + " not part of transaction");
|
|
1956
1953
|
return r = new this.db.Table(e, r, this), r.core = this.db.core.table(e), t[e] = r;
|
|
1957
1954
|
}, ye);
|
|
1958
1955
|
function ye() {
|
|
1959
1956
|
}
|
|
1960
|
-
function
|
|
1957
|
+
function Sn(e, t, r, a, s, o, u) {
|
|
1961
1958
|
return { name: e, keyPath: t, unique: r, multi: a, auto: s, compound: o, src: (r && !u ? "&" : "") + (a ? "*" : "") + (s ? "++" : "") + yr(t) };
|
|
1962
1959
|
}
|
|
1963
1960
|
function yr(e) {
|
|
1964
1961
|
return typeof e == "string" ? e : e ? "[" + [].join.call(e, "+") + "]" : "";
|
|
1965
1962
|
}
|
|
1966
|
-
function
|
|
1963
|
+
function On(e, t, r) {
|
|
1967
1964
|
return { name: e, primKey: t, indexes: r, mappedClass: null, idxByName: (a = function(s) {
|
|
1968
1965
|
return [s.name, s];
|
|
1969
1966
|
}, r.reduce(function(s, o, u) {
|
|
@@ -1971,25 +1968,25 @@ function Ma() {
|
|
|
1971
1968
|
}, {})) };
|
|
1972
1969
|
var a;
|
|
1973
1970
|
}
|
|
1974
|
-
var
|
|
1971
|
+
var bt = function(e) {
|
|
1975
1972
|
try {
|
|
1976
|
-
return e.only([[]]),
|
|
1973
|
+
return e.only([[]]), bt = function() {
|
|
1977
1974
|
return [[]];
|
|
1978
1975
|
}, [[]];
|
|
1979
1976
|
} catch {
|
|
1980
|
-
return
|
|
1977
|
+
return bt = function() {
|
|
1981
1978
|
return Fe;
|
|
1982
1979
|
}, Fe;
|
|
1983
1980
|
}
|
|
1984
1981
|
};
|
|
1985
|
-
function
|
|
1982
|
+
function _n(e) {
|
|
1986
1983
|
return e == null ? function() {
|
|
1987
1984
|
} : typeof e == "string" ? (t = e).split(".").length === 1 ? function(r) {
|
|
1988
1985
|
return r[t];
|
|
1989
1986
|
} : function(r) {
|
|
1990
|
-
return
|
|
1987
|
+
return ve(r, t);
|
|
1991
1988
|
} : function(r) {
|
|
1992
|
-
return
|
|
1989
|
+
return ve(r, e);
|
|
1993
1990
|
};
|
|
1994
1991
|
var t;
|
|
1995
1992
|
}
|
|
@@ -1997,149 +1994,149 @@ function Ma() {
|
|
|
1997
1994
|
return [].slice.call(e);
|
|
1998
1995
|
}
|
|
1999
1996
|
var la = 0;
|
|
2000
|
-
function
|
|
1997
|
+
function vt(e) {
|
|
2001
1998
|
return e == null ? ":id" : typeof e == "string" ? e : "[".concat(e.join("+"), "]");
|
|
2002
1999
|
}
|
|
2003
2000
|
function da(e, t, h) {
|
|
2004
2001
|
function a(y) {
|
|
2005
2002
|
if (y.type === 3) return null;
|
|
2006
2003
|
if (y.type === 4) throw new Error("Cannot convert never type to IDBKeyRange");
|
|
2007
|
-
var
|
|
2008
|
-
return
|
|
2004
|
+
var g = y.lower, b = y.upper, w = y.lowerOpen, y = y.upperOpen;
|
|
2005
|
+
return g === void 0 ? b === void 0 ? null : t.upperBound(b, !!y) : b === void 0 ? t.lowerBound(g, !!w) : t.bound(g, b, !!w, !!y);
|
|
2009
2006
|
}
|
|
2010
2007
|
function s(S) {
|
|
2011
|
-
var
|
|
2008
|
+
var g, b = S.name;
|
|
2012
2009
|
return { name: b, schema: S, mutate: function(w) {
|
|
2013
|
-
var y = w.trans, A = w.type, P = w.keys, D = w.values,
|
|
2014
|
-
return new Promise(function(
|
|
2015
|
-
|
|
2016
|
-
var T = y.objectStore(b),
|
|
2010
|
+
var y = w.trans, A = w.type, P = w.keys, D = w.values, N = w.range;
|
|
2011
|
+
return new Promise(function(R, k) {
|
|
2012
|
+
R = Z(R);
|
|
2013
|
+
var T = y.objectStore(b), I = T.keyPath == null, $ = A === "put" || A === "add";
|
|
2017
2014
|
if (!$ && A !== "delete" && A !== "deleteRange") throw new Error("Invalid operation type: " + A);
|
|
2018
|
-
var
|
|
2015
|
+
var x, M = (P || D || { length: 1 }).length;
|
|
2019
2016
|
if (P && D && P.length !== D.length) throw new Error("Given keys array must have same length as given values array.");
|
|
2020
|
-
if (M === 0) return
|
|
2021
|
-
function
|
|
2022
|
-
++de,
|
|
2017
|
+
if (M === 0) return R({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
|
|
2018
|
+
function F(ce) {
|
|
2019
|
+
++de, mt(ce);
|
|
2023
2020
|
}
|
|
2024
2021
|
var U = [], z = [], de = 0;
|
|
2025
2022
|
if (A === "deleteRange") {
|
|
2026
|
-
if (
|
|
2027
|
-
|
|
2023
|
+
if (N.type === 4) return R({ numFailures: de, failures: z, results: [], lastResult: void 0 });
|
|
2024
|
+
N.type === 3 ? U.push(x = T.clear()) : U.push(x = T.delete(a(N)));
|
|
2028
2025
|
} else {
|
|
2029
|
-
var
|
|
2030
|
-
if ($) for (var
|
|
2031
|
-
else for (
|
|
2026
|
+
var I = $ ? I ? [D, P] : [D, null] : [P, null], W = I[0], se = I[1];
|
|
2027
|
+
if ($) for (var ie = 0; ie < M; ++ie) U.push(x = se && se[ie] !== void 0 ? T[A](W[ie], se[ie]) : T[A](W[ie])), x.onerror = F;
|
|
2028
|
+
else for (ie = 0; ie < M; ++ie) U.push(x = T[A](W[ie])), x.onerror = F;
|
|
2032
2029
|
}
|
|
2033
|
-
function
|
|
2034
|
-
ce = ce.target.result, U.forEach(function(
|
|
2035
|
-
return
|
|
2036
|
-
}),
|
|
2037
|
-
return
|
|
2030
|
+
function Zt(ce) {
|
|
2031
|
+
ce = ce.target.result, U.forEach(function(Ve, Wn) {
|
|
2032
|
+
return Ve.error != null && (z[Wn] = Ve.error);
|
|
2033
|
+
}), R({ numFailures: de, failures: z, results: A === "delete" ? P : U.map(function(Ve) {
|
|
2034
|
+
return Ve.result;
|
|
2038
2035
|
}), lastResult: ce });
|
|
2039
2036
|
}
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
},
|
|
2037
|
+
x.onerror = function(ce) {
|
|
2038
|
+
F(ce), Zt(ce);
|
|
2039
|
+
}, x.onsuccess = Zt;
|
|
2043
2040
|
});
|
|
2044
2041
|
}, getMany: function(w) {
|
|
2045
2042
|
var y = w.trans, A = w.keys;
|
|
2046
2043
|
return new Promise(function(P, D) {
|
|
2047
2044
|
P = Z(P);
|
|
2048
|
-
for (var
|
|
2049
|
-
U = U.target, T[U._pos] = U.result, ++$ ===
|
|
2050
|
-
}, M = me(D),
|
|
2051
|
-
|
|
2045
|
+
for (var N, R = y.objectStore(b), k = A.length, T = new Array(k), I = 0, $ = 0, x = function(U) {
|
|
2046
|
+
U = U.target, T[U._pos] = U.result, ++$ === I && P(T);
|
|
2047
|
+
}, M = me(D), F = 0; F < k; ++F) A[F] != null && ((N = R.get(A[F]))._pos = F, N.onsuccess = x, N.onerror = M, ++I);
|
|
2048
|
+
I === 0 && P(T);
|
|
2052
2049
|
});
|
|
2053
2050
|
}, get: function(w) {
|
|
2054
2051
|
var y = w.trans, A = w.key;
|
|
2055
2052
|
return new Promise(function(P, D) {
|
|
2056
2053
|
P = Z(P);
|
|
2057
|
-
var
|
|
2058
|
-
|
|
2059
|
-
return P(
|
|
2060
|
-
},
|
|
2054
|
+
var N = y.objectStore(b).get(A);
|
|
2055
|
+
N.onsuccess = function(R) {
|
|
2056
|
+
return P(R.target.result);
|
|
2057
|
+
}, N.onerror = me(D);
|
|
2061
2058
|
});
|
|
2062
|
-
}, query: (
|
|
2059
|
+
}, query: (g = m, function(w) {
|
|
2063
2060
|
return new Promise(function(y, A) {
|
|
2064
2061
|
y = Z(y);
|
|
2065
|
-
var P, D,
|
|
2066
|
-
if (
|
|
2067
|
-
|
|
2062
|
+
var P, D, N, I = w.trans, R = w.values, k = w.limit, x = w.query, T = k === 1 / 0 ? void 0 : k, $ = x.index, x = x.range, I = I.objectStore(b), $ = $.isPrimaryKey ? I : I.index($.name), x = a(x);
|
|
2063
|
+
if (k === 0) return y({ result: [] });
|
|
2064
|
+
g ? ((T = R ? $.getAll(x, T) : $.getAllKeys(x, T)).onsuccess = function(M) {
|
|
2068
2065
|
return y({ result: M.target.result });
|
|
2069
|
-
}, T.onerror = me(A)) : (P = 0, D = !
|
|
2070
|
-
var
|
|
2071
|
-
return
|
|
2066
|
+
}, T.onerror = me(A)) : (P = 0, D = !R && "openKeyCursor" in $ ? $.openKeyCursor(x) : $.openCursor(x), N = [], D.onsuccess = function(M) {
|
|
2067
|
+
var F = D.result;
|
|
2068
|
+
return F ? (N.push(R ? F.value : F.primaryKey), ++P === k ? y({ result: N }) : void F.continue()) : y({ result: N });
|
|
2072
2069
|
}, D.onerror = me(A));
|
|
2073
2070
|
});
|
|
2074
2071
|
}), openCursor: function(w) {
|
|
2075
|
-
var y = w.trans, A = w.values, P = w.query, D = w.reverse,
|
|
2076
|
-
return new Promise(function(
|
|
2077
|
-
|
|
2078
|
-
var $ = P.index, T = P.range,
|
|
2079
|
-
|
|
2080
|
-
var
|
|
2081
|
-
|
|
2072
|
+
var y = w.trans, A = w.values, P = w.query, D = w.reverse, N = w.unique;
|
|
2073
|
+
return new Promise(function(R, k) {
|
|
2074
|
+
R = Z(R);
|
|
2075
|
+
var $ = P.index, T = P.range, I = y.objectStore(b), I = $.isPrimaryKey ? I : I.index($.name), $ = D ? N ? "prevunique" : "prev" : N ? "nextunique" : "next", x = !A && "openKeyCursor" in I ? I.openKeyCursor(a(T), $) : I.openCursor(a(T), $);
|
|
2076
|
+
x.onerror = me(k), x.onsuccess = Z(function(M) {
|
|
2077
|
+
var F, U, z, de, W = x.result;
|
|
2078
|
+
W ? (W.___id = ++la, W.done = !1, F = W.continue.bind(W), U = (U = W.continuePrimaryKey) && U.bind(W), z = W.advance.bind(W), de = function() {
|
|
2082
2079
|
throw new Error("Cursor not stopped");
|
|
2083
|
-
},
|
|
2080
|
+
}, W.trans = y, W.stop = W.continue = W.continuePrimaryKey = W.advance = function() {
|
|
2084
2081
|
throw new Error("Cursor not started");
|
|
2085
|
-
},
|
|
2086
|
-
var
|
|
2082
|
+
}, W.fail = Z(k), W.next = function() {
|
|
2083
|
+
var se = this, ie = 1;
|
|
2087
2084
|
return this.start(function() {
|
|
2088
|
-
return
|
|
2085
|
+
return ie-- ? se.continue() : se.stop();
|
|
2089
2086
|
}).then(function() {
|
|
2090
|
-
return
|
|
2087
|
+
return se;
|
|
2091
2088
|
});
|
|
2092
|
-
},
|
|
2093
|
-
function
|
|
2094
|
-
if (
|
|
2095
|
-
|
|
2089
|
+
}, W.start = function(se) {
|
|
2090
|
+
function ie() {
|
|
2091
|
+
if (x.result) try {
|
|
2092
|
+
se();
|
|
2096
2093
|
} catch (ce) {
|
|
2097
|
-
|
|
2094
|
+
W.fail(ce);
|
|
2098
2095
|
}
|
|
2099
|
-
else
|
|
2096
|
+
else W.done = !0, W.start = function() {
|
|
2100
2097
|
throw new Error("Cursor behind last entry");
|
|
2101
|
-
},
|
|
2098
|
+
}, W.stop();
|
|
2102
2099
|
}
|
|
2103
|
-
var
|
|
2104
|
-
ce = Z(ce),
|
|
2105
|
-
|
|
2100
|
+
var Zt = new Promise(function(ce, Ve) {
|
|
2101
|
+
ce = Z(ce), x.onerror = me(Ve), W.fail = Ve, W.stop = function(Wn) {
|
|
2102
|
+
W.stop = W.continue = W.continuePrimaryKey = W.advance = de, ce(Wn);
|
|
2106
2103
|
};
|
|
2107
2104
|
});
|
|
2108
|
-
return
|
|
2109
|
-
|
|
2110
|
-
}),
|
|
2111
|
-
},
|
|
2112
|
-
},
|
|
2105
|
+
return x.onsuccess = Z(function(ce) {
|
|
2106
|
+
x.onsuccess = ie, ie();
|
|
2107
|
+
}), W.continue = F, W.continuePrimaryKey = U, W.advance = z, ie(), Zt;
|
|
2108
|
+
}, R(W)) : R(null);
|
|
2109
|
+
}, k);
|
|
2113
2110
|
});
|
|
2114
2111
|
}, count: function(w) {
|
|
2115
2112
|
var y = w.query, A = w.trans, P = y.index, D = y.range;
|
|
2116
|
-
return new Promise(function(
|
|
2117
|
-
var
|
|
2118
|
-
T.onsuccess = Z(function(
|
|
2119
|
-
return
|
|
2120
|
-
}), T.onerror = me(
|
|
2113
|
+
return new Promise(function(N, R) {
|
|
2114
|
+
var k = A.objectStore(b), T = P.isPrimaryKey ? k : k.index(P.name), k = a(D), T = k ? T.count(k) : T.count();
|
|
2115
|
+
T.onsuccess = Z(function(I) {
|
|
2116
|
+
return N(I.target.result);
|
|
2117
|
+
}), T.onerror = me(R);
|
|
2121
2118
|
});
|
|
2122
2119
|
} };
|
|
2123
2120
|
}
|
|
2124
2121
|
var o, u, d, v = (u = h, d = br((o = e).objectStoreNames), { schema: { name: o.name, tables: d.map(function(S) {
|
|
2125
2122
|
return u.objectStore(S);
|
|
2126
2123
|
}).map(function(S) {
|
|
2127
|
-
var
|
|
2124
|
+
var g = S.keyPath, y = S.autoIncrement, b = G(g), w = {}, y = { name: S.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: g == null, compound: b, keyPath: g, autoIncrement: y, unique: !0, extractKey: _n(g) }, indexes: br(S.indexNames).map(function(A) {
|
|
2128
2125
|
return S.index(A);
|
|
2129
|
-
}).map(function(
|
|
2130
|
-
var P =
|
|
2131
|
-
return w[
|
|
2126
|
+
}).map(function(N) {
|
|
2127
|
+
var P = N.name, D = N.unique, R = N.multiEntry, N = N.keyPath, R = { name: P, compound: G(N), keyPath: N, unique: D, multiEntry: R, extractKey: _n(N) };
|
|
2128
|
+
return w[vt(N)] = R;
|
|
2132
2129
|
}), getIndexByKeyPath: function(A) {
|
|
2133
|
-
return w[
|
|
2130
|
+
return w[vt(A)];
|
|
2134
2131
|
} };
|
|
2135
|
-
return w[":id"] = y.primaryKey,
|
|
2132
|
+
return w[":id"] = y.primaryKey, g != null && (w[vt(g)] = y.primaryKey), y;
|
|
2136
2133
|
}) }, hasGetAll: 0 < d.length && "getAll" in u.objectStore(d[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }), h = v.schema, m = v.hasGetAll, v = h.tables.map(s), f = {};
|
|
2137
2134
|
return v.forEach(function(S) {
|
|
2138
2135
|
return f[S.name] = S;
|
|
2139
2136
|
}), { stack: "dbcore", transaction: e.transaction.bind(e), table: function(S) {
|
|
2140
2137
|
if (!f[S]) throw new Error("Table '".concat(S, "' not found"));
|
|
2141
2138
|
return f[S];
|
|
2142
|
-
}, MIN_KEY: -1 / 0, MAX_KEY:
|
|
2139
|
+
}, MIN_KEY: -1 / 0, MAX_KEY: bt(t), schema: h };
|
|
2143
2140
|
}
|
|
2144
2141
|
function fa(e, t, r, a) {
|
|
2145
2142
|
var s = r.IDBKeyRange;
|
|
@@ -2156,22 +2153,22 @@ function Ma() {
|
|
|
2156
2153
|
}) && (s.core = e.core.table(o), e[o] instanceof e.Table && (e[o].core = s.core));
|
|
2157
2154
|
});
|
|
2158
2155
|
}
|
|
2159
|
-
function
|
|
2156
|
+
function Lt(e, t, r, a) {
|
|
2160
2157
|
r.forEach(function(s) {
|
|
2161
2158
|
var o = a[s];
|
|
2162
2159
|
t.forEach(function(u) {
|
|
2163
2160
|
var d = function h(m, v) {
|
|
2164
|
-
return
|
|
2161
|
+
return Fr(m, v) || (m = ge(m)) && h(m, v);
|
|
2165
2162
|
}(u, s);
|
|
2166
2163
|
(!d || "value" in d && d.value === void 0) && (u === e.Transaction.prototype || u instanceof e.Transaction ? Ae(u, s, { get: function() {
|
|
2167
2164
|
return this.table(s);
|
|
2168
2165
|
}, set: function(h) {
|
|
2169
|
-
|
|
2166
|
+
Ot(this, s, { value: h, writable: !0, configurable: !0, enumerable: !0 });
|
|
2170
2167
|
} }) : u[s] = new e.Table(s, o));
|
|
2171
2168
|
});
|
|
2172
2169
|
});
|
|
2173
2170
|
}
|
|
2174
|
-
function
|
|
2171
|
+
function An(e, t) {
|
|
2175
2172
|
t.forEach(function(r) {
|
|
2176
2173
|
for (var a in r) r[a] instanceof e.Table && delete r[a];
|
|
2177
2174
|
});
|
|
@@ -2179,91 +2176,91 @@ function Ma() {
|
|
|
2179
2176
|
function ha(e, t) {
|
|
2180
2177
|
return e._cfg.version - t._cfg.version;
|
|
2181
2178
|
}
|
|
2182
|
-
function
|
|
2179
|
+
function ga(e, t, r, a) {
|
|
2183
2180
|
var s = e._dbSchema;
|
|
2184
|
-
r.objectStoreNames.contains("$meta") && !s.$meta && (s.$meta =
|
|
2181
|
+
r.objectStoreNames.contains("$meta") && !s.$meta && (s.$meta = On("$meta", Er("")[0], []), e._storeNames.push("$meta"));
|
|
2185
2182
|
var o = e._createTransaction("readwrite", e._storeNames, s);
|
|
2186
2183
|
o.create(r), o._completion.catch(a);
|
|
2187
|
-
var u = o._reject.bind(o), d =
|
|
2184
|
+
var u = o._reject.bind(o), d = B.transless || B;
|
|
2188
2185
|
De(function() {
|
|
2189
|
-
return
|
|
2186
|
+
return B.trans = o, B.transless = d, t !== 0 ? (Bt(e, r), m = t, ((h = o).storeNames.includes("$meta") ? h.table("$meta").get("version").then(function(v) {
|
|
2190
2187
|
return v ?? m;
|
|
2191
2188
|
}) : j.resolve(m)).then(function(v) {
|
|
2192
|
-
return S = v,
|
|
2189
|
+
return S = v, g = o, b = r, w = [], v = (f = e)._versions, y = f._dbSchema = Ft(0, f.idbdb, b), (v = v.filter(function(A) {
|
|
2193
2190
|
return A._cfg.version >= S;
|
|
2194
2191
|
})).length !== 0 ? (v.forEach(function(A) {
|
|
2195
2192
|
w.push(function() {
|
|
2196
2193
|
var P = y, D = A._cfg.dbschema;
|
|
2197
|
-
|
|
2198
|
-
var
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
}),
|
|
2194
|
+
Ut(f, P, b), Ut(f, D, b), y = f._dbSchema = D;
|
|
2195
|
+
var N = Pn(P, D);
|
|
2196
|
+
N.add.forEach(function($) {
|
|
2197
|
+
Dn(b, $[0], $[1].primKey, $[1].indexes);
|
|
2198
|
+
}), N.change.forEach(function($) {
|
|
2202
2199
|
if ($.recreate) throw new L.Upgrade("Not yet support for changing primary key");
|
|
2203
|
-
var
|
|
2200
|
+
var x = b.objectStore($.name);
|
|
2204
2201
|
$.add.forEach(function(M) {
|
|
2205
|
-
return
|
|
2202
|
+
return Wt(x, M);
|
|
2206
2203
|
}), $.change.forEach(function(M) {
|
|
2207
|
-
|
|
2204
|
+
x.deleteIndex(M.name), Wt(x, M);
|
|
2208
2205
|
}), $.del.forEach(function(M) {
|
|
2209
|
-
return
|
|
2206
|
+
return x.deleteIndex(M);
|
|
2210
2207
|
});
|
|
2211
2208
|
});
|
|
2212
|
-
var
|
|
2213
|
-
if (
|
|
2214
|
-
Bt(f, b),
|
|
2215
|
-
var
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
}),
|
|
2219
|
-
var T,
|
|
2220
|
-
return
|
|
2209
|
+
var R = A._cfg.contentUpgrade;
|
|
2210
|
+
if (R && A._cfg.version > S) {
|
|
2211
|
+
Bt(f, b), g._memoizedTables = {};
|
|
2212
|
+
var k = Qn(D);
|
|
2213
|
+
N.del.forEach(function($) {
|
|
2214
|
+
k[$] = P[$];
|
|
2215
|
+
}), An(f, [f.Transaction.prototype]), Lt(f, [f.Transaction.prototype], C(k), k), g.schema = k;
|
|
2216
|
+
var T, I = an(R);
|
|
2217
|
+
return I && et(), N = j.follow(function() {
|
|
2221
2218
|
var $;
|
|
2222
|
-
(T =
|
|
2223
|
-
}), T && typeof T.then == "function" ? j.resolve(T) :
|
|
2219
|
+
(T = R(g)) && I && ($ = Ne.bind(null, null), T.then($, $));
|
|
2220
|
+
}), T && typeof T.then == "function" ? j.resolve(T) : N.then(function() {
|
|
2224
2221
|
return T;
|
|
2225
2222
|
});
|
|
2226
2223
|
}
|
|
2227
2224
|
}), w.push(function(P) {
|
|
2228
|
-
var D,
|
|
2229
|
-
D =
|
|
2230
|
-
return D[
|
|
2231
|
-
}),
|
|
2225
|
+
var D, N, R = A._cfg.dbschema;
|
|
2226
|
+
D = R, N = P, [].slice.call(N.db.objectStoreNames).forEach(function(k) {
|
|
2227
|
+
return D[k] == null && N.db.deleteObjectStore(k);
|
|
2228
|
+
}), An(f, [f.Transaction.prototype]), Lt(f, [f.Transaction.prototype], f._storeNames, f._dbSchema), g.schema = f._dbSchema;
|
|
2232
2229
|
}), w.push(function(P) {
|
|
2233
2230
|
f.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(f.idbdb.version / 10) === A._cfg.version ? (f.idbdb.deleteObjectStore("$meta"), delete f._dbSchema.$meta, f._storeNames = f._storeNames.filter(function(D) {
|
|
2234
2231
|
return D !== "$meta";
|
|
2235
2232
|
})) : P.objectStore("$meta").put(A._cfg.version, "version"));
|
|
2236
2233
|
});
|
|
2237
2234
|
}), function A() {
|
|
2238
|
-
return w.length ? j.resolve(w.shift()(
|
|
2235
|
+
return w.length ? j.resolve(w.shift()(g.idbtrans)).then(A) : j.resolve();
|
|
2239
2236
|
}().then(function() {
|
|
2240
2237
|
vr(y, b);
|
|
2241
2238
|
})) : j.resolve();
|
|
2242
|
-
var f, S,
|
|
2243
|
-
}).catch(u)) : (
|
|
2244
|
-
|
|
2239
|
+
var f, S, g, b, w, y;
|
|
2240
|
+
}).catch(u)) : (C(s).forEach(function(v) {
|
|
2241
|
+
Dn(r, v, s[v].primKey, s[v].indexes);
|
|
2245
2242
|
}), Bt(e, r), void j.follow(function() {
|
|
2246
2243
|
return e.on.populate.fire(o);
|
|
2247
2244
|
}).catch(u));
|
|
2248
2245
|
var h, m;
|
|
2249
2246
|
});
|
|
2250
2247
|
}
|
|
2251
|
-
function
|
|
2248
|
+
function pa(e, t) {
|
|
2252
2249
|
vr(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");
|
|
2253
2250
|
var r = Ft(0, e.idbdb, t);
|
|
2254
|
-
|
|
2255
|
-
for (var a = 0, s =
|
|
2251
|
+
Ut(e, e._dbSchema, t);
|
|
2252
|
+
for (var a = 0, s = Pn(r, e._dbSchema).change; a < s.length; a++) {
|
|
2256
2253
|
var o = function(u) {
|
|
2257
2254
|
if (u.change.length || u.recreate) return console.warn("Unable to patch indexes of table ".concat(u.name, " because it has changes on the type of index or primary key.")), { value: void 0 };
|
|
2258
2255
|
var d = t.objectStore(u.name);
|
|
2259
2256
|
u.add.forEach(function(h) {
|
|
2260
|
-
|
|
2257
|
+
pe && console.debug("Dexie upgrade patch: Creating missing index ".concat(u.name, ".").concat(h.src)), Wt(d, h);
|
|
2261
2258
|
});
|
|
2262
2259
|
}(s[a]);
|
|
2263
2260
|
if (typeof o == "object") return o.value;
|
|
2264
2261
|
}
|
|
2265
2262
|
}
|
|
2266
|
-
function
|
|
2263
|
+
function Pn(e, t) {
|
|
2267
2264
|
var r, a = { del: [], add: [], change: [] };
|
|
2268
2265
|
for (r in e) t[r] || a.del.push(r);
|
|
2269
2266
|
for (r in t) {
|
|
@@ -2284,36 +2281,36 @@ function Ma() {
|
|
|
2284
2281
|
}
|
|
2285
2282
|
return a;
|
|
2286
2283
|
}
|
|
2287
|
-
function
|
|
2284
|
+
function Dn(e, t, r, a) {
|
|
2288
2285
|
var s = e.db.createObjectStore(t, r.keyPath ? { keyPath: r.keyPath, autoIncrement: r.auto } : { autoIncrement: r.auto });
|
|
2289
2286
|
return a.forEach(function(o) {
|
|
2290
|
-
return
|
|
2287
|
+
return Wt(s, o);
|
|
2291
2288
|
}), s;
|
|
2292
2289
|
}
|
|
2293
2290
|
function vr(e, t) {
|
|
2294
|
-
|
|
2295
|
-
t.db.objectStoreNames.contains(r) || (
|
|
2291
|
+
C(e).forEach(function(r) {
|
|
2292
|
+
t.db.objectStoreNames.contains(r) || (pe && console.debug("Dexie: Creating missing table", r), Dn(t, r, e[r].primKey, e[r].indexes));
|
|
2296
2293
|
});
|
|
2297
2294
|
}
|
|
2298
|
-
function
|
|
2295
|
+
function Wt(e, t) {
|
|
2299
2296
|
e.createIndex(t.name, t.keyPath, { unique: t.unique, multiEntry: t.multi });
|
|
2300
2297
|
}
|
|
2301
2298
|
function Ft(e, t, r) {
|
|
2302
2299
|
var a = {};
|
|
2303
|
-
return
|
|
2304
|
-
for (var o = r.objectStore(s), u =
|
|
2305
|
-
var v = o.index(o.indexNames[h]), m = v.keyPath, v =
|
|
2300
|
+
return _t(t.objectStoreNames, 0).forEach(function(s) {
|
|
2301
|
+
for (var o = r.objectStore(s), u = Sn(yr(m = o.keyPath), m || "", !0, !1, !!o.autoIncrement, m && typeof m != "string", !0), d = [], h = 0; h < o.indexNames.length; ++h) {
|
|
2302
|
+
var v = o.index(o.indexNames[h]), m = v.keyPath, v = Sn(v.name, m, !!v.unique, !!v.multiEntry, !1, m && typeof m != "string", !1);
|
|
2306
2303
|
d.push(v);
|
|
2307
2304
|
}
|
|
2308
|
-
a[s] =
|
|
2305
|
+
a[s] = On(s, u, d);
|
|
2309
2306
|
}), a;
|
|
2310
2307
|
}
|
|
2311
|
-
function
|
|
2308
|
+
function Ut(e, t, r) {
|
|
2312
2309
|
for (var a = r.db.objectStoreNames, s = 0; s < a.length; ++s) {
|
|
2313
2310
|
var o = a[s], u = r.objectStore(o);
|
|
2314
2311
|
e._hasGetAll = "getAll" in u;
|
|
2315
2312
|
for (var d = 0; d < u.indexNames.length; ++d) {
|
|
2316
|
-
var h = u.indexNames[d], m = u.index(h).keyPath, v = typeof m == "string" ? m : "[" +
|
|
2313
|
+
var h = u.indexNames[d], m = u.index(h).keyPath, v = typeof m == "string" ? m : "[" + _t(m).join("+") + "]";
|
|
2317
2314
|
!t[o] || (m = t[o].idxByName[v]) && (m.name = h, delete t[o].idxByName[v], t[o].idxByName[h] = m);
|
|
2318
2315
|
}
|
|
2319
2316
|
}
|
|
@@ -2322,82 +2319,82 @@ function Ma() {
|
|
|
2322
2319
|
function Er(e) {
|
|
2323
2320
|
return e.split(",").map(function(t, r) {
|
|
2324
2321
|
var a = (t = t.trim()).replace(/([&*]|\+\+)/g, ""), s = /^\[/.test(a) ? a.match(/^\[(.*)\]$/)[1].split("+") : a;
|
|
2325
|
-
return
|
|
2322
|
+
return Sn(a, s || null, /\&/.test(t), /\*/.test(t), /\+\+/.test(t), G(s), r === 0);
|
|
2326
2323
|
});
|
|
2327
2324
|
}
|
|
2328
|
-
var ma = (
|
|
2329
|
-
|
|
2325
|
+
var ma = (zt.prototype._parseStoresSpec = function(e, t) {
|
|
2326
|
+
C(e).forEach(function(r) {
|
|
2330
2327
|
if (e[r] !== null) {
|
|
2331
2328
|
var a = Er(e[r]), s = a.shift();
|
|
2332
2329
|
if (s.unique = !0, s.multi) throw new L.Schema("Primary key cannot be multi-valued");
|
|
2333
2330
|
a.forEach(function(o) {
|
|
2334
2331
|
if (o.auto) throw new L.Schema("Only primary key can be marked as autoIncrement (++)");
|
|
2335
2332
|
if (!o.keyPath) throw new L.Schema("Index must have a name and cannot be an empty string");
|
|
2336
|
-
}), t[r] =
|
|
2333
|
+
}), t[r] = On(r, s, a);
|
|
2337
2334
|
}
|
|
2338
2335
|
});
|
|
2339
|
-
},
|
|
2336
|
+
}, zt.prototype.stores = function(r) {
|
|
2340
2337
|
var t = this.db;
|
|
2341
|
-
this._cfg.storesSource = this._cfg.storesSource ?
|
|
2338
|
+
this._cfg.storesSource = this._cfg.storesSource ? te(this._cfg.storesSource, r) : r;
|
|
2342
2339
|
var r = t._versions, a = {}, s = {};
|
|
2343
2340
|
return r.forEach(function(o) {
|
|
2344
|
-
|
|
2345
|
-
}), t._dbSchema = s,
|
|
2346
|
-
},
|
|
2347
|
-
return this._cfg.contentUpgrade =
|
|
2348
|
-
},
|
|
2349
|
-
function
|
|
2350
|
-
}
|
|
2351
|
-
function
|
|
2341
|
+
te(a, o._cfg.storesSource), s = o._cfg.dbschema = {}, o._parseStoresSpec(a, s);
|
|
2342
|
+
}), t._dbSchema = s, An(t, [t._allTables, t, t.Transaction.prototype]), Lt(t, [t._allTables, t, t.Transaction.prototype, this._cfg.tables], C(s), s), t._storeNames = C(s), this;
|
|
2343
|
+
}, zt.prototype.upgrade = function(e) {
|
|
2344
|
+
return this._cfg.contentUpgrade = on(this._cfg.contentUpgrade || Q, e), this;
|
|
2345
|
+
}, zt);
|
|
2346
|
+
function zt() {
|
|
2347
|
+
}
|
|
2348
|
+
function Nn(e, t) {
|
|
2352
2349
|
var r = e._dbNamesDB;
|
|
2353
|
-
return r || (r = e._dbNamesDB = new
|
|
2350
|
+
return r || (r = e._dbNamesDB = new Se($t, { addons: [], indexedDB: e, IDBKeyRange: t })).version(1).stores({ dbnames: "name" }), r.table("dbnames");
|
|
2354
2351
|
}
|
|
2355
2352
|
function Rn(e) {
|
|
2356
2353
|
return e && typeof e.databases == "function";
|
|
2357
2354
|
}
|
|
2358
|
-
function
|
|
2355
|
+
function Tn(e) {
|
|
2359
2356
|
return De(function() {
|
|
2360
|
-
return
|
|
2357
|
+
return B.letThrough = !0, e();
|
|
2361
2358
|
});
|
|
2362
2359
|
}
|
|
2363
|
-
function
|
|
2360
|
+
function In(e) {
|
|
2364
2361
|
return !("from" in e);
|
|
2365
2362
|
}
|
|
2366
|
-
var
|
|
2363
|
+
var ae = function(e, t) {
|
|
2367
2364
|
if (!this) {
|
|
2368
|
-
var r = new
|
|
2369
|
-
return e && "d" in e &&
|
|
2365
|
+
var r = new ae();
|
|
2366
|
+
return e && "d" in e && te(r, e), r;
|
|
2370
2367
|
}
|
|
2371
|
-
|
|
2368
|
+
te(this, arguments.length ? { d: 1, from: e, to: 1 < arguments.length ? t : e } : { d: 0 });
|
|
2372
2369
|
};
|
|
2373
|
-
function
|
|
2370
|
+
function Et(e, t, r) {
|
|
2374
2371
|
var a = H(t, r);
|
|
2375
2372
|
if (!isNaN(a)) {
|
|
2376
2373
|
if (0 < a) throw RangeError();
|
|
2377
|
-
if (
|
|
2374
|
+
if (In(e)) return te(e, { from: t, to: r, d: 1 });
|
|
2378
2375
|
var s = e.l, a = e.r;
|
|
2379
|
-
if (H(r, e.from) < 0) return s ?
|
|
2380
|
-
if (0 < H(t, e.to)) return a ?
|
|
2381
|
-
H(t, e.from) < 0 && (e.from = t, e.l = null, e.d = a ? a.d + 1 : 1), 0 < H(r, e.to) && (e.to = r, e.r = null, e.d = e.l ? e.l.d + 1 : 1), r = !e.r, s && !e.l &&
|
|
2376
|
+
if (H(r, e.from) < 0) return s ? Et(s, t, r) : e.l = { from: t, to: r, d: 1, l: null, r: null }, Sr(e);
|
|
2377
|
+
if (0 < H(t, e.to)) return a ? Et(a, t, r) : e.r = { from: t, to: r, d: 1, l: null, r: null }, Sr(e);
|
|
2378
|
+
H(t, e.from) < 0 && (e.from = t, e.l = null, e.d = a ? a.d + 1 : 1), 0 < H(r, e.to) && (e.to = r, e.r = null, e.d = e.l ? e.l.d + 1 : 1), r = !e.r, s && !e.l && wt(e, s), a && r && wt(e, a);
|
|
2382
2379
|
}
|
|
2383
2380
|
}
|
|
2384
|
-
function
|
|
2385
|
-
|
|
2381
|
+
function wt(e, t) {
|
|
2382
|
+
In(t) || function r(a, h) {
|
|
2386
2383
|
var o = h.from, u = h.to, d = h.l, h = h.r;
|
|
2387
|
-
|
|
2384
|
+
Et(a, o, u), d && r(a, d), h && r(a, h);
|
|
2388
2385
|
}(e, t);
|
|
2389
2386
|
}
|
|
2390
2387
|
function wr(e, t) {
|
|
2391
|
-
var r =
|
|
2388
|
+
var r = Ht(t), a = r.next();
|
|
2392
2389
|
if (a.done) return !1;
|
|
2393
|
-
for (var s = a.value, o =
|
|
2390
|
+
for (var s = a.value, o = Ht(e), u = o.next(s.from), d = u.value; !a.done && !u.done; ) {
|
|
2394
2391
|
if (H(d.from, s.to) <= 0 && 0 <= H(d.to, s.from)) return !0;
|
|
2395
2392
|
H(s.from, d.from) < 0 ? s = (a = r.next(d.from)).value : d = (u = o.next(s.from)).value;
|
|
2396
2393
|
}
|
|
2397
2394
|
return !1;
|
|
2398
2395
|
}
|
|
2399
|
-
function
|
|
2400
|
-
var t =
|
|
2396
|
+
function Ht(e) {
|
|
2397
|
+
var t = In(e) ? null : { s: 0, n: e };
|
|
2401
2398
|
return { next: function(r) {
|
|
2402
2399
|
for (var a = 0 < arguments.length; t; ) switch (t.s) {
|
|
2403
2400
|
case 0:
|
|
@@ -2424,48 +2421,48 @@ function Ma() {
|
|
|
2424
2421
|
var t = r.r, r = r.l;
|
|
2425
2422
|
return (t ? r ? Math.max(t.d, r.d) : t.d : r ? r.d : 0) + 1;
|
|
2426
2423
|
}
|
|
2427
|
-
function
|
|
2428
|
-
return
|
|
2429
|
-
e[r] ?
|
|
2424
|
+
function Vt(e, t) {
|
|
2425
|
+
return C(t).forEach(function(r) {
|
|
2426
|
+
e[r] ? wt(e[r], t[r]) : e[r] = function a(s) {
|
|
2430
2427
|
var o, u, d = {};
|
|
2431
|
-
for (o in s)
|
|
2428
|
+
for (o in s) oe(s, o) && (u = s[o], d[o] = !u || typeof u != "object" || Jn.has(u.constructor) ? u : a(u));
|
|
2432
2429
|
return d;
|
|
2433
2430
|
}(t[r]);
|
|
2434
2431
|
}), e;
|
|
2435
2432
|
}
|
|
2436
|
-
function
|
|
2433
|
+
function xn(e, t) {
|
|
2437
2434
|
return e.all || t.all || Object.keys(e).some(function(r) {
|
|
2438
2435
|
return t[r] && wr(t[r], e[r]);
|
|
2439
2436
|
});
|
|
2440
2437
|
}
|
|
2441
|
-
|
|
2442
|
-
return
|
|
2438
|
+
be(ae.prototype, ((fe = { add: function(e) {
|
|
2439
|
+
return wt(this, e), this;
|
|
2443
2440
|
}, addKey: function(e) {
|
|
2444
|
-
return
|
|
2441
|
+
return Et(this, e, e), this;
|
|
2445
2442
|
}, addKeys: function(e) {
|
|
2446
2443
|
var t = this;
|
|
2447
2444
|
return e.forEach(function(r) {
|
|
2448
|
-
return
|
|
2445
|
+
return Et(t, r, r);
|
|
2449
2446
|
}), this;
|
|
2450
2447
|
}, hasKey: function(e) {
|
|
2451
|
-
var t =
|
|
2448
|
+
var t = Ht(this).next(e).value;
|
|
2452
2449
|
return t && H(t.from, e) <= 0 && 0 <= H(t.to, e);
|
|
2453
|
-
} })[
|
|
2454
|
-
return
|
|
2455
|
-
},
|
|
2456
|
-
var
|
|
2457
|
-
function
|
|
2458
|
-
|
|
2459
|
-
|
|
2450
|
+
} })[rn] = function() {
|
|
2451
|
+
return Ht(this);
|
|
2452
|
+
}, fe));
|
|
2453
|
+
var ze = {}, kn = {}, Cn = !1;
|
|
2454
|
+
function Yt(e) {
|
|
2455
|
+
Vt(kn, e), Cn || (Cn = !0, setTimeout(function() {
|
|
2456
|
+
Cn = !1, $n(kn, !(kn = {}));
|
|
2460
2457
|
}, 0));
|
|
2461
2458
|
}
|
|
2462
|
-
function
|
|
2459
|
+
function $n(e, t) {
|
|
2463
2460
|
t === void 0 && (t = !1);
|
|
2464
2461
|
var r = /* @__PURE__ */ new Set();
|
|
2465
|
-
if (e.all) for (var a = 0, s = Object.values(
|
|
2462
|
+
if (e.all) for (var a = 0, s = Object.values(ze); a < s.length; a++) _r(u = s[a], e, r, t);
|
|
2466
2463
|
else for (var o in e) {
|
|
2467
2464
|
var u, d = /^idb\:\/\/(.*)\/(.*)\//.exec(o);
|
|
2468
|
-
d && (o = d[1], d = d[2], (u =
|
|
2465
|
+
d && (o = d[1], d = d[2], (u = ze["idb://".concat(o, "/").concat(d)]) && _r(u, e, r, t));
|
|
2469
2466
|
}
|
|
2470
2467
|
r.forEach(function(h) {
|
|
2471
2468
|
return h();
|
|
@@ -2475,14 +2472,14 @@ function Ma() {
|
|
|
2475
2472
|
for (var s = [], o = 0, u = Object.entries(e.queries.query); o < u.length; o++) {
|
|
2476
2473
|
for (var d = u[o], h = d[0], m = [], v = 0, f = d[1]; v < f.length; v++) {
|
|
2477
2474
|
var S = f[v];
|
|
2478
|
-
|
|
2475
|
+
xn(t, S.obsSet) ? S.subscribers.forEach(function(y) {
|
|
2479
2476
|
return r.add(y);
|
|
2480
2477
|
}) : a && m.push(S);
|
|
2481
2478
|
}
|
|
2482
2479
|
a && s.push([h, m]);
|
|
2483
2480
|
}
|
|
2484
|
-
if (a) for (var
|
|
2485
|
-
var w = b[
|
|
2481
|
+
if (a) for (var g = 0, b = s; g < b.length; g++) {
|
|
2482
|
+
var w = b[g], h = w[0], m = w[1];
|
|
2486
2483
|
e.queries.query[h] = m;
|
|
2487
2484
|
}
|
|
2488
2485
|
}
|
|
@@ -2497,33 +2494,33 @@ function Ma() {
|
|
|
2497
2494
|
if (t.openCanceller !== a) throw new L.DatabaseClosed("db.open() was cancelled");
|
|
2498
2495
|
}
|
|
2499
2496
|
function d() {
|
|
2500
|
-
return new j(function(S,
|
|
2497
|
+
return new j(function(S, g) {
|
|
2501
2498
|
if (u(), !r) throw new L.MissingAPI();
|
|
2502
2499
|
var b = e.name, w = t.autoSchema || !s ? r.open(b) : r.open(b, s);
|
|
2503
2500
|
if (!w) throw new L.MissingAPI();
|
|
2504
|
-
w.onerror = me(
|
|
2501
|
+
w.onerror = me(g), w.onblocked = Z(e._fireOnBlocked), w.onupgradeneeded = Z(function(y) {
|
|
2505
2502
|
var A;
|
|
2506
|
-
v = w.transaction, t.autoSchema && !e._options.allowEmptyDB ? (w.onerror =
|
|
2507
|
-
|
|
2508
|
-
})) : (v.onerror = me(
|
|
2509
|
-
},
|
|
2503
|
+
v = w.transaction, t.autoSchema && !e._options.allowEmptyDB ? (w.onerror = mt, v.abort(), w.result.close(), (A = r.deleteDatabase(b)).onsuccess = A.onerror = Z(function() {
|
|
2504
|
+
g(new L.NoSuchDatabase("Database ".concat(b, " doesnt exist")));
|
|
2505
|
+
})) : (v.onerror = me(g), y = y.oldVersion > Math.pow(2, 62) ? 0 : y.oldVersion, f = y < 1, e.idbdb = w.result, o && pa(e, v), ga(e, y / 10, v, g));
|
|
2506
|
+
}, g), w.onsuccess = Z(function() {
|
|
2510
2507
|
v = null;
|
|
2511
|
-
var y, A, P, D,
|
|
2512
|
-
if (0 <
|
|
2513
|
-
var T =
|
|
2514
|
-
if (t.autoSchema) A =
|
|
2515
|
-
else if (
|
|
2516
|
-
return
|
|
2517
|
-
})) && !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."),
|
|
2508
|
+
var y, A, P, D, N, R = e.idbdb = w.result, k = _t(R.objectStoreNames);
|
|
2509
|
+
if (0 < k.length) try {
|
|
2510
|
+
var T = R.transaction((D = k).length === 1 ? D[0] : D, "readonly");
|
|
2511
|
+
if (t.autoSchema) A = R, P = T, (y = e).verno = A.version / 10, P = y._dbSchema = Ft(0, A, P), y._storeNames = _t(A.objectStoreNames, 0), Lt(y, [y._allTables], C(P), P);
|
|
2512
|
+
else if (Ut(e, e._dbSchema, T), ((N = Pn(Ft(0, (N = e).idbdb, T), N._dbSchema)).add.length || N.change.some(function(I) {
|
|
2513
|
+
return I.add.length || I.change.length;
|
|
2514
|
+
})) && !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."), R.close(), s = R.version + 1, o = !0, S(d());
|
|
2518
2515
|
Bt(e, T);
|
|
2519
2516
|
} catch {
|
|
2520
2517
|
}
|
|
2521
|
-
|
|
2522
|
-
t.vcFired = !0, e.on("versionchange").fire(
|
|
2523
|
-
}),
|
|
2524
|
-
e.on("close").fire(
|
|
2525
|
-
}), f && (
|
|
2526
|
-
},
|
|
2518
|
+
tt.push(e), R.onversionchange = Z(function(I) {
|
|
2519
|
+
t.vcFired = !0, e.on("versionchange").fire(I);
|
|
2520
|
+
}), R.onclose = Z(function(I) {
|
|
2521
|
+
e.on("close").fire(I);
|
|
2522
|
+
}), f && (N = e._deps, T = b, R = N.indexedDB, N = N.IDBKeyRange, Rn(R) || T === $t || Nn(R, N).put({ name: T }).catch(Q)), S();
|
|
2523
|
+
}, g);
|
|
2527
2524
|
}).catch(function(S) {
|
|
2528
2525
|
switch (S?.name) {
|
|
2529
2526
|
case "UnknownError":
|
|
@@ -2537,20 +2534,20 @@ function Ma() {
|
|
|
2537
2534
|
}
|
|
2538
2535
|
var h, m = t.dbReadyResolve, v = null, f = !1;
|
|
2539
2536
|
return j.race([a, (typeof navigator > "u" ? j.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(S) {
|
|
2540
|
-
function
|
|
2537
|
+
function g() {
|
|
2541
2538
|
return indexedDB.databases().finally(S);
|
|
2542
2539
|
}
|
|
2543
|
-
h = setInterval(
|
|
2540
|
+
h = setInterval(g, 100), g();
|
|
2544
2541
|
}).finally(function() {
|
|
2545
2542
|
return clearInterval(h);
|
|
2546
2543
|
}) : Promise.resolve()).then(d)]).then(function() {
|
|
2547
|
-
return u(), t.onReadyBeingFired = [], j.resolve(
|
|
2544
|
+
return u(), t.onReadyBeingFired = [], j.resolve(Tn(function() {
|
|
2548
2545
|
return e.on.ready.fire(e.vip);
|
|
2549
2546
|
})).then(function S() {
|
|
2550
2547
|
if (0 < t.onReadyBeingFired.length) {
|
|
2551
|
-
var
|
|
2552
|
-
return t.onReadyBeingFired = [], j.resolve(
|
|
2553
|
-
return
|
|
2548
|
+
var g = t.onReadyBeingFired.reduce(on, Q);
|
|
2549
|
+
return t.onReadyBeingFired = [], j.resolve(Tn(function() {
|
|
2550
|
+
return g(e.vip);
|
|
2554
2551
|
})).then(S);
|
|
2555
2552
|
}
|
|
2556
2553
|
});
|
|
@@ -2567,14 +2564,14 @@ function Ma() {
|
|
|
2567
2564
|
t.openComplete = !0, m();
|
|
2568
2565
|
}).then(function() {
|
|
2569
2566
|
var S;
|
|
2570
|
-
return f && (S = {}, e.tables.forEach(function(
|
|
2571
|
-
|
|
2572
|
-
b.name && (S["idb://".concat(e.name, "/").concat(
|
|
2573
|
-
}), S["idb://".concat(e.name, "/").concat(
|
|
2574
|
-
}), Ie(
|
|
2567
|
+
return f && (S = {}, e.tables.forEach(function(g) {
|
|
2568
|
+
g.schema.indexes.forEach(function(b) {
|
|
2569
|
+
b.name && (S["idb://".concat(e.name, "/").concat(g.name, "/").concat(b.name)] = new ae(-1 / 0, [[[]]]));
|
|
2570
|
+
}), S["idb://".concat(e.name, "/").concat(g.name, "/")] = S["idb://".concat(e.name, "/").concat(g.name, "/:dels")] = new ae(-1 / 0, [[[]]]);
|
|
2571
|
+
}), Ie(yt).fire(S), $n(S, !0)), e;
|
|
2575
2572
|
});
|
|
2576
2573
|
}
|
|
2577
|
-
function
|
|
2574
|
+
function jn(e) {
|
|
2578
2575
|
function t(o) {
|
|
2579
2576
|
return e.next(o);
|
|
2580
2577
|
}
|
|
@@ -2589,16 +2586,16 @@ function Ma() {
|
|
|
2589
2586
|
}
|
|
2590
2587
|
return s(t)();
|
|
2591
2588
|
}
|
|
2592
|
-
function
|
|
2589
|
+
function Qt(e, t, r) {
|
|
2593
2590
|
for (var a = G(e) ? e.slice() : [e], s = 0; s < r; ++s) a.push(t);
|
|
2594
2591
|
return a;
|
|
2595
2592
|
}
|
|
2596
2593
|
var ba = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(e) {
|
|
2597
2594
|
return l(l({}, e), { table: function(t) {
|
|
2598
2595
|
var r = e.table(t), a = r.schema, s = {}, o = [];
|
|
2599
|
-
function u(f, S,
|
|
2600
|
-
var b =
|
|
2601
|
-
return w.push(A), A.isPrimaryKey || o.push(A), 1 < y && u(y === 2 ? f[0] : f.slice(0, y - 1), S + 1,
|
|
2596
|
+
function u(f, S, g) {
|
|
2597
|
+
var b = vt(f), w = s[b] = s[b] || [], y = f == null ? 0 : typeof f == "string" ? 1 : f.length, A = 0 < S, A = l(l({}, g), { name: A ? "".concat(b, "(virtual-from:").concat(g.name, ")") : g.name, lowLevelIndex: g, isVirtual: A, keyTail: S, keyLength: y, extractKey: _n(f), unique: !A && g.unique });
|
|
2598
|
+
return w.push(A), A.isPrimaryKey || o.push(A), 1 < y && u(y === 2 ? f[0] : f.slice(0, y - 1), S + 1, g), w.sort(function(P, D) {
|
|
2602
2599
|
return P.keyTail - D.keyTail;
|
|
2603
2600
|
}), A;
|
|
2604
2601
|
}
|
|
@@ -2608,25 +2605,25 @@ function Ma() {
|
|
|
2608
2605
|
u(m.keyPath, 0, m);
|
|
2609
2606
|
}
|
|
2610
2607
|
function v(f) {
|
|
2611
|
-
var S,
|
|
2612
|
-
return
|
|
2608
|
+
var S, g = f.query.index;
|
|
2609
|
+
return g.isVirtual ? l(l({}, f), { query: { index: g.lowLevelIndex, range: (S = f.query.range, g = g.keyTail, { type: S.type === 1 ? 2 : S.type, lower: Qt(S.lower, S.lowerOpen ? e.MAX_KEY : e.MIN_KEY, g), lowerOpen: !0, upper: Qt(S.upper, S.upperOpen ? e.MIN_KEY : e.MAX_KEY, g), upperOpen: !0 }) } }) : f;
|
|
2613
2610
|
}
|
|
2614
2611
|
return l(l({}, r), { schema: l(l({}, a), { primaryKey: t, indexes: o, getIndexByKeyPath: function(f) {
|
|
2615
|
-
return (f = s[
|
|
2612
|
+
return (f = s[vt(f)]) && f[0];
|
|
2616
2613
|
} }), count: function(f) {
|
|
2617
2614
|
return r.count(v(f));
|
|
2618
2615
|
}, query: function(f) {
|
|
2619
2616
|
return r.query(v(f));
|
|
2620
2617
|
}, openCursor: function(f) {
|
|
2621
|
-
var S = f.query.index,
|
|
2618
|
+
var S = f.query.index, g = S.keyTail, b = S.isVirtual, w = S.keyLength;
|
|
2622
2619
|
return b ? r.openCursor(v(f)).then(function(A) {
|
|
2623
2620
|
return A && y(A);
|
|
2624
2621
|
}) : r.openCursor(f);
|
|
2625
2622
|
function y(A) {
|
|
2626
2623
|
return Object.create(A, { continue: { value: function(P) {
|
|
2627
|
-
P != null ? A.continue(
|
|
2624
|
+
P != null ? A.continue(Qt(P, f.reverse ? e.MAX_KEY : e.MIN_KEY, g)) : f.unique ? A.continue(A.key.slice(0, w).concat(f.reverse ? e.MIN_KEY : e.MAX_KEY, g)) : A.continue();
|
|
2628
2625
|
} }, continuePrimaryKey: { value: function(P, D) {
|
|
2629
|
-
A.continuePrimaryKey(
|
|
2626
|
+
A.continuePrimaryKey(Qt(P, e.MAX_KEY, g), D);
|
|
2630
2627
|
} }, primaryKey: { get: function() {
|
|
2631
2628
|
return A.primaryKey;
|
|
2632
2629
|
} }, key: { get: function() {
|
|
@@ -2639,22 +2636,22 @@ function Ma() {
|
|
|
2639
2636
|
} });
|
|
2640
2637
|
} });
|
|
2641
2638
|
} };
|
|
2642
|
-
function
|
|
2643
|
-
return r = r || {}, a = a || "",
|
|
2639
|
+
function Mn(e, t, r, a) {
|
|
2640
|
+
return r = r || {}, a = a || "", C(e).forEach(function(s) {
|
|
2644
2641
|
var o, u, d;
|
|
2645
|
-
|
|
2646
|
-
}),
|
|
2647
|
-
|
|
2642
|
+
oe(t, s) ? (o = e[s], u = t[s], typeof o == "object" && typeof u == "object" && o && u ? (d = nn(o)) !== nn(u) ? r[a + s] = t[s] : d === "Object" ? Mn(o, u, r, a + s + ".") : o !== u && (r[a + s] = t[s]) : o !== u && (r[a + s] = t[s])) : r[a + s] = void 0;
|
|
2643
|
+
}), C(t).forEach(function(s) {
|
|
2644
|
+
oe(e, s) || (r[a + s] = t[s]);
|
|
2648
2645
|
}), r;
|
|
2649
2646
|
}
|
|
2650
|
-
function
|
|
2647
|
+
function Kn(e, t) {
|
|
2651
2648
|
return t.type === "delete" ? t.keys : t.keys || t.values.map(e.extractKey);
|
|
2652
2649
|
}
|
|
2653
2650
|
var va = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: function(e) {
|
|
2654
2651
|
return l(l({}, e), { table: function(t) {
|
|
2655
2652
|
var r = e.table(t), a = r.schema.primaryKey;
|
|
2656
2653
|
return l(l({}, r), { mutate: function(s) {
|
|
2657
|
-
var o =
|
|
2654
|
+
var o = B.trans, u = o.table(t).hook, d = u.deleting, h = u.creating, m = u.updating;
|
|
2658
2655
|
switch (s.type) {
|
|
2659
2656
|
case "add":
|
|
2660
2657
|
if (h.fire === Q) break;
|
|
@@ -2674,11 +2671,11 @@ function Ma() {
|
|
|
2674
2671
|
case "deleteRange":
|
|
2675
2672
|
if (d.fire === Q) break;
|
|
2676
2673
|
return o._promise("readwrite", function() {
|
|
2677
|
-
return function f(S,
|
|
2678
|
-
return r.query({ trans: S, values: !1, query: { index: a, range:
|
|
2674
|
+
return function f(S, g, b) {
|
|
2675
|
+
return r.query({ trans: S, values: !1, query: { index: a, range: g }, limit: b }).then(function(w) {
|
|
2679
2676
|
var y = w.result;
|
|
2680
2677
|
return v({ type: "delete", keys: y, trans: S }).then(function(A) {
|
|
2681
|
-
return 0 < A.numFailures ? Promise.reject(A.failures[0]) : y.length < b ? { failures: [], numFailures: 0, lastResult: void 0 } : f(S, l(l({},
|
|
2678
|
+
return 0 < A.numFailures ? Promise.reject(A.failures[0]) : y.length < b ? { failures: [], numFailures: 0, lastResult: void 0 } : f(S, l(l({}, g), { lower: y[y.length - 1], lowerOpen: !0 }), b);
|
|
2682
2679
|
});
|
|
2683
2680
|
});
|
|
2684
2681
|
}(s.trans, s.range, 1e4);
|
|
@@ -2686,24 +2683,24 @@ function Ma() {
|
|
|
2686
2683
|
}
|
|
2687
2684
|
return r.mutate(s);
|
|
2688
2685
|
function v(f) {
|
|
2689
|
-
var S,
|
|
2686
|
+
var S, g, b, w = B.trans, y = f.keys || Kn(a, f);
|
|
2690
2687
|
if (!y) throw new Error("Keys missing");
|
|
2691
|
-
return (f = f.type === "add" || f.type === "put" ? l(l({}, f), { keys: y }) : l({}, f)).type !== "delete" && (f.values = E([], f.values)), f.keys && (f.keys = E([], f.keys)), S = r, b = y, ((
|
|
2692
|
-
var P = y.map(function(D,
|
|
2693
|
-
var
|
|
2694
|
-
return f.type === "delete" ? d.fire.call($, D,
|
|
2695
|
-
|
|
2688
|
+
return (f = f.type === "add" || f.type === "put" ? l(l({}, f), { keys: y }) : l({}, f)).type !== "delete" && (f.values = E([], f.values)), f.keys && (f.keys = E([], f.keys)), S = r, b = y, ((g = f).type === "add" ? Promise.resolve([]) : S.getMany({ trans: g.trans, keys: b, cache: "immutable" })).then(function(A) {
|
|
2689
|
+
var P = y.map(function(D, N) {
|
|
2690
|
+
var R, k, T, I = A[N], $ = { onerror: null, onsuccess: null };
|
|
2691
|
+
return f.type === "delete" ? d.fire.call($, D, I, w) : f.type === "add" || I === void 0 ? (R = h.fire.call($, D, f.values[N], w), D == null && R != null && (f.keys[N] = D = R, a.outbound || ue(f.values[N], a.keyPath, D))) : (R = Mn(I, f.values[N]), (k = m.fire.call($, R, D, I, w)) && (T = f.values[N], Object.keys(k).forEach(function(x) {
|
|
2692
|
+
oe(T, x) ? T[x] = k[x] : ue(T, x, k[x]);
|
|
2696
2693
|
}))), $;
|
|
2697
2694
|
});
|
|
2698
2695
|
return r.mutate(f).then(function(D) {
|
|
2699
|
-
for (var
|
|
2700
|
-
var
|
|
2701
|
-
|
|
2696
|
+
for (var N = D.failures, R = D.results, k = D.numFailures, D = D.lastResult, T = 0; T < y.length; ++T) {
|
|
2697
|
+
var I = (R || y)[T], $ = P[T];
|
|
2698
|
+
I == null ? $.onerror && $.onerror(N[T]) : $.onsuccess && $.onsuccess(f.type === "put" && A[T] ? f.values[T] : I);
|
|
2702
2699
|
}
|
|
2703
|
-
return { failures:
|
|
2700
|
+
return { failures: N, results: R, numFailures: k, lastResult: D };
|
|
2704
2701
|
}).catch(function(D) {
|
|
2705
|
-
return P.forEach(function(
|
|
2706
|
-
return
|
|
2702
|
+
return P.forEach(function(N) {
|
|
2703
|
+
return N.onerror && N.onerror(D);
|
|
2707
2704
|
}), Promise.reject(D);
|
|
2708
2705
|
});
|
|
2709
2706
|
});
|
|
@@ -2714,7 +2711,7 @@ function Ma() {
|
|
|
2714
2711
|
function Ar(e, t, r) {
|
|
2715
2712
|
try {
|
|
2716
2713
|
if (!t || t.keys.length < e.length) return null;
|
|
2717
|
-
for (var a = [], s = 0, o = 0; s < t.keys.length && o < e.length; ++s) H(t.keys[s], e[o]) === 0 && (a.push(r ?
|
|
2714
|
+
for (var a = [], s = 0, o = 0; s < t.keys.length && o < e.length; ++s) H(t.keys[s], e[o]) === 0 && (a.push(r ? $e(t.values[s]) : t.values[s]), ++o);
|
|
2718
2715
|
return a.length === e.length ? a : null;
|
|
2719
2716
|
} catch {
|
|
2720
2717
|
return null;
|
|
@@ -2727,7 +2724,7 @@ function Ma() {
|
|
|
2727
2724
|
if (!a.cache) return r.getMany(a);
|
|
2728
2725
|
var s = Ar(a.keys, a.trans._cache, a.cache === "clone");
|
|
2729
2726
|
return s ? j.resolve(s) : r.getMany(a).then(function(o) {
|
|
2730
|
-
return a.trans._cache = { keys: a.keys, values: a.cache === "clone" ?
|
|
2727
|
+
return a.trans._cache = { keys: a.keys, values: a.cache === "clone" ? $e(o) : o }, o;
|
|
2731
2728
|
});
|
|
2732
2729
|
}, mutate: function(a) {
|
|
2733
2730
|
return a.type !== "add" && (a.trans._cache = null), r.mutate(a);
|
|
@@ -2749,94 +2746,94 @@ function Ma() {
|
|
|
2749
2746
|
}
|
|
2750
2747
|
}
|
|
2751
2748
|
var wa = { stack: "dbcore", level: 0, name: "Observability", create: function(e) {
|
|
2752
|
-
var t = e.schema.name, r = new
|
|
2749
|
+
var t = e.schema.name, r = new ae(e.MIN_KEY, e.MAX_KEY);
|
|
2753
2750
|
return l(l({}, e), { transaction: function(a, s, o) {
|
|
2754
|
-
if (
|
|
2751
|
+
if (B.subscr && s !== "readonly") throw new L.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(B.querier));
|
|
2755
2752
|
return e.transaction(a, s, o);
|
|
2756
2753
|
}, table: function(a) {
|
|
2757
|
-
var s = e.table(a), o = s.schema, u = o.primaryKey, f = o.indexes, d = u.extractKey, h = u.outbound, m = u.autoIncrement && f.filter(function(
|
|
2758
|
-
return
|
|
2759
|
-
}), v = l(l({}, s), { mutate: function(
|
|
2760
|
-
function b(
|
|
2761
|
-
return
|
|
2754
|
+
var s = e.table(a), o = s.schema, u = o.primaryKey, f = o.indexes, d = u.extractKey, h = u.outbound, m = u.autoIncrement && f.filter(function(g) {
|
|
2755
|
+
return g.compound && g.keyPath.includes(u.keyPath);
|
|
2756
|
+
}), v = l(l({}, s), { mutate: function(g) {
|
|
2757
|
+
function b(x) {
|
|
2758
|
+
return x = "idb://".concat(t, "/").concat(a, "/").concat(x), D[x] || (D[x] = new ae());
|
|
2762
2759
|
}
|
|
2763
|
-
var w, y, A, P =
|
|
2764
|
-
return
|
|
2765
|
-
}),
|
|
2766
|
-
return G(T) ? (
|
|
2767
|
-
var M = w(
|
|
2768
|
-
function
|
|
2769
|
-
return z != null ?
|
|
2760
|
+
var w, y, A, P = g.trans, D = g.mutatedParts || (g.mutatedParts = {}), N = b(""), R = b(":dels"), k = g.type, $ = g.type === "deleteRange" ? [g.range] : g.type === "delete" ? [g.keys] : g.values.length < 50 ? [Kn(u, g).filter(function(x) {
|
|
2761
|
+
return x;
|
|
2762
|
+
}), g.values] : [], T = $[0], I = $[1], $ = g.trans._cache;
|
|
2763
|
+
return G(T) ? (N.addKeys(T), ($ = k === "delete" || T.length === I.length ? Ar(T, $) : null) || R.addKeys(T), ($ || I) && (w = b, y = $, A = I, o.indexes.forEach(function(x) {
|
|
2764
|
+
var M = w(x.name || "");
|
|
2765
|
+
function F(z) {
|
|
2766
|
+
return z != null ? x.extractKey(z) : null;
|
|
2770
2767
|
}
|
|
2771
2768
|
function U(z) {
|
|
2772
|
-
return
|
|
2769
|
+
return x.multiEntry && G(z) ? z.forEach(function(de) {
|
|
2773
2770
|
return M.addKey(de);
|
|
2774
2771
|
}) : M.addKey(z);
|
|
2775
2772
|
}
|
|
2776
|
-
(y || A).forEach(function(z,
|
|
2777
|
-
var
|
|
2778
|
-
H(
|
|
2773
|
+
(y || A).forEach(function(z, se) {
|
|
2774
|
+
var W = y && F(y[se]), se = A && F(A[se]);
|
|
2775
|
+
H(W, se) !== 0 && (W != null && U(W), se != null && U(se));
|
|
2779
2776
|
});
|
|
2780
|
-
}))) : T ? (
|
|
2781
|
-
return b(
|
|
2782
|
-
})), s.mutate(
|
|
2783
|
-
return !T ||
|
|
2784
|
-
for (var
|
|
2785
|
-
return M.extractKey(
|
|
2786
|
-
}), U = M.keyPath.findIndex(function(
|
|
2787
|
-
return
|
|
2788
|
-
}), z = 0, de =
|
|
2789
|
-
b(M.name).addKeys(
|
|
2790
|
-
})), P.mutatedParts =
|
|
2777
|
+
}))) : T ? (I = { from: (I = T.lower) !== null && I !== void 0 ? I : e.MIN_KEY, to: (I = T.upper) !== null && I !== void 0 ? I : e.MAX_KEY }, R.add(I), N.add(I)) : (N.add(r), R.add(r), o.indexes.forEach(function(x) {
|
|
2778
|
+
return b(x.name).add(r);
|
|
2779
|
+
})), s.mutate(g).then(function(x) {
|
|
2780
|
+
return !T || g.type !== "add" && g.type !== "put" || (N.addKeys(x.results), m && m.forEach(function(M) {
|
|
2781
|
+
for (var F = g.values.map(function(W) {
|
|
2782
|
+
return M.extractKey(W);
|
|
2783
|
+
}), U = M.keyPath.findIndex(function(W) {
|
|
2784
|
+
return W === u.keyPath;
|
|
2785
|
+
}), z = 0, de = x.results.length; z < de; ++z) F[z][U] = x.results[z];
|
|
2786
|
+
b(M.name).addKeys(F);
|
|
2787
|
+
})), P.mutatedParts = Vt(P.mutatedParts || {}, D), x;
|
|
2791
2788
|
});
|
|
2792
2789
|
} }), f = function(b) {
|
|
2793
2790
|
var w = b.query, b = w.index, w = w.range;
|
|
2794
|
-
return [b, new
|
|
2795
|
-
}, S = { get: function(
|
|
2796
|
-
return [u, new
|
|
2797
|
-
}, getMany: function(
|
|
2798
|
-
return [u, new
|
|
2791
|
+
return [b, new ae((b = w.lower) !== null && b !== void 0 ? b : e.MIN_KEY, (w = w.upper) !== null && w !== void 0 ? w : e.MAX_KEY)];
|
|
2792
|
+
}, S = { get: function(g) {
|
|
2793
|
+
return [u, new ae(g.key)];
|
|
2794
|
+
}, getMany: function(g) {
|
|
2795
|
+
return [u, new ae().addKeys(g.keys)];
|
|
2799
2796
|
}, count: f, query: f, openCursor: f };
|
|
2800
|
-
return
|
|
2801
|
-
v[
|
|
2802
|
-
var w =
|
|
2797
|
+
return C(S).forEach(function(g) {
|
|
2798
|
+
v[g] = function(b) {
|
|
2799
|
+
var w = B.subscr, y = !!w, A = Pr(B, s) && Dr(g, b) ? b.obsSet = {} : w;
|
|
2803
2800
|
if (y) {
|
|
2804
|
-
var P = function(
|
|
2805
|
-
return
|
|
2806
|
-
}, D = P(""),
|
|
2807
|
-
if ((
|
|
2808
|
-
if (
|
|
2809
|
-
var
|
|
2810
|
-
return s[
|
|
2811
|
-
if (
|
|
2812
|
-
if (h && b.values) return
|
|
2813
|
-
return
|
|
2801
|
+
var P = function(I) {
|
|
2802
|
+
return I = "idb://".concat(t, "/").concat(a, "/").concat(I), A[I] || (A[I] = new ae());
|
|
2803
|
+
}, D = P(""), N = P(":dels"), w = S[g](b), y = w[0], w = w[1];
|
|
2804
|
+
if ((g === "query" && y.isPrimaryKey && !b.values ? N : P(y.name || "")).add(w), !y.isPrimaryKey) {
|
|
2805
|
+
if (g !== "count") {
|
|
2806
|
+
var R = g === "query" && h && b.values && s.query(l(l({}, b), { values: !1 }));
|
|
2807
|
+
return s[g].apply(this, arguments).then(function(I) {
|
|
2808
|
+
if (g === "query") {
|
|
2809
|
+
if (h && b.values) return R.then(function(F) {
|
|
2810
|
+
return F = F.result, D.addKeys(F), I;
|
|
2814
2811
|
});
|
|
2815
|
-
var $ = b.values ?
|
|
2816
|
-
(b.values ? D :
|
|
2817
|
-
} else if (
|
|
2818
|
-
var
|
|
2819
|
-
return
|
|
2820
|
-
return
|
|
2812
|
+
var $ = b.values ? I.result.map(d) : I.result;
|
|
2813
|
+
(b.values ? D : N).addKeys($);
|
|
2814
|
+
} else if (g === "openCursor") {
|
|
2815
|
+
var x = I, M = b.values;
|
|
2816
|
+
return x && Object.create(x, { key: { get: function() {
|
|
2817
|
+
return N.addKey(x.primaryKey), x.key;
|
|
2821
2818
|
} }, primaryKey: { get: function() {
|
|
2822
|
-
var
|
|
2823
|
-
return
|
|
2819
|
+
var F = x.primaryKey;
|
|
2820
|
+
return N.addKey(F), F;
|
|
2824
2821
|
} }, value: { get: function() {
|
|
2825
|
-
return M && D.addKey(
|
|
2822
|
+
return M && D.addKey(x.primaryKey), x.value;
|
|
2826
2823
|
} } });
|
|
2827
2824
|
}
|
|
2828
|
-
return
|
|
2825
|
+
return I;
|
|
2829
2826
|
});
|
|
2830
2827
|
}
|
|
2831
|
-
|
|
2828
|
+
N.add(r);
|
|
2832
2829
|
}
|
|
2833
2830
|
}
|
|
2834
|
-
return s[
|
|
2831
|
+
return s[g].apply(this, arguments);
|
|
2835
2832
|
};
|
|
2836
2833
|
}), v;
|
|
2837
2834
|
} });
|
|
2838
2835
|
} };
|
|
2839
|
-
function
|
|
2836
|
+
function Nr(e, t, r) {
|
|
2840
2837
|
if (r.numFailures === 0) return t;
|
|
2841
2838
|
if (t.type === "deleteRange") return null;
|
|
2842
2839
|
var a = t.keys ? t.keys.length : "values" in t && t.values ? t.values.length : 1;
|
|
@@ -2846,58 +2843,58 @@ function Ma() {
|
|
|
2846
2843
|
return !(o in r.failures);
|
|
2847
2844
|
})), t);
|
|
2848
2845
|
}
|
|
2849
|
-
function
|
|
2846
|
+
function Gn(e, t) {
|
|
2850
2847
|
return r = e, ((a = t).lower === void 0 || (a.lowerOpen ? 0 < H(r, a.lower) : 0 <= H(r, a.lower))) && (e = e, (t = t).upper === void 0 || (t.upperOpen ? H(e, t.upper) < 0 : H(e, t.upper) <= 0));
|
|
2851
2848
|
var r, a;
|
|
2852
2849
|
}
|
|
2853
|
-
function
|
|
2850
|
+
function Rr(e, t, S, a, s, o) {
|
|
2854
2851
|
if (!S || S.length === 0) return e;
|
|
2855
|
-
var u = t.query.index, d = u.multiEntry, h = t.query.range, m = a.schema.primaryKey.extractKey, v = u.extractKey, f = (u.lowLevelIndex || u).extractKey, S = S.reduce(function(
|
|
2856
|
-
var w =
|
|
2857
|
-
if (b.type === "add" || b.type === "put") for (var A = new
|
|
2858
|
-
var D,
|
|
2859
|
-
A.hasKey(
|
|
2860
|
-
return
|
|
2861
|
-
}) :
|
|
2852
|
+
var u = t.query.index, d = u.multiEntry, h = t.query.range, m = a.schema.primaryKey.extractKey, v = u.extractKey, f = (u.lowLevelIndex || u).extractKey, S = S.reduce(function(g, b) {
|
|
2853
|
+
var w = g, y = [];
|
|
2854
|
+
if (b.type === "add" || b.type === "put") for (var A = new ae(), P = b.values.length - 1; 0 <= P; --P) {
|
|
2855
|
+
var D, N = b.values[P], R = m(N);
|
|
2856
|
+
A.hasKey(R) || (D = v(N), (d && G(D) ? D.some(function(x) {
|
|
2857
|
+
return Gn(x, h);
|
|
2858
|
+
}) : Gn(D, h)) && (A.addKey(R), y.push(N)));
|
|
2862
2859
|
}
|
|
2863
2860
|
switch (b.type) {
|
|
2864
2861
|
case "add":
|
|
2865
|
-
var
|
|
2862
|
+
var k = new ae().addKeys(t.values ? g.map(function(M) {
|
|
2866
2863
|
return m(M);
|
|
2867
|
-
}) :
|
|
2868
|
-
return M = m(M), !
|
|
2864
|
+
}) : g), w = g.concat(t.values ? y.filter(function(M) {
|
|
2865
|
+
return M = m(M), !k.hasKey(M) && (k.addKey(M), !0);
|
|
2869
2866
|
}) : y.map(function(M) {
|
|
2870
2867
|
return m(M);
|
|
2871
2868
|
}).filter(function(M) {
|
|
2872
|
-
return !
|
|
2869
|
+
return !k.hasKey(M) && (k.addKey(M), !0);
|
|
2873
2870
|
}));
|
|
2874
2871
|
break;
|
|
2875
2872
|
case "put":
|
|
2876
|
-
var T = new
|
|
2873
|
+
var T = new ae().addKeys(b.values.map(function(M) {
|
|
2877
2874
|
return m(M);
|
|
2878
2875
|
}));
|
|
2879
|
-
w =
|
|
2876
|
+
w = g.filter(function(M) {
|
|
2880
2877
|
return !T.hasKey(t.values ? m(M) : M);
|
|
2881
2878
|
}).concat(t.values ? y : y.map(function(M) {
|
|
2882
2879
|
return m(M);
|
|
2883
2880
|
}));
|
|
2884
2881
|
break;
|
|
2885
2882
|
case "delete":
|
|
2886
|
-
var
|
|
2887
|
-
w =
|
|
2888
|
-
return !
|
|
2883
|
+
var I = new ae().addKeys(b.keys);
|
|
2884
|
+
w = g.filter(function(M) {
|
|
2885
|
+
return !I.hasKey(t.values ? m(M) : M);
|
|
2889
2886
|
});
|
|
2890
2887
|
break;
|
|
2891
2888
|
case "deleteRange":
|
|
2892
2889
|
var $ = b.range;
|
|
2893
|
-
w =
|
|
2894
|
-
return !
|
|
2890
|
+
w = g.filter(function(M) {
|
|
2891
|
+
return !Gn(m(M), $);
|
|
2895
2892
|
});
|
|
2896
2893
|
}
|
|
2897
2894
|
return w;
|
|
2898
2895
|
}, e);
|
|
2899
|
-
return S === e ? e : (S.sort(function(
|
|
2900
|
-
return H(f(
|
|
2896
|
+
return S === e ? e : (S.sort(function(g, b) {
|
|
2897
|
+
return H(f(g), f(b)) || H(m(g), m(b));
|
|
2901
2898
|
}), t.limit && t.limit < 1 / 0 && (S.length > t.limit ? S.length = t.limit : e.length === t.limit && S.length < t.limit && (s.dirty = !0)), o ? Object.freeze(S) : S);
|
|
2902
2899
|
}
|
|
2903
2900
|
function Tr(e, t) {
|
|
@@ -2928,7 +2925,7 @@ function Ma() {
|
|
|
2928
2925
|
e.subscribers.add(r), a.addEventListener("abort", function() {
|
|
2929
2926
|
var s, o;
|
|
2930
2927
|
e.subscribers.delete(r), e.subscribers.size === 0 && (s = e, o = t, setTimeout(function() {
|
|
2931
|
-
s.subscribers.size === 0 &&
|
|
2928
|
+
s.subscribers.size === 0 && je(o, s);
|
|
2932
2929
|
}, 3e3));
|
|
2933
2930
|
});
|
|
2934
2931
|
}
|
|
@@ -2940,21 +2937,21 @@ function Ma() {
|
|
|
2940
2937
|
return function() {
|
|
2941
2938
|
if (o.abort(), a === "readwrite") {
|
|
2942
2939
|
for (var m = /* @__PURE__ */ new Set(), v = 0, f = r; v < f.length; v++) {
|
|
2943
|
-
var S = f[v],
|
|
2944
|
-
if (
|
|
2945
|
-
var b = e.table(S), w =
|
|
2940
|
+
var S = f[v], g = ze["idb://".concat(t, "/").concat(S)];
|
|
2941
|
+
if (g) {
|
|
2942
|
+
var b = e.table(S), w = g.optimisticOps.filter(function(M) {
|
|
2946
2943
|
return M.trans === d;
|
|
2947
2944
|
});
|
|
2948
|
-
if (d._explicit && h && d.mutatedParts) for (var y = 0, A = Object.values(
|
|
2945
|
+
if (d._explicit && h && d.mutatedParts) for (var y = 0, A = Object.values(g.queries.query); y < A.length; y++) for (var P = 0, D = (k = A[y]).slice(); P < D.length; P++) xn((T = D[P]).obsSet, d.mutatedParts) && (je(k, T), T.subscribers.forEach(function(M) {
|
|
2949
2946
|
return m.add(M);
|
|
2950
2947
|
}));
|
|
2951
2948
|
else if (0 < w.length) {
|
|
2952
|
-
|
|
2949
|
+
g.optimisticOps = g.optimisticOps.filter(function(M) {
|
|
2953
2950
|
return M.trans !== d;
|
|
2954
2951
|
});
|
|
2955
|
-
for (var
|
|
2952
|
+
for (var N = 0, R = Object.values(g.queries.query); N < R.length; N++) for (var k, T, I, $ = 0, x = (k = R[N]).slice(); $ < x.length; $++) (T = x[$]).res != null && d.mutatedParts && (h && !T.dirty ? (I = Object.isFrozen(T.res), I = Rr(T.res, T.req, w, b, T, I), T.dirty ? (je(k, T), T.subscribers.forEach(function(M) {
|
|
2956
2953
|
return m.add(M);
|
|
2957
|
-
})) :
|
|
2954
|
+
})) : I !== T.res && (T.res = I, T.promise = j.resolve({ result: I }))) : (T.dirty && je(k, T), T.subscribers.forEach(function(M) {
|
|
2958
2955
|
return m.add(M);
|
|
2959
2956
|
})));
|
|
2960
2957
|
}
|
|
@@ -2969,67 +2966,67 @@ function Ma() {
|
|
|
2969
2966
|
}, table: function(r) {
|
|
2970
2967
|
var a = e.table(r), s = a.schema.primaryKey;
|
|
2971
2968
|
return l(l({}, a), { mutate: function(o) {
|
|
2972
|
-
var u =
|
|
2969
|
+
var u = B.trans;
|
|
2973
2970
|
if (s.outbound || u.db._options.cache === "disabled" || u.explicit || u.idbtrans.mode !== "readwrite") return a.mutate(o);
|
|
2974
|
-
var d =
|
|
2975
|
-
return d ? (u = a.mutate(o), o.type !== "add" && o.type !== "put" || !(50 <= o.values.length ||
|
|
2971
|
+
var d = ze["idb://".concat(t, "/").concat(r)];
|
|
2972
|
+
return d ? (u = a.mutate(o), o.type !== "add" && o.type !== "put" || !(50 <= o.values.length || Kn(s, o).some(function(h) {
|
|
2976
2973
|
return h == null;
|
|
2977
|
-
})) ? (d.optimisticOps.push(o), o.mutatedParts &&
|
|
2978
|
-
0 < h.numFailures && (
|
|
2974
|
+
})) ? (d.optimisticOps.push(o), o.mutatedParts && Yt(o.mutatedParts), u.then(function(h) {
|
|
2975
|
+
0 < h.numFailures && (je(d.optimisticOps, o), (h = Nr(0, o, h)) && d.optimisticOps.push(h), o.mutatedParts && Yt(o.mutatedParts));
|
|
2979
2976
|
}), u.catch(function() {
|
|
2980
|
-
|
|
2977
|
+
je(d.optimisticOps, o), o.mutatedParts && Yt(o.mutatedParts);
|
|
2981
2978
|
})) : u.then(function(h) {
|
|
2982
|
-
var m =
|
|
2979
|
+
var m = Nr(0, l(l({}, o), { values: o.values.map(function(v, f) {
|
|
2983
2980
|
var S;
|
|
2984
|
-
return h.failures[f] ? v : (v = (S = s.keyPath) !== null && S !== void 0 && S.includes(".") ?
|
|
2981
|
+
return h.failures[f] ? v : (v = (S = s.keyPath) !== null && S !== void 0 && S.includes(".") ? $e(v) : l({}, v), ue(v, s.keyPath, h.results[f]), v);
|
|
2985
2982
|
}) }), h);
|
|
2986
2983
|
d.optimisticOps.push(m), queueMicrotask(function() {
|
|
2987
|
-
return o.mutatedParts &&
|
|
2984
|
+
return o.mutatedParts && Yt(o.mutatedParts);
|
|
2988
2985
|
});
|
|
2989
2986
|
}), u) : a.mutate(o);
|
|
2990
2987
|
}, query: function(o) {
|
|
2991
|
-
if (!Pr(
|
|
2992
|
-
var u = ((m =
|
|
2993
|
-
var P =
|
|
2988
|
+
if (!Pr(B, a) || !Dr("query", o)) return a.query(o);
|
|
2989
|
+
var u = ((m = B.trans) === null || m === void 0 ? void 0 : m.db._options.cache) === "immutable", f = B, d = f.requery, h = f.signal, m = function(b, w, y, A) {
|
|
2990
|
+
var P = ze["idb://".concat(b, "/").concat(w)];
|
|
2994
2991
|
if (!P) return [];
|
|
2995
2992
|
if (!(w = P.queries[y])) return [null, !1, P, null];
|
|
2996
2993
|
var D = w[(A.query ? A.query.index.name : null) || ""];
|
|
2997
2994
|
if (!D) return [null, !1, P, null];
|
|
2998
2995
|
switch (y) {
|
|
2999
2996
|
case "query":
|
|
3000
|
-
var
|
|
3001
|
-
return
|
|
2997
|
+
var N = D.find(function(R) {
|
|
2998
|
+
return R.req.limit === A.limit && R.req.values === A.values && Tr(R.req.query.range, A.query.range);
|
|
3002
2999
|
});
|
|
3003
|
-
return
|
|
3004
|
-
return ("limit" in
|
|
3000
|
+
return N ? [N, !0, P, D] : [D.find(function(R) {
|
|
3001
|
+
return ("limit" in R.req ? R.req.limit : 1 / 0) >= A.limit && (!A.values || R.req.values) && Sa(R.req.query.range, A.query.range);
|
|
3005
3002
|
}), !1, P, D];
|
|
3006
3003
|
case "count":
|
|
3007
|
-
return
|
|
3008
|
-
return Tr(
|
|
3009
|
-
}), [
|
|
3004
|
+
return N = D.find(function(R) {
|
|
3005
|
+
return Tr(R.req.query.range, A.query.range);
|
|
3006
|
+
}), [N, !!N, P, D];
|
|
3010
3007
|
}
|
|
3011
|
-
}(t, r, "query", o), v = m[0], f = m[1], S = m[2],
|
|
3008
|
+
}(t, r, "query", o), v = m[0], f = m[1], S = m[2], g = m[3];
|
|
3012
3009
|
return v && f ? v.obsSet = o.obsSet : (f = a.query(o).then(function(b) {
|
|
3013
3010
|
var w = b.result;
|
|
3014
3011
|
if (v && (v.res = w), u) {
|
|
3015
3012
|
for (var y = 0, A = w.length; y < A; ++y) Object.freeze(w[y]);
|
|
3016
3013
|
Object.freeze(w);
|
|
3017
|
-
} else b.result =
|
|
3014
|
+
} else b.result = $e(w);
|
|
3018
3015
|
return b;
|
|
3019
3016
|
}).catch(function(b) {
|
|
3020
|
-
return
|
|
3021
|
-
}), v = { obsSet: o.obsSet, promise: f, subscribers: /* @__PURE__ */ new Set(), type: "query", req: o, dirty: !1 },
|
|
3022
|
-
return { result:
|
|
3017
|
+
return g && v && je(g, v), Promise.reject(b);
|
|
3018
|
+
}), v = { obsSet: o.obsSet, promise: f, subscribers: /* @__PURE__ */ new Set(), type: "query", req: o, dirty: !1 }, g ? g.push(v) : (g = [v], (S = S || (ze["idb://".concat(t, "/").concat(r)] = { queries: { query: {}, count: {} }, objs: /* @__PURE__ */ new Map(), optimisticOps: [], unsignaledParts: {} })).queries.query[o.query.index.name || ""] = g)), Oa(v, g, d, h), v.promise.then(function(b) {
|
|
3019
|
+
return { result: Rr(b.result, o, S?.optimisticOps, a, v, u) };
|
|
3023
3020
|
});
|
|
3024
3021
|
} });
|
|
3025
3022
|
} });
|
|
3026
3023
|
} };
|
|
3027
|
-
function
|
|
3024
|
+
function Xt(e, t) {
|
|
3028
3025
|
return new Proxy(e, { get: function(r, a, s) {
|
|
3029
3026
|
return a === "db" ? t : Reflect.get(r, a, s);
|
|
3030
3027
|
} });
|
|
3031
3028
|
}
|
|
3032
|
-
var
|
|
3029
|
+
var Se = (ee.prototype.version = function(e) {
|
|
3033
3030
|
if (isNaN(e) || e < 0.1) throw new L.Type("Given version is not a positive number");
|
|
3034
3031
|
if (e = Math.round(10 * e) / 10, this.idbdb || this._state.isBeingOpened) throw new L.Schema("Cannot add version when database is open");
|
|
3035
3032
|
this.verno = Math.max(this.verno, e);
|
|
@@ -3039,7 +3036,7 @@ function Ma() {
|
|
|
3039
3036
|
return r || (r = new this.Version(e), t.push(r), t.sort(ha), r.stores({}), this._state.autoSchema = !1, r);
|
|
3040
3037
|
}, ee.prototype._whenReady = function(e) {
|
|
3041
3038
|
var t = this;
|
|
3042
|
-
return this.idbdb && (this._state.openComplete ||
|
|
3039
|
+
return this.idbdb && (this._state.openComplete || B.letThrough || this._vip) ? e() : new j(function(r, a) {
|
|
3043
3040
|
if (t._state.openComplete) return a(new L.DatabaseClosed(t._state.dbOpenError));
|
|
3044
3041
|
if (!t._state.isBeingOpened) {
|
|
3045
3042
|
if (!t._state.autoOpen) return void a(new L.DatabaseClosed());
|
|
@@ -3059,12 +3056,12 @@ function Ma() {
|
|
|
3059
3056
|
})), this;
|
|
3060
3057
|
}, ee.prototype.open = function() {
|
|
3061
3058
|
var e = this;
|
|
3062
|
-
return
|
|
3059
|
+
return We(Pe, function() {
|
|
3063
3060
|
return ya(e);
|
|
3064
3061
|
});
|
|
3065
3062
|
}, ee.prototype._close = function() {
|
|
3066
|
-
var e = this._state, t =
|
|
3067
|
-
if (0 <= t &&
|
|
3063
|
+
var e = this._state, t = tt.indexOf(this);
|
|
3064
|
+
if (0 <= t && tt.splice(t, 1), this.idbdb) {
|
|
3068
3065
|
try {
|
|
3069
3066
|
this.idbdb.close();
|
|
3070
3067
|
} catch {
|
|
@@ -3089,7 +3086,7 @@ function Ma() {
|
|
|
3089
3086
|
var d = t._deps.indexedDB.deleteDatabase(t.name);
|
|
3090
3087
|
d.onsuccess = Z(function() {
|
|
3091
3088
|
var h, m, v;
|
|
3092
|
-
h = t._deps, m = t.name, v = h.indexedDB, h = h.IDBKeyRange, Rn(v) || m ===
|
|
3089
|
+
h = t._deps, m = t.name, v = h.indexedDB, h = h.IDBKeyRange, Rn(v) || m === $t || Nn(v, h).delete(m).catch(Q), s();
|
|
3093
3090
|
}), d.onerror = me(o), d.onblocked = t._fireOnBlocked;
|
|
3094
3091
|
}
|
|
3095
3092
|
if (r) throw new L.InvalidArgument("Invalid closeOptions argument to db.delete()");
|
|
@@ -3108,7 +3105,7 @@ function Ma() {
|
|
|
3108
3105
|
return this._state.autoSchema;
|
|
3109
3106
|
}, Object.defineProperty(ee.prototype, "tables", { get: function() {
|
|
3110
3107
|
var e = this;
|
|
3111
|
-
return
|
|
3108
|
+
return C(this._allTables).map(function(t) {
|
|
3112
3109
|
return e._allTables[t];
|
|
3113
3110
|
});
|
|
3114
3111
|
}, enumerable: !1, configurable: !0 }), ee.prototype.transaction = function() {
|
|
@@ -3120,7 +3117,7 @@ function Ma() {
|
|
|
3120
3117
|
}.apply(this, arguments);
|
|
3121
3118
|
return this._transaction.apply(this, e);
|
|
3122
3119
|
}, ee.prototype._transaction = function(e, t, r) {
|
|
3123
|
-
var a = this, s =
|
|
3120
|
+
var a = this, s = B.trans;
|
|
3124
3121
|
s && s.db === this && e.indexOf("!") === -1 || (s = null);
|
|
3125
3122
|
var o, u, d = e.indexOf("?") !== -1;
|
|
3126
3123
|
e = e.replace("!", "").replace("?", "");
|
|
@@ -3128,13 +3125,13 @@ function Ma() {
|
|
|
3128
3125
|
if (u = t.map(function(m) {
|
|
3129
3126
|
if (m = m instanceof a.Table ? m.name : m, typeof m != "string") throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");
|
|
3130
3127
|
return m;
|
|
3131
|
-
}), e == "r" || e ===
|
|
3128
|
+
}), e == "r" || e === mn) o = mn;
|
|
3132
3129
|
else {
|
|
3133
|
-
if (e != "rw" && e !=
|
|
3134
|
-
o =
|
|
3130
|
+
if (e != "rw" && e != yn) throw new L.InvalidArgument("Invalid transaction mode: " + e);
|
|
3131
|
+
o = yn;
|
|
3135
3132
|
}
|
|
3136
3133
|
if (s) {
|
|
3137
|
-
if (s.mode ===
|
|
3134
|
+
if (s.mode === mn && o === yn) {
|
|
3138
3135
|
if (!d) throw new L.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");
|
|
3139
3136
|
s = null;
|
|
3140
3137
|
}
|
|
@@ -3150,27 +3147,27 @@ function Ma() {
|
|
|
3150
3147
|
f(m);
|
|
3151
3148
|
}) : q(m);
|
|
3152
3149
|
}
|
|
3153
|
-
var h = function m(v, f, S,
|
|
3150
|
+
var h = function m(v, f, S, g, b) {
|
|
3154
3151
|
return j.resolve().then(function() {
|
|
3155
|
-
var w =
|
|
3156
|
-
if (y.explicit = !0, w = { trans: y, transless: w },
|
|
3152
|
+
var w = B.transless || B, y = v._createTransaction(f, S, v._dbSchema, g);
|
|
3153
|
+
if (y.explicit = !0, w = { trans: y, transless: w }, g) y.idbtrans = g.idbtrans;
|
|
3157
3154
|
else try {
|
|
3158
3155
|
y.create(), y.idbtrans._explicit = !0, v._state.PR1398_maxLoop = 3;
|
|
3159
3156
|
} catch (D) {
|
|
3160
|
-
return D.name ===
|
|
3157
|
+
return D.name === sn.InvalidState && v.isOpen() && 0 < --v._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), v.close({ disableAutoOpen: !1 }), v.open().then(function() {
|
|
3161
3158
|
return m(v, f, S, null, b);
|
|
3162
3159
|
})) : q(D);
|
|
3163
3160
|
}
|
|
3164
|
-
var A, P =
|
|
3165
|
-
return P &&
|
|
3161
|
+
var A, P = an(b);
|
|
3162
|
+
return P && et(), w = j.follow(function() {
|
|
3166
3163
|
var D;
|
|
3167
|
-
(A = b.call(y, y)) && (P ? (D =
|
|
3164
|
+
(A = b.call(y, y)) && (P ? (D = Ne.bind(null, null), A.then(D, D)) : typeof A.next == "function" && typeof A.throw == "function" && (A = jn(A)));
|
|
3168
3165
|
}, w), (A && typeof A.then == "function" ? j.resolve(A).then(function(D) {
|
|
3169
3166
|
return y.active ? D : q(new L.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
|
|
3170
3167
|
}) : w.then(function() {
|
|
3171
3168
|
return A;
|
|
3172
3169
|
})).then(function(D) {
|
|
3173
|
-
return
|
|
3170
|
+
return g && y._resolve(), y._completion.then(function() {
|
|
3174
3171
|
return D;
|
|
3175
3172
|
});
|
|
3176
3173
|
}).catch(function(D) {
|
|
@@ -3178,11 +3175,11 @@ function Ma() {
|
|
|
3178
3175
|
});
|
|
3179
3176
|
});
|
|
3180
3177
|
}.bind(null, this, o, u, s, r);
|
|
3181
|
-
return s ? s._promise(o, h, "lock") :
|
|
3178
|
+
return s ? s._promise(o, h, "lock") : B.trans ? We(B.transless, function() {
|
|
3182
3179
|
return a._whenReady(h);
|
|
3183
3180
|
}) : this._whenReady(h);
|
|
3184
3181
|
}, ee.prototype.table = function(e) {
|
|
3185
|
-
if (!
|
|
3182
|
+
if (!oe(this._allTables, e)) throw new L.InvalidTable("Table ".concat(e, " does not exist"));
|
|
3186
3183
|
return this._allTables[e];
|
|
3187
3184
|
}, ee);
|
|
3188
3185
|
function ee(e, t) {
|
|
@@ -3195,30 +3192,30 @@ function Ma() {
|
|
|
3195
3192
|
m.dbReadyResolve = f;
|
|
3196
3193
|
}), m.openCanceller = new j(function(f, S) {
|
|
3197
3194
|
m.cancelOpen = S;
|
|
3198
|
-
}), this._state = m, this.name = e, this.on =
|
|
3199
|
-
return function(S,
|
|
3195
|
+
}), this._state = m, this.name = e, this.on = ht(this, "populate", "blocked", "versionchange", "close", { ready: [on, Q] }), this.on.ready.subscribe = Vn(this.on.ready.subscribe, function(f) {
|
|
3196
|
+
return function(S, g) {
|
|
3200
3197
|
ee.vip(function() {
|
|
3201
3198
|
var b, w = r._state;
|
|
3202
|
-
w.openComplete ? (w.dbOpenError || j.resolve().then(S),
|
|
3199
|
+
w.openComplete ? (w.dbOpenError || j.resolve().then(S), g && f(S)) : w.onReadyBeingFired ? (w.onReadyBeingFired.push(S), g && f(S)) : (f(S), b = r, g || f(function y() {
|
|
3203
3200
|
b.on.ready.unsubscribe(S), b.on.ready.unsubscribe(y);
|
|
3204
3201
|
}));
|
|
3205
3202
|
});
|
|
3206
3203
|
};
|
|
3207
|
-
}), this.Collection = (s = this,
|
|
3204
|
+
}), this.Collection = (s = this, gt(ia.prototype, function(A, y) {
|
|
3208
3205
|
this.db = s;
|
|
3209
|
-
var
|
|
3206
|
+
var g = or, b = null;
|
|
3210
3207
|
if (y) try {
|
|
3211
|
-
|
|
3208
|
+
g = y();
|
|
3212
3209
|
} catch (P) {
|
|
3213
3210
|
b = P;
|
|
3214
3211
|
}
|
|
3215
3212
|
var w = A._ctx, y = w.table, A = y.hook.reading.fire;
|
|
3216
|
-
this._ctx = { table: y, index: w.index, isPrimKey: !w.index || y.schema.primKey.keyPath && w.index === y.schema.primKey.name, range:
|
|
3217
|
-
})), this.Table = (o = this,
|
|
3218
|
-
this.db = o, this._tx =
|
|
3219
|
-
})), this.Transaction = (u = this,
|
|
3213
|
+
this._ctx = { table: y, index: w.index, isPrimKey: !w.index || y.schema.primKey.keyPath && w.index === y.schema.primKey.name, range: g, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: b, or: w.or, valueMapper: A !== ct ? A : null };
|
|
3214
|
+
})), this.Table = (o = this, gt(dr.prototype, function(f, S, g) {
|
|
3215
|
+
this.db = o, this._tx = g, this.name = f, this.schema = S, this.hook = o._allTables[f] ? o._allTables[f].hook : ht(null, { creating: [Jr, Q], reading: [Xr, ct], updating: [qr, Q], deleting: [Zr, Q] });
|
|
3216
|
+
})), this.Transaction = (u = this, gt(ua.prototype, function(f, S, g, b, w) {
|
|
3220
3217
|
var y = this;
|
|
3221
|
-
this.db = u, this.mode = f, this.storeNames = S, this.schema =
|
|
3218
|
+
this.db = u, this.mode = f, this.storeNames = S, this.schema = g, this.chromeTransactionDurability = b, this.idbtrans = null, this.on = ht(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 j(function(A, P) {
|
|
3222
3219
|
y._resolve = A, y._reject = P;
|
|
3223
3220
|
}), this._completion.then(function() {
|
|
3224
3221
|
y.active = !1, y.on.complete.fire();
|
|
@@ -3226,10 +3223,10 @@ function Ma() {
|
|
|
3226
3223
|
var P = y.active;
|
|
3227
3224
|
return y.active = !1, y.on.error.fire(A), y.parent ? y.parent._reject(A) : P && y.idbtrans && y.idbtrans.abort(), q(A);
|
|
3228
3225
|
});
|
|
3229
|
-
})), this.Version = (d = this,
|
|
3226
|
+
})), this.Version = (d = this, gt(ma.prototype, function(f) {
|
|
3230
3227
|
this.db = d, this._cfg = { version: f, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
|
|
3231
|
-
})), this.WhereClause = (h = this,
|
|
3232
|
-
if (this.db = h, this._ctx = { table: f, index: S === ":id" ? null : S, or:
|
|
3228
|
+
})), this.WhereClause = (h = this, gt(mr.prototype, function(f, S, g) {
|
|
3229
|
+
if (this.db = h, this._ctx = { table: f, index: S === ":id" ? null : S, or: g }, this._cmp = this._ascending = H, this._descending = function(b, w) {
|
|
3233
3230
|
return H(w, b);
|
|
3234
3231
|
}, this._max = function(b, w) {
|
|
3235
3232
|
return 0 < H(b, w) ? b : w;
|
|
@@ -3240,72 +3237,72 @@ function Ma() {
|
|
|
3240
3237
|
0 < f.newVersion ? console.warn("Another connection wants to upgrade database '".concat(r.name, "'. Closing db now to resume the upgrade.")) : console.warn("Another connection wants to delete database '".concat(r.name, "'. Closing db now to resume the delete request.")), r.close({ disableAutoOpen: !1 });
|
|
3241
3238
|
}), this.on("blocked", function(f) {
|
|
3242
3239
|
!f.newVersion || f.newVersion < f.oldVersion ? console.warn("Dexie.delete('".concat(r.name, "') was blocked")) : console.warn("Upgrade '".concat(r.name, "' blocked by other connection holding version ").concat(f.oldVersion / 10));
|
|
3243
|
-
}), this._maxKey =
|
|
3244
|
-
return new r.Transaction(f, S,
|
|
3240
|
+
}), this._maxKey = bt(t.IDBKeyRange), this._createTransaction = function(f, S, g, b) {
|
|
3241
|
+
return new r.Transaction(f, S, g, r._options.chromeTransactionDurability, b);
|
|
3245
3242
|
}, this._fireOnBlocked = function(f) {
|
|
3246
|
-
r.on("blocked").fire(f),
|
|
3243
|
+
r.on("blocked").fire(f), tt.filter(function(S) {
|
|
3247
3244
|
return S.name === r.name && S !== r && !S._state.vcFired;
|
|
3248
3245
|
}).map(function(S) {
|
|
3249
3246
|
return S.on("versionchange").fire(f);
|
|
3250
3247
|
});
|
|
3251
3248
|
}, this.use(Ea), this.use(_a), this.use(wa), this.use(ba), this.use(va);
|
|
3252
|
-
var v = new Proxy(this, { get: function(f, S,
|
|
3249
|
+
var v = new Proxy(this, { get: function(f, S, g) {
|
|
3253
3250
|
if (S === "_vip") return !0;
|
|
3254
3251
|
if (S === "table") return function(w) {
|
|
3255
|
-
return
|
|
3252
|
+
return Xt(r.table(w), v);
|
|
3256
3253
|
};
|
|
3257
|
-
var b = Reflect.get(f, S,
|
|
3258
|
-
return b instanceof dr ?
|
|
3259
|
-
return
|
|
3254
|
+
var b = Reflect.get(f, S, g);
|
|
3255
|
+
return b instanceof dr ? Xt(b, v) : S === "tables" ? b.map(function(w) {
|
|
3256
|
+
return Xt(w, v);
|
|
3260
3257
|
}) : S === "_createTransaction" ? function() {
|
|
3261
|
-
return
|
|
3258
|
+
return Xt(b.apply(this, arguments), v);
|
|
3262
3259
|
} : b;
|
|
3263
3260
|
} });
|
|
3264
3261
|
this.vip = v, a.forEach(function(f) {
|
|
3265
3262
|
return f(r);
|
|
3266
3263
|
});
|
|
3267
3264
|
}
|
|
3268
|
-
var
|
|
3265
|
+
var Jt, fe = typeof Symbol < "u" && "observable" in Symbol ? Symbol.observable : "@@observable", Aa = (Bn.prototype.subscribe = function(e, t, r) {
|
|
3269
3266
|
return this._subscribe(e && typeof e != "function" ? e : { next: e, error: t, complete: r });
|
|
3270
|
-
}, Bn.prototype[
|
|
3267
|
+
}, Bn.prototype[fe] = function() {
|
|
3271
3268
|
return this;
|
|
3272
3269
|
}, Bn);
|
|
3273
3270
|
function Bn(e) {
|
|
3274
3271
|
this._subscribe = e;
|
|
3275
3272
|
}
|
|
3276
3273
|
try {
|
|
3277
|
-
|
|
3274
|
+
Jt = { indexedDB: _.indexedDB || _.mozIndexedDB || _.webkitIndexedDB || _.msIndexedDB, IDBKeyRange: _.IDBKeyRange || _.webkitIDBKeyRange };
|
|
3278
3275
|
} catch {
|
|
3279
|
-
|
|
3276
|
+
Jt = { indexedDB: null, IDBKeyRange: null };
|
|
3280
3277
|
}
|
|
3281
3278
|
function Ir(e) {
|
|
3282
3279
|
var t, r = !1, a = new Aa(function(s) {
|
|
3283
|
-
var o =
|
|
3280
|
+
var o = an(e), u, d = !1, h = {}, m = {}, v = { get closed() {
|
|
3284
3281
|
return d;
|
|
3285
3282
|
}, unsubscribe: function() {
|
|
3286
|
-
d || (d = !0, u && u.abort(), f && Ie.storagemutated.unsubscribe(
|
|
3283
|
+
d || (d = !0, u && u.abort(), f && Ie.storagemutated.unsubscribe(g));
|
|
3287
3284
|
} };
|
|
3288
3285
|
s.start && s.start(v);
|
|
3289
3286
|
var f = !1, S = function() {
|
|
3290
3287
|
return pn(b);
|
|
3291
|
-
},
|
|
3292
|
-
|
|
3288
|
+
}, g = function(w) {
|
|
3289
|
+
Vt(h, w), xn(m, h) && S();
|
|
3293
3290
|
}, b = function() {
|
|
3294
3291
|
var w, y, A;
|
|
3295
|
-
!d &&
|
|
3296
|
-
var D =
|
|
3292
|
+
!d && Jt.indexedDB && (h = {}, w = {}, u && u.abort(), u = new AbortController(), A = function(P) {
|
|
3293
|
+
var D = Ze();
|
|
3297
3294
|
try {
|
|
3298
|
-
o &&
|
|
3299
|
-
var
|
|
3300
|
-
return
|
|
3295
|
+
o && et();
|
|
3296
|
+
var N = De(e, P);
|
|
3297
|
+
return N = o ? N.finally(Ne) : N;
|
|
3301
3298
|
} finally {
|
|
3302
|
-
D &&
|
|
3299
|
+
D && qe();
|
|
3303
3300
|
}
|
|
3304
3301
|
}(y = { subscr: w, signal: u.signal, requery: S, querier: e, trans: null }), Promise.resolve(A).then(function(P) {
|
|
3305
3302
|
r = !0, t = P, d || y.signal.aborted || (h = {}, function(D) {
|
|
3306
|
-
for (var
|
|
3303
|
+
for (var N in D) if (oe(D, N)) return;
|
|
3307
3304
|
return 1;
|
|
3308
|
-
}(m = w) || f || (Ie(
|
|
3305
|
+
}(m = w) || f || (Ie(yt, g), f = !0), pn(function() {
|
|
3309
3306
|
return !d && s.next && s.next(P);
|
|
3310
3307
|
}));
|
|
3311
3308
|
}, function(P) {
|
|
@@ -3322,46 +3319,46 @@ function Ma() {
|
|
|
3322
3319
|
return t;
|
|
3323
3320
|
}, a;
|
|
3324
3321
|
}
|
|
3325
|
-
var
|
|
3326
|
-
function
|
|
3322
|
+
var He = Se;
|
|
3323
|
+
function Ln(e) {
|
|
3327
3324
|
var t = xe;
|
|
3328
3325
|
try {
|
|
3329
|
-
xe = !0, Ie.storagemutated.fire(e),
|
|
3326
|
+
xe = !0, Ie.storagemutated.fire(e), $n(e, !0);
|
|
3330
3327
|
} finally {
|
|
3331
3328
|
xe = t;
|
|
3332
3329
|
}
|
|
3333
3330
|
}
|
|
3334
|
-
|
|
3335
|
-
return new
|
|
3331
|
+
be(He, l(l({}, Pt), { delete: function(e) {
|
|
3332
|
+
return new He(e, { addons: [] }).delete();
|
|
3336
3333
|
}, exists: function(e) {
|
|
3337
|
-
return new
|
|
3334
|
+
return new He(e, { addons: [] }).open().then(function(t) {
|
|
3338
3335
|
return t.close(), !0;
|
|
3339
3336
|
}).catch("NoSuchDatabaseError", function() {
|
|
3340
3337
|
return !1;
|
|
3341
3338
|
});
|
|
3342
3339
|
}, getDatabaseNames: function(e) {
|
|
3343
3340
|
try {
|
|
3344
|
-
return t =
|
|
3341
|
+
return t = He.dependencies, r = t.indexedDB, t = t.IDBKeyRange, (Rn(r) ? Promise.resolve(r.databases()).then(function(a) {
|
|
3345
3342
|
return a.map(function(s) {
|
|
3346
3343
|
return s.name;
|
|
3347
3344
|
}).filter(function(s) {
|
|
3348
|
-
return s !==
|
|
3345
|
+
return s !== $t;
|
|
3349
3346
|
});
|
|
3350
|
-
}) :
|
|
3347
|
+
}) : Nn(r, t).toCollection().primaryKeys()).then(e);
|
|
3351
3348
|
} catch {
|
|
3352
3349
|
return q(new L.MissingAPI());
|
|
3353
3350
|
}
|
|
3354
3351
|
var t, r;
|
|
3355
3352
|
}, defineClass: function() {
|
|
3356
3353
|
return function(e) {
|
|
3357
|
-
|
|
3354
|
+
te(this, e);
|
|
3358
3355
|
};
|
|
3359
3356
|
}, ignoreTransaction: function(e) {
|
|
3360
|
-
return
|
|
3361
|
-
}, vip:
|
|
3357
|
+
return B.trans ? We(B.transless, e) : e();
|
|
3358
|
+
}, vip: Tn, async: function(e) {
|
|
3362
3359
|
return function() {
|
|
3363
3360
|
try {
|
|
3364
|
-
var t =
|
|
3361
|
+
var t = jn(e.apply(this, arguments));
|
|
3365
3362
|
return t && typeof t.then == "function" ? t : j.resolve(t);
|
|
3366
3363
|
} catch (r) {
|
|
3367
3364
|
return q(r);
|
|
@@ -3369,71 +3366,71 @@ function Ma() {
|
|
|
3369
3366
|
};
|
|
3370
3367
|
}, spawn: function(e, t, r) {
|
|
3371
3368
|
try {
|
|
3372
|
-
var a =
|
|
3369
|
+
var a = jn(e.apply(r, t || []));
|
|
3373
3370
|
return a && typeof a.then == "function" ? a : j.resolve(a);
|
|
3374
3371
|
} catch (s) {
|
|
3375
3372
|
return q(s);
|
|
3376
3373
|
}
|
|
3377
3374
|
}, currentTransaction: { get: function() {
|
|
3378
|
-
return
|
|
3375
|
+
return B.trans || null;
|
|
3379
3376
|
} }, waitFor: function(e, t) {
|
|
3380
|
-
return t = j.resolve(typeof e == "function" ?
|
|
3377
|
+
return t = j.resolve(typeof e == "function" ? He.ignoreTransaction(e) : e).timeout(t || 6e4), B.trans ? B.trans.waitFor(t) : t;
|
|
3381
3378
|
}, Promise: j, debug: { get: function() {
|
|
3382
|
-
return
|
|
3379
|
+
return pe;
|
|
3383
3380
|
}, set: function(e) {
|
|
3384
3381
|
er(e);
|
|
3385
|
-
} }, derive:
|
|
3382
|
+
} }, derive: Ye, extend: te, props: be, override: Vn, Events: ht, on: Ie, liveQuery: Ir, extendObservabilitySet: Vt, getByKeyPath: ve, setByKeyPath: ue, delByKeyPath: function(e, t) {
|
|
3386
3383
|
typeof t == "string" ? ue(e, t, void 0) : "length" in t && [].map.call(t, function(r) {
|
|
3387
3384
|
ue(e, r, void 0);
|
|
3388
3385
|
});
|
|
3389
|
-
}, shallowClone: Qn, deepClone:
|
|
3386
|
+
}, shallowClone: Qn, deepClone: $e, getObjectDiff: Mn, cmp: H, asap: Yn, minKey: -1 / 0, addons: [], connections: tt, errnames: sn, dependencies: Jt, cache: ze, semVer: "4.0.11", version: "4.0.11".split(".").map(function(e) {
|
|
3390
3387
|
return parseInt(e);
|
|
3391
3388
|
}).reduce(function(e, t, r) {
|
|
3392
3389
|
return e + t / Math.pow(10, 2 * r);
|
|
3393
|
-
}) })),
|
|
3394
|
-
xe || (e = new CustomEvent(
|
|
3395
|
-
}), addEventListener(
|
|
3396
|
-
e = e.detail, xe ||
|
|
3390
|
+
}) })), He.maxKey = bt(He.dependencies.IDBKeyRange), typeof dispatchEvent < "u" && typeof addEventListener < "u" && (Ie(yt, function(e) {
|
|
3391
|
+
xe || (e = new CustomEvent(wn, { detail: e }), xe = !0, dispatchEvent(e), xe = !1);
|
|
3392
|
+
}), addEventListener(wn, function(e) {
|
|
3393
|
+
e = e.detail, xe || Ln(e);
|
|
3397
3394
|
}));
|
|
3398
|
-
var
|
|
3395
|
+
var at, xe = !1, xr = function() {
|
|
3399
3396
|
};
|
|
3400
3397
|
return typeof BroadcastChannel < "u" && ((xr = function() {
|
|
3401
|
-
(
|
|
3402
|
-
return e.data &&
|
|
3398
|
+
(at = new BroadcastChannel(wn)).onmessage = function(e) {
|
|
3399
|
+
return e.data && Ln(e.data);
|
|
3403
3400
|
};
|
|
3404
|
-
})(), typeof
|
|
3405
|
-
xe ||
|
|
3401
|
+
})(), typeof at.unref == "function" && at.unref(), Ie(yt, function(e) {
|
|
3402
|
+
xe || at.postMessage(e);
|
|
3406
3403
|
})), typeof addEventListener < "u" && (addEventListener("pagehide", function(e) {
|
|
3407
|
-
if (!
|
|
3408
|
-
|
|
3409
|
-
for (var t = 0, r =
|
|
3404
|
+
if (!Se.disableBfCache && e.persisted) {
|
|
3405
|
+
pe && console.debug("Dexie: handling persisted pagehide"), at?.close();
|
|
3406
|
+
for (var t = 0, r = tt; t < r.length; t++) r[t].close({ disableAutoOpen: !1 });
|
|
3410
3407
|
}
|
|
3411
3408
|
}), addEventListener("pageshow", function(e) {
|
|
3412
|
-
!
|
|
3409
|
+
!Se.disableBfCache && e.persisted && (pe && console.debug("Dexie: handling persisted pageshow"), xr(), Ln({ all: new ae(-1 / 0, [[]]) }));
|
|
3413
3410
|
})), j.rejectionMapper = function(e, t) {
|
|
3414
|
-
return !e || e instanceof
|
|
3411
|
+
return !e || e instanceof Xe || e instanceof TypeError || e instanceof SyntaxError || !e.name || !qn[e.name] ? e : (t = new qn[e.name](t || e.message, e), "stack" in e && Ae(t, "stack", { get: function() {
|
|
3415
3412
|
return this.inner.stack;
|
|
3416
3413
|
} }), t);
|
|
3417
|
-
}, er(
|
|
3414
|
+
}, er(pe), l(Se, Object.freeze({ __proto__: null, Dexie: Se, liveQuery: Ir, Entity: cr, cmp: H, PropModification: pt, replacePrefix: function(e, t) {
|
|
3418
3415
|
return new pt({ replacePrefix: [e, t] });
|
|
3419
3416
|
}, add: function(e) {
|
|
3420
3417
|
return new pt({ add: e });
|
|
3421
3418
|
}, remove: function(e) {
|
|
3422
3419
|
return new pt({ remove: e });
|
|
3423
|
-
}, default:
|
|
3420
|
+
}, default: Se, RangeSet: ae, mergeRanges: wt, rangesOverlap: wr }), { default: Se }), Se;
|
|
3424
3421
|
});
|
|
3425
|
-
}(
|
|
3422
|
+
}(en)), en.exports;
|
|
3426
3423
|
}
|
|
3427
3424
|
var Ka = Ma();
|
|
3428
|
-
const
|
|
3429
|
-
if (
|
|
3430
|
-
throw new Error(`Two different versions of Dexie loaded in the same app: ${
|
|
3425
|
+
const zn = /* @__PURE__ */ $a(Ka), $r = Symbol.for("Dexie"), tn = globalThis[$r] || (globalThis[$r] = zn);
|
|
3426
|
+
if (zn.semVer !== tn.semVer)
|
|
3427
|
+
throw new Error(`Two different versions of Dexie loaded in the same app: ${zn.semVer} and ${tn.semVer}`);
|
|
3431
3428
|
class Mr {
|
|
3432
3429
|
db;
|
|
3433
3430
|
subscribers = [];
|
|
3434
3431
|
options;
|
|
3435
3432
|
constructor(n) {
|
|
3436
|
-
this.options = n, this.db = new
|
|
3433
|
+
this.options = n, this.db = new tn(n.app), this.db.version(11).stores({
|
|
3437
3434
|
channel: "id,slide_index",
|
|
3438
3435
|
cloud: "id,dashboard_id",
|
|
3439
3436
|
dashboard: "id,name,update",
|
|
@@ -3455,18 +3452,33 @@ class Mr {
|
|
|
3455
3452
|
* @returns IResponse
|
|
3456
3453
|
*/
|
|
3457
3454
|
getCloud = async (n) => {
|
|
3455
|
+
if (n.widget = "")
|
|
3456
|
+
return K(3, [
|
|
3457
|
+
"%cget%c %cstorage%c %ccloud",
|
|
3458
|
+
c.KO,
|
|
3459
|
+
c.NONE,
|
|
3460
|
+
c.STORAGE,
|
|
3461
|
+
c.NONE,
|
|
3462
|
+
c.CLOUD,
|
|
3463
|
+
n
|
|
3464
|
+
]), {
|
|
3465
|
+
data: null,
|
|
3466
|
+
message: "Series Data error",
|
|
3467
|
+
success: !1,
|
|
3468
|
+
query: n
|
|
3469
|
+
};
|
|
3458
3470
|
const i = await this.db.table(O.CLOUD).where({ id: n.widget }).last().catch(() => {
|
|
3459
|
-
|
|
3471
|
+
K(2, ["%capi%C %ccloud", c.API, c.NONE, c.CLOUD, n.widget]);
|
|
3460
3472
|
});
|
|
3461
3473
|
if (typeof i > "u")
|
|
3462
3474
|
return { data: null, message: "Cloud Data error", success: !1, query: n };
|
|
3463
3475
|
const l = {
|
|
3464
3476
|
data: i.data,
|
|
3465
|
-
message: i !== void 0 ? "
|
|
3477
|
+
message: i !== void 0 ? "Cloud retrieved successfully" : "Cloud Data error",
|
|
3466
3478
|
success: i !== void 0,
|
|
3467
3479
|
query: n
|
|
3468
3480
|
};
|
|
3469
|
-
return
|
|
3481
|
+
return K(3, [
|
|
3470
3482
|
"%cget%c %cstorage%c %ccloud",
|
|
3471
3483
|
c.OK,
|
|
3472
3484
|
c.NONE,
|
|
@@ -3487,7 +3499,7 @@ class Mr {
|
|
|
3487
3499
|
dashboard_id: n.dashboard,
|
|
3488
3500
|
//data: data.data,
|
|
3489
3501
|
data: i
|
|
3490
|
-
}).then(() => 201).catch((l) => (
|
|
3502
|
+
}).then(() => 201).catch((l) => (K(2, [
|
|
3491
3503
|
"%cset%c %cstorage%c %ccloud",
|
|
3492
3504
|
c.KO,
|
|
3493
3505
|
c.NONE,
|
|
@@ -3499,7 +3511,7 @@ class Mr {
|
|
|
3499
3511
|
]), 400)) : 400;
|
|
3500
3512
|
getDashboard = async (n) => {
|
|
3501
3513
|
const i = await this.db.table(O.DASHBOARD).where({ id: n.id }).last().catch(() => {
|
|
3502
|
-
|
|
3514
|
+
K(2, ["%cstorage", c.STORAGE, J.DASHBOARD_LOAD, n.id]);
|
|
3503
3515
|
});
|
|
3504
3516
|
return i === void 0 ? {
|
|
3505
3517
|
data: null,
|
|
@@ -3510,9 +3522,9 @@ class Mr {
|
|
|
3510
3522
|
getDashboards = async (n) => {
|
|
3511
3523
|
const i = (_) => n?.id === _.id, l = (_) => n?.name ? _.name.includes(n?.name) : !1;
|
|
3512
3524
|
let E = await this.db.table(O.DASHBOARD).toArray().then((_) => n?.id ? _.filter(i) : _).then((_) => n?.name ? _.filter(l) : _).catch(() => {
|
|
3513
|
-
|
|
3525
|
+
K(2, ["%cstorage", c.STORAGE, J.DASHBOARD_LOAD, n]);
|
|
3514
3526
|
});
|
|
3515
|
-
return E !== void 0 &&
|
|
3527
|
+
return E !== void 0 && K(3, [
|
|
3516
3528
|
"%cstorage%c %cdashboards",
|
|
3517
3529
|
c.STORAGE,
|
|
3518
3530
|
c.NONE,
|
|
@@ -3541,13 +3553,7 @@ class Mr {
|
|
|
3541
3553
|
data: null,
|
|
3542
3554
|
message: `Dashboard ${i.data.id} saved to storage`,
|
|
3543
3555
|
success: !0
|
|
3544
|
-
})).catch((l) => (
|
|
3545
|
-
"%cstorage",
|
|
3546
|
-
c.STORAGE,
|
|
3547
|
-
O.WIDGET,
|
|
3548
|
-
n,
|
|
3549
|
-
l.message
|
|
3550
|
-
]), {
|
|
3556
|
+
})).catch((l) => (K(4, ["%cstorage", c.STORAGE, O.WIDGET, n, l.message]), {
|
|
3551
3557
|
data: null,
|
|
3552
3558
|
message: `Dashboard ${i.data.id} save error: ${l.message}`,
|
|
3553
3559
|
success: !1
|
|
@@ -3580,40 +3586,55 @@ class Mr {
|
|
|
3580
3586
|
* @returns IResponse
|
|
3581
3587
|
*/
|
|
3582
3588
|
getMessages = async (n) => {
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3589
|
+
if (n.widget === "")
|
|
3590
|
+
return K(3, [
|
|
3591
|
+
"%cget%c %cstorage%c %cmessages",
|
|
3592
|
+
c.KO,
|
|
3593
|
+
c.NONE,
|
|
3594
|
+
c.STORAGE,
|
|
3595
|
+
c.NONE,
|
|
3596
|
+
c.MESSAGES,
|
|
3597
|
+
n
|
|
3598
|
+
]), {
|
|
3599
|
+
data: null,
|
|
3600
|
+
message: "Messages Data error",
|
|
3601
|
+
success: !1,
|
|
3602
|
+
query: n
|
|
3603
|
+
};
|
|
3604
|
+
const i = n?.order ?? "utc", l = Math.floor(Date.now() / 1e3);
|
|
3605
|
+
i !== "utc" && (n.since = l - 60 * 60 * 24 * 30), this.options.delay != 0 ? n.before = l - (this.options.delay || 0) : n.before = l;
|
|
3606
|
+
const E = (G) => G.utc > (n?.since || 0), _ = (G) => G.utc < (n?.before || l), C = (G) => G?.visible !== 0;
|
|
3586
3607
|
try {
|
|
3587
|
-
const
|
|
3588
|
-
if (
|
|
3608
|
+
const te = await this.db.table(O.TOPICS).where("widget_id").equals(n.widget).filter(C).filter(E).filter(_).reverse().limit(n?.limit ?? 25).sortBy(i);
|
|
3609
|
+
if (te.length === 0)
|
|
3589
3610
|
return {
|
|
3590
3611
|
data: null,
|
|
3591
3612
|
message: "No Messages error",
|
|
3592
3613
|
success: !1,
|
|
3593
3614
|
query: n
|
|
3594
3615
|
};
|
|
3595
|
-
let
|
|
3596
|
-
return
|
|
3597
|
-
const
|
|
3616
|
+
let ge = te.map((Ce) => this.db.table(O.MESSAGES).get({ id: Ce.message_id }));
|
|
3617
|
+
return tn.Promise.all(ge).then(async (Ce) => {
|
|
3618
|
+
const be = {
|
|
3598
3619
|
data: {
|
|
3599
|
-
messages:
|
|
3620
|
+
messages: Ce.map((Ot) => Ot.data)
|
|
3600
3621
|
},
|
|
3601
3622
|
query: n,
|
|
3602
3623
|
message: "Messages retrieved successfully",
|
|
3603
3624
|
success: !0
|
|
3604
3625
|
};
|
|
3605
|
-
return
|
|
3626
|
+
return K(3, [
|
|
3606
3627
|
"%cget%c %cstorage%c %cmessages",
|
|
3607
3628
|
c.OK,
|
|
3608
3629
|
c.NONE,
|
|
3609
3630
|
c.STORAGE,
|
|
3610
3631
|
c.NONE,
|
|
3611
3632
|
c.MESSAGES,
|
|
3612
|
-
|
|
3613
|
-
]),
|
|
3633
|
+
be
|
|
3634
|
+
]), be;
|
|
3614
3635
|
});
|
|
3615
|
-
} catch (
|
|
3616
|
-
return
|
|
3636
|
+
} catch (G) {
|
|
3637
|
+
return K(2, [
|
|
3617
3638
|
"%cget%c %cstorage%c %cmessages",
|
|
3618
3639
|
c.OK,
|
|
3619
3640
|
c.NONE,
|
|
@@ -3621,7 +3642,7 @@ class Mr {
|
|
|
3621
3642
|
c.NONE,
|
|
3622
3643
|
c.NO_UPDATES,
|
|
3623
3644
|
n,
|
|
3624
|
-
|
|
3645
|
+
G.message
|
|
3625
3646
|
]), { data: null, message: "Messages Data error", success: !1 };
|
|
3626
3647
|
}
|
|
3627
3648
|
};
|
|
@@ -3659,8 +3680,8 @@ class Mr {
|
|
|
3659
3680
|
utc: _.utc,
|
|
3660
3681
|
data: _,
|
|
3661
3682
|
expires: _.expires
|
|
3662
|
-
}).catch((
|
|
3663
|
-
E++,
|
|
3683
|
+
}).catch((C) => {
|
|
3684
|
+
E++, K(4, [
|
|
3664
3685
|
"%cset%c %cstorage",
|
|
3665
3686
|
c.KO,
|
|
3666
3687
|
c.NONE,
|
|
@@ -3668,7 +3689,7 @@ class Mr {
|
|
|
3668
3689
|
"set message",
|
|
3669
3690
|
`title: ${l}`,
|
|
3670
3691
|
_,
|
|
3671
|
-
|
|
3692
|
+
C.message
|
|
3672
3693
|
]);
|
|
3673
3694
|
}), await this.db.table(O.TOPICS).put({
|
|
3674
3695
|
title: l,
|
|
@@ -3681,8 +3702,8 @@ class Mr {
|
|
|
3681
3702
|
sentiment: _.topics[0]?.sentiment || 0,
|
|
3682
3703
|
utc: _.utc,
|
|
3683
3704
|
expires: _.expires
|
|
3684
|
-
}).catch((
|
|
3685
|
-
E++,
|
|
3705
|
+
}).catch((C) => {
|
|
3706
|
+
E++, K(4, [
|
|
3686
3707
|
"%cset%c %cstorage",
|
|
3687
3708
|
c.KO,
|
|
3688
3709
|
c.NONE,
|
|
@@ -3690,20 +3711,20 @@ class Mr {
|
|
|
3690
3711
|
"set topic",
|
|
3691
3712
|
`title: ${l}`,
|
|
3692
3713
|
_,
|
|
3693
|
-
|
|
3714
|
+
C.message
|
|
3694
3715
|
]);
|
|
3695
|
-
}), await i.data.topics.forEach(async (
|
|
3696
|
-
const G =
|
|
3697
|
-
await this.db.table(O.TOPICS).where("message_id").equals(G).modify({ visible:
|
|
3698
|
-
E++,
|
|
3716
|
+
}), await i.data.topics.forEach(async (C) => {
|
|
3717
|
+
const G = C.message_id, te = C.visible ? 1 : 0, ge = C.title;
|
|
3718
|
+
await this.db.table(O.TOPICS).where("message_id").equals(G).modify({ visible: te }).catch((Ce) => {
|
|
3719
|
+
E++, K(4, [
|
|
3699
3720
|
"%cset%c %cstorage",
|
|
3700
3721
|
c.KO,
|
|
3701
3722
|
c.NONE,
|
|
3702
3723
|
c.STORAGE,
|
|
3703
3724
|
"update message visibility",
|
|
3704
|
-
`title: ${
|
|
3705
|
-
`widget: ${
|
|
3706
|
-
|
|
3725
|
+
`title: ${ge}`,
|
|
3726
|
+
`widget: ${C.widget_id}`,
|
|
3727
|
+
Ce.message
|
|
3707
3728
|
]);
|
|
3708
3729
|
});
|
|
3709
3730
|
}));
|
|
@@ -3715,8 +3736,23 @@ class Mr {
|
|
|
3715
3736
|
* @returns IResponse
|
|
3716
3737
|
*/
|
|
3717
3738
|
getSeries = async (n) => {
|
|
3739
|
+
if (n.widget === "")
|
|
3740
|
+
return K(3, [
|
|
3741
|
+
"%cget%c %cstorage%c %cseries",
|
|
3742
|
+
c.KO,
|
|
3743
|
+
c.NONE,
|
|
3744
|
+
c.STORAGE,
|
|
3745
|
+
c.NONE,
|
|
3746
|
+
c.CLOUD,
|
|
3747
|
+
n
|
|
3748
|
+
]), {
|
|
3749
|
+
data: null,
|
|
3750
|
+
message: "Series Data error",
|
|
3751
|
+
success: !1,
|
|
3752
|
+
query: n
|
|
3753
|
+
};
|
|
3718
3754
|
const i = await this.db.table(O.SERIES).where({ id: n.widget }).last().catch(() => {
|
|
3719
|
-
|
|
3755
|
+
K(2, [
|
|
3720
3756
|
"%cget%c %cstorage%c %cseries",
|
|
3721
3757
|
c.KO,
|
|
3722
3758
|
c.NONE,
|
|
@@ -3731,7 +3767,7 @@ class Mr {
|
|
|
3731
3767
|
success: i !== void 0,
|
|
3732
3768
|
query: n
|
|
3733
3769
|
};
|
|
3734
|
-
return
|
|
3770
|
+
return K(3, [
|
|
3735
3771
|
"%cget%c %cstorage%c %cseries",
|
|
3736
3772
|
c.OK,
|
|
3737
3773
|
c.NONE,
|
|
@@ -3752,7 +3788,7 @@ class Mr {
|
|
|
3752
3788
|
dashboard_id: n.dashboard,
|
|
3753
3789
|
//data: data.data,
|
|
3754
3790
|
data: i
|
|
3755
|
-
}).then(() => 201).catch((l) => (
|
|
3791
|
+
}).then(() => 201).catch((l) => (K(2, [
|
|
3756
3792
|
"%cset%c %cstorage%c %cseries",
|
|
3757
3793
|
c.KO,
|
|
3758
3794
|
c.NONE,
|
|
@@ -3768,6 +3804,21 @@ class Mr {
|
|
|
3768
3804
|
* @returns IResponse
|
|
3769
3805
|
*/
|
|
3770
3806
|
getWidget = async (n) => {
|
|
3807
|
+
if (n.id === "")
|
|
3808
|
+
return K(3, [
|
|
3809
|
+
"%cget%c %cstorage%c %cwidget",
|
|
3810
|
+
c.KO,
|
|
3811
|
+
c.NONE,
|
|
3812
|
+
c.STORAGE,
|
|
3813
|
+
c.NONE,
|
|
3814
|
+
c.WIDGET,
|
|
3815
|
+
n
|
|
3816
|
+
]), {
|
|
3817
|
+
data: null,
|
|
3818
|
+
message: "Widget Data error",
|
|
3819
|
+
success: !1,
|
|
3820
|
+
query: n
|
|
3821
|
+
};
|
|
3771
3822
|
const i = await this.db.table(O.WIDGET).where({ id: n.id }).last().catch(() => {
|
|
3772
3823
|
console.warn("%cstorage", c.STORAGE, J.WIDGET_LOAD, n.id);
|
|
3773
3824
|
});
|
|
@@ -3783,11 +3834,11 @@ class Mr {
|
|
|
3783
3834
|
* @returns IResponse
|
|
3784
3835
|
*/
|
|
3785
3836
|
getWidgets = async (n) => {
|
|
3786
|
-
const i = (
|
|
3787
|
-
let _ = await this.db.table(O.WIDGET).toArray().then((
|
|
3788
|
-
|
|
3837
|
+
const i = (C) => n?.dashboard === C.dashboard_id, l = (C) => n?.type === C.type, E = (C) => n?.name ? C.name.includes(n?.name) : !1;
|
|
3838
|
+
let _ = await this.db.table(O.WIDGET).toArray().then((C) => n?.dashboard ? C.filter(i) : C).then((C) => n?.type ? C.filter(l) : C).then((C) => n?.name ? C.filter(E) : C).catch(() => {
|
|
3839
|
+
K(2, ["%cstorage", c.STORAGE, J.WIDGET_LOAD, n]);
|
|
3789
3840
|
});
|
|
3790
|
-
return _ !== void 0 &&
|
|
3841
|
+
return _ !== void 0 && K(3, [
|
|
3791
3842
|
"%cstorage%c %cwidgets",
|
|
3792
3843
|
c.STORAGE,
|
|
3793
3844
|
c.NONE,
|
|
@@ -3833,7 +3884,7 @@ class Mr {
|
|
|
3833
3884
|
*/
|
|
3834
3885
|
subscribe = (n) => (n = Ia(n), this.subscribers.filter(
|
|
3835
3886
|
(l) => l.widget === n.widget
|
|
3836
|
-
).length > 0 || (n.type === O.MESSAGES && (n =
|
|
3887
|
+
).length > 0 || (n.type === O.MESSAGES && (n = St(this.options, n)), console.info(
|
|
3837
3888
|
"%cstorage%c %csubscribe",
|
|
3838
3889
|
c.STORAGE,
|
|
3839
3890
|
c.NONE,
|
|
@@ -3859,7 +3910,7 @@ class Mr {
|
|
|
3859
3910
|
*/
|
|
3860
3911
|
getSlide = async (n) => {
|
|
3861
3912
|
const i = await this.db.table(O.SLIDE).where({ id: n.id }).last().catch(() => {
|
|
3862
|
-
|
|
3913
|
+
K(2, ["%cstorage", c.STORAGE, J.SLIDE_LOAD, n.id]);
|
|
3863
3914
|
});
|
|
3864
3915
|
return {
|
|
3865
3916
|
// @ts-ignore
|
|
@@ -3874,8 +3925,8 @@ class Mr {
|
|
|
3874
3925
|
* @returns IResponse
|
|
3875
3926
|
*/
|
|
3876
3927
|
getSlides = async (n) => {
|
|
3877
|
-
const i = (
|
|
3878
|
-
return _ !== void 0 &&
|
|
3928
|
+
const i = (C) => n?.id ? n.id = C.id : !1, l = (C) => n?.name ? C.name.includes(n?.name) : !1, _ = await this.db.table(O.SLIDE).toArray().then((C) => n?.id ? C.filter(i) : C).then((C) => n?.name ? C.filter(l) : C);
|
|
3929
|
+
return _ !== void 0 && K(3, ["%cstorage%c %cslides", c.STORAGE, c.NONE, c.SLIDE, n]), {
|
|
3879
3930
|
// @ts-ignore
|
|
3880
3931
|
data: _ !== void 0 ? { slides: _, query: n } : null,
|
|
3881
3932
|
message: _ !== void 0 ? "Slides loaded from storage" : "Slides load error",
|
|
@@ -3937,7 +3988,7 @@ class Mr {
|
|
|
3937
3988
|
*/
|
|
3938
3989
|
getPresentations = async (n) => {
|
|
3939
3990
|
const i = (_) => n?.name ? _.name.includes(n?.name) : !1, E = await this.db.table(O.PRESENTATION).toArray().then((_) => n?.name ? _.filter(i) : _);
|
|
3940
|
-
return E !== void 0 &&
|
|
3991
|
+
return E !== void 0 && K(3, [
|
|
3941
3992
|
"%cstorage%c %cpresentations",
|
|
3942
3993
|
c.STORAGE,
|
|
3943
3994
|
c.NONE,
|
|
@@ -3982,7 +4033,7 @@ class Mr {
|
|
|
3982
4033
|
*/
|
|
3983
4034
|
getPreference = async (n) => {
|
|
3984
4035
|
const i = await this.db.table(O.PREFERENCE).where({ id: n.id }).last().catch(() => {
|
|
3985
|
-
|
|
4036
|
+
K(2, [
|
|
3986
4037
|
"%cstorage",
|
|
3987
4038
|
c.STORAGE,
|
|
3988
4039
|
J.PREFERENCE_LOAD,
|
|
@@ -4003,7 +4054,7 @@ class Mr {
|
|
|
4003
4054
|
*/
|
|
4004
4055
|
getPreferences = async (n) => {
|
|
4005
4056
|
const i = (_) => n?.id ? n.id = _.id : !1, E = await this.db.table(O.SLIDE).toArray().then((_) => n?.id ? _.filter(i) : _);
|
|
4006
|
-
return E !== void 0 &&
|
|
4057
|
+
return E !== void 0 && K(3, [
|
|
4007
4058
|
"%cstorage%c %cpreferences",
|
|
4008
4059
|
c.STORAGE,
|
|
4009
4060
|
c.NONE,
|
|
@@ -4040,28 +4091,28 @@ class Mr {
|
|
|
4040
4091
|
success: !1
|
|
4041
4092
|
}));
|
|
4042
4093
|
}
|
|
4043
|
-
function
|
|
4094
|
+
function Hn(p) {
|
|
4044
4095
|
return new Promise((n, i) => {
|
|
4045
|
-
|
|
4096
|
+
p.oncomplete = p.onsuccess = () => n(p.result), p.onabort = p.onerror = () => i(p.error);
|
|
4046
4097
|
});
|
|
4047
4098
|
}
|
|
4048
|
-
function
|
|
4049
|
-
const i = indexedDB.open(
|
|
4099
|
+
function Ga(p, n) {
|
|
4100
|
+
const i = indexedDB.open(p);
|
|
4050
4101
|
i.onupgradeneeded = () => i.result.createObjectStore(n);
|
|
4051
|
-
const l =
|
|
4052
|
-
return (E, _) => l.then((
|
|
4102
|
+
const l = Hn(i);
|
|
4103
|
+
return (E, _) => l.then((C) => _(C.transaction(n, E).objectStore(n)));
|
|
4053
4104
|
}
|
|
4054
|
-
let
|
|
4105
|
+
let Un;
|
|
4055
4106
|
function Kr() {
|
|
4056
|
-
return
|
|
4107
|
+
return Un || (Un = Ga("keyval-store", "keyval")), Un;
|
|
4057
4108
|
}
|
|
4058
|
-
function
|
|
4059
|
-
return n("readonly", (i) =>
|
|
4109
|
+
function _e(p, n = Kr()) {
|
|
4110
|
+
return n("readonly", (i) => Hn(i.get(p)));
|
|
4060
4111
|
}
|
|
4061
|
-
function ke(
|
|
4062
|
-
return i("readwrite", (l) => (l.put(n,
|
|
4112
|
+
function ke(p, n, i = Kr()) {
|
|
4113
|
+
return i("readwrite", (l) => (l.put(n, p), Hn(l.transaction)));
|
|
4063
4114
|
}
|
|
4064
|
-
class
|
|
4115
|
+
class Gr {
|
|
4065
4116
|
subscribers = [];
|
|
4066
4117
|
options;
|
|
4067
4118
|
constructor(n) {
|
|
@@ -4069,15 +4120,15 @@ class Br {
|
|
|
4069
4120
|
}
|
|
4070
4121
|
getCloud = async (n) => {
|
|
4071
4122
|
const i = Y(n);
|
|
4072
|
-
return await
|
|
4123
|
+
return await _e(i).then((l) => l).catch(() => (console.warn("%capi", c.API, O.CLOUD, n.slide, n.widget), { data: null, message: "Cloud Data error", success: !1 }));
|
|
4073
4124
|
};
|
|
4074
4125
|
getSeries = async (n) => {
|
|
4075
4126
|
const i = Y(n);
|
|
4076
|
-
return await
|
|
4127
|
+
return await _e(i).then((l) => l).catch(() => (console.warn("%capi", c.API, O.SERIES, n.slide, n.widget), { data: null, message: "Series Data error", success: !1 }));
|
|
4077
4128
|
};
|
|
4078
4129
|
getMessages = async (n) => {
|
|
4079
4130
|
const i = Y(n);
|
|
4080
|
-
return await
|
|
4131
|
+
return await _e(i).then((l) => l).catch(() => (console.warn("%capi", c.API, O.MESSAGES, n.slide, n.widget), { data: null, message: "Messages Data error", success: !1 }));
|
|
4081
4132
|
};
|
|
4082
4133
|
/**
|
|
4083
4134
|
* Update Cloud
|
|
@@ -4141,7 +4192,7 @@ class Br {
|
|
|
4141
4192
|
};
|
|
4142
4193
|
getDashboard = async (n) => {
|
|
4143
4194
|
const i = Y(n);
|
|
4144
|
-
return await
|
|
4195
|
+
return await _e(i).then((l) => l).catch((l) => (console.warn("%capi", c.API, O.SLIDE, n.id), {
|
|
4145
4196
|
data: null,
|
|
4146
4197
|
message: `Widget ${n.data.id} load error: ${l.message}`,
|
|
4147
4198
|
success: !1
|
|
@@ -4180,7 +4231,7 @@ class Br {
|
|
|
4180
4231
|
};
|
|
4181
4232
|
getWidget = async (n) => {
|
|
4182
4233
|
const i = Y(n);
|
|
4183
|
-
return await
|
|
4234
|
+
return await _e(i).then((l) => l).catch((l) => (console.warn("%capi", c.API, O.SLIDE, n.id), {
|
|
4184
4235
|
data: null,
|
|
4185
4236
|
message: `Widget ${n.data.id} load error: ${l.message}`,
|
|
4186
4237
|
success: !1
|
|
@@ -4224,7 +4275,7 @@ class Br {
|
|
|
4224
4275
|
* @param query IQuery
|
|
4225
4276
|
* @returns null
|
|
4226
4277
|
*/
|
|
4227
|
-
subscribe = (n) => (n.type === O.MESSAGES && (n =
|
|
4278
|
+
subscribe = (n) => (n.type === O.MESSAGES && (n = St(this.options, n)), this.subscribers.filter(
|
|
4228
4279
|
(l) => l.widget === n.widget
|
|
4229
4280
|
).length > 0 || (console.debug(
|
|
4230
4281
|
"%cstorage%c %csubscribe",
|
|
@@ -4241,7 +4292,7 @@ class Br {
|
|
|
4241
4292
|
getSubscribers = async () => await new Promise((n) => n(this.subscribers));
|
|
4242
4293
|
getSlide = async (n) => {
|
|
4243
4294
|
const i = Y(n);
|
|
4244
|
-
return await
|
|
4295
|
+
return await _e(i).then((l) => l).catch((l) => (console.warn("%capi", c.API, O.SLIDE, n.id), {
|
|
4245
4296
|
data: null,
|
|
4246
4297
|
message: `Slide ${n.data.id} load error: ${l.message}`,
|
|
4247
4298
|
success: !1
|
|
@@ -4282,7 +4333,7 @@ class Br {
|
|
|
4282
4333
|
};
|
|
4283
4334
|
getPresentation = async (n) => {
|
|
4284
4335
|
const i = Y(n);
|
|
4285
|
-
return await
|
|
4336
|
+
return await _e(i).then((l) => l).catch((l) => (console.warn("%capi", c.API, O.PRESENTATION, n.id), {
|
|
4286
4337
|
data: null,
|
|
4287
4338
|
message: `Slide ${n.data.id} load error: ${l.message}`,
|
|
4288
4339
|
success: !1
|
|
@@ -4316,12 +4367,12 @@ class Br {
|
|
|
4316
4367
|
success: !1
|
|
4317
4368
|
}));
|
|
4318
4369
|
};
|
|
4319
|
-
getPreference = async (n) => await
|
|
4370
|
+
getPreference = async (n) => await _e(`${O.PREFERENCE}.${n.id}`).then((i) => i).catch((i) => (console.warn("%capi", c.API, O.PREFERENCE, n.id), {
|
|
4320
4371
|
data: null,
|
|
4321
4372
|
message: `Preference ${n.id} get error: ${i.message}`,
|
|
4322
4373
|
success: !1
|
|
4323
4374
|
}));
|
|
4324
|
-
getPreferences = async () => await
|
|
4375
|
+
getPreferences = async () => await _e(`${O.PREFERENCE}`).then((n) => n).catch((n) => (console.warn("%capi", c.API, O.PREFERENCE), {
|
|
4325
4376
|
data: null,
|
|
4326
4377
|
message: `Preferences get error: ${n.message}`,
|
|
4327
4378
|
success: !1
|
|
@@ -4347,7 +4398,7 @@ class Br {
|
|
|
4347
4398
|
success: !1
|
|
4348
4399
|
}));
|
|
4349
4400
|
}
|
|
4350
|
-
class
|
|
4401
|
+
class Br {
|
|
4351
4402
|
subscribers = [];
|
|
4352
4403
|
options;
|
|
4353
4404
|
constructor(n) {
|
|
@@ -4520,7 +4571,7 @@ class Gr {
|
|
|
4520
4571
|
* @param query IQuery
|
|
4521
4572
|
* @returns null
|
|
4522
4573
|
*/
|
|
4523
|
-
subscribe = (n) => (n.type === O.MESSAGES && (n =
|
|
4574
|
+
subscribe = (n) => (n.type === O.MESSAGES && (n = St(this.options, n)), this.subscribers.filter(
|
|
4524
4575
|
(l) => l.widget === n.widget
|
|
4525
4576
|
).length || (console.debug(
|
|
4526
4577
|
"%cstorage%c %csubscribe",
|
|
@@ -4834,7 +4885,7 @@ class Lr {
|
|
|
4834
4885
|
* @param query IQuery
|
|
4835
4886
|
* @returns null
|
|
4836
4887
|
*/
|
|
4837
|
-
subscribe = (n) => (n.type === O.MESSAGES && (n =
|
|
4888
|
+
subscribe = (n) => (n.type === O.MESSAGES && (n = St(this.options, n)), this.subscribers.filter(
|
|
4838
4889
|
(l) => l.widget === n.widget
|
|
4839
4890
|
).length || (console.debug(
|
|
4840
4891
|
"%cstorage%c %csubscribe",
|
|
@@ -4980,7 +5031,7 @@ class Lr {
|
|
|
4980
5031
|
}
|
|
4981
5032
|
};
|
|
4982
5033
|
}
|
|
4983
|
-
class
|
|
5034
|
+
class Wr {
|
|
4984
5035
|
subscribers = [];
|
|
4985
5036
|
options;
|
|
4986
5037
|
constructor(n) {
|
|
@@ -5148,7 +5199,7 @@ class Fr {
|
|
|
5148
5199
|
* @param query IQuery
|
|
5149
5200
|
* @returns null
|
|
5150
5201
|
*/
|
|
5151
|
-
subscribe = (n) => (n.type === O.MESSAGES && (n =
|
|
5202
|
+
subscribe = (n) => (n.type === O.MESSAGES && (n = St(this.options, n)), this.subscribers.filter(
|
|
5152
5203
|
(l) => l.widget === n.widget
|
|
5153
5204
|
).length || (console.debug(
|
|
5154
5205
|
"%cstorage%c %csubscribe",
|
|
@@ -5295,7 +5346,7 @@ class La {
|
|
|
5295
5346
|
subscribers = [];
|
|
5296
5347
|
//private temp: {[x:string]:any} = []
|
|
5297
5348
|
constructor(n) {
|
|
5298
|
-
|
|
5349
|
+
K(3, [
|
|
5299
5350
|
"%cpresentation",
|
|
5300
5351
|
c.PRESENTATION,
|
|
5301
5352
|
n.presentation,
|
|
@@ -5303,23 +5354,23 @@ class La {
|
|
|
5303
5354
|
xa
|
|
5304
5355
|
]), this.options = n, this.sm = null;
|
|
5305
5356
|
const i = n.presentation;
|
|
5306
|
-
switch (this.bc = new BroadcastChannel(i),
|
|
5357
|
+
switch (this.bc = new BroadcastChannel(i), K(3, ["%cchannel%c %capi", c.BROADCAST, c.NONE, c.API, i]), this.bc.onmessage = (l) => {
|
|
5307
5358
|
this.actions(l);
|
|
5308
5359
|
}, this.bc.postMessage({ event: J.STORAGE_INIT, data: {} }), this.api = new ka(n), n.storage) {
|
|
5309
|
-
case
|
|
5360
|
+
case he.DEXIE:
|
|
5310
5361
|
this.sm = new Mr(n);
|
|
5311
5362
|
break;
|
|
5312
|
-
case
|
|
5363
|
+
case he.LOCAL:
|
|
5313
5364
|
this.sm = new Lr(n);
|
|
5314
5365
|
break;
|
|
5315
|
-
case
|
|
5316
|
-
this.sm = new Gr(n);
|
|
5317
|
-
break;
|
|
5318
|
-
case pe.KEYVAL:
|
|
5366
|
+
case he.SESSION:
|
|
5319
5367
|
this.sm = new Br(n);
|
|
5320
5368
|
break;
|
|
5321
|
-
case
|
|
5322
|
-
this.sm = new
|
|
5369
|
+
case he.KEYVAL:
|
|
5370
|
+
this.sm = new Gr(n);
|
|
5371
|
+
break;
|
|
5372
|
+
case he.WINDOW:
|
|
5373
|
+
this.sm = new Wr(n);
|
|
5323
5374
|
break;
|
|
5324
5375
|
}
|
|
5325
5376
|
}
|
|
@@ -5345,10 +5396,10 @@ class La {
|
|
|
5345
5396
|
let _ = "";
|
|
5346
5397
|
switch (n.query.type) {
|
|
5347
5398
|
case O.MESSAGES:
|
|
5348
|
-
let
|
|
5349
|
-
|
|
5399
|
+
let C;
|
|
5400
|
+
C = n.data.messages.filter(
|
|
5350
5401
|
(G) => G.id !== null
|
|
5351
|
-
), n.data.messages =
|
|
5402
|
+
), n.data.messages = C, _ = Fn(n.data.messages), E?.hash && E.hash === _ ? (K(3, [
|
|
5352
5403
|
"%cload%c %cmessages%c %cno updates",
|
|
5353
5404
|
c.OK,
|
|
5354
5405
|
c.NONE,
|
|
@@ -5356,10 +5407,10 @@ class La {
|
|
|
5356
5407
|
c.NONE,
|
|
5357
5408
|
c.NO_UPDATES,
|
|
5358
5409
|
n.query.widget
|
|
5359
|
-
]),
|
|
5410
|
+
]), K(4, ["%cmessages", c.MESSAGES, n]), l = 204) : (i = n, E.hash = _, l = await this.sm?.setMessages(n.query, n).then(async (G) => (G = 201, this.broadcastUpdate(G, n))));
|
|
5360
5411
|
break;
|
|
5361
5412
|
case O.CLOUD:
|
|
5362
|
-
_ = Fn(n.data.cloud), E?.hash && E.hash === _ ? (
|
|
5413
|
+
_ = Fn(n.data.cloud), E?.hash && E.hash === _ ? (K(3, [
|
|
5363
5414
|
"%cload%c %ccloud%c %cno updates",
|
|
5364
5415
|
c.OK,
|
|
5365
5416
|
c.NONE,
|
|
@@ -5367,7 +5418,7 @@ class La {
|
|
|
5367
5418
|
c.NONE,
|
|
5368
5419
|
c.NO_UPDATES,
|
|
5369
5420
|
n.query.widget
|
|
5370
|
-
]),
|
|
5421
|
+
]), K(4, ["%ccloud", c.CLOUD, n.query]), l = 204) : (E.hash = _, i = {
|
|
5371
5422
|
data: {
|
|
5372
5423
|
cloud: n.data
|
|
5373
5424
|
},
|
|
@@ -5377,7 +5428,7 @@ class La {
|
|
|
5377
5428
|
}, l = await this.sm?.setCloud(n.query, i.data).then((G) => this.broadcastUpdate(G, n)));
|
|
5378
5429
|
break;
|
|
5379
5430
|
case O.SERIES:
|
|
5380
|
-
_ = Fn(n.data.series), E?.hash && E.hash === _ ? (
|
|
5431
|
+
_ = Fn(n.data.series), E?.hash && E.hash === _ ? (K(3, [
|
|
5381
5432
|
"%cload%c %cseries%c %cno updates",
|
|
5382
5433
|
c.OK,
|
|
5383
5434
|
c.NONE,
|
|
@@ -5385,7 +5436,7 @@ class La {
|
|
|
5385
5436
|
c.NONE,
|
|
5386
5437
|
c.NO_UPDATES,
|
|
5387
5438
|
n.query.widget
|
|
5388
|
-
]),
|
|
5439
|
+
]), K(4, ["%cseries", c.SERIES, n]), l = 204) : (E.hash = _, i = {
|
|
5389
5440
|
data: n.data,
|
|
5390
5441
|
message: n.message,
|
|
5391
5442
|
success: n.success,
|
|
@@ -5393,7 +5444,7 @@ class La {
|
|
|
5393
5444
|
}, l = await this.sm?.setSeries(n.query, n.data).then((G) => this.broadcastUpdate(G, n)));
|
|
5394
5445
|
break;
|
|
5395
5446
|
default:
|
|
5396
|
-
|
|
5447
|
+
K(4, [
|
|
5397
5448
|
"%cload%c %cunknown%c %cno updates",
|
|
5398
5449
|
c.KO,
|
|
5399
5450
|
c.NONE,
|
|
@@ -5404,7 +5455,7 @@ class La {
|
|
|
5404
5455
|
]), l = 204;
|
|
5405
5456
|
}
|
|
5406
5457
|
} else
|
|
5407
|
-
switch (
|
|
5458
|
+
switch (K(2, [
|
|
5408
5459
|
"%cload%c %cunknown%c %cno updates",
|
|
5409
5460
|
c.KO,
|
|
5410
5461
|
c.NONE,
|
|
@@ -5431,7 +5482,7 @@ class La {
|
|
|
5431
5482
|
broadcastUpdate = (n, i) => {
|
|
5432
5483
|
switch (n) {
|
|
5433
5484
|
case 201:
|
|
5434
|
-
|
|
5485
|
+
K(3, [
|
|
5435
5486
|
`%cupdate%c %cwidget%c %c${i.query?.type}`,
|
|
5436
5487
|
c.BROADCAST,
|
|
5437
5488
|
c.NONE,
|
|
@@ -5440,7 +5491,7 @@ class La {
|
|
|
5440
5491
|
kr(i.query),
|
|
5441
5492
|
//@ts-ignore
|
|
5442
5493
|
`${i.data?.title ?? ""} ${i.query.widget}`
|
|
5443
|
-
]),
|
|
5494
|
+
]), K(4, [
|
|
5444
5495
|
"%cevent",
|
|
5445
5496
|
c.BROADCAST,
|
|
5446
5497
|
//@ts-ignore
|
|
@@ -5453,7 +5504,7 @@ class La {
|
|
|
5453
5504
|
case 204:
|
|
5454
5505
|
break;
|
|
5455
5506
|
default:
|
|
5456
|
-
|
|
5507
|
+
K(2, [
|
|
5457
5508
|
`%cupdate%c %cwidget%c %c${i.query?.type}`,
|
|
5458
5509
|
c.KO,
|
|
5459
5510
|
c.NONE,
|
|
@@ -5476,7 +5527,7 @@ class La {
|
|
|
5476
5527
|
this.addSubscriber(n.data.data);
|
|
5477
5528
|
break;
|
|
5478
5529
|
case J.UPDATE:
|
|
5479
|
-
|
|
5530
|
+
K(3, [
|
|
5480
5531
|
"%cupdate%c %capi%c %cstorage",
|
|
5481
5532
|
c.BROADCAST,
|
|
5482
5533
|
c.NONE,
|
|
@@ -5490,7 +5541,7 @@ class La {
|
|
|
5490
5541
|
};
|
|
5491
5542
|
cleanMessages = async () => {
|
|
5492
5543
|
if (this.options?.suspended) {
|
|
5493
|
-
|
|
5544
|
+
K(2, [
|
|
5494
5545
|
"%cclean%c %cstorage%c %cmessages",
|
|
5495
5546
|
c.KO,
|
|
5496
5547
|
c.NONE,
|
|
@@ -5504,7 +5555,7 @@ class La {
|
|
|
5504
5555
|
const n = this.options?.retention || 86400 * 4, i = await this.sm?.cleanMessages(
|
|
5505
5556
|
n
|
|
5506
5557
|
);
|
|
5507
|
-
|
|
5558
|
+
K(3, [
|
|
5508
5559
|
"%cclean%c %cstorage%c %cmessages",
|
|
5509
5560
|
c.OK,
|
|
5510
5561
|
c.NONE,
|
|
@@ -5516,7 +5567,7 @@ class La {
|
|
|
5516
5567
|
};
|
|
5517
5568
|
hideMessage = async (n) => {
|
|
5518
5569
|
const i = await this.sm?.hideMessage(n.id, 0);
|
|
5519
|
-
return
|
|
5570
|
+
return K(3, [
|
|
5520
5571
|
"%chide%c %cstorage%c %cmessages",
|
|
5521
5572
|
c.OK,
|
|
5522
5573
|
c.NONE,
|
|
@@ -5554,24 +5605,24 @@ class La {
|
|
|
5554
5605
|
getDashboards = async (n) => await this.sm?.getDashboards();
|
|
5555
5606
|
setDashboard = async (n) => await this.sm?.setDashboard(n);
|
|
5556
5607
|
}
|
|
5557
|
-
class
|
|
5608
|
+
class Ba {
|
|
5558
5609
|
sm;
|
|
5559
5610
|
constructor(n) {
|
|
5560
5611
|
switch (this.sm = null, n.storage) {
|
|
5561
|
-
case
|
|
5612
|
+
case he.DEXIE:
|
|
5562
5613
|
this.sm = new Mr(n);
|
|
5563
5614
|
break;
|
|
5564
|
-
case
|
|
5615
|
+
case he.LOCAL:
|
|
5565
5616
|
this.sm = new Lr(n);
|
|
5566
5617
|
break;
|
|
5567
|
-
case
|
|
5568
|
-
this.sm = new Gr(n);
|
|
5569
|
-
break;
|
|
5570
|
-
case pe.KEYVAL:
|
|
5618
|
+
case he.SESSION:
|
|
5571
5619
|
this.sm = new Br(n);
|
|
5572
5620
|
break;
|
|
5573
|
-
case
|
|
5574
|
-
this.sm = new
|
|
5621
|
+
case he.KEYVAL:
|
|
5622
|
+
this.sm = new Gr(n);
|
|
5623
|
+
break;
|
|
5624
|
+
case he.WINDOW:
|
|
5625
|
+
this.sm = new Wr(n);
|
|
5575
5626
|
break;
|
|
5576
5627
|
}
|
|
5577
5628
|
}
|
|
@@ -5581,10 +5632,12 @@ class Ga {
|
|
|
5581
5632
|
* @returns IResponse
|
|
5582
5633
|
*/
|
|
5583
5634
|
getCloud = async (n) => n.type !== O.CLOUD ? (console.warn(
|
|
5584
|
-
"%
|
|
5585
|
-
c.
|
|
5635
|
+
"%cget%c %cstorage%c %ccloud",
|
|
5636
|
+
c.KO,
|
|
5586
5637
|
c.NONE,
|
|
5587
|
-
c.
|
|
5638
|
+
c.STORAGE,
|
|
5639
|
+
c.NONE,
|
|
5640
|
+
c.CLOUD,
|
|
5588
5641
|
n.widget,
|
|
5589
5642
|
"wrong method call for getMessages, type used is",
|
|
5590
5643
|
n.type
|
|
@@ -5599,12 +5652,12 @@ class Ga {
|
|
|
5599
5652
|
* @returns IResponse
|
|
5600
5653
|
*/
|
|
5601
5654
|
getMessages = async (n) => n.type !== O.MESSAGES ? (console.warn(
|
|
5602
|
-
"%
|
|
5603
|
-
c.
|
|
5655
|
+
"%cget%c %cstorage%c %cmessages",
|
|
5656
|
+
c.KO,
|
|
5604
5657
|
c.NONE,
|
|
5605
|
-
c.
|
|
5658
|
+
c.STORAGE,
|
|
5606
5659
|
c.NONE,
|
|
5607
|
-
c.
|
|
5660
|
+
c.MESSAGES,
|
|
5608
5661
|
n.widget,
|
|
5609
5662
|
"wrong method call for getMessages, type used is",
|
|
5610
5663
|
n.type
|
|
@@ -5619,10 +5672,12 @@ class Ga {
|
|
|
5619
5672
|
* @returns IResponse
|
|
5620
5673
|
*/
|
|
5621
5674
|
getSeries = async (n) => n.type !== O.SERIES ? (console.warn(
|
|
5622
|
-
"%
|
|
5623
|
-
c.
|
|
5675
|
+
"%cget%c %cstorage%c %cseries",
|
|
5676
|
+
c.KO,
|
|
5624
5677
|
c.NONE,
|
|
5625
|
-
c.
|
|
5678
|
+
c.STORAGE,
|
|
5679
|
+
c.NONE,
|
|
5680
|
+
c.SERIES,
|
|
5626
5681
|
n.widget,
|
|
5627
5682
|
"wrong method call for getMessages, type used is",
|
|
5628
5683
|
n.type
|
|
@@ -5632,7 +5687,7 @@ class Ga {
|
|
|
5632
5687
|
success: !1
|
|
5633
5688
|
}) : await this.sm?.getSeries(n);
|
|
5634
5689
|
}
|
|
5635
|
-
class
|
|
5690
|
+
class Wa {
|
|
5636
5691
|
storageReader;
|
|
5637
5692
|
broadcastChannel;
|
|
5638
5693
|
element;
|
|
@@ -5650,7 +5705,7 @@ class Fa {
|
|
|
5650
5705
|
let E;
|
|
5651
5706
|
E = { ...n.dataset }, delete E.hmr, E.presentation = n.closest(l)?.getAttribute("presentation") ?? `${l} not found`, this.query = E, Da(n);
|
|
5652
5707
|
const _ = window.BuzzCasting.getOptions();
|
|
5653
|
-
this.storageReader = new
|
|
5708
|
+
this.storageReader = new Ba(_), this.broadcastChannel = new BroadcastChannel(E.presentation), this.broadcastListener();
|
|
5654
5709
|
}
|
|
5655
5710
|
addCallbackListener(n) {
|
|
5656
5711
|
this.callbacks.push(n);
|
|
@@ -5668,7 +5723,7 @@ class Fa {
|
|
|
5668
5723
|
try {
|
|
5669
5724
|
if (l.dashboard === n.dashboard && l.widget === n.widget) {
|
|
5670
5725
|
const E = await this.getData();
|
|
5671
|
-
E?.success && (
|
|
5726
|
+
E?.success && (K(4, [
|
|
5672
5727
|
"%cset%c %cbroadcast%c %cwidget",
|
|
5673
5728
|
c.OK,
|
|
5674
5729
|
c.NONE,
|
|
@@ -5681,7 +5736,7 @@ class Fa {
|
|
|
5681
5736
|
}));
|
|
5682
5737
|
}
|
|
5683
5738
|
} catch {
|
|
5684
|
-
|
|
5739
|
+
K(4, [J.WIDGET_UPDATE, l]);
|
|
5685
5740
|
}
|
|
5686
5741
|
break;
|
|
5687
5742
|
case J.APP_READY:
|
|
@@ -5695,14 +5750,14 @@ class Fa {
|
|
|
5695
5750
|
* This takes place when the container indicates it has finished loading (ready)
|
|
5696
5751
|
*/
|
|
5697
5752
|
subscribe() {
|
|
5698
|
-
|
|
5753
|
+
K(3, [
|
|
5699
5754
|
"%csubscribe%c %cwidget",
|
|
5700
5755
|
c.SUBSCRIBE,
|
|
5701
5756
|
c.NONE,
|
|
5702
5757
|
c.WIDGET,
|
|
5703
5758
|
this.query.presentation,
|
|
5704
5759
|
this.query.widget
|
|
5705
|
-
]),
|
|
5760
|
+
]), K(4, ["%cwidget", c.WIDGET, this.query]), this.broadcastChannel.postMessage({
|
|
5706
5761
|
event: J.SUBSCRIBE,
|
|
5707
5762
|
data: this.query
|
|
5708
5763
|
});
|
|
@@ -5733,7 +5788,7 @@ class Fa {
|
|
|
5733
5788
|
*
|
|
5734
5789
|
* @returns IResponse
|
|
5735
5790
|
*/
|
|
5736
|
-
getCloud = async () => this.query.type !== O.CLOUD ? (
|
|
5791
|
+
getCloud = async () => this.query.type !== O.CLOUD ? (K(3, [
|
|
5737
5792
|
"%cget%c %cstorage%c %cwidget",
|
|
5738
5793
|
c.KO,
|
|
5739
5794
|
c.NONE,
|
|
@@ -5743,7 +5798,7 @@ class Fa {
|
|
|
5743
5798
|
this.query.widget,
|
|
5744
5799
|
"Wrong method call for getCloud, expected type is",
|
|
5745
5800
|
this.query.type
|
|
5746
|
-
]),
|
|
5801
|
+
]), K(4, ["%ccloud", c.CLOUD, this.query]), {
|
|
5747
5802
|
data: null,
|
|
5748
5803
|
message: `wrong method call for getCloud, expected type is '${this.query.type}'`,
|
|
5749
5804
|
success: !1,
|
|
@@ -5754,7 +5809,7 @@ class Fa {
|
|
|
5754
5809
|
*
|
|
5755
5810
|
* @returns IResponse
|
|
5756
5811
|
*/
|
|
5757
|
-
getMessages = async () => this.query.type !== O.MESSAGES ? (
|
|
5812
|
+
getMessages = async () => this.query.type !== O.MESSAGES ? (K(3, [
|
|
5758
5813
|
"%cget%c %cstorage%c %cwidget",
|
|
5759
5814
|
c.KO,
|
|
5760
5815
|
c.NONE,
|
|
@@ -5764,7 +5819,7 @@ class Fa {
|
|
|
5764
5819
|
this.query.widget,
|
|
5765
5820
|
"Wrong method call for getMessages, expected type is",
|
|
5766
5821
|
this.query.type
|
|
5767
|
-
]),
|
|
5822
|
+
]), K(4, ["%cmessages", c.MESSAGES, this.query]), {
|
|
5768
5823
|
data: null,
|
|
5769
5824
|
message: `wrong method call for getMessages, expected type is '${this.query.type}'`,
|
|
5770
5825
|
success: !1
|
|
@@ -5774,7 +5829,7 @@ class Fa {
|
|
|
5774
5829
|
*
|
|
5775
5830
|
* @returns IResponse
|
|
5776
5831
|
*/
|
|
5777
|
-
getSeries = async () => this.query.type !== O.SERIES ? (
|
|
5832
|
+
getSeries = async () => this.query.type !== O.SERIES ? (K(3, [
|
|
5778
5833
|
"%cget%c %cstorage%c %cwidget",
|
|
5779
5834
|
c.KO,
|
|
5780
5835
|
c.NONE,
|
|
@@ -5784,7 +5839,7 @@ class Fa {
|
|
|
5784
5839
|
this.query.widget,
|
|
5785
5840
|
"Wrong method call for getSeries, expected type is",
|
|
5786
5841
|
this.query.type
|
|
5787
|
-
]),
|
|
5842
|
+
]), K(4, ["%cseries", this.query]), {
|
|
5788
5843
|
data: null,
|
|
5789
5844
|
message: `wrong method call for getSeries, expected type is '${this.query.type}'`,
|
|
5790
5845
|
success: !1,
|
|
@@ -5797,7 +5852,7 @@ class Fa {
|
|
|
5797
5852
|
* @param modal IModal
|
|
5798
5853
|
*/
|
|
5799
5854
|
showModal = (n) => {
|
|
5800
|
-
|
|
5855
|
+
K(3, [
|
|
5801
5856
|
"%cwidget",
|
|
5802
5857
|
c.WIDGET,
|
|
5803
5858
|
J.SHOW_MODAL,
|
|
@@ -5825,6 +5880,6 @@ class Fa {
|
|
|
5825
5880
|
}
|
|
5826
5881
|
export {
|
|
5827
5882
|
La as BuzzcastingStorageManager,
|
|
5828
|
-
|
|
5829
|
-
|
|
5883
|
+
Ba as BuzzcastingStorageReader,
|
|
5884
|
+
Wa as Widget
|
|
5830
5885
|
};
|