buzzcasting-storage 3.21.0 → 3.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/buzzcasting-storage.esm.js +857 -857
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var w = /* @__PURE__ */ ((f) => (f.CARDS = "cards", f.CLOUD = "cloud", f.DASHBOARD = "dashboard", f.DASHBOARDS = "dashboards", f.IMAGES = "images", f.MESSAGES = "messages", f.PREFERENCE = "preference", f.PREFERENCES = "preferences", f.PRESENTATION = "presentation", f.PRESENTATIONS = "presentations", f.SERIES = "series", f.SLIDE = "slide", f.SLIDES = "slides", f.TOPICS = "topics", f.WIDGET = "widget", f.WIDGETS = "widgets", f))(w || {}),
|
|
1
|
+
var w = /* @__PURE__ */ ((f) => (f.CARDS = "cards", f.CLOUD = "cloud", f.DASHBOARD = "dashboard", f.DASHBOARDS = "dashboards", f.IMAGES = "images", f.MESSAGES = "messages", f.PREFERENCE = "preference", f.PREFERENCES = "preferences", f.PRESENTATION = "presentation", f.PRESENTATIONS = "presentations", f.SERIES = "series", f.SLIDE = "slide", f.SLIDES = "slides", f.TOPICS = "topics", f.WIDGET = "widget", f.WIDGETS = "widgets", f))(w || {}), o = /* @__PURE__ */ ((f) => (f.API = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;", f.APP = "color:white;background-color:navy;padding:0 4px 0 4px;border-radius:5px;", f.BROADCAST = "color:navy;background-color:orange;padding:0 4px 0 4px;border-radius:5px;", f.CLOUD = "color:purple;background-color:mistyrose;padding:0 4px 0 4px;border-radius:5px;", f.DATA = "color:grey;background-color:lightskyblue;padding:0 4px 0 4px;border-radius:5px;", f.ERROR = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", f.GET_DATA = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", f.HIDE = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", f.KO = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", f.MESSAGES = "color:white;background-color:darkslateblue;padding:0 4px 0 4px;border-radius:5px;", f.NO_UPDATES = "color:grey;border:1px solid grey;padding:0 4px 0 4px;border-radius:5px;", f.NONE = "color:transparent;background-color:transparent;", f.OK = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", f.PRESENTATION = "color:white;background-color:darkred;padding:0 4px 0 4px;border-radius:5px;", f.SERIES = "color:purple;background-color:thistle;padding:0 4px 0 4px;border-radius:5px;", f.SLIDE = "color:black;background-color:yellow;padding:0 4px 0 4px;border-radius:5px;", f.STORAGE = "color:black;background-color:cyan;padding:0 4px 0 4px;border-radius:5px;", f.SUBSCRIBE = "color:white;background-color:dodgerblue;padding:0 4px 0 4px;border-radius:5px;", f.WIDGET = "color:black;background-color:lemonchiffon;padding:0 4px 0 4px;border-radius:5px;", f.WS = "color:white;background-color:green;padding:0 4px 0 4px;border-radius:5px;", f))(o || {}), Z = /* @__PURE__ */ ((f) => (f.ADD_SLIDE = "addSlide", f.APP_READY = "appReady", f.API_UPDATE = "apiUpdate", f.BACKGROUND_UPDATE = "backgroundUpdate", f.BUILDER_PREVIEW = "builderPreview", f.COMPONENT_UPDATE = "componentUpdate", f.APPROVE_MESSAGE = "approveMessage", f.CHANNEL = "channel", f.CLEAN_MESSAGES = "cleanMessages", f.CLOSE_BUILDER_DIALOG = "closeBuilderDialog", f.CLOSE_BUILDER_MODAL = "closeBuilderModal", f.CLOSE_MODAL = "closeModal", f.COLOR_UPDATE = "colorUpdate", f.COMPONENT_INDEX = "componentIndex", f.CSS_SET = "setCss", f.CSS_STORE = "storeCss", f.DASHBOARD_LOAD = "loadDashboard", f.DASHBOARD_STORE = "storeDashboard", f.DASHBOARD_UPDATED = "dashboardUpdated", f.ERROR = "error", f.HIDE_MESSAGE = "hideMessage", f.HIDE_LABELS = "hideLabels", f.IMAGE_GET = "getImage", f.IMAGE_SET = "setImage", f.IMAGE_STORED = "imageStored", f.LAUPPUT_UPDATE = "layoutUpdate", f.PREV_SLIDE = "prevSlide", f.RELOAD_PRESENTATION = "reloadPresentation", f.STAR_MESSAGE = "starMessage", f.GOTO_SLIDE = "gotoSlide", f.NEXT_SLIDE = "nextSlide", f.PREFERENCE_LOAD = "loadPreference", f.PREFERENCE_STORE = "storePreference", f.PREFERENCE_UPDATED = "preferenceUpdated", f.PAUSE_PRESENTATION = "pausePresentation", f.PRESENTATION_READY = "presentationReady", f.PRESENTATION_LOAD = "loadPresentation", f.PRESENTATION_STORE = "storePresentation", f.PRESENTATION_UPDATED = "presentationUpdated", f.ROW_COL_UPDATE = "rowcolupdate", f.SCREENSHOT_TAKE = "takeScreenshot", f.SCREENSHOT_STORE = "storeScreenshot", f.SECTION_UPDATE = "sectionUpdate", f.SHOW_BUILDER_DIALOG = "showBuilderDialog", f.SHOW_BUILDER_MODAL = "showBuilderModal", f.SHOW_MODAL = "showModal", f.SLIDE_DID_LOAD = "slideDidLoad", f.SLIDE_GET = "getSlide", f.SLIDE_GOTO = "slideGoto", f.SLIDE_LOAD = "loadSlide", f.SLIDE_READY = "slideReady", f.SLIDE_SAVED = "slideSaved", f.SLIDE_SET = "setSlide", f.SLIDE_STORE = "storeSlide", f.SLIDE_STORED = "slideStored", f.SLIDE_TRANSITIONER = "slideTransitioner", f.SLIDE_UPDATED = "slideUpdated", f.START_TRANSITIONER = "startTransitioner", f.STORAGE_INIT = "storageInit", f.STREAM = "stream", f.SUBSCRIBE = "subscribe", f.SUSPEND_ACCOUNT = "suspendAccount", f.SWITCH_PRESENTATION = "switchPresentation", f.REMOVE_CLOUD = "removeCloud", f.UPDATE = "update", f.UPLOAD_COMPLETED = "uploadCompleted", f.VERSION = "version", f.WIDGETS_CLEAR = "widgetsClear", f.WIDGET_DID_LOAD = "widgetDidLoad", f.WIDGET_DID_UPDATE = "widgetDidUpdate", f.WIDGET_LOAD = "widgetLoad", f.WIDGET_STORE = "widgetStore", f.WIDGET_UPDATE = "widgetUpdate", f.WS_API_REQUEST = "wsApiRequest", f.WS_API_RESPONSE = "wsApiResponse", f.WS_API_UPDATE = "wsApiRUpdate", f))(Z || {}), rr = /* @__PURE__ */ ((f) => (f.APPROVED = "approved", f.BEFORE = "before", f.DELAYED = "delayed", f.NONE = "none", f.REALTIME = "realtime", f))(rr || {}), pe = /* @__PURE__ */ ((f) => (f.KEYVAL = "keyval", f.LOCAL = "local", f.SESSION = "session", f.DEXIE = "dexie", f.WINDOW = "window", f))(pe || {});
|
|
2
2
|
function Na(f) {
|
|
3
3
|
const t = {};
|
|
4
4
|
for (let s = 0; s < f.length; s++) {
|
|
@@ -57,37 +57,37 @@ function ka(f) {
|
|
|
57
57
|
function Ur(f) {
|
|
58
58
|
return Ia(Mn(0, f, "", []).toString(16), 8);
|
|
59
59
|
}
|
|
60
|
-
const
|
|
60
|
+
const it = (f) => {
|
|
61
61
|
let t = {}, s = f.split(",");
|
|
62
62
|
for (let l = 0; l < s.length; l++) t[s[l]] = !0;
|
|
63
63
|
return t;
|
|
64
64
|
};
|
|
65
|
-
|
|
65
|
+
it(
|
|
66
66
|
"area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr"
|
|
67
67
|
);
|
|
68
|
-
|
|
68
|
+
it(
|
|
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
|
+
it(
|
|
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
|
+
it("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr");
|
|
75
|
+
it(
|
|
76
76
|
"checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"
|
|
77
77
|
);
|
|
78
|
-
|
|
78
|
+
it("script,style");
|
|
79
79
|
const xa = new BroadcastChannel("logging"), C = async (f = 0, t) => {
|
|
80
80
|
xa.postMessage({ action: "log", level: f, message: t });
|
|
81
81
|
}, _t = (f) => {
|
|
82
82
|
switch (f?.type) {
|
|
83
83
|
case w.MESSAGES:
|
|
84
|
-
return
|
|
84
|
+
return o.MESSAGES;
|
|
85
85
|
case w.SERIES:
|
|
86
|
-
return
|
|
86
|
+
return o.SERIES;
|
|
87
87
|
case w.CLOUD:
|
|
88
|
-
return
|
|
88
|
+
return o.CLOUD;
|
|
89
89
|
default:
|
|
90
|
-
return
|
|
90
|
+
return o.NO_UPDATES;
|
|
91
91
|
}
|
|
92
92
|
};
|
|
93
93
|
function X(f) {
|
|
@@ -118,7 +118,7 @@ function Pt(f, t) {
|
|
|
118
118
|
}
|
|
119
119
|
return t;
|
|
120
120
|
}
|
|
121
|
-
const Ca = "3.
|
|
121
|
+
const Ca = "3.21.0";
|
|
122
122
|
async function* Ga(f) {
|
|
123
123
|
const t = f.pipeThrough(new TextDecoderStream("utf-8")).getReader();
|
|
124
124
|
let s = "";
|
|
@@ -176,21 +176,21 @@ class ja {
|
|
|
176
176
|
let R = "";
|
|
177
177
|
switch (t.type) {
|
|
178
178
|
case w.MESSAGES:
|
|
179
|
-
R =
|
|
179
|
+
R = o.MESSAGES;
|
|
180
180
|
break;
|
|
181
181
|
case w.SERIES:
|
|
182
|
-
R =
|
|
182
|
+
R = o.SERIES;
|
|
183
183
|
break;
|
|
184
184
|
case w.CLOUD:
|
|
185
|
-
R =
|
|
185
|
+
R = o.CLOUD;
|
|
186
186
|
break;
|
|
187
187
|
}
|
|
188
188
|
return C(3, [
|
|
189
189
|
`%cfetch%c %capi%c %c${t.type}`,
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
190
|
+
o.OK,
|
|
191
|
+
o.NONE,
|
|
192
|
+
o.API,
|
|
193
|
+
o.NONE,
|
|
194
194
|
R,
|
|
195
195
|
t.widget,
|
|
196
196
|
m
|
|
@@ -219,9 +219,9 @@ class ja {
|
|
|
219
219
|
const { version: s } = this.options, l = this.headers(), m = "?action=visible";
|
|
220
220
|
return C(3, [
|
|
221
221
|
"%capi%c %cput",
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
222
|
+
o.API,
|
|
223
|
+
o.NONE,
|
|
224
|
+
o.GET_DATA,
|
|
225
225
|
Z.HIDE_MESSAGE,
|
|
226
226
|
t.widget,
|
|
227
227
|
t.id
|
|
@@ -240,9 +240,9 @@ class ja {
|
|
|
240
240
|
m.append(`custom_filters[${R}]`, T);
|
|
241
241
|
return console.info(
|
|
242
242
|
"%capi%c %cput",
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
243
|
+
o.API,
|
|
244
|
+
o.NONE,
|
|
245
|
+
o.GET_DATA,
|
|
246
246
|
Z.HIDE_LABELS,
|
|
247
247
|
t.widget,
|
|
248
248
|
g
|
|
@@ -259,11 +259,11 @@ class ja {
|
|
|
259
259
|
const { version: s } = this.options, l = this.headers(), m = Object.assign({}, t);
|
|
260
260
|
return delete m.type, delete m.hash, C(3, [
|
|
261
261
|
"%cload%c %capi%c %cslide",
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
262
|
+
o.OK,
|
|
263
|
+
o.NONE,
|
|
264
|
+
o.API,
|
|
265
|
+
o.NONE,
|
|
266
|
+
o.SLIDE,
|
|
267
267
|
t.id
|
|
268
268
|
]), await fetch(
|
|
269
269
|
[this.url, "api", s, "slides", t.id].join("/"),
|
|
@@ -292,11 +292,11 @@ class ja {
|
|
|
292
292
|
const m = JSON.stringify(t);
|
|
293
293
|
return C(3, [
|
|
294
294
|
"%cput%c %capi%c %cslide",
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
295
|
+
o.OK,
|
|
296
|
+
o.NONE,
|
|
297
|
+
o.API,
|
|
298
|
+
o.NONE,
|
|
299
|
+
o.SLIDE,
|
|
300
300
|
Z.SLIDE_STORE,
|
|
301
301
|
t.id
|
|
302
302
|
]), await fetch(
|
|
@@ -312,11 +312,11 @@ class ja {
|
|
|
312
312
|
const { version: s } = this.options, l = this.headers();
|
|
313
313
|
return delete t.update, C(3, [
|
|
314
314
|
"%cload%c %capi%c %cpresentation",
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
315
|
+
o.OK,
|
|
316
|
+
o.NONE,
|
|
317
|
+
o.API,
|
|
318
|
+
o.NONE,
|
|
319
|
+
o.PRESENTATION,
|
|
320
320
|
t.id
|
|
321
321
|
]), await fetch(
|
|
322
322
|
[this.url, "api", s, w.PRESENTATIONS, t.id].join("/"),
|
|
@@ -341,7 +341,7 @@ class ja {
|
|
|
341
341
|
const { version: s } = this.options, l = this.formHeaders();
|
|
342
342
|
delete t.update;
|
|
343
343
|
const m = JSON.stringify(t);
|
|
344
|
-
return C(2, ["%capi%c %cput",
|
|
344
|
+
return C(2, ["%capi%c %cput", o.API, o.NONE, o.PRESENTATION, t.name]), await fetch(
|
|
345
345
|
[this.url, "api", s, w.PRESENTATIONS, t.id].join("/"),
|
|
346
346
|
{ ...l, body: m, method: "put" }
|
|
347
347
|
).then((g) => {
|
|
@@ -354,11 +354,11 @@ class ja {
|
|
|
354
354
|
const { version: s } = this.options, l = this.headers();
|
|
355
355
|
return C(3, [
|
|
356
356
|
"%cload%c %capi%c %cpreference",
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
357
|
+
o.OK,
|
|
358
|
+
o.NONE,
|
|
359
|
+
o.API,
|
|
360
|
+
o.NONE,
|
|
361
|
+
o.APP,
|
|
362
362
|
t.id
|
|
363
363
|
]), await fetch(
|
|
364
364
|
[this.url, "api", s, w.PREFERENCES, t.id].join("/"),
|
|
@@ -375,9 +375,9 @@ class ja {
|
|
|
375
375
|
const m = JSON.stringify({ data: t });
|
|
376
376
|
return C(3, [
|
|
377
377
|
"%capi%c %cstorePreference",
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
378
|
+
o.API,
|
|
379
|
+
o.NONE,
|
|
380
|
+
o.APP,
|
|
381
381
|
t.id
|
|
382
382
|
]), await fetch(
|
|
383
383
|
[this.url, "api", s, w.PREFERENCES, t.id].join("/"),
|
|
@@ -390,7 +390,7 @@ class ja {
|
|
|
390
390
|
}
|
|
391
391
|
async loadDashboards(t) {
|
|
392
392
|
const { version: s } = this.options, l = this.headers();
|
|
393
|
-
return C(3, ["%capi%c %cdashboards",
|
|
393
|
+
return C(3, ["%capi%c %cdashboards", o.API, o.NONE, o.WIDGET]), await fetch(
|
|
394
394
|
[this.url, "api", s, w.WIDGETS, t?.id || ""].join("/"),
|
|
395
395
|
{
|
|
396
396
|
...l,
|
|
@@ -410,11 +410,11 @@ class ja {
|
|
|
410
410
|
const { version: s } = this.options, l = this.headers();
|
|
411
411
|
return C(3, [
|
|
412
412
|
"%cload%c %capi%c %cimage",
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
413
|
+
o.OK,
|
|
414
|
+
o.NONE,
|
|
415
|
+
o.API,
|
|
416
|
+
o.NONE,
|
|
417
|
+
o.WIDGET
|
|
418
418
|
]), await fetch(
|
|
419
419
|
`${[this.url, "api", s, w.IMAGES].join(
|
|
420
420
|
"/"
|
|
@@ -437,9 +437,9 @@ class ja {
|
|
|
437
437
|
const { version: s } = this.options, l = this.fileHeaders(), m = t;
|
|
438
438
|
return console.info(
|
|
439
439
|
"%capi%c %cstoreImage",
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
440
|
+
o.API,
|
|
441
|
+
o.NONE,
|
|
442
|
+
o.WIDGET,
|
|
443
443
|
t.get("name")
|
|
444
444
|
), await fetch(
|
|
445
445
|
`${[this.url, "api", s, w.IMAGES].join(
|
|
@@ -460,9 +460,9 @@ class ja {
|
|
|
460
460
|
const { version: l } = this.options, m = this.formHeaders();
|
|
461
461
|
return console.info(
|
|
462
462
|
"%capi%c %cdeleteImage",
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
463
|
+
o.API,
|
|
464
|
+
o.NONE,
|
|
465
|
+
o.WIDGET,
|
|
466
466
|
s
|
|
467
467
|
), await fetch(
|
|
468
468
|
`${[this.url, "api", l, w.IMAGES, s].join(
|
|
@@ -490,20 +490,20 @@ function Ba() {
|
|
|
490
490
|
return (s = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, a) {
|
|
491
491
|
n.__proto__ = a;
|
|
492
492
|
} || function(n, a) {
|
|
493
|
-
for (var
|
|
493
|
+
for (var i in a) Object.prototype.hasOwnProperty.call(a, i) && (n[i] = a[i]);
|
|
494
494
|
})(e, r);
|
|
495
495
|
}, l = function() {
|
|
496
496
|
return (l = Object.assign || function(e) {
|
|
497
|
-
for (var r, n = 1, a = arguments.length; n < a; n++) for (var
|
|
497
|
+
for (var r, n = 1, a = arguments.length; n < a; n++) for (var i in r = arguments[n]) Object.prototype.hasOwnProperty.call(r, i) && (e[i] = r[i]);
|
|
498
498
|
return e;
|
|
499
499
|
}).apply(this, arguments);
|
|
500
500
|
};
|
|
501
501
|
function m(e, r, n) {
|
|
502
|
-
for (var a,
|
|
502
|
+
for (var a, i = 0, c = r.length; i < c; i++) !a && i in r || ((a = a || Array.prototype.slice.call(r, 0, i))[i] = r[i]);
|
|
503
503
|
return e.concat(a || Array.prototype.slice.call(r));
|
|
504
504
|
}
|
|
505
505
|
var g = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Ma, R = Object.keys, T = Array.isArray;
|
|
506
|
-
function
|
|
506
|
+
function F(e, r) {
|
|
507
507
|
return typeof r != "object" || R(r).forEach(function(n) {
|
|
508
508
|
e[n] = r[n];
|
|
509
509
|
}), e;
|
|
@@ -518,9 +518,9 @@ function Ba() {
|
|
|
518
518
|
Pe(e, n, r[n]);
|
|
519
519
|
});
|
|
520
520
|
}
|
|
521
|
-
var
|
|
521
|
+
var ot = Object.defineProperty;
|
|
522
522
|
function Pe(e, r, n, a) {
|
|
523
|
-
|
|
523
|
+
ot(e, r, F(n && ae(n, "get") && typeof n.get == "function" ? { get: n.get, set: n.set, configurable: !0 } : { value: n, configurable: !0, writable: !0 }, a));
|
|
524
524
|
}
|
|
525
525
|
function Ye(e) {
|
|
526
526
|
return { from: function(r) {
|
|
@@ -544,7 +544,7 @@ function Ba() {
|
|
|
544
544
|
if (typeof r == "string" && ae(e, r)) return e[r];
|
|
545
545
|
if (!r) return e;
|
|
546
546
|
if (typeof r != "string") {
|
|
547
|
-
for (var n = [], a = 0,
|
|
547
|
+
for (var n = [], a = 0, i = r.length; a < i; ++a) {
|
|
548
548
|
var c = Ee(e, r[a]);
|
|
549
549
|
n.push(c);
|
|
550
550
|
}
|
|
@@ -559,7 +559,7 @@ function Ba() {
|
|
|
559
559
|
function ue(e, r, n) {
|
|
560
560
|
if (e && r !== void 0 && !("isFrozen" in Object && Object.isFrozen(e))) if (typeof r != "string" && "length" in r) {
|
|
561
561
|
ct(typeof n != "string" && "length" in n);
|
|
562
|
-
for (var a = 0,
|
|
562
|
+
for (var a = 0, i = r.length; a < i; ++a) ue(e, r[a], n[a]);
|
|
563
563
|
} else {
|
|
564
564
|
var c, u, d = r.indexOf(".");
|
|
565
565
|
d !== -1 ? (c = r.substr(0, d), (u = r.substr(d + 1)) === "" ? n === void 0 ? T(e) && !isNaN(parseInt(c)) ? e.splice(c, 1) : delete e[c] : e[c] = n : ue(d = !(d = e[c]) || !ae(e, c) ? e[c] = {} : d, u, n)) : n === void 0 ? T(e) && !isNaN(parseInt(r)) ? e.splice(r, 1) : delete e[r] : e[r] = n;
|
|
@@ -590,7 +590,7 @@ function Ba() {
|
|
|
590
590
|
if (a) return a;
|
|
591
591
|
if (T(n)) {
|
|
592
592
|
a = [], ut.set(n, a);
|
|
593
|
-
for (var
|
|
593
|
+
for (var i = 0, c = n.length; i < c; ++i) a.push(r(n[i]));
|
|
594
594
|
} else if (Jr.has(n.constructor)) a = n;
|
|
595
595
|
else {
|
|
596
596
|
var u, d = me(n);
|
|
@@ -614,12 +614,12 @@ function Ba() {
|
|
|
614
614
|
}
|
|
615
615
|
var Xe = {};
|
|
616
616
|
function we(e) {
|
|
617
|
-
var r, n, a,
|
|
617
|
+
var r, n, a, i;
|
|
618
618
|
if (arguments.length === 1) {
|
|
619
619
|
if (T(e)) return e.slice();
|
|
620
620
|
if (this === Xe && typeof e == "string") return [e];
|
|
621
|
-
if (
|
|
622
|
-
for (n = []; !(a =
|
|
621
|
+
if (i = Xn(e)) {
|
|
622
|
+
for (n = []; !(a = i.next()).done; ) n.push(a.value);
|
|
623
623
|
return n;
|
|
624
624
|
}
|
|
625
625
|
if (e == null) return [e];
|
|
@@ -630,7 +630,7 @@ function Ba() {
|
|
|
630
630
|
for (r = arguments.length, n = new Array(r); r--; ) n[r] = arguments[r];
|
|
631
631
|
return n;
|
|
632
632
|
}
|
|
633
|
-
var
|
|
633
|
+
var ir = typeof Symbol < "u" ? function(e) {
|
|
634
634
|
return e[Symbol.toStringTag] === "AsyncFunction";
|
|
635
635
|
} : function() {
|
|
636
636
|
return !1;
|
|
@@ -641,8 +641,8 @@ function Ba() {
|
|
|
641
641
|
function Zr(e, r) {
|
|
642
642
|
return e + ". Errors: " + Object.keys(r).map(function(n) {
|
|
643
643
|
return r[n].toString();
|
|
644
|
-
}).filter(function(n, a,
|
|
645
|
-
return
|
|
644
|
+
}).filter(function(n, a, i) {
|
|
645
|
+
return i.indexOf(n) === a;
|
|
646
646
|
}).join(`
|
|
647
647
|
`);
|
|
648
648
|
}
|
|
@@ -657,13 +657,13 @@ function Ba() {
|
|
|
657
657
|
Ye(Qe).from(Error).extend({ toString: function() {
|
|
658
658
|
return this.name + ": " + this.message;
|
|
659
659
|
} }), Ye(Nt).from(Qe), Ye(Je).from(Qe);
|
|
660
|
-
var
|
|
660
|
+
var or = he.reduce(function(e, r) {
|
|
661
661
|
return e[r] = r + "Error", e;
|
|
662
662
|
}, {}), Jn = Qe, B = he.reduce(function(e, r) {
|
|
663
663
|
var n = r + "Error";
|
|
664
|
-
function a(
|
|
665
|
-
this.name = n,
|
|
666
|
-
` + c : ""), this.inner = c || null) : typeof
|
|
664
|
+
function a(i, c) {
|
|
665
|
+
this.name = n, i ? typeof i == "string" ? (this.message = "".concat(i).concat(c ? `
|
|
666
|
+
` + c : ""), this.inner = c || null) : typeof i == "object" && (this.message = "".concat(i.name, " ").concat(i.message), this.inner = i) : (this.message = Qn[r] || n, this.inner = null);
|
|
667
667
|
}
|
|
668
668
|
return Ye(a).from(Jn), e[r] = a, e;
|
|
669
669
|
}, {});
|
|
@@ -692,10 +692,10 @@ function Ba() {
|
|
|
692
692
|
return e === Q ? r : function() {
|
|
693
693
|
var n = e.apply(this, arguments);
|
|
694
694
|
n !== void 0 && (arguments[0] = n);
|
|
695
|
-
var a = this.onsuccess,
|
|
695
|
+
var a = this.onsuccess, i = this.onerror;
|
|
696
696
|
this.onsuccess = null, this.onerror = null;
|
|
697
697
|
var c = r.apply(this, arguments);
|
|
698
|
-
return a && (this.onsuccess = this.onsuccess ? je(a, this.onsuccess) : a),
|
|
698
|
+
return a && (this.onsuccess = this.onsuccess ? je(a, this.onsuccess) : a), i && (this.onerror = this.onerror ? je(i, this.onerror) : i), c !== void 0 ? c : n;
|
|
699
699
|
};
|
|
700
700
|
}
|
|
701
701
|
function ea(e, r) {
|
|
@@ -708,9 +708,9 @@ function Ba() {
|
|
|
708
708
|
function ta(e, r) {
|
|
709
709
|
return e === Q ? r : function(n) {
|
|
710
710
|
var a = e.apply(this, arguments);
|
|
711
|
-
|
|
712
|
-
var
|
|
713
|
-
return this.onsuccess = null, this.onerror = null, n = r.apply(this, arguments),
|
|
711
|
+
F(n, a);
|
|
712
|
+
var i = this.onsuccess, c = this.onerror;
|
|
713
|
+
return this.onsuccess = null, this.onerror = null, n = r.apply(this, arguments), i && (this.onsuccess = this.onsuccess ? je(i, this.onsuccess) : i), c && (this.onerror = this.onerror ? je(c, this.onerror) : c), a === void 0 ? n === void 0 ? void 0 : n : F(a, n);
|
|
714
714
|
};
|
|
715
715
|
}
|
|
716
716
|
function ra(e, r) {
|
|
@@ -722,7 +722,7 @@ function Ba() {
|
|
|
722
722
|
return e === Q ? r : function() {
|
|
723
723
|
var n = e.apply(this, arguments);
|
|
724
724
|
if (n && typeof n.then == "function") {
|
|
725
|
-
for (var a = this,
|
|
725
|
+
for (var a = this, i = arguments.length, c = new Array(i); i--; ) c[i] = arguments[i];
|
|
726
726
|
return n.then(function() {
|
|
727
727
|
return r.apply(a, c);
|
|
728
728
|
});
|
|
@@ -751,9 +751,9 @@ function Ba() {
|
|
|
751
751
|
if (e !== dt) throw new TypeError("Not a function");
|
|
752
752
|
return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 && fr(this, this._value));
|
|
753
753
|
}
|
|
754
|
-
this._state = null, this._value = null, ++r.ref, (function n(a,
|
|
754
|
+
this._state = null, this._value = null, ++r.ref, (function n(a, i) {
|
|
755
755
|
try {
|
|
756
|
-
|
|
756
|
+
i(function(c) {
|
|
757
757
|
if (a._state === null) {
|
|
758
758
|
if (c === a) throw new TypeError("A promise cannot be resolved with itself.");
|
|
759
759
|
var u = a._lib && Ze();
|
|
@@ -769,9 +769,9 @@ function Ba() {
|
|
|
769
769
|
}
|
|
770
770
|
var hr = { get: function() {
|
|
771
771
|
var e = L, r = Gt;
|
|
772
|
-
function n(a,
|
|
772
|
+
function n(a, i) {
|
|
773
773
|
var c = this, u = !e.global && (e !== L || r !== Gt), d = u && !Te(), p = new M(function(y, S) {
|
|
774
|
-
gr(c, new rn(sn(a, e, u, d), sn(
|
|
774
|
+
gr(c, new rn(sn(a, e, u, d), sn(i, e, u, d), y, S, e));
|
|
775
775
|
});
|
|
776
776
|
return this._consoleTask && (p._consoleTask = this._consoleTask), p;
|
|
777
777
|
}
|
|
@@ -781,21 +781,21 @@ function Ba() {
|
|
|
781
781
|
return e;
|
|
782
782
|
}, set: hr.set });
|
|
783
783
|
} };
|
|
784
|
-
function rn(e, r, n, a,
|
|
785
|
-
this.onFulfilled = typeof e == "function" ? e : null, this.onRejected = typeof r == "function" ? r : null, this.resolve = n, this.reject = a, this.psd =
|
|
784
|
+
function rn(e, r, n, a, i) {
|
|
785
|
+
this.onFulfilled = typeof e == "function" ? e : null, this.onRejected = typeof r == "function" ? r : null, this.resolve = n, this.reject = a, this.psd = i;
|
|
786
786
|
}
|
|
787
787
|
function fr(e, r) {
|
|
788
788
|
var n, a;
|
|
789
|
-
Rt.push(r), e._state === null && (n = e._lib && Ze(), r = dr(r), e._state = !1, e._value = r, a = e, Le.some(function(
|
|
790
|
-
return
|
|
789
|
+
Rt.push(r), e._state === null && (n = e._lib && Ze(), r = dr(r), e._state = !1, e._value = r, a = e, Le.some(function(i) {
|
|
790
|
+
return i._value === a._value;
|
|
791
791
|
}) || Le.push(a), nn(e), n && qe());
|
|
792
792
|
}
|
|
793
793
|
function nn(e) {
|
|
794
794
|
var r = e._listeners;
|
|
795
795
|
e._listeners = [];
|
|
796
796
|
for (var n = 0, a = r.length; n < a; ++n) gr(e, r[n]);
|
|
797
|
-
var
|
|
798
|
-
--
|
|
797
|
+
var i = e._PSD;
|
|
798
|
+
--i.ref || i.finalize(), Be === 0 && (++Be, ft(function() {
|
|
799
799
|
--Be == 0 && pr();
|
|
800
800
|
}, []));
|
|
801
801
|
}
|
|
@@ -808,10 +808,10 @@ function Ba() {
|
|
|
808
808
|
}
|
|
809
809
|
function na(e, r, n) {
|
|
810
810
|
try {
|
|
811
|
-
var a,
|
|
811
|
+
var a, i = r._value;
|
|
812
812
|
!r._state && Rt.length && (Rt = []), a = ye && r._consoleTask ? r._consoleTask.run(function() {
|
|
813
|
-
return e(
|
|
814
|
-
}) : e(
|
|
813
|
+
return e(i);
|
|
814
|
+
}) : e(i), r._state || Rt.indexOf(i) !== -1 || (function(c) {
|
|
815
815
|
for (var u = Le.length; u; ) if (Le[--u]._value === c._value) return Le.splice(u, 1);
|
|
816
816
|
})(r), n.resolve(a);
|
|
817
817
|
} catch (c) {
|
|
@@ -852,13 +852,13 @@ function Ba() {
|
|
|
852
852
|
function q(e, r) {
|
|
853
853
|
var n = L;
|
|
854
854
|
return function() {
|
|
855
|
-
var a = Ze(),
|
|
855
|
+
var a = Ze(), i = L;
|
|
856
856
|
try {
|
|
857
857
|
return Ie(n, !0), e.apply(this, arguments);
|
|
858
858
|
} catch (c) {
|
|
859
859
|
r && r(c);
|
|
860
860
|
} finally {
|
|
861
|
-
Ie(
|
|
861
|
+
Ie(i, !1), a && qe();
|
|
862
862
|
}
|
|
863
863
|
};
|
|
864
864
|
}
|
|
@@ -884,19 +884,19 @@ function Ba() {
|
|
|
884
884
|
});
|
|
885
885
|
}, timeout: function(e, r) {
|
|
886
886
|
var n = this;
|
|
887
|
-
return e < 1 / 0 ? new M(function(a,
|
|
887
|
+
return e < 1 / 0 ? new M(function(a, i) {
|
|
888
888
|
var c = setTimeout(function() {
|
|
889
|
-
return
|
|
889
|
+
return i(new B.Timeout(r));
|
|
890
890
|
}, e);
|
|
891
|
-
n.then(a,
|
|
891
|
+
n.then(a, i).finally(clearTimeout.bind(null, c));
|
|
892
892
|
}) : this;
|
|
893
893
|
} }), typeof Symbol < "u" && Symbol.toStringTag && Pe(M.prototype, Symbol.toStringTag, "Dexie.Promise"), De.env = an(), ge(M, { all: function() {
|
|
894
894
|
var e = we.apply(null, arguments).map(jt);
|
|
895
895
|
return new M(function(r, n) {
|
|
896
896
|
e.length === 0 && r([]);
|
|
897
897
|
var a = e.length;
|
|
898
|
-
e.forEach(function(
|
|
899
|
-
return M.resolve(
|
|
898
|
+
e.forEach(function(i, c) {
|
|
899
|
+
return M.resolve(i).then(function(u) {
|
|
900
900
|
e[c] = u, --a || r(e);
|
|
901
901
|
}, n);
|
|
902
902
|
});
|
|
@@ -928,12 +928,12 @@ function Ba() {
|
|
|
928
928
|
dr = e;
|
|
929
929
|
} }, follow: function(e, r) {
|
|
930
930
|
return new M(function(n, a) {
|
|
931
|
-
return Ne(function(
|
|
931
|
+
return Ne(function(i, c) {
|
|
932
932
|
var u = L;
|
|
933
933
|
u.unhandleds = [], u.onunhandled = c, u.finalize = je(function() {
|
|
934
934
|
var d, p = this;
|
|
935
935
|
d = function() {
|
|
936
|
-
p.unhandleds.length === 0 ?
|
|
936
|
+
p.unhandleds.length === 0 ? i() : c(p.unhandleds[0]);
|
|
937
937
|
}, kt.push(function y() {
|
|
938
938
|
d(), kt.splice(kt.indexOf(y), 1);
|
|
939
939
|
}), ++Be, ft(function() {
|
|
@@ -947,8 +947,8 @@ function Ba() {
|
|
|
947
947
|
return new M(function(r) {
|
|
948
948
|
e.length === 0 && r([]);
|
|
949
949
|
var n = e.length, a = new Array(n);
|
|
950
|
-
e.forEach(function(
|
|
951
|
-
return M.resolve(
|
|
950
|
+
e.forEach(function(i, c) {
|
|
951
|
+
return M.resolve(i).then(function(u) {
|
|
952
952
|
return a[c] = { status: "fulfilled", value: u };
|
|
953
953
|
}, function(u) {
|
|
954
954
|
return a[c] = { status: "rejected", reason: u };
|
|
@@ -961,20 +961,20 @@ function Ba() {
|
|
|
961
961
|
var e = we.apply(null, arguments).map(jt);
|
|
962
962
|
return new M(function(r, n) {
|
|
963
963
|
e.length === 0 && n(new AggregateError([]));
|
|
964
|
-
var a = e.length,
|
|
964
|
+
var a = e.length, i = new Array(a);
|
|
965
965
|
e.forEach(function(c, u) {
|
|
966
966
|
return M.resolve(c).then(function(d) {
|
|
967
967
|
return r(d);
|
|
968
968
|
}, function(d) {
|
|
969
|
-
|
|
969
|
+
i[u] = d, --a || n(new AggregateError(i));
|
|
970
970
|
});
|
|
971
971
|
});
|
|
972
972
|
});
|
|
973
973
|
}), Ke.withResolvers && (M.withResolvers = Ke.withResolvers));
|
|
974
|
-
var re = { awaits: 0, echoes: 0, id: 0 }, sa = 0, $t = [], Ct = 0, Gt = 0,
|
|
974
|
+
var re = { awaits: 0, echoes: 0, id: 0 }, sa = 0, $t = [], Ct = 0, Gt = 0, ia = 0;
|
|
975
975
|
function Ne(e, r, n, a) {
|
|
976
|
-
var
|
|
977
|
-
return c.parent =
|
|
976
|
+
var i = L, c = Object.create(i);
|
|
977
|
+
return c.parent = i, c.ref = 0, c.global = !1, c.id = ++ia, De.env, c.env = ur ? { Promise: M, PromiseProp: { value: M, configurable: !0, writable: !0 }, all: M.all, race: M.race, allSettled: M.allSettled, any: M.any, resolve: M.resolve, reject: M.reject } : {}, r && F(c, r), ++i.ref, c.finalize = function() {
|
|
978
978
|
--this.parent.ref || this.parent.finalize();
|
|
979
979
|
}, a = We(c, e, n, a), c.ref === 0 && c.finalize(), a;
|
|
980
980
|
}
|
|
@@ -991,36 +991,36 @@ function Ba() {
|
|
|
991
991
|
return Te(), ee(r);
|
|
992
992
|
})) : e;
|
|
993
993
|
}
|
|
994
|
-
function
|
|
994
|
+
function oa() {
|
|
995
995
|
var e = $t[$t.length - 1];
|
|
996
996
|
$t.pop(), Ie(e, !1);
|
|
997
997
|
}
|
|
998
998
|
function Ie(e, r) {
|
|
999
999
|
var n, a = L;
|
|
1000
|
-
(r ? !re.echoes || Ct++ && e === L : !Ct || --Ct && e === L) || queueMicrotask(r ? function(
|
|
1001
|
-
++Gt, re.echoes && --re.echoes != 0 || (re.echoes = re.awaits = re.id = 0), $t.push(L), Ie(
|
|
1002
|
-
}.bind(null, e) :
|
|
1000
|
+
(r ? !re.echoes || Ct++ && e === L : !Ct || --Ct && e === L) || queueMicrotask(r ? function(i) {
|
|
1001
|
+
++Gt, re.echoes && --re.echoes != 0 || (re.echoes = re.awaits = re.id = 0), $t.push(L), Ie(i, !0);
|
|
1002
|
+
}.bind(null, e) : oa), e !== L && (L = e, a === De && (De.env = an()), ur && (n = De.env.Promise, r = e.env, (a.global || e.global) && (Object.defineProperty(g, "Promise", r.PromiseProp), n.all = r.all, n.race = r.race, n.resolve = r.resolve, n.reject = r.reject, r.allSettled && (n.allSettled = r.allSettled), r.any && (n.any = r.any))));
|
|
1003
1003
|
}
|
|
1004
1004
|
function an() {
|
|
1005
1005
|
var e = g.Promise;
|
|
1006
1006
|
return ur ? { Promise: e, PromiseProp: Object.getOwnPropertyDescriptor(g, "Promise"), all: e.all, race: e.race, allSettled: e.allSettled, any: e.any, resolve: e.resolve, reject: e.reject } : {};
|
|
1007
1007
|
}
|
|
1008
|
-
function We(e, r, n, a,
|
|
1008
|
+
function We(e, r, n, a, i) {
|
|
1009
1009
|
var c = L;
|
|
1010
1010
|
try {
|
|
1011
|
-
return Ie(e, !0), r(n, a,
|
|
1011
|
+
return Ie(e, !0), r(n, a, i);
|
|
1012
1012
|
} finally {
|
|
1013
1013
|
Ie(c, !1);
|
|
1014
1014
|
}
|
|
1015
1015
|
}
|
|
1016
1016
|
function sn(e, r, n, a) {
|
|
1017
1017
|
return typeof e != "function" ? e : function() {
|
|
1018
|
-
var
|
|
1018
|
+
var i = L;
|
|
1019
1019
|
n && et(), Ie(r, !0);
|
|
1020
1020
|
try {
|
|
1021
1021
|
return e.apply(this, arguments);
|
|
1022
1022
|
} finally {
|
|
1023
|
-
Ie(
|
|
1023
|
+
Ie(i, !1), a && queueMicrotask(Te);
|
|
1024
1024
|
}
|
|
1025
1025
|
};
|
|
1026
1026
|
}
|
|
@@ -1045,7 +1045,7 @@ function Ba() {
|
|
|
1045
1045
|
function un() {
|
|
1046
1046
|
throw B.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.");
|
|
1047
1047
|
}
|
|
1048
|
-
function
|
|
1048
|
+
function z(e, r) {
|
|
1049
1049
|
try {
|
|
1050
1050
|
var n = ln(e), a = ln(r);
|
|
1051
1051
|
if (n !== a) return n === "Array" ? 1 : a === "Array" ? -1 : n === "binary" ? 1 : a === "binary" ? -1 : n === "string" ? 1 : a === "string" ? -1 : n === "Date" ? 1 : a !== "Date" ? NaN : -1;
|
|
@@ -1055,14 +1055,14 @@ function Ba() {
|
|
|
1055
1055
|
case "string":
|
|
1056
1056
|
return r < e ? 1 : e < r ? -1 : 0;
|
|
1057
1057
|
case "binary":
|
|
1058
|
-
return (function(
|
|
1059
|
-
for (var u =
|
|
1058
|
+
return (function(i, c) {
|
|
1059
|
+
for (var u = i.length, d = c.length, p = u < d ? u : d, y = 0; y < p; ++y) if (i[y] !== c[y]) return i[y] < c[y] ? -1 : 1;
|
|
1060
1060
|
return u === d ? 0 : u < d ? -1 : 1;
|
|
1061
1061
|
})(dn(e), dn(r));
|
|
1062
1062
|
case "Array":
|
|
1063
|
-
return (function(
|
|
1064
|
-
for (var u =
|
|
1065
|
-
var S =
|
|
1063
|
+
return (function(i, c) {
|
|
1064
|
+
for (var u = i.length, d = c.length, p = u < d ? u : d, y = 0; y < p; ++y) {
|
|
1065
|
+
var S = z(i[y], c[y]);
|
|
1066
1066
|
if (S !== 0) return S;
|
|
1067
1067
|
}
|
|
1068
1068
|
return u === d ? 0 : u < d ? -1 : 1;
|
|
@@ -1081,10 +1081,10 @@ function Ba() {
|
|
|
1081
1081
|
}
|
|
1082
1082
|
function Lt(e, r, n) {
|
|
1083
1083
|
var a = e.schema.yProps;
|
|
1084
|
-
return a ? (r && 0 < n.numFailures && (r = r.filter(function(
|
|
1084
|
+
return a ? (r && 0 < n.numFailures && (r = r.filter(function(i, c) {
|
|
1085
1085
|
return !n.failures[c];
|
|
1086
|
-
})), Promise.all(a.map(function(
|
|
1087
|
-
return
|
|
1086
|
+
})), Promise.all(a.map(function(i) {
|
|
1087
|
+
return i = i.updatesTable, r ? e.db.table(i).where("k").anyOf(r).delete() : e.db.table(i).clear();
|
|
1088
1088
|
})).then(function() {
|
|
1089
1089
|
return n;
|
|
1090
1090
|
})) : n;
|
|
@@ -1104,8 +1104,8 @@ function Ba() {
|
|
|
1104
1104
|
}
|
|
1105
1105
|
if (r.remove !== void 0) {
|
|
1106
1106
|
var a = r.remove;
|
|
1107
|
-
if (T(a)) return T(e) ? e.filter(function(
|
|
1108
|
-
return !a.includes(
|
|
1107
|
+
if (T(a)) return T(e) ? e.filter(function(i) {
|
|
1108
|
+
return !a.includes(i);
|
|
1109
1109
|
}).sort() : [];
|
|
1110
1110
|
if (typeof a == "number") return Number(e) - a;
|
|
1111
1111
|
if (typeof a == "bigint") try {
|
|
@@ -1121,16 +1121,16 @@ function Ba() {
|
|
|
1121
1121
|
this["@@propmod"] = e;
|
|
1122
1122
|
}
|
|
1123
1123
|
function fn(e, r) {
|
|
1124
|
-
for (var n = R(r), a = n.length,
|
|
1124
|
+
for (var n = R(r), a = n.length, i = !1, c = 0; c < a; ++c) {
|
|
1125
1125
|
var u = n[c], d = r[u], p = Ee(e, u);
|
|
1126
|
-
d instanceof pt ? (ue(e, u, d.execute(p)),
|
|
1126
|
+
d instanceof pt ? (ue(e, u, d.execute(p)), i = !0) : p !== d && (ue(e, u, d), i = !0);
|
|
1127
1127
|
}
|
|
1128
|
-
return
|
|
1128
|
+
return i;
|
|
1129
1129
|
}
|
|
1130
1130
|
var gn = (J.prototype._trans = function(e, r, n) {
|
|
1131
|
-
var a = this._tx || L.trans,
|
|
1131
|
+
var a = this._tx || L.trans, i = this.name, c = ye && typeof console < "u" && console.createTask && console.createTask("Dexie: ".concat(e === "readonly" ? "read" : "write", " ").concat(this.name));
|
|
1132
1132
|
function u(y, S, h) {
|
|
1133
|
-
if (!h.schema[
|
|
1133
|
+
if (!h.schema[i]) throw new B.NotFound("Table " + i + " not part of transaction");
|
|
1134
1134
|
return r(h.idbtrans, h);
|
|
1135
1135
|
}
|
|
1136
1136
|
var d = Ze();
|
|
@@ -1143,7 +1143,7 @@ function Ba() {
|
|
|
1143
1143
|
try {
|
|
1144
1144
|
v.create(), S._state.PR1398_maxLoop = 3;
|
|
1145
1145
|
} catch (E) {
|
|
1146
|
-
return E.name ===
|
|
1146
|
+
return E.name === or.InvalidState && S.isOpen() && 0 < --S._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), S.close({ disableAutoOpen: !1 }), S.open().then(function() {
|
|
1147
1147
|
return y(S, h, _, b);
|
|
1148
1148
|
})) : ee(E);
|
|
1149
1149
|
}
|
|
@@ -1179,8 +1179,8 @@ function Ba() {
|
|
|
1179
1179
|
}, J.prototype.get = function(e, r) {
|
|
1180
1180
|
var n = this;
|
|
1181
1181
|
return e && e.constructor === Object ? this.where(e).first(r) : e == null ? ee(new B.Type("Invalid argument to Table.get()")) : this._trans("readonly", function(a) {
|
|
1182
|
-
return n.core.get({ trans: a, key: e }).then(function(
|
|
1183
|
-
return n.hook.reading.fire(
|
|
1182
|
+
return n.core.get({ trans: a, key: e }).then(function(i) {
|
|
1183
|
+
return n.hook.reading.fire(i);
|
|
1184
1184
|
});
|
|
1185
1185
|
}).then(r);
|
|
1186
1186
|
}, J.prototype.where = function(e) {
|
|
@@ -1207,17 +1207,17 @@ function Ba() {
|
|
|
1207
1207
|
}
|
|
1208
1208
|
!n && ye && console.warn("The query ".concat(JSON.stringify(e), " on ").concat(this.name, " would benefit from a ") + "compound index [".concat(r.join("+"), "]"));
|
|
1209
1209
|
var a = this.schema.idxByName;
|
|
1210
|
-
function
|
|
1211
|
-
return
|
|
1210
|
+
function i(d, p) {
|
|
1211
|
+
return z(d, p) === 0;
|
|
1212
1212
|
}
|
|
1213
1213
|
var u = r.reduce(function(h, p) {
|
|
1214
1214
|
var y = h[0], S = h[1], h = a[p], _ = e[p];
|
|
1215
1215
|
return [y || h, y || !h ? Fe(S, h && h.multi ? function(b) {
|
|
1216
1216
|
return b = Ee(b, p), T(b) && b.some(function(v) {
|
|
1217
|
-
return
|
|
1217
|
+
return i(_, v);
|
|
1218
1218
|
});
|
|
1219
1219
|
} : function(b) {
|
|
1220
|
-
return
|
|
1220
|
+
return i(_, Ee(b, p));
|
|
1221
1221
|
}) : S];
|
|
1222
1222
|
}, [null, null]), c = u[0], u = u[1];
|
|
1223
1223
|
return c ? this.where(c.name).equals(e[c.keyPath]).filter(u) : n ? this.filter(u) : this.where(r).equals("");
|
|
@@ -1241,7 +1241,7 @@ function Ba() {
|
|
|
1241
1241
|
return this.toCollection().reverse();
|
|
1242
1242
|
}, J.prototype.mapToClass = function(e) {
|
|
1243
1243
|
var r, n = this.db, a = this.name;
|
|
1244
|
-
function
|
|
1244
|
+
function i() {
|
|
1245
1245
|
return r !== null && r.apply(this, arguments) || this;
|
|
1246
1246
|
}
|
|
1247
1247
|
(this.schema.mappedClass = e).prototype instanceof un && ((function(p, y) {
|
|
@@ -1250,11 +1250,11 @@ function Ba() {
|
|
|
1250
1250
|
this.constructor = p;
|
|
1251
1251
|
}
|
|
1252
1252
|
s(p, y), p.prototype = y === null ? Object.create(y) : (S.prototype = y.prototype, new S());
|
|
1253
|
-
})(
|
|
1253
|
+
})(i, r = e), Object.defineProperty(i.prototype, "db", { get: function() {
|
|
1254
1254
|
return n;
|
|
1255
|
-
}, enumerable: !1, configurable: !0 }),
|
|
1255
|
+
}, enumerable: !1, configurable: !0 }), i.prototype.table = function() {
|
|
1256
1256
|
return a;
|
|
1257
|
-
}, e =
|
|
1257
|
+
}, e = i);
|
|
1258
1258
|
for (var c = /* @__PURE__ */ new Set(), u = e.prototype; u; u = me(u)) Object.getOwnPropertyNames(u).forEach(function(p) {
|
|
1259
1259
|
return c.add(p);
|
|
1260
1260
|
});
|
|
@@ -1270,11 +1270,11 @@ function Ba() {
|
|
|
1270
1270
|
return this.schema.readHook && this.hook.reading.unsubscribe(this.schema.readHook), this.schema.readHook = d, this.hook("reading", d), e;
|
|
1271
1271
|
}, J.prototype.defineClass = function() {
|
|
1272
1272
|
return this.mapToClass(function(e) {
|
|
1273
|
-
|
|
1273
|
+
F(this, e);
|
|
1274
1274
|
});
|
|
1275
1275
|
}, J.prototype.add = function(e, r) {
|
|
1276
|
-
var n = this, a = this.schema.primKey,
|
|
1277
|
-
return c &&
|
|
1276
|
+
var n = this, a = this.schema.primKey, i = a.auto, c = a.keyPath, u = e;
|
|
1277
|
+
return c && i && (u = Kt(c)(e)), this._trans("readwrite", function(d) {
|
|
1278
1278
|
return n.core.mutate({ trans: d, type: "add", keys: r != null ? [r] : null, values: [u] });
|
|
1279
1279
|
}).then(function(d) {
|
|
1280
1280
|
return d.numFailures ? M.reject(d.failures[0]) : d.lastResult;
|
|
@@ -1287,10 +1287,10 @@ function Ba() {
|
|
|
1287
1287
|
});
|
|
1288
1288
|
}, J.prototype.upsert = function(e, r) {
|
|
1289
1289
|
var n = this, a = this.schema.primKey.keyPath;
|
|
1290
|
-
return this._trans("readwrite", function(
|
|
1291
|
-
return n.core.get({ trans:
|
|
1290
|
+
return this._trans("readwrite", function(i) {
|
|
1291
|
+
return n.core.get({ trans: i, key: e }).then(function(c) {
|
|
1292
1292
|
var u = c ?? {};
|
|
1293
|
-
return fn(u, r), a && ue(u, a, e), n.core.mutate({ trans:
|
|
1293
|
+
return fn(u, r), a && ue(u, a, e), n.core.mutate({ trans: i, type: "put", values: [u], keys: [e], upsert: !0, updates: { keys: [e], changeSpecs: [r] } }).then(function(d) {
|
|
1294
1294
|
return d.numFailures ? M.reject(d.failures[0]) : !!c;
|
|
1295
1295
|
});
|
|
1296
1296
|
});
|
|
@@ -1298,8 +1298,8 @@ function Ba() {
|
|
|
1298
1298
|
}, J.prototype.update = function(e, r) {
|
|
1299
1299
|
return typeof e != "object" || T(e) ? this.where(":id").equals(e).modify(r) : (e = Ee(e, this.schema.primKey.keyPath), e === void 0 ? ee(new B.InvalidArgument("Given object does not contain its primary key")) : this.where(":id").equals(e).modify(r));
|
|
1300
1300
|
}, J.prototype.put = function(e, r) {
|
|
1301
|
-
var n = this, a = this.schema.primKey,
|
|
1302
|
-
return c &&
|
|
1301
|
+
var n = this, a = this.schema.primKey, i = a.auto, c = a.keyPath, u = e;
|
|
1302
|
+
return c && i && (u = Kt(c)(e)), this._trans("readwrite", function(d) {
|
|
1303
1303
|
return n.core.mutate({ trans: d, type: "put", values: [u], keys: r != null ? [r] : null });
|
|
1304
1304
|
}).then(function(d) {
|
|
1305
1305
|
return d.numFailures ? M.reject(d.failures[0]) : d.lastResult;
|
|
@@ -1332,32 +1332,32 @@ function Ba() {
|
|
|
1332
1332
|
var r = this;
|
|
1333
1333
|
return this._trans("readonly", function(n) {
|
|
1334
1334
|
return r.core.getMany({ keys: e, trans: n }).then(function(a) {
|
|
1335
|
-
return a.map(function(
|
|
1336
|
-
return r.hook.reading.fire(
|
|
1335
|
+
return a.map(function(i) {
|
|
1336
|
+
return r.hook.reading.fire(i);
|
|
1337
1337
|
});
|
|
1338
1338
|
});
|
|
1339
1339
|
});
|
|
1340
1340
|
}, J.prototype.bulkAdd = function(e, r, n) {
|
|
1341
|
-
var a = this,
|
|
1341
|
+
var a = this, i = Array.isArray(r) ? r : void 0, c = (n = n || (i ? void 0 : r)) ? n.allKeys : void 0;
|
|
1342
1342
|
return this._trans("readwrite", function(u) {
|
|
1343
1343
|
var y = a.schema.primKey, d = y.auto, y = y.keyPath;
|
|
1344
|
-
if (y &&
|
|
1345
|
-
if (
|
|
1344
|
+
if (y && i) throw new B.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
|
|
1345
|
+
if (i && i.length !== e.length) throw new B.InvalidArgument("Arguments objects and keys must have the same length");
|
|
1346
1346
|
var p = e.length, y = y && d ? e.map(Kt(y)) : e;
|
|
1347
|
-
return a.core.mutate({ trans: u, type: "add", keys:
|
|
1347
|
+
return a.core.mutate({ trans: u, type: "add", keys: i, values: y, wantResults: c }).then(function(v) {
|
|
1348
1348
|
var h = v.numFailures, _ = v.results, b = v.lastResult, v = v.failures;
|
|
1349
1349
|
if (h === 0) return c ? _ : b;
|
|
1350
1350
|
throw new Je("".concat(a.name, ".bulkAdd(): ").concat(h, " of ").concat(p, " operations failed"), v);
|
|
1351
1351
|
});
|
|
1352
1352
|
});
|
|
1353
1353
|
}, J.prototype.bulkPut = function(e, r, n) {
|
|
1354
|
-
var a = this,
|
|
1354
|
+
var a = this, i = Array.isArray(r) ? r : void 0, c = (n = n || (i ? void 0 : r)) ? n.allKeys : void 0;
|
|
1355
1355
|
return this._trans("readwrite", function(u) {
|
|
1356
1356
|
var y = a.schema.primKey, d = y.auto, y = y.keyPath;
|
|
1357
|
-
if (y &&
|
|
1358
|
-
if (
|
|
1357
|
+
if (y && i) throw new B.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
|
|
1358
|
+
if (i && i.length !== e.length) throw new B.InvalidArgument("Arguments objects and keys must have the same length");
|
|
1359
1359
|
var p = e.length, y = y && d ? e.map(Kt(y)) : e;
|
|
1360
|
-
return a.core.mutate({ trans: u, type: "put", keys:
|
|
1360
|
+
return a.core.mutate({ trans: u, type: "put", keys: i, values: y, wantResults: c }).then(function(v) {
|
|
1361
1361
|
var h = v.numFailures, _ = v.results, b = v.lastResult, v = v.failures;
|
|
1362
1362
|
if (h === 0) return c ? _ : b;
|
|
1363
1363
|
throw new Je("".concat(a.name, ".bulkPut(): ").concat(h, " of ").concat(p, " operations failed"), v);
|
|
@@ -1366,7 +1366,7 @@ function Ba() {
|
|
|
1366
1366
|
}, J.prototype.bulkUpdate = function(e) {
|
|
1367
1367
|
var r = this, n = this.core, a = e.map(function(u) {
|
|
1368
1368
|
return u.key;
|
|
1369
|
-
}),
|
|
1369
|
+
}), i = e.map(function(u) {
|
|
1370
1370
|
return u.changes;
|
|
1371
1371
|
}), c = [];
|
|
1372
1372
|
return this._trans("readwrite", function(u) {
|
|
@@ -1378,14 +1378,14 @@ function Ba() {
|
|
|
1378
1378
|
for (var O = 0, A = Object.keys(v); O < A.length; O++) {
|
|
1379
1379
|
var P = A[O], D = v[P];
|
|
1380
1380
|
if (P === r.schema.primKey.keyPath) {
|
|
1381
|
-
if (
|
|
1381
|
+
if (z(D, b) !== 0) throw new B.Constraint("Cannot update primary key in bulkUpdate()");
|
|
1382
1382
|
} else ue(E, P, D);
|
|
1383
1383
|
}
|
|
1384
1384
|
c.push(_), p.push(b), y.push(E);
|
|
1385
1385
|
}
|
|
1386
1386
|
});
|
|
1387
1387
|
var S = p.length;
|
|
1388
|
-
return n.mutate({ trans: u, type: "put", keys: p, values: y, updates: { keys: a, changeSpecs:
|
|
1388
|
+
return n.mutate({ trans: u, type: "put", keys: p, values: y, updates: { keys: a, changeSpecs: i } }).then(function(h) {
|
|
1389
1389
|
var _ = h.numFailures, b = h.failures;
|
|
1390
1390
|
if (_ === 0) return S;
|
|
1391
1391
|
for (var v = 0, E = Object.keys(b); v < E.length; v++) {
|
|
@@ -1399,13 +1399,13 @@ function Ba() {
|
|
|
1399
1399
|
}, J.prototype.bulkDelete = function(e) {
|
|
1400
1400
|
var r = this, n = e.length;
|
|
1401
1401
|
return this._trans("readwrite", function(a) {
|
|
1402
|
-
return r.core.mutate({ trans: a, type: "delete", keys: e }).then(function(
|
|
1403
|
-
return Lt(r, e,
|
|
1402
|
+
return r.core.mutate({ trans: a, type: "delete", keys: e }).then(function(i) {
|
|
1403
|
+
return Lt(r, e, i);
|
|
1404
1404
|
});
|
|
1405
1405
|
}).then(function(u) {
|
|
1406
|
-
var
|
|
1407
|
-
if (
|
|
1408
|
-
throw new Je("".concat(r.name, ".bulkDelete(): ").concat(
|
|
1406
|
+
var i = u.numFailures, c = u.lastResult, u = u.failures;
|
|
1407
|
+
if (i === 0) return c;
|
|
1408
|
+
throw new Je("".concat(r.name, ".bulkDelete(): ").concat(i, " of ").concat(n, " operations failed"), u);
|
|
1409
1409
|
});
|
|
1410
1410
|
}, J);
|
|
1411
1411
|
function J() {
|
|
@@ -1420,7 +1420,7 @@ function Ba() {
|
|
|
1420
1420
|
}
|
|
1421
1421
|
var n = {};
|
|
1422
1422
|
r.addEventType = c;
|
|
1423
|
-
for (var a = 1,
|
|
1423
|
+
for (var a = 1, i = arguments.length; a < i; ++a) c(arguments[a]);
|
|
1424
1424
|
return r;
|
|
1425
1425
|
function c(u, d, p) {
|
|
1426
1426
|
if (typeof u != "object") {
|
|
@@ -1478,11 +1478,11 @@ function Ba() {
|
|
|
1478
1478
|
return r.openCursor({ trans: n, values: !e.keysOnly, reverse: e.dir === "prev", unique: !!e.unique, query: { index: a, range: e.range } });
|
|
1479
1479
|
}
|
|
1480
1480
|
function Wt(e, r, n, a) {
|
|
1481
|
-
var
|
|
1481
|
+
var i = e.replayFilter ? Fe(e.filter, e.replayFilter()) : e.filter;
|
|
1482
1482
|
if (e.or) {
|
|
1483
1483
|
var c = {}, u = function(d, p, y) {
|
|
1484
1484
|
var S, h;
|
|
1485
|
-
|
|
1485
|
+
i && !i(p, y, function(_) {
|
|
1486
1486
|
return p.stop(_);
|
|
1487
1487
|
}, function(_) {
|
|
1488
1488
|
return p.fail(_);
|
|
@@ -1490,10 +1490,10 @@ function Ba() {
|
|
|
1490
1490
|
};
|
|
1491
1491
|
return Promise.all([e.or._iterate(u, n), mn(pn(e, a, n), e.algorithm, u, !e.keysOnly && e.valueMapper)]);
|
|
1492
1492
|
}
|
|
1493
|
-
return mn(pn(e, a, n), Fe(e.algorithm,
|
|
1493
|
+
return mn(pn(e, a, n), Fe(e.algorithm, i), r, !e.keysOnly && e.valueMapper);
|
|
1494
1494
|
}
|
|
1495
1495
|
function mn(e, r, n, a) {
|
|
1496
|
-
var
|
|
1496
|
+
var i = q(a ? function(c, u, d) {
|
|
1497
1497
|
return n(a(c), u, d);
|
|
1498
1498
|
} : n);
|
|
1499
1499
|
return e.then(function(c) {
|
|
@@ -1507,7 +1507,7 @@ function Ba() {
|
|
|
1507
1507
|
c.stop(d), u = Q;
|
|
1508
1508
|
}, function(d) {
|
|
1509
1509
|
c.fail(d), u = Q;
|
|
1510
|
-
}) ||
|
|
1510
|
+
}) || i(c.value, c, function(d) {
|
|
1511
1511
|
return u = d;
|
|
1512
1512
|
}), u();
|
|
1513
1513
|
});
|
|
@@ -1526,7 +1526,7 @@ function Ba() {
|
|
|
1526
1526
|
return Wt(this._ctx, e, r, this._ctx.table.core);
|
|
1527
1527
|
}, Y.prototype.clone = function(e) {
|
|
1528
1528
|
var r = Object.create(this.constructor.prototype), n = Object.create(this._ctx);
|
|
1529
|
-
return e &&
|
|
1529
|
+
return e && F(n, e), r._ctx = n, r;
|
|
1530
1530
|
}, Y.prototype.raw = function() {
|
|
1531
1531
|
return this._ctx.valueMapper = null, this;
|
|
1532
1532
|
}, Y.prototype.each = function(e) {
|
|
@@ -1537,25 +1537,25 @@ function Ba() {
|
|
|
1537
1537
|
}, Y.prototype.count = function(e) {
|
|
1538
1538
|
var r = this;
|
|
1539
1539
|
return this._read(function(n) {
|
|
1540
|
-
var a = r._ctx,
|
|
1541
|
-
if (rt(a, !0)) return
|
|
1540
|
+
var a = r._ctx, i = a.table.core;
|
|
1541
|
+
if (rt(a, !0)) return i.count({ trans: n, query: { index: Bt(a, i.schema), range: a.range } }).then(function(u) {
|
|
1542
1542
|
return Math.min(u, a.limit);
|
|
1543
1543
|
});
|
|
1544
1544
|
var c = 0;
|
|
1545
1545
|
return Wt(a, function() {
|
|
1546
1546
|
return ++c, !1;
|
|
1547
|
-
}, n,
|
|
1547
|
+
}, n, i).then(function() {
|
|
1548
1548
|
return c;
|
|
1549
1549
|
});
|
|
1550
1550
|
}).then(e);
|
|
1551
1551
|
}, Y.prototype.sortBy = function(e, r) {
|
|
1552
|
-
var n = e.split(".").reverse(), a = n[0],
|
|
1552
|
+
var n = e.split(".").reverse(), a = n[0], i = n.length - 1;
|
|
1553
1553
|
function c(p, y) {
|
|
1554
1554
|
return y ? c(p[n[y]], y - 1) : p[a];
|
|
1555
1555
|
}
|
|
1556
1556
|
var u = this._ctx.dir === "next" ? 1 : -1;
|
|
1557
1557
|
function d(p, y) {
|
|
1558
|
-
return
|
|
1558
|
+
return z(c(p, i), c(y, i)) * u;
|
|
1559
1559
|
}
|
|
1560
1560
|
return this.toArray(function(p) {
|
|
1561
1561
|
return p.sort(d);
|
|
@@ -1565,9 +1565,9 @@ function Ba() {
|
|
|
1565
1565
|
return this._read(function(n) {
|
|
1566
1566
|
var a = r._ctx;
|
|
1567
1567
|
if (a.dir === "next" && rt(a, !0) && 0 < a.limit) {
|
|
1568
|
-
var
|
|
1568
|
+
var i = a.valueMapper, c = Bt(a, a.table.core.schema);
|
|
1569
1569
|
return a.table.core.query({ trans: n, limit: a.limit, values: !0, query: { index: c, range: a.range } }).then(function(d) {
|
|
1570
|
-
return d = d.result,
|
|
1570
|
+
return d = d.result, i ? d.map(i) : d;
|
|
1571
1571
|
});
|
|
1572
1572
|
}
|
|
1573
1573
|
var u = [];
|
|
@@ -1581,8 +1581,8 @@ function Ba() {
|
|
|
1581
1581
|
var r = this._ctx;
|
|
1582
1582
|
return e <= 0 || (r.offset += e, rt(r) ? Er(r, function() {
|
|
1583
1583
|
var n = e;
|
|
1584
|
-
return function(a,
|
|
1585
|
-
return n === 0 || (n === 1 ? --n :
|
|
1584
|
+
return function(a, i) {
|
|
1585
|
+
return n === 0 || (n === 1 ? --n : i(function() {
|
|
1586
1586
|
a.advance(n), n = 0;
|
|
1587
1587
|
}), !1);
|
|
1588
1588
|
};
|
|
@@ -1595,13 +1595,13 @@ function Ba() {
|
|
|
1595
1595
|
}, Y.prototype.limit = function(e) {
|
|
1596
1596
|
return this._ctx.limit = Math.min(this._ctx.limit, e), Er(this._ctx, function() {
|
|
1597
1597
|
var r = e;
|
|
1598
|
-
return function(n, a,
|
|
1599
|
-
return --r <= 0 && a(
|
|
1598
|
+
return function(n, a, i) {
|
|
1599
|
+
return --r <= 0 && a(i), 0 <= r;
|
|
1600
1600
|
};
|
|
1601
1601
|
}, !0), this;
|
|
1602
1602
|
}, Y.prototype.until = function(e, r) {
|
|
1603
|
-
return vr(this._ctx, function(n, a,
|
|
1604
|
-
return !e(n.value) || (a(
|
|
1603
|
+
return vr(this._ctx, function(n, a, i) {
|
|
1604
|
+
return !e(n.value) || (a(i), r);
|
|
1605
1605
|
}), this;
|
|
1606
1606
|
}, Y.prototype.first = function(e) {
|
|
1607
1607
|
return this.limit(1).toArray(function(r) {
|
|
@@ -1638,23 +1638,23 @@ function Ba() {
|
|
|
1638
1638
|
var r = this._ctx;
|
|
1639
1639
|
r.keysOnly = !r.isMatch;
|
|
1640
1640
|
var n = [];
|
|
1641
|
-
return this.each(function(a,
|
|
1642
|
-
n.push(
|
|
1641
|
+
return this.each(function(a, i) {
|
|
1642
|
+
n.push(i.key);
|
|
1643
1643
|
}).then(function() {
|
|
1644
1644
|
return n;
|
|
1645
1645
|
}).then(e);
|
|
1646
1646
|
}, Y.prototype.primaryKeys = function(e) {
|
|
1647
1647
|
var r = this._ctx;
|
|
1648
1648
|
if (r.dir === "next" && rt(r, !0) && 0 < r.limit) return this._read(function(a) {
|
|
1649
|
-
var
|
|
1650
|
-
return r.table.core.query({ trans: a, values: !1, limit: r.limit, query: { index:
|
|
1649
|
+
var i = Bt(r, r.table.core.schema);
|
|
1650
|
+
return r.table.core.query({ trans: a, values: !1, limit: r.limit, query: { index: i, range: r.range } });
|
|
1651
1651
|
}).then(function(a) {
|
|
1652
1652
|
return a.result;
|
|
1653
1653
|
}).then(e);
|
|
1654
1654
|
r.keysOnly = !r.isMatch;
|
|
1655
1655
|
var n = [];
|
|
1656
|
-
return this.each(function(a,
|
|
1657
|
-
n.push(
|
|
1656
|
+
return this.each(function(a, i) {
|
|
1657
|
+
n.push(i.primaryKey);
|
|
1658
1658
|
}).then(function() {
|
|
1659
1659
|
return n;
|
|
1660
1660
|
}).then(e);
|
|
@@ -1670,14 +1670,14 @@ function Ba() {
|
|
|
1670
1670
|
var e = this._ctx, e = e.index && e.table.schema.idxByName[e.index];
|
|
1671
1671
|
if (!e || !e.multi) return this;
|
|
1672
1672
|
var r = {};
|
|
1673
|
-
return vr(this._ctx, function(
|
|
1674
|
-
var a =
|
|
1675
|
-
return r[a] = !0, !
|
|
1673
|
+
return vr(this._ctx, function(i) {
|
|
1674
|
+
var a = i.primaryKey.toString(), i = ae(r, a);
|
|
1675
|
+
return r[a] = !0, !i;
|
|
1676
1676
|
}), this;
|
|
1677
1677
|
}, Y.prototype.modify = function(e) {
|
|
1678
1678
|
var r = this, n = this._ctx;
|
|
1679
1679
|
return this._write(function(a) {
|
|
1680
|
-
var
|
|
1680
|
+
var i = typeof e == "function" ? e : function(E) {
|
|
1681
1681
|
return fn(E, e);
|
|
1682
1682
|
}, c = n.table.core, y = c.schema.primaryKey, u = y.outbound, d = y.extractKey, p = 200, y = r.db._options.modifyChunkSize;
|
|
1683
1683
|
y && (p = typeof y == "object" ? y[c.name] || y["*"] || 200 : y);
|
|
@@ -1697,20 +1697,20 @@ function Ba() {
|
|
|
1697
1697
|
var G = [], I = [], x = u ? [] : null, j = v ? N : [];
|
|
1698
1698
|
if (!v) for (var $ = 0; $ < D; ++$) {
|
|
1699
1699
|
var K = k[$], U = { value: Ce(K), primKey: E[P + $] };
|
|
1700
|
-
|
|
1700
|
+
i.call(U, U.value, U) !== !1 && (U.value == null ? j.push(E[P + $]) : u || z(d(K), d(U.value)) === 0 ? (I.push(U.value), u && x.push(E[P + $])) : (j.push(E[P + $]), G.push(U.value)));
|
|
1701
1701
|
}
|
|
1702
|
-
return Promise.resolve(0 < G.length && c.mutate({ trans: a, type: "add", values: G }).then(function(
|
|
1703
|
-
for (var
|
|
1704
|
-
S(G.length,
|
|
1702
|
+
return Promise.resolve(0 < G.length && c.mutate({ trans: a, type: "add", values: G }).then(function(H) {
|
|
1703
|
+
for (var V in H.failures) j.splice(parseInt(V), 1);
|
|
1704
|
+
S(G.length, H);
|
|
1705
1705
|
})).then(function() {
|
|
1706
|
-
return (0 < I.length || A && typeof e == "object") && c.mutate({ trans: a, type: "put", keys: x, values: I, criteria: A, changeSpec: typeof e != "function" && e, isAdditionalChunk: 0 < P }).then(function(
|
|
1707
|
-
return S(I.length,
|
|
1706
|
+
return (0 < I.length || A && typeof e == "object") && c.mutate({ trans: a, type: "put", keys: x, values: I, criteria: A, changeSpec: typeof e != "function" && e, isAdditionalChunk: 0 < P }).then(function(H) {
|
|
1707
|
+
return S(I.length, H);
|
|
1708
1708
|
});
|
|
1709
1709
|
}).then(function() {
|
|
1710
|
-
return (0 < j.length || A && v) && c.mutate({ trans: a, type: "delete", keys: j, criteria: A, isAdditionalChunk: 0 < P }).then(function(
|
|
1711
|
-
return Lt(n.table, j,
|
|
1712
|
-
}).then(function(
|
|
1713
|
-
return S(j.length,
|
|
1710
|
+
return (0 < j.length || A && v) && c.mutate({ trans: a, type: "delete", keys: j, criteria: A, isAdditionalChunk: 0 < P }).then(function(H) {
|
|
1711
|
+
return Lt(n.table, j, H);
|
|
1712
|
+
}).then(function(H) {
|
|
1713
|
+
return S(j.length, H);
|
|
1714
1714
|
});
|
|
1715
1715
|
}).then(function() {
|
|
1716
1716
|
return E.length > P + D && O(P + p);
|
|
@@ -1727,9 +1727,9 @@ function Ba() {
|
|
|
1727
1727
|
}, Y.prototype.delete = function() {
|
|
1728
1728
|
var e = this._ctx, r = e.range;
|
|
1729
1729
|
return !rt(e) || e.table.schema.yProps || !e.isPrimKey && r.type !== 3 ? this.modify(yn) : this._write(function(n) {
|
|
1730
|
-
var a = e.table.core.schema.primaryKey,
|
|
1731
|
-
return e.table.core.count({ trans: n, query: { index: a, range:
|
|
1732
|
-
return e.table.core.mutate({ trans: n, type: "deleteRange", range:
|
|
1730
|
+
var a = e.table.core.schema.primaryKey, i = r;
|
|
1731
|
+
return e.table.core.count({ trans: n, query: { index: a, range: i } }).then(function(c) {
|
|
1732
|
+
return e.table.core.mutate({ trans: n, type: "deleteRange", range: i }).then(function(p) {
|
|
1733
1733
|
var d = p.failures, p = p.numFailures;
|
|
1734
1734
|
if (p) throw new Nt("Could not delete some values", Object.keys(d).map(function(y) {
|
|
1735
1735
|
return d[y];
|
|
@@ -1759,12 +1759,12 @@ function Ba() {
|
|
|
1759
1759
|
}).limit(0);
|
|
1760
1760
|
}
|
|
1761
1761
|
function Ut(e, r, n, a) {
|
|
1762
|
-
var
|
|
1762
|
+
var i, c, u, d, p, y, S, h = n.length;
|
|
1763
1763
|
if (!n.every(function(v) {
|
|
1764
1764
|
return typeof v == "string";
|
|
1765
1765
|
})) return le(e, on);
|
|
1766
1766
|
function _(v) {
|
|
1767
|
-
|
|
1767
|
+
i = v === "next" ? function(O) {
|
|
1768
1768
|
return O.toUpperCase();
|
|
1769
1769
|
} : function(O) {
|
|
1770
1770
|
return O.toLowerCase();
|
|
@@ -1774,7 +1774,7 @@ function Ba() {
|
|
|
1774
1774
|
return O.toUpperCase();
|
|
1775
1775
|
}, u = v === "next" ? ua : la;
|
|
1776
1776
|
var E = n.map(function(O) {
|
|
1777
|
-
return { lower: c(O), upper:
|
|
1777
|
+
return { lower: c(O), upper: i(O) };
|
|
1778
1778
|
}).sort(function(O, A) {
|
|
1779
1779
|
return u(O.lower, A.lower);
|
|
1780
1780
|
});
|
|
@@ -1797,12 +1797,12 @@ function Ba() {
|
|
|
1797
1797
|
if (r(P, p, b)) return !0;
|
|
1798
1798
|
for (var D = null, N = b; N < h; ++N) {
|
|
1799
1799
|
var k = (function(G, I, x, j, $, K) {
|
|
1800
|
-
for (var U = Math.min(G.length, j.length),
|
|
1801
|
-
var de = I[
|
|
1802
|
-
if (de !== j[
|
|
1803
|
-
$(G[
|
|
1800
|
+
for (var U = Math.min(G.length, j.length), H = -1, V = 0; V < U; ++V) {
|
|
1801
|
+
var de = I[V];
|
|
1802
|
+
if (de !== j[V]) return $(G[V], x[V]) < 0 ? G.substr(0, V) + x[V] + x.substr(V + 1) : $(G[V], j[V]) < 0 ? G.substr(0, V) + j[V] + x.substr(V + 1) : 0 <= H ? G.substr(0, H) + I[H] + x.substr(H + 1) : null;
|
|
1803
|
+
$(G[V], de) < 0 && (H = V);
|
|
1804
1804
|
}
|
|
1805
|
-
return U < j.length && K === "next" ? G + x.substr(G.length) : U < G.length && K === "prev" ? G.substr(0, x.length) :
|
|
1805
|
+
return U < j.length && K === "next" ? G + x.substr(G.length) : U < G.length && K === "prev" ? G.substr(0, x.length) : H < 0 ? null : G.substr(0, H) + j[H] + x.substr(H + 1);
|
|
1806
1806
|
})(A, P, d[N], p[N], u, y);
|
|
1807
1807
|
k === null && D === null ? b = N + 1 : (D === null || 0 < u(D, k)) && (D = k);
|
|
1808
1808
|
}
|
|
@@ -1884,11 +1884,11 @@ function Ba() {
|
|
|
1884
1884
|
a._ondirectionchange = function(c) {
|
|
1885
1885
|
n = c === "next" ? e._ascending : e._descending, r.sort(n);
|
|
1886
1886
|
};
|
|
1887
|
-
var
|
|
1887
|
+
var i = 0;
|
|
1888
1888
|
return a._addAlgorithm(function(c, u, d) {
|
|
1889
|
-
for (var p = c.key; 0 < n(p, r[
|
|
1890
|
-
return n(p, r[
|
|
1891
|
-
c.continue(r[
|
|
1889
|
+
for (var p = c.key; 0 < n(p, r[i]); ) if (++i === r.length) return u(d), !1;
|
|
1890
|
+
return n(p, r[i]) === 0 || (u(function() {
|
|
1891
|
+
c.continue(r[i]);
|
|
1892
1892
|
}), !1);
|
|
1893
1893
|
}), a;
|
|
1894
1894
|
}, ne.prototype.notEqual = function(e) {
|
|
@@ -1906,12 +1906,12 @@ function Ba() {
|
|
|
1906
1906
|
}, null);
|
|
1907
1907
|
return r.push([e[e.length - 1], this.db._maxKey]), this.inAnyRange(r, { includeLowers: !1, includeUppers: !1 });
|
|
1908
1908
|
}, ne.prototype.inAnyRange = function(A, r) {
|
|
1909
|
-
var n = this, a = this._cmp,
|
|
1909
|
+
var n = this, a = this._cmp, i = this._ascending, c = this._descending, u = this._min, d = this._max;
|
|
1910
1910
|
if (A.length === 0) return nt(this);
|
|
1911
1911
|
if (!A.every(function(P) {
|
|
1912
|
-
return P[0] !== void 0 && P[1] !== void 0 &&
|
|
1912
|
+
return P[0] !== void 0 && P[1] !== void 0 && i(P[0], P[1]) <= 0;
|
|
1913
1913
|
})) 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", B.InvalidArgument);
|
|
1914
|
-
var p = !r || r.includeLowers !== !1, y = r && r.includeUppers === !0, S, h =
|
|
1914
|
+
var p = !r || r.includeLowers !== !1, y = r && r.includeUppers === !0, S, h = i;
|
|
1915
1915
|
function _(P, D) {
|
|
1916
1916
|
return h(P[0], D[0]);
|
|
1917
1917
|
}
|
|
@@ -1930,9 +1930,9 @@ function Ba() {
|
|
|
1930
1930
|
return le(this, Se);
|
|
1931
1931
|
}
|
|
1932
1932
|
var b = 0, v = y ? function(P) {
|
|
1933
|
-
return 0 <
|
|
1933
|
+
return 0 < i(P, S[b][1]);
|
|
1934
1934
|
} : function(P) {
|
|
1935
|
-
return 0 <=
|
|
1935
|
+
return 0 <= i(P, S[b][1]);
|
|
1936
1936
|
}, E = p ? function(P) {
|
|
1937
1937
|
return 0 < c(P, S[b][0]);
|
|
1938
1938
|
} : function(P) {
|
|
@@ -1941,11 +1941,11 @@ function Ba() {
|
|
|
1941
1941
|
return Re(S[0][0], S[S.length - 1][1], !p, !y);
|
|
1942
1942
|
});
|
|
1943
1943
|
return A._ondirectionchange = function(P) {
|
|
1944
|
-
h = P === "next" ? (O = v,
|
|
1944
|
+
h = P === "next" ? (O = v, i) : (O = E, c), S.sort(_);
|
|
1945
1945
|
}, A._addAlgorithm(function(P, D, N) {
|
|
1946
1946
|
for (var k, G = P.key; O(G); ) if (++b === S.length) return D(N), !1;
|
|
1947
1947
|
return !v(k = G) && !E(k) || (n._cmp(G, S[b][1]) === 0 || n._cmp(G, S[b][0]) === 0 || D(function() {
|
|
1948
|
-
h ===
|
|
1948
|
+
h === i ? P.continue(S[b][0]) : P.continue(S[b][1]);
|
|
1949
1949
|
}), !1);
|
|
1950
1950
|
}), A;
|
|
1951
1951
|
}, ne.prototype.startsWithAnyOf = function() {
|
|
@@ -1992,10 +1992,10 @@ function Ba() {
|
|
|
1992
1992
|
throw new B.OpenFailed(a);
|
|
1993
1993
|
}
|
|
1994
1994
|
if (!this.active) throw new B.TransactionInactive();
|
|
1995
|
-
return ct(this._completion._state === null), (e = this.idbtrans = e || (this.db.core || n).transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability })).onerror = q(function(
|
|
1996
|
-
bt(
|
|
1997
|
-
}), e.onabort = q(function(
|
|
1998
|
-
bt(
|
|
1995
|
+
return ct(this._completion._state === null), (e = this.idbtrans = e || (this.db.core || n).transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability })).onerror = q(function(i) {
|
|
1996
|
+
bt(i), r._reject(e.error);
|
|
1997
|
+
}), e.onabort = q(function(i) {
|
|
1998
|
+
bt(i), r.active && r._reject(new B.Abort(e.error)), r.active = !1, r.on("abort").fire(i);
|
|
1999
1999
|
}), e.oncomplete = q(function() {
|
|
2000
2000
|
r.active = !1, r._resolve(), "mutatedParts" in e && ke.storagemutated.fire(e.mutatedParts);
|
|
2001
2001
|
}), this;
|
|
@@ -2018,11 +2018,11 @@ function Ba() {
|
|
|
2018
2018
|
return a._unlock();
|
|
2019
2019
|
}), c._lib = !0, c;
|
|
2020
2020
|
});
|
|
2021
|
-
var
|
|
2021
|
+
var i = new M(function(c, u) {
|
|
2022
2022
|
var d = r(c, u, a);
|
|
2023
2023
|
d && d.then && d.then(c, u);
|
|
2024
2024
|
});
|
|
2025
|
-
return
|
|
2025
|
+
return i._lib = !0, i;
|
|
2026
2026
|
}, ve.prototype._root = function() {
|
|
2027
2027
|
return this.parent ? this.parent._root() : this;
|
|
2028
2028
|
}, ve.prototype.waitFor = function(e) {
|
|
@@ -2033,14 +2033,14 @@ function Ba() {
|
|
|
2033
2033
|
for (++n._spinCount; n._waitingQueue.length; ) n._waitingQueue.shift()();
|
|
2034
2034
|
n._waitingFor && (r.get(-1 / 0).onsuccess = c);
|
|
2035
2035
|
})());
|
|
2036
|
-
var
|
|
2036
|
+
var i = n._waitingFor;
|
|
2037
2037
|
return new M(function(c, u) {
|
|
2038
2038
|
a.then(function(d) {
|
|
2039
2039
|
return n._waitingQueue.push(q(c.bind(null, d)));
|
|
2040
2040
|
}, function(d) {
|
|
2041
2041
|
return n._waitingQueue.push(q(u.bind(null, d)));
|
|
2042
2042
|
}).finally(function() {
|
|
2043
|
-
n._waitingFor ===
|
|
2043
|
+
n._waitingFor === i && (n._waitingFor = null);
|
|
2044
2044
|
});
|
|
2045
2045
|
});
|
|
2046
2046
|
}, ve.prototype.abort = function() {
|
|
@@ -2054,17 +2054,17 @@ function Ba() {
|
|
|
2054
2054
|
}, ve);
|
|
2055
2055
|
function ve() {
|
|
2056
2056
|
}
|
|
2057
|
-
function Sr(e, r, n, a,
|
|
2058
|
-
return { name: e, keyPath: r, unique: n, multi: a, auto:
|
|
2057
|
+
function Sr(e, r, n, a, i, c, u, d) {
|
|
2058
|
+
return { name: e, keyPath: r, unique: n, multi: a, auto: i, compound: c, src: (n && !u ? "&" : "") + (a ? "*" : "") + (i ? "++" : "") + En(r), type: d };
|
|
2059
2059
|
}
|
|
2060
2060
|
function En(e) {
|
|
2061
2061
|
return typeof e == "string" ? e : e ? "[" + [].join.call(e, "+") + "]" : "";
|
|
2062
2062
|
}
|
|
2063
2063
|
function Or(e, r, n) {
|
|
2064
|
-
return { name: e, primKey: r, indexes: n, mappedClass: null, idxByName: (a = function(
|
|
2065
|
-
return [
|
|
2066
|
-
}, n.reduce(function(
|
|
2067
|
-
return u = a(c, u), u && (
|
|
2064
|
+
return { name: e, primKey: r, indexes: n, mappedClass: null, idxByName: (a = function(i) {
|
|
2065
|
+
return [i.name, i];
|
|
2066
|
+
}, n.reduce(function(i, c, u) {
|
|
2067
|
+
return u = a(c, u), u && (i[u[0]] = u[1]), i;
|
|
2068
2068
|
}, {})) };
|
|
2069
2069
|
var a;
|
|
2070
2070
|
}
|
|
@@ -2104,7 +2104,7 @@ function Ba() {
|
|
|
2104
2104
|
var b = O.lower, v = O.upper, E = O.lowerOpen, O = O.upperOpen;
|
|
2105
2105
|
return b === void 0 ? v === void 0 ? null : r.upperBound(v, !!O) : v === void 0 ? r.lowerBound(b, !!E) : r.bound(b, v, !!E, !!O);
|
|
2106
2106
|
}
|
|
2107
|
-
function
|
|
2107
|
+
function i(_) {
|
|
2108
2108
|
var b, v = _.name;
|
|
2109
2109
|
return { name: v, schema: _, mutate: function(E) {
|
|
2110
2110
|
var O = E.trans, A = E.type, P = E.keys, D = E.values, N = E.range;
|
|
@@ -2118,19 +2118,19 @@ function Ba() {
|
|
|
2118
2118
|
function U(ce) {
|
|
2119
2119
|
++de, bt(ce);
|
|
2120
2120
|
}
|
|
2121
|
-
var
|
|
2121
|
+
var H = [], V = [], de = 0;
|
|
2122
2122
|
if (A === "deleteRange") {
|
|
2123
|
-
if (N.type === 4) return k({ numFailures: de, failures:
|
|
2124
|
-
N.type === 3 ?
|
|
2123
|
+
if (N.type === 4) return k({ numFailures: de, failures: V, results: [], lastResult: void 0 });
|
|
2124
|
+
N.type === 3 ? H.push($ = I.clear()) : H.push($ = I.delete(a(N)));
|
|
2125
2125
|
} else {
|
|
2126
|
-
var x = j ? x ? [D, P] : [D, null] : [P, null], W = x[0],
|
|
2127
|
-
if (j) for (var
|
|
2128
|
-
else for (
|
|
2126
|
+
var x = j ? x ? [D, P] : [D, null] : [P, null], W = x[0], ie = x[1];
|
|
2127
|
+
if (j) for (var oe = 0; oe < K; ++oe) H.push($ = ie && ie[oe] !== void 0 ? I[A](W[oe], ie[oe]) : I[A](W[oe])), $.onerror = U;
|
|
2128
|
+
else for (oe = 0; oe < K; ++oe) H.push($ = I[A](W[oe])), $.onerror = U;
|
|
2129
2129
|
}
|
|
2130
2130
|
function tr(ce) {
|
|
2131
|
-
ce = ce.target.result,
|
|
2132
|
-
return ze.error != null && (
|
|
2133
|
-
}), k({ numFailures: de, failures:
|
|
2131
|
+
ce = ce.target.result, H.forEach(function(ze, Wr) {
|
|
2132
|
+
return ze.error != null && (V[Wr] = ze.error);
|
|
2133
|
+
}), k({ numFailures: de, failures: V, results: A === "delete" ? P : H.map(function(ze) {
|
|
2134
2134
|
return ze.result;
|
|
2135
2135
|
}), lastResult: ce });
|
|
2136
2136
|
}
|
|
@@ -2142,8 +2142,8 @@ function Ba() {
|
|
|
2142
2142
|
var O = E.trans, A = E.keys;
|
|
2143
2143
|
return new Promise(function(P, D) {
|
|
2144
2144
|
P = q(P);
|
|
2145
|
-
for (var N, k = O.objectStore(v), G = A.length, I = new Array(G), x = 0, j = 0, $ = function(
|
|
2146
|
-
|
|
2145
|
+
for (var N, k = O.objectStore(v), G = A.length, I = new Array(G), x = 0, j = 0, $ = function(H) {
|
|
2146
|
+
H = H.target, I[H._pos] = H.result, ++j === x && P(I);
|
|
2147
2147
|
}, K = be(D), U = 0; U < G; ++U) A[U] != null && ((N = k.get(A[U]))._pos = U, N.onsuccess = $, N.onerror = K, ++x);
|
|
2148
2148
|
x === 0 && P(I);
|
|
2149
2149
|
});
|
|
@@ -2174,22 +2174,22 @@ function Ba() {
|
|
|
2174
2174
|
k = q(k);
|
|
2175
2175
|
var j = P.index, I = P.range, x = O.objectStore(v), x = j.isPrimaryKey ? x : x.index(j.name), j = D ? N ? "prevunique" : "prev" : N ? "nextunique" : "next", $ = !A && "openKeyCursor" in x ? x.openKeyCursor(a(I), j) : x.openCursor(a(I), j);
|
|
2176
2176
|
$.onerror = be(G), $.onsuccess = q(function(K) {
|
|
2177
|
-
var U,
|
|
2178
|
-
W ? (W.___id = ++ha, W.done = !1, U = W.continue.bind(W),
|
|
2177
|
+
var U, H, V, de, W = $.result;
|
|
2178
|
+
W ? (W.___id = ++ha, W.done = !1, U = W.continue.bind(W), H = (H = W.continuePrimaryKey) && H.bind(W), V = W.advance.bind(W), de = function() {
|
|
2179
2179
|
throw new Error("Cursor not stopped");
|
|
2180
2180
|
}, W.trans = O, W.stop = W.continue = W.continuePrimaryKey = W.advance = function() {
|
|
2181
2181
|
throw new Error("Cursor not started");
|
|
2182
2182
|
}, W.fail = q(G), W.next = function() {
|
|
2183
|
-
var
|
|
2183
|
+
var ie = this, oe = 1;
|
|
2184
2184
|
return this.start(function() {
|
|
2185
|
-
return
|
|
2185
|
+
return oe-- ? ie.continue() : ie.stop();
|
|
2186
2186
|
}).then(function() {
|
|
2187
|
-
return
|
|
2187
|
+
return ie;
|
|
2188
2188
|
});
|
|
2189
|
-
}, W.start = function(
|
|
2190
|
-
function
|
|
2189
|
+
}, W.start = function(ie) {
|
|
2190
|
+
function oe() {
|
|
2191
2191
|
if ($.result) try {
|
|
2192
|
-
|
|
2192
|
+
ie();
|
|
2193
2193
|
} catch (ce) {
|
|
2194
2194
|
W.fail(ce);
|
|
2195
2195
|
}
|
|
@@ -2203,8 +2203,8 @@ function Ba() {
|
|
|
2203
2203
|
};
|
|
2204
2204
|
});
|
|
2205
2205
|
return $.onsuccess = q(function(ce) {
|
|
2206
|
-
$.onsuccess =
|
|
2207
|
-
}), W.continue = U, W.continuePrimaryKey =
|
|
2206
|
+
$.onsuccess = oe, oe();
|
|
2207
|
+
}), W.continue = U, W.continuePrimaryKey = H, W.advance = V, oe(), tr;
|
|
2208
2208
|
}, k(W)) : k(null);
|
|
2209
2209
|
}, G);
|
|
2210
2210
|
});
|
|
@@ -2230,7 +2230,7 @@ function Ba() {
|
|
|
2230
2230
|
return E[wt(A)];
|
|
2231
2231
|
} };
|
|
2232
2232
|
return E[":id"] = O.primaryKey, b != null && (E[wt(b)] = O.primaryKey), O;
|
|
2233
|
-
}) }, 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) }), p = S.schema, y = S.hasGetAll, S = p.tables.map(
|
|
2233
|
+
}) }, 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) }), p = S.schema, y = S.hasGetAll, S = p.tables.map(i), h = {};
|
|
2234
2234
|
return S.forEach(function(_) {
|
|
2235
2235
|
return h[_.name] = _;
|
|
2236
2236
|
}), { stack: "dbcore", transaction: e.transaction.bind(e), table: function(_) {
|
|
@@ -2239,32 +2239,32 @@ function Ba() {
|
|
|
2239
2239
|
}, MIN_KEY: -1 / 0, MAX_KEY: Et(r), schema: p };
|
|
2240
2240
|
}
|
|
2241
2241
|
function ga(e, r, n, a) {
|
|
2242
|
-
var
|
|
2243
|
-
return n.indexedDB, { dbcore: (a = fa(r,
|
|
2242
|
+
var i = n.IDBKeyRange;
|
|
2243
|
+
return n.indexedDB, { dbcore: (a = fa(r, i, a), e.dbcore.reduce(function(c, u) {
|
|
2244
2244
|
return u = u.create, l(l({}, c), u(c));
|
|
2245
2245
|
}, a)) };
|
|
2246
2246
|
}
|
|
2247
2247
|
function Ft(e, a) {
|
|
2248
2248
|
var n = a.db, a = ga(e._middlewares, n, e._deps, a);
|
|
2249
|
-
e.core = a.dbcore, e.tables.forEach(function(
|
|
2250
|
-
var c =
|
|
2249
|
+
e.core = a.dbcore, e.tables.forEach(function(i) {
|
|
2250
|
+
var c = i.name;
|
|
2251
2251
|
e.core.schema.tables.some(function(u) {
|
|
2252
2252
|
return u.name === c;
|
|
2253
|
-
}) && (
|
|
2253
|
+
}) && (i.core = e.core.table(c), e[c] instanceof e.Table && (e[c].core = i.core));
|
|
2254
2254
|
});
|
|
2255
2255
|
}
|
|
2256
2256
|
function Ht(e, r, n, a) {
|
|
2257
|
-
n.forEach(function(
|
|
2258
|
-
var c = a[
|
|
2257
|
+
n.forEach(function(i) {
|
|
2258
|
+
var c = a[i];
|
|
2259
2259
|
r.forEach(function(u) {
|
|
2260
2260
|
var d = (function p(y, S) {
|
|
2261
2261
|
return Hn(y, S) || (y = me(y)) && p(y, S);
|
|
2262
|
-
})(u,
|
|
2263
|
-
(!d || "value" in d && d.value === void 0) && (u === e.Transaction.prototype || u instanceof e.Transaction ? Pe(u,
|
|
2264
|
-
return this.table(
|
|
2262
|
+
})(u, i);
|
|
2263
|
+
(!d || "value" in d && d.value === void 0) && (u === e.Transaction.prototype || u instanceof e.Transaction ? Pe(u, i, { get: function() {
|
|
2264
|
+
return this.table(i);
|
|
2265
2265
|
}, set: function(p) {
|
|
2266
|
-
|
|
2267
|
-
} }) : u[
|
|
2266
|
+
ot(this, i, { value: p, writable: !0, configurable: !0, enumerable: !0 });
|
|
2267
|
+
} }) : u[i] = new e.Table(i, c));
|
|
2268
2268
|
});
|
|
2269
2269
|
});
|
|
2270
2270
|
}
|
|
@@ -2277,9 +2277,9 @@ function Ba() {
|
|
|
2277
2277
|
return e._cfg.version - r._cfg.version;
|
|
2278
2278
|
}
|
|
2279
2279
|
function ma(e, r, n, a) {
|
|
2280
|
-
var
|
|
2281
|
-
n.objectStoreNames.contains("$meta") && !
|
|
2282
|
-
var c = e._createTransaction("readwrite", e._storeNames,
|
|
2280
|
+
var i = e._dbSchema;
|
|
2281
|
+
n.objectStoreNames.contains("$meta") && !i.$meta && (i.$meta = Or("$meta", On("")[0], []), e._storeNames.push("$meta"));
|
|
2282
|
+
var c = e._createTransaction("readwrite", e._storeNames, i);
|
|
2283
2283
|
c.create(n), c._completion.catch(a);
|
|
2284
2284
|
var u = c._reject.bind(c), d = L.transless || L;
|
|
2285
2285
|
Ne(function() {
|
|
@@ -2313,7 +2313,7 @@ function Ba() {
|
|
|
2313
2313
|
N.del.forEach(function(j) {
|
|
2314
2314
|
G[j] = P[j];
|
|
2315
2315
|
}), Ar(h, [h.Transaction.prototype]), Ht(h, [h.Transaction.prototype], R(G), G), b.schema = G;
|
|
2316
|
-
var I, x =
|
|
2316
|
+
var I, x = ir(k);
|
|
2317
2317
|
return x && et(), N = M.follow(function() {
|
|
2318
2318
|
var j;
|
|
2319
2319
|
(I = k(b)) && x && (j = Te.bind(null, null), I.then(j, j));
|
|
@@ -2337,8 +2337,8 @@ function Ba() {
|
|
|
2337
2337
|
Sn(O, v);
|
|
2338
2338
|
})) : M.resolve();
|
|
2339
2339
|
var h, _, b, v, E, O;
|
|
2340
|
-
}).catch(u)) : (R(
|
|
2341
|
-
Dr(n, S,
|
|
2340
|
+
}).catch(u)) : (R(i).forEach(function(S) {
|
|
2341
|
+
Dr(n, S, i[S].primKey, i[S].indexes);
|
|
2342
2342
|
}), Ft(e, n), void M.follow(function() {
|
|
2343
2343
|
return e.on.populate.fire(c);
|
|
2344
2344
|
}).catch(u));
|
|
@@ -2349,14 +2349,14 @@ function Ba() {
|
|
|
2349
2349
|
Sn(e._dbSchema, r), r.db.version % 10 != 0 || r.objectStoreNames.contains("$meta") || r.db.createObjectStore("$meta").add(Math.ceil(r.db.version / 10 - 1), "version");
|
|
2350
2350
|
var n = zt(0, e.idbdb, r);
|
|
2351
2351
|
Yt(e, e._dbSchema, r);
|
|
2352
|
-
for (var a = 0,
|
|
2352
|
+
for (var a = 0, i = Pr(n, e._dbSchema).change; a < i.length; a++) {
|
|
2353
2353
|
var c = (function(u) {
|
|
2354
2354
|
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 };
|
|
2355
2355
|
var d = r.objectStore(u.name);
|
|
2356
2356
|
u.add.forEach(function(p) {
|
|
2357
2357
|
ye && console.debug("Dexie upgrade patch: Creating missing index ".concat(u.name, ".").concat(p.src)), Vt(d, p);
|
|
2358
2358
|
});
|
|
2359
|
-
})(
|
|
2359
|
+
})(i[a]);
|
|
2360
2360
|
if (typeof c == "object") return c.value;
|
|
2361
2361
|
}
|
|
2362
2362
|
}
|
|
@@ -2364,12 +2364,12 @@ function Ba() {
|
|
|
2364
2364
|
var n, a = { del: [], add: [], change: [] };
|
|
2365
2365
|
for (n in e) r[n] || a.del.push(n);
|
|
2366
2366
|
for (n in r) {
|
|
2367
|
-
var
|
|
2368
|
-
if (
|
|
2367
|
+
var i = e[n], c = r[n];
|
|
2368
|
+
if (i) {
|
|
2369
2369
|
var u = { name: n, def: c, recreate: !1, del: [], add: [], change: [] };
|
|
2370
|
-
if ("" + (
|
|
2370
|
+
if ("" + (i.primKey.keyPath || "") != "" + (c.primKey.keyPath || "") || i.primKey.auto !== c.primKey.auto) u.recreate = !0, a.change.push(u);
|
|
2371
2371
|
else {
|
|
2372
|
-
var d =
|
|
2372
|
+
var d = i.idxByName, p = c.idxByName, y = void 0;
|
|
2373
2373
|
for (y in d) p[y] || u.del.push(y);
|
|
2374
2374
|
for (y in p) {
|
|
2375
2375
|
var S = d[y], h = p[y];
|
|
@@ -2382,10 +2382,10 @@ function Ba() {
|
|
|
2382
2382
|
return a;
|
|
2383
2383
|
}
|
|
2384
2384
|
function Dr(e, r, n, a) {
|
|
2385
|
-
var
|
|
2385
|
+
var i = e.db.createObjectStore(r, n.keyPath ? { keyPath: n.keyPath, autoIncrement: n.auto } : { autoIncrement: n.auto });
|
|
2386
2386
|
return a.forEach(function(c) {
|
|
2387
|
-
return Vt(
|
|
2388
|
-
}),
|
|
2387
|
+
return Vt(i, c);
|
|
2388
|
+
}), i;
|
|
2389
2389
|
}
|
|
2390
2390
|
function Sn(e, r) {
|
|
2391
2391
|
R(e).forEach(function(n) {
|
|
@@ -2397,17 +2397,17 @@ function Ba() {
|
|
|
2397
2397
|
}
|
|
2398
2398
|
function zt(e, r, n) {
|
|
2399
2399
|
var a = {};
|
|
2400
|
-
return Dt(r.objectStoreNames, 0).forEach(function(
|
|
2401
|
-
for (var c = n.objectStore(
|
|
2400
|
+
return Dt(r.objectStoreNames, 0).forEach(function(i) {
|
|
2401
|
+
for (var c = n.objectStore(i), u = Sr(En(y = c.keyPath), y || "", !0, !1, !!c.autoIncrement, y && typeof y != "string", !0), d = [], p = 0; p < c.indexNames.length; ++p) {
|
|
2402
2402
|
var S = c.index(c.indexNames[p]), y = S.keyPath, S = Sr(S.name, y, !!S.unique, !!S.multiEntry, !1, y && typeof y != "string", !1);
|
|
2403
2403
|
d.push(S);
|
|
2404
2404
|
}
|
|
2405
|
-
a[
|
|
2405
|
+
a[i] = Or(i, u, d);
|
|
2406
2406
|
}), a;
|
|
2407
2407
|
}
|
|
2408
2408
|
function Yt(e, r, n) {
|
|
2409
|
-
for (var a = n.db.objectStoreNames,
|
|
2410
|
-
var c = a[
|
|
2409
|
+
for (var a = n.db.objectStoreNames, i = 0; i < a.length; ++i) {
|
|
2410
|
+
var c = a[i], u = n.objectStore(c);
|
|
2411
2411
|
e._hasGetAll = "getAll" in u;
|
|
2412
2412
|
for (var d = 0; d < u.indexNames.length; ++d) {
|
|
2413
2413
|
var p = u.indexNames[d], y = u.index(p).keyPath, S = typeof y == "string" ? y : "[" + Dt(y).join("+") + "]";
|
|
@@ -2418,30 +2418,30 @@ function Ba() {
|
|
|
2418
2418
|
}
|
|
2419
2419
|
function On(e) {
|
|
2420
2420
|
return e.split(",").map(function(r, n) {
|
|
2421
|
-
var c = r.split(":"), a = (
|
|
2422
|
-
return Sr(
|
|
2421
|
+
var c = r.split(":"), a = (i = c[1]) === null || i === void 0 ? void 0 : i.trim(), i = (r = c[0].trim()).replace(/([&*]|\+\+)/g, ""), c = /^\[/.test(i) ? i.match(/^\[(.*)\]$/)[1].split("+") : i;
|
|
2422
|
+
return Sr(i, c || null, /\&/.test(r), /\*/.test(r), /\+\+/.test(r), T(c), n === 0, a);
|
|
2423
2423
|
});
|
|
2424
2424
|
}
|
|
2425
2425
|
var ba = (at.prototype._createTableSchema = Or, at.prototype._parseIndexSyntax = On, at.prototype._parseStoresSpec = function(e, r) {
|
|
2426
2426
|
var n = this;
|
|
2427
2427
|
R(e).forEach(function(a) {
|
|
2428
2428
|
if (e[a] !== null) {
|
|
2429
|
-
var
|
|
2429
|
+
var i = n._parseIndexSyntax(e[a]), c = i.shift();
|
|
2430
2430
|
if (!c) throw new B.Schema("Invalid schema for table " + a + ": " + e[a]);
|
|
2431
2431
|
if (c.unique = !0, c.multi) throw new B.Schema("Primary key cannot be multiEntry*");
|
|
2432
|
-
|
|
2432
|
+
i.forEach(function(u) {
|
|
2433
2433
|
if (u.auto) throw new B.Schema("Only primary key can be marked as autoIncrement (++)");
|
|
2434
2434
|
if (!u.keyPath) throw new B.Schema("Index must have a name and cannot be an empty string");
|
|
2435
|
-
}),
|
|
2435
|
+
}), i = n._createTableSchema(a, c, i), r[a] = i;
|
|
2436
2436
|
}
|
|
2437
2437
|
});
|
|
2438
2438
|
}, at.prototype.stores = function(n) {
|
|
2439
2439
|
var r = this.db;
|
|
2440
|
-
this._cfg.storesSource = this._cfg.storesSource ?
|
|
2441
|
-
var n = r._versions, a = {},
|
|
2440
|
+
this._cfg.storesSource = this._cfg.storesSource ? F(this._cfg.storesSource, n) : n;
|
|
2441
|
+
var n = r._versions, a = {}, i = {};
|
|
2442
2442
|
return n.forEach(function(c) {
|
|
2443
|
-
|
|
2444
|
-
}), r._dbSchema =
|
|
2443
|
+
F(a, c._cfg.storesSource), i = c._cfg.dbschema = {}, c._parseStoresSpec(a, i);
|
|
2444
|
+
}), r._dbSchema = i, Ar(r, [r._allTables, r, r.Transaction.prototype]), Ht(r, [r._allTables, r, r.Transaction.prototype, this._cfg.tables], R(i), i), r._storeNames = R(i), this;
|
|
2445
2445
|
}, at.prototype.upgrade = function(e) {
|
|
2446
2446
|
return this._cfg.contentUpgrade = cr(this._cfg.contentUpgrade || Q, e), this;
|
|
2447
2447
|
}, at);
|
|
@@ -2465,19 +2465,19 @@ function Ba() {
|
|
|
2465
2465
|
var se = function(e, r) {
|
|
2466
2466
|
if (!this) {
|
|
2467
2467
|
var n = new se();
|
|
2468
|
-
return e && "d" in e &&
|
|
2468
|
+
return e && "d" in e && F(n, e), n;
|
|
2469
2469
|
}
|
|
2470
|
-
|
|
2470
|
+
F(this, arguments.length ? { d: 1, from: e, to: 1 < arguments.length ? r : e } : { d: 0 });
|
|
2471
2471
|
};
|
|
2472
2472
|
function St(e, r, n) {
|
|
2473
|
-
var a =
|
|
2473
|
+
var a = z(r, n);
|
|
2474
2474
|
if (!isNaN(a)) {
|
|
2475
2475
|
if (0 < a) throw RangeError();
|
|
2476
|
-
if (Rr(e)) return
|
|
2477
|
-
var
|
|
2478
|
-
if (
|
|
2479
|
-
if (0 <
|
|
2480
|
-
|
|
2476
|
+
if (Rr(e)) return F(e, { from: r, to: n, d: 1 });
|
|
2477
|
+
var i = e.l, a = e.r;
|
|
2478
|
+
if (z(n, e.from) < 0) return i ? St(i, r, n) : e.l = { from: r, to: n, d: 1, l: null, r: null }, An(e);
|
|
2479
|
+
if (0 < z(r, e.to)) return a ? St(a, r, n) : e.r = { from: r, to: n, d: 1, l: null, r: null }, An(e);
|
|
2480
|
+
z(r, e.from) < 0 && (e.from = r, e.l = null, e.d = a ? a.d + 1 : 1), 0 < z(n, e.to) && (e.to = n, e.r = null, e.d = e.l ? e.l.d + 1 : 1), n = !e.r, i && !e.l && Ot(e, i), a && n && Ot(e, a);
|
|
2481
2481
|
}
|
|
2482
2482
|
}
|
|
2483
2483
|
function Ot(e, r) {
|
|
@@ -2489,9 +2489,9 @@ function Ba() {
|
|
|
2489
2489
|
function _n(e, r) {
|
|
2490
2490
|
var n = Xt(r), a = n.next();
|
|
2491
2491
|
if (a.done) return !1;
|
|
2492
|
-
for (var
|
|
2493
|
-
if (
|
|
2494
|
-
|
|
2492
|
+
for (var i = a.value, c = Xt(e), u = c.next(i.from), d = u.value; !a.done && !u.done; ) {
|
|
2493
|
+
if (z(d.from, i.to) <= 0 && 0 <= z(d.to, i.from)) return !0;
|
|
2494
|
+
z(i.from, d.from) < 0 ? i = (a = n.next(d.from)).value : d = (u = c.next(i.from)).value;
|
|
2495
2495
|
}
|
|
2496
2496
|
return !1;
|
|
2497
2497
|
}
|
|
@@ -2500,10 +2500,10 @@ function Ba() {
|
|
|
2500
2500
|
return { next: function(n) {
|
|
2501
2501
|
for (var a = 0 < arguments.length; r; ) switch (r.s) {
|
|
2502
2502
|
case 0:
|
|
2503
|
-
if (r.s = 1, a) for (; r.n.l &&
|
|
2503
|
+
if (r.s = 1, a) for (; r.n.l && z(n, r.n.from) < 0; ) r = { up: r, n: r.n.l, s: 1 };
|
|
2504
2504
|
else for (; r.n.l; ) r = { up: r, n: r.n.l, s: 1 };
|
|
2505
2505
|
case 1:
|
|
2506
|
-
if (r.s = 2, !a ||
|
|
2506
|
+
if (r.s = 2, !a || z(n, r.n.to) <= 0) return { value: r.n, done: !1 };
|
|
2507
2507
|
case 2:
|
|
2508
2508
|
if (r.n.r) {
|
|
2509
2509
|
r.s = 3, r = { up: r, n: r.n.r, s: 0 };
|
|
@@ -2516,8 +2516,8 @@ function Ba() {
|
|
|
2516
2516
|
} };
|
|
2517
2517
|
}
|
|
2518
2518
|
function An(e) {
|
|
2519
|
-
var r, n, a = (((r = e.r) === null || r === void 0 ? void 0 : r.d) || 0) - (((n = e.l) === null || n === void 0 ? void 0 : n.d) || 0),
|
|
2520
|
-
|
|
2519
|
+
var r, n, a = (((r = e.r) === null || r === void 0 ? void 0 : r.d) || 0) - (((n = e.l) === null || n === void 0 ? void 0 : n.d) || 0), i = 1 < a ? "r" : a < -1 ? "l" : "";
|
|
2520
|
+
i && (r = i == "r" ? "l" : "r", n = l({}, e), a = e[i], e.from = a.from, e.to = a.to, e[i] = a[i], n[i] = a[r], (e[r] = n).d = Pn(n)), e.d = Pn(e);
|
|
2521
2521
|
}
|
|
2522
2522
|
function Pn(n) {
|
|
2523
2523
|
var r = n.r, n = n.l;
|
|
@@ -2525,9 +2525,9 @@ function Ba() {
|
|
|
2525
2525
|
}
|
|
2526
2526
|
function Qt(e, r) {
|
|
2527
2527
|
return R(r).forEach(function(n) {
|
|
2528
|
-
e[n] ? Ot(e[n], r[n]) : e[n] = (function a(
|
|
2528
|
+
e[n] ? Ot(e[n], r[n]) : e[n] = (function a(i) {
|
|
2529
2529
|
var c, u, d = {};
|
|
2530
|
-
for (c in
|
|
2530
|
+
for (c in i) ae(i, c) && (u = i[c], d[c] = !u || typeof u != "object" || Jr.has(u.constructor) ? u : a(u));
|
|
2531
2531
|
return d;
|
|
2532
2532
|
})(r[n]);
|
|
2533
2533
|
}), e;
|
|
@@ -2548,7 +2548,7 @@ function Ba() {
|
|
|
2548
2548
|
}), this;
|
|
2549
2549
|
}, hasKey: function(e) {
|
|
2550
2550
|
var r = Xt(this).next(e).value;
|
|
2551
|
-
return r &&
|
|
2551
|
+
return r && z(r.from, e) <= 0 && 0 <= z(r.to, e);
|
|
2552
2552
|
} })[sr] = function() {
|
|
2553
2553
|
return Xt(this);
|
|
2554
2554
|
}, he));
|
|
@@ -2561,7 +2561,7 @@ function Ba() {
|
|
|
2561
2561
|
function Cr(e, r) {
|
|
2562
2562
|
r === void 0 && (r = !1);
|
|
2563
2563
|
var n = /* @__PURE__ */ new Set();
|
|
2564
|
-
if (e.all) for (var a = 0,
|
|
2564
|
+
if (e.all) for (var a = 0, i = Object.values(He); a < i.length; a++) Dn(u = i[a], e, n, r);
|
|
2565
2565
|
else for (var c in e) {
|
|
2566
2566
|
var u, d = /^idb\:\/\/(.*)\/(.*)\//.exec(c);
|
|
2567
2567
|
d && (c = d[1], d = d[2], (u = He["idb://".concat(c, "/").concat(d)]) && Dn(u, e, n, r));
|
|
@@ -2571,16 +2571,16 @@ function Ba() {
|
|
|
2571
2571
|
});
|
|
2572
2572
|
}
|
|
2573
2573
|
function Dn(e, r, n, a) {
|
|
2574
|
-
for (var
|
|
2574
|
+
for (var i = [], c = 0, u = Object.entries(e.queries.query); c < u.length; c++) {
|
|
2575
2575
|
for (var d = u[c], p = d[0], y = [], S = 0, h = d[1]; S < h.length; S++) {
|
|
2576
2576
|
var _ = h[S];
|
|
2577
2577
|
kr(r, _.obsSet) ? _.subscribers.forEach(function(O) {
|
|
2578
2578
|
return n.add(O);
|
|
2579
2579
|
}) : a && y.push(_);
|
|
2580
2580
|
}
|
|
2581
|
-
a &&
|
|
2581
|
+
a && i.push([p, y]);
|
|
2582
2582
|
}
|
|
2583
|
-
if (a) for (var b = 0, v =
|
|
2583
|
+
if (a) for (var b = 0, v = i; b < v.length; b++) {
|
|
2584
2584
|
var E = v[b], p = E[0], y = E[1];
|
|
2585
2585
|
e.queries.query[p] = y;
|
|
2586
2586
|
}
|
|
@@ -2591,14 +2591,14 @@ function Ba() {
|
|
|
2591
2591
|
return r.dbOpenError ? ee(r.dbOpenError) : e;
|
|
2592
2592
|
});
|
|
2593
2593
|
r.isBeingOpened = !0, r.dbOpenError = null, r.openComplete = !1;
|
|
2594
|
-
var a = r.openCanceller,
|
|
2594
|
+
var a = r.openCanceller, i = Math.round(10 * e.verno), c = !1;
|
|
2595
2595
|
function u() {
|
|
2596
2596
|
if (r.openCanceller !== a) throw new B.DatabaseClosed("db.open() was cancelled");
|
|
2597
2597
|
}
|
|
2598
2598
|
function d() {
|
|
2599
2599
|
return new M(function(_, b) {
|
|
2600
2600
|
if (u(), !n) throw new B.MissingAPI();
|
|
2601
|
-
var v = e.name, E = r.autoSchema || !
|
|
2601
|
+
var v = e.name, E = r.autoSchema || !i ? n.open(v) : n.open(v, i);
|
|
2602
2602
|
if (!E) throw new B.MissingAPI();
|
|
2603
2603
|
E.onerror = be(b), E.onblocked = q(e._fireOnBlocked), E.onupgradeneeded = q(function(O) {
|
|
2604
2604
|
var A;
|
|
@@ -2613,7 +2613,7 @@ function Ba() {
|
|
|
2613
2613
|
if (r.autoSchema) A = k, P = I, (O = e).verno = A.version / 10, P = O._dbSchema = zt(0, A, P), O._storeNames = Dt(A.objectStoreNames, 0), Ht(O, [O._allTables], R(P), P);
|
|
2614
2614
|
else if (Yt(e, e._dbSchema, I), ((N = Pr(zt(0, (N = e).idbdb, I), N._dbSchema)).add.length || N.change.some(function(x) {
|
|
2615
2615
|
return x.add.length || x.change.length;
|
|
2616
|
-
})) && !c) 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."), k.close(),
|
|
2616
|
+
})) && !c) 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."), k.close(), i = k.version + 1, c = !0, _(d());
|
|
2617
2617
|
Ft(e, I);
|
|
2618
2618
|
} catch {
|
|
2619
2619
|
}
|
|
@@ -2629,7 +2629,7 @@ function Ba() {
|
|
|
2629
2629
|
if (0 < r.PR1398_maxLoop) return r.PR1398_maxLoop--, console.warn("Dexie: Workaround for Chrome UnknownError on open()"), d();
|
|
2630
2630
|
break;
|
|
2631
2631
|
case "VersionError":
|
|
2632
|
-
if (0 <
|
|
2632
|
+
if (0 < i) return i = 0, d();
|
|
2633
2633
|
}
|
|
2634
2634
|
return M.reject(_);
|
|
2635
2635
|
});
|
|
@@ -2677,31 +2677,31 @@ function Ba() {
|
|
|
2677
2677
|
function r(c) {
|
|
2678
2678
|
return e.next(c);
|
|
2679
2679
|
}
|
|
2680
|
-
var n =
|
|
2680
|
+
var n = i(r), a = i(function(c) {
|
|
2681
2681
|
return e.throw(c);
|
|
2682
2682
|
});
|
|
2683
|
-
function
|
|
2683
|
+
function i(c) {
|
|
2684
2684
|
return function(p) {
|
|
2685
2685
|
var d = c(p), p = d.value;
|
|
2686
2686
|
return d.done ? p : p && typeof p.then == "function" ? p.then(n, a) : T(p) ? Promise.all(p).then(n, a) : n(p);
|
|
2687
2687
|
};
|
|
2688
2688
|
}
|
|
2689
|
-
return
|
|
2689
|
+
return i(r)();
|
|
2690
2690
|
}
|
|
2691
2691
|
function Zt(e, r, n) {
|
|
2692
|
-
for (var a = T(e) ? e.slice() : [e],
|
|
2692
|
+
for (var a = T(e) ? e.slice() : [e], i = 0; i < n; ++i) a.push(r);
|
|
2693
2693
|
return a;
|
|
2694
2694
|
}
|
|
2695
2695
|
var Ea = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(e) {
|
|
2696
2696
|
return l(l({}, e), { table: function(r) {
|
|
2697
|
-
var n = e.table(r), a = n.schema,
|
|
2697
|
+
var n = e.table(r), a = n.schema, i = {}, c = [];
|
|
2698
2698
|
function u(h, _, b) {
|
|
2699
|
-
var v = wt(h), E =
|
|
2699
|
+
var v = wt(h), E = i[v] = i[v] || [], O = h == null ? 0 : typeof h == "string" ? 1 : h.length, A = 0 < _, A = l(l({}, b), { name: A ? "".concat(v, "(virtual-from:").concat(b.name, ")") : b.name, lowLevelIndex: b, isVirtual: A, keyTail: _, keyLength: O, extractKey: _r(h), unique: !A && b.unique });
|
|
2700
2700
|
return E.push(A), A.isPrimaryKey || c.push(A), 1 < O && u(O === 2 ? h[0] : h.slice(0, O - 1), _ + 1, b), E.sort(function(P, D) {
|
|
2701
2701
|
return P.keyTail - D.keyTail;
|
|
2702
2702
|
}), A;
|
|
2703
2703
|
}
|
|
2704
|
-
r = u(a.primaryKey.keyPath, 0, a.primaryKey),
|
|
2704
|
+
r = u(a.primaryKey.keyPath, 0, a.primaryKey), i[":id"] = [r];
|
|
2705
2705
|
for (var d = 0, p = a.indexes; d < p.length; d++) {
|
|
2706
2706
|
var y = p[d];
|
|
2707
2707
|
u(y.keyPath, 0, y);
|
|
@@ -2711,7 +2711,7 @@ function Ba() {
|
|
|
2711
2711
|
return b.isVirtual ? l(l({}, h), { query: { index: b.lowLevelIndex, range: (_ = h.query.range, b = b.keyTail, { type: _.type === 1 ? 2 : _.type, lower: Zt(_.lower, _.lowerOpen ? e.MAX_KEY : e.MIN_KEY, b), lowerOpen: !0, upper: Zt(_.upper, _.upperOpen ? e.MIN_KEY : e.MAX_KEY, b), upperOpen: !0 }) } }) : h;
|
|
2712
2712
|
}
|
|
2713
2713
|
return l(l({}, n), { schema: l(l({}, a), { primaryKey: r, indexes: c, getIndexByKeyPath: function(h) {
|
|
2714
|
-
return (h =
|
|
2714
|
+
return (h = i[wt(h)]) && h[0];
|
|
2715
2715
|
} }), count: function(h) {
|
|
2716
2716
|
return n.count(S(h));
|
|
2717
2717
|
}, query: function(h) {
|
|
@@ -2739,11 +2739,11 @@ function Ba() {
|
|
|
2739
2739
|
} });
|
|
2740
2740
|
} };
|
|
2741
2741
|
function jr(e, r, n, a) {
|
|
2742
|
-
return n = n || {}, a = a || "", R(e).forEach(function(
|
|
2742
|
+
return n = n || {}, a = a || "", R(e).forEach(function(i) {
|
|
2743
2743
|
var c, u, d;
|
|
2744
|
-
ae(r,
|
|
2745
|
-
}), R(r).forEach(function(
|
|
2746
|
-
ae(e,
|
|
2744
|
+
ae(r, i) ? (c = e[i], u = r[i], typeof c == "object" && typeof u == "object" && c && u ? (d = ar(c)) !== ar(u) ? n[a + i] = r[i] : d === "Object" ? jr(c, u, n, a + i + ".") : c !== u && (n[a + i] = r[i]) : c !== u && (n[a + i] = r[i])) : n[a + i] = void 0;
|
|
2745
|
+
}), R(r).forEach(function(i) {
|
|
2746
|
+
ae(e, i) || (n[a + i] = r[i]);
|
|
2747
2747
|
}), n;
|
|
2748
2748
|
}
|
|
2749
2749
|
function Mr(e, r) {
|
|
@@ -2752,23 +2752,23 @@ function Ba() {
|
|
|
2752
2752
|
var wa = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: function(e) {
|
|
2753
2753
|
return l(l({}, e), { table: function(r) {
|
|
2754
2754
|
var n = e.table(r), a = n.schema.primaryKey;
|
|
2755
|
-
return l(l({}, n), { mutate: function(
|
|
2755
|
+
return l(l({}, n), { mutate: function(i) {
|
|
2756
2756
|
var c = L.trans, u = c.table(r).hook, d = u.deleting, p = u.creating, y = u.updating;
|
|
2757
|
-
switch (
|
|
2757
|
+
switch (i.type) {
|
|
2758
2758
|
case "add":
|
|
2759
2759
|
if (p.fire === Q) break;
|
|
2760
2760
|
return c._promise("readwrite", function() {
|
|
2761
|
-
return S(
|
|
2761
|
+
return S(i);
|
|
2762
2762
|
}, !0);
|
|
2763
2763
|
case "put":
|
|
2764
2764
|
if (p.fire === Q && y.fire === Q) break;
|
|
2765
2765
|
return c._promise("readwrite", function() {
|
|
2766
|
-
return S(
|
|
2766
|
+
return S(i);
|
|
2767
2767
|
}, !0);
|
|
2768
2768
|
case "delete":
|
|
2769
2769
|
if (d.fire === Q) break;
|
|
2770
2770
|
return c._promise("readwrite", function() {
|
|
2771
|
-
return S(
|
|
2771
|
+
return S(i);
|
|
2772
2772
|
}, !0);
|
|
2773
2773
|
case "deleteRange":
|
|
2774
2774
|
if (d.fire === Q) break;
|
|
@@ -2780,10 +2780,10 @@ function Ba() {
|
|
|
2780
2780
|
return 0 < A.numFailures ? Promise.reject(A.failures[0]) : O.length < v ? { failures: [], numFailures: 0, lastResult: void 0 } : h(_, l(l({}, b), { lower: O[O.length - 1], lowerOpen: !0 }), v);
|
|
2781
2781
|
});
|
|
2782
2782
|
});
|
|
2783
|
-
})(
|
|
2783
|
+
})(i.trans, i.range, 1e4);
|
|
2784
2784
|
}, !0);
|
|
2785
2785
|
}
|
|
2786
|
-
return n.mutate(
|
|
2786
|
+
return n.mutate(i);
|
|
2787
2787
|
function S(h) {
|
|
2788
2788
|
var _, b, v, E = L.trans, O = h.keys || Mr(a, h);
|
|
2789
2789
|
if (!O) throw new Error("Keys missing");
|
|
@@ -2813,7 +2813,7 @@ function Ba() {
|
|
|
2813
2813
|
function Nn(e, r, n) {
|
|
2814
2814
|
try {
|
|
2815
2815
|
if (!r || r.keys.length < e.length) return null;
|
|
2816
|
-
for (var a = [],
|
|
2816
|
+
for (var a = [], i = 0, c = 0; i < r.keys.length && c < e.length; ++i) z(r.keys[i], e[c]) === 0 && (a.push(n ? Ce(r.values[i]) : r.values[i]), ++c);
|
|
2817
2817
|
return a.length === e.length ? a : null;
|
|
2818
2818
|
} catch {
|
|
2819
2819
|
return null;
|
|
@@ -2824,8 +2824,8 @@ function Ba() {
|
|
|
2824
2824
|
var n = e.table(r);
|
|
2825
2825
|
return l(l({}, n), { getMany: function(a) {
|
|
2826
2826
|
if (!a.cache) return n.getMany(a);
|
|
2827
|
-
var
|
|
2828
|
-
return
|
|
2827
|
+
var i = Nn(a.keys, a.trans._cache, a.cache === "clone");
|
|
2828
|
+
return i ? M.resolve(i) : n.getMany(a).then(function(c) {
|
|
2829
2829
|
return a.trans._cache = { keys: a.keys, values: a.cache === "clone" ? Ce(c) : c }, c;
|
|
2830
2830
|
});
|
|
2831
2831
|
}, mutate: function(a) {
|
|
@@ -2849,13 +2849,13 @@ function Ba() {
|
|
|
2849
2849
|
}
|
|
2850
2850
|
var Oa = { stack: "dbcore", level: 0, name: "Observability", create: function(e) {
|
|
2851
2851
|
var r = e.schema.name, n = new se(e.MIN_KEY, e.MAX_KEY);
|
|
2852
|
-
return l(l({}, e), { transaction: function(a,
|
|
2853
|
-
if (L.subscr &&
|
|
2854
|
-
return e.transaction(a,
|
|
2852
|
+
return l(l({}, e), { transaction: function(a, i, c) {
|
|
2853
|
+
if (L.subscr && i !== "readonly") throw new B.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(L.querier));
|
|
2854
|
+
return e.transaction(a, i, c);
|
|
2855
2855
|
}, table: function(a) {
|
|
2856
|
-
var
|
|
2856
|
+
var i = e.table(a), c = i.schema, u = c.primaryKey, h = c.indexes, d = u.extractKey, p = u.outbound, y = u.autoIncrement && h.filter(function(b) {
|
|
2857
2857
|
return b.compound && b.keyPath.includes(u.keyPath);
|
|
2858
|
-
}), S = l(l({},
|
|
2858
|
+
}), S = l(l({}, i), { mutate: function(b) {
|
|
2859
2859
|
function v($) {
|
|
2860
2860
|
return $ = "idb://".concat(r, "/").concat(a, "/").concat($), D[$] || (D[$] = new se());
|
|
2861
2861
|
}
|
|
@@ -2864,27 +2864,27 @@ function Ba() {
|
|
|
2864
2864
|
}), b.values] : [], I = j[0], x = j[1], j = b.trans._cache;
|
|
2865
2865
|
return T(I) ? (N.addKeys(I), (j = G === "delete" || I.length === x.length ? Nn(I, j) : null) || k.addKeys(I), (j || x) && (E = v, O = j, A = x, c.indexes.forEach(function($) {
|
|
2866
2866
|
var K = E($.name || "");
|
|
2867
|
-
function U(
|
|
2868
|
-
return
|
|
2867
|
+
function U(V) {
|
|
2868
|
+
return V != null ? $.extractKey(V) : null;
|
|
2869
2869
|
}
|
|
2870
|
-
function
|
|
2871
|
-
return $.multiEntry && T(
|
|
2870
|
+
function H(V) {
|
|
2871
|
+
return $.multiEntry && T(V) ? V.forEach(function(de) {
|
|
2872
2872
|
return K.addKey(de);
|
|
2873
|
-
}) : K.addKey(
|
|
2873
|
+
}) : K.addKey(V);
|
|
2874
2874
|
}
|
|
2875
|
-
(O || A).forEach(function(
|
|
2876
|
-
var W = O && U(O[
|
|
2877
|
-
|
|
2875
|
+
(O || A).forEach(function(V, ie) {
|
|
2876
|
+
var W = O && U(O[ie]), ie = A && U(A[ie]);
|
|
2877
|
+
z(W, ie) !== 0 && (W != null && H(W), ie != null && H(ie));
|
|
2878
2878
|
});
|
|
2879
2879
|
}))) : I ? (x = { from: (x = I.lower) !== null && x !== void 0 ? x : e.MIN_KEY, to: (x = I.upper) !== null && x !== void 0 ? x : e.MAX_KEY }, k.add(x), N.add(x)) : (N.add(n), k.add(n), c.indexes.forEach(function($) {
|
|
2880
2880
|
return v($.name).add(n);
|
|
2881
|
-
})),
|
|
2881
|
+
})), i.mutate(b).then(function($) {
|
|
2882
2882
|
return !I || b.type !== "add" && b.type !== "put" || (N.addKeys($.results), y && y.forEach(function(K) {
|
|
2883
2883
|
for (var U = b.values.map(function(W) {
|
|
2884
2884
|
return K.extractKey(W);
|
|
2885
|
-
}),
|
|
2885
|
+
}), H = K.keyPath.findIndex(function(W) {
|
|
2886
2886
|
return W === u.keyPath;
|
|
2887
|
-
}),
|
|
2887
|
+
}), V = 0, de = $.results.length; V < de; ++V) U[V][H] = $.results[V];
|
|
2888
2888
|
v(K.name).addKeys(U);
|
|
2889
2889
|
})), P.mutatedParts = Qt(P.mutatedParts || {}, D), $;
|
|
2890
2890
|
});
|
|
@@ -2898,15 +2898,15 @@ function Ba() {
|
|
|
2898
2898
|
}, count: h, query: h, openCursor: h };
|
|
2899
2899
|
return R(_).forEach(function(b) {
|
|
2900
2900
|
S[b] = function(v) {
|
|
2901
|
-
var E = L.subscr, O = !!E, A = Tn(L,
|
|
2901
|
+
var E = L.subscr, O = !!E, A = Tn(L, i) && In(b, v) ? v.obsSet = {} : E;
|
|
2902
2902
|
if (O) {
|
|
2903
2903
|
var P = function(x) {
|
|
2904
2904
|
return x = "idb://".concat(r, "/").concat(a, "/").concat(x), A[x] || (A[x] = new se());
|
|
2905
2905
|
}, D = P(""), N = P(":dels"), E = _[b](v), O = E[0], E = E[1];
|
|
2906
2906
|
if ((b === "query" && O.isPrimaryKey && !v.values ? N : P(O.name || "")).add(E), !O.isPrimaryKey) {
|
|
2907
2907
|
if (b !== "count") {
|
|
2908
|
-
var k = b === "query" && p && v.values &&
|
|
2909
|
-
return
|
|
2908
|
+
var k = b === "query" && p && v.values && i.query(l(l({}, v), { values: !1 }));
|
|
2909
|
+
return i[b].apply(this, arguments).then(function(x) {
|
|
2910
2910
|
if (b === "query") {
|
|
2911
2911
|
if (p && v.values) return k.then(function(U) {
|
|
2912
2912
|
return U = U.result, D.addKeys(U), x;
|
|
@@ -2930,7 +2930,7 @@ function Ba() {
|
|
|
2930
2930
|
N.add(n);
|
|
2931
2931
|
}
|
|
2932
2932
|
}
|
|
2933
|
-
return
|
|
2933
|
+
return i[b].apply(this, arguments);
|
|
2934
2934
|
};
|
|
2935
2935
|
}), S;
|
|
2936
2936
|
} });
|
|
@@ -2939,17 +2939,17 @@ function Ba() {
|
|
|
2939
2939
|
if (n.numFailures === 0) return r;
|
|
2940
2940
|
if (r.type === "deleteRange") return null;
|
|
2941
2941
|
var a = r.keys ? r.keys.length : "values" in r && r.values ? r.values.length : 1;
|
|
2942
|
-
return n.numFailures === a ? null : (r = l({}, r), T(r.keys) && (r.keys = r.keys.filter(function(
|
|
2942
|
+
return n.numFailures === a ? null : (r = l({}, r), T(r.keys) && (r.keys = r.keys.filter(function(i, c) {
|
|
2943
2943
|
return !(c in n.failures);
|
|
2944
|
-
})), "values" in r && T(r.values) && (r.values = r.values.filter(function(
|
|
2944
|
+
})), "values" in r && T(r.values) && (r.values = r.values.filter(function(i, c) {
|
|
2945
2945
|
return !(c in n.failures);
|
|
2946
2946
|
})), r);
|
|
2947
2947
|
}
|
|
2948
2948
|
function Kr(e, r) {
|
|
2949
|
-
return n = e, ((a = r).lower === void 0 || (a.lowerOpen ? 0 <
|
|
2949
|
+
return n = e, ((a = r).lower === void 0 || (a.lowerOpen ? 0 < z(n, a.lower) : 0 <= z(n, a.lower))) && (e = e, (r = r).upper === void 0 || (r.upperOpen ? z(e, r.upper) < 0 : z(e, r.upper) <= 0));
|
|
2950
2950
|
var n, a;
|
|
2951
2951
|
}
|
|
2952
|
-
function kn(e, r, _, a,
|
|
2952
|
+
function kn(e, r, _, a, i, c) {
|
|
2953
2953
|
if (!_ || _.length === 0) return e;
|
|
2954
2954
|
var u = r.query.index, d = u.multiEntry, p = r.query.range, y = a.schema.primaryKey.extractKey, S = u.extractKey, h = (u.lowLevelIndex || u).extractKey, _ = _.reduce(function(b, v) {
|
|
2955
2955
|
var E = b, O = [];
|
|
@@ -2996,28 +2996,28 @@ function Ba() {
|
|
|
2996
2996
|
return E;
|
|
2997
2997
|
}, e);
|
|
2998
2998
|
return _ === e ? e : (_.sort(function(b, v) {
|
|
2999
|
-
return
|
|
3000
|
-
}), r.limit && r.limit < 1 / 0 && (_.length > r.limit ? _.length = r.limit : e.length === r.limit && _.length < r.limit && (
|
|
2999
|
+
return z(h(b), h(v)) || z(y(b), y(v));
|
|
3000
|
+
}), r.limit && r.limit < 1 / 0 && (_.length > r.limit ? _.length = r.limit : e.length === r.limit && _.length < r.limit && (i.dirty = !0)), c ? Object.freeze(_) : _);
|
|
3001
3001
|
}
|
|
3002
3002
|
function xn(e, r) {
|
|
3003
|
-
return
|
|
3003
|
+
return z(e.lower, r.lower) === 0 && z(e.upper, r.upper) === 0 && !!e.lowerOpen == !!r.lowerOpen && !!e.upperOpen == !!r.upperOpen;
|
|
3004
3004
|
}
|
|
3005
3005
|
function _a(e, r) {
|
|
3006
|
-
return (function(n, a,
|
|
3006
|
+
return (function(n, a, i, c) {
|
|
3007
3007
|
if (n === void 0) return a !== void 0 ? -1 : 0;
|
|
3008
3008
|
if (a === void 0) return 1;
|
|
3009
|
-
if ((a =
|
|
3010
|
-
if (
|
|
3011
|
-
if (
|
|
3009
|
+
if ((a = z(n, a)) === 0) {
|
|
3010
|
+
if (i && c) return 0;
|
|
3011
|
+
if (i) return 1;
|
|
3012
3012
|
if (c) return -1;
|
|
3013
3013
|
}
|
|
3014
3014
|
return a;
|
|
3015
|
-
})(e.lower, r.lower, e.lowerOpen, r.lowerOpen) <= 0 && 0 <= (function(n, a,
|
|
3015
|
+
})(e.lower, r.lower, e.lowerOpen, r.lowerOpen) <= 0 && 0 <= (function(n, a, i, c) {
|
|
3016
3016
|
if (n === void 0) return a !== void 0 ? 1 : 0;
|
|
3017
3017
|
if (a === void 0) return -1;
|
|
3018
|
-
if ((a =
|
|
3019
|
-
if (
|
|
3020
|
-
if (
|
|
3018
|
+
if ((a = z(n, a)) === 0) {
|
|
3019
|
+
if (i && c) return 0;
|
|
3020
|
+
if (i) return -1;
|
|
3021
3021
|
if (c) return 1;
|
|
3022
3022
|
}
|
|
3023
3023
|
return a;
|
|
@@ -3025,17 +3025,17 @@ function Ba() {
|
|
|
3025
3025
|
}
|
|
3026
3026
|
function Aa(e, r, n, a) {
|
|
3027
3027
|
e.subscribers.add(n), a.addEventListener("abort", function() {
|
|
3028
|
-
var
|
|
3029
|
-
e.subscribers.delete(n), e.subscribers.size === 0 && (
|
|
3030
|
-
|
|
3028
|
+
var i, c;
|
|
3029
|
+
e.subscribers.delete(n), e.subscribers.size === 0 && (i = e, c = r, setTimeout(function() {
|
|
3030
|
+
i.subscribers.size === 0 && Ge(c, i);
|
|
3031
3031
|
}, 3e3));
|
|
3032
3032
|
});
|
|
3033
3033
|
}
|
|
3034
3034
|
var Pa = { stack: "dbcore", level: 0, name: "Cache", create: function(e) {
|
|
3035
3035
|
var r = e.schema.name;
|
|
3036
|
-
return l(l({}, e), { transaction: function(n, a,
|
|
3037
|
-
var c, u, d = e.transaction(n, a,
|
|
3038
|
-
return a === "readwrite" && (u = (c = new AbortController()).signal,
|
|
3036
|
+
return l(l({}, e), { transaction: function(n, a, i) {
|
|
3037
|
+
var c, u, d = e.transaction(n, a, i);
|
|
3038
|
+
return a === "readwrite" && (u = (c = new AbortController()).signal, i = function(p) {
|
|
3039
3039
|
return function() {
|
|
3040
3040
|
if (c.abort(), a === "readwrite") {
|
|
3041
3041
|
for (var y = /* @__PURE__ */ new Set(), S = 0, h = n; S < h.length; S++) {
|
|
@@ -3064,14 +3064,14 @@ function Ba() {
|
|
|
3064
3064
|
});
|
|
3065
3065
|
}
|
|
3066
3066
|
};
|
|
3067
|
-
}, d.addEventListener("abort",
|
|
3067
|
+
}, d.addEventListener("abort", i(!1), { signal: u }), d.addEventListener("error", i(!1), { signal: u }), d.addEventListener("complete", i(!0), { signal: u })), d;
|
|
3068
3068
|
}, table: function(n) {
|
|
3069
|
-
var a = e.table(n),
|
|
3069
|
+
var a = e.table(n), i = a.schema.primaryKey;
|
|
3070
3070
|
return l(l({}, a), { mutate: function(c) {
|
|
3071
3071
|
var u = L.trans;
|
|
3072
|
-
if (
|
|
3072
|
+
if (i.outbound || u.db._options.cache === "disabled" || u.explicit || u.idbtrans.mode !== "readwrite") return a.mutate(c);
|
|
3073
3073
|
var d = He["idb://".concat(r, "/").concat(n)];
|
|
3074
|
-
return d ? (u = a.mutate(c), c.type !== "add" && c.type !== "put" || !(50 <= c.values.length || Mr(
|
|
3074
|
+
return d ? (u = a.mutate(c), c.type !== "add" && c.type !== "put" || !(50 <= c.values.length || Mr(i, c).some(function(p) {
|
|
3075
3075
|
return p == null;
|
|
3076
3076
|
})) ? (d.optimisticOps.push(c), c.mutatedParts && Jt(c.mutatedParts), u.then(function(p) {
|
|
3077
3077
|
0 < p.numFailures && (Ge(d.optimisticOps, c), (p = Rn(0, c, p)) && d.optimisticOps.push(p), c.mutatedParts && Jt(c.mutatedParts));
|
|
@@ -3080,7 +3080,7 @@ function Ba() {
|
|
|
3080
3080
|
})) : u.then(function(p) {
|
|
3081
3081
|
var y = Rn(0, l(l({}, c), { values: c.values.map(function(S, h) {
|
|
3082
3082
|
var _;
|
|
3083
|
-
return p.failures[h] ? S : (S = (_ =
|
|
3083
|
+
return p.failures[h] ? S : (S = (_ = i.keyPath) !== null && _ !== void 0 && _.includes(".") ? Ce(S) : l({}, S), ue(S, i.keyPath, p.results[h]), S);
|
|
3084
3084
|
}) }), p);
|
|
3085
3085
|
d.optimisticOps.push(y), queueMicrotask(function() {
|
|
3086
3086
|
return c.mutatedParts && Jt(c.mutatedParts);
|
|
@@ -3124,8 +3124,8 @@ function Ba() {
|
|
|
3124
3124
|
} });
|
|
3125
3125
|
} };
|
|
3126
3126
|
function qt(e, r) {
|
|
3127
|
-
return new Proxy(e, { get: function(n, a,
|
|
3128
|
-
return a === "db" ? r : Reflect.get(n, a,
|
|
3127
|
+
return new Proxy(e, { get: function(n, a, i) {
|
|
3128
|
+
return a === "db" ? r : Reflect.get(n, a, i);
|
|
3129
3129
|
} });
|
|
3130
3130
|
}
|
|
3131
3131
|
var Oe = (te.prototype.version = function(e) {
|
|
@@ -3147,14 +3147,14 @@ function Ba() {
|
|
|
3147
3147
|
r._state.dbReadyPromise.then(n, a);
|
|
3148
3148
|
}).then(e);
|
|
3149
3149
|
}, te.prototype.use = function(e) {
|
|
3150
|
-
var r = e.stack, n = e.create, a = e.level,
|
|
3151
|
-
return
|
|
3150
|
+
var r = e.stack, n = e.create, a = e.level, i = e.name;
|
|
3151
|
+
return i && this.unuse({ stack: r, name: i }), e = this._middlewares[r] || (this._middlewares[r] = []), e.push({ stack: r, create: n, level: a ?? 10, name: i }), e.sort(function(c, u) {
|
|
3152
3152
|
return c.level - u.level;
|
|
3153
3153
|
}), this;
|
|
3154
3154
|
}, te.prototype.unuse = function(e) {
|
|
3155
3155
|
var r = e.stack, n = e.name, a = e.create;
|
|
3156
|
-
return r && this._middlewares[r] && (this._middlewares[r] = this._middlewares[r].filter(function(
|
|
3157
|
-
return a ?
|
|
3156
|
+
return r && this._middlewares[r] && (this._middlewares[r] = this._middlewares[r].filter(function(i) {
|
|
3157
|
+
return a ? i.create !== a : !!n && i.name !== n;
|
|
3158
3158
|
})), this;
|
|
3159
3159
|
}, te.prototype.open = function() {
|
|
3160
3160
|
var e = this;
|
|
@@ -3183,13 +3183,13 @@ function Ba() {
|
|
|
3183
3183
|
var r = this;
|
|
3184
3184
|
e === void 0 && (e = { disableAutoOpen: !0 });
|
|
3185
3185
|
var n = 0 < arguments.length && typeof arguments[0] != "object", a = this._state;
|
|
3186
|
-
return new M(function(
|
|
3186
|
+
return new M(function(i, c) {
|
|
3187
3187
|
function u() {
|
|
3188
3188
|
r.close(e);
|
|
3189
3189
|
var d = r._deps.indexedDB.deleteDatabase(r.name);
|
|
3190
3190
|
d.onsuccess = q(function() {
|
|
3191
3191
|
var p, y, S;
|
|
3192
|
-
p = r._deps, y = r.name, S = p.indexedDB, p = p.IDBKeyRange, Tr(S) || y === Mt || Nr(S, p).delete(y).catch(Q),
|
|
3192
|
+
p = r._deps, y = r.name, S = p.indexedDB, p = p.IDBKeyRange, Tr(S) || y === Mt || Nr(S, p).delete(y).catch(Q), i();
|
|
3193
3193
|
}), d.onerror = be(c), d.onblocked = r._fireOnBlocked;
|
|
3194
3194
|
}
|
|
3195
3195
|
if (n) throw new B.InvalidArgument("Invalid closeOptions argument to db.delete()");
|
|
@@ -3213,15 +3213,15 @@ function Ba() {
|
|
|
3213
3213
|
});
|
|
3214
3214
|
}, enumerable: !1, configurable: !0 }), te.prototype.transaction = function() {
|
|
3215
3215
|
var e = function(r, n, a) {
|
|
3216
|
-
var
|
|
3217
|
-
if (
|
|
3218
|
-
for (var c = new Array(
|
|
3216
|
+
var i = arguments.length;
|
|
3217
|
+
if (i < 2) throw new B.InvalidArgument("Too few arguments");
|
|
3218
|
+
for (var c = new Array(i - 1); --i; ) c[i - 1] = arguments[i];
|
|
3219
3219
|
return a = c.pop(), [r, Qr(c), a];
|
|
3220
3220
|
}.apply(this, arguments);
|
|
3221
3221
|
return this._transaction.apply(this, e);
|
|
3222
3222
|
}, te.prototype._transaction = function(e, r, n) {
|
|
3223
|
-
var a = this,
|
|
3224
|
-
|
|
3223
|
+
var a = this, i = L.trans;
|
|
3224
|
+
i && i.db === this && e.indexOf("!") === -1 || (i = null);
|
|
3225
3225
|
var c, u, d = e.indexOf("?") !== -1;
|
|
3226
3226
|
e = e.replace("!", "").replace("?", "");
|
|
3227
3227
|
try {
|
|
@@ -3233,20 +3233,20 @@ function Ba() {
|
|
|
3233
3233
|
if (e != "rw" && e != br) throw new B.InvalidArgument("Invalid transaction mode: " + e);
|
|
3234
3234
|
c = br;
|
|
3235
3235
|
}
|
|
3236
|
-
if (
|
|
3237
|
-
if (
|
|
3236
|
+
if (i) {
|
|
3237
|
+
if (i.mode === yr && c === br) {
|
|
3238
3238
|
if (!d) throw new B.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");
|
|
3239
|
-
|
|
3239
|
+
i = null;
|
|
3240
3240
|
}
|
|
3241
|
-
|
|
3242
|
-
if (
|
|
3241
|
+
i && u.forEach(function(y) {
|
|
3242
|
+
if (i && i.storeNames.indexOf(y) === -1) {
|
|
3243
3243
|
if (!d) throw new B.SubTransaction("Table " + y + " not included in parent transaction.");
|
|
3244
|
-
|
|
3244
|
+
i = null;
|
|
3245
3245
|
}
|
|
3246
|
-
}), d &&
|
|
3246
|
+
}), d && i && !i.active && (i = null);
|
|
3247
3247
|
}
|
|
3248
3248
|
} catch (y) {
|
|
3249
|
-
return
|
|
3249
|
+
return i ? i._promise(null, function(S, h) {
|
|
3250
3250
|
h(y);
|
|
3251
3251
|
}) : ee(y);
|
|
3252
3252
|
}
|
|
@@ -3257,11 +3257,11 @@ function Ba() {
|
|
|
3257
3257
|
else try {
|
|
3258
3258
|
O.create(), O.idbtrans._explicit = !0, S._state.PR1398_maxLoop = 3;
|
|
3259
3259
|
} catch (D) {
|
|
3260
|
-
return D.name ===
|
|
3260
|
+
return D.name === or.InvalidState && S.isOpen() && 0 < --S._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), S.close({ disableAutoOpen: !1 }), S.open().then(function() {
|
|
3261
3261
|
return y(S, h, _, null, v);
|
|
3262
3262
|
})) : ee(D);
|
|
3263
3263
|
}
|
|
3264
|
-
var A, P =
|
|
3264
|
+
var A, P = ir(v);
|
|
3265
3265
|
return P && et(), E = M.follow(function() {
|
|
3266
3266
|
var D;
|
|
3267
3267
|
(A = v.call(O, O)) && (P ? (D = Te.bind(null, null), A.then(D, D)) : typeof A.next == "function" && typeof A.throw == "function" && (A = Gr(A)));
|
|
@@ -3277,8 +3277,8 @@ function Ba() {
|
|
|
3277
3277
|
return O._reject(D), ee(D);
|
|
3278
3278
|
});
|
|
3279
3279
|
});
|
|
3280
|
-
}.bind(null, this, c, u,
|
|
3281
|
-
return
|
|
3280
|
+
}.bind(null, this, c, u, i, n);
|
|
3281
|
+
return i ? i._promise(c, p, "lock") : L.trans ? We(L.transless, function() {
|
|
3282
3282
|
return a._whenReady(p);
|
|
3283
3283
|
}) : this._whenReady(p);
|
|
3284
3284
|
}, te.prototype.table = function(e) {
|
|
@@ -3290,7 +3290,7 @@ function Ba() {
|
|
|
3290
3290
|
this._middlewares = {}, this.verno = 0;
|
|
3291
3291
|
var a = te.dependencies;
|
|
3292
3292
|
this._options = r = l({ addons: te.addons, autoOpen: !0, indexedDB: a.indexedDB, IDBKeyRange: a.IDBKeyRange, cache: "cloned" }, r), this._deps = { indexedDB: r.indexedDB, IDBKeyRange: r.IDBKeyRange }, a = r.addons, this._dbSchema = {}, this._versions = [], this._storeNames = [], this._allTables = {}, this.idbdb = null, this._novip = this;
|
|
3293
|
-
var
|
|
3293
|
+
var i, c, u, d, p, y = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: Q, dbReadyPromise: null, cancelOpen: Q, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: r.autoOpen };
|
|
3294
3294
|
y.dbReadyPromise = new M(function(h) {
|
|
3295
3295
|
y.dbReadyResolve = h;
|
|
3296
3296
|
}), y.openCanceller = new M(function(h, _) {
|
|
@@ -3310,8 +3310,8 @@ function Ba() {
|
|
|
3310
3310
|
}));
|
|
3311
3311
|
});
|
|
3312
3312
|
};
|
|
3313
|
-
}), this.Collection = (
|
|
3314
|
-
this.db =
|
|
3313
|
+
}), this.Collection = (i = this, yt(ca.prototype, function(A, O) {
|
|
3314
|
+
this.db = i;
|
|
3315
3315
|
var b = cn, v = null;
|
|
3316
3316
|
if (O) try {
|
|
3317
3317
|
b = O();
|
|
@@ -3339,12 +3339,12 @@ function Ba() {
|
|
|
3339
3339
|
})), this.Version = (d = this, yt(ba.prototype, function(h) {
|
|
3340
3340
|
this.db = d, this._cfg = { version: h, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
|
|
3341
3341
|
})), this.WhereClause = (p = this, yt(vn.prototype, function(h, _, b) {
|
|
3342
|
-
if (this.db = p, this._ctx = { table: h, index: _ === ":id" ? null : _, or: b }, this._cmp = this._ascending =
|
|
3343
|
-
return
|
|
3342
|
+
if (this.db = p, this._ctx = { table: h, index: _ === ":id" ? null : _, or: b }, this._cmp = this._ascending = z, this._descending = function(v, E) {
|
|
3343
|
+
return z(E, v);
|
|
3344
3344
|
}, this._max = function(v, E) {
|
|
3345
|
-
return 0 <
|
|
3345
|
+
return 0 < z(v, E) ? v : E;
|
|
3346
3346
|
}, this._min = function(v, E) {
|
|
3347
|
-
return
|
|
3347
|
+
return z(v, E) < 0 ? v : E;
|
|
3348
3348
|
}, this._IDBKeyRange = p._deps.IDBKeyRange, !this._IDBKeyRange) throw new B.MissingAPI();
|
|
3349
3349
|
})), this.on("versionchange", function(h) {
|
|
3350
3350
|
0 < h.newVersion ? console.warn("Another connection wants to upgrade database '".concat(n.name, "'. Closing db now to resume the upgrade.")) : console.warn("Another connection wants to delete database '".concat(n.name, "'. Closing db now to resume the delete request.")), n.close({ disableAutoOpen: !1 });
|
|
@@ -3389,13 +3389,13 @@ function Ba() {
|
|
|
3389
3389
|
er = { indexedDB: null, IDBKeyRange: null };
|
|
3390
3390
|
}
|
|
3391
3391
|
function $n(e) {
|
|
3392
|
-
var r, n = !1, a = new Da(function(
|
|
3393
|
-
var c =
|
|
3392
|
+
var r, n = !1, a = new Da(function(i) {
|
|
3393
|
+
var c = ir(e), u, d = !1, p = {}, y = {}, S = { get closed() {
|
|
3394
3394
|
return d;
|
|
3395
3395
|
}, unsubscribe: function() {
|
|
3396
3396
|
d || (d = !0, u && u.abort(), h && ke.storagemutated.unsubscribe(b));
|
|
3397
3397
|
} };
|
|
3398
|
-
|
|
3398
|
+
i.start && i.start(S);
|
|
3399
3399
|
var h = !1, _ = function() {
|
|
3400
3400
|
return mr(v);
|
|
3401
3401
|
}, b = function(E) {
|
|
@@ -3416,11 +3416,11 @@ function Ba() {
|
|
|
3416
3416
|
for (var N in D) if (ae(D, N)) return;
|
|
3417
3417
|
return 1;
|
|
3418
3418
|
})(y = E) || h || (ke(vt, b), h = !0), mr(function() {
|
|
3419
|
-
return !d &&
|
|
3419
|
+
return !d && i.next && i.next(P);
|
|
3420
3420
|
}));
|
|
3421
3421
|
}, function(P) {
|
|
3422
3422
|
n = !1, ["DatabaseClosedError", "AbortError"].includes(P?.name) || d || mr(function() {
|
|
3423
|
-
d ||
|
|
3423
|
+
d || i.error && i.error(P);
|
|
3424
3424
|
});
|
|
3425
3425
|
}));
|
|
3426
3426
|
};
|
|
@@ -3452,10 +3452,10 @@ function Ba() {
|
|
|
3452
3452
|
}, getDatabaseNames: function(e) {
|
|
3453
3453
|
try {
|
|
3454
3454
|
return r = Ve.dependencies, n = r.indexedDB, r = r.IDBKeyRange, (Tr(n) ? Promise.resolve(n.databases()).then(function(a) {
|
|
3455
|
-
return a.map(function(
|
|
3456
|
-
return
|
|
3457
|
-
}).filter(function(
|
|
3458
|
-
return
|
|
3455
|
+
return a.map(function(i) {
|
|
3456
|
+
return i.name;
|
|
3457
|
+
}).filter(function(i) {
|
|
3458
|
+
return i !== Mt;
|
|
3459
3459
|
});
|
|
3460
3460
|
}) : Nr(n, r).toCollection().primaryKeys()).then(e);
|
|
3461
3461
|
} catch {
|
|
@@ -3464,7 +3464,7 @@ function Ba() {
|
|
|
3464
3464
|
var r, n;
|
|
3465
3465
|
}, defineClass: function() {
|
|
3466
3466
|
return function(e) {
|
|
3467
|
-
|
|
3467
|
+
F(this, e);
|
|
3468
3468
|
};
|
|
3469
3469
|
}, ignoreTransaction: function(e) {
|
|
3470
3470
|
return L.trans ? We(L.transless, e) : e();
|
|
@@ -3481,8 +3481,8 @@ function Ba() {
|
|
|
3481
3481
|
try {
|
|
3482
3482
|
var a = Gr(e.apply(n, r || []));
|
|
3483
3483
|
return a && typeof a.then == "function" ? a : M.resolve(a);
|
|
3484
|
-
} catch (
|
|
3485
|
-
return ee(
|
|
3484
|
+
} catch (i) {
|
|
3485
|
+
return ee(i);
|
|
3486
3486
|
}
|
|
3487
3487
|
}, currentTransaction: { get: function() {
|
|
3488
3488
|
return L.trans || null;
|
|
@@ -3492,11 +3492,11 @@ function Ba() {
|
|
|
3492
3492
|
return ye;
|
|
3493
3493
|
}, set: function(e) {
|
|
3494
3494
|
en(e);
|
|
3495
|
-
} }, derive: Ye, extend:
|
|
3495
|
+
} }, derive: Ye, extend: F, props: ge, override: zr, Events: mt, on: ke, liveQuery: $n, extendObservabilitySet: Qt, getByKeyPath: Ee, setByKeyPath: ue, delByKeyPath: function(e, r) {
|
|
3496
3496
|
typeof r == "string" ? ue(e, r, void 0) : "length" in r && [].map.call(r, function(n) {
|
|
3497
3497
|
ue(e, n, void 0);
|
|
3498
3498
|
});
|
|
3499
|
-
}, shallowClone: Xr, deepClone: Ce, getObjectDiff: jr, cmp:
|
|
3499
|
+
}, shallowClone: Xr, deepClone: Ce, getObjectDiff: jr, cmp: z, asap: Yr, minKey: -1 / 0, addons: [], connections: tt, errnames: or, dependencies: er, cache: He, semVer: "4.2.1", version: "4.2.1".split(".").map(function(e) {
|
|
3500
3500
|
return parseInt(e);
|
|
3501
3501
|
}).reduce(function(e, r, n) {
|
|
3502
3502
|
return e + r / Math.pow(10, 2 * n);
|
|
@@ -3524,7 +3524,7 @@ function Ba() {
|
|
|
3524
3524
|
return !e || e instanceof Qe || e instanceof TypeError || e instanceof SyntaxError || !e.name || !qr[e.name] ? e : (r = new qr[e.name](r || e.message, e), "stack" in e && Pe(r, "stack", { get: function() {
|
|
3525
3525
|
return this.inner.stack;
|
|
3526
3526
|
} }), r);
|
|
3527
|
-
}, en(ye), l(Oe, Object.freeze({ __proto__: null, Dexie: Oe, liveQuery: $n, Entity: un, cmp:
|
|
3527
|
+
}, en(ye), l(Oe, Object.freeze({ __proto__: null, Dexie: Oe, liveQuery: $n, Entity: un, cmp: z, PropModification: pt, replacePrefix: function(e, r) {
|
|
3528
3528
|
return new pt({ replacePrefix: [e, r] });
|
|
3529
3529
|
}, add: function(e) {
|
|
3530
3530
|
return new pt({ add: e });
|
|
@@ -3577,15 +3577,15 @@ class Kn {
|
|
|
3577
3577
|
}
|
|
3578
3578
|
getHash = async (t) => {
|
|
3579
3579
|
const s = await this.db.table("hashtable").where({ id: t.widget }).last().catch(() => {
|
|
3580
|
-
C(2, ["%chash%c %capi%C %chash",
|
|
3580
|
+
C(2, ["%chash%c %capi%C %chash", o.API, o.NONE, o.APP]);
|
|
3581
3581
|
});
|
|
3582
3582
|
return C(3, [
|
|
3583
3583
|
"%cget%c %chash%c %chash",
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3584
|
+
o.OK,
|
|
3585
|
+
o.NONE,
|
|
3586
|
+
o.API,
|
|
3587
|
+
o.NONE,
|
|
3588
|
+
o.APP,
|
|
3589
3589
|
t
|
|
3590
3590
|
]), s?.hash ?? "none";
|
|
3591
3591
|
};
|
|
@@ -3593,38 +3593,38 @@ class Kn {
|
|
|
3593
3593
|
id: t.widget
|
|
3594
3594
|
}).modify({ hash: t.hash }).then(() => (C(3, [
|
|
3595
3595
|
"%cset%c %chash%c %chash}",
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3596
|
+
o.OK,
|
|
3597
|
+
o.NONE,
|
|
3598
|
+
o.API,
|
|
3599
|
+
o.NONE,
|
|
3600
|
+
o.WIDGET,
|
|
3601
3601
|
t
|
|
3602
3602
|
]), 201)).catch((s) => (C(2, [
|
|
3603
3603
|
"%cget%c %chash%c %chash",
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3604
|
+
o.OK,
|
|
3605
|
+
o.NONE,
|
|
3606
|
+
o.API,
|
|
3607
|
+
o.NONE,
|
|
3608
|
+
o.WIDGET,
|
|
3609
3609
|
t,
|
|
3610
3610
|
s.message
|
|
3611
3611
|
]), 400));
|
|
3612
3612
|
clearHash = async () => await this.db.table("hashtable").clear().then(() => 201).catch((t) => (C(2, [
|
|
3613
3613
|
"%cclear%c %cstorage%c %chash",
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3614
|
+
o.KO,
|
|
3615
|
+
o.NONE,
|
|
3616
|
+
o.STORAGE,
|
|
3617
|
+
o.NONE,
|
|
3618
|
+
o.WIDGET,
|
|
3619
3619
|
"clear hashes"
|
|
3620
3620
|
]), 400));
|
|
3621
3621
|
deleteHash = async (t) => await this.db.table("hashtable").where({ id: t.widget }).delete().then(() => 201).catch((s) => (C(2, [
|
|
3622
3622
|
"%cdelete%c %cstorage%c %chash",
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3623
|
+
o.KO,
|
|
3624
|
+
o.NONE,
|
|
3625
|
+
o.STORAGE,
|
|
3626
|
+
o.NONE,
|
|
3627
|
+
o.WIDGET,
|
|
3628
3628
|
"clear dashboard hashes",
|
|
3629
3629
|
t.dashboard
|
|
3630
3630
|
]), 400));
|
|
@@ -3633,11 +3633,11 @@ class Kn {
|
|
|
3633
3633
|
hash: t.hash
|
|
3634
3634
|
}).then(() => 201).catch((s) => (C(2, [
|
|
3635
3635
|
"%cset%c %cstorage%c %chash",
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3636
|
+
o.KO,
|
|
3637
|
+
o.NONE,
|
|
3638
|
+
o.STORAGE,
|
|
3639
|
+
o.NONE,
|
|
3640
|
+
o.WIDGET,
|
|
3641
3641
|
t,
|
|
3642
3642
|
s.message
|
|
3643
3643
|
]), 400));
|
|
@@ -3650,11 +3650,11 @@ class Kn {
|
|
|
3650
3650
|
if (t.widget === "")
|
|
3651
3651
|
return C(3, [
|
|
3652
3652
|
"%cget%c %cstorage%c %ccloud",
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3653
|
+
o.NO_UPDATES,
|
|
3654
|
+
o.NONE,
|
|
3655
|
+
o.STORAGE,
|
|
3656
|
+
o.NONE,
|
|
3657
|
+
o.CLOUD,
|
|
3658
3658
|
t
|
|
3659
3659
|
]), {
|
|
3660
3660
|
data: null,
|
|
@@ -3663,7 +3663,7 @@ class Kn {
|
|
|
3663
3663
|
query: t
|
|
3664
3664
|
};
|
|
3665
3665
|
const s = await this.db.table(w.CLOUD).where({ id: t.widget }).last().catch(() => {
|
|
3666
|
-
C(2, ["%capi%C %ccloud",
|
|
3666
|
+
C(2, ["%capi%C %ccloud", o.API, o.NONE, o.CLOUD, t.widget]);
|
|
3667
3667
|
});
|
|
3668
3668
|
if (typeof s > "u")
|
|
3669
3669
|
return { data: null, message: "Cloud Data error", success: !1, query: t };
|
|
@@ -3675,11 +3675,11 @@ class Kn {
|
|
|
3675
3675
|
};
|
|
3676
3676
|
return C(3, [
|
|
3677
3677
|
"%cget%c %cstorage%c %ccloud",
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3678
|
+
o.OK,
|
|
3679
|
+
o.NONE,
|
|
3680
|
+
o.STORAGE,
|
|
3681
|
+
o.NONE,
|
|
3682
|
+
o.CLOUD,
|
|
3683
3683
|
l
|
|
3684
3684
|
]), l;
|
|
3685
3685
|
};
|
|
@@ -3691,11 +3691,11 @@ class Kn {
|
|
|
3691
3691
|
*/
|
|
3692
3692
|
setCloud = async (t, s) => t.type === w.CLOUD && s !== "" ? (C(3, [
|
|
3693
3693
|
"%cset%c %cstorage%c %ccloud",
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3694
|
+
o.OK,
|
|
3695
|
+
o.NONE,
|
|
3696
|
+
o.STORAGE,
|
|
3697
|
+
o.NONE,
|
|
3698
|
+
o.CLOUD,
|
|
3699
3699
|
s?.title ?? t.widget
|
|
3700
3700
|
]), await this.db.table(w.CLOUD).put({
|
|
3701
3701
|
id: t.widget,
|
|
@@ -3705,11 +3705,11 @@ class Kn {
|
|
|
3705
3705
|
data: s
|
|
3706
3706
|
}).then(() => 201).catch((l) => (C(2, [
|
|
3707
3707
|
"%cset%c %cstorage%c %ccloud",
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3708
|
+
o.KO,
|
|
3709
|
+
o.NONE,
|
|
3710
|
+
o.STORAGE,
|
|
3711
|
+
o.NONE,
|
|
3712
|
+
o.CLOUD,
|
|
3713
3713
|
t,
|
|
3714
3714
|
l.message
|
|
3715
3715
|
]), 400))) : 400;
|
|
@@ -3719,7 +3719,7 @@ class Kn {
|
|
|
3719
3719
|
success: !0
|
|
3720
3720
|
})).catch((l) => (C(4, [
|
|
3721
3721
|
"%cstorage",
|
|
3722
|
-
|
|
3722
|
+
o.STORAGE,
|
|
3723
3723
|
t,
|
|
3724
3724
|
s.length,
|
|
3725
3725
|
l.message
|
|
@@ -3730,7 +3730,7 @@ class Kn {
|
|
|
3730
3730
|
}));
|
|
3731
3731
|
get = async (t, s) => {
|
|
3732
3732
|
const l = await this.db.table(t).where({ id: s.id }).last().catch(() => {
|
|
3733
|
-
C(2, ["%cstorage",
|
|
3733
|
+
C(2, ["%cstorage", o.STORAGE, `loading ${t}`, s.id]);
|
|
3734
3734
|
});
|
|
3735
3735
|
return l === void 0 ? {
|
|
3736
3736
|
data: null,
|
|
@@ -3742,14 +3742,14 @@ class Kn {
|
|
|
3742
3742
|
data: null,
|
|
3743
3743
|
message: `${t} ${s.id} saved to storage`,
|
|
3744
3744
|
success: !0
|
|
3745
|
-
})).catch((l) => (C(4, ["%cstorage",
|
|
3745
|
+
})).catch((l) => (C(4, ["%cstorage", o.STORAGE, t, s, l.message]), {
|
|
3746
3746
|
data: null,
|
|
3747
3747
|
message: `${t} ${s.id} save error: ${l.message}`,
|
|
3748
3748
|
success: !1
|
|
3749
3749
|
}));
|
|
3750
3750
|
getDashboard = async (t) => {
|
|
3751
3751
|
const s = await this.db.table(w.DASHBOARD).where({ id: t.id }).last().catch(() => {
|
|
3752
|
-
C(2, ["%cstorage",
|
|
3752
|
+
C(2, ["%cstorage", o.STORAGE, Z.DASHBOARD_LOAD, t.id]);
|
|
3753
3753
|
});
|
|
3754
3754
|
return s === void 0 ? {
|
|
3755
3755
|
data: null,
|
|
@@ -3759,13 +3759,13 @@ class Kn {
|
|
|
3759
3759
|
};
|
|
3760
3760
|
getDashboards = async (t) => {
|
|
3761
3761
|
const s = (g) => t?.id === g.id, l = (g) => t?.name ? g.name.includes(t?.name) : !1, m = await this.db.table(w.DASHBOARD).toArray().then((g) => t?.id ? g.filter(s) : g).then((g) => t?.name ? g.filter(l) : g).catch(() => {
|
|
3762
|
-
C(2, ["%cstorage",
|
|
3762
|
+
C(2, ["%cstorage", o.STORAGE, Z.DASHBOARD_LOAD, t]);
|
|
3763
3763
|
});
|
|
3764
3764
|
return m !== void 0 && C(3, [
|
|
3765
3765
|
"%cstorage%c %cdashboards",
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3766
|
+
o.STORAGE,
|
|
3767
|
+
o.NONE,
|
|
3768
|
+
o.WIDGET,
|
|
3769
3769
|
t
|
|
3770
3770
|
]), {
|
|
3771
3771
|
data: m !== void 0 ? { dashboards: m, query: t } : null,
|
|
@@ -3789,7 +3789,7 @@ class Kn {
|
|
|
3789
3789
|
data: null,
|
|
3790
3790
|
message: `Dashboard ${s.data.id} saved to storage`,
|
|
3791
3791
|
success: !0
|
|
3792
|
-
})).catch((l) => (C(4, ["%cstorage",
|
|
3792
|
+
})).catch((l) => (C(4, ["%cstorage", o.STORAGE, w.WIDGET, t, l.message]), {
|
|
3793
3793
|
data: null,
|
|
3794
3794
|
message: `Dashboard ${s.data.id} save error: ${l.message}`,
|
|
3795
3795
|
success: !1
|
|
@@ -3799,7 +3799,7 @@ class Kn {
|
|
|
3799
3799
|
data: null,
|
|
3800
3800
|
message: `Dashboard ${t.id} deleted`,
|
|
3801
3801
|
success: !0
|
|
3802
|
-
})).catch((s) => (C(4, ["%cstorage",
|
|
3802
|
+
})).catch((s) => (C(4, ["%cstorage", o.STORAGE, w.DASHBOARD, t, s.message]), {
|
|
3803
3803
|
data: null,
|
|
3804
3804
|
message: `Dashboard ${t.id} delete error: ${s.message}`,
|
|
3805
3805
|
success: !1
|
|
@@ -3810,7 +3810,7 @@ class Kn {
|
|
|
3810
3810
|
success: !0
|
|
3811
3811
|
})).catch((t) => (console.error(
|
|
3812
3812
|
"%cstorage",
|
|
3813
|
-
|
|
3813
|
+
o.STORAGE,
|
|
3814
3814
|
w.DASHBOARD,
|
|
3815
3815
|
"deleted",
|
|
3816
3816
|
t.message
|
|
@@ -3826,17 +3826,17 @@ class Kn {
|
|
|
3826
3826
|
const t = Date.now() / 1e3, s = (g) => g.expires < t, l = (g) => g.expires < t;
|
|
3827
3827
|
return await this.db.table(w.TOPICS).orderBy("expires").filter(s).delete().catch((g) => (console.error(
|
|
3828
3828
|
"%cstorage%c %cclean",
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3829
|
+
o.STORAGE,
|
|
3830
|
+
o.NONE,
|
|
3831
|
+
o.MESSAGES,
|
|
3832
3832
|
g.message
|
|
3833
3833
|
), 0)), await this.db.table(w.MESSAGES).orderBy("expires").filter(l).delete().catch((g) => (console.error(
|
|
3834
3834
|
"%clean%c %cstorage%c %cmessages",
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3835
|
+
o.OK,
|
|
3836
|
+
o.NONE,
|
|
3837
|
+
o.STORAGE,
|
|
3838
|
+
o.NONE,
|
|
3839
|
+
o.MESSAGES,
|
|
3840
3840
|
g.message
|
|
3841
3841
|
), 0));
|
|
3842
3842
|
};
|
|
@@ -3849,11 +3849,11 @@ class Kn {
|
|
|
3849
3849
|
if (t.widget === "")
|
|
3850
3850
|
return C(3, [
|
|
3851
3851
|
"%cget%c %cstorage%c %cmessages",
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3852
|
+
o.NO_UPDATES,
|
|
3853
|
+
o.NONE,
|
|
3854
|
+
o.STORAGE,
|
|
3855
|
+
o.NONE,
|
|
3856
|
+
o.MESSAGES,
|
|
3857
3857
|
t
|
|
3858
3858
|
]), {
|
|
3859
3859
|
data: null,
|
|
@@ -3867,20 +3867,20 @@ class Kn {
|
|
|
3867
3867
|
try {
|
|
3868
3868
|
const T = this.db.table(w.TOPICS).where("widget_id").equals(t.widget).filter(g).filter(R);
|
|
3869
3869
|
t?.approved === "true" ? T.and((fe) => fe.approved === 1) : T.and((fe) => fe.visible === 1), T.reverse();
|
|
3870
|
-
const
|
|
3871
|
-
if (
|
|
3870
|
+
const F = await T.limit(t?.limit ?? 25).sortBy(s);
|
|
3871
|
+
if (F.length === 0)
|
|
3872
3872
|
return {
|
|
3873
3873
|
data: null,
|
|
3874
3874
|
message: "No Messages error",
|
|
3875
3875
|
success: !1,
|
|
3876
3876
|
query: t
|
|
3877
3877
|
};
|
|
3878
|
-
const me =
|
|
3878
|
+
const me = F.map((fe) => this.db.table(w.MESSAGES).get({ id: fe.message_id }));
|
|
3879
3879
|
return At.Promise.all(me).then(async (fe) => {
|
|
3880
3880
|
const ge = {
|
|
3881
3881
|
data: {
|
|
3882
|
-
messages: fe.map((
|
|
3883
|
-
if (
|
|
3882
|
+
messages: fe.map((ot) => {
|
|
3883
|
+
if (ot !== void 0) return ot.data;
|
|
3884
3884
|
})
|
|
3885
3885
|
},
|
|
3886
3886
|
query: t,
|
|
@@ -3889,22 +3889,22 @@ class Kn {
|
|
|
3889
3889
|
};
|
|
3890
3890
|
return C(3, [
|
|
3891
3891
|
"%cget%c %cstorage%c %cmessages",
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3892
|
+
o.OK,
|
|
3893
|
+
o.NONE,
|
|
3894
|
+
o.STORAGE,
|
|
3895
|
+
o.NONE,
|
|
3896
|
+
o.MESSAGES,
|
|
3897
3897
|
ge
|
|
3898
3898
|
]), ge;
|
|
3899
3899
|
});
|
|
3900
3900
|
} catch (T) {
|
|
3901
3901
|
return C(2, [
|
|
3902
3902
|
"%cget%c %cstorage%c %cmessages",
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3903
|
+
o.OK,
|
|
3904
|
+
o.NONE,
|
|
3905
|
+
o.STORAGE,
|
|
3906
|
+
o.NONE,
|
|
3907
|
+
o.NO_UPDATES,
|
|
3908
3908
|
t,
|
|
3909
3909
|
T.message
|
|
3910
3910
|
]), { data: null, message: "Messages Data error", success: !1 };
|
|
@@ -3913,11 +3913,11 @@ class Kn {
|
|
|
3913
3913
|
hideMessage = async (t, s) => {
|
|
3914
3914
|
await this.db.table(w.TOPICS).where("message_id").equals(t).modify({ visible: s ? 1 : 0 }).catch((l) => (console.error(
|
|
3915
3915
|
"%chide%c %cstorage%c %cmessage",
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3916
|
+
o.KO,
|
|
3917
|
+
o.NONE,
|
|
3918
|
+
o.STORAGE,
|
|
3919
|
+
o.NONE,
|
|
3920
|
+
o.HIDE,
|
|
3921
3921
|
l.message
|
|
3922
3922
|
), 0));
|
|
3923
3923
|
};
|
|
@@ -3934,11 +3934,11 @@ class Kn {
|
|
|
3934
3934
|
let m = 0;
|
|
3935
3935
|
return C(3, [
|
|
3936
3936
|
"%cset%c %cstorage%c %cmessages",
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3937
|
+
o.OK,
|
|
3938
|
+
o.NONE,
|
|
3939
|
+
o.STORAGE,
|
|
3940
|
+
o.NONE,
|
|
3941
|
+
o.MESSAGES,
|
|
3942
3942
|
s?.title ?? t.widget
|
|
3943
3943
|
]), await s.data.messages.forEach(async (g) => {
|
|
3944
3944
|
if (g.id !== null) {
|
|
@@ -3958,9 +3958,9 @@ class Kn {
|
|
|
3958
3958
|
}).catch((T) => {
|
|
3959
3959
|
m++, C(4, [
|
|
3960
3960
|
"%cset%c %cstorage",
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3961
|
+
o.KO,
|
|
3962
|
+
o.NONE,
|
|
3963
|
+
o.STORAGE,
|
|
3964
3964
|
"set message",
|
|
3965
3965
|
`title: ${l}`,
|
|
3966
3966
|
g,
|
|
@@ -3985,22 +3985,22 @@ class Kn {
|
|
|
3985
3985
|
await this.db.table(w.TOPICS).put(R).catch((T) => {
|
|
3986
3986
|
m++, C(4, [
|
|
3987
3987
|
"%cset%c %cstorage",
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3988
|
+
o.KO,
|
|
3989
|
+
o.NONE,
|
|
3990
|
+
o.STORAGE,
|
|
3991
3991
|
"set topic",
|
|
3992
3992
|
`title: ${l}`,
|
|
3993
3993
|
g,
|
|
3994
3994
|
T.message
|
|
3995
3995
|
]);
|
|
3996
3996
|
}), await s.data.topics.forEach(async (T) => {
|
|
3997
|
-
const
|
|
3998
|
-
await this.db.table(w.TOPICS).where("message_id").equals(
|
|
3997
|
+
const F = T.message_id, me = T.visible ? 1 : 0, fe = T.approve ? 1 : 0, ae = T.title;
|
|
3998
|
+
await this.db.table(w.TOPICS).where("message_id").equals(F).modify({ visible: me, approve: fe }).catch((ge) => {
|
|
3999
3999
|
m++, C(4, [
|
|
4000
4000
|
"%cset%c %cstorage",
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4001
|
+
o.KO,
|
|
4002
|
+
o.NONE,
|
|
4003
|
+
o.STORAGE,
|
|
4004
4004
|
"update message visibility",
|
|
4005
4005
|
`title: ${ae}`,
|
|
4006
4006
|
`widget: ${T.widget_id}`,
|
|
@@ -4020,11 +4020,11 @@ class Kn {
|
|
|
4020
4020
|
if (t.widget === "")
|
|
4021
4021
|
return C(3, [
|
|
4022
4022
|
"%cget%c %cstorage%c %cseries",
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4023
|
+
o.NO_UPDATES,
|
|
4024
|
+
o.NONE,
|
|
4025
|
+
o.STORAGE,
|
|
4026
|
+
o.NONE,
|
|
4027
|
+
o.CLOUD,
|
|
4028
4028
|
t
|
|
4029
4029
|
]), {
|
|
4030
4030
|
data: null,
|
|
@@ -4035,11 +4035,11 @@ class Kn {
|
|
|
4035
4035
|
const s = await this.db.table(w.SERIES).where({ id: t.widget }).last().catch(() => {
|
|
4036
4036
|
C(2, [
|
|
4037
4037
|
"%cget%c %cstorage%c %cseries",
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4038
|
+
o.KO,
|
|
4039
|
+
o.NONE,
|
|
4040
|
+
o.STORAGE,
|
|
4041
|
+
o.NONE,
|
|
4042
|
+
o.SERIES,
|
|
4043
4043
|
t.widget
|
|
4044
4044
|
]);
|
|
4045
4045
|
}), l = {
|
|
@@ -4050,11 +4050,11 @@ class Kn {
|
|
|
4050
4050
|
};
|
|
4051
4051
|
return C(3, [
|
|
4052
4052
|
"%cget%c %cstorage%c %cseries",
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4053
|
+
o.OK,
|
|
4054
|
+
o.NONE,
|
|
4055
|
+
o.STORAGE,
|
|
4056
|
+
o.NONE,
|
|
4057
|
+
o.SERIES,
|
|
4058
4058
|
l
|
|
4059
4059
|
]), l;
|
|
4060
4060
|
};
|
|
@@ -4066,11 +4066,11 @@ class Kn {
|
|
|
4066
4066
|
*/
|
|
4067
4067
|
setSeries = async (t, s) => (delete s?.query, t.type === w.SERIES && s !== "" ? (C(3, [
|
|
4068
4068
|
"%cset%c %cstorage%c %cseries",
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4069
|
+
o.OK,
|
|
4070
|
+
o.NONE,
|
|
4071
|
+
o.STORAGE,
|
|
4072
|
+
o.NONE,
|
|
4073
|
+
o.SERIES,
|
|
4074
4074
|
s?.title ?? t.widget
|
|
4075
4075
|
]), await this.db.table(w.SERIES).put({
|
|
4076
4076
|
id: t.widget,
|
|
@@ -4080,11 +4080,11 @@ class Kn {
|
|
|
4080
4080
|
data: s
|
|
4081
4081
|
}).then(() => 201).catch((l) => (C(2, [
|
|
4082
4082
|
"%cset%c %cstorage%c %cseries",
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4083
|
+
o.KO,
|
|
4084
|
+
o.NONE,
|
|
4085
|
+
o.STORAGE,
|
|
4086
|
+
o.NONE,
|
|
4087
|
+
o.SERIES,
|
|
4088
4088
|
t,
|
|
4089
4089
|
l.message
|
|
4090
4090
|
]), 400))) : 400);
|
|
@@ -4097,11 +4097,11 @@ class Kn {
|
|
|
4097
4097
|
if (t.id === "")
|
|
4098
4098
|
return C(3, [
|
|
4099
4099
|
"%cget%c %cstorage%c %cwidget",
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4100
|
+
o.KO,
|
|
4101
|
+
o.NONE,
|
|
4102
|
+
o.STORAGE,
|
|
4103
|
+
o.NONE,
|
|
4104
|
+
o.WIDGET,
|
|
4105
4105
|
t
|
|
4106
4106
|
]), {
|
|
4107
4107
|
data: null,
|
|
@@ -4110,7 +4110,7 @@ class Kn {
|
|
|
4110
4110
|
query: t
|
|
4111
4111
|
};
|
|
4112
4112
|
const s = await this.db.table(w.WIDGET).where({ id: t.id }).last().catch(() => {
|
|
4113
|
-
console.warn("%cstorage",
|
|
4113
|
+
console.warn("%cstorage", o.STORAGE, Z.WIDGET_LOAD, t.id);
|
|
4114
4114
|
});
|
|
4115
4115
|
return s === void 0 ? {
|
|
4116
4116
|
data: null,
|
|
@@ -4125,13 +4125,13 @@ class Kn {
|
|
|
4125
4125
|
*/
|
|
4126
4126
|
getWidgets = async (t) => {
|
|
4127
4127
|
const s = (R) => t?.dashboard === R.dashboard_id, l = (R) => t?.type === R.type, m = (R) => t?.name ? R.name.includes(t?.name) : !1, g = await this.db.table(w.WIDGET).toArray().then((R) => t?.dashboard ? R.filter(s) : R).then((R) => t?.type ? R.filter(l) : R).then((R) => t?.name ? R.filter(m) : R).catch(() => {
|
|
4128
|
-
C(2, ["%cstorage",
|
|
4128
|
+
C(2, ["%cstorage", o.STORAGE, Z.WIDGET_LOAD, t]);
|
|
4129
4129
|
});
|
|
4130
4130
|
return g !== void 0 && C(3, [
|
|
4131
4131
|
"%cstorage%c %cwidgets",
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4132
|
+
o.STORAGE,
|
|
4133
|
+
o.NONE,
|
|
4134
|
+
o.MESSAGES,
|
|
4135
4135
|
t
|
|
4136
4136
|
]), {
|
|
4137
4137
|
// @ts-ignore
|
|
@@ -4157,7 +4157,7 @@ class Kn {
|
|
|
4157
4157
|
success: !0
|
|
4158
4158
|
})).catch((s) => (console.error(
|
|
4159
4159
|
"%cstorage",
|
|
4160
|
-
|
|
4160
|
+
o.STORAGE,
|
|
4161
4161
|
w.WIDGET,
|
|
4162
4162
|
t,
|
|
4163
4163
|
s.message
|
|
@@ -4174,7 +4174,7 @@ class Kn {
|
|
|
4174
4174
|
success: !0
|
|
4175
4175
|
})).catch((s) => (console.error(
|
|
4176
4176
|
"%cstorage",
|
|
4177
|
-
|
|
4177
|
+
o.STORAGE,
|
|
4178
4178
|
w.WIDGET,
|
|
4179
4179
|
t,
|
|
4180
4180
|
s.message
|
|
@@ -4189,7 +4189,7 @@ class Kn {
|
|
|
4189
4189
|
success: !0
|
|
4190
4190
|
})).catch((t) => (console.error(
|
|
4191
4191
|
"%cstorage",
|
|
4192
|
-
|
|
4192
|
+
o.STORAGE,
|
|
4193
4193
|
w.WIDGETS,
|
|
4194
4194
|
"deleted",
|
|
4195
4195
|
t.message
|
|
@@ -4207,16 +4207,16 @@ class Kn {
|
|
|
4207
4207
|
(l) => l.widget === t.widget
|
|
4208
4208
|
).length > 0 || (t.type === w.MESSAGES && (t = Pt(this.options, t)), console.info(
|
|
4209
4209
|
"%cstorage%c %csubscribe",
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4210
|
+
o.STORAGE,
|
|
4211
|
+
o.NONE,
|
|
4212
|
+
o.SUBSCRIBE,
|
|
4213
4213
|
t.slide,
|
|
4214
4214
|
t.widget
|
|
4215
4215
|
), console.debug(
|
|
4216
4216
|
"%cstorage%c %csubscribe",
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4217
|
+
o.STORAGE,
|
|
4218
|
+
o.NONE,
|
|
4219
|
+
o.SUBSCRIBE,
|
|
4220
4220
|
t
|
|
4221
4221
|
), this.subscribers.push(t)), null);
|
|
4222
4222
|
/**
|
|
@@ -4231,7 +4231,7 @@ class Kn {
|
|
|
4231
4231
|
*/
|
|
4232
4232
|
getSlide = async (t) => {
|
|
4233
4233
|
const s = await this.db.table(w.SLIDE).where({ id: t.id }).last().catch(() => {
|
|
4234
|
-
C(2, ["%cstorage",
|
|
4234
|
+
C(2, ["%cstorage", o.STORAGE, Z.SLIDE_LOAD, t.id]);
|
|
4235
4235
|
});
|
|
4236
4236
|
return {
|
|
4237
4237
|
data: s,
|
|
@@ -4247,7 +4247,7 @@ class Kn {
|
|
|
4247
4247
|
*/
|
|
4248
4248
|
getSlides = async (t) => {
|
|
4249
4249
|
const s = (T) => t?.id ? T.id === t.id : !1, l = (T) => t?.name ? T.name.includes(t?.name) : !1, m = (T) => t?.presentation_id ? T.presentation_id === t.presentation_id : !1, R = await this.db.table(w.SLIDE).toArray().then((T) => t?.presentation_id ? T.filter(m) : T).then((T) => t?.id ? T.filter(s) : T).then((T) => t?.name ? T.filter(l) : T);
|
|
4250
|
-
return R && R.sort((T,
|
|
4250
|
+
return R && R.sort((T, F) => T.order_index - F.order_index), R !== void 0 && C(3, ["%cstorage%c %cslides", o.STORAGE, o.NONE, o.SLIDE, t]), {
|
|
4251
4251
|
// @ts-ignore
|
|
4252
4252
|
data: R,
|
|
4253
4253
|
query: t,
|
|
@@ -4275,7 +4275,7 @@ class Kn {
|
|
|
4275
4275
|
success: !0
|
|
4276
4276
|
})).catch((s) => (console.error(
|
|
4277
4277
|
"%cstorage",
|
|
4278
|
-
|
|
4278
|
+
o.STORAGE,
|
|
4279
4279
|
Z.SLIDE_STORE,
|
|
4280
4280
|
t,
|
|
4281
4281
|
s.message
|
|
@@ -4292,7 +4292,7 @@ class Kn {
|
|
|
4292
4292
|
success: !0
|
|
4293
4293
|
})).catch((s) => (console.error(
|
|
4294
4294
|
"%cstorage",
|
|
4295
|
-
|
|
4295
|
+
o.STORAGE,
|
|
4296
4296
|
w.WIDGET,
|
|
4297
4297
|
t,
|
|
4298
4298
|
s.message
|
|
@@ -4307,7 +4307,7 @@ class Kn {
|
|
|
4307
4307
|
success: !0
|
|
4308
4308
|
})).catch((t) => (console.error(
|
|
4309
4309
|
"%cstorage",
|
|
4310
|
-
|
|
4310
|
+
o.STORAGE,
|
|
4311
4311
|
w.SLIDE,
|
|
4312
4312
|
"deleted",
|
|
4313
4313
|
t.message
|
|
@@ -4325,7 +4325,7 @@ class Kn {
|
|
|
4325
4325
|
const s = await this.db.table(w.PRESENTATION).where({ id: t.id }).last().catch(() => {
|
|
4326
4326
|
console.warn(
|
|
4327
4327
|
"%cstorage ",
|
|
4328
|
-
|
|
4328
|
+
o.STORAGE,
|
|
4329
4329
|
Z.PRESENTATION_LOAD,
|
|
4330
4330
|
t.id
|
|
4331
4331
|
);
|
|
@@ -4345,9 +4345,9 @@ class Kn {
|
|
|
4345
4345
|
const s = (g) => t?.name ? g.name.includes(t?.name) : !1, m = await this.db.table(w.PRESENTATION).toArray().then((g) => t?.name ? g.filter(s) : g);
|
|
4346
4346
|
return m !== void 0 && C(3, [
|
|
4347
4347
|
"%cstorage%c %cpresentations",
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4348
|
+
o.STORAGE,
|
|
4349
|
+
o.NONE,
|
|
4350
|
+
o.PRESENTATION,
|
|
4351
4351
|
t
|
|
4352
4352
|
]), {
|
|
4353
4353
|
data: m,
|
|
@@ -4373,7 +4373,7 @@ class Kn {
|
|
|
4373
4373
|
success: !0
|
|
4374
4374
|
})).catch((s) => (console.error(
|
|
4375
4375
|
"%cstorage",
|
|
4376
|
-
|
|
4376
|
+
o.STORAGE,
|
|
4377
4377
|
Z.PRESENTATION_STORE,
|
|
4378
4378
|
t,
|
|
4379
4379
|
s.message
|
|
@@ -4391,7 +4391,7 @@ class Kn {
|
|
|
4391
4391
|
success: !0
|
|
4392
4392
|
})).catch((s) => (console.error(
|
|
4393
4393
|
"%cstorage",
|
|
4394
|
-
|
|
4394
|
+
o.STORAGE,
|
|
4395
4395
|
w.PRESENTATION,
|
|
4396
4396
|
t,
|
|
4397
4397
|
s.message
|
|
@@ -4406,7 +4406,7 @@ class Kn {
|
|
|
4406
4406
|
success: !0
|
|
4407
4407
|
})).catch((t) => (console.error(
|
|
4408
4408
|
"%cstorage",
|
|
4409
|
-
|
|
4409
|
+
o.STORAGE,
|
|
4410
4410
|
w.PRESENTATION,
|
|
4411
4411
|
"deleted",
|
|
4412
4412
|
t.message
|
|
@@ -4424,7 +4424,7 @@ class Kn {
|
|
|
4424
4424
|
const s = await this.db.table(w.PREFERENCE).where({ id: t.id }).last().catch(() => {
|
|
4425
4425
|
C(2, [
|
|
4426
4426
|
"%cstorage",
|
|
4427
|
-
|
|
4427
|
+
o.STORAGE,
|
|
4428
4428
|
Z.PREFERENCE_LOAD,
|
|
4429
4429
|
t.id
|
|
4430
4430
|
]);
|
|
@@ -4447,9 +4447,9 @@ class Kn {
|
|
|
4447
4447
|
const s = (g) => t?.id ? t.id = g.id : !1, m = await this.db.table(w.PREFERENCE).toArray().then((g) => t?.id ? g.filter(s) : g);
|
|
4448
4448
|
return m !== void 0 && C(3, [
|
|
4449
4449
|
"%cstorage%c %cpreferences",
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4450
|
+
o.STORAGE,
|
|
4451
|
+
o.NONE,
|
|
4452
|
+
o.PRESENTATION,
|
|
4453
4453
|
t
|
|
4454
4454
|
]), {
|
|
4455
4455
|
// @ts-ignore
|
|
@@ -4473,7 +4473,7 @@ class Kn {
|
|
|
4473
4473
|
success: !0
|
|
4474
4474
|
})).catch((s) => (console.error(
|
|
4475
4475
|
"%cstorage",
|
|
4476
|
-
|
|
4476
|
+
o.STORAGE,
|
|
4477
4477
|
Z.PREFERENCE_STORE,
|
|
4478
4478
|
t,
|
|
4479
4479
|
s.message
|
|
@@ -4490,7 +4490,7 @@ class Kn {
|
|
|
4490
4490
|
success: !0
|
|
4491
4491
|
})).catch((s) => (console.error(
|
|
4492
4492
|
"%cstorage",
|
|
4493
|
-
|
|
4493
|
+
o.STORAGE,
|
|
4494
4494
|
w.PREFERENCE,
|
|
4495
4495
|
t,
|
|
4496
4496
|
s.message
|
|
@@ -4508,9 +4508,9 @@ class Kn {
|
|
|
4508
4508
|
const s = (g) => t?.id ? g.includes(t.id) : !1, m = await this.db.table(w.IMAGES).toArray().then((g) => t?.id ? g.filter(s) : g);
|
|
4509
4509
|
return m !== void 0 && C(3, [
|
|
4510
4510
|
"%cstorage%c %cimages",
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4511
|
+
o.STORAGE,
|
|
4512
|
+
o.NONE,
|
|
4513
|
+
o.PRESENTATION,
|
|
4514
4514
|
t
|
|
4515
4515
|
]), {
|
|
4516
4516
|
// @ts-expect-error query.widget is obligatory but not always
|
|
@@ -4537,7 +4537,7 @@ class Kn {
|
|
|
4537
4537
|
success: !0
|
|
4538
4538
|
})).catch((s) => (console.error(
|
|
4539
4539
|
"%cstorage",
|
|
4540
|
-
|
|
4540
|
+
o.STORAGE,
|
|
4541
4541
|
Z.IMAGE_SET,
|
|
4542
4542
|
t,
|
|
4543
4543
|
s.message
|
|
@@ -4588,15 +4588,15 @@ class Bn {
|
|
|
4588
4588
|
deleteHash = async (t) => 404;
|
|
4589
4589
|
getCloud = async (t) => {
|
|
4590
4590
|
const s = X(t);
|
|
4591
|
-
return await Ae(s).then((l) => l).catch(() => (console.warn("%capi",
|
|
4591
|
+
return await Ae(s).then((l) => l).catch(() => (console.warn("%capi", o.API, w.CLOUD, t.slide, t.widget), { data: null, message: "Cloud Data error", success: !1 }));
|
|
4592
4592
|
};
|
|
4593
4593
|
getSeries = async (t) => {
|
|
4594
4594
|
const s = X(t);
|
|
4595
|
-
return await Ae(s).then((l) => l).catch(() => (console.warn("%capi",
|
|
4595
|
+
return await Ae(s).then((l) => l).catch(() => (console.warn("%capi", o.API, w.SERIES, t.slide, t.widget), { data: null, message: "Series Data error", success: !1 }));
|
|
4596
4596
|
};
|
|
4597
4597
|
getMessages = async (t) => {
|
|
4598
4598
|
const s = X(t);
|
|
4599
|
-
return await Ae(s).then((l) => l).catch(() => (console.warn("%capi",
|
|
4599
|
+
return await Ae(s).then((l) => l).catch(() => (console.warn("%capi", o.API, w.MESSAGES, t.slide, t.widget), { data: null, message: "Messages Data error", success: !1 }));
|
|
4600
4600
|
};
|
|
4601
4601
|
/**
|
|
4602
4602
|
* Update Cloud
|
|
@@ -4610,7 +4610,7 @@ class Bn {
|
|
|
4610
4610
|
const l = X(t);
|
|
4611
4611
|
return delete s.success, delete s.message, await $e(l, s).then(() => 201).catch((m) => (console.error(
|
|
4612
4612
|
"%cstorage",
|
|
4613
|
-
|
|
4613
|
+
o.STORAGE,
|
|
4614
4614
|
w.CLOUD,
|
|
4615
4615
|
t,
|
|
4616
4616
|
m.message
|
|
@@ -4628,7 +4628,7 @@ class Bn {
|
|
|
4628
4628
|
const l = X(t);
|
|
4629
4629
|
return delete s.success, delete s.message, await $e(l, s).then(() => 201).catch((m) => (console.error(
|
|
4630
4630
|
"%cstorage",
|
|
4631
|
-
|
|
4631
|
+
o.STORAGE,
|
|
4632
4632
|
w.SERIES,
|
|
4633
4633
|
t,
|
|
4634
4634
|
m.message
|
|
@@ -4646,7 +4646,7 @@ class Bn {
|
|
|
4646
4646
|
const l = X(t);
|
|
4647
4647
|
return delete s.success, delete s.message, await $e(l, s).then(() => 201).catch((m) => (console.error(
|
|
4648
4648
|
"%cstorage",
|
|
4649
|
-
|
|
4649
|
+
o.STORAGE,
|
|
4650
4650
|
w.MESSAGES,
|
|
4651
4651
|
t,
|
|
4652
4652
|
m.message
|
|
@@ -4660,7 +4660,7 @@ class Bn {
|
|
|
4660
4660
|
};
|
|
4661
4661
|
getDashboard = async (t) => {
|
|
4662
4662
|
const s = X(t);
|
|
4663
|
-
return await Ae(s).then((l) => l).catch((l) => (console.warn("%capi",
|
|
4663
|
+
return await Ae(s).then((l) => l).catch((l) => (console.warn("%capi", o.API, w.SLIDE, t.id), {
|
|
4664
4664
|
data: null,
|
|
4665
4665
|
message: `Widget ${t.data.id} load error: ${l.message}`,
|
|
4666
4666
|
success: !1
|
|
@@ -4687,7 +4687,7 @@ class Bn {
|
|
|
4687
4687
|
success: !0
|
|
4688
4688
|
})).catch((m) => (console.error(
|
|
4689
4689
|
"%cstorage",
|
|
4690
|
-
|
|
4690
|
+
o.STORAGE,
|
|
4691
4691
|
w.WIDGET,
|
|
4692
4692
|
t,
|
|
4693
4693
|
m.message
|
|
@@ -4699,13 +4699,13 @@ class Bn {
|
|
|
4699
4699
|
};
|
|
4700
4700
|
getWidget = async (t) => {
|
|
4701
4701
|
const s = X(t);
|
|
4702
|
-
return await Ae(s).then((l) => l).catch((l) => (console.warn("%capi",
|
|
4702
|
+
return await Ae(s).then((l) => l).catch((l) => (console.warn("%capi", o.API, w.SLIDE, t.id), {
|
|
4703
4703
|
data: null,
|
|
4704
4704
|
message: `Widget ${t.data.id} load error: ${l.message}`,
|
|
4705
4705
|
success: !1
|
|
4706
4706
|
}));
|
|
4707
4707
|
};
|
|
4708
|
-
getWidgets = async (t) => (console.warn("%capi",
|
|
4708
|
+
getWidgets = async (t) => (console.warn("%capi", o.API, w.SLIDE, t?.presentation), {
|
|
4709
4709
|
data: null,
|
|
4710
4710
|
message: "Widgets load error: ",
|
|
4711
4711
|
success: !1
|
|
@@ -4728,7 +4728,7 @@ class Bn {
|
|
|
4728
4728
|
success: !0
|
|
4729
4729
|
})).catch((m) => (console.error(
|
|
4730
4730
|
"%cstorage",
|
|
4731
|
-
|
|
4731
|
+
o.STORAGE,
|
|
4732
4732
|
w.WIDGET,
|
|
4733
4733
|
t,
|
|
4734
4734
|
m.message
|
|
@@ -4766,9 +4766,9 @@ class Bn {
|
|
|
4766
4766
|
(l) => l.widget === t.widget
|
|
4767
4767
|
).length > 0 || (console.debug(
|
|
4768
4768
|
"%cstorage%c %csubscribe",
|
|
4769
|
-
|
|
4770
|
-
|
|
4771
|
-
|
|
4769
|
+
o.STORAGE,
|
|
4770
|
+
o.NONE,
|
|
4771
|
+
o.SUBSCRIBE,
|
|
4772
4772
|
t.slide,
|
|
4773
4773
|
t.widget
|
|
4774
4774
|
), this.subscribers.push(t)), null);
|
|
@@ -4779,13 +4779,13 @@ class Bn {
|
|
|
4779
4779
|
getSubscribers = async () => await new Promise((t) => t(this.subscribers));
|
|
4780
4780
|
getSlide = async (t) => {
|
|
4781
4781
|
const s = X(t);
|
|
4782
|
-
return await Ae(s).then((l) => l).catch((l) => (console.warn("%capi",
|
|
4782
|
+
return await Ae(s).then((l) => l).catch((l) => (console.warn("%capi", o.API, w.SLIDE, t.id), {
|
|
4783
4783
|
data: null,
|
|
4784
4784
|
message: `Slide ${t.data.id} load error: ${l.message}`,
|
|
4785
4785
|
success: !1
|
|
4786
4786
|
}));
|
|
4787
4787
|
};
|
|
4788
|
-
getSlides = async (t) => (console.warn("%capi",
|
|
4788
|
+
getSlides = async (t) => (console.warn("%capi", o.API, w.SLIDE, t.presentation), {
|
|
4789
4789
|
data: null,
|
|
4790
4790
|
message: `Slided ${t.presentation} load error: `,
|
|
4791
4791
|
success: !1
|
|
@@ -4808,7 +4808,7 @@ class Bn {
|
|
|
4808
4808
|
success: !0
|
|
4809
4809
|
})).catch((m) => (console.error(
|
|
4810
4810
|
"%cstorage",
|
|
4811
|
-
|
|
4811
|
+
o.STORAGE,
|
|
4812
4812
|
w.SLIDE,
|
|
4813
4813
|
t,
|
|
4814
4814
|
m.message
|
|
@@ -4820,7 +4820,7 @@ class Bn {
|
|
|
4820
4820
|
};
|
|
4821
4821
|
getPresentation = async (t) => {
|
|
4822
4822
|
const s = X(t);
|
|
4823
|
-
return await Ae(s).then((l) => l).catch((l) => (console.warn("%capi",
|
|
4823
|
+
return await Ae(s).then((l) => l).catch((l) => (console.warn("%capi", o.API, w.PRESENTATION, t.id), {
|
|
4824
4824
|
data: null,
|
|
4825
4825
|
message: `Slide ${t.data.id} load error: ${l.message}`,
|
|
4826
4826
|
success: !1
|
|
@@ -4844,7 +4844,7 @@ class Bn {
|
|
|
4844
4844
|
success: !0
|
|
4845
4845
|
})).catch((m) => (console.error(
|
|
4846
4846
|
"%cstorage",
|
|
4847
|
-
|
|
4847
|
+
o.STORAGE,
|
|
4848
4848
|
w.PRESENTATION,
|
|
4849
4849
|
t,
|
|
4850
4850
|
m.message
|
|
@@ -4854,12 +4854,12 @@ class Bn {
|
|
|
4854
4854
|
success: !1
|
|
4855
4855
|
}));
|
|
4856
4856
|
};
|
|
4857
|
-
getPreference = async (t) => await Ae(`${w.PREFERENCE}.${t.id}`).then((s) => s).catch((s) => (console.warn("%capi",
|
|
4857
|
+
getPreference = async (t) => await Ae(`${w.PREFERENCE}.${t.id}`).then((s) => s).catch((s) => (console.warn("%capi", o.API, w.PREFERENCE, t.id), {
|
|
4858
4858
|
data: null,
|
|
4859
4859
|
message: `Preference ${t.id} get error: ${s.message}`,
|
|
4860
4860
|
success: !1
|
|
4861
4861
|
}));
|
|
4862
|
-
getPreferences = async () => await Ae(`${w.PREFERENCE}`).then((t) => t).catch((t) => (console.warn("%capi",
|
|
4862
|
+
getPreferences = async () => await Ae(`${w.PREFERENCE}`).then((t) => t).catch((t) => (console.warn("%capi", o.API, w.PREFERENCE), {
|
|
4863
4863
|
data: null,
|
|
4864
4864
|
message: `Preferences get error: ${t.message}`,
|
|
4865
4865
|
success: !1
|
|
@@ -4875,7 +4875,7 @@ class Bn {
|
|
|
4875
4875
|
success: !0
|
|
4876
4876
|
})).catch((s) => (console.error(
|
|
4877
4877
|
"%cstorage",
|
|
4878
|
-
|
|
4878
|
+
o.STORAGE,
|
|
4879
4879
|
w.PREFERENCE,
|
|
4880
4880
|
t,
|
|
4881
4881
|
s.message
|
|
@@ -4918,7 +4918,7 @@ class Wn {
|
|
|
4918
4918
|
} catch (l) {
|
|
4919
4919
|
return console.warn(
|
|
4920
4920
|
"%capi",
|
|
4921
|
-
|
|
4921
|
+
o.API,
|
|
4922
4922
|
w.CLOUD,
|
|
4923
4923
|
t.slide,
|
|
4924
4924
|
t.widget,
|
|
@@ -4933,7 +4933,7 @@ class Wn {
|
|
|
4933
4933
|
} catch (l) {
|
|
4934
4934
|
return console.warn(
|
|
4935
4935
|
"%capi",
|
|
4936
|
-
|
|
4936
|
+
o.API,
|
|
4937
4937
|
w.SERIES,
|
|
4938
4938
|
t.slide,
|
|
4939
4939
|
t.widget,
|
|
@@ -4948,7 +4948,7 @@ class Wn {
|
|
|
4948
4948
|
} catch (l) {
|
|
4949
4949
|
return console.warn(
|
|
4950
4950
|
"%capi",
|
|
4951
|
-
|
|
4951
|
+
o.API,
|
|
4952
4952
|
w.MESSAGES,
|
|
4953
4953
|
t.slide,
|
|
4954
4954
|
t.widget,
|
|
@@ -4970,7 +4970,7 @@ class Wn {
|
|
|
4970
4970
|
try {
|
|
4971
4971
|
return localStorage.setObject(l, s), 201;
|
|
4972
4972
|
} catch (m) {
|
|
4973
|
-
return console.error("%cstorage",
|
|
4973
|
+
return console.error("%cstorage", o.STORAGE, w.CLOUD, t, m), 400;
|
|
4974
4974
|
}
|
|
4975
4975
|
};
|
|
4976
4976
|
/**
|
|
@@ -4984,7 +4984,7 @@ class Wn {
|
|
|
4984
4984
|
try {
|
|
4985
4985
|
return localStorage.setObject(l, s), 201;
|
|
4986
4986
|
} catch (m) {
|
|
4987
|
-
return console.error("%cstorage",
|
|
4987
|
+
return console.error("%cstorage", o.STORAGE, w.SERIES, t, m), 400;
|
|
4988
4988
|
}
|
|
4989
4989
|
};
|
|
4990
4990
|
/**
|
|
@@ -4998,7 +4998,7 @@ class Wn {
|
|
|
4998
4998
|
try {
|
|
4999
4999
|
return localStorage.setObject(l, s), 200;
|
|
5000
5000
|
} catch (m) {
|
|
5001
|
-
return console.error("%cstorage",
|
|
5001
|
+
return console.error("%cstorage", o.STORAGE, w.MESSAGES, t, m), 400;
|
|
5002
5002
|
}
|
|
5003
5003
|
};
|
|
5004
5004
|
cleanMessages = async (t) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((s) => s(0)));
|
|
@@ -5011,7 +5011,7 @@ class Wn {
|
|
|
5011
5011
|
try {
|
|
5012
5012
|
return localStorage.getObject(`${w.DASHBOARD}.${t.id}`);
|
|
5013
5013
|
} catch (s) {
|
|
5014
|
-
return console.warn("%capi",
|
|
5014
|
+
return console.warn("%capi", o.API, w.SLIDE, t.id, s), {
|
|
5015
5015
|
data: null,
|
|
5016
5016
|
message: `Dashboard ${t.id} load error: ${s.message}`,
|
|
5017
5017
|
success: !1
|
|
@@ -5032,7 +5032,7 @@ class Wn {
|
|
|
5032
5032
|
success: !0
|
|
5033
5033
|
};
|
|
5034
5034
|
} catch (l) {
|
|
5035
|
-
return console.error("%cstorage",
|
|
5035
|
+
return console.error("%cstorage", o.STORAGE, w.WIDGET, t, l), {
|
|
5036
5036
|
data: null,
|
|
5037
5037
|
message: `Dashboard ${t.data.id} save error: ${l.message}`,
|
|
5038
5038
|
success: !1
|
|
@@ -5045,7 +5045,7 @@ class Wn {
|
|
|
5045
5045
|
try {
|
|
5046
5046
|
return localStorage.getObject(`${w.WIDGET}.${t.id}`);
|
|
5047
5047
|
} catch (s) {
|
|
5048
|
-
return console.warn("%capi",
|
|
5048
|
+
return console.warn("%capi", o.API, w.SLIDE, t.id, s), {
|
|
5049
5049
|
data: null,
|
|
5050
5050
|
message: `Widget ${t.id} load error: ${s.message}`,
|
|
5051
5051
|
success: !1
|
|
@@ -5066,7 +5066,7 @@ class Wn {
|
|
|
5066
5066
|
success: !0
|
|
5067
5067
|
};
|
|
5068
5068
|
} catch (l) {
|
|
5069
|
-
return console.error("%cstorage",
|
|
5069
|
+
return console.error("%cstorage", o.STORAGE, w.WIDGET, t, l), {
|
|
5070
5070
|
data: null,
|
|
5071
5071
|
message: `Widget ${t.data.id} save error: ${l.message}`,
|
|
5072
5072
|
success: !1
|
|
@@ -5088,9 +5088,9 @@ class Wn {
|
|
|
5088
5088
|
(l) => l.widget === t.widget
|
|
5089
5089
|
).length || (console.debug(
|
|
5090
5090
|
"%cstorage%c %csubscribe",
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5091
|
+
o.STORAGE,
|
|
5092
|
+
o.NONE,
|
|
5093
|
+
o.SUBSCRIBE,
|
|
5094
5094
|
t.slide,
|
|
5095
5095
|
t.widget
|
|
5096
5096
|
), this.subscribers.push(t)), null);
|
|
@@ -5103,7 +5103,7 @@ class Wn {
|
|
|
5103
5103
|
try {
|
|
5104
5104
|
return localStorage.getObject(`${w.SLIDE}.${t.id}`);
|
|
5105
5105
|
} catch (s) {
|
|
5106
|
-
return console.warn("%capi",
|
|
5106
|
+
return console.warn("%capi", o.API, w.SLIDE, t.id, s), {
|
|
5107
5107
|
data: null,
|
|
5108
5108
|
message: `Slide ${t.id} load error: ${s.message}`,
|
|
5109
5109
|
success: !1
|
|
@@ -5114,7 +5114,7 @@ class Wn {
|
|
|
5114
5114
|
try {
|
|
5115
5115
|
return localStorage.getObject(`${w.SLIDE}.${t.id}`);
|
|
5116
5116
|
} catch (s) {
|
|
5117
|
-
return console.warn("%capi",
|
|
5117
|
+
return console.warn("%capi", o.API, w.SLIDE, t.id, s), {
|
|
5118
5118
|
data: null,
|
|
5119
5119
|
message: `Slide ${t.id} load error: ${s.message}`,
|
|
5120
5120
|
success: !1
|
|
@@ -5134,7 +5134,7 @@ class Wn {
|
|
|
5134
5134
|
success: !0
|
|
5135
5135
|
};
|
|
5136
5136
|
} catch (s) {
|
|
5137
|
-
return console.error("%cstorage",
|
|
5137
|
+
return console.error("%cstorage", o.STORAGE, w.SLIDE, t, s), {
|
|
5138
5138
|
data: null,
|
|
5139
5139
|
message: `Slide ${t.data.id} save error: ${s.message}`,
|
|
5140
5140
|
success: !1
|
|
@@ -5149,7 +5149,7 @@ class Wn {
|
|
|
5149
5149
|
} catch (s) {
|
|
5150
5150
|
return console.warn(
|
|
5151
5151
|
"%capi",
|
|
5152
|
-
|
|
5152
|
+
o.API,
|
|
5153
5153
|
w.PRESENTATION,
|
|
5154
5154
|
t.presentation,
|
|
5155
5155
|
s
|
|
@@ -5164,7 +5164,7 @@ class Wn {
|
|
|
5164
5164
|
try {
|
|
5165
5165
|
return localStorage.getObject(`${w.PRESENTATION}.`);
|
|
5166
5166
|
} catch (t) {
|
|
5167
|
-
return console.warn("%capi",
|
|
5167
|
+
return console.warn("%capi", o.API, w.PRESENTATION, t), {
|
|
5168
5168
|
data: null,
|
|
5169
5169
|
message: `Presentations get error: ${t.message}`,
|
|
5170
5170
|
success: !1
|
|
@@ -5182,7 +5182,7 @@ class Wn {
|
|
|
5182
5182
|
success: !0
|
|
5183
5183
|
};
|
|
5184
5184
|
} catch (s) {
|
|
5185
|
-
return console.error("%cstorage",
|
|
5185
|
+
return console.error("%cstorage", o.STORAGE, w.PRESENTATION, t, s), {
|
|
5186
5186
|
data: null,
|
|
5187
5187
|
message: `Presentation ${t.data.id} save error: ${s.message}`,
|
|
5188
5188
|
success: !1
|
|
@@ -5193,7 +5193,7 @@ class Wn {
|
|
|
5193
5193
|
try {
|
|
5194
5194
|
return localStorage.getObject(`${w.PREFERENCE}.${t.id}`);
|
|
5195
5195
|
} catch (s) {
|
|
5196
|
-
return console.warn("%capi",
|
|
5196
|
+
return console.warn("%capi", o.API, w.PREFERENCE, t.id, s), {
|
|
5197
5197
|
data: null,
|
|
5198
5198
|
message: `Preference ${t.id} load error: ${s.message}`,
|
|
5199
5199
|
success: !1
|
|
@@ -5204,7 +5204,7 @@ class Wn {
|
|
|
5204
5204
|
try {
|
|
5205
5205
|
return localStorage.getObject(`${w.PREFERENCE}.`);
|
|
5206
5206
|
} catch (t) {
|
|
5207
|
-
return console.warn("%capi",
|
|
5207
|
+
return console.warn("%capi", o.API, w.PREFERENCE, t), {
|
|
5208
5208
|
data: null,
|
|
5209
5209
|
message: `Preference get error: ${t.message}`,
|
|
5210
5210
|
success: !1
|
|
@@ -5224,7 +5224,7 @@ class Wn {
|
|
|
5224
5224
|
} catch (s) {
|
|
5225
5225
|
return console.error(
|
|
5226
5226
|
"%cstorage",
|
|
5227
|
-
|
|
5227
|
+
o.STORAGE,
|
|
5228
5228
|
w.PREFERENCE,
|
|
5229
5229
|
t,
|
|
5230
5230
|
s
|
|
@@ -5269,7 +5269,7 @@ class Un {
|
|
|
5269
5269
|
} catch (l) {
|
|
5270
5270
|
return console.warn(
|
|
5271
5271
|
"%capi",
|
|
5272
|
-
|
|
5272
|
+
o.API,
|
|
5273
5273
|
w.CLOUD,
|
|
5274
5274
|
t.slide,
|
|
5275
5275
|
t.widget,
|
|
@@ -5284,7 +5284,7 @@ class Un {
|
|
|
5284
5284
|
} catch (l) {
|
|
5285
5285
|
return console.warn(
|
|
5286
5286
|
"%capi",
|
|
5287
|
-
|
|
5287
|
+
o.API,
|
|
5288
5288
|
w.SERIES,
|
|
5289
5289
|
t.slide,
|
|
5290
5290
|
t.widget,
|
|
@@ -5299,7 +5299,7 @@ class Un {
|
|
|
5299
5299
|
} catch (l) {
|
|
5300
5300
|
return console.warn(
|
|
5301
5301
|
"%capi",
|
|
5302
|
-
|
|
5302
|
+
o.API,
|
|
5303
5303
|
w.MESSAGES,
|
|
5304
5304
|
t.slide,
|
|
5305
5305
|
t.widget,
|
|
@@ -5318,7 +5318,7 @@ class Un {
|
|
|
5318
5318
|
try {
|
|
5319
5319
|
return sessionStorage.setObject(l, s), 201;
|
|
5320
5320
|
} catch (m) {
|
|
5321
|
-
return console.error("%cstorage",
|
|
5321
|
+
return console.error("%cstorage", o.STORAGE, w.CLOUD, t, m), 400;
|
|
5322
5322
|
}
|
|
5323
5323
|
};
|
|
5324
5324
|
/**
|
|
@@ -5332,7 +5332,7 @@ class Un {
|
|
|
5332
5332
|
try {
|
|
5333
5333
|
return sessionStorage.setObject(l, s), 201;
|
|
5334
5334
|
} catch (m) {
|
|
5335
|
-
return console.error("%cstorage",
|
|
5335
|
+
return console.error("%cstorage", o.STORAGE, w.SERIES, t, m), 400;
|
|
5336
5336
|
}
|
|
5337
5337
|
};
|
|
5338
5338
|
/**
|
|
@@ -5346,7 +5346,7 @@ class Un {
|
|
|
5346
5346
|
try {
|
|
5347
5347
|
return sessionStorage.setObject(l, s), 200;
|
|
5348
5348
|
} catch (m) {
|
|
5349
|
-
return console.error("%cstorage",
|
|
5349
|
+
return console.error("%cstorage", o.STORAGE, w.MESSAGES, t, m), 400;
|
|
5350
5350
|
}
|
|
5351
5351
|
};
|
|
5352
5352
|
cleanMessages = async (t) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((s) => s(0)));
|
|
@@ -5362,7 +5362,7 @@ class Un {
|
|
|
5362
5362
|
try {
|
|
5363
5363
|
return sessionStorage.getObject(`${w.DASHBOARD}.${t.id}`);
|
|
5364
5364
|
} catch (s) {
|
|
5365
|
-
return console.warn("%capi",
|
|
5365
|
+
return console.warn("%capi", o.API, w.SLIDE, t.id, s), {
|
|
5366
5366
|
data: null,
|
|
5367
5367
|
message: `Dashboard ${t.id} load error: ${s.message}`,
|
|
5368
5368
|
success: !1
|
|
@@ -5385,7 +5385,7 @@ class Un {
|
|
|
5385
5385
|
success: !0
|
|
5386
5386
|
};
|
|
5387
5387
|
} catch (l) {
|
|
5388
|
-
return console.error("%cstorage",
|
|
5388
|
+
return console.error("%cstorage", o.STORAGE, w.WIDGET, t, l), {
|
|
5389
5389
|
data: null,
|
|
5390
5390
|
message: `Dashboard ${t.data.id} save error: ${l.message}`,
|
|
5391
5391
|
success: !1
|
|
@@ -5396,7 +5396,7 @@ class Un {
|
|
|
5396
5396
|
try {
|
|
5397
5397
|
return sessionStorage.getObject(`${w.WIDGET}.${t.id}`);
|
|
5398
5398
|
} catch (s) {
|
|
5399
|
-
return console.warn("%capi",
|
|
5399
|
+
return console.warn("%capi", o.API, w.SLIDE, t.id, s), {
|
|
5400
5400
|
data: null,
|
|
5401
5401
|
message: `Widget ${t.id} load error: ${s.message}`,
|
|
5402
5402
|
success: !1
|
|
@@ -5417,7 +5417,7 @@ class Un {
|
|
|
5417
5417
|
success: !0
|
|
5418
5418
|
};
|
|
5419
5419
|
} catch (l) {
|
|
5420
|
-
return console.error("%cstorage",
|
|
5420
|
+
return console.error("%cstorage", o.STORAGE, w.WIDGET, t, l), {
|
|
5421
5421
|
data: null,
|
|
5422
5422
|
message: `Slide ${t.data.id} save error: ${l.message}`,
|
|
5423
5423
|
success: !1
|
|
@@ -5439,9 +5439,9 @@ class Un {
|
|
|
5439
5439
|
(l) => l.widget === t.widget
|
|
5440
5440
|
).length || (console.debug(
|
|
5441
5441
|
"%cstorage%c %csubscribe",
|
|
5442
|
-
|
|
5443
|
-
|
|
5444
|
-
|
|
5442
|
+
o.STORAGE,
|
|
5443
|
+
o.NONE,
|
|
5444
|
+
o.SUBSCRIBE,
|
|
5445
5445
|
t.slide,
|
|
5446
5446
|
t.widget
|
|
5447
5447
|
), this.subscribers.push(t)), null);
|
|
@@ -5454,7 +5454,7 @@ class Un {
|
|
|
5454
5454
|
try {
|
|
5455
5455
|
return sessionStorage.getObject(`${w.SLIDE}.${t.id}`);
|
|
5456
5456
|
} catch (s) {
|
|
5457
|
-
return console.warn("%capi",
|
|
5457
|
+
return console.warn("%capi", o.API, w.SLIDE, t.id, s), {
|
|
5458
5458
|
data: null,
|
|
5459
5459
|
message: `Slide ${t.id} load error: ${s.message}`,
|
|
5460
5460
|
success: !1
|
|
@@ -5465,7 +5465,7 @@ class Un {
|
|
|
5465
5465
|
try {
|
|
5466
5466
|
return sessionStorage.getObject(`${w.SLIDE}.${t.id}`);
|
|
5467
5467
|
} catch (s) {
|
|
5468
|
-
return console.warn("%capi",
|
|
5468
|
+
return console.warn("%capi", o.API, w.SLIDE, t.id, s), {
|
|
5469
5469
|
data: null,
|
|
5470
5470
|
message: `Slide ${t.id} load error: ${s.message}`,
|
|
5471
5471
|
success: !1
|
|
@@ -5490,7 +5490,7 @@ class Un {
|
|
|
5490
5490
|
success: !0
|
|
5491
5491
|
};
|
|
5492
5492
|
} catch (s) {
|
|
5493
|
-
return console.error("%cstorage",
|
|
5493
|
+
return console.error("%cstorage", o.STORAGE, w.SLIDE, t, s), {
|
|
5494
5494
|
data: null,
|
|
5495
5495
|
message: `Slide ${t.data.id} save error: ${s.message}`,
|
|
5496
5496
|
success: !1
|
|
@@ -5505,7 +5505,7 @@ class Un {
|
|
|
5505
5505
|
} catch (s) {
|
|
5506
5506
|
return console.warn(
|
|
5507
5507
|
"%capi",
|
|
5508
|
-
|
|
5508
|
+
o.API,
|
|
5509
5509
|
w.PRESENTATION,
|
|
5510
5510
|
t.presentation,
|
|
5511
5511
|
s
|
|
@@ -5520,7 +5520,7 @@ class Un {
|
|
|
5520
5520
|
try {
|
|
5521
5521
|
return sessionStorage.getObject(`${w.PRESENTATION}.`);
|
|
5522
5522
|
} catch (t) {
|
|
5523
|
-
return console.warn("%capi",
|
|
5523
|
+
return console.warn("%capi", o.API, w.PRESENTATION, t), {
|
|
5524
5524
|
data: null,
|
|
5525
5525
|
message: `Presentations get error: ${t.message}`,
|
|
5526
5526
|
success: !1
|
|
@@ -5538,7 +5538,7 @@ class Un {
|
|
|
5538
5538
|
success: !0
|
|
5539
5539
|
};
|
|
5540
5540
|
} catch (s) {
|
|
5541
|
-
return console.error("%cstorage",
|
|
5541
|
+
return console.error("%cstorage", o.STORAGE, w.PRESENTATION, t, s), {
|
|
5542
5542
|
data: null,
|
|
5543
5543
|
message: `Presentation ${t.data.id} save error: ${s.message}`,
|
|
5544
5544
|
success: !1
|
|
@@ -5549,7 +5549,7 @@ class Un {
|
|
|
5549
5549
|
try {
|
|
5550
5550
|
return sessionStorage.getObject(`${w.PREFERENCE}.${t.id}`);
|
|
5551
5551
|
} catch (s) {
|
|
5552
|
-
return console.warn("%capi",
|
|
5552
|
+
return console.warn("%capi", o.API, w.PREFERENCE, t.id, s), {
|
|
5553
5553
|
data: null,
|
|
5554
5554
|
message: `Preference ${t.id} load error: ${s.message}`,
|
|
5555
5555
|
success: !1
|
|
@@ -5560,7 +5560,7 @@ class Un {
|
|
|
5560
5560
|
try {
|
|
5561
5561
|
return sessionStorage.getObject(`${w.PREFERENCE}`);
|
|
5562
5562
|
} catch (t) {
|
|
5563
|
-
return console.warn("%capi",
|
|
5563
|
+
return console.warn("%capi", o.API, w.PREFERENCE, t), {
|
|
5564
5564
|
data: null,
|
|
5565
5565
|
message: `Preferences get error: ${t.message}`,
|
|
5566
5566
|
success: !1
|
|
@@ -5580,7 +5580,7 @@ class Un {
|
|
|
5580
5580
|
} catch (s) {
|
|
5581
5581
|
return console.error(
|
|
5582
5582
|
"%cstorage",
|
|
5583
|
-
|
|
5583
|
+
o.STORAGE,
|
|
5584
5584
|
w.PREFERENCE,
|
|
5585
5585
|
t,
|
|
5586
5586
|
s
|
|
@@ -5620,7 +5620,7 @@ class Fn {
|
|
|
5620
5620
|
} catch (l) {
|
|
5621
5621
|
return console.warn(
|
|
5622
5622
|
"%capi",
|
|
5623
|
-
|
|
5623
|
+
o.API,
|
|
5624
5624
|
w.CLOUD,
|
|
5625
5625
|
t.slide,
|
|
5626
5626
|
t.widget,
|
|
@@ -5635,7 +5635,7 @@ class Fn {
|
|
|
5635
5635
|
} catch (l) {
|
|
5636
5636
|
return console.warn(
|
|
5637
5637
|
"%capi",
|
|
5638
|
-
|
|
5638
|
+
o.API,
|
|
5639
5639
|
w.SERIES,
|
|
5640
5640
|
t.slide,
|
|
5641
5641
|
t.widget,
|
|
@@ -5650,7 +5650,7 @@ class Fn {
|
|
|
5650
5650
|
} catch (l) {
|
|
5651
5651
|
return console.warn(
|
|
5652
5652
|
"%capi",
|
|
5653
|
-
|
|
5653
|
+
o.API,
|
|
5654
5654
|
w.MESSAGES,
|
|
5655
5655
|
t.slide,
|
|
5656
5656
|
t.widget,
|
|
@@ -5669,7 +5669,7 @@ class Fn {
|
|
|
5669
5669
|
try {
|
|
5670
5670
|
return window.__bc.WidgetData[l] = s, 201;
|
|
5671
5671
|
} catch (m) {
|
|
5672
|
-
return console.error("%cstorage",
|
|
5672
|
+
return console.error("%cstorage", o.STORAGE, "set", t, m), 400;
|
|
5673
5673
|
}
|
|
5674
5674
|
};
|
|
5675
5675
|
/**
|
|
@@ -5683,7 +5683,7 @@ class Fn {
|
|
|
5683
5683
|
try {
|
|
5684
5684
|
return window.__bc.WidgetData[l] = s, 201;
|
|
5685
5685
|
} catch (m) {
|
|
5686
|
-
return console.error("%cstorage",
|
|
5686
|
+
return console.error("%cstorage", o.STORAGE, "set", t, m), 400;
|
|
5687
5687
|
}
|
|
5688
5688
|
};
|
|
5689
5689
|
/**
|
|
@@ -5697,7 +5697,7 @@ class Fn {
|
|
|
5697
5697
|
try {
|
|
5698
5698
|
return window.__bc.WidgetData[l] = s, 201;
|
|
5699
5699
|
} catch (m) {
|
|
5700
|
-
return console.error("%cstorage",
|
|
5700
|
+
return console.error("%cstorage", o.STORAGE, "set", t, m), 400;
|
|
5701
5701
|
}
|
|
5702
5702
|
};
|
|
5703
5703
|
cleanMessages = async (t) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((s) => s(0)));
|
|
@@ -5713,7 +5713,7 @@ class Fn {
|
|
|
5713
5713
|
try {
|
|
5714
5714
|
return window.__bc.DashboardData[t.id];
|
|
5715
5715
|
} catch (s) {
|
|
5716
|
-
return console.warn("%capi",
|
|
5716
|
+
return console.warn("%capi", o.API, w.DASHBOARD, t.id, s), {
|
|
5717
5717
|
data: null,
|
|
5718
5718
|
message: `Dashboard ${t.id} load error: ${s.message}`,
|
|
5719
5719
|
success: !1
|
|
@@ -5734,7 +5734,7 @@ class Fn {
|
|
|
5734
5734
|
success: !0
|
|
5735
5735
|
};
|
|
5736
5736
|
} catch (l) {
|
|
5737
|
-
return console.error("%cstorage",
|
|
5737
|
+
return console.error("%cstorage", o.STORAGE, w.DASHBOARD, t, l), {
|
|
5738
5738
|
data: null,
|
|
5739
5739
|
message: `Dashboard ${t.data.id} save error: ${l.message}`,
|
|
5740
5740
|
success: !1
|
|
@@ -5747,7 +5747,7 @@ class Fn {
|
|
|
5747
5747
|
try {
|
|
5748
5748
|
return window.__bc.WidgetData[t.id];
|
|
5749
5749
|
} catch (s) {
|
|
5750
|
-
return console.warn("%capi",
|
|
5750
|
+
return console.warn("%capi", o.API, w.WIDGET, t.id, s), {
|
|
5751
5751
|
data: null,
|
|
5752
5752
|
message: `Widget ${t.id} load error: ${s.message}`,
|
|
5753
5753
|
success: !1
|
|
@@ -5768,7 +5768,7 @@ class Fn {
|
|
|
5768
5768
|
success: !0
|
|
5769
5769
|
};
|
|
5770
5770
|
} catch (l) {
|
|
5771
|
-
return console.error("%cstorage",
|
|
5771
|
+
return console.error("%cstorage", o.STORAGE, w.WIDGET, t, l), {
|
|
5772
5772
|
data: null,
|
|
5773
5773
|
message: `Slide ${t.data.id} save error: ${l.message}`,
|
|
5774
5774
|
success: !1
|
|
@@ -5790,9 +5790,9 @@ class Fn {
|
|
|
5790
5790
|
(l) => l.widget === t.widget
|
|
5791
5791
|
).length || (console.debug(
|
|
5792
5792
|
"%cstorage%c %csubscribe",
|
|
5793
|
-
|
|
5794
|
-
|
|
5795
|
-
|
|
5793
|
+
o.STORAGE,
|
|
5794
|
+
o.NONE,
|
|
5795
|
+
o.SUBSCRIBE,
|
|
5796
5796
|
t.slide,
|
|
5797
5797
|
t.widget
|
|
5798
5798
|
), this.subscribers.push(t)), null);
|
|
@@ -5805,7 +5805,7 @@ class Fn {
|
|
|
5805
5805
|
try {
|
|
5806
5806
|
return window.__bc.SlideData[t.id];
|
|
5807
5807
|
} catch (s) {
|
|
5808
|
-
return console.warn("%capi",
|
|
5808
|
+
return console.warn("%capi", o.API, w.SLIDE, t.id, s), {
|
|
5809
5809
|
data: null,
|
|
5810
5810
|
message: `Slide ${t.id} load error: ${s.message}`,
|
|
5811
5811
|
success: !1
|
|
@@ -5820,7 +5820,7 @@ class Fn {
|
|
|
5820
5820
|
} catch (s) {
|
|
5821
5821
|
return console.warn(
|
|
5822
5822
|
"%capi",
|
|
5823
|
-
|
|
5823
|
+
o.API,
|
|
5824
5824
|
w.PRESENTATION,
|
|
5825
5825
|
t.presentation_id,
|
|
5826
5826
|
s
|
|
@@ -5844,7 +5844,7 @@ class Fn {
|
|
|
5844
5844
|
success: !0
|
|
5845
5845
|
};
|
|
5846
5846
|
} catch (s) {
|
|
5847
|
-
return console.error("%cstorage",
|
|
5847
|
+
return console.error("%cstorage", o.STORAGE, w.SLIDE, t, s), {
|
|
5848
5848
|
data: null,
|
|
5849
5849
|
message: `Slide ${t.data.id} save error: ${s.message}`,
|
|
5850
5850
|
success: !1
|
|
@@ -5858,7 +5858,7 @@ class Fn {
|
|
|
5858
5858
|
} catch (s) {
|
|
5859
5859
|
return console.warn(
|
|
5860
5860
|
"%capi",
|
|
5861
|
-
|
|
5861
|
+
o.API,
|
|
5862
5862
|
w.PRESENTATION,
|
|
5863
5863
|
t.presentation,
|
|
5864
5864
|
s
|
|
@@ -5873,7 +5873,7 @@ class Fn {
|
|
|
5873
5873
|
try {
|
|
5874
5874
|
return window.__bc.PresentationData;
|
|
5875
5875
|
} catch (t) {
|
|
5876
|
-
return console.warn("%capi",
|
|
5876
|
+
return console.warn("%capi", o.API, w.PRESENTATION, t), {
|
|
5877
5877
|
data: null,
|
|
5878
5878
|
message: `Presentations get error: ${t.message}`,
|
|
5879
5879
|
success: !1
|
|
@@ -5888,7 +5888,7 @@ class Fn {
|
|
|
5888
5888
|
success: !0
|
|
5889
5889
|
};
|
|
5890
5890
|
} catch (s) {
|
|
5891
|
-
return console.error("%cstorage",
|
|
5891
|
+
return console.error("%cstorage", o.STORAGE, w.PRESENTATION, t, s), {
|
|
5892
5892
|
data: null,
|
|
5893
5893
|
message: `Presentation ${t.data.id} save error: ${s.message}`,
|
|
5894
5894
|
success: !1
|
|
@@ -5899,7 +5899,7 @@ class Fn {
|
|
|
5899
5899
|
try {
|
|
5900
5900
|
return window.__bc.Preferences[t.id];
|
|
5901
5901
|
} catch (s) {
|
|
5902
|
-
return console.warn("%capi",
|
|
5902
|
+
return console.warn("%capi", o.API, w.PREFERENCE, t.id, s), {
|
|
5903
5903
|
data: null,
|
|
5904
5904
|
message: `Preference ${t.id} load error: ${s.message}`,
|
|
5905
5905
|
success: !1
|
|
@@ -5910,7 +5910,7 @@ class Fn {
|
|
|
5910
5910
|
try {
|
|
5911
5911
|
return window.__bc.Preferences;
|
|
5912
5912
|
} catch (t) {
|
|
5913
|
-
return console.warn("%capi",
|
|
5913
|
+
return console.warn("%capi", o.API, w.PREFERENCE, t), {
|
|
5914
5914
|
data: null,
|
|
5915
5915
|
message: `Preferences get error: ${t.message}`,
|
|
5916
5916
|
success: !1
|
|
@@ -5927,7 +5927,7 @@ class Fn {
|
|
|
5927
5927
|
} catch (s) {
|
|
5928
5928
|
return console.error(
|
|
5929
5929
|
"%cstorage",
|
|
5930
|
-
|
|
5930
|
+
o.STORAGE,
|
|
5931
5931
|
w.PREFERENCE,
|
|
5932
5932
|
t,
|
|
5933
5933
|
s
|
|
@@ -5959,7 +5959,7 @@ class rs {
|
|
|
5959
5959
|
constructor(t) {
|
|
5960
5960
|
switch (C(3, [
|
|
5961
5961
|
"%cpresentation",
|
|
5962
|
-
|
|
5962
|
+
o.PRESENTATION,
|
|
5963
5963
|
t.presentation,
|
|
5964
5964
|
Z.VERSION,
|
|
5965
5965
|
Ca
|
|
@@ -5990,9 +5990,9 @@ class rs {
|
|
|
5990
5990
|
update = async (t) => {
|
|
5991
5991
|
if (C(3, [
|
|
5992
5992
|
"%cupdate%c %cdata",
|
|
5993
|
-
|
|
5994
|
-
|
|
5995
|
-
|
|
5993
|
+
o.NO_UPDATES,
|
|
5994
|
+
o.NONE,
|
|
5995
|
+
o.MESSAGES,
|
|
5996
5996
|
t
|
|
5997
5997
|
]), this.sm === null || Object.keys(this.subscribers).length === 0)
|
|
5998
5998
|
return;
|
|
@@ -6021,33 +6021,33 @@ class rs {
|
|
|
6021
6021
|
switch (T.type) {
|
|
6022
6022
|
case w.MESSAGES:
|
|
6023
6023
|
R = await this.sm?.getHash(T), R === "none" && (T.hash = "temp", await this.sm?.createHash(T)), t.data.messages = t.data.messages.filter(
|
|
6024
|
-
(
|
|
6024
|
+
(F) => F.id !== null
|
|
6025
6025
|
), g = t.data.messages.length > 0 ? Ur(t.data.messages[0].utc) : "none", R === g && s.refresh === !1 ? (C(3, [
|
|
6026
6026
|
"%cset%c %cstorage%c %cmessages",
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
|
|
6027
|
+
o.NO_UPDATES,
|
|
6028
|
+
o.NONE,
|
|
6029
|
+
o.STORAGE,
|
|
6030
|
+
o.NONE,
|
|
6031
|
+
o.MESSAGES,
|
|
6032
6032
|
t.data?.title ?? t.query.widget,
|
|
6033
6033
|
`same hash:${g}`
|
|
6034
|
-
]), m.code = 204) : this.sm !== null ? (T.hash = g, await this.sm?.setHash(T), m.code = await this.sm.setMessages(t.query, t).then(async (
|
|
6034
|
+
]), m.code = 204) : this.sm !== null ? (T.hash = g, await this.sm?.setHash(T), m.code = await this.sm.setMessages(t.query, t).then(async (F) => (s.refresh && F === 204 && (F = 201), this.broadcastUpdate(F, t), F)).catch((F) => 500)) : m.code = 500;
|
|
6035
6035
|
break;
|
|
6036
6036
|
case w.CLOUD:
|
|
6037
6037
|
R = await this.sm?.getHash(T), R === "none" && (T.hash = "temp", await this.sm?.createHash(T)), g = Ur(t.data.cloud), R === g && s.refresh === !1 ? (C(3, [
|
|
6038
6038
|
"%cset%c %cstorage%c %ccloud",
|
|
6039
|
-
|
|
6040
|
-
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
|
|
6039
|
+
o.NO_UPDATES,
|
|
6040
|
+
o.NONE,
|
|
6041
|
+
o.STORAGE,
|
|
6042
|
+
o.NONE,
|
|
6043
|
+
o.CLOUD,
|
|
6044
6044
|
t.data?.title ?? T.widget,
|
|
6045
6045
|
`same hash:${g}`
|
|
6046
6046
|
]), C(4, [
|
|
6047
6047
|
"%cdebug%c %ccloud",
|
|
6048
|
-
|
|
6049
|
-
|
|
6050
|
-
|
|
6048
|
+
o.NO_UPDATES,
|
|
6049
|
+
o.NONE,
|
|
6050
|
+
o.CLOUD,
|
|
6051
6051
|
t.query
|
|
6052
6052
|
]), m = { code: 204, hash: g }) : (T.hash = g, await this.sm?.setHash(T), l = {
|
|
6053
6053
|
data: {
|
|
@@ -6056,50 +6056,50 @@ class rs {
|
|
|
6056
6056
|
message: t.message,
|
|
6057
6057
|
success: t.success,
|
|
6058
6058
|
query: t.query
|
|
6059
|
-
}, this.sm !== null ? m.code = await this.sm.setCloud(t.query, l.data).then((
|
|
6059
|
+
}, this.sm !== null ? m.code = await this.sm.setCloud(t.query, l.data).then((F) => (s.refresh && F === 204 && (F = 201), this.broadcastUpdate(F, t), F)).catch((F) => 500) : m.code = 500);
|
|
6060
6060
|
break;
|
|
6061
6061
|
case w.SERIES:
|
|
6062
6062
|
R = await this.sm?.getHash(T), R === "none" && (T.hash = "temp", await this.sm?.createHash(T)), g = Ur(t.data.series), R === g && s.refresh === !1 ? (C(3, [
|
|
6063
6063
|
"%cset%c %cstorage%c %cseries",
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
|
|
6068
|
-
|
|
6064
|
+
o.NO_UPDATES,
|
|
6065
|
+
o.NONE,
|
|
6066
|
+
o.STORAGE,
|
|
6067
|
+
o.NONE,
|
|
6068
|
+
o.SERIES,
|
|
6069
6069
|
t.data?.title ?? t.query.widget,
|
|
6070
6070
|
`same hash:${g}`
|
|
6071
6071
|
]), C(4, [
|
|
6072
6072
|
"%cdebug%c %cseries",
|
|
6073
|
-
|
|
6074
|
-
|
|
6075
|
-
|
|
6073
|
+
o.NO_UPDATES,
|
|
6074
|
+
o.NONE,
|
|
6075
|
+
o.SERIES,
|
|
6076
6076
|
T
|
|
6077
6077
|
]), m = { code: 204, hash: g }) : (T.hash = g, await this.sm?.setHash(T), l = {
|
|
6078
6078
|
data: t.data,
|
|
6079
6079
|
message: t.message,
|
|
6080
6080
|
success: t.success,
|
|
6081
6081
|
query: t.query
|
|
6082
|
-
}, this.sm !== null ? m.code = await this.sm
|
|
6082
|
+
}, this.sm !== null ? m.code = await this.sm.setSeries(T, t.data).then((F) => (s.refresh && F === 204 && (F = 201), this.broadcastUpdate(F, t), F)).catch((F) => 500) : m.code = 500);
|
|
6083
6083
|
break;
|
|
6084
6084
|
default:
|
|
6085
6085
|
C(3, [
|
|
6086
6086
|
`%cfetch%c %capi% %c${T.type} `,
|
|
6087
|
-
|
|
6088
|
-
|
|
6089
|
-
|
|
6090
|
-
|
|
6091
|
-
|
|
6087
|
+
o.KO,
|
|
6088
|
+
o.NONE,
|
|
6089
|
+
o.API,
|
|
6090
|
+
o.NONE,
|
|
6091
|
+
o.NO_UPDATES,
|
|
6092
6092
|
`Bad request: type ${T.type} unknown`
|
|
6093
6093
|
]), m = { code: 404, hash: g };
|
|
6094
6094
|
}
|
|
6095
6095
|
} else
|
|
6096
6096
|
switch (C(3, [
|
|
6097
6097
|
`%cset%c %c${t.query.type}%c %cunauthorized`,
|
|
6098
|
-
|
|
6099
|
-
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
|
|
6098
|
+
o.KO,
|
|
6099
|
+
o.NONE,
|
|
6100
|
+
o.STORAGE,
|
|
6101
|
+
o.NONE,
|
|
6102
|
+
o.NO_UPDATES,
|
|
6103
6103
|
t.query
|
|
6104
6104
|
]), t.query.type) {
|
|
6105
6105
|
case w.MESSAGES:
|
|
@@ -6113,7 +6113,7 @@ class rs {
|
|
|
6113
6113
|
};
|
|
6114
6114
|
startBroadcastListener = () => {
|
|
6115
6115
|
const t = this.options.presentation;
|
|
6116
|
-
C(3, ["%cchannel%c %capi",
|
|
6116
|
+
C(3, ["%cchannel%c %capi", o.BROADCAST, o.NONE, o.API, t]), this.bc && (this.bc.onmessage = (s) => {
|
|
6117
6117
|
this.actions(s);
|
|
6118
6118
|
}, this.bc.postMessage({ event: Z.STORAGE_INIT, data: {} }));
|
|
6119
6119
|
};
|
|
@@ -6125,18 +6125,18 @@ class rs {
|
|
|
6125
6125
|
case 201:
|
|
6126
6126
|
C(3, [
|
|
6127
6127
|
`%cupdate%c %cwidget%c %c${s.query?.type}`,
|
|
6128
|
-
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
|
|
6128
|
+
o.BROADCAST,
|
|
6129
|
+
o.NONE,
|
|
6130
|
+
o.WIDGET,
|
|
6131
|
+
o.NONE,
|
|
6132
6132
|
_t(s.query),
|
|
6133
6133
|
// @ts-expect-error query.widget is obligatory but not always
|
|
6134
6134
|
`${s?.data?.title ?? ""} ${s.query.widget}`
|
|
6135
6135
|
]), C(4, [
|
|
6136
6136
|
"%cdebug%c %cevent",
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6137
|
+
o.NO_UPDATES,
|
|
6138
|
+
o.NONE,
|
|
6139
|
+
o.BROADCAST,
|
|
6140
6140
|
s
|
|
6141
6141
|
]), this.bc?.postMessage({
|
|
6142
6142
|
event: Z.WIDGET_UPDATE,
|
|
@@ -6148,10 +6148,10 @@ class rs {
|
|
|
6148
6148
|
default:
|
|
6149
6149
|
C(2, [
|
|
6150
6150
|
`%cupdate%c %cwidget%c %c${s.query?.type}`,
|
|
6151
|
-
|
|
6152
|
-
|
|
6153
|
-
|
|
6154
|
-
|
|
6151
|
+
o.KO,
|
|
6152
|
+
o.NONE,
|
|
6153
|
+
o.WIDGET,
|
|
6154
|
+
o.NONE,
|
|
6155
6155
|
_t(s.query),
|
|
6156
6156
|
"Fetch error",
|
|
6157
6157
|
s.query
|
|
@@ -6168,10 +6168,10 @@ class rs {
|
|
|
6168
6168
|
const s = t.data.data;
|
|
6169
6169
|
s.widget !== void 0 && (C(3, [
|
|
6170
6170
|
`%csubscribe%c %cwidget%c %c${t.data.data.type}`,
|
|
6171
|
-
|
|
6172
|
-
|
|
6173
|
-
|
|
6174
|
-
|
|
6171
|
+
o.BROADCAST,
|
|
6172
|
+
o.NONE,
|
|
6173
|
+
o.WIDGET,
|
|
6174
|
+
o.NONE,
|
|
6175
6175
|
_t(s),
|
|
6176
6176
|
s
|
|
6177
6177
|
]), this.addSubscriber(s));
|
|
@@ -6179,22 +6179,22 @@ class rs {
|
|
|
6179
6179
|
case Z.UPDATE:
|
|
6180
6180
|
C(3, [
|
|
6181
6181
|
"%cupdate%c %capi%c %cstorage",
|
|
6182
|
-
|
|
6183
|
-
|
|
6184
|
-
|
|
6185
|
-
|
|
6186
|
-
|
|
6182
|
+
o.BROADCAST,
|
|
6183
|
+
o.NONE,
|
|
6184
|
+
o.API,
|
|
6185
|
+
o.NONE,
|
|
6186
|
+
o.STORAGE,
|
|
6187
6187
|
t.data
|
|
6188
6188
|
]), await this.update(t.data.data);
|
|
6189
6189
|
break;
|
|
6190
6190
|
case "stream":
|
|
6191
6191
|
C(3, [
|
|
6192
6192
|
"%cupdate%c %capi%c %cstorage",
|
|
6193
|
-
|
|
6194
|
-
|
|
6195
|
-
|
|
6196
|
-
|
|
6197
|
-
|
|
6193
|
+
o.BROADCAST,
|
|
6194
|
+
o.NONE,
|
|
6195
|
+
o.API,
|
|
6196
|
+
o.NONE,
|
|
6197
|
+
o.STORAGE,
|
|
6198
6198
|
t.data
|
|
6199
6199
|
]), await this.stream();
|
|
6200
6200
|
break;
|
|
@@ -6204,11 +6204,11 @@ class rs {
|
|
|
6204
6204
|
if (this.options?.suspended) {
|
|
6205
6205
|
C(2, [
|
|
6206
6206
|
"%cclean%c %cstorage%c %cmessages",
|
|
6207
|
-
|
|
6208
|
-
|
|
6209
|
-
|
|
6210
|
-
|
|
6211
|
-
|
|
6207
|
+
o.KO,
|
|
6208
|
+
o.NONE,
|
|
6209
|
+
o.STORAGE,
|
|
6210
|
+
o.NONE,
|
|
6211
|
+
o.MESSAGES,
|
|
6212
6212
|
"Account suspended"
|
|
6213
6213
|
]);
|
|
6214
6214
|
return;
|
|
@@ -6216,11 +6216,11 @@ class rs {
|
|
|
6216
6216
|
const t = this.options?.retention || 86400 * 40, s = await this.sm?.cleanMessages(t);
|
|
6217
6217
|
C(3, [
|
|
6218
6218
|
"%cclean%c %cstorage%c %cmessages",
|
|
6219
|
-
|
|
6220
|
-
|
|
6221
|
-
|
|
6222
|
-
|
|
6223
|
-
|
|
6219
|
+
o.OK,
|
|
6220
|
+
o.NONE,
|
|
6221
|
+
o.STORAGE,
|
|
6222
|
+
o.NONE,
|
|
6223
|
+
o.MESSAGES,
|
|
6224
6224
|
`${s} messages deleted`
|
|
6225
6225
|
]);
|
|
6226
6226
|
};
|
|
@@ -6228,11 +6228,11 @@ class rs {
|
|
|
6228
6228
|
const s = await this.sm?.hideMessage(t.id, 0);
|
|
6229
6229
|
return C(3, [
|
|
6230
6230
|
"%chide%c %cstorage%c %cmessages",
|
|
6231
|
-
|
|
6232
|
-
|
|
6233
|
-
|
|
6234
|
-
|
|
6235
|
-
|
|
6231
|
+
o.OK,
|
|
6232
|
+
o.NONE,
|
|
6233
|
+
o.STORAGE,
|
|
6234
|
+
o.NONE,
|
|
6235
|
+
o.MESSAGES,
|
|
6236
6236
|
`${s} messages hidden`
|
|
6237
6237
|
]), await this.api.hideMessage(t);
|
|
6238
6238
|
};
|
|
@@ -6312,11 +6312,11 @@ class Fa {
|
|
|
6312
6312
|
*/
|
|
6313
6313
|
getCloud = async (t) => t.type !== w.CLOUD ? (console.warn(
|
|
6314
6314
|
"%cget%c %cstorage%c %ccloud",
|
|
6315
|
-
|
|
6316
|
-
|
|
6317
|
-
|
|
6318
|
-
|
|
6319
|
-
|
|
6315
|
+
o.KO,
|
|
6316
|
+
o.NONE,
|
|
6317
|
+
o.STORAGE,
|
|
6318
|
+
o.NONE,
|
|
6319
|
+
o.CLOUD,
|
|
6320
6320
|
t.widget,
|
|
6321
6321
|
"wrong method call for getCloud, type used is",
|
|
6322
6322
|
t.type
|
|
@@ -6332,11 +6332,11 @@ class Fa {
|
|
|
6332
6332
|
*/
|
|
6333
6333
|
getMessages = async (t) => t.type !== w.MESSAGES ? (console.warn(
|
|
6334
6334
|
"%cget%c %cstorage%c %cmessages",
|
|
6335
|
-
|
|
6336
|
-
|
|
6337
|
-
|
|
6338
|
-
|
|
6339
|
-
|
|
6335
|
+
o.KO,
|
|
6336
|
+
o.NONE,
|
|
6337
|
+
o.STORAGE,
|
|
6338
|
+
o.NONE,
|
|
6339
|
+
o.MESSAGES,
|
|
6340
6340
|
t.widget,
|
|
6341
6341
|
"wrong method call for getMessages, type used is",
|
|
6342
6342
|
t.type
|
|
@@ -6352,11 +6352,11 @@ class Fa {
|
|
|
6352
6352
|
*/
|
|
6353
6353
|
getSeries = async (t) => t.type !== w.SERIES ? (console.warn(
|
|
6354
6354
|
"%cget%c %cstorage%c %cseries",
|
|
6355
|
-
|
|
6356
|
-
|
|
6357
|
-
|
|
6358
|
-
|
|
6359
|
-
|
|
6355
|
+
o.KO,
|
|
6356
|
+
o.NONE,
|
|
6357
|
+
o.STORAGE,
|
|
6358
|
+
o.NONE,
|
|
6359
|
+
o.SERIES,
|
|
6360
6360
|
t.widget,
|
|
6361
6361
|
"wrong method call for getSeries, type used is",
|
|
6362
6362
|
t.type
|
|
@@ -6406,10 +6406,10 @@ class ns {
|
|
|
6406
6406
|
const m = await this.getData();
|
|
6407
6407
|
m?.success && (C(4, [
|
|
6408
6408
|
`%cset%c %cwidget%c %c${this.query.type}`,
|
|
6409
|
-
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
|
|
6409
|
+
o.OK,
|
|
6410
|
+
o.NONE,
|
|
6411
|
+
o.WIDGET,
|
|
6412
|
+
o.NONE,
|
|
6413
6413
|
//@ts-ignore
|
|
6414
6414
|
_t(this.query),
|
|
6415
6415
|
this.query
|
|
@@ -6437,17 +6437,17 @@ class ns {
|
|
|
6437
6437
|
data: this.query
|
|
6438
6438
|
}), C(3, [
|
|
6439
6439
|
`%csubscribe%c %cwidget%c %c${this.query.type}`,
|
|
6440
|
-
|
|
6441
|
-
|
|
6442
|
-
|
|
6443
|
-
|
|
6440
|
+
o.SUBSCRIBE,
|
|
6441
|
+
o.NONE,
|
|
6442
|
+
o.WIDGET,
|
|
6443
|
+
o.NONE,
|
|
6444
6444
|
_t(this.query),
|
|
6445
6445
|
this.query.widget
|
|
6446
6446
|
]), C(4, [
|
|
6447
6447
|
"%cdebug%c %cwidget",
|
|
6448
|
-
|
|
6449
|
-
|
|
6450
|
-
|
|
6448
|
+
o.NO_UPDATES,
|
|
6449
|
+
o.NONE,
|
|
6450
|
+
o.WIDGET,
|
|
6451
6451
|
this.query
|
|
6452
6452
|
]));
|
|
6453
6453
|
}
|
|
@@ -6479,19 +6479,19 @@ class ns {
|
|
|
6479
6479
|
*/
|
|
6480
6480
|
getCloud = async () => this.query.type !== w.CLOUD ? (C(3, [
|
|
6481
6481
|
"%cget%c %cstorage%c %cwidget",
|
|
6482
|
-
|
|
6483
|
-
|
|
6484
|
-
|
|
6485
|
-
|
|
6486
|
-
|
|
6482
|
+
o.KO,
|
|
6483
|
+
o.NONE,
|
|
6484
|
+
o.STORAGE,
|
|
6485
|
+
o.NONE,
|
|
6486
|
+
o.WIDGET,
|
|
6487
6487
|
this.query.widget,
|
|
6488
6488
|
"Wrong method call for getCloud, expected type is",
|
|
6489
6489
|
this.query.type
|
|
6490
6490
|
]), C(4, [
|
|
6491
6491
|
"%cdebug%c %ccloud",
|
|
6492
|
-
|
|
6493
|
-
|
|
6494
|
-
|
|
6492
|
+
o.NO_UPDATES,
|
|
6493
|
+
o.NONE,
|
|
6494
|
+
o.CLOUD,
|
|
6495
6495
|
this.query
|
|
6496
6496
|
]), {
|
|
6497
6497
|
data: null,
|
|
@@ -6506,19 +6506,19 @@ class ns {
|
|
|
6506
6506
|
*/
|
|
6507
6507
|
getMessages = async () => this.query.type !== w.MESSAGES ? (C(3, [
|
|
6508
6508
|
"%cget%c %cstorage%c %cwidget",
|
|
6509
|
-
|
|
6510
|
-
|
|
6511
|
-
|
|
6512
|
-
|
|
6513
|
-
|
|
6509
|
+
o.KO,
|
|
6510
|
+
o.NONE,
|
|
6511
|
+
o.STORAGE,
|
|
6512
|
+
o.NONE,
|
|
6513
|
+
o.WIDGET,
|
|
6514
6514
|
this.query.widget,
|
|
6515
6515
|
"Wrong method call for getMessages, expected type is",
|
|
6516
6516
|
this.query.type
|
|
6517
6517
|
]), C(4, [
|
|
6518
6518
|
"%debug%c %cmessages",
|
|
6519
|
-
|
|
6520
|
-
|
|
6521
|
-
|
|
6519
|
+
o.NO_UPDATES,
|
|
6520
|
+
o.NONE,
|
|
6521
|
+
o.MESSAGES,
|
|
6522
6522
|
this.query
|
|
6523
6523
|
]), {
|
|
6524
6524
|
data: null,
|
|
@@ -6532,19 +6532,19 @@ class ns {
|
|
|
6532
6532
|
*/
|
|
6533
6533
|
getSeries = async () => this.query.type !== w.SERIES ? (C(3, [
|
|
6534
6534
|
"%cget%c %cstorage%c %cwidget",
|
|
6535
|
-
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
6535
|
+
o.KO,
|
|
6536
|
+
o.NONE,
|
|
6537
|
+
o.STORAGE,
|
|
6538
|
+
o.NONE,
|
|
6539
|
+
o.WIDGET,
|
|
6540
6540
|
this.query.widget,
|
|
6541
6541
|
"Wrong method call for getSeries, expected type is",
|
|
6542
6542
|
this.query.type
|
|
6543
6543
|
]), C(4, [
|
|
6544
6544
|
"%cdebug%c %cseries",
|
|
6545
|
-
|
|
6546
|
-
|
|
6547
|
-
|
|
6545
|
+
o.NO_UPDATES,
|
|
6546
|
+
o.NONE,
|
|
6547
|
+
o.SERIES,
|
|
6548
6548
|
this.query
|
|
6549
6549
|
]), {
|
|
6550
6550
|
data: null,
|
|
@@ -6561,9 +6561,9 @@ class ns {
|
|
|
6561
6561
|
showModal = (t) => {
|
|
6562
6562
|
C(3, [
|
|
6563
6563
|
"%cmodal%c %cwidget",
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
|
|
6564
|
+
o.OK,
|
|
6565
|
+
o.NONE,
|
|
6566
|
+
o.WIDGET,
|
|
6567
6567
|
Z.SHOW_MODAL,
|
|
6568
6568
|
t.showComponent,
|
|
6569
6569
|
Na(this.element.attributes)
|