@sprig-technologies/sprig-browser 2.26.5 → 2.26.6
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/index-CqSba42x.cjs +8 -0
- package/dist/{index-IMQ1RWe8.js → index-Dc62vWMo.js} +215 -204
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +8 -2
- package/dist/index.js +1 -1
- package/dist/{view-8NEFT9sC.js → view-BxLGbeCm.js} +2 -2
- package/dist/{view-kCdkKjUT.cjs → view-qyKPee6i.cjs} +2 -2
- package/package.json +1 -1
- package/dist/index-1NW718SB.cjs +0 -8
|
@@ -645,7 +645,7 @@ var bi = { exports: {} };
|
|
|
645
645
|
h = c.retryOn;
|
|
646
646
|
else
|
|
647
647
|
throw new i("retryOn property expects an array or function");
|
|
648
|
-
return new Promise(function(w,
|
|
648
|
+
return new Promise(function(w, y) {
|
|
649
649
|
var g = function(f) {
|
|
650
650
|
var v = typeof Request < "u" && u instanceof Request ? u.clone() : u;
|
|
651
651
|
s(v, c).then(function(b) {
|
|
@@ -654,29 +654,29 @@ var bi = { exports: {} };
|
|
|
654
654
|
else if (typeof h == "function")
|
|
655
655
|
try {
|
|
656
656
|
return Promise.resolve(h(f, null, b)).then(function(_) {
|
|
657
|
-
_ ?
|
|
658
|
-
}).catch(
|
|
657
|
+
_ ? m(f, null, b) : w(b);
|
|
658
|
+
}).catch(y);
|
|
659
659
|
} catch (_) {
|
|
660
|
-
|
|
660
|
+
y(_);
|
|
661
661
|
}
|
|
662
662
|
else
|
|
663
|
-
f < p ?
|
|
663
|
+
f < p ? m(f, null, b) : w(b);
|
|
664
664
|
}).catch(function(b) {
|
|
665
665
|
if (typeof h == "function")
|
|
666
666
|
try {
|
|
667
667
|
Promise.resolve(h(f, b, null)).then(function(_) {
|
|
668
|
-
_ ?
|
|
668
|
+
_ ? m(f, b, null) : y(b);
|
|
669
669
|
}).catch(function(_) {
|
|
670
|
-
|
|
670
|
+
y(_);
|
|
671
671
|
});
|
|
672
672
|
} catch (_) {
|
|
673
|
-
|
|
673
|
+
y(_);
|
|
674
674
|
}
|
|
675
675
|
else
|
|
676
|
-
f < p ?
|
|
676
|
+
f < p ? m(f, b, null) : y(b);
|
|
677
677
|
});
|
|
678
678
|
};
|
|
679
|
-
function
|
|
679
|
+
function m(f, v, b) {
|
|
680
680
|
var _ = typeof d == "function" ? d(f, v, b) : d;
|
|
681
681
|
setTimeout(function() {
|
|
682
682
|
g(++f);
|
|
@@ -842,7 +842,7 @@ function et(e = {}) {
|
|
|
842
842
|
const t = {
|
|
843
843
|
"Content-Type": "application/json",
|
|
844
844
|
"userleap-platform": dn.Web,
|
|
845
|
-
"x-ul-sdk-version": "2.26.
|
|
845
|
+
"x-ul-sdk-version": "2.26.6",
|
|
846
846
|
[oe.InstallationMethod]: Eo(e)
|
|
847
847
|
};
|
|
848
848
|
if (e.envId && (t[oe.EnvironmentID] = e.envId), e.token && (t.Authorization = "Bearer " + e.token), e.userId && (t[oe.UserID] = e.userId), e.visitorId && (t[oe.VisitorID] = e.visitorId), e.partnerAnonymousId && (t[oe.PartnerAnonymousId] = e.partnerAnonymousId), e.mobileHeadersJSON) {
|
|
@@ -1041,7 +1041,7 @@ function Ri(e, t) {
|
|
|
1041
1041
|
}, {});
|
|
1042
1042
|
}
|
|
1043
1043
|
function ye(e, t) {
|
|
1044
|
-
if (te(e, t))
|
|
1044
|
+
if (typeof t == "string" && te(e, t))
|
|
1045
1045
|
return e[t];
|
|
1046
1046
|
if (!t)
|
|
1047
1047
|
return e;
|
|
@@ -1055,7 +1055,7 @@ function ye(e, t) {
|
|
|
1055
1055
|
var o = t.indexOf(".");
|
|
1056
1056
|
if (o !== -1) {
|
|
1057
1057
|
var a = e[t.substr(0, o)];
|
|
1058
|
-
return a
|
|
1058
|
+
return a == null ? void 0 : ye(a, t.substr(o + 1));
|
|
1059
1059
|
}
|
|
1060
1060
|
}
|
|
1061
1061
|
function ie(e, t, n) {
|
|
@@ -1088,7 +1088,7 @@ const Oo = [].concat;
|
|
|
1088
1088
|
function Ti(e) {
|
|
1089
1089
|
return Oo.apply([], e);
|
|
1090
1090
|
}
|
|
1091
|
-
const Ci = "Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(Ti([8, 16, 32, 64].map((e) => ["Int", "Uint", "Float"].map((t) => t + e + "Array")))).filter((e) => j[e]), Ro = Ci.map((e) => j[e]);
|
|
1091
|
+
const Ci = "BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(Ti([8, 16, 32, 64].map((e) => ["Int", "Uint", "Float"].map((t) => t + e + "Array")))).filter((e) => j[e]), Ro = Ci.map((e) => j[e]);
|
|
1092
1092
|
Ri(Ci, (e) => [e, !0]);
|
|
1093
1093
|
let _e = null;
|
|
1094
1094
|
function xt(e) {
|
|
@@ -1637,7 +1637,7 @@ function Yn(e, t, n, r) {
|
|
|
1637
1637
|
}
|
|
1638
1638
|
return e._state.dbReadyPromise.then(() => Yn(e, t, n, r));
|
|
1639
1639
|
}
|
|
1640
|
-
const $r = "3.2.
|
|
1640
|
+
const $r = "3.2.7", De = "", Jn = -1 / 0, ce = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", Yi = "String expected.", yt = [], fn = typeof navigator < "u" && /(MSIE|Trident|Edge)/.test(navigator.userAgent), Yo = fn, Jo = fn, Ji = (e) => !/(dexie\.js|dexie\.min\.js)/.test(e), mn = "__dbnames", bn = "readonly", _n = "readwrite";
|
|
1641
1641
|
function Fe(e, t) {
|
|
1642
1642
|
return e ? t ? function() {
|
|
1643
1643
|
return e.apply(this, arguments) && t.apply(this, arguments);
|
|
@@ -1673,9 +1673,19 @@ class Qo {
|
|
|
1673
1673
|
const n = F(t);
|
|
1674
1674
|
if (n.length === 1)
|
|
1675
1675
|
return this.where(n[0]).equals(t[n[0]]);
|
|
1676
|
-
const r = this.schema.indexes.concat(this.schema.primKey).filter((u) =>
|
|
1677
|
-
|
|
1678
|
-
|
|
1676
|
+
const r = this.schema.indexes.concat(this.schema.primKey).filter((u) => {
|
|
1677
|
+
if (u.compound && n.every((c) => u.keyPath.indexOf(c) >= 0)) {
|
|
1678
|
+
for (let c = 0; c < n.length; ++c)
|
|
1679
|
+
if (n.indexOf(u.keyPath[c]) === -1)
|
|
1680
|
+
return !1;
|
|
1681
|
+
return !0;
|
|
1682
|
+
}
|
|
1683
|
+
return !1;
|
|
1684
|
+
}).sort((u, c) => u.keyPath.length - c.keyPath.length)[0];
|
|
1685
|
+
if (r && this.db._maxKey !== De) {
|
|
1686
|
+
const u = r.keyPath.slice(0, n.length);
|
|
1687
|
+
return this.where(u).equals(u.map((c) => t[c]));
|
|
1688
|
+
}
|
|
1679
1689
|
!r && le && console.warn(`The query ${JSON.stringify(t)} on ${this.name} would benefit of a compound index [${n.join("+")}]`);
|
|
1680
1690
|
const { idxByName: i } = this.schema, s = this.db._deps.indexedDB;
|
|
1681
1691
|
function o(u, c) {
|
|
@@ -1688,8 +1698,8 @@ class Qo {
|
|
|
1688
1698
|
const [a, l] = n.reduce(([u, c], p) => {
|
|
1689
1699
|
const d = i[p], h = t[p];
|
|
1690
1700
|
return [u || d, u || !d ? Fe(c, d && d.multi ? (w) => {
|
|
1691
|
-
const
|
|
1692
|
-
return z(
|
|
1701
|
+
const y = ye(w, p);
|
|
1702
|
+
return z(y) && y.some((g) => o(h, g));
|
|
1693
1703
|
} : (w) => o(h, ye(w, p))) : c];
|
|
1694
1704
|
}, [null, null]);
|
|
1695
1705
|
return a ? this.where(a.name).equals(t[a.keyPath]).filter(l) : r ? this.filter(l) : this.where(n).equals("");
|
|
@@ -1869,11 +1879,11 @@ function wt(e) {
|
|
|
1869
1879
|
if (d !== "asap")
|
|
1870
1880
|
throw new A.InvalidArgument("Invalid event config");
|
|
1871
1881
|
var h = s(p, _t, function() {
|
|
1872
|
-
for (var w = arguments.length,
|
|
1873
|
-
|
|
1882
|
+
for (var w = arguments.length, y = new Array(w); w--; )
|
|
1883
|
+
y[w] = arguments[w];
|
|
1874
1884
|
h.subscribers.forEach(function(g) {
|
|
1875
1885
|
Oi(function() {
|
|
1876
|
-
g.apply(null,
|
|
1886
|
+
g.apply(null, y);
|
|
1877
1887
|
});
|
|
1878
1888
|
});
|
|
1879
1889
|
});
|
|
@@ -2161,43 +2171,43 @@ class Xo {
|
|
|
2161
2171
|
i = t;
|
|
2162
2172
|
else {
|
|
2163
2173
|
var s = F(t), o = s.length;
|
|
2164
|
-
i = function(
|
|
2165
|
-
for (var g = !1,
|
|
2166
|
-
var f = s[
|
|
2167
|
-
ye(
|
|
2174
|
+
i = function(y) {
|
|
2175
|
+
for (var g = !1, m = 0; m < o; ++m) {
|
|
2176
|
+
var f = s[m], v = t[f];
|
|
2177
|
+
ye(y, f) !== v && (ie(y, f, v), g = !0);
|
|
2168
2178
|
}
|
|
2169
2179
|
return g;
|
|
2170
2180
|
};
|
|
2171
2181
|
}
|
|
2172
2182
|
const a = n.table.core, { outbound: l, extractKey: u } = a.schema.primaryKey, c = this.db._options.modifyChunkSize || 200, p = [];
|
|
2173
2183
|
let d = 0;
|
|
2174
|
-
const h = [], w = (
|
|
2175
|
-
const { failures:
|
|
2176
|
-
d +=
|
|
2177
|
-
for (let v of F(
|
|
2178
|
-
p.push(
|
|
2184
|
+
const h = [], w = (y, g) => {
|
|
2185
|
+
const { failures: m, numFailures: f } = g;
|
|
2186
|
+
d += y - f;
|
|
2187
|
+
for (let v of F(m))
|
|
2188
|
+
p.push(m[v]);
|
|
2179
2189
|
};
|
|
2180
|
-
return this.clone().primaryKeys().then((
|
|
2181
|
-
const g = (
|
|
2182
|
-
const f = Math.min(c,
|
|
2183
|
-
return a.getMany({ trans: r, keys:
|
|
2190
|
+
return this.clone().primaryKeys().then((y) => {
|
|
2191
|
+
const g = (m) => {
|
|
2192
|
+
const f = Math.min(c, y.length - m);
|
|
2193
|
+
return a.getMany({ trans: r, keys: y.slice(m, m + f), cache: "immutable" }).then((v) => {
|
|
2184
2194
|
const b = [], _ = [], E = l ? [] : null, S = [];
|
|
2185
2195
|
for (let k = 0; k < f; ++k) {
|
|
2186
|
-
const B = v[k], D = { value: xt(B), primKey: m
|
|
2187
|
-
i.call(D, D.value, D) !== !1 && (D.value == null ? S.push(m
|
|
2196
|
+
const B = v[k], D = { value: xt(B), primKey: y[m + k] };
|
|
2197
|
+
i.call(D, D.value, D) !== !1 && (D.value == null ? S.push(y[m + k]) : l || G(u(B), u(D.value)) === 0 ? (_.push(D.value), l && E.push(y[m + k])) : (S.push(y[m + k]), b.push(D.value)));
|
|
2188
2198
|
}
|
|
2189
2199
|
const P = We(n) && n.limit === 1 / 0 && (typeof t != "function" || t === kn) && { index: n.index, range: n.range };
|
|
2190
2200
|
return Promise.resolve(b.length > 0 && a.mutate({ trans: r, type: "add", values: b }).then((k) => {
|
|
2191
2201
|
for (let B in k.failures)
|
|
2192
2202
|
S.splice(parseInt(B), 1);
|
|
2193
2203
|
w(b.length, k);
|
|
2194
|
-
})).then(() => (_.length > 0 || P && typeof t == "object") && a.mutate({ trans: r, type: "put", keys: E, values: _, criteria: P, changeSpec: typeof t != "function" && t }).then((k) => w(_.length, k))).then(() => (S.length > 0 || P && t === kn) && a.mutate({ trans: r, type: "delete", keys: S, criteria: P }).then((k) => w(S.length, k))).then(() =>
|
|
2204
|
+
})).then(() => (_.length > 0 || P && typeof t == "object") && a.mutate({ trans: r, type: "put", keys: E, values: _, criteria: P, changeSpec: typeof t != "function" && t }).then((k) => w(_.length, k))).then(() => (S.length > 0 || P && t === kn) && a.mutate({ trans: r, type: "delete", keys: S, criteria: P }).then((k) => w(S.length, k))).then(() => y.length > m + f && g(m + c));
|
|
2195
2205
|
});
|
|
2196
2206
|
};
|
|
2197
2207
|
return g(0).then(() => {
|
|
2198
2208
|
if (p.length > 0)
|
|
2199
2209
|
throw new nn("Error modifying one or more objects", p, d, h);
|
|
2200
|
-
return
|
|
2210
|
+
return y.length;
|
|
2201
2211
|
});
|
|
2202
2212
|
});
|
|
2203
2213
|
});
|
|
@@ -2239,33 +2249,33 @@ function ta(e, t, n, r, i, s) {
|
|
|
2239
2249
|
}
|
|
2240
2250
|
function Kt(e, t, n, r) {
|
|
2241
2251
|
var i, s, o, a, l, u, c, p = n.length;
|
|
2242
|
-
if (!n.every((
|
|
2252
|
+
if (!n.every((y) => typeof y == "string"))
|
|
2243
2253
|
return Q(e, Yi);
|
|
2244
|
-
function d(
|
|
2245
|
-
i = /* @__PURE__ */ function(
|
|
2246
|
-
return
|
|
2247
|
-
}(
|
|
2248
|
-
return
|
|
2249
|
-
}(
|
|
2250
|
-
var g = n.map(function(
|
|
2251
|
-
return { lower: s(
|
|
2252
|
-
}).sort(function(
|
|
2253
|
-
return o(
|
|
2254
|
+
function d(y) {
|
|
2255
|
+
i = /* @__PURE__ */ function(m) {
|
|
2256
|
+
return m === "next" ? (f) => f.toUpperCase() : (f) => f.toLowerCase();
|
|
2257
|
+
}(y), s = /* @__PURE__ */ function(m) {
|
|
2258
|
+
return m === "next" ? (f) => f.toLowerCase() : (f) => f.toUpperCase();
|
|
2259
|
+
}(y), o = y === "next" ? Zo : ea;
|
|
2260
|
+
var g = n.map(function(m) {
|
|
2261
|
+
return { lower: s(m), upper: i(m) };
|
|
2262
|
+
}).sort(function(m, f) {
|
|
2263
|
+
return o(m.lower, f.lower);
|
|
2254
2264
|
});
|
|
2255
|
-
a = g.map(function(
|
|
2256
|
-
return
|
|
2257
|
-
}), l = g.map(function(
|
|
2258
|
-
return
|
|
2259
|
-
}), u =
|
|
2265
|
+
a = g.map(function(m) {
|
|
2266
|
+
return m.upper;
|
|
2267
|
+
}), l = g.map(function(m) {
|
|
2268
|
+
return m.lower;
|
|
2269
|
+
}), u = y, c = y === "next" ? "" : r;
|
|
2260
2270
|
}
|
|
2261
2271
|
d("next");
|
|
2262
2272
|
var h = new e.Collection(e, () => be(a[0], l[p - 1] + r));
|
|
2263
|
-
h._ondirectionchange = function(
|
|
2264
|
-
d(
|
|
2273
|
+
h._ondirectionchange = function(y) {
|
|
2274
|
+
d(y);
|
|
2265
2275
|
};
|
|
2266
2276
|
var w = 0;
|
|
2267
|
-
return h._addAlgorithm(function(
|
|
2268
|
-
var f =
|
|
2277
|
+
return h._addAlgorithm(function(y, g, m) {
|
|
2278
|
+
var f = y.key;
|
|
2269
2279
|
if (typeof f != "string")
|
|
2270
2280
|
return !1;
|
|
2271
2281
|
var v = s(f);
|
|
@@ -2276,8 +2286,8 @@ function Kt(e, t, n, r) {
|
|
|
2276
2286
|
E === null && b === null ? w = _ + 1 : (b === null || o(b, E) > 0) && (b = E);
|
|
2277
2287
|
}
|
|
2278
2288
|
return g(b !== null ? function() {
|
|
2279
|
-
|
|
2280
|
-
} :
|
|
2289
|
+
y.continue(b + c);
|
|
2290
|
+
} : m), !1;
|
|
2281
2291
|
}), h;
|
|
2282
2292
|
}
|
|
2283
2293
|
function be(e, t, n, r) {
|
|
@@ -2397,21 +2407,21 @@ class Zi {
|
|
|
2397
2407
|
return Q(this, ce);
|
|
2398
2408
|
}
|
|
2399
2409
|
let h = 0;
|
|
2400
|
-
const w = u ? (f) => i(f, c[h][1]) > 0 : (f) => i(f, c[h][1]) >= 0,
|
|
2410
|
+
const w = u ? (f) => i(f, c[h][1]) > 0 : (f) => i(f, c[h][1]) >= 0, y = l ? (f) => s(f, c[h][0]) > 0 : (f) => s(f, c[h][0]) >= 0;
|
|
2401
2411
|
let g = w;
|
|
2402
|
-
const
|
|
2403
|
-
return
|
|
2404
|
-
f === "next" ? (g = w, p = i) : (g =
|
|
2405
|
-
},
|
|
2412
|
+
const m = new this.Collection(this, () => be(c[0][0], c[c.length - 1][1], !l, !u));
|
|
2413
|
+
return m._ondirectionchange = (f) => {
|
|
2414
|
+
f === "next" ? (g = w, p = i) : (g = y, p = s), c.sort(d);
|
|
2415
|
+
}, m._addAlgorithm((f, v, b) => {
|
|
2406
2416
|
for (var _ = f.key; g(_); )
|
|
2407
2417
|
if (++h, h === c.length)
|
|
2408
2418
|
return v(b), !1;
|
|
2409
2419
|
return !!function(E) {
|
|
2410
|
-
return !w(E) && !
|
|
2420
|
+
return !w(E) && !y(E);
|
|
2411
2421
|
}(_) || (this._cmp(_, c[h][1]) === 0 || this._cmp(_, c[h][0]) === 0 || v(() => {
|
|
2412
2422
|
p === i ? f.continue(c[h][0]) : f.continue(c[h][1]);
|
|
2413
2423
|
}), !1);
|
|
2414
|
-
}),
|
|
2424
|
+
}), m;
|
|
2415
2425
|
}
|
|
2416
2426
|
startsWithAnyOf() {
|
|
2417
2427
|
const t = pe.apply(Ge, arguments);
|
|
@@ -2573,16 +2583,16 @@ function ia(e, t, n) {
|
|
|
2573
2583
|
const { schema: i, hasGetAll: s } = function(l, u) {
|
|
2574
2584
|
const c = Gr(l.objectStoreNames);
|
|
2575
2585
|
return { schema: { name: l.name, tables: c.map((p) => u.objectStore(p)).map((p) => {
|
|
2576
|
-
const { keyPath: d, autoIncrement: h } = p, w = z(d),
|
|
2586
|
+
const { keyPath: d, autoIncrement: h } = p, w = z(d), y = d == null, g = {}, m = { name: p.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: y, compound: w, keyPath: d, autoIncrement: h, unique: !0, extractKey: Xn(d) }, indexes: Gr(p.indexNames).map((f) => p.index(f)).map((f) => {
|
|
2577
2587
|
const { name: v, unique: b, multiEntry: _, keyPath: E } = f, S = { name: v, compound: z(E), keyPath: E, unique: b, multiEntry: _, extractKey: Xn(E) };
|
|
2578
2588
|
return g[gt(E)] = S, S;
|
|
2579
2589
|
}), getIndexByKeyPath: (f) => g[gt(f)] };
|
|
2580
|
-
return g[":id"] =
|
|
2590
|
+
return g[":id"] = m.primaryKey, d != null && (g[gt(d)] = m.primaryKey), m;
|
|
2581
2591
|
}) }, hasGetAll: c.length > 0 && "getAll" in u.objectStore(c[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) };
|
|
2582
2592
|
}(e, n), o = i.tables.map((l) => function(u) {
|
|
2583
2593
|
const c = u.name;
|
|
2584
|
-
return { name: c, schema: u, mutate: function({ trans: p, type: d, keys: h, values: w, range:
|
|
2585
|
-
return new Promise((g,
|
|
2594
|
+
return { name: c, schema: u, mutate: function({ trans: p, type: d, keys: h, values: w, range: y }) {
|
|
2595
|
+
return new Promise((g, m) => {
|
|
2586
2596
|
g = N(g);
|
|
2587
2597
|
const f = p.objectStore(c), v = f.keyPath == null, b = d === "put" || d === "add";
|
|
2588
2598
|
if (!b && d !== "delete" && d !== "deleteRange")
|
|
@@ -2599,9 +2609,9 @@ function ia(e, t, n) {
|
|
|
2599
2609
|
++k, Et(V);
|
|
2600
2610
|
};
|
|
2601
2611
|
if (d === "deleteRange") {
|
|
2602
|
-
if (
|
|
2612
|
+
if (y.type === 4)
|
|
2603
2613
|
return g({ numFailures: k, failures: P, results: [], lastResult: void 0 });
|
|
2604
|
-
|
|
2614
|
+
y.type === 3 ? S.push(E = f.clear()) : S.push(E = f.delete(r(y)));
|
|
2605
2615
|
} else {
|
|
2606
2616
|
const [V, M] = b ? v ? [w, h] : [w, null] : [h, null];
|
|
2607
2617
|
if (b)
|
|
@@ -2621,24 +2631,24 @@ function ia(e, t, n) {
|
|
|
2621
2631
|
});
|
|
2622
2632
|
}, getMany: ({ trans: p, keys: d }) => new Promise((h, w) => {
|
|
2623
2633
|
h = N(h);
|
|
2624
|
-
const
|
|
2634
|
+
const y = p.objectStore(c), g = d.length, m = new Array(g);
|
|
2625
2635
|
let f, v = 0, b = 0;
|
|
2626
2636
|
const _ = (S) => {
|
|
2627
2637
|
const P = S.target;
|
|
2628
|
-
|
|
2638
|
+
m[P._pos] = P.result, ++b === v && h(m);
|
|
2629
2639
|
}, E = se(w);
|
|
2630
2640
|
for (let S = 0; S < g; ++S)
|
|
2631
|
-
d[S] != null && (f =
|
|
2632
|
-
v === 0 && h(
|
|
2641
|
+
d[S] != null && (f = y.get(d[S]), f._pos = S, f.onsuccess = _, f.onerror = E, ++v);
|
|
2642
|
+
v === 0 && h(m);
|
|
2633
2643
|
}), get: ({ trans: p, key: d }) => new Promise((h, w) => {
|
|
2634
2644
|
h = N(h);
|
|
2635
|
-
const
|
|
2636
|
-
|
|
2645
|
+
const y = p.objectStore(c).get(d);
|
|
2646
|
+
y.onsuccess = (g) => h(g.target.result), y.onerror = se(w);
|
|
2637
2647
|
}), query: /* @__PURE__ */ function(p) {
|
|
2638
2648
|
return (d) => new Promise((h, w) => {
|
|
2639
2649
|
h = N(h);
|
|
2640
|
-
const { trans:
|
|
2641
|
-
if (
|
|
2650
|
+
const { trans: y, values: g, limit: m, query: f } = d, v = m === 1 / 0 ? void 0 : m, { index: b, range: _ } = f, E = y.objectStore(c), S = b.isPrimaryKey ? E : E.index(b.name), P = r(_);
|
|
2651
|
+
if (m === 0)
|
|
2642
2652
|
return h({ result: [] });
|
|
2643
2653
|
if (p) {
|
|
2644
2654
|
const k = g ? S.getAll(P, v) : S.getAllKeys(P, v);
|
|
@@ -2648,15 +2658,15 @@ function ia(e, t, n) {
|
|
|
2648
2658
|
const B = g || !("openKeyCursor" in S) ? S.openCursor(P) : S.openKeyCursor(P), D = [];
|
|
2649
2659
|
B.onsuccess = (V) => {
|
|
2650
2660
|
const M = B.result;
|
|
2651
|
-
return M ? (D.push(g ? M.value : M.primaryKey), ++k ===
|
|
2661
|
+
return M ? (D.push(g ? M.value : M.primaryKey), ++k === m ? h({ result: D }) : void M.continue()) : h({ result: D });
|
|
2652
2662
|
}, B.onerror = se(w);
|
|
2653
2663
|
}
|
|
2654
2664
|
});
|
|
2655
|
-
}(s), openCursor: function({ trans: p, values: d, query: h, reverse: w, unique:
|
|
2656
|
-
return new Promise((g,
|
|
2665
|
+
}(s), openCursor: function({ trans: p, values: d, query: h, reverse: w, unique: y }) {
|
|
2666
|
+
return new Promise((g, m) => {
|
|
2657
2667
|
g = N(g);
|
|
2658
|
-
const { index: f, range: v } = h, b = p.objectStore(c), _ = f.isPrimaryKey ? b : b.index(f.name), E = w ?
|
|
2659
|
-
S.onerror = se(
|
|
2668
|
+
const { index: f, range: v } = h, b = p.objectStore(c), _ = f.isPrimaryKey ? b : b.index(f.name), E = w ? y ? "prevunique" : "prev" : y ? "nextunique" : "next", S = d || !("openKeyCursor" in _) ? _.openCursor(r(v), E) : _.openKeyCursor(r(v), E);
|
|
2669
|
+
S.onerror = se(m), S.onsuccess = N((P) => {
|
|
2660
2670
|
const k = S.result;
|
|
2661
2671
|
if (!k)
|
|
2662
2672
|
return void g(null);
|
|
@@ -2669,7 +2679,7 @@ function ia(e, t, n) {
|
|
|
2669
2679
|
};
|
|
2670
2680
|
k.trans = p, k.stop = k.continue = k.continuePrimaryKey = k.advance = () => {
|
|
2671
2681
|
throw new Error("Cursor not started");
|
|
2672
|
-
}, k.fail = N(
|
|
2682
|
+
}, k.fail = N(m), k.next = function() {
|
|
2673
2683
|
let x = 1;
|
|
2674
2684
|
return this.start(() => x-- ? this.continue() : this.stop()).then(() => this);
|
|
2675
2685
|
}, k.start = (x) => {
|
|
@@ -2693,13 +2703,13 @@ function ia(e, t, n) {
|
|
|
2693
2703
|
S.onsuccess = qe, qe();
|
|
2694
2704
|
}), k.continue = B, k.continuePrimaryKey = D, k.advance = V, qe(), ve;
|
|
2695
2705
|
}, g(k);
|
|
2696
|
-
},
|
|
2706
|
+
}, m);
|
|
2697
2707
|
});
|
|
2698
2708
|
}, count({ query: p, trans: d }) {
|
|
2699
2709
|
const { index: h, range: w } = p;
|
|
2700
|
-
return new Promise((
|
|
2701
|
-
const
|
|
2702
|
-
b.onsuccess = N((_) =>
|
|
2710
|
+
return new Promise((y, g) => {
|
|
2711
|
+
const m = d.objectStore(c), f = h.isPrimaryKey ? m : m.index(h.name), v = r(w), b = v ? f.count(v) : f.count();
|
|
2712
|
+
b.onsuccess = N((_) => y(_.target.result)), b.onerror = se(g);
|
|
2703
2713
|
});
|
|
2704
2714
|
} };
|
|
2705
2715
|
}(l)), a = {};
|
|
@@ -2751,10 +2761,10 @@ function oa(e, t, n, r) {
|
|
|
2751
2761
|
Ln(n, l, i[l].primKey, i[l].indexes);
|
|
2752
2762
|
}), Zn(e, n), L.follow(() => e.on.populate.fire(s)).catch(o)) : function({ _novip: l }, u, c, p) {
|
|
2753
2763
|
const d = [], h = l._versions;
|
|
2754
|
-
let w = l._dbSchema = nr(l, l.idbdb, p),
|
|
2764
|
+
let w = l._dbSchema = nr(l, l.idbdb, p), y = !1;
|
|
2755
2765
|
const g = h.filter((f) => f._cfg.version >= u);
|
|
2756
|
-
function
|
|
2757
|
-
return d.length ? L.resolve(d.shift()(c.idbtrans)).then(
|
|
2766
|
+
function m() {
|
|
2767
|
+
return d.length ? L.resolve(d.shift()(c.idbtrans)).then(m) : L.resolve();
|
|
2758
2768
|
}
|
|
2759
2769
|
return g.forEach((f) => {
|
|
2760
2770
|
d.push(() => {
|
|
@@ -2775,7 +2785,7 @@ function oa(e, t, n, r) {
|
|
|
2775
2785
|
});
|
|
2776
2786
|
const E = f._cfg.contentUpgrade;
|
|
2777
2787
|
if (E && f._cfg.version > u) {
|
|
2778
|
-
Zn(l, p), c._memoizedTables = {},
|
|
2788
|
+
Zn(l, p), c._memoizedTables = {}, y = !0;
|
|
2779
2789
|
let S = Di(b);
|
|
2780
2790
|
_.del.forEach((D) => {
|
|
2781
2791
|
S[D] = v[D];
|
|
@@ -2792,11 +2802,11 @@ function oa(e, t, n, r) {
|
|
|
2792
2802
|
return k && typeof k.then == "function" ? L.resolve(k) : B.then(() => k);
|
|
2793
2803
|
}
|
|
2794
2804
|
}), d.push((v) => {
|
|
2795
|
-
(!
|
|
2805
|
+
(!y || !Yo) && function(b, _) {
|
|
2796
2806
|
[].slice.call(_.db.objectStoreNames).forEach((E) => b[E] == null && _.db.deleteObjectStore(E));
|
|
2797
2807
|
}(f._cfg.dbschema, v), er(l, [l.Transaction.prototype]), ln(l, [l.Transaction.prototype], l._storeNames, l._dbSchema), c.schema = l._dbSchema;
|
|
2798
2808
|
});
|
|
2799
|
-
}),
|
|
2809
|
+
}), m().then(() => {
|
|
2800
2810
|
var f, v;
|
|
2801
2811
|
v = p, F(f = w).forEach((b) => {
|
|
2802
2812
|
v.db.objectStoreNames.contains(b) || Ln(v, b, f[b].primKey, f[b].indexes);
|
|
@@ -2935,63 +2945,64 @@ function ca(e) {
|
|
|
2935
2945
|
throw new A.DatabaseClosed("db.open() was cancelled");
|
|
2936
2946
|
}
|
|
2937
2947
|
let s = t.dbReadyResolve, o = null, a = !1;
|
|
2938
|
-
|
|
2948
|
+
const l = () => new L((u, c) => {
|
|
2939
2949
|
if (i(), !n)
|
|
2940
2950
|
throw new A.MissingAPI();
|
|
2941
|
-
const
|
|
2942
|
-
if (!
|
|
2951
|
+
const p = e.name, d = t.autoSchema ? n.open(p) : n.open(p, Math.round(10 * e.verno));
|
|
2952
|
+
if (!d)
|
|
2943
2953
|
throw new A.MissingAPI();
|
|
2944
|
-
|
|
2945
|
-
if (o =
|
|
2946
|
-
|
|
2947
|
-
const
|
|
2948
|
-
|
|
2949
|
-
|
|
2954
|
+
d.onerror = se(c), d.onblocked = N(e._fireOnBlocked), d.onupgradeneeded = N((h) => {
|
|
2955
|
+
if (o = d.transaction, t.autoSchema && !e._options.allowEmptyDB) {
|
|
2956
|
+
d.onerror = Et, o.abort(), d.result.close();
|
|
2957
|
+
const y = n.deleteDatabase(p);
|
|
2958
|
+
y.onsuccess = y.onerror = N(() => {
|
|
2959
|
+
c(new A.NoSuchDatabase(`Database ${p} doesnt exist`));
|
|
2950
2960
|
});
|
|
2951
2961
|
} else {
|
|
2952
|
-
o.onerror = se(
|
|
2953
|
-
var
|
|
2954
|
-
a =
|
|
2962
|
+
o.onerror = se(c);
|
|
2963
|
+
var w = h.oldVersion > Math.pow(2, 62) ? 0 : h.oldVersion;
|
|
2964
|
+
a = w < 1, e._novip.idbdb = d.result, oa(e, w / 10, o, c);
|
|
2955
2965
|
}
|
|
2956
|
-
},
|
|
2966
|
+
}, c), d.onsuccess = N(() => {
|
|
2957
2967
|
o = null;
|
|
2958
|
-
const
|
|
2959
|
-
if (
|
|
2968
|
+
const h = e._novip.idbdb = d.result, w = tn(h.objectStoreNames);
|
|
2969
|
+
if (w.length > 0)
|
|
2960
2970
|
try {
|
|
2961
|
-
const
|
|
2962
|
-
t.autoSchema ? function({ _novip:
|
|
2963
|
-
|
|
2964
|
-
const
|
|
2965
|
-
|
|
2966
|
-
}(e,
|
|
2967
|
-
const
|
|
2968
|
-
return !(
|
|
2969
|
-
}(e,
|
|
2971
|
+
const g = h.transaction((y = w).length === 1 ? y[0] : y, "readonly");
|
|
2972
|
+
t.autoSchema ? function({ _novip: m }, f, v) {
|
|
2973
|
+
m.verno = f.version / 10;
|
|
2974
|
+
const b = m._dbSchema = nr(0, f, v);
|
|
2975
|
+
m._storeNames = tn(f.objectStoreNames, 0), ln(m, [m._allTables], F(b), b);
|
|
2976
|
+
}(e, h, g) : (rr(e, e._dbSchema, g), function(m, f) {
|
|
2977
|
+
const v = ns(nr(0, m.idbdb, f), m._dbSchema);
|
|
2978
|
+
return !(v.add.length || v.change.some((b) => b.add.length || b.change.length));
|
|
2979
|
+
}(e, g) || console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")), Zn(e, g);
|
|
2970
2980
|
} catch {
|
|
2971
2981
|
}
|
|
2972
|
-
var
|
|
2973
|
-
yt.push(e),
|
|
2974
|
-
t.vcFired = !0, e.on("versionchange").fire(
|
|
2975
|
-
}),
|
|
2976
|
-
e.on("close").fire(
|
|
2977
|
-
}), a && function({ indexedDB:
|
|
2978
|
-
!Ir(
|
|
2979
|
-
}(e._deps,
|
|
2980
|
-
},
|
|
2981
|
-
})
|
|
2982
|
+
var y;
|
|
2983
|
+
yt.push(e), h.onversionchange = N((g) => {
|
|
2984
|
+
t.vcFired = !0, e.on("versionchange").fire(g);
|
|
2985
|
+
}), h.onclose = N((g) => {
|
|
2986
|
+
e.on("close").fire(g);
|
|
2987
|
+
}), a && function({ indexedDB: g, IDBKeyRange: m }, f) {
|
|
2988
|
+
!Ir(g) && f !== mn && Lr(g, m).put({ name: f }).catch(C);
|
|
2989
|
+
}(e._deps, p), u();
|
|
2990
|
+
}, c);
|
|
2991
|
+
}).catch((u) => u && u.name === "UnknownError" && t.PR1398_maxLoop > 0 ? (t.PR1398_maxLoop--, console.warn("Dexie: Workaround for Chrome UnknownError on open()"), l()) : L.reject(u));
|
|
2992
|
+
return L.race([r, (typeof navigator > "u" ? L.resolve() : la()).then(l)]).then(() => (i(), t.onReadyBeingFired = [], L.resolve(ir(() => e.on.ready.fire(e.vip))).then(function u() {
|
|
2982
2993
|
if (t.onReadyBeingFired.length > 0) {
|
|
2983
|
-
let
|
|
2984
|
-
return t.onReadyBeingFired = [], L.resolve(ir(() =>
|
|
2994
|
+
let c = t.onReadyBeingFired.reduce(_r, C);
|
|
2995
|
+
return t.onReadyBeingFired = [], L.resolve(ir(() => c(e.vip))).then(u);
|
|
2985
2996
|
}
|
|
2986
2997
|
}))).finally(() => {
|
|
2987
2998
|
t.onReadyBeingFired = null, t.isBeingOpened = !1;
|
|
2988
|
-
}).then(() => e).catch((
|
|
2989
|
-
t.dbOpenError =
|
|
2999
|
+
}).then(() => e).catch((u) => {
|
|
3000
|
+
t.dbOpenError = u;
|
|
2990
3001
|
try {
|
|
2991
3002
|
o && o.abort();
|
|
2992
3003
|
} catch {
|
|
2993
3004
|
}
|
|
2994
|
-
return r === t.openCanceller && e._close(), $(
|
|
3005
|
+
return r === t.openCanceller && e._close(), $(u);
|
|
2995
3006
|
}).finally(() => {
|
|
2996
3007
|
t.openComplete = !0, s();
|
|
2997
3008
|
});
|
|
@@ -3049,8 +3060,8 @@ const da = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create:
|
|
|
3049
3060
|
return { ...e, table(t) {
|
|
3050
3061
|
const n = e.table(t), { schema: r } = n, i = {}, s = [];
|
|
3051
3062
|
function o(c, p, d) {
|
|
3052
|
-
const h = gt(c), w = i[h] = i[h] || [],
|
|
3053
|
-
return w.push(
|
|
3063
|
+
const h = gt(c), w = i[h] = i[h] || [], y = c == null ? 0 : typeof c == "string" ? 1 : c.length, g = p > 0, m = { ...d, isVirtual: g, keyTail: p, keyLength: y, extractKey: Xn(c), unique: !g && d.unique };
|
|
3064
|
+
return w.push(m), m.isPrimaryKey || s.push(m), y > 1 && o(y === 2 ? c[0] : c.slice(0, y - 1), p + 1, d), w.sort((f, v) => f.keyTail - v.keyTail), m;
|
|
3054
3065
|
}
|
|
3055
3066
|
const a = o(r.primaryKey.keyPath, 0, r.primaryKey);
|
|
3056
3067
|
i[":id"] = [a];
|
|
@@ -3066,15 +3077,15 @@ const da = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create:
|
|
|
3066
3077
|
return p && p[0];
|
|
3067
3078
|
} }, count: (c) => n.count(l(c)), query: (c) => n.query(l(c)), openCursor(c) {
|
|
3068
3079
|
const { keyTail: p, isVirtual: d, keyLength: h } = c.query.index;
|
|
3069
|
-
return d ? n.openCursor(l(c)).then((w) => w && function(
|
|
3070
|
-
return Object.create(
|
|
3071
|
-
|
|
3072
|
-
} }, continuePrimaryKey: { value(
|
|
3073
|
-
|
|
3074
|
-
} }, primaryKey: { get: () =>
|
|
3075
|
-
const
|
|
3076
|
-
return h === 1 ?
|
|
3077
|
-
} }, value: { get: () =>
|
|
3080
|
+
return d ? n.openCursor(l(c)).then((w) => w && function(y) {
|
|
3081
|
+
return Object.create(y, { continue: { value: function(m) {
|
|
3082
|
+
m != null ? y.continue(Ft(m, c.reverse ? e.MAX_KEY : e.MIN_KEY, p)) : c.unique ? y.continue(y.key.slice(0, h).concat(c.reverse ? e.MIN_KEY : e.MAX_KEY, p)) : y.continue();
|
|
3083
|
+
} }, continuePrimaryKey: { value(m, f) {
|
|
3084
|
+
y.continuePrimaryKey(Ft(m, e.MAX_KEY, p), f);
|
|
3085
|
+
} }, primaryKey: { get: () => y.primaryKey }, key: { get() {
|
|
3086
|
+
const m = y.key;
|
|
3087
|
+
return h === 1 ? m[0] : m.slice(0, h);
|
|
3088
|
+
} }, value: { get: () => y.value } });
|
|
3078
3089
|
}(w)) : n.openCursor(c);
|
|
3079
3090
|
} };
|
|
3080
3091
|
} };
|
|
@@ -3120,23 +3131,23 @@ const pa = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: (e) =>
|
|
|
3120
3131
|
}
|
|
3121
3132
|
return n.mutate(s);
|
|
3122
3133
|
function c(d) {
|
|
3123
|
-
const h = U.trans, w = d.keys || function(
|
|
3124
|
-
return g.type === "delete" ? g.keys : g.keys || g.values.map(
|
|
3134
|
+
const h = U.trans, w = d.keys || function(y, g) {
|
|
3135
|
+
return g.type === "delete" ? g.keys : g.keys || g.values.map(y.extractKey);
|
|
3125
3136
|
}(r, d);
|
|
3126
3137
|
if (!w)
|
|
3127
3138
|
throw new Error("Keys missing");
|
|
3128
|
-
return (d = d.type === "add" || d.type === "put" ? { ...d, keys: w } : { ...d }).type !== "delete" && (d.values = [...d.values]), d.keys && (d.keys = [...d.keys]), function(
|
|
3129
|
-
return g.type === "add" ? Promise.resolve([]) :
|
|
3130
|
-
}(n, d, w).then((
|
|
3131
|
-
const g = w.map((
|
|
3132
|
-
const v =
|
|
3139
|
+
return (d = d.type === "add" || d.type === "put" ? { ...d, keys: w } : { ...d }).type !== "delete" && (d.values = [...d.values]), d.keys && (d.keys = [...d.keys]), function(y, g, m) {
|
|
3140
|
+
return g.type === "add" ? Promise.resolve([]) : y.getMany({ trans: g.trans, keys: m, cache: "immutable" });
|
|
3141
|
+
}(n, d, w).then((y) => {
|
|
3142
|
+
const g = w.map((m, f) => {
|
|
3143
|
+
const v = y[f], b = { onerror: null, onsuccess: null };
|
|
3133
3144
|
if (d.type === "delete")
|
|
3134
|
-
a.fire.call(b,
|
|
3145
|
+
a.fire.call(b, m, v, h);
|
|
3135
3146
|
else if (d.type === "add" || v === void 0) {
|
|
3136
|
-
const _ = l.fire.call(b,
|
|
3137
|
-
|
|
3147
|
+
const _ = l.fire.call(b, m, d.values[f], h);
|
|
3148
|
+
m == null && _ != null && (m = _, d.keys[f] = m, r.outbound || ie(d.values[f], r.keyPath, m));
|
|
3138
3149
|
} else {
|
|
3139
|
-
const _ = Ur(v, d.values[f]), E = u.fire.call(b, _,
|
|
3150
|
+
const _ = Ur(v, d.values[f]), E = u.fire.call(b, _, m, v, h);
|
|
3140
3151
|
if (E) {
|
|
3141
3152
|
const S = d.values[f];
|
|
3142
3153
|
Object.keys(E).forEach((P) => {
|
|
@@ -3146,17 +3157,17 @@ const pa = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: (e) =>
|
|
|
3146
3157
|
}
|
|
3147
3158
|
return b;
|
|
3148
3159
|
});
|
|
3149
|
-
return n.mutate(d).then(({ failures:
|
|
3160
|
+
return n.mutate(d).then(({ failures: m, results: f, numFailures: v, lastResult: b }) => {
|
|
3150
3161
|
for (let _ = 0; _ < w.length; ++_) {
|
|
3151
3162
|
const E = f ? f[_] : w[_], S = g[_];
|
|
3152
|
-
E == null ? S.onerror && S.onerror(
|
|
3163
|
+
E == null ? S.onerror && S.onerror(m[_]) : S.onsuccess && S.onsuccess(d.type === "put" && y[_] ? d.values[_] : E);
|
|
3153
3164
|
}
|
|
3154
|
-
return { failures:
|
|
3155
|
-
}).catch((
|
|
3165
|
+
return { failures: m, results: f, numFailures: v, lastResult: b };
|
|
3166
|
+
}).catch((m) => (g.forEach((f) => f.onerror && f.onerror(m)), Promise.reject(m)));
|
|
3156
3167
|
});
|
|
3157
3168
|
}
|
|
3158
3169
|
function p(d, h, w) {
|
|
3159
|
-
return n.query({ trans: d, values: !1, query: { index: r, range: h }, limit: w }).then(({ result:
|
|
3170
|
+
return n.query({ trans: d, values: !1, query: { index: r, range: h }, limit: w }).then(({ result: y }) => c({ type: "delete", keys: y, trans: d }).then((g) => g.numFailures > 0 ? Promise.reject(g.failures[0]) : y.length < w ? { failures: [], numFailures: 0, lastResult: void 0 } : p(d, { ...h, lower: y[y.length - 1], lowerOpen: !0 }, w)));
|
|
3160
3171
|
}
|
|
3161
3172
|
} };
|
|
3162
3173
|
} }) };
|
|
@@ -3280,17 +3291,17 @@ const ma = { stack: "dbcore", level: 0, create: (e) => {
|
|
|
3280
3291
|
const t = e.schema.name, n = new ue(e.MIN_KEY, e.MAX_KEY);
|
|
3281
3292
|
return { ...e, table: (r) => {
|
|
3282
3293
|
const i = e.table(r), { schema: s } = i, { primaryKey: o } = s, { extractKey: a, outbound: l } = o, u = { ...i, mutate: (d) => {
|
|
3283
|
-
const h = d.trans, w = h.mutatedParts || (h.mutatedParts = {}),
|
|
3294
|
+
const h = d.trans, w = h.mutatedParts || (h.mutatedParts = {}), y = (E) => {
|
|
3284
3295
|
const S = `idb://${t}/${r}/${E}`;
|
|
3285
3296
|
return w[S] || (w[S] = new ue());
|
|
3286
|
-
}, g =
|
|
3297
|
+
}, g = y(""), m = y(":dels"), { type: f } = d;
|
|
3287
3298
|
let [v, b] = d.type === "deleteRange" ? [d.range] : d.type === "delete" ? [d.keys] : d.values.length < 50 ? [[], d.values] : [];
|
|
3288
3299
|
const _ = d.trans._cache;
|
|
3289
3300
|
return i.mutate(d).then((E) => {
|
|
3290
3301
|
if (z(v)) {
|
|
3291
3302
|
f !== "delete" && (v = E.results), g.addKeys(v);
|
|
3292
3303
|
const S = is(v, _);
|
|
3293
|
-
S || f === "add" ||
|
|
3304
|
+
S || f === "add" || m.addKeys(v), (S || b) && function(P, k, B, D) {
|
|
3294
3305
|
function V(M) {
|
|
3295
3306
|
const x = P(M.name || "");
|
|
3296
3307
|
function ve(J) {
|
|
@@ -3303,27 +3314,27 @@ const ma = { stack: "dbcore", level: 0, create: (e) => {
|
|
|
3303
3314
|
});
|
|
3304
3315
|
}
|
|
3305
3316
|
k.indexes.forEach(V);
|
|
3306
|
-
}(
|
|
3317
|
+
}(y, s, S, b);
|
|
3307
3318
|
} else if (v) {
|
|
3308
3319
|
const S = { from: v.lower, to: v.upper };
|
|
3309
|
-
|
|
3320
|
+
m.add(S), g.add(S);
|
|
3310
3321
|
} else
|
|
3311
|
-
g.add(n),
|
|
3322
|
+
g.add(n), m.add(n), s.indexes.forEach((S) => y(S.name).add(n));
|
|
3312
3323
|
return E;
|
|
3313
3324
|
});
|
|
3314
3325
|
} }, c = ({ query: { index: d, range: h } }) => {
|
|
3315
|
-
var w,
|
|
3316
|
-
return [d, new ue((w = h.lower) !== null && w !== void 0 ? w : e.MIN_KEY, (
|
|
3326
|
+
var w, y;
|
|
3327
|
+
return [d, new ue((w = h.lower) !== null && w !== void 0 ? w : e.MIN_KEY, (y = h.upper) !== null && y !== void 0 ? y : e.MAX_KEY)];
|
|
3317
3328
|
}, p = { get: (d) => [o, new ue(d.key)], getMany: (d) => [o, new ue().addKeys(d.keys)], count: c, query: c, openCursor: c };
|
|
3318
3329
|
return F(p).forEach((d) => {
|
|
3319
3330
|
u[d] = function(h) {
|
|
3320
3331
|
const { subscr: w } = U;
|
|
3321
3332
|
if (w) {
|
|
3322
|
-
const
|
|
3333
|
+
const y = (b) => {
|
|
3323
3334
|
const _ = `idb://${t}/${r}/${b}`;
|
|
3324
3335
|
return w[_] || (w[_] = new ue());
|
|
3325
|
-
}, g =
|
|
3326
|
-
if (
|
|
3336
|
+
}, g = y(""), m = y(":dels"), [f, v] = p[d](h);
|
|
3337
|
+
if (y(f.name || "").add(v), !f.isPrimaryKey) {
|
|
3327
3338
|
if (d !== "count") {
|
|
3328
3339
|
const b = d === "query" && l && h.values && i.query({ ...h, values: !1 });
|
|
3329
3340
|
return i[d].apply(this, arguments).then((_) => {
|
|
@@ -3331,18 +3342,18 @@ const ma = { stack: "dbcore", level: 0, create: (e) => {
|
|
|
3331
3342
|
if (l && h.values)
|
|
3332
3343
|
return b.then(({ result: S }) => (g.addKeys(S), _));
|
|
3333
3344
|
const E = h.values ? _.result.map(a) : _.result;
|
|
3334
|
-
h.values ? g.addKeys(E) :
|
|
3345
|
+
h.values ? g.addKeys(E) : m.addKeys(E);
|
|
3335
3346
|
} else if (d === "openCursor") {
|
|
3336
3347
|
const E = _, S = h.values;
|
|
3337
|
-
return E && Object.create(E, { key: { get: () => (
|
|
3348
|
+
return E && Object.create(E, { key: { get: () => (m.addKey(E.primaryKey), E.key) }, primaryKey: { get() {
|
|
3338
3349
|
const P = E.primaryKey;
|
|
3339
|
-
return
|
|
3350
|
+
return m.addKey(P), P;
|
|
3340
3351
|
} }, value: { get: () => (S && g.addKey(E.primaryKey), E.value) } });
|
|
3341
3352
|
}
|
|
3342
3353
|
return _;
|
|
3343
3354
|
});
|
|
3344
3355
|
}
|
|
3345
|
-
|
|
3356
|
+
m.add(n);
|
|
3346
3357
|
}
|
|
3347
3358
|
}
|
|
3348
3359
|
return i[d].apply(this, arguments);
|
|
@@ -3594,23 +3605,23 @@ function ga(e) {
|
|
|
3594
3605
|
i.start && i.start(u);
|
|
3595
3606
|
let c = !1, p = !1;
|
|
3596
3607
|
function d() {
|
|
3597
|
-
return F(l).some((
|
|
3608
|
+
return F(l).some((y) => a[y] && fa(a[y], l[y]));
|
|
3598
3609
|
}
|
|
3599
|
-
const h = (
|
|
3600
|
-
ss(a,
|
|
3610
|
+
const h = (y) => {
|
|
3611
|
+
ss(a, y), d() && w();
|
|
3601
3612
|
}, w = () => {
|
|
3602
3613
|
if (c || o)
|
|
3603
3614
|
return;
|
|
3604
3615
|
a = {};
|
|
3605
|
-
const
|
|
3616
|
+
const y = {}, g = function(m) {
|
|
3606
3617
|
s && it();
|
|
3607
|
-
const f = () => Le(e, { subscr:
|
|
3618
|
+
const f = () => Le(e, { subscr: m, trans: null }), v = U.trans ? st(U.transless, f) : f();
|
|
3608
3619
|
return s && v.then(we, we), v;
|
|
3609
|
-
}(
|
|
3610
|
-
p || (Ue(kt, h), p = !0), c = !0, Promise.resolve(g).then((
|
|
3611
|
-
n = !0, t =
|
|
3612
|
-
}, (
|
|
3613
|
-
c = !1, n = !1, i.error && i.error(
|
|
3620
|
+
}(y);
|
|
3621
|
+
p || (Ue(kt, h), p = !0), c = !0, Promise.resolve(g).then((m) => {
|
|
3622
|
+
n = !0, t = m, c = !1, o || (d() ? w() : (a = {}, l = y, i.next && i.next(m)));
|
|
3623
|
+
}, (m) => {
|
|
3624
|
+
c = !1, n = !1, i.error && i.error(m), u.unsubscribe();
|
|
3614
3625
|
});
|
|
3615
3626
|
};
|
|
3616
3627
|
return w(), u;
|
|
@@ -4040,15 +4051,15 @@ const qa = (e) => {
|
|
|
4040
4051
|
const p = e - un * 1e3, d = [];
|
|
4041
4052
|
let h = [];
|
|
4042
4053
|
I(`Getting events between ${new Date(e).toLocaleTimeString()} and ${new Date(t).toLocaleTimeString()}`), I(`Using batch duration: ${Jt}ms`);
|
|
4043
|
-
for (let
|
|
4044
|
-
if ([l, h] = await Ha(
|
|
4054
|
+
for (let y = p; y < t; y += Jt) {
|
|
4055
|
+
if ([l, h] = await Ha(y, e, t, l, Jt), !(h != null && h.length)) {
|
|
4045
4056
|
I("No events found");
|
|
4046
4057
|
continue;
|
|
4047
4058
|
}
|
|
4048
4059
|
u === 0 && (u = h[0].timestamp), c = h[h.length - 1].timestamp, I(`Last event time in batch: ${new Date(c).toLocaleTimeString()}`);
|
|
4049
|
-
const g = `${a ? "," : "["}${h.map((f) => f.event).join(",")}`,
|
|
4060
|
+
const g = `${a ? "," : "["}${h.map((f) => f.event).join(",")}`, m = r.encode(g);
|
|
4050
4061
|
n && s === null && (vt("Attempting compression"), o = new window.CompressionStream("gzip"), s = o.writable.getWriter()), as(() => {
|
|
4051
|
-
n && s ? s.write(
|
|
4062
|
+
n && s ? s.write(m) : d.push(m);
|
|
4052
4063
|
}, $e.ReplayCompression), a = !0;
|
|
4053
4064
|
}
|
|
4054
4065
|
if (c - u < cr)
|
|
@@ -4581,25 +4592,25 @@ const bs = async (e) => {
|
|
|
4581
4592
|
name: O.SurveyWillPresent,
|
|
4582
4593
|
[Xt.SurveyId]: l
|
|
4583
4594
|
});
|
|
4584
|
-
let
|
|
4595
|
+
let y, g = document.createElement("div"), m, f, v;
|
|
4585
4596
|
const b = (x) => {
|
|
4586
4597
|
const {
|
|
4587
4598
|
[ci.ViewVersion]: ve
|
|
4588
4599
|
} = x;
|
|
4589
4600
|
ve !== d["x-ul-sdk-version"] && hi(), R.removeListener(xn.VerifyViewVersion, b);
|
|
4590
4601
|
};
|
|
4591
|
-
R.on(xn.VerifyViewVersion, b), Xs(d) ? (
|
|
4602
|
+
R.on(xn.VerifyViewVersion, b), Xs(d) ? (y = "ul-direct-embeded-frame", m = document.head, f = window, v = !1, h && (pi(), g.id = y, window.UserLeap.container.appendChild(g), fi(), R.emit(O.SurveyLifeCycle, {
|
|
4592
4603
|
state: "presented"
|
|
4593
4604
|
}), R.emit(O.SurveyPresented, {
|
|
4594
4605
|
name: O.SurveyPresented,
|
|
4595
4606
|
[Xt.SurveyId]: l
|
|
4596
4607
|
}))) : {
|
|
4597
|
-
frameId:
|
|
4598
|
-
contentWinDocHead:
|
|
4608
|
+
frameId: y,
|
|
4609
|
+
contentWinDocHead: m,
|
|
4599
4610
|
contentWindow: f,
|
|
4600
4611
|
hasOverlay: v,
|
|
4601
4612
|
iframe: g
|
|
4602
|
-
} = Ds(s, w, l), window.UserLeap.frameId =
|
|
4613
|
+
} = Ds(s, w, l), window.UserLeap.frameId = y, window.UserLeap.useMobileStyling = w;
|
|
4603
4614
|
const _ = (x) => {
|
|
4604
4615
|
R.on(O.CloseSurveyOnOverlayClick, x);
|
|
4605
4616
|
}, E = Object.assign({
|
|
@@ -4651,7 +4662,7 @@ const bs = async (e) => {
|
|
|
4651
4662
|
if (E.installationMethod === He.Npm || E.installationMethod === He.NpmBundled) {
|
|
4652
4663
|
const {
|
|
4653
4664
|
default: x
|
|
4654
|
-
} = await import("./view-
|
|
4665
|
+
} = await import("./view-BxLGbeCm.js");
|
|
4655
4666
|
x.configure(E), v && window.UserLeap.container && D();
|
|
4656
4667
|
} else
|
|
4657
4668
|
P && (B.src = P, v && B.addEventListener("load", () => {
|
|
@@ -4662,7 +4673,7 @@ const bs = async (e) => {
|
|
|
4662
4673
|
capture: !0,
|
|
4663
4674
|
once: !0
|
|
4664
4675
|
}));
|
|
4665
|
-
return
|
|
4676
|
+
return m == null || m.appendChild(B), {
|
|
4666
4677
|
success: !0,
|
|
4667
4678
|
surveyState: re.Ready,
|
|
4668
4679
|
surveyId: l,
|
|
@@ -4719,7 +4730,7 @@ const Rl = function(e) {
|
|
|
4719
4730
|
if (!window.UserLeap)
|
|
4720
4731
|
return;
|
|
4721
4732
|
const t = async (r = {}) => {
|
|
4722
|
-
var
|
|
4733
|
+
var y, g, m, f;
|
|
4723
4734
|
const {
|
|
4724
4735
|
userId: i,
|
|
4725
4736
|
anonymousId: s,
|
|
@@ -4751,11 +4762,11 @@ const Rl = function(e) {
|
|
|
4751
4762
|
};
|
|
4752
4763
|
}
|
|
4753
4764
|
const p = window.location.href;
|
|
4754
|
-
if (o.url || (o.url = p), X("trackStartUrl", p), (g = (
|
|
4765
|
+
if (o.url || (o.url = p), X("trackStartUrl", p), (g = (y = window.UserLeap) == null ? void 0 : y._config) != null && g.optimizelyEnabled) {
|
|
4755
4766
|
const v = et(window.UserLeap);
|
|
4756
4767
|
Dr(v) || Mt.getAndSetWebOptimizelyExperiments(), o.optimizelyExperiments = Object.assign({}, Mt.getAllOptimizelyExperiments());
|
|
4757
4768
|
}
|
|
4758
|
-
(f = (
|
|
4769
|
+
(f = (m = window.UserLeap) == null ? void 0 : m._config) != null && f.launchDarklyEnabled && (o.launchDarklyFlags = Pn.getAllLaunchDarklyVariations()), i && (window.UserLeap.userId = i), s && (window.UserLeap.partnerAnonymousId = s), a && (o.eventProperties = a), nl({
|
|
4759
4770
|
name: u,
|
|
4760
4771
|
url: o.url
|
|
4761
4772
|
}), I(`Tracking event: ${u}`);
|