@septkit/ui 0.0.83 → 0.0.85
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/dialecte/create-document-store.js +4 -4
- package/dist/external/.pnpm/{@dialecte_core@0.10.0/node_modules/@dialecte/core/dist/dialecte-CVLWSkgW.js → @dialecte_core@0.11.0/node_modules/@dialecte/core/dist/dialecte-Cs_XRP4I.js} +281 -270
- package/dist/external/.pnpm/@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/index.js +6 -0
- package/dist/external/.pnpm/{@dialecte_core@0.10.0/node_modules/@dialecte/core/dist/running-operations-DCKvzlU7.js → @dialecte_core@0.11.0/node_modules/@dialecte/core/dist/open-connections-D59wm6nb.js} +33 -33
- package/dist/external/.pnpm/{@dialecte_core@0.10.0/node_modules/@dialecte/core/dist/project-key-2ccZ-0gu.js → @dialecte_core@0.11.0/node_modules/@dialecte/core/dist/project-key-sr4wkl2Q.js} +2 -1
- package/dist/external/.pnpm/{@dialecte_core@0.10.0 → @dialecte_core@0.11.0}/node_modules/@dialecte/core/dist/rolldown-runtime-CYdcPHCu.js +1 -1
- package/dist/external/.pnpm/{@dialecte_core@0.10.0/node_modules/@dialecte/core/dist/same-json-value-_AChwM_n.js → @dialecte_core@0.11.0/node_modules/@dialecte/core/dist/same-json-value-boJ4pSRe.js} +382 -192
- package/dist/external/.pnpm/{@dialecte_core@0.10.0 → @dialecte_core@0.11.0}/node_modules/@dialecte/core/dist/utils-Cv4oHia0.js +1 -1
- package/dist/external/.pnpm/@lucide_vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/loader-circle.js +8 -0
- package/dist/external/.pnpm/@vueuse_core@14.3.0_vue@3.5.39_typescript@5.8.3_/node_modules/@vueuse/core/dist/index.js +73 -73
- package/dist/external/.pnpm/@vueuse_shared@14.3.0_vue@3.5.39_typescript@5.8.3_/node_modules/@vueuse/shared/dist/index.js +172 -80
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/HoverCard/HoverCardContent.js +126 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/HoverCard/HoverCardContentImpl.js +170 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/HoverCard/HoverCardPortal.js +33 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/HoverCard/HoverCardRoot.js +73 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/HoverCard/HoverCardTrigger.js +64 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/HoverCard/utils.js +11 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Popover/PopoverContent.js +133 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Popover/PopoverContentImpl.js +165 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Popover/PopoverContentModal.js +137 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Popover/PopoverContentNonModal.js +130 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Popover/PopoverPortal.js +33 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Popover/PopoverRoot.js +54 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Popover/PopoverTrigger.js +55 -0
- package/dist/index.d.ts +89 -6
- package/dist/index.js +14 -9
- package/dist/status-bar/index.js +5 -0
- package/dist/status-bar/progress-bar.js +7 -0
- package/dist/status-bar/progress-bar.vue_vue_type_script_setup_true_lang.js +31 -0
- package/dist/status-bar/spinner.js +7 -0
- package/dist/status-bar/spinner.vue_vue_type_script_setup_true_lang.js +27 -0
- package/dist/status-bar/status-bar-item.js +8 -0
- package/dist/status-bar/status-bar-item.vue_vue_type_script_setup_true_lang.js +138 -0
- package/dist/status-bar/status-bar.js +7 -0
- package/dist/status-bar/status-bar.vue_vue_type_script_setup_true_lang.js +17 -0
- package/dist/ui.css +1 -1
- package/package.json +3 -3
- package/dist/external/.pnpm/@dialecte_core@0.10.0/node_modules/@dialecte/core/dist/index.js +0 -6
- /package/dist/external/.pnpm/{@dialecte_core@0.10.0 → @dialecte_core@0.11.0}/node_modules/@dialecte/core/dist/helpers-D8p0KiJu.js +0 -0
- /package/dist/external/.pnpm/{@dialecte_core@0.10.0 → @dialecte_core@0.11.0}/node_modules/@dialecte/core/dist/utils.js +0 -0
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { W as e } from "./utils-Cv4oHia0.js";
|
|
2
2
|
import { n as t, t as n } from "./rolldown-runtime-CYdcPHCu.js";
|
|
3
|
-
import { i as r, n as i, r as a, t as o } from "./
|
|
4
|
-
import { F as s, G as c, H as l, L as u, M as d, R as f, U as p, W as m, h, j as g, k as _, n as v, t as y, z as b } from "./project-key-
|
|
3
|
+
import { i as r, n as i, r as a, t as o } from "./open-connections-D59wm6nb.js";
|
|
4
|
+
import { F as s, G as c, H as l, L as u, M as d, R as f, U as p, W as m, h, j as g, k as _, n as v, t as y, z as b } from "./project-key-sr4wkl2Q.js";
|
|
5
5
|
import "./helpers-D8p0KiJu.js";
|
|
6
|
-
import {
|
|
7
|
-
//#region node_modules/.pnpm/@dialecte+core@0.
|
|
6
|
+
import { E as x, d as S, f as C, h as ee, i as w, m as te, n as T, p as E, r as ne, t as re, u as ie } from "./same-json-value-boJ4pSRe.js";
|
|
7
|
+
//#region node_modules/.pnpm/@dialecte+core@0.11.0/node_modules/@dialecte/core/dist/dialecte-Cs_XRP4I.js
|
|
8
8
|
async function ae(e) {
|
|
9
9
|
let { store: t, isRunning: n } = e, r = await t.getDocuments();
|
|
10
10
|
for (let e of r) e.status === "importing" && (await n?.(e) || (await t.getDocument(e.id))?.status === "importing" && await t.removeDocument(e.id));
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function D(e) {
|
|
13
13
|
let { held: t, registered: n } = e;
|
|
14
14
|
return !t || !n || t.status !== "importing" ? !1 : t.id === n.id && t.writeId === n.writeId && t.createdAt === n.createdAt;
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
o(), i();
|
|
17
|
+
var O = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
17
18
|
((n, r) => {
|
|
18
19
|
typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self).Dexie = r();
|
|
19
20
|
})(n, function() {
|
|
@@ -138,43 +139,43 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
138
139
|
return r[e];
|
|
139
140
|
}), te = new Set(w.map(function(e) {
|
|
140
141
|
return r[e];
|
|
141
|
-
})),
|
|
142
|
-
function
|
|
143
|
-
return
|
|
142
|
+
})), T = null;
|
|
143
|
+
function E(e) {
|
|
144
|
+
return T = /* @__PURE__ */ new WeakMap(), e = function e(t) {
|
|
144
145
|
if (!t || typeof t != "object") return t;
|
|
145
|
-
var n =
|
|
146
|
+
var n = T.get(t);
|
|
146
147
|
if (n) return n;
|
|
147
148
|
if (a(t)) {
|
|
148
|
-
n = [],
|
|
149
|
+
n = [], T.set(t, n);
|
|
149
150
|
for (var r = 0, i = t.length; r < i; ++r) n.push(e(t[r]));
|
|
150
151
|
} else if (te.has(t.constructor)) n = t;
|
|
151
152
|
else {
|
|
152
153
|
var o, c = s(t);
|
|
153
|
-
for (o in n = c === Object.prototype ? {} : Object.create(c),
|
|
154
|
+
for (o in n = c === Object.prototype ? {} : Object.create(c), T.set(t, n), t) l(t, o) && (n[o] = e(t[o]));
|
|
154
155
|
}
|
|
155
156
|
return n;
|
|
156
|
-
}(e),
|
|
157
|
+
}(e), T = null, e;
|
|
157
158
|
}
|
|
158
|
-
var
|
|
159
|
-
function
|
|
160
|
-
return
|
|
159
|
+
var ne = {}.toString;
|
|
160
|
+
function re(e) {
|
|
161
|
+
return ne.call(e).slice(8, -1);
|
|
161
162
|
}
|
|
162
|
-
var
|
|
163
|
+
var ie = typeof Symbol < "u" ? Symbol.iterator : "@@iterator", ae = typeof ie == "symbol" ? function(e) {
|
|
163
164
|
var t;
|
|
164
|
-
return e != null && (t = e[
|
|
165
|
+
return e != null && (t = e[ie]) && t.apply(e);
|
|
165
166
|
} : function() {
|
|
166
167
|
return null;
|
|
167
168
|
};
|
|
168
|
-
function
|
|
169
|
+
function D(e, t) {
|
|
169
170
|
t = e.indexOf(t), 0 <= t && e.splice(t, 1);
|
|
170
171
|
}
|
|
171
|
-
var
|
|
172
|
-
function
|
|
172
|
+
var O = {};
|
|
173
|
+
function k(e) {
|
|
173
174
|
var t, n, r, i;
|
|
174
175
|
if (arguments.length === 1) {
|
|
175
176
|
if (a(e)) return e.slice();
|
|
176
|
-
if (this ===
|
|
177
|
-
if (i =
|
|
177
|
+
if (this === O && typeof e == "string") return [e];
|
|
178
|
+
if (i = ae(e)) for (n = []; !(r = i.next()).done;) n.push(r.value);
|
|
178
179
|
else {
|
|
179
180
|
if (e == null || typeof (t = e.length) != "number") return [e];
|
|
180
181
|
for (n = Array(t); t--;) n[t] = e[t];
|
|
@@ -182,7 +183,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
182
183
|
} else for (t = arguments.length, n = Array(t); t--;) n[t] = arguments[t];
|
|
183
184
|
return n;
|
|
184
185
|
}
|
|
185
|
-
var
|
|
186
|
+
var oe = typeof Symbol < "u" ? function(e) {
|
|
186
187
|
return e[Symbol.toStringTag] === "AsyncFunction";
|
|
187
188
|
} : function() {
|
|
188
189
|
return !1;
|
|
@@ -201,7 +202,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
201
202
|
"QuotaExceeded",
|
|
202
203
|
"Syntax",
|
|
203
204
|
"DataClone"
|
|
204
|
-
],
|
|
205
|
+
], A = [
|
|
205
206
|
"Modify",
|
|
206
207
|
"Bulk",
|
|
207
208
|
"OpenFailed",
|
|
@@ -218,92 +219,92 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
218
219
|
"DatabaseClosed",
|
|
219
220
|
"PrematureCommit",
|
|
220
221
|
"ForeignAwait"
|
|
221
|
-
].concat(w),
|
|
222
|
+
].concat(w), se = {
|
|
222
223
|
VersionChanged: "Database version changed by other database connection",
|
|
223
224
|
DatabaseClosed: "Database has been closed",
|
|
224
225
|
Abort: "Transaction aborted",
|
|
225
226
|
TransactionInactive: "Transaction has already completed or failed",
|
|
226
227
|
MissingAPI: "IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"
|
|
227
228
|
};
|
|
228
|
-
function
|
|
229
|
+
function ce(e, t) {
|
|
229
230
|
this.name = e, this.message = t;
|
|
230
231
|
}
|
|
231
|
-
function
|
|
232
|
+
function le(e, t) {
|
|
232
233
|
return e + ". Errors: " + Object.keys(t).map(function(e) {
|
|
233
234
|
return t[e].toString();
|
|
234
235
|
}).filter(function(e, t, n) {
|
|
235
236
|
return n.indexOf(e) === t;
|
|
236
237
|
}).join("\n");
|
|
237
238
|
}
|
|
238
|
-
function
|
|
239
|
-
this.failures = t, this.failedKeys = r, this.successCount = n, this.message =
|
|
239
|
+
function ue(e, t, n, r) {
|
|
240
|
+
this.failures = t, this.failedKeys = r, this.successCount = n, this.message = le(e, t);
|
|
240
241
|
}
|
|
241
|
-
function
|
|
242
|
+
function de(e, t) {
|
|
242
243
|
this.name = "BulkError", this.failures = Object.keys(t).map(function(e) {
|
|
243
244
|
return t[e];
|
|
244
|
-
}), this.failuresByPos = t, this.message =
|
|
245
|
+
}), this.failuresByPos = t, this.message = le(e, this.failures);
|
|
245
246
|
}
|
|
246
|
-
p(
|
|
247
|
+
p(ce).from(Error).extend({ toString: function() {
|
|
247
248
|
return this.name + ": " + this.message;
|
|
248
|
-
} }), p(
|
|
249
|
-
var
|
|
249
|
+
} }), p(ue).from(ce), p(de).from(ce);
|
|
250
|
+
var fe = A.reduce(function(e, t) {
|
|
250
251
|
return e[t] = t + "Error", e;
|
|
251
|
-
}, {}),
|
|
252
|
+
}, {}), pe = ce, j = A.reduce(function(e, t) {
|
|
252
253
|
var n = t + "Error";
|
|
253
254
|
function r(e, r) {
|
|
254
|
-
this.name = n, e ? typeof e == "string" ? (this.message = `${e}${r ? "\n " + r : ""}`, this.inner = r || null) : typeof e == "object" && (this.message = `${e.name} ${e.message}`, this.inner = e) : (this.message =
|
|
255
|
+
this.name = n, e ? typeof e == "string" ? (this.message = `${e}${r ? "\n " + r : ""}`, this.inner = r || null) : typeof e == "object" && (this.message = `${e.name} ${e.message}`, this.inner = e) : (this.message = se[t] || n, this.inner = null);
|
|
255
256
|
}
|
|
256
|
-
return p(r).from(
|
|
257
|
-
}, {}),
|
|
258
|
-
return e[t + "Error"] =
|
|
257
|
+
return p(r).from(pe), e[t] = r, e;
|
|
258
|
+
}, {}), me = (j.Syntax = SyntaxError, j.Type = TypeError, j.Range = RangeError, w.reduce(function(e, t) {
|
|
259
|
+
return e[t + "Error"] = j[t], e;
|
|
259
260
|
}, {}));
|
|
260
|
-
w =
|
|
261
|
+
w = A.reduce(function(e, t) {
|
|
261
262
|
return [
|
|
262
263
|
"Syntax",
|
|
263
264
|
"Type",
|
|
264
265
|
"Range"
|
|
265
|
-
].indexOf(t) === -1 && (e[t + "Error"] =
|
|
266
|
+
].indexOf(t) === -1 && (e[t + "Error"] = j[t]), e;
|
|
266
267
|
}, {});
|
|
267
|
-
function
|
|
268
|
-
function
|
|
268
|
+
function M() {}
|
|
269
|
+
function N(e) {
|
|
269
270
|
return e;
|
|
270
271
|
}
|
|
271
|
-
function
|
|
272
|
-
return e == null || e ===
|
|
272
|
+
function he(e, t) {
|
|
273
|
+
return e == null || e === N ? t : function(n) {
|
|
273
274
|
return t(e(n));
|
|
274
275
|
};
|
|
275
276
|
}
|
|
276
|
-
function
|
|
277
|
+
function P(e, t) {
|
|
277
278
|
return function() {
|
|
278
279
|
e.apply(this, arguments), t.apply(this, arguments);
|
|
279
280
|
};
|
|
280
281
|
}
|
|
281
|
-
function
|
|
282
|
-
return e ===
|
|
282
|
+
function ge(e, t) {
|
|
283
|
+
return e === M ? t : function() {
|
|
283
284
|
var n = e.apply(this, arguments), r = (n !== void 0 && (arguments[0] = n), this.onsuccess), i = this.onerror, a = (this.onsuccess = null, this.onerror = null, t.apply(this, arguments));
|
|
284
|
-
return r && (this.onsuccess = this.onsuccess ?
|
|
285
|
+
return r && (this.onsuccess = this.onsuccess ? P(r, this.onsuccess) : r), i && (this.onerror = this.onerror ? P(i, this.onerror) : i), a === void 0 ? n : a;
|
|
285
286
|
};
|
|
286
287
|
}
|
|
287
|
-
function
|
|
288
|
-
return e ===
|
|
288
|
+
function _e(e, t) {
|
|
289
|
+
return e === M ? t : function() {
|
|
289
290
|
e.apply(this, arguments);
|
|
290
291
|
var n = this.onsuccess, r = this.onerror;
|
|
291
|
-
this.onsuccess = this.onerror = null, t.apply(this, arguments), n && (this.onsuccess = this.onsuccess ?
|
|
292
|
+
this.onsuccess = this.onerror = null, t.apply(this, arguments), n && (this.onsuccess = this.onsuccess ? P(n, this.onsuccess) : n), r && (this.onerror = this.onerror ? P(r, this.onerror) : r);
|
|
292
293
|
};
|
|
293
294
|
}
|
|
294
|
-
function
|
|
295
|
-
return e ===
|
|
295
|
+
function ve(e, t) {
|
|
296
|
+
return e === M ? t : function() {
|
|
296
297
|
var n = e.apply(this, arguments), r = (o(arguments[0], n), this.onsuccess), i = this.onerror, a = (this.onsuccess = null, this.onerror = null, t.apply(this, arguments));
|
|
297
|
-
return r && (this.onsuccess = this.onsuccess ?
|
|
298
|
+
return r && (this.onsuccess = this.onsuccess ? P(r, this.onsuccess) : r), i && (this.onerror = this.onerror ? P(i, this.onerror) : i), n === void 0 ? a === void 0 ? void 0 : a : o(n, a);
|
|
298
299
|
};
|
|
299
300
|
}
|
|
300
|
-
function
|
|
301
|
-
return e ===
|
|
301
|
+
function ye(e, t) {
|
|
302
|
+
return e === M ? t : function() {
|
|
302
303
|
return !1 !== t.apply(this, arguments) && e.apply(this, arguments);
|
|
303
304
|
};
|
|
304
305
|
}
|
|
305
|
-
function
|
|
306
|
-
return e ===
|
|
306
|
+
function be(e, t) {
|
|
307
|
+
return e === M ? t : function() {
|
|
307
308
|
var n = e.apply(this, arguments);
|
|
308
309
|
if (n && typeof n.then == "function") {
|
|
309
310
|
for (var r = this, i = arguments.length, a = Array(i); i--;) a[i] = arguments[i];
|
|
@@ -314,37 +315,37 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
314
315
|
return t.apply(this, arguments);
|
|
315
316
|
};
|
|
316
317
|
}
|
|
317
|
-
w.ModifyError =
|
|
318
|
-
var
|
|
319
|
-
function
|
|
320
|
-
|
|
318
|
+
w.ModifyError = ue, w.DexieError = ce, w.BulkError = de;
|
|
319
|
+
var F = typeof location < "u" && /^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);
|
|
320
|
+
function xe(e) {
|
|
321
|
+
F = e;
|
|
321
322
|
}
|
|
322
|
-
var
|
|
323
|
+
var Se = {}, Ce = 100, we = typeof Promise > "u" ? [] : (A = Promise.resolve(), typeof crypto < "u" && crypto.subtle ? [
|
|
323
324
|
we = crypto.subtle.digest("SHA-512", new Uint8Array([0])),
|
|
324
325
|
s(we),
|
|
325
|
-
|
|
326
|
+
A
|
|
326
327
|
] : [
|
|
327
|
-
|
|
328
|
-
s(
|
|
329
|
-
|
|
330
|
-
]),
|
|
328
|
+
A,
|
|
329
|
+
s(A),
|
|
330
|
+
A
|
|
331
|
+
]), A = we[0], Te = we[1], Te = Te && Te.then, I = A && A.constructor, Ee = !!we[2], De = function(e, t) {
|
|
331
332
|
Ne.push([e, t]), ke &&= (queueMicrotask(He), !1);
|
|
332
|
-
}, Oe = !0, ke = !0, Ae = [], je = [], Me =
|
|
333
|
+
}, Oe = !0, ke = !0, Ae = [], je = [], Me = N, L = {
|
|
333
334
|
id: "global",
|
|
334
335
|
global: !0,
|
|
335
336
|
ref: 0,
|
|
336
337
|
unhandleds: [],
|
|
337
|
-
onunhandled:
|
|
338
|
+
onunhandled: M,
|
|
338
339
|
pgp: !1,
|
|
339
340
|
env: {},
|
|
340
|
-
finalize:
|
|
341
|
+
finalize: M
|
|
341
342
|
}, R = L, Ne = [], Pe = 0, Fe = [];
|
|
342
343
|
function z(e) {
|
|
343
344
|
if (typeof this != "object") throw TypeError("Promises must be constructed via new");
|
|
344
345
|
this._listeners = [], this._lib = !1;
|
|
345
346
|
var t = this._PSD = R;
|
|
346
347
|
if (typeof e != "function") {
|
|
347
|
-
if (e !==
|
|
348
|
+
if (e !== Se) throw TypeError("Not a function");
|
|
348
349
|
this._state = arguments[1], this._value = arguments[2], !1 === this._state && Re(this, this._value);
|
|
349
350
|
} else this._state = null, this._value = null, ++t.ref, function e(t, n) {
|
|
350
351
|
try {
|
|
@@ -371,10 +372,10 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
371
372
|
});
|
|
372
373
|
return this._consoleTask && (s._consoleTask = this._consoleTask), s;
|
|
373
374
|
}
|
|
374
|
-
return n.prototype =
|
|
375
|
+
return n.prototype = Se, n;
|
|
375
376
|
},
|
|
376
377
|
set: function(e) {
|
|
377
|
-
f(this, "then", e && e.prototype ===
|
|
378
|
+
f(this, "then", e && e.prototype === Se ? Ie : {
|
|
378
379
|
get: function() {
|
|
379
380
|
return e;
|
|
380
381
|
},
|
|
@@ -415,7 +416,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
415
416
|
function Ve(e, t, n) {
|
|
416
417
|
try {
|
|
417
418
|
var r, i = t._value;
|
|
418
|
-
!t._state && je.length && (je = []), r =
|
|
419
|
+
!t._state && je.length && (je = []), r = F && t._consoleTask ? t._consoleTask.run(function() {
|
|
419
420
|
return e(i);
|
|
420
421
|
}) : e(i), t._state || je.indexOf(i) !== -1 || ((e) => {
|
|
421
422
|
for (var t = Ae.length; t;) if (Ae[--t]._value === e._value) return Ae.splice(t, 1);
|
|
@@ -451,7 +452,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
451
452
|
}), Fe.slice(0)), n = t.length; n;) t[--n]();
|
|
452
453
|
}
|
|
453
454
|
function Ke(e) {
|
|
454
|
-
return new z(
|
|
455
|
+
return new z(Se, !1, e);
|
|
455
456
|
}
|
|
456
457
|
function B(e, t) {
|
|
457
458
|
var n = R;
|
|
@@ -494,14 +495,14 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
494
495
|
var n = this;
|
|
495
496
|
return e < Infinity ? new z(function(r, i) {
|
|
496
497
|
var a = setTimeout(function() {
|
|
497
|
-
return i(new
|
|
498
|
+
return i(new j.Timeout(t));
|
|
498
499
|
}, e);
|
|
499
500
|
n.then(r, i).finally(clearTimeout.bind(null, a));
|
|
500
501
|
}) : this;
|
|
501
502
|
}
|
|
502
503
|
}), typeof Symbol < "u" && Symbol.toStringTag && f(z.prototype, Symbol.toStringTag, "Dexie.Promise"), L.env = it(), u(z, {
|
|
503
504
|
all: function() {
|
|
504
|
-
var e =
|
|
505
|
+
var e = k.apply(null, arguments).map(tt);
|
|
505
506
|
return new z(function(t, n) {
|
|
506
507
|
e.length === 0 && t([]);
|
|
507
508
|
var r = e.length;
|
|
@@ -515,11 +516,11 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
515
516
|
resolve: function(e) {
|
|
516
517
|
return e instanceof z ? e : e && typeof e.then == "function" ? new z(function(t, n) {
|
|
517
518
|
e.then(t, n);
|
|
518
|
-
}) : new z(
|
|
519
|
+
}) : new z(Se, !0, e);
|
|
519
520
|
},
|
|
520
521
|
reject: Ke,
|
|
521
522
|
race: function() {
|
|
522
|
-
var e =
|
|
523
|
+
var e = k.apply(null, arguments).map(tt);
|
|
523
524
|
return new z(function(t, n) {
|
|
524
525
|
e.map(function(e) {
|
|
525
526
|
return z.resolve(e).then(t, n);
|
|
@@ -559,7 +560,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
559
560
|
return new z(function(n, r) {
|
|
560
561
|
return Qe(function(t, n) {
|
|
561
562
|
var r = R;
|
|
562
|
-
r.unhandleds = [], r.onunhandled = n, r.finalize =
|
|
563
|
+
r.unhandleds = [], r.onunhandled = n, r.finalize = P(function() {
|
|
563
564
|
var e, r = this;
|
|
564
565
|
e = function() {
|
|
565
566
|
r.unhandleds.length === 0 ? t() : n(r.unhandleds[0]);
|
|
@@ -573,7 +574,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
573
574
|
});
|
|
574
575
|
}
|
|
575
576
|
}), I && (I.allSettled && f(z, "allSettled", function() {
|
|
576
|
-
var e =
|
|
577
|
+
var e = k.apply(null, arguments).map(tt);
|
|
577
578
|
return new z(function(t) {
|
|
578
579
|
e.length === 0 && t([]);
|
|
579
580
|
var n = e.length, r = Array(n);
|
|
@@ -594,7 +595,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
594
595
|
});
|
|
595
596
|
});
|
|
596
597
|
}), I.any && typeof AggregateError < "u" && f(z, "any", function() {
|
|
597
|
-
var e =
|
|
598
|
+
var e = k.apply(null, arguments).map(tt);
|
|
598
599
|
return new z(function(t, n) {
|
|
599
600
|
e.length === 0 && n(/* @__PURE__ */ AggregateError([]));
|
|
600
601
|
var r = e.length, i = Array(r);
|
|
@@ -689,7 +690,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
689
690
|
function st(e) {
|
|
690
691
|
Promise === I && V.echoes === 0 ? Ye === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
|
|
691
692
|
}
|
|
692
|
-
("" + Te).indexOf("[native code]") === -1 && ($e = et =
|
|
693
|
+
("" + Te).indexOf("[native code]") === -1 && ($e = et = M);
|
|
693
694
|
var H = z.reject, ct = "", U = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", lt = "String expected.", ut = "__dbnames", dt = "readonly", ft = "readwrite";
|
|
694
695
|
function pt(e, t) {
|
|
695
696
|
return e ? t ? function() {
|
|
@@ -707,11 +708,11 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
707
708
|
return typeof e != "string" || /\./.test(e) ? function(e) {
|
|
708
709
|
return e;
|
|
709
710
|
} : function(t) {
|
|
710
|
-
return t[e] === void 0 && e in t && delete (t =
|
|
711
|
+
return t[e] === void 0 && e in t && delete (t = E(t))[e], t;
|
|
711
712
|
};
|
|
712
713
|
}
|
|
713
714
|
function gt() {
|
|
714
|
-
throw
|
|
715
|
+
throw j.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.");
|
|
715
716
|
}
|
|
716
717
|
function W(e, t) {
|
|
717
718
|
try {
|
|
@@ -736,7 +737,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
736
737
|
}
|
|
737
738
|
function _t(e) {
|
|
738
739
|
var t = typeof e;
|
|
739
|
-
return t == "object" && (ArrayBuffer.isView(e) || (t =
|
|
740
|
+
return t == "object" && (ArrayBuffer.isView(e) || (t = re(e)) === "ArrayBuffer") ? "binary" : t;
|
|
740
741
|
}
|
|
741
742
|
function vt(e) {
|
|
742
743
|
return e instanceof Uint8Array ? e : ArrayBuffer.isView(e) ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : new Uint8Array(e);
|
|
@@ -791,10 +792,10 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
791
792
|
return a;
|
|
792
793
|
}
|
|
793
794
|
G.prototype._trans = function(e, t, n) {
|
|
794
|
-
var r = this._tx || R.trans, i = this.name, a =
|
|
795
|
+
var r = this._tx || R.trans, i = this.name, a = F && typeof console < "u" && console.createTask && console.createTask(`Dexie: ${e === "readonly" ? "read" : "write"} ${this.name}`);
|
|
795
796
|
function o(e, n, r) {
|
|
796
797
|
if (r.schema[i]) return t(r.idbtrans, r);
|
|
797
|
-
throw new
|
|
798
|
+
throw new j.NotFound("Table " + i + " not part of transaction");
|
|
798
799
|
}
|
|
799
800
|
var s = Ue();
|
|
800
801
|
try {
|
|
@@ -809,7 +810,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
809
810
|
try {
|
|
810
811
|
a.create(), t._state.PR1398_maxLoop = 3;
|
|
811
812
|
} catch (a) {
|
|
812
|
-
return a.name ===
|
|
813
|
+
return a.name === fe.InvalidState && t.isOpen() && 0 < --t._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), t.close({ disableAutoOpen: !1 }), t.open().then(function() {
|
|
813
814
|
return e(t, n, r, i);
|
|
814
815
|
})) : H(a);
|
|
815
816
|
}
|
|
@@ -826,10 +827,10 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
826
827
|
});
|
|
827
828
|
});
|
|
828
829
|
}
|
|
829
|
-
if (t._state.openComplete) return H(new
|
|
830
|
+
if (t._state.openComplete) return H(new j.DatabaseClosed(t._state.dbOpenError));
|
|
830
831
|
if (!t._state.isBeingOpened) {
|
|
831
|
-
if (!t._state.autoOpen) return H(new
|
|
832
|
-
t.open().catch(
|
|
832
|
+
if (!t._state.autoOpen) return H(new j.DatabaseClosed());
|
|
833
|
+
t.open().catch(M);
|
|
833
834
|
}
|
|
834
835
|
return t._state.dbReadyPromise.then(function() {
|
|
835
836
|
return e(t, n, r, i);
|
|
@@ -843,7 +844,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
843
844
|
}
|
|
844
845
|
}, G.prototype.get = function(e, t) {
|
|
845
846
|
var n = this;
|
|
846
|
-
return e && e.constructor === Object ? this.where(e).first(t) : e == null ? H(new
|
|
847
|
+
return e && e.constructor === Object ? this.where(e).first(t) : e == null ? H(new j.Type("Invalid argument to Table.get()")) : this._trans("readonly", function(t) {
|
|
847
848
|
return n.core.get({
|
|
848
849
|
trans: t,
|
|
849
850
|
key: e
|
|
@@ -870,7 +871,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
870
871
|
if (n && this.db._maxKey !== ct) return s = n.keyPath.slice(0, t.length), this.where(s).equals(s.map(function(t) {
|
|
871
872
|
return e[t];
|
|
872
873
|
}));
|
|
873
|
-
!n &&
|
|
874
|
+
!n && F && console.warn(`The query ${JSON.stringify(e)} on ${this.name} would benefit from a compound index [${t.join("+")}]`);
|
|
874
875
|
var r = this.schema.idxByName;
|
|
875
876
|
function o(e, t) {
|
|
876
877
|
return W(e, t) === 0;
|
|
@@ -980,7 +981,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
980
981
|
});
|
|
981
982
|
});
|
|
982
983
|
}, G.prototype.update = function(e, t) {
|
|
983
|
-
return typeof e != "object" || a(e) ? this.where(":id").equals(e).modify(t) : (e = b(e, this.schema.primKey.keyPath)) === void 0 ? H(new
|
|
984
|
+
return typeof e != "object" || a(e) ? this.where(":id").equals(e).modify(t) : (e = b(e, this.schema.primKey.keyPath)) === void 0 ? H(new j.InvalidArgument("Given object does not contain its primary key")) : this.where(":id").equals(e).modify(t);
|
|
984
985
|
}, G.prototype.put = function(e, t) {
|
|
985
986
|
var n = this, r = this.schema.primKey, i = r.auto, a = r.keyPath, o = e;
|
|
986
987
|
return a && i && (o = ht(a)(e)), this._trans("readwrite", function(e) {
|
|
@@ -1040,8 +1041,8 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
1040
1041
|
var r = this, i = Array.isArray(t) ? t : void 0, a = (n ||= i ? void 0 : t) ? n.allKeys : void 0;
|
|
1041
1042
|
return this._trans("readwrite", function(t) {
|
|
1042
1043
|
var n = r.schema.primKey, o = n.auto, n = n.keyPath;
|
|
1043
|
-
if (n && i) throw new
|
|
1044
|
-
if (i && i.length !== e.length) throw new
|
|
1044
|
+
if (n && i) throw new j.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
|
|
1045
|
+
if (i && i.length !== e.length) throw new j.InvalidArgument("Arguments objects and keys must have the same length");
|
|
1045
1046
|
var s = e.length, o = n && o ? e.map(ht(n)) : e;
|
|
1046
1047
|
return r.core.mutate({
|
|
1047
1048
|
trans: t,
|
|
@@ -1052,15 +1053,15 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
1052
1053
|
}).then(function(e) {
|
|
1053
1054
|
var t = e.numFailures, n = e.failures;
|
|
1054
1055
|
if (t === 0) return a ? e.results : e.lastResult;
|
|
1055
|
-
throw new
|
|
1056
|
+
throw new de(`${r.name}.bulkAdd(): ${t} of ${s} operations failed`, n);
|
|
1056
1057
|
});
|
|
1057
1058
|
});
|
|
1058
1059
|
}, G.prototype.bulkPut = function(e, t, n) {
|
|
1059
1060
|
var r = this, i = Array.isArray(t) ? t : void 0, a = (n ||= i ? void 0 : t) ? n.allKeys : void 0;
|
|
1060
1061
|
return this._trans("readwrite", function(t) {
|
|
1061
1062
|
var n = r.schema.primKey, o = n.auto, n = n.keyPath;
|
|
1062
|
-
if (n && i) throw new
|
|
1063
|
-
if (i && i.length !== e.length) throw new
|
|
1063
|
+
if (n && i) throw new j.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
|
|
1064
|
+
if (i && i.length !== e.length) throw new j.InvalidArgument("Arguments objects and keys must have the same length");
|
|
1064
1065
|
var s = e.length, o = n && o ? e.map(ht(n)) : e;
|
|
1065
1066
|
return r.core.mutate({
|
|
1066
1067
|
trans: t,
|
|
@@ -1071,7 +1072,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
1071
1072
|
}).then(function(e) {
|
|
1072
1073
|
var t = e.numFailures, n = e.failures;
|
|
1073
1074
|
if (t === 0) return a ? e.results : e.lastResult;
|
|
1074
|
-
throw new
|
|
1075
|
+
throw new de(`${r.name}.bulkPut(): ${t} of ${s} operations failed`, n);
|
|
1075
1076
|
});
|
|
1076
1077
|
});
|
|
1077
1078
|
}, G.prototype.bulkUpdate = function(e) {
|
|
@@ -1092,7 +1093,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
1092
1093
|
for (var u = 0, d = Object.keys(i); u < d.length; u++) {
|
|
1093
1094
|
var f = d[u], p = i[f];
|
|
1094
1095
|
if (f === t.schema.primKey.keyPath) {
|
|
1095
|
-
if (W(p, r) !== 0) throw new
|
|
1096
|
+
if (W(p, r) !== 0) throw new j.Constraint("Cannot update primary key in bulkUpdate()");
|
|
1096
1097
|
} else x(o, f, p);
|
|
1097
1098
|
}
|
|
1098
1099
|
a.push(n), c.push(r), l.push(o);
|
|
@@ -1114,7 +1115,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
1114
1115
|
var s, c = o[i], l = a[Number(c)];
|
|
1115
1116
|
l != null && (s = r[c], delete r[c], r[l] = s);
|
|
1116
1117
|
}
|
|
1117
|
-
throw new
|
|
1118
|
+
throw new de(`${t.name}.bulkUpdate(): ${n} of ${u} operations failed`, r);
|
|
1118
1119
|
});
|
|
1119
1120
|
});
|
|
1120
1121
|
});
|
|
@@ -1131,7 +1132,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
1131
1132
|
}).then(function(e) {
|
|
1132
1133
|
var r = e.numFailures, i = e.failures;
|
|
1133
1134
|
if (r === 0) return e.lastResult;
|
|
1134
|
-
throw new
|
|
1135
|
+
throw new de(`${t.name}.bulkDelete(): ${r} of ${n} operations failed`, i);
|
|
1135
1136
|
});
|
|
1136
1137
|
};
|
|
1137
1138
|
var Ct = G;
|
|
@@ -1150,9 +1151,9 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
1150
1151
|
return t;
|
|
1151
1152
|
function s(e, r, o) {
|
|
1152
1153
|
var c, l;
|
|
1153
|
-
if (typeof e != "object") return r ||=
|
|
1154
|
+
if (typeof e != "object") return r ||= ye, l = {
|
|
1154
1155
|
subscribers: [],
|
|
1155
|
-
fire: o ||=
|
|
1156
|
+
fire: o ||= M,
|
|
1156
1157
|
subscribe: function(e) {
|
|
1157
1158
|
l.subscribers.indexOf(e) === -1 && (l.subscribers.push(e), l.fire = r(l.fire, e));
|
|
1158
1159
|
},
|
|
@@ -1166,8 +1167,8 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
1166
1167
|
var t = c[e];
|
|
1167
1168
|
if (a(t)) s(e, c[e][0], c[e][1]);
|
|
1168
1169
|
else {
|
|
1169
|
-
if (t !== "asap") throw new
|
|
1170
|
-
var n = s(e,
|
|
1170
|
+
if (t !== "asap") throw new j.InvalidArgument("Invalid event config");
|
|
1171
|
+
var n = s(e, N, function() {
|
|
1171
1172
|
for (var e = arguments.length, t = Array(e); e--;) t[e] = arguments[e];
|
|
1172
1173
|
n.subscribers.forEach(function(e) {
|
|
1173
1174
|
y(function() {
|
|
@@ -1198,7 +1199,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
1198
1199
|
if (e.isPrimKey) return t.primaryKey;
|
|
1199
1200
|
var n = t.getIndexByKeyPath(e.index);
|
|
1200
1201
|
if (n) return n;
|
|
1201
|
-
throw new
|
|
1202
|
+
throw new j.Schema("KeyPath " + e.index + " on object store " + t.name + " is not indexed");
|
|
1202
1203
|
}
|
|
1203
1204
|
function At(e, t, n) {
|
|
1204
1205
|
var r = kt(e, t.schema);
|
|
@@ -1236,9 +1237,9 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
1236
1237
|
t && !t(e, function(e) {
|
|
1237
1238
|
return n = e;
|
|
1238
1239
|
}, function(t) {
|
|
1239
|
-
e.stop(t), n =
|
|
1240
|
+
e.stop(t), n = M;
|
|
1240
1241
|
}, function(t) {
|
|
1241
|
-
e.fail(t), n =
|
|
1242
|
+
e.fail(t), n = M;
|
|
1242
1243
|
}) || i(e.value, e, function(e) {
|
|
1243
1244
|
return n = e;
|
|
1244
1245
|
}), n();
|
|
@@ -1444,7 +1445,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
1444
1445
|
var _ = [], v = [], y = l ? [] : null, b = h ? m : [];
|
|
1445
1446
|
if (!h) for (var x = 0; x < p; ++x) {
|
|
1446
1447
|
var S = g[x], C = {
|
|
1447
|
-
value:
|
|
1448
|
+
value: E(S),
|
|
1448
1449
|
primKey: t[f + x]
|
|
1449
1450
|
};
|
|
1450
1451
|
!1 !== o.call(C, C.value, C) && (C.value == null ? b.push(t[f + x]) : l || W(u(S), u(C.value)) === 0 ? (v.push(C.value), l && y.push(t[f + x])) : (b.push(t[f + x]), _.push(C.value)));
|
|
@@ -1490,7 +1491,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
1490
1491
|
range: n.range
|
|
1491
1492
|
};
|
|
1492
1493
|
return i(0).then(function() {
|
|
1493
|
-
if (0 < f.length) throw new
|
|
1494
|
+
if (0 < f.length) throw new ue("Error modifying one or more objects", f, p, m);
|
|
1494
1495
|
return t.length;
|
|
1495
1496
|
});
|
|
1496
1497
|
});
|
|
@@ -1512,7 +1513,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
1512
1513
|
range: i
|
|
1513
1514
|
}).then(function(e) {
|
|
1514
1515
|
var n = e.failures, e = e.numFailures;
|
|
1515
|
-
if (e) throw new
|
|
1516
|
+
if (e) throw new ue("Could not delete some values", Object.keys(n).map(function(e) {
|
|
1516
1517
|
return n[e];
|
|
1517
1518
|
}), t - e);
|
|
1518
1519
|
return t - e;
|
|
@@ -1659,19 +1660,19 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
1659
1660
|
return e === t[0];
|
|
1660
1661
|
}, [e], "");
|
|
1661
1662
|
}, J.prototype.anyOfIgnoreCase = function() {
|
|
1662
|
-
var e =
|
|
1663
|
+
var e = k.apply(O, arguments);
|
|
1663
1664
|
return e.length === 0 ? Lt(this) : Rt(this, function(e, t) {
|
|
1664
1665
|
return t.indexOf(e) !== -1;
|
|
1665
1666
|
}, e, "");
|
|
1666
1667
|
}, J.prototype.startsWithAnyOfIgnoreCase = function() {
|
|
1667
|
-
var e =
|
|
1668
|
+
var e = k.apply(O, arguments);
|
|
1668
1669
|
return e.length === 0 ? Lt(this) : Rt(this, function(e, t) {
|
|
1669
1670
|
return t.some(function(t) {
|
|
1670
1671
|
return e.indexOf(t) === 0;
|
|
1671
1672
|
});
|
|
1672
1673
|
}, e, ct);
|
|
1673
1674
|
}, J.prototype.anyOf = function() {
|
|
1674
|
-
var e, t, n = this, r =
|
|
1675
|
+
var e, t, n = this, r = k.apply(O, arguments), i = this._cmp;
|
|
1675
1676
|
try {
|
|
1676
1677
|
r.sort(i);
|
|
1677
1678
|
} catch {
|
|
@@ -1693,7 +1694,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
1693
1694
|
includeUppers: !1
|
|
1694
1695
|
});
|
|
1695
1696
|
}, J.prototype.noneOf = function() {
|
|
1696
|
-
var e =
|
|
1697
|
+
var e = k.apply(O, arguments);
|
|
1697
1698
|
if (e.length === 0) return new this.Collection(this);
|
|
1698
1699
|
try {
|
|
1699
1700
|
e.sort(this._ascending);
|
|
@@ -1712,7 +1713,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
1712
1713
|
if (e.length === 0) return Lt(this);
|
|
1713
1714
|
if (!e.every(function(e) {
|
|
1714
1715
|
return e[0] !== void 0 && e[1] !== void 0 && i(e[0], e[1]) <= 0;
|
|
1715
|
-
})) return q(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",
|
|
1716
|
+
})) return q(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", j.InvalidArgument);
|
|
1716
1717
|
var c = !t || !1 !== t.includeLowers, l = t && !0 === t.includeUppers, u, d = i;
|
|
1717
1718
|
function f(e, t) {
|
|
1718
1719
|
return d(e[0], t[0]);
|
|
@@ -1751,7 +1752,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
1751
1752
|
}), !1);
|
|
1752
1753
|
}), t;
|
|
1753
1754
|
}, J.prototype.startsWithAnyOf = function() {
|
|
1754
|
-
var e =
|
|
1755
|
+
var e = k.apply(O, arguments);
|
|
1755
1756
|
return e.every(function(e) {
|
|
1756
1757
|
return typeof e == "string";
|
|
1757
1758
|
}) ? e.length === 0 ? Lt(this) : this.inAnyRange(e.map(function(e) {
|
|
@@ -1785,15 +1786,15 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
1785
1786
|
if (this.mode) {
|
|
1786
1787
|
var n = this.db.idbdb, r = this.db._state.dbOpenError;
|
|
1787
1788
|
if (v(!this.idbtrans), !e && !n) switch (r && r.name) {
|
|
1788
|
-
case "DatabaseClosedError": throw new
|
|
1789
|
-
case "MissingAPIError": throw new
|
|
1790
|
-
default: throw new
|
|
1789
|
+
case "DatabaseClosedError": throw new j.DatabaseClosed(r);
|
|
1790
|
+
case "MissingAPIError": throw new j.MissingAPI(r.message, r);
|
|
1791
|
+
default: throw new j.OpenFailed(r);
|
|
1791
1792
|
}
|
|
1792
|
-
if (!this.active) throw new
|
|
1793
|
+
if (!this.active) throw new j.TransactionInactive();
|
|
1793
1794
|
v(this._completion._state === null), (e = this.idbtrans = e || (this.db.core || n).transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability })).onerror = B(function(n) {
|
|
1794
1795
|
Ht(n), t._reject(e.error);
|
|
1795
1796
|
}), e.onabort = B(function(n) {
|
|
1796
|
-
Ht(n), t.active && t._reject(new
|
|
1797
|
+
Ht(n), t.active && t._reject(new j.Abort(e.error)), t.active = !1, t.on("abort").fire(n);
|
|
1797
1798
|
}), e.oncomplete = B(function() {
|
|
1798
1799
|
t.active = !1, t._resolve(), "mutatedParts" in e && Gt.storagemutated.fire(e.mutatedParts);
|
|
1799
1800
|
});
|
|
@@ -1801,7 +1802,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
1801
1802
|
return this;
|
|
1802
1803
|
}, X.prototype._promise = function(e, t, n) {
|
|
1803
1804
|
var r, i = this;
|
|
1804
|
-
return e === "readwrite" && this.mode !== "readwrite" ? H(new
|
|
1805
|
+
return e === "readwrite" && this.mode !== "readwrite" ? H(new j.ReadOnly("Transaction is readonly")) : this.active ? this._locked() ? new z(function(r, a) {
|
|
1805
1806
|
i._blockedFuncs.push([function() {
|
|
1806
1807
|
i._promise(e, t, n).then(r, a);
|
|
1807
1808
|
}, R]);
|
|
@@ -1817,7 +1818,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
1817
1818
|
}) : ((r = new z(function(e, n) {
|
|
1818
1819
|
var r = t(e, n, i);
|
|
1819
1820
|
r && r.then && r.then(e, n);
|
|
1820
|
-
}))._lib = !0, r) : H(new
|
|
1821
|
+
}))._lib = !0, r) : H(new j.TransactionInactive());
|
|
1821
1822
|
}, X.prototype._root = function() {
|
|
1822
1823
|
return this.parent ? this.parent._root() : this;
|
|
1823
1824
|
}, X.prototype.waitFor = function(e) {
|
|
@@ -1837,13 +1838,13 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
1837
1838
|
});
|
|
1838
1839
|
});
|
|
1839
1840
|
}, X.prototype.abort = function() {
|
|
1840
|
-
this.active && (this.active = !1, this.idbtrans && this.idbtrans.abort(), this._reject(new
|
|
1841
|
+
this.active && (this.active = !1, this.idbtrans && this.idbtrans.abort(), this._reject(new j.Abort()));
|
|
1841
1842
|
}, X.prototype.table = function(e) {
|
|
1842
1843
|
var t = this._memoizedTables ||= {};
|
|
1843
1844
|
if (l(t, e)) return t[e];
|
|
1844
1845
|
var n = this.schema[e];
|
|
1845
1846
|
if (n) return (n = new this.db.Table(e, n, this)).core = this.db.core.table(e), t[e] = n;
|
|
1846
|
-
throw new
|
|
1847
|
+
throw new j.NotFound("Table " + e + " not part of transaction");
|
|
1847
1848
|
}, X);
|
|
1848
1849
|
function X() {}
|
|
1849
1850
|
function qt(e, t, n, r, i, a, o, s) {
|
|
@@ -2169,7 +2170,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
2169
2170
|
var t, n, o, l = u, d = e._cfg.dbschema, f = (hn(r, l, c), hn(r, d, c), u = r._dbSchema = d, un(l, d)), p = (f.add.forEach(function(e) {
|
|
2170
2171
|
dn(c, e[0], e[1].primKey, e[1].indexes);
|
|
2171
2172
|
}), f.change.forEach(function(e) {
|
|
2172
|
-
if (e.recreate) throw new
|
|
2173
|
+
if (e.recreate) throw new j.Upgrade("Not yet support for changing primary key");
|
|
2173
2174
|
var t = c.objectStore(e.name);
|
|
2174
2175
|
e.add.forEach(function(e) {
|
|
2175
2176
|
return pn(t, e);
|
|
@@ -2181,7 +2182,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
2181
2182
|
}), e._cfg.contentUpgrade);
|
|
2182
2183
|
if (p && e._cfg.version > a) return rn(r, c), s._memoizedTables = {}, t = S(d), f.del.forEach(function(e) {
|
|
2183
2184
|
t[e] = l[e];
|
|
2184
|
-
}), on(r, [r.Transaction.prototype]), an(r, [r.Transaction.prototype], i(t), t), s.schema = t, (n =
|
|
2185
|
+
}), on(r, [r.Transaction.prototype]), an(r, [r.Transaction.prototype], i(t), t), s.schema = t, (n = oe(p)) && $e(), d = z.follow(function() {
|
|
2185
2186
|
var e;
|
|
2186
2187
|
(o = p(s)) && n && (e = et.bind(null, null), o.then(e, e));
|
|
2187
2188
|
}), o && typeof o.then == "function" ? z.resolve(o) : d.then(function() {
|
|
@@ -2220,7 +2221,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
2220
2221
|
if (e.change.length || e.recreate) return console.warn(`Unable to patch indexes of table ${e.name} because it has changes on the type of index or primary key.`), { value: void 0 };
|
|
2221
2222
|
var n = t.objectStore(e.name);
|
|
2222
2223
|
e.add.forEach(function(t) {
|
|
2223
|
-
|
|
2224
|
+
F && console.debug(`Dexie upgrade patch: Creating missing index ${e.name}.${t.src}`), pn(n, t);
|
|
2224
2225
|
});
|
|
2225
2226
|
})(i[r]);
|
|
2226
2227
|
if (typeof a == "object") return a.value;
|
|
@@ -2269,7 +2270,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
2269
2270
|
}
|
|
2270
2271
|
function fn(e, t) {
|
|
2271
2272
|
i(e).forEach(function(n) {
|
|
2272
|
-
t.db.objectStoreNames.contains(n) || (
|
|
2273
|
+
t.db.objectStoreNames.contains(n) || (F && console.debug("Dexie: Creating missing table", n), dn(t, n, e[n].primKey, e[n].indexes));
|
|
2273
2274
|
});
|
|
2274
2275
|
}
|
|
2275
2276
|
function pn(e, t) {
|
|
@@ -2310,11 +2311,11 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
2310
2311
|
i(e).forEach(function(r) {
|
|
2311
2312
|
if (e[r] !== null) {
|
|
2312
2313
|
var i = n._parseIndexSyntax(e[r]), a = i.shift();
|
|
2313
|
-
if (!a) throw new
|
|
2314
|
-
if (a.unique = !0, a.multi) throw new
|
|
2314
|
+
if (!a) throw new j.Schema("Invalid schema for table " + r + ": " + e[r]);
|
|
2315
|
+
if (a.unique = !0, a.multi) throw new j.Schema("Primary key cannot be multiEntry*");
|
|
2315
2316
|
i.forEach(function(e) {
|
|
2316
|
-
if (e.auto) throw new
|
|
2317
|
-
if (!e.keyPath) throw new
|
|
2317
|
+
if (e.auto) throw new j.Schema("Only primary key can be marked as autoIncrement (++)");
|
|
2318
|
+
if (!e.keyPath) throw new j.Schema("Index must have a name and cannot be an empty string");
|
|
2318
2319
|
}), a = n._createTableSchema(r, a, i), t[r] = a;
|
|
2319
2320
|
}
|
|
2320
2321
|
});
|
|
@@ -2333,7 +2334,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
2333
2334
|
this._cfg.tables
|
|
2334
2335
|
], i(r), r), t._storeNames = i(r), this;
|
|
2335
2336
|
}, vn.prototype.upgrade = function(e) {
|
|
2336
|
-
return this._cfg.contentUpgrade =
|
|
2337
|
+
return this._cfg.contentUpgrade = be(this._cfg.contentUpgrade || M, e), this;
|
|
2337
2338
|
};
|
|
2338
2339
|
var _n = vn;
|
|
2339
2340
|
function vn() {}
|
|
@@ -2497,7 +2498,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
2497
2498
|
return t[n] && En(t[n], e[n]);
|
|
2498
2499
|
});
|
|
2499
2500
|
}
|
|
2500
|
-
u(Z.prototype, ((
|
|
2501
|
+
u(Z.prototype, ((A = {
|
|
2501
2502
|
add: function(e) {
|
|
2502
2503
|
return Tn(this, e), this;
|
|
2503
2504
|
},
|
|
@@ -2514,9 +2515,9 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
2514
2515
|
var t = Dn(this).next(e).value;
|
|
2515
2516
|
return t && W(t.from, e) <= 0 && 0 <= W(t.to, e);
|
|
2516
2517
|
}
|
|
2517
|
-
})[
|
|
2518
|
+
})[ie] = function() {
|
|
2518
2519
|
return Dn(this);
|
|
2519
|
-
},
|
|
2520
|
+
}, A));
|
|
2520
2521
|
var Mn = {}, Nn = {}, Pn = !1;
|
|
2521
2522
|
function Fn(e) {
|
|
2522
2523
|
An(Nn, e), Pn || (Pn = !0, setTimeout(function() {
|
|
@@ -2558,17 +2559,17 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
2558
2559
|
t.isBeingOpened = !0, t.dbOpenError = null, t.openComplete = !1;
|
|
2559
2560
|
var r = t.openCanceller, a = Math.round(10 * e.verno), o = !1;
|
|
2560
2561
|
function s() {
|
|
2561
|
-
if (t.openCanceller !== r) throw new
|
|
2562
|
+
if (t.openCanceller !== r) throw new j.DatabaseClosed("db.open() was cancelled");
|
|
2562
2563
|
}
|
|
2563
2564
|
function c() {
|
|
2564
2565
|
return new z(function(r, l) {
|
|
2565
|
-
if (s(), !n) throw new
|
|
2566
|
+
if (s(), !n) throw new j.MissingAPI();
|
|
2566
2567
|
var u = e.name, p = t.autoSchema || !a ? n.open(u) : n.open(u, a);
|
|
2567
|
-
if (!p) throw new
|
|
2568
|
+
if (!p) throw new j.MissingAPI();
|
|
2568
2569
|
p.onerror = Y(l), p.onblocked = B(e._fireOnBlocked), p.onupgradeneeded = B(function(r) {
|
|
2569
2570
|
var i;
|
|
2570
2571
|
d = p.transaction, t.autoSchema && !e._options.allowEmptyDB ? (p.onerror = Ht, d.abort(), p.result.close(), (i = n.deleteDatabase(u)).onsuccess = i.onerror = B(function() {
|
|
2571
|
-
l(new
|
|
2572
|
+
l(new j.NoSuchDatabase(`Database ${u} doesnt exist`));
|
|
2572
2573
|
})) : (d.onerror = Y(l), i = r.oldVersion > 2 ** 62 ? 0 : r.oldVersion, f = i < 1, e.idbdb = p.result, o && ln(e, d), cn(e, i / 10, d, l));
|
|
2573
2574
|
}, l), p.onsuccess = B(function() {
|
|
2574
2575
|
d = null;
|
|
@@ -2585,7 +2586,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
2585
2586
|
t.vcFired = !0, e.on("versionchange").fire(n);
|
|
2586
2587
|
}), v.onclose = B(function() {
|
|
2587
2588
|
e.close({ disableAutoOpen: !1 });
|
|
2588
|
-
}), f && (y = e._deps, h = u, xn(_ = y.indexedDB) || h === ut || bn(_, y.IDBKeyRange).put({ name: h }).catch(
|
|
2589
|
+
}), f && (y = e._deps, h = u, xn(_ = y.indexedDB) || h === ut || bn(_, y.IDBKeyRange).put({ name: h }).catch(M)), r();
|
|
2589
2590
|
}, l);
|
|
2590
2591
|
}).catch(function(e) {
|
|
2591
2592
|
switch (e?.name) {
|
|
@@ -2610,7 +2611,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
2610
2611
|
return e.on.ready.fire(e.vip);
|
|
2611
2612
|
})).then(function n() {
|
|
2612
2613
|
var r;
|
|
2613
|
-
if (0 < t.onReadyBeingFired.length) return r = t.onReadyBeingFired.reduce(
|
|
2614
|
+
if (0 < t.onReadyBeingFired.length) return r = t.onReadyBeingFired.reduce(be, M), t.onReadyBeingFired = [], z.resolve(Sn(function() {
|
|
2614
2615
|
return r(e.vip);
|
|
2615
2616
|
})).then(n);
|
|
2616
2617
|
});
|
|
@@ -2739,7 +2740,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
2739
2740
|
function Hn(e, t, n, r) {
|
|
2740
2741
|
return n ||= {}, r ||= "", i(e).forEach(function(i) {
|
|
2741
2742
|
var a, o, s;
|
|
2742
|
-
l(t, i) ? (a = e[i], o = t[i], typeof a == "object" && typeof o == "object" && a && o ? (s =
|
|
2743
|
+
l(t, i) ? (a = e[i], o = t[i], typeof a == "object" && typeof o == "object" && a && o ? (s = re(a)) === re(o) ? s === "Object" ? Hn(a, o, n, r + i + ".") : a !== o && (n[r + i] = t[i]) : n[r + i] = t[i] : a !== o && (n[r + i] = t[i])) : n[r + i] = void 0;
|
|
2743
2744
|
}), i(t).forEach(function(i) {
|
|
2744
2745
|
l(e, i) || (n[r + i] = t[i]);
|
|
2745
2746
|
}), n;
|
|
@@ -2758,22 +2759,22 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
2758
2759
|
var o = R.trans, s = o.table(r).hook, c = s.deleting, u = s.creating, d = s.updating;
|
|
2759
2760
|
switch (e.type) {
|
|
2760
2761
|
case "add":
|
|
2761
|
-
if (u.fire ===
|
|
2762
|
+
if (u.fire === M) break;
|
|
2762
2763
|
return o._promise("readwrite", function() {
|
|
2763
2764
|
return f(e);
|
|
2764
2765
|
}, !0);
|
|
2765
2766
|
case "put":
|
|
2766
|
-
if (u.fire ===
|
|
2767
|
+
if (u.fire === M && d.fire === M) break;
|
|
2767
2768
|
return o._promise("readwrite", function() {
|
|
2768
2769
|
return f(e);
|
|
2769
2770
|
}, !0);
|
|
2770
2771
|
case "delete":
|
|
2771
|
-
if (c.fire ===
|
|
2772
|
+
if (c.fire === M) break;
|
|
2772
2773
|
return o._promise("readwrite", function() {
|
|
2773
2774
|
return f(e);
|
|
2774
2775
|
}, !0);
|
|
2775
2776
|
case "deleteRange":
|
|
2776
|
-
if (c.fire ===
|
|
2777
|
+
if (c.fire === M) break;
|
|
2777
2778
|
return o._promise("readwrite", function() {
|
|
2778
2779
|
return function e(n, r, o) {
|
|
2779
2780
|
return i.query({
|
|
@@ -2847,7 +2848,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
2847
2848
|
function Gn(e, t, n) {
|
|
2848
2849
|
try {
|
|
2849
2850
|
if (!t || t.keys.length < e.length) return null;
|
|
2850
|
-
for (var r = [], i = 0, a = 0; i < t.keys.length && a < e.length; ++i) W(t.keys[i], e[a]) === 0 && (r.push(n ?
|
|
2851
|
+
for (var r = [], i = 0, a = 0; i < t.keys.length && a < e.length; ++i) W(t.keys[i], e[a]) === 0 && (r.push(n ? E(t.values[i]) : t.values[i]), ++a);
|
|
2851
2852
|
return r.length === e.length ? r : null;
|
|
2852
2853
|
} catch {
|
|
2853
2854
|
return null;
|
|
@@ -2865,7 +2866,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
2865
2866
|
return e.cache ? (t = Gn(e.keys, e.trans._cache, e.cache === "clone")) ? z.resolve(t) : r.getMany(e).then(function(t) {
|
|
2866
2867
|
return e.trans._cache = {
|
|
2867
2868
|
keys: e.keys,
|
|
2868
|
-
values: e.cache === "clone" ?
|
|
2869
|
+
values: e.cache === "clone" ? E(t) : t
|
|
2869
2870
|
}, t;
|
|
2870
2871
|
}) : r.getMany(e);
|
|
2871
2872
|
},
|
|
@@ -2896,7 +2897,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
2896
2897
|
var n = e.schema.name, r = new Z(e.MIN_KEY, e.MAX_KEY);
|
|
2897
2898
|
return t(t({}, e), {
|
|
2898
2899
|
transaction: function(t, n, r) {
|
|
2899
|
-
if (R.subscr && n !== "readonly") throw new
|
|
2900
|
+
if (R.subscr && n !== "readonly") throw new j.ReadOnly(`Readwrite transaction in liveQuery context. Querier source: ${R.querier}`);
|
|
2900
2901
|
return e.transaction(t, n, r);
|
|
2901
2902
|
},
|
|
2902
2903
|
table: function(o) {
|
|
@@ -3086,7 +3087,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
3086
3087
|
e.subscribers.add(n), r.addEventListener("abort", function() {
|
|
3087
3088
|
var r, i;
|
|
3088
3089
|
e.subscribers.delete(n), e.subscribers.size === 0 && (r = e, i = t, setTimeout(function() {
|
|
3089
|
-
r.subscribers.size === 0 &&
|
|
3090
|
+
r.subscribers.size === 0 && D(i, r);
|
|
3090
3091
|
}, 3e3));
|
|
3091
3092
|
});
|
|
3092
3093
|
}
|
|
@@ -3108,16 +3109,16 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
3108
3109
|
var f = e.table(u), p = d.optimisticOps.filter(function(e) {
|
|
3109
3110
|
return e.trans === s;
|
|
3110
3111
|
});
|
|
3111
|
-
if (s._explicit && i && s.mutatedParts) for (var m = 0, h = Object.values(d.queries.query); m < h.length; m++) for (var g = 0, _ = (b = h[m]).slice(); g < _.length; g++) jn((x = _[g]).obsSet, s.mutatedParts) && (
|
|
3112
|
+
if (s._explicit && i && s.mutatedParts) for (var m = 0, h = Object.values(d.queries.query); m < h.length; m++) for (var g = 0, _ = (b = h[m]).slice(); g < _.length; g++) jn((x = _[g]).obsSet, s.mutatedParts) && (D(b, x), x.subscribers.forEach(function(e) {
|
|
3112
3113
|
return o.add(e);
|
|
3113
3114
|
}));
|
|
3114
3115
|
else if (0 < p.length) {
|
|
3115
3116
|
d.optimisticOps = d.optimisticOps.filter(function(e) {
|
|
3116
3117
|
return e.trans !== s;
|
|
3117
3118
|
});
|
|
3118
|
-
for (var v = 0, y = Object.values(d.queries.query); v < y.length; v++) for (var b, x, S, C = 0, ee = (b = y[v]).slice(); C < ee.length; C++) (x = ee[C]).res != null && s.mutatedParts && (i && !x.dirty ? (S = Object.isFrozen(x.res), S = Qn(x.res, x.req, p, f, x, S), x.dirty ? (
|
|
3119
|
+
for (var v = 0, y = Object.values(d.queries.query); v < y.length; v++) for (var b, x, S, C = 0, ee = (b = y[v]).slice(); C < ee.length; C++) (x = ee[C]).res != null && s.mutatedParts && (i && !x.dirty ? (S = Object.isFrozen(x.res), S = Qn(x.res, x.req, p, f, x, S), x.dirty ? (D(b, x), x.subscribers.forEach(function(e) {
|
|
3119
3120
|
return o.add(e);
|
|
3120
|
-
})) : S !== x.res && (x.res = S, x.promise = z.resolve({ result: S }))) : (x.dirty &&
|
|
3121
|
+
})) : S !== x.res && (x.res = S, x.promise = z.resolve({ result: S }))) : (x.dirty && D(b, x), x.subscribers.forEach(function(e) {
|
|
3121
3122
|
return o.add(e);
|
|
3122
3123
|
})));
|
|
3123
3124
|
}
|
|
@@ -3138,13 +3139,13 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
3138
3139
|
return !a.outbound && s.db._options.cache !== "disabled" && !s.explicit && s.idbtrans.mode === "readwrite" && (o = Mn[`idb://${n}/${r}`]) ? (s = i.mutate(e), e.type !== "add" && e.type !== "put" || !(50 <= e.values.length || Un(a, e).some(function(e) {
|
|
3139
3140
|
return e == null;
|
|
3140
3141
|
})) ? (o.optimisticOps.push(e), e.mutatedParts && Fn(e.mutatedParts), s.then(function(t) {
|
|
3141
|
-
0 < t.numFailures && (
|
|
3142
|
+
0 < t.numFailures && (D(o.optimisticOps, e), (t = Xn(0, e, t)) && o.optimisticOps.push(t), e.mutatedParts) && Fn(e.mutatedParts);
|
|
3142
3143
|
}), s.catch(function() {
|
|
3143
|
-
|
|
3144
|
+
D(o.optimisticOps, e), e.mutatedParts && Fn(e.mutatedParts);
|
|
3144
3145
|
})) : s.then(function(n) {
|
|
3145
3146
|
var r = Xn(0, t(t({}, e), { values: e.values.map(function(e, r) {
|
|
3146
3147
|
var i;
|
|
3147
|
-
return n.failures[r] ? e : (x(i = (i = a.keyPath) != null && i.includes(".") ?
|
|
3148
|
+
return n.failures[r] ? e : (x(i = (i = a.keyPath) != null && i.includes(".") ? E(e) : t({}, e), a.keyPath, n.results[r]), i);
|
|
3148
3149
|
}) }), n);
|
|
3149
3150
|
o.optimisticOps.push(r), queueMicrotask(function() {
|
|
3150
3151
|
return e.mutatedParts && Fn(e.mutatedParts);
|
|
@@ -3193,7 +3194,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
3193
3194
|
}
|
|
3194
3195
|
return e;
|
|
3195
3196
|
}).catch(function(e) {
|
|
3196
|
-
return c && u &&
|
|
3197
|
+
return c && u && D(c, u), Promise.reject(e);
|
|
3197
3198
|
}), u = {
|
|
3198
3199
|
obsSet: e.obsSet,
|
|
3199
3200
|
promise: l,
|
|
@@ -3210,7 +3211,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
3210
3211
|
optimisticOps: [],
|
|
3211
3212
|
unsignaledParts: {}
|
|
3212
3213
|
}).queries.query[e.query.index.name || ""] = c)), tr(u, c, a, o), u.promise.then(function(n) {
|
|
3213
|
-
return n = Qn(n.result, e, s?.optimisticOps, i, u, t), { result: t ? n :
|
|
3214
|
+
return n = Qn(n.result, e, s?.optimisticOps, i, u, t), { result: t ? n : E(n) };
|
|
3214
3215
|
})) : i.query(e);
|
|
3215
3216
|
}
|
|
3216
3217
|
});
|
|
@@ -3224,8 +3225,8 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
3224
3225
|
} });
|
|
3225
3226
|
}
|
|
3226
3227
|
$.prototype.version = function(e) {
|
|
3227
|
-
if (isNaN(e) || e < .1) throw new
|
|
3228
|
-
if (e = Math.round(10 * e) / 10, this.idbdb || this._state.isBeingOpened) throw new
|
|
3228
|
+
if (isNaN(e) || e < .1) throw new j.Type("Given version is not a positive number");
|
|
3229
|
+
if (e = Math.round(10 * e) / 10, this.idbdb || this._state.isBeingOpened) throw new j.Schema("Cannot add version when database is open");
|
|
3229
3230
|
this.verno = Math.max(this.verno, e);
|
|
3230
3231
|
var t = this._versions, n = t.filter(function(t) {
|
|
3231
3232
|
return t._cfg.version === e;
|
|
@@ -3234,10 +3235,10 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
3234
3235
|
}, $.prototype._whenReady = function(e) {
|
|
3235
3236
|
var t = this;
|
|
3236
3237
|
return this.idbdb && (this._state.openComplete || R.letThrough || this._vip) ? e() : new z(function(e, n) {
|
|
3237
|
-
if (t._state.openComplete) return n(new
|
|
3238
|
+
if (t._state.openComplete) return n(new j.DatabaseClosed(t._state.dbOpenError));
|
|
3238
3239
|
if (!t._state.isBeingOpened) {
|
|
3239
|
-
if (!t._state.autoOpen) return void n(new
|
|
3240
|
-
t.open().catch(
|
|
3240
|
+
if (!t._state.autoOpen) return void n(new j.DatabaseClosed());
|
|
3241
|
+
t.open().catch(M);
|
|
3241
3242
|
}
|
|
3242
3243
|
t._state.dbReadyPromise.then(e, n);
|
|
3243
3244
|
}).then(e);
|
|
@@ -3280,7 +3281,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
3280
3281
|
}));
|
|
3281
3282
|
}, $.prototype.close = function(e) {
|
|
3282
3283
|
var e = (e === void 0 ? { disableAutoOpen: !0 } : e).disableAutoOpen, t = this._state;
|
|
3283
|
-
e ? (t.isBeingOpened && t.cancelOpen(new
|
|
3284
|
+
e ? (t.isBeingOpened && t.cancelOpen(new j.DatabaseClosed()), this._close(), t.autoOpen = !1, t.dbOpenError = new j.DatabaseClosed()) : (this._close(), t.autoOpen = this._options.autoOpen || t.isBeingOpened, t.openComplete = !1, t.dbOpenError = null);
|
|
3284
3285
|
}, $.prototype.delete = function(e) {
|
|
3285
3286
|
var t = this, n = (e === void 0 && (e = { disableAutoOpen: !0 }), 0 < arguments.length && typeof arguments[0] != "object"), r = this._state;
|
|
3286
3287
|
return new z(function(i, a) {
|
|
@@ -3289,10 +3290,10 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
3289
3290
|
var n = t._deps.indexedDB.deleteDatabase(t.name);
|
|
3290
3291
|
n.onsuccess = B(function() {
|
|
3291
3292
|
var e = t._deps, n = t.name, r;
|
|
3292
|
-
xn(r = e.indexedDB) || n === ut || bn(r, e.IDBKeyRange).delete(n).catch(
|
|
3293
|
+
xn(r = e.indexedDB) || n === ut || bn(r, e.IDBKeyRange).delete(n).catch(M), i();
|
|
3293
3294
|
}), n.onerror = Y(a), n.onblocked = t._fireOnBlocked;
|
|
3294
3295
|
}
|
|
3295
|
-
if (n) throw new
|
|
3296
|
+
if (n) throw new j.InvalidArgument("Invalid closeOptions argument to db.delete()");
|
|
3296
3297
|
r.isBeingOpened ? r.dbReadyPromise.then(o) : o();
|
|
3297
3298
|
});
|
|
3298
3299
|
}, $.prototype.backendDB = function() {
|
|
@@ -3318,7 +3319,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
3318
3319
|
}), $.prototype.transaction = function() {
|
|
3319
3320
|
var e = function(e, t, n) {
|
|
3320
3321
|
var r = arguments.length;
|
|
3321
|
-
if (r < 2) throw new
|
|
3322
|
+
if (r < 2) throw new j.InvalidArgument("Too few arguments");
|
|
3322
3323
|
for (var i = Array(r - 1); --r;) i[r - 1] = arguments[r];
|
|
3323
3324
|
return n = i.pop(), [
|
|
3324
3325
|
e,
|
|
@@ -3336,17 +3337,17 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
3336
3337
|
return e;
|
|
3337
3338
|
}), e == "r" || e === dt) r = dt;
|
|
3338
3339
|
else {
|
|
3339
|
-
if (e != "rw" && e != ft) throw new
|
|
3340
|
+
if (e != "rw" && e != ft) throw new j.InvalidArgument("Invalid transaction mode: " + e);
|
|
3340
3341
|
r = ft;
|
|
3341
3342
|
}
|
|
3342
3343
|
if (o) {
|
|
3343
3344
|
if (o.mode === dt && r === ft) {
|
|
3344
|
-
if (!s) throw new
|
|
3345
|
+
if (!s) throw new j.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");
|
|
3345
3346
|
o = null;
|
|
3346
3347
|
}
|
|
3347
3348
|
o && i.forEach(function(e) {
|
|
3348
3349
|
if (o && o.storeNames.indexOf(e) === -1) {
|
|
3349
|
-
if (!s) throw new
|
|
3350
|
+
if (!s) throw new j.SubTransaction("Table " + e + " not included in parent transaction.");
|
|
3350
3351
|
o = null;
|
|
3351
3352
|
}
|
|
3352
3353
|
}), s && o && !o.active && (o = null);
|
|
@@ -3366,16 +3367,16 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
3366
3367
|
else try {
|
|
3367
3368
|
s.create(), s.idbtrans._explicit = !0, t._state.PR1398_maxLoop = 3;
|
|
3368
3369
|
} catch (i) {
|
|
3369
|
-
return i.name ===
|
|
3370
|
+
return i.name === fe.InvalidState && t.isOpen() && 0 < --t._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), t.close({ disableAutoOpen: !1 }), t.open().then(function() {
|
|
3370
3371
|
return e(t, n, r, null, a);
|
|
3371
3372
|
})) : H(i);
|
|
3372
3373
|
}
|
|
3373
|
-
var c, l =
|
|
3374
|
+
var c, l = oe(a), o = (l && $e(), z.follow(function() {
|
|
3374
3375
|
var e;
|
|
3375
3376
|
(c = a.call(s, s)) && (l ? (e = et.bind(null, null), c.then(e, e)) : typeof c.next == "function" && typeof c.throw == "function" && (c = zn(c)));
|
|
3376
3377
|
}, o));
|
|
3377
3378
|
return (c && typeof c.then == "function" ? z.resolve(c).then(function(e) {
|
|
3378
|
-
return s.active ? e : H(new
|
|
3379
|
+
return s.active ? e : H(new j.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
|
|
3379
3380
|
}) : o.then(function() {
|
|
3380
3381
|
return c;
|
|
3381
3382
|
})).then(function(e) {
|
|
@@ -3392,7 +3393,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
3392
3393
|
}) : this._whenReady(c);
|
|
3393
3394
|
}, $.prototype.table = function(e) {
|
|
3394
3395
|
if (l(this._allTables, e)) return this._allTables[e];
|
|
3395
|
-
throw new
|
|
3396
|
+
throw new j.InvalidTable(`Table ${e} does not exist`);
|
|
3396
3397
|
};
|
|
3397
3398
|
var Q = $;
|
|
3398
3399
|
function $(e, n) {
|
|
@@ -3411,9 +3412,9 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
3411
3412
|
isBeingOpened: !1,
|
|
3412
3413
|
onReadyBeingFired: null,
|
|
3413
3414
|
openComplete: !1,
|
|
3414
|
-
dbReadyResolve:
|
|
3415
|
+
dbReadyResolve: M,
|
|
3415
3416
|
dbReadyPromise: null,
|
|
3416
|
-
cancelOpen:
|
|
3417
|
+
cancelOpen: M,
|
|
3417
3418
|
openCanceller: null,
|
|
3418
3419
|
autoSchema: !0,
|
|
3419
3420
|
PR1398_maxLoop: 3,
|
|
@@ -3422,7 +3423,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
3422
3423
|
u.dbReadyResolve = e;
|
|
3423
3424
|
}), u.openCanceller = new z(function(e, t) {
|
|
3424
3425
|
u.cancelOpen = t;
|
|
3425
|
-
}), this._state = u, this.name = e, this.on = wt(this, "populate", "blocked", "versionchange", "close", { ready: [
|
|
3426
|
+
}), this._state = u, this.name = e, this.on = wt(this, "populate", "blocked", "versionchange", "close", { ready: [be, M] }), this.once = function(e, t) {
|
|
3426
3427
|
var n = function() {
|
|
3427
3428
|
var r = [...arguments];
|
|
3428
3429
|
c.on(e).unsubscribe(n), t.apply(c, r);
|
|
@@ -3463,14 +3464,14 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
3463
3464
|
limit: Infinity,
|
|
3464
3465
|
error: i,
|
|
3465
3466
|
or: t.or,
|
|
3466
|
-
valueMapper: a ===
|
|
3467
|
+
valueMapper: a === N ? null : a
|
|
3467
3468
|
};
|
|
3468
3469
|
})), this.Table = (i = this, Tt(Ct.prototype, function(e, t, n) {
|
|
3469
3470
|
this.db = i, this._tx = n, this.name = e, this.schema = t, this.hook = i._allTables[e] ? i._allTables[e].hook : wt(null, {
|
|
3470
|
-
creating: [
|
|
3471
|
-
reading: [
|
|
3472
|
-
updating: [
|
|
3473
|
-
deleting: [
|
|
3471
|
+
creating: [ge, M],
|
|
3472
|
+
reading: [he, N],
|
|
3473
|
+
updating: [ve, M],
|
|
3474
|
+
deleting: [_e, M]
|
|
3474
3475
|
});
|
|
3475
3476
|
})), this.Transaction = (a = this, Tt(Kt.prototype, function(e, t, n, r, i) {
|
|
3476
3477
|
var o = this;
|
|
@@ -3505,7 +3506,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
3505
3506
|
return 0 < W(e, t) ? e : t;
|
|
3506
3507
|
}, this._min = function(e, t) {
|
|
3507
3508
|
return W(e, t) < 0 ? e : t;
|
|
3508
|
-
}, this._IDBKeyRange = s._deps.IDBKeyRange, !this._IDBKeyRange) throw new
|
|
3509
|
+
}, this._IDBKeyRange = s._deps.IDBKeyRange, !this._IDBKeyRange) throw new j.MissingAPI();
|
|
3509
3510
|
})), this.on("versionchange", function(e) {
|
|
3510
3511
|
0 < e.newVersion ? console.warn(`Another connection wants to upgrade database '${c.name}'. Closing db now to resume the upgrade.`) : console.warn(`Another connection wants to delete database '${c.name}'. Closing db now to resume the delete request.`), c.close({ disableAutoOpen: !1 });
|
|
3511
3512
|
}), this.on("blocked", function(e) {
|
|
@@ -3557,7 +3558,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
3557
3558
|
}
|
|
3558
3559
|
function sr(e) {
|
|
3559
3560
|
var t, n = !1, r = new ar(function(r) {
|
|
3560
|
-
var i =
|
|
3561
|
+
var i = oe(e), a, o = !1, s = {}, c = {}, l = {
|
|
3561
3562
|
get closed() {
|
|
3562
3563
|
return o;
|
|
3563
3564
|
},
|
|
@@ -3637,7 +3638,7 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
3637
3638
|
});
|
|
3638
3639
|
}) : bn(n, t).toCollection().primaryKeys()).then(e);
|
|
3639
3640
|
} catch {
|
|
3640
|
-
return H(new
|
|
3641
|
+
return H(new j.MissingAPI());
|
|
3641
3642
|
}
|
|
3642
3643
|
var t, n;
|
|
3643
3644
|
},
|
|
@@ -3677,10 +3678,10 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
3677
3678
|
Promise: z,
|
|
3678
3679
|
debug: {
|
|
3679
3680
|
get: function() {
|
|
3680
|
-
return
|
|
3681
|
+
return F;
|
|
3681
3682
|
},
|
|
3682
3683
|
set: function(e) {
|
|
3683
|
-
|
|
3684
|
+
xe(e);
|
|
3684
3685
|
}
|
|
3685
3686
|
},
|
|
3686
3687
|
derive: p,
|
|
@@ -3699,14 +3700,14 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
3699
3700
|
});
|
|
3700
3701
|
},
|
|
3701
3702
|
shallowClone: S,
|
|
3702
|
-
deepClone:
|
|
3703
|
+
deepClone: E,
|
|
3703
3704
|
getObjectDiff: Hn,
|
|
3704
3705
|
cmp: W,
|
|
3705
3706
|
asap: y,
|
|
3706
3707
|
minKey: -Infinity,
|
|
3707
3708
|
addons: [],
|
|
3708
3709
|
connections: { get: yn.toArray },
|
|
3709
|
-
errnames:
|
|
3710
|
+
errnames: fe,
|
|
3710
3711
|
dependencies: ir,
|
|
3711
3712
|
cache: Mn,
|
|
3712
3713
|
semVer: "4.4.6",
|
|
@@ -3729,16 +3730,16 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
3729
3730
|
dr || ur.postMessage(e);
|
|
3730
3731
|
})), typeof addEventListener < "u" && (addEventListener("pagehide", function(e) {
|
|
3731
3732
|
if (!Q.disableBfCache && e.persisted) {
|
|
3732
|
-
|
|
3733
|
+
F && console.debug("Dexie: handling persisted pagehide"), ur?.close();
|
|
3733
3734
|
for (var t = 0, n = yn.toArray(); t < n.length; t++) n[t].close({ disableAutoOpen: !1 });
|
|
3734
3735
|
}
|
|
3735
3736
|
}), addEventListener("pageshow", function(e) {
|
|
3736
|
-
!Q.disableBfCache && e.persisted && (
|
|
3737
|
+
!Q.disableBfCache && e.persisted && (F && console.debug("Dexie: handling persisted pageshow"), fr(), lr({ all: new Z(-Infinity, [[]]) }));
|
|
3737
3738
|
})), z.rejectionMapper = function(e, t) {
|
|
3738
|
-
return !e || e instanceof
|
|
3739
|
+
return !e || e instanceof ce || e instanceof TypeError || e instanceof SyntaxError || !e.name || !me[e.name] ? e : (t = new me[e.name](t || e.message, e), "stack" in e && f(t, "stack", { get: function() {
|
|
3739
3740
|
return this.inner.stack;
|
|
3740
3741
|
} }), t);
|
|
3741
|
-
},
|
|
3742
|
+
}, xe(F), t(Q, Object.freeze({
|
|
3742
3743
|
__proto__: null,
|
|
3743
3744
|
DEFAULT_MAX_CONNECTIONS: 1e3,
|
|
3744
3745
|
Dexie: Q,
|
|
@@ -3761,20 +3762,18 @@ var E = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t, n) => {
|
|
|
3761
3762
|
}
|
|
3762
3763
|
}), { default: Q }), Q;
|
|
3763
3764
|
});
|
|
3764
|
-
})))(), 1),
|
|
3765
|
-
if (
|
|
3766
|
-
var { liveQuery:
|
|
3767
|
-
i(), r();
|
|
3768
|
-
var j = /* @__PURE__ */ new Map(), M = i(), ge = r(), N = /* @__PURE__ */ new Map();
|
|
3765
|
+
})))(), 1), k = Symbol.for("Dexie"), oe = globalThis[k] || (globalThis[k] = O.default);
|
|
3766
|
+
if (O.default.semVer !== oe.semVer) throw Error(`Two different versions of Dexie loaded in the same app: ${O.default.semVer} and ${oe.semVer}`);
|
|
3767
|
+
var { liveQuery: A, mergeRanges: se, rangesOverlap: ce, RangeSet: le, cmp: ue, Entity: de, PropModification: fe, replacePrefix: pe, add: j, remove: me, DexieYProvider: M } = oe, N = /* @__PURE__ */ new Map(), he = o(), P = i(), ge = /* @__PURE__ */ new Map();
|
|
3769
3768
|
function _e(e) {
|
|
3770
|
-
let { key: t, connection: n, listener: r } = e, i =
|
|
3771
|
-
|
|
3769
|
+
let { key: t, connection: n, listener: r } = e, i = ge.get(t) ?? /* @__PURE__ */ new Set();
|
|
3770
|
+
ge.set(t, i);
|
|
3772
3771
|
let a = {
|
|
3773
3772
|
connection: n,
|
|
3774
3773
|
listener: r
|
|
3775
3774
|
};
|
|
3776
3775
|
return i.add(a), function() {
|
|
3777
|
-
i.delete(a), i.size === 0 &&
|
|
3776
|
+
i.delete(a), i.size === 0 && ge.get(t) === i && ge.delete(t);
|
|
3778
3777
|
};
|
|
3779
3778
|
}
|
|
3780
3779
|
function ve(e) {
|
|
@@ -3782,7 +3781,7 @@ function ve(e) {
|
|
|
3782
3781
|
...i,
|
|
3783
3782
|
timestamp: Date.now()
|
|
3784
3783
|
};
|
|
3785
|
-
for (let e of Array.from(
|
|
3784
|
+
for (let e of Array.from(ge.get(t) ?? [])) d({
|
|
3786
3785
|
listener: e.listener,
|
|
3787
3786
|
value: {
|
|
3788
3787
|
type: "change",
|
|
@@ -3800,16 +3799,16 @@ function ye(e) {
|
|
|
3800
3799
|
});
|
|
3801
3800
|
}
|
|
3802
3801
|
function be(e) {
|
|
3803
|
-
return
|
|
3802
|
+
return N.get(e.key);
|
|
3804
3803
|
}
|
|
3805
|
-
function
|
|
3806
|
-
let { key: t } = e, n =
|
|
3804
|
+
function F(e) {
|
|
3805
|
+
let { key: t } = e, n = N.get(t);
|
|
3807
3806
|
if (n) return n;
|
|
3808
3807
|
let r = Se();
|
|
3809
|
-
return
|
|
3808
|
+
return N.set(t, r), r;
|
|
3810
3809
|
}
|
|
3811
|
-
function
|
|
3812
|
-
|
|
3810
|
+
function xe(e) {
|
|
3811
|
+
N.delete(e.key);
|
|
3813
3812
|
}
|
|
3814
3813
|
function Se() {
|
|
3815
3814
|
return {
|
|
@@ -3824,12 +3823,12 @@ function Se() {
|
|
|
3824
3823
|
versions: /* @__PURE__ */ new Map()
|
|
3825
3824
|
};
|
|
3826
3825
|
}
|
|
3827
|
-
function
|
|
3826
|
+
function Ce(e) {
|
|
3828
3827
|
let { state: t, documentId: n } = e;
|
|
3829
3828
|
t.versions.set(n, (t.versions.get(n) ?? 0) + 1);
|
|
3830
3829
|
}
|
|
3831
|
-
var
|
|
3832
|
-
function
|
|
3830
|
+
var we = /* @__PURE__ */ new Map(), Te = Se();
|
|
3831
|
+
function I(e) {
|
|
3833
3832
|
let { table: t, creates: n, documentId: r } = e, i = /* @__PURE__ */ new Set(), a = [], o = [];
|
|
3834
3833
|
for (let { id: e } of n) t.has(e) && a.push(e), i.has(e) && o.push(e), i.add(e);
|
|
3835
3834
|
(a.length > 0 || o.length > 0) && l({
|
|
@@ -3843,7 +3842,7 @@ function Te(e) {
|
|
|
3843
3842
|
this.reconcileWarned = !1;
|
|
3844
3843
|
}
|
|
3845
3844
|
constructor(e, t) {
|
|
3846
|
-
this.closed = !1, this.closings = 0, this.operations =
|
|
3845
|
+
this.closed = !1, this.closings = 0, this.operations = a(), h({
|
|
3847
3846
|
project: e,
|
|
3848
3847
|
dialecteId: t?.dialecteId
|
|
3849
3848
|
}), this.name = e, this.writable = t?.writable ?? !0, this.runtime = t?.runtime, this.stateKey = ye({
|
|
@@ -3853,8 +3852,8 @@ function Te(e) {
|
|
|
3853
3852
|
}
|
|
3854
3853
|
async open() {
|
|
3855
3854
|
let e = this.closings;
|
|
3856
|
-
for (await this.operations.whenIdle(); this.destroying;) await this.destroying.catch(
|
|
3857
|
-
this.closings !== e && c({ storeName: this.name }), this.closed = !1, this.writable &&
|
|
3855
|
+
for (await this.operations.whenIdle(); this.destroying;) await this.destroying.catch(r);
|
|
3856
|
+
this.closings !== e && c({ storeName: this.name }), this.closed = !1, this.writable && he.markOpen({
|
|
3858
3857
|
name: this.stateKey,
|
|
3859
3858
|
connection: this
|
|
3860
3859
|
}), await ae({
|
|
@@ -3863,19 +3862,19 @@ function Te(e) {
|
|
|
3863
3862
|
});
|
|
3864
3863
|
}
|
|
3865
3864
|
async close() {
|
|
3866
|
-
if (this.closed = !0, this.closings += 1,
|
|
3865
|
+
if (this.closed = !0, this.closings += 1, he.markClosed({
|
|
3867
3866
|
name: this.stateKey,
|
|
3868
3867
|
connection: this
|
|
3869
3868
|
}), this.operations.count === 0) return;
|
|
3870
3869
|
let e = this.operations.whenIdle();
|
|
3871
|
-
|
|
3870
|
+
P.markClosing({
|
|
3872
3871
|
name: this.stateKey,
|
|
3873
3872
|
until: e
|
|
3874
3873
|
}), await e;
|
|
3875
3874
|
}
|
|
3876
3875
|
async destroy() {
|
|
3877
3876
|
if (!this.writable) return;
|
|
3878
|
-
for (; this.destroying;) await this.destroying.catch(
|
|
3877
|
+
for (; this.destroying;) await this.destroying.catch(r);
|
|
3879
3878
|
let e = this.destroyOnceIdle();
|
|
3880
3879
|
this.destroying = e;
|
|
3881
3880
|
try {
|
|
@@ -3885,15 +3884,15 @@ function Te(e) {
|
|
|
3885
3884
|
}
|
|
3886
3885
|
}
|
|
3887
3886
|
async destroyOnceIdle() {
|
|
3888
|
-
await this.operations.whenIdle(), await
|
|
3889
|
-
let e =
|
|
3887
|
+
await this.operations.whenIdle(), await P.settled({ name: this.stateKey });
|
|
3888
|
+
let e = he.others({
|
|
3890
3889
|
name: this.stateKey,
|
|
3891
3890
|
connection: this
|
|
3892
3891
|
});
|
|
3893
3892
|
e > 0 && p({
|
|
3894
3893
|
storeName: this.name,
|
|
3895
3894
|
connections: e
|
|
3896
|
-
}),
|
|
3895
|
+
}), xe({ key: this.stateKey }), he.markClosed({
|
|
3897
3896
|
name: this.stateKey,
|
|
3898
3897
|
connection: this
|
|
3899
3898
|
});
|
|
@@ -3914,7 +3913,7 @@ function Te(e) {
|
|
|
3914
3913
|
return await this.guardOpen(), this.getDocumentUnguarded(e);
|
|
3915
3914
|
}
|
|
3916
3915
|
async getDocuments() {
|
|
3917
|
-
return await this.guardOpen(), structuredClone([...this.readState().documents.values()].sort(
|
|
3916
|
+
return await this.guardOpen(), structuredClone([...this.readState().documents.values()].sort(T));
|
|
3918
3917
|
}
|
|
3919
3918
|
async updateDocument(e, t) {
|
|
3920
3919
|
await this.guardOpen();
|
|
@@ -3939,7 +3938,7 @@ function Te(e) {
|
|
|
3939
3938
|
return await this.guardOpen(), structuredClone(this.readTable(t).get(e));
|
|
3940
3939
|
}
|
|
3941
3940
|
async getByDocumentId(e) {
|
|
3942
|
-
return await this.guardOpen(), structuredClone([...this.readTable(e).values()].sort(
|
|
3941
|
+
return await this.guardOpen(), structuredClone([...this.readTable(e).values()].sort(T));
|
|
3943
3942
|
}
|
|
3944
3943
|
async count(e) {
|
|
3945
3944
|
return await this.guardOpen(), this.countUnguarded(e);
|
|
@@ -3953,14 +3952,14 @@ function Te(e) {
|
|
|
3953
3952
|
async importFile(e) {
|
|
3954
3953
|
let t = this.guardOpen();
|
|
3955
3954
|
t && await t, this.guardWritable();
|
|
3956
|
-
let { file: n, options: r, writeId: i = crypto.randomUUID(), onProgress: a, signal: o } = e, s =
|
|
3955
|
+
let { file: n, options: r, writeId: i = crypto.randomUUID(), onProgress: a, signal: o } = e, s = ne({
|
|
3957
3956
|
runtime: this.runtime,
|
|
3958
3957
|
storeName: this.name,
|
|
3959
3958
|
operation: "import"
|
|
3960
|
-
}), { runningImports: c } =
|
|
3959
|
+
}), { runningImports: c } = F({ key: this.stateKey });
|
|
3961
3960
|
c.add(i), this.operations.start();
|
|
3962
3961
|
try {
|
|
3963
|
-
let e = await
|
|
3962
|
+
let e = await w({
|
|
3964
3963
|
store: this.ownImportTarget(),
|
|
3965
3964
|
runtime: s,
|
|
3966
3965
|
file: n,
|
|
@@ -3981,7 +3980,7 @@ function Te(e) {
|
|
|
3981
3980
|
async exportFile(e) {
|
|
3982
3981
|
let t = this.guardOpen();
|
|
3983
3982
|
t && await t;
|
|
3984
|
-
let { documentId: n, options: r, onProgress: i, signal: a } = e, o =
|
|
3983
|
+
let { documentId: n, options: r, onProgress: i, signal: a } = e, o = ne({
|
|
3985
3984
|
runtime: this.runtime,
|
|
3986
3985
|
storeName: this.name,
|
|
3987
3986
|
operation: "export"
|
|
@@ -4034,14 +4033,14 @@ function Te(e) {
|
|
|
4034
4033
|
documentId: t,
|
|
4035
4034
|
recordId: e.id
|
|
4036
4035
|
}), n;
|
|
4037
|
-
}), l =
|
|
4038
|
-
|
|
4036
|
+
}), l = E({ records: e.creates });
|
|
4037
|
+
I({
|
|
4039
4038
|
table: o,
|
|
4040
4039
|
creates: l,
|
|
4041
4040
|
documentId: t
|
|
4042
4041
|
});
|
|
4043
|
-
let u =
|
|
4044
|
-
|
|
4042
|
+
let u = E({ records: e.updates });
|
|
4043
|
+
Ce({
|
|
4045
4044
|
state: a,
|
|
4046
4045
|
documentId: t
|
|
4047
4046
|
});
|
|
@@ -4055,7 +4054,7 @@ function Te(e) {
|
|
|
4055
4054
|
let { heads: f, changelog: p, discardedCommits: h } = a, g = f.get(t) ?? 0, _ = p.get(t) ?? [], v = _.filter((e) => e.sequenceNumber <= g), y = h.get(t) ?? /* @__PURE__ */ new Set();
|
|
4056
4055
|
for (let e of _) e.sequenceNumber > g && y.add(e.writeId);
|
|
4057
4056
|
h.set(t, y);
|
|
4058
|
-
let x = g + 1,
|
|
4057
|
+
let x = g + 1, C = {
|
|
4059
4058
|
id: v.length + 1,
|
|
4060
4059
|
documentId: t,
|
|
4061
4060
|
sequenceNumber: x,
|
|
@@ -4070,7 +4069,7 @@ function Te(e) {
|
|
|
4070
4069
|
deletes: d
|
|
4071
4070
|
}
|
|
4072
4071
|
};
|
|
4073
|
-
v.push(
|
|
4072
|
+
v.push(C), p.set(t, v), f.set(t, x), S({
|
|
4074
4073
|
onProgress: i,
|
|
4075
4074
|
parts: [
|
|
4076
4075
|
l.length,
|
|
@@ -4092,7 +4091,7 @@ function Te(e) {
|
|
|
4092
4091
|
for (let e of s) i.set(e.id, e);
|
|
4093
4092
|
for (let e of o) i.set(e.before.id, e.before);
|
|
4094
4093
|
for (let e of a) i.delete(e.id);
|
|
4095
|
-
t.heads.set(e, n - 1),
|
|
4094
|
+
t.heads.set(e, n - 1), Ce({
|
|
4096
4095
|
state: t,
|
|
4097
4096
|
documentId: e
|
|
4098
4097
|
}), this.announce({
|
|
@@ -4110,7 +4109,7 @@ function Te(e) {
|
|
|
4110
4109
|
for (let e of a) i.set(e.id, e);
|
|
4111
4110
|
for (let e of o) i.set(e.after.id, e.after);
|
|
4112
4111
|
for (let e of s) i.delete(e.id);
|
|
4113
|
-
t.heads.set(e, n),
|
|
4112
|
+
t.heads.set(e, n), Ce({
|
|
4114
4113
|
state: t,
|
|
4115
4114
|
documentId: e
|
|
4116
4115
|
}), this.announce({
|
|
@@ -4157,13 +4156,13 @@ function Te(e) {
|
|
|
4157
4156
|
};
|
|
4158
4157
|
}
|
|
4159
4158
|
async getBlobsByDocument(e) {
|
|
4160
|
-
return await this.guardOpen(), structuredClone([...this.readState().blobs.values()].filter((t) => t.attachedTo.some((t) => t.documentId === e)).sort(
|
|
4159
|
+
return await this.guardOpen(), structuredClone([...this.readState().blobs.values()].filter((t) => t.attachedTo.some((t) => t.documentId === e)).sort(T));
|
|
4161
4160
|
}
|
|
4162
4161
|
async getBlobsByRecord(e, t) {
|
|
4163
|
-
return await this.guardOpen(), structuredClone([...this.readState().blobs.values()].filter((n) => n.attachedTo.some((n) => n.documentId === e && n.recordRef === t)).sort(
|
|
4162
|
+
return await this.guardOpen(), structuredClone([...this.readState().blobs.values()].filter((n) => n.attachedTo.some((n) => n.documentId === e && n.recordRef === t)).sort(T));
|
|
4164
4163
|
}
|
|
4165
4164
|
async getStandaloneBlobs() {
|
|
4166
|
-
return await this.guardOpen(), structuredClone([...this.readState().blobs.values()].filter((e) => e.attachedTo.length === 0).sort(
|
|
4165
|
+
return await this.guardOpen(), structuredClone([...this.readState().blobs.values()].filter((e) => e.attachedTo.length === 0).sort(T));
|
|
4167
4166
|
}
|
|
4168
4167
|
async attachBlob(t, n) {
|
|
4169
4168
|
await this.guardOpen(), this.guardWritable();
|
|
@@ -4211,7 +4210,7 @@ function Te(e) {
|
|
|
4211
4210
|
listener: (t) => {
|
|
4212
4211
|
this.closed || e(t);
|
|
4213
4212
|
}
|
|
4214
|
-
}) :
|
|
4213
|
+
}) : Ee;
|
|
4215
4214
|
}
|
|
4216
4215
|
announce(e) {
|
|
4217
4216
|
ve({
|
|
@@ -4223,10 +4222,10 @@ function Te(e) {
|
|
|
4223
4222
|
}
|
|
4224
4223
|
async registerDocumentUnguarded(e) {
|
|
4225
4224
|
this.guardWritable();
|
|
4226
|
-
let t =
|
|
4225
|
+
let t = F({ key: this.stateKey });
|
|
4227
4226
|
t.documents.has(e.id) && f({ documentId: e.id });
|
|
4228
4227
|
let n = u({ value: e });
|
|
4229
|
-
|
|
4228
|
+
ee({
|
|
4230
4229
|
document: n,
|
|
4231
4230
|
documents: [...t.documents.values()]
|
|
4232
4231
|
}), t.documents.set(e.id, n), t.records.set(_(e.id), /* @__PURE__ */ new Map()), t.blobData.set(e.id, /* @__PURE__ */ new Map());
|
|
@@ -4238,11 +4237,11 @@ function Te(e) {
|
|
|
4238
4237
|
this.guardWritable();
|
|
4239
4238
|
let n = u({ value: t }), r = this.writeState(), i = r?.documents.get(e);
|
|
4240
4239
|
if (!r || !i) return;
|
|
4241
|
-
let a =
|
|
4240
|
+
let a = te({
|
|
4242
4241
|
document: i,
|
|
4243
4242
|
updates: n
|
|
4244
4243
|
});
|
|
4245
|
-
a.path !== i.path &&
|
|
4244
|
+
a.path !== i.path && ee({
|
|
4246
4245
|
document: a,
|
|
4247
4246
|
documents: [...r.documents.values()]
|
|
4248
4247
|
}), r.documents.set(e, a);
|
|
@@ -4251,7 +4250,7 @@ function Te(e) {
|
|
|
4251
4250
|
let { documentId: t, registered: n } = e;
|
|
4252
4251
|
this.guardWritable();
|
|
4253
4252
|
let r = this.writeState(), i = r?.documents.get(t);
|
|
4254
|
-
r && i &&
|
|
4253
|
+
r && i && D({
|
|
4255
4254
|
held: i,
|
|
4256
4255
|
registered: n
|
|
4257
4256
|
}) || b({
|
|
@@ -4264,7 +4263,7 @@ function Te(e) {
|
|
|
4264
4263
|
}
|
|
4265
4264
|
async bulkWriteOwnImport(e) {
|
|
4266
4265
|
let { documentId: t, ops: n, registered: r } = e, i = this.writeState()?.documents.get(t);
|
|
4267
|
-
|
|
4266
|
+
D({
|
|
4268
4267
|
held: i,
|
|
4269
4268
|
registered: r
|
|
4270
4269
|
}) || b({
|
|
@@ -4274,7 +4273,7 @@ function Te(e) {
|
|
|
4274
4273
|
}
|
|
4275
4274
|
async removeOwnImport(e) {
|
|
4276
4275
|
let { documentId: t, registered: n } = e, r = this.writeState()?.documents.get(t);
|
|
4277
|
-
|
|
4276
|
+
D({
|
|
4278
4277
|
held: r,
|
|
4279
4278
|
registered: n
|
|
4280
4279
|
}) && await this.removeDocumentUnguarded(t);
|
|
@@ -4289,8 +4288,8 @@ function Te(e) {
|
|
|
4289
4288
|
}
|
|
4290
4289
|
async bulkWriteUnguarded(e, t) {
|
|
4291
4290
|
this.guardWritable();
|
|
4292
|
-
let { state: n, table: r } = this.writeTarget(e), i =
|
|
4293
|
-
|
|
4291
|
+
let { state: n, table: r } = this.writeTarget(e), i = E({ records: t.creates ?? [] });
|
|
4292
|
+
I({
|
|
4294
4293
|
table: r,
|
|
4295
4294
|
creates: i,
|
|
4296
4295
|
documentId: e
|
|
@@ -4299,25 +4298,25 @@ function Te(e) {
|
|
|
4299
4298
|
for (let e of i) r.set(e.id, e);
|
|
4300
4299
|
for (let e of o) {
|
|
4301
4300
|
let t = r.get(e.recordId);
|
|
4302
|
-
t && r.set(e.recordId,
|
|
4301
|
+
t && r.set(e.recordId, C({
|
|
4303
4302
|
record: t,
|
|
4304
4303
|
patch: e
|
|
4305
4304
|
}));
|
|
4306
4305
|
}
|
|
4307
4306
|
if (t.deletes) for (let e of t.deletes) r.delete(e);
|
|
4308
|
-
|
|
4307
|
+
Ce({
|
|
4309
4308
|
state: n,
|
|
4310
4309
|
documentId: e
|
|
4311
4310
|
});
|
|
4312
4311
|
}
|
|
4313
4312
|
readState() {
|
|
4314
|
-
return this.writable ? be({ key: this.stateKey }) ??
|
|
4313
|
+
return this.writable ? be({ key: this.stateKey }) ?? Te : Te;
|
|
4315
4314
|
}
|
|
4316
4315
|
writeState() {
|
|
4317
4316
|
return be({ key: this.stateKey });
|
|
4318
4317
|
}
|
|
4319
4318
|
readTable(e) {
|
|
4320
|
-
return this.readState().records.get(_(e)) ??
|
|
4319
|
+
return this.readState().records.get(_(e)) ?? we;
|
|
4321
4320
|
}
|
|
4322
4321
|
writeTarget(e) {
|
|
4323
4322
|
let t = this.writeState(), n = t?.records.get(_(e));
|
|
@@ -4331,13 +4330,24 @@ function Te(e) {
|
|
|
4331
4330
|
}
|
|
4332
4331
|
guardOpen() {
|
|
4333
4332
|
if (this.closed && c({ storeName: this.name }), this.destroying) return this.guardOpenAfterOwnDestroy({ destroying: this.destroying });
|
|
4334
|
-
this.writable &&
|
|
4333
|
+
this.writable && he.markOpen({
|
|
4335
4334
|
name: this.stateKey,
|
|
4336
4335
|
connection: this
|
|
4337
4336
|
});
|
|
4338
4337
|
}
|
|
4339
4338
|
async guardOpenAfterOwnDestroy(e) {
|
|
4340
|
-
await e.destroying.catch(
|
|
4339
|
+
await e.destroying.catch(r), await this.guardOpen();
|
|
4340
|
+
}
|
|
4341
|
+
async writeOwnSession(e) {
|
|
4342
|
+
let { documentId: t, ops: n, control: r, registered: i } = e;
|
|
4343
|
+
await this.bulkWriteOwnImport({
|
|
4344
|
+
documentId: t,
|
|
4345
|
+
ops: n,
|
|
4346
|
+
registered: i
|
|
4347
|
+
}), ie({
|
|
4348
|
+
ops: n,
|
|
4349
|
+
control: r
|
|
4350
|
+
});
|
|
4341
4351
|
}
|
|
4342
4352
|
ownImportTarget() {
|
|
4343
4353
|
let e;
|
|
@@ -4357,9 +4367,10 @@ function Te(e) {
|
|
|
4357
4367
|
ops: n,
|
|
4358
4368
|
registered: e
|
|
4359
4369
|
}),
|
|
4360
|
-
writeSession: (t, n) => this.
|
|
4370
|
+
writeSession: (t, n, r) => this.writeOwnSession({
|
|
4361
4371
|
documentId: t,
|
|
4362
4372
|
ops: n,
|
|
4373
|
+
control: r,
|
|
4363
4374
|
registered: e
|
|
4364
4375
|
})
|
|
4365
4376
|
};
|
|
@@ -4383,7 +4394,7 @@ function Te(e) {
|
|
|
4383
4394
|
async getByTagNameInDocumentUnguarded(e, t) {
|
|
4384
4395
|
let n = [];
|
|
4385
4396
|
for (let r of this.readTable(t).values()) r.tagName === e && n.push(r);
|
|
4386
|
-
return structuredClone(n.sort(
|
|
4397
|
+
return structuredClone(n.sort(T));
|
|
4387
4398
|
}
|
|
4388
4399
|
async getManyUnguarded(e, t) {
|
|
4389
4400
|
let n = this.readTable(t);
|
|
@@ -4393,15 +4404,15 @@ function Te(e) {
|
|
|
4393
4404
|
this.writable || e("STORE_NOT_WRITABLE", { detail: "In-memory store is read-only. Hydrate with a real document before writing." });
|
|
4394
4405
|
}
|
|
4395
4406
|
});
|
|
4396
|
-
function
|
|
4397
|
-
function Ee(e, t) {
|
|
4398
|
-
return e ? De(e, t) : {};
|
|
4399
|
-
}
|
|
4407
|
+
function Ee() {}
|
|
4400
4408
|
function De(e, t) {
|
|
4409
|
+
return e ? Oe(e, t) : {};
|
|
4410
|
+
}
|
|
4411
|
+
function Oe(e, t) {
|
|
4401
4412
|
let n = {};
|
|
4402
4413
|
for (let r of Object.keys(e)) {
|
|
4403
4414
|
let i = e[r];
|
|
4404
|
-
n[r] = typeof i == "function" ? (...e) => i(t, ...e) :
|
|
4415
|
+
n[r] = typeof i == "function" ? (...e) => i(t, ...e) : Oe(i, t);
|
|
4405
4416
|
}
|
|
4406
4417
|
return n;
|
|
4407
4418
|
}
|
|
@@ -4412,4 +4423,4 @@ Object.freeze({
|
|
|
4412
4423
|
forceClear() {}
|
|
4413
4424
|
});
|
|
4414
4425
|
//#endregion
|
|
4415
|
-
export {
|
|
4426
|
+
export { De as V, ae as Y };
|