@dialecte/core 0.1.0 → 0.1.2
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/document/query/find/descendant/find-descendant.types.d.ts +2 -2
- package/dist/document/query/find/descendant/find-descendant.types.d.ts.map +1 -1
- package/dist/document/query/main.d.ts +134 -10
- package/dist/document/query/main.d.ts.map +1 -1
- package/dist/document/transaction/main.d.ts +53 -0
- package/dist/document/transaction/main.d.ts.map +1 -1
- package/dist/{index--bGUvjR6.js → index-CCEg5JAo.js} +1049 -920
- package/dist/index.js +1 -1
- package/dist/test.js +1 -1
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { toRef as Ne, isRecordOf as ur, toTreeRecord as cr, toRawRecord as or, standardizeRecord as Ya, toFullAttributeArray as za, CUSTOM_RECORD_ID_ATTRIBUTE as ia } from "./helpers.js";
|
|
2
|
-
import { t as Me, a as
|
|
2
|
+
import { t as Me, a as $e } from "./index-B67NZSGJ.js";
|
|
3
3
|
async function dr(g) {
|
|
4
4
|
const { context: u, tagName: c, attributes: i } = g, h = await ua({ context: u, tagName: c }), m = [];
|
|
5
5
|
for (const y of h)
|
|
@@ -247,7 +247,7 @@ async function ua(g) {
|
|
|
247
247
|
}
|
|
248
248
|
async function ca(g) {
|
|
249
249
|
const { context: u, ref: c, options: i = {} } = g, { include: h, exclude: m, unwrap: y } = i, N = await Re({ context: u, ref: c });
|
|
250
|
-
|
|
250
|
+
$e(N, {
|
|
251
251
|
detail: "No record found for provided ref",
|
|
252
252
|
method: "getTree",
|
|
253
253
|
key: "ELEMENT_NOT_FOUND"
|
|
@@ -358,22 +358,77 @@ class fa {
|
|
|
358
358
|
};
|
|
359
359
|
}
|
|
360
360
|
//== Record lookup
|
|
361
|
+
/**
|
|
362
|
+
* Get the root element of the document.
|
|
363
|
+
*
|
|
364
|
+
* @returns The root record, or `undefined` if the database is empty.
|
|
365
|
+
*
|
|
366
|
+
* @example
|
|
367
|
+
* ```ts
|
|
368
|
+
* const root = await query.getRoot()
|
|
369
|
+
* ```
|
|
370
|
+
*/
|
|
361
371
|
async getRoot() {
|
|
362
372
|
return Re({
|
|
363
373
|
context: this.context,
|
|
364
374
|
ref: { tagName: this.dialecteConfig.rootElementName }
|
|
365
375
|
});
|
|
366
376
|
}
|
|
377
|
+
/**
|
|
378
|
+
* Get a single record by ref, record, or relationship.
|
|
379
|
+
*
|
|
380
|
+
* @param refOrRecord - A ref `{ tagName, id }`, or any record/relationship.
|
|
381
|
+
* @returns The tracked record, or `undefined` if not found.
|
|
382
|
+
*
|
|
383
|
+
* @example
|
|
384
|
+
* ```ts
|
|
385
|
+
* const ied = await query.getRecord({ tagName: 'IED', id: knownId })
|
|
386
|
+
* ```
|
|
387
|
+
*/
|
|
367
388
|
async getRecord(u) {
|
|
368
389
|
return Re({ context: this.context, ref: Ne(u) });
|
|
369
390
|
}
|
|
391
|
+
/**
|
|
392
|
+
* Get multiple records in a single call.
|
|
393
|
+
*
|
|
394
|
+
* @param refsOrRecords - Array of refs, records, or relationships.
|
|
395
|
+
* @returns Array of tracked records (same order, `undefined` for missing).
|
|
396
|
+
*
|
|
397
|
+
* @example
|
|
398
|
+
* ```ts
|
|
399
|
+
* const [bay1, bay2] = await query.getRecords([ref1, ref2])
|
|
400
|
+
* ```
|
|
401
|
+
*/
|
|
370
402
|
async getRecords(u) {
|
|
371
403
|
const c = u.map((i) => Ne(i));
|
|
372
404
|
return li({ context: this.context, refs: c });
|
|
373
405
|
}
|
|
406
|
+
/**
|
|
407
|
+
* Get all records of a given tag name.
|
|
408
|
+
*
|
|
409
|
+
* @param tagName - The element type to retrieve.
|
|
410
|
+
* @returns All tracked records matching that tag name.
|
|
411
|
+
*
|
|
412
|
+
* @example
|
|
413
|
+
* ```ts
|
|
414
|
+
* const ieds = await query.getRecordsByTagName('IED')
|
|
415
|
+
* ```
|
|
416
|
+
*/
|
|
374
417
|
async getRecordsByTagName(u) {
|
|
375
418
|
return ua({ context: this.context, tagName: u });
|
|
376
419
|
}
|
|
420
|
+
/**
|
|
421
|
+
* Find all descendants of an element, grouped by tag name.
|
|
422
|
+
*
|
|
423
|
+
* @param refOrRecord - The ancestor element.
|
|
424
|
+
* @param filter - Optional filter to restrict which tag names are returned.
|
|
425
|
+
* @returns Object keyed by tag name, each value an array of tracked records.
|
|
426
|
+
*
|
|
427
|
+
* @example
|
|
428
|
+
* ```ts
|
|
429
|
+
* const { Bay, VoltageLevel } = await query.findDescendants(substation)
|
|
430
|
+
* ```
|
|
431
|
+
*/
|
|
377
432
|
async findDescendants(u, c) {
|
|
378
433
|
return Qa({
|
|
379
434
|
context: this.context,
|
|
@@ -382,29 +437,44 @@ class fa {
|
|
|
382
437
|
filter: c
|
|
383
438
|
});
|
|
384
439
|
}
|
|
385
|
-
async getTree(u, c) {
|
|
386
|
-
return ca({ context: this.context, ref: Ne(u), options: c });
|
|
387
|
-
}
|
|
388
|
-
//== Attribute queries
|
|
389
440
|
/**
|
|
441
|
+
* Build a full tree structure from an element down.
|
|
442
|
+
*
|
|
443
|
+
* @param refOrRecord - The root of the subtree.
|
|
444
|
+
* @param options - Optional depth/filter controls.
|
|
445
|
+
* @returns A tree record with nested children, or `undefined` if not found.
|
|
446
|
+
*
|
|
390
447
|
* @example
|
|
391
|
-
*
|
|
392
|
-
* await
|
|
448
|
+
* ```ts
|
|
449
|
+
* const tree = await query.getTree(bay)
|
|
450
|
+
* ```
|
|
393
451
|
*/
|
|
452
|
+
async getTree(u, c) {
|
|
453
|
+
return ca({ context: this.context, ref: Ne(u), options: c });
|
|
454
|
+
}
|
|
394
455
|
async getAttribute(u, c) {
|
|
395
456
|
const i = Ne(u), { fullObject: h } = c;
|
|
396
457
|
return h ? ii({ context: this.context, ref: i, ...c }) : ai({ context: this.context, ref: i, ...c });
|
|
397
458
|
}
|
|
398
|
-
/**
|
|
399
|
-
* @example
|
|
400
|
-
* const { name, desc } = await doc.query.getAttributes({ ref }) // destructurable
|
|
401
|
-
* const fullAttrs = await doc.query.getAttributes({ ref, fullObject: true }) // FullAttributeObject[]
|
|
402
|
-
*/
|
|
403
459
|
async getAttributes(u, c) {
|
|
404
460
|
const i = Ne(u), { fullObject: h } = c || {};
|
|
405
461
|
return h ? si({ context: this.context, ref: i, ...c }) : oi({ context: this.context, ref: i, ...c });
|
|
406
462
|
}
|
|
407
463
|
//== Find queries
|
|
464
|
+
/**
|
|
465
|
+
* Find records matching specific attribute values.
|
|
466
|
+
*
|
|
467
|
+
* @param params - Tag name and attribute filter criteria.
|
|
468
|
+
* @returns All matching tracked records.
|
|
469
|
+
*
|
|
470
|
+
* @example
|
|
471
|
+
* ```ts
|
|
472
|
+
* const bays = await query.findByAttributes({
|
|
473
|
+
* tagName: 'Bay',
|
|
474
|
+
* attributes: { name: 'Q01' },
|
|
475
|
+
* })
|
|
476
|
+
* ```
|
|
477
|
+
*/
|
|
408
478
|
async findByAttributes(u) {
|
|
409
479
|
return dr({ context: this.context, ...u });
|
|
410
480
|
}
|
|
@@ -412,15 +482,15 @@ class fa {
|
|
|
412
482
|
function ze(g) {
|
|
413
483
|
const { context: u, status: c, record: i, oldRecord: h, newRecord: m } = g;
|
|
414
484
|
let y, N, R;
|
|
415
|
-
i && (y = or(i)), h && (N = or(h)), m && (R = or(m)), c === "created" ? (
|
|
485
|
+
i && (y = or(i)), h && (N = or(h)), m && (R = or(m)), c === "created" ? ($e(y, {
|
|
416
486
|
detail: "Record is required for created",
|
|
417
487
|
method: "stageOperation",
|
|
418
488
|
key: "ELEMENT_NOT_FOUND"
|
|
419
|
-
}), u.stagedOperations.push({ status: c, oldRecord: void 0, newRecord: y })) : c === "updated" ? (
|
|
489
|
+
}), u.stagedOperations.push({ status: c, oldRecord: void 0, newRecord: y })) : c === "updated" ? ($e(N && R, {
|
|
420
490
|
detail: "Old record and new record are required for updated",
|
|
421
491
|
method: "stageOperation",
|
|
422
492
|
key: "ELEMENT_NOT_FOUND"
|
|
423
|
-
}), u.stagedOperations.push({ status: c, oldRecord: N, newRecord: R })) : c === "deleted" && y && (
|
|
493
|
+
}), u.stagedOperations.push({ status: c, oldRecord: N, newRecord: R })) : c === "deleted" && y && ($e(y, {
|
|
424
494
|
detail: "Record is required for deleted",
|
|
425
495
|
method: "stageOperation",
|
|
426
496
|
key: "ELEMENT_NOT_FOUND"
|
|
@@ -448,7 +518,7 @@ function gi(g) {
|
|
|
448
518
|
}
|
|
449
519
|
async function da(g) {
|
|
450
520
|
const { dialecteConfig: u, context: c, parentRef: i, params: h } = g, { id: m, tagName: y, attributes: N, namespace: R, value: j } = h, X = await Re({ context: c, ref: i });
|
|
451
|
-
|
|
521
|
+
$e(X, {
|
|
452
522
|
detail: "Parent record not found",
|
|
453
523
|
method: "addChild",
|
|
454
524
|
key: "ELEMENT_NOT_FOUND",
|
|
@@ -583,18 +653,18 @@ async function bi(g) {
|
|
|
583
653
|
}
|
|
584
654
|
async function wi(g) {
|
|
585
655
|
const { context: u, ref: c } = g, i = await Re({ context: u, ref: c });
|
|
586
|
-
|
|
656
|
+
$e(i, {
|
|
587
657
|
detail: `Record not found (tagName=${c.tagName}, id=${c.id})`,
|
|
588
658
|
method: "delete",
|
|
589
659
|
key: "ELEMENT_NOT_FOUND",
|
|
590
660
|
ref: c
|
|
591
|
-
}),
|
|
661
|
+
}), $e(i.parent, {
|
|
592
662
|
detail: "Cannot delete root element",
|
|
593
663
|
method: "delete",
|
|
594
664
|
key: "PROTECTED_ROOT"
|
|
595
665
|
}), await ma({ context: u, record: i }), ze({ context: u, status: "deleted", record: i });
|
|
596
666
|
const h = Ne(i.parent), m = await Re({ context: u, ref: h });
|
|
597
|
-
|
|
667
|
+
$e(m, {
|
|
598
668
|
detail: `Parent record not found (tagName=${i.parent.tagName}, id=${i.parent.id})`,
|
|
599
669
|
method: "delete",
|
|
600
670
|
key: "ELEMENT_NOT_FOUND"
|
|
@@ -614,7 +684,7 @@ async function ma(g) {
|
|
|
614
684
|
}
|
|
615
685
|
async function _i(g) {
|
|
616
686
|
const { dialecteConfig: u, context: c, ref: i, params: h } = g, { attributes: m, value: y } = h, N = await Re({ context: c, ref: i });
|
|
617
|
-
|
|
687
|
+
$e(N, {
|
|
618
688
|
detail: `Record not found (tagName=${i.tagName}, id=${i.id})`,
|
|
619
689
|
method: "update",
|
|
620
690
|
key: "ELEMENT_NOT_FOUND",
|
|
@@ -664,6 +734,21 @@ class Ti extends fa {
|
|
|
664
734
|
};
|
|
665
735
|
}
|
|
666
736
|
//== Mutation methods
|
|
737
|
+
/**
|
|
738
|
+
* Add a child element to a parent.
|
|
739
|
+
*
|
|
740
|
+
* @param parentRefOrRecord - The parent element (ref, record, or relationship). `undefined` for root.
|
|
741
|
+
* @param params - Child tagName, attributes and optional namespace, value, id.
|
|
742
|
+
* @returns Ref to the created child.
|
|
743
|
+
*
|
|
744
|
+
* @example
|
|
745
|
+
* ```ts
|
|
746
|
+
* const bayRef = await tx.addChild(substation, {
|
|
747
|
+
* tagName: 'VoltageLevel',
|
|
748
|
+
* attributes: { name: 'VL1' },
|
|
749
|
+
* })
|
|
750
|
+
* ```
|
|
751
|
+
*/
|
|
667
752
|
async addChild(u, c) {
|
|
668
753
|
return da({
|
|
669
754
|
context: this.context,
|
|
@@ -672,6 +757,20 @@ class Ti extends fa {
|
|
|
672
757
|
dialecteConfig: this.dialecteConfig
|
|
673
758
|
});
|
|
674
759
|
}
|
|
760
|
+
/**
|
|
761
|
+
* Update attributes of an existing element.
|
|
762
|
+
*
|
|
763
|
+
* @param refOrRecord - The element to update (ref, record, or relationship).
|
|
764
|
+
* @param params - New attribute values.
|
|
765
|
+
* @returns Ref to the updated element.
|
|
766
|
+
*
|
|
767
|
+
* @example
|
|
768
|
+
* ```ts
|
|
769
|
+
* await tx.update(bay, {
|
|
770
|
+
* attributes: { name: 'Q02', desc: 'Feeder bay' },
|
|
771
|
+
* })
|
|
772
|
+
* ```
|
|
773
|
+
*/
|
|
675
774
|
async update(u, c) {
|
|
676
775
|
return _i({
|
|
677
776
|
context: this.context,
|
|
@@ -680,9 +779,33 @@ class Ti extends fa {
|
|
|
680
779
|
dialecteConfig: this.dialecteConfig
|
|
681
780
|
});
|
|
682
781
|
}
|
|
782
|
+
/**
|
|
783
|
+
* Delete an element and its entire subtree.
|
|
784
|
+
*
|
|
785
|
+
* @param refOrRecord - The element to delete (ref, record, or relationship).
|
|
786
|
+
* @returns Ref to the deleted element's parent.
|
|
787
|
+
*
|
|
788
|
+
* @example
|
|
789
|
+
* ```ts
|
|
790
|
+
* const parentRef = await tx.delete(bay)
|
|
791
|
+
* ```
|
|
792
|
+
*/
|
|
683
793
|
async delete(u) {
|
|
684
794
|
return wi({ context: this.context, ref: Ne(u) });
|
|
685
795
|
}
|
|
796
|
+
/**
|
|
797
|
+
* Deep-clone a subtree under a new parent.
|
|
798
|
+
*
|
|
799
|
+
* @param parentRefOrRecord - The target parent for the clone.
|
|
800
|
+
* @param record - The tree record to clone (from `getTree`).
|
|
801
|
+
* @returns The cloned root ref and an ID mapping from old to new.
|
|
802
|
+
*
|
|
803
|
+
* @example
|
|
804
|
+
* ```ts
|
|
805
|
+
* const tree = await tx.getTree(bay)
|
|
806
|
+
* const { ref, idMap } = await tx.deepClone(substation, tree)
|
|
807
|
+
* ```
|
|
808
|
+
*/
|
|
686
809
|
async deepClone(u, c) {
|
|
687
810
|
return yi({
|
|
688
811
|
dialecteConfig: this.dialecteConfig,
|
|
@@ -928,7 +1051,7 @@ function Ai() {
|
|
|
928
1051
|
}).apply(this, arguments);
|
|
929
1052
|
};
|
|
930
1053
|
function h(e, t, n) {
|
|
931
|
-
for (var r, a = 0,
|
|
1054
|
+
for (var r, a = 0, s = t.length; a < s; a++) !r && a in t || ((r = r || Array.prototype.slice.call(t, 0, a))[a] = t[a]);
|
|
932
1055
|
return e.concat(r || Array.prototype.slice.call(t));
|
|
933
1056
|
}
|
|
934
1057
|
var m = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Ei, y = Object.keys, N = Array.isArray;
|
|
@@ -974,8 +1097,8 @@ function Ai() {
|
|
|
974
1097
|
if (!t) return e;
|
|
975
1098
|
if (typeof t != "string") {
|
|
976
1099
|
for (var n = [], r = 0, a = t.length; r < a; ++r) {
|
|
977
|
-
var
|
|
978
|
-
n.push(
|
|
1100
|
+
var s = pe(e, t[r]);
|
|
1101
|
+
n.push(s);
|
|
979
1102
|
}
|
|
980
1103
|
return n;
|
|
981
1104
|
}
|
|
@@ -990,20 +1113,20 @@ function Ai() {
|
|
|
990
1113
|
Y(typeof n != "string" && "length" in n);
|
|
991
1114
|
for (var r = 0, a = t.length; r < a; ++r) ne(e, t[r], n[r]);
|
|
992
1115
|
} else {
|
|
993
|
-
var
|
|
994
|
-
d !== -1 ? (
|
|
1116
|
+
var s, f, d = t.indexOf(".");
|
|
1117
|
+
d !== -1 ? (s = t.substr(0, d), (f = t.substr(d + 1)) === "" ? n === void 0 ? N(e) && !isNaN(parseInt(s)) ? e.splice(s, 1) : delete e[s] : e[s] = n : ne(d = !(d = e[s]) || !W(e, s) ? e[s] = {} : d, f, n)) : n === void 0 ? N(e) && !isNaN(parseInt(t)) ? e.splice(t, 1) : delete e[t] : e[t] = n;
|
|
995
1118
|
}
|
|
996
1119
|
}
|
|
997
|
-
function
|
|
1120
|
+
function Ie(e) {
|
|
998
1121
|
var t, n = {};
|
|
999
1122
|
for (t in e) W(e, t) && (n[t] = e[t]);
|
|
1000
1123
|
return n;
|
|
1001
1124
|
}
|
|
1002
|
-
var
|
|
1003
|
-
function
|
|
1004
|
-
return
|
|
1125
|
+
var I = [].concat;
|
|
1126
|
+
function Dt(e) {
|
|
1127
|
+
return I.apply([], e);
|
|
1005
1128
|
}
|
|
1006
|
-
var ct = "BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(
|
|
1129
|
+
var ct = "BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(Dt([8, 16, 32, 64].map(function(e) {
|
|
1007
1130
|
return ["Int", "Uint", "Float"].map(function(t) {
|
|
1008
1131
|
return t + e + "Array";
|
|
1009
1132
|
});
|
|
@@ -1012,14 +1135,14 @@ function Ai() {
|
|
|
1012
1135
|
}), He = new Set(ct.map(function(e) {
|
|
1013
1136
|
return m[e];
|
|
1014
1137
|
})), de = null;
|
|
1015
|
-
function
|
|
1138
|
+
function ke(e) {
|
|
1016
1139
|
return de = /* @__PURE__ */ new WeakMap(), e = (function t(n) {
|
|
1017
1140
|
if (!n || typeof n != "object") return n;
|
|
1018
1141
|
var r = de.get(n);
|
|
1019
1142
|
if (r) return r;
|
|
1020
1143
|
if (N(n)) {
|
|
1021
1144
|
r = [], de.set(n, r);
|
|
1022
|
-
for (var a = 0,
|
|
1145
|
+
for (var a = 0, s = n.length; a < s; ++a) r.push(t(n[a]));
|
|
1023
1146
|
} else if (He.has(n.constructor)) r = n;
|
|
1024
1147
|
else {
|
|
1025
1148
|
var f, d = j(n);
|
|
@@ -1029,7 +1152,7 @@ function Ai() {
|
|
|
1029
1152
|
})(e), de = null, e;
|
|
1030
1153
|
}
|
|
1031
1154
|
var zt = {}.toString;
|
|
1032
|
-
function
|
|
1155
|
+
function Ke(e) {
|
|
1033
1156
|
return zt.call(e).slice(8, -1);
|
|
1034
1157
|
}
|
|
1035
1158
|
var bt = typeof Symbol < "u" ? Symbol.iterator : "@@iterator", le = typeof bt == "symbol" ? function(e) {
|
|
@@ -1041,12 +1164,12 @@ function Ai() {
|
|
|
1041
1164
|
function Xe(e, t) {
|
|
1042
1165
|
return t = e.indexOf(t), 0 <= t && e.splice(t, 1), 0 <= t;
|
|
1043
1166
|
}
|
|
1044
|
-
var
|
|
1167
|
+
var Ue = {};
|
|
1045
1168
|
function Fe(e) {
|
|
1046
1169
|
var t, n, r, a;
|
|
1047
1170
|
if (arguments.length === 1) {
|
|
1048
1171
|
if (N(e)) return e.slice();
|
|
1049
|
-
if (this ===
|
|
1172
|
+
if (this === Ue && typeof e == "string") return [e];
|
|
1050
1173
|
if (a = le(e)) {
|
|
1051
1174
|
for (n = []; !(r = a.next()).done; ) n.push(r.value);
|
|
1052
1175
|
return n;
|
|
@@ -1059,11 +1182,11 @@ function Ai() {
|
|
|
1059
1182
|
for (t = arguments.length, n = new Array(t); t--; ) n[t] = arguments[t];
|
|
1060
1183
|
return n;
|
|
1061
1184
|
}
|
|
1062
|
-
var
|
|
1185
|
+
var qe = typeof Symbol < "u" ? function(e) {
|
|
1063
1186
|
return e[Symbol.toStringTag] === "AsyncFunction";
|
|
1064
1187
|
} : function() {
|
|
1065
1188
|
return !1;
|
|
1066
|
-
},
|
|
1189
|
+
}, kt = ["Unknown", "Constraint", "Data", "TransactionInactive", "ReadOnly", "Version", "NotFound", "InvalidState", "InvalidAccess", "Abort", "Timeout", "QuotaExceeded", "Syntax", "DataClone"], je = ["Modify", "Bulk", "OpenFailed", "VersionChange", "Schema", "Upgrade", "InvalidTable", "MissingAPI", "NoSuchDatabase", "InvalidArgument", "SubTransaction", "Unsupported", "Internal", "DatabaseClosed", "PrematureCommit", "ForeignAwait"].concat(kt), It = { VersionChanged: "Database version changed by other database connection", DatabaseClosed: "Database has been closed", Abort: "Transaction aborted", TransactionInactive: "Transaction has already completed or failed", MissingAPI: "IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb" };
|
|
1067
1190
|
function Ze(e, t) {
|
|
1068
1191
|
this.name = e, this.message = t;
|
|
1069
1192
|
}
|
|
@@ -1088,19 +1211,19 @@ function Ai() {
|
|
|
1088
1211
|
} }), F(Je).from(Ze), F(et).from(Ze);
|
|
1089
1212
|
var l = je.reduce(function(e, t) {
|
|
1090
1213
|
return e[t] = t + "Error", e;
|
|
1091
|
-
}, {}),
|
|
1214
|
+
}, {}), o = Ze, C = je.reduce(function(e, t) {
|
|
1092
1215
|
var n = t + "Error";
|
|
1093
|
-
function r(a,
|
|
1094
|
-
this.name = n, a ? typeof a == "string" ? (this.message = "".concat(a).concat(
|
|
1095
|
-
` +
|
|
1216
|
+
function r(a, s) {
|
|
1217
|
+
this.name = n, a ? typeof a == "string" ? (this.message = "".concat(a).concat(s ? `
|
|
1218
|
+
` + s : ""), this.inner = s || null) : typeof a == "object" && (this.message = "".concat(a.name, " ").concat(a.message), this.inner = a) : (this.message = It[t] || n, this.inner = null);
|
|
1096
1219
|
}
|
|
1097
|
-
return F(r).from(
|
|
1220
|
+
return F(r).from(o), e[t] = r, e;
|
|
1098
1221
|
}, {});
|
|
1099
|
-
|
|
1100
|
-
var E =
|
|
1101
|
-
return e[t + "Error"] =
|
|
1222
|
+
C.Syntax = SyntaxError, C.Type = TypeError, C.Range = RangeError;
|
|
1223
|
+
var E = kt.reduce(function(e, t) {
|
|
1224
|
+
return e[t + "Error"] = C[t], e;
|
|
1102
1225
|
}, {}), ie = je.reduce(function(e, t) {
|
|
1103
|
-
return ["Syntax", "Type", "Range"].indexOf(t) === -1 && (e[t + "Error"] =
|
|
1226
|
+
return ["Syntax", "Type", "Range"].indexOf(t) === -1 && (e[t + "Error"] = C[t]), e;
|
|
1104
1227
|
}, {});
|
|
1105
1228
|
function Q() {
|
|
1106
1229
|
}
|
|
@@ -1123,8 +1246,8 @@ function Ai() {
|
|
|
1123
1246
|
n !== void 0 && (arguments[0] = n);
|
|
1124
1247
|
var r = this.onsuccess, a = this.onerror;
|
|
1125
1248
|
this.onsuccess = null, this.onerror = null;
|
|
1126
|
-
var
|
|
1127
|
-
return r && (this.onsuccess = this.onsuccess ? ye(r, this.onsuccess) : r), a && (this.onerror = this.onerror ? ye(a, this.onerror) : a),
|
|
1249
|
+
var s = t.apply(this, arguments);
|
|
1250
|
+
return r && (this.onsuccess = this.onsuccess ? ye(r, this.onsuccess) : r), a && (this.onerror = this.onerror ? ye(a, this.onerror) : a), s !== void 0 ? s : n;
|
|
1128
1251
|
};
|
|
1129
1252
|
}
|
|
1130
1253
|
function _e(e, t) {
|
|
@@ -1134,12 +1257,12 @@ function Ai() {
|
|
|
1134
1257
|
this.onsuccess = this.onerror = null, t.apply(this, arguments), n && (this.onsuccess = this.onsuccess ? ye(n, this.onsuccess) : n), r && (this.onerror = this.onerror ? ye(r, this.onerror) : r);
|
|
1135
1258
|
};
|
|
1136
1259
|
}
|
|
1137
|
-
function
|
|
1260
|
+
function Le(e, t) {
|
|
1138
1261
|
return e === Q ? t : function(n) {
|
|
1139
1262
|
var r = e.apply(this, arguments);
|
|
1140
1263
|
R(n, r);
|
|
1141
|
-
var a = this.onsuccess,
|
|
1142
|
-
return this.onsuccess = null, this.onerror = null, n = t.apply(this, arguments), a && (this.onsuccess = this.onsuccess ? ye(a, this.onsuccess) : a),
|
|
1264
|
+
var a = this.onsuccess, s = this.onerror;
|
|
1265
|
+
return this.onsuccess = null, this.onerror = null, n = t.apply(this, arguments), a && (this.onsuccess = this.onsuccess ? ye(a, this.onsuccess) : a), s && (this.onerror = this.onerror ? ye(s, this.onerror) : s), r === void 0 ? n === void 0 ? void 0 : n : R(r, n);
|
|
1143
1266
|
};
|
|
1144
1267
|
}
|
|
1145
1268
|
function Nn(e, t) {
|
|
@@ -1151,25 +1274,25 @@ function Ai() {
|
|
|
1151
1274
|
return e === Q ? t : function() {
|
|
1152
1275
|
var n = e.apply(this, arguments);
|
|
1153
1276
|
if (n && typeof n.then == "function") {
|
|
1154
|
-
for (var r = this, a = arguments.length,
|
|
1277
|
+
for (var r = this, a = arguments.length, s = new Array(a); a--; ) s[a] = arguments[a];
|
|
1155
1278
|
return n.then(function() {
|
|
1156
|
-
return t.apply(r,
|
|
1279
|
+
return t.apply(r, s);
|
|
1157
1280
|
});
|
|
1158
1281
|
}
|
|
1159
1282
|
return t.apply(this, arguments);
|
|
1160
1283
|
};
|
|
1161
1284
|
}
|
|
1162
1285
|
ie.ModifyError = Je, ie.DexieError = Ze, ie.BulkError = et;
|
|
1163
|
-
var
|
|
1286
|
+
var Pe = typeof location < "u" && /^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);
|
|
1164
1287
|
function Rt(e) {
|
|
1165
|
-
|
|
1288
|
+
Pe = e;
|
|
1166
1289
|
}
|
|
1167
|
-
var
|
|
1290
|
+
var Pt = {}, pr = 100, ct = typeof Promise > "u" ? [] : (function() {
|
|
1168
1291
|
var e = Promise.resolve();
|
|
1169
1292
|
if (typeof crypto > "u" || !crypto.subtle) return [e, j(e), e];
|
|
1170
1293
|
var t = crypto.subtle.digest("SHA-512", new Uint8Array([0]));
|
|
1171
1294
|
return [t, j(t), e];
|
|
1172
|
-
})(),
|
|
1295
|
+
})(), kt = ct[0], je = ct[1], ct = ct[2], je = je && je.then, lt = kt && kt.constructor, An = !!ct, Ft = function(e, t) {
|
|
1173
1296
|
Bt.push([e, t]), Qt && (queueMicrotask(xa), Qt = !1);
|
|
1174
1297
|
}, On = !0, Qt = !0, ft = [], Ht = [], Cn = he, nt = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: Q, pgp: !1, env: {}, finalize: Q }, z = nt, Bt = [], dt = 0, Zt = [];
|
|
1175
1298
|
function G(e) {
|
|
@@ -1177,43 +1300,43 @@ function Ai() {
|
|
|
1177
1300
|
this._listeners = [], this._lib = !1;
|
|
1178
1301
|
var t = this._PSD = z;
|
|
1179
1302
|
if (typeof e != "function") {
|
|
1180
|
-
if (e !==
|
|
1181
|
-
return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 &&
|
|
1303
|
+
if (e !== Pt) throw new TypeError("Not a function");
|
|
1304
|
+
return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 && In(this, this._value));
|
|
1182
1305
|
}
|
|
1183
1306
|
this._state = null, this._value = null, ++t.ref, (function n(r, a) {
|
|
1184
1307
|
try {
|
|
1185
|
-
a(function(
|
|
1308
|
+
a(function(s) {
|
|
1186
1309
|
if (r._state === null) {
|
|
1187
|
-
if (
|
|
1310
|
+
if (s === r) throw new TypeError("A promise cannot be resolved with itself.");
|
|
1188
1311
|
var f = r._lib && _t();
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
}) : (r._state = !0, r._value =
|
|
1312
|
+
s && typeof s.then == "function" ? n(r, function(d, v) {
|
|
1313
|
+
s instanceof G ? s._then(d, v) : s.then(d, v);
|
|
1314
|
+
}) : (r._state = !0, r._value = s, yr(r)), f && Tt();
|
|
1192
1315
|
}
|
|
1193
|
-
},
|
|
1194
|
-
} catch (
|
|
1195
|
-
|
|
1316
|
+
}, In.bind(null, r));
|
|
1317
|
+
} catch (s) {
|
|
1318
|
+
In(r, s);
|
|
1196
1319
|
}
|
|
1197
1320
|
})(this, e);
|
|
1198
1321
|
}
|
|
1199
|
-
var
|
|
1322
|
+
var Dn = { get: function() {
|
|
1200
1323
|
var e = z, t = nn;
|
|
1201
1324
|
function n(r, a) {
|
|
1202
|
-
var
|
|
1203
|
-
Sn(
|
|
1325
|
+
var s = this, f = !e.global && (e !== z || t !== nn), d = f && !at(), v = new G(function(w, T) {
|
|
1326
|
+
Sn(s, new gr(br(r, e, f, d), br(a, e, f, d), w, T, e));
|
|
1204
1327
|
});
|
|
1205
1328
|
return this._consoleTask && (v._consoleTask = this._consoleTask), v;
|
|
1206
1329
|
}
|
|
1207
|
-
return n.prototype =
|
|
1330
|
+
return n.prototype = Pt, n;
|
|
1208
1331
|
}, set: function(e) {
|
|
1209
|
-
B(this, "then", e && e.prototype ===
|
|
1332
|
+
B(this, "then", e && e.prototype === Pt ? Dn : { get: function() {
|
|
1210
1333
|
return e;
|
|
1211
|
-
}, set:
|
|
1334
|
+
}, set: Dn.set });
|
|
1212
1335
|
} };
|
|
1213
1336
|
function gr(e, t, n, r, a) {
|
|
1214
1337
|
this.onFulfilled = typeof e == "function" ? e : null, this.onRejected = typeof t == "function" ? t : null, this.resolve = n, this.reject = r, this.psd = a;
|
|
1215
1338
|
}
|
|
1216
|
-
function
|
|
1339
|
+
function In(e, t) {
|
|
1217
1340
|
var n, r;
|
|
1218
1341
|
Ht.push(t), e._state === null && (n = e._lib && _t(), t = Cn(t), e._state = !1, e._value = t, r = e, ft.some(function(a) {
|
|
1219
1342
|
return a._value === r._value;
|
|
@@ -1238,13 +1361,13 @@ function Ai() {
|
|
|
1238
1361
|
function Ea(e, t, n) {
|
|
1239
1362
|
try {
|
|
1240
1363
|
var r, a = t._value;
|
|
1241
|
-
!t._state && Ht.length && (Ht = []), r =
|
|
1364
|
+
!t._state && Ht.length && (Ht = []), r = Pe && t._consoleTask ? t._consoleTask.run(function() {
|
|
1242
1365
|
return e(a);
|
|
1243
|
-
}) : e(a), t._state || Ht.indexOf(a) !== -1 || (function(
|
|
1244
|
-
for (var f = ft.length; f; ) if (ft[--f]._value ===
|
|
1366
|
+
}) : e(a), t._state || Ht.indexOf(a) !== -1 || (function(s) {
|
|
1367
|
+
for (var f = ft.length; f; ) if (ft[--f]._value === s._value) return ft.splice(f, 1);
|
|
1245
1368
|
})(t), n.resolve(r);
|
|
1246
|
-
} catch (
|
|
1247
|
-
n.reject(
|
|
1369
|
+
} catch (s) {
|
|
1370
|
+
n.reject(s);
|
|
1248
1371
|
} finally {
|
|
1249
1372
|
--dt == 0 && Rn(), --n.psd.ref || n.psd.finalize();
|
|
1250
1373
|
}
|
|
@@ -1276,7 +1399,7 @@ function Ai() {
|
|
|
1276
1399
|
for (var t = Zt.slice(0), n = t.length; n; ) t[--n]();
|
|
1277
1400
|
}
|
|
1278
1401
|
function Jt(e) {
|
|
1279
|
-
return new G(
|
|
1402
|
+
return new G(Pt, !1, e);
|
|
1280
1403
|
}
|
|
1281
1404
|
function ge(e, t) {
|
|
1282
1405
|
var n = z;
|
|
@@ -1284,14 +1407,14 @@ function Ai() {
|
|
|
1284
1407
|
var r = _t(), a = z;
|
|
1285
1408
|
try {
|
|
1286
1409
|
return it(n, !0), e.apply(this, arguments);
|
|
1287
|
-
} catch (
|
|
1288
|
-
t && t(
|
|
1410
|
+
} catch (s) {
|
|
1411
|
+
t && t(s);
|
|
1289
1412
|
} finally {
|
|
1290
1413
|
it(a, !1), r && Tt();
|
|
1291
1414
|
}
|
|
1292
1415
|
};
|
|
1293
1416
|
}
|
|
1294
|
-
J(G.prototype, { then:
|
|
1417
|
+
J(G.prototype, { then: Dn, _then: function(e, t) {
|
|
1295
1418
|
Sn(this, new gr(null, null, e, t, z));
|
|
1296
1419
|
}, catch: function(e) {
|
|
1297
1420
|
if (arguments.length === 1) return this.then(null, e);
|
|
@@ -1314,26 +1437,26 @@ function Ai() {
|
|
|
1314
1437
|
}, timeout: function(e, t) {
|
|
1315
1438
|
var n = this;
|
|
1316
1439
|
return e < 1 / 0 ? new G(function(r, a) {
|
|
1317
|
-
var
|
|
1318
|
-
return a(new
|
|
1440
|
+
var s = setTimeout(function() {
|
|
1441
|
+
return a(new C.Timeout(t));
|
|
1319
1442
|
}, e);
|
|
1320
|
-
n.then(r, a).finally(clearTimeout.bind(null,
|
|
1443
|
+
n.then(r, a).finally(clearTimeout.bind(null, s));
|
|
1321
1444
|
}) : this;
|
|
1322
1445
|
} }), typeof Symbol < "u" && Symbol.toStringTag && B(G.prototype, Symbol.toStringTag, "Dexie.Promise"), nt.env = vr(), J(G, { all: function() {
|
|
1323
1446
|
var e = Fe.apply(null, arguments).map(rn);
|
|
1324
1447
|
return new G(function(t, n) {
|
|
1325
1448
|
e.length === 0 && t([]);
|
|
1326
1449
|
var r = e.length;
|
|
1327
|
-
e.forEach(function(a,
|
|
1450
|
+
e.forEach(function(a, s) {
|
|
1328
1451
|
return G.resolve(a).then(function(f) {
|
|
1329
|
-
e[
|
|
1452
|
+
e[s] = f, --r || t(e);
|
|
1330
1453
|
}, n);
|
|
1331
1454
|
});
|
|
1332
1455
|
});
|
|
1333
1456
|
}, resolve: function(e) {
|
|
1334
1457
|
return e instanceof G ? e : e && typeof e.then == "function" ? new G(function(t, n) {
|
|
1335
1458
|
e.then(t, n);
|
|
1336
|
-
}) : new G(
|
|
1459
|
+
}) : new G(Pt, !0, e);
|
|
1337
1460
|
}, reject: Jt, race: function() {
|
|
1338
1461
|
var e = Fe.apply(null, arguments).map(rn);
|
|
1339
1462
|
return new G(function(t, n) {
|
|
@@ -1357,12 +1480,12 @@ function Ai() {
|
|
|
1357
1480
|
Cn = e;
|
|
1358
1481
|
} }, follow: function(e, t) {
|
|
1359
1482
|
return new G(function(n, r) {
|
|
1360
|
-
return rt(function(a,
|
|
1483
|
+
return rt(function(a, s) {
|
|
1361
1484
|
var f = z;
|
|
1362
|
-
f.unhandleds = [], f.onunhandled =
|
|
1485
|
+
f.unhandleds = [], f.onunhandled = s, f.finalize = ye(function() {
|
|
1363
1486
|
var d, v = this;
|
|
1364
1487
|
d = function() {
|
|
1365
|
-
v.unhandleds.length === 0 ? a() :
|
|
1488
|
+
v.unhandleds.length === 0 ? a() : s(v.unhandleds[0]);
|
|
1366
1489
|
}, Zt.push(function w() {
|
|
1367
1490
|
d(), Zt.splice(Zt.indexOf(w), 1);
|
|
1368
1491
|
}), ++dt, Ft(function() {
|
|
@@ -1376,11 +1499,11 @@ function Ai() {
|
|
|
1376
1499
|
return new G(function(t) {
|
|
1377
1500
|
e.length === 0 && t([]);
|
|
1378
1501
|
var n = e.length, r = new Array(n);
|
|
1379
|
-
e.forEach(function(a,
|
|
1502
|
+
e.forEach(function(a, s) {
|
|
1380
1503
|
return G.resolve(a).then(function(f) {
|
|
1381
|
-
return r[
|
|
1504
|
+
return r[s] = { status: "fulfilled", value: f };
|
|
1382
1505
|
}, function(f) {
|
|
1383
|
-
return r[
|
|
1506
|
+
return r[s] = { status: "rejected", reason: f };
|
|
1384
1507
|
}).then(function() {
|
|
1385
1508
|
return --n || t(r);
|
|
1386
1509
|
});
|
|
@@ -1391,8 +1514,8 @@ function Ai() {
|
|
|
1391
1514
|
return new G(function(t, n) {
|
|
1392
1515
|
e.length === 0 && n(new AggregateError([]));
|
|
1393
1516
|
var r = e.length, a = new Array(r);
|
|
1394
|
-
e.forEach(function(
|
|
1395
|
-
return G.resolve(
|
|
1517
|
+
e.forEach(function(s, f) {
|
|
1518
|
+
return G.resolve(s).then(function(d) {
|
|
1396
1519
|
return t(d);
|
|
1397
1520
|
}, function(d) {
|
|
1398
1521
|
a[f] = d, --r || n(new AggregateError(a));
|
|
@@ -1402,10 +1525,10 @@ function Ai() {
|
|
|
1402
1525
|
}), lt.withResolvers && (G.withResolvers = lt.withResolvers));
|
|
1403
1526
|
var Ee = { awaits: 0, echoes: 0, id: 0 }, Na = 0, en = [], tn = 0, nn = 0, Aa = 0;
|
|
1404
1527
|
function rt(e, t, n, r) {
|
|
1405
|
-
var a = z,
|
|
1406
|
-
return
|
|
1528
|
+
var a = z, s = Object.create(a);
|
|
1529
|
+
return s.parent = a, s.ref = 0, s.global = !1, s.id = ++Aa, nt.env, s.env = An ? { Promise: G, PromiseProp: { value: G, configurable: !0, writable: !0 }, all: G.all, race: G.race, allSettled: G.allSettled, any: G.any, resolve: G.resolve, reject: G.reject } : {}, t && R(s, t), ++a.ref, s.finalize = function() {
|
|
1407
1530
|
--this.parent.ref || this.parent.finalize();
|
|
1408
|
-
}, r = ht(
|
|
1531
|
+
}, r = ht(s, e, n, r), s.ref === 0 && s.finalize(), r;
|
|
1409
1532
|
}
|
|
1410
1533
|
function Et() {
|
|
1411
1534
|
return Ee.id || (Ee.id = ++Na), ++Ee.awaits, Ee.echoes += pr, Ee.id;
|
|
@@ -1435,11 +1558,11 @@ function Ai() {
|
|
|
1435
1558
|
return An ? { Promise: e, PromiseProp: Object.getOwnPropertyDescriptor(m, "Promise"), all: e.all, race: e.race, allSettled: e.allSettled, any: e.any, resolve: e.resolve, reject: e.reject } : {};
|
|
1436
1559
|
}
|
|
1437
1560
|
function ht(e, t, n, r, a) {
|
|
1438
|
-
var
|
|
1561
|
+
var s = z;
|
|
1439
1562
|
try {
|
|
1440
1563
|
return it(e, !0), t(n, r, a);
|
|
1441
1564
|
} finally {
|
|
1442
|
-
it(
|
|
1565
|
+
it(s, !1);
|
|
1443
1566
|
}
|
|
1444
1567
|
}
|
|
1445
1568
|
function br(e, t, n, r) {
|
|
@@ -1453,11 +1576,11 @@ function Ai() {
|
|
|
1453
1576
|
}
|
|
1454
1577
|
};
|
|
1455
1578
|
}
|
|
1456
|
-
function
|
|
1579
|
+
function Pn(e) {
|
|
1457
1580
|
Promise === lt && Ee.echoes === 0 ? tn === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
|
|
1458
1581
|
}
|
|
1459
1582
|
("" + je).indexOf("[native code]") === -1 && (Et = at = Q);
|
|
1460
|
-
var be = G.reject, mt = "", We = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", wr = "String expected.", xt = [], an = "__dbnames",
|
|
1583
|
+
var be = G.reject, mt = "", We = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", wr = "String expected.", xt = [], an = "__dbnames", kn = "readonly", Fn = "readwrite";
|
|
1461
1584
|
function pt(e, t) {
|
|
1462
1585
|
return e ? t ? function() {
|
|
1463
1586
|
return e.apply(this, arguments) && t.apply(this, arguments);
|
|
@@ -1468,11 +1591,11 @@ function Ai() {
|
|
|
1468
1591
|
return typeof e != "string" || /\./.test(e) ? function(t) {
|
|
1469
1592
|
return t;
|
|
1470
1593
|
} : function(t) {
|
|
1471
|
-
return t[e] === void 0 && e in t && delete (t =
|
|
1594
|
+
return t[e] === void 0 && e in t && delete (t = ke(t))[e], t;
|
|
1472
1595
|
};
|
|
1473
1596
|
}
|
|
1474
1597
|
function Tr() {
|
|
1475
|
-
throw
|
|
1598
|
+
throw C.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.");
|
|
1476
1599
|
}
|
|
1477
1600
|
function re(e, t) {
|
|
1478
1601
|
try {
|
|
@@ -1484,14 +1607,14 @@ function Ai() {
|
|
|
1484
1607
|
case "string":
|
|
1485
1608
|
return t < e ? 1 : e < t ? -1 : 0;
|
|
1486
1609
|
case "binary":
|
|
1487
|
-
return (function(a,
|
|
1488
|
-
for (var f = a.length, d =
|
|
1610
|
+
return (function(a, s) {
|
|
1611
|
+
for (var f = a.length, d = s.length, v = f < d ? f : d, w = 0; w < v; ++w) if (a[w] !== s[w]) return a[w] < s[w] ? -1 : 1;
|
|
1489
1612
|
return f === d ? 0 : f < d ? -1 : 1;
|
|
1490
1613
|
})(xr(e), xr(t));
|
|
1491
1614
|
case "Array":
|
|
1492
|
-
return (function(a,
|
|
1493
|
-
for (var f = a.length, d =
|
|
1494
|
-
var T = re(a[w],
|
|
1615
|
+
return (function(a, s) {
|
|
1616
|
+
for (var f = a.length, d = s.length, v = f < d ? f : d, w = 0; w < v; ++w) {
|
|
1617
|
+
var T = re(a[w], s[w]);
|
|
1495
1618
|
if (T !== 0) return T;
|
|
1496
1619
|
}
|
|
1497
1620
|
return f === d ? 0 : f < d ? -1 : 1;
|
|
@@ -1503,15 +1626,15 @@ function Ai() {
|
|
|
1503
1626
|
}
|
|
1504
1627
|
function Er(e) {
|
|
1505
1628
|
var t = typeof e;
|
|
1506
|
-
return t != "object" ? t : ArrayBuffer.isView(e) ? "binary" : (e =
|
|
1629
|
+
return t != "object" ? t : ArrayBuffer.isView(e) ? "binary" : (e = Ke(e), e === "ArrayBuffer" ? "binary" : e);
|
|
1507
1630
|
}
|
|
1508
1631
|
function xr(e) {
|
|
1509
1632
|
return e instanceof Uint8Array ? e : ArrayBuffer.isView(e) ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : new Uint8Array(e);
|
|
1510
1633
|
}
|
|
1511
1634
|
function sn(e, t, n) {
|
|
1512
1635
|
var r = e.schema.yProps;
|
|
1513
|
-
return r ? (t && 0 < n.numFailures && (t = t.filter(function(a,
|
|
1514
|
-
return !n.failures[
|
|
1636
|
+
return r ? (t && 0 < n.numFailures && (t = t.filter(function(a, s) {
|
|
1637
|
+
return !n.failures[s];
|
|
1515
1638
|
})), Promise.all(r.map(function(a) {
|
|
1516
1639
|
return a = a.updatesTable, t ? e.db.table(a).where("k").anyOf(t).delete() : e.db.table(a).clear();
|
|
1517
1640
|
})).then(function() {
|
|
@@ -1519,9 +1642,9 @@ function Ai() {
|
|
|
1519
1642
|
})) : n;
|
|
1520
1643
|
}
|
|
1521
1644
|
var Nr = (me.prototype._trans = function(e, t, n) {
|
|
1522
|
-
var r = this._tx || z.trans, a = this.name,
|
|
1645
|
+
var r = this._tx || z.trans, a = this.name, s = Pe && typeof console < "u" && console.createTask && console.createTask("Dexie: ".concat(e === "readonly" ? "read" : "write", " ").concat(this.name));
|
|
1523
1646
|
function f(w, T, p) {
|
|
1524
|
-
if (!p.schema[a]) throw new
|
|
1647
|
+
if (!p.schema[a]) throw new C.NotFound("Table " + a + " not part of transaction");
|
|
1525
1648
|
return t(p.idbtrans, p);
|
|
1526
1649
|
}
|
|
1527
1650
|
var d = _t();
|
|
@@ -1552,16 +1675,16 @@ function Ai() {
|
|
|
1552
1675
|
});
|
|
1553
1676
|
});
|
|
1554
1677
|
}
|
|
1555
|
-
if (T._state.openComplete) return be(new
|
|
1678
|
+
if (T._state.openComplete) return be(new C.DatabaseClosed(T._state.dbOpenError));
|
|
1556
1679
|
if (!T._state.isBeingOpened) {
|
|
1557
|
-
if (!T._state.autoOpen) return be(new
|
|
1680
|
+
if (!T._state.autoOpen) return be(new C.DatabaseClosed());
|
|
1558
1681
|
T.open().catch(Q);
|
|
1559
1682
|
}
|
|
1560
1683
|
return T._state.dbReadyPromise.then(function() {
|
|
1561
1684
|
return w(T, p, O, b);
|
|
1562
1685
|
});
|
|
1563
1686
|
})(this.db, e, [this.name], f);
|
|
1564
|
-
return
|
|
1687
|
+
return s && (v._consoleTask = s, v = v.catch(function(w) {
|
|
1565
1688
|
return console.trace(w), be(w);
|
|
1566
1689
|
})), v;
|
|
1567
1690
|
} finally {
|
|
@@ -1569,7 +1692,7 @@ function Ai() {
|
|
|
1569
1692
|
}
|
|
1570
1693
|
}, me.prototype.get = function(e, t) {
|
|
1571
1694
|
var n = this;
|
|
1572
|
-
return e && e.constructor === Object ? this.where(e).first(t) : e == null ? be(new
|
|
1695
|
+
return e && e.constructor === Object ? this.where(e).first(t) : e == null ? be(new C.Type("Invalid argument to Table.get()")) : this._trans("readonly", function(r) {
|
|
1573
1696
|
return n.core.get({ trans: r, key: e }).then(function(a) {
|
|
1574
1697
|
return n.hook.reading.fire(a);
|
|
1575
1698
|
});
|
|
@@ -1591,12 +1714,12 @@ function Ai() {
|
|
|
1591
1714
|
return d.keyPath.length - v.keyPath.length;
|
|
1592
1715
|
})[0];
|
|
1593
1716
|
if (n && this.db._maxKey !== mt) {
|
|
1594
|
-
var
|
|
1595
|
-
return this.where(
|
|
1717
|
+
var s = n.keyPath.slice(0, t.length);
|
|
1718
|
+
return this.where(s).equals(s.map(function(v) {
|
|
1596
1719
|
return e[v];
|
|
1597
1720
|
}));
|
|
1598
1721
|
}
|
|
1599
|
-
!n &&
|
|
1722
|
+
!n && Pe && console.warn("The query ".concat(JSON.stringify(e), " on ").concat(this.name, " would benefit from a ") + "compound index [".concat(t.join("+"), "]"));
|
|
1600
1723
|
var r = this.schema.idxByName;
|
|
1601
1724
|
function a(d, v) {
|
|
1602
1725
|
return re(d, v) === 0;
|
|
@@ -1610,8 +1733,8 @@ function Ai() {
|
|
|
1610
1733
|
} : function(b) {
|
|
1611
1734
|
return a(O, pe(b, v));
|
|
1612
1735
|
}) : T];
|
|
1613
|
-
}, [null, null]),
|
|
1614
|
-
return
|
|
1736
|
+
}, [null, null]), s = f[0], f = f[1];
|
|
1737
|
+
return s ? this.where(s.name).equals(e[s.keyPath]).filter(f) : n ? this.filter(f) : this.where(t).equals("");
|
|
1615
1738
|
}, me.prototype.filter = function(e) {
|
|
1616
1739
|
return this.toCollection().and(e);
|
|
1617
1740
|
}, me.prototype.count = function(e) {
|
|
@@ -1646,13 +1769,13 @@ function Ai() {
|
|
|
1646
1769
|
}, enumerable: !1, configurable: !0 }), a.prototype.table = function() {
|
|
1647
1770
|
return r;
|
|
1648
1771
|
}, e = a);
|
|
1649
|
-
for (var
|
|
1650
|
-
return
|
|
1772
|
+
for (var s = /* @__PURE__ */ new Set(), f = e.prototype; f; f = j(f)) Object.getOwnPropertyNames(f).forEach(function(v) {
|
|
1773
|
+
return s.add(v);
|
|
1651
1774
|
});
|
|
1652
1775
|
function d(v) {
|
|
1653
1776
|
if (!v) return v;
|
|
1654
1777
|
var w, T = Object.create(e.prototype);
|
|
1655
|
-
for (w in v) if (!
|
|
1778
|
+
for (w in v) if (!s.has(w)) try {
|
|
1656
1779
|
T[w] = v[w];
|
|
1657
1780
|
} catch {
|
|
1658
1781
|
}
|
|
@@ -1664,29 +1787,29 @@ function Ai() {
|
|
|
1664
1787
|
R(this, e);
|
|
1665
1788
|
});
|
|
1666
1789
|
}, me.prototype.add = function(e, t) {
|
|
1667
|
-
var n = this, r = this.schema.primKey, a = r.auto,
|
|
1668
|
-
return
|
|
1790
|
+
var n = this, r = this.schema.primKey, a = r.auto, s = r.keyPath, f = e;
|
|
1791
|
+
return s && a && (f = on(s)(e)), this._trans("readwrite", function(d) {
|
|
1669
1792
|
return n.core.mutate({ trans: d, type: "add", keys: t != null ? [t] : null, values: [f] });
|
|
1670
1793
|
}).then(function(d) {
|
|
1671
1794
|
return d.numFailures ? G.reject(d.failures[0]) : d.lastResult;
|
|
1672
1795
|
}).then(function(d) {
|
|
1673
|
-
if (
|
|
1674
|
-
ne(e,
|
|
1796
|
+
if (s) try {
|
|
1797
|
+
ne(e, s, d);
|
|
1675
1798
|
} catch {
|
|
1676
1799
|
}
|
|
1677
1800
|
return d;
|
|
1678
1801
|
});
|
|
1679
1802
|
}, me.prototype.update = function(e, t) {
|
|
1680
|
-
return typeof e != "object" || N(e) ? this.where(":id").equals(e).modify(t) : (e = pe(e, this.schema.primKey.keyPath), e === void 0 ? be(new
|
|
1803
|
+
return typeof e != "object" || N(e) ? this.where(":id").equals(e).modify(t) : (e = pe(e, this.schema.primKey.keyPath), e === void 0 ? be(new C.InvalidArgument("Given object does not contain its primary key")) : this.where(":id").equals(e).modify(t));
|
|
1681
1804
|
}, me.prototype.put = function(e, t) {
|
|
1682
|
-
var n = this, r = this.schema.primKey, a = r.auto,
|
|
1683
|
-
return
|
|
1805
|
+
var n = this, r = this.schema.primKey, a = r.auto, s = r.keyPath, f = e;
|
|
1806
|
+
return s && a && (f = on(s)(e)), this._trans("readwrite", function(d) {
|
|
1684
1807
|
return n.core.mutate({ trans: d, type: "put", values: [f], keys: t != null ? [t] : null });
|
|
1685
1808
|
}).then(function(d) {
|
|
1686
1809
|
return d.numFailures ? G.reject(d.failures[0]) : d.lastResult;
|
|
1687
1810
|
}).then(function(d) {
|
|
1688
|
-
if (
|
|
1689
|
-
ne(e,
|
|
1811
|
+
if (s) try {
|
|
1812
|
+
ne(e, s, d);
|
|
1690
1813
|
} catch {
|
|
1691
1814
|
}
|
|
1692
1815
|
return d;
|
|
@@ -1719,28 +1842,28 @@ function Ai() {
|
|
|
1719
1842
|
});
|
|
1720
1843
|
});
|
|
1721
1844
|
}, me.prototype.bulkAdd = function(e, t, n) {
|
|
1722
|
-
var r = this, a = Array.isArray(t) ? t : void 0,
|
|
1845
|
+
var r = this, a = Array.isArray(t) ? t : void 0, s = (n = n || (a ? void 0 : t)) ? n.allKeys : void 0;
|
|
1723
1846
|
return this._trans("readwrite", function(f) {
|
|
1724
1847
|
var w = r.schema.primKey, d = w.auto, w = w.keyPath;
|
|
1725
|
-
if (w && a) throw new
|
|
1726
|
-
if (a && a.length !== e.length) throw new
|
|
1848
|
+
if (w && a) throw new C.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
|
|
1849
|
+
if (a && a.length !== e.length) throw new C.InvalidArgument("Arguments objects and keys must have the same length");
|
|
1727
1850
|
var v = e.length, w = w && d ? e.map(on(w)) : e;
|
|
1728
|
-
return r.core.mutate({ trans: f, type: "add", keys: a, values: w, wantResults:
|
|
1851
|
+
return r.core.mutate({ trans: f, type: "add", keys: a, values: w, wantResults: s }).then(function(_) {
|
|
1729
1852
|
var p = _.numFailures, O = _.results, b = _.lastResult, _ = _.failures;
|
|
1730
|
-
if (p === 0) return
|
|
1853
|
+
if (p === 0) return s ? O : b;
|
|
1731
1854
|
throw new et("".concat(r.name, ".bulkAdd(): ").concat(p, " of ").concat(v, " operations failed"), _);
|
|
1732
1855
|
});
|
|
1733
1856
|
});
|
|
1734
1857
|
}, me.prototype.bulkPut = function(e, t, n) {
|
|
1735
|
-
var r = this, a = Array.isArray(t) ? t : void 0,
|
|
1858
|
+
var r = this, a = Array.isArray(t) ? t : void 0, s = (n = n || (a ? void 0 : t)) ? n.allKeys : void 0;
|
|
1736
1859
|
return this._trans("readwrite", function(f) {
|
|
1737
1860
|
var w = r.schema.primKey, d = w.auto, w = w.keyPath;
|
|
1738
|
-
if (w && a) throw new
|
|
1739
|
-
if (a && a.length !== e.length) throw new
|
|
1861
|
+
if (w && a) throw new C.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
|
|
1862
|
+
if (a && a.length !== e.length) throw new C.InvalidArgument("Arguments objects and keys must have the same length");
|
|
1740
1863
|
var v = e.length, w = w && d ? e.map(on(w)) : e;
|
|
1741
|
-
return r.core.mutate({ trans: f, type: "put", keys: a, values: w, wantResults:
|
|
1864
|
+
return r.core.mutate({ trans: f, type: "put", keys: a, values: w, wantResults: s }).then(function(_) {
|
|
1742
1865
|
var p = _.numFailures, O = _.results, b = _.lastResult, _ = _.failures;
|
|
1743
|
-
if (p === 0) return
|
|
1866
|
+
if (p === 0) return s ? O : b;
|
|
1744
1867
|
throw new et("".concat(r.name, ".bulkPut(): ").concat(p, " of ").concat(v, " operations failed"), _);
|
|
1745
1868
|
});
|
|
1746
1869
|
});
|
|
@@ -1749,20 +1872,20 @@ function Ai() {
|
|
|
1749
1872
|
return f.key;
|
|
1750
1873
|
}), a = e.map(function(f) {
|
|
1751
1874
|
return f.changes;
|
|
1752
|
-
}),
|
|
1875
|
+
}), s = [];
|
|
1753
1876
|
return this._trans("readwrite", function(f) {
|
|
1754
1877
|
return n.getMany({ trans: f, keys: r, cache: "clone" }).then(function(d) {
|
|
1755
1878
|
var v = [], w = [];
|
|
1756
1879
|
e.forEach(function(p, O) {
|
|
1757
1880
|
var b = p.key, _ = p.changes, A = d[O];
|
|
1758
1881
|
if (A) {
|
|
1759
|
-
for (var x = 0,
|
|
1760
|
-
var S =
|
|
1882
|
+
for (var x = 0, D = Object.keys(_); x < D.length; x++) {
|
|
1883
|
+
var S = D[x], P = _[S];
|
|
1761
1884
|
if (S === t.schema.primKey.keyPath) {
|
|
1762
|
-
if (re(
|
|
1763
|
-
} else ne(A, S,
|
|
1885
|
+
if (re(P, b) !== 0) throw new C.Constraint("Cannot update primary key in bulkUpdate()");
|
|
1886
|
+
} else ne(A, S, P);
|
|
1764
1887
|
}
|
|
1765
|
-
|
|
1888
|
+
s.push(O), v.push(b), w.push(A);
|
|
1766
1889
|
}
|
|
1767
1890
|
});
|
|
1768
1891
|
var T = v.length;
|
|
@@ -1770,8 +1893,8 @@ function Ai() {
|
|
|
1770
1893
|
var O = p.numFailures, b = p.failures;
|
|
1771
1894
|
if (O === 0) return T;
|
|
1772
1895
|
for (var _ = 0, A = Object.keys(b); _ < A.length; _++) {
|
|
1773
|
-
var x,
|
|
1774
|
-
S != null && (x = b[
|
|
1896
|
+
var x, D = A[_], S = s[Number(D)];
|
|
1897
|
+
S != null && (x = b[D], delete b[D], b[S] = x);
|
|
1775
1898
|
}
|
|
1776
1899
|
throw new et("".concat(t.name, ".bulkUpdate(): ").concat(O, " of ").concat(T, " operations failed"), b);
|
|
1777
1900
|
});
|
|
@@ -1784,8 +1907,8 @@ function Ai() {
|
|
|
1784
1907
|
return sn(t, e, a);
|
|
1785
1908
|
});
|
|
1786
1909
|
}).then(function(f) {
|
|
1787
|
-
var a = f.numFailures,
|
|
1788
|
-
if (a === 0) return
|
|
1910
|
+
var a = f.numFailures, s = f.lastResult, f = f.failures;
|
|
1911
|
+
if (a === 0) return s;
|
|
1789
1912
|
throw new et("".concat(t.name, ".bulkDelete(): ").concat(a, " of ").concat(n, " operations failed"), f);
|
|
1790
1913
|
});
|
|
1791
1914
|
}, me);
|
|
@@ -1800,10 +1923,10 @@ function Ai() {
|
|
|
1800
1923
|
if (typeof f == "string") return n[f];
|
|
1801
1924
|
}
|
|
1802
1925
|
var n = {};
|
|
1803
|
-
t.addEventType =
|
|
1804
|
-
for (var r = 1, a = arguments.length; r < a; ++r)
|
|
1926
|
+
t.addEventType = s;
|
|
1927
|
+
for (var r = 1, a = arguments.length; r < a; ++r) s(arguments[r]);
|
|
1805
1928
|
return t;
|
|
1806
|
-
function
|
|
1929
|
+
function s(f, d, v) {
|
|
1807
1930
|
if (typeof f != "object") {
|
|
1808
1931
|
var w;
|
|
1809
1932
|
d = d || Nn;
|
|
@@ -1818,10 +1941,10 @@ function Ai() {
|
|
|
1818
1941
|
}
|
|
1819
1942
|
y(w = f).forEach(function(p) {
|
|
1820
1943
|
var O = w[p];
|
|
1821
|
-
if (N(O))
|
|
1944
|
+
if (N(O)) s(p, w[p][0], w[p][1]);
|
|
1822
1945
|
else {
|
|
1823
|
-
if (O !== "asap") throw new
|
|
1824
|
-
var b =
|
|
1946
|
+
if (O !== "asap") throw new C.InvalidArgument("Invalid event config");
|
|
1947
|
+
var b = s(p, he, function() {
|
|
1825
1948
|
for (var _ = arguments.length, A = new Array(_); _--; ) A[_] = arguments[_];
|
|
1826
1949
|
b.subscribers.forEach(function(x) {
|
|
1827
1950
|
ae(function() {
|
|
@@ -1851,7 +1974,7 @@ function Ai() {
|
|
|
1851
1974
|
function un(e, t) {
|
|
1852
1975
|
if (e.isPrimKey) return t.primaryKey;
|
|
1853
1976
|
var n = t.getIndexByKeyPath(e.index);
|
|
1854
|
-
if (!n) throw new
|
|
1977
|
+
if (!n) throw new C.Schema("KeyPath " + e.index + " on object store " + t.name + " is not indexed");
|
|
1855
1978
|
return n;
|
|
1856
1979
|
}
|
|
1857
1980
|
function Ar(e, t, n) {
|
|
@@ -1861,34 +1984,34 @@ function Ai() {
|
|
|
1861
1984
|
function cn(e, t, n, r) {
|
|
1862
1985
|
var a = e.replayFilter ? pt(e.filter, e.replayFilter()) : e.filter;
|
|
1863
1986
|
if (e.or) {
|
|
1864
|
-
var
|
|
1987
|
+
var s = {}, f = function(d, v, w) {
|
|
1865
1988
|
var T, p;
|
|
1866
1989
|
a && !a(v, w, function(O) {
|
|
1867
1990
|
return v.stop(O);
|
|
1868
1991
|
}, function(O) {
|
|
1869
1992
|
return v.fail(O);
|
|
1870
|
-
}) || ((p = "" + (T = v.primaryKey)) == "[object ArrayBuffer]" && (p = "" + new Uint8Array(T)), W(
|
|
1993
|
+
}) || ((p = "" + (T = v.primaryKey)) == "[object ArrayBuffer]" && (p = "" + new Uint8Array(T)), W(s, p) || (s[p] = !0, t(d, v, w)));
|
|
1871
1994
|
};
|
|
1872
1995
|
return Promise.all([e.or._iterate(f, n), Or(Ar(e, r, n), e.algorithm, f, !e.keysOnly && e.valueMapper)]);
|
|
1873
1996
|
}
|
|
1874
1997
|
return Or(Ar(e, r, n), pt(e.algorithm, a), t, !e.keysOnly && e.valueMapper);
|
|
1875
1998
|
}
|
|
1876
1999
|
function Or(e, t, n, r) {
|
|
1877
|
-
var a = ge(r ? function(
|
|
1878
|
-
return n(r(
|
|
2000
|
+
var a = ge(r ? function(s, f, d) {
|
|
2001
|
+
return n(r(s), f, d);
|
|
1879
2002
|
} : n);
|
|
1880
|
-
return e.then(function(
|
|
1881
|
-
if (
|
|
2003
|
+
return e.then(function(s) {
|
|
2004
|
+
if (s) return s.start(function() {
|
|
1882
2005
|
var f = function() {
|
|
1883
|
-
return
|
|
2006
|
+
return s.continue();
|
|
1884
2007
|
};
|
|
1885
|
-
t && !t(
|
|
2008
|
+
t && !t(s, function(d) {
|
|
1886
2009
|
return f = d;
|
|
1887
2010
|
}, function(d) {
|
|
1888
|
-
|
|
2011
|
+
s.stop(d), f = Q;
|
|
1889
2012
|
}, function(d) {
|
|
1890
|
-
|
|
1891
|
-
}) || a(
|
|
2013
|
+
s.fail(d), f = Q;
|
|
2014
|
+
}) || a(s.value, s, function(d) {
|
|
1892
2015
|
return f = d;
|
|
1893
2016
|
}), f();
|
|
1894
2017
|
});
|
|
@@ -1953,21 +2076,21 @@ function Ai() {
|
|
|
1953
2076
|
if (Nt(r, !0)) return a.count({ trans: n, query: { index: un(r, a.schema), range: r.range } }).then(function(f) {
|
|
1954
2077
|
return Math.min(f, r.limit);
|
|
1955
2078
|
});
|
|
1956
|
-
var
|
|
2079
|
+
var s = 0;
|
|
1957
2080
|
return cn(r, function() {
|
|
1958
|
-
return ++
|
|
2081
|
+
return ++s, !1;
|
|
1959
2082
|
}, n, a).then(function() {
|
|
1960
|
-
return
|
|
2083
|
+
return s;
|
|
1961
2084
|
});
|
|
1962
2085
|
}).then(e);
|
|
1963
2086
|
}, ue.prototype.sortBy = function(e, t) {
|
|
1964
2087
|
var n = e.split(".").reverse(), r = n[0], a = n.length - 1;
|
|
1965
|
-
function
|
|
1966
|
-
return w ?
|
|
2088
|
+
function s(v, w) {
|
|
2089
|
+
return w ? s(v[n[w]], w - 1) : v[r];
|
|
1967
2090
|
}
|
|
1968
2091
|
var f = this._ctx.dir === "next" ? 1 : -1;
|
|
1969
2092
|
function d(v, w) {
|
|
1970
|
-
return re(
|
|
2093
|
+
return re(s(v, a), s(w, a)) * f;
|
|
1971
2094
|
}
|
|
1972
2095
|
return this.toArray(function(v) {
|
|
1973
2096
|
return v.sort(d);
|
|
@@ -1977,8 +2100,8 @@ function Ai() {
|
|
|
1977
2100
|
return this._read(function(n) {
|
|
1978
2101
|
var r = t._ctx;
|
|
1979
2102
|
if (r.dir === "next" && Nt(r, !0) && 0 < r.limit) {
|
|
1980
|
-
var a = r.valueMapper,
|
|
1981
|
-
return r.table.core.query({ trans: n, limit: r.limit, values: !0, query: { index:
|
|
2103
|
+
var a = r.valueMapper, s = un(r, r.table.core.schema);
|
|
2104
|
+
return r.table.core.query({ trans: n, limit: r.limit, values: !0, query: { index: s, range: r.range } }).then(function(d) {
|
|
1982
2105
|
return d = d.result, a ? d.map(a) : d;
|
|
1983
2106
|
});
|
|
1984
2107
|
}
|
|
@@ -2089,83 +2212,83 @@ function Ai() {
|
|
|
2089
2212
|
}, ue.prototype.modify = function(e) {
|
|
2090
2213
|
var t = this, n = this._ctx;
|
|
2091
2214
|
return this._write(function(r) {
|
|
2092
|
-
var a,
|
|
2093
|
-
f = typeof e == "function" ? e : (a = y(e),
|
|
2094
|
-
for (var S = !1,
|
|
2095
|
-
var
|
|
2096
|
-
M instanceof Kt ? (ne(
|
|
2215
|
+
var a, s, f;
|
|
2216
|
+
f = typeof e == "function" ? e : (a = y(e), s = a.length, function(D) {
|
|
2217
|
+
for (var S = !1, P = 0; P < s; ++P) {
|
|
2218
|
+
var k = a[P], M = e[k], L = pe(D, k);
|
|
2219
|
+
M instanceof Kt ? (ne(D, k, M.execute(L)), S = !0) : L !== M && (ne(D, k, M), S = !0);
|
|
2097
2220
|
}
|
|
2098
2221
|
return S;
|
|
2099
2222
|
});
|
|
2100
2223
|
var d = n.table.core, p = d.schema.primaryKey, v = p.outbound, w = p.extractKey, T = 200, p = t.db._options.modifyChunkSize;
|
|
2101
2224
|
p && (T = typeof p == "object" ? p[d.name] || p["*"] || 200 : p);
|
|
2102
|
-
function O(
|
|
2103
|
-
var
|
|
2104
|
-
_ +=
|
|
2105
|
-
for (var M = 0, L = y(
|
|
2225
|
+
function O(D, k) {
|
|
2226
|
+
var P = k.failures, k = k.numFailures;
|
|
2227
|
+
_ += D - k;
|
|
2228
|
+
for (var M = 0, L = y(P); M < L.length; M++) {
|
|
2106
2229
|
var K = L[M];
|
|
2107
|
-
b.push(
|
|
2230
|
+
b.push(P[K]);
|
|
2108
2231
|
}
|
|
2109
2232
|
}
|
|
2110
|
-
var b = [], _ = 0, A = [], x = e ===
|
|
2111
|
-
return t.clone().primaryKeys().then(function(
|
|
2112
|
-
function S(
|
|
2113
|
-
var M = Math.min(T,
|
|
2233
|
+
var b = [], _ = 0, A = [], x = e === Dr;
|
|
2234
|
+
return t.clone().primaryKeys().then(function(D) {
|
|
2235
|
+
function S(k) {
|
|
2236
|
+
var M = Math.min(T, D.length - k), L = D.slice(k, k + M);
|
|
2114
2237
|
return (x ? Promise.resolve([]) : d.getMany({ trans: r, keys: L, cache: "immutable" })).then(function(K) {
|
|
2115
2238
|
var q = [], V = [], U = v ? [] : null, $ = x ? L : [];
|
|
2116
2239
|
if (!x) for (var te = 0; te < M; ++te) {
|
|
2117
|
-
var oe = K[te], Z = { value:
|
|
2118
|
-
f.call(Z, Z.value, Z) !== !1 && (Z.value == null ? $.push(
|
|
2240
|
+
var oe = K[te], Z = { value: ke(oe), primKey: D[k + te] };
|
|
2241
|
+
f.call(Z, Z.value, Z) !== !1 && (Z.value == null ? $.push(D[k + te]) : v || re(w(oe), w(Z.value)) === 0 ? (V.push(Z.value), v && U.push(D[k + te])) : ($.push(D[k + te]), q.push(Z.value)));
|
|
2119
2242
|
}
|
|
2120
2243
|
return Promise.resolve(0 < q.length && d.mutate({ trans: r, type: "add", values: q }).then(function(ve) {
|
|
2121
2244
|
for (var H in ve.failures) $.splice(parseInt(H), 1);
|
|
2122
2245
|
O(q.length, ve);
|
|
2123
2246
|
})).then(function() {
|
|
2124
|
-
return (0 < V.length ||
|
|
2247
|
+
return (0 < V.length || P && typeof e == "object") && d.mutate({ trans: r, type: "put", keys: U, values: V, criteria: P, changeSpec: typeof e != "function" && e, isAdditionalChunk: 0 < k }).then(function(ve) {
|
|
2125
2248
|
return O(V.length, ve);
|
|
2126
2249
|
});
|
|
2127
2250
|
}).then(function() {
|
|
2128
|
-
return (0 < $.length ||
|
|
2251
|
+
return (0 < $.length || P && x) && d.mutate({ trans: r, type: "delete", keys: $, criteria: P, isAdditionalChunk: 0 < k }).then(function(ve) {
|
|
2129
2252
|
return sn(n.table, $, ve);
|
|
2130
2253
|
}).then(function(ve) {
|
|
2131
2254
|
return O($.length, ve);
|
|
2132
2255
|
});
|
|
2133
2256
|
}).then(function() {
|
|
2134
|
-
return
|
|
2257
|
+
return D.length > k + M && S(k + T);
|
|
2135
2258
|
});
|
|
2136
2259
|
});
|
|
2137
2260
|
}
|
|
2138
|
-
var
|
|
2261
|
+
var P = Nt(n) && n.limit === 1 / 0 && (typeof e != "function" || x) && { index: n.index, range: n.range };
|
|
2139
2262
|
return S(0).then(function() {
|
|
2140
2263
|
if (0 < b.length) throw new Je("Error modifying one or more objects", b, _, A);
|
|
2141
|
-
return
|
|
2264
|
+
return D.length;
|
|
2142
2265
|
});
|
|
2143
2266
|
});
|
|
2144
2267
|
});
|
|
2145
2268
|
}, ue.prototype.delete = function() {
|
|
2146
2269
|
var e = this._ctx, t = e.range;
|
|
2147
|
-
return !Nt(e) || e.table.schema.yProps || !e.isPrimKey && t.type !== 3 ? this.modify(
|
|
2270
|
+
return !Nt(e) || e.table.schema.yProps || !e.isPrimKey && t.type !== 3 ? this.modify(Dr) : this._write(function(n) {
|
|
2148
2271
|
var r = e.table.core.schema.primaryKey, a = t;
|
|
2149
|
-
return e.table.core.count({ trans: n, query: { index: r, range: a } }).then(function(
|
|
2272
|
+
return e.table.core.count({ trans: n, query: { index: r, range: a } }).then(function(s) {
|
|
2150
2273
|
return e.table.core.mutate({ trans: n, type: "deleteRange", range: a }).then(function(v) {
|
|
2151
2274
|
var d = v.failures, v = v.numFailures;
|
|
2152
2275
|
if (v) throw new Je("Could not delete some values", Object.keys(d).map(function(w) {
|
|
2153
2276
|
return d[w];
|
|
2154
|
-
}),
|
|
2155
|
-
return
|
|
2277
|
+
}), s - v);
|
|
2278
|
+
return s - v;
|
|
2156
2279
|
});
|
|
2157
2280
|
});
|
|
2158
2281
|
});
|
|
2159
2282
|
}, ue);
|
|
2160
2283
|
function ue() {
|
|
2161
2284
|
}
|
|
2162
|
-
var
|
|
2285
|
+
var Dr = function(e, t) {
|
|
2163
2286
|
return t.value = null;
|
|
2164
2287
|
};
|
|
2165
|
-
function
|
|
2288
|
+
function Da(e, t) {
|
|
2166
2289
|
return e < t ? -1 : e === t ? 0 : 1;
|
|
2167
2290
|
}
|
|
2168
|
-
function
|
|
2291
|
+
function Ia(e, t) {
|
|
2169
2292
|
return t < e ? -1 : e === t ? 0 : 1;
|
|
2170
2293
|
}
|
|
2171
2294
|
function Be(e, t, n) {
|
|
@@ -2173,11 +2296,11 @@ function Ai() {
|
|
|
2173
2296
|
}
|
|
2174
2297
|
function At(e) {
|
|
2175
2298
|
return new e.Collection(e, function() {
|
|
2176
|
-
return
|
|
2299
|
+
return Ir("");
|
|
2177
2300
|
}).limit(0);
|
|
2178
2301
|
}
|
|
2179
2302
|
function ln(e, t, n, r) {
|
|
2180
|
-
var a,
|
|
2303
|
+
var a, s, f, d, v, w, T, p = n.length;
|
|
2181
2304
|
if (!n.every(function(_) {
|
|
2182
2305
|
return typeof _ == "string";
|
|
2183
2306
|
})) return Be(e, wr);
|
|
@@ -2186,15 +2309,15 @@ function Ai() {
|
|
|
2186
2309
|
return x.toUpperCase();
|
|
2187
2310
|
} : function(x) {
|
|
2188
2311
|
return x.toLowerCase();
|
|
2189
|
-
},
|
|
2312
|
+
}, s = _ === "next" ? function(x) {
|
|
2190
2313
|
return x.toLowerCase();
|
|
2191
2314
|
} : function(x) {
|
|
2192
2315
|
return x.toUpperCase();
|
|
2193
|
-
}, f = _ === "next" ?
|
|
2316
|
+
}, f = _ === "next" ? Da : Ia;
|
|
2194
2317
|
var A = n.map(function(x) {
|
|
2195
|
-
return { lower:
|
|
2196
|
-
}).sort(function(x,
|
|
2197
|
-
return f(x.lower,
|
|
2318
|
+
return { lower: s(x), upper: a(x) };
|
|
2319
|
+
}).sort(function(x, D) {
|
|
2320
|
+
return f(x.lower, D.lower);
|
|
2198
2321
|
});
|
|
2199
2322
|
d = A.map(function(x) {
|
|
2200
2323
|
return x.upper;
|
|
@@ -2209,11 +2332,11 @@ function Ai() {
|
|
|
2209
2332
|
};
|
|
2210
2333
|
var b = 0;
|
|
2211
2334
|
return e._addAlgorithm(function(_, A, x) {
|
|
2212
|
-
var
|
|
2213
|
-
if (typeof
|
|
2214
|
-
var S =
|
|
2335
|
+
var D = _.key;
|
|
2336
|
+
if (typeof D != "string") return !1;
|
|
2337
|
+
var S = s(D);
|
|
2215
2338
|
if (t(S, v, b)) return !0;
|
|
2216
|
-
for (var
|
|
2339
|
+
for (var P = null, k = b; k < p; ++k) {
|
|
2217
2340
|
var M = (function(L, K, q, V, U, $) {
|
|
2218
2341
|
for (var te = Math.min(L.length, V.length), oe = -1, Z = 0; Z < te; ++Z) {
|
|
2219
2342
|
var ve = K[Z];
|
|
@@ -2221,18 +2344,18 @@ function Ai() {
|
|
|
2221
2344
|
U(L[Z], ve) < 0 && (oe = Z);
|
|
2222
2345
|
}
|
|
2223
2346
|
return te < V.length && $ === "next" ? L + q.substr(L.length) : te < L.length && $ === "prev" ? L.substr(0, q.length) : oe < 0 ? null : L.substr(0, oe) + V[oe] + q.substr(oe + 1);
|
|
2224
|
-
})(
|
|
2225
|
-
M === null &&
|
|
2347
|
+
})(D, S, d[k], v[k], f, w);
|
|
2348
|
+
M === null && P === null ? b = k + 1 : (P === null || 0 < f(P, M)) && (P = M);
|
|
2226
2349
|
}
|
|
2227
|
-
return A(
|
|
2228
|
-
_.continue(
|
|
2350
|
+
return A(P !== null ? function() {
|
|
2351
|
+
_.continue(P + T);
|
|
2229
2352
|
} : x), !1;
|
|
2230
2353
|
}), e;
|
|
2231
2354
|
}
|
|
2232
2355
|
function ot(e, t, n, r) {
|
|
2233
2356
|
return { type: 2, lower: e, upper: t, lowerOpen: n, upperOpen: r };
|
|
2234
2357
|
}
|
|
2235
|
-
function
|
|
2358
|
+
function Ir(e) {
|
|
2236
2359
|
return { type: 1, lower: e, upper: e };
|
|
2237
2360
|
}
|
|
2238
2361
|
var Sr = (Object.defineProperty(xe.prototype, "Collection", { get: function() {
|
|
@@ -2248,7 +2371,7 @@ function Ai() {
|
|
|
2248
2371
|
}
|
|
2249
2372
|
}, xe.prototype.equals = function(e) {
|
|
2250
2373
|
return e == null ? Be(this, We) : new this.Collection(this, function() {
|
|
2251
|
-
return
|
|
2374
|
+
return Ir(e);
|
|
2252
2375
|
});
|
|
2253
2376
|
}, xe.prototype.above = function(e) {
|
|
2254
2377
|
return e == null ? Be(this, We) : new this.Collection(this, function() {
|
|
@@ -2277,19 +2400,19 @@ function Ai() {
|
|
|
2277
2400
|
return t === n[0];
|
|
2278
2401
|
}, [e], "");
|
|
2279
2402
|
}, xe.prototype.anyOfIgnoreCase = function() {
|
|
2280
|
-
var e = Fe.apply(
|
|
2403
|
+
var e = Fe.apply(Ue, arguments);
|
|
2281
2404
|
return e.length === 0 ? At(this) : ln(this, function(t, n) {
|
|
2282
2405
|
return n.indexOf(t) !== -1;
|
|
2283
2406
|
}, e, "");
|
|
2284
2407
|
}, xe.prototype.startsWithAnyOfIgnoreCase = function() {
|
|
2285
|
-
var e = Fe.apply(
|
|
2408
|
+
var e = Fe.apply(Ue, arguments);
|
|
2286
2409
|
return e.length === 0 ? At(this) : ln(this, function(t, n) {
|
|
2287
2410
|
return n.some(function(r) {
|
|
2288
2411
|
return t.indexOf(r) === 0;
|
|
2289
2412
|
});
|
|
2290
2413
|
}, e, mt);
|
|
2291
2414
|
}, xe.prototype.anyOf = function() {
|
|
2292
|
-
var e = this, t = Fe.apply(
|
|
2415
|
+
var e = this, t = Fe.apply(Ue, arguments), n = this._cmp;
|
|
2293
2416
|
try {
|
|
2294
2417
|
t.sort(n);
|
|
2295
2418
|
} catch {
|
|
@@ -2299,20 +2422,20 @@ function Ai() {
|
|
|
2299
2422
|
var r = new this.Collection(this, function() {
|
|
2300
2423
|
return ot(t[0], t[t.length - 1]);
|
|
2301
2424
|
});
|
|
2302
|
-
r._ondirectionchange = function(
|
|
2303
|
-
n =
|
|
2425
|
+
r._ondirectionchange = function(s) {
|
|
2426
|
+
n = s === "next" ? e._ascending : e._descending, t.sort(n);
|
|
2304
2427
|
};
|
|
2305
2428
|
var a = 0;
|
|
2306
|
-
return r._addAlgorithm(function(
|
|
2307
|
-
for (var v =
|
|
2429
|
+
return r._addAlgorithm(function(s, f, d) {
|
|
2430
|
+
for (var v = s.key; 0 < n(v, t[a]); ) if (++a === t.length) return f(d), !1;
|
|
2308
2431
|
return n(v, t[a]) === 0 || (f(function() {
|
|
2309
|
-
|
|
2432
|
+
s.continue(t[a]);
|
|
2310
2433
|
}), !1);
|
|
2311
2434
|
}), r;
|
|
2312
2435
|
}, xe.prototype.notEqual = function(e) {
|
|
2313
2436
|
return this.inAnyRange([[-1 / 0, e], [e, this.db._maxKey]], { includeLowers: !1, includeUppers: !1 });
|
|
2314
2437
|
}, xe.prototype.noneOf = function() {
|
|
2315
|
-
var e = Fe.apply(
|
|
2438
|
+
var e = Fe.apply(Ue, arguments);
|
|
2316
2439
|
if (e.length === 0) return new this.Collection(this);
|
|
2317
2440
|
try {
|
|
2318
2441
|
e.sort(this._ascending);
|
|
@@ -2323,26 +2446,26 @@ function Ai() {
|
|
|
2323
2446
|
return n ? n.concat([[n[n.length - 1][1], r]]) : [[-1 / 0, r]];
|
|
2324
2447
|
}, null);
|
|
2325
2448
|
return t.push([e[e.length - 1], this.db._maxKey]), this.inAnyRange(t, { includeLowers: !1, includeUppers: !1 });
|
|
2326
|
-
}, xe.prototype.inAnyRange = function(
|
|
2327
|
-
var n = this, r = this._cmp, a = this._ascending,
|
|
2328
|
-
if (
|
|
2329
|
-
if (!
|
|
2449
|
+
}, xe.prototype.inAnyRange = function(D, t) {
|
|
2450
|
+
var n = this, r = this._cmp, a = this._ascending, s = this._descending, f = this._min, d = this._max;
|
|
2451
|
+
if (D.length === 0) return At(this);
|
|
2452
|
+
if (!D.every(function(S) {
|
|
2330
2453
|
return S[0] !== void 0 && S[1] !== void 0 && a(S[0], S[1]) <= 0;
|
|
2331
|
-
})) return Be(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",
|
|
2454
|
+
})) return Be(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", C.InvalidArgument);
|
|
2332
2455
|
var v = !t || t.includeLowers !== !1, w = t && t.includeUppers === !0, T, p = a;
|
|
2333
|
-
function O(S,
|
|
2334
|
-
return p(S[0],
|
|
2456
|
+
function O(S, P) {
|
|
2457
|
+
return p(S[0], P[0]);
|
|
2335
2458
|
}
|
|
2336
2459
|
try {
|
|
2337
|
-
(T =
|
|
2338
|
-
for (var
|
|
2339
|
-
var L = S[
|
|
2340
|
-
if (r(
|
|
2341
|
-
L[0] = f(L[0],
|
|
2460
|
+
(T = D.reduce(function(S, P) {
|
|
2461
|
+
for (var k = 0, M = S.length; k < M; ++k) {
|
|
2462
|
+
var L = S[k];
|
|
2463
|
+
if (r(P[0], L[1]) < 0 && 0 < r(P[1], L[0])) {
|
|
2464
|
+
L[0] = f(L[0], P[0]), L[1] = d(L[1], P[1]);
|
|
2342
2465
|
break;
|
|
2343
2466
|
}
|
|
2344
2467
|
}
|
|
2345
|
-
return
|
|
2468
|
+
return k === M && S.push(P), S;
|
|
2346
2469
|
}, [])).sort(O);
|
|
2347
2470
|
} catch {
|
|
2348
2471
|
return Be(this, We);
|
|
@@ -2352,22 +2475,22 @@ function Ai() {
|
|
|
2352
2475
|
} : function(S) {
|
|
2353
2476
|
return 0 <= a(S, T[b][1]);
|
|
2354
2477
|
}, A = v ? function(S) {
|
|
2355
|
-
return 0 <
|
|
2478
|
+
return 0 < s(S, T[b][0]);
|
|
2356
2479
|
} : function(S) {
|
|
2357
|
-
return 0 <=
|
|
2358
|
-
}, x = _,
|
|
2480
|
+
return 0 <= s(S, T[b][0]);
|
|
2481
|
+
}, x = _, D = new this.Collection(this, function() {
|
|
2359
2482
|
return ot(T[0][0], T[T.length - 1][1], !v, !w);
|
|
2360
2483
|
});
|
|
2361
|
-
return
|
|
2362
|
-
p = S === "next" ? (x = _, a) : (x = A,
|
|
2363
|
-
},
|
|
2364
|
-
for (var M, L = S.key; x(L); ) if (++b === T.length) return k
|
|
2365
|
-
return !_(M = L) && !A(M) || (n._cmp(L, T[b][1]) === 0 || n._cmp(L, T[b][0]) === 0 ||
|
|
2484
|
+
return D._ondirectionchange = function(S) {
|
|
2485
|
+
p = S === "next" ? (x = _, a) : (x = A, s), T.sort(O);
|
|
2486
|
+
}, D._addAlgorithm(function(S, P, k) {
|
|
2487
|
+
for (var M, L = S.key; x(L); ) if (++b === T.length) return P(k), !1;
|
|
2488
|
+
return !_(M = L) && !A(M) || (n._cmp(L, T[b][1]) === 0 || n._cmp(L, T[b][0]) === 0 || P(function() {
|
|
2366
2489
|
p === a ? S.continue(T[b][0]) : S.continue(T[b][1]);
|
|
2367
2490
|
}), !1);
|
|
2368
|
-
}),
|
|
2491
|
+
}), D;
|
|
2369
2492
|
}, xe.prototype.startsWithAnyOf = function() {
|
|
2370
|
-
var e = Fe.apply(
|
|
2493
|
+
var e = Fe.apply(Ue, arguments);
|
|
2371
2494
|
return e.every(function(t) {
|
|
2372
2495
|
return typeof t == "string";
|
|
2373
2496
|
}) ? e.length === 0 ? At(this) : this.inAnyRange(e.map(function(t) {
|
|
@@ -2376,7 +2499,7 @@ function Ai() {
|
|
|
2376
2499
|
}, xe);
|
|
2377
2500
|
function xe() {
|
|
2378
2501
|
}
|
|
2379
|
-
function
|
|
2502
|
+
function Ve(e) {
|
|
2380
2503
|
return ge(function(t) {
|
|
2381
2504
|
return qt(t), e(t.target.error), !1;
|
|
2382
2505
|
});
|
|
@@ -2384,9 +2507,9 @@ function Ai() {
|
|
|
2384
2507
|
function qt(e) {
|
|
2385
2508
|
e.stopPropagation && e.stopPropagation(), e.preventDefault && e.preventDefault();
|
|
2386
2509
|
}
|
|
2387
|
-
var Lt = "storagemutated", jn = "x-storagemutated-1", st = Mt(null, Lt), Sa = (
|
|
2510
|
+
var Lt = "storagemutated", jn = "x-storagemutated-1", st = Mt(null, Lt), Sa = (Ge.prototype._lock = function() {
|
|
2388
2511
|
return Y(!z.global), ++this._reculock, this._reculock !== 1 || z.global || (z.lockOwnerFor = this), this;
|
|
2389
|
-
},
|
|
2512
|
+
}, Ge.prototype._unlock = function() {
|
|
2390
2513
|
if (Y(!z.global), --this._reculock == 0) for (z.global || (z.lockOwnerFor = null); 0 < this._blockedFuncs.length && !this._locked(); ) {
|
|
2391
2514
|
var e = this._blockedFuncs.shift();
|
|
2392
2515
|
try {
|
|
@@ -2395,85 +2518,85 @@ function Ai() {
|
|
|
2395
2518
|
}
|
|
2396
2519
|
}
|
|
2397
2520
|
return this;
|
|
2398
|
-
},
|
|
2521
|
+
}, Ge.prototype._locked = function() {
|
|
2399
2522
|
return this._reculock && z.lockOwnerFor !== this;
|
|
2400
|
-
},
|
|
2523
|
+
}, Ge.prototype.create = function(e) {
|
|
2401
2524
|
var t = this;
|
|
2402
2525
|
if (!this.mode) return this;
|
|
2403
2526
|
var n = this.db.idbdb, r = this.db._state.dbOpenError;
|
|
2404
2527
|
if (Y(!this.idbtrans), !e && !n) switch (r && r.name) {
|
|
2405
2528
|
case "DatabaseClosedError":
|
|
2406
|
-
throw new
|
|
2529
|
+
throw new C.DatabaseClosed(r);
|
|
2407
2530
|
case "MissingAPIError":
|
|
2408
|
-
throw new
|
|
2531
|
+
throw new C.MissingAPI(r.message, r);
|
|
2409
2532
|
default:
|
|
2410
|
-
throw new
|
|
2533
|
+
throw new C.OpenFailed(r);
|
|
2411
2534
|
}
|
|
2412
|
-
if (!this.active) throw new
|
|
2535
|
+
if (!this.active) throw new C.TransactionInactive();
|
|
2413
2536
|
return Y(this._completion._state === null), (e = this.idbtrans = e || (this.db.core || n).transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability })).onerror = ge(function(a) {
|
|
2414
2537
|
qt(a), t._reject(e.error);
|
|
2415
2538
|
}), e.onabort = ge(function(a) {
|
|
2416
|
-
qt(a), t.active && t._reject(new
|
|
2539
|
+
qt(a), t.active && t._reject(new C.Abort(e.error)), t.active = !1, t.on("abort").fire(a);
|
|
2417
2540
|
}), e.oncomplete = ge(function() {
|
|
2418
2541
|
t.active = !1, t._resolve(), "mutatedParts" in e && st.storagemutated.fire(e.mutatedParts);
|
|
2419
2542
|
}), this;
|
|
2420
|
-
},
|
|
2543
|
+
}, Ge.prototype._promise = function(e, t, n) {
|
|
2421
2544
|
var r = this;
|
|
2422
|
-
if (e === "readwrite" && this.mode !== "readwrite") return be(new
|
|
2423
|
-
if (!this.active) return be(new
|
|
2424
|
-
if (this._locked()) return new G(function(
|
|
2545
|
+
if (e === "readwrite" && this.mode !== "readwrite") return be(new C.ReadOnly("Transaction is readonly"));
|
|
2546
|
+
if (!this.active) return be(new C.TransactionInactive());
|
|
2547
|
+
if (this._locked()) return new G(function(s, f) {
|
|
2425
2548
|
r._blockedFuncs.push([function() {
|
|
2426
|
-
r._promise(e, t, n).then(
|
|
2549
|
+
r._promise(e, t, n).then(s, f);
|
|
2427
2550
|
}, z]);
|
|
2428
2551
|
});
|
|
2429
2552
|
if (n) return rt(function() {
|
|
2430
|
-
var
|
|
2553
|
+
var s = new G(function(f, d) {
|
|
2431
2554
|
r._lock();
|
|
2432
2555
|
var v = t(f, d, r);
|
|
2433
2556
|
v && v.then && v.then(f, d);
|
|
2434
2557
|
});
|
|
2435
|
-
return
|
|
2558
|
+
return s.finally(function() {
|
|
2436
2559
|
return r._unlock();
|
|
2437
|
-
}),
|
|
2560
|
+
}), s._lib = !0, s;
|
|
2438
2561
|
});
|
|
2439
|
-
var a = new G(function(
|
|
2440
|
-
var d = t(
|
|
2441
|
-
d && d.then && d.then(
|
|
2562
|
+
var a = new G(function(s, f) {
|
|
2563
|
+
var d = t(s, f, r);
|
|
2564
|
+
d && d.then && d.then(s, f);
|
|
2442
2565
|
});
|
|
2443
2566
|
return a._lib = !0, a;
|
|
2444
|
-
},
|
|
2567
|
+
}, Ge.prototype._root = function() {
|
|
2445
2568
|
return this.parent ? this.parent._root() : this;
|
|
2446
|
-
},
|
|
2569
|
+
}, Ge.prototype.waitFor = function(e) {
|
|
2447
2570
|
var t, n = this._root(), r = G.resolve(e);
|
|
2448
2571
|
n._waitingFor ? n._waitingFor = n._waitingFor.then(function() {
|
|
2449
2572
|
return r;
|
|
2450
|
-
}) : (n._waitingFor = r, n._waitingQueue = [], t = n.idbtrans.objectStore(n.storeNames[0]), (function
|
|
2573
|
+
}) : (n._waitingFor = r, n._waitingQueue = [], t = n.idbtrans.objectStore(n.storeNames[0]), (function s() {
|
|
2451
2574
|
for (++n._spinCount; n._waitingQueue.length; ) n._waitingQueue.shift()();
|
|
2452
|
-
n._waitingFor && (t.get(-1 / 0).onsuccess =
|
|
2575
|
+
n._waitingFor && (t.get(-1 / 0).onsuccess = s);
|
|
2453
2576
|
})());
|
|
2454
2577
|
var a = n._waitingFor;
|
|
2455
|
-
return new G(function(
|
|
2578
|
+
return new G(function(s, f) {
|
|
2456
2579
|
r.then(function(d) {
|
|
2457
|
-
return n._waitingQueue.push(ge(
|
|
2580
|
+
return n._waitingQueue.push(ge(s.bind(null, d)));
|
|
2458
2581
|
}, function(d) {
|
|
2459
2582
|
return n._waitingQueue.push(ge(f.bind(null, d)));
|
|
2460
2583
|
}).finally(function() {
|
|
2461
2584
|
n._waitingFor === a && (n._waitingFor = null);
|
|
2462
2585
|
});
|
|
2463
2586
|
});
|
|
2464
|
-
},
|
|
2465
|
-
this.active && (this.active = !1, this.idbtrans && this.idbtrans.abort(), this._reject(new
|
|
2466
|
-
},
|
|
2587
|
+
}, Ge.prototype.abort = function() {
|
|
2588
|
+
this.active && (this.active = !1, this.idbtrans && this.idbtrans.abort(), this._reject(new C.Abort()));
|
|
2589
|
+
}, Ge.prototype.table = function(e) {
|
|
2467
2590
|
var t = this._memoizedTables || (this._memoizedTables = {});
|
|
2468
2591
|
if (W(t, e)) return t[e];
|
|
2469
2592
|
var n = this.schema[e];
|
|
2470
|
-
if (!n) throw new
|
|
2593
|
+
if (!n) throw new C.NotFound("Table " + e + " not part of transaction");
|
|
2471
2594
|
return n = new this.db.Table(e, n, this), n.core = this.db.core.table(e), t[e] = n;
|
|
2472
|
-
},
|
|
2473
|
-
function
|
|
2595
|
+
}, Ge);
|
|
2596
|
+
function Ge() {
|
|
2474
2597
|
}
|
|
2475
|
-
function Kn(e, t, n, r, a,
|
|
2476
|
-
return { name: e, keyPath: t, unique: n, multi: r, auto: a, compound:
|
|
2598
|
+
function Kn(e, t, n, r, a, s, f, d) {
|
|
2599
|
+
return { name: e, keyPath: t, unique: n, multi: r, auto: a, compound: s, src: (n && !f ? "&" : "") + (r ? "*" : "") + (a ? "++" : "") + Rr(t), type: d };
|
|
2477
2600
|
}
|
|
2478
2601
|
function Rr(e) {
|
|
2479
2602
|
return typeof e == "string" ? e : e ? "[" + [].join.call(e, "+") + "]" : "";
|
|
@@ -2481,8 +2604,8 @@ function Ai() {
|
|
|
2481
2604
|
function qn(e, t, n) {
|
|
2482
2605
|
return { name: e, primKey: t, indexes: n, mappedClass: null, idxByName: (r = function(a) {
|
|
2483
2606
|
return [a.name, a];
|
|
2484
|
-
}, n.reduce(function(a,
|
|
2485
|
-
return f = r(
|
|
2607
|
+
}, n.reduce(function(a, s, f) {
|
|
2608
|
+
return f = r(s, f), f && (a[f[0]] = f[1]), a;
|
|
2486
2609
|
}, {})) };
|
|
2487
2610
|
var r;
|
|
2488
2611
|
}
|
|
@@ -2508,14 +2631,14 @@ function Ai() {
|
|
|
2508
2631
|
};
|
|
2509
2632
|
var t;
|
|
2510
2633
|
}
|
|
2511
|
-
function
|
|
2634
|
+
function Pr(e) {
|
|
2512
2635
|
return [].slice.call(e);
|
|
2513
2636
|
}
|
|
2514
2637
|
var Ra = 0;
|
|
2515
2638
|
function Vt(e) {
|
|
2516
2639
|
return e == null ? ":id" : typeof e == "string" ? e : "[".concat(e.join("+"), "]");
|
|
2517
2640
|
}
|
|
2518
|
-
function
|
|
2641
|
+
function Pa(e, t, v) {
|
|
2519
2642
|
function r(x) {
|
|
2520
2643
|
if (x.type === 3) return null;
|
|
2521
2644
|
if (x.type === 4) throw new Error("Cannot convert never type to IDBKeyRange");
|
|
@@ -2525,30 +2648,30 @@ function Ai() {
|
|
|
2525
2648
|
function a(O) {
|
|
2526
2649
|
var b, _ = O.name;
|
|
2527
2650
|
return { name: _, schema: O, mutate: function(A) {
|
|
2528
|
-
var x = A.trans,
|
|
2651
|
+
var x = A.trans, D = A.type, S = A.keys, P = A.values, k = A.range;
|
|
2529
2652
|
return new Promise(function(M, L) {
|
|
2530
2653
|
M = ge(M);
|
|
2531
|
-
var K = x.objectStore(_), q = K.keyPath == null, V =
|
|
2532
|
-
if (!V &&
|
|
2533
|
-
var U, $ = (S ||
|
|
2534
|
-
if (S &&
|
|
2654
|
+
var K = x.objectStore(_), q = K.keyPath == null, V = D === "put" || D === "add";
|
|
2655
|
+
if (!V && D !== "delete" && D !== "deleteRange") throw new Error("Invalid operation type: " + D);
|
|
2656
|
+
var U, $ = (S || P || { length: 1 }).length;
|
|
2657
|
+
if (S && P && S.length !== P.length) throw new Error("Given keys array must have same length as given values array.");
|
|
2535
2658
|
if ($ === 0) return M({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
|
|
2536
2659
|
function te(Se) {
|
|
2537
2660
|
++ve, qt(Se);
|
|
2538
2661
|
}
|
|
2539
2662
|
var oe = [], Z = [], ve = 0;
|
|
2540
|
-
if (
|
|
2541
|
-
if (
|
|
2542
|
-
|
|
2663
|
+
if (D === "deleteRange") {
|
|
2664
|
+
if (k.type === 4) return M({ numFailures: ve, failures: Z, results: [], lastResult: void 0 });
|
|
2665
|
+
k.type === 3 ? oe.push(U = K.clear()) : oe.push(U = K.delete(r(k)));
|
|
2543
2666
|
} else {
|
|
2544
|
-
var q = V ? q ? [
|
|
2545
|
-
if (V) for (var
|
|
2546
|
-
else for (
|
|
2667
|
+
var q = V ? q ? [P, S] : [P, null] : [S, null], H = q[0], Ce = q[1];
|
|
2668
|
+
if (V) for (var De = 0; De < $; ++De) oe.push(U = Ce && Ce[De] !== void 0 ? K[D](H[De], Ce[De]) : K[D](H[De])), U.onerror = te;
|
|
2669
|
+
else for (De = 0; De < $; ++De) oe.push(U = K[D](H[De])), U.onerror = te;
|
|
2547
2670
|
}
|
|
2548
2671
|
function Tn(Se) {
|
|
2549
2672
|
Se = Se.target.result, oe.forEach(function(vt, ir) {
|
|
2550
2673
|
return vt.error != null && (Z[ir] = vt.error);
|
|
2551
|
-
}), M({ numFailures: ve, failures: Z, results:
|
|
2674
|
+
}), M({ numFailures: ve, failures: Z, results: D === "delete" ? S : oe.map(function(vt) {
|
|
2552
2675
|
return vt.result;
|
|
2553
2676
|
}), lastResult: Se });
|
|
2554
2677
|
}
|
|
@@ -2557,55 +2680,55 @@ function Ai() {
|
|
|
2557
2680
|
}, U.onsuccess = Tn;
|
|
2558
2681
|
});
|
|
2559
2682
|
}, getMany: function(A) {
|
|
2560
|
-
var x = A.trans,
|
|
2561
|
-
return new Promise(function(S,
|
|
2683
|
+
var x = A.trans, D = A.keys;
|
|
2684
|
+
return new Promise(function(S, P) {
|
|
2562
2685
|
S = ge(S);
|
|
2563
|
-
for (var
|
|
2686
|
+
for (var k, M = x.objectStore(_), L = D.length, K = new Array(L), q = 0, V = 0, U = function(oe) {
|
|
2564
2687
|
oe = oe.target, K[oe._pos] = oe.result, ++V === q && S(K);
|
|
2565
|
-
}, $ =
|
|
2688
|
+
}, $ = Ve(P), te = 0; te < L; ++te) D[te] != null && ((k = M.get(D[te]))._pos = te, k.onsuccess = U, k.onerror = $, ++q);
|
|
2566
2689
|
q === 0 && S(K);
|
|
2567
2690
|
});
|
|
2568
2691
|
}, get: function(A) {
|
|
2569
|
-
var x = A.trans,
|
|
2570
|
-
return new Promise(function(S,
|
|
2692
|
+
var x = A.trans, D = A.key;
|
|
2693
|
+
return new Promise(function(S, P) {
|
|
2571
2694
|
S = ge(S);
|
|
2572
|
-
var
|
|
2573
|
-
|
|
2695
|
+
var k = x.objectStore(_).get(D);
|
|
2696
|
+
k.onsuccess = function(M) {
|
|
2574
2697
|
return S(M.target.result);
|
|
2575
|
-
},
|
|
2698
|
+
}, k.onerror = Ve(P);
|
|
2576
2699
|
});
|
|
2577
2700
|
}, query: (b = w, function(A) {
|
|
2578
|
-
return new Promise(function(x,
|
|
2701
|
+
return new Promise(function(x, D) {
|
|
2579
2702
|
x = ge(x);
|
|
2580
|
-
var S,
|
|
2703
|
+
var S, P, k, q = A.trans, M = A.values, L = A.limit, U = A.query, K = L === 1 / 0 ? void 0 : L, V = U.index, U = U.range, q = q.objectStore(_), V = V.isPrimaryKey ? q : q.index(V.name), U = r(U);
|
|
2581
2704
|
if (L === 0) return x({ result: [] });
|
|
2582
2705
|
b ? ((K = M ? V.getAll(U, K) : V.getAllKeys(U, K)).onsuccess = function($) {
|
|
2583
2706
|
return x({ result: $.target.result });
|
|
2584
|
-
}, K.onerror =
|
|
2585
|
-
var te =
|
|
2586
|
-
return te ? (
|
|
2587
|
-
},
|
|
2707
|
+
}, K.onerror = Ve(D)) : (S = 0, P = !M && "openKeyCursor" in V ? V.openKeyCursor(U) : V.openCursor(U), k = [], P.onsuccess = function($) {
|
|
2708
|
+
var te = P.result;
|
|
2709
|
+
return te ? (k.push(M ? te.value : te.primaryKey), ++S === L ? x({ result: k }) : void te.continue()) : x({ result: k });
|
|
2710
|
+
}, P.onerror = Ve(D));
|
|
2588
2711
|
});
|
|
2589
2712
|
}), openCursor: function(A) {
|
|
2590
|
-
var x = A.trans,
|
|
2713
|
+
var x = A.trans, D = A.values, S = A.query, P = A.reverse, k = A.unique;
|
|
2591
2714
|
return new Promise(function(M, L) {
|
|
2592
2715
|
M = ge(M);
|
|
2593
|
-
var V = S.index, K = S.range, q = x.objectStore(_), q = V.isPrimaryKey ? q : q.index(V.name), V =
|
|
2594
|
-
U.onerror =
|
|
2716
|
+
var V = S.index, K = S.range, q = x.objectStore(_), q = V.isPrimaryKey ? q : q.index(V.name), V = P ? k ? "prevunique" : "prev" : k ? "nextunique" : "next", U = !D && "openKeyCursor" in q ? q.openKeyCursor(r(K), V) : q.openCursor(r(K), V);
|
|
2717
|
+
U.onerror = Ve(L), U.onsuccess = ge(function($) {
|
|
2595
2718
|
var te, oe, Z, ve, H = U.result;
|
|
2596
2719
|
H ? (H.___id = ++Ra, H.done = !1, te = H.continue.bind(H), oe = (oe = H.continuePrimaryKey) && oe.bind(H), Z = H.advance.bind(H), ve = function() {
|
|
2597
2720
|
throw new Error("Cursor not stopped");
|
|
2598
2721
|
}, H.trans = x, H.stop = H.continue = H.continuePrimaryKey = H.advance = function() {
|
|
2599
2722
|
throw new Error("Cursor not started");
|
|
2600
2723
|
}, H.fail = ge(L), H.next = function() {
|
|
2601
|
-
var Ce = this,
|
|
2724
|
+
var Ce = this, De = 1;
|
|
2602
2725
|
return this.start(function() {
|
|
2603
|
-
return
|
|
2726
|
+
return De-- ? Ce.continue() : Ce.stop();
|
|
2604
2727
|
}).then(function() {
|
|
2605
2728
|
return Ce;
|
|
2606
2729
|
});
|
|
2607
2730
|
}, H.start = function(Ce) {
|
|
2608
|
-
function
|
|
2731
|
+
function De() {
|
|
2609
2732
|
if (U.result) try {
|
|
2610
2733
|
Ce();
|
|
2611
2734
|
} catch (Se) {
|
|
@@ -2616,36 +2739,36 @@ function Ai() {
|
|
|
2616
2739
|
}, H.stop();
|
|
2617
2740
|
}
|
|
2618
2741
|
var Tn = new Promise(function(Se, vt) {
|
|
2619
|
-
Se = ge(Se), U.onerror =
|
|
2742
|
+
Se = ge(Se), U.onerror = Ve(vt), H.fail = vt, H.stop = function(ir) {
|
|
2620
2743
|
H.stop = H.continue = H.continuePrimaryKey = H.advance = ve, Se(ir);
|
|
2621
2744
|
};
|
|
2622
2745
|
});
|
|
2623
2746
|
return U.onsuccess = ge(function(Se) {
|
|
2624
|
-
U.onsuccess =
|
|
2625
|
-
}), H.continue = te, H.continuePrimaryKey = oe, H.advance = Z,
|
|
2747
|
+
U.onsuccess = De, De();
|
|
2748
|
+
}), H.continue = te, H.continuePrimaryKey = oe, H.advance = Z, De(), Tn;
|
|
2626
2749
|
}, M(H)) : M(null);
|
|
2627
2750
|
}, L);
|
|
2628
2751
|
});
|
|
2629
2752
|
}, count: function(A) {
|
|
2630
|
-
var x = A.query,
|
|
2631
|
-
return new Promise(function(
|
|
2632
|
-
var L =
|
|
2753
|
+
var x = A.query, D = A.trans, S = x.index, P = x.range;
|
|
2754
|
+
return new Promise(function(k, M) {
|
|
2755
|
+
var L = D.objectStore(_), K = S.isPrimaryKey ? L : L.index(S.name), L = r(P), K = L ? K.count(L) : K.count();
|
|
2633
2756
|
K.onsuccess = ge(function(q) {
|
|
2634
|
-
return
|
|
2635
|
-
}), K.onerror =
|
|
2757
|
+
return k(q.target.result);
|
|
2758
|
+
}), K.onerror = Ve(M);
|
|
2636
2759
|
});
|
|
2637
2760
|
} };
|
|
2638
2761
|
}
|
|
2639
|
-
var
|
|
2762
|
+
var s, f, d, T = (f = v, d = Pr((s = e).objectStoreNames), { schema: { name: s.name, tables: d.map(function(O) {
|
|
2640
2763
|
return f.objectStore(O);
|
|
2641
2764
|
}).map(function(O) {
|
|
2642
|
-
var b = O.keyPath, x = O.autoIncrement, _ = N(b), A = {}, x = { name: O.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: b == null, compound: _, keyPath: b, autoIncrement: x, unique: !0, extractKey: Ln(b) }, indexes:
|
|
2643
|
-
return O.index(
|
|
2644
|
-
}).map(function(
|
|
2645
|
-
var S =
|
|
2646
|
-
return A[Vt(
|
|
2647
|
-
}), getIndexByKeyPath: function(
|
|
2648
|
-
return A[Vt(
|
|
2765
|
+
var b = O.keyPath, x = O.autoIncrement, _ = N(b), A = {}, x = { name: O.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: b == null, compound: _, keyPath: b, autoIncrement: x, unique: !0, extractKey: Ln(b) }, indexes: Pr(O.indexNames).map(function(D) {
|
|
2766
|
+
return O.index(D);
|
|
2767
|
+
}).map(function(k) {
|
|
2768
|
+
var S = k.name, P = k.unique, M = k.multiEntry, k = k.keyPath, M = { name: S, compound: N(k), keyPath: k, unique: P, multiEntry: M, extractKey: Ln(k) };
|
|
2769
|
+
return A[Vt(k)] = M;
|
|
2770
|
+
}), getIndexByKeyPath: function(D) {
|
|
2771
|
+
return A[Vt(D)];
|
|
2649
2772
|
} };
|
|
2650
2773
|
return A[":id"] = x.primaryKey, b != null && (A[Vt(b)] = x.primaryKey), x;
|
|
2651
2774
|
}) }, hasGetAll: 0 < d.length && "getAll" in f.objectStore(d[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }), v = T.schema, w = T.hasGetAll, T = v.tables.map(a), p = {};
|
|
@@ -2656,24 +2779,24 @@ function Ai() {
|
|
|
2656
2779
|
return p[O];
|
|
2657
2780
|
}, MIN_KEY: -1 / 0, MAX_KEY: Ut(t), schema: v };
|
|
2658
2781
|
}
|
|
2659
|
-
function
|
|
2782
|
+
function ka(e, t, n, r) {
|
|
2660
2783
|
var a = n.IDBKeyRange;
|
|
2661
|
-
return n.indexedDB, { dbcore: (r =
|
|
2662
|
-
return f = f.create, i(i({},
|
|
2784
|
+
return n.indexedDB, { dbcore: (r = Pa(t, a, r), e.dbcore.reduce(function(s, f) {
|
|
2785
|
+
return f = f.create, i(i({}, s), f(s));
|
|
2663
2786
|
}, r)) };
|
|
2664
2787
|
}
|
|
2665
2788
|
function fn(e, r) {
|
|
2666
|
-
var n = r.db, r =
|
|
2789
|
+
var n = r.db, r = ka(e._middlewares, n, e._deps, r);
|
|
2667
2790
|
e.core = r.dbcore, e.tables.forEach(function(a) {
|
|
2668
|
-
var
|
|
2791
|
+
var s = a.name;
|
|
2669
2792
|
e.core.schema.tables.some(function(f) {
|
|
2670
|
-
return f.name ===
|
|
2671
|
-
}) && (a.core = e.core.table(
|
|
2793
|
+
return f.name === s;
|
|
2794
|
+
}) && (a.core = e.core.table(s), e[s] instanceof e.Table && (e[s].core = a.core));
|
|
2672
2795
|
});
|
|
2673
2796
|
}
|
|
2674
2797
|
function dn(e, t, n, r) {
|
|
2675
2798
|
n.forEach(function(a) {
|
|
2676
|
-
var
|
|
2799
|
+
var s = r[a];
|
|
2677
2800
|
t.forEach(function(f) {
|
|
2678
2801
|
var d = (function v(w, T) {
|
|
2679
2802
|
return se(w, T) || (w = j(w)) && v(w, T);
|
|
@@ -2682,7 +2805,7 @@ function Ai() {
|
|
|
2682
2805
|
return this.table(a);
|
|
2683
2806
|
}, set: function(v) {
|
|
2684
2807
|
fe(this, a, { value: v, writable: !0, configurable: !0, enumerable: !0 });
|
|
2685
|
-
} }) : f[a] = new e.Table(a,
|
|
2808
|
+
} }) : f[a] = new e.Table(a, s));
|
|
2686
2809
|
});
|
|
2687
2810
|
});
|
|
2688
2811
|
}
|
|
@@ -2697,24 +2820,24 @@ function Ai() {
|
|
|
2697
2820
|
function Ba(e, t, n, r) {
|
|
2698
2821
|
var a = e._dbSchema;
|
|
2699
2822
|
n.objectStoreNames.contains("$meta") && !a.$meta && (a.$meta = qn("$meta", Fr("")[0], []), e._storeNames.push("$meta"));
|
|
2700
|
-
var
|
|
2701
|
-
|
|
2702
|
-
var f =
|
|
2823
|
+
var s = e._createTransaction("readwrite", e._storeNames, a);
|
|
2824
|
+
s.create(n), s._completion.catch(r);
|
|
2825
|
+
var f = s._reject.bind(s), d = z.transless || z;
|
|
2703
2826
|
rt(function() {
|
|
2704
|
-
return z.trans =
|
|
2827
|
+
return z.trans = s, z.transless = d, t !== 0 ? (fn(e, n), w = t, ((v = s).storeNames.includes("$meta") ? v.table("$meta").get("version").then(function(T) {
|
|
2705
2828
|
return T ?? w;
|
|
2706
2829
|
}) : G.resolve(w)).then(function(T) {
|
|
2707
|
-
return O = T, b =
|
|
2708
|
-
return
|
|
2709
|
-
})).length !== 0 ? (T.forEach(function(
|
|
2830
|
+
return O = T, b = s, _ = n, A = [], T = (p = e)._versions, x = p._dbSchema = mn(0, p.idbdb, _), (T = T.filter(function(D) {
|
|
2831
|
+
return D._cfg.version >= O;
|
|
2832
|
+
})).length !== 0 ? (T.forEach(function(D) {
|
|
2710
2833
|
A.push(function() {
|
|
2711
|
-
var S = x,
|
|
2712
|
-
pn(p, S, _), pn(p,
|
|
2713
|
-
var
|
|
2714
|
-
|
|
2834
|
+
var S = x, P = D._cfg.dbschema;
|
|
2835
|
+
pn(p, S, _), pn(p, P, _), x = p._dbSchema = P;
|
|
2836
|
+
var k = Vn(S, P);
|
|
2837
|
+
k.add.forEach(function(V) {
|
|
2715
2838
|
Gn(_, V[0], V[1].primKey, V[1].indexes);
|
|
2716
|
-
}),
|
|
2717
|
-
if (V.recreate) throw new
|
|
2839
|
+
}), k.change.forEach(function(V) {
|
|
2840
|
+
if (V.recreate) throw new C.Upgrade("Not yet support for changing primary key");
|
|
2718
2841
|
var U = _.objectStore(V.name);
|
|
2719
2842
|
V.add.forEach(function($) {
|
|
2720
2843
|
return hn(U, $);
|
|
@@ -2724,70 +2847,70 @@ function Ai() {
|
|
|
2724
2847
|
return U.deleteIndex($);
|
|
2725
2848
|
});
|
|
2726
2849
|
});
|
|
2727
|
-
var M =
|
|
2728
|
-
if (M &&
|
|
2850
|
+
var M = D._cfg.contentUpgrade;
|
|
2851
|
+
if (M && D._cfg.version > O) {
|
|
2729
2852
|
fn(p, _), b._memoizedTables = {};
|
|
2730
|
-
var L =
|
|
2731
|
-
|
|
2853
|
+
var L = Ie(P);
|
|
2854
|
+
k.del.forEach(function(V) {
|
|
2732
2855
|
L[V] = S[V];
|
|
2733
2856
|
}), Un(p, [p.Transaction.prototype]), dn(p, [p.Transaction.prototype], y(L), L), b.schema = L;
|
|
2734
|
-
var K, q =
|
|
2735
|
-
return q && Et(),
|
|
2857
|
+
var K, q = qe(M);
|
|
2858
|
+
return q && Et(), k = G.follow(function() {
|
|
2736
2859
|
var V;
|
|
2737
2860
|
(K = M(b)) && q && (V = at.bind(null, null), K.then(V, V));
|
|
2738
|
-
}), K && typeof K.then == "function" ? G.resolve(K) :
|
|
2861
|
+
}), K && typeof K.then == "function" ? G.resolve(K) : k.then(function() {
|
|
2739
2862
|
return K;
|
|
2740
2863
|
});
|
|
2741
2864
|
}
|
|
2742
2865
|
}), A.push(function(S) {
|
|
2743
|
-
var
|
|
2744
|
-
|
|
2745
|
-
return
|
|
2866
|
+
var P, k, M = D._cfg.dbschema;
|
|
2867
|
+
P = M, k = S, [].slice.call(k.db.objectStoreNames).forEach(function(L) {
|
|
2868
|
+
return P[L] == null && k.db.deleteObjectStore(L);
|
|
2746
2869
|
}), Un(p, [p.Transaction.prototype]), dn(p, [p.Transaction.prototype], p._storeNames, p._dbSchema), b.schema = p._dbSchema;
|
|
2747
2870
|
}), A.push(function(S) {
|
|
2748
|
-
p.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(p.idbdb.version / 10) ===
|
|
2749
|
-
return
|
|
2750
|
-
})) : S.objectStore("$meta").put(
|
|
2871
|
+
p.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(p.idbdb.version / 10) === D._cfg.version ? (p.idbdb.deleteObjectStore("$meta"), delete p._dbSchema.$meta, p._storeNames = p._storeNames.filter(function(P) {
|
|
2872
|
+
return P !== "$meta";
|
|
2873
|
+
})) : S.objectStore("$meta").put(D._cfg.version, "version"));
|
|
2751
2874
|
});
|
|
2752
|
-
}), (function
|
|
2753
|
-
return A.length ? G.resolve(A.shift()(b.idbtrans)).then(
|
|
2875
|
+
}), (function D() {
|
|
2876
|
+
return A.length ? G.resolve(A.shift()(b.idbtrans)).then(D) : G.resolve();
|
|
2754
2877
|
})().then(function() {
|
|
2755
|
-
|
|
2878
|
+
kr(x, _);
|
|
2756
2879
|
})) : G.resolve();
|
|
2757
2880
|
var p, O, b, _, A, x;
|
|
2758
2881
|
}).catch(f)) : (y(a).forEach(function(T) {
|
|
2759
2882
|
Gn(n, T, a[T].primKey, a[T].indexes);
|
|
2760
2883
|
}), fn(e, n), void G.follow(function() {
|
|
2761
|
-
return e.on.populate.fire(
|
|
2884
|
+
return e.on.populate.fire(s);
|
|
2762
2885
|
}).catch(f));
|
|
2763
2886
|
var v, w;
|
|
2764
2887
|
});
|
|
2765
2888
|
}
|
|
2766
2889
|
function Ma(e, t) {
|
|
2767
|
-
|
|
2890
|
+
kr(e._dbSchema, t), t.db.version % 10 != 0 || t.objectStoreNames.contains("$meta") || t.db.createObjectStore("$meta").add(Math.ceil(t.db.version / 10 - 1), "version");
|
|
2768
2891
|
var n = mn(0, e.idbdb, t);
|
|
2769
2892
|
pn(e, e._dbSchema, t);
|
|
2770
2893
|
for (var r = 0, a = Vn(n, e._dbSchema).change; r < a.length; r++) {
|
|
2771
|
-
var
|
|
2894
|
+
var s = (function(f) {
|
|
2772
2895
|
if (f.change.length || f.recreate) return console.warn("Unable to patch indexes of table ".concat(f.name, " because it has changes on the type of index or primary key.")), { value: void 0 };
|
|
2773
2896
|
var d = t.objectStore(f.name);
|
|
2774
2897
|
f.add.forEach(function(v) {
|
|
2775
|
-
|
|
2898
|
+
Pe && console.debug("Dexie upgrade patch: Creating missing index ".concat(f.name, ".").concat(v.src)), hn(d, v);
|
|
2776
2899
|
});
|
|
2777
2900
|
})(a[r]);
|
|
2778
|
-
if (typeof
|
|
2901
|
+
if (typeof s == "object") return s.value;
|
|
2779
2902
|
}
|
|
2780
2903
|
}
|
|
2781
2904
|
function Vn(e, t) {
|
|
2782
2905
|
var n, r = { del: [], add: [], change: [] };
|
|
2783
2906
|
for (n in e) t[n] || r.del.push(n);
|
|
2784
2907
|
for (n in t) {
|
|
2785
|
-
var a = e[n],
|
|
2908
|
+
var a = e[n], s = t[n];
|
|
2786
2909
|
if (a) {
|
|
2787
|
-
var f = { name: n, def:
|
|
2788
|
-
if ("" + (a.primKey.keyPath || "") != "" + (
|
|
2910
|
+
var f = { name: n, def: s, recreate: !1, del: [], add: [], change: [] };
|
|
2911
|
+
if ("" + (a.primKey.keyPath || "") != "" + (s.primKey.keyPath || "") || a.primKey.auto !== s.primKey.auto) f.recreate = !0, r.change.push(f);
|
|
2789
2912
|
else {
|
|
2790
|
-
var d = a.idxByName, v =
|
|
2913
|
+
var d = a.idxByName, v = s.idxByName, w = void 0;
|
|
2791
2914
|
for (w in d) v[w] || f.del.push(w);
|
|
2792
2915
|
for (w in v) {
|
|
2793
2916
|
var T = d[w], p = v[w];
|
|
@@ -2795,19 +2918,19 @@ function Ai() {
|
|
|
2795
2918
|
}
|
|
2796
2919
|
(0 < f.del.length || 0 < f.add.length || 0 < f.change.length) && r.change.push(f);
|
|
2797
2920
|
}
|
|
2798
|
-
} else r.add.push([n,
|
|
2921
|
+
} else r.add.push([n, s]);
|
|
2799
2922
|
}
|
|
2800
2923
|
return r;
|
|
2801
2924
|
}
|
|
2802
2925
|
function Gn(e, t, n, r) {
|
|
2803
2926
|
var a = e.db.createObjectStore(t, n.keyPath ? { keyPath: n.keyPath, autoIncrement: n.auto } : { autoIncrement: n.auto });
|
|
2804
|
-
return r.forEach(function(
|
|
2805
|
-
return hn(a,
|
|
2927
|
+
return r.forEach(function(s) {
|
|
2928
|
+
return hn(a, s);
|
|
2806
2929
|
}), a;
|
|
2807
2930
|
}
|
|
2808
|
-
function
|
|
2931
|
+
function kr(e, t) {
|
|
2809
2932
|
y(e).forEach(function(n) {
|
|
2810
|
-
t.db.objectStoreNames.contains(n) || (
|
|
2933
|
+
t.db.objectStoreNames.contains(n) || (Pe && console.debug("Dexie: Creating missing table", n), Gn(t, n, e[n].primKey, e[n].indexes));
|
|
2811
2934
|
});
|
|
2812
2935
|
}
|
|
2813
2936
|
function hn(e, t) {
|
|
@@ -2816,8 +2939,8 @@ function Ai() {
|
|
|
2816
2939
|
function mn(e, t, n) {
|
|
2817
2940
|
var r = {};
|
|
2818
2941
|
return Te(t.objectStoreNames, 0).forEach(function(a) {
|
|
2819
|
-
for (var
|
|
2820
|
-
var T =
|
|
2942
|
+
for (var s = n.objectStore(a), f = Kn(Rr(w = s.keyPath), w || "", !0, !1, !!s.autoIncrement, w && typeof w != "string", !0), d = [], v = 0; v < s.indexNames.length; ++v) {
|
|
2943
|
+
var T = s.index(s.indexNames[v]), w = T.keyPath, T = Kn(T.name, w, !!T.unique, !!T.multiEntry, !1, w && typeof w != "string", !1);
|
|
2821
2944
|
d.push(T);
|
|
2822
2945
|
}
|
|
2823
2946
|
r[a] = qn(a, f, d);
|
|
@@ -2825,40 +2948,40 @@ function Ai() {
|
|
|
2825
2948
|
}
|
|
2826
2949
|
function pn(e, t, n) {
|
|
2827
2950
|
for (var r = n.db.objectStoreNames, a = 0; a < r.length; ++a) {
|
|
2828
|
-
var
|
|
2951
|
+
var s = r[a], f = n.objectStore(s);
|
|
2829
2952
|
e._hasGetAll = "getAll" in f;
|
|
2830
2953
|
for (var d = 0; d < f.indexNames.length; ++d) {
|
|
2831
2954
|
var v = f.indexNames[d], w = f.index(v).keyPath, T = typeof w == "string" ? w : "[" + Te(w).join("+") + "]";
|
|
2832
|
-
!t[
|
|
2955
|
+
!t[s] || (w = t[s].idxByName[T]) && (w.name = v, delete t[s].idxByName[T], t[s].idxByName[v] = w);
|
|
2833
2956
|
}
|
|
2834
2957
|
}
|
|
2835
2958
|
typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && m.WorkerGlobalScope && m instanceof m.WorkerGlobalScope && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604 && (e._hasGetAll = !1);
|
|
2836
2959
|
}
|
|
2837
2960
|
function Fr(e) {
|
|
2838
2961
|
return e.split(",").map(function(t, n) {
|
|
2839
|
-
var
|
|
2840
|
-
return Kn(a,
|
|
2962
|
+
var s = t.split(":"), r = (a = s[1]) === null || a === void 0 ? void 0 : a.trim(), a = (t = s[0].trim()).replace(/([&*]|\+\+)/g, ""), s = /^\[/.test(a) ? a.match(/^\[(.*)\]$/)[1].split("+") : a;
|
|
2963
|
+
return Kn(a, s || null, /\&/.test(t), /\*/.test(t), /\+\+/.test(t), N(s), n === 0, r);
|
|
2841
2964
|
});
|
|
2842
2965
|
}
|
|
2843
2966
|
var ja = (Ot.prototype._createTableSchema = qn, Ot.prototype._parseIndexSyntax = Fr, Ot.prototype._parseStoresSpec = function(e, t) {
|
|
2844
2967
|
var n = this;
|
|
2845
2968
|
y(e).forEach(function(r) {
|
|
2846
2969
|
if (e[r] !== null) {
|
|
2847
|
-
var a = n._parseIndexSyntax(e[r]),
|
|
2848
|
-
if (!
|
|
2849
|
-
if (
|
|
2970
|
+
var a = n._parseIndexSyntax(e[r]), s = a.shift();
|
|
2971
|
+
if (!s) throw new C.Schema("Invalid schema for table " + r + ": " + e[r]);
|
|
2972
|
+
if (s.unique = !0, s.multi) throw new C.Schema("Primary key cannot be multiEntry*");
|
|
2850
2973
|
a.forEach(function(f) {
|
|
2851
|
-
if (f.auto) throw new
|
|
2852
|
-
if (!f.keyPath) throw new
|
|
2853
|
-
}), a = n._createTableSchema(r,
|
|
2974
|
+
if (f.auto) throw new C.Schema("Only primary key can be marked as autoIncrement (++)");
|
|
2975
|
+
if (!f.keyPath) throw new C.Schema("Index must have a name and cannot be an empty string");
|
|
2976
|
+
}), a = n._createTableSchema(r, s, a), t[r] = a;
|
|
2854
2977
|
}
|
|
2855
2978
|
});
|
|
2856
2979
|
}, Ot.prototype.stores = function(n) {
|
|
2857
2980
|
var t = this.db;
|
|
2858
2981
|
this._cfg.storesSource = this._cfg.storesSource ? R(this._cfg.storesSource, n) : n;
|
|
2859
2982
|
var n = t._versions, r = {}, a = {};
|
|
2860
|
-
return n.forEach(function(
|
|
2861
|
-
R(r,
|
|
2983
|
+
return n.forEach(function(s) {
|
|
2984
|
+
R(r, s._cfg.storesSource), a = s._cfg.dbschema = {}, s._parseStoresSpec(r, a);
|
|
2862
2985
|
}), t._dbSchema = a, Un(t, [t._allTables, t, t.Transaction.prototype]), dn(t, [t._allTables, t, t.Transaction.prototype, this._cfg.tables], y(a), a), t._storeNames = y(a), this;
|
|
2863
2986
|
}, Ot.prototype.upgrade = function(e) {
|
|
2864
2987
|
return this._cfg.contentUpgrade = wt(this._cfg.contentUpgrade || Q, e), this;
|
|
@@ -2900,16 +3023,16 @@ function Ai() {
|
|
|
2900
3023
|
}
|
|
2901
3024
|
function $t(e, t) {
|
|
2902
3025
|
Yn(t) || (function n(r, v) {
|
|
2903
|
-
var
|
|
2904
|
-
Gt(r,
|
|
3026
|
+
var s = v.from, f = v.to, d = v.l, v = v.r;
|
|
3027
|
+
Gt(r, s, f), d && n(r, d), v && n(r, v);
|
|
2905
3028
|
})(e, t);
|
|
2906
3029
|
}
|
|
2907
3030
|
function Br(e, t) {
|
|
2908
3031
|
var n = gn(t), r = n.next();
|
|
2909
3032
|
if (r.done) return !1;
|
|
2910
|
-
for (var a = r.value,
|
|
3033
|
+
for (var a = r.value, s = gn(e), f = s.next(a.from), d = f.value; !r.done && !f.done; ) {
|
|
2911
3034
|
if (re(d.from, a.to) <= 0 && 0 <= re(d.to, a.from)) return !0;
|
|
2912
|
-
re(a.from, d.from) < 0 ? a = (r = n.next(d.from)).value : d = (f =
|
|
3035
|
+
re(a.from, d.from) < 0 ? a = (r = n.next(d.from)).value : d = (f = s.next(a.from)).value;
|
|
2913
3036
|
}
|
|
2914
3037
|
return !1;
|
|
2915
3038
|
}
|
|
@@ -2944,8 +3067,8 @@ function Ai() {
|
|
|
2944
3067
|
function yn(e, t) {
|
|
2945
3068
|
return y(t).forEach(function(n) {
|
|
2946
3069
|
e[n] ? $t(e[n], t[n]) : e[n] = (function r(a) {
|
|
2947
|
-
var
|
|
2948
|
-
for (
|
|
3070
|
+
var s, f, d = {};
|
|
3071
|
+
for (s in a) W(a, s) && (f = a[s], d[s] = !f || typeof f != "object" || He.has(f.constructor) ? f : r(f));
|
|
2949
3072
|
return d;
|
|
2950
3073
|
})(t[n]);
|
|
2951
3074
|
}), e;
|
|
@@ -2980,17 +3103,17 @@ function Ai() {
|
|
|
2980
3103
|
t === void 0 && (t = !1);
|
|
2981
3104
|
var n = /* @__PURE__ */ new Set();
|
|
2982
3105
|
if (e.all) for (var r = 0, a = Object.values(gt); r < a.length; r++) Kr(f = a[r], e, n, t);
|
|
2983
|
-
else for (var
|
|
2984
|
-
var f, d = /^idb\:\/\/(.*)\/(.*)\//.exec(
|
|
2985
|
-
d && (
|
|
3106
|
+
else for (var s in e) {
|
|
3107
|
+
var f, d = /^idb\:\/\/(.*)\/(.*)\//.exec(s);
|
|
3108
|
+
d && (s = d[1], d = d[2], (f = gt["idb://".concat(s, "/").concat(d)]) && Kr(f, e, n, t));
|
|
2986
3109
|
}
|
|
2987
3110
|
n.forEach(function(v) {
|
|
2988
3111
|
return v();
|
|
2989
3112
|
});
|
|
2990
3113
|
}
|
|
2991
3114
|
function Kr(e, t, n, r) {
|
|
2992
|
-
for (var a = [],
|
|
2993
|
-
for (var d = f[
|
|
3115
|
+
for (var a = [], s = 0, f = Object.entries(e.queries.query); s < f.length; s++) {
|
|
3116
|
+
for (var d = f[s], v = d[0], w = [], T = 0, p = d[1]; T < p.length; T++) {
|
|
2994
3117
|
var O = p[T];
|
|
2995
3118
|
zn(t, O.obsSet) ? O.subscribers.forEach(function(x) {
|
|
2996
3119
|
return n.add(x);
|
|
@@ -3009,29 +3132,29 @@ function Ai() {
|
|
|
3009
3132
|
return t.dbOpenError ? be(t.dbOpenError) : e;
|
|
3010
3133
|
});
|
|
3011
3134
|
t.isBeingOpened = !0, t.dbOpenError = null, t.openComplete = !1;
|
|
3012
|
-
var r = t.openCanceller, a = Math.round(10 * e.verno),
|
|
3135
|
+
var r = t.openCanceller, a = Math.round(10 * e.verno), s = !1;
|
|
3013
3136
|
function f() {
|
|
3014
|
-
if (t.openCanceller !== r) throw new
|
|
3137
|
+
if (t.openCanceller !== r) throw new C.DatabaseClosed("db.open() was cancelled");
|
|
3015
3138
|
}
|
|
3016
3139
|
function d() {
|
|
3017
3140
|
return new G(function(O, b) {
|
|
3018
|
-
if (f(), !n) throw new
|
|
3141
|
+
if (f(), !n) throw new C.MissingAPI();
|
|
3019
3142
|
var _ = e.name, A = t.autoSchema || !a ? n.open(_) : n.open(_, a);
|
|
3020
|
-
if (!A) throw new
|
|
3021
|
-
A.onerror =
|
|
3022
|
-
var
|
|
3023
|
-
T = A.transaction, t.autoSchema && !e._options.allowEmptyDB ? (A.onerror = qt, T.abort(), A.result.close(), (
|
|
3024
|
-
b(new
|
|
3025
|
-
})) : (T.onerror =
|
|
3143
|
+
if (!A) throw new C.MissingAPI();
|
|
3144
|
+
A.onerror = Ve(b), A.onblocked = ge(e._fireOnBlocked), A.onupgradeneeded = ge(function(x) {
|
|
3145
|
+
var D;
|
|
3146
|
+
T = A.transaction, t.autoSchema && !e._options.allowEmptyDB ? (A.onerror = qt, T.abort(), A.result.close(), (D = n.deleteDatabase(_)).onsuccess = D.onerror = ge(function() {
|
|
3147
|
+
b(new C.NoSuchDatabase("Database ".concat(_, " doesnt exist")));
|
|
3148
|
+
})) : (T.onerror = Ve(b), x = x.oldVersion > Math.pow(2, 62) ? 0 : x.oldVersion, p = x < 1, e.idbdb = A.result, s && Ma(e, T), Ba(e, x / 10, T, b));
|
|
3026
3149
|
}, b), A.onsuccess = ge(function() {
|
|
3027
3150
|
T = null;
|
|
3028
|
-
var x,
|
|
3151
|
+
var x, D, S, P, k, M = e.idbdb = A.result, L = Te(M.objectStoreNames);
|
|
3029
3152
|
if (0 < L.length) try {
|
|
3030
|
-
var K = M.transaction((
|
|
3031
|
-
if (t.autoSchema)
|
|
3032
|
-
else if (pn(e, e._dbSchema, K), ((
|
|
3153
|
+
var K = M.transaction((P = L).length === 1 ? P[0] : P, "readonly");
|
|
3154
|
+
if (t.autoSchema) D = M, S = K, (x = e).verno = D.version / 10, S = x._dbSchema = mn(0, D, S), x._storeNames = Te(D.objectStoreNames, 0), dn(x, [x._allTables], y(S), S);
|
|
3155
|
+
else if (pn(e, e._dbSchema, K), ((k = Vn(mn(0, (k = e).idbdb, K), k._dbSchema)).add.length || k.change.some(function(q) {
|
|
3033
3156
|
return q.add.length || q.change.length;
|
|
3034
|
-
})) && !
|
|
3157
|
+
})) && !s) return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."), M.close(), a = M.version + 1, s = !0, O(d());
|
|
3035
3158
|
fn(e, K);
|
|
3036
3159
|
} catch {
|
|
3037
3160
|
}
|
|
@@ -3039,7 +3162,7 @@ function Ai() {
|
|
|
3039
3162
|
t.vcFired = !0, e.on("versionchange").fire(q);
|
|
3040
3163
|
}), M.onclose = ge(function(q) {
|
|
3041
3164
|
e.on("close").fire(q);
|
|
3042
|
-
}), p && (
|
|
3165
|
+
}), p && (k = e._deps, K = _, M = k.indexedDB, k = k.IDBKeyRange, Xn(M) || K === an || $n(M, k).put({ name: K }).catch(Q)), O();
|
|
3043
3166
|
}, b);
|
|
3044
3167
|
}).catch(function(O) {
|
|
3045
3168
|
switch (O?.name) {
|
|
@@ -3092,15 +3215,15 @@ function Ai() {
|
|
|
3092
3215
|
});
|
|
3093
3216
|
}
|
|
3094
3217
|
function Jn(e) {
|
|
3095
|
-
function t(
|
|
3096
|
-
return e.next(
|
|
3218
|
+
function t(s) {
|
|
3219
|
+
return e.next(s);
|
|
3097
3220
|
}
|
|
3098
|
-
var n = a(t), r = a(function(
|
|
3099
|
-
return e.throw(
|
|
3221
|
+
var n = a(t), r = a(function(s) {
|
|
3222
|
+
return e.throw(s);
|
|
3100
3223
|
});
|
|
3101
|
-
function a(
|
|
3224
|
+
function a(s) {
|
|
3102
3225
|
return function(v) {
|
|
3103
|
-
var d =
|
|
3226
|
+
var d = s(v), v = d.value;
|
|
3104
3227
|
return d.done ? v : v && typeof v.then == "function" ? v.then(n, r) : N(v) ? Promise.all(v).then(n, r) : n(v);
|
|
3105
3228
|
};
|
|
3106
3229
|
}
|
|
@@ -3112,12 +3235,12 @@ function Ai() {
|
|
|
3112
3235
|
}
|
|
3113
3236
|
var qa = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(e) {
|
|
3114
3237
|
return i(i({}, e), { table: function(t) {
|
|
3115
|
-
var n = e.table(t), r = n.schema, a = {},
|
|
3238
|
+
var n = e.table(t), r = n.schema, a = {}, s = [];
|
|
3116
3239
|
function f(p, O, b) {
|
|
3117
|
-
var _ = Vt(p), A = a[_] = a[_] || [], x = p == null ? 0 : typeof p == "string" ? 1 : p.length,
|
|
3118
|
-
return A.push(
|
|
3119
|
-
return S.keyTail -
|
|
3120
|
-
}),
|
|
3240
|
+
var _ = Vt(p), A = a[_] = a[_] || [], x = p == null ? 0 : typeof p == "string" ? 1 : p.length, D = 0 < O, D = i(i({}, b), { name: D ? "".concat(_, "(virtual-from:").concat(b.name, ")") : b.name, lowLevelIndex: b, isVirtual: D, keyTail: O, keyLength: x, extractKey: Ln(p), unique: !D && b.unique });
|
|
3241
|
+
return A.push(D), D.isPrimaryKey || s.push(D), 1 < x && f(x === 2 ? p[0] : p.slice(0, x - 1), O + 1, b), A.sort(function(S, P) {
|
|
3242
|
+
return S.keyTail - P.keyTail;
|
|
3243
|
+
}), D;
|
|
3121
3244
|
}
|
|
3122
3245
|
t = f(r.primaryKey.keyPath, 0, r.primaryKey), a[":id"] = [t];
|
|
3123
3246
|
for (var d = 0, v = r.indexes; d < v.length; d++) {
|
|
@@ -3128,7 +3251,7 @@ function Ai() {
|
|
|
3128
3251
|
var O, b = p.query.index;
|
|
3129
3252
|
return b.isVirtual ? i(i({}, p), { query: { index: b.lowLevelIndex, range: (O = p.query.range, b = b.keyTail, { type: O.type === 1 ? 2 : O.type, lower: bn(O.lower, O.lowerOpen ? e.MAX_KEY : e.MIN_KEY, b), lowerOpen: !0, upper: bn(O.upper, O.upperOpen ? e.MIN_KEY : e.MAX_KEY, b), upperOpen: !0 }) } }) : p;
|
|
3130
3253
|
}
|
|
3131
|
-
return i(i({}, n), { schema: i(i({}, r), { primaryKey: t, indexes:
|
|
3254
|
+
return i(i({}, n), { schema: i(i({}, r), { primaryKey: t, indexes: s, getIndexByKeyPath: function(p) {
|
|
3132
3255
|
return (p = a[Vt(p)]) && p[0];
|
|
3133
3256
|
} }), count: function(p) {
|
|
3134
3257
|
return n.count(T(p));
|
|
@@ -3136,21 +3259,21 @@ function Ai() {
|
|
|
3136
3259
|
return n.query(T(p));
|
|
3137
3260
|
}, openCursor: function(p) {
|
|
3138
3261
|
var O = p.query.index, b = O.keyTail, _ = O.isVirtual, A = O.keyLength;
|
|
3139
|
-
return _ ? n.openCursor(T(p)).then(function(
|
|
3140
|
-
return
|
|
3262
|
+
return _ ? n.openCursor(T(p)).then(function(D) {
|
|
3263
|
+
return D && x(D);
|
|
3141
3264
|
}) : n.openCursor(p);
|
|
3142
|
-
function x(
|
|
3143
|
-
return Object.create(
|
|
3144
|
-
S != null ?
|
|
3145
|
-
} }, continuePrimaryKey: { value: function(S,
|
|
3146
|
-
|
|
3265
|
+
function x(D) {
|
|
3266
|
+
return Object.create(D, { continue: { value: function(S) {
|
|
3267
|
+
S != null ? D.continue(bn(S, p.reverse ? e.MAX_KEY : e.MIN_KEY, b)) : p.unique ? D.continue(D.key.slice(0, A).concat(p.reverse ? e.MIN_KEY : e.MAX_KEY, b)) : D.continue();
|
|
3268
|
+
} }, continuePrimaryKey: { value: function(S, P) {
|
|
3269
|
+
D.continuePrimaryKey(bn(S, e.MAX_KEY, b), P);
|
|
3147
3270
|
} }, primaryKey: { get: function() {
|
|
3148
|
-
return
|
|
3271
|
+
return D.primaryKey;
|
|
3149
3272
|
} }, key: { get: function() {
|
|
3150
|
-
var S =
|
|
3273
|
+
var S = D.key;
|
|
3151
3274
|
return A === 1 ? S[0] : S.slice(0, A);
|
|
3152
3275
|
} }, value: { get: function() {
|
|
3153
|
-
return
|
|
3276
|
+
return D.value;
|
|
3154
3277
|
} } });
|
|
3155
3278
|
}
|
|
3156
3279
|
} });
|
|
@@ -3158,8 +3281,8 @@ function Ai() {
|
|
|
3158
3281
|
} };
|
|
3159
3282
|
function er(e, t, n, r) {
|
|
3160
3283
|
return n = n || {}, r = r || "", y(e).forEach(function(a) {
|
|
3161
|
-
var
|
|
3162
|
-
W(t, a) ? (
|
|
3284
|
+
var s, f, d;
|
|
3285
|
+
W(t, a) ? (s = e[a], f = t[a], typeof s == "object" && typeof f == "object" && s && f ? (d = Ke(s)) !== Ke(f) ? n[r + a] = t[a] : d === "Object" ? er(s, f, n, r + a + ".") : s !== f && (n[r + a] = t[a]) : s !== f && (n[r + a] = t[a])) : n[r + a] = void 0;
|
|
3163
3286
|
}), y(t).forEach(function(a) {
|
|
3164
3287
|
W(e, a) || (n[r + a] = t[a]);
|
|
3165
3288
|
}), n;
|
|
@@ -3171,31 +3294,31 @@ function Ai() {
|
|
|
3171
3294
|
return i(i({}, e), { table: function(t) {
|
|
3172
3295
|
var n = e.table(t), r = n.schema.primaryKey;
|
|
3173
3296
|
return i(i({}, n), { mutate: function(a) {
|
|
3174
|
-
var
|
|
3297
|
+
var s = z.trans, f = s.table(t).hook, d = f.deleting, v = f.creating, w = f.updating;
|
|
3175
3298
|
switch (a.type) {
|
|
3176
3299
|
case "add":
|
|
3177
3300
|
if (v.fire === Q) break;
|
|
3178
|
-
return
|
|
3301
|
+
return s._promise("readwrite", function() {
|
|
3179
3302
|
return T(a);
|
|
3180
3303
|
}, !0);
|
|
3181
3304
|
case "put":
|
|
3182
3305
|
if (v.fire === Q && w.fire === Q) break;
|
|
3183
|
-
return
|
|
3306
|
+
return s._promise("readwrite", function() {
|
|
3184
3307
|
return T(a);
|
|
3185
3308
|
}, !0);
|
|
3186
3309
|
case "delete":
|
|
3187
3310
|
if (d.fire === Q) break;
|
|
3188
|
-
return
|
|
3311
|
+
return s._promise("readwrite", function() {
|
|
3189
3312
|
return T(a);
|
|
3190
3313
|
}, !0);
|
|
3191
3314
|
case "deleteRange":
|
|
3192
3315
|
if (d.fire === Q) break;
|
|
3193
|
-
return
|
|
3316
|
+
return s._promise("readwrite", function() {
|
|
3194
3317
|
return (function p(O, b, _) {
|
|
3195
3318
|
return n.query({ trans: O, values: !1, query: { index: r, range: b }, limit: _ }).then(function(A) {
|
|
3196
3319
|
var x = A.result;
|
|
3197
|
-
return T({ type: "delete", keys: x, trans: O }).then(function(
|
|
3198
|
-
return 0 <
|
|
3320
|
+
return T({ type: "delete", keys: x, trans: O }).then(function(D) {
|
|
3321
|
+
return 0 < D.numFailures ? Promise.reject(D.failures[0]) : x.length < _ ? { failures: [], numFailures: 0, lastResult: void 0 } : p(O, i(i({}, b), { lower: x[x.length - 1], lowerOpen: !0 }), _);
|
|
3199
3322
|
});
|
|
3200
3323
|
});
|
|
3201
3324
|
})(a.trans, a.range, 1e4);
|
|
@@ -3205,23 +3328,23 @@ function Ai() {
|
|
|
3205
3328
|
function T(p) {
|
|
3206
3329
|
var O, b, _, A = z.trans, x = p.keys || tr(r, p);
|
|
3207
3330
|
if (!x) throw new Error("Keys missing");
|
|
3208
|
-
return (p = p.type === "add" || p.type === "put" ? i(i({}, p), { keys: x }) : i({}, p)).type !== "delete" && (p.values = h([], p.values)), p.keys && (p.keys = h([], p.keys)), O = n, _ = x, ((b = p).type === "add" ? Promise.resolve([]) : O.getMany({ trans: b.trans, keys: _, cache: "immutable" })).then(function(
|
|
3209
|
-
var S = x.map(function(
|
|
3210
|
-
var M, L, K, q =
|
|
3211
|
-
return p.type === "delete" ? d.fire.call(V,
|
|
3331
|
+
return (p = p.type === "add" || p.type === "put" ? i(i({}, p), { keys: x }) : i({}, p)).type !== "delete" && (p.values = h([], p.values)), p.keys && (p.keys = h([], p.keys)), O = n, _ = x, ((b = p).type === "add" ? Promise.resolve([]) : O.getMany({ trans: b.trans, keys: _, cache: "immutable" })).then(function(D) {
|
|
3332
|
+
var S = x.map(function(P, k) {
|
|
3333
|
+
var M, L, K, q = D[k], V = { onerror: null, onsuccess: null };
|
|
3334
|
+
return p.type === "delete" ? d.fire.call(V, P, q, A) : p.type === "add" || q === void 0 ? (M = v.fire.call(V, P, p.values[k], A), P == null && M != null && (p.keys[k] = P = M, r.outbound || ne(p.values[k], r.keyPath, P))) : (M = er(q, p.values[k]), (L = w.fire.call(V, M, P, q, A)) && (K = p.values[k], Object.keys(L).forEach(function(U) {
|
|
3212
3335
|
W(K, U) ? K[U] = L[U] : ne(K, U, L[U]);
|
|
3213
3336
|
}))), V;
|
|
3214
3337
|
});
|
|
3215
|
-
return n.mutate(p).then(function(
|
|
3216
|
-
for (var
|
|
3338
|
+
return n.mutate(p).then(function(P) {
|
|
3339
|
+
for (var k = P.failures, M = P.results, L = P.numFailures, P = P.lastResult, K = 0; K < x.length; ++K) {
|
|
3217
3340
|
var q = (M || x)[K], V = S[K];
|
|
3218
|
-
q == null ? V.onerror && V.onerror(
|
|
3341
|
+
q == null ? V.onerror && V.onerror(k[K]) : V.onsuccess && V.onsuccess(p.type === "put" && D[K] ? p.values[K] : q);
|
|
3219
3342
|
}
|
|
3220
|
-
return { failures:
|
|
3221
|
-
}).catch(function(
|
|
3222
|
-
return S.forEach(function(
|
|
3223
|
-
return
|
|
3224
|
-
}), Promise.reject(
|
|
3343
|
+
return { failures: k, results: M, numFailures: L, lastResult: P };
|
|
3344
|
+
}).catch(function(P) {
|
|
3345
|
+
return S.forEach(function(k) {
|
|
3346
|
+
return k.onerror && k.onerror(P);
|
|
3347
|
+
}), Promise.reject(P);
|
|
3225
3348
|
});
|
|
3226
3349
|
});
|
|
3227
3350
|
}
|
|
@@ -3231,7 +3354,7 @@ function Ai() {
|
|
|
3231
3354
|
function qr(e, t, n) {
|
|
3232
3355
|
try {
|
|
3233
3356
|
if (!t || t.keys.length < e.length) return null;
|
|
3234
|
-
for (var r = [], a = 0,
|
|
3357
|
+
for (var r = [], a = 0, s = 0; a < t.keys.length && s < e.length; ++a) re(t.keys[a], e[s]) === 0 && (r.push(n ? ke(t.values[a]) : t.values[a]), ++s);
|
|
3235
3358
|
return r.length === e.length ? r : null;
|
|
3236
3359
|
} catch {
|
|
3237
3360
|
return null;
|
|
@@ -3243,8 +3366,8 @@ function Ai() {
|
|
|
3243
3366
|
return i(i({}, n), { getMany: function(r) {
|
|
3244
3367
|
if (!r.cache) return n.getMany(r);
|
|
3245
3368
|
var a = qr(r.keys, r.trans._cache, r.cache === "clone");
|
|
3246
|
-
return a ? G.resolve(a) : n.getMany(r).then(function(
|
|
3247
|
-
return r.trans._cache = { keys: r.keys, values: r.cache === "clone" ?
|
|
3369
|
+
return a ? G.resolve(a) : n.getMany(r).then(function(s) {
|
|
3370
|
+
return r.trans._cache = { keys: r.keys, values: r.cache === "clone" ? ke(s) : s }, s;
|
|
3248
3371
|
});
|
|
3249
3372
|
}, mutate: function(r) {
|
|
3250
3373
|
return r.type !== "add" && (r.trans._cache = null), n.mutate(r);
|
|
@@ -3267,20 +3390,20 @@ function Ai() {
|
|
|
3267
3390
|
}
|
|
3268
3391
|
var Va = { stack: "dbcore", level: 0, name: "Observability", create: function(e) {
|
|
3269
3392
|
var t = e.schema.name, n = new Oe(e.MIN_KEY, e.MAX_KEY);
|
|
3270
|
-
return i(i({}, e), { transaction: function(r, a,
|
|
3271
|
-
if (z.subscr && a !== "readonly") throw new
|
|
3272
|
-
return e.transaction(r, a,
|
|
3393
|
+
return i(i({}, e), { transaction: function(r, a, s) {
|
|
3394
|
+
if (z.subscr && a !== "readonly") throw new C.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(z.querier));
|
|
3395
|
+
return e.transaction(r, a, s);
|
|
3273
3396
|
}, table: function(r) {
|
|
3274
|
-
var a = e.table(r),
|
|
3397
|
+
var a = e.table(r), s = a.schema, f = s.primaryKey, p = s.indexes, d = f.extractKey, v = f.outbound, w = f.autoIncrement && p.filter(function(b) {
|
|
3275
3398
|
return b.compound && b.keyPath.includes(f.keyPath);
|
|
3276
3399
|
}), T = i(i({}, a), { mutate: function(b) {
|
|
3277
3400
|
function _(U) {
|
|
3278
|
-
return U = "idb://".concat(t, "/").concat(r, "/").concat(U),
|
|
3401
|
+
return U = "idb://".concat(t, "/").concat(r, "/").concat(U), P[U] || (P[U] = new Oe());
|
|
3279
3402
|
}
|
|
3280
|
-
var A, x,
|
|
3403
|
+
var A, x, D, S = b.trans, P = b.mutatedParts || (b.mutatedParts = {}), k = _(""), M = _(":dels"), L = b.type, V = b.type === "deleteRange" ? [b.range] : b.type === "delete" ? [b.keys] : b.values.length < 50 ? [tr(f, b).filter(function(U) {
|
|
3281
3404
|
return U;
|
|
3282
3405
|
}), b.values] : [], K = V[0], q = V[1], V = b.trans._cache;
|
|
3283
|
-
return N(K) ? (
|
|
3406
|
+
return N(K) ? (k.addKeys(K), (V = L === "delete" || K.length === q.length ? qr(K, V) : null) || M.addKeys(K), (V || q) && (A = _, x = V, D = q, s.indexes.forEach(function(U) {
|
|
3284
3407
|
var $ = A(U.name || "");
|
|
3285
3408
|
function te(Z) {
|
|
3286
3409
|
return Z != null ? U.extractKey(Z) : null;
|
|
@@ -3290,21 +3413,21 @@ function Ai() {
|
|
|
3290
3413
|
return $.addKey(ve);
|
|
3291
3414
|
}) : $.addKey(Z);
|
|
3292
3415
|
}
|
|
3293
|
-
(x ||
|
|
3294
|
-
var H = x && te(x[Ce]), Ce =
|
|
3416
|
+
(x || D).forEach(function(Z, Ce) {
|
|
3417
|
+
var H = x && te(x[Ce]), Ce = D && te(D[Ce]);
|
|
3295
3418
|
re(H, Ce) !== 0 && (H != null && oe(H), Ce != null && oe(Ce));
|
|
3296
3419
|
});
|
|
3297
|
-
}))) : K ? (q = { from: (q = K.lower) !== null && q !== void 0 ? q : e.MIN_KEY, to: (q = K.upper) !== null && q !== void 0 ? q : e.MAX_KEY }, M.add(q),
|
|
3420
|
+
}))) : K ? (q = { from: (q = K.lower) !== null && q !== void 0 ? q : e.MIN_KEY, to: (q = K.upper) !== null && q !== void 0 ? q : e.MAX_KEY }, M.add(q), k.add(q)) : (k.add(n), M.add(n), s.indexes.forEach(function(U) {
|
|
3298
3421
|
return _(U.name).add(n);
|
|
3299
3422
|
})), a.mutate(b).then(function(U) {
|
|
3300
|
-
return !K || b.type !== "add" && b.type !== "put" || (
|
|
3423
|
+
return !K || b.type !== "add" && b.type !== "put" || (k.addKeys(U.results), w && w.forEach(function($) {
|
|
3301
3424
|
for (var te = b.values.map(function(H) {
|
|
3302
3425
|
return $.extractKey(H);
|
|
3303
3426
|
}), oe = $.keyPath.findIndex(function(H) {
|
|
3304
3427
|
return H === f.keyPath;
|
|
3305
3428
|
}), Z = 0, ve = U.results.length; Z < ve; ++Z) te[Z][oe] = U.results[Z];
|
|
3306
3429
|
_($.name).addKeys(te);
|
|
3307
|
-
})), S.mutatedParts = yn(S.mutatedParts || {},
|
|
3430
|
+
})), S.mutatedParts = yn(S.mutatedParts || {}, P), U;
|
|
3308
3431
|
});
|
|
3309
3432
|
} }), p = function(_) {
|
|
3310
3433
|
var A = _.query, _ = A.index, A = A.range;
|
|
@@ -3316,36 +3439,36 @@ function Ai() {
|
|
|
3316
3439
|
}, count: p, query: p, openCursor: p };
|
|
3317
3440
|
return y(O).forEach(function(b) {
|
|
3318
3441
|
T[b] = function(_) {
|
|
3319
|
-
var A = z.subscr, x = !!A,
|
|
3442
|
+
var A = z.subscr, x = !!A, D = Lr(z, a) && Ur(b, _) ? _.obsSet = {} : A;
|
|
3320
3443
|
if (x) {
|
|
3321
3444
|
var S = function(q) {
|
|
3322
|
-
return q = "idb://".concat(t, "/").concat(r, "/").concat(q),
|
|
3323
|
-
},
|
|
3324
|
-
if ((b === "query" && x.isPrimaryKey && !_.values ?
|
|
3445
|
+
return q = "idb://".concat(t, "/").concat(r, "/").concat(q), D[q] || (D[q] = new Oe());
|
|
3446
|
+
}, P = S(""), k = S(":dels"), A = O[b](_), x = A[0], A = A[1];
|
|
3447
|
+
if ((b === "query" && x.isPrimaryKey && !_.values ? k : S(x.name || "")).add(A), !x.isPrimaryKey) {
|
|
3325
3448
|
if (b !== "count") {
|
|
3326
3449
|
var M = b === "query" && v && _.values && a.query(i(i({}, _), { values: !1 }));
|
|
3327
3450
|
return a[b].apply(this, arguments).then(function(q) {
|
|
3328
3451
|
if (b === "query") {
|
|
3329
3452
|
if (v && _.values) return M.then(function(te) {
|
|
3330
|
-
return te = te.result,
|
|
3453
|
+
return te = te.result, P.addKeys(te), q;
|
|
3331
3454
|
});
|
|
3332
3455
|
var V = _.values ? q.result.map(d) : q.result;
|
|
3333
|
-
(_.values ?
|
|
3456
|
+
(_.values ? P : k).addKeys(V);
|
|
3334
3457
|
} else if (b === "openCursor") {
|
|
3335
3458
|
var U = q, $ = _.values;
|
|
3336
3459
|
return U && Object.create(U, { key: { get: function() {
|
|
3337
|
-
return
|
|
3460
|
+
return k.addKey(U.primaryKey), U.key;
|
|
3338
3461
|
} }, primaryKey: { get: function() {
|
|
3339
3462
|
var te = U.primaryKey;
|
|
3340
|
-
return
|
|
3463
|
+
return k.addKey(te), te;
|
|
3341
3464
|
} }, value: { get: function() {
|
|
3342
|
-
return $ &&
|
|
3465
|
+
return $ && P.addKey(U.primaryKey), U.value;
|
|
3343
3466
|
} } });
|
|
3344
3467
|
}
|
|
3345
3468
|
return q;
|
|
3346
3469
|
});
|
|
3347
3470
|
}
|
|
3348
|
-
|
|
3471
|
+
k.add(n);
|
|
3349
3472
|
}
|
|
3350
3473
|
}
|
|
3351
3474
|
return a[b].apply(this, arguments);
|
|
@@ -3357,25 +3480,25 @@ function Ai() {
|
|
|
3357
3480
|
if (n.numFailures === 0) return t;
|
|
3358
3481
|
if (t.type === "deleteRange") return null;
|
|
3359
3482
|
var r = t.keys ? t.keys.length : "values" in t && t.values ? t.values.length : 1;
|
|
3360
|
-
return n.numFailures === r ? null : (t = i({}, t), N(t.keys) && (t.keys = t.keys.filter(function(a,
|
|
3361
|
-
return !(
|
|
3362
|
-
})), "values" in t && N(t.values) && (t.values = t.values.filter(function(a,
|
|
3363
|
-
return !(
|
|
3483
|
+
return n.numFailures === r ? null : (t = i({}, t), N(t.keys) && (t.keys = t.keys.filter(function(a, s) {
|
|
3484
|
+
return !(s in n.failures);
|
|
3485
|
+
})), "values" in t && N(t.values) && (t.values = t.values.filter(function(a, s) {
|
|
3486
|
+
return !(s in n.failures);
|
|
3364
3487
|
})), t);
|
|
3365
3488
|
}
|
|
3366
3489
|
function nr(e, t) {
|
|
3367
3490
|
return n = e, ((r = t).lower === void 0 || (r.lowerOpen ? 0 < re(n, r.lower) : 0 <= re(n, r.lower))) && (e = e, (t = t).upper === void 0 || (t.upperOpen ? re(e, t.upper) < 0 : re(e, t.upper) <= 0));
|
|
3368
3491
|
var n, r;
|
|
3369
3492
|
}
|
|
3370
|
-
function Gr(e, t, O, r, a,
|
|
3493
|
+
function Gr(e, t, O, r, a, s) {
|
|
3371
3494
|
if (!O || O.length === 0) return e;
|
|
3372
3495
|
var f = t.query.index, d = f.multiEntry, v = t.query.range, w = r.schema.primaryKey.extractKey, T = f.extractKey, p = (f.lowLevelIndex || f).extractKey, O = O.reduce(function(b, _) {
|
|
3373
3496
|
var A = b, x = [];
|
|
3374
|
-
if (_.type === "add" || _.type === "put") for (var
|
|
3375
|
-
var
|
|
3376
|
-
|
|
3497
|
+
if (_.type === "add" || _.type === "put") for (var D = new Oe(), S = _.values.length - 1; 0 <= S; --S) {
|
|
3498
|
+
var P, k = _.values[S], M = w(k);
|
|
3499
|
+
D.hasKey(M) || (P = T(k), (d && N(P) ? P.some(function(U) {
|
|
3377
3500
|
return nr(U, v);
|
|
3378
|
-
}) : nr(
|
|
3501
|
+
}) : nr(P, v)) && (D.addKey(M), x.push(k)));
|
|
3379
3502
|
}
|
|
3380
3503
|
switch (_.type) {
|
|
3381
3504
|
case "add":
|
|
@@ -3415,61 +3538,61 @@ function Ai() {
|
|
|
3415
3538
|
}, e);
|
|
3416
3539
|
return O === e ? e : (O.sort(function(b, _) {
|
|
3417
3540
|
return re(p(b), p(_)) || re(w(b), w(_));
|
|
3418
|
-
}), t.limit && t.limit < 1 / 0 && (O.length > t.limit ? O.length = t.limit : e.length === t.limit && O.length < t.limit && (a.dirty = !0)),
|
|
3541
|
+
}), t.limit && t.limit < 1 / 0 && (O.length > t.limit ? O.length = t.limit : e.length === t.limit && O.length < t.limit && (a.dirty = !0)), s ? Object.freeze(O) : O);
|
|
3419
3542
|
}
|
|
3420
3543
|
function $r(e, t) {
|
|
3421
3544
|
return re(e.lower, t.lower) === 0 && re(e.upper, t.upper) === 0 && !!e.lowerOpen == !!t.lowerOpen && !!e.upperOpen == !!t.upperOpen;
|
|
3422
3545
|
}
|
|
3423
3546
|
function Ga(e, t) {
|
|
3424
|
-
return (function(n, r, a,
|
|
3547
|
+
return (function(n, r, a, s) {
|
|
3425
3548
|
if (n === void 0) return r !== void 0 ? -1 : 0;
|
|
3426
3549
|
if (r === void 0) return 1;
|
|
3427
3550
|
if ((r = re(n, r)) === 0) {
|
|
3428
|
-
if (a &&
|
|
3551
|
+
if (a && s) return 0;
|
|
3429
3552
|
if (a) return 1;
|
|
3430
|
-
if (
|
|
3553
|
+
if (s) return -1;
|
|
3431
3554
|
}
|
|
3432
3555
|
return r;
|
|
3433
|
-
})(e.lower, t.lower, e.lowerOpen, t.lowerOpen) <= 0 && 0 <= (function(n, r, a,
|
|
3556
|
+
})(e.lower, t.lower, e.lowerOpen, t.lowerOpen) <= 0 && 0 <= (function(n, r, a, s) {
|
|
3434
3557
|
if (n === void 0) return r !== void 0 ? 1 : 0;
|
|
3435
3558
|
if (r === void 0) return -1;
|
|
3436
3559
|
if ((r = re(n, r)) === 0) {
|
|
3437
|
-
if (a &&
|
|
3560
|
+
if (a && s) return 0;
|
|
3438
3561
|
if (a) return -1;
|
|
3439
|
-
if (
|
|
3562
|
+
if (s) return 1;
|
|
3440
3563
|
}
|
|
3441
3564
|
return r;
|
|
3442
3565
|
})(e.upper, t.upper, e.upperOpen, t.upperOpen);
|
|
3443
3566
|
}
|
|
3444
3567
|
function $a(e, t, n, r) {
|
|
3445
3568
|
e.subscribers.add(n), r.addEventListener("abort", function() {
|
|
3446
|
-
var a,
|
|
3447
|
-
e.subscribers.delete(n), e.subscribers.size === 0 && (a = e,
|
|
3448
|
-
a.subscribers.size === 0 && Xe(
|
|
3569
|
+
var a, s;
|
|
3570
|
+
e.subscribers.delete(n), e.subscribers.size === 0 && (a = e, s = t, setTimeout(function() {
|
|
3571
|
+
a.subscribers.size === 0 && Xe(s, a);
|
|
3449
3572
|
}, 3e3));
|
|
3450
3573
|
});
|
|
3451
3574
|
}
|
|
3452
3575
|
var Xa = { stack: "dbcore", level: 0, name: "Cache", create: function(e) {
|
|
3453
3576
|
var t = e.schema.name;
|
|
3454
3577
|
return i(i({}, e), { transaction: function(n, r, a) {
|
|
3455
|
-
var
|
|
3456
|
-
return r === "readwrite" && (f = (
|
|
3578
|
+
var s, f, d = e.transaction(n, r, a);
|
|
3579
|
+
return r === "readwrite" && (f = (s = new AbortController()).signal, a = function(v) {
|
|
3457
3580
|
return function() {
|
|
3458
|
-
if (
|
|
3581
|
+
if (s.abort(), r === "readwrite") {
|
|
3459
3582
|
for (var w = /* @__PURE__ */ new Set(), T = 0, p = n; T < p.length; T++) {
|
|
3460
3583
|
var O = p[T], b = gt["idb://".concat(t, "/").concat(O)];
|
|
3461
3584
|
if (b) {
|
|
3462
3585
|
var _ = e.table(O), A = b.optimisticOps.filter(function($) {
|
|
3463
3586
|
return $.trans === d;
|
|
3464
3587
|
});
|
|
3465
|
-
if (d._explicit && v && d.mutatedParts) for (var x = 0,
|
|
3588
|
+
if (d._explicit && v && d.mutatedParts) for (var x = 0, D = Object.values(b.queries.query); x < D.length; x++) for (var S = 0, P = (L = D[x]).slice(); S < P.length; S++) zn((K = P[S]).obsSet, d.mutatedParts) && (Xe(L, K), K.subscribers.forEach(function($) {
|
|
3466
3589
|
return w.add($);
|
|
3467
3590
|
}));
|
|
3468
3591
|
else if (0 < A.length) {
|
|
3469
3592
|
b.optimisticOps = b.optimisticOps.filter(function($) {
|
|
3470
3593
|
return $.trans !== d;
|
|
3471
3594
|
});
|
|
3472
|
-
for (var
|
|
3595
|
+
for (var k = 0, M = Object.values(b.queries.query); k < M.length; k++) for (var L, K, q, V = 0, U = (L = M[k]).slice(); V < U.length; V++) (K = U[V]).res != null && d.mutatedParts && (v && !K.dirty ? (q = Object.isFrozen(K.res), q = Gr(K.res, K.req, A, _, K, q), K.dirty ? (Xe(L, K), K.subscribers.forEach(function($) {
|
|
3473
3596
|
return w.add($);
|
|
3474
3597
|
})) : q !== K.res && (K.res = q, K.promise = G.resolve({ result: q }))) : (K.dirty && Xe(L, K), K.subscribers.forEach(function($) {
|
|
3475
3598
|
return w.add($);
|
|
@@ -3485,58 +3608,58 @@ function Ai() {
|
|
|
3485
3608
|
}, d.addEventListener("abort", a(!1), { signal: f }), d.addEventListener("error", a(!1), { signal: f }), d.addEventListener("complete", a(!0), { signal: f })), d;
|
|
3486
3609
|
}, table: function(n) {
|
|
3487
3610
|
var r = e.table(n), a = r.schema.primaryKey;
|
|
3488
|
-
return i(i({}, r), { mutate: function(
|
|
3611
|
+
return i(i({}, r), { mutate: function(s) {
|
|
3489
3612
|
var f = z.trans;
|
|
3490
|
-
if (a.outbound || f.db._options.cache === "disabled" || f.explicit || f.idbtrans.mode !== "readwrite") return r.mutate(
|
|
3613
|
+
if (a.outbound || f.db._options.cache === "disabled" || f.explicit || f.idbtrans.mode !== "readwrite") return r.mutate(s);
|
|
3491
3614
|
var d = gt["idb://".concat(t, "/").concat(n)];
|
|
3492
|
-
return d ? (f = r.mutate(
|
|
3615
|
+
return d ? (f = r.mutate(s), s.type !== "add" && s.type !== "put" || !(50 <= s.values.length || tr(a, s).some(function(v) {
|
|
3493
3616
|
return v == null;
|
|
3494
|
-
})) ? (d.optimisticOps.push(
|
|
3495
|
-
0 < v.numFailures && (Xe(d.optimisticOps,
|
|
3617
|
+
})) ? (d.optimisticOps.push(s), s.mutatedParts && vn(s.mutatedParts), f.then(function(v) {
|
|
3618
|
+
0 < v.numFailures && (Xe(d.optimisticOps, s), (v = Vr(0, s, v)) && d.optimisticOps.push(v), s.mutatedParts && vn(s.mutatedParts));
|
|
3496
3619
|
}), f.catch(function() {
|
|
3497
|
-
Xe(d.optimisticOps,
|
|
3620
|
+
Xe(d.optimisticOps, s), s.mutatedParts && vn(s.mutatedParts);
|
|
3498
3621
|
})) : f.then(function(v) {
|
|
3499
|
-
var w = Vr(0, i(i({},
|
|
3622
|
+
var w = Vr(0, i(i({}, s), { values: s.values.map(function(T, p) {
|
|
3500
3623
|
var O;
|
|
3501
|
-
return v.failures[p] ? T : (T = (O = a.keyPath) !== null && O !== void 0 && O.includes(".") ?
|
|
3624
|
+
return v.failures[p] ? T : (T = (O = a.keyPath) !== null && O !== void 0 && O.includes(".") ? ke(T) : i({}, T), ne(T, a.keyPath, v.results[p]), T);
|
|
3502
3625
|
}) }), v);
|
|
3503
3626
|
d.optimisticOps.push(w), queueMicrotask(function() {
|
|
3504
|
-
return
|
|
3627
|
+
return s.mutatedParts && vn(s.mutatedParts);
|
|
3505
3628
|
});
|
|
3506
|
-
}), f) : r.mutate(
|
|
3507
|
-
}, query: function(
|
|
3508
|
-
if (!Lr(z, r) || !Ur("query",
|
|
3509
|
-
var f = ((w = z.trans) === null || w === void 0 ? void 0 : w.db._options.cache) === "immutable", p = z, d = p.requery, v = p.signal, w = (function(_, A, x,
|
|
3629
|
+
}), f) : r.mutate(s);
|
|
3630
|
+
}, query: function(s) {
|
|
3631
|
+
if (!Lr(z, r) || !Ur("query", s)) return r.query(s);
|
|
3632
|
+
var f = ((w = z.trans) === null || w === void 0 ? void 0 : w.db._options.cache) === "immutable", p = z, d = p.requery, v = p.signal, w = (function(_, A, x, D) {
|
|
3510
3633
|
var S = gt["idb://".concat(_, "/").concat(A)];
|
|
3511
3634
|
if (!S) return [];
|
|
3512
3635
|
if (!(A = S.queries[x])) return [null, !1, S, null];
|
|
3513
|
-
var
|
|
3514
|
-
if (!
|
|
3636
|
+
var P = A[(D.query ? D.query.index.name : null) || ""];
|
|
3637
|
+
if (!P) return [null, !1, S, null];
|
|
3515
3638
|
switch (x) {
|
|
3516
3639
|
case "query":
|
|
3517
|
-
var
|
|
3518
|
-
return M.req.limit ===
|
|
3640
|
+
var k = P.find(function(M) {
|
|
3641
|
+
return M.req.limit === D.limit && M.req.values === D.values && $r(M.req.query.range, D.query.range);
|
|
3519
3642
|
});
|
|
3520
|
-
return
|
|
3521
|
-
return ("limit" in M.req ? M.req.limit : 1 / 0) >=
|
|
3522
|
-
}), !1, S,
|
|
3643
|
+
return k ? [k, !0, S, P] : [P.find(function(M) {
|
|
3644
|
+
return ("limit" in M.req ? M.req.limit : 1 / 0) >= D.limit && (!D.values || M.req.values) && Ga(M.req.query.range, D.query.range);
|
|
3645
|
+
}), !1, S, P];
|
|
3523
3646
|
case "count":
|
|
3524
|
-
return
|
|
3525
|
-
return $r(M.req.query.range,
|
|
3526
|
-
}), [
|
|
3647
|
+
return k = P.find(function(M) {
|
|
3648
|
+
return $r(M.req.query.range, D.query.range);
|
|
3649
|
+
}), [k, !!k, S, P];
|
|
3527
3650
|
}
|
|
3528
|
-
})(t, n, "query",
|
|
3529
|
-
return T && p ? T.obsSet =
|
|
3651
|
+
})(t, n, "query", s), T = w[0], p = w[1], O = w[2], b = w[3];
|
|
3652
|
+
return T && p ? T.obsSet = s.obsSet : (p = r.query(s).then(function(_) {
|
|
3530
3653
|
var A = _.result;
|
|
3531
3654
|
if (T && (T.res = A), f) {
|
|
3532
|
-
for (var x = 0,
|
|
3655
|
+
for (var x = 0, D = A.length; x < D; ++x) Object.freeze(A[x]);
|
|
3533
3656
|
Object.freeze(A);
|
|
3534
|
-
} else _.result =
|
|
3657
|
+
} else _.result = ke(A);
|
|
3535
3658
|
return _;
|
|
3536
3659
|
}).catch(function(_) {
|
|
3537
3660
|
return b && T && Xe(b, T), Promise.reject(_);
|
|
3538
|
-
}), T = { obsSet:
|
|
3539
|
-
return { result: Gr(_.result,
|
|
3661
|
+
}), T = { obsSet: s.obsSet, promise: p, subscribers: /* @__PURE__ */ new Set(), type: "query", req: s, dirty: !1 }, b ? b.push(T) : (b = [T], (O = O || (gt["idb://".concat(t, "/").concat(n)] = { queries: { query: {}, count: {} }, objs: /* @__PURE__ */ new Map(), optimisticOps: [], unsignaledParts: {} })).queries.query[s.query.index.name || ""] = b)), $a(T, b, d, v), T.promise.then(function(_) {
|
|
3662
|
+
return { result: Gr(_.result, s, O?.optimisticOps, r, T, f) };
|
|
3540
3663
|
});
|
|
3541
3664
|
} });
|
|
3542
3665
|
} });
|
|
@@ -3547,8 +3670,8 @@ function Ai() {
|
|
|
3547
3670
|
} });
|
|
3548
3671
|
}
|
|
3549
3672
|
var Ye = (we.prototype.version = function(e) {
|
|
3550
|
-
if (isNaN(e) || e < 0.1) throw new
|
|
3551
|
-
if (e = Math.round(10 * e) / 10, this.idbdb || this._state.isBeingOpened) throw new
|
|
3673
|
+
if (isNaN(e) || e < 0.1) throw new C.Type("Given version is not a positive number");
|
|
3674
|
+
if (e = Math.round(10 * e) / 10, this.idbdb || this._state.isBeingOpened) throw new C.Schema("Cannot add version when database is open");
|
|
3552
3675
|
this.verno = Math.max(this.verno, e);
|
|
3553
3676
|
var t = this._versions, n = t.filter(function(r) {
|
|
3554
3677
|
return r._cfg.version === e;
|
|
@@ -3557,17 +3680,17 @@ function Ai() {
|
|
|
3557
3680
|
}, we.prototype._whenReady = function(e) {
|
|
3558
3681
|
var t = this;
|
|
3559
3682
|
return this.idbdb && (this._state.openComplete || z.letThrough || this._vip) ? e() : new G(function(n, r) {
|
|
3560
|
-
if (t._state.openComplete) return r(new
|
|
3683
|
+
if (t._state.openComplete) return r(new C.DatabaseClosed(t._state.dbOpenError));
|
|
3561
3684
|
if (!t._state.isBeingOpened) {
|
|
3562
|
-
if (!t._state.autoOpen) return void r(new
|
|
3685
|
+
if (!t._state.autoOpen) return void r(new C.DatabaseClosed());
|
|
3563
3686
|
t.open().catch(Q);
|
|
3564
3687
|
}
|
|
3565
3688
|
t._state.dbReadyPromise.then(n, r);
|
|
3566
3689
|
}).then(e);
|
|
3567
3690
|
}, we.prototype.use = function(e) {
|
|
3568
3691
|
var t = e.stack, n = e.create, r = e.level, a = e.name;
|
|
3569
|
-
return a && this.unuse({ stack: t, name: a }), e = this._middlewares[t] || (this._middlewares[t] = []), e.push({ stack: t, create: n, level: r ?? 10, name: a }), e.sort(function(
|
|
3570
|
-
return
|
|
3692
|
+
return a && this.unuse({ stack: t, name: a }), e = this._middlewares[t] || (this._middlewares[t] = []), e.push({ stack: t, create: n, level: r ?? 10, name: a }), e.sort(function(s, f) {
|
|
3693
|
+
return s.level - f.level;
|
|
3571
3694
|
}), this;
|
|
3572
3695
|
}, we.prototype.unuse = function(e) {
|
|
3573
3696
|
var t = e.stack, n = e.name, r = e.create;
|
|
@@ -3596,21 +3719,21 @@ function Ai() {
|
|
|
3596
3719
|
}));
|
|
3597
3720
|
}, we.prototype.close = function(n) {
|
|
3598
3721
|
var t = (n === void 0 ? { disableAutoOpen: !0 } : n).disableAutoOpen, n = this._state;
|
|
3599
|
-
t ? (n.isBeingOpened && n.cancelOpen(new
|
|
3722
|
+
t ? (n.isBeingOpened && n.cancelOpen(new C.DatabaseClosed()), this._close(), n.autoOpen = !1, n.dbOpenError = new C.DatabaseClosed()) : (this._close(), n.autoOpen = this._options.autoOpen || n.isBeingOpened, n.openComplete = !1, n.dbOpenError = null);
|
|
3600
3723
|
}, we.prototype.delete = function(e) {
|
|
3601
3724
|
var t = this;
|
|
3602
3725
|
e === void 0 && (e = { disableAutoOpen: !0 });
|
|
3603
3726
|
var n = 0 < arguments.length && typeof arguments[0] != "object", r = this._state;
|
|
3604
|
-
return new G(function(a,
|
|
3727
|
+
return new G(function(a, s) {
|
|
3605
3728
|
function f() {
|
|
3606
3729
|
t.close(e);
|
|
3607
3730
|
var d = t._deps.indexedDB.deleteDatabase(t.name);
|
|
3608
3731
|
d.onsuccess = ge(function() {
|
|
3609
3732
|
var v, w, T;
|
|
3610
3733
|
v = t._deps, w = t.name, T = v.indexedDB, v = v.IDBKeyRange, Xn(T) || w === an || $n(T, v).delete(w).catch(Q), a();
|
|
3611
|
-
}), d.onerror =
|
|
3734
|
+
}), d.onerror = Ve(s), d.onblocked = t._fireOnBlocked;
|
|
3612
3735
|
}
|
|
3613
|
-
if (n) throw new
|
|
3736
|
+
if (n) throw new C.InvalidArgument("Invalid closeOptions argument to db.delete()");
|
|
3614
3737
|
r.isBeingOpened ? r.dbReadyPromise.then(f) : f();
|
|
3615
3738
|
});
|
|
3616
3739
|
}, we.prototype.backendDB = function() {
|
|
@@ -3632,33 +3755,33 @@ function Ai() {
|
|
|
3632
3755
|
}, enumerable: !1, configurable: !0 }), we.prototype.transaction = function() {
|
|
3633
3756
|
var e = (function(t, n, r) {
|
|
3634
3757
|
var a = arguments.length;
|
|
3635
|
-
if (a < 2) throw new
|
|
3636
|
-
for (var
|
|
3637
|
-
return r =
|
|
3758
|
+
if (a < 2) throw new C.InvalidArgument("Too few arguments");
|
|
3759
|
+
for (var s = new Array(a - 1); --a; ) s[a - 1] = arguments[a];
|
|
3760
|
+
return r = s.pop(), [t, Dt(s), r];
|
|
3638
3761
|
}).apply(this, arguments);
|
|
3639
3762
|
return this._transaction.apply(this, e);
|
|
3640
3763
|
}, we.prototype._transaction = function(e, t, n) {
|
|
3641
3764
|
var r = this, a = z.trans;
|
|
3642
3765
|
a && a.db === this && e.indexOf("!") === -1 || (a = null);
|
|
3643
|
-
var
|
|
3766
|
+
var s, f, d = e.indexOf("?") !== -1;
|
|
3644
3767
|
e = e.replace("!", "").replace("?", "");
|
|
3645
3768
|
try {
|
|
3646
3769
|
if (f = t.map(function(w) {
|
|
3647
3770
|
if (w = w instanceof r.Table ? w.name : w, typeof w != "string") throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");
|
|
3648
3771
|
return w;
|
|
3649
|
-
}), e == "r" || e ===
|
|
3772
|
+
}), e == "r" || e === kn) s = kn;
|
|
3650
3773
|
else {
|
|
3651
|
-
if (e != "rw" && e != Fn) throw new
|
|
3652
|
-
|
|
3774
|
+
if (e != "rw" && e != Fn) throw new C.InvalidArgument("Invalid transaction mode: " + e);
|
|
3775
|
+
s = Fn;
|
|
3653
3776
|
}
|
|
3654
3777
|
if (a) {
|
|
3655
|
-
if (a.mode ===
|
|
3656
|
-
if (!d) throw new
|
|
3778
|
+
if (a.mode === kn && s === Fn) {
|
|
3779
|
+
if (!d) throw new C.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");
|
|
3657
3780
|
a = null;
|
|
3658
3781
|
}
|
|
3659
3782
|
a && f.forEach(function(w) {
|
|
3660
3783
|
if (a && a.storeNames.indexOf(w) === -1) {
|
|
3661
|
-
if (!d) throw new
|
|
3784
|
+
if (!d) throw new C.SubTransaction("Table " + w + " not included in parent transaction.");
|
|
3662
3785
|
a = null;
|
|
3663
3786
|
}
|
|
3664
3787
|
}), d && a && !a.active && (a = null);
|
|
@@ -3674,33 +3797,33 @@ function Ai() {
|
|
|
3674
3797
|
if (x.explicit = !0, A = { trans: x, transless: A }, b) x.idbtrans = b.idbtrans;
|
|
3675
3798
|
else try {
|
|
3676
3799
|
x.create(), x.idbtrans._explicit = !0, T._state.PR1398_maxLoop = 3;
|
|
3677
|
-
} catch (
|
|
3678
|
-
return
|
|
3800
|
+
} catch (P) {
|
|
3801
|
+
return P.name === l.InvalidState && T.isOpen() && 0 < --T._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), T.close({ disableAutoOpen: !1 }), T.open().then(function() {
|
|
3679
3802
|
return w(T, p, O, null, _);
|
|
3680
|
-
})) : be(
|
|
3803
|
+
})) : be(P);
|
|
3681
3804
|
}
|
|
3682
|
-
var
|
|
3805
|
+
var D, S = qe(_);
|
|
3683
3806
|
return S && Et(), A = G.follow(function() {
|
|
3684
|
-
var
|
|
3685
|
-
(
|
|
3686
|
-
}, A), (
|
|
3687
|
-
return x.active ?
|
|
3807
|
+
var P;
|
|
3808
|
+
(D = _.call(x, x)) && (S ? (P = at.bind(null, null), D.then(P, P)) : typeof D.next == "function" && typeof D.throw == "function" && (D = Jn(D)));
|
|
3809
|
+
}, A), (D && typeof D.then == "function" ? G.resolve(D).then(function(P) {
|
|
3810
|
+
return x.active ? P : be(new C.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
|
|
3688
3811
|
}) : A.then(function() {
|
|
3689
|
-
return
|
|
3690
|
-
})).then(function(
|
|
3812
|
+
return D;
|
|
3813
|
+
})).then(function(P) {
|
|
3691
3814
|
return b && x._resolve(), x._completion.then(function() {
|
|
3692
|
-
return
|
|
3815
|
+
return P;
|
|
3693
3816
|
});
|
|
3694
|
-
}).catch(function(
|
|
3695
|
-
return x._reject(
|
|
3817
|
+
}).catch(function(P) {
|
|
3818
|
+
return x._reject(P), be(P);
|
|
3696
3819
|
});
|
|
3697
3820
|
});
|
|
3698
|
-
}).bind(null, this,
|
|
3699
|
-
return a ? a._promise(
|
|
3821
|
+
}).bind(null, this, s, f, a, n);
|
|
3822
|
+
return a ? a._promise(s, v, "lock") : z.trans ? ht(z.transless, function() {
|
|
3700
3823
|
return r._whenReady(v);
|
|
3701
3824
|
}) : this._whenReady(v);
|
|
3702
3825
|
}, we.prototype.table = function(e) {
|
|
3703
|
-
if (!W(this._allTables, e)) throw new
|
|
3826
|
+
if (!W(this._allTables, e)) throw new C.InvalidTable("Table ".concat(e, " does not exist"));
|
|
3704
3827
|
return this._allTables[e];
|
|
3705
3828
|
}, we);
|
|
3706
3829
|
function we(e, t) {
|
|
@@ -3708,7 +3831,7 @@ function Ai() {
|
|
|
3708
3831
|
this._middlewares = {}, this.verno = 0;
|
|
3709
3832
|
var r = we.dependencies;
|
|
3710
3833
|
this._options = t = i({ addons: we.addons, autoOpen: !0, indexedDB: r.indexedDB, IDBKeyRange: r.IDBKeyRange, cache: "cloned" }, t), this._deps = { indexedDB: t.indexedDB, IDBKeyRange: t.IDBKeyRange }, r = t.addons, this._dbSchema = {}, this._versions = [], this._storeNames = [], this._allTables = {}, this.idbdb = null, this._novip = this;
|
|
3711
|
-
var a,
|
|
3834
|
+
var a, s, f, d, v, w = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: Q, dbReadyPromise: null, cancelOpen: Q, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: t.autoOpen };
|
|
3712
3835
|
w.dbReadyPromise = new G(function(p) {
|
|
3713
3836
|
w.dbReadyResolve = p;
|
|
3714
3837
|
}), w.openCanceller = new G(function(p, O) {
|
|
@@ -3728,7 +3851,7 @@ function Ai() {
|
|
|
3728
3851
|
}));
|
|
3729
3852
|
});
|
|
3730
3853
|
};
|
|
3731
|
-
}), this.Collection = (a = this, jt(Ca.prototype, function(
|
|
3854
|
+
}), this.Collection = (a = this, jt(Ca.prototype, function(D, x) {
|
|
3732
3855
|
this.db = a;
|
|
3733
3856
|
var b = _r, _ = null;
|
|
3734
3857
|
if (x) try {
|
|
@@ -3736,23 +3859,23 @@ function Ai() {
|
|
|
3736
3859
|
} catch (S) {
|
|
3737
3860
|
_ = S;
|
|
3738
3861
|
}
|
|
3739
|
-
var A =
|
|
3740
|
-
this._ctx = { table: x, index: A.index, isPrimKey: !A.index || x.schema.primKey.keyPath && A.index === x.schema.primKey.name, range: b, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: _, or: A.or, valueMapper:
|
|
3741
|
-
})), this.Table = (
|
|
3742
|
-
this.db =
|
|
3862
|
+
var A = D._ctx, x = A.table, D = x.hook.reading.fire;
|
|
3863
|
+
this._ctx = { table: x, index: A.index, isPrimKey: !A.index || x.schema.primKey.keyPath && A.index === x.schema.primKey.name, range: b, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: _, or: A.or, valueMapper: D !== he ? D : null };
|
|
3864
|
+
})), this.Table = (s = this, jt(Nr.prototype, function(p, O, b) {
|
|
3865
|
+
this.db = s, this._tx = b, this.name = p, this.schema = O, this.hook = s._allTables[p] ? s._allTables[p].hook : Mt(null, { creating: [tt, Q], reading: [Ae, he], updating: [Le, Q], deleting: [_e, Q] });
|
|
3743
3866
|
})), this.Transaction = (f = this, jt(Sa.prototype, function(p, O, b, _, A) {
|
|
3744
3867
|
var x = this;
|
|
3745
|
-
p !== "readonly" && O.forEach(function(
|
|
3746
|
-
|
|
3868
|
+
p !== "readonly" && O.forEach(function(D) {
|
|
3869
|
+
D = (D = b[D]) === null || D === void 0 ? void 0 : D.yProps, D && (O = O.concat(D.map(function(S) {
|
|
3747
3870
|
return S.updatesTable;
|
|
3748
3871
|
})));
|
|
3749
|
-
}), this.db = f, this.mode = p, this.storeNames = O, this.schema = b, this.chromeTransactionDurability = _, this.idbtrans = null, this.on = Mt(this, "complete", "error", "abort"), this.parent = A || null, this.active = !0, this._reculock = 0, this._blockedFuncs = [], this._resolve = null, this._reject = null, this._waitingFor = null, this._waitingQueue = null, this._spinCount = 0, this._completion = new G(function(
|
|
3750
|
-
x._resolve =
|
|
3872
|
+
}), this.db = f, this.mode = p, this.storeNames = O, this.schema = b, this.chromeTransactionDurability = _, this.idbtrans = null, this.on = Mt(this, "complete", "error", "abort"), this.parent = A || null, this.active = !0, this._reculock = 0, this._blockedFuncs = [], this._resolve = null, this._reject = null, this._waitingFor = null, this._waitingQueue = null, this._spinCount = 0, this._completion = new G(function(D, S) {
|
|
3873
|
+
x._resolve = D, x._reject = S;
|
|
3751
3874
|
}), this._completion.then(function() {
|
|
3752
3875
|
x.active = !1, x.on.complete.fire();
|
|
3753
|
-
}, function(
|
|
3876
|
+
}, function(D) {
|
|
3754
3877
|
var S = x.active;
|
|
3755
|
-
return x.active = !1, x.on.error.fire(
|
|
3878
|
+
return x.active = !1, x.on.error.fire(D), x.parent ? x.parent._reject(D) : S && x.idbtrans && x.idbtrans.abort(), be(D);
|
|
3756
3879
|
});
|
|
3757
3880
|
})), this.Version = (d = this, jt(ja.prototype, function(p) {
|
|
3758
3881
|
this.db = d, this._cfg = { version: p, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
|
|
@@ -3763,7 +3886,7 @@ function Ai() {
|
|
|
3763
3886
|
return 0 < re(_, A) ? _ : A;
|
|
3764
3887
|
}, this._min = function(_, A) {
|
|
3765
3888
|
return re(_, A) < 0 ? _ : A;
|
|
3766
|
-
}, this._IDBKeyRange = v._deps.IDBKeyRange, !this._IDBKeyRange) throw new
|
|
3889
|
+
}, this._IDBKeyRange = v._deps.IDBKeyRange, !this._IDBKeyRange) throw new C.MissingAPI();
|
|
3767
3890
|
})), this.on("versionchange", function(p) {
|
|
3768
3891
|
0 < p.newVersion ? console.warn("Another connection wants to upgrade database '".concat(n.name, "'. Closing db now to resume the upgrade.")) : console.warn("Another connection wants to delete database '".concat(n.name, "'. Closing db now to resume the delete request.")), n.close({ disableAutoOpen: !1 });
|
|
3769
3892
|
}), this.on("blocked", function(p) {
|
|
@@ -3808,36 +3931,36 @@ function Ai() {
|
|
|
3808
3931
|
}
|
|
3809
3932
|
function Xr(e) {
|
|
3810
3933
|
var t, n = !1, r = new Wa(function(a) {
|
|
3811
|
-
var
|
|
3934
|
+
var s = qe(e), f, d = !1, v = {}, w = {}, T = { get closed() {
|
|
3812
3935
|
return d;
|
|
3813
3936
|
}, unsubscribe: function() {
|
|
3814
3937
|
d || (d = !0, f && f.abort(), p && st.storagemutated.unsubscribe(b));
|
|
3815
3938
|
} };
|
|
3816
3939
|
a.start && a.start(T);
|
|
3817
3940
|
var p = !1, O = function() {
|
|
3818
|
-
return
|
|
3941
|
+
return Pn(_);
|
|
3819
3942
|
}, b = function(A) {
|
|
3820
3943
|
yn(v, A), zn(w, v) && O();
|
|
3821
3944
|
}, _ = function() {
|
|
3822
|
-
var A, x,
|
|
3823
|
-
!d && _n.indexedDB && (v = {}, A = {}, f && f.abort(), f = new AbortController(),
|
|
3824
|
-
var
|
|
3945
|
+
var A, x, D;
|
|
3946
|
+
!d && _n.indexedDB && (v = {}, A = {}, f && f.abort(), f = new AbortController(), D = (function(S) {
|
|
3947
|
+
var P = _t();
|
|
3825
3948
|
try {
|
|
3826
|
-
|
|
3827
|
-
var
|
|
3828
|
-
return
|
|
3949
|
+
s && Et();
|
|
3950
|
+
var k = rt(e, S);
|
|
3951
|
+
return k = s ? k.finally(at) : k;
|
|
3829
3952
|
} finally {
|
|
3830
|
-
|
|
3953
|
+
P && Tt();
|
|
3831
3954
|
}
|
|
3832
|
-
})(x = { subscr: A, signal: f.signal, requery: O, querier: e, trans: null }), Promise.resolve(
|
|
3833
|
-
n = !0, t = S, d || x.signal.aborted || (v = {}, (function(
|
|
3834
|
-
for (var
|
|
3955
|
+
})(x = { subscr: A, signal: f.signal, requery: O, querier: e, trans: null }), Promise.resolve(D).then(function(S) {
|
|
3956
|
+
n = !0, t = S, d || x.signal.aborted || (v = {}, (function(P) {
|
|
3957
|
+
for (var k in P) if (W(P, k)) return;
|
|
3835
3958
|
return 1;
|
|
3836
|
-
})(w = A) || p || (st(Lt, b), p = !0),
|
|
3959
|
+
})(w = A) || p || (st(Lt, b), p = !0), Pn(function() {
|
|
3837
3960
|
return !d && a.next && a.next(S);
|
|
3838
3961
|
}));
|
|
3839
3962
|
}, function(S) {
|
|
3840
|
-
n = !1, ["DatabaseClosedError", "AbortError"].includes(S?.name) || d ||
|
|
3963
|
+
n = !1, ["DatabaseClosedError", "AbortError"].includes(S?.name) || d || Pn(function() {
|
|
3841
3964
|
d || a.error && a.error(S);
|
|
3842
3965
|
});
|
|
3843
3966
|
}));
|
|
@@ -3877,7 +4000,7 @@ function Ai() {
|
|
|
3877
4000
|
});
|
|
3878
4001
|
}) : $n(n, t).toCollection().primaryKeys()).then(e);
|
|
3879
4002
|
} catch {
|
|
3880
|
-
return be(new
|
|
4003
|
+
return be(new C.MissingAPI());
|
|
3881
4004
|
}
|
|
3882
4005
|
var t, n;
|
|
3883
4006
|
}, defineClass: function() {
|
|
@@ -3907,14 +4030,14 @@ function Ai() {
|
|
|
3907
4030
|
} }, waitFor: function(e, t) {
|
|
3908
4031
|
return t = G.resolve(typeof e == "function" ? yt.ignoreTransaction(e) : e).timeout(t || 6e4), z.trans ? z.trans.waitFor(t) : t;
|
|
3909
4032
|
}, Promise: G, debug: { get: function() {
|
|
3910
|
-
return
|
|
4033
|
+
return Pe;
|
|
3911
4034
|
}, set: function(e) {
|
|
3912
4035
|
Rt(e);
|
|
3913
4036
|
} }, derive: F, extend: R, props: J, override: ee, Events: Mt, on: st, liveQuery: Xr, extendObservabilitySet: yn, getByKeyPath: pe, setByKeyPath: ne, delByKeyPath: function(e, t) {
|
|
3914
4037
|
typeof t == "string" ? ne(e, t, void 0) : "length" in t && [].map.call(t, function(n) {
|
|
3915
4038
|
ne(e, n, void 0);
|
|
3916
4039
|
});
|
|
3917
|
-
}, shallowClone:
|
|
4040
|
+
}, shallowClone: Ie, deepClone: ke, getObjectDiff: er, cmp: re, asap: ae, minKey: -1 / 0, addons: [], connections: xt, errnames: l, dependencies: _n, cache: gt, semVer: "4.2.0", version: "4.2.0".split(".").map(function(e) {
|
|
3918
4041
|
return parseInt(e);
|
|
3919
4042
|
}).reduce(function(e, t, n) {
|
|
3920
4043
|
return e + t / Math.pow(10, 2 * n);
|
|
@@ -3933,16 +4056,16 @@ function Ai() {
|
|
|
3933
4056
|
ut || Ct.postMessage(e);
|
|
3934
4057
|
})), typeof addEventListener < "u" && (addEventListener("pagehide", function(e) {
|
|
3935
4058
|
if (!Ye.disableBfCache && e.persisted) {
|
|
3936
|
-
|
|
4059
|
+
Pe && console.debug("Dexie: handling persisted pagehide"), Ct?.close();
|
|
3937
4060
|
for (var t = 0, n = xt; t < n.length; t++) n[t].close({ disableAutoOpen: !1 });
|
|
3938
4061
|
}
|
|
3939
4062
|
}), addEventListener("pageshow", function(e) {
|
|
3940
|
-
!Ye.disableBfCache && e.persisted && (
|
|
4063
|
+
!Ye.disableBfCache && e.persisted && (Pe && console.debug("Dexie: handling persisted pageshow"), Wr(), ar({ all: new Oe(-1 / 0, [[]]) }));
|
|
3941
4064
|
})), G.rejectionMapper = function(e, t) {
|
|
3942
4065
|
return !e || e instanceof Ze || e instanceof TypeError || e instanceof SyntaxError || !e.name || !E[e.name] ? e : (t = new E[e.name](t || e.message, e), "stack" in e && B(t, "stack", { get: function() {
|
|
3943
4066
|
return this.inner.stack;
|
|
3944
4067
|
} }), t);
|
|
3945
|
-
}, Rt(
|
|
4068
|
+
}, Rt(Pe), i(Ye, Object.freeze({ __proto__: null, Dexie: Ye, liveQuery: Xr, Entity: Tr, cmp: re, PropModification: Kt, replacePrefix: function(e, t) {
|
|
3946
4069
|
return new Kt({ replacePrefix: [e, t] });
|
|
3947
4070
|
}, add: function(e) {
|
|
3948
4071
|
return new Kt({ add: e });
|
|
@@ -4126,7 +4249,7 @@ class Ci {
|
|
|
4126
4249
|
this.databaseInstance.isOpen() && (this.databaseInstance.close(), await new Promise((u) => setTimeout(u, 20))), await Qe.delete(this.databaseInstance.name);
|
|
4127
4250
|
}
|
|
4128
4251
|
}
|
|
4129
|
-
function
|
|
4252
|
+
function Di(g) {
|
|
4130
4253
|
const { databaseName: u, dialecteConfig: c } = g, { xmlElements: i, additionalTables: h } = c.database.tables, m = new Qe(u), y = {
|
|
4131
4254
|
[i.name]: i.schema
|
|
4132
4255
|
};
|
|
@@ -4139,7 +4262,7 @@ async function ga(g) {
|
|
|
4139
4262
|
const { databaseInstance: u, elementsTableName: c, records: i } = g, h = u.table(c);
|
|
4140
4263
|
await u.transaction("rw", h, () => h.bulkAdd(i));
|
|
4141
4264
|
}
|
|
4142
|
-
async function
|
|
4265
|
+
async function Ii(g) {
|
|
4143
4266
|
const { databaseInstance: u, elementsTableName: c, updates: i } = g;
|
|
4144
4267
|
if (i.length === 0) return;
|
|
4145
4268
|
const h = u.table(c);
|
|
@@ -4168,7 +4291,7 @@ async function Di(g) {
|
|
|
4168
4291
|
}
|
|
4169
4292
|
});
|
|
4170
4293
|
}
|
|
4171
|
-
async function
|
|
4294
|
+
async function Do(g) {
|
|
4172
4295
|
const { databaseInstance: u, elementsTableName: c, updates: i } = g;
|
|
4173
4296
|
if (i.length === 0) return;
|
|
4174
4297
|
const h = u.table(c);
|
|
@@ -4191,7 +4314,7 @@ async function Si(g) {
|
|
|
4191
4314
|
const h = u.table(c);
|
|
4192
4315
|
await u.transaction("rw", h, () => h.bulkDelete(i));
|
|
4193
4316
|
}
|
|
4194
|
-
async function
|
|
4317
|
+
async function Io(g) {
|
|
4195
4318
|
if (await Qe.exists(g))
|
|
4196
4319
|
return await Qe.delete(g);
|
|
4197
4320
|
}
|
|
@@ -4199,7 +4322,7 @@ function Ri(g) {
|
|
|
4199
4322
|
return "prefix" in g && "uri" in g && !!g.prefix && !!g.uri;
|
|
4200
4323
|
}
|
|
4201
4324
|
const Yt = {};
|
|
4202
|
-
function
|
|
4325
|
+
function Pi(g) {
|
|
4203
4326
|
const { parentId: u, child: c } = g;
|
|
4204
4327
|
Yt[u] || (Yt[u] = []);
|
|
4205
4328
|
const i = {
|
|
@@ -4208,7 +4331,7 @@ function ki(g) {
|
|
|
4208
4331
|
};
|
|
4209
4332
|
Yt[u].push(i);
|
|
4210
4333
|
}
|
|
4211
|
-
function
|
|
4334
|
+
function ki(g) {
|
|
4212
4335
|
const { currentBatch: u } = g, c = [...u];
|
|
4213
4336
|
for (const [i, h] of c.entries()) {
|
|
4214
4337
|
const m = Yt[h.id] || [];
|
|
@@ -4231,8 +4354,8 @@ var Jr;
|
|
|
4231
4354
|
function Ki() {
|
|
4232
4355
|
return Jr || (Jr = 1, (function(g) {
|
|
4233
4356
|
(function(u) {
|
|
4234
|
-
u.parser = function(l,
|
|
4235
|
-
return new i(l,
|
|
4357
|
+
u.parser = function(l, o) {
|
|
4358
|
+
return new i(l, o);
|
|
4236
4359
|
}, u.SAXParser = i, u.SAXStream = X, u.createStream = j, u.MAX_BUFFER_LENGTH = 64 * 1024;
|
|
4237
4360
|
var c = [
|
|
4238
4361
|
"comment",
|
|
@@ -4268,30 +4391,30 @@ function Ki() {
|
|
|
4268
4391
|
"opennamespace",
|
|
4269
4392
|
"closenamespace"
|
|
4270
4393
|
];
|
|
4271
|
-
function i(l,
|
|
4394
|
+
function i(l, o) {
|
|
4272
4395
|
if (!(this instanceof i))
|
|
4273
|
-
return new i(l,
|
|
4274
|
-
var
|
|
4275
|
-
m(
|
|
4396
|
+
return new i(l, o);
|
|
4397
|
+
var C = this;
|
|
4398
|
+
m(C), C.q = C.c = "", C.bufferCheckPosition = u.MAX_BUFFER_LENGTH, C.opt = o || {}, C.opt.lowercase = C.opt.lowercase || C.opt.lowercasetags, C.looseCase = C.opt.lowercase ? "toLowerCase" : "toUpperCase", C.opt.maxEntityCount = C.opt.maxEntityCount || 512, C.opt.maxEntityDepth = C.opt.maxEntityDepth || 4, C.entityCount = C.entityDepth = 0, C.tags = [], C.closed = C.closedRoot = C.sawRoot = !1, C.tag = C.error = null, C.strict = !!l, C.noscript = !!(l || C.opt.noscript), C.state = I.BEGIN, C.strictEntities = C.opt.strictEntities, C.ENTITIES = C.strictEntities ? Object.create(u.XML_ENTITIES) : Object.create(u.ENTITIES), C.attribList = [], C.opt.xmlns && (C.ns = Object.create(F)), C.opt.unquotedAttributeValues === void 0 && (C.opt.unquotedAttributeValues = !l), C.trackPosition = C.opt.position !== !1, C.trackPosition && (C.position = C.line = C.column = 0), He(C, "onready");
|
|
4276
4399
|
}
|
|
4277
4400
|
Object.create || (Object.create = function(l) {
|
|
4278
|
-
function
|
|
4401
|
+
function o() {
|
|
4279
4402
|
}
|
|
4280
|
-
|
|
4281
|
-
var
|
|
4282
|
-
return
|
|
4403
|
+
o.prototype = l;
|
|
4404
|
+
var C = new o();
|
|
4405
|
+
return C;
|
|
4283
4406
|
}), Object.keys || (Object.keys = function(l) {
|
|
4284
|
-
var
|
|
4285
|
-
for (var
|
|
4286
|
-
return
|
|
4407
|
+
var o = [];
|
|
4408
|
+
for (var C in l) l.hasOwnProperty(C) && o.push(C);
|
|
4409
|
+
return o;
|
|
4287
4410
|
});
|
|
4288
4411
|
function h(l) {
|
|
4289
|
-
for (var
|
|
4412
|
+
for (var o = Math.max(u.MAX_BUFFER_LENGTH, 10), C = 0, E = 0, ie = c.length; E < ie; E++) {
|
|
4290
4413
|
var Q = l[c[E]].length;
|
|
4291
|
-
if (Q >
|
|
4414
|
+
if (Q > o)
|
|
4292
4415
|
switch (c[E]) {
|
|
4293
4416
|
case "textNode":
|
|
4294
|
-
|
|
4417
|
+
ke(l);
|
|
4295
4418
|
break;
|
|
4296
4419
|
case "cdata":
|
|
4297
4420
|
de(l, "oncdata", l.cdata), l.cdata = "";
|
|
@@ -4300,19 +4423,19 @@ function Ki() {
|
|
|
4300
4423
|
de(l, "onscript", l.script), l.script = "";
|
|
4301
4424
|
break;
|
|
4302
4425
|
default:
|
|
4303
|
-
|
|
4426
|
+
Ke(l, "Max buffer length exceeded: " + c[E]);
|
|
4304
4427
|
}
|
|
4305
|
-
|
|
4428
|
+
C = Math.max(C, Q);
|
|
4306
4429
|
}
|
|
4307
|
-
var he = u.MAX_BUFFER_LENGTH -
|
|
4430
|
+
var he = u.MAX_BUFFER_LENGTH - C;
|
|
4308
4431
|
l.bufferCheckPosition = he + l.position;
|
|
4309
4432
|
}
|
|
4310
4433
|
function m(l) {
|
|
4311
|
-
for (var
|
|
4312
|
-
l[c[
|
|
4434
|
+
for (var o = 0, C = c.length; o < C; o++)
|
|
4435
|
+
l[c[o]] = "";
|
|
4313
4436
|
}
|
|
4314
4437
|
function y(l) {
|
|
4315
|
-
|
|
4438
|
+
ke(l), l.cdata !== "" && (de(l, "oncdata", l.cdata), l.cdata = ""), l.script !== "" && (de(l, "onscript", l.script), l.script = "");
|
|
4316
4439
|
}
|
|
4317
4440
|
i.prototype = {
|
|
4318
4441
|
end: function() {
|
|
@@ -4341,27 +4464,27 @@ function Ki() {
|
|
|
4341
4464
|
var R = u.EVENTS.filter(function(l) {
|
|
4342
4465
|
return l !== "error" && l !== "end";
|
|
4343
4466
|
});
|
|
4344
|
-
function j(l,
|
|
4345
|
-
return new X(l,
|
|
4467
|
+
function j(l, o) {
|
|
4468
|
+
return new X(l, o);
|
|
4346
4469
|
}
|
|
4347
|
-
function X(l,
|
|
4470
|
+
function X(l, o) {
|
|
4348
4471
|
if (!(this instanceof X))
|
|
4349
|
-
return new X(l,
|
|
4350
|
-
N.apply(this), this._parser = new i(l,
|
|
4351
|
-
var
|
|
4472
|
+
return new X(l, o);
|
|
4473
|
+
N.apply(this), this._parser = new i(l, o), this.writable = !0, this.readable = !0;
|
|
4474
|
+
var C = this;
|
|
4352
4475
|
this._parser.onend = function() {
|
|
4353
|
-
|
|
4476
|
+
C.emit("end");
|
|
4354
4477
|
}, this._parser.onerror = function(E) {
|
|
4355
|
-
|
|
4478
|
+
C.emit("error", E), C._parser.error = null;
|
|
4356
4479
|
}, this._decoder = null, R.forEach(function(E) {
|
|
4357
|
-
Object.defineProperty(
|
|
4480
|
+
Object.defineProperty(C, "on" + E, {
|
|
4358
4481
|
get: function() {
|
|
4359
|
-
return
|
|
4482
|
+
return C._parser["on" + E];
|
|
4360
4483
|
},
|
|
4361
4484
|
set: function(ie) {
|
|
4362
4485
|
if (!ie)
|
|
4363
|
-
return
|
|
4364
|
-
|
|
4486
|
+
return C.removeAllListeners(E), C._parser["on" + E] = ie, ie;
|
|
4487
|
+
C.on(E, ie);
|
|
4365
4488
|
},
|
|
4366
4489
|
enumerable: !0,
|
|
4367
4490
|
configurable: !1
|
|
@@ -4376,16 +4499,16 @@ function Ki() {
|
|
|
4376
4499
|
return typeof Buffer == "function" && typeof Buffer.isBuffer == "function" && Buffer.isBuffer(l) && (this._decoder || (this._decoder = new TextDecoder("utf8")), l = this._decoder.decode(l, { stream: !0 })), this._parser.write(l.toString()), this.emit("data", l), !0;
|
|
4377
4500
|
}, X.prototype.end = function(l) {
|
|
4378
4501
|
if (l && l.length && this.write(l), this._decoder) {
|
|
4379
|
-
var
|
|
4380
|
-
|
|
4502
|
+
var o = this._decoder.decode();
|
|
4503
|
+
o && (this._parser.write(o), this.emit("data", o));
|
|
4381
4504
|
}
|
|
4382
4505
|
return this._parser.end(), !0;
|
|
4383
|
-
}, X.prototype.on = function(l,
|
|
4384
|
-
var
|
|
4385
|
-
return !
|
|
4506
|
+
}, X.prototype.on = function(l, o) {
|
|
4507
|
+
var C = this;
|
|
4508
|
+
return !C._parser["on" + l] && R.indexOf(l) !== -1 && (C._parser["on" + l] = function() {
|
|
4386
4509
|
var E = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments);
|
|
4387
|
-
E.splice(0, 0, l),
|
|
4388
|
-
}), N.prototype.on.call(
|
|
4510
|
+
E.splice(0, 0, l), C.emit.apply(C, E);
|
|
4511
|
+
}), N.prototype.on.call(C, l, o);
|
|
4389
4512
|
};
|
|
4390
4513
|
var W = "[CDATA[", J = "DOCTYPE", fe = "http://www.w3.org/XML/1998/namespace", B = "http://www.w3.org/2000/xmlns/", F = { xml: fe, xmlns: B }, se = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/, ce = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/, Te = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/, ee = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;
|
|
4391
4514
|
function Y(l) {
|
|
@@ -4398,85 +4521,85 @@ function Ki() {
|
|
|
4398
4521
|
function pe(l) {
|
|
4399
4522
|
return l === ">" || Y(l);
|
|
4400
4523
|
}
|
|
4401
|
-
function ne(l,
|
|
4402
|
-
return l.test(
|
|
4524
|
+
function ne(l, o) {
|
|
4525
|
+
return l.test(o);
|
|
4403
4526
|
}
|
|
4404
|
-
function
|
|
4405
|
-
return !ne(l,
|
|
4527
|
+
function Ie(l, o) {
|
|
4528
|
+
return !ne(l, o);
|
|
4406
4529
|
}
|
|
4407
|
-
var
|
|
4530
|
+
var I = 0;
|
|
4408
4531
|
u.STATE = {
|
|
4409
|
-
BEGIN:
|
|
4532
|
+
BEGIN: I++,
|
|
4410
4533
|
// leading byte order mark or whitespace
|
|
4411
|
-
BEGIN_WHITESPACE:
|
|
4534
|
+
BEGIN_WHITESPACE: I++,
|
|
4412
4535
|
// leading whitespace
|
|
4413
|
-
TEXT:
|
|
4536
|
+
TEXT: I++,
|
|
4414
4537
|
// general stuff
|
|
4415
|
-
TEXT_ENTITY:
|
|
4538
|
+
TEXT_ENTITY: I++,
|
|
4416
4539
|
// & and such.
|
|
4417
|
-
OPEN_WAKA:
|
|
4540
|
+
OPEN_WAKA: I++,
|
|
4418
4541
|
// <
|
|
4419
|
-
SGML_DECL:
|
|
4542
|
+
SGML_DECL: I++,
|
|
4420
4543
|
// <!BLARG
|
|
4421
|
-
SGML_DECL_QUOTED:
|
|
4544
|
+
SGML_DECL_QUOTED: I++,
|
|
4422
4545
|
// <!BLARG foo "bar
|
|
4423
|
-
DOCTYPE:
|
|
4546
|
+
DOCTYPE: I++,
|
|
4424
4547
|
// <!DOCTYPE
|
|
4425
|
-
DOCTYPE_QUOTED:
|
|
4548
|
+
DOCTYPE_QUOTED: I++,
|
|
4426
4549
|
// <!DOCTYPE "//blah
|
|
4427
|
-
DOCTYPE_DTD:
|
|
4550
|
+
DOCTYPE_DTD: I++,
|
|
4428
4551
|
// <!DOCTYPE "//blah" [ ...
|
|
4429
|
-
DOCTYPE_DTD_QUOTED:
|
|
4552
|
+
DOCTYPE_DTD_QUOTED: I++,
|
|
4430
4553
|
// <!DOCTYPE "//blah" [ "foo
|
|
4431
|
-
COMMENT_STARTING:
|
|
4554
|
+
COMMENT_STARTING: I++,
|
|
4432
4555
|
// <!-
|
|
4433
|
-
COMMENT:
|
|
4556
|
+
COMMENT: I++,
|
|
4434
4557
|
// <!--
|
|
4435
|
-
COMMENT_ENDING:
|
|
4558
|
+
COMMENT_ENDING: I++,
|
|
4436
4559
|
// <!-- blah -
|
|
4437
|
-
COMMENT_ENDED:
|
|
4560
|
+
COMMENT_ENDED: I++,
|
|
4438
4561
|
// <!-- blah --
|
|
4439
|
-
CDATA:
|
|
4562
|
+
CDATA: I++,
|
|
4440
4563
|
// <![CDATA[ something
|
|
4441
|
-
CDATA_ENDING:
|
|
4564
|
+
CDATA_ENDING: I++,
|
|
4442
4565
|
// ]
|
|
4443
|
-
CDATA_ENDING_2:
|
|
4566
|
+
CDATA_ENDING_2: I++,
|
|
4444
4567
|
// ]]
|
|
4445
|
-
PROC_INST:
|
|
4568
|
+
PROC_INST: I++,
|
|
4446
4569
|
// <?hi
|
|
4447
|
-
PROC_INST_BODY:
|
|
4570
|
+
PROC_INST_BODY: I++,
|
|
4448
4571
|
// <?hi there
|
|
4449
|
-
PROC_INST_ENDING:
|
|
4572
|
+
PROC_INST_ENDING: I++,
|
|
4450
4573
|
// <?hi "there" ?
|
|
4451
|
-
OPEN_TAG:
|
|
4574
|
+
OPEN_TAG: I++,
|
|
4452
4575
|
// <strong
|
|
4453
|
-
OPEN_TAG_SLASH:
|
|
4576
|
+
OPEN_TAG_SLASH: I++,
|
|
4454
4577
|
// <strong /
|
|
4455
|
-
ATTRIB:
|
|
4578
|
+
ATTRIB: I++,
|
|
4456
4579
|
// <a
|
|
4457
|
-
ATTRIB_NAME:
|
|
4580
|
+
ATTRIB_NAME: I++,
|
|
4458
4581
|
// <a foo
|
|
4459
|
-
ATTRIB_NAME_SAW_WHITE:
|
|
4582
|
+
ATTRIB_NAME_SAW_WHITE: I++,
|
|
4460
4583
|
// <a foo _
|
|
4461
|
-
ATTRIB_VALUE:
|
|
4584
|
+
ATTRIB_VALUE: I++,
|
|
4462
4585
|
// <a foo=
|
|
4463
|
-
ATTRIB_VALUE_QUOTED:
|
|
4586
|
+
ATTRIB_VALUE_QUOTED: I++,
|
|
4464
4587
|
// <a foo="bar
|
|
4465
|
-
ATTRIB_VALUE_CLOSED:
|
|
4588
|
+
ATTRIB_VALUE_CLOSED: I++,
|
|
4466
4589
|
// <a foo="bar"
|
|
4467
|
-
ATTRIB_VALUE_UNQUOTED:
|
|
4590
|
+
ATTRIB_VALUE_UNQUOTED: I++,
|
|
4468
4591
|
// <a foo=bar
|
|
4469
|
-
ATTRIB_VALUE_ENTITY_Q:
|
|
4592
|
+
ATTRIB_VALUE_ENTITY_Q: I++,
|
|
4470
4593
|
// <foo bar="""
|
|
4471
|
-
ATTRIB_VALUE_ENTITY_U:
|
|
4594
|
+
ATTRIB_VALUE_ENTITY_U: I++,
|
|
4472
4595
|
// <foo bar="
|
|
4473
|
-
CLOSE_TAG:
|
|
4596
|
+
CLOSE_TAG: I++,
|
|
4474
4597
|
// </a
|
|
4475
|
-
CLOSE_TAG_SAW_WHITE:
|
|
4598
|
+
CLOSE_TAG_SAW_WHITE: I++,
|
|
4476
4599
|
// </a >
|
|
4477
|
-
SCRIPT:
|
|
4600
|
+
SCRIPT: I++,
|
|
4478
4601
|
// <script> ...
|
|
4479
|
-
SCRIPT_ENDING:
|
|
4602
|
+
SCRIPT_ENDING: I++
|
|
4480
4603
|
// <script> ... <
|
|
4481
4604
|
}, u.XML_ENTITIES = {
|
|
4482
4605
|
amp: "&",
|
|
@@ -4739,46 +4862,46 @@ function Ki() {
|
|
|
4739
4862
|
hearts: 9829,
|
|
4740
4863
|
diams: 9830
|
|
4741
4864
|
}, Object.keys(u.ENTITIES).forEach(function(l) {
|
|
4742
|
-
var
|
|
4743
|
-
u.ENTITIES[l] =
|
|
4865
|
+
var o = u.ENTITIES[l], C = typeof o == "number" ? String.fromCharCode(o) : o;
|
|
4866
|
+
u.ENTITIES[l] = C;
|
|
4744
4867
|
});
|
|
4745
|
-
for (var
|
|
4746
|
-
u.STATE[u.STATE[
|
|
4747
|
-
|
|
4748
|
-
function He(l,
|
|
4749
|
-
l[
|
|
4868
|
+
for (var Dt in u.STATE)
|
|
4869
|
+
u.STATE[u.STATE[Dt]] = Dt;
|
|
4870
|
+
I = u.STATE;
|
|
4871
|
+
function He(l, o, C) {
|
|
4872
|
+
l[o] && l[o](C);
|
|
4750
4873
|
}
|
|
4751
|
-
function de(l,
|
|
4752
|
-
l.textNode &&
|
|
4874
|
+
function de(l, o, C) {
|
|
4875
|
+
l.textNode && ke(l), He(l, o, C);
|
|
4753
4876
|
}
|
|
4754
|
-
function
|
|
4877
|
+
function ke(l) {
|
|
4755
4878
|
l.textNode = zt(l.opt, l.textNode), l.textNode && He(l, "ontext", l.textNode), l.textNode = "";
|
|
4756
4879
|
}
|
|
4757
|
-
function zt(l,
|
|
4758
|
-
return l.trim && (
|
|
4880
|
+
function zt(l, o) {
|
|
4881
|
+
return l.trim && (o = o.trim()), l.normalize && (o = o.replace(/\s+/g, " ")), o;
|
|
4759
4882
|
}
|
|
4760
|
-
function
|
|
4761
|
-
return
|
|
4883
|
+
function Ke(l, o) {
|
|
4884
|
+
return ke(l), l.trackPosition && (o += `
|
|
4762
4885
|
Line: ` + l.line + `
|
|
4763
4886
|
Column: ` + l.column + `
|
|
4764
|
-
Char: ` + l.c),
|
|
4887
|
+
Char: ` + l.c), o = new Error(o), l.error = o, He(l, "onerror", o), l;
|
|
4765
4888
|
}
|
|
4766
4889
|
function bt(l) {
|
|
4767
|
-
return l.sawRoot && !l.closedRoot && le(l, "Unclosed root tag"), l.state !==
|
|
4890
|
+
return l.sawRoot && !l.closedRoot && le(l, "Unclosed root tag"), l.state !== I.BEGIN && l.state !== I.BEGIN_WHITESPACE && l.state !== I.TEXT && Ke(l, "Unexpected end"), ke(l), l.c = "", l.closed = !0, He(l, "onend"), i.call(l, l.strict, l.opt), l;
|
|
4768
4891
|
}
|
|
4769
|
-
function le(l,
|
|
4892
|
+
function le(l, o) {
|
|
4770
4893
|
if (typeof l != "object" || !(l instanceof i))
|
|
4771
4894
|
throw new Error("bad call to strictFail");
|
|
4772
|
-
l.strict &&
|
|
4895
|
+
l.strict && Ke(l, o);
|
|
4773
4896
|
}
|
|
4774
4897
|
function Xe(l) {
|
|
4775
4898
|
l.strict || (l.tagName = l.tagName[l.looseCase]());
|
|
4776
|
-
var
|
|
4777
|
-
l.opt.xmlns && (
|
|
4899
|
+
var o = l.tags[l.tags.length - 1] || l, C = l.tag = { name: l.tagName, attributes: {} };
|
|
4900
|
+
l.opt.xmlns && (C.ns = o.ns), l.attribList.length = 0, de(l, "onopentagstart", C);
|
|
4778
4901
|
}
|
|
4779
|
-
function
|
|
4780
|
-
var
|
|
4781
|
-
return
|
|
4902
|
+
function Ue(l, o) {
|
|
4903
|
+
var C = l.indexOf(":"), E = C < 0 ? ["", l] : l.split(":"), ie = E[0], Q = E[1];
|
|
4904
|
+
return o && l === "xmlns" && (ie = "xmlns", Q = ""), { prefix: ie, local: Q };
|
|
4782
4905
|
}
|
|
4783
4906
|
function Fe(l) {
|
|
4784
4907
|
if (l.strict || (l.attribName = l.attribName[l.looseCase]()), l.attribList.indexOf(l.attribName) !== -1 || l.tag.attributes.hasOwnProperty(l.attribName)) {
|
|
@@ -4786,8 +4909,8 @@ Char: ` + l.c), s = new Error(s), l.error = s, He(l, "onerror", s), l;
|
|
|
4786
4909
|
return;
|
|
4787
4910
|
}
|
|
4788
4911
|
if (l.opt.xmlns) {
|
|
4789
|
-
var
|
|
4790
|
-
if (
|
|
4912
|
+
var o = Ue(l.attribName, !0), C = o.prefix, E = o.local;
|
|
4913
|
+
if (C === "xmlns")
|
|
4791
4914
|
if (E === "xml" && l.attribValue !== fe)
|
|
4792
4915
|
le(
|
|
4793
4916
|
l,
|
|
@@ -4812,64 +4935,64 @@ Actual: ` + l.attribValue
|
|
|
4812
4935
|
});
|
|
4813
4936
|
l.attribName = l.attribValue = "";
|
|
4814
4937
|
}
|
|
4815
|
-
function
|
|
4938
|
+
function qe(l, o) {
|
|
4816
4939
|
if (l.opt.xmlns) {
|
|
4817
|
-
var
|
|
4818
|
-
|
|
4940
|
+
var C = l.tag, E = Ue(l.tagName);
|
|
4941
|
+
C.prefix = E.prefix, C.local = E.local, C.uri = C.ns[E.prefix] || "", C.prefix && !C.uri && (le(
|
|
4819
4942
|
l,
|
|
4820
4943
|
"Unbound namespace prefix: " + JSON.stringify(l.tagName)
|
|
4821
|
-
),
|
|
4944
|
+
), C.uri = E.prefix);
|
|
4822
4945
|
var ie = l.tags[l.tags.length - 1] || l;
|
|
4823
|
-
|
|
4946
|
+
C.ns && ie.ns !== C.ns && Object.keys(C.ns).forEach(function(Rt) {
|
|
4824
4947
|
de(l, "onopennamespace", {
|
|
4825
4948
|
prefix: Rt,
|
|
4826
|
-
uri:
|
|
4949
|
+
uri: C.ns[Rt]
|
|
4827
4950
|
});
|
|
4828
4951
|
});
|
|
4829
4952
|
for (var Q = 0, he = l.attribList.length; Q < he; Q++) {
|
|
4830
|
-
var Ae = l.attribList[Q], ye = Ae[0], tt = Ae[1], _e =
|
|
4953
|
+
var Ae = l.attribList[Q], ye = Ae[0], tt = Ae[1], _e = Ue(ye, !0), Le = _e.prefix, Nn = _e.local, wt = Le === "" ? "" : C.ns[Le] || "", Pe = {
|
|
4831
4954
|
name: ye,
|
|
4832
4955
|
value: tt,
|
|
4833
|
-
prefix:
|
|
4956
|
+
prefix: Le,
|
|
4834
4957
|
local: Nn,
|
|
4835
4958
|
uri: wt
|
|
4836
4959
|
};
|
|
4837
|
-
|
|
4960
|
+
Le && Le !== "xmlns" && !wt && (le(
|
|
4838
4961
|
l,
|
|
4839
|
-
"Unbound namespace prefix: " + JSON.stringify(
|
|
4840
|
-
),
|
|
4962
|
+
"Unbound namespace prefix: " + JSON.stringify(Le)
|
|
4963
|
+
), Pe.uri = Le), l.tag.attributes[ye] = Pe, de(l, "onattribute", Pe);
|
|
4841
4964
|
}
|
|
4842
4965
|
l.attribList.length = 0;
|
|
4843
4966
|
}
|
|
4844
|
-
l.tag.isSelfClosing = !!
|
|
4967
|
+
l.tag.isSelfClosing = !!o, l.sawRoot = !0, l.tags.push(l.tag), de(l, "onopentag", l.tag), o || (!l.noscript && l.tagName.toLowerCase() === "script" ? l.state = I.SCRIPT : l.state = I.TEXT, l.tag = null, l.tagName = ""), l.attribName = l.attribValue = "", l.attribList.length = 0;
|
|
4845
4968
|
}
|
|
4846
|
-
function
|
|
4969
|
+
function It(l) {
|
|
4847
4970
|
if (!l.tagName) {
|
|
4848
|
-
le(l, "Weird empty close tag."), l.textNode += "</>", l.state =
|
|
4971
|
+
le(l, "Weird empty close tag."), l.textNode += "</>", l.state = I.TEXT;
|
|
4849
4972
|
return;
|
|
4850
4973
|
}
|
|
4851
4974
|
if (l.script) {
|
|
4852
4975
|
if (l.tagName !== "script") {
|
|
4853
|
-
l.script += "</" + l.tagName + ">", l.tagName = "", l.state =
|
|
4976
|
+
l.script += "</" + l.tagName + ">", l.tagName = "", l.state = I.SCRIPT;
|
|
4854
4977
|
return;
|
|
4855
4978
|
}
|
|
4856
4979
|
de(l, "onscript", l.script), l.script = "";
|
|
4857
4980
|
}
|
|
4858
|
-
var
|
|
4859
|
-
l.strict || (
|
|
4860
|
-
for (var E =
|
|
4861
|
-
var ie = l.tags[
|
|
4981
|
+
var o = l.tags.length, C = l.tagName;
|
|
4982
|
+
l.strict || (C = C[l.looseCase]());
|
|
4983
|
+
for (var E = C; o--; ) {
|
|
4984
|
+
var ie = l.tags[o];
|
|
4862
4985
|
if (ie.name !== E)
|
|
4863
4986
|
le(l, "Unexpected close tag");
|
|
4864
4987
|
else
|
|
4865
4988
|
break;
|
|
4866
4989
|
}
|
|
4867
|
-
if (
|
|
4868
|
-
le(l, "Unmatched closing tag: " + l.tagName), l.textNode += "</" + l.tagName + ">", l.state =
|
|
4990
|
+
if (o < 0) {
|
|
4991
|
+
le(l, "Unmatched closing tag: " + l.tagName), l.textNode += "</" + l.tagName + ">", l.state = I.TEXT;
|
|
4869
4992
|
return;
|
|
4870
4993
|
}
|
|
4871
|
-
l.tagName =
|
|
4872
|
-
for (var Q = l.tags.length; Q-- >
|
|
4994
|
+
l.tagName = C;
|
|
4995
|
+
for (var Q = l.tags.length; Q-- > o; ) {
|
|
4873
4996
|
var he = l.tag = l.tags.pop();
|
|
4874
4997
|
l.tagName = l.tag.name, de(l, "onclosetag", l.tagName);
|
|
4875
4998
|
var Ae = {};
|
|
@@ -4877,230 +5000,236 @@ Actual: ` + l.attribValue
|
|
|
4877
5000
|
Ae[ye] = he.ns[ye];
|
|
4878
5001
|
var tt = l.tags[l.tags.length - 1] || l;
|
|
4879
5002
|
l.opt.xmlns && he.ns !== tt.ns && Object.keys(he.ns).forEach(function(_e) {
|
|
4880
|
-
var
|
|
4881
|
-
de(l, "onclosenamespace", { prefix: _e, uri:
|
|
5003
|
+
var Le = he.ns[_e];
|
|
5004
|
+
de(l, "onclosenamespace", { prefix: _e, uri: Le });
|
|
4882
5005
|
});
|
|
4883
5006
|
}
|
|
4884
|
-
|
|
5007
|
+
o === 0 && (l.closedRoot = !0), l.tagName = l.attribValue = l.attribName = "", l.attribList.length = 0, l.state = I.TEXT;
|
|
4885
5008
|
}
|
|
4886
5009
|
function Ze(l) {
|
|
4887
|
-
var
|
|
4888
|
-
return l.ENTITIES[
|
|
5010
|
+
var o = l.entity, C = o.toLowerCase(), E, ie = "";
|
|
5011
|
+
return l.ENTITIES[o] ? l.ENTITIES[o] : l.ENTITIES[C] ? l.ENTITIES[C] : (o = C, o.charAt(0) === "#" && (o.charAt(1) === "x" ? (o = o.slice(2), E = parseInt(o, 16), ie = E.toString(16)) : (o = o.slice(1), E = parseInt(o, 10), ie = E.toString(10))), o = o.replace(/^0+/, ""), isNaN(E) || ie.toLowerCase() !== o || E < 0 || E > 1114111 ? (le(l, "Invalid character entity"), "&" + l.entity + ";") : String.fromCodePoint(E));
|
|
4889
5012
|
}
|
|
4890
|
-
function St(l,
|
|
4891
|
-
|
|
5013
|
+
function St(l, o) {
|
|
5014
|
+
o === "<" ? (l.state = I.OPEN_WAKA, l.startTagPosition = l.position) : Y(o) || (le(l, "Non-whitespace before first tag."), l.textNode = o, l.state = I.TEXT);
|
|
4892
5015
|
}
|
|
4893
|
-
function Je(l,
|
|
4894
|
-
var
|
|
4895
|
-
return
|
|
5016
|
+
function Je(l, o) {
|
|
5017
|
+
var C = "";
|
|
5018
|
+
return o < l.length && (C = l.charAt(o)), C;
|
|
4896
5019
|
}
|
|
4897
5020
|
function et(l) {
|
|
4898
|
-
var
|
|
5021
|
+
var o = this;
|
|
4899
5022
|
if (this.error)
|
|
4900
5023
|
throw this.error;
|
|
4901
|
-
if (
|
|
4902
|
-
return
|
|
4903
|
-
|
|
5024
|
+
if (o.closed)
|
|
5025
|
+
return Ke(
|
|
5026
|
+
o,
|
|
4904
5027
|
"Cannot write after close. Assign an onready handler."
|
|
4905
5028
|
);
|
|
4906
5029
|
if (l === null)
|
|
4907
|
-
return bt(
|
|
5030
|
+
return bt(o);
|
|
4908
5031
|
typeof l == "object" && (l = l.toString());
|
|
4909
|
-
for (var
|
|
4910
|
-
switch (
|
|
4911
|
-
` ? (
|
|
4912
|
-
case
|
|
4913
|
-
if (
|
|
5032
|
+
for (var C = 0, E = ""; E = Je(l, C++), o.c = E, !!E; )
|
|
5033
|
+
switch (o.trackPosition && (o.position++, E === `
|
|
5034
|
+
` ? (o.line++, o.column = 0) : o.column++), o.state) {
|
|
5035
|
+
case I.BEGIN:
|
|
5036
|
+
if (o.state = I.BEGIN_WHITESPACE, E === "\uFEFF")
|
|
4914
5037
|
continue;
|
|
4915
|
-
St(
|
|
5038
|
+
St(o, E);
|
|
4916
5039
|
continue;
|
|
4917
|
-
case
|
|
4918
|
-
St(
|
|
5040
|
+
case I.BEGIN_WHITESPACE:
|
|
5041
|
+
St(o, E);
|
|
4919
5042
|
continue;
|
|
4920
|
-
case
|
|
4921
|
-
if (
|
|
4922
|
-
for (var Q =
|
|
4923
|
-
E = Je(l,
|
|
4924
|
-
` ? (
|
|
4925
|
-
|
|
5043
|
+
case I.TEXT:
|
|
5044
|
+
if (o.sawRoot && !o.closedRoot) {
|
|
5045
|
+
for (var Q = C - 1; E && E !== "<" && E !== "&"; )
|
|
5046
|
+
E = Je(l, C++), E && o.trackPosition && (o.position++, E === `
|
|
5047
|
+
` ? (o.line++, o.column = 0) : o.column++);
|
|
5048
|
+
o.textNode += l.substring(Q, C - 1);
|
|
4926
5049
|
}
|
|
4927
|
-
E === "<" && !(
|
|
5050
|
+
E === "<" && !(o.sawRoot && o.closedRoot && !o.strict) ? (o.state = I.OPEN_WAKA, o.startTagPosition = o.position) : (!Y(E) && (!o.sawRoot || o.closedRoot) && le(o, "Text data outside of root node."), E === "&" ? o.state = I.TEXT_ENTITY : o.textNode += E);
|
|
4928
5051
|
continue;
|
|
4929
|
-
case
|
|
4930
|
-
E === "<" ?
|
|
5052
|
+
case I.SCRIPT:
|
|
5053
|
+
E === "<" ? o.state = I.SCRIPT_ENDING : o.script += E;
|
|
4931
5054
|
continue;
|
|
4932
|
-
case
|
|
4933
|
-
E === "/" ?
|
|
5055
|
+
case I.SCRIPT_ENDING:
|
|
5056
|
+
E === "/" ? o.state = I.CLOSE_TAG : (o.script += "<" + E, o.state = I.SCRIPT);
|
|
4934
5057
|
continue;
|
|
4935
|
-
case
|
|
5058
|
+
case I.OPEN_WAKA:
|
|
4936
5059
|
if (E === "!")
|
|
4937
|
-
|
|
5060
|
+
o.state = I.SGML_DECL, o.sgmlDecl = "";
|
|
4938
5061
|
else if (!Y(E)) if (ne(se, E))
|
|
4939
|
-
|
|
5062
|
+
o.state = I.OPEN_TAG, o.tagName = E;
|
|
4940
5063
|
else if (E === "/")
|
|
4941
|
-
|
|
5064
|
+
o.state = I.CLOSE_TAG, o.tagName = "";
|
|
4942
5065
|
else if (E === "?")
|
|
4943
|
-
|
|
5066
|
+
o.state = I.PROC_INST, o.procInstName = o.procInstBody = "";
|
|
4944
5067
|
else {
|
|
4945
|
-
if (le(
|
|
4946
|
-
var ie =
|
|
5068
|
+
if (le(o, "Unencoded <"), o.startTagPosition + 1 < o.position) {
|
|
5069
|
+
var ie = o.position - o.startTagPosition;
|
|
4947
5070
|
E = new Array(ie).join(" ") + E;
|
|
4948
5071
|
}
|
|
4949
|
-
|
|
5072
|
+
o.textNode += "<" + E, o.state = I.TEXT;
|
|
4950
5073
|
}
|
|
4951
5074
|
continue;
|
|
4952
|
-
case
|
|
4953
|
-
if (
|
|
4954
|
-
|
|
5075
|
+
case I.SGML_DECL:
|
|
5076
|
+
if (o.sgmlDecl + E === "--") {
|
|
5077
|
+
o.state = I.COMMENT, o.comment = "", o.sgmlDecl = "";
|
|
4955
5078
|
continue;
|
|
4956
5079
|
}
|
|
4957
|
-
|
|
4958
|
-
|
|
5080
|
+
o.doctype && o.doctype !== !0 && o.sgmlDecl ? (o.state = I.DOCTYPE_DTD, o.doctype += "<!" + o.sgmlDecl + E, o.sgmlDecl = "") : (o.sgmlDecl + E).toUpperCase() === W ? (de(o, "onopencdata"), o.state = I.CDATA, o.sgmlDecl = "", o.cdata = "") : (o.sgmlDecl + E).toUpperCase() === J ? (o.state = I.DOCTYPE, (o.doctype || o.sawRoot) && le(
|
|
5081
|
+
o,
|
|
4959
5082
|
"Inappropriately located doctype declaration"
|
|
4960
|
-
),
|
|
5083
|
+
), o.doctype = "", o.sgmlDecl = "") : E === ">" ? (de(o, "onsgmldeclaration", o.sgmlDecl), o.sgmlDecl = "", o.state = I.TEXT) : (ae(E) && (o.state = I.SGML_DECL_QUOTED), o.sgmlDecl += E);
|
|
4961
5084
|
continue;
|
|
4962
|
-
case
|
|
4963
|
-
E ===
|
|
5085
|
+
case I.SGML_DECL_QUOTED:
|
|
5086
|
+
E === o.q && (o.state = I.SGML_DECL, o.q = ""), o.sgmlDecl += E;
|
|
4964
5087
|
continue;
|
|
4965
|
-
case
|
|
4966
|
-
E === ">" ? (
|
|
5088
|
+
case I.DOCTYPE:
|
|
5089
|
+
E === ">" ? (o.state = I.TEXT, de(o, "ondoctype", o.doctype), o.doctype = !0) : (o.doctype += E, E === "[" ? o.state = I.DOCTYPE_DTD : ae(E) && (o.state = I.DOCTYPE_QUOTED, o.q = E));
|
|
4967
5090
|
continue;
|
|
4968
|
-
case
|
|
4969
|
-
|
|
5091
|
+
case I.DOCTYPE_QUOTED:
|
|
5092
|
+
o.doctype += E, E === o.q && (o.q = "", o.state = I.DOCTYPE);
|
|
4970
5093
|
continue;
|
|
4971
|
-
case
|
|
4972
|
-
E === "]" ? (
|
|
5094
|
+
case I.DOCTYPE_DTD:
|
|
5095
|
+
E === "]" ? (o.doctype += E, o.state = I.DOCTYPE) : E === "<" ? (o.state = I.OPEN_WAKA, o.startTagPosition = o.position) : ae(E) ? (o.doctype += E, o.state = I.DOCTYPE_DTD_QUOTED, o.q = E) : o.doctype += E;
|
|
4973
5096
|
continue;
|
|
4974
|
-
case
|
|
4975
|
-
|
|
5097
|
+
case I.DOCTYPE_DTD_QUOTED:
|
|
5098
|
+
o.doctype += E, E === o.q && (o.state = I.DOCTYPE_DTD, o.q = "");
|
|
4976
5099
|
continue;
|
|
4977
|
-
case
|
|
4978
|
-
E === "-" ?
|
|
5100
|
+
case I.COMMENT:
|
|
5101
|
+
E === "-" ? o.state = I.COMMENT_ENDING : o.comment += E;
|
|
4979
5102
|
continue;
|
|
4980
|
-
case
|
|
4981
|
-
E === "-" ? (
|
|
5103
|
+
case I.COMMENT_ENDING:
|
|
5104
|
+
E === "-" ? (o.state = I.COMMENT_ENDED, o.comment = zt(o.opt, o.comment), o.comment && de(o, "oncomment", o.comment), o.comment = "") : (o.comment += "-" + E, o.state = I.COMMENT);
|
|
4982
5105
|
continue;
|
|
4983
|
-
case
|
|
4984
|
-
E !== ">" ? (le(
|
|
5106
|
+
case I.COMMENT_ENDED:
|
|
5107
|
+
E !== ">" ? (le(o, "Malformed comment"), o.comment += "--" + E, o.state = I.COMMENT) : o.doctype && o.doctype !== !0 ? o.state = I.DOCTYPE_DTD : o.state = I.TEXT;
|
|
4985
5108
|
continue;
|
|
4986
|
-
case
|
|
4987
|
-
for (var Q =
|
|
4988
|
-
E = Je(l,
|
|
4989
|
-
` ? (
|
|
4990
|
-
|
|
5109
|
+
case I.CDATA:
|
|
5110
|
+
for (var Q = C - 1; E && E !== "]"; )
|
|
5111
|
+
E = Je(l, C++), E && o.trackPosition && (o.position++, E === `
|
|
5112
|
+
` ? (o.line++, o.column = 0) : o.column++);
|
|
5113
|
+
o.cdata += l.substring(Q, C - 1), E === "]" && (o.state = I.CDATA_ENDING);
|
|
4991
5114
|
continue;
|
|
4992
|
-
case
|
|
4993
|
-
E === "]" ?
|
|
5115
|
+
case I.CDATA_ENDING:
|
|
5116
|
+
E === "]" ? o.state = I.CDATA_ENDING_2 : (o.cdata += "]" + E, o.state = I.CDATA);
|
|
4994
5117
|
continue;
|
|
4995
|
-
case
|
|
4996
|
-
E === ">" ? (
|
|
5118
|
+
case I.CDATA_ENDING_2:
|
|
5119
|
+
E === ">" ? (o.cdata && de(o, "oncdata", o.cdata), de(o, "onclosecdata"), o.cdata = "", o.state = I.TEXT) : E === "]" ? o.cdata += "]" : (o.cdata += "]]" + E, o.state = I.CDATA);
|
|
4997
5120
|
continue;
|
|
4998
|
-
case
|
|
4999
|
-
E === "?" ?
|
|
5121
|
+
case I.PROC_INST:
|
|
5122
|
+
E === "?" ? o.state = I.PROC_INST_ENDING : Y(E) ? o.state = I.PROC_INST_BODY : o.procInstName += E;
|
|
5000
5123
|
continue;
|
|
5001
|
-
case
|
|
5002
|
-
if (!
|
|
5124
|
+
case I.PROC_INST_BODY:
|
|
5125
|
+
if (!o.procInstBody && Y(E))
|
|
5003
5126
|
continue;
|
|
5004
|
-
E === "?" ?
|
|
5127
|
+
E === "?" ? o.state = I.PROC_INST_ENDING : o.procInstBody += E;
|
|
5005
5128
|
continue;
|
|
5006
|
-
case
|
|
5007
|
-
E === ">" ? (de(
|
|
5008
|
-
name:
|
|
5009
|
-
body:
|
|
5010
|
-
}),
|
|
5129
|
+
case I.PROC_INST_ENDING:
|
|
5130
|
+
E === ">" ? (de(o, "onprocessinginstruction", {
|
|
5131
|
+
name: o.procInstName,
|
|
5132
|
+
body: o.procInstBody
|
|
5133
|
+
}), o.procInstName = o.procInstBody = "", o.state = I.TEXT) : (o.procInstBody += "?" + E, o.state = I.PROC_INST_BODY);
|
|
5011
5134
|
continue;
|
|
5012
|
-
case
|
|
5013
|
-
ne(ce, E) ?
|
|
5135
|
+
case I.OPEN_TAG:
|
|
5136
|
+
ne(ce, E) ? o.tagName += E : (Xe(o), E === ">" ? qe(o) : E === "/" ? o.state = I.OPEN_TAG_SLASH : (Y(E) || le(o, "Invalid character in tag name"), o.state = I.ATTRIB));
|
|
5014
5137
|
continue;
|
|
5015
|
-
case
|
|
5016
|
-
E === ">" ? (
|
|
5017
|
-
|
|
5138
|
+
case I.OPEN_TAG_SLASH:
|
|
5139
|
+
E === ">" ? (qe(o, !0), It(o)) : (le(
|
|
5140
|
+
o,
|
|
5018
5141
|
"Forward-slash in opening tag not followed by >"
|
|
5019
|
-
),
|
|
5142
|
+
), o.state = I.ATTRIB);
|
|
5020
5143
|
continue;
|
|
5021
|
-
case
|
|
5144
|
+
case I.ATTRIB:
|
|
5022
5145
|
if (Y(E))
|
|
5023
5146
|
continue;
|
|
5024
|
-
E === ">" ?
|
|
5147
|
+
E === ">" ? qe(o) : E === "/" ? o.state = I.OPEN_TAG_SLASH : ne(se, E) ? (o.attribName = E, o.attribValue = "", o.state = I.ATTRIB_NAME) : le(o, "Invalid attribute name");
|
|
5025
5148
|
continue;
|
|
5026
|
-
case
|
|
5027
|
-
E === "=" ?
|
|
5149
|
+
case I.ATTRIB_NAME:
|
|
5150
|
+
E === "=" ? o.state = I.ATTRIB_VALUE : E === ">" ? (le(o, "Attribute without value"), o.attribValue = o.attribName, Fe(o), qe(o)) : Y(E) ? o.state = I.ATTRIB_NAME_SAW_WHITE : ne(ce, E) ? o.attribName += E : le(o, "Invalid attribute name");
|
|
5028
5151
|
continue;
|
|
5029
|
-
case
|
|
5152
|
+
case I.ATTRIB_NAME_SAW_WHITE:
|
|
5030
5153
|
if (E === "=")
|
|
5031
|
-
|
|
5154
|
+
o.state = I.ATTRIB_VALUE;
|
|
5032
5155
|
else {
|
|
5033
5156
|
if (Y(E))
|
|
5034
5157
|
continue;
|
|
5035
|
-
le(
|
|
5036
|
-
name:
|
|
5158
|
+
le(o, "Attribute without value"), o.tag.attributes[o.attribName] = "", o.attribValue = "", de(o, "onattribute", {
|
|
5159
|
+
name: o.attribName,
|
|
5037
5160
|
value: ""
|
|
5038
|
-
}),
|
|
5161
|
+
}), o.attribName = "", E === ">" ? qe(o) : ne(se, E) ? (o.attribName = E, o.state = I.ATTRIB_NAME) : (le(o, "Invalid attribute name"), o.state = I.ATTRIB);
|
|
5039
5162
|
}
|
|
5040
5163
|
continue;
|
|
5041
|
-
case
|
|
5164
|
+
case I.ATTRIB_VALUE:
|
|
5042
5165
|
if (Y(E))
|
|
5043
5166
|
continue;
|
|
5044
|
-
ae(E) ? (
|
|
5167
|
+
ae(E) ? (o.q = E, o.state = I.ATTRIB_VALUE_QUOTED) : (o.opt.unquotedAttributeValues || Ke(o, "Unquoted attribute value"), o.state = I.ATTRIB_VALUE_UNQUOTED, o.attribValue = E);
|
|
5045
5168
|
continue;
|
|
5046
|
-
case
|
|
5047
|
-
if (E !==
|
|
5048
|
-
E === "&" ?
|
|
5169
|
+
case I.ATTRIB_VALUE_QUOTED:
|
|
5170
|
+
if (E !== o.q) {
|
|
5171
|
+
E === "&" ? o.state = I.ATTRIB_VALUE_ENTITY_Q : o.attribValue += E;
|
|
5049
5172
|
continue;
|
|
5050
5173
|
}
|
|
5051
|
-
Fe(
|
|
5174
|
+
Fe(o), o.q = "", o.state = I.ATTRIB_VALUE_CLOSED;
|
|
5052
5175
|
continue;
|
|
5053
|
-
case
|
|
5054
|
-
Y(E) ?
|
|
5176
|
+
case I.ATTRIB_VALUE_CLOSED:
|
|
5177
|
+
Y(E) ? o.state = I.ATTRIB : E === ">" ? qe(o) : E === "/" ? o.state = I.OPEN_TAG_SLASH : ne(se, E) ? (le(o, "No whitespace between attributes"), o.attribName = E, o.attribValue = "", o.state = I.ATTRIB_NAME) : le(o, "Invalid attribute name");
|
|
5055
5178
|
continue;
|
|
5056
|
-
case
|
|
5179
|
+
case I.ATTRIB_VALUE_UNQUOTED:
|
|
5057
5180
|
if (!pe(E)) {
|
|
5058
|
-
E === "&" ?
|
|
5181
|
+
E === "&" ? o.state = I.ATTRIB_VALUE_ENTITY_U : o.attribValue += E;
|
|
5059
5182
|
continue;
|
|
5060
5183
|
}
|
|
5061
|
-
Fe(
|
|
5184
|
+
Fe(o), E === ">" ? qe(o) : o.state = I.ATTRIB;
|
|
5062
5185
|
continue;
|
|
5063
|
-
case
|
|
5064
|
-
if (
|
|
5065
|
-
E === ">" ?
|
|
5186
|
+
case I.CLOSE_TAG:
|
|
5187
|
+
if (o.tagName)
|
|
5188
|
+
E === ">" ? It(o) : ne(ce, E) ? o.tagName += E : o.script ? (o.script += "</" + o.tagName + E, o.tagName = "", o.state = I.SCRIPT) : (Y(E) || le(o, "Invalid tagname in closing tag"), o.state = I.CLOSE_TAG_SAW_WHITE);
|
|
5066
5189
|
else {
|
|
5067
5190
|
if (Y(E))
|
|
5068
5191
|
continue;
|
|
5069
|
-
|
|
5192
|
+
Ie(se, E) ? o.script ? (o.script += "</" + E, o.state = I.SCRIPT) : le(o, "Invalid tagname in closing tag.") : o.tagName = E;
|
|
5070
5193
|
}
|
|
5071
5194
|
continue;
|
|
5072
|
-
case
|
|
5195
|
+
case I.CLOSE_TAG_SAW_WHITE:
|
|
5073
5196
|
if (Y(E))
|
|
5074
5197
|
continue;
|
|
5075
|
-
E === ">" ?
|
|
5198
|
+
E === ">" ? It(o) : le(o, "Invalid characters in closing tag");
|
|
5076
5199
|
continue;
|
|
5077
|
-
case
|
|
5078
|
-
case
|
|
5079
|
-
case
|
|
5200
|
+
case I.TEXT_ENTITY:
|
|
5201
|
+
case I.ATTRIB_VALUE_ENTITY_Q:
|
|
5202
|
+
case I.ATTRIB_VALUE_ENTITY_U:
|
|
5080
5203
|
var he, Ae;
|
|
5081
|
-
switch (
|
|
5082
|
-
case
|
|
5083
|
-
he =
|
|
5204
|
+
switch (o.state) {
|
|
5205
|
+
case I.TEXT_ENTITY:
|
|
5206
|
+
he = I.TEXT, Ae = "textNode";
|
|
5084
5207
|
break;
|
|
5085
|
-
case
|
|
5086
|
-
he =
|
|
5208
|
+
case I.ATTRIB_VALUE_ENTITY_Q:
|
|
5209
|
+
he = I.ATTRIB_VALUE_QUOTED, Ae = "attribValue";
|
|
5087
5210
|
break;
|
|
5088
|
-
case
|
|
5089
|
-
he =
|
|
5211
|
+
case I.ATTRIB_VALUE_ENTITY_U:
|
|
5212
|
+
he = I.ATTRIB_VALUE_UNQUOTED, Ae = "attribValue";
|
|
5090
5213
|
break;
|
|
5091
5214
|
}
|
|
5092
5215
|
if (E === ";") {
|
|
5093
|
-
var ye = Ze(
|
|
5094
|
-
|
|
5095
|
-
|
|
5216
|
+
var ye = Ze(o);
|
|
5217
|
+
o.opt.unparsedEntities && !Object.values(u.XML_ENTITIES).includes(ye) ? ((o.entityCount += 1) > o.opt.maxEntityCount && Ke(
|
|
5218
|
+
o,
|
|
5219
|
+
"Parsed entity count exceeds max entity count"
|
|
5220
|
+
), (o.entityDepth += 1) > o.opt.maxEntityDepth && Ke(
|
|
5221
|
+
o,
|
|
5222
|
+
"Parsed entity depth exceeds max entity depth"
|
|
5223
|
+
), o.entity = "", o.state = he, o.write(ye), o.entityDepth -= 1) : (o[Ae] += ye, o.entity = "", o.state = he);
|
|
5224
|
+
} else ne(o.entity.length ? ee : Te, E) ? o.entity += E : (le(o, "Invalid character in entity name"), o[Ae] += "&" + o.entity + E, o.entity = "", o.state = he);
|
|
5096
5225
|
continue;
|
|
5097
5226
|
default:
|
|
5098
|
-
throw new Error(
|
|
5227
|
+
throw new Error(o, "Unknown state: " + o.state);
|
|
5099
5228
|
}
|
|
5100
|
-
return
|
|
5229
|
+
return o.position >= o.bufferCheckPosition && h(o), o;
|
|
5101
5230
|
}
|
|
5102
5231
|
String.fromCodePoint || (function() {
|
|
5103
|
-
var l = String.fromCharCode,
|
|
5232
|
+
var l = String.fromCharCode, o = Math.floor, C = function() {
|
|
5104
5233
|
var E = 16384, ie = [], Q, he, Ae = -1, ye = arguments.length;
|
|
5105
5234
|
if (!ye)
|
|
5106
5235
|
return "";
|
|
@@ -5109,17 +5238,17 @@ Actual: ` + l.attribValue
|
|
|
5109
5238
|
if (!isFinite(_e) || // `NaN`, `+Infinity`, or `-Infinity`
|
|
5110
5239
|
_e < 0 || // not a valid Unicode code point
|
|
5111
5240
|
_e > 1114111 || // not a valid Unicode code point
|
|
5112
|
-
|
|
5241
|
+
o(_e) !== _e)
|
|
5113
5242
|
throw RangeError("Invalid code point: " + _e);
|
|
5114
5243
|
_e <= 65535 ? ie.push(_e) : (_e -= 65536, Q = (_e >> 10) + 55296, he = _e % 1024 + 56320, ie.push(Q, he)), (Ae + 1 === ye || ie.length > E) && (tt += l.apply(null, ie), ie.length = 0);
|
|
5115
5244
|
}
|
|
5116
5245
|
return tt;
|
|
5117
5246
|
};
|
|
5118
5247
|
Object.defineProperty ? Object.defineProperty(String, "fromCodePoint", {
|
|
5119
|
-
value:
|
|
5248
|
+
value: C,
|
|
5120
5249
|
configurable: !0,
|
|
5121
5250
|
writable: !0
|
|
5122
|
-
}) : String.fromCodePoint =
|
|
5251
|
+
}) : String.fromCodePoint = C;
|
|
5123
5252
|
})();
|
|
5124
5253
|
})(g);
|
|
5125
5254
|
})(sr)), sr;
|
|
@@ -5214,7 +5343,7 @@ function Gi(g) {
|
|
|
5214
5343
|
]
|
|
5215
5344
|
} : N
|
|
5216
5345
|
);
|
|
5217
|
-
} else i.parent &&
|
|
5346
|
+
} else i.parent && Pi({
|
|
5218
5347
|
parentId: i.parent.id,
|
|
5219
5348
|
child: { id: i.id, tagName: i.tagName }
|
|
5220
5349
|
});
|
|
@@ -5236,7 +5365,7 @@ function Xi(g) {
|
|
|
5236
5365
|
}
|
|
5237
5366
|
function Wi(g) {
|
|
5238
5367
|
const { element: u, defaultNamespace: c, rootElementName: i } = g;
|
|
5239
|
-
return
|
|
5368
|
+
return $e(u.name === i, {
|
|
5240
5369
|
detail: `Expected root element <${i}>, got <${u.name}>`,
|
|
5241
5370
|
method: "import::getDefaultNamespace"
|
|
5242
5371
|
}), u.attributes?.xmlns?.value ? {
|
|
@@ -5313,7 +5442,7 @@ function eo(g) {
|
|
|
5313
5442
|
return g.name.replace(/\.[^.]+$/, "");
|
|
5314
5443
|
}
|
|
5315
5444
|
async function to(g) {
|
|
5316
|
-
const { file: u, dialecteConfig: c, options: i, useCustomRecordsIds: h } = g, m = eo(u), y = await
|
|
5445
|
+
const { file: u, dialecteConfig: c, options: i, useCustomRecordsIds: h } = g, m = eo(u), y = await Di({ databaseName: m, dialecteConfig: c });
|
|
5317
5446
|
try {
|
|
5318
5447
|
const N = c.database.tables.xmlElements.name;
|
|
5319
5448
|
if (await y.table(N).clear(), i.useBrowserApi && u.size !== 0 && await no({
|
|
@@ -5328,7 +5457,7 @@ async function to(g) {
|
|
|
5328
5457
|
}
|
|
5329
5458
|
}), c.io.hooks?.afterImport) {
|
|
5330
5459
|
const { creates: R, updates: j, deletes: X } = await c.io.hooks.afterImport();
|
|
5331
|
-
R?.length && await ga({ databaseInstance: y, elementsTableName: N, records: R }), j?.length && await
|
|
5460
|
+
R?.length && await ga({ databaseInstance: y, elementsTableName: N, records: R }), j?.length && await Ii({ databaseInstance: y, elementsTableName: N, updates: j }), X?.length && await Si({ databaseInstance: y, elementsTableName: N, ids: X });
|
|
5332
5461
|
}
|
|
5333
5462
|
return m;
|
|
5334
5463
|
} catch (N) {
|
|
@@ -5385,7 +5514,7 @@ async function fr(g) {
|
|
|
5385
5514
|
async function ta(g) {
|
|
5386
5515
|
const { databaseInstance: u, elementsTableName: c, sax: i, batchSize: h } = g;
|
|
5387
5516
|
if (i.getSize() >= h) {
|
|
5388
|
-
const y = i.drainBatch(), N =
|
|
5517
|
+
const y = i.drainBatch(), N = ki({
|
|
5389
5518
|
currentBatch: y
|
|
5390
5519
|
});
|
|
5391
5520
|
await ga({
|
|
@@ -5463,9 +5592,9 @@ function ro() {
|
|
|
5463
5592
|
children: []
|
|
5464
5593
|
}, pe = ee ? !1 : i.options.filter(ae) === !1;
|
|
5465
5594
|
for (; !(se() || ce(">") || ce("?>") || ce("/>")); ) {
|
|
5466
|
-
const
|
|
5467
|
-
if (
|
|
5468
|
-
ae.attributes[
|
|
5595
|
+
const Ie = fe();
|
|
5596
|
+
if (Ie)
|
|
5597
|
+
ae.attributes[Ie.name] = Ie.value;
|
|
5469
5598
|
else
|
|
5470
5599
|
return;
|
|
5471
5600
|
}
|
|
@@ -5479,11 +5608,11 @@ function ro() {
|
|
|
5479
5608
|
for (; ne; )
|
|
5480
5609
|
ne.excluded || ae.children.push(ne.node), ne = h();
|
|
5481
5610
|
if (i.options.strictMode) {
|
|
5482
|
-
const
|
|
5483
|
-
if (i.xml.startsWith(
|
|
5484
|
-
i.xml = i.xml.slice(
|
|
5611
|
+
const Ie = `</${ae.name}>`;
|
|
5612
|
+
if (i.xml.startsWith(Ie))
|
|
5613
|
+
i.xml = i.xml.slice(Ie.length);
|
|
5485
5614
|
else
|
|
5486
|
-
throw new c("Failed to parse XML", `Closing tag not matching "${
|
|
5615
|
+
throw new c("Failed to parse XML", `Closing tag not matching "${Ie}"`);
|
|
5487
5616
|
} else
|
|
5488
5617
|
F(/^<\/[\w-:.\u00C0-\u00FF]+\s*>/);
|
|
5489
5618
|
return {
|
|
@@ -5636,9 +5765,9 @@ function ao() {
|
|
|
5636
5765
|
let Te = B.attributes["xml:space"] === "preserve" || se, ee = !1;
|
|
5637
5766
|
if (!Te && F.options.ignoredPaths && (ee = j(F.path, F.options.ignoredPaths), Te = ee), !Te && F.options.collapseContent) {
|
|
5638
5767
|
let Y = !1, ae = !1, pe = !1;
|
|
5639
|
-
ce.forEach(function(ne,
|
|
5768
|
+
ce.forEach(function(ne, Ie) {
|
|
5640
5769
|
ne.type === "Text" ? (ne.content.includes(`
|
|
5641
|
-
`) ? (ae = !0, ne.content = ne.content.trim()) : (
|
|
5770
|
+
`) ? (ae = !0, ne.content = ne.content.trim()) : (Ie === 0 || Ie === ce.length - 1) && !se && ne.content.trim().length === 0 && (ne.content = ""), (ne.content.trim().length > 0 || ce.length === 1) && (Y = !0)) : ne.type === "CDATA" ? Y = !0 : pe = !0;
|
|
5642
5771
|
}), Y && (!pe || !ae) && (Te = !0);
|
|
5643
5772
|
}
|
|
5644
5773
|
ce.forEach(function(Y) {
|
|
@@ -5902,7 +6031,7 @@ function Ta(g) {
|
|
|
5902
6031
|
function po(g) {
|
|
5903
6032
|
return !!(g.name === "xmlns" || g.name.startsWith("xmlns:") || Ta(g) && g.namespace?.prefix === "xmlns");
|
|
5904
6033
|
}
|
|
5905
|
-
function
|
|
6034
|
+
function Po(g) {
|
|
5906
6035
|
const { config: u, storage: c } = g;
|
|
5907
6036
|
return c.type === "local" ? new Yr(new Ci(c.databaseName, u), u) : new Yr(c.store, u);
|
|
5908
6037
|
}
|
|
@@ -5916,16 +6045,16 @@ export {
|
|
|
5916
6045
|
ga as c,
|
|
5917
6046
|
Si as d,
|
|
5918
6047
|
Ro as e,
|
|
5919
|
-
|
|
6048
|
+
Do as f,
|
|
5920
6049
|
pa as g,
|
|
5921
|
-
|
|
6050
|
+
Ii as h,
|
|
5922
6051
|
So as i,
|
|
5923
|
-
|
|
6052
|
+
Io as j,
|
|
5924
6053
|
dr as k,
|
|
5925
6054
|
Qa as l,
|
|
5926
6055
|
so as m,
|
|
5927
6056
|
ai as n,
|
|
5928
|
-
|
|
6057
|
+
Po as o,
|
|
5929
6058
|
ii as p,
|
|
5930
6059
|
oi as q,
|
|
5931
6060
|
si as r,
|