buzzcasting-storage 3.11.6 → 3.12.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.d.ts +3 -3
- package/dist/buzzcasting-storage.esm.js +662 -649
- package/package.json +53 -53
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _ = /* @__PURE__ */ ((h) => (h.CLOUD = "cloud", h.DASHBOARD = "dashboard", h.DASHBOARDS = "dashboards", h.IMAGES = "images", h.MESSAGES = "messages", h.PREFERENCE = "preference", h.PREFERENCES = "preferences", h.PRESENTATION = "presentation", h.PRESENTATIONS = "presentations", h.SERIES = "series", h.SLIDE = "slide", h.SLIDES = "slides", h.TOPICS = "topics", h.WIDGET = "widget", h.WIDGETS = "widgets", h))(_ || {}), c = /* @__PURE__ */ ((h) => (h.API = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;", h.APP = "color:white;background-color:navy;padding:0 4px 0 4px;border-radius:5px;", h.BROADCAST = "color:navy;background-color:orange;padding:0 4px 0 4px;border-radius:5px;", h.CLOUD = "color:purple;background-color:mistyrose;padding:0 4px 0 4px;border-radius:5px;", h.DATA = "color:grey;background-color:lightskyblue;padding:0 4px 0 4px;border-radius:5px;", h.ERROR = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", h.GET_DATA = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", h.HIDE = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", h.KO = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", h.MESSAGES = "color:white;background-color:darkslateblue;padding:0 4px 0 4px;border-radius:5px;", h.NO_UPDATES = "color:grey;border:1px solid grey;padding:0 4px 0 4px;border-radius:5px;", h.NONE = "color:transparent;background-color:transparent;", h.OK = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", h.PRESENTATION = "color:white;background-color:darkred;padding:0 4px 0 4px;border-radius:5px;", h.SERIES = "color:purple;background-color:thistle;padding:0 4px 0 4px;border-radius:5px;", h.SLIDE = "color:black;background-color:yellow;padding:0 4px 0 4px;border-radius:5px;", h.STORAGE = "color:black;background-color:cyan;padding:0 4px 0 4px;border-radius:5px;", h.SUBSCRIBE = "color:white;background-color:dodgerblue;padding:0 4px 0 4px;border-radius:5px;", h.WIDGET = "color:gret;background-color:lemonchiffon;padding:0 4px 0 4px;border-radius:5px;", h.WS = "color:white;background-color:green;padding:0 4px 0 4px;border-radius:5px;", h))(c || {}), X = /* @__PURE__ */ ((h) => (h.ADD_SLIDE = "addSlide", h.APP_READY = "appReady", h.API_UPDATE = "apiUpdate", h.WS_API_REQUEST = "wsApiRequest", h.WS_API_RESPONSE = "wsApiResponse", h.WS_API_UPDATE = "wsApiRUpdate", h.APPROVE_MESSAGE = "approveMessage", h.CHANNEL = "channel", h.CLEAN_MESSAGES = "cleanMessages", h.CLOSE_BUILDER_DIALOG = "closeBuilderDialog", h.CLOSE_BUILDER_MODAL = "closeBuilderModal", h.CLOSE_MODAL = "closeModal", h.CSS_SET = "setCss", h.CSS_STORE = "storeCss", h.DASHBOARD_LOAD = "loadDashboard", h.DASHBOARD_STORE = "storeDashboard", h.ERROR = "error", h.HIDE_MESSAGE = "hideMessage", h.HIDE_LABELS = "hideLabels", h.IMAGE_GET = "getImage", h.IMAGE_SET = "setImage", h.LAUPPUT_UPDATE = "layoutUpdate", h.PREV_SLIDE = "prevSlide", h.RELOAD_PRESENTATION = "reloadPresentation", h.STAR_MESSAGE = "starMessage", h.GOTO_SLIDE = "gotoSlide", h.NEXT_SLIDE = "nextSlide", h.PREFERENCE_LOAD = "loadPreference", h.PREFERENCE_STORE = "storePreference", h.PAUSE_PRESENTATION = "pausePresentation", h.PRESENTATION_READY = "presentationReady", h.PRESENTATION_LOAD = "loadPresentation", h.PRESENTATION_STORE = "storePresentation", h.SHOW_BUILDER_DIALOG = "showBuilderDialog", h.SHOW_BUILDER_MODAL = "showBuilderModal", h.SHOW_MODAL = "showModal", h.SLIDE_DID_LOAD = "slideDidLoad", h.SLIDE_GET = "getSlide", h.SLIDE_GOTO = "slideGoto", h.SLIDE_LOAD = "loadSlide", h.SLIDE_READY = "slideReady", h.SLIDE_SET = "setSlide", h.SLIDE_STORE = "storeSlide", h.SLIDE_TRANSITIONER = "slideTransitioner", h.START_TRANSITIONER = "startTransitioner", h.STORAGE_INIT = "storageInit", h.SUBSCRIBE = "subscribe", h.SUSPEND_ACCOUNT = "suspendAccount", h.SWITCH_PRESENTATION = "switchPresentation", h.REMOVE_CLOUD = "removeCloud", h.UPDATE = "update", h.VERSION = "version", h.WIDGETS_CLEAR = "widgetsClear", h.WIDGET_LOAD = "widgetLoad", h.WIDGET_STORE = "widgetStore", h.WIDGET_UPDATE = "widgetUpdate", h))(X || {}), en = /* @__PURE__ */ ((h) => (h.APPROVED = "approved", h.BEFORE = "before", h.DELAYED = "delayed", h.NONE = "none", h.REALTIME = "realtime", h))(en || {}), he = /* @__PURE__ */ ((h) => (h.KEYVAL = "keyval", h.LOCAL = "local", h.SESSION = "session", h.DEXIE = "dexie", h.WINDOW = "window", h))(he || {});
|
|
1
|
+
var _ = /* @__PURE__ */ ((h) => (h.CLOUD = "cloud", h.DASHBOARD = "dashboard", h.DASHBOARDS = "dashboards", h.IMAGES = "images", h.MESSAGES = "messages", h.PREFERENCE = "preference", h.PREFERENCES = "preferences", h.PRESENTATION = "presentation", h.PRESENTATIONS = "presentations", h.SERIES = "series", h.SLIDE = "slide", h.SLIDES = "slides", h.TOPICS = "topics", h.WIDGET = "widget", h.WIDGETS = "widgets", h))(_ || {}), c = /* @__PURE__ */ ((h) => (h.API = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;", h.APP = "color:white;background-color:navy;padding:0 4px 0 4px;border-radius:5px;", h.BROADCAST = "color:navy;background-color:orange;padding:0 4px 0 4px;border-radius:5px;", h.CLOUD = "color:purple;background-color:mistyrose;padding:0 4px 0 4px;border-radius:5px;", h.DATA = "color:grey;background-color:lightskyblue;padding:0 4px 0 4px;border-radius:5px;", h.ERROR = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", h.GET_DATA = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", h.HIDE = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", h.KO = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", h.MESSAGES = "color:white;background-color:darkslateblue;padding:0 4px 0 4px;border-radius:5px;", h.NO_UPDATES = "color:grey;border:1px solid grey;padding:0 4px 0 4px;border-radius:5px;", h.NONE = "color:transparent;background-color:transparent;", h.OK = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", h.PRESENTATION = "color:white;background-color:darkred;padding:0 4px 0 4px;border-radius:5px;", h.SERIES = "color:purple;background-color:thistle;padding:0 4px 0 4px;border-radius:5px;", h.SLIDE = "color:black;background-color:yellow;padding:0 4px 0 4px;border-radius:5px;", h.STORAGE = "color:black;background-color:cyan;padding:0 4px 0 4px;border-radius:5px;", h.SUBSCRIBE = "color:white;background-color:dodgerblue;padding:0 4px 0 4px;border-radius:5px;", h.WIDGET = "color:gret;background-color:lemonchiffon;padding:0 4px 0 4px;border-radius:5px;", h.WS = "color:white;background-color:green;padding:0 4px 0 4px;border-radius:5px;", h))(c || {}), X = /* @__PURE__ */ ((h) => (h.ADD_SLIDE = "addSlide", h.APP_READY = "appReady", h.API_UPDATE = "apiUpdate", h.WS_API_REQUEST = "wsApiRequest", h.WS_API_RESPONSE = "wsApiResponse", h.WS_API_UPDATE = "wsApiRUpdate", h.APPROVE_MESSAGE = "approveMessage", h.CHANNEL = "channel", h.CLEAN_MESSAGES = "cleanMessages", h.CLOSE_BUILDER_DIALOG = "closeBuilderDialog", h.CLOSE_BUILDER_MODAL = "closeBuilderModal", h.CLOSE_MODAL = "closeModal", h.CSS_SET = "setCss", h.CSS_STORE = "storeCss", h.DASHBOARD_LOAD = "loadDashboard", h.DASHBOARD_STORE = "storeDashboard", h.ERROR = "error", h.HIDE_MESSAGE = "hideMessage", h.HIDE_LABELS = "hideLabels", h.IMAGE_GET = "getImage", h.IMAGE_SET = "setImage", h.IMAGE_STORED = "imageStored", h.LAUPPUT_UPDATE = "layoutUpdate", h.PREV_SLIDE = "prevSlide", h.RELOAD_PRESENTATION = "reloadPresentation", h.STAR_MESSAGE = "starMessage", h.GOTO_SLIDE = "gotoSlide", h.NEXT_SLIDE = "nextSlide", h.PREFERENCE_LOAD = "loadPreference", h.PREFERENCE_STORE = "storePreference", h.PAUSE_PRESENTATION = "pausePresentation", h.PRESENTATION_READY = "presentationReady", h.PRESENTATION_LOAD = "loadPresentation", h.PRESENTATION_STORE = "storePresentation", h.SCREENSHOT_TAKE = "takeScreenshot", h.SCREENSHOT_STORE = "storeScreenshot", h.SECTION_UPDATE = "sectionUpdate", h.SHOW_BUILDER_DIALOG = "showBuilderDialog", h.SHOW_BUILDER_MODAL = "showBuilderModal", h.SHOW_MODAL = "showModal", h.SLIDE_DID_LOAD = "slideDidLoad", h.SLIDE_GET = "getSlide", h.SLIDE_GOTO = "slideGoto", h.SLIDE_LOAD = "loadSlide", h.SLIDE_READY = "slideReady", h.SLIDE_SAVED = "slideSaved", h.SLIDE_SET = "setSlide", h.SLIDE_STORE = "storeSlide", h.SLIDE_STORED = "slideStored", h.SLIDE_TRANSITIONER = "slideTransitioner", h.START_TRANSITIONER = "startTransitioner", h.STORAGE_INIT = "storageInit", h.SUBSCRIBE = "subscribe", h.SUSPEND_ACCOUNT = "suspendAccount", h.SWITCH_PRESENTATION = "switchPresentation", h.REMOVE_CLOUD = "removeCloud", h.UPDATE = "update", h.UPLOAD_COMPLETED = "uploadCompleted", h.VERSION = "version", h.WIDGETS_CLEAR = "widgetsClear", h.WIDGET_LOAD = "widgetLoad", h.WIDGET_STORE = "widgetStore", h.WIDGET_UPDATE = "widgetUpdate", h))(X || {}), en = /* @__PURE__ */ ((h) => (h.APPROVED = "approved", h.BEFORE = "before", h.DELAYED = "delayed", h.NONE = "none", h.REALTIME = "realtime", h))(en || {}), he = /* @__PURE__ */ ((h) => (h.KEYVAL = "keyval", h.LOCAL = "local", h.SESSION = "session", h.DEXIE = "dexie", h.WINDOW = "window", h))(he || {});
|
|
2
2
|
function Pa(h) {
|
|
3
3
|
const t = {};
|
|
4
4
|
for (let o = 0; o < h.length; o++) {
|
|
@@ -17,39 +17,39 @@ function Ia(h, t) {
|
|
|
17
17
|
return h;
|
|
18
18
|
}
|
|
19
19
|
function Oe(h, t) {
|
|
20
|
-
let o, l,
|
|
20
|
+
let o, l, g;
|
|
21
21
|
if (t.length === 0)
|
|
22
22
|
return h;
|
|
23
|
-
for (o = 0,
|
|
23
|
+
for (o = 0, g = t.length; o < g; o++)
|
|
24
24
|
l = t.charCodeAt(o), h = (h << 5) - h + l, h |= 0;
|
|
25
25
|
return h < 0 ? h * -2 : h;
|
|
26
26
|
}
|
|
27
27
|
function Na(h, t, o) {
|
|
28
28
|
return Object.keys(t).sort().reduce(l, h);
|
|
29
|
-
function l(
|
|
30
|
-
return jr(
|
|
29
|
+
function l(g, v) {
|
|
30
|
+
return jr(g, t[v], v, o);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
function jr(h, t, o, l) {
|
|
34
|
-
const
|
|
34
|
+
const g = Oe(Oe(Oe(h, o), Ra(t)), typeof t);
|
|
35
35
|
if (t === null)
|
|
36
|
-
return Oe(
|
|
36
|
+
return Oe(g, "null");
|
|
37
37
|
if (t === void 0)
|
|
38
|
-
return Oe(
|
|
38
|
+
return Oe(g, "undefined");
|
|
39
39
|
if (typeof t == "object" || typeof t == "function") {
|
|
40
40
|
if (l.includes(t))
|
|
41
|
-
return Oe(
|
|
41
|
+
return Oe(g, `[Circular]${o}`);
|
|
42
42
|
l.push(t);
|
|
43
|
-
const
|
|
43
|
+
const v = Na(g, t, l);
|
|
44
44
|
if (!("valueOf" in t) || typeof t.valueOf != "function")
|
|
45
|
-
return
|
|
45
|
+
return v;
|
|
46
46
|
try {
|
|
47
|
-
return Oe(
|
|
48
|
-
} catch (
|
|
49
|
-
return Oe(
|
|
47
|
+
return Oe(v, String(t.valueOf()));
|
|
48
|
+
} catch (T) {
|
|
49
|
+
return Oe(v, `[valueOf exception]${T.stack || T.message}`);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
return Oe(
|
|
52
|
+
return Oe(g, t.toString());
|
|
53
53
|
}
|
|
54
54
|
function Ra(h) {
|
|
55
55
|
return Object.prototype.toString.call(h);
|
|
@@ -117,10 +117,10 @@ function Ta(h) {
|
|
|
117
117
|
}
|
|
118
118
|
function Ot(h, t) {
|
|
119
119
|
var o;
|
|
120
|
-
let l,
|
|
120
|
+
let l, g, v, T, K;
|
|
121
121
|
switch (h.moderation) {
|
|
122
122
|
case en.BEFORE:
|
|
123
|
-
l = /* @__PURE__ */ new Date(),
|
|
123
|
+
l = /* @__PURE__ */ new Date(), g = (o = h.beforeTime) == null ? void 0 : o.split(":"), v = Number.parseInt(g ? g[0] : "00"), T = Number.parseInt(g ? g[1] : "00"), K = Number.parseInt(g ? g[2] : "00"), t.before = l.setHours(v, T, K, 0) / 1e3, t.period || (t.period = l.getDay() === 1 ? 72 : 24);
|
|
124
124
|
break;
|
|
125
125
|
case en.DELAYED:
|
|
126
126
|
h.delay && h.delay > 0 && (t.delay = `${h.delay}`);
|
|
@@ -133,7 +133,7 @@ function Ot(h, t) {
|
|
|
133
133
|
}
|
|
134
134
|
return t;
|
|
135
135
|
}
|
|
136
|
-
const xa = "3.
|
|
136
|
+
const xa = "3.12.0";
|
|
137
137
|
class ka {
|
|
138
138
|
options;
|
|
139
139
|
url;
|
|
@@ -171,19 +171,19 @@ class ka {
|
|
|
171
171
|
};
|
|
172
172
|
};
|
|
173
173
|
async get(t) {
|
|
174
|
-
const { version: o } = this.options, l = this.headers(),
|
|
175
|
-
delete
|
|
176
|
-
const
|
|
177
|
-
let
|
|
174
|
+
const { version: o } = this.options, l = this.headers(), g = Object.assign({}, t);
|
|
175
|
+
delete g.type, delete g.hash, delete g.order, g.topics = `${g.dashboard}-${g.widget}`, delete g.presentation;
|
|
176
|
+
const v = Object.keys(g).length > 0 ? `?${new URLSearchParams(g).toString()}` : "";
|
|
177
|
+
let T = "";
|
|
178
178
|
switch (t.type) {
|
|
179
179
|
case _.MESSAGES:
|
|
180
|
-
|
|
180
|
+
T = c.MESSAGES;
|
|
181
181
|
break;
|
|
182
182
|
case _.SERIES:
|
|
183
|
-
|
|
183
|
+
T = c.SERIES;
|
|
184
184
|
break;
|
|
185
185
|
case _.CLOUD:
|
|
186
|
-
|
|
186
|
+
T = c.CLOUD;
|
|
187
187
|
break;
|
|
188
188
|
}
|
|
189
189
|
return G(3, [
|
|
@@ -192,10 +192,10 @@ class ka {
|
|
|
192
192
|
c.NONE,
|
|
193
193
|
c.API,
|
|
194
194
|
c.NONE,
|
|
195
|
-
|
|
195
|
+
T,
|
|
196
196
|
t.widget
|
|
197
|
-
]), G(4, [t.type,
|
|
198
|
-
[this.url, "api", o, t.type].join("/") +
|
|
197
|
+
]), G(4, [t.type, g]), await fetch(
|
|
198
|
+
[this.url, "api", o, t.type].join("/") + v,
|
|
199
199
|
{ ...l, method: "get" }
|
|
200
200
|
).then(async (K) => {
|
|
201
201
|
if (!K.ok)
|
|
@@ -204,7 +204,7 @@ class ka {
|
|
|
204
204
|
}).then((K) => K.json()).then((K) => (K.query = t, K)).catch((K) => ({ success: !1, message: `${K}`, data: null, query: t }));
|
|
205
205
|
}
|
|
206
206
|
async hideMessage(t) {
|
|
207
|
-
const { version: o } = this.options, l = this.headers(),
|
|
207
|
+
const { version: o } = this.options, l = this.headers(), g = "?action=visible";
|
|
208
208
|
return console.info(
|
|
209
209
|
"%capi%c %cput",
|
|
210
210
|
c.API,
|
|
@@ -214,18 +214,18 @@ class ka {
|
|
|
214
214
|
t.widget,
|
|
215
215
|
t.id
|
|
216
216
|
), await fetch(
|
|
217
|
-
[this.url, "api", o, "messages", t.id].join("/") +
|
|
217
|
+
[this.url, "api", o, "messages", t.id].join("/") + g,
|
|
218
218
|
{ ...l, method: "put" }
|
|
219
|
-
).then((
|
|
220
|
-
if (!
|
|
221
|
-
throw new Error(
|
|
222
|
-
return
|
|
223
|
-
}).then((
|
|
219
|
+
).then((v) => {
|
|
220
|
+
if (!v.ok)
|
|
221
|
+
throw new Error(v.statusText);
|
|
222
|
+
return v;
|
|
223
|
+
}).then((v) => v.json()).catch((v) => ({ succes: !1, message: v, data: [] }));
|
|
224
224
|
}
|
|
225
225
|
async hideLabels(t) {
|
|
226
|
-
const { version: o } = this.options, l = this.formHeaders(),
|
|
227
|
-
for (const [
|
|
228
|
-
|
|
226
|
+
const { version: o } = this.options, l = this.formHeaders(), g = new URLSearchParams(), v = t.labels || [];
|
|
227
|
+
for (const [T, K] of v.entries())
|
|
228
|
+
g.append(`custom_filters[${T}]`, K);
|
|
229
229
|
return console.info(
|
|
230
230
|
"%capi%c %cput",
|
|
231
231
|
c.API,
|
|
@@ -233,26 +233,26 @@ class ka {
|
|
|
233
233
|
c.GET_DATA,
|
|
234
234
|
X.HIDE_LABELS,
|
|
235
235
|
t.widget,
|
|
236
|
-
|
|
236
|
+
v
|
|
237
237
|
), await fetch(
|
|
238
238
|
[this.url, "api", o, t.type, t.widget].join("/"),
|
|
239
|
-
{ ...l, body:
|
|
240
|
-
).then((
|
|
241
|
-
if (!
|
|
242
|
-
throw new Error(
|
|
243
|
-
return
|
|
244
|
-
}).then((
|
|
239
|
+
{ ...l, body: g, method: "put" }
|
|
240
|
+
).then((T) => {
|
|
241
|
+
if (!T.ok)
|
|
242
|
+
throw new Error(T.statusText);
|
|
243
|
+
return T;
|
|
244
|
+
}).then((T) => T.json()).catch((T) => ({ succes: !1, message: T, data: [] }));
|
|
245
245
|
}
|
|
246
246
|
async loadSlide(t) {
|
|
247
|
-
const { version: o } = this.options, l = this.headers(),
|
|
248
|
-
return delete
|
|
247
|
+
const { version: o } = this.options, l = this.headers(), g = Object.assign({}, t);
|
|
248
|
+
return delete g.type, delete g.hash, G(3, ["%capi%c %cloadSlide", c.API, c.NONE, c.SLIDE, t.id]), await fetch(
|
|
249
249
|
[this.url, "api", o, "slides", t.id].join("/"),
|
|
250
250
|
{ ...l, method: "get" }
|
|
251
|
-
).then(async (
|
|
252
|
-
if (!
|
|
253
|
-
throw new Error(`${
|
|
254
|
-
return
|
|
255
|
-
}).then((
|
|
251
|
+
).then(async (v) => {
|
|
252
|
+
if (!v.ok)
|
|
253
|
+
throw new Error(`${v.status}`);
|
|
254
|
+
return v;
|
|
255
|
+
}).then((v) => v.json()).then((v) => (v.query = t, v.data && v.data.json && (v.data.json = JSON.parse(v.data.json)), v)).catch((v) => ({ success: !1, message: `${v}`, data: null }));
|
|
256
256
|
}
|
|
257
257
|
/**
|
|
258
258
|
* Store slide definition
|
|
@@ -264,7 +264,7 @@ class ka {
|
|
|
264
264
|
async storeSlide(t) {
|
|
265
265
|
const { version: o } = this.options, l = this.formHeaders();
|
|
266
266
|
delete t.update, delete t.type;
|
|
267
|
-
const
|
|
267
|
+
const g = JSON.stringify(t);
|
|
268
268
|
return G(3, [
|
|
269
269
|
"%cput%c %capi%c %cslide",
|
|
270
270
|
c.OK,
|
|
@@ -276,12 +276,12 @@ class ka {
|
|
|
276
276
|
t.id
|
|
277
277
|
]), await fetch(
|
|
278
278
|
[this.url, "api", o, "slides", t.id].join("/"),
|
|
279
|
-
{ ...l, body:
|
|
280
|
-
).then((
|
|
281
|
-
if (!
|
|
282
|
-
throw new Error(
|
|
283
|
-
return
|
|
284
|
-
}).then((
|
|
279
|
+
{ ...l, body: g, method: "put" }
|
|
280
|
+
).then((v) => {
|
|
281
|
+
if (!v.ok)
|
|
282
|
+
throw new Error(v.statusText);
|
|
283
|
+
return v;
|
|
284
|
+
}).then((v) => v.json()).catch((v) => ({ succes: !1, message: v, data: [] }));
|
|
285
285
|
}
|
|
286
286
|
async loadPresentation(t) {
|
|
287
287
|
const { version: o } = this.options, l = this.headers();
|
|
@@ -296,11 +296,11 @@ class ka {
|
|
|
296
296
|
]), await fetch(
|
|
297
297
|
[this.url, "api", o, _.PRESENTATIONS, t.id].join("/"),
|
|
298
298
|
{ ...l, method: "get" }
|
|
299
|
-
).then(async (
|
|
300
|
-
if (!
|
|
301
|
-
throw new Error(`${
|
|
302
|
-
return
|
|
303
|
-
}).then((
|
|
299
|
+
).then(async (g) => {
|
|
300
|
+
if (!g.ok)
|
|
301
|
+
throw new Error(`${g.status}`);
|
|
302
|
+
return g;
|
|
303
|
+
}).then((g) => g.json()).then((g) => (g.query = t, g)).catch((g) => ({ success: !1, message: `${g}`, data: null }));
|
|
304
304
|
}
|
|
305
305
|
/**
|
|
306
306
|
* Store slide definition
|
|
@@ -312,15 +312,15 @@ class ka {
|
|
|
312
312
|
async storePresentation(t) {
|
|
313
313
|
const { version: o } = this.options, l = this.formHeaders();
|
|
314
314
|
delete t.update;
|
|
315
|
-
const
|
|
315
|
+
const g = JSON.stringify(t);
|
|
316
316
|
return G(2, ["%capi%c %cput", c.API, c.NONE, c.PRESENTATION, t.name]), await fetch(
|
|
317
317
|
[this.url, "api", o, _.PRESENTATIONS, t.id].join("/"),
|
|
318
|
-
{ ...l, body:
|
|
319
|
-
).then((
|
|
320
|
-
if (!
|
|
321
|
-
throw new Error(
|
|
322
|
-
return
|
|
323
|
-
}).then((
|
|
318
|
+
{ ...l, body: g, method: "put" }
|
|
319
|
+
).then((v) => {
|
|
320
|
+
if (!v.ok)
|
|
321
|
+
throw new Error(v.statusText);
|
|
322
|
+
return v;
|
|
323
|
+
}).then((v) => v.json()).catch((v) => ({ succes: !1, message: v, data: [] }));
|
|
324
324
|
}
|
|
325
325
|
async loadPreference(t) {
|
|
326
326
|
const { version: o } = this.options, l = this.headers();
|
|
@@ -333,16 +333,16 @@ class ka {
|
|
|
333
333
|
]), await fetch(
|
|
334
334
|
[this.url, "api", o, _.PREFERENCES, t.id].join("/"),
|
|
335
335
|
{ ...l, method: "get" }
|
|
336
|
-
).then(async (
|
|
337
|
-
if (!
|
|
338
|
-
throw new Error(`${
|
|
339
|
-
return
|
|
340
|
-
}).then((
|
|
336
|
+
).then(async (g) => {
|
|
337
|
+
if (!g.ok)
|
|
338
|
+
throw new Error(`${g.status}`);
|
|
339
|
+
return g;
|
|
340
|
+
}).then((g) => g.json()).then((g) => g).catch((g) => ({ success: !1, message: `${g}`, data: null }));
|
|
341
341
|
}
|
|
342
342
|
async storePreference(t) {
|
|
343
343
|
const { version: o } = this.options, l = this.formHeaders();
|
|
344
344
|
delete t.update;
|
|
345
|
-
const
|
|
345
|
+
const g = JSON.stringify({ data: t });
|
|
346
346
|
return console.info(
|
|
347
347
|
"%capi%c %cstorePreference",
|
|
348
348
|
c.API,
|
|
@@ -351,12 +351,12 @@ class ka {
|
|
|
351
351
|
t.id
|
|
352
352
|
), await fetch(
|
|
353
353
|
[this.url, "api", o, _.PREFERENCES, t.id].join("/"),
|
|
354
|
-
{ ...l, body:
|
|
355
|
-
).then((
|
|
356
|
-
if (!
|
|
357
|
-
throw new Error(
|
|
358
|
-
return
|
|
359
|
-
}).then((
|
|
354
|
+
{ ...l, body: g, method: "put" }
|
|
355
|
+
).then((v) => {
|
|
356
|
+
if (!v.ok)
|
|
357
|
+
throw new Error(v.statusText);
|
|
358
|
+
return v;
|
|
359
|
+
}).then((v) => v.json()).catch((v) => ({ succes: !1, message: v, data: [] }));
|
|
360
360
|
}
|
|
361
361
|
/*public async loadDashboardWidgets(query: IQuery): Promise<any> {
|
|
362
362
|
if (query?.dashboard === undefined)
|
|
@@ -403,64 +403,77 @@ class ka {
|
|
|
403
403
|
...l,
|
|
404
404
|
method: "get"
|
|
405
405
|
}
|
|
406
|
-
).then(async (
|
|
407
|
-
if (!
|
|
408
|
-
throw new Error(`${
|
|
409
|
-
return
|
|
410
|
-
}).then((
|
|
411
|
-
data: { dashboards:
|
|
406
|
+
).then(async (g) => {
|
|
407
|
+
if (!g.ok)
|
|
408
|
+
throw new Error(`${g.status}`);
|
|
409
|
+
return g;
|
|
410
|
+
}).then((g) => g.json()).then((g) => ({
|
|
411
|
+
data: { dashboards: g },
|
|
412
412
|
message: "Dashboard Widgets loaded from api",
|
|
413
413
|
success: !0
|
|
414
|
-
})).catch((
|
|
414
|
+
})).catch((g) => ({ success: !1, message: `${g}`, data: null }));
|
|
415
415
|
}
|
|
416
|
-
async loadImages() {
|
|
417
|
-
const { version:
|
|
418
|
-
return console.info("%capi%c %cloadImage", c.API, c.NONE, c.WIDGET), await fetch(
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
416
|
+
async loadImages(t) {
|
|
417
|
+
const { version: o } = this.options, l = this.headers();
|
|
418
|
+
return console.info("%capi%c %cloadImage", c.API, c.NONE, c.WIDGET), await fetch(
|
|
419
|
+
`${[this.url, "api", o, _.IMAGES].join(
|
|
420
|
+
"/"
|
|
421
|
+
)}?folder=${t}`,
|
|
422
|
+
{
|
|
423
|
+
...l,
|
|
424
|
+
method: "get"
|
|
425
|
+
}
|
|
426
|
+
).then(async (g) => {
|
|
427
|
+
if (!g.ok)
|
|
428
|
+
throw new Error(`${g.status}`);
|
|
429
|
+
return g;
|
|
430
|
+
}).then((g) => g.json()).then((g) => ({
|
|
431
|
+
data: { images: g.data },
|
|
427
432
|
message: "Images loaded via api",
|
|
428
433
|
success: !0
|
|
429
|
-
})).catch((
|
|
434
|
+
})).catch((g) => ({ success: !1, message: `${g}`, data: null }));
|
|
430
435
|
}
|
|
431
|
-
async storeImage(t) {
|
|
432
|
-
const { version:
|
|
436
|
+
async storeImage(t, o) {
|
|
437
|
+
const { version: l } = this.options, g = this.fileHeaders(), v = o;
|
|
433
438
|
return console.info(
|
|
434
439
|
"%capi%c %cstoreImage",
|
|
435
440
|
c.API,
|
|
436
441
|
c.NONE,
|
|
437
442
|
c.WIDGET,
|
|
438
|
-
|
|
443
|
+
o.get("name")
|
|
439
444
|
), await fetch(
|
|
440
|
-
[this.url, "api",
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
445
|
+
`${[this.url, "api", l, _.IMAGES].join(
|
|
446
|
+
"/"
|
|
447
|
+
)}?folder=${t}`,
|
|
448
|
+
{
|
|
449
|
+
...g,
|
|
450
|
+
body: v,
|
|
451
|
+
method: "post"
|
|
452
|
+
}
|
|
453
|
+
).then((T) => {
|
|
454
|
+
if (!T.ok)
|
|
455
|
+
throw new Error(T.statusText);
|
|
456
|
+
return T;
|
|
457
|
+
}).then((T) => T.json()).catch((T) => ({ succes: !1, message: T, data: [] }));
|
|
447
458
|
}
|
|
448
|
-
async deleteImage(t) {
|
|
449
|
-
const { version:
|
|
459
|
+
async deleteImage(t, o) {
|
|
460
|
+
const { version: l } = this.options, g = this.formHeaders();
|
|
450
461
|
return console.info(
|
|
451
462
|
"%capi%c %cdeleteImage",
|
|
452
463
|
c.API,
|
|
453
464
|
c.NONE,
|
|
454
465
|
c.WIDGET,
|
|
455
|
-
|
|
466
|
+
o
|
|
456
467
|
), await fetch(
|
|
457
|
-
[this.url, "api",
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
468
|
+
`${[this.url, "api", l, _.IMAGES, o].join(
|
|
469
|
+
"/"
|
|
470
|
+
)}?folder=${t}`,
|
|
471
|
+
{ ...g, method: "delete" }
|
|
472
|
+
).then((v) => {
|
|
473
|
+
if (!v.ok)
|
|
474
|
+
throw new Error(v.statusText);
|
|
475
|
+
return v;
|
|
476
|
+
}).then((v) => v.json()).catch((v) => ({ succes: !1, message: v, data: [] }));
|
|
464
477
|
}
|
|
465
478
|
}
|
|
466
479
|
var Ca = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
@@ -485,23 +498,23 @@ function Ma() {
|
|
|
485
498
|
return e;
|
|
486
499
|
}).apply(this, arguments);
|
|
487
500
|
};
|
|
488
|
-
function
|
|
501
|
+
function g(e, n, r) {
|
|
489
502
|
for (var a, s = 0, i = n.length; s < i; s++) !a && s in n || ((a = a || Array.prototype.slice.call(n, 0, s))[s] = n[s]);
|
|
490
503
|
return e.concat(a || Array.prototype.slice.call(n));
|
|
491
504
|
}
|
|
492
|
-
var
|
|
505
|
+
var v = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Ca, T = Object.keys, K = Array.isArray;
|
|
493
506
|
function te(e, n) {
|
|
494
|
-
return typeof n != "object" ||
|
|
507
|
+
return typeof n != "object" || T(n).forEach(function(r) {
|
|
495
508
|
e[r] = n[r];
|
|
496
509
|
}), e;
|
|
497
510
|
}
|
|
498
|
-
typeof Promise > "u" ||
|
|
511
|
+
typeof Promise > "u" || v.Promise || (v.Promise = Promise);
|
|
499
512
|
var ge = Object.getPrototypeOf, Ce = {}.hasOwnProperty;
|
|
500
513
|
function ie(e, n) {
|
|
501
514
|
return Ce.call(e, n);
|
|
502
515
|
}
|
|
503
516
|
function be(e, n) {
|
|
504
|
-
typeof n == "function" && (n = n(ge(e))), (typeof Reflect > "u" ?
|
|
517
|
+
typeof n == "function" && (n = n(ge(e))), (typeof Reflect > "u" ? T : Reflect.ownKeys)(n).forEach(function(r) {
|
|
505
518
|
Ae(e, r, n[r]);
|
|
506
519
|
});
|
|
507
520
|
}
|
|
@@ -525,7 +538,7 @@ function Ma() {
|
|
|
525
538
|
if (!e) throw new Error("Assertion Failed");
|
|
526
539
|
}
|
|
527
540
|
function Yn(e) {
|
|
528
|
-
|
|
541
|
+
v.setImmediate ? setImmediate(e) : setTimeout(e, 0);
|
|
529
542
|
}
|
|
530
543
|
function ve(e, n) {
|
|
531
544
|
if (typeof n == "string" && ie(e, n)) return e[n];
|
|
@@ -566,9 +579,9 @@ function Ma() {
|
|
|
566
579
|
return n + e + "Array";
|
|
567
580
|
});
|
|
568
581
|
}))).filter(function(e) {
|
|
569
|
-
return
|
|
582
|
+
return v[e];
|
|
570
583
|
}), Jn = new Set(Ge.map(function(e) {
|
|
571
|
-
return
|
|
584
|
+
return v[e];
|
|
572
585
|
})), it = null;
|
|
573
586
|
function $e(e) {
|
|
574
587
|
return it = /* @__PURE__ */ new WeakMap(), e = function n(r) {
|
|
@@ -744,8 +757,8 @@ function Ma() {
|
|
|
744
757
|
if (a._state === null) {
|
|
745
758
|
if (i === a) throw new TypeError("A promise cannot be resolved with itself.");
|
|
746
759
|
var u = a._lib && Ze();
|
|
747
|
-
i && typeof i.then == "function" ? r(a, function(d,
|
|
748
|
-
i instanceof j ? i._then(d,
|
|
760
|
+
i && typeof i.then == "function" ? r(a, function(d, p) {
|
|
761
|
+
i instanceof j ? i._then(d, p) : i.then(d, p);
|
|
749
762
|
}) : (a._state = !0, a._value = i, rr(a)), u && qe();
|
|
750
763
|
}
|
|
751
764
|
}, fn.bind(null, a));
|
|
@@ -757,10 +770,10 @@ function Ma() {
|
|
|
757
770
|
var dn = { get: function() {
|
|
758
771
|
var e = B, n = Ct;
|
|
759
772
|
function r(a, s) {
|
|
760
|
-
var i = this, u = !e.global && (e !== B || n !== Ct), d = u && !Ie(),
|
|
773
|
+
var i = this, u = !e.global && (e !== B || n !== Ct), d = u && !Ie(), p = new j(function(y, w) {
|
|
761
774
|
hn(i, new nr(sr(a, e, u, d), sr(s, e, u, d), y, w, e));
|
|
762
775
|
});
|
|
763
|
-
return this._consoleTask && (
|
|
776
|
+
return this._consoleTask && (p._consoleTask = this._consoleTask), p;
|
|
764
777
|
}
|
|
765
778
|
return r.prototype = ut, r;
|
|
766
779
|
}, set: function(e) {
|
|
@@ -918,9 +931,9 @@ function Ma() {
|
|
|
918
931
|
return De(function(s, i) {
|
|
919
932
|
var u = B;
|
|
920
933
|
u.unhandleds = [], u.onunhandled = i, u.finalize = Me(function() {
|
|
921
|
-
var d,
|
|
934
|
+
var d, p = this;
|
|
922
935
|
d = function() {
|
|
923
|
-
|
|
936
|
+
p.unhandleds.length === 0 ? s() : i(p.unhandleds[0]);
|
|
924
937
|
}, Rt.push(function y() {
|
|
925
938
|
d(), Rt.splice(Rt.indexOf(y), 1);
|
|
926
939
|
}), ++Le, dt(function() {
|
|
@@ -986,11 +999,11 @@ function Ma() {
|
|
|
986
999
|
var r, a = B;
|
|
987
1000
|
(n ? !ne.echoes || kt++ && e === B : !kt || --kt && e === B) || queueMicrotask(n ? function(s) {
|
|
988
1001
|
++Ct, ne.echoes && --ne.echoes != 0 || (ne.echoes = ne.awaits = ne.id = 0), xt.push(B), Ne(s, !0);
|
|
989
|
-
}.bind(null, e) : sa), e !== B && (B = e, a === Pe && (Pe.env = ar()), cn && (r = Pe.env.Promise, n = e.env, (a.global || e.global) && (Object.defineProperty(
|
|
1002
|
+
}.bind(null, e) : sa), e !== B && (B = e, a === Pe && (Pe.env = ar()), cn && (r = Pe.env.Promise, n = e.env, (a.global || e.global) && (Object.defineProperty(v, "Promise", n.PromiseProp), r.all = n.all, r.race = n.race, r.resolve = n.resolve, r.reject = n.reject, n.allSettled && (r.allSettled = n.allSettled), n.any && (r.any = n.any))));
|
|
990
1003
|
}
|
|
991
1004
|
function ar() {
|
|
992
|
-
var e =
|
|
993
|
-
return cn ? { Promise: e, PromiseProp: Object.getOwnPropertyDescriptor(
|
|
1005
|
+
var e = v.Promise;
|
|
1006
|
+
return cn ? { Promise: e, PromiseProp: Object.getOwnPropertyDescriptor(v, "Promise"), all: e.all, race: e.race, allSettled: e.allSettled, any: e.any, resolve: e.resolve, reject: e.reject } : {};
|
|
994
1007
|
}
|
|
995
1008
|
function We(e, n, r, a, s) {
|
|
996
1009
|
var i = B;
|
|
@@ -1043,12 +1056,12 @@ function Ma() {
|
|
|
1043
1056
|
return n < e ? 1 : e < n ? -1 : 0;
|
|
1044
1057
|
case "binary":
|
|
1045
1058
|
return function(s, i) {
|
|
1046
|
-
for (var u = s.length, d = i.length,
|
|
1059
|
+
for (var u = s.length, d = i.length, p = u < d ? u : d, y = 0; y < p; ++y) if (s[y] !== i[y]) return s[y] < i[y] ? -1 : 1;
|
|
1047
1060
|
return u === d ? 0 : u < d ? -1 : 1;
|
|
1048
1061
|
}(lr(e), lr(n));
|
|
1049
1062
|
case "Array":
|
|
1050
1063
|
return function(s, i) {
|
|
1051
|
-
for (var u = s.length, d = i.length,
|
|
1064
|
+
for (var u = s.length, d = i.length, p = u < d ? u : d, y = 0; y < p; ++y) {
|
|
1052
1065
|
var w = H(s[y], i[y]);
|
|
1053
1066
|
if (w !== 0) return w;
|
|
1054
1067
|
}
|
|
@@ -1074,28 +1087,28 @@ function Ma() {
|
|
|
1074
1087
|
}
|
|
1075
1088
|
var d = Ze();
|
|
1076
1089
|
try {
|
|
1077
|
-
var
|
|
1090
|
+
var p = a && a.db._novip === this.db._novip ? a === B.trans ? a._promise(e, u, r) : De(function() {
|
|
1078
1091
|
return a._promise(e, u, r);
|
|
1079
1092
|
}, { trans: a, transless: B.transless || B }) : function y(w, f, O, m) {
|
|
1080
1093
|
if (w.idbdb && (w._state.openComplete || B.letThrough || w._vip)) {
|
|
1081
|
-
var
|
|
1094
|
+
var E = w._createTransaction(f, O, w._dbSchema);
|
|
1082
1095
|
try {
|
|
1083
|
-
|
|
1096
|
+
E.create(), w._state.PR1398_maxLoop = 3;
|
|
1084
1097
|
} catch (S) {
|
|
1085
1098
|
return S.name === sn.InvalidState && w.isOpen() && 0 < --w._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), w.close({ disableAutoOpen: !1 }), w.open().then(function() {
|
|
1086
1099
|
return y(w, f, O, m);
|
|
1087
1100
|
})) : q(S);
|
|
1088
1101
|
}
|
|
1089
|
-
return
|
|
1102
|
+
return E._promise(f, function(S, b) {
|
|
1090
1103
|
return De(function() {
|
|
1091
|
-
return B.trans =
|
|
1104
|
+
return B.trans = E, m(S, b, E);
|
|
1092
1105
|
});
|
|
1093
1106
|
}).then(function(S) {
|
|
1094
1107
|
if (f === "readwrite") try {
|
|
1095
|
-
|
|
1108
|
+
E.idbtrans.commit();
|
|
1096
1109
|
} catch {
|
|
1097
1110
|
}
|
|
1098
|
-
return f === "readonly" ? S :
|
|
1111
|
+
return f === "readonly" ? S : E._completion.then(function() {
|
|
1099
1112
|
return S;
|
|
1100
1113
|
});
|
|
1101
1114
|
});
|
|
@@ -1109,9 +1122,9 @@ function Ma() {
|
|
|
1109
1122
|
return y(w, f, O, m);
|
|
1110
1123
|
});
|
|
1111
1124
|
}(this.db, e, [this.name], u);
|
|
1112
|
-
return i && (
|
|
1125
|
+
return i && (p._consoleTask = i, p = p.catch(function(y) {
|
|
1113
1126
|
return console.trace(y), q(y);
|
|
1114
|
-
})),
|
|
1127
|
+
})), p;
|
|
1115
1128
|
} finally {
|
|
1116
1129
|
d && qe();
|
|
1117
1130
|
}
|
|
@@ -1125,38 +1138,38 @@ function Ma() {
|
|
|
1125
1138
|
}, J.prototype.where = function(e) {
|
|
1126
1139
|
if (typeof e == "string") return new this.db.WhereClause(this, e);
|
|
1127
1140
|
if (K(e)) return new this.db.WhereClause(this, "[".concat(e.join("+"), "]"));
|
|
1128
|
-
var n =
|
|
1141
|
+
var n = T(e);
|
|
1129
1142
|
if (n.length === 1) return this.where(n[0]).equals(e[n[0]]);
|
|
1130
1143
|
var r = this.schema.indexes.concat(this.schema.primKey).filter(function(d) {
|
|
1131
1144
|
if (d.compound && n.every(function(y) {
|
|
1132
1145
|
return 0 <= d.keyPath.indexOf(y);
|
|
1133
1146
|
})) {
|
|
1134
|
-
for (var
|
|
1147
|
+
for (var p = 0; p < n.length; ++p) if (n.indexOf(d.keyPath[p]) === -1) return !1;
|
|
1135
1148
|
return !0;
|
|
1136
1149
|
}
|
|
1137
1150
|
return !1;
|
|
1138
|
-
}).sort(function(d,
|
|
1139
|
-
return d.keyPath.length -
|
|
1151
|
+
}).sort(function(d, p) {
|
|
1152
|
+
return d.keyPath.length - p.keyPath.length;
|
|
1140
1153
|
})[0];
|
|
1141
1154
|
if (r && this.db._maxKey !== Fe) {
|
|
1142
1155
|
var i = r.keyPath.slice(0, n.length);
|
|
1143
|
-
return this.where(i).equals(i.map(function(
|
|
1144
|
-
return e[
|
|
1156
|
+
return this.where(i).equals(i.map(function(p) {
|
|
1157
|
+
return e[p];
|
|
1145
1158
|
}));
|
|
1146
1159
|
}
|
|
1147
1160
|
!r && pe && console.warn("The query ".concat(JSON.stringify(e), " on ").concat(this.name, " would benefit from a ") + "compound index [".concat(n.join("+"), "]"));
|
|
1148
1161
|
var a = this.schema.idxByName;
|
|
1149
|
-
function s(d,
|
|
1150
|
-
return H(d,
|
|
1162
|
+
function s(d, p) {
|
|
1163
|
+
return H(d, p) === 0;
|
|
1151
1164
|
}
|
|
1152
|
-
var u = n.reduce(function(f,
|
|
1153
|
-
var y = f[0], w = f[1], f = a[
|
|
1165
|
+
var u = n.reduce(function(f, p) {
|
|
1166
|
+
var y = f[0], w = f[1], f = a[p], O = e[p];
|
|
1154
1167
|
return [y || f, y || !f ? Ue(w, f && f.multi ? function(m) {
|
|
1155
|
-
return m = ve(m,
|
|
1156
|
-
return s(O,
|
|
1168
|
+
return m = ve(m, p), K(m) && m.some(function(E) {
|
|
1169
|
+
return s(O, E);
|
|
1157
1170
|
});
|
|
1158
1171
|
} : function(m) {
|
|
1159
|
-
return s(O, ve(m,
|
|
1172
|
+
return s(O, ve(m, p));
|
|
1160
1173
|
}) : w];
|
|
1161
1174
|
}, [null, null]), i = u[0], u = u[1];
|
|
1162
1175
|
return i ? this.where(i.name).equals(e[i.keyPath]).filter(u) : r ? this.filter(u) : this.where(n).equals("");
|
|
@@ -1183,25 +1196,25 @@ function Ma() {
|
|
|
1183
1196
|
function s() {
|
|
1184
1197
|
return n !== null && n.apply(this, arguments) || this;
|
|
1185
1198
|
}
|
|
1186
|
-
(this.schema.mappedClass = e).prototype instanceof cr && (function(
|
|
1199
|
+
(this.schema.mappedClass = e).prototype instanceof cr && (function(p, y) {
|
|
1187
1200
|
if (typeof y != "function" && y !== null) throw new TypeError("Class extends value " + String(y) + " is not a constructor or null");
|
|
1188
1201
|
function w() {
|
|
1189
|
-
this.constructor =
|
|
1202
|
+
this.constructor = p;
|
|
1190
1203
|
}
|
|
1191
|
-
o(
|
|
1204
|
+
o(p, y), p.prototype = y === null ? Object.create(y) : (w.prototype = y.prototype, new w());
|
|
1192
1205
|
}(s, n = e), Object.defineProperty(s.prototype, "db", { get: function() {
|
|
1193
1206
|
return r;
|
|
1194
1207
|
}, enumerable: !1, configurable: !0 }), s.prototype.table = function() {
|
|
1195
1208
|
return a;
|
|
1196
1209
|
}, e = s);
|
|
1197
|
-
for (var i = /* @__PURE__ */ new Set(), u = e.prototype; u; u = ge(u)) Object.getOwnPropertyNames(u).forEach(function(
|
|
1198
|
-
return i.add(
|
|
1210
|
+
for (var i = /* @__PURE__ */ new Set(), u = e.prototype; u; u = ge(u)) Object.getOwnPropertyNames(u).forEach(function(p) {
|
|
1211
|
+
return i.add(p);
|
|
1199
1212
|
});
|
|
1200
|
-
function d(
|
|
1201
|
-
if (!
|
|
1213
|
+
function d(p) {
|
|
1214
|
+
if (!p) return p;
|
|
1202
1215
|
var y, w = Object.create(e.prototype);
|
|
1203
|
-
for (y in
|
|
1204
|
-
w[y] =
|
|
1216
|
+
for (y in p) if (!i.has(y)) try {
|
|
1217
|
+
w[y] = p[y];
|
|
1205
1218
|
} catch {
|
|
1206
1219
|
}
|
|
1207
1220
|
return w;
|
|
@@ -1268,11 +1281,11 @@ function Ma() {
|
|
|
1268
1281
|
var y = a.schema.primKey, d = y.auto, y = y.keyPath;
|
|
1269
1282
|
if (y && s) throw new L.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
|
|
1270
1283
|
if (s && s.length !== e.length) throw new L.InvalidArgument("Arguments objects and keys must have the same length");
|
|
1271
|
-
var
|
|
1272
|
-
return a.core.mutate({ trans: u, type: "add", keys: s, values: y, wantResults: i }).then(function(
|
|
1273
|
-
var f =
|
|
1284
|
+
var p = e.length, y = y && d ? e.map(Mt(y)) : e;
|
|
1285
|
+
return a.core.mutate({ trans: u, type: "add", keys: s, values: y, wantResults: i }).then(function(E) {
|
|
1286
|
+
var f = E.numFailures, O = E.results, m = E.lastResult, E = E.failures;
|
|
1274
1287
|
if (f === 0) return i ? O : m;
|
|
1275
|
-
throw new Je("".concat(a.name, ".bulkAdd(): ").concat(f, " of ").concat(
|
|
1288
|
+
throw new Je("".concat(a.name, ".bulkAdd(): ").concat(f, " of ").concat(p, " operations failed"), E);
|
|
1276
1289
|
});
|
|
1277
1290
|
});
|
|
1278
1291
|
}, J.prototype.bulkPut = function(e, n, r) {
|
|
@@ -1281,11 +1294,11 @@ function Ma() {
|
|
|
1281
1294
|
var y = a.schema.primKey, d = y.auto, y = y.keyPath;
|
|
1282
1295
|
if (y && s) throw new L.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
|
|
1283
1296
|
if (s && s.length !== e.length) throw new L.InvalidArgument("Arguments objects and keys must have the same length");
|
|
1284
|
-
var
|
|
1285
|
-
return a.core.mutate({ trans: u, type: "put", keys: s, values: y, wantResults: i }).then(function(
|
|
1286
|
-
var f =
|
|
1297
|
+
var p = e.length, y = y && d ? e.map(Mt(y)) : e;
|
|
1298
|
+
return a.core.mutate({ trans: u, type: "put", keys: s, values: y, wantResults: i }).then(function(E) {
|
|
1299
|
+
var f = E.numFailures, O = E.results, m = E.lastResult, E = E.failures;
|
|
1287
1300
|
if (f === 0) return i ? O : m;
|
|
1288
|
-
throw new Je("".concat(a.name, ".bulkPut(): ").concat(f, " of ").concat(
|
|
1301
|
+
throw new Je("".concat(a.name, ".bulkPut(): ").concat(f, " of ").concat(p, " operations failed"), E);
|
|
1289
1302
|
});
|
|
1290
1303
|
});
|
|
1291
1304
|
}, J.prototype.bulkUpdate = function(e) {
|
|
@@ -1296,25 +1309,25 @@ function Ma() {
|
|
|
1296
1309
|
}), i = [];
|
|
1297
1310
|
return this._trans("readwrite", function(u) {
|
|
1298
1311
|
return r.getMany({ trans: u, keys: a, cache: "clone" }).then(function(d) {
|
|
1299
|
-
var
|
|
1312
|
+
var p = [], y = [];
|
|
1300
1313
|
e.forEach(function(f, O) {
|
|
1301
|
-
var m = f.key,
|
|
1314
|
+
var m = f.key, E = f.changes, S = d[O];
|
|
1302
1315
|
if (S) {
|
|
1303
|
-
for (var b = 0, A = Object.keys(
|
|
1304
|
-
var P = A[b], D =
|
|
1316
|
+
for (var b = 0, A = Object.keys(E); b < A.length; b++) {
|
|
1317
|
+
var P = A[b], D = E[P];
|
|
1305
1318
|
if (P === n.schema.primKey.keyPath) {
|
|
1306
1319
|
if (H(D, m) !== 0) throw new L.Constraint("Cannot update primary key in bulkUpdate()");
|
|
1307
1320
|
} else ue(S, P, D);
|
|
1308
1321
|
}
|
|
1309
|
-
i.push(O),
|
|
1322
|
+
i.push(O), p.push(m), y.push(S);
|
|
1310
1323
|
}
|
|
1311
1324
|
});
|
|
1312
|
-
var w =
|
|
1313
|
-
return r.mutate({ trans: u, type: "put", keys:
|
|
1325
|
+
var w = p.length;
|
|
1326
|
+
return r.mutate({ trans: u, type: "put", keys: p, values: y, updates: { keys: a, changeSpecs: s } }).then(function(f) {
|
|
1314
1327
|
var O = f.numFailures, m = f.failures;
|
|
1315
1328
|
if (O === 0) return w;
|
|
1316
|
-
for (var
|
|
1317
|
-
var b, A = S[
|
|
1329
|
+
for (var E = 0, S = Object.keys(m); E < S.length; E++) {
|
|
1330
|
+
var b, A = S[E], P = i[Number(A)];
|
|
1318
1331
|
P != null && (b = m[A], delete m[A], m[P] = b);
|
|
1319
1332
|
}
|
|
1320
1333
|
throw new Je("".concat(n.name, ".bulkUpdate(): ").concat(O, " of ").concat(w, " operations failed"), m);
|
|
@@ -1336,7 +1349,7 @@ function Ma() {
|
|
|
1336
1349
|
function ht(e) {
|
|
1337
1350
|
function n(u, d) {
|
|
1338
1351
|
if (d) {
|
|
1339
|
-
for (var
|
|
1352
|
+
for (var p = arguments.length, y = new Array(p - 1); --p; ) y[p - 1] = arguments[p];
|
|
1340
1353
|
return r[u].subscribe.apply(null, y), e;
|
|
1341
1354
|
}
|
|
1342
1355
|
if (typeof u == "string") return r[u];
|
|
@@ -1345,26 +1358,26 @@ function Ma() {
|
|
|
1345
1358
|
n.addEventType = i;
|
|
1346
1359
|
for (var a = 1, s = arguments.length; a < s; ++a) i(arguments[a]);
|
|
1347
1360
|
return n;
|
|
1348
|
-
function i(u, d,
|
|
1361
|
+
function i(u, d, p) {
|
|
1349
1362
|
if (typeof u != "object") {
|
|
1350
1363
|
var y;
|
|
1351
1364
|
d = d || ea;
|
|
1352
|
-
var w = { subscribers: [], fire:
|
|
1365
|
+
var w = { subscribers: [], fire: p = p || Q, subscribe: function(f) {
|
|
1353
1366
|
w.subscribers.indexOf(f) === -1 && (w.subscribers.push(f), w.fire = d(w.fire, f));
|
|
1354
1367
|
}, unsubscribe: function(f) {
|
|
1355
1368
|
w.subscribers = w.subscribers.filter(function(O) {
|
|
1356
1369
|
return O !== f;
|
|
1357
|
-
}), w.fire = w.subscribers.reduce(d,
|
|
1370
|
+
}), w.fire = w.subscribers.reduce(d, p);
|
|
1358
1371
|
} };
|
|
1359
1372
|
return r[u] = n[u] = w;
|
|
1360
1373
|
}
|
|
1361
|
-
|
|
1374
|
+
T(y = u).forEach(function(f) {
|
|
1362
1375
|
var O = y[f];
|
|
1363
1376
|
if (K(O)) i(f, y[f][0], y[f][1]);
|
|
1364
1377
|
else {
|
|
1365
1378
|
if (O !== "asap") throw new L.InvalidArgument("Invalid event config");
|
|
1366
1379
|
var m = i(f, ct, function() {
|
|
1367
|
-
for (var
|
|
1380
|
+
for (var E = arguments.length, S = new Array(E); E--; ) S[E] = arguments[E];
|
|
1368
1381
|
m.subscribers.forEach(function(b) {
|
|
1369
1382
|
Yn(function() {
|
|
1370
1383
|
b.apply(null, S);
|
|
@@ -1403,13 +1416,13 @@ function Ma() {
|
|
|
1403
1416
|
function Kt(e, n, r, a) {
|
|
1404
1417
|
var s = e.replayFilter ? Ue(e.filter, e.replayFilter()) : e.filter;
|
|
1405
1418
|
if (e.or) {
|
|
1406
|
-
var i = {}, u = function(d,
|
|
1419
|
+
var i = {}, u = function(d, p, y) {
|
|
1407
1420
|
var w, f;
|
|
1408
|
-
s && !s(
|
|
1409
|
-
return
|
|
1421
|
+
s && !s(p, y, function(O) {
|
|
1422
|
+
return p.stop(O);
|
|
1410
1423
|
}, function(O) {
|
|
1411
|
-
return
|
|
1412
|
-
}) || ((f = "" + (w =
|
|
1424
|
+
return p.fail(O);
|
|
1425
|
+
}) || ((f = "" + (w = p.primaryKey)) == "[object ArrayBuffer]" && (f = "" + new Uint8Array(w)), ie(i, f) || (i[f] = !0, n(d, p, y)));
|
|
1413
1426
|
};
|
|
1414
1427
|
return Promise.all([e.or._iterate(u, r), hr(fr(e, a, r), e.algorithm, u, !e.keysOnly && e.valueMapper)]);
|
|
1415
1428
|
}
|
|
@@ -1440,7 +1453,7 @@ function Ma() {
|
|
|
1440
1453
|
var n = this["@@propmod"];
|
|
1441
1454
|
if (n.add !== void 0) {
|
|
1442
1455
|
var r = n.add;
|
|
1443
|
-
if (K(r)) return
|
|
1456
|
+
if (K(r)) return g(g([], K(e) ? e : [], !0), r).sort();
|
|
1444
1457
|
if (typeof r == "number") return (Number(e) || 0) + r;
|
|
1445
1458
|
if (typeof r == "bigint") try {
|
|
1446
1459
|
return BigInt(e) + r;
|
|
@@ -1504,15 +1517,15 @@ function Ma() {
|
|
|
1504
1517
|
}).then(e);
|
|
1505
1518
|
}, V.prototype.sortBy = function(e, n) {
|
|
1506
1519
|
var r = e.split(".").reverse(), a = r[0], s = r.length - 1;
|
|
1507
|
-
function i(
|
|
1508
|
-
return y ? i(
|
|
1520
|
+
function i(p, y) {
|
|
1521
|
+
return y ? i(p[r[y]], y - 1) : p[a];
|
|
1509
1522
|
}
|
|
1510
1523
|
var u = this._ctx.dir === "next" ? 1 : -1;
|
|
1511
|
-
function d(
|
|
1512
|
-
return H(i(
|
|
1524
|
+
function d(p, y) {
|
|
1525
|
+
return H(i(p, s), i(y, s)) * u;
|
|
1513
1526
|
}
|
|
1514
|
-
return this.toArray(function(
|
|
1515
|
-
return
|
|
1527
|
+
return this.toArray(function(p) {
|
|
1528
|
+
return p.sort(d);
|
|
1516
1529
|
}).then(n);
|
|
1517
1530
|
}, V.prototype.toArray = function(e) {
|
|
1518
1531
|
var n = this;
|
|
@@ -1632,37 +1645,37 @@ function Ma() {
|
|
|
1632
1645
|
var n = this, r = this._ctx;
|
|
1633
1646
|
return this._write(function(a) {
|
|
1634
1647
|
var s, i, u;
|
|
1635
|
-
u = typeof e == "function" ? e : (s =
|
|
1648
|
+
u = typeof e == "function" ? e : (s = T(e), i = s.length, function(b) {
|
|
1636
1649
|
for (var A = !1, P = 0; P < i; ++P) {
|
|
1637
1650
|
var D = s[P], I = e[D], N = ve(b, D);
|
|
1638
1651
|
I instanceof pt ? (ue(b, D, I.execute(N)), A = !0) : N !== I && (ue(b, D, I), A = !0);
|
|
1639
1652
|
}
|
|
1640
1653
|
return A;
|
|
1641
1654
|
});
|
|
1642
|
-
var d = r.table.core, f = d.schema.primaryKey,
|
|
1655
|
+
var d = r.table.core, f = d.schema.primaryKey, p = f.outbound, y = f.extractKey, w = 200, f = n.db._options.modifyChunkSize;
|
|
1643
1656
|
f && (w = typeof f == "object" ? f[d.name] || f["*"] || 200 : f);
|
|
1644
1657
|
function O(b, D) {
|
|
1645
1658
|
var P = D.failures, D = D.numFailures;
|
|
1646
|
-
|
|
1647
|
-
for (var I = 0, N =
|
|
1648
|
-
var
|
|
1649
|
-
m.push(P[
|
|
1659
|
+
E += b - D;
|
|
1660
|
+
for (var I = 0, N = T(P); I < N.length; I++) {
|
|
1661
|
+
var C = N[I];
|
|
1662
|
+
m.push(P[C]);
|
|
1650
1663
|
}
|
|
1651
1664
|
}
|
|
1652
|
-
var m = [],
|
|
1665
|
+
var m = [], E = 0, S = [];
|
|
1653
1666
|
return n.clone().primaryKeys().then(function(b) {
|
|
1654
1667
|
function A(D) {
|
|
1655
1668
|
var I = Math.min(w, b.length - D);
|
|
1656
1669
|
return d.getMany({ trans: a, keys: b.slice(D, D + I), cache: "immutable" }).then(function(N) {
|
|
1657
|
-
for (var
|
|
1658
|
-
var M = N[
|
|
1659
|
-
u.call(F, F.value, F) !== !1 && (F.value == null ? $.push(b[D +
|
|
1670
|
+
for (var C = [], R = [], x = p ? [] : null, $ = [], k = 0; k < I; ++k) {
|
|
1671
|
+
var M = N[k], F = { value: $e(M), primKey: b[D + k] };
|
|
1672
|
+
u.call(F, F.value, F) !== !1 && (F.value == null ? $.push(b[D + k]) : p || H(y(M), y(F.value)) === 0 ? (R.push(F.value), p && x.push(b[D + k])) : ($.push(b[D + k]), C.push(F.value)));
|
|
1660
1673
|
}
|
|
1661
|
-
return Promise.resolve(0 <
|
|
1674
|
+
return Promise.resolve(0 < C.length && d.mutate({ trans: a, type: "add", values: C }).then(function(U) {
|
|
1662
1675
|
for (var z in U.failures) $.splice(parseInt(z), 1);
|
|
1663
|
-
O(
|
|
1676
|
+
O(C.length, U);
|
|
1664
1677
|
})).then(function() {
|
|
1665
|
-
return (0 < R.length || P && typeof e == "object") && d.mutate({ trans: a, type: "put", keys:
|
|
1678
|
+
return (0 < R.length || P && typeof e == "object") && d.mutate({ trans: a, type: "put", keys: x, values: R, criteria: P, changeSpec: typeof e != "function" && e, isAdditionalChunk: 0 < D }).then(function(U) {
|
|
1666
1679
|
return O(R.length, U);
|
|
1667
1680
|
});
|
|
1668
1681
|
}).then(function() {
|
|
@@ -1676,7 +1689,7 @@ function Ma() {
|
|
|
1676
1689
|
}
|
|
1677
1690
|
var P = nt(r) && r.limit === 1 / 0 && (typeof e != "function" || e === En) && { index: r.index, range: r.range };
|
|
1678
1691
|
return A(0).then(function() {
|
|
1679
|
-
if (0 < m.length) throw new Pt("Error modifying one or more objects", m,
|
|
1692
|
+
if (0 < m.length) throw new Pt("Error modifying one or more objects", m, E, S);
|
|
1680
1693
|
return b.length;
|
|
1681
1694
|
});
|
|
1682
1695
|
});
|
|
@@ -1688,8 +1701,8 @@ function Ma() {
|
|
|
1688
1701
|
return e.table.core.count({ trans: r, query: { index: a, range: s } }).then(function(i) {
|
|
1689
1702
|
return e.table.core.mutate({ trans: r, type: "deleteRange", range: s }).then(function(u) {
|
|
1690
1703
|
var d = u.failures;
|
|
1691
|
-
if (u.lastResult, u.results, u = u.numFailures, u) throw new Pt("Could not delete some values", Object.keys(d).map(function(
|
|
1692
|
-
return d[
|
|
1704
|
+
if (u.lastResult, u.results, u = u.numFailures, u) throw new Pt("Could not delete some values", Object.keys(d).map(function(p) {
|
|
1705
|
+
return d[p];
|
|
1693
1706
|
}), i - u);
|
|
1694
1707
|
return i - u;
|
|
1695
1708
|
});
|
|
@@ -1716,20 +1729,20 @@ function Ma() {
|
|
|
1716
1729
|
}).limit(0);
|
|
1717
1730
|
}
|
|
1718
1731
|
function Bt(e, n, r, a) {
|
|
1719
|
-
var s, i, u, d,
|
|
1720
|
-
if (!r.every(function(
|
|
1721
|
-
return typeof
|
|
1732
|
+
var s, i, u, d, p, y, w, f = r.length;
|
|
1733
|
+
if (!r.every(function(E) {
|
|
1734
|
+
return typeof E == "string";
|
|
1722
1735
|
})) return le(e, or);
|
|
1723
|
-
function O(
|
|
1724
|
-
s =
|
|
1736
|
+
function O(E) {
|
|
1737
|
+
s = E === "next" ? function(b) {
|
|
1725
1738
|
return b.toUpperCase();
|
|
1726
1739
|
} : function(b) {
|
|
1727
1740
|
return b.toLowerCase();
|
|
1728
|
-
}, i =
|
|
1741
|
+
}, i = E === "next" ? function(b) {
|
|
1729
1742
|
return b.toLowerCase();
|
|
1730
1743
|
} : function(b) {
|
|
1731
1744
|
return b.toUpperCase();
|
|
1732
|
-
}, u =
|
|
1745
|
+
}, u = E === "next" ? ia : ca;
|
|
1733
1746
|
var S = r.map(function(b) {
|
|
1734
1747
|
return { lower: i(b), upper: s(b) };
|
|
1735
1748
|
}).sort(function(b, A) {
|
|
@@ -1737,34 +1750,34 @@ function Ma() {
|
|
|
1737
1750
|
});
|
|
1738
1751
|
d = S.map(function(b) {
|
|
1739
1752
|
return b.upper;
|
|
1740
|
-
}),
|
|
1753
|
+
}), p = S.map(function(b) {
|
|
1741
1754
|
return b.lower;
|
|
1742
|
-
}), w = (y =
|
|
1755
|
+
}), w = (y = E) === "next" ? "" : a;
|
|
1743
1756
|
}
|
|
1744
1757
|
O("next"), e = new e.Collection(e, function() {
|
|
1745
|
-
return Re(d[0],
|
|
1746
|
-
}), e._ondirectionchange = function(
|
|
1747
|
-
O(
|
|
1758
|
+
return Re(d[0], p[f - 1] + a);
|
|
1759
|
+
}), e._ondirectionchange = function(E) {
|
|
1760
|
+
O(E);
|
|
1748
1761
|
};
|
|
1749
1762
|
var m = 0;
|
|
1750
|
-
return e._addAlgorithm(function(
|
|
1751
|
-
var A =
|
|
1763
|
+
return e._addAlgorithm(function(E, S, b) {
|
|
1764
|
+
var A = E.key;
|
|
1752
1765
|
if (typeof A != "string") return !1;
|
|
1753
1766
|
var P = i(A);
|
|
1754
|
-
if (n(P,
|
|
1767
|
+
if (n(P, p, m)) return !0;
|
|
1755
1768
|
for (var D = null, I = m; I < f; ++I) {
|
|
1756
|
-
var N = function(
|
|
1757
|
-
for (var F = Math.min(
|
|
1769
|
+
var N = function(C, R, x, $, k, M) {
|
|
1770
|
+
for (var F = Math.min(C.length, $.length), U = -1, z = 0; z < F; ++z) {
|
|
1758
1771
|
var de = R[z];
|
|
1759
|
-
if (de !== $[z]) return
|
|
1760
|
-
|
|
1772
|
+
if (de !== $[z]) return k(C[z], x[z]) < 0 ? C.substr(0, z) + x[z] + x.substr(z + 1) : k(C[z], $[z]) < 0 ? C.substr(0, z) + $[z] + x.substr(z + 1) : 0 <= U ? C.substr(0, U) + R[U] + x.substr(U + 1) : null;
|
|
1773
|
+
k(C[z], de) < 0 && (U = z);
|
|
1761
1774
|
}
|
|
1762
|
-
return F < $.length && M === "next" ?
|
|
1763
|
-
}(A, P, d[I],
|
|
1775
|
+
return F < $.length && M === "next" ? C + x.substr(C.length) : F < C.length && M === "prev" ? C.substr(0, x.length) : U < 0 ? null : C.substr(0, U) + $[U] + x.substr(U + 1);
|
|
1776
|
+
}(A, P, d[I], p[I], u, y);
|
|
1764
1777
|
N === null && D === null ? m = I + 1 : (D === null || 0 < u(D, N)) && (D = N);
|
|
1765
1778
|
}
|
|
1766
1779
|
return S(D !== null ? function() {
|
|
1767
|
-
|
|
1780
|
+
E.continue(D + w);
|
|
1768
1781
|
} : b), !1;
|
|
1769
1782
|
}), e;
|
|
1770
1783
|
}
|
|
@@ -1843,8 +1856,8 @@ function Ma() {
|
|
|
1843
1856
|
};
|
|
1844
1857
|
var s = 0;
|
|
1845
1858
|
return a._addAlgorithm(function(i, u, d) {
|
|
1846
|
-
for (var
|
|
1847
|
-
return r(
|
|
1859
|
+
for (var p = i.key; 0 < r(p, n[s]); ) if (++s === n.length) return u(d), !1;
|
|
1860
|
+
return r(p, n[s]) === 0 || (u(function() {
|
|
1848
1861
|
i.continue(n[s]);
|
|
1849
1862
|
}), !1);
|
|
1850
1863
|
}), a;
|
|
@@ -1868,16 +1881,16 @@ function Ma() {
|
|
|
1868
1881
|
if (!A.every(function(P) {
|
|
1869
1882
|
return P[0] !== void 0 && P[1] !== void 0 && s(P[0], P[1]) <= 0;
|
|
1870
1883
|
})) return le(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", L.InvalidArgument);
|
|
1871
|
-
var
|
|
1884
|
+
var p = !n || n.includeLowers !== !1, y = n && n.includeUppers === !0, w, f = s;
|
|
1872
1885
|
function O(P, D) {
|
|
1873
1886
|
return f(P[0], D[0]);
|
|
1874
1887
|
}
|
|
1875
1888
|
try {
|
|
1876
1889
|
(w = A.reduce(function(P, D) {
|
|
1877
1890
|
for (var I = 0, N = P.length; I < N; ++I) {
|
|
1878
|
-
var
|
|
1879
|
-
if (a(D[0],
|
|
1880
|
-
|
|
1891
|
+
var C = P[I];
|
|
1892
|
+
if (a(D[0], C[1]) < 0 && 0 < a(D[1], C[0])) {
|
|
1893
|
+
C[0] = u(C[0], D[0]), C[1] = d(C[1], D[1]);
|
|
1881
1894
|
break;
|
|
1882
1895
|
}
|
|
1883
1896
|
}
|
|
@@ -1886,22 +1899,22 @@ function Ma() {
|
|
|
1886
1899
|
} catch {
|
|
1887
1900
|
return le(this, we);
|
|
1888
1901
|
}
|
|
1889
|
-
var m = 0,
|
|
1902
|
+
var m = 0, E = y ? function(P) {
|
|
1890
1903
|
return 0 < s(P, w[m][1]);
|
|
1891
1904
|
} : function(P) {
|
|
1892
1905
|
return 0 <= s(P, w[m][1]);
|
|
1893
|
-
}, S =
|
|
1906
|
+
}, S = p ? function(P) {
|
|
1894
1907
|
return 0 < i(P, w[m][0]);
|
|
1895
1908
|
} : function(P) {
|
|
1896
1909
|
return 0 <= i(P, w[m][0]);
|
|
1897
|
-
}, b =
|
|
1898
|
-
return Re(w[0][0], w[w.length - 1][1], !
|
|
1910
|
+
}, b = E, A = new this.Collection(this, function() {
|
|
1911
|
+
return Re(w[0][0], w[w.length - 1][1], !p, !y);
|
|
1899
1912
|
});
|
|
1900
1913
|
return A._ondirectionchange = function(P) {
|
|
1901
|
-
f = P === "next" ? (b =
|
|
1914
|
+
f = P === "next" ? (b = E, s) : (b = S, i), w.sort(O);
|
|
1902
1915
|
}, A._addAlgorithm(function(P, D, I) {
|
|
1903
|
-
for (var N,
|
|
1904
|
-
return !
|
|
1916
|
+
for (var N, C = P.key; b(C); ) if (++m === w.length) return D(I), !1;
|
|
1917
|
+
return !E(N = C) && !S(N) || (r._cmp(C, w[m][1]) === 0 || r._cmp(C, w[m][0]) === 0 || D(function() {
|
|
1905
1918
|
f === s ? P.continue(w[m][0]) : P.continue(w[m][1]);
|
|
1906
1919
|
}), !1);
|
|
1907
1920
|
}), A;
|
|
@@ -1968,8 +1981,8 @@ function Ma() {
|
|
|
1968
1981
|
if (r) return De(function() {
|
|
1969
1982
|
var i = new j(function(u, d) {
|
|
1970
1983
|
a._lock();
|
|
1971
|
-
var
|
|
1972
|
-
|
|
1984
|
+
var p = n(u, d, a);
|
|
1985
|
+
p && p.then && p.then(u, d);
|
|
1973
1986
|
});
|
|
1974
1987
|
return i.finally(function() {
|
|
1975
1988
|
return a._unlock();
|
|
@@ -2054,22 +2067,22 @@ function Ma() {
|
|
|
2054
2067
|
function vt(e) {
|
|
2055
2068
|
return e == null ? ":id" : typeof e == "string" ? e : "[".concat(e.join("+"), "]");
|
|
2056
2069
|
}
|
|
2057
|
-
function da(e, n,
|
|
2070
|
+
function da(e, n, p) {
|
|
2058
2071
|
function a(b) {
|
|
2059
2072
|
if (b.type === 3) return null;
|
|
2060
2073
|
if (b.type === 4) throw new Error("Cannot convert never type to IDBKeyRange");
|
|
2061
|
-
var m = b.lower,
|
|
2062
|
-
return m === void 0 ?
|
|
2074
|
+
var m = b.lower, E = b.upper, S = b.lowerOpen, b = b.upperOpen;
|
|
2075
|
+
return m === void 0 ? E === void 0 ? null : n.upperBound(E, !!b) : E === void 0 ? n.lowerBound(m, !!S) : n.bound(m, E, !!S, !!b);
|
|
2063
2076
|
}
|
|
2064
2077
|
function s(O) {
|
|
2065
|
-
var m,
|
|
2066
|
-
return { name:
|
|
2078
|
+
var m, E = O.name;
|
|
2079
|
+
return { name: E, schema: O, mutate: function(S) {
|
|
2067
2080
|
var b = S.trans, A = S.type, P = S.keys, D = S.values, I = S.range;
|
|
2068
|
-
return new Promise(function(N,
|
|
2081
|
+
return new Promise(function(N, C) {
|
|
2069
2082
|
N = Z(N);
|
|
2070
|
-
var R = b.objectStore(
|
|
2083
|
+
var R = b.objectStore(E), x = R.keyPath == null, $ = A === "put" || A === "add";
|
|
2071
2084
|
if (!$ && A !== "delete" && A !== "deleteRange") throw new Error("Invalid operation type: " + A);
|
|
2072
|
-
var
|
|
2085
|
+
var k, M = (P || D || { length: 1 }).length;
|
|
2073
2086
|
if (P && D && P.length !== D.length) throw new Error("Given keys array must have same length as given values array.");
|
|
2074
2087
|
if (M === 0) return N({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
|
|
2075
2088
|
function F(ce) {
|
|
@@ -2078,11 +2091,11 @@ function Ma() {
|
|
|
2078
2091
|
var U = [], z = [], de = 0;
|
|
2079
2092
|
if (A === "deleteRange") {
|
|
2080
2093
|
if (I.type === 4) return N({ numFailures: de, failures: z, results: [], lastResult: void 0 });
|
|
2081
|
-
I.type === 3 ? U.push(
|
|
2094
|
+
I.type === 3 ? U.push(k = R.clear()) : U.push(k = R.delete(a(I)));
|
|
2082
2095
|
} else {
|
|
2083
|
-
var
|
|
2084
|
-
if ($) for (var oe = 0; oe < M; ++oe) U.push(
|
|
2085
|
-
else for (oe = 0; oe < M; ++oe) U.push(
|
|
2096
|
+
var x = $ ? x ? [D, P] : [D, null] : [P, null], W = x[0], se = x[1];
|
|
2097
|
+
if ($) for (var oe = 0; oe < M; ++oe) U.push(k = se && se[oe] !== void 0 ? R[A](W[oe], se[oe]) : R[A](W[oe])), k.onerror = F;
|
|
2098
|
+
else for (oe = 0; oe < M; ++oe) U.push(k = R[A](W[oe])), k.onerror = F;
|
|
2086
2099
|
}
|
|
2087
2100
|
function qt(ce) {
|
|
2088
2101
|
ce = ce.target.result, U.forEach(function(Ve, Wn) {
|
|
@@ -2091,24 +2104,24 @@ function Ma() {
|
|
|
2091
2104
|
return Ve.result;
|
|
2092
2105
|
}), lastResult: ce });
|
|
2093
2106
|
}
|
|
2094
|
-
|
|
2107
|
+
k.onerror = function(ce) {
|
|
2095
2108
|
F(ce), qt(ce);
|
|
2096
|
-
},
|
|
2109
|
+
}, k.onsuccess = qt;
|
|
2097
2110
|
});
|
|
2098
2111
|
}, getMany: function(S) {
|
|
2099
2112
|
var b = S.trans, A = S.keys;
|
|
2100
2113
|
return new Promise(function(P, D) {
|
|
2101
2114
|
P = Z(P);
|
|
2102
|
-
for (var I, N = b.objectStore(
|
|
2103
|
-
U = U.target, R[U._pos] = U.result, ++$ ===
|
|
2104
|
-
}, M = me(D), F = 0; F <
|
|
2105
|
-
|
|
2115
|
+
for (var I, N = b.objectStore(E), C = A.length, R = new Array(C), x = 0, $ = 0, k = function(U) {
|
|
2116
|
+
U = U.target, R[U._pos] = U.result, ++$ === x && P(R);
|
|
2117
|
+
}, M = me(D), F = 0; F < C; ++F) A[F] != null && ((I = N.get(A[F]))._pos = F, I.onsuccess = k, I.onerror = M, ++x);
|
|
2118
|
+
x === 0 && P(R);
|
|
2106
2119
|
});
|
|
2107
2120
|
}, get: function(S) {
|
|
2108
2121
|
var b = S.trans, A = S.key;
|
|
2109
2122
|
return new Promise(function(P, D) {
|
|
2110
2123
|
P = Z(P);
|
|
2111
|
-
var I = b.objectStore(
|
|
2124
|
+
var I = b.objectStore(E).get(A);
|
|
2112
2125
|
I.onsuccess = function(N) {
|
|
2113
2126
|
return P(N.target.result);
|
|
2114
2127
|
}, I.onerror = me(D);
|
|
@@ -2116,27 +2129,27 @@ function Ma() {
|
|
|
2116
2129
|
}, query: (m = y, function(S) {
|
|
2117
2130
|
return new Promise(function(b, A) {
|
|
2118
2131
|
b = Z(b);
|
|
2119
|
-
var P, D, I,
|
|
2120
|
-
if (
|
|
2121
|
-
m ? ((R = N ? $.getAll(
|
|
2132
|
+
var P, D, I, x = S.trans, N = S.values, C = S.limit, k = S.query, R = C === 1 / 0 ? void 0 : C, $ = k.index, k = k.range, x = x.objectStore(E), $ = $.isPrimaryKey ? x : x.index($.name), k = a(k);
|
|
2133
|
+
if (C === 0) return b({ result: [] });
|
|
2134
|
+
m ? ((R = N ? $.getAll(k, R) : $.getAllKeys(k, R)).onsuccess = function(M) {
|
|
2122
2135
|
return b({ result: M.target.result });
|
|
2123
|
-
}, R.onerror = me(A)) : (P = 0, D = !N && "openKeyCursor" in $ ? $.openKeyCursor(
|
|
2136
|
+
}, R.onerror = me(A)) : (P = 0, D = !N && "openKeyCursor" in $ ? $.openKeyCursor(k) : $.openCursor(k), I = [], D.onsuccess = function(M) {
|
|
2124
2137
|
var F = D.result;
|
|
2125
|
-
return F ? (I.push(N ? F.value : F.primaryKey), ++P ===
|
|
2138
|
+
return F ? (I.push(N ? F.value : F.primaryKey), ++P === C ? b({ result: I }) : void F.continue()) : b({ result: I });
|
|
2126
2139
|
}, D.onerror = me(A));
|
|
2127
2140
|
});
|
|
2128
2141
|
}), openCursor: function(S) {
|
|
2129
2142
|
var b = S.trans, A = S.values, P = S.query, D = S.reverse, I = S.unique;
|
|
2130
|
-
return new Promise(function(N,
|
|
2143
|
+
return new Promise(function(N, C) {
|
|
2131
2144
|
N = Z(N);
|
|
2132
|
-
var $ = P.index, R = P.range,
|
|
2133
|
-
|
|
2134
|
-
var F, U, z, de, W =
|
|
2145
|
+
var $ = P.index, R = P.range, x = b.objectStore(E), x = $.isPrimaryKey ? x : x.index($.name), $ = D ? I ? "prevunique" : "prev" : I ? "nextunique" : "next", k = !A && "openKeyCursor" in x ? x.openKeyCursor(a(R), $) : x.openCursor(a(R), $);
|
|
2146
|
+
k.onerror = me(C), k.onsuccess = Z(function(M) {
|
|
2147
|
+
var F, U, z, de, W = k.result;
|
|
2135
2148
|
W ? (W.___id = ++la, W.done = !1, F = W.continue.bind(W), U = (U = W.continuePrimaryKey) && U.bind(W), z = W.advance.bind(W), de = function() {
|
|
2136
2149
|
throw new Error("Cursor not stopped");
|
|
2137
2150
|
}, W.trans = b, W.stop = W.continue = W.continuePrimaryKey = W.advance = function() {
|
|
2138
2151
|
throw new Error("Cursor not started");
|
|
2139
|
-
}, W.fail = Z(
|
|
2152
|
+
}, W.fail = Z(C), W.next = function() {
|
|
2140
2153
|
var se = this, oe = 1;
|
|
2141
2154
|
return this.start(function() {
|
|
2142
2155
|
return oe-- ? se.continue() : se.stop();
|
|
@@ -2145,7 +2158,7 @@ function Ma() {
|
|
|
2145
2158
|
});
|
|
2146
2159
|
}, W.start = function(se) {
|
|
2147
2160
|
function oe() {
|
|
2148
|
-
if (
|
|
2161
|
+
if (k.result) try {
|
|
2149
2162
|
se();
|
|
2150
2163
|
} catch (ce) {
|
|
2151
2164
|
W.fail(ce);
|
|
@@ -2155,30 +2168,30 @@ function Ma() {
|
|
|
2155
2168
|
}, W.stop();
|
|
2156
2169
|
}
|
|
2157
2170
|
var qt = new Promise(function(ce, Ve) {
|
|
2158
|
-
ce = Z(ce),
|
|
2171
|
+
ce = Z(ce), k.onerror = me(Ve), W.fail = Ve, W.stop = function(Wn) {
|
|
2159
2172
|
W.stop = W.continue = W.continuePrimaryKey = W.advance = de, ce(Wn);
|
|
2160
2173
|
};
|
|
2161
2174
|
});
|
|
2162
|
-
return
|
|
2163
|
-
|
|
2175
|
+
return k.onsuccess = Z(function(ce) {
|
|
2176
|
+
k.onsuccess = oe, oe();
|
|
2164
2177
|
}), W.continue = F, W.continuePrimaryKey = U, W.advance = z, oe(), qt;
|
|
2165
2178
|
}, N(W)) : N(null);
|
|
2166
|
-
},
|
|
2179
|
+
}, C);
|
|
2167
2180
|
});
|
|
2168
2181
|
}, count: function(S) {
|
|
2169
2182
|
var b = S.query, A = S.trans, P = b.index, D = b.range;
|
|
2170
2183
|
return new Promise(function(I, N) {
|
|
2171
|
-
var
|
|
2172
|
-
R.onsuccess = Z(function(
|
|
2173
|
-
return I(
|
|
2184
|
+
var C = A.objectStore(E), R = P.isPrimaryKey ? C : C.index(P.name), C = a(D), R = C ? R.count(C) : R.count();
|
|
2185
|
+
R.onsuccess = Z(function(x) {
|
|
2186
|
+
return I(x.target.result);
|
|
2174
2187
|
}), R.onerror = me(N);
|
|
2175
2188
|
});
|
|
2176
2189
|
} };
|
|
2177
2190
|
}
|
|
2178
|
-
var i, u, d, w = (u =
|
|
2191
|
+
var i, u, d, w = (u = p, d = br((i = e).objectStoreNames), { schema: { name: i.name, tables: d.map(function(O) {
|
|
2179
2192
|
return u.objectStore(O);
|
|
2180
2193
|
}).map(function(O) {
|
|
2181
|
-
var m = O.keyPath, b = O.autoIncrement,
|
|
2194
|
+
var m = O.keyPath, b = O.autoIncrement, E = K(m), S = {}, b = { name: O.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: m == null, compound: E, keyPath: m, autoIncrement: b, unique: !0, extractKey: _n(m) }, indexes: br(O.indexNames).map(function(A) {
|
|
2182
2195
|
return O.index(A);
|
|
2183
2196
|
}).map(function(I) {
|
|
2184
2197
|
var P = I.name, D = I.unique, N = I.multiEntry, I = I.keyPath, N = { name: P, compound: K(I), keyPath: I, unique: D, multiEntry: N, extractKey: _n(I) };
|
|
@@ -2187,13 +2200,13 @@ function Ma() {
|
|
|
2187
2200
|
return S[vt(A)];
|
|
2188
2201
|
} };
|
|
2189
2202
|
return S[":id"] = b.primaryKey, m != null && (S[vt(m)] = b.primaryKey), b;
|
|
2190
|
-
}) }, 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) }),
|
|
2203
|
+
}) }, 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 = w.schema, y = w.hasGetAll, w = p.tables.map(s), f = {};
|
|
2191
2204
|
return w.forEach(function(O) {
|
|
2192
2205
|
return f[O.name] = O;
|
|
2193
2206
|
}), { stack: "dbcore", transaction: e.transaction.bind(e), table: function(O) {
|
|
2194
2207
|
if (!f[O]) throw new Error("Table '".concat(O, "' not found"));
|
|
2195
2208
|
return f[O];
|
|
2196
|
-
}, MIN_KEY: -1 / 0, MAX_KEY: bt(n), schema:
|
|
2209
|
+
}, MIN_KEY: -1 / 0, MAX_KEY: bt(n), schema: p };
|
|
2197
2210
|
}
|
|
2198
2211
|
function fa(e, n, r, a) {
|
|
2199
2212
|
var s = r.IDBKeyRange;
|
|
@@ -2214,13 +2227,13 @@ function Ma() {
|
|
|
2214
2227
|
r.forEach(function(s) {
|
|
2215
2228
|
var i = a[s];
|
|
2216
2229
|
n.forEach(function(u) {
|
|
2217
|
-
var d = function
|
|
2218
|
-
return Fr(y, w) || (y = ge(y)) &&
|
|
2230
|
+
var d = function p(y, w) {
|
|
2231
|
+
return Fr(y, w) || (y = ge(y)) && p(y, w);
|
|
2219
2232
|
}(u, s);
|
|
2220
2233
|
(!d || "value" in d && d.value === void 0) && (u === e.Transaction.prototype || u instanceof e.Transaction ? Ae(u, s, { get: function() {
|
|
2221
2234
|
return this.table(s);
|
|
2222
|
-
}, set: function(
|
|
2223
|
-
_t(this, s, { value:
|
|
2235
|
+
}, set: function(p) {
|
|
2236
|
+
_t(this, s, { value: p, writable: !0, configurable: !0, enumerable: !0 });
|
|
2224
2237
|
} }) : u[s] = new e.Table(s, i));
|
|
2225
2238
|
});
|
|
2226
2239
|
});
|
|
@@ -2240,48 +2253,48 @@ function Ma() {
|
|
|
2240
2253
|
i.create(r), i._completion.catch(a);
|
|
2241
2254
|
var u = i._reject.bind(i), d = B.transless || B;
|
|
2242
2255
|
De(function() {
|
|
2243
|
-
return B.trans = i, B.transless = d, n !== 0 ? (Lt(e, r), y = n, ((
|
|
2256
|
+
return B.trans = i, B.transless = d, n !== 0 ? (Lt(e, r), y = n, ((p = i).storeNames.includes("$meta") ? p.table("$meta").get("version").then(function(w) {
|
|
2244
2257
|
return w ?? y;
|
|
2245
2258
|
}) : j.resolve(y)).then(function(w) {
|
|
2246
|
-
return O = w, m = i,
|
|
2259
|
+
return O = w, m = i, E = r, S = [], w = (f = e)._versions, b = f._dbSchema = Ut(0, f.idbdb, E), (w = w.filter(function(A) {
|
|
2247
2260
|
return A._cfg.version >= O;
|
|
2248
2261
|
})).length !== 0 ? (w.forEach(function(A) {
|
|
2249
2262
|
S.push(function() {
|
|
2250
2263
|
var P = b, D = A._cfg.dbschema;
|
|
2251
|
-
zt(f, P,
|
|
2264
|
+
zt(f, P, E), zt(f, D, E), b = f._dbSchema = D;
|
|
2252
2265
|
var I = Pn(P, D);
|
|
2253
2266
|
I.add.forEach(function($) {
|
|
2254
|
-
Dn(
|
|
2267
|
+
Dn(E, $[0], $[1].primKey, $[1].indexes);
|
|
2255
2268
|
}), I.change.forEach(function($) {
|
|
2256
2269
|
if ($.recreate) throw new L.Upgrade("Not yet support for changing primary key");
|
|
2257
|
-
var
|
|
2270
|
+
var k = E.objectStore($.name);
|
|
2258
2271
|
$.add.forEach(function(M) {
|
|
2259
|
-
return Ft(
|
|
2272
|
+
return Ft(k, M);
|
|
2260
2273
|
}), $.change.forEach(function(M) {
|
|
2261
|
-
|
|
2274
|
+
k.deleteIndex(M.name), Ft(k, M);
|
|
2262
2275
|
}), $.del.forEach(function(M) {
|
|
2263
|
-
return
|
|
2276
|
+
return k.deleteIndex(M);
|
|
2264
2277
|
});
|
|
2265
2278
|
});
|
|
2266
2279
|
var N = A._cfg.contentUpgrade;
|
|
2267
2280
|
if (N && A._cfg.version > O) {
|
|
2268
|
-
Lt(f,
|
|
2269
|
-
var
|
|
2281
|
+
Lt(f, E), m._memoizedTables = {};
|
|
2282
|
+
var C = Qn(D);
|
|
2270
2283
|
I.del.forEach(function($) {
|
|
2271
|
-
|
|
2272
|
-
}), An(f, [f.Transaction.prototype]), Wt(f, [f.Transaction.prototype], C
|
|
2273
|
-
var R,
|
|
2274
|
-
return
|
|
2284
|
+
C[$] = P[$];
|
|
2285
|
+
}), An(f, [f.Transaction.prototype]), Wt(f, [f.Transaction.prototype], T(C), C), m.schema = C;
|
|
2286
|
+
var R, x = an(N);
|
|
2287
|
+
return x && et(), I = j.follow(function() {
|
|
2275
2288
|
var $;
|
|
2276
|
-
(R = N(m)) &&
|
|
2289
|
+
(R = N(m)) && x && ($ = Ie.bind(null, null), R.then($, $));
|
|
2277
2290
|
}), R && typeof R.then == "function" ? j.resolve(R) : I.then(function() {
|
|
2278
2291
|
return R;
|
|
2279
2292
|
});
|
|
2280
2293
|
}
|
|
2281
2294
|
}), S.push(function(P) {
|
|
2282
2295
|
var D, I, N = A._cfg.dbschema;
|
|
2283
|
-
D = N, I = P, [].slice.call(I.db.objectStoreNames).forEach(function(
|
|
2284
|
-
return D[
|
|
2296
|
+
D = N, I = P, [].slice.call(I.db.objectStoreNames).forEach(function(C) {
|
|
2297
|
+
return D[C] == null && I.db.deleteObjectStore(C);
|
|
2285
2298
|
}), An(f, [f.Transaction.prototype]), Wt(f, [f.Transaction.prototype], f._storeNames, f._dbSchema), m.schema = f._dbSchema;
|
|
2286
2299
|
}), S.push(function(P) {
|
|
2287
2300
|
f.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(f.idbdb.version / 10) === A._cfg.version ? (f.idbdb.deleteObjectStore("$meta"), delete f._dbSchema.$meta, f._storeNames = f._storeNames.filter(function(D) {
|
|
@@ -2291,15 +2304,15 @@ function Ma() {
|
|
|
2291
2304
|
}), function A() {
|
|
2292
2305
|
return S.length ? j.resolve(S.shift()(m.idbtrans)).then(A) : j.resolve();
|
|
2293
2306
|
}().then(function() {
|
|
2294
|
-
vr(b,
|
|
2307
|
+
vr(b, E);
|
|
2295
2308
|
})) : j.resolve();
|
|
2296
|
-
var f, O, m,
|
|
2297
|
-
}).catch(u)) : (
|
|
2309
|
+
var f, O, m, E, S, b;
|
|
2310
|
+
}).catch(u)) : (T(s).forEach(function(w) {
|
|
2298
2311
|
Dn(r, w, s[w].primKey, s[w].indexes);
|
|
2299
2312
|
}), Lt(e, r), void j.follow(function() {
|
|
2300
2313
|
return e.on.populate.fire(i);
|
|
2301
2314
|
}).catch(u));
|
|
2302
|
-
var
|
|
2315
|
+
var p, y;
|
|
2303
2316
|
});
|
|
2304
2317
|
}
|
|
2305
2318
|
function pa(e, n) {
|
|
@@ -2310,8 +2323,8 @@ function Ma() {
|
|
|
2310
2323
|
var i = function(u) {
|
|
2311
2324
|
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 };
|
|
2312
2325
|
var d = n.objectStore(u.name);
|
|
2313
|
-
u.add.forEach(function(
|
|
2314
|
-
pe && console.debug("Dexie upgrade patch: Creating missing index ".concat(u.name, ".").concat(
|
|
2326
|
+
u.add.forEach(function(p) {
|
|
2327
|
+
pe && console.debug("Dexie upgrade patch: Creating missing index ".concat(u.name, ".").concat(p.src)), Ft(d, p);
|
|
2315
2328
|
});
|
|
2316
2329
|
}(s[a]);
|
|
2317
2330
|
if (typeof i == "object") return i.value;
|
|
@@ -2326,10 +2339,10 @@ function Ma() {
|
|
|
2326
2339
|
var u = { name: r, def: i, recreate: !1, del: [], add: [], change: [] };
|
|
2327
2340
|
if ("" + (s.primKey.keyPath || "") != "" + (i.primKey.keyPath || "") || s.primKey.auto !== i.primKey.auto) u.recreate = !0, a.change.push(u);
|
|
2328
2341
|
else {
|
|
2329
|
-
var d = s.idxByName,
|
|
2330
|
-
for (y in d)
|
|
2331
|
-
for (y in
|
|
2332
|
-
var w = d[y], f =
|
|
2342
|
+
var d = s.idxByName, p = i.idxByName, y = void 0;
|
|
2343
|
+
for (y in d) p[y] || u.del.push(y);
|
|
2344
|
+
for (y in p) {
|
|
2345
|
+
var w = d[y], f = p[y];
|
|
2333
2346
|
w ? w.src !== f.src && u.change.push(f) : u.add.push(f);
|
|
2334
2347
|
}
|
|
2335
2348
|
(0 < u.del.length || 0 < u.add.length || 0 < u.change.length) && a.change.push(u);
|
|
@@ -2345,7 +2358,7 @@ function Ma() {
|
|
|
2345
2358
|
}), s;
|
|
2346
2359
|
}
|
|
2347
2360
|
function vr(e, n) {
|
|
2348
|
-
|
|
2361
|
+
T(e).forEach(function(r) {
|
|
2349
2362
|
n.db.objectStoreNames.contains(r) || (pe && console.debug("Dexie: Creating missing table", r), Dn(n, r, e[r].primKey, e[r].indexes));
|
|
2350
2363
|
});
|
|
2351
2364
|
}
|
|
@@ -2355,8 +2368,8 @@ function Ma() {
|
|
|
2355
2368
|
function Ut(e, n, r) {
|
|
2356
2369
|
var a = {};
|
|
2357
2370
|
return At(n.objectStoreNames, 0).forEach(function(s) {
|
|
2358
|
-
for (var i = r.objectStore(s), u = Sn(yr(y = i.keyPath), y || "", !0, !1, !!i.autoIncrement, y && typeof y != "string", !0), d = [],
|
|
2359
|
-
var w = i.index(i.indexNames[
|
|
2371
|
+
for (var i = r.objectStore(s), u = Sn(yr(y = i.keyPath), y || "", !0, !1, !!i.autoIncrement, y && typeof y != "string", !0), d = [], p = 0; p < i.indexNames.length; ++p) {
|
|
2372
|
+
var w = i.index(i.indexNames[p]), y = w.keyPath, w = Sn(w.name, y, !!w.unique, !!w.multiEntry, !1, y && typeof y != "string", !1);
|
|
2360
2373
|
d.push(w);
|
|
2361
2374
|
}
|
|
2362
2375
|
a[s] = On(s, u, d);
|
|
@@ -2367,11 +2380,11 @@ function Ma() {
|
|
|
2367
2380
|
var i = a[s], u = r.objectStore(i);
|
|
2368
2381
|
e._hasGetAll = "getAll" in u;
|
|
2369
2382
|
for (var d = 0; d < u.indexNames.length; ++d) {
|
|
2370
|
-
var
|
|
2371
|
-
!n[i] || (y = n[i].idxByName[w]) && (y.name =
|
|
2383
|
+
var p = u.indexNames[d], y = u.index(p).keyPath, w = typeof y == "string" ? y : "[" + At(y).join("+") + "]";
|
|
2384
|
+
!n[i] || (y = n[i].idxByName[w]) && (y.name = p, delete n[i].idxByName[w], n[i].idxByName[p] = y);
|
|
2372
2385
|
}
|
|
2373
2386
|
}
|
|
2374
|
-
typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) &&
|
|
2387
|
+
typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && v.WorkerGlobalScope && v instanceof v.WorkerGlobalScope && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604 && (e._hasGetAll = !1);
|
|
2375
2388
|
}
|
|
2376
2389
|
function Er(e) {
|
|
2377
2390
|
return e.split(",").map(function(n, r) {
|
|
@@ -2380,7 +2393,7 @@ function Ma() {
|
|
|
2380
2393
|
});
|
|
2381
2394
|
}
|
|
2382
2395
|
var ma = (Ht.prototype._parseStoresSpec = function(e, n) {
|
|
2383
|
-
|
|
2396
|
+
T(e).forEach(function(r) {
|
|
2384
2397
|
if (e[r] !== null) {
|
|
2385
2398
|
var a = Er(e[r]), s = a.shift();
|
|
2386
2399
|
if (s.unique = !0, s.multi) throw new L.Schema("Primary key cannot be multi-valued");
|
|
@@ -2396,7 +2409,7 @@ function Ma() {
|
|
|
2396
2409
|
var r = n._versions, a = {}, s = {};
|
|
2397
2410
|
return r.forEach(function(i) {
|
|
2398
2411
|
te(a, i._cfg.storesSource), s = i._cfg.dbschema = {}, i._parseStoresSpec(a, s);
|
|
2399
|
-
}), n._dbSchema = s, An(n, [n._allTables, n, n.Transaction.prototype]), Wt(n, [n._allTables, n, n.Transaction.prototype, this._cfg.tables],
|
|
2412
|
+
}), n._dbSchema = s, An(n, [n._allTables, n, n.Transaction.prototype]), Wt(n, [n._allTables, n, n.Transaction.prototype, this._cfg.tables], T(s), s), n._storeNames = T(s), this;
|
|
2400
2413
|
}, Ht.prototype.upgrade = function(e) {
|
|
2401
2414
|
return this._cfg.contentUpgrade = on(this._cfg.contentUpgrade || Q, e), this;
|
|
2402
2415
|
}, Ht);
|
|
@@ -2436,9 +2449,9 @@ function Ma() {
|
|
|
2436
2449
|
}
|
|
2437
2450
|
}
|
|
2438
2451
|
function wt(e, n) {
|
|
2439
|
-
Tn(n) || function r(a,
|
|
2440
|
-
var i =
|
|
2441
|
-
Et(a, i, u), d && r(a, d),
|
|
2452
|
+
Tn(n) || function r(a, p) {
|
|
2453
|
+
var i = p.from, u = p.to, d = p.l, p = p.r;
|
|
2454
|
+
Et(a, i, u), d && r(a, d), p && r(a, p);
|
|
2442
2455
|
}(e, n);
|
|
2443
2456
|
}
|
|
2444
2457
|
function wr(e, n) {
|
|
@@ -2479,7 +2492,7 @@ function Ma() {
|
|
|
2479
2492
|
return (n ? r ? Math.max(n.d, r.d) : n.d : r ? r.d : 0) + 1;
|
|
2480
2493
|
}
|
|
2481
2494
|
function Yt(e, n) {
|
|
2482
|
-
return
|
|
2495
|
+
return T(n).forEach(function(r) {
|
|
2483
2496
|
e[r] ? wt(e[r], n[r]) : e[r] = function a(s) {
|
|
2484
2497
|
var i, u, d = {};
|
|
2485
2498
|
for (i in s) ie(s, i) && (u = s[i], d[i] = !u || typeof u != "object" || Jn.has(u.constructor) ? u : a(u));
|
|
@@ -2521,23 +2534,23 @@ function Ma() {
|
|
|
2521
2534
|
var u, d = /^idb\:\/\/(.*)\/(.*)\//.exec(i);
|
|
2522
2535
|
d && (i = d[1], d = d[2], (u = ze["idb://".concat(i, "/").concat(d)]) && _r(u, e, r, n));
|
|
2523
2536
|
}
|
|
2524
|
-
r.forEach(function(
|
|
2525
|
-
return
|
|
2537
|
+
r.forEach(function(p) {
|
|
2538
|
+
return p();
|
|
2526
2539
|
});
|
|
2527
2540
|
}
|
|
2528
2541
|
function _r(e, n, r, a) {
|
|
2529
2542
|
for (var s = [], i = 0, u = Object.entries(e.queries.query); i < u.length; i++) {
|
|
2530
|
-
for (var d = u[i],
|
|
2543
|
+
for (var d = u[i], p = d[0], y = [], w = 0, f = d[1]; w < f.length; w++) {
|
|
2531
2544
|
var O = f[w];
|
|
2532
2545
|
xn(n, O.obsSet) ? O.subscribers.forEach(function(b) {
|
|
2533
2546
|
return r.add(b);
|
|
2534
2547
|
}) : a && y.push(O);
|
|
2535
2548
|
}
|
|
2536
|
-
a && s.push([
|
|
2549
|
+
a && s.push([p, y]);
|
|
2537
2550
|
}
|
|
2538
|
-
if (a) for (var m = 0,
|
|
2539
|
-
var S =
|
|
2540
|
-
e.queries.query[
|
|
2551
|
+
if (a) for (var m = 0, E = s; m < E.length; m++) {
|
|
2552
|
+
var S = E[m], p = S[0], y = S[1];
|
|
2553
|
+
e.queries.query[p] = y;
|
|
2541
2554
|
}
|
|
2542
2555
|
}
|
|
2543
2556
|
function ya(e) {
|
|
@@ -2553,30 +2566,30 @@ function Ma() {
|
|
|
2553
2566
|
function d() {
|
|
2554
2567
|
return new j(function(O, m) {
|
|
2555
2568
|
if (u(), !r) throw new L.MissingAPI();
|
|
2556
|
-
var
|
|
2569
|
+
var E = e.name, S = n.autoSchema || !s ? r.open(E) : r.open(E, s);
|
|
2557
2570
|
if (!S) throw new L.MissingAPI();
|
|
2558
2571
|
S.onerror = me(m), S.onblocked = Z(e._fireOnBlocked), S.onupgradeneeded = Z(function(b) {
|
|
2559
2572
|
var A;
|
|
2560
|
-
w = S.transaction, n.autoSchema && !e._options.allowEmptyDB ? (S.onerror = mt, w.abort(), S.result.close(), (A = r.deleteDatabase(
|
|
2561
|
-
m(new L.NoSuchDatabase("Database ".concat(
|
|
2573
|
+
w = S.transaction, n.autoSchema && !e._options.allowEmptyDB ? (S.onerror = mt, w.abort(), S.result.close(), (A = r.deleteDatabase(E)).onsuccess = A.onerror = Z(function() {
|
|
2574
|
+
m(new L.NoSuchDatabase("Database ".concat(E, " doesnt exist")));
|
|
2562
2575
|
})) : (w.onerror = me(m), b = b.oldVersion > Math.pow(2, 62) ? 0 : b.oldVersion, f = b < 1, e.idbdb = S.result, i && pa(e, w), ga(e, b / 10, w, m));
|
|
2563
2576
|
}, m), S.onsuccess = Z(function() {
|
|
2564
2577
|
w = null;
|
|
2565
|
-
var b, A, P, D, I, N = e.idbdb = S.result,
|
|
2566
|
-
if (0 <
|
|
2567
|
-
var R = N.transaction((D =
|
|
2568
|
-
if (n.autoSchema) A = N, P = R, (b = e).verno = A.version / 10, P = b._dbSchema = Ut(0, A, P), b._storeNames = At(A.objectStoreNames, 0), Wt(b, [b._allTables],
|
|
2569
|
-
else if (zt(e, e._dbSchema, R), ((I = Pn(Ut(0, (I = e).idbdb, R), I._dbSchema)).add.length || I.change.some(function(
|
|
2570
|
-
return
|
|
2578
|
+
var b, A, P, D, I, N = e.idbdb = S.result, C = At(N.objectStoreNames);
|
|
2579
|
+
if (0 < C.length) try {
|
|
2580
|
+
var R = N.transaction((D = C).length === 1 ? D[0] : D, "readonly");
|
|
2581
|
+
if (n.autoSchema) A = N, P = R, (b = e).verno = A.version / 10, P = b._dbSchema = Ut(0, A, P), b._storeNames = At(A.objectStoreNames, 0), Wt(b, [b._allTables], T(P), P);
|
|
2582
|
+
else if (zt(e, e._dbSchema, R), ((I = Pn(Ut(0, (I = e).idbdb, R), I._dbSchema)).add.length || I.change.some(function(x) {
|
|
2583
|
+
return x.add.length || x.change.length;
|
|
2571
2584
|
})) && !i) 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."), N.close(), s = N.version + 1, i = !0, O(d());
|
|
2572
2585
|
Lt(e, R);
|
|
2573
2586
|
} catch {
|
|
2574
2587
|
}
|
|
2575
|
-
tt.push(e), N.onversionchange = Z(function(
|
|
2576
|
-
n.vcFired = !0, e.on("versionchange").fire(
|
|
2577
|
-
}), N.onclose = Z(function(
|
|
2578
|
-
e.on("close").fire(
|
|
2579
|
-
}), f && (I = e._deps, R =
|
|
2588
|
+
tt.push(e), N.onversionchange = Z(function(x) {
|
|
2589
|
+
n.vcFired = !0, e.on("versionchange").fire(x);
|
|
2590
|
+
}), N.onclose = Z(function(x) {
|
|
2591
|
+
e.on("close").fire(x);
|
|
2592
|
+
}), f && (I = e._deps, R = E, N = I.indexedDB, I = I.IDBKeyRange, Nn(N) || R === jt || In(N, I).put({ name: R }).catch(Q)), O();
|
|
2580
2593
|
}, m);
|
|
2581
2594
|
}).catch(function(O) {
|
|
2582
2595
|
switch (O?.name) {
|
|
@@ -2589,14 +2602,14 @@ function Ma() {
|
|
|
2589
2602
|
return j.reject(O);
|
|
2590
2603
|
});
|
|
2591
2604
|
}
|
|
2592
|
-
var
|
|
2605
|
+
var p, y = n.dbReadyResolve, w = null, f = !1;
|
|
2593
2606
|
return j.race([a, (typeof navigator > "u" ? j.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(O) {
|
|
2594
2607
|
function m() {
|
|
2595
2608
|
return indexedDB.databases().finally(O);
|
|
2596
2609
|
}
|
|
2597
|
-
|
|
2610
|
+
p = setInterval(m, 100), m();
|
|
2598
2611
|
}).finally(function() {
|
|
2599
|
-
return clearInterval(
|
|
2612
|
+
return clearInterval(p);
|
|
2600
2613
|
}) : Promise.resolve()).then(d)]).then(function() {
|
|
2601
2614
|
return u(), n.onReadyBeingFired = [], j.resolve(Rn(function() {
|
|
2602
2615
|
return e.on.ready.fire(e.vip);
|
|
@@ -2622,8 +2635,8 @@ function Ma() {
|
|
|
2622
2635
|
}).then(function() {
|
|
2623
2636
|
var O;
|
|
2624
2637
|
return f && (O = {}, e.tables.forEach(function(m) {
|
|
2625
|
-
m.schema.indexes.forEach(function(
|
|
2626
|
-
|
|
2638
|
+
m.schema.indexes.forEach(function(E) {
|
|
2639
|
+
E.name && (O["idb://".concat(e.name, "/").concat(m.name, "/").concat(E.name)] = new ae(-1 / 0, [[[]]]));
|
|
2627
2640
|
}), O["idb://".concat(e.name, "/").concat(m.name, "/")] = O["idb://".concat(e.name, "/").concat(m.name, "/:dels")] = new ae(-1 / 0, [[[]]]);
|
|
2628
2641
|
}), Te(yt).fire(O), $n(O, !0)), e;
|
|
2629
2642
|
});
|
|
@@ -2636,9 +2649,9 @@ function Ma() {
|
|
|
2636
2649
|
return e.throw(i);
|
|
2637
2650
|
});
|
|
2638
2651
|
function s(i) {
|
|
2639
|
-
return function(
|
|
2640
|
-
var d = i(
|
|
2641
|
-
return d.done ?
|
|
2652
|
+
return function(p) {
|
|
2653
|
+
var d = i(p), p = d.value;
|
|
2654
|
+
return d.done ? p : p && typeof p.then == "function" ? p.then(r, a) : K(p) ? Promise.all(p).then(r, a) : r(p);
|
|
2642
2655
|
};
|
|
2643
2656
|
}
|
|
2644
2657
|
return s(n)();
|
|
@@ -2651,14 +2664,14 @@ function Ma() {
|
|
|
2651
2664
|
return l(l({}, e), { table: function(n) {
|
|
2652
2665
|
var r = e.table(n), a = r.schema, s = {}, i = [];
|
|
2653
2666
|
function u(f, O, m) {
|
|
2654
|
-
var
|
|
2667
|
+
var E = vt(f), S = s[E] = s[E] || [], b = f == null ? 0 : typeof f == "string" ? 1 : f.length, A = 0 < O, A = l(l({}, m), { name: A ? "".concat(E, "(virtual-from:").concat(m.name, ")") : m.name, lowLevelIndex: m, isVirtual: A, keyTail: O, keyLength: b, extractKey: _n(f), unique: !A && m.unique });
|
|
2655
2668
|
return S.push(A), A.isPrimaryKey || i.push(A), 1 < b && u(b === 2 ? f[0] : f.slice(0, b - 1), O + 1, m), S.sort(function(P, D) {
|
|
2656
2669
|
return P.keyTail - D.keyTail;
|
|
2657
2670
|
}), A;
|
|
2658
2671
|
}
|
|
2659
2672
|
n = u(a.primaryKey.keyPath, 0, a.primaryKey), s[":id"] = [n];
|
|
2660
|
-
for (var d = 0,
|
|
2661
|
-
var y =
|
|
2673
|
+
for (var d = 0, p = a.indexes; d < p.length; d++) {
|
|
2674
|
+
var y = p[d];
|
|
2662
2675
|
u(y.keyPath, 0, y);
|
|
2663
2676
|
}
|
|
2664
2677
|
function w(f) {
|
|
@@ -2672,8 +2685,8 @@ function Ma() {
|
|
|
2672
2685
|
}, query: function(f) {
|
|
2673
2686
|
return r.query(w(f));
|
|
2674
2687
|
}, openCursor: function(f) {
|
|
2675
|
-
var O = f.query.index, m = O.keyTail,
|
|
2676
|
-
return
|
|
2688
|
+
var O = f.query.index, m = O.keyTail, E = O.isVirtual, S = O.keyLength;
|
|
2689
|
+
return E ? r.openCursor(w(f)).then(function(A) {
|
|
2677
2690
|
return A && b(A);
|
|
2678
2691
|
}) : r.openCursor(f);
|
|
2679
2692
|
function b(A) {
|
|
@@ -2694,10 +2707,10 @@ function Ma() {
|
|
|
2694
2707
|
} });
|
|
2695
2708
|
} };
|
|
2696
2709
|
function Mn(e, n, r, a) {
|
|
2697
|
-
return r = r || {}, a = a || "",
|
|
2710
|
+
return r = r || {}, a = a || "", T(e).forEach(function(s) {
|
|
2698
2711
|
var i, u, d;
|
|
2699
2712
|
ie(n, s) ? (i = e[s], u = n[s], typeof i == "object" && typeof u == "object" && i && u ? (d = nn(i)) !== nn(u) ? r[a + s] = n[s] : d === "Object" ? Mn(i, u, r, a + s + ".") : i !== u && (r[a + s] = n[s]) : i !== u && (r[a + s] = n[s])) : r[a + s] = void 0;
|
|
2700
|
-
}),
|
|
2713
|
+
}), T(n).forEach(function(s) {
|
|
2701
2714
|
ie(e, s) || (r[a + s] = n[s]);
|
|
2702
2715
|
}), r;
|
|
2703
2716
|
}
|
|
@@ -2708,15 +2721,15 @@ function Ma() {
|
|
|
2708
2721
|
return l(l({}, e), { table: function(n) {
|
|
2709
2722
|
var r = e.table(n), a = r.schema.primaryKey;
|
|
2710
2723
|
return l(l({}, r), { mutate: function(s) {
|
|
2711
|
-
var i = B.trans, u = i.table(n).hook, d = u.deleting,
|
|
2724
|
+
var i = B.trans, u = i.table(n).hook, d = u.deleting, p = u.creating, y = u.updating;
|
|
2712
2725
|
switch (s.type) {
|
|
2713
2726
|
case "add":
|
|
2714
|
-
if (
|
|
2727
|
+
if (p.fire === Q) break;
|
|
2715
2728
|
return i._promise("readwrite", function() {
|
|
2716
2729
|
return w(s);
|
|
2717
2730
|
}, !0);
|
|
2718
2731
|
case "put":
|
|
2719
|
-
if (
|
|
2732
|
+
if (p.fire === Q && y.fire === Q) break;
|
|
2720
2733
|
return i._promise("readwrite", function() {
|
|
2721
2734
|
return w(s);
|
|
2722
2735
|
}, !0);
|
|
@@ -2728,11 +2741,11 @@ function Ma() {
|
|
|
2728
2741
|
case "deleteRange":
|
|
2729
2742
|
if (d.fire === Q) break;
|
|
2730
2743
|
return i._promise("readwrite", function() {
|
|
2731
|
-
return function f(O, m,
|
|
2732
|
-
return r.query({ trans: O, values: !1, query: { index: a, range: m }, limit:
|
|
2744
|
+
return function f(O, m, E) {
|
|
2745
|
+
return r.query({ trans: O, values: !1, query: { index: a, range: m }, limit: E }).then(function(S) {
|
|
2733
2746
|
var b = S.result;
|
|
2734
2747
|
return w({ type: "delete", keys: b, trans: O }).then(function(A) {
|
|
2735
|
-
return 0 < A.numFailures ? Promise.reject(A.failures[0]) : b.length <
|
|
2748
|
+
return 0 < A.numFailures ? Promise.reject(A.failures[0]) : b.length < E ? { failures: [], numFailures: 0, lastResult: void 0 } : f(O, l(l({}, m), { lower: b[b.length - 1], lowerOpen: !0 }), E);
|
|
2736
2749
|
});
|
|
2737
2750
|
});
|
|
2738
2751
|
}(s.trans, s.range, 1e4);
|
|
@@ -2740,21 +2753,21 @@ function Ma() {
|
|
|
2740
2753
|
}
|
|
2741
2754
|
return r.mutate(s);
|
|
2742
2755
|
function w(f) {
|
|
2743
|
-
var O, m,
|
|
2756
|
+
var O, m, E, S = B.trans, b = f.keys || Gn(a, f);
|
|
2744
2757
|
if (!b) throw new Error("Keys missing");
|
|
2745
|
-
return (f = f.type === "add" || f.type === "put" ? l(l({}, f), { keys: b }) : l({}, f)).type !== "delete" && (f.values =
|
|
2758
|
+
return (f = f.type === "add" || f.type === "put" ? l(l({}, f), { keys: b }) : l({}, f)).type !== "delete" && (f.values = g([], f.values)), f.keys && (f.keys = g([], f.keys)), O = r, E = b, ((m = f).type === "add" ? Promise.resolve([]) : O.getMany({ trans: m.trans, keys: E, cache: "immutable" })).then(function(A) {
|
|
2746
2759
|
var P = b.map(function(D, I) {
|
|
2747
|
-
var N,
|
|
2748
|
-
return f.type === "delete" ? d.fire.call($, D,
|
|
2749
|
-
ie(R,
|
|
2760
|
+
var N, C, R, x = A[I], $ = { onerror: null, onsuccess: null };
|
|
2761
|
+
return f.type === "delete" ? d.fire.call($, D, x, S) : f.type === "add" || x === void 0 ? (N = p.fire.call($, D, f.values[I], S), D == null && N != null && (f.keys[I] = D = N, a.outbound || ue(f.values[I], a.keyPath, D))) : (N = Mn(x, f.values[I]), (C = y.fire.call($, N, D, x, S)) && (R = f.values[I], Object.keys(C).forEach(function(k) {
|
|
2762
|
+
ie(R, k) ? R[k] = C[k] : ue(R, k, C[k]);
|
|
2750
2763
|
}))), $;
|
|
2751
2764
|
});
|
|
2752
2765
|
return r.mutate(f).then(function(D) {
|
|
2753
|
-
for (var I = D.failures, N = D.results,
|
|
2754
|
-
var
|
|
2755
|
-
|
|
2766
|
+
for (var I = D.failures, N = D.results, C = D.numFailures, D = D.lastResult, R = 0; R < b.length; ++R) {
|
|
2767
|
+
var x = (N || b)[R], $ = P[R];
|
|
2768
|
+
x == null ? $.onerror && $.onerror(I[R]) : $.onsuccess && $.onsuccess(f.type === "put" && A[R] ? f.values[R] : x);
|
|
2756
2769
|
}
|
|
2757
|
-
return { failures: I, results: N, numFailures:
|
|
2770
|
+
return { failures: I, results: N, numFailures: C, lastResult: D };
|
|
2758
2771
|
}).catch(function(D) {
|
|
2759
2772
|
return P.forEach(function(I) {
|
|
2760
2773
|
return I.onerror && I.onerror(D);
|
|
@@ -2808,22 +2821,22 @@ function Ma() {
|
|
|
2808
2821
|
if (B.subscr && s !== "readonly") throw new L.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(B.querier));
|
|
2809
2822
|
return e.transaction(a, s, i);
|
|
2810
2823
|
}, table: function(a) {
|
|
2811
|
-
var s = e.table(a), i = s.schema, u = i.primaryKey, f = i.indexes, d = u.extractKey,
|
|
2824
|
+
var s = e.table(a), i = s.schema, u = i.primaryKey, f = i.indexes, d = u.extractKey, p = u.outbound, y = u.autoIncrement && f.filter(function(m) {
|
|
2812
2825
|
return m.compound && m.keyPath.includes(u.keyPath);
|
|
2813
2826
|
}), w = l(l({}, s), { mutate: function(m) {
|
|
2814
|
-
function
|
|
2815
|
-
return
|
|
2827
|
+
function E(k) {
|
|
2828
|
+
return k = "idb://".concat(n, "/").concat(a, "/").concat(k), D[k] || (D[k] = new ae());
|
|
2816
2829
|
}
|
|
2817
|
-
var S, b, A, P = m.trans, D = m.mutatedParts || (m.mutatedParts = {}), I =
|
|
2818
|
-
return
|
|
2819
|
-
}), m.values] : [], R = $[0],
|
|
2820
|
-
return K(R) ? (I.addKeys(R), ($ =
|
|
2821
|
-
var M = S(
|
|
2830
|
+
var S, b, A, P = m.trans, D = m.mutatedParts || (m.mutatedParts = {}), I = E(""), N = E(":dels"), C = m.type, $ = m.type === "deleteRange" ? [m.range] : m.type === "delete" ? [m.keys] : m.values.length < 50 ? [Gn(u, m).filter(function(k) {
|
|
2831
|
+
return k;
|
|
2832
|
+
}), m.values] : [], R = $[0], x = $[1], $ = m.trans._cache;
|
|
2833
|
+
return K(R) ? (I.addKeys(R), ($ = C === "delete" || R.length === x.length ? Ar(R, $) : null) || N.addKeys(R), ($ || x) && (S = E, b = $, A = x, i.indexes.forEach(function(k) {
|
|
2834
|
+
var M = S(k.name || "");
|
|
2822
2835
|
function F(z) {
|
|
2823
|
-
return z != null ?
|
|
2836
|
+
return z != null ? k.extractKey(z) : null;
|
|
2824
2837
|
}
|
|
2825
2838
|
function U(z) {
|
|
2826
|
-
return
|
|
2839
|
+
return k.multiEntry && K(z) ? z.forEach(function(de) {
|
|
2827
2840
|
return M.addKey(de);
|
|
2828
2841
|
}) : M.addKey(z);
|
|
2829
2842
|
}
|
|
@@ -2831,55 +2844,55 @@ function Ma() {
|
|
|
2831
2844
|
var W = b && F(b[se]), se = A && F(A[se]);
|
|
2832
2845
|
H(W, se) !== 0 && (W != null && U(W), se != null && U(se));
|
|
2833
2846
|
});
|
|
2834
|
-
}))) : R ? (
|
|
2835
|
-
return
|
|
2836
|
-
})), s.mutate(m).then(function(
|
|
2837
|
-
return !R || m.type !== "add" && m.type !== "put" || (I.addKeys(
|
|
2847
|
+
}))) : R ? (x = { from: (x = R.lower) !== null && x !== void 0 ? x : e.MIN_KEY, to: (x = R.upper) !== null && x !== void 0 ? x : e.MAX_KEY }, N.add(x), I.add(x)) : (I.add(r), N.add(r), i.indexes.forEach(function(k) {
|
|
2848
|
+
return E(k.name).add(r);
|
|
2849
|
+
})), s.mutate(m).then(function(k) {
|
|
2850
|
+
return !R || m.type !== "add" && m.type !== "put" || (I.addKeys(k.results), y && y.forEach(function(M) {
|
|
2838
2851
|
for (var F = m.values.map(function(W) {
|
|
2839
2852
|
return M.extractKey(W);
|
|
2840
2853
|
}), U = M.keyPath.findIndex(function(W) {
|
|
2841
2854
|
return W === u.keyPath;
|
|
2842
|
-
}), z = 0, de =
|
|
2843
|
-
|
|
2844
|
-
})), P.mutatedParts = Yt(P.mutatedParts || {}, D),
|
|
2855
|
+
}), z = 0, de = k.results.length; z < de; ++z) F[z][U] = k.results[z];
|
|
2856
|
+
E(M.name).addKeys(F);
|
|
2857
|
+
})), P.mutatedParts = Yt(P.mutatedParts || {}, D), k;
|
|
2845
2858
|
});
|
|
2846
|
-
} }), f = function(
|
|
2847
|
-
var S =
|
|
2848
|
-
return [
|
|
2859
|
+
} }), f = function(E) {
|
|
2860
|
+
var S = E.query, E = S.index, S = S.range;
|
|
2861
|
+
return [E, new ae((E = S.lower) !== null && E !== void 0 ? E : e.MIN_KEY, (S = S.upper) !== null && S !== void 0 ? S : e.MAX_KEY)];
|
|
2849
2862
|
}, O = { get: function(m) {
|
|
2850
2863
|
return [u, new ae(m.key)];
|
|
2851
2864
|
}, getMany: function(m) {
|
|
2852
2865
|
return [u, new ae().addKeys(m.keys)];
|
|
2853
2866
|
}, count: f, query: f, openCursor: f };
|
|
2854
|
-
return
|
|
2855
|
-
w[m] = function(
|
|
2856
|
-
var S = B.subscr, b = !!S, A = Pr(B, s) && Dr(m,
|
|
2867
|
+
return T(O).forEach(function(m) {
|
|
2868
|
+
w[m] = function(E) {
|
|
2869
|
+
var S = B.subscr, b = !!S, A = Pr(B, s) && Dr(m, E) ? E.obsSet = {} : S;
|
|
2857
2870
|
if (b) {
|
|
2858
|
-
var P = function(
|
|
2859
|
-
return
|
|
2860
|
-
}, D = P(""), I = P(":dels"), S = O[m](
|
|
2861
|
-
if ((m === "query" && b.isPrimaryKey && !
|
|
2871
|
+
var P = function(x) {
|
|
2872
|
+
return x = "idb://".concat(n, "/").concat(a, "/").concat(x), A[x] || (A[x] = new ae());
|
|
2873
|
+
}, D = P(""), I = P(":dels"), S = O[m](E), b = S[0], S = S[1];
|
|
2874
|
+
if ((m === "query" && b.isPrimaryKey && !E.values ? I : P(b.name || "")).add(S), !b.isPrimaryKey) {
|
|
2862
2875
|
if (m !== "count") {
|
|
2863
|
-
var N = m === "query" &&
|
|
2864
|
-
return s[m].apply(this, arguments).then(function(
|
|
2876
|
+
var N = m === "query" && p && E.values && s.query(l(l({}, E), { values: !1 }));
|
|
2877
|
+
return s[m].apply(this, arguments).then(function(x) {
|
|
2865
2878
|
if (m === "query") {
|
|
2866
|
-
if (
|
|
2867
|
-
return F = F.result, D.addKeys(F),
|
|
2879
|
+
if (p && E.values) return N.then(function(F) {
|
|
2880
|
+
return F = F.result, D.addKeys(F), x;
|
|
2868
2881
|
});
|
|
2869
|
-
var $ =
|
|
2870
|
-
(
|
|
2882
|
+
var $ = E.values ? x.result.map(d) : x.result;
|
|
2883
|
+
(E.values ? D : I).addKeys($);
|
|
2871
2884
|
} else if (m === "openCursor") {
|
|
2872
|
-
var
|
|
2873
|
-
return
|
|
2874
|
-
return I.addKey(
|
|
2885
|
+
var k = x, M = E.values;
|
|
2886
|
+
return k && Object.create(k, { key: { get: function() {
|
|
2887
|
+
return I.addKey(k.primaryKey), k.key;
|
|
2875
2888
|
} }, primaryKey: { get: function() {
|
|
2876
|
-
var F =
|
|
2889
|
+
var F = k.primaryKey;
|
|
2877
2890
|
return I.addKey(F), F;
|
|
2878
2891
|
} }, value: { get: function() {
|
|
2879
|
-
return M && D.addKey(
|
|
2892
|
+
return M && D.addKey(k.primaryKey), k.value;
|
|
2880
2893
|
} } });
|
|
2881
2894
|
}
|
|
2882
|
-
return
|
|
2895
|
+
return x;
|
|
2883
2896
|
});
|
|
2884
2897
|
}
|
|
2885
2898
|
I.add(r);
|
|
@@ -2906,28 +2919,28 @@ function Ma() {
|
|
|
2906
2919
|
}
|
|
2907
2920
|
function Nr(e, n, O, a, s, i) {
|
|
2908
2921
|
if (!O || O.length === 0) return e;
|
|
2909
|
-
var u = n.query.index, d = u.multiEntry,
|
|
2922
|
+
var u = n.query.index, d = u.multiEntry, p = n.query.range, y = a.schema.primaryKey.extractKey, w = u.extractKey, f = (u.lowLevelIndex || u).extractKey, O = O.reduce(function(m, E) {
|
|
2910
2923
|
var S = m, b = [];
|
|
2911
|
-
if (
|
|
2912
|
-
var D, I =
|
|
2913
|
-
A.hasKey(N) || (D = w(I), (d && K(D) ? D.some(function(
|
|
2914
|
-
return Kn(
|
|
2915
|
-
}) : Kn(D,
|
|
2924
|
+
if (E.type === "add" || E.type === "put") for (var A = new ae(), P = E.values.length - 1; 0 <= P; --P) {
|
|
2925
|
+
var D, I = E.values[P], N = y(I);
|
|
2926
|
+
A.hasKey(N) || (D = w(I), (d && K(D) ? D.some(function(k) {
|
|
2927
|
+
return Kn(k, p);
|
|
2928
|
+
}) : Kn(D, p)) && (A.addKey(N), b.push(I)));
|
|
2916
2929
|
}
|
|
2917
|
-
switch (
|
|
2930
|
+
switch (E.type) {
|
|
2918
2931
|
case "add":
|
|
2919
|
-
var
|
|
2932
|
+
var C = new ae().addKeys(n.values ? m.map(function(M) {
|
|
2920
2933
|
return y(M);
|
|
2921
2934
|
}) : m), S = m.concat(n.values ? b.filter(function(M) {
|
|
2922
|
-
return M = y(M), !
|
|
2935
|
+
return M = y(M), !C.hasKey(M) && (C.addKey(M), !0);
|
|
2923
2936
|
}) : b.map(function(M) {
|
|
2924
2937
|
return y(M);
|
|
2925
2938
|
}).filter(function(M) {
|
|
2926
|
-
return !
|
|
2939
|
+
return !C.hasKey(M) && (C.addKey(M), !0);
|
|
2927
2940
|
}));
|
|
2928
2941
|
break;
|
|
2929
2942
|
case "put":
|
|
2930
|
-
var R = new ae().addKeys(
|
|
2943
|
+
var R = new ae().addKeys(E.values.map(function(M) {
|
|
2931
2944
|
return y(M);
|
|
2932
2945
|
}));
|
|
2933
2946
|
S = m.filter(function(M) {
|
|
@@ -2937,21 +2950,21 @@ function Ma() {
|
|
|
2937
2950
|
}));
|
|
2938
2951
|
break;
|
|
2939
2952
|
case "delete":
|
|
2940
|
-
var
|
|
2953
|
+
var x = new ae().addKeys(E.keys);
|
|
2941
2954
|
S = m.filter(function(M) {
|
|
2942
|
-
return !
|
|
2955
|
+
return !x.hasKey(n.values ? y(M) : M);
|
|
2943
2956
|
});
|
|
2944
2957
|
break;
|
|
2945
2958
|
case "deleteRange":
|
|
2946
|
-
var $ =
|
|
2959
|
+
var $ = E.range;
|
|
2947
2960
|
S = m.filter(function(M) {
|
|
2948
2961
|
return !Kn(y(M), $);
|
|
2949
2962
|
});
|
|
2950
2963
|
}
|
|
2951
2964
|
return S;
|
|
2952
2965
|
}, e);
|
|
2953
|
-
return O === e ? e : (O.sort(function(m,
|
|
2954
|
-
return H(f(m), f(
|
|
2966
|
+
return O === e ? e : (O.sort(function(m, E) {
|
|
2967
|
+
return H(f(m), f(E)) || H(y(m), y(E));
|
|
2955
2968
|
}), n.limit && n.limit < 1 / 0 && (O.length > n.limit ? O.length = n.limit : e.length === n.limit && O.length < n.limit && (s.dirty = !0)), i ? Object.freeze(O) : O);
|
|
2956
2969
|
}
|
|
2957
2970
|
function Rr(e, n) {
|
|
@@ -2990,25 +3003,25 @@ function Ma() {
|
|
|
2990
3003
|
var n = e.schema.name;
|
|
2991
3004
|
return l(l({}, e), { transaction: function(r, a, s) {
|
|
2992
3005
|
var i, u, d = e.transaction(r, a, s);
|
|
2993
|
-
return a === "readwrite" && (u = (i = new AbortController()).signal, s = function(
|
|
3006
|
+
return a === "readwrite" && (u = (i = new AbortController()).signal, s = function(p) {
|
|
2994
3007
|
return function() {
|
|
2995
3008
|
if (i.abort(), a === "readwrite") {
|
|
2996
3009
|
for (var y = /* @__PURE__ */ new Set(), w = 0, f = r; w < f.length; w++) {
|
|
2997
3010
|
var O = f[w], m = ze["idb://".concat(n, "/").concat(O)];
|
|
2998
3011
|
if (m) {
|
|
2999
|
-
var
|
|
3012
|
+
var E = e.table(O), S = m.optimisticOps.filter(function(M) {
|
|
3000
3013
|
return M.trans === d;
|
|
3001
3014
|
});
|
|
3002
|
-
if (d._explicit &&
|
|
3015
|
+
if (d._explicit && p && d.mutatedParts) for (var b = 0, A = Object.values(m.queries.query); b < A.length; b++) for (var P = 0, D = (C = A[b]).slice(); P < D.length; P++) xn((R = D[P]).obsSet, d.mutatedParts) && (je(C, R), R.subscribers.forEach(function(M) {
|
|
3003
3016
|
return y.add(M);
|
|
3004
3017
|
}));
|
|
3005
3018
|
else if (0 < S.length) {
|
|
3006
3019
|
m.optimisticOps = m.optimisticOps.filter(function(M) {
|
|
3007
3020
|
return M.trans !== d;
|
|
3008
3021
|
});
|
|
3009
|
-
for (var I = 0, N = Object.values(m.queries.query); I < N.length; I++) for (var
|
|
3022
|
+
for (var I = 0, N = Object.values(m.queries.query); I < N.length; I++) for (var C, R, x, $ = 0, k = (C = N[I]).slice(); $ < k.length; $++) (R = k[$]).res != null && d.mutatedParts && (p && !R.dirty ? (x = Object.isFrozen(R.res), x = Nr(R.res, R.req, S, E, R, x), R.dirty ? (je(C, R), R.subscribers.forEach(function(M) {
|
|
3010
3023
|
return y.add(M);
|
|
3011
|
-
})) :
|
|
3024
|
+
})) : x !== R.res && (R.res = x, R.promise = j.resolve({ result: x }))) : (R.dirty && je(C, R), R.subscribers.forEach(function(M) {
|
|
3012
3025
|
return y.add(M);
|
|
3013
3026
|
})));
|
|
3014
3027
|
}
|
|
@@ -3026,25 +3039,25 @@ function Ma() {
|
|
|
3026
3039
|
var u = B.trans;
|
|
3027
3040
|
if (s.outbound || u.db._options.cache === "disabled" || u.explicit || u.idbtrans.mode !== "readwrite") return a.mutate(i);
|
|
3028
3041
|
var d = ze["idb://".concat(n, "/").concat(r)];
|
|
3029
|
-
return d ? (u = a.mutate(i), i.type !== "add" && i.type !== "put" || !(50 <= i.values.length || Gn(s, i).some(function(
|
|
3030
|
-
return
|
|
3031
|
-
})) ? (d.optimisticOps.push(i), i.mutatedParts && Qt(i.mutatedParts), u.then(function(
|
|
3032
|
-
0 <
|
|
3042
|
+
return d ? (u = a.mutate(i), i.type !== "add" && i.type !== "put" || !(50 <= i.values.length || Gn(s, i).some(function(p) {
|
|
3043
|
+
return p == null;
|
|
3044
|
+
})) ? (d.optimisticOps.push(i), i.mutatedParts && Qt(i.mutatedParts), u.then(function(p) {
|
|
3045
|
+
0 < p.numFailures && (je(d.optimisticOps, i), (p = Ir(0, i, p)) && d.optimisticOps.push(p), i.mutatedParts && Qt(i.mutatedParts));
|
|
3033
3046
|
}), u.catch(function() {
|
|
3034
3047
|
je(d.optimisticOps, i), i.mutatedParts && Qt(i.mutatedParts);
|
|
3035
|
-
})) : u.then(function(
|
|
3048
|
+
})) : u.then(function(p) {
|
|
3036
3049
|
var y = Ir(0, l(l({}, i), { values: i.values.map(function(w, f) {
|
|
3037
3050
|
var O;
|
|
3038
|
-
return
|
|
3039
|
-
}) }),
|
|
3051
|
+
return p.failures[f] ? w : (w = (O = s.keyPath) !== null && O !== void 0 && O.includes(".") ? $e(w) : l({}, w), ue(w, s.keyPath, p.results[f]), w);
|
|
3052
|
+
}) }), p);
|
|
3040
3053
|
d.optimisticOps.push(y), queueMicrotask(function() {
|
|
3041
3054
|
return i.mutatedParts && Qt(i.mutatedParts);
|
|
3042
3055
|
});
|
|
3043
3056
|
}), u) : a.mutate(i);
|
|
3044
3057
|
}, query: function(i) {
|
|
3045
3058
|
if (!Pr(B, a) || !Dr("query", i)) return a.query(i);
|
|
3046
|
-
var u = ((y = B.trans) === null || y === void 0 ? void 0 : y.db._options.cache) === "immutable", f = B, d = f.requery,
|
|
3047
|
-
var P = ze["idb://".concat(
|
|
3059
|
+
var u = ((y = B.trans) === null || y === void 0 ? void 0 : y.db._options.cache) === "immutable", f = B, d = f.requery, p = f.signal, y = function(E, S, b, A) {
|
|
3060
|
+
var P = ze["idb://".concat(E, "/").concat(S)];
|
|
3048
3061
|
if (!P) return [];
|
|
3049
3062
|
if (!(S = P.queries[b])) return [null, !1, P, null];
|
|
3050
3063
|
var D = S[(A.query ? A.query.index.name : null) || ""];
|
|
@@ -3063,17 +3076,17 @@ function Ma() {
|
|
|
3063
3076
|
}), [I, !!I, P, D];
|
|
3064
3077
|
}
|
|
3065
3078
|
}(n, r, "query", i), w = y[0], f = y[1], O = y[2], m = y[3];
|
|
3066
|
-
return w && f ? w.obsSet = i.obsSet : (f = a.query(i).then(function(
|
|
3067
|
-
var S =
|
|
3079
|
+
return w && f ? w.obsSet = i.obsSet : (f = a.query(i).then(function(E) {
|
|
3080
|
+
var S = E.result;
|
|
3068
3081
|
if (w && (w.res = S), u) {
|
|
3069
3082
|
for (var b = 0, A = S.length; b < A; ++b) Object.freeze(S[b]);
|
|
3070
3083
|
Object.freeze(S);
|
|
3071
|
-
} else
|
|
3072
|
-
return
|
|
3073
|
-
}).catch(function(
|
|
3074
|
-
return m && w && je(m, w), Promise.reject(
|
|
3075
|
-
}), w = { obsSet: i.obsSet, promise: f, subscribers: /* @__PURE__ */ new Set(), type: "query", req: i, dirty: !1 }, m ? m.push(w) : (m = [w], (O = O || (ze["idb://".concat(n, "/").concat(r)] = { queries: { query: {}, count: {} }, objs: /* @__PURE__ */ new Map(), optimisticOps: [], unsignaledParts: {} })).queries.query[i.query.index.name || ""] = m)), Oa(w, m, d,
|
|
3076
|
-
return { result: Nr(
|
|
3084
|
+
} else E.result = $e(S);
|
|
3085
|
+
return E;
|
|
3086
|
+
}).catch(function(E) {
|
|
3087
|
+
return m && w && je(m, w), Promise.reject(E);
|
|
3088
|
+
}), w = { obsSet: i.obsSet, promise: f, subscribers: /* @__PURE__ */ new Set(), type: "query", req: i, dirty: !1 }, m ? m.push(w) : (m = [w], (O = O || (ze["idb://".concat(n, "/").concat(r)] = { queries: { query: {}, count: {} }, objs: /* @__PURE__ */ new Map(), optimisticOps: [], unsignaledParts: {} })).queries.query[i.query.index.name || ""] = m)), Oa(w, m, d, p), w.promise.then(function(E) {
|
|
3089
|
+
return { result: Nr(E.result, i, O?.optimisticOps, a, w, u) };
|
|
3077
3090
|
});
|
|
3078
3091
|
} });
|
|
3079
3092
|
} });
|
|
@@ -3142,8 +3155,8 @@ function Ma() {
|
|
|
3142
3155
|
n.close(e);
|
|
3143
3156
|
var d = n._deps.indexedDB.deleteDatabase(n.name);
|
|
3144
3157
|
d.onsuccess = Z(function() {
|
|
3145
|
-
var
|
|
3146
|
-
|
|
3158
|
+
var p, y, w;
|
|
3159
|
+
p = n._deps, y = n.name, w = p.indexedDB, p = p.IDBKeyRange, Nn(w) || y === jt || In(w, p).delete(y).catch(Q), s();
|
|
3147
3160
|
}), d.onerror = me(i), d.onblocked = n._fireOnBlocked;
|
|
3148
3161
|
}
|
|
3149
3162
|
if (r) throw new L.InvalidArgument("Invalid closeOptions argument to db.delete()");
|
|
@@ -3162,7 +3175,7 @@ function Ma() {
|
|
|
3162
3175
|
return this._state.autoSchema;
|
|
3163
3176
|
}, Object.defineProperty(ee.prototype, "tables", { get: function() {
|
|
3164
3177
|
var e = this;
|
|
3165
|
-
return
|
|
3178
|
+
return T(this._allTables).map(function(n) {
|
|
3166
3179
|
return e._allTables[n];
|
|
3167
3180
|
});
|
|
3168
3181
|
}, enumerable: !1, configurable: !0 }), ee.prototype.transaction = function() {
|
|
@@ -3204,7 +3217,7 @@ function Ma() {
|
|
|
3204
3217
|
f(y);
|
|
3205
3218
|
}) : q(y);
|
|
3206
3219
|
}
|
|
3207
|
-
var
|
|
3220
|
+
var p = function y(w, f, O, m, E) {
|
|
3208
3221
|
return j.resolve().then(function() {
|
|
3209
3222
|
var S = B.transless || B, b = w._createTransaction(f, O, w._dbSchema, m);
|
|
3210
3223
|
if (b.explicit = !0, S = { trans: b, transless: S }, m) b.idbtrans = m.idbtrans;
|
|
@@ -3212,13 +3225,13 @@ function Ma() {
|
|
|
3212
3225
|
b.create(), b.idbtrans._explicit = !0, w._state.PR1398_maxLoop = 3;
|
|
3213
3226
|
} catch (D) {
|
|
3214
3227
|
return D.name === sn.InvalidState && w.isOpen() && 0 < --w._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), w.close({ disableAutoOpen: !1 }), w.open().then(function() {
|
|
3215
|
-
return y(w, f, O, null,
|
|
3228
|
+
return y(w, f, O, null, E);
|
|
3216
3229
|
})) : q(D);
|
|
3217
3230
|
}
|
|
3218
|
-
var A, P = an(
|
|
3231
|
+
var A, P = an(E);
|
|
3219
3232
|
return P && et(), S = j.follow(function() {
|
|
3220
3233
|
var D;
|
|
3221
|
-
(A =
|
|
3234
|
+
(A = E.call(b, b)) && (P ? (D = Ie.bind(null, null), A.then(D, D)) : typeof A.next == "function" && typeof A.throw == "function" && (A = jn(A)));
|
|
3222
3235
|
}, S), (A && typeof A.then == "function" ? j.resolve(A).then(function(D) {
|
|
3223
3236
|
return b.active ? D : q(new L.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
|
|
3224
3237
|
}) : S.then(function() {
|
|
@@ -3232,9 +3245,9 @@ function Ma() {
|
|
|
3232
3245
|
});
|
|
3233
3246
|
});
|
|
3234
3247
|
}.bind(null, this, i, u, s, r);
|
|
3235
|
-
return s ? s._promise(i,
|
|
3236
|
-
return a._whenReady(
|
|
3237
|
-
}) : this._whenReady(
|
|
3248
|
+
return s ? s._promise(i, p, "lock") : B.trans ? We(B.transless, function() {
|
|
3249
|
+
return a._whenReady(p);
|
|
3250
|
+
}) : this._whenReady(p);
|
|
3238
3251
|
}, ee.prototype.table = function(e) {
|
|
3239
3252
|
if (!ie(this._allTables, e)) throw new L.InvalidTable("Table ".concat(e, " does not exist"));
|
|
3240
3253
|
return this._allTables[e];
|
|
@@ -3244,7 +3257,7 @@ function Ma() {
|
|
|
3244
3257
|
this._middlewares = {}, this.verno = 0;
|
|
3245
3258
|
var a = ee.dependencies;
|
|
3246
3259
|
this._options = n = l({ addons: ee.addons, autoOpen: !0, indexedDB: a.indexedDB, IDBKeyRange: a.IDBKeyRange, cache: "cloned" }, n), this._deps = { indexedDB: n.indexedDB, IDBKeyRange: n.IDBKeyRange }, a = n.addons, this._dbSchema = {}, this._versions = [], this._storeNames = [], this._allTables = {}, this.idbdb = null, this._novip = this;
|
|
3247
|
-
var s, i, u, d,
|
|
3260
|
+
var s, i, 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: n.autoOpen };
|
|
3248
3261
|
y.dbReadyPromise = new j(function(f) {
|
|
3249
3262
|
y.dbReadyResolve = f;
|
|
3250
3263
|
}), y.openCanceller = new j(function(f, O) {
|
|
@@ -3252,27 +3265,27 @@ function Ma() {
|
|
|
3252
3265
|
}), this._state = y, this.name = e, this.on = ht(this, "populate", "blocked", "versionchange", "close", { ready: [on, Q] }), this.on.ready.subscribe = Vn(this.on.ready.subscribe, function(f) {
|
|
3253
3266
|
return function(O, m) {
|
|
3254
3267
|
ee.vip(function() {
|
|
3255
|
-
var
|
|
3256
|
-
S.openComplete ? (S.dbOpenError || j.resolve().then(O), m && f(O)) : S.onReadyBeingFired ? (S.onReadyBeingFired.push(O), m && f(O)) : (f(O),
|
|
3257
|
-
|
|
3268
|
+
var E, S = r._state;
|
|
3269
|
+
S.openComplete ? (S.dbOpenError || j.resolve().then(O), m && f(O)) : S.onReadyBeingFired ? (S.onReadyBeingFired.push(O), m && f(O)) : (f(O), E = r, m || f(function b() {
|
|
3270
|
+
E.on.ready.unsubscribe(O), E.on.ready.unsubscribe(b);
|
|
3258
3271
|
}));
|
|
3259
3272
|
});
|
|
3260
3273
|
};
|
|
3261
3274
|
}), this.Collection = (s = this, gt(oa.prototype, function(A, b) {
|
|
3262
3275
|
this.db = s;
|
|
3263
|
-
var m = ir,
|
|
3276
|
+
var m = ir, E = null;
|
|
3264
3277
|
if (b) try {
|
|
3265
3278
|
m = b();
|
|
3266
3279
|
} catch (P) {
|
|
3267
|
-
|
|
3280
|
+
E = P;
|
|
3268
3281
|
}
|
|
3269
3282
|
var S = A._ctx, b = S.table, A = b.hook.reading.fire;
|
|
3270
|
-
this._ctx = { table: b, index: S.index, isPrimKey: !S.index || b.schema.primKey.keyPath && S.index === b.schema.primKey.name, range: m, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error:
|
|
3283
|
+
this._ctx = { table: b, index: S.index, isPrimKey: !S.index || b.schema.primKey.keyPath && S.index === b.schema.primKey.name, range: m, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: E, or: S.or, valueMapper: A !== ct ? A : null };
|
|
3271
3284
|
})), this.Table = (i = this, gt(dr.prototype, function(f, O, m) {
|
|
3272
3285
|
this.db = i, this._tx = m, this.name = f, this.schema = O, this.hook = i._allTables[f] ? i._allTables[f].hook : ht(null, { creating: [Jr, Q], reading: [Xr, ct], updating: [qr, Q], deleting: [Zr, Q] });
|
|
3273
|
-
})), this.Transaction = (u = this, gt(ua.prototype, function(f, O, m,
|
|
3286
|
+
})), this.Transaction = (u = this, gt(ua.prototype, function(f, O, m, E, S) {
|
|
3274
3287
|
var b = this;
|
|
3275
|
-
this.db = u, this.mode = f, this.storeNames = O, this.schema = m, this.chromeTransactionDurability =
|
|
3288
|
+
this.db = u, this.mode = f, this.storeNames = O, this.schema = m, this.chromeTransactionDurability = E, this.idbtrans = null, this.on = ht(this, "complete", "error", "abort"), this.parent = S || null, this.active = !0, this._reculock = 0, this._blockedFuncs = [], this._resolve = null, this._reject = null, this._waitingFor = null, this._waitingQueue = null, this._spinCount = 0, this._completion = new j(function(A, P) {
|
|
3276
3289
|
b._resolve = A, b._reject = P;
|
|
3277
3290
|
}), this._completion.then(function() {
|
|
3278
3291
|
b.active = !1, b.on.complete.fire();
|
|
@@ -3282,20 +3295,20 @@ function Ma() {
|
|
|
3282
3295
|
});
|
|
3283
3296
|
})), this.Version = (d = this, gt(ma.prototype, function(f) {
|
|
3284
3297
|
this.db = d, this._cfg = { version: f, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
|
|
3285
|
-
})), this.WhereClause = (
|
|
3286
|
-
if (this.db =
|
|
3287
|
-
return H(S,
|
|
3288
|
-
}, this._max = function(
|
|
3289
|
-
return 0 < H(
|
|
3290
|
-
}, this._min = function(
|
|
3291
|
-
return H(
|
|
3292
|
-
}, this._IDBKeyRange =
|
|
3298
|
+
})), this.WhereClause = (p = this, gt(mr.prototype, function(f, O, m) {
|
|
3299
|
+
if (this.db = p, this._ctx = { table: f, index: O === ":id" ? null : O, or: m }, this._cmp = this._ascending = H, this._descending = function(E, S) {
|
|
3300
|
+
return H(S, E);
|
|
3301
|
+
}, this._max = function(E, S) {
|
|
3302
|
+
return 0 < H(E, S) ? E : S;
|
|
3303
|
+
}, this._min = function(E, S) {
|
|
3304
|
+
return H(E, S) < 0 ? E : S;
|
|
3305
|
+
}, this._IDBKeyRange = p._deps.IDBKeyRange, !this._IDBKeyRange) throw new L.MissingAPI();
|
|
3293
3306
|
})), this.on("versionchange", function(f) {
|
|
3294
3307
|
0 < f.newVersion ? console.warn("Another connection wants to upgrade database '".concat(r.name, "'. Closing db now to resume the upgrade.")) : console.warn("Another connection wants to delete database '".concat(r.name, "'. Closing db now to resume the delete request.")), r.close({ disableAutoOpen: !1 });
|
|
3295
3308
|
}), this.on("blocked", function(f) {
|
|
3296
3309
|
!f.newVersion || f.newVersion < f.oldVersion ? console.warn("Dexie.delete('".concat(r.name, "') was blocked")) : console.warn("Upgrade '".concat(r.name, "' blocked by other connection holding version ").concat(f.oldVersion / 10));
|
|
3297
|
-
}), this._maxKey = bt(n.IDBKeyRange), this._createTransaction = function(f, O, m,
|
|
3298
|
-
return new r.Transaction(f, O, m, r._options.chromeTransactionDurability,
|
|
3310
|
+
}), this._maxKey = bt(n.IDBKeyRange), this._createTransaction = function(f, O, m, E) {
|
|
3311
|
+
return new r.Transaction(f, O, m, r._options.chromeTransactionDurability, E);
|
|
3299
3312
|
}, this._fireOnBlocked = function(f) {
|
|
3300
3313
|
r.on("blocked").fire(f), tt.filter(function(O) {
|
|
3301
3314
|
return O.name === r.name && O !== r && !O._state.vcFired;
|
|
@@ -3308,12 +3321,12 @@ function Ma() {
|
|
|
3308
3321
|
if (O === "table") return function(S) {
|
|
3309
3322
|
return Jt(r.table(S), w);
|
|
3310
3323
|
};
|
|
3311
|
-
var
|
|
3312
|
-
return
|
|
3324
|
+
var E = Reflect.get(f, O, m);
|
|
3325
|
+
return E instanceof dr ? Jt(E, w) : O === "tables" ? E.map(function(S) {
|
|
3313
3326
|
return Jt(S, w);
|
|
3314
3327
|
}) : O === "_createTransaction" ? function() {
|
|
3315
|
-
return Jt(
|
|
3316
|
-
} :
|
|
3328
|
+
return Jt(E.apply(this, arguments), w);
|
|
3329
|
+
} : E;
|
|
3317
3330
|
} });
|
|
3318
3331
|
this.vip = w, a.forEach(function(f) {
|
|
3319
3332
|
return f(r);
|
|
@@ -3328,25 +3341,25 @@ function Ma() {
|
|
|
3328
3341
|
this._subscribe = e;
|
|
3329
3342
|
}
|
|
3330
3343
|
try {
|
|
3331
|
-
Zt = { indexedDB:
|
|
3344
|
+
Zt = { indexedDB: v.indexedDB || v.mozIndexedDB || v.webkitIndexedDB || v.msIndexedDB, IDBKeyRange: v.IDBKeyRange || v.webkitIDBKeyRange };
|
|
3332
3345
|
} catch {
|
|
3333
3346
|
Zt = { indexedDB: null, IDBKeyRange: null };
|
|
3334
3347
|
}
|
|
3335
3348
|
function Tr(e) {
|
|
3336
3349
|
var n, r = !1, a = new Aa(function(s) {
|
|
3337
|
-
var i = an(e), u, d = !1,
|
|
3350
|
+
var i = an(e), u, d = !1, p = {}, y = {}, w = { get closed() {
|
|
3338
3351
|
return d;
|
|
3339
3352
|
}, unsubscribe: function() {
|
|
3340
3353
|
d || (d = !0, u && u.abort(), f && Te.storagemutated.unsubscribe(m));
|
|
3341
3354
|
} };
|
|
3342
3355
|
s.start && s.start(w);
|
|
3343
3356
|
var f = !1, O = function() {
|
|
3344
|
-
return pn(
|
|
3357
|
+
return pn(E);
|
|
3345
3358
|
}, m = function(S) {
|
|
3346
|
-
Yt(
|
|
3347
|
-
},
|
|
3359
|
+
Yt(p, S), xn(y, p) && O();
|
|
3360
|
+
}, E = function() {
|
|
3348
3361
|
var S, b, A;
|
|
3349
|
-
!d && Zt.indexedDB && (
|
|
3362
|
+
!d && Zt.indexedDB && (p = {}, S = {}, u && u.abort(), u = new AbortController(), A = function(P) {
|
|
3350
3363
|
var D = Ze();
|
|
3351
3364
|
try {
|
|
3352
3365
|
i && et();
|
|
@@ -3356,7 +3369,7 @@ function Ma() {
|
|
|
3356
3369
|
D && qe();
|
|
3357
3370
|
}
|
|
3358
3371
|
}(b = { subscr: S, signal: u.signal, requery: O, querier: e, trans: null }), Promise.resolve(A).then(function(P) {
|
|
3359
|
-
r = !0, n = P, d || b.signal.aborted || (
|
|
3372
|
+
r = !0, n = P, d || b.signal.aborted || (p = {}, function(D) {
|
|
3360
3373
|
for (var I in D) if (ie(D, I)) return;
|
|
3361
3374
|
return 1;
|
|
3362
3375
|
}(y = S) || f || (Te(yt, m), f = !0), pn(function() {
|
|
@@ -3590,10 +3603,10 @@ class Mr {
|
|
|
3590
3603
|
} : (o.message = `Dashboard ${t.id} retrieved from storage`, o.success = !0, o);
|
|
3591
3604
|
};
|
|
3592
3605
|
getDashboards = async (t) => {
|
|
3593
|
-
const o = (
|
|
3606
|
+
const o = (v) => t?.id === v.id, l = (v) => t?.name ? v.name.includes(t?.name) : !1, g = await this.db.table(_.DASHBOARD).toArray().then((v) => t?.id ? v.filter(o) : v).then((v) => t?.name ? v.filter(l) : v).catch(() => {
|
|
3594
3607
|
G(2, ["%cstorage", c.STORAGE, X.DASHBOARD_LOAD, t]);
|
|
3595
3608
|
});
|
|
3596
|
-
return
|
|
3609
|
+
return g !== void 0 && G(3, [
|
|
3597
3610
|
"%cstorage%c %cdashboards",
|
|
3598
3611
|
c.STORAGE,
|
|
3599
3612
|
c.NONE,
|
|
@@ -3601,9 +3614,9 @@ class Mr {
|
|
|
3601
3614
|
t
|
|
3602
3615
|
]), {
|
|
3603
3616
|
// @ts-ignore
|
|
3604
|
-
data:
|
|
3605
|
-
message:
|
|
3606
|
-
success:
|
|
3617
|
+
data: g !== void 0 ? { dashboards: g, query: t } : null,
|
|
3618
|
+
message: g !== void 0 ? "Dashboards loaded from storage" : "Dashboards load error",
|
|
3619
|
+
success: g !== void 0
|
|
3607
3620
|
};
|
|
3608
3621
|
};
|
|
3609
3622
|
/**
|
|
@@ -3632,21 +3645,21 @@ class Mr {
|
|
|
3632
3645
|
* Wipe Message data after expires timestamp
|
|
3633
3646
|
*/
|
|
3634
3647
|
cleanMessages = async () => {
|
|
3635
|
-
const t = Date.now() / 1e3, o = (
|
|
3636
|
-
return await this.db.table(_.TOPICS).orderBy("expires").filter(o).delete().catch((
|
|
3648
|
+
const t = Date.now() / 1e3, o = (v) => v.expires < t, l = (v) => v.expires < t;
|
|
3649
|
+
return await this.db.table(_.TOPICS).orderBy("expires").filter(o).delete().catch((v) => (console.error(
|
|
3637
3650
|
"%cstorage%c %cclean",
|
|
3638
3651
|
c.STORAGE,
|
|
3639
3652
|
c.NONE,
|
|
3640
3653
|
c.MESSAGES,
|
|
3641
|
-
|
|
3642
|
-
), 0)), await this.db.table(_.MESSAGES).orderBy("expires").filter(l).delete().catch((
|
|
3654
|
+
v.message
|
|
3655
|
+
), 0)), await this.db.table(_.MESSAGES).orderBy("expires").filter(l).delete().catch((v) => (console.error(
|
|
3643
3656
|
"%clean%c %cstorage%c %cmessages",
|
|
3644
3657
|
c.OK,
|
|
3645
3658
|
c.NONE,
|
|
3646
3659
|
c.STORAGE,
|
|
3647
3660
|
c.NONE,
|
|
3648
3661
|
c.MESSAGES,
|
|
3649
|
-
|
|
3662
|
+
v.message
|
|
3650
3663
|
), 0));
|
|
3651
3664
|
};
|
|
3652
3665
|
/**
|
|
@@ -3672,9 +3685,9 @@ class Mr {
|
|
|
3672
3685
|
};
|
|
3673
3686
|
const o = t?.order ?? "utc", l = Math.floor(Date.now() / 1e3);
|
|
3674
3687
|
o !== "utc" && (t.since = l - 60 * 60 * 24 * 30), this.options.delay != 0 ? t.before = l - (this.options.delay || 0) : t.before = l;
|
|
3675
|
-
const
|
|
3688
|
+
const g = (K) => K.utc > (t?.since || 0), v = (K) => K.utc < (t?.before || l), T = (K) => K?.visible !== 0;
|
|
3676
3689
|
try {
|
|
3677
|
-
const te = await this.db.table(_.TOPICS).where("widget_id").equals(t.widget).filter(
|
|
3690
|
+
const te = await this.db.table(_.TOPICS).where("widget_id").equals(t.widget).filter(T).filter(g).filter(v).reverse().limit(t?.limit ?? 25).sortBy(o);
|
|
3678
3691
|
if (te.length === 0)
|
|
3679
3692
|
return {
|
|
3680
3693
|
data: null,
|
|
@@ -3736,68 +3749,68 @@ class Mr {
|
|
|
3736
3749
|
if (t.type !== _.MESSAGES)
|
|
3737
3750
|
return 400;
|
|
3738
3751
|
const l = o.data.title;
|
|
3739
|
-
let
|
|
3740
|
-
return await o.data.messages.forEach(async (
|
|
3741
|
-
|
|
3742
|
-
message_id:
|
|
3743
|
-
engagement:
|
|
3744
|
-
impressions:
|
|
3745
|
-
reach:
|
|
3746
|
-
sentiment:
|
|
3752
|
+
let g = 0;
|
|
3753
|
+
return await o.data.messages.forEach(async (v) => {
|
|
3754
|
+
v.id !== null && (v.topics[0] = {
|
|
3755
|
+
message_id: v.id,
|
|
3756
|
+
engagement: v.topics[0]?.engagement || v.dynamics?.engagement || 0,
|
|
3757
|
+
impressions: v.topics[0]?.impressions || v.dynamics?.semrush_visits || 0,
|
|
3758
|
+
reach: v.topics[0]?.reach || v.dynamics?.potential_reach || 0,
|
|
3759
|
+
sentiment: v.topics[0]?.sentiment || 0
|
|
3747
3760
|
}, await this.db.table(_.MESSAGES).put({
|
|
3748
|
-
id:
|
|
3749
|
-
utc:
|
|
3750
|
-
data:
|
|
3751
|
-
expires:
|
|
3752
|
-
}).catch((
|
|
3753
|
-
|
|
3761
|
+
id: v.id,
|
|
3762
|
+
utc: v.utc,
|
|
3763
|
+
data: v,
|
|
3764
|
+
expires: v.expires
|
|
3765
|
+
}).catch((T) => {
|
|
3766
|
+
g++, G(4, [
|
|
3754
3767
|
"%cset%c %cstorage",
|
|
3755
3768
|
c.KO,
|
|
3756
3769
|
c.NONE,
|
|
3757
3770
|
c.STORAGE,
|
|
3758
3771
|
"set message",
|
|
3759
3772
|
`title: ${l}`,
|
|
3760
|
-
|
|
3761
|
-
|
|
3773
|
+
v,
|
|
3774
|
+
T.message
|
|
3762
3775
|
]);
|
|
3763
3776
|
}), await this.db.table(_.TOPICS).put({
|
|
3764
3777
|
title: l,
|
|
3765
3778
|
widget_id: t.widget,
|
|
3766
|
-
message_id:
|
|
3779
|
+
message_id: v.id,
|
|
3767
3780
|
dashboard_id: t.dashboard,
|
|
3768
|
-
engagement:
|
|
3769
|
-
impressions:
|
|
3770
|
-
reach:
|
|
3771
|
-
sentiment:
|
|
3772
|
-
utc:
|
|
3773
|
-
expires:
|
|
3774
|
-
}).catch((
|
|
3775
|
-
|
|
3781
|
+
engagement: v.topics[0]?.engagement || v.dynamics?.engagement || 0,
|
|
3782
|
+
impressions: v.topics[0]?.impressions || v.dynamics?.semrush_visits || 0,
|
|
3783
|
+
reach: v.topics[0]?.reach || v.dynamics?.potential_reach || 0,
|
|
3784
|
+
sentiment: v.topics[0]?.sentiment || 0,
|
|
3785
|
+
utc: v.utc,
|
|
3786
|
+
expires: v.expires
|
|
3787
|
+
}).catch((T) => {
|
|
3788
|
+
g++, G(4, [
|
|
3776
3789
|
"%cset%c %cstorage",
|
|
3777
3790
|
c.KO,
|
|
3778
3791
|
c.NONE,
|
|
3779
3792
|
c.STORAGE,
|
|
3780
3793
|
"set topic",
|
|
3781
3794
|
`title: ${l}`,
|
|
3782
|
-
|
|
3783
|
-
|
|
3795
|
+
v,
|
|
3796
|
+
T.message
|
|
3784
3797
|
]);
|
|
3785
|
-
}), await o.data.topics.forEach(async (
|
|
3786
|
-
const K =
|
|
3798
|
+
}), await o.data.topics.forEach(async (T) => {
|
|
3799
|
+
const K = T.message_id, te = T.visible ? 1 : 0, ge = T.title;
|
|
3787
3800
|
await this.db.table(_.TOPICS).where("message_id").equals(K).modify({ visible: te }).catch((Ce) => {
|
|
3788
|
-
|
|
3801
|
+
g++, G(4, [
|
|
3789
3802
|
"%cset%c %cstorage",
|
|
3790
3803
|
c.KO,
|
|
3791
3804
|
c.NONE,
|
|
3792
3805
|
c.STORAGE,
|
|
3793
3806
|
"update message visibility",
|
|
3794
3807
|
`title: ${ge}`,
|
|
3795
|
-
`widget: ${
|
|
3808
|
+
`widget: ${T.widget_id}`,
|
|
3796
3809
|
Ce.message
|
|
3797
3810
|
]);
|
|
3798
3811
|
});
|
|
3799
3812
|
}));
|
|
3800
|
-
}),
|
|
3813
|
+
}), g === 0 ? 201 : 400;
|
|
3801
3814
|
};
|
|
3802
3815
|
/**
|
|
3803
3816
|
* Retrieve Series Data
|
|
@@ -3903,10 +3916,10 @@ class Mr {
|
|
|
3903
3916
|
* @returns IResponse
|
|
3904
3917
|
*/
|
|
3905
3918
|
getWidgets = async (t) => {
|
|
3906
|
-
const o = (
|
|
3919
|
+
const o = (T) => t?.dashboard === T.dashboard_id, l = (T) => t?.type === T.type, g = (T) => t?.name ? T.name.includes(t?.name) : !1, v = await this.db.table(_.WIDGET).toArray().then((T) => t?.dashboard ? T.filter(o) : T).then((T) => t?.type ? T.filter(l) : T).then((T) => t?.name ? T.filter(g) : T).catch(() => {
|
|
3907
3920
|
G(2, ["%cstorage", c.STORAGE, X.WIDGET_LOAD, t]);
|
|
3908
3921
|
});
|
|
3909
|
-
return
|
|
3922
|
+
return v !== void 0 && G(3, [
|
|
3910
3923
|
"%cstorage%c %cwidgets",
|
|
3911
3924
|
c.STORAGE,
|
|
3912
3925
|
c.NONE,
|
|
@@ -3914,9 +3927,9 @@ class Mr {
|
|
|
3914
3927
|
t
|
|
3915
3928
|
]), {
|
|
3916
3929
|
// @ts-ignore
|
|
3917
|
-
data:
|
|
3918
|
-
message:
|
|
3919
|
-
success:
|
|
3930
|
+
data: v !== void 0 ? { data: v, query: t } : null,
|
|
3931
|
+
message: v !== void 0 ? "Widgets loaded from storage" : "Widgets load error",
|
|
3932
|
+
success: v !== void 0
|
|
3920
3933
|
};
|
|
3921
3934
|
};
|
|
3922
3935
|
/**
|
|
@@ -3993,12 +4006,12 @@ class Mr {
|
|
|
3993
4006
|
* @returns IResponse
|
|
3994
4007
|
*/
|
|
3995
4008
|
getSlides = async (t) => {
|
|
3996
|
-
const o = (
|
|
3997
|
-
return
|
|
4009
|
+
const o = (T) => t?.id ? t.id = T.id : !1, l = (T) => t?.name ? T.name.includes(t?.name) : !1, v = await this.db.table(_.SLIDE).toArray().then((T) => t?.id ? T.filter(o) : T).then((T) => t?.name ? T.filter(l) : T);
|
|
4010
|
+
return v !== void 0 && G(3, ["%cstorage%c %cslides", c.STORAGE, c.NONE, c.SLIDE, t]), {
|
|
3998
4011
|
// @ts-ignore
|
|
3999
|
-
data:
|
|
4000
|
-
message:
|
|
4001
|
-
success:
|
|
4012
|
+
data: v !== void 0 ? { slides: v, query: t } : null,
|
|
4013
|
+
message: v !== void 0 ? "Slides loaded from storage" : "Slides load error",
|
|
4014
|
+
success: v !== void 0
|
|
4002
4015
|
};
|
|
4003
4016
|
};
|
|
4004
4017
|
/**
|
|
@@ -4055,8 +4068,8 @@ class Mr {
|
|
|
4055
4068
|
* @returns IResponse
|
|
4056
4069
|
*/
|
|
4057
4070
|
getPresentations = async (t) => {
|
|
4058
|
-
const o = (
|
|
4059
|
-
return
|
|
4071
|
+
const o = (v) => t?.name ? v.name.includes(t?.name) : !1, g = await this.db.table(_.PRESENTATION).toArray().then((v) => t?.name ? v.filter(o) : v);
|
|
4072
|
+
return g !== void 0 && G(3, [
|
|
4060
4073
|
"%cstorage%c %cpresentations",
|
|
4061
4074
|
c.STORAGE,
|
|
4062
4075
|
c.NONE,
|
|
@@ -4064,9 +4077,9 @@ class Mr {
|
|
|
4064
4077
|
t
|
|
4065
4078
|
]), {
|
|
4066
4079
|
// @ts-ignore
|
|
4067
|
-
data:
|
|
4068
|
-
message:
|
|
4069
|
-
success:
|
|
4080
|
+
data: g !== void 0 ? { presentations: g, query: t } : null,
|
|
4081
|
+
message: g !== void 0 ? "Presentations loaded from storage" : "Presentations load error",
|
|
4082
|
+
success: g !== void 0
|
|
4070
4083
|
};
|
|
4071
4084
|
};
|
|
4072
4085
|
/**
|
|
@@ -4123,8 +4136,8 @@ class Mr {
|
|
|
4123
4136
|
* @returns IResponse
|
|
4124
4137
|
*/
|
|
4125
4138
|
getPreferences = async (t) => {
|
|
4126
|
-
const o = (
|
|
4127
|
-
return
|
|
4139
|
+
const o = (v) => t?.id ? t.id = v.id : !1, g = await this.db.table(_.SLIDE).toArray().then((v) => t?.id ? v.filter(o) : v);
|
|
4140
|
+
return g !== void 0 && G(3, [
|
|
4128
4141
|
"%cstorage%c %cpreferences",
|
|
4129
4142
|
c.STORAGE,
|
|
4130
4143
|
c.NONE,
|
|
@@ -4132,9 +4145,9 @@ class Mr {
|
|
|
4132
4145
|
t
|
|
4133
4146
|
]), {
|
|
4134
4147
|
// @ts-ignore
|
|
4135
|
-
data:
|
|
4136
|
-
message:
|
|
4137
|
-
success:
|
|
4148
|
+
data: g !== void 0 ? { prefrences: g, query: t } : null,
|
|
4149
|
+
message: g !== void 0 ? "Preferences loaded from storage" : "Preferences load error",
|
|
4150
|
+
success: g !== void 0
|
|
4138
4151
|
};
|
|
4139
4152
|
};
|
|
4140
4153
|
/**
|
|
@@ -4166,8 +4179,8 @@ class Mr {
|
|
|
4166
4179
|
* @returns IResponse
|
|
4167
4180
|
*/
|
|
4168
4181
|
getImages = async (t) => {
|
|
4169
|
-
const o = (
|
|
4170
|
-
return
|
|
4182
|
+
const o = (v) => t?.id ? v.includes(t.id) : !1, g = await this.db.table(_.IMAGES).toArray().then((v) => t?.id ? v.filter(o) : v);
|
|
4183
|
+
return g !== void 0 && G(3, [
|
|
4171
4184
|
"%cstorage%c %cimages",
|
|
4172
4185
|
c.STORAGE,
|
|
4173
4186
|
c.NONE,
|
|
@@ -4175,9 +4188,9 @@ class Mr {
|
|
|
4175
4188
|
t
|
|
4176
4189
|
]), {
|
|
4177
4190
|
// @ts-ignore
|
|
4178
|
-
data:
|
|
4179
|
-
message:
|
|
4180
|
-
success:
|
|
4191
|
+
data: g !== void 0 ? { images: g, query: t } : null,
|
|
4192
|
+
message: g !== void 0 ? "Images loaded from storage" : "Images load error",
|
|
4193
|
+
success: g !== void 0
|
|
4181
4194
|
};
|
|
4182
4195
|
};
|
|
4183
4196
|
/**
|
|
@@ -4218,13 +4231,13 @@ function Ka(h, t) {
|
|
|
4218
4231
|
const l = () => {
|
|
4219
4232
|
if (o)
|
|
4220
4233
|
return o;
|
|
4221
|
-
const
|
|
4222
|
-
return
|
|
4223
|
-
|
|
4234
|
+
const g = indexedDB.open(h);
|
|
4235
|
+
return g.onupgradeneeded = () => g.result.createObjectStore(t), o = Hn(g), o.then((v) => {
|
|
4236
|
+
v.onclose = () => o = void 0;
|
|
4224
4237
|
}, () => {
|
|
4225
4238
|
}), o;
|
|
4226
4239
|
};
|
|
4227
|
-
return (
|
|
4240
|
+
return (g, v) => l().then((T) => v(T.transaction(t, g).objectStore(t)));
|
|
4228
4241
|
}
|
|
4229
4242
|
let Un;
|
|
4230
4243
|
function Gr() {
|
|
@@ -4264,12 +4277,12 @@ class Kr {
|
|
|
4264
4277
|
if (!o.success)
|
|
4265
4278
|
return 400;
|
|
4266
4279
|
const l = Y(t);
|
|
4267
|
-
return delete o.success, delete o.message, await ke(l, o).then(() => 201).catch((
|
|
4280
|
+
return delete o.success, delete o.message, await ke(l, o).then(() => 201).catch((g) => (console.error(
|
|
4268
4281
|
"%cstorage",
|
|
4269
4282
|
c.STORAGE,
|
|
4270
4283
|
_.CLOUD,
|
|
4271
4284
|
t,
|
|
4272
|
-
|
|
4285
|
+
g.message
|
|
4273
4286
|
), 400));
|
|
4274
4287
|
};
|
|
4275
4288
|
/**
|
|
@@ -4282,12 +4295,12 @@ class Kr {
|
|
|
4282
4295
|
if (!o.success)
|
|
4283
4296
|
return 400;
|
|
4284
4297
|
const l = Y(t);
|
|
4285
|
-
return delete o.success, delete o.message, await ke(l, o).then(() => 201).catch((
|
|
4298
|
+
return delete o.success, delete o.message, await ke(l, o).then(() => 201).catch((g) => (console.error(
|
|
4286
4299
|
"%cstorage",
|
|
4287
4300
|
c.STORAGE,
|
|
4288
4301
|
_.SERIES,
|
|
4289
4302
|
t,
|
|
4290
|
-
|
|
4303
|
+
g.message
|
|
4291
4304
|
), 400));
|
|
4292
4305
|
};
|
|
4293
4306
|
/**
|
|
@@ -4300,12 +4313,12 @@ class Kr {
|
|
|
4300
4313
|
if (!o.success)
|
|
4301
4314
|
return 400;
|
|
4302
4315
|
const l = Y(t);
|
|
4303
|
-
return delete o.success, delete o.message, await ke(l, o).then(() => 201).catch((
|
|
4316
|
+
return delete o.success, delete o.message, await ke(l, o).then(() => 201).catch((g) => (console.error(
|
|
4304
4317
|
"%cstorage",
|
|
4305
4318
|
c.STORAGE,
|
|
4306
4319
|
_.MESSAGES,
|
|
4307
4320
|
t,
|
|
4308
|
-
|
|
4321
|
+
g.message
|
|
4309
4322
|
), 400));
|
|
4310
4323
|
};
|
|
4311
4324
|
cleanMessages = async (t) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((o) => o(0)));
|
|
@@ -4341,15 +4354,15 @@ class Kr {
|
|
|
4341
4354
|
data: null,
|
|
4342
4355
|
message: `Dashboard ${t.data.id} saved to storage`,
|
|
4343
4356
|
success: !0
|
|
4344
|
-
})).catch((
|
|
4357
|
+
})).catch((g) => (console.error(
|
|
4345
4358
|
"%cstorage",
|
|
4346
4359
|
c.STORAGE,
|
|
4347
4360
|
_.WIDGET,
|
|
4348
4361
|
t,
|
|
4349
|
-
|
|
4362
|
+
g.message
|
|
4350
4363
|
), {
|
|
4351
4364
|
data: null,
|
|
4352
|
-
message: `Slide ${t.data.id} save error: ${
|
|
4365
|
+
message: `Slide ${t.data.id} save error: ${g.message}`,
|
|
4353
4366
|
success: !1
|
|
4354
4367
|
}));
|
|
4355
4368
|
};
|
|
@@ -4382,15 +4395,15 @@ class Kr {
|
|
|
4382
4395
|
data: null,
|
|
4383
4396
|
message: `Widget ${t.data.id} saved to storage`,
|
|
4384
4397
|
success: !0
|
|
4385
|
-
})).catch((
|
|
4398
|
+
})).catch((g) => (console.error(
|
|
4386
4399
|
"%cstorage",
|
|
4387
4400
|
c.STORAGE,
|
|
4388
4401
|
_.WIDGET,
|
|
4389
4402
|
t,
|
|
4390
|
-
|
|
4403
|
+
g.message
|
|
4391
4404
|
), {
|
|
4392
4405
|
data: null,
|
|
4393
|
-
message: `Slide ${t.data.id} save error: ${
|
|
4406
|
+
message: `Slide ${t.data.id} save error: ${g.message}`,
|
|
4394
4407
|
success: !1
|
|
4395
4408
|
}));
|
|
4396
4409
|
};
|
|
@@ -4443,15 +4456,15 @@ class Kr {
|
|
|
4443
4456
|
data: null,
|
|
4444
4457
|
message: `Slide ${t.data.id} saved to storage`,
|
|
4445
4458
|
success: !0
|
|
4446
|
-
})).catch((
|
|
4459
|
+
})).catch((g) => (console.error(
|
|
4447
4460
|
"%cstorage",
|
|
4448
4461
|
c.STORAGE,
|
|
4449
4462
|
_.SLIDE,
|
|
4450
4463
|
t,
|
|
4451
|
-
|
|
4464
|
+
g.message
|
|
4452
4465
|
), {
|
|
4453
4466
|
data: null,
|
|
4454
|
-
message: `Slide ${t.data.id} save error: ${
|
|
4467
|
+
message: `Slide ${t.data.id} save error: ${g.message}`,
|
|
4455
4468
|
success: !1
|
|
4456
4469
|
}));
|
|
4457
4470
|
};
|
|
@@ -4479,15 +4492,15 @@ class Kr {
|
|
|
4479
4492
|
data: null,
|
|
4480
4493
|
message: `Presentation ${t.data.id} saved to storage`,
|
|
4481
4494
|
success: !0
|
|
4482
|
-
})).catch((
|
|
4495
|
+
})).catch((g) => (console.error(
|
|
4483
4496
|
"%cstorage",
|
|
4484
4497
|
c.STORAGE,
|
|
4485
4498
|
_.PRESENTATION,
|
|
4486
4499
|
t,
|
|
4487
|
-
|
|
4500
|
+
g.message
|
|
4488
4501
|
), {
|
|
4489
4502
|
data: null,
|
|
4490
|
-
message: `Presentation ${t.data.id} save error: ${
|
|
4503
|
+
message: `Presentation ${t.data.id} save error: ${g.message}`,
|
|
4491
4504
|
success: !1
|
|
4492
4505
|
}));
|
|
4493
4506
|
};
|
|
@@ -4598,8 +4611,8 @@ class Br {
|
|
|
4598
4611
|
const l = Y(t);
|
|
4599
4612
|
try {
|
|
4600
4613
|
return localStorage.setObject(l, o), 201;
|
|
4601
|
-
} catch (
|
|
4602
|
-
return console.error("%cstorage", c.STORAGE, _.CLOUD, t,
|
|
4614
|
+
} catch (g) {
|
|
4615
|
+
return console.error("%cstorage", c.STORAGE, _.CLOUD, t, g), 400;
|
|
4603
4616
|
}
|
|
4604
4617
|
};
|
|
4605
4618
|
/**
|
|
@@ -4612,8 +4625,8 @@ class Br {
|
|
|
4612
4625
|
const l = Y(t);
|
|
4613
4626
|
try {
|
|
4614
4627
|
return localStorage.setObject(l, o), 201;
|
|
4615
|
-
} catch (
|
|
4616
|
-
return console.error("%cstorage", c.STORAGE, _.SERIES, t,
|
|
4628
|
+
} catch (g) {
|
|
4629
|
+
return console.error("%cstorage", c.STORAGE, _.SERIES, t, g), 400;
|
|
4617
4630
|
}
|
|
4618
4631
|
};
|
|
4619
4632
|
/**
|
|
@@ -4626,8 +4639,8 @@ class Br {
|
|
|
4626
4639
|
const l = Y(t);
|
|
4627
4640
|
try {
|
|
4628
4641
|
return localStorage.setObject(l, o), 200;
|
|
4629
|
-
} catch (
|
|
4630
|
-
return console.error("%cstorage", c.STORAGE, _.MESSAGES, t,
|
|
4642
|
+
} catch (g) {
|
|
4643
|
+
return console.error("%cstorage", c.STORAGE, _.MESSAGES, t, g), 400;
|
|
4631
4644
|
}
|
|
4632
4645
|
};
|
|
4633
4646
|
cleanMessages = async (t) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((o) => o(0)));
|
|
@@ -4933,8 +4946,8 @@ class Lr {
|
|
|
4933
4946
|
const l = Y(t);
|
|
4934
4947
|
try {
|
|
4935
4948
|
return sessionStorage.setObject(l, o), 201;
|
|
4936
|
-
} catch (
|
|
4937
|
-
return console.error("%cstorage", c.STORAGE, _.CLOUD, t,
|
|
4949
|
+
} catch (g) {
|
|
4950
|
+
return console.error("%cstorage", c.STORAGE, _.CLOUD, t, g), 400;
|
|
4938
4951
|
}
|
|
4939
4952
|
};
|
|
4940
4953
|
/**
|
|
@@ -4947,8 +4960,8 @@ class Lr {
|
|
|
4947
4960
|
const l = Y(t);
|
|
4948
4961
|
try {
|
|
4949
4962
|
return sessionStorage.setObject(l, o), 201;
|
|
4950
|
-
} catch (
|
|
4951
|
-
return console.error("%cstorage", c.STORAGE, _.SERIES, t,
|
|
4963
|
+
} catch (g) {
|
|
4964
|
+
return console.error("%cstorage", c.STORAGE, _.SERIES, t, g), 400;
|
|
4952
4965
|
}
|
|
4953
4966
|
};
|
|
4954
4967
|
/**
|
|
@@ -4961,8 +4974,8 @@ class Lr {
|
|
|
4961
4974
|
const l = Y(t);
|
|
4962
4975
|
try {
|
|
4963
4976
|
return sessionStorage.setObject(l, o), 200;
|
|
4964
|
-
} catch (
|
|
4965
|
-
return console.error("%cstorage", c.STORAGE, _.MESSAGES, t,
|
|
4977
|
+
} catch (g) {
|
|
4978
|
+
return console.error("%cstorage", c.STORAGE, _.MESSAGES, t, g), 400;
|
|
4966
4979
|
}
|
|
4967
4980
|
};
|
|
4968
4981
|
cleanMessages = async (t) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((o) => o(0)));
|
|
@@ -5268,8 +5281,8 @@ class Wr {
|
|
|
5268
5281
|
const l = Y(t);
|
|
5269
5282
|
try {
|
|
5270
5283
|
return window.BuzzCasting.WidgetData[l] = o, 201;
|
|
5271
|
-
} catch (
|
|
5272
|
-
return console.error("%cstorage", c.STORAGE, "set", t,
|
|
5284
|
+
} catch (g) {
|
|
5285
|
+
return console.error("%cstorage", c.STORAGE, "set", t, g), 400;
|
|
5273
5286
|
}
|
|
5274
5287
|
};
|
|
5275
5288
|
/**
|
|
@@ -5282,8 +5295,8 @@ class Wr {
|
|
|
5282
5295
|
const l = Y(t);
|
|
5283
5296
|
try {
|
|
5284
5297
|
return window.BuzzCasting.WidgetData[l] = o, 201;
|
|
5285
|
-
} catch (
|
|
5286
|
-
return console.error("%cstorage", c.STORAGE, "set", t,
|
|
5298
|
+
} catch (g) {
|
|
5299
|
+
return console.error("%cstorage", c.STORAGE, "set", t, g), 400;
|
|
5287
5300
|
}
|
|
5288
5301
|
};
|
|
5289
5302
|
/**
|
|
@@ -5296,8 +5309,8 @@ class Wr {
|
|
|
5296
5309
|
const l = Y(t);
|
|
5297
5310
|
try {
|
|
5298
5311
|
return window.BuzzCasting.WidgetData[l] = o, 201;
|
|
5299
|
-
} catch (
|
|
5300
|
-
return console.error("%cstorage", c.STORAGE, "set", t,
|
|
5312
|
+
} catch (g) {
|
|
5313
|
+
return console.error("%cstorage", c.STORAGE, "set", t, g), 400;
|
|
5301
5314
|
}
|
|
5302
5315
|
};
|
|
5303
5316
|
cleanMessages = async (t) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((o) => o(0)));
|
|
@@ -5585,21 +5598,21 @@ class Ja {
|
|
|
5585
5598
|
o.push(this.api.get(l));
|
|
5586
5599
|
}), o.forEach(async (l) => {
|
|
5587
5600
|
await l.then(
|
|
5588
|
-
async (
|
|
5601
|
+
async (g) => await this.processResponse(g)
|
|
5589
5602
|
);
|
|
5590
5603
|
});
|
|
5591
5604
|
};
|
|
5592
5605
|
processResponse = async (t) => {
|
|
5593
5606
|
let o, l = 400;
|
|
5594
5607
|
if (t.success === !0) {
|
|
5595
|
-
const
|
|
5596
|
-
let
|
|
5608
|
+
const g = this.subscribers[t.query.widget];
|
|
5609
|
+
let v = "";
|
|
5597
5610
|
switch (t.query.type) {
|
|
5598
5611
|
case _.MESSAGES:
|
|
5599
|
-
let
|
|
5600
|
-
|
|
5612
|
+
let T;
|
|
5613
|
+
T = t.data.messages.filter(
|
|
5601
5614
|
(K) => K.id !== null
|
|
5602
|
-
), t.data.messages =
|
|
5615
|
+
), t.data.messages = T, v = t.data.messages.length > 0 ? Fn(t.data.messages[0].utc) : "none", g?.hash && g.hash === v ? (G(3, [
|
|
5603
5616
|
"%cload%c %cmessages%c %cno updates",
|
|
5604
5617
|
c.OK,
|
|
5605
5618
|
c.NONE,
|
|
@@ -5607,10 +5620,10 @@ class Ja {
|
|
|
5607
5620
|
c.NONE,
|
|
5608
5621
|
c.NO_UPDATES,
|
|
5609
5622
|
t.query.widget
|
|
5610
|
-
]), G(4, ["%cmessages", c.MESSAGES, t]), l = 204) : (o = t,
|
|
5623
|
+
]), G(4, ["%cmessages", c.MESSAGES, t]), l = 204) : (o = t, g.hash = v, l = await this.sm?.setMessages(t.query, t).then(async (K) => (K = 201, this.broadcastUpdate(K, t))));
|
|
5611
5624
|
break;
|
|
5612
5625
|
case _.CLOUD:
|
|
5613
|
-
|
|
5626
|
+
v = Fn(t.data.cloud), g?.hash && g.hash === v ? (G(3, [
|
|
5614
5627
|
"%cload%c %ccloud%c %cno updates",
|
|
5615
5628
|
c.OK,
|
|
5616
5629
|
c.NONE,
|
|
@@ -5618,7 +5631,7 @@ class Ja {
|
|
|
5618
5631
|
c.NONE,
|
|
5619
5632
|
c.NO_UPDATES,
|
|
5620
5633
|
t.query.widget
|
|
5621
|
-
]), G(4, ["%ccloud", c.CLOUD, t.query]), l = 204) : (
|
|
5634
|
+
]), G(4, ["%ccloud", c.CLOUD, t.query]), l = 204) : (g.hash = v, o = {
|
|
5622
5635
|
data: {
|
|
5623
5636
|
cloud: t.data
|
|
5624
5637
|
},
|
|
@@ -5628,7 +5641,7 @@ class Ja {
|
|
|
5628
5641
|
}, l = await this.sm?.setCloud(t.query, o.data).then((K) => this.broadcastUpdate(K, t)));
|
|
5629
5642
|
break;
|
|
5630
5643
|
case _.SERIES:
|
|
5631
|
-
|
|
5644
|
+
v = Fn(t.data.series), g?.hash && g.hash === v ? (G(3, [
|
|
5632
5645
|
"%cload%c %cseries%c %cno updates",
|
|
5633
5646
|
c.OK,
|
|
5634
5647
|
c.NONE,
|
|
@@ -5636,7 +5649,7 @@ class Ja {
|
|
|
5636
5649
|
c.NONE,
|
|
5637
5650
|
c.NO_UPDATES,
|
|
5638
5651
|
t.query.widget
|
|
5639
|
-
]), G(4, ["%cseries", c.SERIES, t]), l = 204) : (
|
|
5652
|
+
]), G(4, ["%cseries", c.SERIES, t]), l = 204) : (g.hash = v, o = {
|
|
5640
5653
|
data: t.data,
|
|
5641
5654
|
message: t.message,
|
|
5642
5655
|
success: t.success,
|
|
@@ -5665,16 +5678,16 @@ class Ja {
|
|
|
5665
5678
|
t.query
|
|
5666
5679
|
]), t.query.type) {
|
|
5667
5680
|
case _.MESSAGES:
|
|
5668
|
-
return await this.sm?.getMessages(t.query).then((
|
|
5669
|
-
this.broadcastUpdate(201,
|
|
5681
|
+
return await this.sm?.getMessages(t.query).then((g) => {
|
|
5682
|
+
this.broadcastUpdate(201, g);
|
|
5670
5683
|
});
|
|
5671
5684
|
case _.CLOUD:
|
|
5672
|
-
return await this.sm?.getCloud(t.query).then((
|
|
5673
|
-
this.broadcastUpdate(201,
|
|
5685
|
+
return await this.sm?.getCloud(t.query).then((g) => {
|
|
5686
|
+
this.broadcastUpdate(201, g);
|
|
5674
5687
|
});
|
|
5675
5688
|
case _.SERIES:
|
|
5676
|
-
return await this.sm?.getSeries(t.query).then((
|
|
5677
|
-
this.broadcastUpdate(201,
|
|
5689
|
+
return await this.sm?.getSeries(t.query).then((g) => {
|
|
5690
|
+
this.broadcastUpdate(201, g);
|
|
5678
5691
|
});
|
|
5679
5692
|
}
|
|
5680
5693
|
return l;
|
|
@@ -5804,9 +5817,9 @@ class Ja {
|
|
|
5804
5817
|
getDashboard = async (t) => await this.sm?.getDashboard(t);
|
|
5805
5818
|
getDashboards = async (t) => await this.sm?.getDashboards();
|
|
5806
5819
|
setDashboard = async (t) => await this.sm?.setDashboard(t);
|
|
5807
|
-
loadImages = async () => await this.api.loadImages();
|
|
5808
|
-
storeImage = async (t) => await this.api.storeImage(t);
|
|
5809
|
-
deleteImage = async (t) => await this.api.deleteImage(t);
|
|
5820
|
+
loadImages = async (t) => await this.api.loadImages(t);
|
|
5821
|
+
storeImage = async (t, o) => await this.api.storeImage(t, o);
|
|
5822
|
+
deleteImage = async (t, o) => await this.api.deleteImage(t, o);
|
|
5810
5823
|
getImages = async (t) => await this.sm?.getImages(t);
|
|
5811
5824
|
setImage = async (t) => await this.sm?.setImage(t);
|
|
5812
5825
|
}
|
|
@@ -5907,10 +5920,10 @@ class Za {
|
|
|
5907
5920
|
*/
|
|
5908
5921
|
constructor(t, o, l) {
|
|
5909
5922
|
this.element = t, this.callbacks = o, l = typeof l < "u" ? l : "buzzcasting-app";
|
|
5910
|
-
let
|
|
5911
|
-
|
|
5912
|
-
const
|
|
5913
|
-
this.storageReader = new Ba(
|
|
5923
|
+
let g;
|
|
5924
|
+
g = { ...t.dataset }, delete g.hmr, g.presentation = window.BuzzCasting.getOptions()?.presentation ?? `${l} not found`, this.query = g, Da(t);
|
|
5925
|
+
const v = window.BuzzCasting.getOptions();
|
|
5926
|
+
this.storageReader = new Ba(v), this.broadcastChannel = new BroadcastChannel(g.presentation), this.broadcastListener();
|
|
5914
5927
|
}
|
|
5915
5928
|
addCallbackListener(t) {
|
|
5916
5929
|
this.callbacks.push(t);
|
|
@@ -5927,8 +5940,8 @@ class Za {
|
|
|
5927
5940
|
case X.WIDGET_UPDATE:
|
|
5928
5941
|
try {
|
|
5929
5942
|
if (l.dashboard === t.dashboard && l.widget === t.widget) {
|
|
5930
|
-
const
|
|
5931
|
-
|
|
5943
|
+
const g = await this.getData();
|
|
5944
|
+
g?.success && (G(4, [
|
|
5932
5945
|
"%cset%c %cbroadcast%c %cwidget",
|
|
5933
5946
|
c.OK,
|
|
5934
5947
|
c.NONE,
|
|
@@ -5936,8 +5949,8 @@ class Za {
|
|
|
5936
5949
|
c.NONE,
|
|
5937
5950
|
c.WIDGET,
|
|
5938
5951
|
this.query
|
|
5939
|
-
]), this.callbacks.forEach(async (
|
|
5940
|
-
|
|
5952
|
+
]), this.callbacks.forEach(async (v) => {
|
|
5953
|
+
v(g);
|
|
5941
5954
|
}));
|
|
5942
5955
|
}
|
|
5943
5956
|
} catch {
|