@septkit/ui 0.0.53 → 0.0.55

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.
Files changed (19) hide show
  1. package/dist/dialecte/composables/index.js +2 -1
  2. package/dist/dialecte/composables/use-document-state.js +69 -0
  3. package/dist/dialecte/create-document-store.js +3 -3
  4. package/dist/dialecte/index.js +2 -1
  5. package/dist/external/.pnpm/{@dialecte_core@0.4.11 → @dialecte_core@0.4.12}/node_modules/@dialecte/core/dist/helpers.js +1 -1
  6. package/dist/external/.pnpm/{@dialecte_core@0.4.11 → @dialecte_core@0.4.12}/node_modules/@dialecte/core/dist/index.js +1 -1
  7. package/dist/external/.pnpm/{@dialecte_core@0.4.11/node_modules/@dialecte/core/dist/project-BjO7cVmO.js → @dialecte_core@0.4.12/node_modules/@dialecte/core/dist/project-DkMkDgld.js} +845 -763
  8. package/dist/external/.pnpm/{@dialecte_core@0.4.11 → @dialecte_core@0.4.12}/node_modules/@dialecte/core/dist/utils-C5_11hqg.js +1 -1
  9. package/dist/external/.pnpm/{@dialecte_scl@0.3.13/node_modules/@dialecte/scl/dist/hooks-D5DJSztS.js → @dialecte_scl@0.3.15/node_modules/@dialecte/scl/dist/hooks-CLIa7kxj.js} +3 -3
  10. package/dist/external/.pnpm/{@dialecte_scl@0.3.13 → @dialecte_scl@0.3.15}/node_modules/@dialecte/scl/dist/v2019C1/index.js +3 -3
  11. package/dist/index.d.ts +71 -0
  12. package/dist/index.js +26 -23
  13. package/dist/merge/merge-preflight.vue_vue_type_script_setup_true_lang.js +1 -1
  14. package/dist/merge/merge.service.js +2 -2
  15. package/dist/progress/document-progress-bar.js +5 -0
  16. package/dist/progress/document-progress-bar.vue_vue_type_script_setup_true_lang.js +25 -0
  17. package/dist/progress/index.js +2 -0
  18. package/dist/ui.css +1 -1
  19. package/package.json +3 -3
@@ -1,6 +1,6 @@
1
1
  import { a as e, d as t, f as n, n as r, o as i, p as a, r as o } from "./utils-C5_11hqg.js";
2
2
  import { assertNoFixedViolation as s, isRecordOf as c, standardizeRecord as l, toFullAttributeArray as u, toRawRecord as d, toRef as f, toTreeRecord as p } from "./helpers.js";
3
- //#region node_modules/.pnpm/@dialecte+core@0.4.11/node_modules/@dialecte/core/dist/project-BjO7cVmO.js
3
+ //#region node_modules/.pnpm/@dialecte+core@0.4.12/node_modules/@dialecte/core/dist/project-DkMkDgld.js
4
4
  var m = Object.create, h = Object.defineProperty, g = Object.getOwnPropertyDescriptor, _ = Object.getOwnPropertyNames, v = Object.getPrototypeOf, y = Object.prototype.hasOwnProperty, b = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), x = (e, t, n, r) => {
5
5
  if (t && typeof t == "object" || typeof t == "function") for (var i = _(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !y.call(e, s) && s !== n && h(e, s, {
6
6
  get: ((e) => t[e]).bind(null, s),
@@ -22,7 +22,54 @@ function ee(e, t) {
22
22
  }
23
23
  return n;
24
24
  }
25
- function w(e) {
25
+ function w(e, t = () => {}) {
26
+ let n = [], r = () => {
27
+ if (n.length === 0) {
28
+ e.progress = null;
29
+ return;
30
+ }
31
+ let t = n[0], r = n[n.length - 1];
32
+ e.progress = {
33
+ current: t.current,
34
+ total: t.total,
35
+ label: r.label || t.label,
36
+ step: n.length > 1 ? {
37
+ current: r.current,
38
+ total: r.total
39
+ } : null
40
+ };
41
+ };
42
+ return {
43
+ plan({ steps: e, label: i }) {
44
+ n.push({
45
+ current: 0,
46
+ total: e,
47
+ label: i ?? "",
48
+ open: !1
49
+ }), r(), t(!1);
50
+ },
51
+ nextStep(e) {
52
+ let i = n.at(-1);
53
+ i && (i.open && i.current++, i.open = !0, e !== void 0 && (i.label = e), r(), t(!1));
54
+ },
55
+ endPlan() {
56
+ if (n.length === 0) return;
57
+ n.pop();
58
+ let e = n.length === 0;
59
+ r(), t(e);
60
+ },
61
+ forceClear() {
62
+ n = [], e.progress = null, t(!0);
63
+ }
64
+ };
65
+ }
66
+ var te = Object.freeze({
67
+ plan() {},
68
+ nextStep() {},
69
+ endPlan() {},
70
+ forceClear() {}
71
+ });
72
+ function T(e) {
26
73
  let { stagedOperations: t, tagName: n, id: r } = e;
27
74
  for (let e = t.length - 1; e >= 0; e--) {
28
75
  let i = t[e];
@@ -78,7 +125,7 @@ function w(e) {
78
125
  }
79
126
  }
80
127
  }
81
- function te(e) {
128
+ function ne(e) {
82
129
  let { rawRecords: t, stagedOperations: n, tagName: r } = e, i = new Map(t.map((e) => [e.id, {
83
130
  ...e,
84
131
  status: "unchanged"
@@ -95,7 +142,7 @@ function te(e) {
95
142
  }
96
143
  return Array.from(i.values());
97
144
  }
98
- function T(e) {
145
+ function re(e) {
99
146
  let { rawRecords: t, stagedOperations: n, includeDeleted: r = !1 } = e, i = new Map(t.map((e) => [e.id, {
100
147
  ...e,
101
148
  status: "unchanged"
@@ -118,7 +165,7 @@ function T(e) {
118
165
  deleted: a
119
166
  };
120
167
  }
121
- function ne(e) {
168
+ function ie(e) {
122
169
  let t = /* @__PURE__ */ new Set();
123
170
  for (let n of e) n.status === "created" && t.add(n.newRecord.id);
124
171
  let n = /* @__PURE__ */ new Map();
@@ -139,7 +186,7 @@ function ne(e) {
139
186
  async function E(e) {
140
187
  let { context: t, ref: n } = e;
141
188
  if (t.stagedOperations.length > 0) {
142
- let e = w({
189
+ let e = T({
143
190
  stagedOperations: t.stagedOperations,
144
191
  tagName: n.tagName,
145
192
  id: n.id
@@ -149,11 +196,11 @@ async function E(e) {
149
196
  }
150
197
  let r;
151
198
  if (n.id === void 0) {
152
- let e = `__singleton_${n.tagName}`, i = mt(t) ? t.recordCache.get(e) : void 0;
153
- i ? r = i : (r = (await t.store.getByTagNameInDocument(n.tagName, t.documentId))[0], r && mt(t) && (t.recordCache.set(r.id, r), t.recordCache.set(e, r)));
199
+ let e = `__singleton_${n.tagName}`, i = _t(t) ? t.recordCache.get(e) : void 0;
200
+ i ? (t.perf.count("core::query::getRecord.cacheHit"), r = i) : (t.perf.count("core::query::getRecord.miss"), t.perf.count("core::store::getByTagName"), r = (await t.store.getByTagNameInDocument(n.tagName, t.documentId))[0], r && _t(t) && (t.recordCache.set(r.id, r), t.recordCache.set(e, r)));
154
201
  } else {
155
- let e = mt(t) ? t.recordCache.get(n.id) : void 0;
156
- e ? r = e : (r = await t.store.get(n.id, t.documentId), r && mt(t) && t.recordCache.set(n.id, r));
202
+ let e = _t(t) ? t.recordCache.get(n.id) : void 0;
203
+ e ? (t.perf.count("core::query::getRecord.cacheHit"), r = e) : (t.perf.count("core::query::getRecord.miss"), t.perf.count("core::store::get"), r = await t.store.get(n.id, t.documentId), r && _t(t) && t.recordCache.set(n.id, r));
157
204
  }
158
205
  if (r) return r.tagName !== n.tagName && a("ELEMENT_TAGNAME_MISMATCH", {
159
206
  detail: `Expected tagName '${n.tagName}', got '${r.tagName}' for id '${n.id}'`,
@@ -170,16 +217,18 @@ async function D(e) {
170
217
  ref: e
171
218
  })));
172
219
  }
173
- async function re(e) {
174
- let { context: t, tagName: n } = e, r = await t.store.getByTagNameInDocument(n, t.documentId);
175
- for (let e of r) mt(t) && t.recordCache.set(e.id, e);
176
- return te({
220
+ async function O(e) {
221
+ let { context: t, tagName: n } = e;
222
+ t.perf.count("core::store::getByTagName");
223
+ let r = await t.store.getByTagNameInDocument(n, t.documentId);
224
+ for (let e of r) _t(t) && t.recordCache.set(e.id, e);
225
+ return ne({
177
226
  rawRecords: r,
178
227
  stagedOperations: t.stagedOperations,
179
228
  tagName: n
180
229
  });
181
230
  }
182
- async function O(e) {
231
+ async function k(e) {
183
232
  let { context: t, ref: n, tagName: r } = e, i = await E({
184
233
  context: t,
185
234
  ref: n
@@ -206,7 +255,7 @@ async function O(e) {
206
255
  });
207
256
  }
208
257
  }
209
- async function k(e) {
258
+ async function A(e) {
210
259
  let { context: t, ref: n, tagName: r } = e, i = await E({
211
260
  context: t,
212
261
  ref: n
@@ -236,7 +285,7 @@ async function k(e) {
236
285
  refs: c
237
286
  })).filter((e) => e !== void 0) : [];
238
287
  }
239
- async function A(e) {
288
+ async function ae(e) {
240
289
  let { context: t, ref: n, options: r } = e, i = r?.depth ?? Infinity, a = r?.stopAtTagName, o = r?.order ?? "bottom-up", s = [], c = await E({
241
290
  context: t,
242
291
  ref: n
@@ -252,7 +301,7 @@ async function A(e) {
252
301
  return o === "top-down" ? s.reverse() : s;
253
302
  }
254
303
  async function j(e) {
255
- let { context: t, tagName: n, attributes: r } = e, i = await re({
304
+ let { context: t, tagName: n, attributes: r } = e, i = await O({
256
305
  context: t,
257
306
  tagName: n
258
307
  }), a = [];
@@ -275,28 +324,28 @@ function M(e) {
275
324
  }
276
325
  return !0;
277
326
  }
278
- async function N(e) {
279
- let { context: t, ref: n, options: r } = e, { collect: i, omit: a } = r, o = P(a), s = ae(i), c = /* @__PURE__ */ new Map();
327
+ async function oe(e) {
328
+ let { context: t, ref: n, options: r } = e, { collect: i, omit: a } = r, o = N(a), s = se(i), c = /* @__PURE__ */ new Map();
280
329
  for (let e of s.allTags) c.set(e, /* @__PURE__ */ new Map());
281
330
  let l = await E({
282
331
  context: t,
283
332
  ref: n
284
333
  });
285
- return l && (s.mode === "flat" ? await se({
334
+ return l && (s.mode === "flat" ? await ue({
286
335
  context: t,
287
336
  rootId: l.id,
288
337
  collectSpec: s,
289
338
  omitSpec: o,
290
339
  collected: c
291
- }) : await I({
340
+ }) : await fe({
292
341
  context: t,
293
342
  record: l,
294
343
  pathNodes: s.paths,
295
344
  omitSpec: o,
296
345
  collected: c
297
- })), L(c);
346
+ })), me(c);
298
347
  }
299
- function P(e) {
348
+ function N(e) {
300
349
  let t = /* @__PURE__ */ new Set(), n = [];
301
350
  if (!e) return {
302
351
  unconditional: t,
@@ -315,7 +364,7 @@ function P(e) {
315
364
  conditional: n
316
365
  };
317
366
  }
318
- function ie(e) {
367
+ function P(e) {
319
368
  let { record: t, omitSpec: n } = e;
320
369
  if (n.unconditional.has(t.tagName)) return !0;
321
370
  for (let e of n.conditional) if (e.tagName === t.tagName && M({
@@ -324,7 +373,7 @@ function ie(e) {
324
373
  })) return !0;
325
374
  return !1;
326
375
  }
327
- function ae(e) {
376
+ function se(e) {
328
377
  if (typeof e == "string") return {
329
378
  mode: "flat",
330
379
  targets: [{ tagName: e }],
@@ -346,16 +395,16 @@ function ae(e) {
346
395
  let t = /* @__PURE__ */ new Set();
347
396
  return {
348
397
  mode: "path",
349
- paths: F(e, t),
398
+ paths: ce(e, t),
350
399
  allTags: t
351
400
  };
352
401
  }
353
- function F(e, t) {
402
+ function ce(e, t) {
354
403
  let n = [];
355
404
  for (let [r, i] of Object.entries(e)) {
356
405
  if (r === "where") continue;
357
406
  t.add(r);
358
- let e = oe({
407
+ let e = le({
359
408
  tagName: r,
360
409
  value: i,
361
410
  allTags: t
@@ -364,7 +413,7 @@ function F(e, t) {
364
413
  }
365
414
  return n;
366
415
  }
367
- function oe(e) {
416
+ function le(e) {
368
417
  let { tagName: t, value: n, allTags: r } = e;
369
418
  if (n === !0) return {
370
419
  tagName: t,
@@ -385,25 +434,25 @@ function oe(e) {
385
434
  return {
386
435
  tagName: t,
387
436
  where: a,
388
- children: F(s, r),
437
+ children: ce(s, r),
389
438
  isLeaf: !1
390
439
  };
391
440
  }
392
- async function se(e) {
441
+ async function ue(e) {
393
442
  let { context: t, rootId: n, collectSpec: r, omitSpec: i, collected: a } = e;
394
443
  for (let e of r.targets) {
395
444
  if (i.unconditional.has(e.tagName)) continue;
396
- let r = await re({
445
+ let r = await O({
397
446
  context: t,
398
447
  tagName: e.tagName
399
448
  });
400
- for (let o of r) ce({
449
+ for (let o of r) F({
401
450
  record: o,
402
451
  where: e.where
403
- }) && (ie({
452
+ }) && (P({
404
453
  record: o,
405
454
  omitSpec: i
406
- }) || await le({
455
+ }) || await de({
407
456
  context: t,
408
457
  record: o,
409
458
  rootId: n,
@@ -411,14 +460,14 @@ async function se(e) {
411
460
  }) && a.get(e.tagName).set(o.id, o));
412
461
  }
413
462
  }
414
- function ce(e) {
463
+ function F(e) {
415
464
  let { record: t, where: n } = e;
416
465
  return n ? M({
417
466
  record: t,
418
467
  attributeFilter: n
419
468
  }) : !0;
420
469
  }
421
- async function le(e) {
470
+ async function de(e) {
422
471
  let { context: t, record: n, rootId: r, omitSpec: i } = e;
423
472
  if (n.id === r) return !0;
424
473
  let a = n;
@@ -429,7 +478,7 @@ async function le(e) {
429
478
  context: t,
430
479
  ref: f(a.parent)
431
480
  });
432
- if (!e || ie({
481
+ if (!e || P({
433
482
  record: e,
434
483
  omitSpec: i
435
484
  })) return !1;
@@ -437,12 +486,12 @@ async function le(e) {
437
486
  }
438
487
  return !1;
439
488
  }
440
- async function I(e) {
489
+ async function fe(e) {
441
490
  let { context: t, record: n, pathNodes: r, omitSpec: i, collected: a } = e;
442
491
  if (!n.children?.length) return;
443
492
  let o = new Set(r.map((e) => e.tagName));
444
493
  for (let e of r) {
445
- let r = await ue({
494
+ let r = await I({
446
495
  context: t,
447
496
  record: n,
448
497
  tagName: e.tagName,
@@ -450,7 +499,7 @@ async function I(e) {
450
499
  omitSpec: i,
451
500
  stopAtTagNames: o
452
501
  });
453
- for (let n of r) a.get(e.tagName).set(n.id, n), !e.isLeaf && e.children.length > 0 && await I({
502
+ for (let n of r) a.get(e.tagName).set(n.id, n), !e.isLeaf && e.children.length > 0 && await fe({
454
503
  context: t,
455
504
  record: n,
456
505
  pathNodes: e.children,
@@ -459,10 +508,10 @@ async function I(e) {
459
508
  });
460
509
  }
461
510
  }
462
- async function ue(e) {
511
+ async function I(e) {
463
512
  let { context: t, record: n, tagName: r, where: i, omitSpec: a, stopAtTagNames: o } = e, s = [];
464
513
  if (!n.children?.length) return s;
465
- let c = [], l = await de({
514
+ let c = [], l = await pe({
466
515
  context: t,
467
516
  record: n,
468
517
  omitSpec: a
@@ -470,14 +519,14 @@ async function ue(e) {
470
519
  for (c.push(...l); c.length > 0;) {
471
520
  let e = c.shift();
472
521
  if (e.tagName === r) {
473
- ce({
522
+ F({
474
523
  record: e,
475
524
  where: i
476
525
  }) && s.push(e);
477
526
  continue;
478
527
  }
479
528
  if (!(o.has(e.tagName) && e.tagName !== r) && e.children?.length) {
480
- let n = await de({
529
+ let n = await pe({
481
530
  context: t,
482
531
  record: e,
483
532
  omitSpec: a
@@ -487,28 +536,28 @@ async function ue(e) {
487
536
  }
488
537
  return s;
489
538
  }
490
- async function de(e) {
539
+ async function pe(e) {
491
540
  let { context: t, record: n, omitSpec: r } = e;
492
541
  if (!n.children?.length) return [];
493
542
  let i = n.children.filter((e) => !r.unconditional.has(e.tagName));
494
543
  return i.length ? (await Promise.all(i.map((e) => E({
495
544
  context: t,
496
545
  ref: f(e)
497
- })))).filter((e) => e !== void 0 && !ie({
546
+ })))).filter((e) => e !== void 0 && !P({
498
547
  record: e,
499
548
  omitSpec: r
500
549
  })) : [];
501
550
  }
502
- function L(e) {
551
+ function me(e) {
503
552
  let t = {};
504
553
  for (let [n, r] of e.entries()) t[n] = Array.from(r.values());
505
554
  return t;
506
555
  }
507
- async function fe(e) {
556
+ async function he(e) {
508
557
  let { context: t, ref: r, name: i, namespace: a, defaults: o = "optional" } = e, s = await E({
509
558
  context: t,
510
559
  ref: r
511
- }), c = s?.attributes ?? [], l = me(t.dialecteConfig, i, a), u = c.find((e) => e.name === l);
560
+ }), c = s?.attributes ?? [], l = _e(t.dialecteConfig, i, a), u = c.find((e) => e.name === l);
512
561
  return u ? u.value : (s ? n({
513
562
  dialecteConfig: t.dialecteConfig,
514
563
  tagName: s.tagName,
@@ -516,11 +565,11 @@ async function fe(e) {
516
565
  defaults: o
517
566
  }) : void 0) ?? "";
518
567
  }
519
- async function pe(e) {
568
+ async function ge(e) {
520
569
  let { context: t, ref: r, name: a, namespace: o, defaults: s = "optional" } = e, { dialecteConfig: c } = t, l = await E({
521
570
  context: t,
522
571
  ref: r
523
- }), u = l?.attributes ?? [], d = me(c, a, o), f = u.find((e) => e.name === d);
572
+ }), u = l?.attributes ?? [], d = _e(c, a, o), f = u.find((e) => e.name === d);
524
573
  if (f) return f;
525
574
  if (!l || s === "none") return;
526
575
  let p = n({
@@ -541,23 +590,23 @@ async function pe(e) {
541
590
  namespace: m
542
591
  };
543
592
  }
544
- function me(e, n, r) {
593
+ function _e(e, n, r) {
545
594
  if (r === void 0) return n;
546
595
  let i = t(e, r);
547
596
  return i ? `${i}:${n}` : n;
548
597
  }
549
- async function he(e) {
598
+ async function ve(e) {
550
599
  let { context: r, ref: i, namespace: a, defaults: o = "optional" } = e, { dialecteConfig: s } = r, c = await E({
551
600
  context: r,
552
601
  ref: i
553
602
  }), l = c?.attributes ?? [], u = a === void 0 ? "" : t(s, a), d = l.reduce((e, t) => {
554
- let { prefix: n, local: r, isXmlns: i } = _e(t.name);
603
+ let { prefix: n, local: r, isXmlns: i } = be(t.name);
555
604
  return i || n !== u || (e[r] = t.value ?? ""), e;
556
605
  }, {});
557
606
  if (c && o !== "none") {
558
607
  let e = s.definition[c.tagName]?.attributes.sequence ?? [];
559
608
  for (let t of e) {
560
- let { prefix: e, local: r, isXmlns: i } = _e(t);
609
+ let { prefix: e, local: r, isXmlns: i } = be(t);
561
610
  if (i || e !== u || r in d) continue;
562
611
  let a = n({
563
612
  dialecteConfig: s,
@@ -570,7 +619,7 @@ async function he(e) {
570
619
  }
571
620
  return d;
572
621
  }
573
- async function ge(e) {
622
+ async function ye(e) {
574
623
  let { context: t, ref: r, defaults: a = "optional" } = e, { dialecteConfig: o } = t, s = await E({
575
624
  context: t,
576
625
  ref: r
@@ -600,7 +649,7 @@ async function ge(e) {
600
649
  }
601
650
  return c;
602
651
  }
603
- function _e(e) {
652
+ function be(e) {
604
653
  if (e === "xmlns" || e.startsWith("xmlns:")) return {
605
654
  prefix: "",
606
655
  local: e,
@@ -617,7 +666,7 @@ function _e(e) {
617
666
  isXmlns: !1
618
667
  };
619
668
  }
620
- function ve(e) {
669
+ function L(e) {
621
670
  let { tree: t, unwrapTagNames: n } = e;
622
671
  function r(e) {
623
672
  return e.flatMap((e) => n.includes(e.tagName) ? r(e.tree) : [{
@@ -630,7 +679,7 @@ function ve(e) {
630
679
  tree: r(t.tree)
631
680
  };
632
681
  }
633
- function ye(e) {
682
+ function xe(e) {
634
683
  let t = /* @__PURE__ */ new Set(), n = [];
635
684
  if (!e) return {
636
685
  unconditional: t,
@@ -657,32 +706,32 @@ function ye(e) {
657
706
  conditional: n
658
707
  };
659
708
  }
660
- function R(e) {
709
+ function Se(e) {
661
710
  let { record: t, compiledOmit: n } = e;
662
711
  return n.unconditional.has(t.tagName) ? !0 : n.conditional.some((e) => e.scope === "self" && e.tagName === t.tagName && M({
663
712
  record: t,
664
713
  attributeFilter: e.where
665
714
  }));
666
715
  }
667
- function be(e) {
716
+ function Ce(e) {
668
717
  let { record: t, compiledOmit: n } = e;
669
718
  return n.conditional.some((e) => e.scope === "children" && e.tagName === t.tagName && M({
670
719
  record: t,
671
720
  attributeFilter: e.where
672
721
  }));
673
722
  }
674
- function xe(e) {
723
+ function we(e) {
675
724
  let { tree: t, omit: n } = e;
676
725
  if (!n?.length) return t;
677
- let r = ye(n), i = (e) => {
678
- if (be({
726
+ let r = xe(n), i = (e) => {
727
+ if (Ce({
679
728
  record: e,
680
729
  compiledOmit: r
681
730
  })) return {
682
731
  ...e,
683
732
  tree: []
684
733
  };
685
- let t = e.tree.filter((e) => !R({
734
+ let t = e.tree.filter((e) => !Se({
686
735
  record: e,
687
736
  compiledOmit: r
688
737
  })).map((e) => i(e));
@@ -693,7 +742,7 @@ function xe(e) {
693
742
  };
694
743
  return i(t);
695
744
  }
696
- function Se(e) {
745
+ function Te(e) {
697
746
  let { tree: t, childrenConfig: n } = e, i = (e) => {
698
747
  if (e.tree.length === 0) return e;
699
748
  let t = r({
@@ -708,7 +757,7 @@ function Se(e) {
708
757
  };
709
758
  return i(t);
710
759
  }
711
- async function Ce(e) {
760
+ async function Ee(e) {
712
761
  let { context: t, ref: n, options: r = {}, dialecteConfig: i } = e, { select: a, omit: s, unwrap: c } = r, l = await E({
713
762
  context: t,
714
763
  ref: n
@@ -717,7 +766,7 @@ async function Ce(e) {
717
766
  detail: "No record found for provided ref",
718
767
  key: "ELEMENT_NOT_FOUND"
719
768
  });
720
- let u = ye(s), d = t.dialecteConfig.transparentElements, f = await we({
769
+ let u = xe(s), d = t.dialecteConfig.transparentElements, f = await De({
721
770
  context: t,
722
771
  record: l,
723
772
  select: a,
@@ -727,21 +776,21 @@ async function Ce(e) {
727
776
  });
728
777
  if (!f) return p({ record: l });
729
778
  let m = c ?? (d?.length ? d : void 0);
730
- return Se({
731
- tree: m ? ve({
779
+ return Te({
780
+ tree: m ? L({
732
781
  tree: f,
733
782
  unwrapTagNames: m
734
783
  }) : f,
735
784
  childrenConfig: t.dialecteConfig.children
736
785
  });
737
786
  }
738
- async function we(e) {
787
+ async function De(e) {
739
788
  let { context: t, record: n, select: r, compiledOmit: i, dialecteConfig: a, transparentElements: o } = e;
740
- if (be({
789
+ if (Ce({
741
790
  record: n,
742
791
  compiledOmit: i
743
792
  })) return p({ record: n });
744
- let s = await Te({
793
+ let s = await Oe({
745
794
  context: t,
746
795
  record: n,
747
796
  select: r,
@@ -751,7 +800,7 @@ async function we(e) {
751
800
  });
752
801
  return p({
753
802
  record: n,
754
- tree: (await Promise.all(s.map(({ record: e, select: n }) => we({
803
+ tree: (await Promise.all(s.map(({ record: e, select: n }) => De({
755
804
  context: t,
756
805
  record: e,
757
806
  select: n,
@@ -761,25 +810,25 @@ async function we(e) {
761
810
  })))).filter((e) => e !== null)
762
811
  });
763
812
  }
764
- async function Te(e) {
813
+ async function Oe(e) {
765
814
  let { context: t, record: n, select: r, compiledOmit: i, dialecteConfig: a, transparentElements: o } = e;
766
815
  if (!n.children?.length) return [];
767
- let s = r ? Oe(r) : void 0;
816
+ let s = r ? je(r) : void 0;
768
817
  if (s && r && a && r.recursive !== !1) {
769
818
  let e = n.tagName, t = a.children[e], i = r[e] !== void 0;
770
819
  t?.includes(e) && !i && s.add(e);
771
820
  }
772
- let c = n.children.filter((e) => Ee({
821
+ let c = n.children.filter((e) => ke({
773
822
  tagName: e.tagName,
774
823
  compiledOmit: i,
775
824
  selectKeys: s,
776
825
  transparentElements: o
777
826
  }));
778
- return c.length ? ke({
827
+ return c.length ? Me({
779
828
  children: (await Promise.all(c.map((e) => E({
780
829
  context: t,
781
830
  ref: f(e)
782
- })))).filter((e) => e !== void 0).filter((e) => !R({
831
+ })))).filter((e) => e !== void 0).filter((e) => !Se({
783
832
  record: e,
784
833
  compiledOmit: i
785
834
  })),
@@ -789,17 +838,17 @@ async function Te(e) {
789
838
  transparentElements: o
790
839
  }) : [];
791
840
  }
792
- function Ee(e) {
841
+ function ke(e) {
793
842
  let { tagName: t, compiledOmit: n, selectKeys: r, transparentElements: i } = e;
794
843
  return n.unconditional.has(t) ? !1 : r && !r.has(t) ? !!i?.includes(t) : !0;
795
844
  }
796
- var De = /* @__PURE__ */ new Set(["where", "recursive"]);
797
- function Oe(e) {
845
+ var Ae = /* @__PURE__ */ new Set(["where", "recursive"]);
846
+ function je(e) {
798
847
  let t = /* @__PURE__ */ new Set();
799
- for (let n of Object.keys(e)) De.has(n) || t.add(n);
848
+ for (let n of Object.keys(e)) Ae.has(n) || t.add(n);
800
849
  return t;
801
850
  }
802
- function ke(e) {
851
+ function Me(e) {
803
852
  let { children: t, select: n, record: r, dialecteConfig: i, transparentElements: a } = e;
804
853
  if (!n) return t.map((e) => ({
805
854
  record: e,
@@ -816,7 +865,7 @@ function ke(e) {
816
865
  continue;
817
866
  }
818
867
  if (t === void 0 && e.tagName === r.tagName) {
819
- let t = Ae({
868
+ let t = R({
820
869
  child: e,
821
870
  select: n,
822
871
  dialecteConfig: i
@@ -834,7 +883,7 @@ function ke(e) {
834
883
  });
835
884
  continue;
836
885
  }
837
- let s = je({
886
+ let s = Ne({
838
887
  child: e,
839
888
  entry: t,
840
889
  parentRecord: r
@@ -843,7 +892,7 @@ function ke(e) {
843
892
  }
844
893
  return o;
845
894
  }
846
- function Ae(e) {
895
+ function R(e) {
847
896
  let { child: t, select: n, dialecteConfig: r } = e;
848
897
  if (!(!r || n.recursive === !1) && r.children[t.tagName]?.includes(t.tagName) && !(n.where && !M({
849
898
  record: t,
@@ -853,7 +902,7 @@ function Ae(e) {
853
902
  select: n
854
903
  };
855
904
  }
856
- function je(e) {
905
+ function Ne(e) {
857
906
  let { child: t, entry: n, parentRecord: r } = e, i = n;
858
907
  if (!(i.where && !M({
859
908
  record: t,
@@ -871,7 +920,7 @@ function je(e) {
871
920
  }
872
921
  return i.recursive ? {
873
922
  record: t,
874
- select: z(i, t.tagName)
923
+ select: Pe(i, t.tagName)
875
924
  } : t.tagName === r.tagName ? {
876
925
  record: t,
877
926
  select: {
@@ -884,16 +933,16 @@ function je(e) {
884
933
  };
885
934
  }
886
935
  }
887
- function z(e, t) {
936
+ function Pe(e, t) {
888
937
  return e[t], e;
889
938
  }
890
- async function Me(e) {
939
+ async function Fe(e) {
891
940
  let { context: t, ref: n, ancestors: r = 0, depth: i, includeDeleted: a = !1 } = e;
892
- if (!n && i === void 0) return Ne({
941
+ if (!n && i === void 0) return z({
893
942
  context: t,
894
943
  includeDeleted: a
895
944
  });
896
- let s = e.siblings ?? !1, c = s === !0 || typeof s == "object" && !!s, l = typeof s == "object" && !!s && s.expand === !0, u = n ?? { tagName: t.dialecteConfig.rootElementName }, d = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), m = a ? ne(t.stagedOperations) : void 0, h = (e) => {
945
+ let s = e.siblings ?? !1, c = s === !0 || typeof s == "object" && !!s, l = typeof s == "object" && !!s && s.expand === !0, u = n ?? { tagName: t.dialecteConfig.rootElementName }, d = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), m = a ? ie(t.stagedOperations) : void 0, h = (e) => {
897
946
  if (m) for (let t of m.get(e) ?? []) p.has(t.id) || (p.set(t.id, t), h(t.id));
898
947
  }, g = async (e, n) => {
899
948
  if (d.set(e.id, e), h(e.id), !(i !== void 0 && n >= i)) for (let r of e.children) {
@@ -915,7 +964,7 @@ async function Me(e) {
915
964
  await g(_, 0);
916
965
  let y = Math.max(r, +!!c);
917
966
  if (y > 0) {
918
- let e = await A({
967
+ let e = await ae({
919
968
  context: t,
920
969
  ref: u,
921
970
  options: {
@@ -939,14 +988,14 @@ async function Me(e) {
939
988
  }
940
989
  }
941
990
  }
942
- return Pe({
991
+ return Ie({
943
992
  live: d,
944
993
  deletedById: p,
945
994
  rootId: v
946
995
  });
947
996
  }
948
- async function Ne(e) {
949
- let { context: t, includeDeleted: n = !1 } = e, { live: r, deleted: i } = T({
997
+ async function z(e) {
998
+ let { context: t, includeDeleted: n = !1 } = e, { live: r, deleted: i } = re({
950
999
  rawRecords: await t.store.getByDocumentId(t.documentId),
951
1000
  stagedOperations: t.stagedOperations,
952
1001
  includeDeleted: n
@@ -958,13 +1007,13 @@ async function Ne(e) {
958
1007
  return o(a, {
959
1008
  key: "ROOT_NOT_FOUND",
960
1009
  detail: `No ${t.dialecteConfig.rootElementName} root element found in document`
961
- }), Pe({
1010
+ }), Ie({
962
1011
  live: r,
963
1012
  deletedById: new Map(i.map((e) => [e.id, e])),
964
1013
  rootId: a
965
1014
  });
966
1015
  }
967
- function Pe(e) {
1016
+ function Ie(e) {
968
1017
  let { live: t, deletedById: n, rootId: r } = e, i = new Set(t.keys()), a = Array.from(t.values()).map((e) => ({
969
1018
  ...e,
970
1019
  children: e.children.filter((e) => i.has(e.id))
@@ -978,7 +1027,7 @@ function Pe(e) {
978
1027
  rootId: r
979
1028
  };
980
1029
  }
981
- function B(e) {
1030
+ function Le(e) {
982
1031
  let { liveRecords: t, deletedRecords: n, rootId: r } = e, i = new Map(t.map((e) => [e.id, e])), a = new Map(n.map((e) => [e.id, e])), s = /* @__PURE__ */ new Map();
983
1032
  for (let e of n) {
984
1033
  let t = e.parent?.id;
@@ -1000,7 +1049,7 @@ function B(e) {
1000
1049
  };
1001
1050
  return l(c, "live");
1002
1051
  }
1003
- var Fe = /* @__PURE__ */ b(((e, t) => {
1052
+ var Re = /* @__PURE__ */ b(((e, t) => {
1004
1053
  Object.defineProperty(e, "__esModule", { value: !0 }), e.ParsingError = void 0;
1005
1054
  var n = class extends Error {
1006
1055
  constructor(e, t) {
@@ -1164,12 +1213,12 @@ var Fe = /* @__PURE__ */ b(((e, t) => {
1164
1213
  }, o();
1165
1214
  }
1166
1215
  t !== void 0 && typeof e == "object" && (t.exports = v), e.default = v;
1167
- })), Ie = /* @__PURE__ */ b(((e, t) => {
1216
+ })), ze = /* @__PURE__ */ b(((e, t) => {
1168
1217
  var n = e && e.__importDefault || function(e) {
1169
1218
  return e && e.__esModule ? e : { default: e };
1170
1219
  };
1171
1220
  Object.defineProperty(e, "__esModule", { value: !0 });
1172
- var r = n(Fe());
1221
+ var r = n(Re());
1173
1222
  function i(e) {
1174
1223
  if (!e.options.indentation && !e.options.lineSeparator) return;
1175
1224
  e.content += e.options.lineSeparator;
@@ -1258,16 +1307,16 @@ var Fe = /* @__PURE__ */ b(((e, t) => {
1258
1307
  indentation: "",
1259
1308
  lineSeparator: ""
1260
1309
  })), t !== void 0 && typeof e == "object" && (t.exports = p), e.default = p;
1261
- })), Le = /* @__PURE__ */ S(Ie(), 1);
1262
- function Re(e) {
1263
- return (0, Le.default)(e);
1310
+ })), Be = /* @__PURE__ */ S(ze(), 1);
1311
+ function Ve(e) {
1312
+ return (0, Be.default)(e);
1264
1313
  }
1265
- var ze = "_temp-idb-id";
1266
- function Be(e, t = {}) {
1314
+ var He = "_temp-idb-id";
1315
+ function Ue(e, t = {}) {
1267
1316
  let { includeXmlDeclaration: n = !0 } = t, r = new XMLSerializer().serializeToString(e);
1268
- return Re(n ? "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + r : r);
1317
+ return Ve(n ? "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + r : r);
1269
1318
  }
1270
- function Ve(e) {
1319
+ function We(e) {
1271
1320
  let { records: t, config: n, withDatabaseIds: r = !1, rootId: i, declareNamespaces: a = !0 } = e, s = /* @__PURE__ */ new Map(), c;
1272
1321
  for (let e of t) s.set(e.id, e), e.tagName === n.rootElementName && (c = e);
1273
1322
  let l = i ? s.get(i) : c;
@@ -1275,13 +1324,13 @@ function Ve(e) {
1275
1324
  detail: i ? `No record found for rootId "${i}"` : `No ${n.rootElementName} root element found in records`,
1276
1325
  key: "EXPORT_ROOT_NOT_FOUND"
1277
1326
  });
1278
- let u = l.tagName !== n.rootElementName, d = n.namespaces.default, f = document.implementation.createDocument(d.uri, null, null), p = Ue({
1327
+ let u = l.tagName !== n.rootElementName, d = n.namespaces.default, f = document.implementation.createDocument(d.uri, null, null), p = Ke({
1279
1328
  document: f,
1280
1329
  record: l,
1281
1330
  defaultNamespace: d,
1282
1331
  declareNamespaces: a
1283
1332
  });
1284
- return a && p.setAttribute("xmlns", l.namespace.uri), l.attributes && Ge({
1333
+ return a && p.setAttribute("xmlns", l.namespace.uri), l.attributes && V({
1285
1334
  config: n,
1286
1335
  document: f,
1287
1336
  element: p,
@@ -1289,11 +1338,11 @@ function Ve(e) {
1289
1338
  isRoot: !0,
1290
1339
  isFragment: u,
1291
1340
  declareNamespaces: a
1292
- }), u || H({
1341
+ }), u || Je({
1293
1342
  config: n,
1294
1343
  rootElement: p,
1295
1344
  namespace: l.namespace
1296
- }), l.value && (p.textContent = l.value.trim()), r && p.setAttribute("_temp-idb-id", l.id), f.appendChild(p), He({
1345
+ }), l.value && (p.textContent = l.value.trim()), r && p.setAttribute("_temp-idb-id", l.id), f.appendChild(p), Ge({
1297
1346
  index: s,
1298
1347
  config: n,
1299
1348
  withDatabaseIds: r,
@@ -1304,7 +1353,7 @@ function Ve(e) {
1304
1353
  declareNamespaces: a
1305
1354
  }), f;
1306
1355
  }
1307
- function He(e) {
1356
+ function Ge(e) {
1308
1357
  let { index: t, config: n, withDatabaseIds: i, xmlDocument: a, parentRecord: s, parentElement: c, isFragment: l, declareNamespaces: u } = e;
1309
1358
  if (!s.children || s.children.length === 0) return;
1310
1359
  let d = [];
@@ -1325,7 +1374,7 @@ function He(e) {
1325
1374
  childrenConfig: n.children
1326
1375
  });
1327
1376
  for (let e of f) {
1328
- let r = We({
1377
+ let r = B({
1329
1378
  config: n,
1330
1379
  document: a,
1331
1380
  record: e,
@@ -1334,7 +1383,7 @@ function He(e) {
1334
1383
  isFragment: l,
1335
1384
  declareNamespaces: u
1336
1385
  });
1337
- c.appendChild(r), He({
1386
+ c.appendChild(r), Ge({
1338
1387
  index: t,
1339
1388
  config: n,
1340
1389
  withDatabaseIds: i,
@@ -1346,23 +1395,23 @@ function He(e) {
1346
1395
  });
1347
1396
  }
1348
1397
  }
1349
- function Ue(e) {
1398
+ function Ke(e) {
1350
1399
  let { document: t, record: n, defaultNamespace: r, declareNamespaces: i } = e, a = n.namespace.uri !== r.uri && n.namespace.prefix && n.namespace.prefix !== "xmlns" ? `${n.namespace.prefix}:${n.tagName}` : n.tagName;
1351
1400
  return i ? t.createElementNS(n.namespace.uri, a) : t.createElement(a);
1352
1401
  }
1353
- function We(e) {
1354
- let { config: t, document: n, record: r, defaultNamespace: i, withDatabaseIds: a, isFragment: o, declareNamespaces: s } = e, c = r.namespace.uri === i.uri, l = Ue({
1402
+ function B(e) {
1403
+ let { config: t, document: n, record: r, defaultNamespace: i, withDatabaseIds: a, isFragment: o, declareNamespaces: s } = e, c = r.namespace.uri === i.uri, l = Ke({
1355
1404
  document: n,
1356
1405
  record: r,
1357
1406
  defaultNamespace: i,
1358
1407
  declareNamespaces: s
1359
1408
  });
1360
- return s && !c && r.namespace.prefix && r.namespace.prefix !== "xmlns" && V({
1409
+ return s && !c && r.namespace.prefix && r.namespace.prefix !== "xmlns" && qe({
1361
1410
  config: t,
1362
1411
  document: n,
1363
1412
  namespace: r.namespace,
1364
1413
  isFragment: o
1365
- }), r.attributes && Ge({
1414
+ }), r.attributes && V({
1366
1415
  config: t,
1367
1416
  document: n,
1368
1417
  element: l,
@@ -1370,7 +1419,7 @@ function We(e) {
1370
1419
  isRoot: !1,
1371
1420
  isFragment: o,
1372
1421
  declareNamespaces: s
1373
- }), Ke({
1422
+ }), Ye({
1374
1423
  config: t,
1375
1424
  document: n,
1376
1425
  element: l,
@@ -1379,11 +1428,11 @@ function We(e) {
1379
1428
  declareNamespaces: s
1380
1429
  }), r.value && (l.textContent = r.value.trim()), a && l.setAttribute("_temp-idb-id", r.id), l;
1381
1430
  }
1382
- function Ge(t) {
1431
+ function V(t) {
1383
1432
  let { config: n, document: r, element: i, attributes: a, isRoot: o, isFragment: s, declareNamespaces: c } = t;
1384
1433
  for (let t of a) {
1385
- if (Je(t)) continue;
1386
- if (!qe(t) || !t.namespace.prefix) {
1434
+ if (Ze(t)) continue;
1435
+ if (!Xe(t) || !t.namespace.prefix) {
1387
1436
  i.setAttribute(t.name, String(t.value));
1388
1437
  continue;
1389
1438
  }
@@ -1392,7 +1441,7 @@ function Ge(t) {
1392
1441
  i.setAttribute(`${t.namespace.prefix}:${a}`, String(t.value));
1393
1442
  continue;
1394
1443
  }
1395
- o || V({
1444
+ o || qe({
1396
1445
  config: n,
1397
1446
  document: r,
1398
1447
  namespace: t.namespace,
@@ -1400,17 +1449,17 @@ function Ge(t) {
1400
1449
  }), i.setAttributeNS(t.namespace.uri, `${t.namespace.prefix}:${a}`, String(t.value));
1401
1450
  }
1402
1451
  }
1403
- function V(e) {
1452
+ function qe(e) {
1404
1453
  let { config: t, document: n, namespace: r, isFragment: i } = e, a = n.documentElement;
1405
1454
  if (!a || !r.prefix || r.prefix === "xmlns") return;
1406
1455
  let o = "http://www.w3.org/2000/xmlns/";
1407
- a.getAttributeNS(o, r.prefix) === null && (a.setAttributeNS(o, `xmlns:${r.prefix}`, r.uri), i || H({
1456
+ a.getAttributeNS(o, r.prefix) === null && (a.setAttributeNS(o, `xmlns:${r.prefix}`, r.uri), i || Je({
1408
1457
  config: t,
1409
1458
  rootElement: a,
1410
1459
  namespace: r
1411
1460
  }));
1412
1461
  }
1413
- function H(t) {
1462
+ function Je(t) {
1414
1463
  let { config: r, rootElement: i, namespace: a } = t, o = Object.entries(r.definition[r.rootElementName].attributes.details).filter(([e, t]) => n({
1415
1464
  dialecteConfig: r,
1416
1465
  tagName: r.rootElementName,
@@ -1430,7 +1479,7 @@ function H(t) {
1430
1479
  } else i.setAttribute(o, s);
1431
1480
  }
1432
1481
  }
1433
- function Ke(t) {
1482
+ function Ye(t) {
1434
1483
  let { config: r, document: i, element: a, tagName: o, isFragment: s, declareNamespaces: c } = t;
1435
1484
  if (!c) return;
1436
1485
  let l = r.definition[o]?.attributes.details;
@@ -1443,7 +1492,7 @@ function Ke(t) {
1443
1492
  });
1444
1493
  if (l === void 0) continue;
1445
1494
  let d = e(t);
1446
- (u.namespace ? a.hasAttributeNS(u.namespace.uri, d) : a.hasAttribute(d)) || (u.namespace && u.namespace.prefix && u.namespace.prefix !== "xmlns" ? (c && V({
1495
+ (u.namespace ? a.hasAttributeNS(u.namespace.uri, d) : a.hasAttribute(d)) || (u.namespace && u.namespace.prefix && u.namespace.prefix !== "xmlns" ? (c && qe({
1447
1496
  config: r,
1448
1497
  document: i,
1449
1498
  namespace: u.namespace,
@@ -1451,13 +1500,13 @@ function Ke(t) {
1451
1500
  }), a.setAttributeNS(u.namespace.uri, `${u.namespace.prefix}:${d}`, l)) : a.setAttribute(d, l));
1452
1501
  }
1453
1502
  }
1454
- function qe(e) {
1503
+ function Xe(e) {
1455
1504
  return typeof e == "object" && !!e && "namespace" in e && !!e.namespace;
1456
1505
  }
1457
- function Je(e) {
1458
- return !!(e.name === "xmlns" || e.name.startsWith("xmlns:") || qe(e) && e.namespace?.prefix === "xmlns");
1506
+ function Ze(e) {
1507
+ return !!(e.name === "xmlns" || e.name.startsWith("xmlns:") || Xe(e) && e.namespace?.prefix === "xmlns");
1459
1508
  }
1460
- var Ye = /* @__PURE__ */ b(((e, t) => {
1509
+ var Qe = /* @__PURE__ */ b(((e, t) => {
1461
1510
  t.exports = {};
1462
1511
  }));
1463
1512
  (/* @__PURE__ */ b(((e) => {
@@ -1517,15 +1566,15 @@ var Ye = /* @__PURE__ */ b(((e, t) => {
1517
1566
  var s = n[t[a]].length;
1518
1567
  if (s > r) switch (t[a]) {
1519
1568
  case "textNode":
1520
- k(n);
1569
+ O(n);
1521
1570
  break;
1522
1571
  case "cdata":
1523
- O(n, "oncdata", n.cdata), n.cdata = "";
1572
+ D(n, "oncdata", n.cdata), n.cdata = "";
1524
1573
  break;
1525
1574
  case "script":
1526
- O(n, "onscript", n.script), n.script = "";
1575
+ D(n, "onscript", n.script), n.script = "";
1527
1576
  break;
1528
- default: j(n, "Max buffer length exceeded: " + t[a]);
1577
+ default: A(n, "Max buffer length exceeded: " + t[a]);
1529
1578
  }
1530
1579
  i = Math.max(i, s);
1531
1580
  }
@@ -1535,13 +1584,13 @@ var Ye = /* @__PURE__ */ b(((e, t) => {
1535
1584
  for (var n = 0, r = t.length; n < r; n++) e[t[n]] = "";
1536
1585
  }
1537
1586
  function a(e) {
1538
- k(e), e.cdata !== "" && (O(e, "oncdata", e.cdata), e.cdata = ""), e.script !== "" && (O(e, "onscript", e.script), e.script = "");
1587
+ O(e), e.cdata !== "" && (D(e, "oncdata", e.cdata), e.cdata = ""), e.script !== "" && (D(e, "onscript", e.script), e.script = "");
1539
1588
  }
1540
1589
  n.prototype = {
1541
1590
  end: function() {
1542
- M(this);
1591
+ ae(this);
1543
1592
  },
1544
- write: I,
1593
+ write: F,
1545
1594
  resume: function() {
1546
1595
  return this.error = null, this;
1547
1596
  },
@@ -1554,7 +1603,7 @@ var Ye = /* @__PURE__ */ b(((e, t) => {
1554
1603
  };
1555
1604
  var o;
1556
1605
  try {
1557
- o = Ye().Stream;
1606
+ o = Qe().Stream;
1558
1607
  } catch {
1559
1608
  o = function() {};
1560
1609
  }
@@ -1953,101 +2002,101 @@ var Ye = /* @__PURE__ */ b(((e, t) => {
1953
2002
  var t = e && e.match(/(?:^|\s)encoding\s*=\s*(['"])([^'"]+)\1/i);
1954
2003
  return t ? t[2] : null;
1955
2004
  }
1956
- function E(e) {
2005
+ function re(e) {
1957
2006
  return e ? e.toLowerCase().replace(/[^a-z0-9]/g, "") : null;
1958
2007
  }
1959
- function D(e, t) {
1960
- let n = E(e), r = E(t);
2008
+ function ie(e, t) {
2009
+ let n = re(e), r = re(t);
1961
2010
  return !n || !r ? !0 : r === "utf16" ? n === "utf16le" || n === "utf16be" : n === r;
1962
2011
  }
1963
- function re(e, t) {
2012
+ function E(e, t) {
1964
2013
  if (!(!e.strict || !e.encoding || !t || t.name !== "xml")) {
1965
2014
  var n = ne(t.body);
1966
- n && !D(e.encoding, n) && N(e, "XML declaration encoding " + n + " does not match detected stream encoding " + e.encoding.toUpperCase());
2015
+ n && !ie(e.encoding, n) && j(e, "XML declaration encoding " + n + " does not match detected stream encoding " + e.encoding.toUpperCase());
1967
2016
  }
1968
2017
  }
1969
- function O(e, t, n) {
1970
- e.textNode && k(e), T(e, t, n);
2018
+ function D(e, t, n) {
2019
+ e.textNode && O(e), T(e, t, n);
1971
2020
  }
1972
- function k(e) {
1973
- e.textNode = A(e.opt, e.textNode), e.textNode && T(e, "ontext", e.textNode), e.textNode = "";
2021
+ function O(e) {
2022
+ e.textNode = k(e.opt, e.textNode), e.textNode && T(e, "ontext", e.textNode), e.textNode = "";
1974
2023
  }
1975
- function A(e, t) {
2024
+ function k(e, t) {
1976
2025
  return e.trim && (t = t.trim()), e.normalize && (t = t.replace(/\s+/g, " ")), t;
1977
2026
  }
1978
- function j(e, t) {
1979
- return k(e), e.trackPosition && (t += "\nLine: " + e.line + "\nColumn: " + e.column + "\nChar: " + e.c), t = Error(t), e.error = t, T(e, "onerror", t), e;
2027
+ function A(e, t) {
2028
+ return O(e), e.trackPosition && (t += "\nLine: " + e.line + "\nColumn: " + e.column + "\nChar: " + e.c), t = Error(t), e.error = t, T(e, "onerror", t), e;
1980
2029
  }
1981
- function M(e) {
1982
- return e.sawRoot && !e.closedRoot && N(e, "Unclosed root tag"), e.state !== w.BEGIN && e.state !== w.BEGIN_WHITESPACE && e.state !== w.TEXT && j(e, "Unexpected end"), k(e), e.c = "", e.closed = !0, T(e, "onend"), n.call(e, e.strict, e.opt), e;
2030
+ function ae(e) {
2031
+ return e.sawRoot && !e.closedRoot && j(e, "Unclosed root tag"), e.state !== w.BEGIN && e.state !== w.BEGIN_WHITESPACE && e.state !== w.TEXT && A(e, "Unexpected end"), O(e), e.c = "", e.closed = !0, T(e, "onend"), n.call(e, e.strict, e.opt), e;
1983
2032
  }
1984
- function N(e, t) {
2033
+ function j(e, t) {
1985
2034
  if (typeof e != "object" || !(e instanceof n)) throw Error("bad call to strictFail");
1986
- e.strict && j(e, t);
2035
+ e.strict && A(e, t);
1987
2036
  }
1988
- function P(e) {
2037
+ function M(e) {
1989
2038
  e.strict || (e.tagName = e.tagName[e.looseCase]());
1990
2039
  var t = e.tags[e.tags.length - 1] || e, n = e.tag = {
1991
2040
  name: e.tagName,
1992
2041
  attributes: {}
1993
2042
  };
1994
- e.opt.xmlns && (n.ns = t.ns), e.attribList.length = 0, O(e, "onopentagstart", n);
2043
+ e.opt.xmlns && (n.ns = t.ns), e.attribList.length = 0, D(e, "onopentagstart", n);
1995
2044
  }
1996
- function ie(e, t) {
2045
+ function oe(e, t) {
1997
2046
  var n = e.indexOf(":") < 0 ? ["", e] : e.split(":"), r = n[0], i = n[1];
1998
2047
  return t && e === "xmlns" && (r = "xmlns", i = ""), {
1999
2048
  prefix: r,
2000
2049
  local: i
2001
2050
  };
2002
2051
  }
2003
- function ae(e) {
2052
+ function N(e) {
2004
2053
  if (e.strict || (e.attribName = e.attribName[e.looseCase]()), e.attribList.indexOf(e.attribName) !== -1 || e.tag.attributes.hasOwnProperty(e.attribName)) {
2005
2054
  e.attribName = e.attribValue = "";
2006
2055
  return;
2007
2056
  }
2008
2057
  if (e.opt.xmlns) {
2009
- var t = ie(e.attribName, !0), n = t.prefix, r = t.local;
2010
- if (n === "xmlns") if (r === "xml" && e.attribValue !== p) N(e, "xml: prefix must be bound to " + p + "\nActual: " + e.attribValue);
2011
- else if (r === "xmlns" && e.attribValue !== m) N(e, "xmlns: prefix must be bound to " + m + "\nActual: " + e.attribValue);
2058
+ var t = oe(e.attribName, !0), n = t.prefix, r = t.local;
2059
+ if (n === "xmlns") if (r === "xml" && e.attribValue !== p) j(e, "xml: prefix must be bound to " + p + "\nActual: " + e.attribValue);
2060
+ else if (r === "xmlns" && e.attribValue !== m) j(e, "xmlns: prefix must be bound to " + m + "\nActual: " + e.attribValue);
2012
2061
  else {
2013
2062
  var i = e.tag, a = e.tags[e.tags.length - 1] || e;
2014
2063
  i.ns === a.ns && (i.ns = Object.create(a.ns)), i.ns[r] = e.attribValue;
2015
2064
  }
2016
2065
  e.attribList.push([e.attribName, e.attribValue]);
2017
- } else e.tag.attributes[e.attribName] = e.attribValue, O(e, "onattribute", {
2066
+ } else e.tag.attributes[e.attribName] = e.attribValue, D(e, "onattribute", {
2018
2067
  name: e.attribName,
2019
2068
  value: e.attribValue
2020
2069
  });
2021
2070
  e.attribName = e.attribValue = "";
2022
2071
  }
2023
- function F(e, t) {
2072
+ function P(e, t) {
2024
2073
  if (e.opt.xmlns) {
2025
- var n = e.tag, r = ie(e.tagName);
2026
- n.prefix = r.prefix, n.local = r.local, n.uri = n.ns[r.prefix] || "", n.prefix && !n.uri && (N(e, "Unbound namespace prefix: " + JSON.stringify(e.tagName)), n.uri = r.prefix);
2074
+ var n = e.tag, r = oe(e.tagName);
2075
+ n.prefix = r.prefix, n.local = r.local, n.uri = n.ns[r.prefix] || "", n.prefix && !n.uri && (j(e, "Unbound namespace prefix: " + JSON.stringify(e.tagName)), n.uri = r.prefix);
2027
2076
  var i = e.tags[e.tags.length - 1] || e;
2028
2077
  n.ns && i.ns !== n.ns && Object.keys(n.ns).forEach(function(t) {
2029
- O(e, "onopennamespace", {
2078
+ D(e, "onopennamespace", {
2030
2079
  prefix: t,
2031
2080
  uri: n.ns[t]
2032
2081
  });
2033
2082
  });
2034
2083
  for (var a = 0, o = e.attribList.length; a < o; a++) {
2035
- var s = e.attribList[a], c = s[0], l = s[1], u = ie(c, !0), d = u.prefix, f = u.local, p = d === "" ? "" : n.ns[d] || "", m = {
2084
+ var s = e.attribList[a], c = s[0], l = s[1], u = oe(c, !0), d = u.prefix, f = u.local, p = d === "" ? "" : n.ns[d] || "", m = {
2036
2085
  name: c,
2037
2086
  value: l,
2038
2087
  prefix: d,
2039
2088
  local: f,
2040
2089
  uri: p
2041
2090
  };
2042
- d && d !== "xmlns" && !p && (N(e, "Unbound namespace prefix: " + JSON.stringify(d)), m.uri = d), e.tag.attributes[c] = m, O(e, "onattribute", m);
2091
+ d && d !== "xmlns" && !p && (j(e, "Unbound namespace prefix: " + JSON.stringify(d)), m.uri = d), e.tag.attributes[c] = m, D(e, "onattribute", m);
2043
2092
  }
2044
2093
  e.attribList.length = 0;
2045
2094
  }
2046
- e.tag.isSelfClosing = !!t, e.sawRoot = !0, e.tags.push(e.tag), O(e, "onopentag", e.tag), t || (!e.noscript && e.tagName.toLowerCase() === "script" ? e.state = w.SCRIPT : e.state = w.TEXT, e.tag = null, e.tagName = ""), e.attribName = e.attribValue = "", e.attribList.length = 0;
2095
+ e.tag.isSelfClosing = !!t, e.sawRoot = !0, e.tags.push(e.tag), D(e, "onopentag", e.tag), t || (!e.noscript && e.tagName.toLowerCase() === "script" ? e.state = w.SCRIPT : e.state = w.TEXT, e.tag = null, e.tagName = ""), e.attribName = e.attribValue = "", e.attribList.length = 0;
2047
2096
  }
2048
- function oe(e) {
2097
+ function se(e) {
2049
2098
  if (!e.tagName) {
2050
- N(e, "Weird empty close tag."), e.textNode += "</>", e.state = w.TEXT;
2099
+ j(e, "Weird empty close tag."), e.textNode += "</>", e.state = w.TEXT;
2051
2100
  return;
2052
2101
  }
2053
2102
  if (e.script) {
@@ -2055,25 +2104,25 @@ var Ye = /* @__PURE__ */ b(((e, t) => {
2055
2104
  e.script += "</" + e.tagName + ">", e.tagName = "", e.state = w.SCRIPT;
2056
2105
  return;
2057
2106
  }
2058
- O(e, "onscript", e.script), e.script = "";
2107
+ D(e, "onscript", e.script), e.script = "";
2059
2108
  }
2060
2109
  var t = e.tags.length, n = e.tagName;
2061
2110
  e.strict || (n = n[e.looseCase]());
2062
- for (var r = n; t-- && e.tags[t].name !== r;) N(e, "Unexpected close tag");
2111
+ for (var r = n; t-- && e.tags[t].name !== r;) j(e, "Unexpected close tag");
2063
2112
  if (t < 0) {
2064
- N(e, "Unmatched closing tag: " + e.tagName), e.textNode += "</" + e.tagName + ">", e.state = w.TEXT;
2113
+ j(e, "Unmatched closing tag: " + e.tagName), e.textNode += "</" + e.tagName + ">", e.state = w.TEXT;
2065
2114
  return;
2066
2115
  }
2067
2116
  e.tagName = n;
2068
2117
  for (var i = e.tags.length; i-- > t;) {
2069
2118
  var a = e.tag = e.tags.pop();
2070
- e.tagName = e.tag.name, O(e, "onclosetag", e.tagName);
2119
+ e.tagName = e.tag.name, D(e, "onclosetag", e.tagName);
2071
2120
  var o = {};
2072
2121
  for (var s in a.ns) o[s] = a.ns[s];
2073
2122
  var c = e.tags[e.tags.length - 1] || e;
2074
2123
  e.opt.xmlns && a.ns !== c.ns && Object.keys(a.ns).forEach(function(t) {
2075
2124
  var n = a.ns[t];
2076
- O(e, "onclosenamespace", {
2125
+ D(e, "onclosenamespace", {
2077
2126
  prefix: t,
2078
2127
  uri: n
2079
2128
  });
@@ -2081,37 +2130,37 @@ var Ye = /* @__PURE__ */ b(((e, t) => {
2081
2130
  }
2082
2131
  t === 0 && (e.closedRoot = !0), e.tagName = e.attribValue = e.attribName = "", e.attribList.length = 0, e.state = w.TEXT;
2083
2132
  }
2084
- function se(e) {
2133
+ function ce(e) {
2085
2134
  var t = e.entity, n = t.toLowerCase(), r, i = "";
2086
- return e.ENTITIES[t] ? e.ENTITIES[t] : e.ENTITIES[n] ? e.ENTITIES[n] : (t = n, t.charAt(0) === "#" && (t.charAt(1) === "x" ? (t = t.slice(2), r = parseInt(t, 16), i = r.toString(16)) : (t = t.slice(1), r = parseInt(t, 10), i = r.toString(10))), t = t.replace(/^0+/, ""), isNaN(r) || i.toLowerCase() !== t || r < 0 || r > 1114111 ? (N(e, "Invalid character entity"), "&" + e.entity + ";") : String.fromCodePoint(r));
2087
- }
2088
- function ce(e, t) {
2089
- t === "<" ? (e.state = w.OPEN_WAKA, e.startTagPosition = e.position) : b(t) || (N(e, "Non-whitespace before first tag."), e.textNode = t, e.state = w.TEXT);
2135
+ return e.ENTITIES[t] ? e.ENTITIES[t] : e.ENTITIES[n] ? e.ENTITIES[n] : (t = n, t.charAt(0) === "#" && (t.charAt(1) === "x" ? (t = t.slice(2), r = parseInt(t, 16), i = r.toString(16)) : (t = t.slice(1), r = parseInt(t, 10), i = r.toString(10))), t = t.replace(/^0+/, ""), isNaN(r) || i.toLowerCase() !== t || r < 0 || r > 1114111 ? (j(e, "Invalid character entity"), "&" + e.entity + ";") : String.fromCodePoint(r));
2090
2136
  }
2091
2137
  function le(e, t) {
2138
+ t === "<" ? (e.state = w.OPEN_WAKA, e.startTagPosition = e.position) : b(t) || (j(e, "Non-whitespace before first tag."), e.textNode = t, e.state = w.TEXT);
2139
+ }
2140
+ function ue(e, t) {
2092
2141
  var n = "";
2093
2142
  return t < e.length && (n = e.charAt(t)), n;
2094
2143
  }
2095
- function I(t) {
2144
+ function F(t) {
2096
2145
  var n = this;
2097
2146
  if (this.error) throw this.error;
2098
- if (n.closed) return j(n, "Cannot write after close. Assign an onready handler.");
2099
- if (t === null) return M(n);
2147
+ if (n.closed) return A(n, "Cannot write after close. Assign an onready handler.");
2148
+ if (t === null) return ae(n);
2100
2149
  typeof t == "object" && (t = t.toString());
2101
- for (var i = 0, a = ""; a = le(t, i++), n.c = a, a;) switch (n.trackPosition && (n.position++, a === "\n" ? (n.line++, n.column = 0) : n.column++), n.state) {
2150
+ for (var i = 0, a = ""; a = ue(t, i++), n.c = a, a;) switch (n.trackPosition && (n.position++, a === "\n" ? (n.line++, n.column = 0) : n.column++), n.state) {
2102
2151
  case w.BEGIN:
2103
2152
  if (n.state = w.BEGIN_WHITESPACE, a === "") continue;
2104
- ce(n, a);
2153
+ le(n, a);
2105
2154
  continue;
2106
2155
  case w.BEGIN_WHITESPACE:
2107
- ce(n, a);
2156
+ le(n, a);
2108
2157
  continue;
2109
2158
  case w.TEXT:
2110
2159
  if (n.sawRoot && !n.closedRoot) {
2111
- for (var o = i - 1; a && a !== "<" && a !== "&";) a = le(t, i++), a && n.trackPosition && (n.position++, a === "\n" ? (n.line++, n.column = 0) : n.column++);
2160
+ for (var o = i - 1; a && a !== "<" && a !== "&";) a = ue(t, i++), a && n.trackPosition && (n.position++, a === "\n" ? (n.line++, n.column = 0) : n.column++);
2112
2161
  n.textNode += t.substring(o, i - 1);
2113
2162
  }
2114
- a === "<" && !(n.sawRoot && n.closedRoot && !n.strict) ? (n.state = w.OPEN_WAKA, n.startTagPosition = n.position) : (!b(a) && (!n.sawRoot || n.closedRoot) && N(n, "Text data outside of root node."), a === "&" ? n.state = w.TEXT_ENTITY : n.textNode += a);
2163
+ a === "<" && !(n.sawRoot && n.closedRoot && !n.strict) ? (n.state = w.OPEN_WAKA, n.startTagPosition = n.position) : (!b(a) && (!n.sawRoot || n.closedRoot) && j(n, "Text data outside of root node."), a === "&" ? n.state = w.TEXT_ENTITY : n.textNode += a);
2115
2164
  continue;
2116
2165
  case w.SCRIPT:
2117
2166
  a === "<" ? n.state = w.SCRIPT_ENDING : n.script += a;
@@ -2125,7 +2174,7 @@ var Ye = /* @__PURE__ */ b(((e, t) => {
2125
2174
  else if (a === "/") n.state = w.CLOSE_TAG, n.tagName = "";
2126
2175
  else if (a === "?") n.state = w.PROC_INST, n.procInstName = n.procInstBody = "";
2127
2176
  else {
2128
- if (N(n, "Unencoded <"), n.startTagPosition + 1 < n.position) {
2177
+ if (j(n, "Unencoded <"), n.startTagPosition + 1 < n.position) {
2129
2178
  var s = n.position - n.startTagPosition;
2130
2179
  a = Array(s).join(" ") + a;
2131
2180
  }
@@ -2137,13 +2186,13 @@ var Ye = /* @__PURE__ */ b(((e, t) => {
2137
2186
  n.state = w.COMMENT, n.comment = "", n.sgmlDecl = "";
2138
2187
  continue;
2139
2188
  }
2140
- n.doctype && n.doctype !== !0 && n.sgmlDecl ? (n.state = w.DOCTYPE_DTD, n.doctype += "<!" + n.sgmlDecl + a, n.sgmlDecl = "") : (n.sgmlDecl + a).toUpperCase() === d ? (O(n, "onopencdata"), n.state = w.CDATA, n.sgmlDecl = "", n.cdata = "") : (n.sgmlDecl + a).toUpperCase() === f ? (n.state = w.DOCTYPE, (n.doctype || n.sawRoot) && N(n, "Inappropriately located doctype declaration"), n.doctype = "", n.sgmlDecl = "") : a === ">" ? (O(n, "onsgmldeclaration", n.sgmlDecl), n.sgmlDecl = "", n.state = w.TEXT) : (x(a) && (n.state = w.SGML_DECL_QUOTED), n.sgmlDecl += a);
2189
+ n.doctype && n.doctype !== !0 && n.sgmlDecl ? (n.state = w.DOCTYPE_DTD, n.doctype += "<!" + n.sgmlDecl + a, n.sgmlDecl = "") : (n.sgmlDecl + a).toUpperCase() === d ? (D(n, "onopencdata"), n.state = w.CDATA, n.sgmlDecl = "", n.cdata = "") : (n.sgmlDecl + a).toUpperCase() === f ? (n.state = w.DOCTYPE, (n.doctype || n.sawRoot) && j(n, "Inappropriately located doctype declaration"), n.doctype = "", n.sgmlDecl = "") : a === ">" ? (D(n, "onsgmldeclaration", n.sgmlDecl), n.sgmlDecl = "", n.state = w.TEXT) : (x(a) && (n.state = w.SGML_DECL_QUOTED), n.sgmlDecl += a);
2141
2190
  continue;
2142
2191
  case w.SGML_DECL_QUOTED:
2143
2192
  a === n.q && (n.state = w.SGML_DECL, n.q = ""), n.sgmlDecl += a;
2144
2193
  continue;
2145
2194
  case w.DOCTYPE:
2146
- a === ">" ? (n.state = w.TEXT, O(n, "ondoctype", n.doctype), n.doctype = !0) : (n.doctype += a, a === "[" ? n.state = w.DOCTYPE_DTD : x(a) && (n.state = w.DOCTYPE_QUOTED, n.q = a));
2195
+ a === ">" ? (n.state = w.TEXT, D(n, "ondoctype", n.doctype), n.doctype = !0) : (n.doctype += a, a === "[" ? n.state = w.DOCTYPE_DTD : x(a) && (n.state = w.DOCTYPE_QUOTED, n.q = a));
2147
2196
  continue;
2148
2197
  case w.DOCTYPE_QUOTED:
2149
2198
  n.doctype += a, a === n.q && (n.q = "", n.state = w.DOCTYPE);
@@ -2158,20 +2207,20 @@ var Ye = /* @__PURE__ */ b(((e, t) => {
2158
2207
  a === "-" ? n.state = w.COMMENT_ENDING : n.comment += a;
2159
2208
  continue;
2160
2209
  case w.COMMENT_ENDING:
2161
- a === "-" ? (n.state = w.COMMENT_ENDED, n.comment = A(n.opt, n.comment), n.comment && O(n, "oncomment", n.comment), n.comment = "") : (n.comment += "-" + a, n.state = w.COMMENT);
2210
+ a === "-" ? (n.state = w.COMMENT_ENDED, n.comment = k(n.opt, n.comment), n.comment && D(n, "oncomment", n.comment), n.comment = "") : (n.comment += "-" + a, n.state = w.COMMENT);
2162
2211
  continue;
2163
2212
  case w.COMMENT_ENDED:
2164
- a === ">" ? n.doctype && n.doctype !== !0 ? n.state = w.DOCTYPE_DTD : n.state = w.TEXT : (N(n, "Malformed comment"), n.comment += "--" + a, n.state = w.COMMENT);
2213
+ a === ">" ? n.doctype && n.doctype !== !0 ? n.state = w.DOCTYPE_DTD : n.state = w.TEXT : (j(n, "Malformed comment"), n.comment += "--" + a, n.state = w.COMMENT);
2165
2214
  continue;
2166
2215
  case w.CDATA:
2167
- for (var o = i - 1; a && a !== "]";) a = le(t, i++), a && n.trackPosition && (n.position++, a === "\n" ? (n.line++, n.column = 0) : n.column++);
2216
+ for (var o = i - 1; a && a !== "]";) a = ue(t, i++), a && n.trackPosition && (n.position++, a === "\n" ? (n.line++, n.column = 0) : n.column++);
2168
2217
  n.cdata += t.substring(o, i - 1), a === "]" && (n.state = w.CDATA_ENDING);
2169
2218
  continue;
2170
2219
  case w.CDATA_ENDING:
2171
2220
  a === "]" ? n.state = w.CDATA_ENDING_2 : (n.cdata += "]" + a, n.state = w.CDATA);
2172
2221
  continue;
2173
2222
  case w.CDATA_ENDING_2:
2174
- a === ">" ? (n.cdata && O(n, "oncdata", n.cdata), O(n, "onclosecdata"), n.cdata = "", n.state = w.TEXT) : a === "]" ? n.cdata += "]" : (n.cdata += "]]" + a, n.state = w.CDATA);
2223
+ a === ">" ? (n.cdata && D(n, "oncdata", n.cdata), D(n, "onclosecdata"), n.cdata = "", n.state = w.TEXT) : a === "]" ? n.cdata += "]" : (n.cdata += "]]" + a, n.state = w.CDATA);
2175
2224
  continue;
2176
2225
  case w.PROC_INST:
2177
2226
  a === "?" ? n.state = w.PROC_INST_ENDING : b(a) ? n.state = w.PROC_INST_BODY : n.procInstName += a;
@@ -2186,61 +2235,61 @@ var Ye = /* @__PURE__ */ b(((e, t) => {
2186
2235
  name: n.procInstName,
2187
2236
  body: n.procInstBody
2188
2237
  };
2189
- re(n, e), O(n, "onprocessinginstruction", e), n.procInstName = n.procInstBody = "", n.state = w.TEXT;
2238
+ E(n, e), D(n, "onprocessinginstruction", e), n.procInstName = n.procInstBody = "", n.state = w.TEXT;
2190
2239
  } else n.procInstBody += "?" + a, n.state = w.PROC_INST_BODY;
2191
2240
  continue;
2192
2241
  case w.OPEN_TAG:
2193
- C(_, a) ? n.tagName += a : (P(n), a === ">" ? F(n) : a === "/" ? n.state = w.OPEN_TAG_SLASH : (b(a) || N(n, "Invalid character in tag name"), n.state = w.ATTRIB));
2242
+ C(_, a) ? n.tagName += a : (M(n), a === ">" ? P(n) : a === "/" ? n.state = w.OPEN_TAG_SLASH : (b(a) || j(n, "Invalid character in tag name"), n.state = w.ATTRIB));
2194
2243
  continue;
2195
2244
  case w.OPEN_TAG_SLASH:
2196
- a === ">" ? (F(n, !0), oe(n)) : (N(n, "Forward-slash in opening tag not followed by >"), n.state = w.ATTRIB);
2245
+ a === ">" ? (P(n, !0), se(n)) : (j(n, "Forward-slash in opening tag not followed by >"), n.state = w.ATTRIB);
2197
2246
  continue;
2198
2247
  case w.ATTRIB:
2199
2248
  if (b(a)) continue;
2200
- a === ">" ? F(n) : a === "/" ? n.state = w.OPEN_TAG_SLASH : C(g, a) ? (n.attribName = a, n.attribValue = "", n.state = w.ATTRIB_NAME) : N(n, "Invalid attribute name");
2249
+ a === ">" ? P(n) : a === "/" ? n.state = w.OPEN_TAG_SLASH : C(g, a) ? (n.attribName = a, n.attribValue = "", n.state = w.ATTRIB_NAME) : j(n, "Invalid attribute name");
2201
2250
  continue;
2202
2251
  case w.ATTRIB_NAME:
2203
- a === "=" ? n.state = w.ATTRIB_VALUE : a === ">" ? (N(n, "Attribute without value"), n.attribValue = n.attribName, ae(n), F(n)) : b(a) ? n.state = w.ATTRIB_NAME_SAW_WHITE : C(_, a) ? n.attribName += a : N(n, "Invalid attribute name");
2252
+ a === "=" ? n.state = w.ATTRIB_VALUE : a === ">" ? (j(n, "Attribute without value"), n.attribValue = n.attribName, N(n), P(n)) : b(a) ? n.state = w.ATTRIB_NAME_SAW_WHITE : C(_, a) ? n.attribName += a : j(n, "Invalid attribute name");
2204
2253
  continue;
2205
2254
  case w.ATTRIB_NAME_SAW_WHITE:
2206
2255
  if (a === "=") n.state = w.ATTRIB_VALUE;
2207
2256
  else if (b(a)) continue;
2208
- else N(n, "Attribute without value"), n.tag.attributes[n.attribName] = "", n.attribValue = "", O(n, "onattribute", {
2257
+ else j(n, "Attribute without value"), n.tag.attributes[n.attribName] = "", n.attribValue = "", D(n, "onattribute", {
2209
2258
  name: n.attribName,
2210
2259
  value: ""
2211
- }), n.attribName = "", a === ">" ? F(n) : C(g, a) ? (n.attribName = a, n.state = w.ATTRIB_NAME) : (N(n, "Invalid attribute name"), n.state = w.ATTRIB);
2260
+ }), n.attribName = "", a === ">" ? P(n) : C(g, a) ? (n.attribName = a, n.state = w.ATTRIB_NAME) : (j(n, "Invalid attribute name"), n.state = w.ATTRIB);
2212
2261
  continue;
2213
2262
  case w.ATTRIB_VALUE:
2214
2263
  if (b(a)) continue;
2215
- x(a) ? (n.q = a, n.state = w.ATTRIB_VALUE_QUOTED) : (n.opt.unquotedAttributeValues || j(n, "Unquoted attribute value"), n.state = w.ATTRIB_VALUE_UNQUOTED, n.attribValue = a);
2264
+ x(a) ? (n.q = a, n.state = w.ATTRIB_VALUE_QUOTED) : (n.opt.unquotedAttributeValues || A(n, "Unquoted attribute value"), n.state = w.ATTRIB_VALUE_UNQUOTED, n.attribValue = a);
2216
2265
  continue;
2217
2266
  case w.ATTRIB_VALUE_QUOTED:
2218
2267
  if (a !== n.q) {
2219
2268
  a === "&" ? n.state = w.ATTRIB_VALUE_ENTITY_Q : n.attribValue += a;
2220
2269
  continue;
2221
2270
  }
2222
- ae(n), n.q = "", n.state = w.ATTRIB_VALUE_CLOSED;
2271
+ N(n), n.q = "", n.state = w.ATTRIB_VALUE_CLOSED;
2223
2272
  continue;
2224
2273
  case w.ATTRIB_VALUE_CLOSED:
2225
- b(a) ? n.state = w.ATTRIB : a === ">" ? F(n) : a === "/" ? n.state = w.OPEN_TAG_SLASH : C(g, a) ? (N(n, "No whitespace between attributes"), n.attribName = a, n.attribValue = "", n.state = w.ATTRIB_NAME) : N(n, "Invalid attribute name");
2274
+ b(a) ? n.state = w.ATTRIB : a === ">" ? P(n) : a === "/" ? n.state = w.OPEN_TAG_SLASH : C(g, a) ? (j(n, "No whitespace between attributes"), n.attribName = a, n.attribValue = "", n.state = w.ATTRIB_NAME) : j(n, "Invalid attribute name");
2226
2275
  continue;
2227
2276
  case w.ATTRIB_VALUE_UNQUOTED:
2228
2277
  if (!S(a)) {
2229
2278
  a === "&" ? n.state = w.ATTRIB_VALUE_ENTITY_U : n.attribValue += a;
2230
2279
  continue;
2231
2280
  }
2232
- ae(n), a === ">" ? F(n) : n.state = w.ATTRIB;
2281
+ N(n), a === ">" ? P(n) : n.state = w.ATTRIB;
2233
2282
  continue;
2234
2283
  case w.CLOSE_TAG:
2235
- if (n.tagName) a === ">" ? oe(n) : C(_, a) ? n.tagName += a : n.script ? (n.script += "</" + n.tagName + a, n.tagName = "", n.state = w.SCRIPT) : (b(a) || N(n, "Invalid tagname in closing tag"), n.state = w.CLOSE_TAG_SAW_WHITE);
2284
+ if (n.tagName) a === ">" ? se(n) : C(_, a) ? n.tagName += a : n.script ? (n.script += "</" + n.tagName + a, n.tagName = "", n.state = w.SCRIPT) : (b(a) || j(n, "Invalid tagname in closing tag"), n.state = w.CLOSE_TAG_SAW_WHITE);
2236
2285
  else {
2237
2286
  if (b(a)) continue;
2238
- ee(g, a) ? n.script ? (n.script += "</" + a, n.state = w.SCRIPT) : N(n, "Invalid tagname in closing tag.") : n.tagName = a;
2287
+ ee(g, a) ? n.script ? (n.script += "</" + a, n.state = w.SCRIPT) : j(n, "Invalid tagname in closing tag.") : n.tagName = a;
2239
2288
  }
2240
2289
  continue;
2241
2290
  case w.CLOSE_TAG_SAW_WHITE:
2242
2291
  if (b(a)) continue;
2243
- a === ">" ? oe(n) : N(n, "Invalid characters in closing tag");
2292
+ a === ">" ? se(n) : j(n, "Invalid characters in closing tag");
2244
2293
  continue;
2245
2294
  case w.TEXT_ENTITY:
2246
2295
  case w.ATTRIB_VALUE_ENTITY_Q:
@@ -2258,9 +2307,9 @@ var Ye = /* @__PURE__ */ b(((e, t) => {
2258
2307
  break;
2259
2308
  }
2260
2309
  if (a === ";") {
2261
- var u = se(n);
2262
- n.opt.unparsedEntities && !Object.values(e.XML_ENTITIES).includes(u) ? ((n.entityCount += 1) > n.opt.maxEntityCount && j(n, "Parsed entity count exceeds max entity count"), (n.entityDepth += 1) > n.opt.maxEntityDepth && j(n, "Parsed entity depth exceeds max entity depth"), n.entity = "", n.state = c, n.write(u), --n.entityDepth) : (n[l] += u, n.entity = "", n.state = c);
2263
- } else C(n.entity.length ? y : v, a) ? n.entity += a : (N(n, "Invalid character in entity name"), n[l] += "&" + n.entity + a, n.entity = "", n.state = c);
2310
+ var u = ce(n);
2311
+ n.opt.unparsedEntities && !Object.values(e.XML_ENTITIES).includes(u) ? ((n.entityCount += 1) > n.opt.maxEntityCount && A(n, "Parsed entity count exceeds max entity count"), (n.entityDepth += 1) > n.opt.maxEntityDepth && A(n, "Parsed entity depth exceeds max entity depth"), n.entity = "", n.state = c, n.write(u), --n.entityDepth) : (n[l] += u, n.entity = "", n.state = c);
2312
+ } else C(n.entity.length ? y : v, a) ? n.entity += a : (j(n, "Invalid character in entity name"), n[l] += "&" + n.entity + a, n.entity = "", n.state = c);
2264
2313
  continue;
2265
2314
  default: throw Error(n, "Unknown state: " + n.state);
2266
2315
  }
@@ -2287,8 +2336,21 @@ var Ye = /* @__PURE__ */ b(((e, t) => {
2287
2336
  })();
2288
2337
  })(e === void 0 ? e.sax = {} : e);
2289
2338
  })))();
2290
- async function Xe(e) {
2291
- let { context: t, options: n = {} } = e, { ref: r, ancestors: i, siblings: a, depth: o, includeDeleted: s, omit: c, unwrap: l, as: u = "tree" } = n, d = await Me({
2339
+ var $e = Object.freeze({
2340
+ start() {},
2341
+ stop() {},
2342
+ count() {},
2343
+ profile(e, t) {
2344
+ return t();
2345
+ },
2346
+ report() {
2347
+ return {};
2348
+ },
2349
+ log() {},
2350
+ reset() {}
2351
+ });
2352
+ async function H(e) {
2353
+ let { context: t, options: n = {} } = e, { ref: r, ancestors: i, siblings: a, depth: o, includeDeleted: s, omit: c, unwrap: l, as: u = "tree" } = n, d = await Fe({
2292
2354
  context: t,
2293
2355
  ref: r ? f(r) : void 0,
2294
2356
  ancestors: i,
@@ -2296,33 +2358,33 @@ async function Xe(e) {
2296
2358
  depth: o,
2297
2359
  includeDeleted: s
2298
2360
  });
2299
- if (u === "xml") return Qe(t, d, n.declareNamespaces, n.includeXmlDeclaration);
2300
- let p = Ze(t, d, {
2361
+ if (u === "xml") return tt(t, d, n.declareNamespaces, n.includeXmlDeclaration);
2362
+ let p = et(t, d, {
2301
2363
  omit: c,
2302
2364
  unwrap: l
2303
2365
  });
2304
2366
  return u === "tree" ? p : {
2305
2367
  tree: p,
2306
- xmlString: Qe(t, d, n.declareNamespaces, n.includeXmlDeclaration)
2368
+ xmlString: tt(t, d, n.declareNamespaces, n.includeXmlDeclaration)
2307
2369
  };
2308
2370
  }
2309
- function Ze(e, t, n) {
2310
- let r = B(t);
2311
- r = xe({
2371
+ function et(e, t, n) {
2372
+ let r = Le(t);
2373
+ r = we({
2312
2374
  tree: r,
2313
2375
  omit: n.omit
2314
2376
  });
2315
2377
  let i = e.dialecteConfig.transparentElements, a = n.unwrap ?? (i?.length ? [...i] : void 0);
2316
- return a?.length && (r = ve({
2378
+ return a?.length && (r = L({
2317
2379
  tree: r,
2318
2380
  unwrapTagNames: a
2319
- })), r = Se({
2381
+ })), r = Te({
2320
2382
  tree: r,
2321
2383
  childrenConfig: e.dialecteConfig.children
2322
2384
  }), r;
2323
2385
  }
2324
- function Qe(e, t, n, r) {
2325
- return Be(Ve({
2386
+ function tt(e, t, n, r) {
2387
+ return Ue(We({
2326
2388
  records: t.liveRecords,
2327
2389
  config: e.dialecteConfig,
2328
2390
  rootId: t.rootId,
@@ -2346,32 +2408,32 @@ var U = class {
2346
2408
  });
2347
2409
  }
2348
2410
  async getChild(e, t) {
2349
- return O({
2411
+ return k({
2350
2412
  context: this.getContext(),
2351
2413
  ref: f(e),
2352
2414
  tagName: t
2353
2415
  });
2354
2416
  }
2355
2417
  async getChildren(e, t) {
2356
- return k({
2418
+ return A({
2357
2419
  context: this.getContext(),
2358
2420
  ref: f(e),
2359
2421
  tagName: t
2360
2422
  });
2361
2423
  }
2362
2424
  async getRecordsByTagName(e) {
2363
- return re({
2425
+ return O({
2364
2426
  context: this.getContext(),
2365
2427
  tagName: e
2366
2428
  });
2367
2429
  }
2368
2430
  async getAttribute(e, t) {
2369
2431
  let n = f(e), { fullObject: r } = t;
2370
- return r ? pe({
2432
+ return r ? ge({
2371
2433
  context: this.getContext(),
2372
2434
  ref: n,
2373
2435
  ...t
2374
- }) : fe({
2436
+ }) : he({
2375
2437
  context: this.getContext(),
2376
2438
  ref: n,
2377
2439
  ...t
@@ -2379,18 +2441,18 @@ var U = class {
2379
2441
  }
2380
2442
  async getAttributes(e, t) {
2381
2443
  let n = f(e), { fullObject: r } = t || {};
2382
- return r ? ge({
2444
+ return r ? ye({
2383
2445
  context: this.getContext(),
2384
2446
  ref: n,
2385
2447
  ...t
2386
- }) : he({
2448
+ }) : ve({
2387
2449
  context: this.getContext(),
2388
2450
  ref: n,
2389
2451
  ...t
2390
2452
  });
2391
2453
  }
2392
2454
  async getTree(e, t) {
2393
- return Ce({
2455
+ return Ee({
2394
2456
  context: this.getContext(),
2395
2457
  ref: f(e),
2396
2458
  options: t,
@@ -2398,21 +2460,21 @@ var U = class {
2398
2460
  });
2399
2461
  }
2400
2462
  async getSnapshot(e) {
2401
- return Xe({
2463
+ return H({
2402
2464
  context: this.getContext(),
2403
2465
  options: e
2404
2466
  });
2405
2467
  }
2406
2468
  async findDescendants(e) {
2407
2469
  let t = f(e), n = this.dialecteConfig.descendants[t.tagName] ?? [];
2408
- return N({
2470
+ return oe({
2409
2471
  context: this.getContext(),
2410
2472
  ref: t,
2411
2473
  options: { collect: n }
2412
2474
  });
2413
2475
  }
2414
2476
  async findAncestors(e) {
2415
- return e ? A({
2477
+ return e ? ae({
2416
2478
  context: this.getContext(),
2417
2479
  ref: f(e)
2418
2480
  }) : [];
@@ -2424,9 +2486,12 @@ var U = class {
2424
2486
  attributes: e.attributes
2425
2487
  });
2426
2488
  }
2427
- }, $e = class {
2428
- constructor(e, t, n) {
2429
- this.store = e, this.dialecteConfig = t, this.documentId = n;
2489
+ }, nt = class {
2490
+ constructor(e, t, n, r = $e) {
2491
+ this.store = e, this.dialecteConfig = t, this.documentId = n, this._perf = r;
2492
+ }
2493
+ get perf() {
2494
+ return this._perf;
2430
2495
  }
2431
2496
  get any() {
2432
2497
  return this._any ??= new U(() => this.context, this.dialecteConfig);
@@ -2440,7 +2505,9 @@ var U = class {
2440
2505
  dialecteConfig: this.dialecteConfig,
2441
2506
  documentId: this.documentId,
2442
2507
  recordCache: void 0,
2443
- stagedOperations: this.getOperations()
2508
+ stagedOperations: this.getOperations(),
2509
+ progress: te,
2510
+ perf: this.perf
2444
2511
  };
2445
2512
  }
2446
2513
  async getDocumentInfo() {
@@ -2474,21 +2541,21 @@ var U = class {
2474
2541
  });
2475
2542
  }
2476
2543
  async getChild(e, t) {
2477
- if (e) return O({
2544
+ if (e) return k({
2478
2545
  context: this.context,
2479
2546
  ref: f(e),
2480
2547
  tagName: t
2481
2548
  });
2482
2549
  }
2483
2550
  async getChildren(e, t) {
2484
- return e ? k({
2551
+ return e ? A({
2485
2552
  context: this.context,
2486
2553
  ref: f(e),
2487
2554
  tagName: t
2488
2555
  }) : [];
2489
2556
  }
2490
2557
  async getRecordsByTagName(e) {
2491
- return re({
2558
+ return O({
2492
2559
  context: this.context,
2493
2560
  tagName: e
2494
2561
  });
@@ -2497,27 +2564,27 @@ var U = class {
2497
2564
  let n = f(e);
2498
2565
  if (!t) {
2499
2566
  let e = this.dialecteConfig.descendants[n.tagName] ?? [];
2500
- return N({
2567
+ return oe({
2501
2568
  context: this.context,
2502
2569
  ref: n,
2503
2570
  options: { collect: e }
2504
2571
  });
2505
2572
  }
2506
- return N({
2573
+ return oe({
2507
2574
  context: this.context,
2508
2575
  ref: n,
2509
2576
  options: t
2510
2577
  });
2511
2578
  }
2512
2579
  async findAncestors(e, t) {
2513
- return e ? A({
2580
+ return e ? ae({
2514
2581
  context: this.context,
2515
2582
  ref: f(e),
2516
2583
  options: t
2517
2584
  }) : [];
2518
2585
  }
2519
2586
  async getTree(e, t) {
2520
- return Ce({
2587
+ return Ee({
2521
2588
  context: this.context,
2522
2589
  ref: f(e),
2523
2590
  options: t,
@@ -2525,18 +2592,18 @@ var U = class {
2525
2592
  });
2526
2593
  }
2527
2594
  async getSnapshot(e) {
2528
- return Xe({
2595
+ return H({
2529
2596
  context: this.context,
2530
2597
  options: e
2531
2598
  });
2532
2599
  }
2533
2600
  async getAttribute(e, t) {
2534
2601
  let n = f(e), { fullObject: r } = t;
2535
- return r ? pe({
2602
+ return r ? ge({
2536
2603
  context: this.context,
2537
2604
  ref: n,
2538
2605
  ...t
2539
- }) : fe({
2606
+ }) : he({
2540
2607
  context: this.context,
2541
2608
  ref: n,
2542
2609
  ...t
@@ -2544,11 +2611,11 @@ var U = class {
2544
2611
  }
2545
2612
  async getAttributes(e, t) {
2546
2613
  let n = f(e), { fullObject: r } = t || {};
2547
- return r ? ge({
2614
+ return r ? ye({
2548
2615
  context: this.context,
2549
2616
  ref: n,
2550
2617
  ...t
2551
- }) : he({
2618
+ }) : ve({
2552
2619
  context: this.context,
2553
2620
  ref: n,
2554
2621
  ...t
@@ -2561,7 +2628,7 @@ var U = class {
2561
2628
  });
2562
2629
  }
2563
2630
  };
2564
- function et(e) {
2631
+ function W(e) {
2565
2632
  let { context: t, status: n, record: r, oldRecord: i, newRecord: a } = e, s, c, l;
2566
2633
  r && (s = d(r)), i && (c = d(i)), a && (l = d(a)), n === "created" ? (o(s, {
2567
2634
  detail: "Record is required for created",
@@ -2586,18 +2653,18 @@ function et(e) {
2586
2653
  newRecord: void 0
2587
2654
  }));
2588
2655
  }
2589
- function W(e) {
2656
+ function rt(e) {
2590
2657
  let { context: t, operations: n } = e;
2591
2658
  for (let e of n) switch (e.status) {
2592
2659
  case "created":
2593
- et({
2660
+ W({
2594
2661
  context: t,
2595
2662
  status: "created",
2596
2663
  record: e.newRecord
2597
2664
  });
2598
2665
  break;
2599
2666
  case "updated":
2600
- et({
2667
+ W({
2601
2668
  context: t,
2602
2669
  status: "updated",
2603
2670
  oldRecord: e.oldRecord,
@@ -2605,7 +2672,7 @@ function W(e) {
2605
2672
  });
2606
2673
  break;
2607
2674
  case "deleted":
2608
- et({
2675
+ W({
2609
2676
  context: t,
2610
2677
  status: "deleted",
2611
2678
  record: e.oldRecord
@@ -2613,9 +2680,9 @@ function W(e) {
2613
2680
  break;
2614
2681
  }
2615
2682
  }
2616
- async function tt(e) {
2683
+ async function it(e) {
2617
2684
  let { dialecteConfig: t, hooks: n, context: r, query: i, parentRef: a, params: c } = e, { id: u, tagName: d, attributes: f, namespace: p, value: m } = c;
2618
- nt({
2685
+ G({
2619
2686
  attributes: f,
2620
2687
  tagName: d
2621
2688
  });
@@ -2648,7 +2715,7 @@ async function tt(e) {
2648
2715
  dialecteConfig: t,
2649
2716
  tagName: g.tagName,
2650
2717
  attributes: g.attributes
2651
- }), et({
2718
+ }), W({
2652
2719
  context: r,
2653
2720
  status: "created",
2654
2721
  record: g
@@ -2660,12 +2727,12 @@ async function tt(e) {
2660
2727
  tagName: g.tagName
2661
2728
  }]
2662
2729
  };
2663
- return et({
2730
+ return W({
2664
2731
  context: r,
2665
2732
  status: "updated",
2666
2733
  oldRecord: h,
2667
2734
  newRecord: _
2668
- }), n?.afterCreated && W({
2735
+ }), n?.afterCreated && rt({
2669
2736
  context: r,
2670
2737
  operations: await n.afterCreated({
2671
2738
  childRecord: g,
@@ -2674,7 +2741,7 @@ async function tt(e) {
2674
2741
  })
2675
2742
  }), g;
2676
2743
  }
2677
- function nt(t) {
2744
+ function G(t) {
2678
2745
  let { attributes: n, tagName: r } = t;
2679
2746
  if (!(!n || !Array.isArray(n))) for (let t of n) {
2680
2747
  let { name: n, namespace: i } = t;
@@ -2684,29 +2751,38 @@ function nt(t) {
2684
2751
  });
2685
2752
  }
2686
2753
  }
2687
- async function rt(e) {
2754
+ async function at(e) {
2688
2755
  let { dialecteConfig: t, hooks: n, context: r, query: i, parentRef: a, record: o } = e, s = [];
2689
- return {
2690
- record: await it({
2691
- dialecteConfig: t,
2692
- hooks: n,
2693
- context: r,
2694
- query: i,
2695
- parentRef: a,
2696
- record: o,
2697
- mappings: s
2698
- }),
2756
+ r.perf.start("core::deepClone"), r.perf.start("core::deepClone::countNodes");
2757
+ let c = K(o);
2758
+ r.perf.stop("core::deepClone::countNodes"), r.progress.plan({ steps: c });
2759
+ let l = await ot({
2760
+ dialecteConfig: t,
2761
+ hooks: n,
2762
+ context: r,
2763
+ query: i,
2764
+ parentRef: a,
2765
+ record: o,
2766
+ mappings: s
2767
+ });
2768
+ return r.progress.endPlan(), r.perf.stop("core::deepClone"), {
2769
+ record: l,
2699
2770
  mappings: s
2700
2771
  };
2701
2772
  }
2702
- async function it(e) {
2773
+ function K(e) {
2774
+ let t = 1;
2775
+ for (let n of e.tree) t += K(n);
2776
+ return t;
2777
+ }
2778
+ async function ot(e) {
2703
2779
  let { dialecteConfig: t, hooks: n, context: r, query: i, parentRef: a, record: o, mappings: s } = e, c = !0, l = o;
2704
2780
  if (n?.beforeClone) {
2705
2781
  let e = n.beforeClone({ record: o });
2706
2782
  c = e.shouldBeCloned, l = e.transformedRecord;
2707
2783
  }
2708
2784
  if (!c) return l;
2709
- let u = await tt({
2785
+ let u = await it({
2710
2786
  dialecteConfig: t,
2711
2787
  hooks: n,
2712
2788
  context: r,
@@ -2722,8 +2798,8 @@ async function it(e) {
2722
2798
  s.push({
2723
2799
  source: Object.assign(d, { attributes: [...o.attributes] }),
2724
2800
  target: f(u)
2725
- });
2726
- for (let e of l.tree) await it({
2801
+ }), r.progress.nextStep();
2802
+ for (let e of l.tree) await ot({
2727
2803
  dialecteConfig: t,
2728
2804
  hooks: n,
2729
2805
  context: r,
@@ -2734,7 +2810,7 @@ async function it(e) {
2734
2810
  });
2735
2811
  return u;
2736
2812
  }
2737
- async function G(e) {
2813
+ async function st(e) {
2738
2814
  let { hooks: t, context: n, query: r, ref: i } = e, a = await E({
2739
2815
  context: n,
2740
2816
  ref: i
@@ -2746,16 +2822,16 @@ async function G(e) {
2746
2822
  }), o(a.parent, {
2747
2823
  detail: "Cannot delete root element",
2748
2824
  key: "PROTECTED_ROOT"
2749
- }), t?.beforeDelete && W({
2825
+ }), t?.beforeDelete && rt({
2750
2826
  context: n,
2751
2827
  operations: await t.beforeDelete({
2752
2828
  record: a,
2753
2829
  query: r
2754
2830
  })
2755
- }), await at({
2831
+ }), await ct({
2756
2832
  context: n,
2757
2833
  record: a
2758
- }), et({
2834
+ }), W({
2759
2835
  context: n,
2760
2836
  status: "deleted",
2761
2837
  record: a
@@ -2772,32 +2848,32 @@ async function G(e) {
2772
2848
  ...s,
2773
2849
  children: s.children.filter((e) => e.id !== a.id)
2774
2850
  };
2775
- return et({
2851
+ return W({
2776
2852
  context: n,
2777
2853
  status: "updated",
2778
2854
  oldRecord: s,
2779
2855
  newRecord: c
2780
2856
  }), c;
2781
2857
  }
2782
- async function at(e) {
2858
+ async function ct(e) {
2783
2859
  let { context: t, record: n } = e;
2784
2860
  for (let e of n.children) {
2785
2861
  let n = await E({
2786
2862
  context: t,
2787
2863
  ref: f(e)
2788
2864
  });
2789
- n && (n.children.length > 0 && await at({
2865
+ n && (n.children.length > 0 && await ct({
2790
2866
  context: t,
2791
2867
  record: n
2792
- }), et({
2868
+ }), W({
2793
2869
  context: t,
2794
2870
  status: "deleted",
2795
2871
  record: n
2796
2872
  }));
2797
2873
  }
2798
2874
  }
2799
- async function K(e) {
2800
- let { dialecteConfig: t, hooks: n, context: r, query: i, parentRef: a, params: o } = e, s = ot(o.attributes), c = await k({
2875
+ async function lt(e) {
2876
+ let { dialecteConfig: t, hooks: n, context: r, query: i, parentRef: a, params: o } = e, s = ut(o.attributes), c = await A({
2801
2877
  context: r,
2802
2878
  ref: a,
2803
2879
  tagName: o.tagName
@@ -2805,7 +2881,7 @@ async function K(e) {
2805
2881
  return (s ? c.find((e) => M({
2806
2882
  record: e,
2807
2883
  attributeFilter: s
2808
- })) : o.id === void 0 ? c[0] : c.find((e) => e.id === o.id)) || tt({
2884
+ })) : o.id === void 0 ? c[0] : c.find((e) => e.id === o.id)) || it({
2809
2885
  dialecteConfig: t,
2810
2886
  hooks: n,
2811
2887
  context: r,
@@ -2814,12 +2890,12 @@ async function K(e) {
2814
2890
  params: o
2815
2891
  });
2816
2892
  }
2817
- function ot(e) {
2893
+ function ut(e) {
2818
2894
  if (!e) return;
2819
2895
  let t = Array.isArray(e) ? Object.fromEntries(e.map((e) => [e.name, e.value])) : e;
2820
2896
  return Object.values(t).some((e) => e !== void 0 && e !== "") ? t : void 0;
2821
2897
  }
2822
- async function st(e) {
2898
+ async function dt(e) {
2823
2899
  let { dialecteConfig: t, hooks: n, context: r, query: i, ref: a, params: c } = e, { attributes: d, value: f } = c, p = await E({
2824
2900
  context: r,
2825
2901
  ref: a
@@ -2851,12 +2927,12 @@ async function st(e) {
2851
2927
  value: f === void 0 ? p.value : f
2852
2928
  }
2853
2929
  });
2854
- return ct(p, h) ? h : (et({
2930
+ return ft(p, h) ? h : (W({
2855
2931
  context: r,
2856
2932
  status: "updated",
2857
2933
  oldRecord: p,
2858
2934
  newRecord: h
2859
- }), n?.afterUpdated && W({
2935
+ }), n?.afterUpdated && rt({
2860
2936
  context: r,
2861
2937
  operations: await n.afterUpdated({
2862
2938
  oldRecord: p,
@@ -2865,18 +2941,18 @@ async function st(e) {
2865
2941
  })
2866
2942
  }), h);
2867
2943
  }
2868
- function ct(e, t) {
2869
- return e.value !== t.value || e.attributes.length !== t.attributes.length ? !1 : e.attributes.every((e, n) => lt(e, t.attributes[n]));
2944
+ function ft(e, t) {
2945
+ return e.value !== t.value || e.attributes.length !== t.attributes.length ? !1 : e.attributes.every((e, n) => pt(e, t.attributes[n]));
2870
2946
  }
2871
- function lt(e, t) {
2947
+ function pt(e, t) {
2872
2948
  return e.name === t.name && e.value === t.value && e.namespace?.uri === t.namespace?.uri && e.namespace?.prefix === t.namespace?.prefix;
2873
2949
  }
2874
- var ut = class extends U {
2950
+ var mt = class extends U {
2875
2951
  constructor(e, t, n, r) {
2876
2952
  super(e, t), this.hooks = n, this.query = r;
2877
2953
  }
2878
2954
  async addChild(e, t) {
2879
- return tt({
2955
+ return it({
2880
2956
  context: this.getContext(),
2881
2957
  parentRef: f(e),
2882
2958
  params: {
@@ -2892,7 +2968,7 @@ var ut = class extends U {
2892
2968
  });
2893
2969
  }
2894
2970
  async ensureChild(e, t) {
2895
- return K({
2971
+ return lt({
2896
2972
  context: this.getContext(),
2897
2973
  parentRef: f(e),
2898
2974
  params: {
@@ -2908,7 +2984,7 @@ var ut = class extends U {
2908
2984
  });
2909
2985
  }
2910
2986
  async update(e, t) {
2911
- return st({
2987
+ return dt({
2912
2988
  context: this.getContext(),
2913
2989
  ref: f(e),
2914
2990
  params: {
@@ -2921,7 +2997,7 @@ var ut = class extends U {
2921
2997
  });
2922
2998
  }
2923
2999
  async delete(e) {
2924
- return G({
3000
+ return st({
2925
3001
  context: this.getContext(),
2926
3002
  ref: f(e),
2927
3003
  hooks: this.hooks,
@@ -2929,7 +3005,7 @@ var ut = class extends U {
2929
3005
  });
2930
3006
  }
2931
3007
  async deepClone(e, t) {
2932
- return await rt({
3008
+ return await at({
2933
3009
  dialecteConfig: this.dialecteConfig,
2934
3010
  hooks: this.hooks,
2935
3011
  context: this.getContext(),
@@ -2939,7 +3015,7 @@ var ut = class extends U {
2939
3015
  });
2940
3016
  }
2941
3017
  };
2942
- function dt(e) {
3018
+ function q(e) {
2943
3019
  let t = /* @__PURE__ */ new Map();
2944
3020
  for (let n of e) {
2945
3021
  let e = (n.status === "deleted" ? n.oldRecord : n.newRecord).id, r = t.get(e);
@@ -2968,38 +3044,40 @@ function dt(e) {
2968
3044
  deletes: n.filter((e) => e.status === "deleted")
2969
3045
  };
2970
3046
  }
2971
- async function ft(e) {
2972
- let { stagedOperations: t, store: n, documentId: r, documentState: i } = e, { creates: a, updates: o, deletes: s } = dt(t), c = a.length + o.length + s.length;
2973
- i.loading = !0, i.progress = {
2974
- message: "Committing changes...",
2975
- current: 0,
2976
- total: c
3047
+ async function ht(e) {
3048
+ let { stagedOperations: t, store: n, documentId: r, documentState: i, progress: a, perf: o = $e } = e;
3049
+ o.start("core::commit"), o.start("core::commit::merge");
3050
+ let { creates: s, updates: c, deletes: l } = q(t);
3051
+ o.stop("core::commit::merge");
3052
+ let u = s.length + c.length + l.length;
3053
+ i.loading = !0, a.plan({ steps: u });
3054
+ let d = 0, f = (e) => {
3055
+ for (; d < e;) a.nextStep(), d++;
2977
3056
  };
2978
3057
  try {
2979
- await n.commit({
3058
+ o.count("core::store::commit"), o.start("core::store::commit"), await n.commit({
2980
3059
  documentId: r,
2981
- creates: a.map((e) => e.newRecord),
2982
- updates: o.map((e) => e.newRecord),
2983
- deletes: s.map((e) => e.oldRecord.id),
2984
- onProgress: (e, t) => {
2985
- i.progress = {
2986
- message: "Committing changes...",
2987
- current: e,
2988
- total: t
2989
- };
3060
+ creates: s.map((e) => e.newRecord),
3061
+ updates: c.map((e) => e.newRecord),
3062
+ deletes: l.map((e) => e.oldRecord.id),
3063
+ onProgress: (e) => {
3064
+ f(e);
2990
3065
  }
2991
- });
3066
+ }), o.stop("core::store::commit");
2992
3067
  } catch (e) {
2993
- throw i.loading = !1, i.progress = null, e;
3068
+ throw i.loading = !1, a.endPlan(), o.stop("core::commit"), e;
2994
3069
  }
2995
- i.lastUpdate = Date.now(), i.progress = null;
3070
+ i.lastUpdate = Date.now(), a.endPlan(), o.stop("core::commit");
2996
3071
  }
2997
- var pt = class extends $e {
2998
- constructor(e, t, n, r, i) {
2999
- super(e, t, n), this.stagedOperations = [], this.recordCache = /* @__PURE__ */ new Map(), this.documentActivity = r, this.hooks = i;
3072
+ var gt = class extends nt {
3073
+ constructor(e, t, n, r, i, a = $e, o = () => {}) {
3074
+ super(e, t, n, a), this.stagedOperations = [], this.recordCache = /* @__PURE__ */ new Map(), this.documentActivity = r, this.hooks = i, this.progressReporter = w(r, o);
3075
+ }
3076
+ get progress() {
3077
+ return this.progressReporter;
3000
3078
  }
3001
3079
  get any() {
3002
- return this._anyTx ??= new ut(() => this.context, this.dialecteConfig, this.hooks, this);
3080
+ return this._anyTx ??= new mt(() => this.context, this.dialecteConfig, this.hooks, this);
3003
3081
  }
3004
3082
  getOperations() {
3005
3083
  return this.stagedOperations;
@@ -3010,11 +3088,13 @@ var pt = class extends $e {
3010
3088
  dialecteConfig: this.dialecteConfig,
3011
3089
  documentId: this.documentId,
3012
3090
  recordCache: this.recordCache,
3013
- stagedOperations: this.stagedOperations
3091
+ stagedOperations: this.stagedOperations,
3092
+ progress: this.progressReporter,
3093
+ perf: this.perf
3014
3094
  };
3015
3095
  }
3016
3096
  async addChild(e, t) {
3017
- return tt({
3097
+ return it({
3018
3098
  context: this.context,
3019
3099
  parentRef: f(e),
3020
3100
  params: t,
@@ -3024,7 +3104,7 @@ var pt = class extends $e {
3024
3104
  });
3025
3105
  }
3026
3106
  async ensureChild(e, t) {
3027
- return K({
3107
+ return lt({
3028
3108
  context: this.context,
3029
3109
  parentRef: f(e),
3030
3110
  params: t,
@@ -3034,7 +3114,7 @@ var pt = class extends $e {
3034
3114
  });
3035
3115
  }
3036
3116
  async update(e, t) {
3037
- return st({
3117
+ return dt({
3038
3118
  context: this.context,
3039
3119
  ref: f(e),
3040
3120
  params: t,
@@ -3044,7 +3124,7 @@ var pt = class extends $e {
3044
3124
  });
3045
3125
  }
3046
3126
  async delete(e) {
3047
- return G({
3127
+ return st({
3048
3128
  context: this.context,
3049
3129
  ref: f(e),
3050
3130
  hooks: this.hooks,
@@ -3052,7 +3132,7 @@ var pt = class extends $e {
3052
3132
  });
3053
3133
  }
3054
3134
  async deepClone(e, t) {
3055
- return rt({
3135
+ return at({
3056
3136
  dialecteConfig: this.dialecteConfig,
3057
3137
  hooks: this.hooks,
3058
3138
  context: this.context,
@@ -3071,22 +3151,24 @@ var pt = class extends $e {
3071
3151
  this.recordCache.clear();
3072
3152
  }
3073
3153
  async commit() {
3074
- await ft({
3154
+ await ht({
3075
3155
  stagedOperations: this.stagedOperations,
3076
3156
  store: this.store,
3077
3157
  documentId: this.documentId,
3078
- documentState: this.documentActivity
3158
+ documentState: this.documentActivity,
3159
+ progress: this.progressReporter,
3160
+ perf: this.perf
3079
3161
  });
3080
3162
  }
3081
3163
  };
3082
- function mt(e) {
3164
+ function _t(e) {
3083
3165
  return e.recordCache !== void 0;
3084
3166
  }
3085
- var q = "xel_";
3086
- function ht(e) {
3087
- return `${q}${e}`;
3167
+ var vt = "xel_";
3168
+ function J(e) {
3169
+ return `${vt}${e}`;
3088
3170
  }
3089
- var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
3171
+ var yt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
3090
3172
  (function(n, r) {
3091
3173
  typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self).Dexie = r();
3092
3174
  })(e, function() {
@@ -3220,26 +3302,26 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
3220
3302
  return n;
3221
3303
  }(e), T = null, e;
3222
3304
  }
3223
- var E = {}.toString;
3224
- function D(e) {
3225
- return E.call(e).slice(8, -1);
3305
+ var re = {}.toString;
3306
+ function ie(e) {
3307
+ return re.call(e).slice(8, -1);
3226
3308
  }
3227
- var re = typeof Symbol < "u" ? Symbol.iterator : "@@iterator", O = typeof re == "symbol" ? function(e) {
3309
+ var E = typeof Symbol < "u" ? Symbol.iterator : "@@iterator", D = typeof E == "symbol" ? function(e) {
3228
3310
  var t;
3229
- return e != null && (t = e[re]) && t.apply(e);
3311
+ return e != null && (t = e[E]) && t.apply(e);
3230
3312
  } : function() {
3231
3313
  return null;
3232
3314
  };
3233
- function k(e, t) {
3315
+ function O(e, t) {
3234
3316
  return t = e.indexOf(t), 0 <= t && e.splice(t, 1), 0 <= t;
3235
3317
  }
3236
- var A = {};
3237
- function j(e) {
3318
+ var k = {};
3319
+ function A(e) {
3238
3320
  var t, n, r, i;
3239
3321
  if (arguments.length === 1) {
3240
3322
  if (a(e)) return e.slice();
3241
- if (this === A && typeof e == "string") return [e];
3242
- if (i = O(e)) {
3323
+ if (this === k && typeof e == "string") return [e];
3324
+ if (i = D(e)) {
3243
3325
  for (n = []; !(r = i.next()).done;) n.push(r.value);
3244
3326
  return n;
3245
3327
  }
@@ -3250,11 +3332,11 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
3250
3332
  for (t = arguments.length, n = Array(t); t--;) n[t] = arguments[t];
3251
3333
  return n;
3252
3334
  }
3253
- var M = typeof Symbol < "u" ? function(e) {
3335
+ var ae = typeof Symbol < "u" ? function(e) {
3254
3336
  return e[Symbol.toStringTag] === "AsyncFunction";
3255
3337
  } : function() {
3256
3338
  return !1;
3257
- }, N = [
3339
+ }, j = [
3258
3340
  "Unknown",
3259
3341
  "Constraint",
3260
3342
  "Data",
@@ -3269,7 +3351,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
3269
3351
  "QuotaExceeded",
3270
3352
  "Syntax",
3271
3353
  "DataClone"
3272
- ], P = [
3354
+ ], M = [
3273
3355
  "Modify",
3274
3356
  "Bulk",
3275
3357
  "OpenFailed",
@@ -3286,99 +3368,99 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
3286
3368
  "DatabaseClosed",
3287
3369
  "PrematureCommit",
3288
3370
  "ForeignAwait"
3289
- ].concat(N), ie = {
3371
+ ].concat(j), oe = {
3290
3372
  VersionChanged: "Database version changed by other database connection",
3291
3373
  DatabaseClosed: "Database has been closed",
3292
3374
  Abort: "Transaction aborted",
3293
3375
  TransactionInactive: "Transaction has already completed or failed",
3294
3376
  MissingAPI: "IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"
3295
3377
  };
3296
- function ae(e, t) {
3378
+ function N(e, t) {
3297
3379
  this.name = e, this.message = t;
3298
3380
  }
3299
- function F(e, t) {
3381
+ function P(e, t) {
3300
3382
  return e + ". Errors: " + Object.keys(t).map(function(e) {
3301
3383
  return t[e].toString();
3302
3384
  }).filter(function(e, t, n) {
3303
3385
  return n.indexOf(e) === t;
3304
3386
  }).join("\n");
3305
3387
  }
3306
- function oe(e, t, n, r) {
3307
- this.failures = t, this.failedKeys = r, this.successCount = n, this.message = F(e, t);
3388
+ function se(e, t, n, r) {
3389
+ this.failures = t, this.failedKeys = r, this.successCount = n, this.message = P(e, t);
3308
3390
  }
3309
- function se(e, t) {
3391
+ function ce(e, t) {
3310
3392
  this.name = "BulkError", this.failures = Object.keys(t).map(function(e) {
3311
3393
  return t[e];
3312
- }), this.failuresByPos = t, this.message = F(e, this.failures);
3394
+ }), this.failuresByPos = t, this.message = P(e, this.failures);
3313
3395
  }
3314
- p(ae).from(Error).extend({ toString: function() {
3396
+ p(N).from(Error).extend({ toString: function() {
3315
3397
  return this.name + ": " + this.message;
3316
- } }), p(oe).from(ae), p(se).from(ae);
3317
- var ce = P.reduce(function(e, t) {
3398
+ } }), p(se).from(N), p(ce).from(N);
3399
+ var le = M.reduce(function(e, t) {
3318
3400
  return e[t] = t + "Error", e;
3319
- }, {}), le = ae, I = P.reduce(function(e, t) {
3401
+ }, {}), ue = N, F = M.reduce(function(e, t) {
3320
3402
  var n = t + "Error";
3321
3403
  function r(e, r) {
3322
- this.name = n, e ? typeof e == "string" ? (this.message = `${e}${r ? "\n " + r : ""}`, this.inner = r || null) : typeof e == "object" && (this.message = `${e.name} ${e.message}`, this.inner = e) : (this.message = ie[t] || n, this.inner = null);
3404
+ this.name = n, e ? typeof e == "string" ? (this.message = `${e}${r ? "\n " + r : ""}`, this.inner = r || null) : typeof e == "object" && (this.message = `${e.name} ${e.message}`, this.inner = e) : (this.message = oe[t] || n, this.inner = null);
3323
3405
  }
3324
- return p(r).from(le), e[t] = r, e;
3406
+ return p(r).from(ue), e[t] = r, e;
3325
3407
  }, {});
3326
- I.Syntax = SyntaxError, I.Type = TypeError, I.Range = RangeError;
3327
- var ue = N.reduce(function(e, t) {
3328
- return e[t + "Error"] = I[t], e;
3329
- }, {}), de = P.reduce(function(e, t) {
3408
+ F.Syntax = SyntaxError, F.Type = TypeError, F.Range = RangeError;
3409
+ var de = j.reduce(function(e, t) {
3410
+ return e[t + "Error"] = F[t], e;
3411
+ }, {}), fe = M.reduce(function(e, t) {
3330
3412
  return [
3331
3413
  "Syntax",
3332
3414
  "Type",
3333
3415
  "Range"
3334
- ].indexOf(t) === -1 && (e[t + "Error"] = I[t]), e;
3416
+ ].indexOf(t) === -1 && (e[t + "Error"] = F[t]), e;
3335
3417
  }, {});
3336
- function L() {}
3337
- function fe(e) {
3418
+ function I() {}
3419
+ function pe(e) {
3338
3420
  return e;
3339
3421
  }
3340
- function pe(e, t) {
3341
- return e == null || e === fe ? t : function(n) {
3422
+ function me(e, t) {
3423
+ return e == null || e === pe ? t : function(n) {
3342
3424
  return t(e(n));
3343
3425
  };
3344
3426
  }
3345
- function me(e, t) {
3427
+ function he(e, t) {
3346
3428
  return function() {
3347
3429
  e.apply(this, arguments), t.apply(this, arguments);
3348
3430
  };
3349
3431
  }
3350
- function he(e, t) {
3351
- return e === L ? t : function() {
3432
+ function ge(e, t) {
3433
+ return e === I ? t : function() {
3352
3434
  var n = e.apply(this, arguments);
3353
3435
  n !== void 0 && (arguments[0] = n);
3354
3436
  var r = this.onsuccess, i = this.onerror;
3355
3437
  this.onsuccess = null, this.onerror = null;
3356
3438
  var a = t.apply(this, arguments);
3357
- return r && (this.onsuccess = this.onsuccess ? me(r, this.onsuccess) : r), i && (this.onerror = this.onerror ? me(i, this.onerror) : i), a === void 0 ? n : a;
3439
+ return r && (this.onsuccess = this.onsuccess ? he(r, this.onsuccess) : r), i && (this.onerror = this.onerror ? he(i, this.onerror) : i), a === void 0 ? n : a;
3358
3440
  };
3359
3441
  }
3360
- function ge(e, t) {
3361
- return e === L ? t : function() {
3442
+ function _e(e, t) {
3443
+ return e === I ? t : function() {
3362
3444
  e.apply(this, arguments);
3363
3445
  var n = this.onsuccess, r = this.onerror;
3364
- this.onsuccess = this.onerror = null, t.apply(this, arguments), n && (this.onsuccess = this.onsuccess ? me(n, this.onsuccess) : n), r && (this.onerror = this.onerror ? me(r, this.onerror) : r);
3446
+ this.onsuccess = this.onerror = null, t.apply(this, arguments), n && (this.onsuccess = this.onsuccess ? he(n, this.onsuccess) : n), r && (this.onerror = this.onerror ? he(r, this.onerror) : r);
3365
3447
  };
3366
3448
  }
3367
- function _e(e, t) {
3368
- return e === L ? t : function(n) {
3449
+ function ve(e, t) {
3450
+ return e === I ? t : function(n) {
3369
3451
  var r = e.apply(this, arguments);
3370
3452
  o(n, r);
3371
3453
  var i = this.onsuccess, a = this.onerror;
3372
- return this.onsuccess = null, this.onerror = null, n = t.apply(this, arguments), i && (this.onsuccess = this.onsuccess ? me(i, this.onsuccess) : i), a && (this.onerror = this.onerror ? me(a, this.onerror) : a), r === void 0 ? n === void 0 ? void 0 : n : o(r, n);
3454
+ return this.onsuccess = null, this.onerror = null, n = t.apply(this, arguments), i && (this.onsuccess = this.onsuccess ? he(i, this.onsuccess) : i), a && (this.onerror = this.onerror ? he(a, this.onerror) : a), r === void 0 ? n === void 0 ? void 0 : n : o(r, n);
3373
3455
  };
3374
3456
  }
3375
- function ve(e, t) {
3376
- return e === L ? t : function() {
3457
+ function ye(e, t) {
3458
+ return e === I ? t : function() {
3377
3459
  return !1 !== t.apply(this, arguments) && e.apply(this, arguments);
3378
3460
  };
3379
3461
  }
3380
- function ye(e, t) {
3381
- return e === L ? t : function() {
3462
+ function be(e, t) {
3463
+ return e === I ? t : function() {
3382
3464
  var n = e.apply(this, arguments);
3383
3465
  if (n && typeof n.then == "function") {
3384
3466
  for (var r = this, i = arguments.length, a = Array(i); i--;) a[i] = arguments[i];
@@ -3389,12 +3471,12 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
3389
3471
  return t.apply(this, arguments);
3390
3472
  };
3391
3473
  }
3392
- de.ModifyError = oe, de.DexieError = ae, de.BulkError = se;
3393
- var R = typeof location < "u" && /^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);
3394
- function be(e) {
3395
- R = e;
3474
+ fe.ModifyError = se, fe.DexieError = N, fe.BulkError = ce;
3475
+ var L = typeof location < "u" && /^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);
3476
+ function xe(e) {
3477
+ L = e;
3396
3478
  }
3397
- var xe = {}, Se = 100, w = typeof Promise > "u" ? [] : function() {
3479
+ var Se = {}, Ce = 100, w = typeof Promise > "u" ? [] : function() {
3398
3480
  var e = Promise.resolve();
3399
3481
  if (typeof crypto > "u" || !crypto.subtle) return [
3400
3482
  e,
@@ -3407,25 +3489,25 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
3407
3489
  s(t),
3408
3490
  e
3409
3491
  ];
3410
- }(), N = w[0], P = w[1], w = w[2], P = P && P.then, Ce = N && N.constructor, we = !!w, Te = function(e, t) {
3411
- Me.push([e, t]), De &&= (queueMicrotask(Ve), !1);
3412
- }, Ee = !0, De = !0, Oe = [], ke = [], Ae = fe, je = {
3492
+ }(), j = w[0], M = w[1], w = w[2], M = M && M.then, we = j && j.constructor, Te = !!w, Ee = function(e, t) {
3493
+ Ne.push([e, t]), Oe &&= (queueMicrotask(He), !1);
3494
+ }, De = !0, Oe = !0, ke = [], Ae = [], je = pe, Me = {
3413
3495
  id: "global",
3414
3496
  global: !0,
3415
3497
  ref: 0,
3416
3498
  unhandleds: [],
3417
- onunhandled: L,
3499
+ onunhandled: I,
3418
3500
  pgp: !1,
3419
3501
  env: {},
3420
- finalize: L
3421
- }, z = je, Me = [], Ne = 0, Pe = [];
3422
- function B(e) {
3502
+ finalize: I
3503
+ }, R = Me, Ne = [], Pe = 0, Fe = [];
3504
+ function z(e) {
3423
3505
  if (typeof this != "object") throw TypeError("Promises must be constructed via new");
3424
3506
  this._listeners = [], this._lib = !1;
3425
- var t = this._PSD = z;
3507
+ var t = this._PSD = R;
3426
3508
  if (typeof e != "function") {
3427
- if (e !== xe) throw TypeError("Not a function");
3428
- this._state = arguments[1], this._value = arguments[2], !1 === this._state && Le(this, this._value);
3509
+ if (e !== Se) throw TypeError("Not a function");
3510
+ this._state = arguments[1], this._value = arguments[2], !1 === this._state && Re(this, this._value);
3429
3511
  return;
3430
3512
  }
3431
3513
  this._state = null, this._value = null, ++t.ref, function e(t, n) {
@@ -3433,236 +3515,236 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
3433
3515
  n(function(n) {
3434
3516
  if (t._state === null) {
3435
3517
  if (n === t) throw TypeError("A promise cannot be resolved with itself.");
3436
- var r = t._lib && He();
3518
+ var r = t._lib && Ue();
3437
3519
  n && typeof n.then == "function" ? e(t, function(e, t) {
3438
- n instanceof B ? n._then(e, t) : n.then(e, t);
3439
- }) : (t._state = !0, t._value = n, Re(t)), r && Ue();
3520
+ n instanceof z ? n._then(e, t) : n.then(e, t);
3521
+ }) : (t._state = !0, t._value = n, ze(t)), r && We();
3440
3522
  }
3441
- }, Le.bind(null, t));
3523
+ }, Re.bind(null, t));
3442
3524
  } catch (e) {
3443
- Le(t, e);
3525
+ Re(t, e);
3444
3526
  }
3445
3527
  }(this, e);
3446
3528
  }
3447
- var Fe = {
3529
+ var Ie = {
3448
3530
  get: function() {
3449
- var e = z, t = Ye;
3531
+ var e = R, t = Xe;
3450
3532
  function n(n, r) {
3451
- var i = this, a = !e.global && (e !== z || t !== Ye), o = a && !U(), s = new B(function(t, s) {
3452
- ze(i, new Ie(rt(n, e, a, o), rt(r, e, a, o), t, s, e));
3533
+ var i = this, a = !e.global && (e !== R || t !== Xe), o = a && !H(), s = new z(function(t, s) {
3534
+ Be(i, new Le(rt(n, e, a, o), rt(r, e, a, o), t, s, e));
3453
3535
  });
3454
3536
  return this._consoleTask && (s._consoleTask = this._consoleTask), s;
3455
3537
  }
3456
- return n.prototype = xe, n;
3538
+ return n.prototype = Se, n;
3457
3539
  },
3458
3540
  set: function(e) {
3459
- f(this, "then", e && e.prototype === xe ? Fe : {
3541
+ f(this, "then", e && e.prototype === Se ? Ie : {
3460
3542
  get: function() {
3461
3543
  return e;
3462
3544
  },
3463
- set: Fe.set
3545
+ set: Ie.set
3464
3546
  });
3465
3547
  }
3466
3548
  };
3467
- function Ie(e, t, n, r, i) {
3549
+ function Le(e, t, n, r, i) {
3468
3550
  this.onFulfilled = typeof e == "function" ? e : null, this.onRejected = typeof t == "function" ? t : null, this.resolve = n, this.reject = r, this.psd = i;
3469
3551
  }
3470
- function Le(e, t) {
3552
+ function Re(e, t) {
3471
3553
  var n, r;
3472
- ke.push(t), e._state === null && (n = e._lib && He(), t = Ae(t), e._state = !1, e._value = t, r = e, Oe.some(function(e) {
3554
+ Ae.push(t), e._state === null && (n = e._lib && Ue(), t = je(t), e._state = !1, e._value = t, r = e, ke.some(function(e) {
3473
3555
  return e._value === r._value;
3474
- }) || Oe.push(r), Re(e), n && Ue());
3556
+ }) || ke.push(r), ze(e), n && We());
3475
3557
  }
3476
- function Re(e) {
3558
+ function ze(e) {
3477
3559
  var t = e._listeners;
3478
3560
  e._listeners = [];
3479
- for (var n = 0, r = t.length; n < r; ++n) ze(e, t[n]);
3561
+ for (var n = 0, r = t.length; n < r; ++n) Be(e, t[n]);
3480
3562
  var i = e._PSD;
3481
- --i.ref || i.finalize(), Ne === 0 && (++Ne, Te(function() {
3482
- --Ne == 0 && We();
3563
+ --i.ref || i.finalize(), Pe === 0 && (++Pe, Ee(function() {
3564
+ --Pe == 0 && Ge();
3483
3565
  }, []));
3484
3566
  }
3485
- function ze(e, t) {
3567
+ function Be(e, t) {
3486
3568
  if (e._state !== null) {
3487
3569
  var n = e._state ? t.onFulfilled : t.onRejected;
3488
3570
  if (n === null) return (e._state ? t.resolve : t.reject)(e._value);
3489
- ++t.psd.ref, ++Ne, Te(Be, [
3571
+ ++t.psd.ref, ++Pe, Ee(Ve, [
3490
3572
  n,
3491
3573
  e,
3492
3574
  t
3493
3575
  ]);
3494
3576
  } else e._listeners.push(t);
3495
3577
  }
3496
- function Be(e, t, n) {
3578
+ function Ve(e, t, n) {
3497
3579
  try {
3498
3580
  var r, i = t._value;
3499
- !t._state && ke.length && (ke = []), r = R && t._consoleTask ? t._consoleTask.run(function() {
3581
+ !t._state && Ae.length && (Ae = []), r = L && t._consoleTask ? t._consoleTask.run(function() {
3500
3582
  return e(i);
3501
- }) : e(i), t._state || ke.indexOf(i) !== -1 || function(e) {
3502
- for (var t = Oe.length; t;) if (Oe[--t]._value === e._value) return Oe.splice(t, 1);
3583
+ }) : e(i), t._state || Ae.indexOf(i) !== -1 || function(e) {
3584
+ for (var t = ke.length; t;) if (ke[--t]._value === e._value) return ke.splice(t, 1);
3503
3585
  }(t), n.resolve(r);
3504
3586
  } catch (e) {
3505
3587
  n.reject(e);
3506
3588
  } finally {
3507
- --Ne == 0 && We(), --n.psd.ref || n.psd.finalize();
3589
+ --Pe == 0 && Ge(), --n.psd.ref || n.psd.finalize();
3508
3590
  }
3509
3591
  }
3510
- function Ve() {
3511
- nt(je, function() {
3512
- He() && Ue();
3513
- });
3514
- }
3515
3592
  function He() {
3516
- var e = Ee;
3517
- return De = Ee = !1, e;
3593
+ W(Me, function() {
3594
+ Ue() && We();
3595
+ });
3518
3596
  }
3519
3597
  function Ue() {
3598
+ var e = De;
3599
+ return Oe = De = !1, e;
3600
+ }
3601
+ function We() {
3520
3602
  var e, t, n;
3521
3603
  do
3522
- for (; 0 < Me.length;) for (e = Me, Me = [], n = e.length, t = 0; t < n; ++t) {
3604
+ for (; 0 < Ne.length;) for (e = Ne, Ne = [], n = e.length, t = 0; t < n; ++t) {
3523
3605
  var r = e[t];
3524
3606
  r[0].apply(null, r[1]);
3525
3607
  }
3526
- while (0 < Me.length);
3527
- De = Ee = !0;
3608
+ while (0 < Ne.length);
3609
+ Oe = De = !0;
3528
3610
  }
3529
- function We() {
3530
- var e = Oe;
3531
- Oe = [], e.forEach(function(e) {
3611
+ function Ge() {
3612
+ var e = ke;
3613
+ ke = [], e.forEach(function(e) {
3532
3614
  e._PSD.onunhandled.call(null, e._value, e);
3533
3615
  });
3534
- for (var t = Pe.slice(0), n = t.length; n;) t[--n]();
3616
+ for (var t = Fe.slice(0), n = t.length; n;) t[--n]();
3535
3617
  }
3536
- function Ge(e) {
3537
- return new B(xe, !1, e);
3618
+ function Ke(e) {
3619
+ return new z(Se, !1, e);
3538
3620
  }
3539
- function V(e, t) {
3540
- var n = z;
3621
+ function B(e, t) {
3622
+ var n = R;
3541
3623
  return function() {
3542
- var r = He(), i = z;
3624
+ var r = Ue(), i = R;
3543
3625
  try {
3544
- return W(n, !0), e.apply(this, arguments);
3626
+ return U(n, !0), e.apply(this, arguments);
3545
3627
  } catch (e) {
3546
3628
  t && t(e);
3547
3629
  } finally {
3548
- W(i, !1), r && Ue();
3630
+ U(i, !1), r && We();
3549
3631
  }
3550
3632
  };
3551
3633
  }
3552
- u(B.prototype, {
3553
- then: Fe,
3634
+ u(z.prototype, {
3635
+ then: Ie,
3554
3636
  _then: function(e, t) {
3555
- ze(this, new Ie(null, null, e, t, z));
3637
+ Be(this, new Le(null, null, e, t, R));
3556
3638
  },
3557
3639
  catch: function(e) {
3558
3640
  if (arguments.length === 1) return this.then(null, e);
3559
3641
  var t = e, n = arguments[1];
3560
3642
  return typeof t == "function" ? this.then(null, function(e) {
3561
- return (e instanceof t ? n : Ge)(e);
3643
+ return (e instanceof t ? n : Ke)(e);
3562
3644
  }) : this.then(null, function(e) {
3563
- return (e && e.name === t ? n : Ge)(e);
3645
+ return (e && e.name === t ? n : Ke)(e);
3564
3646
  });
3565
3647
  },
3566
3648
  finally: function(e) {
3567
3649
  return this.then(function(t) {
3568
- return B.resolve(e()).then(function() {
3650
+ return z.resolve(e()).then(function() {
3569
3651
  return t;
3570
3652
  });
3571
3653
  }, function(t) {
3572
- return B.resolve(e()).then(function() {
3573
- return Ge(t);
3654
+ return z.resolve(e()).then(function() {
3655
+ return Ke(t);
3574
3656
  });
3575
3657
  });
3576
3658
  },
3577
3659
  timeout: function(e, t) {
3578
3660
  var n = this;
3579
- return e < Infinity ? new B(function(r, i) {
3661
+ return e < Infinity ? new z(function(r, i) {
3580
3662
  var a = setTimeout(function() {
3581
- return i(new I.Timeout(t));
3663
+ return i(new F.Timeout(t));
3582
3664
  }, e);
3583
3665
  n.then(r, i).finally(clearTimeout.bind(null, a));
3584
3666
  }) : this;
3585
3667
  }
3586
- }), typeof Symbol < "u" && Symbol.toStringTag && f(B.prototype, Symbol.toStringTag, "Dexie.Promise"), je.env = tt(), u(B, {
3668
+ }), typeof Symbol < "u" && Symbol.toStringTag && f(z.prototype, Symbol.toStringTag, "Dexie.Promise"), Me.env = nt(), u(z, {
3587
3669
  all: function() {
3588
- var e = j.apply(null, arguments).map($e);
3589
- return new B(function(t, n) {
3670
+ var e = A.apply(null, arguments).map(et);
3671
+ return new z(function(t, n) {
3590
3672
  e.length === 0 && t([]);
3591
3673
  var r = e.length;
3592
3674
  e.forEach(function(i, a) {
3593
- return B.resolve(i).then(function(n) {
3675
+ return z.resolve(i).then(function(n) {
3594
3676
  e[a] = n, --r || t(e);
3595
3677
  }, n);
3596
3678
  });
3597
3679
  });
3598
3680
  },
3599
3681
  resolve: function(e) {
3600
- return e instanceof B ? e : e && typeof e.then == "function" ? new B(function(t, n) {
3682
+ return e instanceof z ? e : e && typeof e.then == "function" ? new z(function(t, n) {
3601
3683
  e.then(t, n);
3602
- }) : new B(xe, !0, e);
3684
+ }) : new z(Se, !0, e);
3603
3685
  },
3604
- reject: Ge,
3686
+ reject: Ke,
3605
3687
  race: function() {
3606
- var e = j.apply(null, arguments).map($e);
3607
- return new B(function(t, n) {
3688
+ var e = A.apply(null, arguments).map(et);
3689
+ return new z(function(t, n) {
3608
3690
  e.map(function(e) {
3609
- return B.resolve(e).then(t, n);
3691
+ return z.resolve(e).then(t, n);
3610
3692
  });
3611
3693
  });
3612
3694
  },
3613
3695
  PSD: {
3614
3696
  get: function() {
3615
- return z;
3697
+ return R;
3616
3698
  },
3617
3699
  set: function(e) {
3618
- return z = e;
3700
+ return R = e;
3619
3701
  }
3620
3702
  },
3621
3703
  totalEchoes: { get: function() {
3622
- return Ye;
3704
+ return Xe;
3623
3705
  } },
3624
- newPSD: Ze,
3625
- usePSD: nt,
3706
+ newPSD: Qe,
3707
+ usePSD: W,
3626
3708
  scheduler: {
3627
3709
  get: function() {
3628
- return Te;
3710
+ return Ee;
3629
3711
  },
3630
3712
  set: function(e) {
3631
- Te = e;
3713
+ Ee = e;
3632
3714
  }
3633
3715
  },
3634
3716
  rejectionMapper: {
3635
3717
  get: function() {
3636
- return Ae;
3718
+ return je;
3637
3719
  },
3638
3720
  set: function(e) {
3639
- Ae = e;
3721
+ je = e;
3640
3722
  }
3641
3723
  },
3642
3724
  follow: function(e, t) {
3643
- return new B(function(n, r) {
3644
- return Ze(function(t, n) {
3645
- var r = z;
3646
- r.unhandleds = [], r.onunhandled = n, r.finalize = me(function() {
3725
+ return new z(function(n, r) {
3726
+ return Qe(function(t, n) {
3727
+ var r = R;
3728
+ r.unhandleds = [], r.onunhandled = n, r.finalize = he(function() {
3647
3729
  var e, r = this;
3648
3730
  e = function() {
3649
3731
  r.unhandleds.length === 0 ? t() : n(r.unhandleds[0]);
3650
- }, Pe.push(function t() {
3651
- e(), Pe.splice(Pe.indexOf(t), 1);
3652
- }), ++Ne, Te(function() {
3653
- --Ne == 0 && We();
3732
+ }, Fe.push(function t() {
3733
+ e(), Fe.splice(Fe.indexOf(t), 1);
3734
+ }), ++Pe, Ee(function() {
3735
+ --Pe == 0 && Ge();
3654
3736
  }, []);
3655
3737
  }, r.finalize), e();
3656
3738
  }, t, n, r);
3657
3739
  });
3658
3740
  }
3659
- }), Ce && (Ce.allSettled && f(B, "allSettled", function() {
3660
- var e = j.apply(null, arguments).map($e);
3661
- return new B(function(t) {
3741
+ }), we && (we.allSettled && f(z, "allSettled", function() {
3742
+ var e = A.apply(null, arguments).map(et);
3743
+ return new z(function(t) {
3662
3744
  e.length === 0 && t([]);
3663
3745
  var n = e.length, r = Array(n);
3664
3746
  e.forEach(function(e, i) {
3665
- return B.resolve(e).then(function(e) {
3747
+ return z.resolve(e).then(function(e) {
3666
3748
  return r[i] = {
3667
3749
  status: "fulfilled",
3668
3750
  value: e
@@ -3677,70 +3759,70 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
3677
3759
  });
3678
3760
  });
3679
3761
  });
3680
- }), Ce.any && typeof AggregateError < "u" && f(B, "any", function() {
3681
- var e = j.apply(null, arguments).map($e);
3682
- return new B(function(t, n) {
3762
+ }), we.any && typeof AggregateError < "u" && f(z, "any", function() {
3763
+ var e = A.apply(null, arguments).map(et);
3764
+ return new z(function(t, n) {
3683
3765
  e.length === 0 && n(/* @__PURE__ */ AggregateError([]));
3684
3766
  var r = e.length, i = Array(r);
3685
3767
  e.forEach(function(e, a) {
3686
- return B.resolve(e).then(function(e) {
3768
+ return z.resolve(e).then(function(e) {
3687
3769
  return t(e);
3688
3770
  }, function(e) {
3689
3771
  i[a] = e, --r || n(AggregateError(i));
3690
3772
  });
3691
3773
  });
3692
3774
  });
3693
- }), Ce.withResolvers && (B.withResolvers = Ce.withResolvers));
3694
- var H = {
3775
+ }), we.withResolvers && (z.withResolvers = we.withResolvers));
3776
+ var V = {
3695
3777
  awaits: 0,
3696
3778
  echoes: 0,
3697
3779
  id: 0
3698
- }, Ke = 0, qe = [], Je = 0, Ye = 0, Xe = 0;
3699
- function Ze(e, t, n, r) {
3700
- var i = z, a = Object.create(i);
3701
- return a.parent = i, a.ref = 0, a.global = !1, a.id = ++Xe, je.env, a.env = we ? {
3702
- Promise: B,
3780
+ }, qe = 0, Je = [], Ye = 0, Xe = 0, Ze = 0;
3781
+ function Qe(e, t, n, r) {
3782
+ var i = R, a = Object.create(i);
3783
+ return a.parent = i, a.ref = 0, a.global = !1, a.id = ++Ze, Me.env, a.env = Te ? {
3784
+ Promise: z,
3703
3785
  PromiseProp: {
3704
- value: B,
3786
+ value: z,
3705
3787
  configurable: !0,
3706
3788
  writable: !0
3707
3789
  },
3708
- all: B.all,
3709
- race: B.race,
3710
- allSettled: B.allSettled,
3711
- any: B.any,
3712
- resolve: B.resolve,
3713
- reject: B.reject
3790
+ all: z.all,
3791
+ race: z.race,
3792
+ allSettled: z.allSettled,
3793
+ any: z.any,
3794
+ resolve: z.resolve,
3795
+ reject: z.reject
3714
3796
  } : {}, t && o(a, t), ++i.ref, a.finalize = function() {
3715
3797
  --this.parent.ref || this.parent.finalize();
3716
- }, r = nt(a, e, n, r), a.ref === 0 && a.finalize(), r;
3798
+ }, r = W(a, e, n, r), a.ref === 0 && a.finalize(), r;
3717
3799
  }
3718
- function Qe() {
3719
- return H.id ||= ++Ke, ++H.awaits, H.echoes += Se, H.id;
3800
+ function $e() {
3801
+ return V.id ||= ++qe, ++V.awaits, V.echoes += Ce, V.id;
3720
3802
  }
3721
- function U() {
3722
- return !!H.awaits && (--H.awaits == 0 && (H.id = 0), H.echoes = H.awaits * Se, !0);
3803
+ function H() {
3804
+ return !!V.awaits && (--V.awaits == 0 && (V.id = 0), V.echoes = V.awaits * Ce, !0);
3723
3805
  }
3724
- function $e(e) {
3725
- return H.echoes && e && e.constructor === Ce ? (Qe(), e.then(function(e) {
3726
- return U(), e;
3806
+ function et(e) {
3807
+ return V.echoes && e && e.constructor === we ? ($e(), e.then(function(e) {
3808
+ return H(), e;
3727
3809
  }, function(e) {
3728
- return U(), G(e);
3810
+ return H(), G(e);
3729
3811
  })) : e;
3730
3812
  }
3731
- function et() {
3732
- var e = qe[qe.length - 1];
3733
- qe.pop(), W(e, !1);
3813
+ function tt() {
3814
+ var e = Je[Je.length - 1];
3815
+ Je.pop(), U(e, !1);
3734
3816
  }
3735
- function W(e, t) {
3736
- var n, i = z;
3737
- (t ? !H.echoes || Je++ && e === z : !Je || --Je && e === z) || queueMicrotask(t ? function(e) {
3738
- ++Ye, H.echoes && --H.echoes != 0 || (H.echoes = H.awaits = H.id = 0), qe.push(z), W(e, !0);
3739
- }.bind(null, e) : et), e !== z && (z = e, i === je && (je.env = tt()), we && (n = je.env.Promise, t = e.env, (i.global || e.global) && (Object.defineProperty(r, "Promise", t.PromiseProp), n.all = t.all, n.race = t.race, n.resolve = t.resolve, n.reject = t.reject, t.allSettled && (n.allSettled = t.allSettled), t.any && (n.any = t.any))));
3817
+ function U(e, t) {
3818
+ var n, i = R;
3819
+ (t ? !V.echoes || Ye++ && e === R : !Ye || --Ye && e === R) || queueMicrotask(t ? function(e) {
3820
+ ++Xe, V.echoes && --V.echoes != 0 || (V.echoes = V.awaits = V.id = 0), Je.push(R), U(e, !0);
3821
+ }.bind(null, e) : tt), e !== R && (R = e, i === Me && (Me.env = nt()), Te && (n = Me.env.Promise, t = e.env, (i.global || e.global) && (Object.defineProperty(r, "Promise", t.PromiseProp), n.all = t.all, n.race = t.race, n.resolve = t.resolve, n.reject = t.reject, t.allSettled && (n.allSettled = t.allSettled), t.any && (n.any = t.any))));
3740
3822
  }
3741
- function tt() {
3823
+ function nt() {
3742
3824
  var e = r.Promise;
3743
- return we ? {
3825
+ return Te ? {
3744
3826
  Promise: e,
3745
3827
  PromiseProp: Object.getOwnPropertyDescriptor(r, "Promise"),
3746
3828
  all: e.all,
@@ -3751,30 +3833,30 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
3751
3833
  reject: e.reject
3752
3834
  } : {};
3753
3835
  }
3754
- function nt(e, t, n, r, i) {
3755
- var a = z;
3836
+ function W(e, t, n, r, i) {
3837
+ var a = R;
3756
3838
  try {
3757
- return W(e, !0), t(n, r, i);
3839
+ return U(e, !0), t(n, r, i);
3758
3840
  } finally {
3759
- W(a, !1);
3841
+ U(a, !1);
3760
3842
  }
3761
3843
  }
3762
3844
  function rt(e, t, n, r) {
3763
3845
  return typeof e == "function" ? function() {
3764
- var i = z;
3765
- n && Qe(), W(t, !0);
3846
+ var i = R;
3847
+ n && $e(), U(t, !0);
3766
3848
  try {
3767
3849
  return e.apply(this, arguments);
3768
3850
  } finally {
3769
- W(i, !1), r && queueMicrotask(U);
3851
+ U(i, !1), r && queueMicrotask(H);
3770
3852
  }
3771
3853
  } : e;
3772
3854
  }
3773
3855
  function it(e) {
3774
- Promise === Ce && H.echoes === 0 ? Je === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
3856
+ Promise === we && V.echoes === 0 ? Ye === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
3775
3857
  }
3776
- ("" + P).indexOf("[native code]") === -1 && (Qe = U = L);
3777
- var G = B.reject, at = "￿", K = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", ot = "String expected.", st = [], ct = "__dbnames", lt = "readonly", ut = "readwrite";
3858
+ ("" + M).indexOf("[native code]") === -1 && ($e = H = I);
3859
+ var G = z.reject, at = "￿", K = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", ot = "String expected.", st = [], ct = "__dbnames", lt = "readonly", ut = "readwrite";
3778
3860
  function dt(e, t) {
3779
3861
  return e ? t ? function() {
3780
3862
  return e.apply(this, arguments) && t.apply(this, arguments);
@@ -3795,7 +3877,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
3795
3877
  };
3796
3878
  }
3797
3879
  function mt() {
3798
- throw I.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.");
3880
+ throw F.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.");
3799
3881
  }
3800
3882
  function q(e, t) {
3801
3883
  try {
@@ -3822,7 +3904,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
3822
3904
  }
3823
3905
  function ht(e) {
3824
3906
  var t = typeof e;
3825
- return t == "object" ? ArrayBuffer.isView(e) ? "binary" : (e = D(e), e === "ArrayBuffer" ? "binary" : e) : t;
3907
+ return t == "object" ? ArrayBuffer.isView(e) ? "binary" : (e = ie(e), e === "ArrayBuffer" ? "binary" : e) : t;
3826
3908
  }
3827
3909
  function gt(e) {
3828
3910
  return e instanceof Uint8Array ? e : ArrayBuffer.isView(e) ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : new Uint8Array(e);
@@ -3838,31 +3920,31 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
3838
3920
  })) : n;
3839
3921
  }
3840
3922
  var vt = (J.prototype._trans = function(e, t, n) {
3841
- var r = this._tx || z.trans, i = this.name, a = R && typeof console < "u" && console.createTask && console.createTask(`Dexie: ${e === "readonly" ? "read" : "write"} ${this.name}`);
3923
+ var r = this._tx || R.trans, i = this.name, a = L && typeof console < "u" && console.createTask && console.createTask(`Dexie: ${e === "readonly" ? "read" : "write"} ${this.name}`);
3842
3924
  function o(e, n, r) {
3843
- if (!r.schema[i]) throw new I.NotFound("Table " + i + " not part of transaction");
3925
+ if (!r.schema[i]) throw new F.NotFound("Table " + i + " not part of transaction");
3844
3926
  return t(r.idbtrans, r);
3845
3927
  }
3846
- var s = He();
3928
+ var s = Ue();
3847
3929
  try {
3848
- var c = r && r.db._novip === this.db._novip ? r === z.trans ? r._promise(e, o, n) : Ze(function() {
3930
+ var c = r && r.db._novip === this.db._novip ? r === R.trans ? r._promise(e, o, n) : Qe(function() {
3849
3931
  return r._promise(e, o, n);
3850
3932
  }, {
3851
3933
  trans: r,
3852
- transless: z.transless || z
3934
+ transless: R.transless || R
3853
3935
  }) : function e(t, n, r, i) {
3854
- if (t.idbdb && (t._state.openComplete || z.letThrough || t._vip)) {
3936
+ if (t.idbdb && (t._state.openComplete || R.letThrough || t._vip)) {
3855
3937
  var a = t._createTransaction(n, r, t._dbSchema);
3856
3938
  try {
3857
3939
  a.create(), t._state.PR1398_maxLoop = 3;
3858
3940
  } catch (a) {
3859
- return a.name === ce.InvalidState && t.isOpen() && 0 < --t._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), t.close({ disableAutoOpen: !1 }), t.open().then(function() {
3941
+ return a.name === le.InvalidState && t.isOpen() && 0 < --t._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), t.close({ disableAutoOpen: !1 }), t.open().then(function() {
3860
3942
  return e(t, n, r, i);
3861
3943
  })) : G(a);
3862
3944
  }
3863
3945
  return a._promise(n, function(e, t) {
3864
- return Ze(function() {
3865
- return z.trans = a, i(e, t, a);
3946
+ return Qe(function() {
3947
+ return R.trans = a, i(e, t, a);
3866
3948
  });
3867
3949
  }).then(function(e) {
3868
3950
  if (n === "readwrite") try {
@@ -3873,10 +3955,10 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
3873
3955
  });
3874
3956
  });
3875
3957
  }
3876
- if (t._state.openComplete) return G(new I.DatabaseClosed(t._state.dbOpenError));
3958
+ if (t._state.openComplete) return G(new F.DatabaseClosed(t._state.dbOpenError));
3877
3959
  if (!t._state.isBeingOpened) {
3878
- if (!t._state.autoOpen) return G(new I.DatabaseClosed());
3879
- t.open().catch(L);
3960
+ if (!t._state.autoOpen) return G(new F.DatabaseClosed());
3961
+ t.open().catch(I);
3880
3962
  }
3881
3963
  return t._state.dbReadyPromise.then(function() {
3882
3964
  return e(t, n, r, i);
@@ -3886,11 +3968,11 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
3886
3968
  return console.trace(e), G(e);
3887
3969
  })), c;
3888
3970
  } finally {
3889
- s && Ue();
3971
+ s && We();
3890
3972
  }
3891
3973
  }, J.prototype.get = function(e, t) {
3892
3974
  var n = this;
3893
- return e && e.constructor === Object ? this.where(e).first(t) : e == null ? G(new I.Type("Invalid argument to Table.get()")) : this._trans("readonly", function(t) {
3975
+ return e && e.constructor === Object ? this.where(e).first(t) : e == null ? G(new F.Type("Invalid argument to Table.get()")) : this._trans("readonly", function(t) {
3894
3976
  return n.core.get({
3895
3977
  trans: t,
3896
3978
  key: e
@@ -3920,7 +4002,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
3920
4002
  return e[t];
3921
4003
  }));
3922
4004
  }
3923
- !n && R && console.warn(`The query ${JSON.stringify(e)} on ${this.name} would benefit from a compound index [${t.join("+")}]`);
4005
+ !n && L && console.warn(`The query ${JSON.stringify(e)} on ${this.name} would benefit from a compound index [${t.join("+")}]`);
3924
4006
  var o = this.schema.idxByName;
3925
4007
  function s(e, t) {
3926
4008
  return q(e, t) === 0;
@@ -4000,7 +4082,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
4000
4082
  values: [o]
4001
4083
  });
4002
4084
  }).then(function(e) {
4003
- return e.numFailures ? B.reject(e.failures[0]) : e.lastResult;
4085
+ return e.numFailures ? z.reject(e.failures[0]) : e.lastResult;
4004
4086
  }).then(function(t) {
4005
4087
  if (a) try {
4006
4088
  x(e, a, t);
@@ -4008,7 +4090,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
4008
4090
  return t;
4009
4091
  });
4010
4092
  }, J.prototype.update = function(e, t) {
4011
- return typeof e != "object" || a(e) ? this.where(":id").equals(e).modify(t) : (e = b(e, this.schema.primKey.keyPath), e === void 0 ? G(new I.InvalidArgument("Given object does not contain its primary key")) : this.where(":id").equals(e).modify(t));
4093
+ return typeof e != "object" || a(e) ? this.where(":id").equals(e).modify(t) : (e = b(e, this.schema.primKey.keyPath), e === void 0 ? G(new F.InvalidArgument("Given object does not contain its primary key")) : this.where(":id").equals(e).modify(t));
4012
4094
  }, J.prototype.put = function(e, t) {
4013
4095
  var n = this, r = this.schema.primKey, i = r.auto, a = r.keyPath, o = e;
4014
4096
  return a && i && (o = pt(a)(e)), this._trans("readwrite", function(e) {
@@ -4019,7 +4101,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
4019
4101
  keys: t == null ? null : [t]
4020
4102
  });
4021
4103
  }).then(function(e) {
4022
- return e.numFailures ? B.reject(e.failures[0]) : e.lastResult;
4104
+ return e.numFailures ? z.reject(e.failures[0]) : e.lastResult;
4023
4105
  }).then(function(t) {
4024
4106
  if (a) try {
4025
4107
  x(e, a, t);
@@ -4036,7 +4118,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
4036
4118
  }).then(function(n) {
4037
4119
  return _t(t, [e], n);
4038
4120
  }).then(function(e) {
4039
- return e.numFailures ? B.reject(e.failures[0]) : void 0;
4121
+ return e.numFailures ? z.reject(e.failures[0]) : void 0;
4040
4122
  });
4041
4123
  });
4042
4124
  }, J.prototype.clear = function() {
@@ -4050,7 +4132,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
4050
4132
  return _t(e, null, t);
4051
4133
  });
4052
4134
  }).then(function(e) {
4053
- return e.numFailures ? B.reject(e.failures[0]) : void 0;
4135
+ return e.numFailures ? z.reject(e.failures[0]) : void 0;
4054
4136
  });
4055
4137
  }, J.prototype.bulkGet = function(e) {
4056
4138
  var t = this;
@@ -4068,8 +4150,8 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
4068
4150
  var r = this, i = Array.isArray(t) ? t : void 0, a = (n ||= i ? void 0 : t) ? n.allKeys : void 0;
4069
4151
  return this._trans("readwrite", function(t) {
4070
4152
  var n = r.schema.primKey, o = n.auto, n = n.keyPath;
4071
- if (n && i) throw new I.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
4072
- if (i && i.length !== e.length) throw new I.InvalidArgument("Arguments objects and keys must have the same length");
4153
+ if (n && i) throw new F.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
4154
+ if (i && i.length !== e.length) throw new F.InvalidArgument("Arguments objects and keys must have the same length");
4073
4155
  var s = e.length, n = n && o ? e.map(pt(n)) : e;
4074
4156
  return r.core.mutate({
4075
4157
  trans: t,
@@ -4080,15 +4162,15 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
4080
4162
  }).then(function(e) {
4081
4163
  var t = e.numFailures, n = e.results, i = e.lastResult, e = e.failures;
4082
4164
  if (t === 0) return a ? n : i;
4083
- throw new se(`${r.name}.bulkAdd(): ${t} of ${s} operations failed`, e);
4165
+ throw new ce(`${r.name}.bulkAdd(): ${t} of ${s} operations failed`, e);
4084
4166
  });
4085
4167
  });
4086
4168
  }, J.prototype.bulkPut = function(e, t, n) {
4087
4169
  var r = this, i = Array.isArray(t) ? t : void 0, a = (n ||= i ? void 0 : t) ? n.allKeys : void 0;
4088
4170
  return this._trans("readwrite", function(t) {
4089
4171
  var n = r.schema.primKey, o = n.auto, n = n.keyPath;
4090
- if (n && i) throw new I.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
4091
- if (i && i.length !== e.length) throw new I.InvalidArgument("Arguments objects and keys must have the same length");
4172
+ if (n && i) throw new F.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
4173
+ if (i && i.length !== e.length) throw new F.InvalidArgument("Arguments objects and keys must have the same length");
4092
4174
  var s = e.length, n = n && o ? e.map(pt(n)) : e;
4093
4175
  return r.core.mutate({
4094
4176
  trans: t,
@@ -4099,7 +4181,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
4099
4181
  }).then(function(e) {
4100
4182
  var t = e.numFailures, n = e.results, i = e.lastResult, e = e.failures;
4101
4183
  if (t === 0) return a ? n : i;
4102
- throw new se(`${r.name}.bulkPut(): ${t} of ${s} operations failed`, e);
4184
+ throw new ce(`${r.name}.bulkPut(): ${t} of ${s} operations failed`, e);
4103
4185
  });
4104
4186
  });
4105
4187
  }, J.prototype.bulkUpdate = function(e) {
@@ -4121,7 +4203,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
4121
4203
  for (var u = 0, d = Object.keys(i); u < d.length; u++) {
4122
4204
  var f = d[u], p = i[f];
4123
4205
  if (f === t.schema.primKey.keyPath) {
4124
- if (q(p, r) !== 0) throw new I.Constraint("Cannot update primary key in bulkUpdate()");
4206
+ if (q(p, r) !== 0) throw new F.Constraint("Cannot update primary key in bulkUpdate()");
4125
4207
  } else x(o, f, p);
4126
4208
  }
4127
4209
  a.push(n), c.push(r), l.push(o);
@@ -4144,7 +4226,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
4144
4226
  var s, c = o[i], l = a[Number(c)];
4145
4227
  l != null && (s = r[c], delete r[c], r[l] = s);
4146
4228
  }
4147
- throw new se(`${t.name}.bulkUpdate(): ${n} of ${u} operations failed`, r);
4229
+ throw new ce(`${t.name}.bulkUpdate(): ${n} of ${u} operations failed`, r);
4148
4230
  });
4149
4231
  });
4150
4232
  });
@@ -4161,7 +4243,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
4161
4243
  }).then(function(e) {
4162
4244
  var r = e.numFailures, i = e.lastResult, e = e.failures;
4163
4245
  if (r === 0) return i;
4164
- throw new se(`${t.name}.bulkDelete(): ${r} of ${n} operations failed`, e);
4246
+ throw new ce(`${t.name}.bulkDelete(): ${r} of ${n} operations failed`, e);
4165
4247
  });
4166
4248
  }, J);
4167
4249
  function J() {}
@@ -4180,10 +4262,10 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
4180
4262
  function s(e, r, o) {
4181
4263
  if (typeof e != "object") {
4182
4264
  var c;
4183
- r ||= ve;
4265
+ r ||= ye;
4184
4266
  var l = {
4185
4267
  subscribers: [],
4186
- fire: o ||= L,
4268
+ fire: o ||= I,
4187
4269
  subscribe: function(e) {
4188
4270
  l.subscribers.indexOf(e) === -1 && (l.subscribers.push(e), l.fire = r(l.fire, e));
4189
4271
  },
@@ -4199,8 +4281,8 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
4199
4281
  var t = c[e];
4200
4282
  if (a(t)) s(e, c[e][0], c[e][1]);
4201
4283
  else {
4202
- if (t !== "asap") throw new I.InvalidArgument("Invalid event config");
4203
- var n = s(e, fe, function() {
4284
+ if (t !== "asap") throw new F.InvalidArgument("Invalid event config");
4285
+ var n = s(e, pe, function() {
4204
4286
  for (var e = arguments.length, t = Array(e); e--;) t[e] = arguments[e];
4205
4287
  n.subscribers.forEach(function(e) {
4206
4288
  y(function() {
@@ -4230,7 +4312,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
4230
4312
  function wt(e, t) {
4231
4313
  if (e.isPrimKey) return t.primaryKey;
4232
4314
  var n = t.getIndexByKeyPath(e.index);
4233
- if (!n) throw new I.Schema("KeyPath " + e.index + " on object store " + t.name + " is not indexed");
4315
+ if (!n) throw new F.Schema("KeyPath " + e.index + " on object store " + t.name + " is not indexed");
4234
4316
  return n;
4235
4317
  }
4236
4318
  function Tt(e, t, n) {
@@ -4262,7 +4344,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
4262
4344
  return Dt(Tt(e, r, n), dt(e.algorithm, i), t, !e.keysOnly && e.valueMapper);
4263
4345
  }
4264
4346
  function Dt(e, t, n, r) {
4265
- var i = V(r ? function(e, t, i) {
4347
+ var i = B(r ? function(e, t, i) {
4266
4348
  return n(r(e), t, i);
4267
4349
  } : n);
4268
4350
  return e.then(function(e) {
@@ -4273,9 +4355,9 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
4273
4355
  t && !t(e, function(e) {
4274
4356
  return n = e;
4275
4357
  }, function(t) {
4276
- e.stop(t), n = L;
4358
+ e.stop(t), n = I;
4277
4359
  }, function(t) {
4278
- e.fail(t), n = L;
4360
+ e.fail(t), n = I;
4279
4361
  }) || i(e.value, e, function(e) {
4280
4362
  return n = e;
4281
4363
  }), n();
@@ -4573,7 +4655,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
4573
4655
  range: n.range
4574
4656
  };
4575
4657
  return i(0).then(function() {
4576
- if (0 < m.length) throw new oe("Error modifying one or more objects", m, h, g);
4658
+ if (0 < m.length) throw new se("Error modifying one or more objects", m, h, g);
4577
4659
  return t.length;
4578
4660
  });
4579
4661
  });
@@ -4595,7 +4677,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
4595
4677
  range: i
4596
4678
  }).then(function(e) {
4597
4679
  var n = e.failures, e = e.numFailures;
4598
- if (e) throw new oe("Could not delete some values", Object.keys(n).map(function(e) {
4680
+ if (e) throw new se("Could not delete some values", Object.keys(n).map(function(e) {
4599
4681
  return n[e];
4600
4682
  }), t - e);
4601
4683
  return t - e;
@@ -4739,19 +4821,19 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
4739
4821
  return e === t[0];
4740
4822
  }, [e], "");
4741
4823
  }, Z.prototype.anyOfIgnoreCase = function() {
4742
- var e = j.apply(A, arguments);
4824
+ var e = A.apply(k, arguments);
4743
4825
  return e.length === 0 ? Pt(this) : Ft(this, function(e, t) {
4744
4826
  return t.indexOf(e) !== -1;
4745
4827
  }, e, "");
4746
4828
  }, Z.prototype.startsWithAnyOfIgnoreCase = function() {
4747
- var e = j.apply(A, arguments);
4829
+ var e = A.apply(k, arguments);
4748
4830
  return e.length === 0 ? Pt(this) : Ft(this, function(e, t) {
4749
4831
  return t.some(function(t) {
4750
4832
  return e.indexOf(t) === 0;
4751
4833
  });
4752
4834
  }, e, at);
4753
4835
  }, Z.prototype.anyOf = function() {
4754
- var e = this, t = j.apply(A, arguments), n = this._cmp;
4836
+ var e = this, t = A.apply(k, arguments), n = this._cmp;
4755
4837
  try {
4756
4838
  t.sort(n);
4757
4839
  } catch {
@@ -4777,7 +4859,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
4777
4859
  includeUppers: !1
4778
4860
  });
4779
4861
  }, Z.prototype.noneOf = function() {
4780
- var e = j.apply(A, arguments);
4862
+ var e = A.apply(k, arguments);
4781
4863
  if (e.length === 0) return new this.Collection(this);
4782
4864
  try {
4783
4865
  e.sort(this._ascending);
@@ -4796,7 +4878,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
4796
4878
  if (e.length === 0) return Pt(this);
4797
4879
  if (!e.every(function(e) {
4798
4880
  return e[0] !== void 0 && e[1] !== void 0 && i(e[0], e[1]) <= 0;
4799
- })) return X(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", I.InvalidArgument);
4881
+ })) return X(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", F.InvalidArgument);
4800
4882
  var c = !t || !1 !== t.includeLowers, l = t && !0 === t.includeUppers, u, d = i;
4801
4883
  function f(e, t) {
4802
4884
  return d(e[0], t[0]);
@@ -4835,7 +4917,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
4835
4917
  }), !1);
4836
4918
  }), e;
4837
4919
  }, Z.prototype.startsWithAnyOf = function() {
4838
- var e = j.apply(A, arguments);
4920
+ var e = A.apply(k, arguments);
4839
4921
  return e.every(function(e) {
4840
4922
  return typeof e == "string";
4841
4923
  }) ? e.length === 0 ? Pt(this) : this.inAnyRange(e.map(function(e) {
@@ -4844,7 +4926,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
4844
4926
  }, Z);
4845
4927
  function Z() {}
4846
4928
  function zt(e) {
4847
- return V(function(t) {
4929
+ return B(function(t) {
4848
4930
  return Bt(t), e(t.target.error), !1;
4849
4931
  });
4850
4932
  }
@@ -4852,45 +4934,45 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
4852
4934
  e.stopPropagation && e.stopPropagation(), e.preventDefault && e.preventDefault();
4853
4935
  }
4854
4936
  var Vt = "storagemutated", Ht = "x-storagemutated-1", Ut = yt(null, Vt), Wt = (Gt.prototype._lock = function() {
4855
- return v(!z.global), ++this._reculock, this._reculock !== 1 || z.global || (z.lockOwnerFor = this), this;
4937
+ return v(!R.global), ++this._reculock, this._reculock !== 1 || R.global || (R.lockOwnerFor = this), this;
4856
4938
  }, Gt.prototype._unlock = function() {
4857
- if (v(!z.global), --this._reculock == 0) for (z.global || (z.lockOwnerFor = null); 0 < this._blockedFuncs.length && !this._locked();) {
4939
+ if (v(!R.global), --this._reculock == 0) for (R.global || (R.lockOwnerFor = null); 0 < this._blockedFuncs.length && !this._locked();) {
4858
4940
  var e = this._blockedFuncs.shift();
4859
4941
  try {
4860
- nt(e[1], e[0]);
4942
+ W(e[1], e[0]);
4861
4943
  } catch {}
4862
4944
  }
4863
4945
  return this;
4864
4946
  }, Gt.prototype._locked = function() {
4865
- return this._reculock && z.lockOwnerFor !== this;
4947
+ return this._reculock && R.lockOwnerFor !== this;
4866
4948
  }, Gt.prototype.create = function(e) {
4867
4949
  var t = this;
4868
4950
  if (!this.mode) return this;
4869
4951
  var n = this.db.idbdb, r = this.db._state.dbOpenError;
4870
4952
  if (v(!this.idbtrans), !e && !n) switch (r && r.name) {
4871
- case "DatabaseClosedError": throw new I.DatabaseClosed(r);
4872
- case "MissingAPIError": throw new I.MissingAPI(r.message, r);
4873
- default: throw new I.OpenFailed(r);
4953
+ case "DatabaseClosedError": throw new F.DatabaseClosed(r);
4954
+ case "MissingAPIError": throw new F.MissingAPI(r.message, r);
4955
+ default: throw new F.OpenFailed(r);
4874
4956
  }
4875
- if (!this.active) throw new I.TransactionInactive();
4876
- return v(this._completion._state === null), (e = this.idbtrans = e || (this.db.core || n).transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability })).onerror = V(function(n) {
4957
+ if (!this.active) throw new F.TransactionInactive();
4958
+ return v(this._completion._state === null), (e = this.idbtrans = e || (this.db.core || n).transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability })).onerror = B(function(n) {
4877
4959
  Bt(n), t._reject(e.error);
4878
- }), e.onabort = V(function(n) {
4879
- Bt(n), t.active && t._reject(new I.Abort(e.error)), t.active = !1, t.on("abort").fire(n);
4880
- }), e.oncomplete = V(function() {
4960
+ }), e.onabort = B(function(n) {
4961
+ Bt(n), t.active && t._reject(new F.Abort(e.error)), t.active = !1, t.on("abort").fire(n);
4962
+ }), e.oncomplete = B(function() {
4881
4963
  t.active = !1, t._resolve(), "mutatedParts" in e && Ut.storagemutated.fire(e.mutatedParts);
4882
4964
  }), this;
4883
4965
  }, Gt.prototype._promise = function(e, t, n) {
4884
4966
  var r = this;
4885
- if (e === "readwrite" && this.mode !== "readwrite") return G(new I.ReadOnly("Transaction is readonly"));
4886
- if (!this.active) return G(new I.TransactionInactive());
4887
- if (this._locked()) return new B(function(i, a) {
4967
+ if (e === "readwrite" && this.mode !== "readwrite") return G(new F.ReadOnly("Transaction is readonly"));
4968
+ if (!this.active) return G(new F.TransactionInactive());
4969
+ if (this._locked()) return new z(function(i, a) {
4888
4970
  r._blockedFuncs.push([function() {
4889
4971
  r._promise(e, t, n).then(i, a);
4890
- }, z]);
4972
+ }, R]);
4891
4973
  });
4892
- if (n) return Ze(function() {
4893
- var e = new B(function(e, n) {
4974
+ if (n) return Qe(function() {
4975
+ var e = new z(function(e, n) {
4894
4976
  r._lock();
4895
4977
  var i = t(e, n, r);
4896
4978
  i && i.then && i.then(e, n);
@@ -4899,7 +4981,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
4899
4981
  return r._unlock();
4900
4982
  }), e._lib = !0, e;
4901
4983
  });
4902
- var i = new B(function(e, n) {
4984
+ var i = new z(function(e, n) {
4903
4985
  var i = t(e, n, r);
4904
4986
  i && i.then && i.then(e, n);
4905
4987
  });
@@ -4907,7 +4989,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
4907
4989
  }, Gt.prototype._root = function() {
4908
4990
  return this.parent ? this.parent._root() : this;
4909
4991
  }, Gt.prototype.waitFor = function(e) {
4910
- var t, n = this._root(), r = B.resolve(e);
4992
+ var t, n = this._root(), r = z.resolve(e);
4911
4993
  n._waitingFor ? n._waitingFor = n._waitingFor.then(function() {
4912
4994
  return r;
4913
4995
  }) : (n._waitingFor = r, n._waitingQueue = [], t = n.idbtrans.objectStore(n.storeNames[0]), function e() {
@@ -4915,22 +4997,22 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
4915
4997
  n._waitingFor && (t.get(-Infinity).onsuccess = e);
4916
4998
  }());
4917
4999
  var i = n._waitingFor;
4918
- return new B(function(e, t) {
5000
+ return new z(function(e, t) {
4919
5001
  r.then(function(t) {
4920
- return n._waitingQueue.push(V(e.bind(null, t)));
5002
+ return n._waitingQueue.push(B(e.bind(null, t)));
4921
5003
  }, function(e) {
4922
- return n._waitingQueue.push(V(t.bind(null, e)));
5004
+ return n._waitingQueue.push(B(t.bind(null, e)));
4923
5005
  }).finally(function() {
4924
5006
  n._waitingFor === i && (n._waitingFor = null);
4925
5007
  });
4926
5008
  });
4927
5009
  }, Gt.prototype.abort = function() {
4928
- this.active && (this.active = !1, this.idbtrans && this.idbtrans.abort(), this._reject(new I.Abort()));
5010
+ this.active && (this.active = !1, this.idbtrans && this.idbtrans.abort(), this._reject(new F.Abort()));
4929
5011
  }, Gt.prototype.table = function(e) {
4930
5012
  var t = this._memoizedTables ||= {};
4931
5013
  if (l(t, e)) return t[e];
4932
5014
  var n = this.schema[e];
4933
- if (!n) throw new I.NotFound("Table " + e + " not part of transaction");
5015
+ if (!n) throw new F.NotFound("Table " + e + " not part of transaction");
4934
5016
  return n = new this.db.Table(e, n, this), n.core = this.db.core.table(e), t[e] = n;
4935
5017
  }, Gt);
4936
5018
  function Gt() {}
@@ -5006,7 +5088,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
5006
5088
  mutate: function(e) {
5007
5089
  var t = e.trans, i = e.type, a = e.keys, o = e.values, s = e.range;
5008
5090
  return new Promise(function(e, c) {
5009
- e = V(e);
5091
+ e = B(e);
5010
5092
  var l = t.objectStore(n), u = l.keyPath == null, d = i === "put" || i === "add";
5011
5093
  if (!d && i !== "delete" && i !== "deleteRange") throw Error("Invalid operation type: " + i);
5012
5094
  var f, p = (a || o || { length: 1 }).length;
@@ -5054,7 +5136,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
5054
5136
  getMany: function(e) {
5055
5137
  var t = e.trans, r = e.keys;
5056
5138
  return new Promise(function(e, i) {
5057
- e = V(e);
5139
+ e = B(e);
5058
5140
  for (var a, o = t.objectStore(n), s = r.length, c = Array(s), l = 0, u = 0, d = function(t) {
5059
5141
  t = t.target, c[t._pos] = t.result, ++u === l && e(c);
5060
5142
  }, f = zt(i), p = 0; p < s; ++p) r[p] != null && ((a = o.get(r[p]))._pos = p, a.onsuccess = d, a.onerror = f, ++l);
@@ -5064,7 +5146,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
5064
5146
  get: function(e) {
5065
5147
  var t = e.trans, r = e.key;
5066
5148
  return new Promise(function(e, i) {
5067
- e = V(e);
5149
+ e = B(e);
5068
5150
  var a = t.objectStore(n).get(r);
5069
5151
  a.onsuccess = function(t) {
5070
5152
  return e(t.target.result);
@@ -5073,7 +5155,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
5073
5155
  },
5074
5156
  query: (t = u, function(e) {
5075
5157
  return new Promise(function(i, a) {
5076
- i = V(i);
5158
+ i = B(i);
5077
5159
  var o, s, c, l = e.trans, u = e.values, d = e.limit, f = e.query, p = d === Infinity ? void 0 : d, m = f.index, f = f.range, l = l.objectStore(n), m = m.isPrimaryKey ? l : l.index(m.name), f = r(f);
5078
5160
  if (d === 0) return i({ result: [] });
5079
5161
  t ? ((p = u ? m.getAll(f, p) : m.getAllKeys(f, p)).onsuccess = function(e) {
@@ -5087,15 +5169,15 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
5087
5169
  openCursor: function(e) {
5088
5170
  var t = e.trans, i = e.values, a = e.query, o = e.reverse, s = e.unique;
5089
5171
  return new Promise(function(e, c) {
5090
- e = V(e);
5172
+ e = B(e);
5091
5173
  var l = a.index, u = a.range, d = t.objectStore(n), d = l.isPrimaryKey ? d : d.index(l.name), l = o ? s ? "prevunique" : "prev" : s ? "nextunique" : "next", f = !i && "openKeyCursor" in d ? d.openKeyCursor(r(u), l) : d.openCursor(r(u), l);
5092
- f.onerror = zt(c), f.onsuccess = V(function(n) {
5174
+ f.onerror = zt(c), f.onsuccess = B(function(n) {
5093
5175
  var r, i, a, o, s = f.result;
5094
5176
  s ? (s.___id = ++Qt, s.done = !1, r = s.continue.bind(s), i = (i = s.continuePrimaryKey) && i.bind(s), a = s.advance.bind(s), o = function() {
5095
5177
  throw Error("Cursor not stopped");
5096
5178
  }, s.trans = t, s.stop = s.continue = s.continuePrimaryKey = s.advance = function() {
5097
5179
  throw Error("Cursor not started");
5098
- }, s.fail = V(c), s.next = function() {
5180
+ }, s.fail = B(c), s.next = function() {
5099
5181
  var e = this, t = 1;
5100
5182
  return this.start(function() {
5101
5183
  return t-- ? e.continue() : e.stop();
@@ -5114,11 +5196,11 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
5114
5196
  }, s.stop();
5115
5197
  }
5116
5198
  var n = new Promise(function(e, t) {
5117
- e = V(e), f.onerror = zt(t), s.fail = t, s.stop = function(t) {
5199
+ e = B(e), f.onerror = zt(t), s.fail = t, s.stop = function(t) {
5118
5200
  s.stop = s.continue = s.continuePrimaryKey = s.advance = o, e(t);
5119
5201
  };
5120
5202
  });
5121
- return f.onsuccess = V(function(e) {
5203
+ return f.onsuccess = B(function(e) {
5122
5204
  f.onsuccess = t, t();
5123
5205
  }), s.continue = r, s.continuePrimaryKey = i, s.advance = a, t(), n;
5124
5206
  }, e(s)) : e(null);
@@ -5129,7 +5211,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
5129
5211
  var t = e.query, i = e.trans, a = t.index, o = t.range;
5130
5212
  return new Promise(function(e, t) {
5131
5213
  var s = i.objectStore(n), c = a.isPrimaryKey ? s : s.index(a.name), s = r(o), c = s ? c.count(s) : c.count();
5132
- c.onsuccess = V(function(t) {
5214
+ c.onsuccess = B(function(t) {
5133
5215
  return e(t.target.result);
5134
5216
  }), c.onerror = zt(t);
5135
5217
  });
@@ -5241,18 +5323,18 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
5241
5323
  n.objectStoreNames.contains("$meta") && !a.$meta && (a.$meta = Jt("$meta", hn("")[0], []), e._storeNames.push("$meta"));
5242
5324
  var o = e._createTransaction("readwrite", e._storeNames, a);
5243
5325
  o.create(n), o._completion.catch(r);
5244
- var s = o._reject.bind(o), c = z.transless || z;
5245
- Ze(function() {
5246
- return z.trans = o, z.transless = c, t === 0 ? (i(a).forEach(function(e) {
5326
+ var s = o._reject.bind(o), c = R.transless || R;
5327
+ Qe(function() {
5328
+ return R.trans = o, R.transless = c, t === 0 ? (i(a).forEach(function(e) {
5247
5329
  un(n, e, a[e].primKey, a[e].indexes);
5248
- }), nn(e, n), void B.follow(function() {
5330
+ }), nn(e, n), void z.follow(function() {
5249
5331
  return e.on.populate.fire(o);
5250
5332
  }).catch(s)) : (nn(e, n), l = t, ((r = o).storeNames.includes("$meta") ? r.table("$meta").get("version").then(function(e) {
5251
5333
  return e ?? l;
5252
- }) : B.resolve(l)).then(function(t) {
5334
+ }) : z.resolve(l)).then(function(t) {
5253
5335
  return a = t, s = o, c = n, l = [], t = (r = e)._versions, u = r._dbSchema = pn(0, r.idbdb, c), (t = t.filter(function(e) {
5254
5336
  return e._cfg.version >= a;
5255
- })).length === 0 ? B.resolve() : (t.forEach(function(e) {
5337
+ })).length === 0 ? z.resolve() : (t.forEach(function(e) {
5256
5338
  l.push(function() {
5257
5339
  var t = u, n = e._cfg.dbschema;
5258
5340
  mn(r, t, c), mn(r, n, c), u = r._dbSchema = n;
@@ -5260,7 +5342,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
5260
5342
  o.add.forEach(function(e) {
5261
5343
  un(c, e[0], e[1].primKey, e[1].indexes);
5262
5344
  }), o.change.forEach(function(e) {
5263
- if (e.recreate) throw new I.Upgrade("Not yet support for changing primary key");
5345
+ if (e.recreate) throw new F.Upgrade("Not yet support for changing primary key");
5264
5346
  var t = c.objectStore(e.name);
5265
5347
  e.add.forEach(function(e) {
5266
5348
  return fn(t, e);
@@ -5277,11 +5359,11 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
5277
5359
  o.del.forEach(function(e) {
5278
5360
  d[e] = t[e];
5279
5361
  }), an(r, [r.Transaction.prototype]), rn(r, [r.Transaction.prototype], i(d), d), s.schema = d;
5280
- var f, p = M(l);
5281
- return p && Qe(), o = B.follow(function() {
5362
+ var f, p = ae(l);
5363
+ return p && $e(), o = z.follow(function() {
5282
5364
  var e;
5283
- (f = l(s)) && p && (e = U.bind(null, null), f.then(e, e));
5284
- }), f && typeof f.then == "function" ? B.resolve(f) : o.then(function() {
5365
+ (f = l(s)) && p && (e = H.bind(null, null), f.then(e, e));
5366
+ }), f && typeof f.then == "function" ? z.resolve(f) : o.then(function() {
5285
5367
  return f;
5286
5368
  });
5287
5369
  }
@@ -5296,7 +5378,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
5296
5378
  })) : t.objectStore("$meta").put(e._cfg.version, "version"));
5297
5379
  });
5298
5380
  }), function e() {
5299
- return l.length ? B.resolve(l.shift()(s.idbtrans)).then(e) : B.resolve();
5381
+ return l.length ? z.resolve(l.shift()(s.idbtrans)).then(e) : z.resolve();
5300
5382
  }().then(function() {
5301
5383
  dn(u, c);
5302
5384
  }));
@@ -5314,7 +5396,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
5314
5396
  if (e.change.length || e.recreate) return console.warn(`Unable to patch indexes of table ${e.name} because it has changes on the type of index or primary key.`), { value: void 0 };
5315
5397
  var n = t.objectStore(e.name);
5316
5398
  e.add.forEach(function(t) {
5317
- R && console.debug(`Dexie upgrade patch: Creating missing index ${e.name}.${t.src}`), fn(n, t);
5399
+ L && console.debug(`Dexie upgrade patch: Creating missing index ${e.name}.${t.src}`), fn(n, t);
5318
5400
  });
5319
5401
  }(i[r]);
5320
5402
  if (typeof a == "object") return a.value;
@@ -5363,7 +5445,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
5363
5445
  }
5364
5446
  function dn(e, t) {
5365
5447
  i(e).forEach(function(n) {
5366
- t.db.objectStoreNames.contains(n) || (R && console.debug("Dexie: Creating missing table", n), un(t, n, e[n].primKey, e[n].indexes));
5448
+ t.db.objectStoreNames.contains(n) || (L && console.debug("Dexie: Creating missing table", n), un(t, n, e[n].primKey, e[n].indexes));
5367
5449
  });
5368
5450
  }
5369
5451
  function fn(e, t) {
@@ -5404,11 +5486,11 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
5404
5486
  i(e).forEach(function(r) {
5405
5487
  if (e[r] !== null) {
5406
5488
  var i = n._parseIndexSyntax(e[r]), a = i.shift();
5407
- if (!a) throw new I.Schema("Invalid schema for table " + r + ": " + e[r]);
5408
- if (a.unique = !0, a.multi) throw new I.Schema("Primary key cannot be multiEntry*");
5489
+ if (!a) throw new F.Schema("Invalid schema for table " + r + ": " + e[r]);
5490
+ if (a.unique = !0, a.multi) throw new F.Schema("Primary key cannot be multiEntry*");
5409
5491
  i.forEach(function(e) {
5410
- if (e.auto) throw new I.Schema("Only primary key can be marked as autoIncrement (++)");
5411
- if (!e.keyPath) throw new I.Schema("Index must have a name and cannot be an empty string");
5492
+ if (e.auto) throw new F.Schema("Only primary key can be marked as autoIncrement (++)");
5493
+ if (!e.keyPath) throw new F.Schema("Index must have a name and cannot be an empty string");
5412
5494
  }), i = n._createTableSchema(r, a, i), t[r] = i;
5413
5495
  }
5414
5496
  });
@@ -5429,7 +5511,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
5429
5511
  this._cfg.tables
5430
5512
  ], i(r), r), t._storeNames = i(r), this;
5431
5513
  }, _n.prototype.upgrade = function(e) {
5432
- return this._cfg.contentUpgrade = ye(this._cfg.contentUpgrade || L, e), this;
5514
+ return this._cfg.contentUpgrade = be(this._cfg.contentUpgrade || I, e), this;
5433
5515
  }, _n);
5434
5516
  function _n() {}
5435
5517
  function vn(e, t) {
@@ -5444,8 +5526,8 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
5444
5526
  return e && typeof e.databases == "function";
5445
5527
  }
5446
5528
  function bn(e) {
5447
- return Ze(function() {
5448
- return z.letThrough = !0, e();
5529
+ return Qe(function() {
5530
+ return R.letThrough = !0, e();
5449
5531
  });
5450
5532
  }
5451
5533
  function xn(e) {
@@ -5560,7 +5642,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
5560
5642
  return t[n] && wn(t[n], e[n]);
5561
5643
  });
5562
5644
  }
5563
- u(Q.prototype, ((P = {
5645
+ u(Q.prototype, ((M = {
5564
5646
  add: function(e) {
5565
5647
  return Cn(this, e), this;
5566
5648
  },
@@ -5577,9 +5659,9 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
5577
5659
  var t = Tn(this).next(e).value;
5578
5660
  return t && q(t.from, e) <= 0 && 0 <= q(t.to, e);
5579
5661
  }
5580
- })[re] = function() {
5662
+ })[E] = function() {
5581
5663
  return Tn(this);
5582
- }, P));
5664
+ }, M));
5583
5665
  var An = {}, jn = {}, Mn = !1;
5584
5666
  function Nn(e) {
5585
5667
  On(jn, e), Mn || (Mn = !0, setTimeout(function() {
@@ -5621,19 +5703,19 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
5621
5703
  t.isBeingOpened = !0, t.dbOpenError = null, t.openComplete = !1;
5622
5704
  var r = t.openCanceller, a = Math.round(10 * e.verno), o = !1;
5623
5705
  function s() {
5624
- if (t.openCanceller !== r) throw new I.DatabaseClosed("db.open() was cancelled");
5706
+ if (t.openCanceller !== r) throw new F.DatabaseClosed("db.open() was cancelled");
5625
5707
  }
5626
5708
  function c() {
5627
- return new B(function(r, l) {
5628
- if (s(), !n) throw new I.MissingAPI();
5709
+ return new z(function(r, l) {
5710
+ if (s(), !n) throw new F.MissingAPI();
5629
5711
  var u = e.name, p = t.autoSchema || !a ? n.open(u) : n.open(u, a);
5630
- if (!p) throw new I.MissingAPI();
5631
- p.onerror = zt(l), p.onblocked = V(e._fireOnBlocked), p.onupgradeneeded = V(function(r) {
5712
+ if (!p) throw new F.MissingAPI();
5713
+ p.onerror = zt(l), p.onblocked = B(e._fireOnBlocked), p.onupgradeneeded = B(function(r) {
5632
5714
  var i;
5633
- d = p.transaction, t.autoSchema && !e._options.allowEmptyDB ? (p.onerror = Bt, d.abort(), p.result.close(), (i = n.deleteDatabase(u)).onsuccess = i.onerror = V(function() {
5634
- l(new I.NoSuchDatabase(`Database ${u} doesnt exist`));
5715
+ d = p.transaction, t.autoSchema && !e._options.allowEmptyDB ? (p.onerror = Bt, d.abort(), p.result.close(), (i = n.deleteDatabase(u)).onsuccess = i.onerror = B(function() {
5716
+ l(new F.NoSuchDatabase(`Database ${u} doesnt exist`));
5635
5717
  })) : (d.onerror = zt(l), r = r.oldVersion > 2 ** 62 ? 0 : r.oldVersion, f = r < 1, e.idbdb = p.result, o && cn(e, d), sn(e, r / 10, d, l));
5636
- }, l), p.onsuccess = V(function() {
5718
+ }, l), p.onsuccess = B(function() {
5637
5719
  d = null;
5638
5720
  var n, s, l, m, h, _ = e.idbdb = p.result, v = g(_.objectStoreNames);
5639
5721
  if (0 < v.length) try {
@@ -5644,11 +5726,11 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
5644
5726
  })) && !o) 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."), _.close(), a = _.version + 1, o = !0, r(c());
5645
5727
  nn(e, y);
5646
5728
  } catch {}
5647
- st.push(e), _.onversionchange = V(function(n) {
5729
+ st.push(e), _.onversionchange = B(function(n) {
5648
5730
  t.vcFired = !0, e.on("versionchange").fire(n);
5649
- }), _.onclose = V(function(t) {
5731
+ }), _.onclose = B(function(t) {
5650
5732
  e.on("close").fire(t);
5651
- }), f && (h = e._deps, y = u, _ = h.indexedDB, h = h.IDBKeyRange, yn(_) || y === ct || vn(_, h).put({ name: y }).catch(L)), r();
5733
+ }), f && (h = e._deps, y = u, _ = h.indexedDB, h = h.IDBKeyRange, yn(_) || y === ct || vn(_, h).put({ name: y }).catch(I)), r();
5652
5734
  }, l);
5653
5735
  }).catch(function(e) {
5654
5736
  switch (e?.name) {
@@ -5657,11 +5739,11 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
5657
5739
  break;
5658
5740
  case "VersionError": if (0 < a) return a = 0, c();
5659
5741
  }
5660
- return B.reject(e);
5742
+ return z.reject(e);
5661
5743
  });
5662
5744
  }
5663
5745
  var l, u = t.dbReadyResolve, d = null, f = !1;
5664
- return B.race([r, (typeof navigator > "u" ? B.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(e) {
5746
+ return z.race([r, (typeof navigator > "u" ? z.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(e) {
5665
5747
  function t() {
5666
5748
  return indexedDB.databases().finally(e);
5667
5749
  }
@@ -5669,12 +5751,12 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
5669
5751
  }).finally(function() {
5670
5752
  return clearInterval(l);
5671
5753
  }) : Promise.resolve()).then(c)]).then(function() {
5672
- return s(), t.onReadyBeingFired = [], B.resolve(bn(function() {
5754
+ return s(), t.onReadyBeingFired = [], z.resolve(bn(function() {
5673
5755
  return e.on.ready.fire(e.vip);
5674
5756
  })).then(function n() {
5675
5757
  if (0 < t.onReadyBeingFired.length) {
5676
- var r = t.onReadyBeingFired.reduce(ye, L);
5677
- return t.onReadyBeingFired = [], B.resolve(bn(function() {
5758
+ var r = t.onReadyBeingFired.reduce(be, I);
5759
+ return t.onReadyBeingFired = [], z.resolve(bn(function() {
5678
5760
  return r(e.vip);
5679
5761
  })).then(n);
5680
5762
  }
@@ -5803,7 +5885,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
5803
5885
  function Bn(e, t, n, r) {
5804
5886
  return n ||= {}, r ||= "", i(e).forEach(function(i) {
5805
5887
  var a, o, s;
5806
- l(t, i) ? (a = e[i], o = t[i], typeof a == "object" && typeof o == "object" && a && o ? (s = D(a)) === D(o) ? s === "Object" ? Bn(a, o, n, r + i + ".") : a !== o && (n[r + i] = t[i]) : n[r + i] = t[i] : a !== o && (n[r + i] = t[i])) : n[r + i] = void 0;
5888
+ l(t, i) ? (a = e[i], o = t[i], typeof a == "object" && typeof o == "object" && a && o ? (s = ie(a)) === ie(o) ? s === "Object" ? Bn(a, o, n, r + i + ".") : a !== o && (n[r + i] = t[i]) : n[r + i] = t[i] : a !== o && (n[r + i] = t[i])) : n[r + i] = void 0;
5807
5889
  }), i(t).forEach(function(i) {
5808
5890
  l(e, i) || (n[r + i] = t[i]);
5809
5891
  }), n;
@@ -5819,25 +5901,25 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
5819
5901
  return t(t({}, e), { table: function(r) {
5820
5902
  var i = e.table(r), a = i.schema.primaryKey;
5821
5903
  return t(t({}, i), { mutate: function(e) {
5822
- var o = z.trans, s = o.table(r).hook, c = s.deleting, u = s.creating, d = s.updating;
5904
+ var o = R.trans, s = o.table(r).hook, c = s.deleting, u = s.creating, d = s.updating;
5823
5905
  switch (e.type) {
5824
5906
  case "add":
5825
- if (u.fire === L) break;
5907
+ if (u.fire === I) break;
5826
5908
  return o._promise("readwrite", function() {
5827
5909
  return f(e);
5828
5910
  }, !0);
5829
5911
  case "put":
5830
- if (u.fire === L && d.fire === L) break;
5912
+ if (u.fire === I && d.fire === I) break;
5831
5913
  return o._promise("readwrite", function() {
5832
5914
  return f(e);
5833
5915
  }, !0);
5834
5916
  case "delete":
5835
- if (c.fire === L) break;
5917
+ if (c.fire === I) break;
5836
5918
  return o._promise("readwrite", function() {
5837
5919
  return f(e);
5838
5920
  }, !0);
5839
5921
  case "deleteRange":
5840
- if (c.fire === L) break;
5922
+ if (c.fire === I) break;
5841
5923
  return o._promise("readwrite", function() {
5842
5924
  return function e(n, r, o) {
5843
5925
  return i.query({
@@ -5870,7 +5952,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
5870
5952
  }
5871
5953
  return i.mutate(e);
5872
5954
  function f(e) {
5873
- var r, o, s, f = z.trans, p = e.keys || Vn(a, e);
5955
+ var r, o, s, f = R.trans, p = e.keys || Vn(a, e);
5874
5956
  if (!p) throw Error("Keys missing");
5875
5957
  return (e = e.type === "add" || e.type === "put" ? t(t({}, e), { keys: p }) : t({}, e)).type !== "delete" && (e.values = n([], e.values, !0)), e.keys &&= n([], e.keys, !0), r = i, s = p, ((o = e).type === "add" ? Promise.resolve([]) : r.getMany({
5876
5958
  trans: o.trans,
@@ -5927,7 +6009,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
5927
6009
  getMany: function(e) {
5928
6010
  if (!e.cache) return r.getMany(e);
5929
6011
  var t = Un(e.keys, e.trans._cache, e.cache === "clone");
5930
- return t ? B.resolve(t) : r.getMany(e).then(function(t) {
6012
+ return t ? z.resolve(t) : r.getMany(e).then(function(t) {
5931
6013
  return e.trans._cache = {
5932
6014
  keys: e.keys,
5933
6015
  values: e.cache === "clone" ? ne(t) : t
@@ -5961,7 +6043,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
5961
6043
  var n = e.schema.name, r = new Q(e.MIN_KEY, e.MAX_KEY);
5962
6044
  return t(t({}, e), {
5963
6045
  transaction: function(t, n, r) {
5964
- if (z.subscr && n !== "readonly") throw new I.ReadOnly(`Readwrite transaction in liveQuery context. Querier source: ${z.querier}`);
6046
+ if (R.subscr && n !== "readonly") throw new F.ReadOnly(`Readwrite transaction in liveQuery context. Querier source: ${R.querier}`);
5965
6047
  return e.transaction(t, n, r);
5966
6048
  },
5967
6049
  table: function(o) {
@@ -6019,7 +6101,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
6019
6101
  };
6020
6102
  return i(h).forEach(function(e) {
6021
6103
  m[e] = function(i) {
6022
- var a = z.subscr, c = !!a, l = Gn(z, s) && Kn(e, i) ? i.obsSet = {} : a;
6104
+ var a = R.subscr, c = !!a, l = Gn(R, s) && Kn(e, i) ? i.obsSet = {} : a;
6023
6105
  if (c) {
6024
6106
  var u = function(e) {
6025
6107
  return e = `idb://${n}/${o}/${e}`, l[e] || (l[e] = new Q());
@@ -6154,7 +6236,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
6154
6236
  e.subscribers.add(n), r.addEventListener("abort", function() {
6155
6237
  var r, i;
6156
6238
  e.subscribers.delete(n), e.subscribers.size === 0 && (r = e, i = t, setTimeout(function() {
6157
- r.subscribers.size === 0 && k(i, r);
6239
+ r.subscribers.size === 0 && O(i, r);
6158
6240
  }, 3e3));
6159
6241
  });
6160
6242
  }
@@ -6176,16 +6258,16 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
6176
6258
  var f = e.table(u), p = d.optimisticOps.filter(function(e) {
6177
6259
  return e.trans === s;
6178
6260
  });
6179
- if (s._explicit && i && s.mutatedParts) for (var m = 0, h = Object.values(d.queries.query); m < h.length; m++) for (var g = 0, _ = (b = h[m]).slice(); g < _.length; g++) kn((x = _[g]).obsSet, s.mutatedParts) && (k(b, x), x.subscribers.forEach(function(e) {
6261
+ if (s._explicit && i && s.mutatedParts) for (var m = 0, h = Object.values(d.queries.query); m < h.length; m++) for (var g = 0, _ = (b = h[m]).slice(); g < _.length; g++) kn((x = _[g]).obsSet, s.mutatedParts) && (O(b, x), x.subscribers.forEach(function(e) {
6180
6262
  return o.add(e);
6181
6263
  }));
6182
6264
  else if (0 < p.length) {
6183
6265
  d.optimisticOps = d.optimisticOps.filter(function(e) {
6184
6266
  return e.trans !== s;
6185
6267
  });
6186
- for (var v = 0, y = Object.values(d.queries.query); v < y.length; v++) for (var b, x, S, C = 0, ee = (b = y[v]).slice(); C < ee.length; C++) (x = ee[C]).res != null && s.mutatedParts && (i && !x.dirty ? (S = Object.isFrozen(x.res), S = Xn(x.res, x.req, p, f, x, S), x.dirty ? (k(b, x), x.subscribers.forEach(function(e) {
6268
+ for (var v = 0, y = Object.values(d.queries.query); v < y.length; v++) for (var b, x, S, C = 0, ee = (b = y[v]).slice(); C < ee.length; C++) (x = ee[C]).res != null && s.mutatedParts && (i && !x.dirty ? (S = Object.isFrozen(x.res), S = Xn(x.res, x.req, p, f, x, S), x.dirty ? (O(b, x), x.subscribers.forEach(function(e) {
6187
6269
  return o.add(e);
6188
- })) : S !== x.res && (x.res = S, x.promise = B.resolve({ result: S }))) : (x.dirty && k(b, x), x.subscribers.forEach(function(e) {
6270
+ })) : S !== x.res && (x.res = S, x.promise = z.resolve({ result: S }))) : (x.dirty && O(b, x), x.subscribers.forEach(function(e) {
6189
6271
  return o.add(e);
6190
6272
  })));
6191
6273
  }
@@ -6202,15 +6284,15 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
6202
6284
  var i = e.table(r), a = i.schema.primaryKey;
6203
6285
  return t(t({}, i), {
6204
6286
  mutate: function(e) {
6205
- var o = z.trans;
6287
+ var o = R.trans;
6206
6288
  if (a.outbound || o.db._options.cache === "disabled" || o.explicit || o.idbtrans.mode !== "readwrite") return i.mutate(e);
6207
6289
  var s = An[`idb://${n}/${r}`];
6208
6290
  return s ? (o = i.mutate(e), e.type !== "add" && e.type !== "put" || !(50 <= e.values.length || Vn(a, e).some(function(e) {
6209
6291
  return e == null;
6210
6292
  })) ? (s.optimisticOps.push(e), e.mutatedParts && Nn(e.mutatedParts), o.then(function(t) {
6211
- 0 < t.numFailures && (k(s.optimisticOps, e), (t = Jn(0, e, t)) && s.optimisticOps.push(t), e.mutatedParts && Nn(e.mutatedParts));
6293
+ 0 < t.numFailures && (O(s.optimisticOps, e), (t = Jn(0, e, t)) && s.optimisticOps.push(t), e.mutatedParts && Nn(e.mutatedParts));
6212
6294
  }), o.catch(function() {
6213
- k(s.optimisticOps, e), e.mutatedParts && Nn(e.mutatedParts);
6295
+ O(s.optimisticOps, e), e.mutatedParts && Nn(e.mutatedParts);
6214
6296
  })) : o.then(function(n) {
6215
6297
  var r = Jn(0, t(t({}, e), { values: e.values.map(function(e, r) {
6216
6298
  var i;
@@ -6222,8 +6304,8 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
6222
6304
  }), o) : i.mutate(e);
6223
6305
  },
6224
6306
  query: function(e) {
6225
- if (!Gn(z, i) || !Kn("query", e)) return i.query(e);
6226
- var t = (c = z.trans)?.db._options.cache === "immutable", a = z, o = a.requery, s = a.signal, c = function(e, t, n, r) {
6307
+ if (!Gn(R, i) || !Kn("query", e)) return i.query(e);
6308
+ var t = (c = R.trans)?.db._options.cache === "immutable", a = R, o = a.requery, s = a.signal, c = function(e, t, n, r) {
6227
6309
  var i = An[`idb://${e}/${t}`];
6228
6310
  if (!i) return [];
6229
6311
  if (!(t = i.queries[n])) return [
@@ -6275,7 +6357,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
6275
6357
  } else e.result = ne(n);
6276
6358
  return e;
6277
6359
  }).catch(function(e) {
6278
- return d && l && k(d, l), Promise.reject(e);
6360
+ return d && l && O(d, l), Promise.reject(e);
6279
6361
  }), l = {
6280
6362
  obsSet: e.obsSet,
6281
6363
  promise: a,
@@ -6306,8 +6388,8 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
6306
6388
  } });
6307
6389
  }
6308
6390
  var nr = ($.prototype.version = function(e) {
6309
- if (isNaN(e) || e < .1) throw new I.Type("Given version is not a positive number");
6310
- if (e = Math.round(10 * e) / 10, this.idbdb || this._state.isBeingOpened) throw new I.Schema("Cannot add version when database is open");
6391
+ if (isNaN(e) || e < .1) throw new F.Type("Given version is not a positive number");
6392
+ if (e = Math.round(10 * e) / 10, this.idbdb || this._state.isBeingOpened) throw new F.Schema("Cannot add version when database is open");
6311
6393
  this.verno = Math.max(this.verno, e);
6312
6394
  var t = this._versions, n = t.filter(function(t) {
6313
6395
  return t._cfg.version === e;
@@ -6315,11 +6397,11 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
6315
6397
  return n || (n = new this.Version(e), t.push(n), t.sort(on), n.stores({}), this._state.autoSchema = !1, n);
6316
6398
  }, $.prototype._whenReady = function(e) {
6317
6399
  var t = this;
6318
- return this.idbdb && (this._state.openComplete || z.letThrough || this._vip) ? e() : new B(function(e, n) {
6319
- if (t._state.openComplete) return n(new I.DatabaseClosed(t._state.dbOpenError));
6400
+ return this.idbdb && (this._state.openComplete || R.letThrough || this._vip) ? e() : new z(function(e, n) {
6401
+ if (t._state.openComplete) return n(new F.DatabaseClosed(t._state.dbOpenError));
6320
6402
  if (!t._state.isBeingOpened) {
6321
- if (!t._state.autoOpen) return void n(new I.DatabaseClosed());
6322
- t.open().catch(L);
6403
+ if (!t._state.autoOpen) return void n(new F.DatabaseClosed());
6404
+ t.open().catch(I);
6323
6405
  }
6324
6406
  t._state.dbReadyPromise.then(e, n);
6325
6407
  }).then(e);
@@ -6343,7 +6425,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
6343
6425
  })), this;
6344
6426
  }, $.prototype.open = function() {
6345
6427
  var e = this;
6346
- return nt(je, function() {
6428
+ return W(Me, function() {
6347
6429
  return In(e);
6348
6430
  });
6349
6431
  }, $.prototype._close = function() {
@@ -6355,28 +6437,28 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
6355
6437
  } catch {}
6356
6438
  this.idbdb = null;
6357
6439
  }
6358
- e.isBeingOpened || (e.dbReadyPromise = new B(function(t) {
6440
+ e.isBeingOpened || (e.dbReadyPromise = new z(function(t) {
6359
6441
  e.dbReadyResolve = t;
6360
- }), e.openCanceller = new B(function(t, n) {
6442
+ }), e.openCanceller = new z(function(t, n) {
6361
6443
  e.cancelOpen = n;
6362
6444
  }));
6363
6445
  }, $.prototype.close = function(e) {
6364
6446
  var t = (e === void 0 ? { disableAutoOpen: !0 } : e).disableAutoOpen, e = this._state;
6365
- t ? (e.isBeingOpened && e.cancelOpen(new I.DatabaseClosed()), this._close(), e.autoOpen = !1, e.dbOpenError = new I.DatabaseClosed()) : (this._close(), e.autoOpen = this._options.autoOpen || e.isBeingOpened, e.openComplete = !1, e.dbOpenError = null);
6447
+ t ? (e.isBeingOpened && e.cancelOpen(new F.DatabaseClosed()), this._close(), e.autoOpen = !1, e.dbOpenError = new F.DatabaseClosed()) : (this._close(), e.autoOpen = this._options.autoOpen || e.isBeingOpened, e.openComplete = !1, e.dbOpenError = null);
6366
6448
  }, $.prototype.delete = function(e) {
6367
6449
  var t = this;
6368
6450
  e === void 0 && (e = { disableAutoOpen: !0 });
6369
6451
  var n = 0 < arguments.length && typeof arguments[0] != "object", r = this._state;
6370
- return new B(function(i, a) {
6452
+ return new z(function(i, a) {
6371
6453
  function o() {
6372
6454
  t.close(e);
6373
6455
  var n = t._deps.indexedDB.deleteDatabase(t.name);
6374
- n.onsuccess = V(function() {
6456
+ n.onsuccess = B(function() {
6375
6457
  var e = t._deps, n = t.name, r = e.indexedDB;
6376
- e = e.IDBKeyRange, yn(r) || n === ct || vn(r, e).delete(n).catch(L), i();
6458
+ e = e.IDBKeyRange, yn(r) || n === ct || vn(r, e).delete(n).catch(I), i();
6377
6459
  }), n.onerror = zt(a), n.onblocked = t._fireOnBlocked;
6378
6460
  }
6379
- if (n) throw new I.InvalidArgument("Invalid closeOptions argument to db.delete()");
6461
+ if (n) throw new F.InvalidArgument("Invalid closeOptions argument to db.delete()");
6380
6462
  r.isBeingOpened ? r.dbReadyPromise.then(o) : o();
6381
6463
  });
6382
6464
  }, $.prototype.backendDB = function() {
@@ -6402,7 +6484,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
6402
6484
  }), $.prototype.transaction = function() {
6403
6485
  var e = function(e, t, n) {
6404
6486
  var r = arguments.length;
6405
- if (r < 2) throw new I.InvalidArgument("Too few arguments");
6487
+ if (r < 2) throw new F.InvalidArgument("Too few arguments");
6406
6488
  for (var i = Array(r - 1); --r;) i[r - 1] = arguments[r];
6407
6489
  return n = i.pop(), [
6408
6490
  e,
@@ -6412,7 +6494,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
6412
6494
  }.apply(this, arguments);
6413
6495
  return this._transaction.apply(this, e);
6414
6496
  }, $.prototype._transaction = function(e, t, n) {
6415
- var r = this, i = z.trans;
6497
+ var r = this, i = R.trans;
6416
6498
  i && i.db === this && e.indexOf("!") === -1 || (i = null);
6417
6499
  var a, o, s = e.indexOf("?") !== -1;
6418
6500
  e = e.replace("!", "").replace("?", "");
@@ -6422,17 +6504,17 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
6422
6504
  return e;
6423
6505
  }), e == "r" || e === lt) a = lt;
6424
6506
  else {
6425
- if (e != "rw" && e != ut) throw new I.InvalidArgument("Invalid transaction mode: " + e);
6507
+ if (e != "rw" && e != ut) throw new F.InvalidArgument("Invalid transaction mode: " + e);
6426
6508
  a = ut;
6427
6509
  }
6428
6510
  if (i) {
6429
6511
  if (i.mode === lt && a === ut) {
6430
- if (!s) throw new I.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");
6512
+ if (!s) throw new F.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");
6431
6513
  i = null;
6432
6514
  }
6433
6515
  i && o.forEach(function(e) {
6434
6516
  if (i && i.storeNames.indexOf(e) === -1) {
6435
- if (!s) throw new I.SubTransaction("Table " + e + " not included in parent transaction.");
6517
+ if (!s) throw new F.SubTransaction("Table " + e + " not included in parent transaction.");
6436
6518
  i = null;
6437
6519
  }
6438
6520
  }), s && i && !i.active && (i = null);
@@ -6443,8 +6525,8 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
6443
6525
  }) : G(e);
6444
6526
  }
6445
6527
  var c = function e(t, n, r, i, a) {
6446
- return B.resolve().then(function() {
6447
- var o = z.transless || z, s = t._createTransaction(n, r, t._dbSchema, i);
6528
+ return z.resolve().then(function() {
6529
+ var o = R.transless || R, s = t._createTransaction(n, r, t._dbSchema, i);
6448
6530
  if (s.explicit = !0, o = {
6449
6531
  trans: s,
6450
6532
  transless: o
@@ -6452,16 +6534,16 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
6452
6534
  else try {
6453
6535
  s.create(), s.idbtrans._explicit = !0, t._state.PR1398_maxLoop = 3;
6454
6536
  } catch (i) {
6455
- return i.name === ce.InvalidState && t.isOpen() && 0 < --t._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), t.close({ disableAutoOpen: !1 }), t.open().then(function() {
6537
+ return i.name === le.InvalidState && t.isOpen() && 0 < --t._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), t.close({ disableAutoOpen: !1 }), t.open().then(function() {
6456
6538
  return e(t, n, r, null, a);
6457
6539
  })) : G(i);
6458
6540
  }
6459
- var c, l = M(a);
6460
- return l && Qe(), o = B.follow(function() {
6541
+ var c, l = ae(a);
6542
+ return l && $e(), o = z.follow(function() {
6461
6543
  var e;
6462
- (c = a.call(s, s)) && (l ? (e = U.bind(null, null), c.then(e, e)) : typeof c.next == "function" && typeof c.throw == "function" && (c = Ln(c)));
6463
- }, o), (c && typeof c.then == "function" ? B.resolve(c).then(function(e) {
6464
- return s.active ? e : G(new I.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
6544
+ (c = a.call(s, s)) && (l ? (e = H.bind(null, null), c.then(e, e)) : typeof c.next == "function" && typeof c.throw == "function" && (c = Ln(c)));
6545
+ }, o), (c && typeof c.then == "function" ? z.resolve(c).then(function(e) {
6546
+ return s.active ? e : G(new F.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
6465
6547
  }) : o.then(function() {
6466
6548
  return c;
6467
6549
  })).then(function(e) {
@@ -6473,11 +6555,11 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
6473
6555
  });
6474
6556
  });
6475
6557
  }.bind(null, this, a, o, i, n);
6476
- return i ? i._promise(a, c, "lock") : z.trans ? nt(z.transless, function() {
6558
+ return i ? i._promise(a, c, "lock") : R.trans ? W(R.transless, function() {
6477
6559
  return r._whenReady(c);
6478
6560
  }) : this._whenReady(c);
6479
6561
  }, $.prototype.table = function(e) {
6480
- if (!l(this._allTables, e)) throw new I.InvalidTable(`Table ${e} does not exist`);
6562
+ if (!l(this._allTables, e)) throw new F.InvalidTable(`Table ${e} does not exist`);
6481
6563
  return this._allTables[e];
6482
6564
  }, $);
6483
6565
  function $(e, n) {
@@ -6499,19 +6581,19 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
6499
6581
  isBeingOpened: !1,
6500
6582
  onReadyBeingFired: null,
6501
6583
  openComplete: !1,
6502
- dbReadyResolve: L,
6584
+ dbReadyResolve: I,
6503
6585
  dbReadyPromise: null,
6504
- cancelOpen: L,
6586
+ cancelOpen: I,
6505
6587
  openCanceller: null,
6506
6588
  autoSchema: !0,
6507
6589
  PR1398_maxLoop: 3,
6508
6590
  autoOpen: n.autoOpen
6509
6591
  };
6510
- u.dbReadyPromise = new B(function(e) {
6592
+ u.dbReadyPromise = new z(function(e) {
6511
6593
  u.dbReadyResolve = e;
6512
- }), u.openCanceller = new B(function(e, t) {
6594
+ }), u.openCanceller = new z(function(e, t) {
6513
6595
  u.cancelOpen = t;
6514
- }), this._state = u, this.name = e, this.on = yt(this, "populate", "blocked", "versionchange", "close", { ready: [ye, L] }), this.once = function(e, t) {
6596
+ }), this._state = u, this.name = e, this.on = yt(this, "populate", "blocked", "versionchange", "close", { ready: [be, I] }), this.once = function(e, t) {
6515
6597
  var n = function() {
6516
6598
  var i = [...arguments];
6517
6599
  r.on(e).unsubscribe(n), t.apply(r, i);
@@ -6521,7 +6603,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
6521
6603
  return function(t, n) {
6522
6604
  $.vip(function() {
6523
6605
  var i, a = r._state;
6524
- a.openComplete ? (a.dbOpenError || B.resolve().then(t), n && e(t)) : a.onReadyBeingFired ? (a.onReadyBeingFired.push(t), n && e(t)) : (e(t), i = r, n || e(function e() {
6606
+ a.openComplete ? (a.dbOpenError || z.resolve().then(t), n && e(t)) : a.onReadyBeingFired ? (a.onReadyBeingFired.push(t), n && e(t)) : (e(t), i = r, n || e(function e() {
6525
6607
  i.on.ready.unsubscribe(t), i.on.ready.unsubscribe(e);
6526
6608
  }));
6527
6609
  });
@@ -6552,14 +6634,14 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
6552
6634
  limit: Infinity,
6553
6635
  error: r,
6554
6636
  or: i.or,
6555
- valueMapper: e === fe ? null : e
6637
+ valueMapper: e === pe ? null : e
6556
6638
  };
6557
6639
  })), this.Table = (o = this, bt(vt.prototype, function(e, t, n) {
6558
6640
  this.db = o, this._tx = n, this.name = e, this.schema = t, this.hook = o._allTables[e] ? o._allTables[e].hook : yt(null, {
6559
- creating: [he, L],
6560
- reading: [pe, fe],
6561
- updating: [_e, L],
6562
- deleting: [ge, L]
6641
+ creating: [ge, I],
6642
+ reading: [me, pe],
6643
+ updating: [ve, I],
6644
+ deleting: [_e, I]
6563
6645
  });
6564
6646
  })), this.Transaction = (s = this, bt(Wt.prototype, function(e, t, n, r, i) {
6565
6647
  var a = this;
@@ -6567,7 +6649,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
6567
6649
  e = (e = n[e])?.yProps, e && (t = t.concat(e.map(function(e) {
6568
6650
  return e.updatesTable;
6569
6651
  })));
6570
- }), this.db = s, this.mode = e, this.storeNames = t, this.schema = n, this.chromeTransactionDurability = r, this.idbtrans = null, this.on = yt(this, "complete", "error", "abort"), this.parent = i || 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 B(function(e, t) {
6652
+ }), this.db = s, this.mode = e, this.storeNames = t, this.schema = n, this.chromeTransactionDurability = r, this.idbtrans = null, this.on = yt(this, "complete", "error", "abort"), this.parent = i || 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 z(function(e, t) {
6571
6653
  a._resolve = e, a._reject = t;
6572
6654
  }), this._completion.then(function() {
6573
6655
  a.active = !1, a.on.complete.fire();
@@ -6594,7 +6676,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
6594
6676
  return 0 < q(e, t) ? e : t;
6595
6677
  }, this._min = function(e, t) {
6596
6678
  return q(e, t) < 0 ? e : t;
6597
- }, this._IDBKeyRange = l._deps.IDBKeyRange, !this._IDBKeyRange) throw new I.MissingAPI();
6679
+ }, this._IDBKeyRange = l._deps.IDBKeyRange, !this._IDBKeyRange) throw new F.MissingAPI();
6598
6680
  })), this.on("versionchange", function(e) {
6599
6681
  0 < e.newVersion ? console.warn(`Another connection wants to upgrade database '${r.name}'. Closing db now to resume the upgrade.`) : console.warn(`Another connection wants to delete database '${r.name}'. Closing db now to resume the delete request.`), r.close({ disableAutoOpen: !1 });
6600
6682
  }), this.on("blocked", function(e) {
@@ -6624,13 +6706,13 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
6624
6706
  return e(r);
6625
6707
  });
6626
6708
  }
6627
- var rr, P = typeof Symbol < "u" && "observable" in Symbol ? Symbol.observable : "@@observable", ir = (ar.prototype.subscribe = function(e, t, n) {
6709
+ var rr, M = typeof Symbol < "u" && "observable" in Symbol ? Symbol.observable : "@@observable", ir = (ar.prototype.subscribe = function(e, t, n) {
6628
6710
  return this._subscribe(e && typeof e != "function" ? e : {
6629
6711
  next: e,
6630
6712
  error: t,
6631
6713
  complete: n
6632
6714
  });
6633
- }, ar.prototype[P] = function() {
6715
+ }, ar.prototype[M] = function() {
6634
6716
  return this;
6635
6717
  }, ar);
6636
6718
  function ar(e) {
@@ -6649,7 +6731,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
6649
6731
  }
6650
6732
  function or(e) {
6651
6733
  var t, n = !1, r = new ir(function(r) {
6652
- var i = M(e), a, o = !1, s = {}, c = {}, u = {
6734
+ var i = ae(e), a, o = !1, s = {}, c = {}, u = {
6653
6735
  get closed() {
6654
6736
  return o;
6655
6737
  },
@@ -6665,13 +6747,13 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
6665
6747
  }, m = function() {
6666
6748
  var u, m, h;
6667
6749
  !o && rr.indexedDB && (s = {}, u = {}, a && a.abort(), a = new AbortController(), h = function(t) {
6668
- var n = He();
6750
+ var n = Ue();
6669
6751
  try {
6670
- i && Qe();
6671
- var r = Ze(e, t);
6672
- return r = i ? r.finally(U) : r;
6752
+ i && $e();
6753
+ var r = Qe(e, t);
6754
+ return r = i ? r.finally(H) : r;
6673
6755
  } finally {
6674
- n && Ue();
6756
+ n && We();
6675
6757
  }
6676
6758
  }(m = {
6677
6759
  subscr: u,
@@ -6709,7 +6791,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
6709
6791
  ur = t;
6710
6792
  }
6711
6793
  }
6712
- u(sr, t(t({}, de), {
6794
+ u(sr, t(t({}, fe), {
6713
6795
  delete: function(e) {
6714
6796
  return new sr(e, { addons: [] }).delete();
6715
6797
  },
@@ -6730,7 +6812,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
6730
6812
  });
6731
6813
  }) : vn(n, t).toCollection().primaryKeys()).then(e);
6732
6814
  } catch {
6733
- return G(new I.MissingAPI());
6815
+ return G(new F.MissingAPI());
6734
6816
  }
6735
6817
  var t, n;
6736
6818
  },
@@ -6740,14 +6822,14 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
6740
6822
  };
6741
6823
  },
6742
6824
  ignoreTransaction: function(e) {
6743
- return z.trans ? nt(z.transless, e) : e();
6825
+ return R.trans ? W(R.transless, e) : e();
6744
6826
  },
6745
6827
  vip: bn,
6746
6828
  async: function(e) {
6747
6829
  return function() {
6748
6830
  try {
6749
6831
  var t = Ln(e.apply(this, arguments));
6750
- return t && typeof t.then == "function" ? t : B.resolve(t);
6832
+ return t && typeof t.then == "function" ? t : z.resolve(t);
6751
6833
  } catch (e) {
6752
6834
  return G(e);
6753
6835
  }
@@ -6756,24 +6838,24 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
6756
6838
  spawn: function(e, t, n) {
6757
6839
  try {
6758
6840
  var r = Ln(e.apply(n, t || []));
6759
- return r && typeof r.then == "function" ? r : B.resolve(r);
6841
+ return r && typeof r.then == "function" ? r : z.resolve(r);
6760
6842
  } catch (e) {
6761
6843
  return G(e);
6762
6844
  }
6763
6845
  },
6764
6846
  currentTransaction: { get: function() {
6765
- return z.trans || null;
6847
+ return R.trans || null;
6766
6848
  } },
6767
6849
  waitFor: function(e, t) {
6768
- return t = B.resolve(typeof e == "function" ? sr.ignoreTransaction(e) : e).timeout(t || 6e4), z.trans ? z.trans.waitFor(t) : t;
6850
+ return t = z.resolve(typeof e == "function" ? sr.ignoreTransaction(e) : e).timeout(t || 6e4), R.trans ? R.trans.waitFor(t) : t;
6769
6851
  },
6770
- Promise: B,
6852
+ Promise: z,
6771
6853
  debug: {
6772
6854
  get: function() {
6773
- return R;
6855
+ return L;
6774
6856
  },
6775
6857
  set: function(e) {
6776
- be(e);
6858
+ xe(e);
6777
6859
  }
6778
6860
  },
6779
6861
  derive: p,
@@ -6799,7 +6881,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
6799
6881
  minKey: -Infinity,
6800
6882
  addons: [],
6801
6883
  connections: st,
6802
- errnames: ce,
6884
+ errnames: le,
6803
6885
  dependencies: rr,
6804
6886
  cache: An,
6805
6887
  semVer: "4.2.0",
@@ -6822,16 +6904,16 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
6822
6904
  ur || lr.postMessage(e);
6823
6905
  })), typeof addEventListener < "u" && (addEventListener("pagehide", function(e) {
6824
6906
  if (!nr.disableBfCache && e.persisted) {
6825
- R && console.debug("Dexie: handling persisted pagehide"), lr?.close();
6907
+ L && console.debug("Dexie: handling persisted pagehide"), lr?.close();
6826
6908
  for (var t = 0, n = st; t < n.length; t++) n[t].close({ disableAutoOpen: !1 });
6827
6909
  }
6828
6910
  }), addEventListener("pageshow", function(e) {
6829
- !nr.disableBfCache && e.persisted && (R && console.debug("Dexie: handling persisted pageshow"), dr(), cr({ all: new Q(-Infinity, [[]]) }));
6830
- })), B.rejectionMapper = function(e, t) {
6831
- return !e || e instanceof ae || e instanceof TypeError || e instanceof SyntaxError || !e.name || !ue[e.name] ? e : (t = new ue[e.name](t || e.message, e), "stack" in e && f(t, "stack", { get: function() {
6911
+ !nr.disableBfCache && e.persisted && (L && console.debug("Dexie: handling persisted pageshow"), dr(), cr({ all: new Q(-Infinity, [[]]) }));
6912
+ })), z.rejectionMapper = function(e, t) {
6913
+ return !e || e instanceof N || e instanceof TypeError || e instanceof SyntaxError || !e.name || !de[e.name] ? e : (t = new de[e.name](t || e.message, e), "stack" in e && f(t, "stack", { get: function() {
6832
6914
  return this.inner.stack;
6833
6915
  } }), t);
6834
- }, be(R), t(nr, Object.freeze({
6916
+ }, xe(L), t(nr, Object.freeze({
6835
6917
  __proto__: null,
6836
6918
  Dexie: nr,
6837
6919
  liveQuery: or,
@@ -6853,9 +6935,9 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
6853
6935
  rangesOverlap: wn
6854
6936
  }), { default: nr }), nr;
6855
6937
  });
6856
- })))(), 1), _t = Symbol.for("Dexie"), vt = globalThis[_t] || (globalThis[_t] = gt.default);
6857
- if (gt.default.semVer !== vt.semVer) throw Error(`Two different versions of Dexie loaded in the same app: ${gt.default.semVer} and ${vt.semVer}`);
6858
- var { liveQuery: J, mergeRanges: yt, rangesOverlap: bt, RangeSet: xt, cmp: St, Entity: Ct, PropModification: wt, replacePrefix: Tt, add: Et, remove: Dt, DexieYProvider: Ot } = vt;
6938
+ })))(), 1), bt = Symbol.for("Dexie"), xt = globalThis[bt] || (globalThis[bt] = yt.default);
6939
+ if (yt.default.semVer !== xt.semVer) throw Error(`Two different versions of Dexie loaded in the same app: ${yt.default.semVer} and ${xt.semVer}`);
6940
+ var { liveQuery: St, mergeRanges: Ct, rangesOverlap: wt, RangeSet: Tt, cmp: Et, Entity: Dt, PropModification: Ot, replacePrefix: kt, add: At, remove: Y, DexieYProvider: jt } = xt;
6859
6941
  (class e {
6860
6942
  static {
6861
6943
  this.reconcileWarned = !1;
@@ -6875,7 +6957,7 @@ var { liveQuery: J, mergeRanges: yt, rangesOverlap: bt, RangeSet: xt, cmp: St, E
6875
6957
  return this.documents.has(e);
6876
6958
  }
6877
6959
  async registerDocument(e) {
6878
- this.guardWritable(), this.documents.set(e.id, e), this.records.set(ht(e.id), /* @__PURE__ */ new Map()), this.blobData.set(e.id, /* @__PURE__ */ new Map());
6960
+ this.guardWritable(), this.documents.set(e.id, e), this.records.set(J(e.id), /* @__PURE__ */ new Map()), this.blobData.set(e.id, /* @__PURE__ */ new Map());
6879
6961
  }
6880
6962
  async getDocument(e) {
6881
6963
  return this.documents.get(e);
@@ -6892,7 +6974,7 @@ var { liveQuery: J, mergeRanges: yt, rangesOverlap: bt, RangeSet: xt, cmp: St, E
6892
6974
  });
6893
6975
  }
6894
6976
  async removeDocument(e) {
6895
- this.guardWritable(), this.documents.delete(e), this.records.delete(ht(e)), this.changelog.delete(e), this.heads.delete(e), this.blobData.delete(e);
6977
+ this.guardWritable(), this.documents.delete(e), this.records.delete(J(e)), this.changelog.delete(e), this.heads.delete(e), this.blobData.delete(e);
6896
6978
  for (let [t, n] of this.blobs) n.documentId === e && this.blobs.delete(t);
6897
6979
  }
6898
6980
  async get(e, t) {
@@ -7047,7 +7129,7 @@ var { liveQuery: J, mergeRanges: yt, rangesOverlap: bt, RangeSet: xt, cmp: St, E
7047
7129
  return t || (t = /* @__PURE__ */ new Map(), this.blobData.set(e, t)), t;
7048
7130
  }
7049
7131
  getTable(e) {
7050
- let t = ht(e), n = this.records.get(t);
7132
+ let t = J(e), n = this.records.get(t);
7051
7133
  return n || (n = /* @__PURE__ */ new Map(), this.records.set(t, n)), n;
7052
7134
  }
7053
7135
  guardWritable() {
@@ -7055,4 +7137,4 @@ var { liveQuery: J, mergeRanges: yt, rangesOverlap: bt, RangeSet: xt, cmp: St, E
7055
7137
  }
7056
7138
  });
7057
7139
  //#endregion
7058
- export { N as $, Xe as A, B, ht as C, ut as D, pt as E, R as G, Ce as H, Be as I, ve as J, ye as K, ze as L, $e as O, Ve as P, pe as Q, Re as R, mt as T, Se as U, Me as V, xe as W, ge as X, he as Y, fe as Z, re as at, ne as ct, S as dt, j as et, O as it, U as k, T as lt, A as nt, D as ot, be as q, k as rt, E as st, M as tt, C as ut, q as x, Ie as z };
7140
+ export { he as $, H as A, Ve as B, J as C, mt as D, gt as E, Te as G, Le as H, We as I, xe as J, we as K, $e as N, nt as O, ye as Q, Ue as R, _t as T, Fe as U, ze as V, Ee as W, L as X, Ce as Y, ve as Z, A as at, D as ct, re as dt, ge as et, w as ft, ae as it, U as k, E as lt, S as mt, j as nt, k as ot, C as pt, Se as q, M as rt, O as st, oe as tt, ie as ut, vt as x, He as z };