@nylas/react 1.0.2-prealpha1 → 1.1.0-canary.3
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/add-circle-icon_22.entry-8d0ac489.cjs +1 -0
- package/dist/add-circle-icon_22.entry-da31fa71.js +1733 -0
- package/dist/{archive-icon_7.entry-84d70dbf.cjs → archive-icon_7.entry-7aad8104.cjs} +1 -1
- package/dist/{archive-icon_7.entry-91aaa1aa.js → archive-icon_7.entry-bc2418f7.js} +20 -20
- package/dist/{arrow-icon.entry-400a08fa.cjs → arrow-icon.entry-6eba68a9.cjs} +1 -1
- package/dist/arrow-icon.entry-9a932082.js +15 -0
- package/dist/{bold-icon_3.entry-4b2798a8.js → bold-icon_3.entry-5f7e3755.js} +4 -4
- package/dist/{bold-icon_3.entry-9ad35153.cjs → bold-icon_3.entry-db17d481.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-83ba884a.js → calendar-cancel-icon.entry-1ff7845a.js} +4 -4
- package/dist/{calendar-cancel-icon.entry-fcb66929.cjs → calendar-cancel-icon.entry-a5141f82.cjs} +1 -1
- package/dist/calendar-check-icon_2.entry-c3add652.cjs +1 -0
- package/dist/calendar-check-icon_2.entry-d7421059.js +25 -0
- package/dist/{calendar-icon.entry-8f38af4a.js → calendar-icon.entry-4458997f.js} +2 -2
- package/dist/{calendar-icon.entry-7bae38d7.cjs → calendar-icon.entry-445d624a.cjs} +1 -1
- package/dist/chevron-icon_3.entry-8961e6bb.cjs +1 -0
- package/dist/chevron-icon_3.entry-f7f3d487.js +117 -0
- package/dist/close-icon.entry-6dd5ff0a.js +15 -0
- package/dist/close-icon.entry-ebc527c5.cjs +1 -0
- package/dist/{nylas-booked-event-card_10.entry-7e66a648.js → constants-6ee60d6d-4cd16450.js} +1656 -2374
- package/dist/{nylas-booked-event-card_10.entry-ed515326.cjs → constants-6ee60d6d-6c0540db.cjs} +6 -6
- package/dist/document-refresh-icon.entry-298b2133.cjs +1 -0
- package/dist/document-refresh-icon.entry-bdc323b5.js +15 -0
- package/dist/elements/index.d.ts +31 -2
- package/dist/{forward-icon_6.entry-3345af84.cjs → forward-icon_6.entry-15208ea9.cjs} +3 -3
- package/dist/{forward-icon_6.entry-b60fcb35.js → forward-icon_6.entry-62759373.js} +127 -127
- package/dist/{globe-icon.entry-e3fd373f.js → globe-icon.entry-9e082178.js} +4 -4
- package/dist/{globe-icon.entry-8325e73e.cjs → globe-icon.entry-c8302bf5.cjs} +1 -1
- package/dist/google-logo-icon_3.entry-0c095209.js +258 -0
- package/dist/google-logo-icon_3.entry-f8433ff9.cjs +1 -0
- package/dist/index-0f3bd8df.js +1824 -0
- package/dist/index-7a55dc33.cjs +30 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.es-2578c6a5-098d48d0.cjs +7 -0
- package/dist/{index-b30d446a-a90f84b2.js → index.es-2578c6a5-71441142.js} +833 -933
- package/dist/info-icon_2.entry-73106882.js +34 -0
- package/dist/info-icon_2.entry-ca224a3b.cjs +1 -0
- package/dist/{loading-icon.entry-27410cf8.js → loading-icon.entry-012644b7.js} +4 -4
- package/dist/{loading-icon.entry-b2096d2b.cjs → loading-icon.entry-f9f5e66f.cjs} +1 -1
- package/dist/mailbox-store-bb21512c-045c3ea0.cjs +1 -0
- package/dist/{mailbox-store-19f0c6c9-e3e8b4e5.js → mailbox-store-bb21512c-615660ef.js} +17 -16
- package/dist/nylas-additional-participants.entry-a50ef8e2.cjs +1 -0
- package/dist/nylas-additional-participants.entry-db85836a.js +83 -0
- package/dist/nylas-booked-event-card_10.entry-b49b2369.js +784 -0
- package/dist/nylas-booked-event-card_10.entry-fccb783c.cjs +1 -0
- package/dist/nylas-form-card.entry-090a4d3b.js +56 -0
- package/dist/nylas-form-card.entry-f5230005.cjs +1 -0
- package/dist/nylas-if-state.entry-7924dde0.js +96 -0
- package/dist/nylas-if-state.entry-ff9c9a85.cjs +1 -0
- package/dist/{nylas-list-folders.entry-a5437201.js → nylas-list-folders.entry-9dd96530.js} +9 -8
- package/dist/nylas-list-folders.entry-dbfc2cf8.cjs +1 -0
- package/dist/nylas-list-threads.entry-6bcc0328.cjs +1 -0
- package/dist/{nylas-list-threads.entry-fd6cda61.js → nylas-list-threads.entry-b435eaae.js} +5 -4
- package/dist/nylas-login.entry-1623d309.cjs +1 -0
- package/dist/nylas-login.entry-97350c76.js +75 -0
- package/dist/nylas-mailbox-pagination.entry-1776eb16.cjs +1 -0
- package/dist/{nylas-mailbox-pagination.entry-988214bc.js → nylas-mailbox-pagination.entry-ceef8be2.js} +4 -3
- package/dist/nylas-mailbox-toolbar-button.entry-7d3f79b9.cjs +1 -0
- package/dist/{nylas-mailbox-toolbar-button.entry-c720e22a.js → nylas-mailbox-toolbar-button.entry-e6b3d3a4.js} +11 -10
- package/dist/nylas-mailbox.entry-06d8014a.js +136 -0
- package/dist/nylas-mailbox.entry-ae8da6ff.cjs +1 -0
- package/dist/{nylas-provider.entry-70721009.js → nylas-provider.entry-8b9c2b69.js} +46 -33
- package/dist/nylas-provider.entry-97c9e272.cjs +1 -0
- package/dist/nylas-scheduler-editor.entry-c3791787.js +2181 -0
- package/dist/nylas-scheduler-editor.entry-f6cf1cd9.cjs +7 -0
- package/dist/nylas-scheduling.entry-08ae840a.cjs +1 -0
- package/dist/nylas-scheduling.entry-6380509a.js +237 -0
- package/dist/nylas-threads-refresh.entry-246e6d77.cjs +1 -0
- package/dist/{nylas-threads-refresh.entry-b7f9e93f.js → nylas-threads-refresh.entry-eaee86fb.js} +6 -5
- package/dist/nylas-threads-search.entry-42a2acb1.cjs +1 -0
- package/dist/{nylas-threads-search.entry-95afea9c.js → nylas-threads-search.entry-7e12758e.js} +15 -14
- package/dist/nylas-view-thread.entry-78e6927a.cjs +1 -0
- package/dist/{nylas-view-thread.entry-165173b1.js → nylas-view-thread.entry-b936e76a.js} +5 -4
- package/dist/people-icon.entry-5c8ee696.js +15 -0
- package/dist/people-icon.entry-bcf848c0.cjs +1 -0
- package/dist/play-icon_2.entry-356e63cc.js +25 -0
- package/dist/play-icon_2.entry-92e78f1b.cjs +1 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +92 -61
- package/dist/{refresh-icon.entry-e48a338f.js → refresh-icon.entry-77f0c377.js} +2 -2
- package/dist/{refresh-icon.entry-601cac89.cjs → refresh-icon.entry-bec053b6.cjs} +1 -1
- package/dist/{register-component-152c6ad2-a06f58c2.js → register-component-dc659dc3-0fdb18dc.js} +2 -2
- package/dist/{register-component-152c6ad2-0df7215b.cjs → register-component-dc659dc3-f58bf25b.cjs} +1 -1
- package/dist/scheduler-config-store-51ee4f42-ce3a9b0e.cjs +1 -0
- package/dist/scheduler-config-store-51ee4f42-e02895da.js +14 -0
- package/dist/{scheduler-store-7d48e682-0c0c3991.js → scheduler-store-72116723-3ba2480c.js} +100 -95
- package/dist/scheduler-store-72116723-db9d91f6.cjs +1 -0
- package/dist/time-period-selector.entry-decd251b.js +78 -0
- package/dist/time-period-selector.entry-f25fad77.cjs +1 -0
- package/dist/translate-icon.entry-cac02c46.js +15 -0
- package/dist/translate-icon.entry-dd5b707c.cjs +1 -0
- package/dist/utils-c00bdc3c-89ab163d.js +2111 -0
- package/dist/utils-c00bdc3c-94b9c3b6.cjs +8 -0
- package/dist/warning-icon.entry-370b9cf0.js +15 -0
- package/dist/warning-icon.entry-8af8a742.cjs +1 -0
- package/package.json +7 -4
- package/dist/add-circle-icon.entry-2ccb238b.cjs +0 -1
- package/dist/add-circle-icon.entry-35d6aa07.js +0 -15
- package/dist/arrow-icon.entry-8b2e96a6.js +0 -15
- package/dist/calendar-check-icon_3.entry-903e2d82.js +0 -35
- package/dist/calendar-check-icon_3.entry-a16ce05e.cjs +0 -1
- package/dist/chevron-icon.entry-58366662.cjs +0 -1
- package/dist/chevron-icon.entry-5e11cef5.js +0 -15
- package/dist/close-icon_2.entry-011d9cf4.js +0 -25
- package/dist/close-icon_2.entry-83088b9a.cjs +0 -1
- package/dist/document-refresh-icon.entry-071ffd66.cjs +0 -1
- package/dist/document-refresh-icon.entry-9083a2e9.js +0 -15
- package/dist/duration-bddc4a13-05d3e3e2.cjs +0 -1
- package/dist/duration-bddc4a13-179ce826.js +0 -41
- package/dist/index-3b6f5cd5.cjs +0 -30
- package/dist/index-630f4e87.js +0 -1498
- package/dist/index-b30d446a-cbbef925.cjs +0 -7
- package/dist/mailbox-store-19f0c6c9-a0cbfa97.cjs +0 -1
- package/dist/nylas-if-state_3.entry-504be976.cjs +0 -1
- package/dist/nylas-if-state_3.entry-e96d01f1.js +0 -291
- package/dist/nylas-list-folders.entry-866361cc.cjs +0 -1
- package/dist/nylas-list-threads.entry-04989295.cjs +0 -1
- package/dist/nylas-mailbox-pagination.entry-e0bd4aef.cjs +0 -1
- package/dist/nylas-mailbox-toolbar-button.entry-3d772b26.cjs +0 -1
- package/dist/nylas-open-hours-picker.entry-6bdc7c73.js +0 -186
- package/dist/nylas-open-hours-picker.entry-881b6db7.cjs +0 -1
- package/dist/nylas-provider.entry-8d9a844b.cjs +0 -1
- package/dist/nylas-scheduler.entry-7321e18f.js +0 -230
- package/dist/nylas-scheduler.entry-e82977fb.cjs +0 -1
- package/dist/nylas-threads-refresh.entry-477e68e4.cjs +0 -1
- package/dist/nylas-threads-search.entry-c5854641.cjs +0 -1
- package/dist/nylas-view-thread.entry-8b72cbdb.cjs +0 -1
- package/dist/play-icon_2.entry-ed5877e3.js +0 -25
- package/dist/play-icon_2.entry-f23ed6c1.cjs +0 -1
- package/dist/scheduler-store-7d48e682-674705ef.cjs +0 -1
- package/dist/search-icon_3.entry-292138c3.js +0 -101
- package/dist/search-icon_3.entry-8e555357.cjs +0 -1
- package/dist/utils-5074a070-ce33ee6b.js +0 -119
- package/dist/utils-5074a070-d5ba6add.cjs +0 -2
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { d as T, u as
|
|
2
|
-
|
|
3
|
-
class ar {
|
|
1
|
+
import { d as T, u as nr, c as hn } from "./utils-c00bdc3c-89ab163d.js";
|
|
2
|
+
class rr {
|
|
4
3
|
constructor(e, n, r = !0, s) {
|
|
5
4
|
this.automaticComponentRegistration = !0, this.registeredComponents = {}, this.propStateRegistrations = /* @__PURE__ */ new Map(), this.eventListenerRegistrations = /* @__PURE__ */ new Map(), this.host = e, this.stores = n, this.automaticComponentRegistration = r, this.eventOverrides = s, T(`[${this.hostTagName}] Initializing (abstract) provider.`, { eventOverrides: s }), this.registerComponent = this.registerComponent.bind(this), this.getStore = this.getStore.bind(this), Object.keys(this.stores).forEach((i) => {
|
|
6
5
|
this.propStateRegistrations.set(i, /* @__PURE__ */ new Map());
|
|
@@ -62,35 +61,35 @@ class ar {
|
|
|
62
61
|
return;
|
|
63
62
|
}
|
|
64
63
|
const { stateToProps: r, getStoresToProp: s, eventToProps: i, storeToProps: o, connectorToProp: u, element: a } = e;
|
|
65
|
-
a.dataset.nylasId =
|
|
66
|
-
const
|
|
67
|
-
i == null || i.forEach((h,
|
|
68
|
-
var
|
|
69
|
-
const d = this.nylasConnector,
|
|
70
|
-
T(`[${this.hostTagName}] Handling "${e.name}" prop "${String(
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
const
|
|
74
|
-
T(`[${this.hostTagName}] Adding event listener for "${
|
|
75
|
-
}), r == null || r.forEach((h,
|
|
76
|
-
var
|
|
77
|
-
const [d,
|
|
64
|
+
a.dataset.nylasId = nr(), this.registeredComponents[a.dataset.nylasId] = e;
|
|
65
|
+
const c = this.eventOverrides;
|
|
66
|
+
console.log("eventOverrides", c, e.name, i), i == null || i.forEach((h, l) => {
|
|
67
|
+
var v;
|
|
68
|
+
const d = this.nylasConnector, f = async (g) => {
|
|
69
|
+
T(`[${this.hostTagName}] Handling "${e.name}" prop "${String(l)}" event.`, { event: g }), l in c && (T(`[${this.hostTagName}] Found event override for "${String(l)}" event. Calling override.`), await c[l](g, d)), g.defaultPrevented || await h(g, d);
|
|
70
|
+
}, m = e.element.dataset.nylasId;
|
|
71
|
+
m && !this.eventListenerRegistrations.has(m) && this.eventListenerRegistrations.set(m, []), m && ((v = this.eventListenerRegistrations.get(m)) == null || v.push([a, l, f])), T(`[${this.hostTagName}] Setting "${e.name}" event "${String(l)}" to automcially call NylasConnector method.`);
|
|
72
|
+
const p = hn(l.toString());
|
|
73
|
+
T(`[${this.hostTagName}] Adding event listener for "${p}" on "${a.tagName}"`), a.addEventListener(p, f);
|
|
74
|
+
}), r == null || r.forEach((h, l) => {
|
|
75
|
+
var v, g, y, b;
|
|
76
|
+
const [d, f] = l.split("."), p = this.getStore(d).state[f];
|
|
78
77
|
if (!a.dataset.nylasId) {
|
|
79
78
|
T(`[${this.hostTagName}] Component "${e.name}" not registered. Skipping.`, { component: e });
|
|
80
79
|
return;
|
|
81
80
|
}
|
|
82
|
-
this.propStateRegistrations.has(d) || this.propStateRegistrations.set(d, /* @__PURE__ */ new Map()), (
|
|
81
|
+
this.propStateRegistrations.has(d) || this.propStateRegistrations.set(d, /* @__PURE__ */ new Map()), (v = this.propStateRegistrations.get(d)) != null && v.has(f) ? (b = (y = this.propStateRegistrations.get(d)) == null ? void 0 : y.get(f)) == null || b.push({
|
|
83
82
|
elementId: a.dataset.nylasId,
|
|
84
83
|
propKey: h
|
|
85
|
-
}) : (g = this.propStateRegistrations.get(d)) == null || g.set(
|
|
84
|
+
}) : (g = this.propStateRegistrations.get(d)) == null || g.set(f, [
|
|
86
85
|
{
|
|
87
86
|
elementId: a.dataset.nylasId,
|
|
88
87
|
propKey: h
|
|
89
88
|
}
|
|
90
|
-
]), a[h.toString()] =
|
|
91
|
-
}), s && (a[s == null ? void 0 : s.toString()] = this.getStore, T(`[${this.hostTagName}] Setting "${e.name}" prop "${s.toString()}" to "getStore" method.`)), o == null || o.forEach((h,
|
|
92
|
-
const d = this.getStore(
|
|
93
|
-
a[h.toString()] = d, T(`[${this.hostTagName}] Setting "${e.name}" prop "${h.toString()}" to "${
|
|
89
|
+
]), a[h.toString()] = p, T(`[${this.hostTagName}] Setting "${e.name}" prop "${h.toString()}" to "${l}" value.`, { stateValue: p });
|
|
90
|
+
}), s && (a[s == null ? void 0 : s.toString()] = this.getStore, T(`[${this.hostTagName}] Setting "${e.name}" prop "${s.toString()}" to "getStore" method.`)), o == null || o.forEach((h, l) => {
|
|
91
|
+
const d = this.getStore(l);
|
|
92
|
+
a[h.toString()] = d, T(`[${this.hostTagName}] Setting "${e.name}" prop "${h.toString()}" to "${l}" store.`, { store: d });
|
|
94
93
|
}), u && (a[u == null ? void 0 : u.toString()] = this.nylasConnector, T(`[${this.hostTagName}] Setting "${e.name}" prop "${u.toString()}" to "nylasConnector" value.`, { connectorToProp: u })), T(`[${this.hostTagName}] Component ${e.name} registered.`);
|
|
95
94
|
}
|
|
96
95
|
unregisterComponent(e) {
|
|
@@ -106,14 +105,14 @@ class ar {
|
|
|
106
105
|
}
|
|
107
106
|
this.propStateRegistrations.forEach((s, i) => {
|
|
108
107
|
s.forEach((o, u) => {
|
|
109
|
-
var h,
|
|
110
|
-
const a = (h = this.propStateRegistrations.get(i)) == null ? void 0 : h.get(u),
|
|
111
|
-
|
|
108
|
+
var h, l;
|
|
109
|
+
const a = (h = this.propStateRegistrations.get(i)) == null ? void 0 : h.get(u), c = a == null ? void 0 : a.filter((d) => d.elementId !== n);
|
|
110
|
+
c && ((l = this.propStateRegistrations.get(i)) == null || l.set(u, c));
|
|
112
111
|
});
|
|
113
112
|
});
|
|
114
113
|
const r = this.eventListenerRegistrations.get(n);
|
|
115
114
|
r == null || r.forEach(([s, i, o]) => {
|
|
116
|
-
const u =
|
|
115
|
+
const u = hn(i.toString());
|
|
117
116
|
T(`[${this.hostTagName}] Removing event listener for "${u}" on "${s.tagName}"`), s.removeEventListener(u, o);
|
|
118
117
|
}), delete this.registeredComponents[n];
|
|
119
118
|
}
|
|
@@ -128,7 +127,7 @@ class ar {
|
|
|
128
127
|
Object.entries(this.stores).forEach(([n, r]) => {
|
|
129
128
|
T(`[${e.hostTagName}] Listening for changes in "${n}" store.`), r.use({
|
|
130
129
|
set(s, i, o) {
|
|
131
|
-
var
|
|
130
|
+
var c;
|
|
132
131
|
if (T(`[${e.hostTagName}] Store "${n}" state "${s.toString()}" changed`, { newValue: i, oldValue: o }), i === o) {
|
|
133
132
|
T(`[${e.hostTagName}] Store "${n}" state "${s.toString()}" unchanged. Skipping.`);
|
|
134
133
|
return;
|
|
@@ -138,18 +137,18 @@ class ar {
|
|
|
138
137
|
T(`[${e.hostTagName}] No registered components found. Skipping.`);
|
|
139
138
|
return;
|
|
140
139
|
}
|
|
141
|
-
const a = ((
|
|
140
|
+
const a = ((c = e.propStateRegistrations.get(n)) == null ? void 0 : c.get(s.toString())) || [];
|
|
142
141
|
T(`[${e.hostTagName}] Found ${a.length} prop(s) registered for "${s.toString()}" store.`, {
|
|
143
142
|
props: a,
|
|
144
143
|
propStateRegistrations: e.propStateRegistrations
|
|
145
|
-
}), a.forEach(({ elementId: h, propKey:
|
|
144
|
+
}), a.forEach(({ elementId: h, propKey: l }) => {
|
|
146
145
|
const d = u[h];
|
|
147
146
|
if (!d) {
|
|
148
147
|
T(`[${e.hostTagName}] Component "${h}" not found. Skipping.`, { component: d });
|
|
149
148
|
return;
|
|
150
149
|
}
|
|
151
|
-
const
|
|
152
|
-
d.element[
|
|
150
|
+
const m = e.getStore(n).state[s];
|
|
151
|
+
d.element[l.toString()] = m, T(`[${e.hostTagName}] Setting "${d.name}" prop "${l.toString()}" to "${s.toString()}" value.`, { stateValue: m });
|
|
153
152
|
});
|
|
154
153
|
}
|
|
155
154
|
});
|
|
@@ -160,64 +159,65 @@ class ar {
|
|
|
160
159
|
return ((n = (e = this.host) == null ? void 0 : e.tagName) == null ? void 0 : n.toLowerCase()) ?? "nylas-provider";
|
|
161
160
|
}
|
|
162
161
|
}
|
|
163
|
-
class
|
|
162
|
+
class ns extends rr {
|
|
164
163
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
164
|
+
const sr = typeof global < "u" ? global : typeof self < "u" ? self : typeof window < "u" ? window : {};
|
|
165
|
+
var ir = Object.defineProperty, or = (t, e, n) => e in t ? ir(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, ut = (t, e, n) => (or(t, typeof e != "symbol" ? e + "" : e, n), n), ar = /* @__PURE__ */ ((t) => (t.Error = "error", t.Warning = "warning", t.Info = "info", t.Success = "success", t))(ar || {});
|
|
166
|
+
const rs = (t) => "error" in t;
|
|
167
|
+
class ss extends Error {
|
|
168
168
|
constructor(e) {
|
|
169
169
|
super(e == null ? void 0 : e.message), ut(this, "apiError"), this.name = "NylasAPIError", this.stack = new Error().stack, this.apiError = e;
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
|
-
async function
|
|
172
|
+
async function dn(t) {
|
|
173
173
|
const e = new TextEncoder().encode(t), n = await crypto.subtle.digest("SHA-256", e), r = Array.from(new Uint8Array(n)).map((s) => s.toString(16).padStart(2, "0")).join("");
|
|
174
174
|
return btoa(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
175
175
|
}
|
|
176
|
-
const K = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window :
|
|
176
|
+
const K = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : sr, D = Object.keys, M = Array.isArray;
|
|
177
177
|
function U(t, e) {
|
|
178
|
-
return typeof e != "object" ||
|
|
178
|
+
return typeof e != "object" || D(e).forEach(function(n) {
|
|
179
179
|
t[n] = e[n];
|
|
180
180
|
}), t;
|
|
181
181
|
}
|
|
182
182
|
typeof Promise > "u" || K.Promise || (K.Promise = Promise);
|
|
183
|
-
const Be = Object.getPrototypeOf,
|
|
183
|
+
const Be = Object.getPrototypeOf, ur = {}.hasOwnProperty;
|
|
184
184
|
function z(t, e) {
|
|
185
|
-
return
|
|
185
|
+
return ur.call(t, e);
|
|
186
186
|
}
|
|
187
187
|
function Ee(t, e) {
|
|
188
|
-
typeof e == "function" && (e = e(Be(t))), (typeof Reflect > "u" ?
|
|
188
|
+
typeof e == "function" && (e = e(Be(t))), (typeof Reflect > "u" ? D : Reflect.ownKeys)(e).forEach((n) => {
|
|
189
189
|
ee(t, n, e[n]);
|
|
190
190
|
});
|
|
191
191
|
}
|
|
192
|
-
const
|
|
192
|
+
const En = Object.defineProperty;
|
|
193
193
|
function ee(t, e, n, r) {
|
|
194
|
-
|
|
194
|
+
En(t, e, U(n && z(n, "get") && typeof n.get == "function" ? { get: n.get, set: n.set, configurable: !0 } : { value: n, configurable: !0, writable: !0 }, r));
|
|
195
195
|
}
|
|
196
196
|
function ke(t) {
|
|
197
197
|
return { from: function(e) {
|
|
198
198
|
return t.prototype = Object.create(e.prototype), ee(t.prototype, "constructor", t), { extend: Ee.bind(null, t.prototype) };
|
|
199
199
|
} };
|
|
200
200
|
}
|
|
201
|
-
const
|
|
202
|
-
function
|
|
201
|
+
const lr = Object.getOwnPropertyDescriptor;
|
|
202
|
+
function Jt(t, e) {
|
|
203
203
|
let n;
|
|
204
|
-
return
|
|
204
|
+
return lr(t, e) || (n = Be(t)) && Jt(n, e);
|
|
205
205
|
}
|
|
206
|
-
const
|
|
207
|
-
function
|
|
208
|
-
return
|
|
206
|
+
const cr = [].slice;
|
|
207
|
+
function lt(t, e, n) {
|
|
208
|
+
return cr.call(t, e, n);
|
|
209
209
|
}
|
|
210
|
-
function
|
|
210
|
+
function Pn(t, e) {
|
|
211
211
|
return e(t);
|
|
212
212
|
}
|
|
213
213
|
function Ie(t) {
|
|
214
214
|
if (!t)
|
|
215
215
|
throw new Error("Assertion Failed");
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function Cn(t) {
|
|
218
218
|
K.setImmediate ? setImmediate(t) : setTimeout(t, 0);
|
|
219
219
|
}
|
|
220
|
-
function
|
|
220
|
+
function Tn(t, e) {
|
|
221
221
|
return t.reduce((n, r, s) => {
|
|
222
222
|
var i = e(r, s);
|
|
223
223
|
return i && (n[i[0]] = i[1]), n;
|
|
@@ -252,70 +252,70 @@ function H(t, e, n) {
|
|
|
252
252
|
if (i !== -1) {
|
|
253
253
|
var o = e.substr(0, i), u = e.substr(i + 1);
|
|
254
254
|
if (u === "")
|
|
255
|
-
n === void 0 ?
|
|
255
|
+
n === void 0 ? M(t) && !isNaN(parseInt(o)) ? t.splice(o, 1) : delete t[o] : t[o] = n;
|
|
256
256
|
else {
|
|
257
257
|
var a = t[o];
|
|
258
258
|
a && z(t, o) || (a = t[o] = {}), H(a, u, n);
|
|
259
259
|
}
|
|
260
260
|
} else
|
|
261
|
-
n === void 0 ?
|
|
261
|
+
n === void 0 ? M(t) && !isNaN(parseInt(e)) ? t.splice(e, 1) : delete t[e] : t[e] = n;
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
|
-
function
|
|
264
|
+
function An(t) {
|
|
265
265
|
var e = {};
|
|
266
266
|
for (var n in t)
|
|
267
267
|
z(t, n) && (e[n] = t[n]);
|
|
268
268
|
return e;
|
|
269
269
|
}
|
|
270
|
-
const
|
|
271
|
-
function
|
|
272
|
-
return
|
|
270
|
+
const hr = [].concat;
|
|
271
|
+
function On(t) {
|
|
272
|
+
return hr.apply([], t);
|
|
273
273
|
}
|
|
274
|
-
const
|
|
275
|
-
|
|
274
|
+
const In = "Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(On([8, 16, 32, 64].map((t) => ["Int", "Uint", "Float"].map((e) => e + t + "Array")))).filter((t) => K[t]), dr = In.map((t) => K[t]);
|
|
275
|
+
Tn(In, (t) => [t, !0]);
|
|
276
276
|
let se = null;
|
|
277
277
|
function We(t) {
|
|
278
278
|
se = typeof WeakMap < "u" && /* @__PURE__ */ new WeakMap();
|
|
279
|
-
const e =
|
|
279
|
+
const e = Ct(t);
|
|
280
280
|
return se = null, e;
|
|
281
281
|
}
|
|
282
|
-
function
|
|
282
|
+
function Ct(t) {
|
|
283
283
|
if (!t || typeof t != "object")
|
|
284
284
|
return t;
|
|
285
285
|
let e = se && se.get(t);
|
|
286
286
|
if (e)
|
|
287
287
|
return e;
|
|
288
|
-
if (
|
|
288
|
+
if (M(t)) {
|
|
289
289
|
e = [], se && se.set(t, e);
|
|
290
290
|
for (var n = 0, r = t.length; n < r; ++n)
|
|
291
|
-
e.push(
|
|
292
|
-
} else if (
|
|
291
|
+
e.push(Ct(t[n]));
|
|
292
|
+
} else if (dr.indexOf(t.constructor) >= 0)
|
|
293
293
|
e = t;
|
|
294
294
|
else {
|
|
295
295
|
const i = Be(t);
|
|
296
296
|
for (var s in e = i === Object.prototype ? {} : Object.create(i), se && se.set(t, e), t)
|
|
297
|
-
z(t, s) && (e[s] =
|
|
297
|
+
z(t, s) && (e[s] = Ct(t[s]));
|
|
298
298
|
}
|
|
299
299
|
return e;
|
|
300
300
|
}
|
|
301
|
-
const { toString:
|
|
302
|
-
function
|
|
303
|
-
return
|
|
301
|
+
const { toString: fr } = {};
|
|
302
|
+
function Tt(t) {
|
|
303
|
+
return fr.call(t).slice(8, -1);
|
|
304
304
|
}
|
|
305
|
-
const
|
|
305
|
+
const At = typeof Symbol < "u" ? Symbol.iterator : "@@iterator", pr = typeof At == "symbol" ? function(t) {
|
|
306
306
|
var e;
|
|
307
|
-
return t != null && (e = t[
|
|
307
|
+
return t != null && (e = t[At]) && e.apply(t);
|
|
308
308
|
} : function() {
|
|
309
309
|
return null;
|
|
310
310
|
}, _e = {};
|
|
311
311
|
function J(t) {
|
|
312
312
|
var e, n, r, s;
|
|
313
313
|
if (arguments.length === 1) {
|
|
314
|
-
if (
|
|
314
|
+
if (M(t))
|
|
315
315
|
return t.slice();
|
|
316
316
|
if (this === _e && typeof t == "string")
|
|
317
317
|
return [t];
|
|
318
|
-
if (s =
|
|
318
|
+
if (s = pr(t)) {
|
|
319
319
|
for (n = []; !(r = s.next()).done; )
|
|
320
320
|
n.push(r.value);
|
|
321
321
|
return n;
|
|
@@ -333,15 +333,15 @@ function J(t) {
|
|
|
333
333
|
n[e] = arguments[e];
|
|
334
334
|
return n;
|
|
335
335
|
}
|
|
336
|
-
const
|
|
336
|
+
const Zt = typeof Symbol < "u" ? (t) => t[Symbol.toStringTag] === "AsyncFunction" : () => !1;
|
|
337
337
|
var G = typeof location < "u" && /^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);
|
|
338
|
-
function
|
|
339
|
-
G = t,
|
|
338
|
+
function Kn(t, e) {
|
|
339
|
+
G = t, jn = e;
|
|
340
340
|
}
|
|
341
|
-
var
|
|
342
|
-
const
|
|
341
|
+
var jn = () => !0;
|
|
342
|
+
const mr = !new Error("").stack;
|
|
343
343
|
function Pe() {
|
|
344
|
-
if (
|
|
344
|
+
if (mr)
|
|
345
345
|
try {
|
|
346
346
|
throw new Error();
|
|
347
347
|
} catch (t) {
|
|
@@ -349,51 +349,51 @@ function Pe() {
|
|
|
349
349
|
}
|
|
350
350
|
return new Error();
|
|
351
351
|
}
|
|
352
|
-
function
|
|
352
|
+
function Ot(t, e) {
|
|
353
353
|
var n = t.stack;
|
|
354
354
|
return n ? (e = e || 0, n.indexOf(t.name) === 0 && (e += (t.name + t.message).split(`
|
|
355
355
|
`).length), n.split(`
|
|
356
|
-
`).slice(e).filter(
|
|
356
|
+
`).slice(e).filter(jn).map((r) => `
|
|
357
357
|
` + r).join("")) : "";
|
|
358
358
|
}
|
|
359
|
-
var
|
|
359
|
+
var Rn = ["Unknown", "Constraint", "Data", "TransactionInactive", "ReadOnly", "Version", "NotFound", "InvalidState", "InvalidAccess", "Abort", "Timeout", "QuotaExceeded", "Syntax", "DataClone"], en = ["Modify", "Bulk", "OpenFailed", "VersionChange", "Schema", "Upgrade", "InvalidTable", "MissingAPI", "NoSuchDatabase", "InvalidArgument", "SubTransaction", "Unsupported", "Internal", "DatabaseClosed", "PrematureCommit", "ForeignAwait"].concat(Rn), yr = { VersionChanged: "Database version changed by other database connection", DatabaseClosed: "Database has been closed", Abort: "Transaction aborted", TransactionInactive: "Transaction has already completed or failed", MissingAPI: "IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb" };
|
|
360
360
|
function xe(t, e) {
|
|
361
361
|
this._e = Pe(), this.name = t, this.message = e;
|
|
362
362
|
}
|
|
363
|
-
function
|
|
363
|
+
function Nn(t, e) {
|
|
364
364
|
return t + ". Errors: " + Object.keys(e).map((n) => e[n].toString()).filter((n, r, s) => s.indexOf(n) === r).join(`
|
|
365
365
|
`);
|
|
366
366
|
}
|
|
367
|
-
function
|
|
368
|
-
this._e = Pe(), this.failures = e, this.failedKeys = r, this.successCount = n, this.message =
|
|
367
|
+
function ct(t, e, n, r) {
|
|
368
|
+
this._e = Pe(), this.failures = e, this.failedKeys = r, this.successCount = n, this.message = Nn(t, e);
|
|
369
369
|
}
|
|
370
|
-
function
|
|
371
|
-
this._e = Pe(), this.name = "BulkError", this.failures = Object.keys(e).map((n) => e[n]), this.failuresByPos = e, this.message =
|
|
370
|
+
function je(t, e) {
|
|
371
|
+
this._e = Pe(), this.name = "BulkError", this.failures = Object.keys(e).map((n) => e[n]), this.failuresByPos = e, this.message = Nn(t, e);
|
|
372
372
|
}
|
|
373
373
|
ke(xe).from(Error).extend({ stack: { get: function() {
|
|
374
|
-
return this._stack || (this._stack = this.name + ": " + this.message +
|
|
374
|
+
return this._stack || (this._stack = this.name + ": " + this.message + Ot(this._e, 2));
|
|
375
375
|
} }, toString: function() {
|
|
376
376
|
return this.name + ": " + this.message;
|
|
377
|
-
} }), ke(
|
|
378
|
-
var
|
|
379
|
-
const
|
|
380
|
-
var C =
|
|
377
|
+
} }), ke(ct).from(xe), ke(je).from(xe);
|
|
378
|
+
var tn = en.reduce((t, e) => (t[e] = e + "Error", t), {});
|
|
379
|
+
const gr = xe;
|
|
380
|
+
var C = en.reduce((t, e) => {
|
|
381
381
|
var n = e + "Error";
|
|
382
382
|
function r(s, i) {
|
|
383
383
|
this._e = Pe(), this.name = n, s ? typeof s == "string" ? (this.message = `${s}${i ? `
|
|
384
|
-
` + i : ""}`, this.inner = i || null) : typeof s == "object" && (this.message = `${s.name} ${s.message}`, this.inner = s) : (this.message =
|
|
384
|
+
` + i : ""}`, this.inner = i || null) : typeof s == "object" && (this.message = `${s.name} ${s.message}`, this.inner = s) : (this.message = yr[e] || n, this.inner = null);
|
|
385
385
|
}
|
|
386
|
-
return ke(r).from(
|
|
386
|
+
return ke(r).from(gr), t[e] = r, t;
|
|
387
387
|
}, {});
|
|
388
388
|
C.Syntax = SyntaxError, C.Type = TypeError, C.Range = RangeError;
|
|
389
|
-
var
|
|
389
|
+
var fn = Rn.reduce((t, e) => (t[e + "Error"] = C[e], t), {}), tt = en.reduce((t, e) => (["Syntax", "Type", "Range"].indexOf(e) === -1 && (t[e + "Error"] = C[e]), t), {});
|
|
390
390
|
function I() {
|
|
391
391
|
}
|
|
392
|
-
function
|
|
392
|
+
function Fe(t) {
|
|
393
393
|
return t;
|
|
394
394
|
}
|
|
395
|
-
function
|
|
396
|
-
return t == null || t ===
|
|
395
|
+
function vr(t, e) {
|
|
396
|
+
return t == null || t === Fe ? e : function(n) {
|
|
397
397
|
return e(t(n));
|
|
398
398
|
};
|
|
399
399
|
}
|
|
@@ -402,7 +402,7 @@ function me(t, e) {
|
|
|
402
402
|
t.apply(this, arguments), e.apply(this, arguments);
|
|
403
403
|
};
|
|
404
404
|
}
|
|
405
|
-
function
|
|
405
|
+
function br(t, e) {
|
|
406
406
|
return t === I ? e : function() {
|
|
407
407
|
var n = t.apply(this, arguments);
|
|
408
408
|
n !== void 0 && (arguments[0] = n);
|
|
@@ -412,14 +412,14 @@ function kr(t, e) {
|
|
|
412
412
|
return r && (this.onsuccess = this.onsuccess ? me(r, this.onsuccess) : r), s && (this.onerror = this.onerror ? me(s, this.onerror) : s), i !== void 0 ? i : n;
|
|
413
413
|
};
|
|
414
414
|
}
|
|
415
|
-
function
|
|
415
|
+
function wr(t, e) {
|
|
416
416
|
return t === I ? e : function() {
|
|
417
417
|
t.apply(this, arguments);
|
|
418
418
|
var n = this.onsuccess, r = this.onerror;
|
|
419
419
|
this.onsuccess = this.onerror = null, e.apply(this, arguments), n && (this.onsuccess = this.onsuccess ? me(n, this.onsuccess) : n), r && (this.onerror = this.onerror ? me(r, this.onerror) : r);
|
|
420
420
|
};
|
|
421
421
|
}
|
|
422
|
-
function
|
|
422
|
+
function _r(t, e) {
|
|
423
423
|
return t === I ? e : function(n) {
|
|
424
424
|
var r = t.apply(this, arguments);
|
|
425
425
|
U(n, r);
|
|
@@ -429,12 +429,12 @@ function Sr(t, e) {
|
|
|
429
429
|
return s && (this.onsuccess = this.onsuccess ? me(s, this.onsuccess) : s), i && (this.onerror = this.onerror ? me(i, this.onerror) : i), r === void 0 ? o === void 0 ? void 0 : o : U(r, o);
|
|
430
430
|
};
|
|
431
431
|
}
|
|
432
|
-
function
|
|
432
|
+
function kr(t, e) {
|
|
433
433
|
return t === I ? e : function() {
|
|
434
434
|
return e.apply(this, arguments) !== !1 && t.apply(this, arguments);
|
|
435
435
|
};
|
|
436
436
|
}
|
|
437
|
-
function
|
|
437
|
+
function nn(t, e) {
|
|
438
438
|
return t === I ? e : function() {
|
|
439
439
|
var n = t.apply(this, arguments);
|
|
440
440
|
if (n && typeof n.then == "function") {
|
|
@@ -447,17 +447,17 @@ function rn(t, e) {
|
|
|
447
447
|
return e.apply(this, arguments);
|
|
448
448
|
};
|
|
449
449
|
}
|
|
450
|
-
tt.ModifyError =
|
|
451
|
-
var
|
|
452
|
-
const
|
|
450
|
+
tt.ModifyError = ct, tt.DexieError = xe, tt.BulkError = je;
|
|
451
|
+
var Me = {};
|
|
452
|
+
const Dn = 100, [It, ht, Kt] = typeof Promise > "u" ? [] : (() => {
|
|
453
453
|
let t = Promise.resolve();
|
|
454
454
|
if (typeof crypto > "u" || !crypto.subtle)
|
|
455
455
|
return [t, Be(t), t];
|
|
456
456
|
const e = crypto.subtle.digest("SHA-512", new Uint8Array([0]));
|
|
457
457
|
return [e, Be(e), t];
|
|
458
|
-
})(),
|
|
459
|
-
var jt = !1,
|
|
460
|
-
|
|
458
|
+
})(), $n = ht && ht.then, nt = It && It.constructor, rn = !!Kt;
|
|
459
|
+
var jt = !1, xr = Kt ? () => {
|
|
460
|
+
Kt.then(Ye);
|
|
461
461
|
} : K.setImmediate ? setImmediate.bind(null, Ye) : K.MutationObserver ? () => {
|
|
462
462
|
var t = document.createElement("div");
|
|
463
463
|
new MutationObserver(() => {
|
|
@@ -465,12 +465,12 @@ var jt = !1, Pr = Rt ? () => {
|
|
|
465
465
|
}).observe(t, { attributes: !0 }), t.setAttribute("i", "1");
|
|
466
466
|
} : () => {
|
|
467
467
|
setTimeout(Ye, 0);
|
|
468
|
-
},
|
|
469
|
-
Ke.push([t, e]), dt && (
|
|
470
|
-
},
|
|
468
|
+
}, Re = function(t, e) {
|
|
469
|
+
Ke.push([t, e]), dt && (xr(), dt = !1);
|
|
470
|
+
}, Rt = !0, dt = !0, de = [], rt = [], Nt = null, Dt = Fe, Se = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: yn, pgp: !1, env: {}, finalize: function() {
|
|
471
471
|
this.unhandleds.forEach((t) => {
|
|
472
472
|
try {
|
|
473
|
-
|
|
473
|
+
yn(t[0], t[1]);
|
|
474
474
|
} catch {
|
|
475
475
|
}
|
|
476
476
|
});
|
|
@@ -481,86 +481,86 @@ function S(t) {
|
|
|
481
481
|
this._listeners = [], this.onuncatched = I, this._lib = !1;
|
|
482
482
|
var e = this._PSD = P;
|
|
483
483
|
if (G && (this._stackHolder = Pe(), this._prev = null, this._numPrev = 0), typeof t != "function") {
|
|
484
|
-
if (t !==
|
|
484
|
+
if (t !== Me)
|
|
485
485
|
throw new TypeError("Not a function");
|
|
486
|
-
return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 &&
|
|
486
|
+
return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 && Bt(this, this._value));
|
|
487
487
|
}
|
|
488
|
-
this._state = null, this._value = null, ++e.ref,
|
|
488
|
+
this._state = null, this._value = null, ++e.ref, Fn(this, t);
|
|
489
489
|
}
|
|
490
|
-
const
|
|
490
|
+
const $t = { get: function() {
|
|
491
491
|
var t = P, e = ft;
|
|
492
492
|
function n(r, s) {
|
|
493
493
|
var i = !t.global && (t !== P || e !== ft);
|
|
494
494
|
const o = i && !ne();
|
|
495
|
-
var u = new S((a,
|
|
496
|
-
|
|
495
|
+
var u = new S((a, c) => {
|
|
496
|
+
sn(this, new Bn(pt(r, t, i, o), pt(s, t, i, o), a, c, t));
|
|
497
497
|
});
|
|
498
|
-
return G &&
|
|
498
|
+
return G && Ln(u, this), u;
|
|
499
499
|
}
|
|
500
|
-
return n.prototype =
|
|
500
|
+
return n.prototype = Me, n;
|
|
501
501
|
}, set: function(t) {
|
|
502
|
-
ee(this, "then", t && t.prototype ===
|
|
502
|
+
ee(this, "then", t && t.prototype === Me ? $t : { get: function() {
|
|
503
503
|
return t;
|
|
504
|
-
}, set:
|
|
504
|
+
}, set: $t.set });
|
|
505
505
|
} };
|
|
506
|
-
function
|
|
506
|
+
function Bn(t, e, n, r, s) {
|
|
507
507
|
this.onFulfilled = typeof t == "function" ? t : null, this.onRejected = typeof e == "function" ? e : null, this.resolve = n, this.reject = r, this.psd = s;
|
|
508
508
|
}
|
|
509
|
-
function
|
|
509
|
+
function Fn(t, e) {
|
|
510
510
|
try {
|
|
511
511
|
e((n) => {
|
|
512
512
|
if (t._state === null) {
|
|
513
513
|
if (n === t)
|
|
514
514
|
throw new TypeError("A promise cannot be resolved with itself.");
|
|
515
515
|
var r = t._lib && ze();
|
|
516
|
-
n && typeof n.then == "function" ?
|
|
516
|
+
n && typeof n.then == "function" ? Fn(t, (s, i) => {
|
|
517
517
|
n instanceof S ? n._then(s, i) : n.then(s, i);
|
|
518
|
-
}) : (t._state = !0, t._value = n,
|
|
518
|
+
}) : (t._state = !0, t._value = n, Mn(t)), r && He();
|
|
519
519
|
}
|
|
520
|
-
},
|
|
520
|
+
}, Bt.bind(null, t));
|
|
521
521
|
} catch (n) {
|
|
522
|
-
|
|
522
|
+
Bt(t, n);
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
|
-
function
|
|
525
|
+
function Bt(t, e) {
|
|
526
526
|
if (rt.push(e), t._state === null) {
|
|
527
527
|
var n = t._lib && ze();
|
|
528
|
-
e =
|
|
528
|
+
e = Dt(e), t._state = !1, t._value = e, G && e !== null && typeof e == "object" && !e._promise && function(r, s, i) {
|
|
529
529
|
try {
|
|
530
530
|
r.apply(null, i);
|
|
531
531
|
} catch (o) {
|
|
532
532
|
s && s(o);
|
|
533
533
|
}
|
|
534
534
|
}(() => {
|
|
535
|
-
var r =
|
|
535
|
+
var r = Jt(e, "stack");
|
|
536
536
|
e._promise = t, ee(e, "stack", { get: () => jt ? r && (r.get ? r.get.apply(e) : r.value) : t.stack });
|
|
537
537
|
}), function(r) {
|
|
538
538
|
de.some((s) => s._value === r._value) || de.push(r);
|
|
539
|
-
}(t),
|
|
539
|
+
}(t), Mn(t), n && He();
|
|
540
540
|
}
|
|
541
541
|
}
|
|
542
|
-
function
|
|
542
|
+
function Mn(t) {
|
|
543
543
|
var e = t._listeners;
|
|
544
544
|
t._listeners = [];
|
|
545
545
|
for (var n = 0, r = e.length; n < r; ++n)
|
|
546
|
-
|
|
546
|
+
sn(t, e[n]);
|
|
547
547
|
var s = t._PSD;
|
|
548
|
-
--s.ref || s.finalize(), fe === 0 && (++fe,
|
|
549
|
-
--fe == 0 &&
|
|
548
|
+
--s.ref || s.finalize(), fe === 0 && (++fe, Re(() => {
|
|
549
|
+
--fe == 0 && on();
|
|
550
550
|
}, []));
|
|
551
551
|
}
|
|
552
|
-
function
|
|
552
|
+
function sn(t, e) {
|
|
553
553
|
if (t._state !== null) {
|
|
554
554
|
var n = t._state ? e.onFulfilled : e.onRejected;
|
|
555
555
|
if (n === null)
|
|
556
556
|
return (t._state ? e.resolve : e.reject)(t._value);
|
|
557
|
-
++e.psd.ref, ++fe,
|
|
557
|
+
++e.psd.ref, ++fe, Re(Sr, [n, t, e]);
|
|
558
558
|
} else
|
|
559
559
|
t._listeners.push(e);
|
|
560
560
|
}
|
|
561
|
-
function
|
|
561
|
+
function Sr(t, e, n) {
|
|
562
562
|
try {
|
|
563
|
-
|
|
563
|
+
Nt = e;
|
|
564
564
|
var r, s = e._value;
|
|
565
565
|
e._state ? r = t(s) : (rt.length && (rt = []), r = t(s), rt.indexOf(s) === -1 && function(i) {
|
|
566
566
|
for (var o = de.length; o; )
|
|
@@ -570,20 +570,20 @@ function Cr(t, e, n) {
|
|
|
570
570
|
} catch (i) {
|
|
571
571
|
n.reject(i);
|
|
572
572
|
} finally {
|
|
573
|
-
|
|
573
|
+
Nt = null, --fe == 0 && on(), --n.psd.ref || n.psd.finalize();
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
|
-
function
|
|
576
|
+
function qn(t, e, n) {
|
|
577
577
|
if (e.length === n)
|
|
578
578
|
return e;
|
|
579
579
|
var r = "";
|
|
580
580
|
if (t._state === !1) {
|
|
581
581
|
var s, i, o = t._value;
|
|
582
|
-
o != null ? (s = o.name || "Error", i = o.message || o, r =
|
|
582
|
+
o != null ? (s = o.name || "Error", i = o.message || o, r = Ot(o, 0)) : (s = o, i = ""), e.push(s + (i ? ": " + i : "") + r);
|
|
583
583
|
}
|
|
584
|
-
return G && ((r =
|
|
584
|
+
return G && ((r = Ot(t._stackHolder, 2)) && e.indexOf(r) === -1 && e.push(r), t._prev && qn(t._prev, e, n)), e;
|
|
585
585
|
}
|
|
586
|
-
function
|
|
586
|
+
function Ln(t, e) {
|
|
587
587
|
var n = e ? e._numPrev + 1 : 0;
|
|
588
588
|
n < 100 && (t._prev = e, t._numPrev = n);
|
|
589
589
|
}
|
|
@@ -591,8 +591,8 @@ function Ye() {
|
|
|
591
591
|
ze() && He();
|
|
592
592
|
}
|
|
593
593
|
function ze() {
|
|
594
|
-
var t =
|
|
595
|
-
return
|
|
594
|
+
var t = Rt;
|
|
595
|
+
return Rt = !1, dt = !1, t;
|
|
596
596
|
}
|
|
597
597
|
function He() {
|
|
598
598
|
var t, e, n;
|
|
@@ -603,9 +603,9 @@ function He() {
|
|
|
603
603
|
r[0].apply(null, r[1]);
|
|
604
604
|
}
|
|
605
605
|
while (Ke.length > 0);
|
|
606
|
-
|
|
606
|
+
Rt = !0, dt = !0;
|
|
607
607
|
}
|
|
608
|
-
function
|
|
608
|
+
function on() {
|
|
609
609
|
var t = de;
|
|
610
610
|
de = [], t.forEach((r) => {
|
|
611
611
|
r._PSD.onunhandled.call(null, r._value, r);
|
|
@@ -614,9 +614,9 @@ function an() {
|
|
|
614
614
|
e[--n]();
|
|
615
615
|
}
|
|
616
616
|
function Ge(t) {
|
|
617
|
-
return new S(
|
|
617
|
+
return new S(Me, !1, t);
|
|
618
618
|
}
|
|
619
|
-
function
|
|
619
|
+
function j(t, e) {
|
|
620
620
|
var n = P;
|
|
621
621
|
return function() {
|
|
622
622
|
var r = ze(), s = P;
|
|
@@ -629,8 +629,8 @@ function R(t, e) {
|
|
|
629
629
|
}
|
|
630
630
|
};
|
|
631
631
|
}
|
|
632
|
-
Ee(S.prototype, { then:
|
|
633
|
-
|
|
632
|
+
Ee(S.prototype, { then: $t, _then: function(t, e) {
|
|
633
|
+
sn(this, new Bn(null, null, t, e, P));
|
|
634
634
|
}, catch: function(t) {
|
|
635
635
|
if (arguments.length === 1)
|
|
636
636
|
return this.then(null, t);
|
|
@@ -643,7 +643,7 @@ Ee(S.prototype, { then: Bt, _then: function(t, e) {
|
|
|
643
643
|
return this._stack;
|
|
644
644
|
try {
|
|
645
645
|
jt = !0;
|
|
646
|
-
var t =
|
|
646
|
+
var t = qn(this, [], 20).join(`
|
|
647
647
|
From previous: `);
|
|
648
648
|
return this._state !== null && (this._stack = t), t;
|
|
649
649
|
} finally {
|
|
@@ -654,7 +654,7 @@ From previous: `);
|
|
|
654
654
|
var s = setTimeout(() => r(new C.Timeout(e)), t);
|
|
655
655
|
this.then(n, r).finally(clearTimeout.bind(null, s));
|
|
656
656
|
}) : this;
|
|
657
|
-
} }), typeof Symbol < "u" && Symbol.toStringTag && ee(S.prototype, Symbol.toStringTag, "Dexie.Promise"), Se.env =
|
|
657
|
+
} }), typeof Symbol < "u" && Symbol.toStringTag && ee(S.prototype, Symbol.toStringTag, "Dexie.Promise"), Se.env = Un(), Ee(S, { all: function() {
|
|
658
658
|
var t = J.apply(null, arguments).map(Xe);
|
|
659
659
|
return new S(function(e, n) {
|
|
660
660
|
t.length === 0 && e([]);
|
|
@@ -670,17 +670,17 @@ From previous: `);
|
|
|
670
670
|
return new S((n, r) => {
|
|
671
671
|
t.then(n, r);
|
|
672
672
|
});
|
|
673
|
-
var e = new S(
|
|
674
|
-
return
|
|
673
|
+
var e = new S(Me, !0, t);
|
|
674
|
+
return Ln(e, Nt), e;
|
|
675
675
|
}, reject: Ge, race: function() {
|
|
676
676
|
var t = J.apply(null, arguments).map(Xe);
|
|
677
677
|
return new S((e, n) => {
|
|
678
678
|
t.map((r) => S.resolve(r).then(e, n));
|
|
679
679
|
});
|
|
680
|
-
}, PSD: { get: () => P, set: (t) => P = t }, totalEchoes: { get: () => ft }, newPSD: oe, usePSD: Te, scheduler: { get: () =>
|
|
681
|
-
|
|
682
|
-
} }, rejectionMapper: { get: () =>
|
|
683
|
-
|
|
680
|
+
}, PSD: { get: () => P, set: (t) => P = t }, totalEchoes: { get: () => ft }, newPSD: oe, usePSD: Te, scheduler: { get: () => Re, set: (t) => {
|
|
681
|
+
Re = t;
|
|
682
|
+
} }, rejectionMapper: { get: () => Dt, set: (t) => {
|
|
683
|
+
Dt = t;
|
|
684
684
|
} }, follow: (t, e) => new S((n, r) => oe((s, i) => {
|
|
685
685
|
var o = P;
|
|
686
686
|
o.unhandleds = [], o.onunhandled = i, o.finalize = me(function() {
|
|
@@ -688,8 +688,8 @@ From previous: `);
|
|
|
688
688
|
function a() {
|
|
689
689
|
u(), st.splice(st.indexOf(a), 1);
|
|
690
690
|
}
|
|
691
|
-
st.push(a), ++fe,
|
|
692
|
-
--fe == 0 &&
|
|
691
|
+
st.push(a), ++fe, Re(() => {
|
|
692
|
+
--fe == 0 && on();
|
|
693
693
|
}, []);
|
|
694
694
|
})(() => {
|
|
695
695
|
this.unhandleds.length === 0 ? s() : i(this.unhandleds[0]);
|
|
@@ -714,44 +714,44 @@ From previous: `);
|
|
|
714
714
|
}));
|
|
715
715
|
});
|
|
716
716
|
}));
|
|
717
|
-
const
|
|
718
|
-
var
|
|
717
|
+
const F = { awaits: 0, echoes: 0, id: 0 };
|
|
718
|
+
var Er = 0, it = [], wt = 0, ft = 0, Pr = 0;
|
|
719
719
|
function oe(t, e, n, r) {
|
|
720
720
|
var s = P, i = Object.create(s);
|
|
721
|
-
i.parent = s, i.ref = 0, i.global = !1, i.id = ++
|
|
721
|
+
i.parent = s, i.ref = 0, i.global = !1, i.id = ++Pr;
|
|
722
722
|
var o = Se.env;
|
|
723
|
-
i.env =
|
|
723
|
+
i.env = rn ? { Promise: S, PromiseProp: { value: S, configurable: !0, writable: !0 }, all: S.all, race: S.race, allSettled: S.allSettled, any: S.any, resolve: S.resolve, reject: S.reject, nthen: pn(o.nthen, i), gthen: pn(o.gthen, i) } : {}, e && U(i, e), ++s.ref, i.finalize = function() {
|
|
724
724
|
--this.parent.ref || this.parent.finalize();
|
|
725
725
|
};
|
|
726
726
|
var u = Te(i, t, n, r);
|
|
727
727
|
return i.ref === 0 && i.finalize(), u;
|
|
728
728
|
}
|
|
729
729
|
function Ce() {
|
|
730
|
-
return
|
|
730
|
+
return F.id || (F.id = ++Er), ++F.awaits, F.echoes += Dn, F.id;
|
|
731
731
|
}
|
|
732
732
|
function ne() {
|
|
733
|
-
return !!
|
|
733
|
+
return !!F.awaits && (--F.awaits == 0 && (F.id = 0), F.echoes = F.awaits * Dn, !0);
|
|
734
734
|
}
|
|
735
735
|
function Xe(t) {
|
|
736
|
-
return
|
|
736
|
+
return F.echoes && t && t.constructor === nt ? (Ce(), t.then((e) => (ne(), e), (e) => (ne(), $(e)))) : t;
|
|
737
737
|
}
|
|
738
|
-
function
|
|
739
|
-
++ft,
|
|
738
|
+
function Cr(t) {
|
|
739
|
+
++ft, F.echoes && --F.echoes != 0 || (F.echoes = F.id = 0), it.push(P), ae(t, !0);
|
|
740
740
|
}
|
|
741
|
-
function
|
|
741
|
+
function Tr() {
|
|
742
742
|
var t = it[it.length - 1];
|
|
743
743
|
it.pop(), ae(t, !1);
|
|
744
744
|
}
|
|
745
745
|
function ae(t, e) {
|
|
746
746
|
var n = P;
|
|
747
|
-
if ((e ? !
|
|
747
|
+
if ((e ? !F.echoes || wt++ && t === P : !wt || --wt && t === P) || Vn(e ? Cr.bind(null, t) : Tr), t !== P && (P = t, n === Se && (Se.env = Un()), rn)) {
|
|
748
748
|
var r = Se.env.Promise, s = t.env;
|
|
749
749
|
ht.then = s.nthen, r.prototype.then = s.gthen, (n.global || t.global) && (Object.defineProperty(K, "Promise", s.PromiseProp), r.all = s.all, r.race = s.race, r.resolve = s.resolve, r.reject = s.reject, s.allSettled && (r.allSettled = s.allSettled), s.any && (r.any = s.any));
|
|
750
750
|
}
|
|
751
751
|
}
|
|
752
|
-
function
|
|
752
|
+
function Un() {
|
|
753
753
|
var t = K.Promise;
|
|
754
|
-
return
|
|
754
|
+
return rn ? { Promise: t, PromiseProp: Object.getOwnPropertyDescriptor(K, "Promise"), all: t.all, race: t.race, allSettled: t.allSettled, any: t.any, resolve: t.resolve, reject: t.reject, nthen: ht.then, gthen: t.prototype.then } : {};
|
|
755
755
|
}
|
|
756
756
|
function Te(t, e, n, r, s) {
|
|
757
757
|
var i = P;
|
|
@@ -761,8 +761,8 @@ function Te(t, e, n, r, s) {
|
|
|
761
761
|
ae(i, !1);
|
|
762
762
|
}
|
|
763
763
|
}
|
|
764
|
-
function
|
|
765
|
-
|
|
764
|
+
function Vn(t) {
|
|
765
|
+
$n.call(It, t);
|
|
766
766
|
}
|
|
767
767
|
function pt(t, e, n, r) {
|
|
768
768
|
return typeof t != "function" ? t : function() {
|
|
@@ -771,18 +771,18 @@ function pt(t, e, n, r) {
|
|
|
771
771
|
try {
|
|
772
772
|
return t.apply(this, arguments);
|
|
773
773
|
} finally {
|
|
774
|
-
ae(s, !1), r &&
|
|
774
|
+
ae(s, !1), r && Vn(ne);
|
|
775
775
|
}
|
|
776
776
|
};
|
|
777
777
|
}
|
|
778
|
-
function
|
|
778
|
+
function pn(t, e) {
|
|
779
779
|
return function(n, r) {
|
|
780
780
|
return t.call(this, pt(n, e), pt(r, e));
|
|
781
781
|
};
|
|
782
782
|
}
|
|
783
|
-
("" +
|
|
784
|
-
const
|
|
785
|
-
function
|
|
783
|
+
("" + $n).indexOf("[native code]") === -1 && (Ce = ne = I);
|
|
784
|
+
const mn = "unhandledrejection";
|
|
785
|
+
function yn(t, e) {
|
|
786
786
|
var n;
|
|
787
787
|
try {
|
|
788
788
|
n = e.onuncatched(t);
|
|
@@ -791,7 +791,7 @@ function bn(t, e) {
|
|
|
791
791
|
if (n !== !1)
|
|
792
792
|
try {
|
|
793
793
|
var r, s = { promise: e, reason: t };
|
|
794
|
-
if (K.document && document.createEvent ? ((r = document.createEvent("Event")).initEvent(
|
|
794
|
+
if (K.document && document.createEvent ? ((r = document.createEvent("Event")).initEvent(mn, !0, !0), U(r, s)) : K.CustomEvent && U(r = new CustomEvent(mn, { detail: s }), s), r && K.dispatchEvent && (dispatchEvent(r), !K.PromiseRejectionEvent && K.onunhandledrejection))
|
|
795
795
|
try {
|
|
796
796
|
K.onunhandledrejection(r);
|
|
797
797
|
} catch {
|
|
@@ -800,40 +800,40 @@ function bn(t, e) {
|
|
|
800
800
|
} catch {
|
|
801
801
|
}
|
|
802
802
|
}
|
|
803
|
-
var
|
|
803
|
+
var $ = S.reject;
|
|
804
804
|
function Ft(t, e, n, r) {
|
|
805
805
|
if (t.idbdb && (t._state.openComplete || P.letThrough || t._vip)) {
|
|
806
806
|
var s = t._createTransaction(e, n, t._dbSchema);
|
|
807
807
|
try {
|
|
808
808
|
s.create(), t._state.PR1398_maxLoop = 3;
|
|
809
809
|
} catch (i) {
|
|
810
|
-
return i.name ===
|
|
810
|
+
return i.name === tn.InvalidState && t.isOpen() && --t._state.PR1398_maxLoop > 0 ? (console.warn("Dexie: Need to reopen db"), t._close(), t.open().then(() => Ft(t, e, n, r))) : $(i);
|
|
811
811
|
}
|
|
812
812
|
return s._promise(e, (i, o) => oe(() => (P.trans = s, r(i, o, s)))).then((i) => s._completion.then(() => i));
|
|
813
813
|
}
|
|
814
814
|
if (t._state.openComplete)
|
|
815
|
-
return
|
|
815
|
+
return $(new C.DatabaseClosed(t._state.dbOpenError));
|
|
816
816
|
if (!t._state.isBeingOpened) {
|
|
817
817
|
if (!t._options.autoOpen)
|
|
818
|
-
return
|
|
818
|
+
return $(new C.DatabaseClosed());
|
|
819
819
|
t.open().catch(I);
|
|
820
820
|
}
|
|
821
821
|
return t._state.dbReadyPromise.then(() => Ft(t, e, n, r));
|
|
822
822
|
}
|
|
823
|
-
const
|
|
824
|
-
function
|
|
823
|
+
const gn = "3.2.4", he = String.fromCharCode(65535), Mt = -1 / 0, X = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", Wn = "String expected.", Ne = [], gt = typeof navigator < "u" && /(MSIE|Trident|Edge)/.test(navigator.userAgent), Ar = gt, Or = gt, zn = (t) => !/(dexie\.js|dexie\.min\.js)/.test(t), vt = "__dbnames", _t = "readonly", kt = "readwrite";
|
|
824
|
+
function ye(t, e) {
|
|
825
825
|
return t ? e ? function() {
|
|
826
826
|
return t.apply(this, arguments) && e.apply(this, arguments);
|
|
827
827
|
} : t : e;
|
|
828
828
|
}
|
|
829
|
-
const
|
|
829
|
+
const Hn = { type: 3, lower: -1 / 0, lowerOpen: !1, upper: [[]], upperOpen: !1 };
|
|
830
830
|
function Qe(t) {
|
|
831
831
|
return typeof t != "string" || /\./.test(t) ? (e) => e : (e) => (e[t] === void 0 && t in e && delete (e = We(e))[t], e);
|
|
832
832
|
}
|
|
833
|
-
class
|
|
833
|
+
class Ir {
|
|
834
834
|
_trans(e, n, r) {
|
|
835
835
|
const s = this._tx || P.trans, i = this.name;
|
|
836
|
-
function o(a,
|
|
836
|
+
function o(a, c, h) {
|
|
837
837
|
if (!h.schema[i])
|
|
838
838
|
throw new C.NotFound("Table " + i + " not part of transaction");
|
|
839
839
|
return n(h.idbtrans, h);
|
|
@@ -851,29 +851,29 @@ class jr {
|
|
|
851
851
|
where(e) {
|
|
852
852
|
if (typeof e == "string")
|
|
853
853
|
return new this.db.WhereClause(this, e);
|
|
854
|
-
if (
|
|
854
|
+
if (M(e))
|
|
855
855
|
return new this.db.WhereClause(this, `[${e.join("+")}]`);
|
|
856
|
-
const n =
|
|
856
|
+
const n = D(e);
|
|
857
857
|
if (n.length === 1)
|
|
858
858
|
return this.where(n[0]).equals(e[n[0]]);
|
|
859
|
-
const r = this.schema.indexes.concat(this.schema.primKey).filter((
|
|
859
|
+
const r = this.schema.indexes.concat(this.schema.primKey).filter((c) => c.compound && n.every((h) => c.keyPath.indexOf(h) >= 0) && c.keyPath.every((h) => n.indexOf(h) >= 0))[0];
|
|
860
860
|
if (r && this.db._maxKey !== he)
|
|
861
|
-
return this.where(r.name).equals(r.keyPath.map((
|
|
861
|
+
return this.where(r.name).equals(r.keyPath.map((c) => e[c]));
|
|
862
862
|
!r && G && console.warn(`The query ${JSON.stringify(e)} on ${this.name} would benefit of a compound index [${n.join("+")}]`);
|
|
863
863
|
const { idxByName: s } = this.schema, i = this.db._deps.indexedDB;
|
|
864
|
-
function o(
|
|
864
|
+
function o(c, h) {
|
|
865
865
|
try {
|
|
866
|
-
return i.cmp(
|
|
866
|
+
return i.cmp(c, h) === 0;
|
|
867
867
|
} catch {
|
|
868
868
|
return !1;
|
|
869
869
|
}
|
|
870
870
|
}
|
|
871
|
-
const [u, a] = n.reduce(([
|
|
872
|
-
const d = s[
|
|
873
|
-
return [
|
|
874
|
-
const
|
|
875
|
-
return
|
|
876
|
-
} : (
|
|
871
|
+
const [u, a] = n.reduce(([c, h], l) => {
|
|
872
|
+
const d = s[l], f = e[l];
|
|
873
|
+
return [c || d, c || !d ? ye(h, d && d.multi ? (m) => {
|
|
874
|
+
const p = te(m, l);
|
|
875
|
+
return M(p) && p.some((v) => o(f, v));
|
|
876
|
+
} : (m) => o(f, te(m, l))) : h];
|
|
877
877
|
}, [null, null]);
|
|
878
878
|
return u ? this.where(u.name).equals(e[u.keyPath]).filter(a) : r ? this.filter(a) : this.where(n).equals("");
|
|
879
879
|
}
|
|
@@ -899,7 +899,7 @@ class jr {
|
|
|
899
899
|
return new this.db.Collection(new this.db.WhereClause(this));
|
|
900
900
|
}
|
|
901
901
|
orderBy(e) {
|
|
902
|
-
return new this.db.Collection(new this.db.WhereClause(this,
|
|
902
|
+
return new this.db.Collection(new this.db.WhereClause(this, M(e) ? `[${e.join("+")}]` : e));
|
|
903
903
|
}
|
|
904
904
|
reverse() {
|
|
905
905
|
return this.toCollection().reverse();
|
|
@@ -938,14 +938,14 @@ class jr {
|
|
|
938
938
|
});
|
|
939
939
|
}
|
|
940
940
|
update(e, n) {
|
|
941
|
-
if (typeof e != "object" ||
|
|
941
|
+
if (typeof e != "object" || M(e))
|
|
942
942
|
return this.where(":id").equals(e).modify(n);
|
|
943
943
|
{
|
|
944
944
|
const r = te(e, this.schema.primKey.keyPath);
|
|
945
945
|
if (r === void 0)
|
|
946
|
-
return
|
|
946
|
+
return $(new C.InvalidArgument("Given object does not contain its primary key"));
|
|
947
947
|
try {
|
|
948
|
-
typeof n != "function" ?
|
|
948
|
+
typeof n != "function" ? D(n).forEach((s) => {
|
|
949
949
|
H(e, s, n[s]);
|
|
950
950
|
}) : n(e, { value: e, primKey: r });
|
|
951
951
|
} catch {
|
|
@@ -969,7 +969,7 @@ class jr {
|
|
|
969
969
|
return this._trans("readwrite", (n) => this.core.mutate({ trans: n, type: "delete", keys: [e] })).then((n) => n.numFailures ? S.reject(n.failures[0]) : void 0);
|
|
970
970
|
}
|
|
971
971
|
clear() {
|
|
972
|
-
return this._trans("readwrite", (e) => this.core.mutate({ trans: e, type: "deleteRange", range:
|
|
972
|
+
return this._trans("readwrite", (e) => this.core.mutate({ trans: e, type: "deleteRange", range: Hn })).then((e) => e.numFailures ? S.reject(e.failures[0]) : void 0);
|
|
973
973
|
}
|
|
974
974
|
bulkGet(e) {
|
|
975
975
|
return this._trans("readonly", (n) => this.core.getMany({ keys: e, trans: n }).then((r) => r.map((s) => this.hook.reading.fire(s))));
|
|
@@ -982,12 +982,12 @@ class jr {
|
|
|
982
982
|
throw new C.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
|
|
983
983
|
if (s && s.length !== e.length)
|
|
984
984
|
throw new C.InvalidArgument("Arguments objects and keys must have the same length");
|
|
985
|
-
const
|
|
985
|
+
const c = e.length;
|
|
986
986
|
let h = a && u ? e.map(Qe(a)) : e;
|
|
987
|
-
return this.core.mutate({ trans: o, type: "add", keys: s, values: h, wantResults: i }).then(({ numFailures:
|
|
988
|
-
if (
|
|
989
|
-
return i ? d :
|
|
990
|
-
throw new
|
|
987
|
+
return this.core.mutate({ trans: o, type: "add", keys: s, values: h, wantResults: i }).then(({ numFailures: l, results: d, lastResult: f, failures: m }) => {
|
|
988
|
+
if (l === 0)
|
|
989
|
+
return i ? d : f;
|
|
990
|
+
throw new je(`${this.name}.bulkAdd(): ${l} of ${c} operations failed`, m);
|
|
991
991
|
});
|
|
992
992
|
});
|
|
993
993
|
}
|
|
@@ -999,12 +999,12 @@ class jr {
|
|
|
999
999
|
throw new C.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
|
|
1000
1000
|
if (s && s.length !== e.length)
|
|
1001
1001
|
throw new C.InvalidArgument("Arguments objects and keys must have the same length");
|
|
1002
|
-
const
|
|
1002
|
+
const c = e.length;
|
|
1003
1003
|
let h = a && u ? e.map(Qe(a)) : e;
|
|
1004
|
-
return this.core.mutate({ trans: o, type: "put", keys: s, values: h, wantResults: i }).then(({ numFailures:
|
|
1005
|
-
if (
|
|
1006
|
-
return i ? d :
|
|
1007
|
-
throw new
|
|
1004
|
+
return this.core.mutate({ trans: o, type: "put", keys: s, values: h, wantResults: i }).then(({ numFailures: l, results: d, lastResult: f, failures: m }) => {
|
|
1005
|
+
if (l === 0)
|
|
1006
|
+
return i ? d : f;
|
|
1007
|
+
throw new je(`${this.name}.bulkPut(): ${l} of ${c} operations failed`, m);
|
|
1008
1008
|
});
|
|
1009
1009
|
});
|
|
1010
1010
|
}
|
|
@@ -1013,16 +1013,16 @@ class jr {
|
|
|
1013
1013
|
return this._trans("readwrite", (r) => this.core.mutate({ trans: r, type: "delete", keys: e })).then(({ numFailures: r, lastResult: s, failures: i }) => {
|
|
1014
1014
|
if (r === 0)
|
|
1015
1015
|
return s;
|
|
1016
|
-
throw new
|
|
1016
|
+
throw new je(`${this.name}.bulkDelete(): ${r} of ${n} operations failed`, i);
|
|
1017
1017
|
});
|
|
1018
1018
|
}
|
|
1019
1019
|
}
|
|
1020
|
-
function
|
|
1020
|
+
function De(t) {
|
|
1021
1021
|
var e = {}, n = function(o, u) {
|
|
1022
1022
|
if (u) {
|
|
1023
|
-
for (var a = arguments.length,
|
|
1024
|
-
|
|
1025
|
-
return e[o].subscribe.apply(null,
|
|
1023
|
+
for (var a = arguments.length, c = new Array(a - 1); --a; )
|
|
1024
|
+
c[a - 1] = arguments[a];
|
|
1025
|
+
return e[o].subscribe.apply(null, c), t;
|
|
1026
1026
|
}
|
|
1027
1027
|
if (typeof o == "string")
|
|
1028
1028
|
return e[o];
|
|
@@ -1033,30 +1033,30 @@ function $e(t) {
|
|
|
1033
1033
|
return n;
|
|
1034
1034
|
function i(o, u, a) {
|
|
1035
1035
|
if (typeof o != "object") {
|
|
1036
|
-
var
|
|
1037
|
-
u || (u =
|
|
1038
|
-
var h = { subscribers: [], fire: a, subscribe: function(
|
|
1039
|
-
h.subscribers.indexOf(
|
|
1040
|
-
}, unsubscribe: function(
|
|
1036
|
+
var c;
|
|
1037
|
+
u || (u = kr), a || (a = I);
|
|
1038
|
+
var h = { subscribers: [], fire: a, subscribe: function(l) {
|
|
1039
|
+
h.subscribers.indexOf(l) === -1 && (h.subscribers.push(l), h.fire = u(h.fire, l));
|
|
1040
|
+
}, unsubscribe: function(l) {
|
|
1041
1041
|
h.subscribers = h.subscribers.filter(function(d) {
|
|
1042
|
-
return d !==
|
|
1042
|
+
return d !== l;
|
|
1043
1043
|
}), h.fire = h.subscribers.reduce(u, a);
|
|
1044
1044
|
} };
|
|
1045
1045
|
return e[o] = n[o] = h, h;
|
|
1046
1046
|
}
|
|
1047
|
-
|
|
1048
|
-
var d = l
|
|
1049
|
-
if (
|
|
1050
|
-
i(
|
|
1047
|
+
D(c = o).forEach(function(l) {
|
|
1048
|
+
var d = c[l];
|
|
1049
|
+
if (M(d))
|
|
1050
|
+
i(l, c[l][0], c[l][1]);
|
|
1051
1051
|
else {
|
|
1052
1052
|
if (d !== "asap")
|
|
1053
1053
|
throw new C.InvalidArgument("Invalid event config");
|
|
1054
|
-
var
|
|
1055
|
-
for (var
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1054
|
+
var f = i(l, Fe, function() {
|
|
1055
|
+
for (var m = arguments.length, p = new Array(m); m--; )
|
|
1056
|
+
p[m] = arguments[m];
|
|
1057
|
+
f.subscribers.forEach(function(v) {
|
|
1058
|
+
Cn(function() {
|
|
1059
|
+
v.apply(null, p);
|
|
1060
1060
|
});
|
|
1061
1061
|
});
|
|
1062
1062
|
});
|
|
@@ -1071,11 +1071,11 @@ function be(t, e) {
|
|
|
1071
1071
|
return !(t.filter || t.algorithm || t.or) && (e ? t.justLimit : !t.replayFilter);
|
|
1072
1072
|
}
|
|
1073
1073
|
function xt(t, e) {
|
|
1074
|
-
t.filter =
|
|
1074
|
+
t.filter = ye(t.filter, e);
|
|
1075
1075
|
}
|
|
1076
1076
|
function St(t, e, n) {
|
|
1077
1077
|
var r = t.replayFilter;
|
|
1078
|
-
t.replayFilter = r ? () =>
|
|
1078
|
+
t.replayFilter = r ? () => ye(r(), e()) : e, t.justLimit = n && !r;
|
|
1079
1079
|
}
|
|
1080
1080
|
function ot(t, e) {
|
|
1081
1081
|
if (t.isPrimKey)
|
|
@@ -1085,25 +1085,25 @@ function ot(t, e) {
|
|
|
1085
1085
|
throw new C.Schema("KeyPath " + t.index + " on object store " + e.name + " is not indexed");
|
|
1086
1086
|
return n;
|
|
1087
1087
|
}
|
|
1088
|
-
function
|
|
1088
|
+
function vn(t, e, n) {
|
|
1089
1089
|
const r = ot(t, e.schema);
|
|
1090
1090
|
return e.openCursor({ trans: n, values: !t.keysOnly, reverse: t.dir === "prev", unique: !!t.unique, query: { index: r, range: t.range } });
|
|
1091
1091
|
}
|
|
1092
1092
|
function Je(t, e, n, r) {
|
|
1093
|
-
const s = t.replayFilter ?
|
|
1093
|
+
const s = t.replayFilter ? ye(t.filter, t.replayFilter()) : t.filter;
|
|
1094
1094
|
if (t.or) {
|
|
1095
|
-
const i = {}, o = (u, a,
|
|
1096
|
-
if (!s || s(a,
|
|
1097
|
-
var h = a.primaryKey,
|
|
1098
|
-
|
|
1095
|
+
const i = {}, o = (u, a, c) => {
|
|
1096
|
+
if (!s || s(a, c, (d) => a.stop(d), (d) => a.fail(d))) {
|
|
1097
|
+
var h = a.primaryKey, l = "" + h;
|
|
1098
|
+
l === "[object ArrayBuffer]" && (l = "" + new Uint8Array(h)), z(i, l) || (i[l] = !0, e(u, a, c));
|
|
1099
1099
|
}
|
|
1100
1100
|
};
|
|
1101
|
-
return Promise.all([t.or._iterate(o, n),
|
|
1101
|
+
return Promise.all([t.or._iterate(o, n), bn(vn(t, r, n), t.algorithm, o, !t.keysOnly && t.valueMapper)]);
|
|
1102
1102
|
}
|
|
1103
|
-
return
|
|
1103
|
+
return bn(vn(t, r, n), ye(t.algorithm, s), e, !t.keysOnly && t.valueMapper);
|
|
1104
1104
|
}
|
|
1105
|
-
function
|
|
1106
|
-
var s =
|
|
1105
|
+
function bn(t, e, n, r) {
|
|
1106
|
+
var s = j(r ? (i, o, u) => n(r(i), o, u) : n);
|
|
1107
1107
|
return t.then((i) => {
|
|
1108
1108
|
if (i)
|
|
1109
1109
|
return i.start(() => {
|
|
@@ -1118,7 +1118,7 @@ function kn(t, e, n, r) {
|
|
|
1118
1118
|
}
|
|
1119
1119
|
function L(t, e) {
|
|
1120
1120
|
try {
|
|
1121
|
-
const n =
|
|
1121
|
+
const n = wn(t), r = wn(e);
|
|
1122
1122
|
if (n !== r)
|
|
1123
1123
|
return n === "Array" ? 1 : r === "Array" ? -1 : n === "binary" ? 1 : r === "binary" ? -1 : n === "string" ? 1 : r === "string" ? -1 : n === "Date" ? 1 : r !== "Date" ? NaN : -1;
|
|
1124
1124
|
switch (n) {
|
|
@@ -1129,16 +1129,16 @@ function L(t, e) {
|
|
|
1129
1129
|
case "binary":
|
|
1130
1130
|
return function(s, i) {
|
|
1131
1131
|
const o = s.length, u = i.length, a = o < u ? o : u;
|
|
1132
|
-
for (let
|
|
1133
|
-
if (s[
|
|
1134
|
-
return s[
|
|
1132
|
+
for (let c = 0; c < a; ++c)
|
|
1133
|
+
if (s[c] !== i[c])
|
|
1134
|
+
return s[c] < i[c] ? -1 : 1;
|
|
1135
1135
|
return o === u ? 0 : o < u ? -1 : 1;
|
|
1136
|
-
}(
|
|
1136
|
+
}(_n(t), _n(e));
|
|
1137
1137
|
case "Array":
|
|
1138
1138
|
return function(s, i) {
|
|
1139
1139
|
const o = s.length, u = i.length, a = o < u ? o : u;
|
|
1140
|
-
for (let
|
|
1141
|
-
const h = L(s[
|
|
1140
|
+
for (let c = 0; c < a; ++c) {
|
|
1141
|
+
const h = L(s[c], i[c]);
|
|
1142
1142
|
if (h !== 0)
|
|
1143
1143
|
return h;
|
|
1144
1144
|
}
|
|
@@ -1149,30 +1149,30 @@ function L(t, e) {
|
|
|
1149
1149
|
}
|
|
1150
1150
|
return NaN;
|
|
1151
1151
|
}
|
|
1152
|
-
function
|
|
1152
|
+
function wn(t) {
|
|
1153
1153
|
const e = typeof t;
|
|
1154
1154
|
if (e !== "object")
|
|
1155
1155
|
return e;
|
|
1156
1156
|
if (ArrayBuffer.isView(t))
|
|
1157
1157
|
return "binary";
|
|
1158
|
-
const n =
|
|
1158
|
+
const n = Tt(t);
|
|
1159
1159
|
return n === "ArrayBuffer" ? "binary" : n;
|
|
1160
1160
|
}
|
|
1161
|
-
function
|
|
1161
|
+
function _n(t) {
|
|
1162
1162
|
return t instanceof Uint8Array ? t : ArrayBuffer.isView(t) ? new Uint8Array(t.buffer, t.byteOffset, t.byteLength) : new Uint8Array(t);
|
|
1163
1163
|
}
|
|
1164
|
-
class
|
|
1164
|
+
class Kr {
|
|
1165
1165
|
_read(e, n) {
|
|
1166
1166
|
var r = this._ctx;
|
|
1167
|
-
return r.error ? r.table._trans(null,
|
|
1167
|
+
return r.error ? r.table._trans(null, $.bind(null, r.error)) : r.table._trans("readonly", e).then(n);
|
|
1168
1168
|
}
|
|
1169
1169
|
_write(e) {
|
|
1170
1170
|
var n = this._ctx;
|
|
1171
|
-
return n.error ? n.table._trans(null,
|
|
1171
|
+
return n.error ? n.table._trans(null, $.bind(null, n.error)) : n.table._trans("readwrite", e, "locked");
|
|
1172
1172
|
}
|
|
1173
1173
|
_addAlgorithm(e) {
|
|
1174
1174
|
var n = this._ctx;
|
|
1175
|
-
n.algorithm =
|
|
1175
|
+
n.algorithm = ye(n.algorithm, e);
|
|
1176
1176
|
}
|
|
1177
1177
|
_iterate(e, n) {
|
|
1178
1178
|
return Je(this._ctx, e, n, this._ctx.table.core);
|
|
@@ -1199,16 +1199,16 @@ class Dr {
|
|
|
1199
1199
|
}
|
|
1200
1200
|
sortBy(e, n) {
|
|
1201
1201
|
const r = e.split(".").reverse(), s = r[0], i = r.length - 1;
|
|
1202
|
-
function o(
|
|
1203
|
-
return h ? o(
|
|
1202
|
+
function o(c, h) {
|
|
1203
|
+
return h ? o(c[r[h]], h - 1) : c[s];
|
|
1204
1204
|
}
|
|
1205
1205
|
var u = this._ctx.dir === "next" ? 1 : -1;
|
|
1206
|
-
function a(
|
|
1207
|
-
var
|
|
1208
|
-
return
|
|
1206
|
+
function a(c, h) {
|
|
1207
|
+
var l = o(c, i), d = o(h, i);
|
|
1208
|
+
return l < d ? -u : l > d ? u : 0;
|
|
1209
1209
|
}
|
|
1210
|
-
return this.toArray(function(
|
|
1211
|
-
return
|
|
1210
|
+
return this.toArray(function(c) {
|
|
1211
|
+
return c.sort(a);
|
|
1212
1212
|
}).then(n);
|
|
1213
1213
|
}
|
|
1214
1214
|
toArray(e) {
|
|
@@ -1261,7 +1261,7 @@ class Dr {
|
|
|
1261
1261
|
var n, r;
|
|
1262
1262
|
return xt(this._ctx, function(s) {
|
|
1263
1263
|
return e(s.value);
|
|
1264
|
-
}), n = this._ctx, r = e, n.isMatch =
|
|
1264
|
+
}), n = this._ctx, r = e, n.isMatch = ye(n.isMatch, r), this;
|
|
1265
1265
|
}
|
|
1266
1266
|
and(e) {
|
|
1267
1267
|
return this.filter(e);
|
|
@@ -1343,133 +1343,133 @@ class Dr {
|
|
|
1343
1343
|
if (typeof e == "function")
|
|
1344
1344
|
s = e;
|
|
1345
1345
|
else {
|
|
1346
|
-
var i =
|
|
1347
|
-
s = function(
|
|
1348
|
-
for (var
|
|
1349
|
-
var
|
|
1350
|
-
te(
|
|
1346
|
+
var i = D(e), o = i.length;
|
|
1347
|
+
s = function(p) {
|
|
1348
|
+
for (var v = !1, g = 0; g < o; ++g) {
|
|
1349
|
+
var y = i[g], b = e[y];
|
|
1350
|
+
te(p, y) !== b && (H(p, y, b), v = !0);
|
|
1351
1351
|
}
|
|
1352
|
-
return
|
|
1352
|
+
return v;
|
|
1353
1353
|
};
|
|
1354
1354
|
}
|
|
1355
|
-
const u = n.table.core, { outbound: a, extractKey:
|
|
1355
|
+
const u = n.table.core, { outbound: a, extractKey: c } = u.schema.primaryKey, h = this.db._options.modifyChunkSize || 200, l = [];
|
|
1356
1356
|
let d = 0;
|
|
1357
|
-
const
|
|
1358
|
-
const { failures: g, numFailures:
|
|
1359
|
-
d +=
|
|
1360
|
-
for (let b of
|
|
1361
|
-
|
|
1357
|
+
const f = [], m = (p, v) => {
|
|
1358
|
+
const { failures: g, numFailures: y } = v;
|
|
1359
|
+
d += p - y;
|
|
1360
|
+
for (let b of D(g))
|
|
1361
|
+
l.push(g[b]);
|
|
1362
1362
|
};
|
|
1363
|
-
return this.clone().primaryKeys().then((
|
|
1364
|
-
const
|
|
1365
|
-
const
|
|
1366
|
-
return u.getMany({ trans: r, keys:
|
|
1363
|
+
return this.clone().primaryKeys().then((p) => {
|
|
1364
|
+
const v = (g) => {
|
|
1365
|
+
const y = Math.min(h, p.length - g);
|
|
1366
|
+
return u.getMany({ trans: r, keys: p.slice(g, g + y), cache: "immutable" }).then((b) => {
|
|
1367
1367
|
const x = [], E = [], k = a ? [] : null, w = [];
|
|
1368
|
-
for (let _ = 0; _ <
|
|
1369
|
-
const
|
|
1370
|
-
s.call(O, O.value, O) !== !1 && (O.value == null ? w.push(
|
|
1368
|
+
for (let _ = 0; _ < y; ++_) {
|
|
1369
|
+
const R = b[_], O = { value: We(R), primKey: p[g + _] };
|
|
1370
|
+
s.call(O, O.value, O) !== !1 && (O.value == null ? w.push(p[g + _]) : a || L(c(R), c(O.value)) === 0 ? (E.push(O.value), a && k.push(p[g + _])) : (w.push(p[g + _]), x.push(O.value)));
|
|
1371
1371
|
}
|
|
1372
1372
|
const A = be(n) && n.limit === 1 / 0 && (typeof e != "function" || e === Et) && { index: n.index, range: n.range };
|
|
1373
1373
|
return Promise.resolve(x.length > 0 && u.mutate({ trans: r, type: "add", values: x }).then((_) => {
|
|
1374
|
-
for (let
|
|
1375
|
-
w.splice(parseInt(
|
|
1376
|
-
|
|
1377
|
-
})).then(() => (E.length > 0 || A && typeof e == "object") && u.mutate({ trans: r, type: "put", keys: k, values: E, criteria: A, changeSpec: typeof e != "function" && e }).then((_) =>
|
|
1374
|
+
for (let R in _.failures)
|
|
1375
|
+
w.splice(parseInt(R), 1);
|
|
1376
|
+
m(x.length, _);
|
|
1377
|
+
})).then(() => (E.length > 0 || A && typeof e == "object") && u.mutate({ trans: r, type: "put", keys: k, values: E, criteria: A, changeSpec: typeof e != "function" && e }).then((_) => m(E.length, _))).then(() => (w.length > 0 || A && e === Et) && u.mutate({ trans: r, type: "delete", keys: w, criteria: A }).then((_) => m(w.length, _))).then(() => p.length > g + y && v(g + h));
|
|
1378
1378
|
});
|
|
1379
1379
|
};
|
|
1380
|
-
return
|
|
1381
|
-
if (
|
|
1382
|
-
throw new
|
|
1383
|
-
return
|
|
1380
|
+
return v(0).then(() => {
|
|
1381
|
+
if (l.length > 0)
|
|
1382
|
+
throw new ct("Error modifying one or more objects", l, d, f);
|
|
1383
|
+
return p.length;
|
|
1384
1384
|
});
|
|
1385
1385
|
});
|
|
1386
1386
|
});
|
|
1387
1387
|
}
|
|
1388
1388
|
delete() {
|
|
1389
1389
|
var e = this._ctx, n = e.range;
|
|
1390
|
-
return be(e) && (e.isPrimKey && !
|
|
1390
|
+
return be(e) && (e.isPrimKey && !Or || n.type === 3) ? this._write((r) => {
|
|
1391
1391
|
const { primaryKey: s } = e.table.core.schema, i = n;
|
|
1392
|
-
return e.table.core.count({ trans: r, query: { index: s, range: i } }).then((o) => e.table.core.mutate({ trans: r, type: "deleteRange", range: i }).then(({ failures: u, lastResult: a, results:
|
|
1392
|
+
return e.table.core.count({ trans: r, query: { index: s, range: i } }).then((o) => e.table.core.mutate({ trans: r, type: "deleteRange", range: i }).then(({ failures: u, lastResult: a, results: c, numFailures: h }) => {
|
|
1393
1393
|
if (h)
|
|
1394
|
-
throw new
|
|
1394
|
+
throw new ct("Could not delete some values", Object.keys(u).map((l) => u[l]), o - h);
|
|
1395
1395
|
return o - h;
|
|
1396
1396
|
}));
|
|
1397
1397
|
}) : this.modify(Et);
|
|
1398
1398
|
}
|
|
1399
1399
|
}
|
|
1400
1400
|
const Et = (t, e) => e.value = null;
|
|
1401
|
-
function
|
|
1401
|
+
function jr(t, e) {
|
|
1402
1402
|
return t < e ? -1 : t === e ? 0 : 1;
|
|
1403
1403
|
}
|
|
1404
|
-
function
|
|
1404
|
+
function Rr(t, e) {
|
|
1405
1405
|
return t > e ? -1 : t === e ? 0 : 1;
|
|
1406
1406
|
}
|
|
1407
1407
|
function W(t, e, n) {
|
|
1408
|
-
var r = t instanceof
|
|
1408
|
+
var r = t instanceof Gn ? new t.Collection(t) : t;
|
|
1409
1409
|
return r._ctx.error = n ? new n(e) : new TypeError(e), r;
|
|
1410
1410
|
}
|
|
1411
1411
|
function we(t) {
|
|
1412
|
-
return new t.Collection(t, () =>
|
|
1412
|
+
return new t.Collection(t, () => Yn("")).limit(0);
|
|
1413
1413
|
}
|
|
1414
|
-
function
|
|
1414
|
+
function Nr(t, e, n, r, s, i) {
|
|
1415
1415
|
for (var o = Math.min(t.length, r.length), u = -1, a = 0; a < o; ++a) {
|
|
1416
|
-
var
|
|
1417
|
-
if (
|
|
1416
|
+
var c = e[a];
|
|
1417
|
+
if (c !== r[a])
|
|
1418
1418
|
return s(t[a], n[a]) < 0 ? t.substr(0, a) + n[a] + n.substr(a + 1) : s(t[a], r[a]) < 0 ? t.substr(0, a) + r[a] + n.substr(a + 1) : u >= 0 ? t.substr(0, u) + e[u] + n.substr(u + 1) : null;
|
|
1419
|
-
s(t[a],
|
|
1419
|
+
s(t[a], c) < 0 && (u = a);
|
|
1420
1420
|
}
|
|
1421
1421
|
return o < r.length && i === "next" ? t + n.substr(t.length) : o < t.length && i === "prev" ? t.substr(0, n.length) : u < 0 ? null : t.substr(0, u) + r[u] + n.substr(u + 1);
|
|
1422
1422
|
}
|
|
1423
1423
|
function Ze(t, e, n, r) {
|
|
1424
|
-
var s, i, o, u, a,
|
|
1425
|
-
if (!n.every((
|
|
1426
|
-
return W(t,
|
|
1427
|
-
function d(
|
|
1424
|
+
var s, i, o, u, a, c, h, l = n.length;
|
|
1425
|
+
if (!n.every((p) => typeof p == "string"))
|
|
1426
|
+
return W(t, Wn);
|
|
1427
|
+
function d(p) {
|
|
1428
1428
|
s = function(g) {
|
|
1429
|
-
return g === "next" ? (
|
|
1430
|
-
}(
|
|
1431
|
-
return g === "next" ? (
|
|
1432
|
-
}(
|
|
1433
|
-
var
|
|
1429
|
+
return g === "next" ? (y) => y.toUpperCase() : (y) => y.toLowerCase();
|
|
1430
|
+
}(p), i = function(g) {
|
|
1431
|
+
return g === "next" ? (y) => y.toLowerCase() : (y) => y.toUpperCase();
|
|
1432
|
+
}(p), o = p === "next" ? jr : Rr;
|
|
1433
|
+
var v = n.map(function(g) {
|
|
1434
1434
|
return { lower: i(g), upper: s(g) };
|
|
1435
|
-
}).sort(function(g,
|
|
1436
|
-
return o(g.lower,
|
|
1435
|
+
}).sort(function(g, y) {
|
|
1436
|
+
return o(g.lower, y.lower);
|
|
1437
1437
|
});
|
|
1438
|
-
u =
|
|
1438
|
+
u = v.map(function(g) {
|
|
1439
1439
|
return g.upper;
|
|
1440
|
-
}), a =
|
|
1440
|
+
}), a = v.map(function(g) {
|
|
1441
1441
|
return g.lower;
|
|
1442
|
-
}),
|
|
1442
|
+
}), c = p, h = p === "next" ? "" : r;
|
|
1443
1443
|
}
|
|
1444
1444
|
d("next");
|
|
1445
|
-
var
|
|
1446
|
-
|
|
1447
|
-
d(
|
|
1445
|
+
var f = new t.Collection(t, () => re(u[0], a[l - 1] + r));
|
|
1446
|
+
f._ondirectionchange = function(p) {
|
|
1447
|
+
d(p);
|
|
1448
1448
|
};
|
|
1449
|
-
var
|
|
1450
|
-
return
|
|
1451
|
-
var
|
|
1452
|
-
if (typeof
|
|
1449
|
+
var m = 0;
|
|
1450
|
+
return f._addAlgorithm(function(p, v, g) {
|
|
1451
|
+
var y = p.key;
|
|
1452
|
+
if (typeof y != "string")
|
|
1453
1453
|
return !1;
|
|
1454
|
-
var b = i(
|
|
1455
|
-
if (e(b, a,
|
|
1454
|
+
var b = i(y);
|
|
1455
|
+
if (e(b, a, m))
|
|
1456
1456
|
return !0;
|
|
1457
|
-
for (var x = null, E =
|
|
1458
|
-
var k =
|
|
1459
|
-
k === null && x === null ?
|
|
1457
|
+
for (var x = null, E = m; E < l; ++E) {
|
|
1458
|
+
var k = Nr(y, b, u[E], a[E], o, c);
|
|
1459
|
+
k === null && x === null ? m = E + 1 : (x === null || o(x, k) > 0) && (x = k);
|
|
1460
1460
|
}
|
|
1461
|
-
return
|
|
1462
|
-
|
|
1461
|
+
return v(x !== null ? function() {
|
|
1462
|
+
p.continue(x + h);
|
|
1463
1463
|
} : g), !1;
|
|
1464
|
-
}),
|
|
1464
|
+
}), f;
|
|
1465
1465
|
}
|
|
1466
1466
|
function re(t, e, n, r) {
|
|
1467
1467
|
return { type: 2, lower: t, upper: e, lowerOpen: n, upperOpen: r };
|
|
1468
1468
|
}
|
|
1469
|
-
function
|
|
1469
|
+
function Yn(t) {
|
|
1470
1470
|
return { type: 1, lower: t, upper: t };
|
|
1471
1471
|
}
|
|
1472
|
-
class
|
|
1472
|
+
class Gn {
|
|
1473
1473
|
get Collection() {
|
|
1474
1474
|
return this._ctx.table.db.Collection;
|
|
1475
1475
|
}
|
|
@@ -1482,7 +1482,7 @@ class Zn {
|
|
|
1482
1482
|
}
|
|
1483
1483
|
}
|
|
1484
1484
|
equals(e) {
|
|
1485
|
-
return e == null ? W(this, X) : new this.Collection(this, () =>
|
|
1485
|
+
return e == null ? W(this, X) : new this.Collection(this, () => Yn(e));
|
|
1486
1486
|
}
|
|
1487
1487
|
above(e) {
|
|
1488
1488
|
return e == null ? W(this, X) : new this.Collection(this, () => re(e, void 0, !0));
|
|
@@ -1497,7 +1497,7 @@ class Zn {
|
|
|
1497
1497
|
return e == null ? W(this, X) : new this.Collection(this, () => re(void 0, e));
|
|
1498
1498
|
}
|
|
1499
1499
|
startsWith(e) {
|
|
1500
|
-
return typeof e != "string" ? W(this,
|
|
1500
|
+
return typeof e != "string" ? W(this, Wn) : this.between(e, e + he, !0, !0);
|
|
1501
1501
|
}
|
|
1502
1502
|
startsWithIgnoreCase(e) {
|
|
1503
1503
|
return e === "" ? this.startsWith(e) : Ze(this, (n, r) => n.indexOf(r[0]) === 0, [e], he);
|
|
@@ -1539,7 +1539,7 @@ class Zn {
|
|
|
1539
1539
|
}), r;
|
|
1540
1540
|
}
|
|
1541
1541
|
notEqual(e) {
|
|
1542
|
-
return this.inAnyRange([[
|
|
1542
|
+
return this.inAnyRange([[Mt, e], [e, this.db._maxKey]], { includeLowers: !1, includeUppers: !1 });
|
|
1543
1543
|
}
|
|
1544
1544
|
noneOf() {
|
|
1545
1545
|
const e = J.apply(_e, arguments);
|
|
@@ -1550,49 +1550,49 @@ class Zn {
|
|
|
1550
1550
|
} catch {
|
|
1551
1551
|
return W(this, X);
|
|
1552
1552
|
}
|
|
1553
|
-
const n = e.reduce((r, s) => r ? r.concat([[r[r.length - 1][1], s]]) : [[
|
|
1553
|
+
const n = e.reduce((r, s) => r ? r.concat([[r[r.length - 1][1], s]]) : [[Mt, s]], null);
|
|
1554
1554
|
return n.push([e[e.length - 1], this.db._maxKey]), this.inAnyRange(n, { includeLowers: !1, includeUppers: !1 });
|
|
1555
1555
|
}
|
|
1556
1556
|
inAnyRange(e, n) {
|
|
1557
1557
|
const r = this._cmp, s = this._ascending, i = this._descending, o = this._min, u = this._max;
|
|
1558
1558
|
if (e.length === 0)
|
|
1559
1559
|
return we(this);
|
|
1560
|
-
if (!e.every((
|
|
1560
|
+
if (!e.every((y) => y[0] !== void 0 && y[1] !== void 0 && s(y[0], y[1]) <= 0))
|
|
1561
1561
|
return W(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", C.InvalidArgument);
|
|
1562
|
-
const a = !n || n.includeLowers !== !1,
|
|
1563
|
-
let h,
|
|
1564
|
-
function d(
|
|
1565
|
-
return
|
|
1562
|
+
const a = !n || n.includeLowers !== !1, c = n && n.includeUppers === !0;
|
|
1563
|
+
let h, l = s;
|
|
1564
|
+
function d(y, b) {
|
|
1565
|
+
return l(y[0], b[0]);
|
|
1566
1566
|
}
|
|
1567
1567
|
try {
|
|
1568
|
-
h = e.reduce(function(
|
|
1569
|
-
let x = 0, E =
|
|
1568
|
+
h = e.reduce(function(y, b) {
|
|
1569
|
+
let x = 0, E = y.length;
|
|
1570
1570
|
for (; x < E; ++x) {
|
|
1571
|
-
const k =
|
|
1571
|
+
const k = y[x];
|
|
1572
1572
|
if (r(b[0], k[1]) < 0 && r(b[1], k[0]) > 0) {
|
|
1573
1573
|
k[0] = o(k[0], b[0]), k[1] = u(k[1], b[1]);
|
|
1574
1574
|
break;
|
|
1575
1575
|
}
|
|
1576
1576
|
}
|
|
1577
|
-
return x === E &&
|
|
1577
|
+
return x === E && y.push(b), y;
|
|
1578
1578
|
}, []), h.sort(d);
|
|
1579
1579
|
} catch {
|
|
1580
1580
|
return W(this, X);
|
|
1581
1581
|
}
|
|
1582
|
-
let
|
|
1583
|
-
const
|
|
1584
|
-
let
|
|
1585
|
-
const g = new this.Collection(this, () => re(h[0][0], h[h.length - 1][1], !a, !
|
|
1586
|
-
return g._ondirectionchange = (
|
|
1587
|
-
|
|
1588
|
-
}, g._addAlgorithm((
|
|
1589
|
-
for (var E =
|
|
1590
|
-
if (++
|
|
1582
|
+
let f = 0;
|
|
1583
|
+
const m = c ? (y) => s(y, h[f][1]) > 0 : (y) => s(y, h[f][1]) >= 0, p = a ? (y) => i(y, h[f][0]) > 0 : (y) => i(y, h[f][0]) >= 0;
|
|
1584
|
+
let v = m;
|
|
1585
|
+
const g = new this.Collection(this, () => re(h[0][0], h[h.length - 1][1], !a, !c));
|
|
1586
|
+
return g._ondirectionchange = (y) => {
|
|
1587
|
+
y === "next" ? (v = m, l = s) : (v = p, l = i), h.sort(d);
|
|
1588
|
+
}, g._addAlgorithm((y, b, x) => {
|
|
1589
|
+
for (var E = y.key; v(E); )
|
|
1590
|
+
if (++f, f === h.length)
|
|
1591
1591
|
return b(x), !1;
|
|
1592
1592
|
return !!function(k) {
|
|
1593
|
-
return !
|
|
1594
|
-
}(E) || (this._cmp(E, h[
|
|
1595
|
-
|
|
1593
|
+
return !m(k) && !p(k);
|
|
1594
|
+
}(E) || (this._cmp(E, h[f][1]) === 0 || this._cmp(E, h[f][0]) === 0 || b(() => {
|
|
1595
|
+
l === s ? y.continue(h[f][0]) : y.continue(h[f][1]);
|
|
1596
1596
|
}), !1);
|
|
1597
1597
|
}), g;
|
|
1598
1598
|
}
|
|
@@ -1602,15 +1602,15 @@ class Zn {
|
|
|
1602
1602
|
}
|
|
1603
1603
|
}
|
|
1604
1604
|
function Y(t) {
|
|
1605
|
-
return
|
|
1605
|
+
return j(function(e) {
|
|
1606
1606
|
return qe(e), t(e.target.error), !1;
|
|
1607
1607
|
});
|
|
1608
1608
|
}
|
|
1609
1609
|
function qe(t) {
|
|
1610
1610
|
t.stopPropagation && t.stopPropagation(), t.preventDefault && t.preventDefault();
|
|
1611
1611
|
}
|
|
1612
|
-
const Le = "storagemutated", ie = "x-storagemutated-1", ue =
|
|
1613
|
-
class
|
|
1612
|
+
const Le = "storagemutated", ie = "x-storagemutated-1", ue = De(null, Le);
|
|
1613
|
+
class Dr {
|
|
1614
1614
|
_lock() {
|
|
1615
1615
|
return Ie(!P.global), ++this._reculock, this._reculock !== 1 || P.global || (P.lockOwnerFor = this), this;
|
|
1616
1616
|
}
|
|
@@ -1643,19 +1643,19 @@ class Mr {
|
|
|
1643
1643
|
}
|
|
1644
1644
|
if (!this.active)
|
|
1645
1645
|
throw new C.TransactionInactive();
|
|
1646
|
-
return Ie(this._completion._state === null), (e = this.idbtrans = e || (this.db.core ? this.db.core.transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability }) : n.transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability }))).onerror =
|
|
1646
|
+
return Ie(this._completion._state === null), (e = this.idbtrans = e || (this.db.core ? this.db.core.transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability }) : n.transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability }))).onerror = j((s) => {
|
|
1647
1647
|
qe(s), this._reject(e.error);
|
|
1648
|
-
}), e.onabort =
|
|
1648
|
+
}), e.onabort = j((s) => {
|
|
1649
1649
|
qe(s), this.active && this._reject(new C.Abort(e.error)), this.active = !1, this.on("abort").fire(s);
|
|
1650
|
-
}), e.oncomplete =
|
|
1650
|
+
}), e.oncomplete = j(() => {
|
|
1651
1651
|
this.active = !1, this._resolve(), "mutatedParts" in e && ue.storagemutated.fire(e.mutatedParts);
|
|
1652
1652
|
}), this;
|
|
1653
1653
|
}
|
|
1654
1654
|
_promise(e, n, r) {
|
|
1655
1655
|
if (e === "readwrite" && this.mode !== "readwrite")
|
|
1656
|
-
return
|
|
1656
|
+
return $(new C.ReadOnly("Transaction is readonly"));
|
|
1657
1657
|
if (!this.active)
|
|
1658
|
-
return
|
|
1658
|
+
return $(new C.TransactionInactive());
|
|
1659
1659
|
if (this._locked())
|
|
1660
1660
|
return new S((i, o) => {
|
|
1661
1661
|
this._blockedFuncs.push([() => {
|
|
@@ -1696,7 +1696,7 @@ class Mr {
|
|
|
1696
1696
|
}
|
|
1697
1697
|
var i = n._waitingFor;
|
|
1698
1698
|
return new S((o, u) => {
|
|
1699
|
-
r.then((a) => n._waitingQueue.push(
|
|
1699
|
+
r.then((a) => n._waitingQueue.push(j(o.bind(null, a))), (a) => n._waitingQueue.push(j(u.bind(null, a)))).finally(() => {
|
|
1700
1700
|
n._waitingFor === i && (n._waitingFor = null);
|
|
1701
1701
|
});
|
|
1702
1702
|
});
|
|
@@ -1715,14 +1715,14 @@ class Mr {
|
|
|
1715
1715
|
return s.core = this.db.core.table(e), n[e] = s, s;
|
|
1716
1716
|
}
|
|
1717
1717
|
}
|
|
1718
|
-
function
|
|
1719
|
-
return { name: t, keyPath: e, unique: n, multi: r, auto: s, compound: i, src: (n && !o ? "&" : "") + (r ? "*" : "") + (s ? "++" : "") +
|
|
1718
|
+
function qt(t, e, n, r, s, i, o) {
|
|
1719
|
+
return { name: t, keyPath: e, unique: n, multi: r, auto: s, compound: i, src: (n && !o ? "&" : "") + (r ? "*" : "") + (s ? "++" : "") + Xn(e) };
|
|
1720
1720
|
}
|
|
1721
|
-
function
|
|
1721
|
+
function Xn(t) {
|
|
1722
1722
|
return typeof t == "string" ? t : t ? "[" + [].join.call(t, "+") + "]" : "";
|
|
1723
1723
|
}
|
|
1724
|
-
function
|
|
1725
|
-
return { name: t, primKey: e, indexes: n, mappedClass: null, idxByName:
|
|
1724
|
+
function Qn(t, e, n) {
|
|
1725
|
+
return { name: t, primKey: e, indexes: n, mappedClass: null, idxByName: Tn(n, (r) => [r.name, r]) };
|
|
1726
1726
|
}
|
|
1727
1727
|
let Ue = (t) => {
|
|
1728
1728
|
try {
|
|
@@ -1731,139 +1731,139 @@ let Ue = (t) => {
|
|
|
1731
1731
|
return Ue = () => he, he;
|
|
1732
1732
|
}
|
|
1733
1733
|
};
|
|
1734
|
-
function
|
|
1734
|
+
function Lt(t) {
|
|
1735
1735
|
return t == null ? () => {
|
|
1736
1736
|
} : typeof t == "string" ? function(e) {
|
|
1737
1737
|
return e.split(".").length === 1 ? (n) => n[e] : (n) => te(n, e);
|
|
1738
1738
|
}(t) : (e) => te(e, t);
|
|
1739
1739
|
}
|
|
1740
|
-
function
|
|
1740
|
+
function kn(t) {
|
|
1741
1741
|
return [].slice.call(t);
|
|
1742
1742
|
}
|
|
1743
|
-
let
|
|
1744
|
-
function
|
|
1743
|
+
let $r = 0;
|
|
1744
|
+
function $e(t) {
|
|
1745
1745
|
return t == null ? ":id" : typeof t == "string" ? t : `[${t.join("+")}]`;
|
|
1746
1746
|
}
|
|
1747
|
-
function
|
|
1747
|
+
function Br(t, e, n) {
|
|
1748
1748
|
function r(a) {
|
|
1749
1749
|
if (a.type === 3)
|
|
1750
1750
|
return null;
|
|
1751
1751
|
if (a.type === 4)
|
|
1752
1752
|
throw new Error("Cannot convert never type to IDBKeyRange");
|
|
1753
|
-
const { lower:
|
|
1754
|
-
return
|
|
1755
|
-
}
|
|
1756
|
-
const { schema: s, hasGetAll: i } = function(a,
|
|
1757
|
-
const h =
|
|
1758
|
-
return { schema: { name: a.name, tables: h.map((
|
|
1759
|
-
const { keyPath: d, autoIncrement:
|
|
1760
|
-
const { name: b, unique: x, multiEntry: E, keyPath: k } =
|
|
1761
|
-
return
|
|
1762
|
-
}), getIndexByKeyPath: (
|
|
1763
|
-
return
|
|
1764
|
-
}) }, hasGetAll: h.length > 0 && "getAll" in
|
|
1765
|
-
}(t, n), o = s.tables.map((a) => function(
|
|
1766
|
-
const h =
|
|
1767
|
-
return { name: h, schema:
|
|
1768
|
-
return new Promise((
|
|
1769
|
-
|
|
1770
|
-
const
|
|
1753
|
+
const { lower: c, upper: h, lowerOpen: l, upperOpen: d } = a;
|
|
1754
|
+
return c === void 0 ? h === void 0 ? null : e.upperBound(h, !!d) : h === void 0 ? e.lowerBound(c, !!l) : e.bound(c, h, !!l, !!d);
|
|
1755
|
+
}
|
|
1756
|
+
const { schema: s, hasGetAll: i } = function(a, c) {
|
|
1757
|
+
const h = kn(a.objectStoreNames);
|
|
1758
|
+
return { schema: { name: a.name, tables: h.map((l) => c.objectStore(l)).map((l) => {
|
|
1759
|
+
const { keyPath: d, autoIncrement: f } = l, m = M(d), p = d == null, v = {}, g = { name: l.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: p, compound: m, keyPath: d, autoIncrement: f, unique: !0, extractKey: Lt(d) }, indexes: kn(l.indexNames).map((y) => l.index(y)).map((y) => {
|
|
1760
|
+
const { name: b, unique: x, multiEntry: E, keyPath: k } = y, w = { name: b, compound: M(k), keyPath: k, unique: x, multiEntry: E, extractKey: Lt(k) };
|
|
1761
|
+
return v[$e(k)] = w, w;
|
|
1762
|
+
}), getIndexByKeyPath: (y) => v[$e(y)] };
|
|
1763
|
+
return v[":id"] = g.primaryKey, d != null && (v[$e(d)] = g.primaryKey), g;
|
|
1764
|
+
}) }, hasGetAll: h.length > 0 && "getAll" in c.objectStore(h[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) };
|
|
1765
|
+
}(t, n), o = s.tables.map((a) => function(c) {
|
|
1766
|
+
const h = c.name;
|
|
1767
|
+
return { name: h, schema: c, mutate: function({ trans: l, type: d, keys: f, values: m, range: p }) {
|
|
1768
|
+
return new Promise((v, g) => {
|
|
1769
|
+
v = j(v);
|
|
1770
|
+
const y = l.objectStore(h), b = y.keyPath == null, x = d === "put" || d === "add";
|
|
1771
1771
|
if (!x && d !== "delete" && d !== "deleteRange")
|
|
1772
1772
|
throw new Error("Invalid operation type: " + d);
|
|
1773
|
-
const { length: E } =
|
|
1774
|
-
if (
|
|
1773
|
+
const { length: E } = f || m || { length: 1 };
|
|
1774
|
+
if (f && m && f.length !== m.length)
|
|
1775
1775
|
throw new Error("Given keys array must have same length as given values array.");
|
|
1776
1776
|
if (E === 0)
|
|
1777
|
-
return
|
|
1777
|
+
return v({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
|
|
1778
1778
|
let k;
|
|
1779
1779
|
const w = [], A = [];
|
|
1780
1780
|
let _ = 0;
|
|
1781
|
-
const
|
|
1781
|
+
const R = (q) => {
|
|
1782
1782
|
++_, qe(q);
|
|
1783
1783
|
};
|
|
1784
1784
|
if (d === "deleteRange") {
|
|
1785
|
-
if (
|
|
1786
|
-
return
|
|
1787
|
-
|
|
1785
|
+
if (p.type === 4)
|
|
1786
|
+
return v({ numFailures: _, failures: A, results: [], lastResult: void 0 });
|
|
1787
|
+
p.type === 3 ? w.push(k = y.clear()) : w.push(k = y.delete(r(p)));
|
|
1788
1788
|
} else {
|
|
1789
|
-
const [q, B] = x ? b ? [
|
|
1789
|
+
const [q, B] = x ? b ? [m, f] : [m, null] : [f, null];
|
|
1790
1790
|
if (x)
|
|
1791
|
-
for (let
|
|
1792
|
-
w.push(k = B && B[
|
|
1791
|
+
for (let N = 0; N < E; ++N)
|
|
1792
|
+
w.push(k = B && B[N] !== void 0 ? y[d](q[N], B[N]) : y[d](q[N])), k.onerror = R;
|
|
1793
1793
|
else
|
|
1794
|
-
for (let
|
|
1795
|
-
w.push(k =
|
|
1794
|
+
for (let N = 0; N < E; ++N)
|
|
1795
|
+
w.push(k = y[d](q[N])), k.onerror = R;
|
|
1796
1796
|
}
|
|
1797
1797
|
const O = (q) => {
|
|
1798
1798
|
const B = q.target.result;
|
|
1799
|
-
w.forEach((
|
|
1799
|
+
w.forEach((N, ge) => N.error != null && (A[ge] = N.error)), v({ numFailures: _, failures: A, results: d === "delete" ? f : w.map((N) => N.result), lastResult: B });
|
|
1800
1800
|
};
|
|
1801
1801
|
k.onerror = (q) => {
|
|
1802
|
-
|
|
1802
|
+
R(q), O(q);
|
|
1803
1803
|
}, k.onsuccess = O;
|
|
1804
1804
|
});
|
|
1805
|
-
}, getMany: ({ trans:
|
|
1806
|
-
|
|
1807
|
-
const
|
|
1808
|
-
let
|
|
1805
|
+
}, getMany: ({ trans: l, keys: d }) => new Promise((f, m) => {
|
|
1806
|
+
f = j(f);
|
|
1807
|
+
const p = l.objectStore(h), v = d.length, g = new Array(v);
|
|
1808
|
+
let y, b = 0, x = 0;
|
|
1809
1809
|
const E = (w) => {
|
|
1810
1810
|
const A = w.target;
|
|
1811
|
-
g[A._pos] = A.result, ++x === b &&
|
|
1812
|
-
}, k = Y(
|
|
1813
|
-
for (let w = 0; w <
|
|
1814
|
-
d[w] != null && (
|
|
1815
|
-
b === 0 &&
|
|
1816
|
-
}), get: ({ trans:
|
|
1817
|
-
|
|
1818
|
-
const
|
|
1819
|
-
|
|
1820
|
-
}), query: function(
|
|
1821
|
-
return (d) => new Promise((
|
|
1822
|
-
|
|
1823
|
-
const { trans:
|
|
1811
|
+
g[A._pos] = A.result, ++x === b && f(g);
|
|
1812
|
+
}, k = Y(m);
|
|
1813
|
+
for (let w = 0; w < v; ++w)
|
|
1814
|
+
d[w] != null && (y = p.get(d[w]), y._pos = w, y.onsuccess = E, y.onerror = k, ++b);
|
|
1815
|
+
b === 0 && f(g);
|
|
1816
|
+
}), get: ({ trans: l, key: d }) => new Promise((f, m) => {
|
|
1817
|
+
f = j(f);
|
|
1818
|
+
const p = l.objectStore(h).get(d);
|
|
1819
|
+
p.onsuccess = (v) => f(v.target.result), p.onerror = Y(m);
|
|
1820
|
+
}), query: function(l) {
|
|
1821
|
+
return (d) => new Promise((f, m) => {
|
|
1822
|
+
f = j(f);
|
|
1823
|
+
const { trans: p, values: v, limit: g, query: y } = d, b = g === 1 / 0 ? void 0 : g, { index: x, range: E } = y, k = p.objectStore(h), w = x.isPrimaryKey ? k : k.index(x.name), A = r(E);
|
|
1824
1824
|
if (g === 0)
|
|
1825
|
-
return
|
|
1826
|
-
if (
|
|
1827
|
-
const _ =
|
|
1828
|
-
_.onsuccess = (
|
|
1825
|
+
return f({ result: [] });
|
|
1826
|
+
if (l) {
|
|
1827
|
+
const _ = v ? w.getAll(A, b) : w.getAllKeys(A, b);
|
|
1828
|
+
_.onsuccess = (R) => f({ result: R.target.result }), _.onerror = Y(m);
|
|
1829
1829
|
} else {
|
|
1830
1830
|
let _ = 0;
|
|
1831
|
-
const
|
|
1832
|
-
|
|
1833
|
-
const B =
|
|
1834
|
-
return B ? (O.push(
|
|
1835
|
-
},
|
|
1831
|
+
const R = v || !("openKeyCursor" in w) ? w.openCursor(A) : w.openKeyCursor(A), O = [];
|
|
1832
|
+
R.onsuccess = (q) => {
|
|
1833
|
+
const B = R.result;
|
|
1834
|
+
return B ? (O.push(v ? B.value : B.primaryKey), ++_ === g ? f({ result: O }) : void B.continue()) : f({ result: O });
|
|
1835
|
+
}, R.onerror = Y(m);
|
|
1836
1836
|
}
|
|
1837
1837
|
});
|
|
1838
|
-
}(i), openCursor: function({ trans:
|
|
1839
|
-
return new Promise((
|
|
1840
|
-
|
|
1841
|
-
const { index:
|
|
1842
|
-
w.onerror = Y(g), w.onsuccess =
|
|
1838
|
+
}(i), openCursor: function({ trans: l, values: d, query: f, reverse: m, unique: p }) {
|
|
1839
|
+
return new Promise((v, g) => {
|
|
1840
|
+
v = j(v);
|
|
1841
|
+
const { index: y, range: b } = f, x = l.objectStore(h), E = y.isPrimaryKey ? x : x.index(y.name), k = m ? p ? "prevunique" : "prev" : p ? "nextunique" : "next", w = d || !("openKeyCursor" in E) ? E.openCursor(r(b), k) : E.openKeyCursor(r(b), k);
|
|
1842
|
+
w.onerror = Y(g), w.onsuccess = j((A) => {
|
|
1843
1843
|
const _ = w.result;
|
|
1844
1844
|
if (!_)
|
|
1845
|
-
return void
|
|
1846
|
-
_.___id =
|
|
1847
|
-
const
|
|
1845
|
+
return void v(null);
|
|
1846
|
+
_.___id = ++$r, _.done = !1;
|
|
1847
|
+
const R = _.continue.bind(_);
|
|
1848
1848
|
let O = _.continuePrimaryKey;
|
|
1849
1849
|
O && (O = O.bind(_));
|
|
1850
1850
|
const q = _.advance.bind(_), B = () => {
|
|
1851
1851
|
throw new Error("Cursor not stopped");
|
|
1852
1852
|
};
|
|
1853
|
-
_.trans =
|
|
1853
|
+
_.trans = l, _.stop = _.continue = _.continuePrimaryKey = _.advance = () => {
|
|
1854
1854
|
throw new Error("Cursor not started");
|
|
1855
|
-
}, _.fail =
|
|
1856
|
-
let
|
|
1857
|
-
return this.start(() =>
|
|
1858
|
-
}, _.start = (
|
|
1859
|
-
const
|
|
1860
|
-
V =
|
|
1855
|
+
}, _.fail = j(g), _.next = function() {
|
|
1856
|
+
let N = 1;
|
|
1857
|
+
return this.start(() => N-- ? this.continue() : this.stop()).then(() => this);
|
|
1858
|
+
}, _.start = (N) => {
|
|
1859
|
+
const ge = new Promise((V, le) => {
|
|
1860
|
+
V = j(V), w.onerror = Y(le), _.fail = le, _.stop = (Ae) => {
|
|
1861
1861
|
_.stop = _.continue = _.continuePrimaryKey = _.advance = B, V(Ae);
|
|
1862
1862
|
};
|
|
1863
1863
|
}), ve = () => {
|
|
1864
1864
|
if (w.result)
|
|
1865
1865
|
try {
|
|
1866
|
-
|
|
1866
|
+
N();
|
|
1867
1867
|
} catch (V) {
|
|
1868
1868
|
_.fail(V);
|
|
1869
1869
|
}
|
|
@@ -1872,17 +1872,17 @@ function qr(t, e, n) {
|
|
|
1872
1872
|
throw new Error("Cursor behind last entry");
|
|
1873
1873
|
}, _.stop();
|
|
1874
1874
|
};
|
|
1875
|
-
return w.onsuccess =
|
|
1875
|
+
return w.onsuccess = j((V) => {
|
|
1876
1876
|
w.onsuccess = ve, ve();
|
|
1877
|
-
}), _.continue =
|
|
1878
|
-
},
|
|
1877
|
+
}), _.continue = R, _.continuePrimaryKey = O, _.advance = q, ve(), ge;
|
|
1878
|
+
}, v(_);
|
|
1879
1879
|
}, g);
|
|
1880
1880
|
});
|
|
1881
|
-
}, count({ query:
|
|
1882
|
-
const { index:
|
|
1883
|
-
return new Promise((
|
|
1884
|
-
const g = d.objectStore(h),
|
|
1885
|
-
x.onsuccess =
|
|
1881
|
+
}, count({ query: l, trans: d }) {
|
|
1882
|
+
const { index: f, range: m } = l;
|
|
1883
|
+
return new Promise((p, v) => {
|
|
1884
|
+
const g = d.objectStore(h), y = f.isPrimaryKey ? g : g.index(f.name), b = r(m), x = b ? y.count(b) : y.count();
|
|
1885
|
+
x.onsuccess = j((E) => p(E.target.result)), x.onerror = Y(v);
|
|
1886
1886
|
});
|
|
1887
1887
|
} };
|
|
1888
1888
|
}(a)), u = {};
|
|
@@ -1892,11 +1892,11 @@ function qr(t, e, n) {
|
|
|
1892
1892
|
return u[a];
|
|
1893
1893
|
}, MIN_KEY: -1 / 0, MAX_KEY: Ue(e), schema: s };
|
|
1894
1894
|
}
|
|
1895
|
-
function
|
|
1895
|
+
function Ut({ _novip: t }, e) {
|
|
1896
1896
|
const n = e.db, r = function(s, i, { IDBKeyRange: o, indexedDB: u }, a) {
|
|
1897
|
-
return { dbcore: function(
|
|
1898
|
-
return h.reduce((
|
|
1899
|
-
}(
|
|
1897
|
+
return { dbcore: function(c, h) {
|
|
1898
|
+
return h.reduce((l, { create: d }) => ({ ...l, ...d(l) }), c);
|
|
1899
|
+
}(Br(i, o, a), s.dbcore) };
|
|
1900
1900
|
}(t._middlewares, n, t._deps, e);
|
|
1901
1901
|
t.core = r.dbcore, t.tables.forEach((s) => {
|
|
1902
1902
|
const i = s.name;
|
|
@@ -1907,88 +1907,88 @@ function mt({ _novip: t }, e, n, r) {
|
|
|
1907
1907
|
n.forEach((s) => {
|
|
1908
1908
|
const i = r[s];
|
|
1909
1909
|
e.forEach((o) => {
|
|
1910
|
-
const u =
|
|
1910
|
+
const u = Jt(o, s);
|
|
1911
1911
|
(!u || "value" in u && u.value === void 0) && (o === t.Transaction.prototype || o instanceof t.Transaction ? ee(o, s, { get() {
|
|
1912
1912
|
return this.table(s);
|
|
1913
1913
|
}, set(a) {
|
|
1914
|
-
|
|
1914
|
+
En(this, s, { value: a, writable: !0, configurable: !0, enumerable: !0 });
|
|
1915
1915
|
} }) : o[s] = new t.Table(s, i));
|
|
1916
1916
|
});
|
|
1917
1917
|
});
|
|
1918
1918
|
}
|
|
1919
|
-
function
|
|
1919
|
+
function Vt({ _novip: t }, e) {
|
|
1920
1920
|
e.forEach((n) => {
|
|
1921
1921
|
for (let r in n)
|
|
1922
1922
|
n[r] instanceof t.Table && delete n[r];
|
|
1923
1923
|
});
|
|
1924
1924
|
}
|
|
1925
|
-
function
|
|
1925
|
+
function Fr(t, e) {
|
|
1926
1926
|
return t._cfg.version - e._cfg.version;
|
|
1927
1927
|
}
|
|
1928
|
-
function
|
|
1928
|
+
function Mr(t, e, n, r) {
|
|
1929
1929
|
const s = t._dbSchema, i = t._createTransaction("readwrite", t._storeNames, s);
|
|
1930
1930
|
i.create(n), i._completion.catch(r);
|
|
1931
1931
|
const o = i._reject.bind(i), u = P.transless || P;
|
|
1932
1932
|
oe(() => {
|
|
1933
|
-
P.trans = i, P.transless = u, e === 0 ? (
|
|
1933
|
+
P.trans = i, P.transless = u, e === 0 ? (D(s).forEach((a) => {
|
|
1934
1934
|
Pt(n, a, s[a].primKey, s[a].indexes);
|
|
1935
|
-
}),
|
|
1936
|
-
const d = [],
|
|
1937
|
-
let
|
|
1938
|
-
const
|
|
1935
|
+
}), Ut(t, n), S.follow(() => t.on.populate.fire(i)).catch(o)) : function({ _novip: a }, c, h, l) {
|
|
1936
|
+
const d = [], f = a._versions;
|
|
1937
|
+
let m = a._dbSchema = zt(a, a.idbdb, l), p = !1;
|
|
1938
|
+
const v = f.filter((y) => y._cfg.version >= c);
|
|
1939
1939
|
function g() {
|
|
1940
1940
|
return d.length ? S.resolve(d.shift()(h.idbtrans)).then(g) : S.resolve();
|
|
1941
1941
|
}
|
|
1942
|
-
return
|
|
1942
|
+
return v.forEach((y) => {
|
|
1943
1943
|
d.push(() => {
|
|
1944
|
-
const b =
|
|
1945
|
-
|
|
1946
|
-
const E =
|
|
1944
|
+
const b = m, x = y._cfg.dbschema;
|
|
1945
|
+
Ht(a, b, l), Ht(a, x, l), m = a._dbSchema = x;
|
|
1946
|
+
const E = Jn(b, x);
|
|
1947
1947
|
E.add.forEach((w) => {
|
|
1948
|
-
Pt(
|
|
1948
|
+
Pt(l, w[0], w[1].primKey, w[1].indexes);
|
|
1949
1949
|
}), E.change.forEach((w) => {
|
|
1950
1950
|
if (w.recreate)
|
|
1951
1951
|
throw new C.Upgrade("Not yet support for changing primary key");
|
|
1952
1952
|
{
|
|
1953
|
-
const A =
|
|
1954
|
-
w.add.forEach((_) =>
|
|
1955
|
-
A.deleteIndex(_.name),
|
|
1953
|
+
const A = l.objectStore(w.name);
|
|
1954
|
+
w.add.forEach((_) => Wt(A, _)), w.change.forEach((_) => {
|
|
1955
|
+
A.deleteIndex(_.name), Wt(A, _);
|
|
1956
1956
|
}), w.del.forEach((_) => A.deleteIndex(_));
|
|
1957
1957
|
}
|
|
1958
1958
|
});
|
|
1959
|
-
const k =
|
|
1960
|
-
if (k &&
|
|
1961
|
-
|
|
1962
|
-
let w =
|
|
1959
|
+
const k = y._cfg.contentUpgrade;
|
|
1960
|
+
if (k && y._cfg.version > c) {
|
|
1961
|
+
Ut(a, l), h._memoizedTables = {}, p = !0;
|
|
1962
|
+
let w = An(x);
|
|
1963
1963
|
E.del.forEach((O) => {
|
|
1964
1964
|
w[O] = b[O];
|
|
1965
|
-
}),
|
|
1966
|
-
const A =
|
|
1965
|
+
}), Vt(a, [a.Transaction.prototype]), mt(a, [a.Transaction.prototype], D(w), w), h.schema = w;
|
|
1966
|
+
const A = Zt(k);
|
|
1967
1967
|
let _;
|
|
1968
1968
|
A && Ce();
|
|
1969
|
-
const
|
|
1969
|
+
const R = S.follow(() => {
|
|
1970
1970
|
if (_ = k(h), _ && A) {
|
|
1971
1971
|
var O = ne.bind(null, null);
|
|
1972
1972
|
_.then(O, O);
|
|
1973
1973
|
}
|
|
1974
1974
|
});
|
|
1975
|
-
return _ && typeof _.then == "function" ? S.resolve(_) :
|
|
1975
|
+
return _ && typeof _.then == "function" ? S.resolve(_) : R.then(() => _);
|
|
1976
1976
|
}
|
|
1977
1977
|
}), d.push((b) => {
|
|
1978
|
-
(!
|
|
1978
|
+
(!p || !Ar) && function(x, E) {
|
|
1979
1979
|
[].slice.call(E.db.objectStoreNames).forEach((k) => x[k] == null && E.db.deleteObjectStore(k));
|
|
1980
|
-
}(
|
|
1980
|
+
}(y._cfg.dbschema, b), Vt(a, [a.Transaction.prototype]), mt(a, [a.Transaction.prototype], a._storeNames, a._dbSchema), h.schema = a._dbSchema;
|
|
1981
1981
|
});
|
|
1982
1982
|
}), g().then(() => {
|
|
1983
|
-
var
|
|
1984
|
-
b =
|
|
1985
|
-
b.db.objectStoreNames.contains(x) || Pt(b, x,
|
|
1983
|
+
var y, b;
|
|
1984
|
+
b = l, D(y = m).forEach((x) => {
|
|
1985
|
+
b.db.objectStoreNames.contains(x) || Pt(b, x, y[x].primKey, y[x].indexes);
|
|
1986
1986
|
});
|
|
1987
1987
|
});
|
|
1988
1988
|
}(t, e, i, n).catch(o);
|
|
1989
1989
|
});
|
|
1990
1990
|
}
|
|
1991
|
-
function
|
|
1991
|
+
function Jn(t, e) {
|
|
1992
1992
|
const n = { del: [], add: [], change: [] };
|
|
1993
1993
|
let r;
|
|
1994
1994
|
for (r in t)
|
|
@@ -1997,16 +1997,16 @@ function nr(t, e) {
|
|
|
1997
1997
|
const s = t[r], i = e[r];
|
|
1998
1998
|
if (s) {
|
|
1999
1999
|
const o = { name: r, def: i, recreate: !1, del: [], add: [], change: [] };
|
|
2000
|
-
if ("" + (s.primKey.keyPath || "") != "" + (i.primKey.keyPath || "") || s.primKey.auto !== i.primKey.auto && !
|
|
2000
|
+
if ("" + (s.primKey.keyPath || "") != "" + (i.primKey.keyPath || "") || s.primKey.auto !== i.primKey.auto && !gt)
|
|
2001
2001
|
o.recreate = !0, n.change.push(o);
|
|
2002
2002
|
else {
|
|
2003
2003
|
const u = s.idxByName, a = i.idxByName;
|
|
2004
|
-
let
|
|
2005
|
-
for (
|
|
2006
|
-
a[
|
|
2007
|
-
for (
|
|
2008
|
-
const h = u[
|
|
2009
|
-
h ? h.src !==
|
|
2004
|
+
let c;
|
|
2005
|
+
for (c in u)
|
|
2006
|
+
a[c] || o.del.push(c);
|
|
2007
|
+
for (c in a) {
|
|
2008
|
+
const h = u[c], l = a[c];
|
|
2009
|
+
h ? h.src !== l.src && o.change.push(l) : o.add.push(l);
|
|
2010
2010
|
}
|
|
2011
2011
|
(o.del.length > 0 || o.add.length > 0 || o.change.length > 0) && n.change.push(o);
|
|
2012
2012
|
}
|
|
@@ -2017,48 +2017,48 @@ function nr(t, e) {
|
|
|
2017
2017
|
}
|
|
2018
2018
|
function Pt(t, e, n, r) {
|
|
2019
2019
|
const s = t.db.createObjectStore(e, n.keyPath ? { keyPath: n.keyPath, autoIncrement: n.auto } : { autoIncrement: n.auto });
|
|
2020
|
-
return r.forEach((i) =>
|
|
2020
|
+
return r.forEach((i) => Wt(s, i)), s;
|
|
2021
2021
|
}
|
|
2022
|
-
function
|
|
2022
|
+
function Wt(t, e) {
|
|
2023
2023
|
t.createIndex(e.name, e.keyPath, { unique: e.unique, multiEntry: e.multi });
|
|
2024
2024
|
}
|
|
2025
|
-
function
|
|
2025
|
+
function zt(t, e, n) {
|
|
2026
2026
|
const r = {};
|
|
2027
|
-
return
|
|
2027
|
+
return lt(e.objectStoreNames, 0).forEach((s) => {
|
|
2028
2028
|
const i = n.objectStore(s);
|
|
2029
2029
|
let o = i.keyPath;
|
|
2030
|
-
const u =
|
|
2030
|
+
const u = qt(Xn(o), o || "", !1, !1, !!i.autoIncrement, o && typeof o != "string", !0), a = [];
|
|
2031
2031
|
for (let h = 0; h < i.indexNames.length; ++h) {
|
|
2032
|
-
const
|
|
2033
|
-
o =
|
|
2034
|
-
var
|
|
2035
|
-
a.push(
|
|
2032
|
+
const l = i.index(i.indexNames[h]);
|
|
2033
|
+
o = l.keyPath;
|
|
2034
|
+
var c = qt(l.name, o, !!l.unique, !!l.multiEntry, !1, o && typeof o != "string", !1);
|
|
2035
|
+
a.push(c);
|
|
2036
2036
|
}
|
|
2037
|
-
r[s] =
|
|
2037
|
+
r[s] = Qn(s, u, a);
|
|
2038
2038
|
}), r;
|
|
2039
2039
|
}
|
|
2040
|
-
function
|
|
2040
|
+
function Ht({ _novip: t }, e, n) {
|
|
2041
2041
|
const r = n.db.objectStoreNames;
|
|
2042
2042
|
for (let s = 0; s < r.length; ++s) {
|
|
2043
2043
|
const i = r[s], o = n.objectStore(i);
|
|
2044
2044
|
t._hasGetAll = "getAll" in o;
|
|
2045
2045
|
for (let u = 0; u < o.indexNames.length; ++u) {
|
|
2046
|
-
const a = o.indexNames[u],
|
|
2046
|
+
const a = o.indexNames[u], c = o.index(a).keyPath, h = typeof c == "string" ? c : "[" + lt(c).join("+") + "]";
|
|
2047
2047
|
if (e[i]) {
|
|
2048
|
-
const
|
|
2049
|
-
|
|
2048
|
+
const l = e[i].idxByName[h];
|
|
2049
|
+
l && (l.name = a, delete e[i].idxByName[h], e[i].idxByName[a] = l);
|
|
2050
2050
|
}
|
|
2051
2051
|
}
|
|
2052
2052
|
}
|
|
2053
2053
|
typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && K.WorkerGlobalScope && K instanceof K.WorkerGlobalScope && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604 && (t._hasGetAll = !1);
|
|
2054
2054
|
}
|
|
2055
|
-
class
|
|
2055
|
+
class qr {
|
|
2056
2056
|
_parseStoresSpec(e, n) {
|
|
2057
|
-
|
|
2057
|
+
D(e).forEach((r) => {
|
|
2058
2058
|
if (e[r] !== null) {
|
|
2059
2059
|
var s = e[r].split(",").map((o, u) => {
|
|
2060
|
-
const a = (o = o.trim()).replace(/([&*]|\+\+)/g, ""),
|
|
2061
|
-
return
|
|
2060
|
+
const a = (o = o.trim()).replace(/([&*]|\+\+)/g, ""), c = /^\[/.test(a) ? a.match(/^\[(.*)\]$/)[1].split("+") : a;
|
|
2061
|
+
return qt(a, c || null, /\&/.test(o), /\*/.test(o), /\+\+/.test(o), M(c), u === 0);
|
|
2062
2062
|
}), i = s.shift();
|
|
2063
2063
|
if (i.multi)
|
|
2064
2064
|
throw new C.Schema("Primary key cannot be multi-valued");
|
|
@@ -2067,7 +2067,7 @@ class Vr {
|
|
|
2067
2067
|
throw new C.Schema("Only primary key can be marked as autoIncrement (++)");
|
|
2068
2068
|
if (!o.keyPath)
|
|
2069
2069
|
throw new C.Schema("Index must have a name and cannot be an empty string");
|
|
2070
|
-
}), n[r] =
|
|
2070
|
+
}), n[r] = Qn(r, i, s);
|
|
2071
2071
|
}
|
|
2072
2072
|
});
|
|
2073
2073
|
}
|
|
@@ -2078,25 +2078,25 @@ class Vr {
|
|
|
2078
2078
|
let i = {};
|
|
2079
2079
|
return r.forEach((o) => {
|
|
2080
2080
|
U(s, o._cfg.storesSource), i = o._cfg.dbschema = {}, o._parseStoresSpec(s, i);
|
|
2081
|
-
}), n._dbSchema = i,
|
|
2081
|
+
}), n._dbSchema = i, Vt(n, [n._allTables, n, n.Transaction.prototype]), mt(n, [n._allTables, n, n.Transaction.prototype, this._cfg.tables], D(i), i), n._storeNames = D(i), this;
|
|
2082
2082
|
}
|
|
2083
2083
|
upgrade(e) {
|
|
2084
|
-
return this._cfg.contentUpgrade =
|
|
2084
|
+
return this._cfg.contentUpgrade = nn(this._cfg.contentUpgrade || I, e), this;
|
|
2085
2085
|
}
|
|
2086
2086
|
}
|
|
2087
|
-
function
|
|
2087
|
+
function an(t, e) {
|
|
2088
2088
|
let n = t._dbNamesDB;
|
|
2089
2089
|
return n || (n = t._dbNamesDB = new pe(vt, { addons: [], indexedDB: t, IDBKeyRange: e }), n.version(1).stores({ dbnames: "name" })), n.table("dbnames");
|
|
2090
2090
|
}
|
|
2091
|
-
function
|
|
2091
|
+
function un(t) {
|
|
2092
2092
|
return t && typeof t.databases == "function";
|
|
2093
2093
|
}
|
|
2094
|
-
function
|
|
2094
|
+
function Yt(t) {
|
|
2095
2095
|
return oe(function() {
|
|
2096
2096
|
return P.letThrough = !0, t();
|
|
2097
2097
|
});
|
|
2098
2098
|
}
|
|
2099
|
-
function
|
|
2099
|
+
function Lr() {
|
|
2100
2100
|
var t;
|
|
2101
2101
|
return !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(e) {
|
|
2102
2102
|
var n = function() {
|
|
@@ -2107,10 +2107,10 @@ function Wr() {
|
|
|
2107
2107
|
return clearInterval(t);
|
|
2108
2108
|
}) : Promise.resolve();
|
|
2109
2109
|
}
|
|
2110
|
-
function
|
|
2110
|
+
function Ur(t) {
|
|
2111
2111
|
const e = t._state, { indexedDB: n } = t._deps;
|
|
2112
2112
|
if (e.isBeingOpened || t.idbdb)
|
|
2113
|
-
return e.dbReadyPromise.then(() => e.dbOpenError ?
|
|
2113
|
+
return e.dbReadyPromise.then(() => e.dbOpenError ? $(e.dbOpenError) : t);
|
|
2114
2114
|
G && (e.openCanceller._stackHolder = Pe()), e.isBeingOpened = !0, e.dbOpenError = null, e.openComplete = !1;
|
|
2115
2115
|
const r = e.openCanceller;
|
|
2116
2116
|
function s() {
|
|
@@ -2118,53 +2118,53 @@ function zr(t) {
|
|
|
2118
2118
|
throw new C.DatabaseClosed("db.open() was cancelled");
|
|
2119
2119
|
}
|
|
2120
2120
|
let i = e.dbReadyResolve, o = null, u = !1;
|
|
2121
|
-
return S.race([r, (typeof navigator > "u" ? S.resolve() :
|
|
2121
|
+
return S.race([r, (typeof navigator > "u" ? S.resolve() : Lr()).then(() => new S((a, c) => {
|
|
2122
2122
|
if (s(), !n)
|
|
2123
2123
|
throw new C.MissingAPI();
|
|
2124
|
-
const h = t.name,
|
|
2125
|
-
if (!
|
|
2124
|
+
const h = t.name, l = e.autoSchema ? n.open(h) : n.open(h, Math.round(10 * t.verno));
|
|
2125
|
+
if (!l)
|
|
2126
2126
|
throw new C.MissingAPI();
|
|
2127
|
-
|
|
2128
|
-
if (o =
|
|
2129
|
-
|
|
2130
|
-
const
|
|
2131
|
-
|
|
2132
|
-
|
|
2127
|
+
l.onerror = Y(c), l.onblocked = j(t._fireOnBlocked), l.onupgradeneeded = j((d) => {
|
|
2128
|
+
if (o = l.transaction, e.autoSchema && !t._options.allowEmptyDB) {
|
|
2129
|
+
l.onerror = qe, o.abort(), l.result.close();
|
|
2130
|
+
const m = n.deleteDatabase(h);
|
|
2131
|
+
m.onsuccess = m.onerror = j(() => {
|
|
2132
|
+
c(new C.NoSuchDatabase(`Database ${h} doesnt exist`));
|
|
2133
2133
|
});
|
|
2134
2134
|
} else {
|
|
2135
|
-
o.onerror = Y(
|
|
2136
|
-
var
|
|
2137
|
-
u =
|
|
2135
|
+
o.onerror = Y(c);
|
|
2136
|
+
var f = d.oldVersion > Math.pow(2, 62) ? 0 : d.oldVersion;
|
|
2137
|
+
u = f < 1, t._novip.idbdb = l.result, Mr(t, f / 10, o, c);
|
|
2138
2138
|
}
|
|
2139
|
-
},
|
|
2139
|
+
}, c), l.onsuccess = j(() => {
|
|
2140
2140
|
o = null;
|
|
2141
|
-
const d = t._novip.idbdb =
|
|
2142
|
-
if (
|
|
2141
|
+
const d = t._novip.idbdb = l.result, f = lt(d.objectStoreNames);
|
|
2142
|
+
if (f.length > 0)
|
|
2143
2143
|
try {
|
|
2144
|
-
const
|
|
2145
|
-
e.autoSchema ? function({ _novip:
|
|
2146
|
-
|
|
2147
|
-
const b =
|
|
2148
|
-
|
|
2149
|
-
}(t, d,
|
|
2150
|
-
const
|
|
2151
|
-
return !(
|
|
2152
|
-
}(t,
|
|
2144
|
+
const p = d.transaction((m = f).length === 1 ? m[0] : m, "readonly");
|
|
2145
|
+
e.autoSchema ? function({ _novip: v }, g, y) {
|
|
2146
|
+
v.verno = g.version / 10;
|
|
2147
|
+
const b = v._dbSchema = zt(0, g, y);
|
|
2148
|
+
v._storeNames = lt(g.objectStoreNames, 0), mt(v, [v._allTables], D(b), b);
|
|
2149
|
+
}(t, d, p) : (Ht(t, t._dbSchema, p), function(v, g) {
|
|
2150
|
+
const y = Jn(zt(0, v.idbdb, g), v._dbSchema);
|
|
2151
|
+
return !(y.add.length || y.change.some((b) => b.add.length || b.change.length));
|
|
2152
|
+
}(t, p) || console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")), Ut(t, p);
|
|
2153
2153
|
} catch {
|
|
2154
2154
|
}
|
|
2155
|
-
var
|
|
2156
|
-
|
|
2157
|
-
e.vcFired = !0, t.on("versionchange").fire(
|
|
2158
|
-
}), d.onclose =
|
|
2159
|
-
t.on("close").fire(
|
|
2160
|
-
}), u && function({ indexedDB:
|
|
2161
|
-
!
|
|
2155
|
+
var m;
|
|
2156
|
+
Ne.push(t), d.onversionchange = j((p) => {
|
|
2157
|
+
e.vcFired = !0, t.on("versionchange").fire(p);
|
|
2158
|
+
}), d.onclose = j((p) => {
|
|
2159
|
+
t.on("close").fire(p);
|
|
2160
|
+
}), u && function({ indexedDB: p, IDBKeyRange: v }, g) {
|
|
2161
|
+
!un(p) && g !== vt && an(p, v).put({ name: g }).catch(I);
|
|
2162
2162
|
}(t._deps, h), a();
|
|
2163
|
-
},
|
|
2164
|
-
}))]).then(() => (s(), e.onReadyBeingFired = [], S.resolve(
|
|
2163
|
+
}, c);
|
|
2164
|
+
}))]).then(() => (s(), e.onReadyBeingFired = [], S.resolve(Yt(() => t.on.ready.fire(t.vip))).then(function a() {
|
|
2165
2165
|
if (e.onReadyBeingFired.length > 0) {
|
|
2166
|
-
let
|
|
2167
|
-
return e.onReadyBeingFired = [], S.resolve(
|
|
2166
|
+
let c = e.onReadyBeingFired.reduce(nn, I);
|
|
2167
|
+
return e.onReadyBeingFired = [], S.resolve(Yt(() => c(t.vip))).then(a);
|
|
2168
2168
|
}
|
|
2169
2169
|
}))).finally(() => {
|
|
2170
2170
|
e.onReadyBeingFired = null, e.isBeingOpened = !1;
|
|
@@ -2174,30 +2174,30 @@ function zr(t) {
|
|
|
2174
2174
|
o && o.abort();
|
|
2175
2175
|
} catch {
|
|
2176
2176
|
}
|
|
2177
|
-
return r === e.openCanceller && t._close(),
|
|
2177
|
+
return r === e.openCanceller && t._close(), $(a);
|
|
2178
2178
|
}).finally(() => {
|
|
2179
2179
|
e.openComplete = !0, i();
|
|
2180
2180
|
});
|
|
2181
2181
|
}
|
|
2182
|
-
function
|
|
2182
|
+
function Gt(t) {
|
|
2183
2183
|
var e = (i) => t.next(i), n = s(e), r = s((i) => t.throw(i));
|
|
2184
2184
|
function s(i) {
|
|
2185
2185
|
return (o) => {
|
|
2186
2186
|
var u = i(o), a = u.value;
|
|
2187
|
-
return u.done ? a : a && typeof a.then == "function" ? a.then(n, r) :
|
|
2187
|
+
return u.done ? a : a && typeof a.then == "function" ? a.then(n, r) : M(a) ? Promise.all(a).then(n, r) : n(a);
|
|
2188
2188
|
};
|
|
2189
2189
|
}
|
|
2190
2190
|
return s(e)();
|
|
2191
2191
|
}
|
|
2192
|
-
function
|
|
2192
|
+
function Vr(t, e, n) {
|
|
2193
2193
|
var r = arguments.length;
|
|
2194
2194
|
if (r < 2)
|
|
2195
2195
|
throw new C.InvalidArgument("Too few arguments");
|
|
2196
2196
|
for (var s = new Array(r - 1); --r; )
|
|
2197
2197
|
s[r - 1] = arguments[r];
|
|
2198
|
-
return n = s.pop(), [t,
|
|
2198
|
+
return n = s.pop(), [t, On(s), n];
|
|
2199
2199
|
}
|
|
2200
|
-
function
|
|
2200
|
+
function Zn(t, e, n, r, s) {
|
|
2201
2201
|
return S.resolve().then(() => {
|
|
2202
2202
|
const i = P.transless || P, o = t._createTransaction(e, n, t._dbSchema, r), u = { trans: o, transless: i };
|
|
2203
2203
|
if (r)
|
|
@@ -2205,79 +2205,79 @@ function rr(t, e, n, r, s) {
|
|
|
2205
2205
|
else
|
|
2206
2206
|
try {
|
|
2207
2207
|
o.create(), t._state.PR1398_maxLoop = 3;
|
|
2208
|
-
} catch (
|
|
2209
|
-
return
|
|
2208
|
+
} catch (l) {
|
|
2209
|
+
return l.name === tn.InvalidState && t.isOpen() && --t._state.PR1398_maxLoop > 0 ? (console.warn("Dexie: Need to reopen db"), t._close(), t.open().then(() => Zn(t, e, n, null, s))) : $(l);
|
|
2210
2210
|
}
|
|
2211
|
-
const a =
|
|
2212
|
-
let
|
|
2211
|
+
const a = Zt(s);
|
|
2212
|
+
let c;
|
|
2213
2213
|
a && Ce();
|
|
2214
2214
|
const h = S.follow(() => {
|
|
2215
|
-
if (
|
|
2215
|
+
if (c = s.call(o, o), c)
|
|
2216
2216
|
if (a) {
|
|
2217
|
-
var
|
|
2218
|
-
|
|
2217
|
+
var l = ne.bind(null, null);
|
|
2218
|
+
c.then(l, l);
|
|
2219
2219
|
} else
|
|
2220
|
-
typeof
|
|
2220
|
+
typeof c.next == "function" && typeof c.throw == "function" && (c = Gt(c));
|
|
2221
2221
|
}, u);
|
|
2222
|
-
return (
|
|
2222
|
+
return (c && typeof c.then == "function" ? S.resolve(c).then((l) => o.active ? l : $(new C.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))) : h.then(() => c)).then((l) => (r && o._resolve(), o._completion.then(() => l))).catch((l) => (o._reject(l), $(l)));
|
|
2223
2223
|
});
|
|
2224
2224
|
}
|
|
2225
2225
|
function et(t, e, n) {
|
|
2226
|
-
const r =
|
|
2226
|
+
const r = M(t) ? t.slice() : [t];
|
|
2227
2227
|
for (let s = 0; s < n; ++s)
|
|
2228
2228
|
r.push(e);
|
|
2229
2229
|
return r;
|
|
2230
2230
|
}
|
|
2231
|
-
const
|
|
2231
|
+
const Wr = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(t) {
|
|
2232
2232
|
return { ...t, table(e) {
|
|
2233
2233
|
const n = t.table(e), { schema: r } = n, s = {}, i = [];
|
|
2234
|
-
function o(
|
|
2235
|
-
const d =
|
|
2236
|
-
return
|
|
2234
|
+
function o(c, h, l) {
|
|
2235
|
+
const d = $e(c), f = s[d] = s[d] || [], m = c == null ? 0 : typeof c == "string" ? 1 : c.length, p = h > 0, v = { ...l, isVirtual: p, keyTail: h, keyLength: m, extractKey: Lt(c), unique: !p && l.unique };
|
|
2236
|
+
return f.push(v), v.isPrimaryKey || i.push(v), m > 1 && o(m === 2 ? c[0] : c.slice(0, m - 1), h + 1, l), f.sort((g, y) => g.keyTail - y.keyTail), v;
|
|
2237
2237
|
}
|
|
2238
2238
|
const u = o(r.primaryKey.keyPath, 0, r.primaryKey);
|
|
2239
2239
|
s[":id"] = [u];
|
|
2240
|
-
for (const
|
|
2241
|
-
o(
|
|
2242
|
-
function a(
|
|
2243
|
-
const h =
|
|
2244
|
-
return h.isVirtual ? { ...
|
|
2245
|
-
var
|
|
2240
|
+
for (const c of r.indexes)
|
|
2241
|
+
o(c.keyPath, 0, c);
|
|
2242
|
+
function a(c) {
|
|
2243
|
+
const h = c.query.index;
|
|
2244
|
+
return h.isVirtual ? { ...c, query: { index: h, range: (l = c.query.range, d = h.keyTail, { type: l.type === 1 ? 2 : l.type, lower: et(l.lower, l.lowerOpen ? t.MAX_KEY : t.MIN_KEY, d), lowerOpen: !0, upper: et(l.upper, l.upperOpen ? t.MIN_KEY : t.MAX_KEY, d), upperOpen: !0 }) } } : c;
|
|
2245
|
+
var l, d;
|
|
2246
2246
|
}
|
|
2247
|
-
return { ...n, schema: { ...r, primaryKey: u, indexes: i, getIndexByKeyPath: function(
|
|
2248
|
-
const h = s[
|
|
2247
|
+
return { ...n, schema: { ...r, primaryKey: u, indexes: i, getIndexByKeyPath: function(c) {
|
|
2248
|
+
const h = s[$e(c)];
|
|
2249
2249
|
return h && h[0];
|
|
2250
|
-
} }, count: (
|
|
2251
|
-
const { keyTail: h, isVirtual:
|
|
2252
|
-
return
|
|
2253
|
-
return Object.create(
|
|
2254
|
-
|
|
2255
|
-
} }, continuePrimaryKey: { value(
|
|
2256
|
-
|
|
2257
|
-
} }, primaryKey: { get: () =>
|
|
2258
|
-
const
|
|
2259
|
-
return d === 1 ?
|
|
2260
|
-
} }, value: { get: () =>
|
|
2261
|
-
}(
|
|
2250
|
+
} }, count: (c) => n.count(a(c)), query: (c) => n.query(a(c)), openCursor(c) {
|
|
2251
|
+
const { keyTail: h, isVirtual: l, keyLength: d } = c.query.index;
|
|
2252
|
+
return l ? n.openCursor(a(c)).then((f) => f && function(m) {
|
|
2253
|
+
return Object.create(m, { continue: { value: function(p) {
|
|
2254
|
+
p != null ? m.continue(et(p, c.reverse ? t.MAX_KEY : t.MIN_KEY, h)) : c.unique ? m.continue(m.key.slice(0, d).concat(c.reverse ? t.MIN_KEY : t.MAX_KEY, h)) : m.continue();
|
|
2255
|
+
} }, continuePrimaryKey: { value(p, v) {
|
|
2256
|
+
m.continuePrimaryKey(et(p, t.MAX_KEY, h), v);
|
|
2257
|
+
} }, primaryKey: { get: () => m.primaryKey }, key: { get() {
|
|
2258
|
+
const p = m.key;
|
|
2259
|
+
return d === 1 ? p[0] : p.slice(0, d);
|
|
2260
|
+
} }, value: { get: () => m.value } });
|
|
2261
|
+
}(f)) : n.openCursor(c);
|
|
2262
2262
|
} };
|
|
2263
2263
|
} };
|
|
2264
2264
|
} };
|
|
2265
2265
|
function ln(t, e, n, r) {
|
|
2266
|
-
return n = n || {}, r = r || "",
|
|
2266
|
+
return n = n || {}, r = r || "", D(t).forEach((s) => {
|
|
2267
2267
|
if (z(e, s)) {
|
|
2268
2268
|
var i = t[s], o = e[s];
|
|
2269
2269
|
if (typeof i == "object" && typeof o == "object" && i && o) {
|
|
2270
|
-
const u =
|
|
2271
|
-
u !==
|
|
2270
|
+
const u = Tt(i);
|
|
2271
|
+
u !== Tt(o) ? n[r + s] = e[s] : u === "Object" ? ln(i, o, n, r + s + ".") : i !== o && (n[r + s] = e[s]);
|
|
2272
2272
|
} else
|
|
2273
2273
|
i !== o && (n[r + s] = e[s]);
|
|
2274
2274
|
} else
|
|
2275
2275
|
n[r + s] = void 0;
|
|
2276
|
-
}),
|
|
2276
|
+
}), D(e).forEach((s) => {
|
|
2277
2277
|
z(t, s) || (n[r + s] = e[s]);
|
|
2278
2278
|
}), n;
|
|
2279
2279
|
}
|
|
2280
|
-
const
|
|
2280
|
+
const zr = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: (t) => ({ ...t, table(e) {
|
|
2281
2281
|
const n = t.table(e), { primaryKey: r } = n.schema;
|
|
2282
2282
|
return { ...n, mutate(s) {
|
|
2283
2283
|
const i = P.trans, { deleting: o, creating: u, updating: a } = i.table(e).hook;
|
|
@@ -2285,43 +2285,43 @@ const Gr = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: (t) =>
|
|
|
2285
2285
|
case "add":
|
|
2286
2286
|
if (u.fire === I)
|
|
2287
2287
|
break;
|
|
2288
|
-
return i._promise("readwrite", () =>
|
|
2288
|
+
return i._promise("readwrite", () => c(s), !0);
|
|
2289
2289
|
case "put":
|
|
2290
2290
|
if (u.fire === I && a.fire === I)
|
|
2291
2291
|
break;
|
|
2292
|
-
return i._promise("readwrite", () =>
|
|
2292
|
+
return i._promise("readwrite", () => c(s), !0);
|
|
2293
2293
|
case "delete":
|
|
2294
2294
|
if (o.fire === I)
|
|
2295
2295
|
break;
|
|
2296
|
-
return i._promise("readwrite", () =>
|
|
2296
|
+
return i._promise("readwrite", () => c(s), !0);
|
|
2297
2297
|
case "deleteRange":
|
|
2298
2298
|
if (o.fire === I)
|
|
2299
2299
|
break;
|
|
2300
|
-
return i._promise("readwrite", () => function(
|
|
2301
|
-
return h(
|
|
2300
|
+
return i._promise("readwrite", () => function(l) {
|
|
2301
|
+
return h(l.trans, l.range, 1e4);
|
|
2302
2302
|
}(s), !0);
|
|
2303
2303
|
}
|
|
2304
2304
|
return n.mutate(s);
|
|
2305
|
-
function l
|
|
2306
|
-
const d = P.trans,
|
|
2307
|
-
return
|
|
2308
|
-
}(r,
|
|
2309
|
-
if (!
|
|
2305
|
+
function c(l) {
|
|
2306
|
+
const d = P.trans, f = l.keys || function(m, p) {
|
|
2307
|
+
return p.type === "delete" ? p.keys : p.keys || p.values.map(m.extractKey);
|
|
2308
|
+
}(r, l);
|
|
2309
|
+
if (!f)
|
|
2310
2310
|
throw new Error("Keys missing");
|
|
2311
|
-
return (
|
|
2312
|
-
return
|
|
2313
|
-
}(n,
|
|
2314
|
-
const
|
|
2315
|
-
const
|
|
2316
|
-
if (
|
|
2317
|
-
o.fire.call(b,
|
|
2318
|
-
else if (
|
|
2319
|
-
const x = u.fire.call(b,
|
|
2320
|
-
|
|
2311
|
+
return (l = l.type === "add" || l.type === "put" ? { ...l, keys: f } : { ...l }).type !== "delete" && (l.values = [...l.values]), l.keys && (l.keys = [...l.keys]), function(m, p, v) {
|
|
2312
|
+
return p.type === "add" ? Promise.resolve([]) : m.getMany({ trans: p.trans, keys: v, cache: "immutable" });
|
|
2313
|
+
}(n, l, f).then((m) => {
|
|
2314
|
+
const p = f.map((v, g) => {
|
|
2315
|
+
const y = m[g], b = { onerror: null, onsuccess: null };
|
|
2316
|
+
if (l.type === "delete")
|
|
2317
|
+
o.fire.call(b, v, y, d);
|
|
2318
|
+
else if (l.type === "add" || y === void 0) {
|
|
2319
|
+
const x = u.fire.call(b, v, l.values[g], d);
|
|
2320
|
+
v == null && x != null && (v = x, l.keys[g] = v, r.outbound || H(l.values[g], r.keyPath, v));
|
|
2321
2321
|
} else {
|
|
2322
|
-
const x = ln(
|
|
2322
|
+
const x = ln(y, l.values[g]), E = a.fire.call(b, x, v, y, d);
|
|
2323
2323
|
if (E) {
|
|
2324
|
-
const k =
|
|
2324
|
+
const k = l.values[g];
|
|
2325
2325
|
Object.keys(E).forEach((w) => {
|
|
2326
2326
|
z(k, w) ? k[w] = E[w] : H(k, w, E[w]);
|
|
2327
2327
|
});
|
|
@@ -2329,21 +2329,21 @@ const Gr = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: (t) =>
|
|
|
2329
2329
|
}
|
|
2330
2330
|
return b;
|
|
2331
2331
|
});
|
|
2332
|
-
return n.mutate(
|
|
2333
|
-
for (let x = 0; x <
|
|
2334
|
-
const E = g ? g[x] :
|
|
2335
|
-
E == null ? k.onerror && k.onerror(
|
|
2332
|
+
return n.mutate(l).then(({ failures: v, results: g, numFailures: y, lastResult: b }) => {
|
|
2333
|
+
for (let x = 0; x < f.length; ++x) {
|
|
2334
|
+
const E = g ? g[x] : f[x], k = p[x];
|
|
2335
|
+
E == null ? k.onerror && k.onerror(v[x]) : k.onsuccess && k.onsuccess(l.type === "put" && m[x] ? l.values[x] : E);
|
|
2336
2336
|
}
|
|
2337
|
-
return { failures:
|
|
2338
|
-
}).catch((
|
|
2337
|
+
return { failures: v, results: g, numFailures: y, lastResult: b };
|
|
2338
|
+
}).catch((v) => (p.forEach((g) => g.onerror && g.onerror(v)), Promise.reject(v)));
|
|
2339
2339
|
});
|
|
2340
2340
|
}
|
|
2341
|
-
function h(
|
|
2342
|
-
return n.query({ trans:
|
|
2341
|
+
function h(l, d, f) {
|
|
2342
|
+
return n.query({ trans: l, values: !1, query: { index: r, range: d }, limit: f }).then(({ result: m }) => c({ type: "delete", keys: m, trans: l }).then((p) => p.numFailures > 0 ? Promise.reject(p.failures[0]) : m.length < f ? { failures: [], numFailures: 0, lastResult: void 0 } : h(l, { ...d, lower: m[m.length - 1], lowerOpen: !0 }, f)));
|
|
2343
2343
|
}
|
|
2344
2344
|
} };
|
|
2345
2345
|
} }) };
|
|
2346
|
-
function
|
|
2346
|
+
function er(t, e, n) {
|
|
2347
2347
|
try {
|
|
2348
2348
|
if (!e || e.keys.length < t.length)
|
|
2349
2349
|
return null;
|
|
@@ -2355,16 +2355,16 @@ function sr(t, e, n) {
|
|
|
2355
2355
|
return null;
|
|
2356
2356
|
}
|
|
2357
2357
|
}
|
|
2358
|
-
const
|
|
2358
|
+
const Hr = { stack: "dbcore", level: -1, create: (t) => ({ table: (e) => {
|
|
2359
2359
|
const n = t.table(e);
|
|
2360
2360
|
return { ...n, getMany: (r) => {
|
|
2361
2361
|
if (!r.cache)
|
|
2362
2362
|
return n.getMany(r);
|
|
2363
|
-
const s =
|
|
2363
|
+
const s = er(r.keys, r.trans._cache, r.cache === "clone");
|
|
2364
2364
|
return s ? S.resolve(s) : n.getMany(r).then((i) => (r.trans._cache = { keys: r.keys, values: r.cache === "clone" ? We(i) : i }, i));
|
|
2365
2365
|
}, mutate: (r) => (r.type !== "add" && (r.trans._cache = null), n.mutate(r)) };
|
|
2366
2366
|
} }) };
|
|
2367
|
-
function
|
|
2367
|
+
function cn(t) {
|
|
2368
2368
|
return !("from" in t);
|
|
2369
2369
|
}
|
|
2370
2370
|
const Q = function(t, e) {
|
|
@@ -2380,29 +2380,29 @@ function Ve(t, e, n) {
|
|
|
2380
2380
|
return;
|
|
2381
2381
|
if (r > 0)
|
|
2382
2382
|
throw RangeError();
|
|
2383
|
-
if (
|
|
2383
|
+
if (cn(t))
|
|
2384
2384
|
return U(t, { from: e, to: n, d: 1 });
|
|
2385
2385
|
const s = t.l, i = t.r;
|
|
2386
2386
|
if (L(n, t.from) < 0)
|
|
2387
|
-
return s ? Ve(s, e, n) : t.l = { from: e, to: n, d: 1, l: null, r: null },
|
|
2387
|
+
return s ? Ve(s, e, n) : t.l = { from: e, to: n, d: 1, l: null, r: null }, xn(t);
|
|
2388
2388
|
if (L(e, t.to) > 0)
|
|
2389
|
-
return i ? Ve(i, e, n) : t.r = { from: e, to: n, d: 1, l: null, r: null },
|
|
2389
|
+
return i ? Ve(i, e, n) : t.r = { from: e, to: n, d: 1, l: null, r: null }, xn(t);
|
|
2390
2390
|
L(e, t.from) < 0 && (t.from = e, t.l = null, t.d = i ? i.d + 1 : 1), L(n, t.to) > 0 && (t.to = n, t.r = null, t.d = t.l ? t.l.d + 1 : 1);
|
|
2391
2391
|
const o = !t.r;
|
|
2392
|
-
s && !t.l &&
|
|
2392
|
+
s && !t.l && yt(t, s), i && o && yt(t, i);
|
|
2393
2393
|
}
|
|
2394
|
-
function
|
|
2395
|
-
|
|
2394
|
+
function yt(t, e) {
|
|
2395
|
+
cn(e) || function n(r, { from: s, to: i, l: o, r: u }) {
|
|
2396
2396
|
Ve(r, s, i), o && n(r, o), u && n(r, u);
|
|
2397
2397
|
}(t, e);
|
|
2398
2398
|
}
|
|
2399
|
-
function
|
|
2400
|
-
const n =
|
|
2399
|
+
function Yr(t, e) {
|
|
2400
|
+
const n = Xt(e);
|
|
2401
2401
|
let r = n.next();
|
|
2402
2402
|
if (r.done)
|
|
2403
2403
|
return !1;
|
|
2404
2404
|
let s = r.value;
|
|
2405
|
-
const i =
|
|
2405
|
+
const i = Xt(t);
|
|
2406
2406
|
let o = i.next(s.from), u = o.value;
|
|
2407
2407
|
for (; !r.done && !o.done; ) {
|
|
2408
2408
|
if (L(u.from, s.to) <= 0 && L(u.to, s.from) >= 0)
|
|
@@ -2411,8 +2411,8 @@ function Qr(t, e) {
|
|
|
2411
2411
|
}
|
|
2412
2412
|
return !1;
|
|
2413
2413
|
}
|
|
2414
|
-
function
|
|
2415
|
-
let e =
|
|
2414
|
+
function Xt(t) {
|
|
2415
|
+
let e = cn(t) ? null : { s: 0, n: t };
|
|
2416
2416
|
return { next(n) {
|
|
2417
2417
|
const r = arguments.length > 0;
|
|
2418
2418
|
for (; e; )
|
|
@@ -2438,89 +2438,89 @@ function Qt(t) {
|
|
|
2438
2438
|
return { done: !0 };
|
|
2439
2439
|
} };
|
|
2440
2440
|
}
|
|
2441
|
-
function
|
|
2441
|
+
function xn(t) {
|
|
2442
2442
|
var e, n;
|
|
2443
2443
|
const r = (((e = t.r) === null || e === void 0 ? void 0 : e.d) || 0) - (((n = t.l) === null || n === void 0 ? void 0 : n.d) || 0), s = r > 1 ? "r" : r < -1 ? "l" : "";
|
|
2444
2444
|
if (s) {
|
|
2445
2445
|
const i = s === "r" ? "l" : "r", o = { ...t }, u = t[s];
|
|
2446
|
-
t.from = u.from, t.to = u.to, t[s] = u[s], o[s] = u[i], t[i] = o, o.d =
|
|
2446
|
+
t.from = u.from, t.to = u.to, t[s] = u[s], o[s] = u[i], t[i] = o, o.d = Sn(o);
|
|
2447
2447
|
}
|
|
2448
|
-
t.d =
|
|
2448
|
+
t.d = Sn(t);
|
|
2449
2449
|
}
|
|
2450
|
-
function
|
|
2450
|
+
function Sn({ r: t, l: e }) {
|
|
2451
2451
|
return (t ? e ? Math.max(t.d, e.d) : t.d : e ? e.d : 0) + 1;
|
|
2452
2452
|
}
|
|
2453
2453
|
Ee(Q.prototype, { add(t) {
|
|
2454
|
-
return
|
|
2454
|
+
return yt(this, t), this;
|
|
2455
2455
|
}, addKey(t) {
|
|
2456
2456
|
return Ve(this, t, t), this;
|
|
2457
2457
|
}, addKeys(t) {
|
|
2458
2458
|
return t.forEach((e) => Ve(this, e, e)), this;
|
|
2459
|
-
}, [
|
|
2460
|
-
return
|
|
2459
|
+
}, [At]() {
|
|
2460
|
+
return Xt(this);
|
|
2461
2461
|
} });
|
|
2462
|
-
const
|
|
2462
|
+
const Gr = { stack: "dbcore", level: 0, create: (t) => {
|
|
2463
2463
|
const e = t.schema.name, n = new Q(t.MIN_KEY, t.MAX_KEY);
|
|
2464
2464
|
return { ...t, table: (r) => {
|
|
2465
|
-
const s = t.table(r), { schema: i } = s, { primaryKey: o } = i, { extractKey: u, outbound: a } = o,
|
|
2466
|
-
const
|
|
2465
|
+
const s = t.table(r), { schema: i } = s, { primaryKey: o } = i, { extractKey: u, outbound: a } = o, c = { ...s, mutate: (d) => {
|
|
2466
|
+
const f = d.trans, m = f.mutatedParts || (f.mutatedParts = {}), p = (k) => {
|
|
2467
2467
|
const w = `idb://${e}/${r}/${k}`;
|
|
2468
|
-
return
|
|
2469
|
-
},
|
|
2468
|
+
return m[w] || (m[w] = new Q());
|
|
2469
|
+
}, v = p(""), g = p(":dels"), { type: y } = d;
|
|
2470
2470
|
let [b, x] = d.type === "deleteRange" ? [d.range] : d.type === "delete" ? [d.keys] : d.values.length < 50 ? [[], d.values] : [];
|
|
2471
2471
|
const E = d.trans._cache;
|
|
2472
2472
|
return s.mutate(d).then((k) => {
|
|
2473
|
-
if (
|
|
2474
|
-
|
|
2475
|
-
const w =
|
|
2476
|
-
w ||
|
|
2473
|
+
if (M(b)) {
|
|
2474
|
+
y !== "delete" && (b = k.results), v.addKeys(b);
|
|
2475
|
+
const w = er(b, E);
|
|
2476
|
+
w || y === "add" || g.addKeys(b), (w || x) && function(A, _, R, O) {
|
|
2477
2477
|
function q(B) {
|
|
2478
|
-
const
|
|
2479
|
-
function
|
|
2478
|
+
const N = A(B.name || "");
|
|
2479
|
+
function ge(V) {
|
|
2480
2480
|
return V != null ? B.extractKey(V) : null;
|
|
2481
2481
|
}
|
|
2482
|
-
const ve = (V) => B.multiEntry &&
|
|
2483
|
-
(
|
|
2484
|
-
const Ae =
|
|
2482
|
+
const ve = (V) => B.multiEntry && M(V) ? V.forEach((le) => N.addKey(le)) : N.addKey(V);
|
|
2483
|
+
(R || O).forEach((V, le) => {
|
|
2484
|
+
const Ae = R && ge(R[le]), bt = O && ge(O[le]);
|
|
2485
2485
|
L(Ae, bt) !== 0 && (Ae != null && ve(Ae), bt != null && ve(bt));
|
|
2486
2486
|
});
|
|
2487
2487
|
}
|
|
2488
2488
|
_.indexes.forEach(q);
|
|
2489
|
-
}(
|
|
2489
|
+
}(p, i, w, x);
|
|
2490
2490
|
} else if (b) {
|
|
2491
2491
|
const w = { from: b.lower, to: b.upper };
|
|
2492
|
-
g.add(w),
|
|
2492
|
+
g.add(w), v.add(w);
|
|
2493
2493
|
} else
|
|
2494
|
-
|
|
2494
|
+
v.add(n), g.add(n), i.indexes.forEach((w) => p(w.name).add(n));
|
|
2495
2495
|
return k;
|
|
2496
2496
|
});
|
|
2497
|
-
} }, h = ({ query: { index: d, range:
|
|
2498
|
-
var
|
|
2499
|
-
return [d, new Q((
|
|
2500
|
-
},
|
|
2501
|
-
return
|
|
2502
|
-
|
|
2503
|
-
const { subscr:
|
|
2504
|
-
if (
|
|
2505
|
-
const
|
|
2497
|
+
} }, h = ({ query: { index: d, range: f } }) => {
|
|
2498
|
+
var m, p;
|
|
2499
|
+
return [d, new Q((m = f.lower) !== null && m !== void 0 ? m : t.MIN_KEY, (p = f.upper) !== null && p !== void 0 ? p : t.MAX_KEY)];
|
|
2500
|
+
}, l = { get: (d) => [o, new Q(d.key)], getMany: (d) => [o, new Q().addKeys(d.keys)], count: h, query: h, openCursor: h };
|
|
2501
|
+
return D(l).forEach((d) => {
|
|
2502
|
+
c[d] = function(f) {
|
|
2503
|
+
const { subscr: m } = P;
|
|
2504
|
+
if (m) {
|
|
2505
|
+
const p = (x) => {
|
|
2506
2506
|
const E = `idb://${e}/${r}/${x}`;
|
|
2507
|
-
return
|
|
2508
|
-
},
|
|
2509
|
-
if (
|
|
2507
|
+
return m[E] || (m[E] = new Q());
|
|
2508
|
+
}, v = p(""), g = p(":dels"), [y, b] = l[d](f);
|
|
2509
|
+
if (p(y.name || "").add(b), !y.isPrimaryKey) {
|
|
2510
2510
|
if (d !== "count") {
|
|
2511
|
-
const x = d === "query" && a &&
|
|
2511
|
+
const x = d === "query" && a && f.values && s.query({ ...f, values: !1 });
|
|
2512
2512
|
return s[d].apply(this, arguments).then((E) => {
|
|
2513
2513
|
if (d === "query") {
|
|
2514
|
-
if (a &&
|
|
2515
|
-
return x.then(({ result: w }) => (
|
|
2516
|
-
const k =
|
|
2517
|
-
|
|
2514
|
+
if (a && f.values)
|
|
2515
|
+
return x.then(({ result: w }) => (v.addKeys(w), E));
|
|
2516
|
+
const k = f.values ? E.result.map(u) : E.result;
|
|
2517
|
+
f.values ? v.addKeys(k) : g.addKeys(k);
|
|
2518
2518
|
} else if (d === "openCursor") {
|
|
2519
|
-
const k = E, w =
|
|
2519
|
+
const k = E, w = f.values;
|
|
2520
2520
|
return k && Object.create(k, { key: { get: () => (g.addKey(k.primaryKey), k.key) }, primaryKey: { get() {
|
|
2521
2521
|
const A = k.primaryKey;
|
|
2522
2522
|
return g.addKey(A), A;
|
|
2523
|
-
} }, value: { get: () => (w &&
|
|
2523
|
+
} }, value: { get: () => (w && v.addKey(k.primaryKey), k.value) } });
|
|
2524
2524
|
}
|
|
2525
2525
|
return E;
|
|
2526
2526
|
});
|
|
@@ -2530,7 +2530,7 @@ const Jr = { stack: "dbcore", level: 0, create: (t) => {
|
|
|
2530
2530
|
}
|
|
2531
2531
|
return s[d].apply(this, arguments);
|
|
2532
2532
|
};
|
|
2533
|
-
}),
|
|
2533
|
+
}), c;
|
|
2534
2534
|
} };
|
|
2535
2535
|
} };
|
|
2536
2536
|
class pe {
|
|
@@ -2546,66 +2546,66 @@ class pe {
|
|
|
2546
2546
|
i.dbReadyResolve = u;
|
|
2547
2547
|
}), i.openCanceller = new S((u, a) => {
|
|
2548
2548
|
i.cancelOpen = a;
|
|
2549
|
-
}), this._state = i, this.name = e, this.on =
|
|
2549
|
+
}), this._state = i, this.name = e, this.on = De(this, "populate", "blocked", "versionchange", "close", { ready: [nn, I] }), this.on.ready.subscribe = Pn(this.on.ready.subscribe, (u) => (a, c) => {
|
|
2550
2550
|
pe.vip(() => {
|
|
2551
2551
|
const h = this._state;
|
|
2552
2552
|
if (h.openComplete)
|
|
2553
|
-
h.dbOpenError || S.resolve().then(a),
|
|
2553
|
+
h.dbOpenError || S.resolve().then(a), c && u(a);
|
|
2554
2554
|
else if (h.onReadyBeingFired)
|
|
2555
|
-
h.onReadyBeingFired.push(a),
|
|
2555
|
+
h.onReadyBeingFired.push(a), c && u(a);
|
|
2556
2556
|
else {
|
|
2557
2557
|
u(a);
|
|
2558
|
-
const
|
|
2559
|
-
|
|
2560
|
-
|
|
2558
|
+
const l = this;
|
|
2559
|
+
c || u(function d() {
|
|
2560
|
+
l.on.ready.unsubscribe(a), l.on.ready.unsubscribe(d);
|
|
2561
2561
|
});
|
|
2562
2562
|
}
|
|
2563
2563
|
});
|
|
2564
|
-
}), this.Collection = (o = this, Oe(
|
|
2564
|
+
}), this.Collection = (o = this, Oe(Kr.prototype, function(u, a) {
|
|
2565
2565
|
this.db = o;
|
|
2566
|
-
let
|
|
2566
|
+
let c = Hn, h = null;
|
|
2567
2567
|
if (a)
|
|
2568
2568
|
try {
|
|
2569
|
-
|
|
2570
|
-
} catch (
|
|
2571
|
-
h =
|
|
2569
|
+
c = a();
|
|
2570
|
+
} catch (m) {
|
|
2571
|
+
h = m;
|
|
2572
2572
|
}
|
|
2573
|
-
const
|
|
2574
|
-
this._ctx = { table: d, index:
|
|
2573
|
+
const l = u._ctx, d = l.table, f = d.hook.reading.fire;
|
|
2574
|
+
this._ctx = { table: d, index: l.index, isPrimKey: !l.index || d.schema.primKey.keyPath && l.index === d.schema.primKey.name, range: c, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: h, or: l.or, valueMapper: f !== Fe ? f : null };
|
|
2575
2575
|
})), this.Table = function(u) {
|
|
2576
|
-
return Oe(
|
|
2577
|
-
this.db = u, this._tx = h, this.name = a, this.schema =
|
|
2576
|
+
return Oe(Ir.prototype, function(a, c, h) {
|
|
2577
|
+
this.db = u, this._tx = h, this.name = a, this.schema = c, this.hook = u._allTables[a] ? u._allTables[a].hook : De(null, { creating: [br, I], reading: [vr, Fe], updating: [_r, I], deleting: [wr, I] });
|
|
2578
2578
|
});
|
|
2579
2579
|
}(this), this.Transaction = function(u) {
|
|
2580
|
-
return Oe(
|
|
2581
|
-
this.db = u, this.mode = a, this.storeNames =
|
|
2582
|
-
this._resolve =
|
|
2580
|
+
return Oe(Dr.prototype, function(a, c, h, l, d) {
|
|
2581
|
+
this.db = u, this.mode = a, this.storeNames = c, this.schema = h, this.chromeTransactionDurability = l, this.idbtrans = null, this.on = De(this, "complete", "error", "abort"), this.parent = d || 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 S((f, m) => {
|
|
2582
|
+
this._resolve = f, this._reject = m;
|
|
2583
2583
|
}), this._completion.then(() => {
|
|
2584
2584
|
this.active = !1, this.on.complete.fire();
|
|
2585
|
-
}, (
|
|
2586
|
-
var
|
|
2587
|
-
return this.active = !1, this.on.error.fire(
|
|
2585
|
+
}, (f) => {
|
|
2586
|
+
var m = this.active;
|
|
2587
|
+
return this.active = !1, this.on.error.fire(f), this.parent ? this.parent._reject(f) : m && this.idbtrans && this.idbtrans.abort(), $(f);
|
|
2588
2588
|
});
|
|
2589
2589
|
});
|
|
2590
2590
|
}(this), this.Version = function(u) {
|
|
2591
|
-
return Oe(
|
|
2591
|
+
return Oe(qr.prototype, function(a) {
|
|
2592
2592
|
this.db = u, this._cfg = { version: a, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
|
|
2593
2593
|
});
|
|
2594
2594
|
}(this), this.WhereClause = function(u) {
|
|
2595
|
-
return Oe(
|
|
2596
|
-
this.db = u, this._ctx = { table: a, index:
|
|
2597
|
-
const
|
|
2598
|
-
if (!
|
|
2595
|
+
return Oe(Gn.prototype, function(a, c, h) {
|
|
2596
|
+
this.db = u, this._ctx = { table: a, index: c === ":id" ? null : c, or: h };
|
|
2597
|
+
const l = u._deps.indexedDB;
|
|
2598
|
+
if (!l)
|
|
2599
2599
|
throw new C.MissingAPI();
|
|
2600
|
-
this._cmp = this._ascending =
|
|
2600
|
+
this._cmp = this._ascending = l.cmp.bind(l), this._descending = (d, f) => l.cmp(f, d), this._max = (d, f) => l.cmp(d, f) > 0 ? d : f, this._min = (d, f) => l.cmp(d, f) < 0 ? d : f, this._IDBKeyRange = u._deps.IDBKeyRange;
|
|
2601
2601
|
});
|
|
2602
2602
|
}(this), this.on("versionchange", (u) => {
|
|
2603
2603
|
u.newVersion > 0 ? console.warn(`Another connection wants to upgrade database '${this.name}'. Closing db now to resume the upgrade.`) : console.warn(`Another connection wants to delete database '${this.name}'. Closing db now to resume the delete request.`), this.close();
|
|
2604
2604
|
}), this.on("blocked", (u) => {
|
|
2605
2605
|
!u.newVersion || u.newVersion < u.oldVersion ? console.warn(`Dexie.delete('${this.name}') was blocked`) : console.warn(`Upgrade '${this.name}' blocked by other connection holding version ${u.oldVersion / 10}`);
|
|
2606
|
-
}), this._maxKey = Ue(n.IDBKeyRange), this._createTransaction = (u, a,
|
|
2607
|
-
this.on("blocked").fire(u),
|
|
2608
|
-
}, this.use(
|
|
2606
|
+
}), this._maxKey = Ue(n.IDBKeyRange), this._createTransaction = (u, a, c, h) => new this.Transaction(u, a, c, this._options.chromeTransactionDurability, h), this._fireOnBlocked = (u) => {
|
|
2607
|
+
this.on("blocked").fire(u), Ne.filter((a) => a.name === this.name && a !== this && !a._state.vcFired).map((a) => a.on("versionchange").fire(u));
|
|
2608
|
+
}, this.use(Wr), this.use(zr), this.use(Gr), this.use(Hr), this.vip = Object.create(this, { _vip: { value: !0 } }), s.forEach((u) => u(this));
|
|
2609
2609
|
}
|
|
2610
2610
|
version(e) {
|
|
2611
2611
|
if (isNaN(e) || e < 0.1)
|
|
@@ -2615,7 +2615,7 @@ class pe {
|
|
|
2615
2615
|
this.verno = Math.max(this.verno, e);
|
|
2616
2616
|
const n = this._versions;
|
|
2617
2617
|
var r = n.filter((s) => s._cfg.version === e)[0];
|
|
2618
|
-
return r || (r = new this.Version(e), n.push(r), n.sort(
|
|
2618
|
+
return r || (r = new this.Version(e), n.push(r), n.sort(Fr), r.stores({}), this._state.autoSchema = !1, r);
|
|
2619
2619
|
}
|
|
2620
2620
|
_whenReady(e) {
|
|
2621
2621
|
return this.idbdb && (this._state.openComplete || P.letThrough || this._vip) ? e() : new S((n, r) => {
|
|
@@ -2638,11 +2638,11 @@ class pe {
|
|
|
2638
2638
|
return e && this._middlewares[e] && (this._middlewares[e] = this._middlewares[e].filter((s) => r ? s.create !== r : !!n && s.name !== n)), this;
|
|
2639
2639
|
}
|
|
2640
2640
|
open() {
|
|
2641
|
-
return
|
|
2641
|
+
return Ur(this);
|
|
2642
2642
|
}
|
|
2643
2643
|
_close() {
|
|
2644
|
-
const e = this._state, n =
|
|
2645
|
-
if (n >= 0 &&
|
|
2644
|
+
const e = this._state, n = Ne.indexOf(this);
|
|
2645
|
+
if (n >= 0 && Ne.splice(n, 1), this.idbdb) {
|
|
2646
2646
|
try {
|
|
2647
2647
|
this.idbdb.close();
|
|
2648
2648
|
} catch {
|
|
@@ -2666,9 +2666,9 @@ class pe {
|
|
|
2666
2666
|
const i = () => {
|
|
2667
2667
|
this.close();
|
|
2668
2668
|
var o = this._deps.indexedDB.deleteDatabase(this.name);
|
|
2669
|
-
o.onsuccess =
|
|
2670
|
-
(function({ indexedDB: u, IDBKeyRange: a },
|
|
2671
|
-
!
|
|
2669
|
+
o.onsuccess = j(() => {
|
|
2670
|
+
(function({ indexedDB: u, IDBKeyRange: a }, c) {
|
|
2671
|
+
!un(u) && c !== vt && an(u, a).delete(c).catch(I);
|
|
2672
2672
|
})(this._deps, this.name), r();
|
|
2673
2673
|
}), o.onerror = Y(s), o.onblocked = this._fireOnBlocked;
|
|
2674
2674
|
};
|
|
@@ -2694,10 +2694,10 @@ class pe {
|
|
|
2694
2694
|
return this._state.autoSchema;
|
|
2695
2695
|
}
|
|
2696
2696
|
get tables() {
|
|
2697
|
-
return
|
|
2697
|
+
return D(this._allTables).map((e) => this._allTables[e]);
|
|
2698
2698
|
}
|
|
2699
2699
|
transaction() {
|
|
2700
|
-
const e =
|
|
2700
|
+
const e = Vr.apply(this, arguments);
|
|
2701
2701
|
return this._transaction.apply(this, e);
|
|
2702
2702
|
}
|
|
2703
2703
|
_transaction(e, n, r) {
|
|
@@ -2707,8 +2707,8 @@ class pe {
|
|
|
2707
2707
|
let o, u;
|
|
2708
2708
|
e = e.replace("!", "").replace("?", "");
|
|
2709
2709
|
try {
|
|
2710
|
-
if (u = n.map((
|
|
2711
|
-
var h =
|
|
2710
|
+
if (u = n.map((c) => {
|
|
2711
|
+
var h = c instanceof this.Table ? c.name : c;
|
|
2712
2712
|
if (typeof h != "string")
|
|
2713
2713
|
throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");
|
|
2714
2714
|
return h;
|
|
@@ -2725,20 +2725,20 @@ class pe {
|
|
|
2725
2725
|
throw new C.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");
|
|
2726
2726
|
s = null;
|
|
2727
2727
|
}
|
|
2728
|
-
s && u.forEach((
|
|
2729
|
-
if (s && s.storeNames.indexOf(
|
|
2728
|
+
s && u.forEach((c) => {
|
|
2729
|
+
if (s && s.storeNames.indexOf(c) === -1) {
|
|
2730
2730
|
if (!i)
|
|
2731
|
-
throw new C.SubTransaction("Table " +
|
|
2731
|
+
throw new C.SubTransaction("Table " + c + " not included in parent transaction.");
|
|
2732
2732
|
s = null;
|
|
2733
2733
|
}
|
|
2734
2734
|
}), i && s && !s.active && (s = null);
|
|
2735
2735
|
}
|
|
2736
|
-
} catch (
|
|
2737
|
-
return s ? s._promise(null, (h,
|
|
2738
|
-
c
|
|
2739
|
-
}) :
|
|
2736
|
+
} catch (c) {
|
|
2737
|
+
return s ? s._promise(null, (h, l) => {
|
|
2738
|
+
l(c);
|
|
2739
|
+
}) : $(c);
|
|
2740
2740
|
}
|
|
2741
|
-
const a =
|
|
2741
|
+
const a = Zn.bind(null, this, o, u, s, r);
|
|
2742
2742
|
return s ? s._promise(o, a, "lock") : P.trans ? Te(P.transless, () => this._whenReady(a)) : this._whenReady(a);
|
|
2743
2743
|
}
|
|
2744
2744
|
table(e) {
|
|
@@ -2747,66 +2747,66 @@ class pe {
|
|
|
2747
2747
|
return this._allTables[e];
|
|
2748
2748
|
}
|
|
2749
2749
|
}
|
|
2750
|
-
const
|
|
2751
|
-
class
|
|
2750
|
+
const Xr = typeof Symbol < "u" && "observable" in Symbol ? Symbol.observable : "@@observable";
|
|
2751
|
+
class Qr {
|
|
2752
2752
|
constructor(e) {
|
|
2753
2753
|
this._subscribe = e;
|
|
2754
2754
|
}
|
|
2755
2755
|
subscribe(e, n, r) {
|
|
2756
2756
|
return this._subscribe(e && typeof e != "function" ? e : { next: e, error: n, complete: r });
|
|
2757
2757
|
}
|
|
2758
|
-
[
|
|
2758
|
+
[Xr]() {
|
|
2759
2759
|
return this;
|
|
2760
2760
|
}
|
|
2761
2761
|
}
|
|
2762
|
-
function
|
|
2763
|
-
return
|
|
2764
|
-
|
|
2762
|
+
function tr(t, e) {
|
|
2763
|
+
return D(e).forEach((n) => {
|
|
2764
|
+
yt(t[n] || (t[n] = new Q()), e[n]);
|
|
2765
2765
|
}), t;
|
|
2766
2766
|
}
|
|
2767
|
-
function
|
|
2767
|
+
function Jr(t) {
|
|
2768
2768
|
let e, n = !1;
|
|
2769
|
-
const r = new
|
|
2770
|
-
const i =
|
|
2769
|
+
const r = new Qr((s) => {
|
|
2770
|
+
const i = Zt(t);
|
|
2771
2771
|
let o = !1, u = {}, a = {};
|
|
2772
|
-
const
|
|
2772
|
+
const c = { get closed() {
|
|
2773
2773
|
return o;
|
|
2774
2774
|
}, unsubscribe: () => {
|
|
2775
|
-
o = !0, ue.storagemutated.unsubscribe(
|
|
2775
|
+
o = !0, ue.storagemutated.unsubscribe(f);
|
|
2776
2776
|
} };
|
|
2777
|
-
s.start && s.start(
|
|
2778
|
-
let h = !1,
|
|
2777
|
+
s.start && s.start(c);
|
|
2778
|
+
let h = !1, l = !1;
|
|
2779
2779
|
function d() {
|
|
2780
|
-
return
|
|
2780
|
+
return D(a).some((p) => u[p] && Yr(u[p], a[p]));
|
|
2781
2781
|
}
|
|
2782
|
-
const
|
|
2783
|
-
|
|
2784
|
-
},
|
|
2782
|
+
const f = (p) => {
|
|
2783
|
+
tr(u, p), d() && m();
|
|
2784
|
+
}, m = () => {
|
|
2785
2785
|
if (h || o)
|
|
2786
2786
|
return;
|
|
2787
2787
|
u = {};
|
|
2788
|
-
const
|
|
2788
|
+
const p = {}, v = function(g) {
|
|
2789
2789
|
i && Ce();
|
|
2790
|
-
const
|
|
2790
|
+
const y = () => oe(t, { subscr: g, trans: null }), b = P.trans ? Te(P.transless, y) : y();
|
|
2791
2791
|
return i && b.then(ne, ne), b;
|
|
2792
|
-
}(
|
|
2793
|
-
|
|
2794
|
-
n = !0, e = g, h = !1, o || (d() ?
|
|
2792
|
+
}(p);
|
|
2793
|
+
l || (ue(Le, f), l = !0), h = !0, Promise.resolve(v).then((g) => {
|
|
2794
|
+
n = !0, e = g, h = !1, o || (d() ? m() : (u = {}, a = p, s.next && s.next(g)));
|
|
2795
2795
|
}, (g) => {
|
|
2796
|
-
h = !1, n = !1, s.error && s.error(g),
|
|
2796
|
+
h = !1, n = !1, s.error && s.error(g), c.unsubscribe();
|
|
2797
2797
|
});
|
|
2798
2798
|
};
|
|
2799
|
-
return
|
|
2799
|
+
return m(), c;
|
|
2800
2800
|
});
|
|
2801
2801
|
return r.hasValue = () => n, r.getValue = () => e, r;
|
|
2802
2802
|
}
|
|
2803
|
-
let
|
|
2803
|
+
let Qt;
|
|
2804
2804
|
try {
|
|
2805
|
-
|
|
2805
|
+
Qt = { indexedDB: K.indexedDB || K.mozIndexedDB || K.webkitIndexedDB || K.msIndexedDB, IDBKeyRange: K.IDBKeyRange || K.webkitIDBKeyRange };
|
|
2806
2806
|
} catch {
|
|
2807
|
-
|
|
2807
|
+
Qt = { indexedDB: null, IDBKeyRange: null };
|
|
2808
2808
|
}
|
|
2809
|
-
const
|
|
2809
|
+
const ce = pe;
|
|
2810
2810
|
function at(t) {
|
|
2811
2811
|
let e = Z;
|
|
2812
2812
|
try {
|
|
@@ -2815,45 +2815,45 @@ function at(t) {
|
|
|
2815
2815
|
Z = e;
|
|
2816
2816
|
}
|
|
2817
2817
|
}
|
|
2818
|
-
Ee(
|
|
2818
|
+
Ee(ce, { ...tt, delete: (t) => new ce(t, { addons: [] }).delete(), exists: (t) => new ce(t, { addons: [] }).open().then((e) => (e.close(), !0)).catch("NoSuchDatabaseError", () => !1), getDatabaseNames(t) {
|
|
2819
2819
|
try {
|
|
2820
2820
|
return function({ indexedDB: e, IDBKeyRange: n }) {
|
|
2821
|
-
return
|
|
2822
|
-
}(
|
|
2821
|
+
return un(e) ? Promise.resolve(e.databases()).then((r) => r.map((s) => s.name).filter((s) => s !== vt)) : an(e, n).toCollection().primaryKeys();
|
|
2822
|
+
}(ce.dependencies).then(t);
|
|
2823
2823
|
} catch {
|
|
2824
|
-
return
|
|
2824
|
+
return $(new C.MissingAPI());
|
|
2825
2825
|
}
|
|
2826
2826
|
}, defineClass: () => function(t) {
|
|
2827
2827
|
U(this, t);
|
|
2828
|
-
}, ignoreTransaction: (t) => P.trans ? Te(P.transless, t) : t(), vip:
|
|
2828
|
+
}, ignoreTransaction: (t) => P.trans ? Te(P.transless, t) : t(), vip: Yt, async: function(t) {
|
|
2829
2829
|
return function() {
|
|
2830
2830
|
try {
|
|
2831
|
-
var e =
|
|
2831
|
+
var e = Gt(t.apply(this, arguments));
|
|
2832
2832
|
return e && typeof e.then == "function" ? e : S.resolve(e);
|
|
2833
2833
|
} catch (n) {
|
|
2834
|
-
return
|
|
2834
|
+
return $(n);
|
|
2835
2835
|
}
|
|
2836
2836
|
};
|
|
2837
2837
|
}, spawn: function(t, e, n) {
|
|
2838
2838
|
try {
|
|
2839
|
-
var r =
|
|
2839
|
+
var r = Gt(t.apply(n, e || []));
|
|
2840
2840
|
return r && typeof r.then == "function" ? r : S.resolve(r);
|
|
2841
2841
|
} catch (s) {
|
|
2842
|
-
return
|
|
2842
|
+
return $(s);
|
|
2843
2843
|
}
|
|
2844
2844
|
}, currentTransaction: { get: () => P.trans || null }, waitFor: function(t, e) {
|
|
2845
|
-
const n = S.resolve(typeof t == "function" ?
|
|
2845
|
+
const n = S.resolve(typeof t == "function" ? ce.ignoreTransaction(t) : t).timeout(e || 6e4);
|
|
2846
2846
|
return P.trans ? P.trans.waitFor(n) : n;
|
|
2847
2847
|
}, Promise: S, debug: { get: () => G, set: (t) => {
|
|
2848
|
-
|
|
2849
|
-
} }, derive: ke, extend: U, props: Ee, override:
|
|
2848
|
+
Kn(t, t === "dexie" ? () => !0 : zn);
|
|
2849
|
+
} }, derive: ke, extend: U, props: Ee, override: Pn, Events: De, on: ue, liveQuery: Jr, extendObservabilitySet: tr, getByKeyPath: te, setByKeyPath: H, delByKeyPath: function(t, e) {
|
|
2850
2850
|
typeof e == "string" ? H(t, e, void 0) : "length" in e && [].map.call(e, function(n) {
|
|
2851
2851
|
H(t, n, void 0);
|
|
2852
2852
|
});
|
|
2853
|
-
}, shallowClone:
|
|
2853
|
+
}, shallowClone: An, deepClone: We, getObjectDiff: ln, cmp: L, asap: Cn, minKey: Mt, addons: [], connections: Ne, errnames: tn, dependencies: Qt, semVer: gn, version: gn.split(".").map((t) => parseInt(t)).reduce((t, e, n) => t + e / Math.pow(10, 2 * n)) }), ce.maxKey = Ue(ce.dependencies.IDBKeyRange), typeof dispatchEvent < "u" && typeof addEventListener < "u" && (ue(Le, (t) => {
|
|
2854
2854
|
if (!Z) {
|
|
2855
2855
|
let e;
|
|
2856
|
-
|
|
2856
|
+
gt ? (e = document.createEvent("CustomEvent"), e.initCustomEvent(ie, !0, !0, t)) : e = new CustomEvent(ie, { detail: t }), Z = !0, dispatchEvent(e), Z = !1;
|
|
2857
2857
|
}
|
|
2858
2858
|
}), addEventListener(ie, ({ detail: t }) => {
|
|
2859
2859
|
Z || at(t);
|
|
@@ -2884,14 +2884,14 @@ if (typeof BroadcastChannel < "u") {
|
|
|
2884
2884
|
});
|
|
2885
2885
|
}
|
|
2886
2886
|
S.rejectionMapper = function(t, e) {
|
|
2887
|
-
if (!t || t instanceof xe || t instanceof TypeError || t instanceof SyntaxError || !t.name || !
|
|
2887
|
+
if (!t || t instanceof xe || t instanceof TypeError || t instanceof SyntaxError || !t.name || !fn[t.name])
|
|
2888
2888
|
return t;
|
|
2889
|
-
var n = new
|
|
2889
|
+
var n = new fn[t.name](e || t.message, t);
|
|
2890
2890
|
return "stack" in t && ee(n, "stack", { get: function() {
|
|
2891
2891
|
return this.inner.stack;
|
|
2892
2892
|
} }), n;
|
|
2893
|
-
},
|
|
2894
|
-
class
|
|
2893
|
+
}, Kn(G, zn);
|
|
2894
|
+
class Zr extends pe {
|
|
2895
2895
|
constructor() {
|
|
2896
2896
|
super("NylasAuthDatabase"), ut(this, "grant"), ut(this, "pkce"), this.version(1).stores({
|
|
2897
2897
|
grant: "++id,token",
|
|
@@ -2899,9 +2899,9 @@ class ns extends pe {
|
|
|
2899
2899
|
}), this.grant = this.table("grant"), this.pkce = this.table("pkce");
|
|
2900
2900
|
}
|
|
2901
2901
|
}
|
|
2902
|
-
class
|
|
2902
|
+
class es {
|
|
2903
2903
|
constructor() {
|
|
2904
|
-
ut(this, "theDB"), this.theDB = new
|
|
2904
|
+
ut(this, "theDB"), this.theDB = new Zr();
|
|
2905
2905
|
}
|
|
2906
2906
|
async setCodeVerifier(e) {
|
|
2907
2907
|
await this.theDB.pkce.put({ id: 1, codeVerifier: e }, 1);
|
|
@@ -2921,12 +2921,12 @@ class rs {
|
|
|
2921
2921
|
await this.theDB.grant.clear();
|
|
2922
2922
|
}
|
|
2923
2923
|
}
|
|
2924
|
-
function
|
|
2924
|
+
function is(t) {
|
|
2925
2925
|
const e = "NylasAuth";
|
|
2926
2926
|
if (!t)
|
|
2927
2927
|
throw new Error("NylasAuth requires a config object");
|
|
2928
2928
|
let n = null;
|
|
2929
|
-
if (t.storageType === "indexeddb" && (n = new
|
|
2929
|
+
if (t.storageType === "indexeddb" && (n = new es()), !n)
|
|
2930
2930
|
throw new Error("NylasAuth requires a storage object");
|
|
2931
2931
|
const r = [
|
|
2932
2932
|
{
|
|
@@ -2979,18 +2979,18 @@ function ms(t) {
|
|
|
2979
2979
|
value: "offline_access"
|
|
2980
2980
|
}
|
|
2981
2981
|
];
|
|
2982
|
-
async function i(o, u, a,
|
|
2983
|
-
const d = await (n == null ? void 0 : n.getTokenInfo()),
|
|
2984
|
-
|
|
2985
|
-
const
|
|
2982
|
+
async function i(o, u, a, c = !0, h, l) {
|
|
2983
|
+
const d = await (n == null ? void 0 : n.getTokenInfo()), f = new URL(o, h ?? t.apiUri), m = new Headers();
|
|
2984
|
+
m.append("Accept", "application/json"), m.append("Content-Type", "application/json"), m.append("User-Agent", e), d && m.append("Authorization", `Bearer ${d.access_token}`);
|
|
2985
|
+
const p = await fetch(f.toString(), {
|
|
2986
2986
|
method: u || "GET",
|
|
2987
|
-
headers:
|
|
2987
|
+
headers: m,
|
|
2988
2988
|
mode: "cors",
|
|
2989
2989
|
referrer: location.origin,
|
|
2990
2990
|
body: a ? JSON.stringify(a) : void 0,
|
|
2991
|
-
...
|
|
2991
|
+
...l || {}
|
|
2992
2992
|
});
|
|
2993
|
-
return
|
|
2993
|
+
return c ? await p.json() : p.body;
|
|
2994
2994
|
}
|
|
2995
2995
|
return {
|
|
2996
2996
|
config: t,
|
|
@@ -3002,10 +3002,10 @@ function ms(t) {
|
|
|
3002
3002
|
* @returns A promise that resolves to a URL string that can be used to redirect the user to the Nylas API to complete the authorization flow
|
|
3003
3003
|
*/
|
|
3004
3004
|
async getHostedAuthRedirectURL(o = t.defaultScopes, u, a) {
|
|
3005
|
-
const
|
|
3006
|
-
await (n == null ? void 0 : n.setCodeVerifier(
|
|
3007
|
-
const
|
|
3008
|
-
return
|
|
3005
|
+
const c = await dn(Math.random().toString()), h = await dn(c);
|
|
3006
|
+
await (n == null ? void 0 : n.setCodeVerifier(c));
|
|
3007
|
+
const l = new URL(`${t.apiUri}/v3/connect/auth`);
|
|
3008
|
+
return l.searchParams.set("client_id", t.clientId), l.searchParams.set("response_type", "code"), l.searchParams.set("scope", o.join(" ")), l.searchParams.set("redirect_uri", t.redirectURI), l.searchParams.set("access_type", "offline"), l.searchParams.set("code_challenge", h), l.searchParams.set("code_challenge_method", "S256"), l.searchParams.set("options", "rotate_refresh_token"), a && l.searchParams.set("provider", a), u && l.searchParams.set("login_hint", u), l.toString();
|
|
3009
3009
|
},
|
|
3010
3010
|
/**
|
|
3011
3011
|
* This method will make a request to the Nylas API to exchange an authorization code for an access token.
|
|
@@ -3038,10 +3038,10 @@ function ms(t) {
|
|
|
3038
3038
|
* This method will make a `application/octet-stream` request to the Nylas API to download a file.
|
|
3039
3039
|
*/
|
|
3040
3040
|
async nylasDownloadFileRequest(o, u = "GET", a) {
|
|
3041
|
-
const
|
|
3042
|
-
return
|
|
3041
|
+
const c = await (n == null ? void 0 : n.getTokenInfo()), h = new URL(o, t.apiUri), l = new Headers();
|
|
3042
|
+
return l.append("Accept", "application/json"), l.append("Content-Type", "application/octet-stream"), l.append("User-Agent", e), c && l.append("Authorization", `Bearer ${c.access_token}`), (await fetch(h.toString(), {
|
|
3043
3043
|
method: u,
|
|
3044
|
-
headers:
|
|
3044
|
+
headers: l,
|
|
3045
3045
|
mode: "cors",
|
|
3046
3046
|
referrer: location.origin,
|
|
3047
3047
|
body: a ? JSON.stringify(a) : void 0
|
|
@@ -3104,10 +3104,10 @@ function ms(t) {
|
|
|
3104
3104
|
const a = await (n == null ? void 0 : n.getTokenInfo());
|
|
3105
3105
|
if (!a)
|
|
3106
3106
|
return !1;
|
|
3107
|
-
const
|
|
3107
|
+
const c = a.scope.toLowerCase().split(" ");
|
|
3108
3108
|
let h = [];
|
|
3109
|
-
const
|
|
3110
|
-
return o === "email" && (h = [...s, ...r].filter((d) =>
|
|
3109
|
+
const l = Array.isArray(u) ? u : [u];
|
|
3110
|
+
return o === "email" && (h = [...s, ...r].filter((d) => l.includes(d.type))), h.every((d) => c.includes(d.value));
|
|
3111
3111
|
},
|
|
3112
3112
|
/**
|
|
3113
3113
|
* A helper method to check if the current access token has a given scope.
|
|
@@ -3119,115 +3119,15 @@ function ms(t) {
|
|
|
3119
3119
|
if (!u)
|
|
3120
3120
|
return !1;
|
|
3121
3121
|
const a = u.scope.toLowerCase().split(" ");
|
|
3122
|
-
return (Array.isArray(o) ? o : [o]).some((
|
|
3122
|
+
return (Array.isArray(o) ? o : [o]).some((c) => a.includes(c.toLowerCase()));
|
|
3123
3123
|
}
|
|
3124
3124
|
};
|
|
3125
3125
|
}
|
|
3126
|
-
const ss = (t, e, n) => {
|
|
3127
|
-
const r = t.get(e);
|
|
3128
|
-
r ? r.includes(n) || r.push(n) : t.set(e, [n]);
|
|
3129
|
-
}, is = (t, e) => {
|
|
3130
|
-
let n;
|
|
3131
|
-
return (...r) => {
|
|
3132
|
-
n && clearTimeout(n), n = setTimeout(() => {
|
|
3133
|
-
n = 0, t(...r);
|
|
3134
|
-
}, e);
|
|
3135
|
-
};
|
|
3136
|
-
}, os = (t) => !("isConnected" in t) || t.isConnected, Tn = is((t) => {
|
|
3137
|
-
for (let e of t.keys())
|
|
3138
|
-
t.set(e, t.get(e).filter(os));
|
|
3139
|
-
}, 2e3), as = () => {
|
|
3140
|
-
if (typeof fn != "function")
|
|
3141
|
-
return {};
|
|
3142
|
-
const t = /* @__PURE__ */ new Map();
|
|
3143
|
-
return {
|
|
3144
|
-
dispose: () => t.clear(),
|
|
3145
|
-
get: (e) => {
|
|
3146
|
-
const n = fn();
|
|
3147
|
-
n && ss(t, e, n);
|
|
3148
|
-
},
|
|
3149
|
-
set: (e) => {
|
|
3150
|
-
const n = t.get(e);
|
|
3151
|
-
n && t.set(e, n.filter(pn)), Tn(t);
|
|
3152
|
-
},
|
|
3153
|
-
reset: () => {
|
|
3154
|
-
t.forEach((e) => e.forEach(pn)), Tn(t);
|
|
3155
|
-
}
|
|
3156
|
-
};
|
|
3157
|
-
}, Ct = (t) => typeof t == "function" ? t() : t, us = (t, e = (n, r) => n !== r) => {
|
|
3158
|
-
const n = Ct(t);
|
|
3159
|
-
let r = new Map(Object.entries(n ?? {}));
|
|
3160
|
-
const s = {
|
|
3161
|
-
dispose: [],
|
|
3162
|
-
get: [],
|
|
3163
|
-
set: [],
|
|
3164
|
-
reset: []
|
|
3165
|
-
}, i = () => {
|
|
3166
|
-
var p;
|
|
3167
|
-
r = new Map(Object.entries((p = Ct(t)) !== null && p !== void 0 ? p : {})), s.reset.forEach((f) => f());
|
|
3168
|
-
}, o = () => {
|
|
3169
|
-
s.dispose.forEach((p) => p()), i();
|
|
3170
|
-
}, u = (p) => (s.get.forEach((f) => f(p)), r.get(p)), a = (p, f) => {
|
|
3171
|
-
const y = r.get(p);
|
|
3172
|
-
e(f, y, p) && (r.set(p, f), s.set.forEach((g) => g(p, f, y)));
|
|
3173
|
-
}, l = typeof Proxy > "u" ? {} : new Proxy(n, {
|
|
3174
|
-
get(p, f) {
|
|
3175
|
-
return u(f);
|
|
3176
|
-
},
|
|
3177
|
-
ownKeys(p) {
|
|
3178
|
-
return Array.from(r.keys());
|
|
3179
|
-
},
|
|
3180
|
-
getOwnPropertyDescriptor() {
|
|
3181
|
-
return {
|
|
3182
|
-
enumerable: !0,
|
|
3183
|
-
configurable: !0
|
|
3184
|
-
};
|
|
3185
|
-
},
|
|
3186
|
-
has(p, f) {
|
|
3187
|
-
return r.has(f);
|
|
3188
|
-
},
|
|
3189
|
-
set(p, f, y) {
|
|
3190
|
-
return a(f, y), !0;
|
|
3191
|
-
}
|
|
3192
|
-
}), h = (p, f) => (s[p].push(f), () => {
|
|
3193
|
-
cs(s[p], f);
|
|
3194
|
-
});
|
|
3195
|
-
return {
|
|
3196
|
-
state: l,
|
|
3197
|
-
get: u,
|
|
3198
|
-
set: a,
|
|
3199
|
-
on: h,
|
|
3200
|
-
onChange: (p, f) => {
|
|
3201
|
-
const y = h("set", (v, b) => {
|
|
3202
|
-
v === p && f(b);
|
|
3203
|
-
}), g = h("reset", () => f(Ct(t)[p]));
|
|
3204
|
-
return () => {
|
|
3205
|
-
y(), g();
|
|
3206
|
-
};
|
|
3207
|
-
},
|
|
3208
|
-
use: (...p) => {
|
|
3209
|
-
const f = p.reduce((y, g) => (g.set && y.push(h("set", g.set)), g.get && y.push(h("get", g.get)), g.reset && y.push(h("reset", g.reset)), g.dispose && y.push(h("dispose", g.dispose)), y), []);
|
|
3210
|
-
return () => f.forEach((y) => y());
|
|
3211
|
-
},
|
|
3212
|
-
dispose: o,
|
|
3213
|
-
reset: i,
|
|
3214
|
-
forceUpdate: (p) => {
|
|
3215
|
-
const f = r.get(p);
|
|
3216
|
-
s.set.forEach((y) => y(p, f, f));
|
|
3217
|
-
}
|
|
3218
|
-
};
|
|
3219
|
-
}, cs = (t, e) => {
|
|
3220
|
-
const n = t.indexOf(e);
|
|
3221
|
-
n >= 0 && (t[n] = t[t.length - 1], t.length--);
|
|
3222
|
-
}, gs = (t, e) => {
|
|
3223
|
-
const n = us(t, e);
|
|
3224
|
-
return n.use(as()), n;
|
|
3225
|
-
};
|
|
3226
3126
|
export {
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3127
|
+
ns as N,
|
|
3128
|
+
rs as X,
|
|
3129
|
+
ss as Z,
|
|
3130
|
+
is as e,
|
|
3131
|
+
sr as g,
|
|
3132
|
+
ar as n
|
|
3233
3133
|
};
|