@dialecte/core 0.1.13 → 0.1.15

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.
@@ -1,5 +1,5 @@
1
1
  import { t as qe, i as Ge } from "./index-B1qiHOqL.js";
2
- import { g as fr, l as Ee, o as dr, k as ur, s as Ja, t as ei, C as sa, m as ua } from "./merge-extensions-BWXwiKx1.js";
2
+ import { g as fr, l as ye, o as dr, k as ur, s as ri, t as ai, C as fa, m as da } from "./merge-extensions-BWXwiKx1.js";
3
3
  function cr(m, s) {
4
4
  if (!m) return {};
5
5
  const l = {};
@@ -13,7 +13,7 @@ function cr(m, s) {
13
13
  }
14
14
  return l;
15
15
  }
16
- function ti(m) {
16
+ function ii(m) {
17
17
  const { stagedOperations: s, tagName: l, id: i } = m;
18
18
  for (let d = s.length - 1; d >= 0; d--) {
19
19
  const h = s[d];
@@ -62,7 +62,7 @@ function ti(m) {
62
62
  }
63
63
  }
64
64
  }
65
- function ni(m) {
65
+ function oi(m) {
66
66
  const { rawRecords: s, stagedOperations: l, tagName: i } = m, d = new Map(
67
67
  s.map((h) => [h.id, { ...h, status: "unchanged" }])
68
68
  );
@@ -75,10 +75,10 @@ function ni(m) {
75
75
  }
76
76
  return Array.from(d.values());
77
77
  }
78
- async function Te(m) {
78
+ async function xe(m) {
79
79
  const { context: s, ref: l } = m;
80
80
  if (s.stagedOperations.length > 0) {
81
- const d = ti({
81
+ const d = ii({
82
82
  stagedOperations: s.stagedOperations,
83
83
  tagName: l.tagName,
84
84
  id: l.id
@@ -88,52 +88,52 @@ async function Te(m) {
88
88
  }
89
89
  let i;
90
90
  if (l.id === void 0) {
91
- const d = `__singleton_${l.tagName}`, h = Xt(s) ? s.recordCache.get(d) : void 0;
92
- h ? i = h : (i = (await s.store.getByTagName(l.tagName))[0], i && Xt(s) && (s.recordCache.set(i.id, i), s.recordCache.set(d, i)));
91
+ const d = `__singleton_${l.tagName}`, h = $t(s) ? s.recordCache.get(d) : void 0;
92
+ h ? i = h : (i = (await s.store.getByTagName(l.tagName))[0], i && $t(s) && (s.recordCache.set(i.id, i), s.recordCache.set(d, i)));
93
93
  } else {
94
- const d = Xt(s) ? s.recordCache.get(l.id) : void 0;
95
- d ? i = d : (i = await s.store.get(l.id), i && Xt(s) && s.recordCache.set(l.id, i));
94
+ const d = $t(s) ? s.recordCache.get(l.id) : void 0;
95
+ d ? i = d : (i = await s.store.get(l.id), i && $t(s) && s.recordCache.set(l.id, i));
96
96
  }
97
97
  if (i)
98
98
  return { ...i, status: "unchanged" };
99
99
  }
100
- async function ca(m) {
100
+ async function ha(m) {
101
101
  const { context: s, refs: l } = m;
102
- return Promise.all(l.map((i) => Te({ context: s, ref: i })));
102
+ return Promise.all(l.map((i) => xe({ context: s, ref: i })));
103
103
  }
104
- async function la(m) {
104
+ async function pa(m) {
105
105
  const { context: s, tagName: l } = m, i = await s.store.getByTagName(l);
106
106
  for (const d of i)
107
- Xt(s) && s.recordCache.set(d.id, d);
108
- return ni({ rawRecords: i, stagedOperations: s.stagedOperations, tagName: l });
107
+ $t(s) && s.recordCache.set(d.id, d);
108
+ return oi({ rawRecords: i, stagedOperations: s.stagedOperations, tagName: l });
109
109
  }
110
- async function ri(m) {
111
- const { context: s, ref: l, tagName: i } = m, d = await Te({ context: s, ref: l });
110
+ async function si(m) {
111
+ const { context: s, ref: l, tagName: i } = m, d = await xe({ context: s, ref: l });
112
112
  if (!d) return;
113
113
  const h = d.children.find((y) => y.tagName === i);
114
114
  if (h)
115
- return Te({ context: s, ref: h });
115
+ return xe({ context: s, ref: h });
116
116
  }
117
- async function ai(m) {
118
- const { context: s, ref: l, tagName: i } = m, d = await Te({ context: s, ref: l });
117
+ async function ui(m) {
118
+ const { context: s, ref: l, tagName: i } = m, d = await xe({ context: s, ref: l });
119
119
  if (!d) return [];
120
120
  const h = d.children.filter((_) => _.tagName === i).map((_) => ({ tagName: i, id: _.id }));
121
- return (await ca({ context: s, refs: h })).filter(
121
+ return (await ha({ context: s, refs: h })).filter(
122
122
  (_) => _ !== void 0
123
123
  );
124
124
  }
125
- async function ii(m) {
125
+ async function ci(m) {
126
126
  const { context: s, ref: l, options: i } = m, d = i?.depth ?? 1 / 0, h = i?.stopAtTagName, y = i?.order ?? "bottom-up", _ = [];
127
- let D = await Te({ context: s, ref: l });
127
+ let D = await xe({ context: s, ref: l });
128
128
  for (; D?.parent && _.length < d; ) {
129
- const F = D.parent, $ = await Te({ context: s, ref: F });
130
- if (!$ || (_.push($), h && $.tagName === h)) break;
131
- D = $;
129
+ const F = D.parent, X = await xe({ context: s, ref: F });
130
+ if (!X || (_.push(X), h && X.tagName === h)) break;
131
+ D = X;
132
132
  }
133
133
  return y === "top-down" ? _.reverse() : _;
134
134
  }
135
135
  async function Nn(m) {
136
- const { context: s, tagName: l, attributes: i } = m, d = await la({ context: s, tagName: l }), h = [];
136
+ const { context: s, tagName: l, attributes: i } = m, d = await pa({ context: s, tagName: l }), h = [];
137
137
  for (const y of d)
138
138
  mr({ record: y, attributeFilter: i }) && h.push(y);
139
139
  return h;
@@ -156,50 +156,50 @@ function mr(m) {
156
156
  }
157
157
  return !0;
158
158
  }
159
- async function oi(m) {
159
+ async function li(m) {
160
160
  const { context: s, dialecteConfig: l, ref: i, filter: d } = m;
161
- return d ? ui({
161
+ return d ? di({
162
162
  context: s,
163
163
  ref: i,
164
164
  filter: d
165
- }) : si({
165
+ }) : fi({
166
166
  context: s,
167
167
  dialecteConfig: l,
168
168
  ref: i
169
169
  });
170
170
  }
171
- async function si(m) {
172
- const { context: s, dialecteConfig: l, ref: i } = m, d = await ha({ context: s, ref: i });
171
+ async function fi(m) {
172
+ const { context: s, dialecteConfig: l, ref: i } = m, d = await ya({ context: s, ref: i });
173
173
  if (!d) return {};
174
- const h = ci(d), y = [i.tagName, ...l.descendants[i.tagName]], _ = {};
174
+ const h = hi(d), y = [i.tagName, ...l.descendants[i.tagName]], _ = {};
175
175
  for (const D of y)
176
176
  _[D] = [];
177
177
  for (const D of h)
178
178
  _[D.tagName] && _[D.tagName].push(D);
179
179
  return _;
180
180
  }
181
- async function ui(m) {
182
- const { context: s, ref: l, filter: i } = m, d = fa(i), h = new Set(da(i)), y = d[d.length - 1], _ = y.attributes ? await Nn({
181
+ async function di(m) {
182
+ const { context: s, ref: l, filter: i } = m, d = ma(i), h = new Set(ga(i)), y = d[d.length - 1], _ = y.attributes ? await Nn({
183
183
  context: s,
184
184
  tagName: y.tagName,
185
185
  attributes: y.attributes
186
- }) : await hi({
186
+ }) : await yi({
187
187
  context: s,
188
188
  tagName: y.tagName
189
189
  }), D = /* @__PURE__ */ new Map();
190
190
  for (const F of _) {
191
- const $ = await li({
191
+ const X = await pi({
192
192
  context: s,
193
193
  record: F,
194
194
  targetRef: l
195
195
  });
196
- if ($.length !== 0 && fi({ ancestry: $, conditions: d }))
197
- for (const G of $)
196
+ if (X.length !== 0 && mi({ ancestry: X, conditions: d }))
197
+ for (const G of X)
198
198
  h.has(G.tagName) && (D.has(G.tagName) || D.set(G.tagName, /* @__PURE__ */ new Map()), D.get(G.tagName).set(G.id, G));
199
199
  }
200
- return di({ collected: D, collectTags: h });
200
+ return gi({ collected: D, collectTags: h });
201
201
  }
202
- function ci(m) {
202
+ function hi(m) {
203
203
  const s = [];
204
204
  function l(i) {
205
205
  if (i.tree?.length)
@@ -208,7 +208,7 @@ function ci(m) {
208
208
  }
209
209
  return l(m), s;
210
210
  }
211
- function fa(m) {
211
+ function ma(m) {
212
212
  const s = [
213
213
  {
214
214
  tagName: m.tagName,
@@ -217,35 +217,35 @@ function fa(m) {
217
217
  }
218
218
  ];
219
219
  return m.descendant && s.push(
220
- ...fa(m.descendant)
220
+ ...ma(m.descendant)
221
221
  ), s;
222
222
  }
223
- function da(m) {
223
+ function ga(m) {
224
224
  const s = [m.tagName];
225
- return m.descendant && s.push(...da(m.descendant)), s;
225
+ return m.descendant && s.push(...ga(m.descendant)), s;
226
226
  }
227
- async function li(m) {
227
+ async function pi(m) {
228
228
  const { context: s, record: l, targetRef: i } = m, d = [];
229
229
  let h = l;
230
230
  for (; h && h.id !== i.id; ) {
231
231
  if (d.push(h), !h.parent) return [];
232
- const y = await Te({
232
+ const y = await xe({
233
233
  context: s,
234
- ref: Ee(h.parent)
234
+ ref: ye(h.parent)
235
235
  });
236
236
  if (!y) return [];
237
237
  h = y;
238
238
  }
239
239
  return !h || h.id !== i.id ? [] : (d.push(h), d);
240
240
  }
241
- function fi(m) {
241
+ function mi(m) {
242
242
  const { ancestry: s, conditions: l } = m;
243
243
  return l.every((i) => s.some((h) => h.tagName !== i.tagName ? !1 : i.attributes ? mr({
244
244
  record: h,
245
245
  attributeFilter: i.attributes
246
246
  }) : !0) || i.optional === !0);
247
247
  }
248
- function di(m) {
248
+ function gi(m) {
249
249
  const { collected: s, collectTags: l } = m, i = {};
250
250
  for (const d of l)
251
251
  i[d] = [];
@@ -253,7 +253,7 @@ function di(m) {
253
253
  l.has(d) && (i[d] = Array.from(h.values()));
254
254
  return i;
255
255
  }
256
- async function hi(m) {
256
+ async function yi(m) {
257
257
  const { context: s, tagName: l } = m;
258
258
  return Nn({
259
259
  context: s,
@@ -261,32 +261,32 @@ async function hi(m) {
261
261
  attributes: {}
262
262
  });
263
263
  }
264
- async function pi(m) {
264
+ async function Hr(m) {
265
265
  const { context: s, ref: l, name: i } = m;
266
- return ((await Te({ context: s, ref: l }))?.attributes ?? []).find((_) => _.name === i)?.value ?? "";
266
+ return ((await xe({ context: s, ref: l }))?.attributes ?? []).find((_) => _.name === i)?.value ?? "";
267
267
  }
268
- async function mi(m) {
268
+ async function Zr(m) {
269
269
  const { context: s, ref: l, name: i } = m;
270
- return ((await Te({ context: s, ref: l }))?.attributes ?? []).find((_) => _.name === i);
270
+ return ((await xe({ context: s, ref: l }))?.attributes ?? []).find((_) => _.name === i);
271
271
  }
272
- async function gi(m) {
272
+ async function Jr(m) {
273
273
  const { context: s, ref: l } = m;
274
- return ((await Te({ context: s, ref: l }))?.attributes ?? []).reduce(
274
+ return ((await xe({ context: s, ref: l }))?.attributes ?? []).reduce(
275
275
  (h, y) => (h[y.name] = y.value ?? "", h),
276
276
  {}
277
277
  );
278
278
  }
279
- async function yi(m) {
279
+ async function ea(m) {
280
280
  const { context: s, ref: l } = m;
281
- return (await Te({ context: s, ref: l }))?.attributes ?? [];
281
+ return (await xe({ context: s, ref: l }))?.attributes ?? [];
282
282
  }
283
- async function ha(m) {
284
- const { context: s, ref: l, options: i = {} } = m, { include: d, exclude: h, unwrap: y } = i, _ = await Te({ context: s, ref: l });
283
+ async function ya(m) {
284
+ const { context: s, ref: l, options: i = {} } = m, { include: d, exclude: h, unwrap: y } = i, _ = await xe({ context: s, ref: l });
285
285
  Ge(_, {
286
286
  detail: "No record found for provided ref",
287
287
  key: "ELEMENT_NOT_FOUND"
288
288
  });
289
- const D = await pa({
289
+ const D = await va({
290
290
  context: s,
291
291
  record: _,
292
292
  includeFilters: d ? [d] : void 0,
@@ -294,7 +294,7 @@ async function ha(m) {
294
294
  });
295
295
  return D ? y ? Ei({ tree: D, unwrapTagNames: y }) : D : dr({ record: _ });
296
296
  }
297
- async function pa(m) {
297
+ async function va(m) {
298
298
  const { context: s, record: l, includeFilters: i, exclude: d } = m;
299
299
  if (vi({ record: l, excludeFilters: d }))
300
300
  return dr({ record: l });
@@ -305,7 +305,7 @@ async function pa(m) {
305
305
  excludeFilters: d
306
306
  }), _ = (await Promise.all(
307
307
  h.map(
308
- ({ record: D, includeFilters: F }) => pa({ context: s, record: D, includeFilters: F, exclude: d })
308
+ ({ record: D, includeFilters: F }) => va({ context: s, record: D, includeFilters: F, exclude: d })
309
309
  )
310
310
  )).filter(
311
311
  (D) => D !== null
@@ -325,9 +325,9 @@ async function wi(m) {
325
325
  if (!l.children?.length) return [];
326
326
  const _ = (await Promise.all(
327
327
  l.children.map(
328
- (D) => Te({
328
+ (D) => xe({
329
329
  context: s,
330
- ref: Ee(D)
330
+ ref: ye(D)
331
331
  })
332
332
  )
333
333
  )).filter(
@@ -367,7 +367,7 @@ function Ei(m) {
367
367
  }
368
368
  return { ...s, tree: i(s.tree) };
369
369
  }
370
- class ma {
370
+ class ba {
371
371
  constructor(s, l) {
372
372
  this.store = s, this.dialecteConfig = l;
373
373
  }
@@ -416,7 +416,7 @@ class ma {
416
416
  * ```
417
417
  */
418
418
  async getRoot() {
419
- const s = await Te({
419
+ const s = await xe({
420
420
  context: this.context,
421
421
  ref: { tagName: this.dialecteConfig.rootElementName }
422
422
  });
@@ -437,7 +437,7 @@ class ma {
437
437
  * ```
438
438
  */
439
439
  async getRecord(s) {
440
- return Te({ context: this.context, ref: Ee(s) });
440
+ return xe({ context: this.context, ref: ye(s) });
441
441
  }
442
442
  /**
443
443
  * Get multiple records in a single call.
@@ -451,8 +451,8 @@ class ma {
451
451
  * ```
452
452
  */
453
453
  async getRecords(s) {
454
- const l = s.map((i) => Ee(i));
455
- return ca({ context: this.context, refs: l });
454
+ const l = s.map((i) => ye(i));
455
+ return ha({ context: this.context, refs: l });
456
456
  }
457
457
  /**
458
458
  * Get the first direct child of an element matching a given tag name.
@@ -468,7 +468,7 @@ class ma {
468
468
  */
469
469
  async getChild(s, l) {
470
470
  if (s)
471
- return ri({ context: this.context, ref: Ee(s), tagName: l });
471
+ return si({ context: this.context, ref: ye(s), tagName: l });
472
472
  }
473
473
  /**
474
474
  * Get all direct children of an element matching a given tag name.
@@ -483,7 +483,7 @@ class ma {
483
483
  * ```
484
484
  */
485
485
  async getChildren(s, l) {
486
- return s ? ai({ context: this.context, ref: Ee(s), tagName: l }) : [];
486
+ return s ? ui({ context: this.context, ref: ye(s), tagName: l }) : [];
487
487
  }
488
488
  /**
489
489
  * Get all records of a given tag name.
@@ -497,7 +497,7 @@ class ma {
497
497
  * ```
498
498
  */
499
499
  async getRecordsByTagName(s) {
500
- return la({ context: this.context, tagName: s });
500
+ return pa({ context: this.context, tagName: s });
501
501
  }
502
502
  /**
503
503
  * Find all descendants of an element, grouped by tag name.
@@ -512,10 +512,10 @@ class ma {
512
512
  * ```
513
513
  */
514
514
  async findDescendants(s, l) {
515
- return oi({
515
+ return li({
516
516
  context: this.context,
517
517
  dialecteConfig: this.dialecteConfig,
518
- ref: Ee(s),
518
+ ref: ye(s),
519
519
  filter: l
520
520
  });
521
521
  }
@@ -533,7 +533,7 @@ class ma {
533
533
  * ```
534
534
  */
535
535
  async findAncestors(s, l) {
536
- return s ? ii({ context: this.context, ref: Ee(s), options: l }) : [];
536
+ return s ? ci({ context: this.context, ref: ye(s), options: l }) : [];
537
537
  }
538
538
  /**
539
539
  * Build a full tree structure from an element down.
@@ -548,36 +548,23 @@ class ma {
548
548
  * ```
549
549
  */
550
550
  async getTree(s, l) {
551
- return ha({ context: this.context, ref: Ee(s), options: l });
551
+ return ya({ context: this.context, ref: ye(s), options: l });
552
552
  }
553
553
  async getAttribute(s, l) {
554
- const i = Ee(s), { fullObject: d } = l;
555
- return d ? mi({ context: this.context, ref: i, ...l }) : pi({ context: this.context, ref: i, ...l });
554
+ const i = ye(s), { fullObject: d } = l;
555
+ return d ? Zr({ context: this.context, ref: i, ...l }) : Hr({ context: this.context, ref: i, ...l });
556
556
  }
557
557
  async getAttributes(s, l) {
558
- const i = Ee(s), { fullObject: d } = l || {};
559
- return d ? yi({ context: this.context, ref: i, ...l }) : gi({ context: this.context, ref: i, ...l });
558
+ const i = ye(s), { fullObject: d } = l || {};
559
+ return d ? ea({ context: this.context, ref: i, ...l }) : Jr({ context: this.context, ref: i, ...l });
560
560
  }
561
- //== Any-typed companions (for union-element / untyped-ref call sites)
562
- /**
563
- * Get a single attribute value without element-type constraint.
564
- * Use when the element type is a union or unknown at the call site.
565
- * Returns `''` if the attribute is absent.
566
- */
567
561
  async getAnyAttribute(s, l) {
568
- return this.getAttribute(
569
- s,
570
- { name: l }
571
- );
562
+ const i = ye(s), { fullObject: d } = l;
563
+ return d ? Zr({ context: this.context, ref: i, ...l }) : Hr({ context: this.context, ref: i, ...l });
572
564
  }
573
- /**
574
- * Get all attributes as a plain `Record<string, string>` without element-type constraint.
575
- * Use when the element type is a union or unknown at the call site.
576
- */
577
- async getAnyAttributes(s) {
578
- return await this.getAttributes(
579
- s
580
- );
565
+ async getAnyAttributes(s, l) {
566
+ const i = ye(s), { fullObject: d } = l || {};
567
+ return d ? ea({ context: this.context, ref: i, ...l }) : Jr({ context: this.context, ref: i, ...l });
581
568
  }
582
569
  /**
583
570
  * Get the first direct child matching a tag name without element-type constraint.
@@ -653,20 +640,20 @@ function yr(m) {
653
640
  }
654
641
  }
655
642
  async function vr(m) {
656
- const { dialecteConfig: s, hooks: l, context: i, query: d, parentRef: h, params: y } = m, { id: _, tagName: D, attributes: F, namespace: $, value: G } = y, Q = await Te({ context: i, ref: h });
643
+ const { dialecteConfig: s, hooks: l, context: i, query: d, parentRef: h, params: y } = m, { id: _, tagName: D, attributes: F, namespace: X, value: G } = y, Q = await xe({ context: i, ref: h });
657
644
  Ge(Q, {
658
645
  detail: "Parent record not found",
659
646
  key: "ELEMENT_NOT_FOUND",
660
647
  ref: h
661
648
  });
662
- const fe = Ja({
649
+ const fe = ri({
663
650
  dialecteConfig: s,
664
651
  hooks: l,
665
652
  record: {
666
653
  id: _ ?? crypto.randomUUID(),
667
654
  tagName: D,
668
655
  attributes: F,
669
- namespace: $,
656
+ namespace: X,
670
657
  value: G,
671
658
  parent: { id: Q.id, tagName: Q.tagName },
672
659
  children: []
@@ -696,8 +683,8 @@ async function vr(m) {
696
683
  }
697
684
  return fe;
698
685
  }
699
- async function Ti(m) {
700
- const { dialecteConfig: s, hooks: l, context: i, query: d, parentRef: h, record: y, cumulativeCloneMappings: _ } = m, D = [], F = await ga({
686
+ async function xi(m) {
687
+ const { dialecteConfig: s, hooks: l, context: i, query: d, parentRef: h, record: y, cumulativeCloneMappings: _ } = m, D = [], F = await wa({
701
688
  dialecteConfig: s,
702
689
  hooks: l,
703
690
  context: i,
@@ -707,18 +694,18 @@ async function Ti(m) {
707
694
  mappings: D
708
695
  });
709
696
  if (_.push(...D), l?.afterDeepClone) {
710
- const $ = await l.afterDeepClone({
697
+ const X = await l.afterDeepClone({
711
698
  cumulativeCloneMappings: _,
712
699
  query: d
713
700
  });
714
- i.stagedOperations.push(...$);
701
+ i.stagedOperations.push(...X);
715
702
  }
716
703
  return {
717
704
  record: F,
718
705
  mappings: D
719
706
  };
720
707
  }
721
- async function ga(m) {
708
+ async function wa(m) {
722
709
  const { dialecteConfig: s, hooks: l, context: i, query: d, parentRef: h, record: y, mappings: _ } = m;
723
710
  let D = !0, F = y;
724
711
  if (l?.beforeClone) {
@@ -726,7 +713,7 @@ async function ga(m) {
726
713
  D = Q.shouldBeCloned, F = Q.transformedRecord;
727
714
  }
728
715
  if (!D) return F;
729
- const $ = await vr({
716
+ const X = await vr({
730
717
  dialecteConfig: s,
731
718
  hooks: l,
732
719
  context: i,
@@ -738,26 +725,26 @@ async function ga(m) {
738
725
  attributes: F.attributes,
739
726
  value: F.value
740
727
  }
741
- }), G = Ee(y);
728
+ }), G = ye(y);
742
729
  _.push({
743
730
  source: Object.assign(G, {
744
731
  attributes: [...y.attributes]
745
732
  }),
746
- target: Ee($)
733
+ target: ye(X)
747
734
  });
748
735
  for (const Q of F.tree)
749
- await ga({
736
+ await wa({
750
737
  dialecteConfig: s,
751
738
  hooks: l,
752
739
  context: i,
753
740
  query: d,
754
- parentRef: Ee($),
741
+ parentRef: ye(X),
755
742
  record: Q,
756
743
  mappings: _
757
744
  });
758
- return $;
745
+ return X;
759
746
  }
760
- function xi(m) {
747
+ function Ti(m) {
761
748
  const s = /* @__PURE__ */ new Map();
762
749
  for (const i of m) {
763
750
  const d = (i.status === "deleted" ? i.oldRecord : i.newRecord).id, h = s.get(d);
@@ -787,7 +774,7 @@ function xi(m) {
787
774
  };
788
775
  }
789
776
  async function Ni(m) {
790
- const { stagedOperations: s, store: l, documentState: i } = m, { creates: d, updates: h, deletes: y } = xi(s), _ = d.length + h.length + y.length;
777
+ const { stagedOperations: s, store: l, documentState: i } = m, { creates: d, updates: h, deletes: y } = Ti(s), _ = d.length + h.length + y.length;
791
778
  i.loading = !0, i.progress = { message: "Committing changes...", current: 0, total: _ };
792
779
  try {
793
780
  await l.commit({
@@ -804,7 +791,7 @@ async function Ni(m) {
804
791
  i.lastUpdate = Date.now();
805
792
  }
806
793
  async function Ai(m) {
807
- const { hooks: s, context: l, query: i, ref: d } = m, h = await Te({ context: l, ref: d });
794
+ const { hooks: s, context: l, query: i, ref: d } = m, h = await xe({ context: l, ref: d });
808
795
  if (Ge(h, {
809
796
  detail: `Record not found (tagName=${d.tagName}, id=${d.id})`,
810
797
  key: "ELEMENT_NOT_FOUND",
@@ -816,8 +803,8 @@ async function Ai(m) {
816
803
  const F = await s.beforeDelete({ record: h, query: i });
817
804
  yr({ context: l, operations: F });
818
805
  }
819
- await ya({ context: l, record: h }), Ze({ context: l, status: "deleted", record: h });
820
- const y = Ee(h.parent), _ = await Te({ context: l, ref: y });
806
+ await _a({ context: l, record: h }), Ze({ context: l, status: "deleted", record: h });
807
+ const y = ye(h.parent), _ = await xe({ context: l, ref: y });
821
808
  Ge(_, {
822
809
  detail: `Parent record not found (tagName=${h.parent.tagName}, id=${h.parent.id})`,
823
810
  key: "ELEMENT_NOT_FOUND"
@@ -828,11 +815,11 @@ async function Ai(m) {
828
815
  };
829
816
  return Ze({ context: l, status: "updated", oldRecord: _, newRecord: D }), D;
830
817
  }
831
- async function ya(m) {
818
+ async function _a(m) {
832
819
  const { context: s, record: l } = m;
833
820
  for (const i of l.children) {
834
- const d = Ee(i), h = await Te({ context: s, ref: d });
835
- h && (h.children.length > 0 && await ya({ context: s, record: h }), Ze({ context: s, status: "deleted", record: h }));
821
+ const d = ye(i), h = await xe({ context: s, ref: d });
822
+ h && (h.children.length > 0 && await _a({ context: s, record: h }), Ze({ context: s, status: "deleted", record: h }));
836
823
  }
837
824
  }
838
825
  async function Oi(m) {
@@ -845,7 +832,7 @@ async function Oi(m) {
845
832
  });
846
833
  if (D) return D;
847
834
  } else {
848
- const D = { tagName: y.tagName, id: y.id }, F = await Te({ context: i, ref: D });
835
+ const D = { tagName: y.tagName, id: y.id }, F = await xe({ context: i, ref: D });
849
836
  if (F) return F;
850
837
  }
851
838
  return vr({
@@ -862,20 +849,20 @@ function Ci(m) {
862
849
  return Object.values(s).some((i) => i !== void 0 && i !== "") ? s : void 0;
863
850
  }
864
851
  async function Di(m) {
865
- const { dialecteConfig: s, hooks: l, context: i, query: d, ref: h, params: y } = m, { attributes: _, value: D } = y, F = await Te({ context: i, ref: h });
852
+ const { dialecteConfig: s, hooks: l, context: i, query: d, ref: h, params: y } = m, { attributes: _, value: D } = y, F = await xe({ context: i, ref: h });
866
853
  Ge(F, {
867
854
  detail: `Record not found (tagName=${h.tagName}, id=${h.id})`,
868
855
  key: "ELEMENT_NOT_FOUND",
869
856
  ref: h
870
857
  });
871
- let $ = F.attributes;
858
+ let X = F.attributes;
872
859
  if (_) {
873
- const Q = ei({
860
+ const Q = ai({
874
861
  dialecteConfig: s,
875
862
  tagName: F.tagName,
876
863
  attributes: _
877
864
  });
878
- $ = [...F.attributes.filter(
865
+ X = [...F.attributes.filter(
879
866
  (M) => !Q.some((B) => B.name === M.name)
880
867
  ), ...Q].filter(
881
868
  (M) => M.value !== void 0 && M.value !== null
@@ -883,7 +870,7 @@ async function Di(m) {
883
870
  }
884
871
  const G = {
885
872
  ...F,
886
- attributes: $,
873
+ attributes: X,
887
874
  value: D !== void 0 ? D : F.value
888
875
  };
889
876
  if (Ze({ context: i, status: "updated", oldRecord: F, newRecord: G }), l?.afterUpdated) {
@@ -896,7 +883,7 @@ async function Di(m) {
896
883
  }
897
884
  return G;
898
885
  }
899
- class Ii extends ma {
886
+ class Ii extends ba {
900
887
  constructor(s, l, i, d) {
901
888
  super(s, l), this.stagedOperations = [], this.recordCache = /* @__PURE__ */ new Map(), this.cumulativeCloneMappings = [], this.documentState = i, this.hooks = d;
902
889
  }
@@ -938,7 +925,7 @@ class Ii extends ma {
938
925
  async addChild(s, l) {
939
926
  return vr({
940
927
  context: this.context,
941
- parentRef: Ee(s),
928
+ parentRef: ye(s),
942
929
  params: l,
943
930
  dialecteConfig: this.dialecteConfig,
944
931
  hooks: this.hooks,
@@ -969,7 +956,7 @@ class Ii extends ma {
969
956
  async ensureChild(s, l) {
970
957
  return Oi({
971
958
  context: this.context,
972
- parentRef: Ee(s),
959
+ parentRef: ye(s),
973
960
  params: l,
974
961
  dialecteConfig: this.dialecteConfig,
975
962
  hooks: this.hooks,
@@ -993,7 +980,7 @@ class Ii extends ma {
993
980
  async update(s, l) {
994
981
  return Di({
995
982
  context: this.context,
996
- ref: Ee(s),
983
+ ref: ye(s),
997
984
  params: l,
998
985
  dialecteConfig: this.dialecteConfig,
999
986
  hooks: this.hooks,
@@ -1014,7 +1001,7 @@ class Ii extends ma {
1014
1001
  async delete(s) {
1015
1002
  return Ai({
1016
1003
  context: this.context,
1017
- ref: Ee(s),
1004
+ ref: ye(s),
1018
1005
  hooks: this.hooks,
1019
1006
  query: this
1020
1007
  });
@@ -1033,11 +1020,11 @@ class Ii extends ma {
1033
1020
  * ```
1034
1021
  */
1035
1022
  async deepClone(s, l) {
1036
- return Ti({
1023
+ return xi({
1037
1024
  dialecteConfig: this.dialecteConfig,
1038
1025
  hooks: this.hooks,
1039
1026
  context: this.context,
1040
- parentRef: Ee(s),
1027
+ parentRef: ye(s),
1041
1028
  record: l,
1042
1029
  query: this,
1043
1030
  cumulativeCloneMappings: this.cumulativeCloneMappings
@@ -1075,10 +1062,10 @@ class Ii extends ma {
1075
1062
  });
1076
1063
  }
1077
1064
  }
1078
- function Xt(m) {
1065
+ function $t(m) {
1079
1066
  return m.recordCache !== void 0;
1080
1067
  }
1081
- class va {
1068
+ class Ea {
1082
1069
  constructor(s, l, i, d) {
1083
1070
  this.state = {
1084
1071
  loading: !1,
@@ -1103,7 +1090,7 @@ class va {
1103
1090
  * Override in dialecte subclass to return a domain-specific Query.
1104
1091
  */
1105
1092
  createQuery() {
1106
- return new ma(this.store, this.config);
1093
+ return new ba(this.store, this.config);
1107
1094
  }
1108
1095
  get query() {
1109
1096
  return this.withQueryExtensions(this.createQuery());
@@ -1239,7 +1226,7 @@ class va {
1239
1226
  }
1240
1227
  }
1241
1228
  var Ri = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
1242
- function ba(m) {
1229
+ function xa(m) {
1243
1230
  return m && m.__esModule && Object.prototype.hasOwnProperty.call(m, "default") ? m.default : m;
1244
1231
  }
1245
1232
  function Si(m) {
@@ -1266,9 +1253,9 @@ function Si(m) {
1266
1253
  });
1267
1254
  }), l;
1268
1255
  }
1269
- var xn = { exports: {} }, ki = xn.exports, Hr;
1256
+ var Tn = { exports: {} }, ki = Tn.exports, ta;
1270
1257
  function Pi() {
1271
- return Hr || (Hr = 1, (function(m, s) {
1258
+ return ta || (ta = 1, (function(m, s) {
1272
1259
  (function(l, i) {
1273
1260
  m.exports = i();
1274
1261
  })(ki, function() {
@@ -1295,9 +1282,9 @@ function Pi() {
1295
1282
  }), e;
1296
1283
  }
1297
1284
  typeof Promise > "u" || h.Promise || (h.Promise = Promise);
1298
- var F = Object.getPrototypeOf, $ = {}.hasOwnProperty;
1285
+ var F = Object.getPrototypeOf, X = {}.hasOwnProperty;
1299
1286
  function G(e, t) {
1300
- return $.call(e, t);
1287
+ return X.call(e, t);
1301
1288
  }
1302
1289
  function Q(e, t) {
1303
1290
  typeof t == "function" && (t = t(F(e))), (typeof Reflect > "u" ? y : Reflect.ownKeys)(t).forEach(function(n) {
@@ -1314,7 +1301,7 @@ function Pi() {
1314
1301
  } };
1315
1302
  }
1316
1303
  var ue = Object.getOwnPropertyDescriptor, ie = [].slice;
1317
- function xe(e, t, n) {
1304
+ function Te(e, t, n) {
1318
1305
  return ie.call(e, t, n);
1319
1306
  }
1320
1307
  function te(e, t) {
@@ -1389,7 +1376,7 @@ function Pi() {
1389
1376
  function St(e) {
1390
1377
  return Yt.call(e).slice(8, -1);
1391
1378
  }
1392
- var kt = typeof Symbol < "u" ? Symbol.iterator : "@@iterator", ye = typeof kt == "symbol" ? function(e) {
1379
+ var kt = typeof Symbol < "u" ? Symbol.iterator : "@@iterator", ve = typeof kt == "symbol" ? function(e) {
1393
1380
  var t;
1394
1381
  return e != null && (t = e[kt]) && t.apply(e);
1395
1382
  } : function() {
@@ -1404,7 +1391,7 @@ function Pi() {
1404
1391
  if (arguments.length === 1) {
1405
1392
  if (_(e)) return e.slice();
1406
1393
  if (this === ze && typeof e == "string") return [e];
1407
- if (a = ye(e)) {
1394
+ if (a = ve(e)) {
1408
1395
  for (n = []; !(r = a.next()).done; ) n.push(r.value);
1409
1396
  return n;
1410
1397
  }
@@ -1491,7 +1478,7 @@ function Pi() {
1491
1478
  this.onsuccess = this.onerror = null, t.apply(this, arguments), n && (this.onsuccess = this.onsuccess ? E(n, this.onsuccess) : n), r && (this.onerror = this.onerror ? E(r, this.onerror) : r);
1492
1479
  };
1493
1480
  }
1494
- function be(e, t) {
1481
+ function we(e, t) {
1495
1482
  return e === c ? t : function(n) {
1496
1483
  var r = e.apply(this, arguments);
1497
1484
  D(n, r);
@@ -1526,10 +1513,10 @@ function Pi() {
1526
1513
  if (typeof crypto > "u" || !crypto.subtle) return [e, F(e), e];
1527
1514
  var t = crypto.subtle.digest("SHA-512", new Uint8Array([0]));
1528
1515
  return [t, F(t), e];
1529
- })(), nt = Ve[0], Le = Ve[1], Ve = Ve[2], Le = Le && Le.then, Xe = nt && nt.constructor, Cn = !!Ve, Pt = function(e, t) {
1530
- Ft.push([e, t]), Qt && (queueMicrotask(Da), Qt = !1);
1516
+ })(), nt = Ve[0], Le = Ve[1], Ve = Ve[2], Le = Le && Le.then, $e = nt && nt.constructor, Cn = !!Ve, Pt = function(e, t) {
1517
+ Ft.push([e, t]), Qt && (queueMicrotask(ka), Qt = !1);
1531
1518
  }, Dn = !0, Qt = !0, ft = [], Ht = [], In = o, rt = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: c, pgp: !1, env: {}, finalize: c }, Y = rt, Ft = [], dt = 0, Zt = [];
1532
- function X(e) {
1519
+ function $(e) {
1533
1520
  if (typeof this != "object") throw new TypeError("Promises must be constructed via new");
1534
1521
  this._listeners = [], this._lib = !1;
1535
1522
  var t = this._PSD = Y;
@@ -1542,10 +1529,10 @@ function Pi() {
1542
1529
  a(function(u) {
1543
1530
  if (r._state === null) {
1544
1531
  if (u === r) throw new TypeError("A promise cannot be resolved with itself.");
1545
- var f = r._lib && Tt();
1532
+ var f = r._lib && xt();
1546
1533
  u && typeof u.then == "function" ? n(r, function(p, v) {
1547
- u instanceof X ? u._then(p, v) : u.then(p, v);
1548
- }) : (r._state = !0, r._value = u, wr(r)), f && xt();
1534
+ u instanceof $ ? u._then(p, v) : u.then(p, v);
1535
+ }) : (r._state = !0, r._value = u, wr(r)), f && Tt();
1549
1536
  }
1550
1537
  }, Sn.bind(null, r));
1551
1538
  } catch (u) {
@@ -1556,8 +1543,8 @@ function Pi() {
1556
1543
  var Rn = { get: function() {
1557
1544
  var e = Y, t = nn;
1558
1545
  function n(r, a) {
1559
- var u = this, f = !e.global && (e !== Y || t !== nn), p = f && !it(), v = new X(function(w, x) {
1560
- kn(u, new br(Er(r, e, f, p), Er(a, e, f, p), w, x, e));
1546
+ var u = this, f = !e.global && (e !== Y || t !== nn), p = f && !it(), v = new $(function(w, T) {
1547
+ kn(u, new br(Er(r, e, f, p), Er(a, e, f, p), w, T, e));
1561
1548
  });
1562
1549
  return this._consoleTask && (v._consoleTask = this._consoleTask), v;
1563
1550
  }
@@ -1572,9 +1559,9 @@ function Pi() {
1572
1559
  }
1573
1560
  function Sn(e, t) {
1574
1561
  var n, r;
1575
- Ht.push(t), e._state === null && (n = e._lib && Tt(), t = In(t), e._state = !1, e._value = t, r = e, ft.some(function(a) {
1562
+ Ht.push(t), e._state === null && (n = e._lib && xt(), t = In(t), e._state = !1, e._value = t, r = e, ft.some(function(a) {
1576
1563
  return a._value === r._value;
1577
- }) || ft.push(r), wr(e), n && xt());
1564
+ }) || ft.push(r), wr(e), n && Tt());
1578
1565
  }
1579
1566
  function wr(e) {
1580
1567
  var t = e._listeners;
@@ -1589,10 +1576,10 @@ function Pi() {
1589
1576
  if (e._state !== null) {
1590
1577
  var n = e._state ? t.onFulfilled : t.onRejected;
1591
1578
  if (n === null) return (e._state ? t.resolve : t.reject)(e._value);
1592
- ++t.psd.ref, ++dt, Pt(Ca, [n, e, t]);
1579
+ ++t.psd.ref, ++dt, Pt(Sa, [n, e, t]);
1593
1580
  } else e._listeners.push(t);
1594
1581
  }
1595
- function Ca(e, t, n) {
1582
+ function Sa(e, t, n) {
1596
1583
  try {
1597
1584
  var r, a = t._value;
1598
1585
  !t._state && Ht.length && (Ht = []), r = Ne && t._consoleTask ? t._consoleTask.run(function() {
@@ -1606,16 +1593,16 @@ function Pi() {
1606
1593
  --dt == 0 && Pn(), --n.psd.ref || n.psd.finalize();
1607
1594
  }
1608
1595
  }
1609
- function Da() {
1596
+ function ka() {
1610
1597
  ht(rt, function() {
1611
- Tt() && xt();
1598
+ xt() && Tt();
1612
1599
  });
1613
1600
  }
1614
- function Tt() {
1601
+ function xt() {
1615
1602
  var e = Dn;
1616
1603
  return Qt = Dn = !1, e;
1617
1604
  }
1618
- function xt() {
1605
+ function Tt() {
1619
1606
  var e, t, n;
1620
1607
  do
1621
1608
  for (; 0 < Ft.length; ) for (e = Ft, Ft = [], n = e.length, t = 0; t < n; ++t) {
@@ -1633,22 +1620,22 @@ function Pi() {
1633
1620
  for (var t = Zt.slice(0), n = t.length; n; ) t[--n]();
1634
1621
  }
1635
1622
  function Jt(e) {
1636
- return new X(Fe, !1, e);
1623
+ return new $(Fe, !1, e);
1637
1624
  }
1638
1625
  function pe(e, t) {
1639
1626
  var n = Y;
1640
1627
  return function() {
1641
- var r = Tt(), a = Y;
1628
+ var r = xt(), a = Y;
1642
1629
  try {
1643
1630
  return ot(n, !0), e.apply(this, arguments);
1644
1631
  } catch (u) {
1645
1632
  t && t(u);
1646
1633
  } finally {
1647
- ot(a, !1), r && xt();
1634
+ ot(a, !1), r && Tt();
1648
1635
  }
1649
1636
  };
1650
1637
  }
1651
- Q(X.prototype, { then: Rn, _then: function(e, t) {
1638
+ Q($.prototype, { then: Rn, _then: function(e, t) {
1652
1639
  kn(this, new br(null, null, e, t, Y));
1653
1640
  }, catch: function(e) {
1654
1641
  if (arguments.length === 1) return this.then(null, e);
@@ -1660,42 +1647,42 @@ function Pi() {
1660
1647
  });
1661
1648
  }, finally: function(e) {
1662
1649
  return this.then(function(t) {
1663
- return X.resolve(e()).then(function() {
1650
+ return $.resolve(e()).then(function() {
1664
1651
  return t;
1665
1652
  });
1666
1653
  }, function(t) {
1667
- return X.resolve(e()).then(function() {
1654
+ return $.resolve(e()).then(function() {
1668
1655
  return Jt(t);
1669
1656
  });
1670
1657
  });
1671
1658
  }, timeout: function(e, t) {
1672
1659
  var n = this;
1673
- return e < 1 / 0 ? new X(function(r, a) {
1660
+ return e < 1 / 0 ? new $(function(r, a) {
1674
1661
  var u = setTimeout(function() {
1675
1662
  return a(new z.Timeout(t));
1676
1663
  }, e);
1677
1664
  n.then(r, a).finally(clearTimeout.bind(null, u));
1678
1665
  }) : this;
1679
- } }), typeof Symbol < "u" && Symbol.toStringTag && M(X.prototype, Symbol.toStringTag, "Dexie.Promise"), rt.env = _r(), Q(X, { all: function() {
1666
+ } }), typeof Symbol < "u" && Symbol.toStringTag && M($.prototype, Symbol.toStringTag, "Dexie.Promise"), rt.env = _r(), Q($, { all: function() {
1680
1667
  var e = Ie.apply(null, arguments).map(rn);
1681
- return new X(function(t, n) {
1668
+ return new $(function(t, n) {
1682
1669
  e.length === 0 && t([]);
1683
1670
  var r = e.length;
1684
1671
  e.forEach(function(a, u) {
1685
- return X.resolve(a).then(function(f) {
1672
+ return $.resolve(a).then(function(f) {
1686
1673
  e[u] = f, --r || t(e);
1687
1674
  }, n);
1688
1675
  });
1689
1676
  });
1690
1677
  }, resolve: function(e) {
1691
- return e instanceof X ? e : e && typeof e.then == "function" ? new X(function(t, n) {
1678
+ return e instanceof $ ? e : e && typeof e.then == "function" ? new $(function(t, n) {
1692
1679
  e.then(t, n);
1693
- }) : new X(Fe, !0, e);
1680
+ }) : new $(Fe, !0, e);
1694
1681
  }, reject: Jt, race: function() {
1695
1682
  var e = Ie.apply(null, arguments).map(rn);
1696
- return new X(function(t, n) {
1683
+ return new $(function(t, n) {
1697
1684
  e.map(function(r) {
1698
- return X.resolve(r).then(t, n);
1685
+ return $.resolve(r).then(t, n);
1699
1686
  });
1700
1687
  });
1701
1688
  }, PSD: { get: function() {
@@ -1713,7 +1700,7 @@ function Pi() {
1713
1700
  }, set: function(e) {
1714
1701
  In = e;
1715
1702
  } }, follow: function(e, t) {
1716
- return new X(function(n, r) {
1703
+ return new $(function(n, r) {
1717
1704
  return at(function(a, u) {
1718
1705
  var f = Y;
1719
1706
  f.unhandleds = [], f.onunhandled = u, f.finalize = E(function() {
@@ -1728,13 +1715,13 @@ function Pi() {
1728
1715
  }, f.finalize), e();
1729
1716
  }, t, n, r);
1730
1717
  });
1731
- } }), Xe && (Xe.allSettled && M(X, "allSettled", function() {
1718
+ } }), $e && ($e.allSettled && M($, "allSettled", function() {
1732
1719
  var e = Ie.apply(null, arguments).map(rn);
1733
- return new X(function(t) {
1720
+ return new $(function(t) {
1734
1721
  e.length === 0 && t([]);
1735
1722
  var n = e.length, r = new Array(n);
1736
1723
  e.forEach(function(a, u) {
1737
- return X.resolve(a).then(function(f) {
1724
+ return $.resolve(a).then(function(f) {
1738
1725
  return r[u] = { status: "fulfilled", value: f };
1739
1726
  }, function(f) {
1740
1727
  return r[u] = { status: "rejected", reason: f };
@@ -1743,41 +1730,41 @@ function Pi() {
1743
1730
  });
1744
1731
  });
1745
1732
  });
1746
- }), Xe.any && typeof AggregateError < "u" && M(X, "any", function() {
1733
+ }), $e.any && typeof AggregateError < "u" && M($, "any", function() {
1747
1734
  var e = Ie.apply(null, arguments).map(rn);
1748
- return new X(function(t, n) {
1735
+ return new $(function(t, n) {
1749
1736
  e.length === 0 && n(new AggregateError([]));
1750
1737
  var r = e.length, a = new Array(r);
1751
1738
  e.forEach(function(u, f) {
1752
- return X.resolve(u).then(function(p) {
1739
+ return $.resolve(u).then(function(p) {
1753
1740
  return t(p);
1754
1741
  }, function(p) {
1755
1742
  a[f] = p, --r || n(new AggregateError(a));
1756
1743
  });
1757
1744
  });
1758
1745
  });
1759
- }), Xe.withResolvers && (X.withResolvers = Xe.withResolvers));
1760
- var Ce = { awaits: 0, echoes: 0, id: 0 }, Ia = 0, en = [], tn = 0, nn = 0, Ra = 0;
1746
+ }), $e.withResolvers && ($.withResolvers = $e.withResolvers));
1747
+ var Ce = { awaits: 0, echoes: 0, id: 0 }, Pa = 0, en = [], tn = 0, nn = 0, Fa = 0;
1761
1748
  function at(e, t, n, r) {
1762
1749
  var a = Y, u = Object.create(a);
1763
- return u.parent = a, u.ref = 0, u.global = !1, u.id = ++Ra, rt.env, u.env = Cn ? { Promise: X, PromiseProp: { value: X, configurable: !0, writable: !0 }, all: X.all, race: X.race, allSettled: X.allSettled, any: X.any, resolve: X.resolve, reject: X.reject } : {}, t && D(u, t), ++a.ref, u.finalize = function() {
1750
+ return u.parent = a, u.ref = 0, u.global = !1, u.id = ++Fa, rt.env, u.env = Cn ? { Promise: $, PromiseProp: { value: $, configurable: !0, writable: !0 }, all: $.all, race: $.race, allSettled: $.allSettled, any: $.any, resolve: $.resolve, reject: $.reject } : {}, t && D(u, t), ++a.ref, u.finalize = function() {
1764
1751
  --this.parent.ref || this.parent.finalize();
1765
1752
  }, r = ht(u, e, n, r), u.ref === 0 && u.finalize(), r;
1766
1753
  }
1767
1754
  function Nt() {
1768
- return Ce.id || (Ce.id = ++Ia), ++Ce.awaits, Ce.echoes += zt, Ce.id;
1755
+ return Ce.id || (Ce.id = ++Pa), ++Ce.awaits, Ce.echoes += zt, Ce.id;
1769
1756
  }
1770
1757
  function it() {
1771
1758
  return !!Ce.awaits && (--Ce.awaits == 0 && (Ce.id = 0), Ce.echoes = Ce.awaits * zt, !0);
1772
1759
  }
1773
1760
  function rn(e) {
1774
- return Ce.echoes && e && e.constructor === Xe ? (Nt(), e.then(function(t) {
1761
+ return Ce.echoes && e && e.constructor === $e ? (Nt(), e.then(function(t) {
1775
1762
  return it(), t;
1776
1763
  }, function(t) {
1777
- return it(), we(t);
1764
+ return it(), _e(t);
1778
1765
  })) : e;
1779
1766
  }
1780
- function Sa() {
1767
+ function Ba() {
1781
1768
  var e = en[en.length - 1];
1782
1769
  en.pop(), ot(e, !1);
1783
1770
  }
@@ -1785,7 +1772,7 @@ function Pi() {
1785
1772
  var n, r = Y;
1786
1773
  (t ? !Ce.echoes || tn++ && e === Y : !tn || --tn && e === Y) || queueMicrotask(t ? (function(a) {
1787
1774
  ++nn, Ce.echoes && --Ce.echoes != 0 || (Ce.echoes = Ce.awaits = Ce.id = 0), en.push(Y), ot(a, !0);
1788
- }).bind(null, e) : Sa), e !== Y && (Y = e, r === rt && (rt.env = _r()), Cn && (n = rt.env.Promise, t = e.env, (r.global || e.global) && (Object.defineProperty(h, "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))));
1775
+ }).bind(null, e) : Ba), e !== Y && (Y = e, r === rt && (rt.env = _r()), Cn && (n = rt.env.Promise, t = e.env, (r.global || e.global) && (Object.defineProperty(h, "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))));
1789
1776
  }
1790
1777
  function _r() {
1791
1778
  var e = h.Promise;
@@ -1811,16 +1798,16 @@ function Pi() {
1811
1798
  };
1812
1799
  }
1813
1800
  function Fn(e) {
1814
- Promise === Xe && Ce.echoes === 0 ? tn === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
1801
+ Promise === $e && Ce.echoes === 0 ? tn === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
1815
1802
  }
1816
1803
  ("" + Le).indexOf("[native code]") === -1 && (Nt = it = c);
1817
- var we = X.reject, pt = "￿", Qe = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", Tr = "String expected.", At = [], an = "__dbnames", Bn = "readonly", Mn = "readwrite";
1804
+ var _e = $.reject, pt = "￿", Qe = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", xr = "String expected.", At = [], an = "__dbnames", Bn = "readonly", Mn = "readwrite";
1818
1805
  function mt(e, t) {
1819
1806
  return e ? t ? function() {
1820
1807
  return e.apply(this, arguments) && t.apply(this, arguments);
1821
1808
  } : e : t;
1822
1809
  }
1823
- var xr = { type: 3, lower: -1 / 0, lowerOpen: !1, upper: [[]], upperOpen: !1 };
1810
+ var Tr = { type: 3, lower: -1 / 0, lowerOpen: !1, upper: [[]], upperOpen: !1 };
1824
1811
  function on(e) {
1825
1812
  return typeof e != "string" || /\./.test(e) ? function(t) {
1826
1813
  return t;
@@ -1848,8 +1835,8 @@ function Pi() {
1848
1835
  case "Array":
1849
1836
  return (function(a, u) {
1850
1837
  for (var f = a.length, p = u.length, v = f < p ? f : p, w = 0; w < v; ++w) {
1851
- var x = re(a[w], u[w]);
1852
- if (x !== 0) return x;
1838
+ var T = re(a[w], u[w]);
1839
+ if (T !== 0) return T;
1853
1840
  }
1854
1841
  return f === p ? 0 : f < p ? -1 : 1;
1855
1842
  })(e, t);
@@ -1877,56 +1864,56 @@ function Pi() {
1877
1864
  }
1878
1865
  var Cr = (he.prototype._trans = function(e, t, n) {
1879
1866
  var r = this._tx || Y.trans, a = this.name, u = Ne && typeof console < "u" && console.createTask && console.createTask("Dexie: ".concat(e === "readonly" ? "read" : "write", " ").concat(this.name));
1880
- function f(w, x, g) {
1867
+ function f(w, T, g) {
1881
1868
  if (!g.schema[a]) throw new z.NotFound("Table " + a + " not part of transaction");
1882
1869
  return t(g.idbtrans, g);
1883
1870
  }
1884
- var p = Tt();
1871
+ var p = xt();
1885
1872
  try {
1886
1873
  var v = r && r.db._novip === this.db._novip ? r === Y.trans ? r._promise(e, f, n) : at(function() {
1887
1874
  return r._promise(e, f, n);
1888
- }, { trans: r, transless: Y.transless || Y }) : (function w(x, g, O, b) {
1889
- if (x.idbdb && (x._state.openComplete || Y.letThrough || x._vip)) {
1890
- var T = x._createTransaction(g, O, x._dbSchema);
1875
+ }, { trans: r, transless: Y.transless || Y }) : (function w(T, g, O, b) {
1876
+ if (T.idbdb && (T._state.openComplete || Y.letThrough || T._vip)) {
1877
+ var x = T._createTransaction(g, O, T._dbSchema);
1891
1878
  try {
1892
- T.create(), x._state.PR1398_maxLoop = 3;
1879
+ x.create(), T._state.PR1398_maxLoop = 3;
1893
1880
  } catch (A) {
1894
- return A.name === lt.InvalidState && x.isOpen() && 0 < --x._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), x.close({ disableAutoOpen: !1 }), x.open().then(function() {
1895
- return w(x, g, O, b);
1896
- })) : we(A);
1881
+ return A.name === lt.InvalidState && T.isOpen() && 0 < --T._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), T.close({ disableAutoOpen: !1 }), T.open().then(function() {
1882
+ return w(T, g, O, b);
1883
+ })) : _e(A);
1897
1884
  }
1898
- return T._promise(g, function(A, N) {
1885
+ return x._promise(g, function(A, N) {
1899
1886
  return at(function() {
1900
- return Y.trans = T, b(A, N, T);
1887
+ return Y.trans = x, b(A, N, x);
1901
1888
  });
1902
1889
  }).then(function(A) {
1903
1890
  if (g === "readwrite") try {
1904
- T.idbtrans.commit();
1891
+ x.idbtrans.commit();
1905
1892
  } catch {
1906
1893
  }
1907
- return g === "readonly" ? A : T._completion.then(function() {
1894
+ return g === "readonly" ? A : x._completion.then(function() {
1908
1895
  return A;
1909
1896
  });
1910
1897
  });
1911
1898
  }
1912
- if (x._state.openComplete) return we(new z.DatabaseClosed(x._state.dbOpenError));
1913
- if (!x._state.isBeingOpened) {
1914
- if (!x._state.autoOpen) return we(new z.DatabaseClosed());
1915
- x.open().catch(c);
1899
+ if (T._state.openComplete) return _e(new z.DatabaseClosed(T._state.dbOpenError));
1900
+ if (!T._state.isBeingOpened) {
1901
+ if (!T._state.autoOpen) return _e(new z.DatabaseClosed());
1902
+ T.open().catch(c);
1916
1903
  }
1917
- return x._state.dbReadyPromise.then(function() {
1918
- return w(x, g, O, b);
1904
+ return T._state.dbReadyPromise.then(function() {
1905
+ return w(T, g, O, b);
1919
1906
  });
1920
1907
  })(this.db, e, [this.name], f);
1921
1908
  return u && (v._consoleTask = u, v = v.catch(function(w) {
1922
- return console.trace(w), we(w);
1909
+ return console.trace(w), _e(w);
1923
1910
  })), v;
1924
1911
  } finally {
1925
- p && xt();
1912
+ p && Tt();
1926
1913
  }
1927
1914
  }, he.prototype.get = function(e, t) {
1928
1915
  var n = this;
1929
- return e && e.constructor === Object ? this.where(e).first(t) : e == null ? we(new z.Type("Invalid argument to Table.get()")) : this._trans("readonly", function(r) {
1916
+ return e && e.constructor === Object ? this.where(e).first(t) : e == null ? _e(new z.Type("Invalid argument to Table.get()")) : this._trans("readonly", function(r) {
1930
1917
  return n.core.get({ trans: r, key: e }).then(function(a) {
1931
1918
  return n.hook.reading.fire(a);
1932
1919
  });
@@ -1959,14 +1946,14 @@ function Pi() {
1959
1946
  return re(p, v) === 0;
1960
1947
  }
1961
1948
  var f = t.reduce(function(g, v) {
1962
- var w = g[0], x = g[1], g = r[v], O = e[v];
1963
- return [w || g, w || !g ? mt(x, g && g.multi ? function(b) {
1964
- return b = de(b, v), _(b) && b.some(function(T) {
1965
- return a(O, T);
1949
+ var w = g[0], T = g[1], g = r[v], O = e[v];
1950
+ return [w || g, w || !g ? mt(T, g && g.multi ? function(b) {
1951
+ return b = de(b, v), _(b) && b.some(function(x) {
1952
+ return a(O, x);
1966
1953
  });
1967
1954
  } : function(b) {
1968
1955
  return a(O, de(b, v));
1969
- }) : x];
1956
+ }) : T];
1970
1957
  }, [null, null]), u = f[0], f = f[1];
1971
1958
  return u ? this.where(u.name).equals(e[u.keyPath]).filter(f) : n ? this.filter(f) : this.where(t).equals("");
1972
1959
  }, he.prototype.filter = function(e) {
@@ -1994,10 +1981,10 @@ function Pi() {
1994
1981
  }
1995
1982
  (this.schema.mappedClass = e).prototype instanceof Nr && ((function(v, w) {
1996
1983
  if (typeof w != "function" && w !== null) throw new TypeError("Class extends value " + String(w) + " is not a constructor or null");
1997
- function x() {
1984
+ function T() {
1998
1985
  this.constructor = v;
1999
1986
  }
2000
- l(v, w), v.prototype = w === null ? Object.create(w) : (x.prototype = w.prototype, new x());
1987
+ l(v, w), v.prototype = w === null ? Object.create(w) : (T.prototype = w.prototype, new T());
2001
1988
  })(a, t = e), Object.defineProperty(a.prototype, "db", { get: function() {
2002
1989
  return n;
2003
1990
  }, enumerable: !1, configurable: !0 }), a.prototype.table = function() {
@@ -2008,12 +1995,12 @@ function Pi() {
2008
1995
  });
2009
1996
  function p(v) {
2010
1997
  if (!v) return v;
2011
- var w, x = Object.create(e.prototype);
1998
+ var w, T = Object.create(e.prototype);
2012
1999
  for (w in v) if (!u.has(w)) try {
2013
- x[w] = v[w];
2000
+ T[w] = v[w];
2014
2001
  } catch {
2015
2002
  }
2016
- return x;
2003
+ return T;
2017
2004
  }
2018
2005
  return this.schema.readHook && this.hook.reading.unsubscribe(this.schema.readHook), this.schema.readHook = p, this.hook("reading", p), e;
2019
2006
  }, he.prototype.defineClass = function() {
@@ -2025,7 +2012,7 @@ function Pi() {
2025
2012
  return u && a && (f = on(u)(e)), this._trans("readwrite", function(p) {
2026
2013
  return n.core.mutate({ trans: p, type: "add", keys: t != null ? [t] : null, values: [f] });
2027
2014
  }).then(function(p) {
2028
- return p.numFailures ? X.reject(p.failures[0]) : p.lastResult;
2015
+ return p.numFailures ? $.reject(p.failures[0]) : p.lastResult;
2029
2016
  }).then(function(p) {
2030
2017
  if (u) try {
2031
2018
  le(e, u, p);
@@ -2034,13 +2021,13 @@ function Pi() {
2034
2021
  return p;
2035
2022
  });
2036
2023
  }, he.prototype.update = function(e, t) {
2037
- return typeof e != "object" || _(e) ? this.where(":id").equals(e).modify(t) : (e = de(e, this.schema.primKey.keyPath), e === void 0 ? we(new z.InvalidArgument("Given object does not contain its primary key")) : this.where(":id").equals(e).modify(t));
2024
+ return typeof e != "object" || _(e) ? this.where(":id").equals(e).modify(t) : (e = de(e, this.schema.primKey.keyPath), e === void 0 ? _e(new z.InvalidArgument("Given object does not contain its primary key")) : this.where(":id").equals(e).modify(t));
2038
2025
  }, he.prototype.put = function(e, t) {
2039
2026
  var n = this, r = this.schema.primKey, a = r.auto, u = r.keyPath, f = e;
2040
2027
  return u && a && (f = on(u)(e)), this._trans("readwrite", function(p) {
2041
2028
  return n.core.mutate({ trans: p, type: "put", values: [f], keys: t != null ? [t] : null });
2042
2029
  }).then(function(p) {
2043
- return p.numFailures ? X.reject(p.failures[0]) : p.lastResult;
2030
+ return p.numFailures ? $.reject(p.failures[0]) : p.lastResult;
2044
2031
  }).then(function(p) {
2045
2032
  if (u) try {
2046
2033
  le(e, u, p);
@@ -2054,17 +2041,17 @@ function Pi() {
2054
2041
  return t.core.mutate({ trans: n, type: "delete", keys: [e] }).then(function(r) {
2055
2042
  return sn(t, [e], r);
2056
2043
  }).then(function(r) {
2057
- return r.numFailures ? X.reject(r.failures[0]) : void 0;
2044
+ return r.numFailures ? $.reject(r.failures[0]) : void 0;
2058
2045
  });
2059
2046
  });
2060
2047
  }, he.prototype.clear = function() {
2061
2048
  var e = this;
2062
2049
  return this._trans("readwrite", function(t) {
2063
- return e.core.mutate({ trans: t, type: "deleteRange", range: xr }).then(function(n) {
2050
+ return e.core.mutate({ trans: t, type: "deleteRange", range: Tr }).then(function(n) {
2064
2051
  return sn(e, null, n);
2065
2052
  });
2066
2053
  }).then(function(t) {
2067
- return t.numFailures ? X.reject(t.failures[0]) : void 0;
2054
+ return t.numFailures ? $.reject(t.failures[0]) : void 0;
2068
2055
  });
2069
2056
  }, he.prototype.bulkGet = function(e) {
2070
2057
  var t = this;
@@ -2082,10 +2069,10 @@ function Pi() {
2082
2069
  if (w && a) throw new z.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
2083
2070
  if (a && a.length !== e.length) throw new z.InvalidArgument("Arguments objects and keys must have the same length");
2084
2071
  var v = e.length, w = w && p ? e.map(on(w)) : e;
2085
- return r.core.mutate({ trans: f, type: "add", keys: a, values: w, wantResults: u }).then(function(T) {
2086
- var g = T.numFailures, O = T.results, b = T.lastResult, T = T.failures;
2072
+ return r.core.mutate({ trans: f, type: "add", keys: a, values: w, wantResults: u }).then(function(x) {
2073
+ var g = x.numFailures, O = x.results, b = x.lastResult, x = x.failures;
2087
2074
  if (g === 0) return u ? O : b;
2088
- throw new Me("".concat(r.name, ".bulkAdd(): ").concat(g, " of ").concat(v, " operations failed"), T);
2075
+ throw new Me("".concat(r.name, ".bulkAdd(): ").concat(g, " of ").concat(v, " operations failed"), x);
2089
2076
  });
2090
2077
  });
2091
2078
  }, he.prototype.bulkPut = function(e, t, n) {
@@ -2095,10 +2082,10 @@ function Pi() {
2095
2082
  if (w && a) throw new z.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
2096
2083
  if (a && a.length !== e.length) throw new z.InvalidArgument("Arguments objects and keys must have the same length");
2097
2084
  var v = e.length, w = w && p ? e.map(on(w)) : e;
2098
- return r.core.mutate({ trans: f, type: "put", keys: a, values: w, wantResults: u }).then(function(T) {
2099
- var g = T.numFailures, O = T.results, b = T.lastResult, T = T.failures;
2085
+ return r.core.mutate({ trans: f, type: "put", keys: a, values: w, wantResults: u }).then(function(x) {
2086
+ var g = x.numFailures, O = x.results, b = x.lastResult, x = x.failures;
2100
2087
  if (g === 0) return u ? O : b;
2101
- throw new Me("".concat(r.name, ".bulkPut(): ").concat(g, " of ").concat(v, " operations failed"), T);
2088
+ throw new Me("".concat(r.name, ".bulkPut(): ").concat(g, " of ").concat(v, " operations failed"), x);
2102
2089
  });
2103
2090
  });
2104
2091
  }, he.prototype.bulkUpdate = function(e) {
@@ -2111,10 +2098,10 @@ function Pi() {
2111
2098
  return n.getMany({ trans: f, keys: r, cache: "clone" }).then(function(p) {
2112
2099
  var v = [], w = [];
2113
2100
  e.forEach(function(g, O) {
2114
- var b = g.key, T = g.changes, A = p[O];
2101
+ var b = g.key, x = g.changes, A = p[O];
2115
2102
  if (A) {
2116
- for (var N = 0, C = Object.keys(T); N < C.length; N++) {
2117
- var R = C[N], k = T[R];
2103
+ for (var N = 0, C = Object.keys(x); N < C.length; N++) {
2104
+ var R = C[N], k = x[R];
2118
2105
  if (R === t.schema.primKey.keyPath) {
2119
2106
  if (re(k, b) !== 0) throw new z.Constraint("Cannot update primary key in bulkUpdate()");
2120
2107
  } else le(A, R, k);
@@ -2122,15 +2109,15 @@ function Pi() {
2122
2109
  u.push(O), v.push(b), w.push(A);
2123
2110
  }
2124
2111
  });
2125
- var x = v.length;
2112
+ var T = v.length;
2126
2113
  return n.mutate({ trans: f, type: "put", keys: v, values: w, updates: { keys: r, changeSpecs: a } }).then(function(g) {
2127
2114
  var O = g.numFailures, b = g.failures;
2128
- if (O === 0) return x;
2129
- for (var T = 0, A = Object.keys(b); T < A.length; T++) {
2130
- var N, C = A[T], R = u[Number(C)];
2115
+ if (O === 0) return T;
2116
+ for (var x = 0, A = Object.keys(b); x < A.length; x++) {
2117
+ var N, C = A[x], R = u[Number(C)];
2131
2118
  R != null && (N = b[C], delete b[C], b[R] = N);
2132
2119
  }
2133
- throw new Me("".concat(t.name, ".bulkUpdate(): ").concat(O, " of ").concat(x, " operations failed"), b);
2120
+ throw new Me("".concat(t.name, ".bulkUpdate(): ").concat(O, " of ").concat(T, " operations failed"), b);
2134
2121
  });
2135
2122
  });
2136
2123
  });
@@ -2164,14 +2151,14 @@ function Pi() {
2164
2151
  if (typeof f != "object") {
2165
2152
  var w;
2166
2153
  p = p || Re;
2167
- var x = { subscribers: [], fire: v = v || c, subscribe: function(g) {
2168
- x.subscribers.indexOf(g) === -1 && (x.subscribers.push(g), x.fire = p(x.fire, g));
2154
+ var T = { subscribers: [], fire: v = v || c, subscribe: function(g) {
2155
+ T.subscribers.indexOf(g) === -1 && (T.subscribers.push(g), T.fire = p(T.fire, g));
2169
2156
  }, unsubscribe: function(g) {
2170
- x.subscribers = x.subscribers.filter(function(O) {
2157
+ T.subscribers = T.subscribers.filter(function(O) {
2171
2158
  return O !== g;
2172
- }), x.fire = x.subscribers.reduce(p, v);
2159
+ }), T.fire = T.subscribers.reduce(p, v);
2173
2160
  } };
2174
- return n[f] = t[f] = x;
2161
+ return n[f] = t[f] = T;
2175
2162
  }
2176
2163
  y(w = f).forEach(function(g) {
2177
2164
  var O = w[g];
@@ -2179,7 +2166,7 @@ function Pi() {
2179
2166
  else {
2180
2167
  if (O !== "asap") throw new z.InvalidArgument("Invalid event config");
2181
2168
  var b = u(g, o, function() {
2182
- for (var T = arguments.length, A = new Array(T); T--; ) A[T] = arguments[T];
2169
+ for (var x = arguments.length, A = new Array(x); x--; ) A[x] = arguments[x];
2183
2170
  b.subscribers.forEach(function(N) {
2184
2171
  Z(function() {
2185
2172
  N.apply(null, A);
@@ -2219,12 +2206,12 @@ function Pi() {
2219
2206
  var a = e.replayFilter ? mt(e.filter, e.replayFilter()) : e.filter;
2220
2207
  if (e.or) {
2221
2208
  var u = {}, f = function(p, v, w) {
2222
- var x, g;
2209
+ var T, g;
2223
2210
  a && !a(v, w, function(O) {
2224
2211
  return v.stop(O);
2225
2212
  }, function(O) {
2226
2213
  return v.fail(O);
2227
- }) || ((g = "" + (x = v.primaryKey)) == "[object ArrayBuffer]" && (g = "" + new Uint8Array(x)), G(u, g) || (u[g] = !0, t(p, v, w)));
2214
+ }) || ((g = "" + (T = v.primaryKey)) == "[object ArrayBuffer]" && (g = "" + new Uint8Array(T)), G(u, g) || (u[g] = !0, t(p, v, w)));
2228
2215
  };
2229
2216
  return Promise.all([e.or._iterate(f, n), Ir(Dr(e, r, n), e.algorithm, f, !e.keysOnly && e.valueMapper)]);
2230
2217
  }
@@ -2282,12 +2269,12 @@ function Pi() {
2282
2269
  function Rr(e) {
2283
2270
  this["@@propmod"] = e;
2284
2271
  }
2285
- var ka = (oe.prototype._read = function(e, t) {
2272
+ var Ma = (oe.prototype._read = function(e, t) {
2286
2273
  var n = this._ctx;
2287
- return n.error ? n.table._trans(null, we.bind(null, n.error)) : n.table._trans("readonly", e).then(t);
2274
+ return n.error ? n.table._trans(null, _e.bind(null, n.error)) : n.table._trans("readonly", e).then(t);
2288
2275
  }, oe.prototype._write = function(e) {
2289
2276
  var t = this._ctx;
2290
- return t.error ? t.table._trans(null, we.bind(null, t.error)) : t.table._trans("readwrite", e, "locked");
2277
+ return t.error ? t.table._trans(null, _e.bind(null, t.error)) : t.table._trans("readwrite", e, "locked");
2291
2278
  }, oe.prototype._addAlgorithm = function(e) {
2292
2279
  var t = this._ctx;
2293
2280
  t.algorithm = mt(t.algorithm, e);
@@ -2454,47 +2441,47 @@ function Pi() {
2454
2441
  }
2455
2442
  return R;
2456
2443
  });
2457
- var p = n.table.core, g = p.schema.primaryKey, v = g.outbound, w = g.extractKey, x = 200, g = t.db._options.modifyChunkSize;
2458
- g && (x = typeof g == "object" ? g[p.name] || g["*"] || 200 : g);
2444
+ var p = n.table.core, g = p.schema.primaryKey, v = g.outbound, w = g.extractKey, T = 200, g = t.db._options.modifyChunkSize;
2445
+ g && (T = typeof g == "object" ? g[p.name] || g["*"] || 200 : g);
2459
2446
  function O(C, P) {
2460
2447
  var k = P.failures, P = P.numFailures;
2461
- T += C - P;
2448
+ x += C - P;
2462
2449
  for (var j = 0, L = y(k); j < L.length; j++) {
2463
2450
  var K = L[j];
2464
2451
  b.push(k[K]);
2465
2452
  }
2466
2453
  }
2467
- var b = [], T = 0, A = [], N = e === Sr;
2454
+ var b = [], x = 0, A = [], N = e === Sr;
2468
2455
  return t.clone().primaryKeys().then(function(C) {
2469
2456
  function R(P) {
2470
- var j = Math.min(x, C.length - P), L = C.slice(P, P + j);
2457
+ var j = Math.min(T, C.length - P), L = C.slice(P, P + j);
2471
2458
  return (N ? Promise.resolve([]) : p.getMany({ trans: r, keys: L, cache: "immutable" })).then(function(K) {
2472
2459
  var q = [], V = [], U = v ? [] : null, W = N ? L : [];
2473
2460
  if (!N) for (var ne = 0; ne < j; ++ne) {
2474
2461
  var ae = K[ne], ee = { value: Ye(ae), primKey: C[P + ne] };
2475
2462
  f.call(ee, ee.value, ee) !== !1 && (ee.value == null ? W.push(C[P + ne]) : v || re(w(ae), w(ee.value)) === 0 ? (V.push(ee.value), v && U.push(C[P + ne])) : (W.push(C[P + ne]), q.push(ee.value)));
2476
2463
  }
2477
- return Promise.resolve(0 < q.length && p.mutate({ trans: r, type: "add", values: q }).then(function(ve) {
2478
- for (var J in ve.failures) W.splice(parseInt(J), 1);
2479
- O(q.length, ve);
2464
+ return Promise.resolve(0 < q.length && p.mutate({ trans: r, type: "add", values: q }).then(function(be) {
2465
+ for (var J in be.failures) W.splice(parseInt(J), 1);
2466
+ O(q.length, be);
2480
2467
  })).then(function() {
2481
- return (0 < V.length || k && typeof e == "object") && p.mutate({ trans: r, type: "put", keys: U, values: V, criteria: k, changeSpec: typeof e != "function" && e, isAdditionalChunk: 0 < P }).then(function(ve) {
2482
- return O(V.length, ve);
2468
+ return (0 < V.length || k && typeof e == "object") && p.mutate({ trans: r, type: "put", keys: U, values: V, criteria: k, changeSpec: typeof e != "function" && e, isAdditionalChunk: 0 < P }).then(function(be) {
2469
+ return O(V.length, be);
2483
2470
  });
2484
2471
  }).then(function() {
2485
- return (0 < W.length || k && N) && p.mutate({ trans: r, type: "delete", keys: W, criteria: k, isAdditionalChunk: 0 < P }).then(function(ve) {
2486
- return sn(n.table, W, ve);
2487
- }).then(function(ve) {
2488
- return O(W.length, ve);
2472
+ return (0 < W.length || k && N) && p.mutate({ trans: r, type: "delete", keys: W, criteria: k, isAdditionalChunk: 0 < P }).then(function(be) {
2473
+ return sn(n.table, W, be);
2474
+ }).then(function(be) {
2475
+ return O(W.length, be);
2489
2476
  });
2490
2477
  }).then(function() {
2491
- return C.length > P + j && R(P + x);
2478
+ return C.length > P + j && R(P + T);
2492
2479
  });
2493
2480
  });
2494
2481
  }
2495
2482
  var k = Ot(n) && n.limit === 1 / 0 && (typeof e != "function" || N) && { index: n.index, range: n.range };
2496
2483
  return R(0).then(function() {
2497
- if (0 < b.length) throw new tt("Error modifying one or more objects", b, T, A);
2484
+ if (0 < b.length) throw new tt("Error modifying one or more objects", b, x, A);
2498
2485
  return C.length;
2499
2486
  });
2500
2487
  });
@@ -2519,10 +2506,10 @@ function Pi() {
2519
2506
  var Sr = function(e, t) {
2520
2507
  return t.value = null;
2521
2508
  };
2522
- function Pa(e, t) {
2509
+ function ja(e, t) {
2523
2510
  return e < t ? -1 : e === t ? 0 : 1;
2524
2511
  }
2525
- function Fa(e, t) {
2512
+ function Ka(e, t) {
2526
2513
  return t < e ? -1 : e === t ? 0 : 1;
2527
2514
  }
2528
2515
  function Ke(e, t, n) {
@@ -2534,20 +2521,20 @@ function Pi() {
2534
2521
  }).limit(0);
2535
2522
  }
2536
2523
  function ln(e, t, n, r) {
2537
- var a, u, f, p, v, w, x, g = n.length;
2538
- if (!n.every(function(T) {
2539
- return typeof T == "string";
2540
- })) return Ke(e, Tr);
2541
- function O(T) {
2542
- a = T === "next" ? function(N) {
2524
+ var a, u, f, p, v, w, T, g = n.length;
2525
+ if (!n.every(function(x) {
2526
+ return typeof x == "string";
2527
+ })) return Ke(e, xr);
2528
+ function O(x) {
2529
+ a = x === "next" ? function(N) {
2543
2530
  return N.toUpperCase();
2544
2531
  } : function(N) {
2545
2532
  return N.toLowerCase();
2546
- }, u = T === "next" ? function(N) {
2533
+ }, u = x === "next" ? function(N) {
2547
2534
  return N.toLowerCase();
2548
2535
  } : function(N) {
2549
2536
  return N.toUpperCase();
2550
- }, f = T === "next" ? Pa : Fa;
2537
+ }, f = x === "next" ? ja : Ka;
2551
2538
  var A = n.map(function(N) {
2552
2539
  return { lower: u(N), upper: a(N) };
2553
2540
  }).sort(function(N, C) {
@@ -2557,32 +2544,32 @@ function Pi() {
2557
2544
  return N.upper;
2558
2545
  }), v = A.map(function(N) {
2559
2546
  return N.lower;
2560
- }), x = (w = T) === "next" ? "" : r;
2547
+ }), T = (w = x) === "next" ? "" : r;
2561
2548
  }
2562
2549
  O("next"), e = new e.Collection(e, function() {
2563
2550
  return st(p[0], v[g - 1] + r);
2564
- }), e._ondirectionchange = function(T) {
2565
- O(T);
2551
+ }), e._ondirectionchange = function(x) {
2552
+ O(x);
2566
2553
  };
2567
2554
  var b = 0;
2568
- return e._addAlgorithm(function(T, A, N) {
2569
- var C = T.key;
2555
+ return e._addAlgorithm(function(x, A, N) {
2556
+ var C = x.key;
2570
2557
  if (typeof C != "string") return !1;
2571
2558
  var R = u(C);
2572
2559
  if (t(R, v, b)) return !0;
2573
2560
  for (var k = null, P = b; P < g; ++P) {
2574
2561
  var j = (function(L, K, q, V, U, W) {
2575
2562
  for (var ne = Math.min(L.length, V.length), ae = -1, ee = 0; ee < ne; ++ee) {
2576
- var ve = K[ee];
2577
- if (ve !== V[ee]) return U(L[ee], q[ee]) < 0 ? L.substr(0, ee) + q[ee] + q.substr(ee + 1) : U(L[ee], V[ee]) < 0 ? L.substr(0, ee) + V[ee] + q.substr(ee + 1) : 0 <= ae ? L.substr(0, ae) + K[ae] + q.substr(ae + 1) : null;
2578
- U(L[ee], ve) < 0 && (ae = ee);
2563
+ var be = K[ee];
2564
+ if (be !== V[ee]) return U(L[ee], q[ee]) < 0 ? L.substr(0, ee) + q[ee] + q.substr(ee + 1) : U(L[ee], V[ee]) < 0 ? L.substr(0, ee) + V[ee] + q.substr(ee + 1) : 0 <= ae ? L.substr(0, ae) + K[ae] + q.substr(ae + 1) : null;
2565
+ U(L[ee], be) < 0 && (ae = ee);
2579
2566
  }
2580
2567
  return ne < V.length && W === "next" ? L + q.substr(L.length) : ne < L.length && W === "prev" ? L.substr(0, q.length) : ae < 0 ? null : L.substr(0, ae) + V[ae] + q.substr(ae + 1);
2581
2568
  })(C, R, p[P], v[P], f, w);
2582
2569
  j === null && k === null ? b = P + 1 : (k === null || 0 < f(k, j)) && (k = j);
2583
2570
  }
2584
2571
  return A(k !== null ? function() {
2585
- T.continue(k + x);
2572
+ x.continue(k + T);
2586
2573
  } : N), !1;
2587
2574
  }), e;
2588
2575
  }
@@ -2624,7 +2611,7 @@ function Pi() {
2624
2611
  return st(void 0, e);
2625
2612
  });
2626
2613
  }, De.prototype.startsWith = function(e) {
2627
- return typeof e != "string" ? Ke(this, Tr) : this.between(e, e + pt, !0, !0);
2614
+ return typeof e != "string" ? Ke(this, xr) : this.between(e, e + pt, !0, !0);
2628
2615
  }, De.prototype.startsWithIgnoreCase = function(e) {
2629
2616
  return e === "" ? this.startsWith(e) : ln(this, function(t, n) {
2630
2617
  return t.indexOf(n[0]) === 0;
@@ -2686,12 +2673,12 @@ function Pi() {
2686
2673
  if (!C.every(function(R) {
2687
2674
  return R[0] !== void 0 && R[1] !== void 0 && a(R[0], R[1]) <= 0;
2688
2675
  })) return Ke(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", z.InvalidArgument);
2689
- var v = !t || t.includeLowers !== !1, w = t && t.includeUppers === !0, x, g = a;
2676
+ var v = !t || t.includeLowers !== !1, w = t && t.includeUppers === !0, T, g = a;
2690
2677
  function O(R, k) {
2691
2678
  return g(R[0], k[0]);
2692
2679
  }
2693
2680
  try {
2694
- (x = C.reduce(function(R, k) {
2681
+ (T = C.reduce(function(R, k) {
2695
2682
  for (var P = 0, j = R.length; P < j; ++P) {
2696
2683
  var L = R[P];
2697
2684
  if (r(k[0], L[1]) < 0 && 0 < r(k[1], L[0])) {
@@ -2704,23 +2691,23 @@ function Pi() {
2704
2691
  } catch {
2705
2692
  return Ke(this, Qe);
2706
2693
  }
2707
- var b = 0, T = w ? function(R) {
2708
- return 0 < a(R, x[b][1]);
2694
+ var b = 0, x = w ? function(R) {
2695
+ return 0 < a(R, T[b][1]);
2709
2696
  } : function(R) {
2710
- return 0 <= a(R, x[b][1]);
2697
+ return 0 <= a(R, T[b][1]);
2711
2698
  }, A = v ? function(R) {
2712
- return 0 < u(R, x[b][0]);
2699
+ return 0 < u(R, T[b][0]);
2713
2700
  } : function(R) {
2714
- return 0 <= u(R, x[b][0]);
2715
- }, N = T, C = new this.Collection(this, function() {
2716
- return st(x[0][0], x[x.length - 1][1], !v, !w);
2701
+ return 0 <= u(R, T[b][0]);
2702
+ }, N = x, C = new this.Collection(this, function() {
2703
+ return st(T[0][0], T[T.length - 1][1], !v, !w);
2717
2704
  });
2718
2705
  return C._ondirectionchange = function(R) {
2719
- g = R === "next" ? (N = T, a) : (N = A, u), x.sort(O);
2706
+ g = R === "next" ? (N = x, a) : (N = A, u), T.sort(O);
2720
2707
  }, C._addAlgorithm(function(R, k, P) {
2721
- for (var j, L = R.key; N(L); ) if (++b === x.length) return k(P), !1;
2722
- return !T(j = L) && !A(j) || (n._cmp(L, x[b][1]) === 0 || n._cmp(L, x[b][0]) === 0 || k(function() {
2723
- g === a ? R.continue(x[b][0]) : R.continue(x[b][1]);
2708
+ for (var j, L = R.key; N(L); ) if (++b === T.length) return k(P), !1;
2709
+ return !x(j = L) && !A(j) || (n._cmp(L, T[b][1]) === 0 || n._cmp(L, T[b][0]) === 0 || k(function() {
2710
+ g === a ? R.continue(T[b][0]) : R.continue(T[b][1]);
2724
2711
  }), !1);
2725
2712
  }), C;
2726
2713
  }, De.prototype.startsWithAnyOf = function() {
@@ -2733,7 +2720,7 @@ function Pi() {
2733
2720
  }, De);
2734
2721
  function De() {
2735
2722
  }
2736
- function $e(e) {
2723
+ function Xe(e) {
2737
2724
  return pe(function(t) {
2738
2725
  return Kt(t), e(t.target.error), !1;
2739
2726
  });
@@ -2741,7 +2728,7 @@ function Pi() {
2741
2728
  function Kt(e) {
2742
2729
  e.stopPropagation && e.stopPropagation(), e.preventDefault && e.preventDefault();
2743
2730
  }
2744
- var qt = "storagemutated", qn = "x-storagemutated-1", ut = Bt(null, qt), Ba = (We.prototype._lock = function() {
2731
+ var qt = "storagemutated", qn = "x-storagemutated-1", ut = Bt(null, qt), qa = (We.prototype._lock = function() {
2745
2732
  return H(!Y.global), ++this._reculock, this._reculock !== 1 || Y.global || (Y.lockOwnerFor = this), this;
2746
2733
  }, We.prototype._unlock = function() {
2747
2734
  if (H(!Y.global), --this._reculock == 0) for (Y.global || (Y.lockOwnerFor = null); 0 < this._blockedFuncs.length && !this._locked(); ) {
@@ -2776,15 +2763,15 @@ function Pi() {
2776
2763
  }), this;
2777
2764
  }, We.prototype._promise = function(e, t, n) {
2778
2765
  var r = this;
2779
- if (e === "readwrite" && this.mode !== "readwrite") return we(new z.ReadOnly("Transaction is readonly"));
2780
- if (!this.active) return we(new z.TransactionInactive());
2781
- if (this._locked()) return new X(function(u, f) {
2766
+ if (e === "readwrite" && this.mode !== "readwrite") return _e(new z.ReadOnly("Transaction is readonly"));
2767
+ if (!this.active) return _e(new z.TransactionInactive());
2768
+ if (this._locked()) return new $(function(u, f) {
2782
2769
  r._blockedFuncs.push([function() {
2783
2770
  r._promise(e, t, n).then(u, f);
2784
2771
  }, Y]);
2785
2772
  });
2786
2773
  if (n) return at(function() {
2787
- var u = new X(function(f, p) {
2774
+ var u = new $(function(f, p) {
2788
2775
  r._lock();
2789
2776
  var v = t(f, p, r);
2790
2777
  v && v.then && v.then(f, p);
@@ -2793,7 +2780,7 @@ function Pi() {
2793
2780
  return r._unlock();
2794
2781
  }), u._lib = !0, u;
2795
2782
  });
2796
- var a = new X(function(u, f) {
2783
+ var a = new $(function(u, f) {
2797
2784
  var p = t(u, f, r);
2798
2785
  p && p.then && p.then(u, f);
2799
2786
  });
@@ -2801,7 +2788,7 @@ function Pi() {
2801
2788
  }, We.prototype._root = function() {
2802
2789
  return this.parent ? this.parent._root() : this;
2803
2790
  }, We.prototype.waitFor = function(e) {
2804
- var t, n = this._root(), r = X.resolve(e);
2791
+ var t, n = this._root(), r = $.resolve(e);
2805
2792
  n._waitingFor ? n._waitingFor = n._waitingFor.then(function() {
2806
2793
  return r;
2807
2794
  }) : (n._waitingFor = r, n._waitingQueue = [], t = n.idbtrans.objectStore(n.storeNames[0]), (function u() {
@@ -2809,7 +2796,7 @@ function Pi() {
2809
2796
  n._waitingFor && (t.get(-1 / 0).onsuccess = u);
2810
2797
  })());
2811
2798
  var a = n._waitingFor;
2812
- return new X(function(u, f) {
2799
+ return new $(function(u, f) {
2813
2800
  r.then(function(p) {
2814
2801
  return n._waitingQueue.push(pe(u.bind(null, p)));
2815
2802
  }, function(p) {
@@ -2868,34 +2855,34 @@ function Pi() {
2868
2855
  function Br(e) {
2869
2856
  return [].slice.call(e);
2870
2857
  }
2871
- var Ma = 0;
2858
+ var La = 0;
2872
2859
  function Ut(e) {
2873
2860
  return e == null ? ":id" : typeof e == "string" ? e : "[".concat(e.join("+"), "]");
2874
2861
  }
2875
- function ja(e, t, v) {
2862
+ function Ua(e, t, v) {
2876
2863
  function r(N) {
2877
2864
  if (N.type === 3) return null;
2878
2865
  if (N.type === 4) throw new Error("Cannot convert never type to IDBKeyRange");
2879
- var b = N.lower, T = N.upper, A = N.lowerOpen, N = N.upperOpen;
2880
- return b === void 0 ? T === void 0 ? null : t.upperBound(T, !!N) : T === void 0 ? t.lowerBound(b, !!A) : t.bound(b, T, !!A, !!N);
2866
+ var b = N.lower, x = N.upper, A = N.lowerOpen, N = N.upperOpen;
2867
+ return b === void 0 ? x === void 0 ? null : t.upperBound(x, !!N) : x === void 0 ? t.lowerBound(b, !!A) : t.bound(b, x, !!A, !!N);
2881
2868
  }
2882
2869
  function a(O) {
2883
- var b, T = O.name;
2884
- return { name: T, schema: O, mutate: function(A) {
2870
+ var b, x = O.name;
2871
+ return { name: x, schema: O, mutate: function(A) {
2885
2872
  var N = A.trans, C = A.type, R = A.keys, k = A.values, P = A.range;
2886
2873
  return new Promise(function(j, L) {
2887
2874
  j = pe(j);
2888
- var K = N.objectStore(T), q = K.keyPath == null, V = C === "put" || C === "add";
2875
+ var K = N.objectStore(x), q = K.keyPath == null, V = C === "put" || C === "add";
2889
2876
  if (!V && C !== "delete" && C !== "deleteRange") throw new Error("Invalid operation type: " + C);
2890
2877
  var U, W = (R || k || { length: 1 }).length;
2891
2878
  if (R && k && R.length !== k.length) throw new Error("Given keys array must have same length as given values array.");
2892
2879
  if (W === 0) return j({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
2893
2880
  function ne(Be) {
2894
- ++ve, Kt(Be);
2881
+ ++be, Kt(Be);
2895
2882
  }
2896
- var ae = [], ee = [], ve = 0;
2883
+ var ae = [], ee = [], be = 0;
2897
2884
  if (C === "deleteRange") {
2898
- if (P.type === 4) return j({ numFailures: ve, failures: ee, results: [], lastResult: void 0 });
2885
+ if (P.type === 4) return j({ numFailures: be, failures: ee, results: [], lastResult: void 0 });
2899
2886
  P.type === 3 ? ae.push(U = K.clear()) : ae.push(U = K.delete(r(P)));
2900
2887
  } else {
2901
2888
  var q = V ? q ? [k, R] : [k, null] : [R, null], J = q[0], ke = q[1];
@@ -2905,7 +2892,7 @@ function Pi() {
2905
2892
  function En(Be) {
2906
2893
  Be = Be.target.result, ae.forEach(function(vt, sr) {
2907
2894
  return vt.error != null && (ee[sr] = vt.error);
2908
- }), j({ numFailures: ve, failures: ee, results: C === "delete" ? R : ae.map(function(vt) {
2895
+ }), j({ numFailures: be, failures: ee, results: C === "delete" ? R : ae.map(function(vt) {
2909
2896
  return vt.result;
2910
2897
  }), lastResult: Be });
2911
2898
  }
@@ -2917,40 +2904,40 @@ function Pi() {
2917
2904
  var N = A.trans, C = A.keys;
2918
2905
  return new Promise(function(R, k) {
2919
2906
  R = pe(R);
2920
- for (var P, j = N.objectStore(T), L = C.length, K = new Array(L), q = 0, V = 0, U = function(ae) {
2907
+ for (var P, j = N.objectStore(x), L = C.length, K = new Array(L), q = 0, V = 0, U = function(ae) {
2921
2908
  ae = ae.target, K[ae._pos] = ae.result, ++V === q && R(K);
2922
- }, W = $e(k), ne = 0; ne < L; ++ne) C[ne] != null && ((P = j.get(C[ne]))._pos = ne, P.onsuccess = U, P.onerror = W, ++q);
2909
+ }, W = Xe(k), ne = 0; ne < L; ++ne) C[ne] != null && ((P = j.get(C[ne]))._pos = ne, P.onsuccess = U, P.onerror = W, ++q);
2923
2910
  q === 0 && R(K);
2924
2911
  });
2925
2912
  }, get: function(A) {
2926
2913
  var N = A.trans, C = A.key;
2927
2914
  return new Promise(function(R, k) {
2928
2915
  R = pe(R);
2929
- var P = N.objectStore(T).get(C);
2916
+ var P = N.objectStore(x).get(C);
2930
2917
  P.onsuccess = function(j) {
2931
2918
  return R(j.target.result);
2932
- }, P.onerror = $e(k);
2919
+ }, P.onerror = Xe(k);
2933
2920
  });
2934
2921
  }, query: (b = w, function(A) {
2935
2922
  return new Promise(function(N, C) {
2936
2923
  N = pe(N);
2937
- var R, k, P, q = A.trans, j = A.values, L = A.limit, U = A.query, K = L === 1 / 0 ? void 0 : L, V = U.index, U = U.range, q = q.objectStore(T), V = V.isPrimaryKey ? q : q.index(V.name), U = r(U);
2924
+ var R, k, P, q = A.trans, j = A.values, L = A.limit, U = A.query, K = L === 1 / 0 ? void 0 : L, V = U.index, U = U.range, q = q.objectStore(x), V = V.isPrimaryKey ? q : q.index(V.name), U = r(U);
2938
2925
  if (L === 0) return N({ result: [] });
2939
2926
  b ? ((K = j ? V.getAll(U, K) : V.getAllKeys(U, K)).onsuccess = function(W) {
2940
2927
  return N({ result: W.target.result });
2941
- }, K.onerror = $e(C)) : (R = 0, k = !j && "openKeyCursor" in V ? V.openKeyCursor(U) : V.openCursor(U), P = [], k.onsuccess = function(W) {
2928
+ }, K.onerror = Xe(C)) : (R = 0, k = !j && "openKeyCursor" in V ? V.openKeyCursor(U) : V.openCursor(U), P = [], k.onsuccess = function(W) {
2942
2929
  var ne = k.result;
2943
2930
  return ne ? (P.push(j ? ne.value : ne.primaryKey), ++R === L ? N({ result: P }) : void ne.continue()) : N({ result: P });
2944
- }, k.onerror = $e(C));
2931
+ }, k.onerror = Xe(C));
2945
2932
  });
2946
2933
  }), openCursor: function(A) {
2947
2934
  var N = A.trans, C = A.values, R = A.query, k = A.reverse, P = A.unique;
2948
2935
  return new Promise(function(j, L) {
2949
2936
  j = pe(j);
2950
- var V = R.index, K = R.range, q = N.objectStore(T), q = V.isPrimaryKey ? q : q.index(V.name), V = k ? P ? "prevunique" : "prev" : P ? "nextunique" : "next", U = !C && "openKeyCursor" in q ? q.openKeyCursor(r(K), V) : q.openCursor(r(K), V);
2951
- U.onerror = $e(L), U.onsuccess = pe(function(W) {
2952
- var ne, ae, ee, ve, J = U.result;
2953
- J ? (J.___id = ++Ma, J.done = !1, ne = J.continue.bind(J), ae = (ae = J.continuePrimaryKey) && ae.bind(J), ee = J.advance.bind(J), ve = function() {
2937
+ var V = R.index, K = R.range, q = N.objectStore(x), q = V.isPrimaryKey ? q : q.index(V.name), V = k ? P ? "prevunique" : "prev" : P ? "nextunique" : "next", U = !C && "openKeyCursor" in q ? q.openKeyCursor(r(K), V) : q.openCursor(r(K), V);
2938
+ U.onerror = Xe(L), U.onsuccess = pe(function(W) {
2939
+ var ne, ae, ee, be, J = U.result;
2940
+ J ? (J.___id = ++La, J.done = !1, ne = J.continue.bind(J), ae = (ae = J.continuePrimaryKey) && ae.bind(J), ee = J.advance.bind(J), be = function() {
2954
2941
  throw new Error("Cursor not stopped");
2955
2942
  }, J.trans = N, J.stop = J.continue = J.continuePrimaryKey = J.advance = function() {
2956
2943
  throw new Error("Cursor not started");
@@ -2973,8 +2960,8 @@ function Pi() {
2973
2960
  }, J.stop();
2974
2961
  }
2975
2962
  var En = new Promise(function(Be, vt) {
2976
- Be = pe(Be), U.onerror = $e(vt), J.fail = vt, J.stop = function(sr) {
2977
- J.stop = J.continue = J.continuePrimaryKey = J.advance = ve, Be(sr);
2963
+ Be = pe(Be), U.onerror = Xe(vt), J.fail = vt, J.stop = function(sr) {
2964
+ J.stop = J.continue = J.continuePrimaryKey = J.advance = be, Be(sr);
2978
2965
  };
2979
2966
  });
2980
2967
  return U.onsuccess = pe(function(Be) {
@@ -2986,17 +2973,17 @@ function Pi() {
2986
2973
  }, count: function(A) {
2987
2974
  var N = A.query, C = A.trans, R = N.index, k = N.range;
2988
2975
  return new Promise(function(P, j) {
2989
- var L = C.objectStore(T), K = R.isPrimaryKey ? L : L.index(R.name), L = r(k), K = L ? K.count(L) : K.count();
2976
+ var L = C.objectStore(x), K = R.isPrimaryKey ? L : L.index(R.name), L = r(k), K = L ? K.count(L) : K.count();
2990
2977
  K.onsuccess = pe(function(q) {
2991
2978
  return P(q.target.result);
2992
- }), K.onerror = $e(j);
2979
+ }), K.onerror = Xe(j);
2993
2980
  });
2994
2981
  } };
2995
2982
  }
2996
- var u, f, p, x = (f = v, p = Br((u = e).objectStoreNames), { schema: { name: u.name, tables: p.map(function(O) {
2983
+ var u, f, p, T = (f = v, p = Br((u = e).objectStoreNames), { schema: { name: u.name, tables: p.map(function(O) {
2997
2984
  return f.objectStore(O);
2998
2985
  }).map(function(O) {
2999
- var b = O.keyPath, N = O.autoIncrement, T = _(b), A = {}, N = { name: O.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: b == null, compound: T, keyPath: b, autoIncrement: N, unique: !0, extractKey: Vn(b) }, indexes: Br(O.indexNames).map(function(C) {
2986
+ var b = O.keyPath, N = O.autoIncrement, x = _(b), A = {}, N = { name: O.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: b == null, compound: x, keyPath: b, autoIncrement: N, unique: !0, extractKey: Vn(b) }, indexes: Br(O.indexNames).map(function(C) {
3000
2987
  return O.index(C);
3001
2988
  }).map(function(P) {
3002
2989
  var R = P.name, k = P.unique, j = P.multiEntry, P = P.keyPath, j = { name: R, compound: _(P), keyPath: P, unique: k, multiEntry: j, extractKey: Vn(P) };
@@ -3005,22 +2992,22 @@ function Pi() {
3005
2992
  return A[Ut(C)];
3006
2993
  } };
3007
2994
  return A[":id"] = N.primaryKey, b != null && (A[Ut(b)] = N.primaryKey), N;
3008
- }) }, hasGetAll: 0 < p.length && "getAll" in f.objectStore(p[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }), v = x.schema, w = x.hasGetAll, x = v.tables.map(a), g = {};
3009
- return x.forEach(function(O) {
2995
+ }) }, hasGetAll: 0 < p.length && "getAll" in f.objectStore(p[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }), v = T.schema, w = T.hasGetAll, T = v.tables.map(a), g = {};
2996
+ return T.forEach(function(O) {
3010
2997
  return g[O.name] = O;
3011
2998
  }), { stack: "dbcore", transaction: e.transaction.bind(e), table: function(O) {
3012
2999
  if (!g[O]) throw new Error("Table '".concat(O, "' not found"));
3013
3000
  return g[O];
3014
3001
  }, MIN_KEY: -1 / 0, MAX_KEY: Lt(t), schema: v };
3015
3002
  }
3016
- function Ka(e, t, n, r) {
3003
+ function Va(e, t, n, r) {
3017
3004
  var a = n.IDBKeyRange;
3018
- return n.indexedDB, { dbcore: (r = ja(t, a, r), e.dbcore.reduce(function(u, f) {
3005
+ return n.indexedDB, { dbcore: (r = Ua(t, a, r), e.dbcore.reduce(function(u, f) {
3019
3006
  return f = f.create, i(i({}, u), f(u));
3020
3007
  }, r)) };
3021
3008
  }
3022
3009
  function fn(e, r) {
3023
- var n = r.db, r = Ka(e._middlewares, n, e._deps, r);
3010
+ var n = r.db, r = Va(e._middlewares, n, e._deps, r);
3024
3011
  e.core = r.dbcore, e.tables.forEach(function(a) {
3025
3012
  var u = a.name;
3026
3013
  e.core.schema.tables.some(function(f) {
@@ -3032,8 +3019,8 @@ function Pi() {
3032
3019
  n.forEach(function(a) {
3033
3020
  var u = r[a];
3034
3021
  t.forEach(function(f) {
3035
- var p = (function v(w, x) {
3036
- return ue(w, x) || (w = F(w)) && v(w, x);
3022
+ var p = (function v(w, T) {
3023
+ return ue(w, T) || (w = F(w)) && v(w, T);
3037
3024
  })(f, a);
3038
3025
  (!p || "value" in p && p.value === void 0) && (f === e.Transaction.prototype || f instanceof e.Transaction ? M(f, a, { get: function() {
3039
3026
  return this.table(a);
@@ -3048,31 +3035,31 @@ function Pi() {
3048
3035
  for (var r in n) n[r] instanceof e.Table && delete n[r];
3049
3036
  });
3050
3037
  }
3051
- function qa(e, t) {
3038
+ function Ga(e, t) {
3052
3039
  return e._cfg.version - t._cfg.version;
3053
3040
  }
3054
- function La(e, t, n, r) {
3041
+ function $a(e, t, n, r) {
3055
3042
  var a = e._dbSchema;
3056
3043
  n.objectStoreNames.contains("$meta") && !a.$meta && (a.$meta = Un("$meta", jr("")[0], []), e._storeNames.push("$meta"));
3057
3044
  var u = e._createTransaction("readwrite", e._storeNames, a);
3058
3045
  u.create(n), u._completion.catch(r);
3059
3046
  var f = u._reject.bind(u), p = Y.transless || Y;
3060
3047
  at(function() {
3061
- return Y.trans = u, Y.transless = p, t !== 0 ? (fn(e, n), w = t, ((v = u).storeNames.includes("$meta") ? v.table("$meta").get("version").then(function(x) {
3062
- return x ?? w;
3063
- }) : X.resolve(w)).then(function(x) {
3064
- return O = x, b = u, T = n, A = [], x = (g = e)._versions, N = g._dbSchema = pn(0, g.idbdb, T), (x = x.filter(function(C) {
3048
+ return Y.trans = u, Y.transless = p, t !== 0 ? (fn(e, n), w = t, ((v = u).storeNames.includes("$meta") ? v.table("$meta").get("version").then(function(T) {
3049
+ return T ?? w;
3050
+ }) : $.resolve(w)).then(function(T) {
3051
+ return O = T, b = u, x = n, A = [], T = (g = e)._versions, N = g._dbSchema = pn(0, g.idbdb, x), (T = T.filter(function(C) {
3065
3052
  return C._cfg.version >= O;
3066
- })).length !== 0 ? (x.forEach(function(C) {
3053
+ })).length !== 0 ? (T.forEach(function(C) {
3067
3054
  A.push(function() {
3068
3055
  var R = N, k = C._cfg.dbschema;
3069
- mn(g, R, T), mn(g, k, T), N = g._dbSchema = k;
3070
- var P = Xn(R, k);
3056
+ mn(g, R, x), mn(g, k, x), N = g._dbSchema = k;
3057
+ var P = $n(R, k);
3071
3058
  P.add.forEach(function(V) {
3072
- $n(T, V[0], V[1].primKey, V[1].indexes);
3059
+ Xn(x, V[0], V[1].primKey, V[1].indexes);
3073
3060
  }), P.change.forEach(function(V) {
3074
3061
  if (V.recreate) throw new z.Upgrade("Not yet support for changing primary key");
3075
- var U = T.objectStore(V.name);
3062
+ var U = x.objectStore(V.name);
3076
3063
  V.add.forEach(function(W) {
3077
3064
  return hn(U, W);
3078
3065
  }), V.change.forEach(function(W) {
@@ -3083,16 +3070,16 @@ function Pi() {
3083
3070
  });
3084
3071
  var j = C._cfg.contentUpgrade;
3085
3072
  if (j && C._cfg.version > O) {
3086
- fn(g, T), b._memoizedTables = {};
3073
+ fn(g, x), b._memoizedTables = {};
3087
3074
  var L = me(k);
3088
3075
  P.del.forEach(function(V) {
3089
3076
  L[V] = R[V];
3090
3077
  }), Gn(g, [g.Transaction.prototype]), dn(g, [g.Transaction.prototype], y(L), L), b.schema = L;
3091
3078
  var K, q = bt(j);
3092
- return q && Nt(), P = X.follow(function() {
3079
+ return q && Nt(), P = $.follow(function() {
3093
3080
  var V;
3094
3081
  (K = j(b)) && q && (V = it.bind(null, null), K.then(V, V));
3095
- }), K && typeof K.then == "function" ? X.resolve(K) : P.then(function() {
3082
+ }), K && typeof K.then == "function" ? $.resolve(K) : P.then(function() {
3096
3083
  return K;
3097
3084
  });
3098
3085
  }
@@ -3107,24 +3094,24 @@ function Pi() {
3107
3094
  })) : R.objectStore("$meta").put(C._cfg.version, "version"));
3108
3095
  });
3109
3096
  }), (function C() {
3110
- return A.length ? X.resolve(A.shift()(b.idbtrans)).then(C) : X.resolve();
3097
+ return A.length ? $.resolve(A.shift()(b.idbtrans)).then(C) : $.resolve();
3111
3098
  })().then(function() {
3112
- Mr(N, T);
3113
- })) : X.resolve();
3114
- var g, O, b, T, A, N;
3115
- }).catch(f)) : (y(a).forEach(function(x) {
3116
- $n(n, x, a[x].primKey, a[x].indexes);
3117
- }), fn(e, n), void X.follow(function() {
3099
+ Mr(N, x);
3100
+ })) : $.resolve();
3101
+ var g, O, b, x, A, N;
3102
+ }).catch(f)) : (y(a).forEach(function(T) {
3103
+ Xn(n, T, a[T].primKey, a[T].indexes);
3104
+ }), fn(e, n), void $.follow(function() {
3118
3105
  return e.on.populate.fire(u);
3119
3106
  }).catch(f));
3120
3107
  var v, w;
3121
3108
  });
3122
3109
  }
3123
- function Ua(e, t) {
3110
+ function Xa(e, t) {
3124
3111
  Mr(e._dbSchema, t), t.db.version % 10 != 0 || t.objectStoreNames.contains("$meta") || t.db.createObjectStore("$meta").add(Math.ceil(t.db.version / 10 - 1), "version");
3125
3112
  var n = pn(0, e.idbdb, t);
3126
3113
  mn(e, e._dbSchema, t);
3127
- for (var r = 0, a = Xn(n, e._dbSchema).change; r < a.length; r++) {
3114
+ for (var r = 0, a = $n(n, e._dbSchema).change; r < a.length; r++) {
3128
3115
  var u = (function(f) {
3129
3116
  if (f.change.length || f.recreate) return console.warn("Unable to patch indexes of table ".concat(f.name, " because it has changes on the type of index or primary key.")), { value: void 0 };
3130
3117
  var p = t.objectStore(f.name);
@@ -3135,7 +3122,7 @@ function Pi() {
3135
3122
  if (typeof u == "object") return u.value;
3136
3123
  }
3137
3124
  }
3138
- function Xn(e, t) {
3125
+ function $n(e, t) {
3139
3126
  var n, r = { del: [], add: [], change: [] };
3140
3127
  for (n in e) t[n] || r.del.push(n);
3141
3128
  for (n in t) {
@@ -3147,8 +3134,8 @@ function Pi() {
3147
3134
  var p = a.idxByName, v = u.idxByName, w = void 0;
3148
3135
  for (w in p) v[w] || f.del.push(w);
3149
3136
  for (w in v) {
3150
- var x = p[w], g = v[w];
3151
- x ? x.src !== g.src && f.change.push(g) : f.add.push(g);
3137
+ var T = p[w], g = v[w];
3138
+ T ? T.src !== g.src && f.change.push(g) : f.add.push(g);
3152
3139
  }
3153
3140
  (0 < f.del.length || 0 < f.add.length || 0 < f.change.length) && r.change.push(f);
3154
3141
  }
@@ -3156,7 +3143,7 @@ function Pi() {
3156
3143
  }
3157
3144
  return r;
3158
3145
  }
3159
- function $n(e, t, n, r) {
3146
+ function Xn(e, t, n, r) {
3160
3147
  var a = e.db.createObjectStore(t, n.keyPath ? { keyPath: n.keyPath, autoIncrement: n.auto } : { autoIncrement: n.auto });
3161
3148
  return r.forEach(function(u) {
3162
3149
  return hn(a, u);
@@ -3164,7 +3151,7 @@ function Pi() {
3164
3151
  }
3165
3152
  function Mr(e, t) {
3166
3153
  y(e).forEach(function(n) {
3167
- t.db.objectStoreNames.contains(n) || (Ne && console.debug("Dexie: Creating missing table", n), $n(t, n, e[n].primKey, e[n].indexes));
3154
+ t.db.objectStoreNames.contains(n) || (Ne && console.debug("Dexie: Creating missing table", n), Xn(t, n, e[n].primKey, e[n].indexes));
3168
3155
  });
3169
3156
  }
3170
3157
  function hn(e, t) {
@@ -3172,10 +3159,10 @@ function Pi() {
3172
3159
  }
3173
3160
  function pn(e, t, n) {
3174
3161
  var r = {};
3175
- return xe(t.objectStoreNames, 0).forEach(function(a) {
3162
+ return Te(t.objectStoreNames, 0).forEach(function(a) {
3176
3163
  for (var u = n.objectStore(a), f = Ln(Fr(w = u.keyPath), w || "", !0, !1, !!u.autoIncrement, w && typeof w != "string", !0), p = [], v = 0; v < u.indexNames.length; ++v) {
3177
- var x = u.index(u.indexNames[v]), w = x.keyPath, x = Ln(x.name, w, !!x.unique, !!x.multiEntry, !1, w && typeof w != "string", !1);
3178
- p.push(x);
3164
+ var T = u.index(u.indexNames[v]), w = T.keyPath, T = Ln(T.name, w, !!T.unique, !!T.multiEntry, !1, w && typeof w != "string", !1);
3165
+ p.push(T);
3179
3166
  }
3180
3167
  r[a] = Un(a, f, p);
3181
3168
  }), r;
@@ -3185,8 +3172,8 @@ function Pi() {
3185
3172
  var u = r[a], f = n.objectStore(u);
3186
3173
  e._hasGetAll = "getAll" in f;
3187
3174
  for (var p = 0; p < f.indexNames.length; ++p) {
3188
- var v = f.indexNames[p], w = f.index(v).keyPath, x = typeof w == "string" ? w : "[" + xe(w).join("+") + "]";
3189
- !t[u] || (w = t[u].idxByName[x]) && (w.name = v, delete t[u].idxByName[x], t[u].idxByName[v] = w);
3175
+ var v = f.indexNames[p], w = f.index(v).keyPath, T = typeof w == "string" ? w : "[" + Te(w).join("+") + "]";
3176
+ !t[u] || (w = t[u].idxByName[T]) && (w.name = v, delete t[u].idxByName[T], t[u].idxByName[v] = w);
3190
3177
  }
3191
3178
  }
3192
3179
  typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && h.WorkerGlobalScope && h instanceof h.WorkerGlobalScope && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604 && (e._hasGetAll = !1);
@@ -3197,7 +3184,7 @@ function Pi() {
3197
3184
  return Ln(a, u || null, /\&/.test(t), /\*/.test(t), /\+\+/.test(t), _(u), n === 0, r);
3198
3185
  });
3199
3186
  }
3200
- var Va = (Dt.prototype._createTableSchema = Un, Dt.prototype._parseIndexSyntax = jr, Dt.prototype._parseStoresSpec = function(e, t) {
3187
+ var Wa = (Dt.prototype._createTableSchema = Un, Dt.prototype._parseIndexSyntax = jr, Dt.prototype._parseStoresSpec = function(e, t) {
3201
3188
  var n = this;
3202
3189
  y(e).forEach(function(r) {
3203
3190
  if (e[r] !== null) {
@@ -3347,23 +3334,23 @@ function Pi() {
3347
3334
  }
3348
3335
  function Ur(e, t, n, r) {
3349
3336
  for (var a = [], u = 0, f = Object.entries(e.queries.query); u < f.length; u++) {
3350
- for (var p = f[u], v = p[0], w = [], x = 0, g = p[1]; x < g.length; x++) {
3351
- var O = g[x];
3337
+ for (var p = f[u], v = p[0], w = [], T = 0, g = p[1]; T < g.length; T++) {
3338
+ var O = g[T];
3352
3339
  Hn(t, O.obsSet) ? O.subscribers.forEach(function(N) {
3353
3340
  return n.add(N);
3354
3341
  }) : r && w.push(O);
3355
3342
  }
3356
3343
  r && a.push([v, w]);
3357
3344
  }
3358
- if (r) for (var b = 0, T = a; b < T.length; b++) {
3359
- var A = T[b], v = A[0], w = A[1];
3345
+ if (r) for (var b = 0, x = a; b < x.length; b++) {
3346
+ var A = x[b], v = A[0], w = A[1];
3360
3347
  e.queries.query[v] = w;
3361
3348
  }
3362
3349
  }
3363
- function Ga(e) {
3350
+ function Ya(e) {
3364
3351
  var t = e._state, n = e._deps.indexedDB;
3365
3352
  if (t.isBeingOpened || e.idbdb) return t.dbReadyPromise.then(function() {
3366
- return t.dbOpenError ? we(t.dbOpenError) : e;
3353
+ return t.dbOpenError ? _e(t.dbOpenError) : e;
3367
3354
  });
3368
3355
  t.isBeingOpened = !0, t.dbOpenError = null, t.openComplete = !1;
3369
3356
  var r = t.openCanceller, a = Math.round(10 * e.verno), u = !1;
@@ -3371,22 +3358,22 @@ function Pi() {
3371
3358
  if (t.openCanceller !== r) throw new z.DatabaseClosed("db.open() was cancelled");
3372
3359
  }
3373
3360
  function p() {
3374
- return new X(function(O, b) {
3361
+ return new $(function(O, b) {
3375
3362
  if (f(), !n) throw new z.MissingAPI();
3376
- var T = e.name, A = t.autoSchema || !a ? n.open(T) : n.open(T, a);
3363
+ var x = e.name, A = t.autoSchema || !a ? n.open(x) : n.open(x, a);
3377
3364
  if (!A) throw new z.MissingAPI();
3378
- A.onerror = $e(b), A.onblocked = pe(e._fireOnBlocked), A.onupgradeneeded = pe(function(N) {
3365
+ A.onerror = Xe(b), A.onblocked = pe(e._fireOnBlocked), A.onupgradeneeded = pe(function(N) {
3379
3366
  var C;
3380
- x = A.transaction, t.autoSchema && !e._options.allowEmptyDB ? (A.onerror = Kt, x.abort(), A.result.close(), (C = n.deleteDatabase(T)).onsuccess = C.onerror = pe(function() {
3381
- b(new z.NoSuchDatabase("Database ".concat(T, " doesnt exist")));
3382
- })) : (x.onerror = $e(b), N = N.oldVersion > Math.pow(2, 62) ? 0 : N.oldVersion, g = N < 1, e.idbdb = A.result, u && Ua(e, x), La(e, N / 10, x, b));
3367
+ T = A.transaction, t.autoSchema && !e._options.allowEmptyDB ? (A.onerror = Kt, T.abort(), A.result.close(), (C = n.deleteDatabase(x)).onsuccess = C.onerror = pe(function() {
3368
+ b(new z.NoSuchDatabase("Database ".concat(x, " doesnt exist")));
3369
+ })) : (T.onerror = Xe(b), N = N.oldVersion > Math.pow(2, 62) ? 0 : N.oldVersion, g = N < 1, e.idbdb = A.result, u && Xa(e, T), $a(e, N / 10, T, b));
3383
3370
  }, b), A.onsuccess = pe(function() {
3384
- x = null;
3385
- var N, C, R, k, P, j = e.idbdb = A.result, L = xe(j.objectStoreNames);
3371
+ T = null;
3372
+ var N, C, R, k, P, j = e.idbdb = A.result, L = Te(j.objectStoreNames);
3386
3373
  if (0 < L.length) try {
3387
3374
  var K = j.transaction((k = L).length === 1 ? k[0] : k, "readonly");
3388
- if (t.autoSchema) C = j, R = K, (N = e).verno = C.version / 10, R = N._dbSchema = pn(0, C, R), N._storeNames = xe(C.objectStoreNames, 0), dn(N, [N._allTables], y(R), R);
3389
- else if (mn(e, e._dbSchema, K), ((P = Xn(pn(0, (P = e).idbdb, K), P._dbSchema)).add.length || P.change.some(function(q) {
3375
+ if (t.autoSchema) C = j, R = K, (N = e).verno = C.version / 10, R = N._dbSchema = pn(0, C, R), N._storeNames = Te(C.objectStoreNames, 0), dn(N, [N._allTables], y(R), R);
3376
+ else if (mn(e, e._dbSchema, K), ((P = $n(pn(0, (P = e).idbdb, K), P._dbSchema)).add.length || P.change.some(function(q) {
3390
3377
  return q.add.length || q.change.length;
3391
3378
  })) && !u) 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."), j.close(), a = j.version + 1, u = !0, O(p());
3392
3379
  fn(e, K);
@@ -3396,7 +3383,7 @@ function Pi() {
3396
3383
  t.vcFired = !0, e.on("versionchange").fire(q);
3397
3384
  }), j.onclose = pe(function(q) {
3398
3385
  e.on("close").fire(q);
3399
- }), g && (P = e._deps, K = T, j = P.indexedDB, P = P.IDBKeyRange, Yn(j) || K === an || Wn(j, P).put({ name: K }).catch(c)), O();
3386
+ }), g && (P = e._deps, K = x, j = P.indexedDB, P = P.IDBKeyRange, Yn(j) || K === an || Wn(j, P).put({ name: K }).catch(c)), O();
3400
3387
  }, b);
3401
3388
  }).catch(function(O) {
3402
3389
  switch (O?.name) {
@@ -3406,11 +3393,11 @@ function Pi() {
3406
3393
  case "VersionError":
3407
3394
  if (0 < a) return a = 0, p();
3408
3395
  }
3409
- return X.reject(O);
3396
+ return $.reject(O);
3410
3397
  });
3411
3398
  }
3412
- var v, w = t.dbReadyResolve, x = null, g = !1;
3413
- return X.race([r, (typeof navigator > "u" ? X.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(O) {
3399
+ var v, w = t.dbReadyResolve, T = null, g = !1;
3400
+ return $.race([r, (typeof navigator > "u" ? $.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(O) {
3414
3401
  function b() {
3415
3402
  return indexedDB.databases().finally(O);
3416
3403
  }
@@ -3418,12 +3405,12 @@ function Pi() {
3418
3405
  }).finally(function() {
3419
3406
  return clearInterval(v);
3420
3407
  }) : Promise.resolve()).then(p)]).then(function() {
3421
- return f(), t.onReadyBeingFired = [], X.resolve(zn(function() {
3408
+ return f(), t.onReadyBeingFired = [], $.resolve(zn(function() {
3422
3409
  return e.on.ready.fire(e.vip);
3423
3410
  })).then(function O() {
3424
3411
  if (0 < t.onReadyBeingFired.length) {
3425
3412
  var b = t.onReadyBeingFired.reduce(Oe, c);
3426
- return t.onReadyBeingFired = [], X.resolve(zn(function() {
3413
+ return t.onReadyBeingFired = [], $.resolve(zn(function() {
3427
3414
  return b(e.vip);
3428
3415
  })).then(O);
3429
3416
  }
@@ -3433,17 +3420,17 @@ function Pi() {
3433
3420
  }).catch(function(O) {
3434
3421
  t.dbOpenError = O;
3435
3422
  try {
3436
- x && x.abort();
3423
+ T && T.abort();
3437
3424
  } catch {
3438
3425
  }
3439
- return r === t.openCanceller && e._close(), we(O);
3426
+ return r === t.openCanceller && e._close(), _e(O);
3440
3427
  }).finally(function() {
3441
3428
  t.openComplete = !0, w();
3442
3429
  }).then(function() {
3443
3430
  var O;
3444
3431
  return g && (O = {}, e.tables.forEach(function(b) {
3445
- b.schema.indexes.forEach(function(T) {
3446
- T.name && (O["idb://".concat(e.name, "/").concat(b.name, "/").concat(T.name)] = new Se(-1 / 0, [[[]]]));
3432
+ b.schema.indexes.forEach(function(x) {
3433
+ x.name && (O["idb://".concat(e.name, "/").concat(b.name, "/").concat(x.name)] = new Se(-1 / 0, [[[]]]));
3447
3434
  }), O["idb://".concat(e.name, "/").concat(b.name, "/")] = O["idb://".concat(e.name, "/").concat(b.name, "/:dels")] = new Se(-1 / 0, [[[]]]);
3448
3435
  }), ut(qt).fire(O), er(O, !0)), e;
3449
3436
  });
@@ -3467,11 +3454,11 @@ function Pi() {
3467
3454
  for (var r = _(e) ? e.slice() : [e], a = 0; a < n; ++a) r.push(t);
3468
3455
  return r;
3469
3456
  }
3470
- var Xa = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(e) {
3457
+ var za = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(e) {
3471
3458
  return i(i({}, e), { table: function(t) {
3472
3459
  var n = e.table(t), r = n.schema, a = {}, u = [];
3473
3460
  function f(g, O, b) {
3474
- var T = Ut(g), A = a[T] = a[T] || [], N = g == null ? 0 : typeof g == "string" ? 1 : g.length, C = 0 < O, C = i(i({}, b), { name: C ? "".concat(T, "(virtual-from:").concat(b.name, ")") : b.name, lowLevelIndex: b, isVirtual: C, keyTail: O, keyLength: N, extractKey: Vn(g), unique: !C && b.unique });
3461
+ var x = Ut(g), A = a[x] = a[x] || [], N = g == null ? 0 : typeof g == "string" ? 1 : g.length, C = 0 < O, C = i(i({}, b), { name: C ? "".concat(x, "(virtual-from:").concat(b.name, ")") : b.name, lowLevelIndex: b, isVirtual: C, keyTail: O, keyLength: N, extractKey: Vn(g), unique: !C && b.unique });
3475
3462
  return A.push(C), C.isPrimaryKey || u.push(C), 1 < N && f(N === 2 ? g[0] : g.slice(0, N - 1), O + 1, b), A.sort(function(R, k) {
3476
3463
  return R.keyTail - k.keyTail;
3477
3464
  }), C;
@@ -3481,19 +3468,19 @@ function Pi() {
3481
3468
  var w = v[p];
3482
3469
  f(w.keyPath, 0, w);
3483
3470
  }
3484
- function x(g) {
3471
+ function T(g) {
3485
3472
  var O, b = g.query.index;
3486
3473
  return b.isVirtual ? i(i({}, g), { query: { index: b.lowLevelIndex, range: (O = g.query.range, b = b.keyTail, { type: O.type === 1 ? 2 : O.type, lower: bn(O.lower, O.lowerOpen ? e.MAX_KEY : e.MIN_KEY, b), lowerOpen: !0, upper: bn(O.upper, O.upperOpen ? e.MIN_KEY : e.MAX_KEY, b), upperOpen: !0 }) } }) : g;
3487
3474
  }
3488
3475
  return i(i({}, n), { schema: i(i({}, r), { primaryKey: t, indexes: u, getIndexByKeyPath: function(g) {
3489
3476
  return (g = a[Ut(g)]) && g[0];
3490
3477
  } }), count: function(g) {
3491
- return n.count(x(g));
3478
+ return n.count(T(g));
3492
3479
  }, query: function(g) {
3493
- return n.query(x(g));
3480
+ return n.query(T(g));
3494
3481
  }, openCursor: function(g) {
3495
- var O = g.query.index, b = O.keyTail, T = O.isVirtual, A = O.keyLength;
3496
- return T ? n.openCursor(x(g)).then(function(C) {
3482
+ var O = g.query.index, b = O.keyTail, x = O.isVirtual, A = O.keyLength;
3483
+ return x ? n.openCursor(T(g)).then(function(C) {
3497
3484
  return C && N(C);
3498
3485
  }) : n.openCursor(g);
3499
3486
  function N(C) {
@@ -3524,7 +3511,7 @@ function Pi() {
3524
3511
  function rr(e, t) {
3525
3512
  return t.type === "delete" ? t.keys : t.keys || t.values.map(e.extractKey);
3526
3513
  }
3527
- var $a = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: function(e) {
3514
+ var Qa = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: function(e) {
3528
3515
  return i(i({}, e), { table: function(t) {
3529
3516
  var n = e.table(t), r = n.schema.primaryKey;
3530
3517
  return i(i({}, n), { mutate: function(a) {
@@ -3533,36 +3520,36 @@ function Pi() {
3533
3520
  case "add":
3534
3521
  if (v.fire === c) break;
3535
3522
  return u._promise("readwrite", function() {
3536
- return x(a);
3523
+ return T(a);
3537
3524
  }, !0);
3538
3525
  case "put":
3539
3526
  if (v.fire === c && w.fire === c) break;
3540
3527
  return u._promise("readwrite", function() {
3541
- return x(a);
3528
+ return T(a);
3542
3529
  }, !0);
3543
3530
  case "delete":
3544
3531
  if (p.fire === c) break;
3545
3532
  return u._promise("readwrite", function() {
3546
- return x(a);
3533
+ return T(a);
3547
3534
  }, !0);
3548
3535
  case "deleteRange":
3549
3536
  if (p.fire === c) break;
3550
3537
  return u._promise("readwrite", function() {
3551
- return (function g(O, b, T) {
3552
- return n.query({ trans: O, values: !1, query: { index: r, range: b }, limit: T }).then(function(A) {
3538
+ return (function g(O, b, x) {
3539
+ return n.query({ trans: O, values: !1, query: { index: r, range: b }, limit: x }).then(function(A) {
3553
3540
  var N = A.result;
3554
- return x({ type: "delete", keys: N, trans: O }).then(function(C) {
3555
- return 0 < C.numFailures ? Promise.reject(C.failures[0]) : N.length < T ? { failures: [], numFailures: 0, lastResult: void 0 } : g(O, i(i({}, b), { lower: N[N.length - 1], lowerOpen: !0 }), T);
3541
+ return T({ type: "delete", keys: N, trans: O }).then(function(C) {
3542
+ return 0 < C.numFailures ? Promise.reject(C.failures[0]) : N.length < x ? { failures: [], numFailures: 0, lastResult: void 0 } : g(O, i(i({}, b), { lower: N[N.length - 1], lowerOpen: !0 }), x);
3556
3543
  });
3557
3544
  });
3558
3545
  })(a.trans, a.range, 1e4);
3559
3546
  }, !0);
3560
3547
  }
3561
3548
  return n.mutate(a);
3562
- function x(g) {
3563
- var O, b, T, A = Y.trans, N = g.keys || rr(r, g);
3549
+ function T(g) {
3550
+ var O, b, x, A = Y.trans, N = g.keys || rr(r, g);
3564
3551
  if (!N) throw new Error("Keys missing");
3565
- return (g = g.type === "add" || g.type === "put" ? i(i({}, g), { keys: N }) : i({}, g)).type !== "delete" && (g.values = d([], g.values)), g.keys && (g.keys = d([], g.keys)), O = n, T = N, ((b = g).type === "add" ? Promise.resolve([]) : O.getMany({ trans: b.trans, keys: T, cache: "immutable" })).then(function(C) {
3552
+ return (g = g.type === "add" || g.type === "put" ? i(i({}, g), { keys: N }) : i({}, g)).type !== "delete" && (g.values = d([], g.values)), g.keys && (g.keys = d([], g.keys)), O = n, x = N, ((b = g).type === "add" ? Promise.resolve([]) : O.getMany({ trans: b.trans, keys: x, cache: "immutable" })).then(function(C) {
3566
3553
  var R = N.map(function(k, P) {
3567
3554
  var j, L, K, q = C[P], V = { onerror: null, onsuccess: null };
3568
3555
  return g.type === "delete" ? p.fire.call(V, k, q, A) : g.type === "add" || q === void 0 ? (j = v.fire.call(V, k, g.values[P], A), k == null && j != null && (g.keys[P] = k = j, r.outbound || le(g.values[P], r.keyPath, k))) : (j = nr(q, g.values[P]), (L = w.fire.call(V, j, k, q, A)) && (K = g.values[P], Object.keys(L).forEach(function(U) {
@@ -3594,13 +3581,13 @@ function Pi() {
3594
3581
  return null;
3595
3582
  }
3596
3583
  }
3597
- var Wa = { stack: "dbcore", level: -1, create: function(e) {
3584
+ var Ha = { stack: "dbcore", level: -1, create: function(e) {
3598
3585
  return { table: function(t) {
3599
3586
  var n = e.table(t);
3600
3587
  return i(i({}, n), { getMany: function(r) {
3601
3588
  if (!r.cache) return n.getMany(r);
3602
3589
  var a = Vr(r.keys, r.trans._cache, r.cache === "clone");
3603
- return a ? X.resolve(a) : n.getMany(r).then(function(u) {
3590
+ return a ? $.resolve(a) : n.getMany(r).then(function(u) {
3604
3591
  return r.trans._cache = { keys: r.keys, values: r.cache === "clone" ? Ye(u) : u }, u;
3605
3592
  });
3606
3593
  }, mutate: function(r) {
@@ -3611,7 +3598,7 @@ function Pi() {
3611
3598
  function Gr(e, t) {
3612
3599
  return e.trans.mode === "readonly" && !!e.subscr && !e.trans.explicit && e.trans.db._options.cache !== "disabled" && !t.schema.primaryKey.outbound;
3613
3600
  }
3614
- function Xr(e, t) {
3601
+ function $r(e, t) {
3615
3602
  switch (e) {
3616
3603
  case "query":
3617
3604
  return t.values && !t.unique;
@@ -3622,7 +3609,7 @@ function Pi() {
3622
3609
  return !1;
3623
3610
  }
3624
3611
  }
3625
- var Ya = { stack: "dbcore", level: 0, name: "Observability", create: function(e) {
3612
+ var Za = { stack: "dbcore", level: 0, name: "Observability", create: function(e) {
3626
3613
  var t = e.schema.name, n = new Se(e.MIN_KEY, e.MAX_KEY);
3627
3614
  return i(i({}, e), { transaction: function(r, a, u) {
3628
3615
  if (Y.subscr && a !== "readonly") throw new z.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(Y.querier));
@@ -3630,21 +3617,21 @@ function Pi() {
3630
3617
  }, table: function(r) {
3631
3618
  var a = e.table(r), u = a.schema, f = u.primaryKey, g = u.indexes, p = f.extractKey, v = f.outbound, w = f.autoIncrement && g.filter(function(b) {
3632
3619
  return b.compound && b.keyPath.includes(f.keyPath);
3633
- }), x = i(i({}, a), { mutate: function(b) {
3634
- function T(U) {
3620
+ }), T = i(i({}, a), { mutate: function(b) {
3621
+ function x(U) {
3635
3622
  return U = "idb://".concat(t, "/").concat(r, "/").concat(U), k[U] || (k[U] = new Se());
3636
3623
  }
3637
- var A, N, C, R = b.trans, k = b.mutatedParts || (b.mutatedParts = {}), P = T(""), j = T(":dels"), L = b.type, V = b.type === "deleteRange" ? [b.range] : b.type === "delete" ? [b.keys] : b.values.length < 50 ? [rr(f, b).filter(function(U) {
3624
+ var A, N, C, R = b.trans, k = b.mutatedParts || (b.mutatedParts = {}), P = x(""), j = x(":dels"), L = b.type, V = b.type === "deleteRange" ? [b.range] : b.type === "delete" ? [b.keys] : b.values.length < 50 ? [rr(f, b).filter(function(U) {
3638
3625
  return U;
3639
3626
  }), b.values] : [], K = V[0], q = V[1], V = b.trans._cache;
3640
- return _(K) ? (P.addKeys(K), (V = L === "delete" || K.length === q.length ? Vr(K, V) : null) || j.addKeys(K), (V || q) && (A = T, N = V, C = q, u.indexes.forEach(function(U) {
3627
+ return _(K) ? (P.addKeys(K), (V = L === "delete" || K.length === q.length ? Vr(K, V) : null) || j.addKeys(K), (V || q) && (A = x, N = V, C = q, u.indexes.forEach(function(U) {
3641
3628
  var W = A(U.name || "");
3642
3629
  function ne(ee) {
3643
3630
  return ee != null ? U.extractKey(ee) : null;
3644
3631
  }
3645
3632
  function ae(ee) {
3646
- return U.multiEntry && _(ee) ? ee.forEach(function(ve) {
3647
- return W.addKey(ve);
3633
+ return U.multiEntry && _(ee) ? ee.forEach(function(be) {
3634
+ return W.addKey(be);
3648
3635
  }) : W.addKey(ee);
3649
3636
  }
3650
3637
  (N || C).forEach(function(ee, ke) {
@@ -3652,44 +3639,44 @@ function Pi() {
3652
3639
  re(J, ke) !== 0 && (J != null && ae(J), ke != null && ae(ke));
3653
3640
  });
3654
3641
  }))) : K ? (q = { from: (q = K.lower) !== null && q !== void 0 ? q : e.MIN_KEY, to: (q = K.upper) !== null && q !== void 0 ? q : e.MAX_KEY }, j.add(q), P.add(q)) : (P.add(n), j.add(n), u.indexes.forEach(function(U) {
3655
- return T(U.name).add(n);
3642
+ return x(U.name).add(n);
3656
3643
  })), a.mutate(b).then(function(U) {
3657
3644
  return !K || b.type !== "add" && b.type !== "put" || (P.addKeys(U.results), w && w.forEach(function(W) {
3658
3645
  for (var ne = b.values.map(function(J) {
3659
3646
  return W.extractKey(J);
3660
3647
  }), ae = W.keyPath.findIndex(function(J) {
3661
3648
  return J === f.keyPath;
3662
- }), ee = 0, ve = U.results.length; ee < ve; ++ee) ne[ee][ae] = U.results[ee];
3663
- T(W.name).addKeys(ne);
3649
+ }), ee = 0, be = U.results.length; ee < be; ++ee) ne[ee][ae] = U.results[ee];
3650
+ x(W.name).addKeys(ne);
3664
3651
  })), R.mutatedParts = yn(R.mutatedParts || {}, k), U;
3665
3652
  });
3666
- } }), g = function(T) {
3667
- var A = T.query, T = A.index, A = A.range;
3668
- return [T, new Se((T = A.lower) !== null && T !== void 0 ? T : e.MIN_KEY, (A = A.upper) !== null && A !== void 0 ? A : e.MAX_KEY)];
3653
+ } }), g = function(x) {
3654
+ var A = x.query, x = A.index, A = A.range;
3655
+ return [x, new Se((x = A.lower) !== null && x !== void 0 ? x : e.MIN_KEY, (A = A.upper) !== null && A !== void 0 ? A : e.MAX_KEY)];
3669
3656
  }, O = { get: function(b) {
3670
3657
  return [f, new Se(b.key)];
3671
3658
  }, getMany: function(b) {
3672
3659
  return [f, new Se().addKeys(b.keys)];
3673
3660
  }, count: g, query: g, openCursor: g };
3674
3661
  return y(O).forEach(function(b) {
3675
- x[b] = function(T) {
3676
- var A = Y.subscr, N = !!A, C = Gr(Y, a) && Xr(b, T) ? T.obsSet = {} : A;
3662
+ T[b] = function(x) {
3663
+ var A = Y.subscr, N = !!A, C = Gr(Y, a) && $r(b, x) ? x.obsSet = {} : A;
3677
3664
  if (N) {
3678
3665
  var R = function(q) {
3679
3666
  return q = "idb://".concat(t, "/").concat(r, "/").concat(q), C[q] || (C[q] = new Se());
3680
- }, k = R(""), P = R(":dels"), A = O[b](T), N = A[0], A = A[1];
3681
- if ((b === "query" && N.isPrimaryKey && !T.values ? P : R(N.name || "")).add(A), !N.isPrimaryKey) {
3667
+ }, k = R(""), P = R(":dels"), A = O[b](x), N = A[0], A = A[1];
3668
+ if ((b === "query" && N.isPrimaryKey && !x.values ? P : R(N.name || "")).add(A), !N.isPrimaryKey) {
3682
3669
  if (b !== "count") {
3683
- var j = b === "query" && v && T.values && a.query(i(i({}, T), { values: !1 }));
3670
+ var j = b === "query" && v && x.values && a.query(i(i({}, x), { values: !1 }));
3684
3671
  return a[b].apply(this, arguments).then(function(q) {
3685
3672
  if (b === "query") {
3686
- if (v && T.values) return j.then(function(ne) {
3673
+ if (v && x.values) return j.then(function(ne) {
3687
3674
  return ne = ne.result, k.addKeys(ne), q;
3688
3675
  });
3689
- var V = T.values ? q.result.map(p) : q.result;
3690
- (T.values ? k : P).addKeys(V);
3676
+ var V = x.values ? q.result.map(p) : q.result;
3677
+ (x.values ? k : P).addKeys(V);
3691
3678
  } else if (b === "openCursor") {
3692
- var U = q, W = T.values;
3679
+ var U = q, W = x.values;
3693
3680
  return U && Object.create(U, { key: { get: function() {
3694
3681
  return P.addKey(U.primaryKey), U.key;
3695
3682
  } }, primaryKey: { get: function() {
@@ -3707,10 +3694,10 @@ function Pi() {
3707
3694
  }
3708
3695
  return a[b].apply(this, arguments);
3709
3696
  };
3710
- }), x;
3697
+ }), T;
3711
3698
  } });
3712
3699
  } };
3713
- function $r(e, t, n) {
3700
+ function Xr(e, t, n) {
3714
3701
  if (n.numFailures === 0) return t;
3715
3702
  if (t.type === "deleteRange") return null;
3716
3703
  var r = t.keys ? t.keys.length : "values" in t && t.values ? t.values.length : 1;
@@ -3726,15 +3713,15 @@ function Pi() {
3726
3713
  }
3727
3714
  function Wr(e, t, O, r, a, u) {
3728
3715
  if (!O || O.length === 0) return e;
3729
- var f = t.query.index, p = f.multiEntry, v = t.query.range, w = r.schema.primaryKey.extractKey, x = f.extractKey, g = (f.lowLevelIndex || f).extractKey, O = O.reduce(function(b, T) {
3716
+ var f = t.query.index, p = f.multiEntry, v = t.query.range, w = r.schema.primaryKey.extractKey, T = f.extractKey, g = (f.lowLevelIndex || f).extractKey, O = O.reduce(function(b, x) {
3730
3717
  var A = b, N = [];
3731
- if (T.type === "add" || T.type === "put") for (var C = new Se(), R = T.values.length - 1; 0 <= R; --R) {
3732
- var k, P = T.values[R], j = w(P);
3733
- C.hasKey(j) || (k = x(P), (p && _(k) ? k.some(function(U) {
3718
+ if (x.type === "add" || x.type === "put") for (var C = new Se(), R = x.values.length - 1; 0 <= R; --R) {
3719
+ var k, P = x.values[R], j = w(P);
3720
+ C.hasKey(j) || (k = T(P), (p && _(k) ? k.some(function(U) {
3734
3721
  return ar(U, v);
3735
3722
  }) : ar(k, v)) && (C.addKey(j), N.push(P)));
3736
3723
  }
3737
- switch (T.type) {
3724
+ switch (x.type) {
3738
3725
  case "add":
3739
3726
  var L = new Se().addKeys(t.values ? b.map(function(W) {
3740
3727
  return w(W);
@@ -3747,7 +3734,7 @@ function Pi() {
3747
3734
  }));
3748
3735
  break;
3749
3736
  case "put":
3750
- var K = new Se().addKeys(T.values.map(function(W) {
3737
+ var K = new Se().addKeys(x.values.map(function(W) {
3751
3738
  return w(W);
3752
3739
  }));
3753
3740
  A = b.filter(function(W) {
@@ -3757,27 +3744,27 @@ function Pi() {
3757
3744
  }));
3758
3745
  break;
3759
3746
  case "delete":
3760
- var q = new Se().addKeys(T.keys);
3747
+ var q = new Se().addKeys(x.keys);
3761
3748
  A = b.filter(function(W) {
3762
3749
  return !q.hasKey(t.values ? w(W) : W);
3763
3750
  });
3764
3751
  break;
3765
3752
  case "deleteRange":
3766
- var V = T.range;
3753
+ var V = x.range;
3767
3754
  A = b.filter(function(W) {
3768
3755
  return !ar(w(W), V);
3769
3756
  });
3770
3757
  }
3771
3758
  return A;
3772
3759
  }, e);
3773
- return O === e ? e : (O.sort(function(b, T) {
3774
- return re(g(b), g(T)) || re(w(b), w(T));
3760
+ return O === e ? e : (O.sort(function(b, x) {
3761
+ return re(g(b), g(x)) || re(w(b), w(x));
3775
3762
  }), t.limit && t.limit < 1 / 0 && (O.length > t.limit ? O.length = t.limit : e.length === t.limit && O.length < t.limit && (a.dirty = !0)), u ? Object.freeze(O) : O);
3776
3763
  }
3777
3764
  function Yr(e, t) {
3778
3765
  return re(e.lower, t.lower) === 0 && re(e.upper, t.upper) === 0 && !!e.lowerOpen == !!t.lowerOpen && !!e.upperOpen == !!t.upperOpen;
3779
3766
  }
3780
- function za(e, t) {
3767
+ function Ja(e, t) {
3781
3768
  return (function(n, r, a, u) {
3782
3769
  if (n === void 0) return r !== void 0 ? -1 : 0;
3783
3770
  if (r === void 0) return 1;
@@ -3798,7 +3785,7 @@ function Pi() {
3798
3785
  return r;
3799
3786
  })(e.upper, t.upper, e.upperOpen, t.upperOpen);
3800
3787
  }
3801
- function Qa(e, t, n, r) {
3788
+ function ei(e, t, n, r) {
3802
3789
  e.subscribers.add(n), r.addEventListener("abort", function() {
3803
3790
  var a, u;
3804
3791
  e.subscribers.delete(n), e.subscribers.size === 0 && (a = e, u = t, setTimeout(function() {
@@ -3806,17 +3793,17 @@ function Pi() {
3806
3793
  }, 3e3));
3807
3794
  });
3808
3795
  }
3809
- var Ha = { stack: "dbcore", level: 0, name: "Cache", create: function(e) {
3796
+ var ti = { stack: "dbcore", level: 0, name: "Cache", create: function(e) {
3810
3797
  var t = e.schema.name;
3811
3798
  return i(i({}, e), { transaction: function(n, r, a) {
3812
3799
  var u, f, p = e.transaction(n, r, a);
3813
3800
  return r === "readwrite" && (f = (u = new AbortController()).signal, a = function(v) {
3814
3801
  return function() {
3815
3802
  if (u.abort(), r === "readwrite") {
3816
- for (var w = /* @__PURE__ */ new Set(), x = 0, g = n; x < g.length; x++) {
3817
- var O = g[x], b = gt["idb://".concat(t, "/").concat(O)];
3803
+ for (var w = /* @__PURE__ */ new Set(), T = 0, g = n; T < g.length; T++) {
3804
+ var O = g[T], b = gt["idb://".concat(t, "/").concat(O)];
3818
3805
  if (b) {
3819
- var T = e.table(O), A = b.optimisticOps.filter(function(W) {
3806
+ var x = e.table(O), A = b.optimisticOps.filter(function(W) {
3820
3807
  return W.trans === p;
3821
3808
  });
3822
3809
  if (p._explicit && v && p.mutatedParts) for (var N = 0, C = Object.values(b.queries.query); N < C.length; N++) for (var R = 0, k = (L = C[N]).slice(); R < k.length; R++) Hn((K = k[R]).obsSet, p.mutatedParts) && (je(L, K), K.subscribers.forEach(function(W) {
@@ -3826,9 +3813,9 @@ function Pi() {
3826
3813
  b.optimisticOps = b.optimisticOps.filter(function(W) {
3827
3814
  return W.trans !== p;
3828
3815
  });
3829
- for (var P = 0, j = Object.values(b.queries.query); P < j.length; P++) for (var L, K, q, V = 0, U = (L = j[P]).slice(); V < U.length; V++) (K = U[V]).res != null && p.mutatedParts && (v && !K.dirty ? (q = Object.isFrozen(K.res), q = Wr(K.res, K.req, A, T, K, q), K.dirty ? (je(L, K), K.subscribers.forEach(function(W) {
3816
+ for (var P = 0, j = Object.values(b.queries.query); P < j.length; P++) for (var L, K, q, V = 0, U = (L = j[P]).slice(); V < U.length; V++) (K = U[V]).res != null && p.mutatedParts && (v && !K.dirty ? (q = Object.isFrozen(K.res), q = Wr(K.res, K.req, A, x, K, q), K.dirty ? (je(L, K), K.subscribers.forEach(function(W) {
3830
3817
  return w.add(W);
3831
- })) : q !== K.res && (K.res = q, K.promise = X.resolve({ result: q }))) : (K.dirty && je(L, K), K.subscribers.forEach(function(W) {
3818
+ })) : q !== K.res && (K.res = q, K.promise = $.resolve({ result: q }))) : (K.dirty && je(L, K), K.subscribers.forEach(function(W) {
3832
3819
  return w.add(W);
3833
3820
  })));
3834
3821
  }
@@ -3849,22 +3836,22 @@ function Pi() {
3849
3836
  return p ? (f = r.mutate(u), u.type !== "add" && u.type !== "put" || !(50 <= u.values.length || rr(a, u).some(function(v) {
3850
3837
  return v == null;
3851
3838
  })) ? (p.optimisticOps.push(u), u.mutatedParts && vn(u.mutatedParts), f.then(function(v) {
3852
- 0 < v.numFailures && (je(p.optimisticOps, u), (v = $r(0, u, v)) && p.optimisticOps.push(v), u.mutatedParts && vn(u.mutatedParts));
3839
+ 0 < v.numFailures && (je(p.optimisticOps, u), (v = Xr(0, u, v)) && p.optimisticOps.push(v), u.mutatedParts && vn(u.mutatedParts));
3853
3840
  }), f.catch(function() {
3854
3841
  je(p.optimisticOps, u), u.mutatedParts && vn(u.mutatedParts);
3855
3842
  })) : f.then(function(v) {
3856
- var w = $r(0, i(i({}, u), { values: u.values.map(function(x, g) {
3843
+ var w = Xr(0, i(i({}, u), { values: u.values.map(function(T, g) {
3857
3844
  var O;
3858
- return v.failures[g] ? x : (x = (O = a.keyPath) !== null && O !== void 0 && O.includes(".") ? Ye(x) : i({}, x), le(x, a.keyPath, v.results[g]), x);
3845
+ return v.failures[g] ? T : (T = (O = a.keyPath) !== null && O !== void 0 && O.includes(".") ? Ye(T) : i({}, T), le(T, a.keyPath, v.results[g]), T);
3859
3846
  }) }), v);
3860
3847
  p.optimisticOps.push(w), queueMicrotask(function() {
3861
3848
  return u.mutatedParts && vn(u.mutatedParts);
3862
3849
  });
3863
3850
  }), f) : r.mutate(u);
3864
3851
  }, query: function(u) {
3865
- if (!Gr(Y, r) || !Xr("query", u)) return r.query(u);
3866
- var f = ((w = Y.trans) === null || w === void 0 ? void 0 : w.db._options.cache) === "immutable", g = Y, p = g.requery, v = g.signal, w = (function(T, A, N, C) {
3867
- var R = gt["idb://".concat(T, "/").concat(A)];
3852
+ if (!Gr(Y, r) || !$r("query", u)) return r.query(u);
3853
+ var f = ((w = Y.trans) === null || w === void 0 ? void 0 : w.db._options.cache) === "immutable", g = Y, p = g.requery, v = g.signal, w = (function(x, A, N, C) {
3854
+ var R = gt["idb://".concat(x, "/").concat(A)];
3868
3855
  if (!R) return [];
3869
3856
  if (!(A = R.queries[N])) return [null, !1, R, null];
3870
3857
  var k = A[(C.query ? C.query.index.name : null) || ""];
@@ -3875,25 +3862,25 @@ function Pi() {
3875
3862
  return j.req.limit === C.limit && j.req.values === C.values && Yr(j.req.query.range, C.query.range);
3876
3863
  });
3877
3864
  return P ? [P, !0, R, k] : [k.find(function(j) {
3878
- return ("limit" in j.req ? j.req.limit : 1 / 0) >= C.limit && (!C.values || j.req.values) && za(j.req.query.range, C.query.range);
3865
+ return ("limit" in j.req ? j.req.limit : 1 / 0) >= C.limit && (!C.values || j.req.values) && Ja(j.req.query.range, C.query.range);
3879
3866
  }), !1, R, k];
3880
3867
  case "count":
3881
3868
  return P = k.find(function(j) {
3882
3869
  return Yr(j.req.query.range, C.query.range);
3883
3870
  }), [P, !!P, R, k];
3884
3871
  }
3885
- })(t, n, "query", u), x = w[0], g = w[1], O = w[2], b = w[3];
3886
- return x && g ? x.obsSet = u.obsSet : (g = r.query(u).then(function(T) {
3887
- var A = T.result;
3888
- if (x && (x.res = A), f) {
3872
+ })(t, n, "query", u), T = w[0], g = w[1], O = w[2], b = w[3];
3873
+ return T && g ? T.obsSet = u.obsSet : (g = r.query(u).then(function(x) {
3874
+ var A = x.result;
3875
+ if (T && (T.res = A), f) {
3889
3876
  for (var N = 0, C = A.length; N < C; ++N) Object.freeze(A[N]);
3890
3877
  Object.freeze(A);
3891
- } else T.result = Ye(A);
3892
- return T;
3893
- }).catch(function(T) {
3894
- return b && x && je(b, x), Promise.reject(T);
3895
- }), x = { obsSet: u.obsSet, promise: g, subscribers: /* @__PURE__ */ new Set(), type: "query", req: u, dirty: !1 }, b ? b.push(x) : (b = [x], (O = O || (gt["idb://".concat(t, "/").concat(n)] = { queries: { query: {}, count: {} }, objs: /* @__PURE__ */ new Map(), optimisticOps: [], unsignaledParts: {} })).queries.query[u.query.index.name || ""] = b)), Qa(x, b, p, v), x.promise.then(function(T) {
3896
- return { result: Wr(T.result, u, O?.optimisticOps, r, x, f) };
3878
+ } else x.result = Ye(A);
3879
+ return x;
3880
+ }).catch(function(x) {
3881
+ return b && T && je(b, T), Promise.reject(x);
3882
+ }), T = { obsSet: u.obsSet, promise: g, subscribers: /* @__PURE__ */ new Set(), type: "query", req: u, dirty: !1 }, b ? b.push(T) : (b = [T], (O = O || (gt["idb://".concat(t, "/").concat(n)] = { queries: { query: {}, count: {} }, objs: /* @__PURE__ */ new Map(), optimisticOps: [], unsignaledParts: {} })).queries.query[u.query.index.name || ""] = b)), ei(T, b, p, v), T.promise.then(function(x) {
3883
+ return { result: Wr(x.result, u, O?.optimisticOps, r, T, f) };
3897
3884
  });
3898
3885
  } });
3899
3886
  } });
@@ -3903,17 +3890,17 @@ function Pi() {
3903
3890
  return r === "db" ? t : Reflect.get(n, r, a);
3904
3891
  } });
3905
3892
  }
3906
- var He = (_e.prototype.version = function(e) {
3893
+ var He = (Ee.prototype.version = function(e) {
3907
3894
  if (isNaN(e) || e < 0.1) throw new z.Type("Given version is not a positive number");
3908
3895
  if (e = Math.round(10 * e) / 10, this.idbdb || this._state.isBeingOpened) throw new z.Schema("Cannot add version when database is open");
3909
3896
  this.verno = Math.max(this.verno, e);
3910
3897
  var t = this._versions, n = t.filter(function(r) {
3911
3898
  return r._cfg.version === e;
3912
3899
  })[0];
3913
- return n || (n = new this.Version(e), t.push(n), t.sort(qa), n.stores({}), this._state.autoSchema = !1, n);
3914
- }, _e.prototype._whenReady = function(e) {
3900
+ return n || (n = new this.Version(e), t.push(n), t.sort(Ga), n.stores({}), this._state.autoSchema = !1, n);
3901
+ }, Ee.prototype._whenReady = function(e) {
3915
3902
  var t = this;
3916
- return this.idbdb && (this._state.openComplete || Y.letThrough || this._vip) ? e() : new X(function(n, r) {
3903
+ return this.idbdb && (this._state.openComplete || Y.letThrough || this._vip) ? e() : new $(function(n, r) {
3917
3904
  if (t._state.openComplete) return r(new z.DatabaseClosed(t._state.dbOpenError));
3918
3905
  if (!t._state.isBeingOpened) {
3919
3906
  if (!t._state.autoOpen) return void r(new z.DatabaseClosed());
@@ -3921,22 +3908,22 @@ function Pi() {
3921
3908
  }
3922
3909
  t._state.dbReadyPromise.then(n, r);
3923
3910
  }).then(e);
3924
- }, _e.prototype.use = function(e) {
3911
+ }, Ee.prototype.use = function(e) {
3925
3912
  var t = e.stack, n = e.create, r = e.level, a = e.name;
3926
3913
  return a && this.unuse({ stack: t, name: a }), e = this._middlewares[t] || (this._middlewares[t] = []), e.push({ stack: t, create: n, level: r ?? 10, name: a }), e.sort(function(u, f) {
3927
3914
  return u.level - f.level;
3928
3915
  }), this;
3929
- }, _e.prototype.unuse = function(e) {
3916
+ }, Ee.prototype.unuse = function(e) {
3930
3917
  var t = e.stack, n = e.name, r = e.create;
3931
3918
  return t && this._middlewares[t] && (this._middlewares[t] = this._middlewares[t].filter(function(a) {
3932
3919
  return r ? a.create !== r : !!n && a.name !== n;
3933
3920
  })), this;
3934
- }, _e.prototype.open = function() {
3921
+ }, Ee.prototype.open = function() {
3935
3922
  var e = this;
3936
3923
  return ht(rt, function() {
3937
- return Ga(e);
3924
+ return Ya(e);
3938
3925
  });
3939
- }, _e.prototype._close = function() {
3926
+ }, Ee.prototype._close = function() {
3940
3927
  this.on.close.fire(new CustomEvent("close"));
3941
3928
  var e = this._state, t = At.indexOf(this);
3942
3929
  if (0 <= t && At.splice(t, 1), this.idbdb) {
@@ -3946,47 +3933,47 @@ function Pi() {
3946
3933
  }
3947
3934
  this.idbdb = null;
3948
3935
  }
3949
- e.isBeingOpened || (e.dbReadyPromise = new X(function(n) {
3936
+ e.isBeingOpened || (e.dbReadyPromise = new $(function(n) {
3950
3937
  e.dbReadyResolve = n;
3951
- }), e.openCanceller = new X(function(n, r) {
3938
+ }), e.openCanceller = new $(function(n, r) {
3952
3939
  e.cancelOpen = r;
3953
3940
  }));
3954
- }, _e.prototype.close = function(n) {
3941
+ }, Ee.prototype.close = function(n) {
3955
3942
  var t = (n === void 0 ? { disableAutoOpen: !0 } : n).disableAutoOpen, n = this._state;
3956
3943
  t ? (n.isBeingOpened && n.cancelOpen(new z.DatabaseClosed()), this._close(), n.autoOpen = !1, n.dbOpenError = new z.DatabaseClosed()) : (this._close(), n.autoOpen = this._options.autoOpen || n.isBeingOpened, n.openComplete = !1, n.dbOpenError = null);
3957
- }, _e.prototype.delete = function(e) {
3944
+ }, Ee.prototype.delete = function(e) {
3958
3945
  var t = this;
3959
3946
  e === void 0 && (e = { disableAutoOpen: !0 });
3960
3947
  var n = 0 < arguments.length && typeof arguments[0] != "object", r = this._state;
3961
- return new X(function(a, u) {
3948
+ return new $(function(a, u) {
3962
3949
  function f() {
3963
3950
  t.close(e);
3964
3951
  var p = t._deps.indexedDB.deleteDatabase(t.name);
3965
3952
  p.onsuccess = pe(function() {
3966
- var v, w, x;
3967
- v = t._deps, w = t.name, x = v.indexedDB, v = v.IDBKeyRange, Yn(x) || w === an || Wn(x, v).delete(w).catch(c), a();
3968
- }), p.onerror = $e(u), p.onblocked = t._fireOnBlocked;
3953
+ var v, w, T;
3954
+ v = t._deps, w = t.name, T = v.indexedDB, v = v.IDBKeyRange, Yn(T) || w === an || Wn(T, v).delete(w).catch(c), a();
3955
+ }), p.onerror = Xe(u), p.onblocked = t._fireOnBlocked;
3969
3956
  }
3970
3957
  if (n) throw new z.InvalidArgument("Invalid closeOptions argument to db.delete()");
3971
3958
  r.isBeingOpened ? r.dbReadyPromise.then(f) : f();
3972
3959
  });
3973
- }, _e.prototype.backendDB = function() {
3960
+ }, Ee.prototype.backendDB = function() {
3974
3961
  return this.idbdb;
3975
- }, _e.prototype.isOpen = function() {
3962
+ }, Ee.prototype.isOpen = function() {
3976
3963
  return this.idbdb !== null;
3977
- }, _e.prototype.hasBeenClosed = function() {
3964
+ }, Ee.prototype.hasBeenClosed = function() {
3978
3965
  var e = this._state.dbOpenError;
3979
3966
  return e && e.name === "DatabaseClosed";
3980
- }, _e.prototype.hasFailed = function() {
3967
+ }, Ee.prototype.hasFailed = function() {
3981
3968
  return this._state.dbOpenError !== null;
3982
- }, _e.prototype.dynamicallyOpened = function() {
3969
+ }, Ee.prototype.dynamicallyOpened = function() {
3983
3970
  return this._state.autoSchema;
3984
- }, Object.defineProperty(_e.prototype, "tables", { get: function() {
3971
+ }, Object.defineProperty(Ee.prototype, "tables", { get: function() {
3985
3972
  var e = this;
3986
3973
  return y(this._allTables).map(function(t) {
3987
3974
  return e._allTables[t];
3988
3975
  });
3989
- }, enumerable: !1, configurable: !0 }), _e.prototype.transaction = function() {
3976
+ }, enumerable: !1, configurable: !0 }), Ee.prototype.transaction = function() {
3990
3977
  var e = (function(t, n, r) {
3991
3978
  var a = arguments.length;
3992
3979
  if (a < 2) throw new z.InvalidArgument("Too few arguments");
@@ -3994,7 +3981,7 @@ function Pi() {
3994
3981
  return r = u.pop(), [t, I(u), r];
3995
3982
  }).apply(this, arguments);
3996
3983
  return this._transaction.apply(this, e);
3997
- }, _e.prototype._transaction = function(e, t, n) {
3984
+ }, Ee.prototype._transaction = function(e, t, n) {
3998
3985
  var r = this, a = Y.trans;
3999
3986
  a && a.db === this && e.indexOf("!") === -1 || (a = null);
4000
3987
  var u, f, p = e.indexOf("?") !== -1;
@@ -4021,27 +4008,27 @@ function Pi() {
4021
4008
  }), p && a && !a.active && (a = null);
4022
4009
  }
4023
4010
  } catch (w) {
4024
- return a ? a._promise(null, function(x, g) {
4011
+ return a ? a._promise(null, function(T, g) {
4025
4012
  g(w);
4026
- }) : we(w);
4013
+ }) : _e(w);
4027
4014
  }
4028
- var v = (function w(x, g, O, b, T) {
4029
- return X.resolve().then(function() {
4030
- var A = Y.transless || Y, N = x._createTransaction(g, O, x._dbSchema, b);
4015
+ var v = (function w(T, g, O, b, x) {
4016
+ return $.resolve().then(function() {
4017
+ var A = Y.transless || Y, N = T._createTransaction(g, O, T._dbSchema, b);
4031
4018
  if (N.explicit = !0, A = { trans: N, transless: A }, b) N.idbtrans = b.idbtrans;
4032
4019
  else try {
4033
- N.create(), N.idbtrans._explicit = !0, x._state.PR1398_maxLoop = 3;
4020
+ N.create(), N.idbtrans._explicit = !0, T._state.PR1398_maxLoop = 3;
4034
4021
  } catch (k) {
4035
- return k.name === lt.InvalidState && x.isOpen() && 0 < --x._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), x.close({ disableAutoOpen: !1 }), x.open().then(function() {
4036
- return w(x, g, O, null, T);
4037
- })) : we(k);
4022
+ return k.name === lt.InvalidState && T.isOpen() && 0 < --T._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), T.close({ disableAutoOpen: !1 }), T.open().then(function() {
4023
+ return w(T, g, O, null, x);
4024
+ })) : _e(k);
4038
4025
  }
4039
- var C, R = bt(T);
4040
- return R && Nt(), A = X.follow(function() {
4026
+ var C, R = bt(x);
4027
+ return R && Nt(), A = $.follow(function() {
4041
4028
  var k;
4042
- (C = T.call(N, N)) && (R ? (k = it.bind(null, null), C.then(k, k)) : typeof C.next == "function" && typeof C.throw == "function" && (C = tr(C)));
4043
- }, A), (C && typeof C.then == "function" ? X.resolve(C).then(function(k) {
4044
- return N.active ? k : we(new z.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
4029
+ (C = x.call(N, N)) && (R ? (k = it.bind(null, null), C.then(k, k)) : typeof C.next == "function" && typeof C.throw == "function" && (C = tr(C)));
4030
+ }, A), (C && typeof C.then == "function" ? $.resolve(C).then(function(k) {
4031
+ return N.active ? k : _e(new z.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
4045
4032
  }) : A.then(function() {
4046
4033
  return C;
4047
4034
  })).then(function(k) {
@@ -4049,108 +4036,108 @@ function Pi() {
4049
4036
  return k;
4050
4037
  });
4051
4038
  }).catch(function(k) {
4052
- return N._reject(k), we(k);
4039
+ return N._reject(k), _e(k);
4053
4040
  });
4054
4041
  });
4055
4042
  }).bind(null, this, u, f, a, n);
4056
4043
  return a ? a._promise(u, v, "lock") : Y.trans ? ht(Y.transless, function() {
4057
4044
  return r._whenReady(v);
4058
4045
  }) : this._whenReady(v);
4059
- }, _e.prototype.table = function(e) {
4046
+ }, Ee.prototype.table = function(e) {
4060
4047
  if (!G(this._allTables, e)) throw new z.InvalidTable("Table ".concat(e, " does not exist"));
4061
4048
  return this._allTables[e];
4062
- }, _e);
4063
- function _e(e, t) {
4049
+ }, Ee);
4050
+ function Ee(e, t) {
4064
4051
  var n = this;
4065
4052
  this._middlewares = {}, this.verno = 0;
4066
- var r = _e.dependencies;
4067
- this._options = t = i({ addons: _e.addons, autoOpen: !0, indexedDB: r.indexedDB, IDBKeyRange: r.IDBKeyRange, cache: "cloned" }, t), this._deps = { indexedDB: t.indexedDB, IDBKeyRange: t.IDBKeyRange }, r = t.addons, this._dbSchema = {}, this._versions = [], this._storeNames = [], this._allTables = {}, this.idbdb = null, this._novip = this;
4053
+ var r = Ee.dependencies;
4054
+ this._options = t = i({ addons: Ee.addons, autoOpen: !0, indexedDB: r.indexedDB, IDBKeyRange: r.IDBKeyRange, cache: "cloned" }, t), this._deps = { indexedDB: t.indexedDB, IDBKeyRange: t.IDBKeyRange }, r = t.addons, this._dbSchema = {}, this._versions = [], this._storeNames = [], this._allTables = {}, this.idbdb = null, this._novip = this;
4068
4055
  var a, u, f, p, v, w = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: c, dbReadyPromise: null, cancelOpen: c, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: t.autoOpen };
4069
- w.dbReadyPromise = new X(function(g) {
4056
+ w.dbReadyPromise = new $(function(g) {
4070
4057
  w.dbReadyResolve = g;
4071
- }), w.openCanceller = new X(function(g, O) {
4058
+ }), w.openCanceller = new $(function(g, O) {
4072
4059
  w.cancelOpen = O;
4073
4060
  }), this._state = w, this.name = e, this.on = Bt(this, "populate", "blocked", "versionchange", "close", { ready: [Oe, c] }), this.once = function(g, O) {
4074
4061
  var b = function() {
4075
- for (var T = [], A = 0; A < arguments.length; A++) T[A] = arguments[A];
4076
- n.on(g).unsubscribe(b), O.apply(n, T);
4062
+ for (var x = [], A = 0; A < arguments.length; A++) x[A] = arguments[A];
4063
+ n.on(g).unsubscribe(b), O.apply(n, x);
4077
4064
  };
4078
4065
  return n.on(g, b);
4079
4066
  }, this.on.ready.subscribe = te(this.on.ready.subscribe, function(g) {
4080
4067
  return function(O, b) {
4081
- _e.vip(function() {
4082
- var T, A = n._state;
4083
- A.openComplete ? (A.dbOpenError || X.resolve().then(O), b && g(O)) : A.onReadyBeingFired ? (A.onReadyBeingFired.push(O), b && g(O)) : (g(O), T = n, b || g(function N() {
4084
- T.on.ready.unsubscribe(O), T.on.ready.unsubscribe(N);
4068
+ Ee.vip(function() {
4069
+ var x, A = n._state;
4070
+ A.openComplete ? (A.dbOpenError || $.resolve().then(O), b && g(O)) : A.onReadyBeingFired ? (A.onReadyBeingFired.push(O), b && g(O)) : (g(O), x = n, b || g(function N() {
4071
+ x.on.ready.unsubscribe(O), x.on.ready.unsubscribe(N);
4085
4072
  }));
4086
4073
  });
4087
4074
  };
4088
- }), this.Collection = (a = this, Mt(ka.prototype, function(C, N) {
4075
+ }), this.Collection = (a = this, Mt(Ma.prototype, function(C, N) {
4089
4076
  this.db = a;
4090
- var b = xr, T = null;
4077
+ var b = Tr, x = null;
4091
4078
  if (N) try {
4092
4079
  b = N();
4093
4080
  } catch (R) {
4094
- T = R;
4081
+ x = R;
4095
4082
  }
4096
4083
  var A = C._ctx, N = A.table, C = N.hook.reading.fire;
4097
- this._ctx = { table: N, index: A.index, isPrimKey: !A.index || N.schema.primKey.keyPath && A.index === N.schema.primKey.name, range: b, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: T, or: A.or, valueMapper: C !== o ? C : null };
4084
+ this._ctx = { table: N, index: A.index, isPrimKey: !A.index || N.schema.primKey.keyPath && A.index === N.schema.primKey.name, range: b, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: x, or: A.or, valueMapper: C !== o ? C : null };
4098
4085
  })), this.Table = (u = this, Mt(Cr.prototype, function(g, O, b) {
4099
- this.db = u, this._tx = b, this.name = g, this.schema = O, this.hook = u._allTables[g] ? u._allTables[g].hook : Bt(null, { creating: [se, c], reading: [S, o], updating: [be, c], deleting: [ge, c] });
4100
- })), this.Transaction = (f = this, Mt(Ba.prototype, function(g, O, b, T, A) {
4086
+ this.db = u, this._tx = b, this.name = g, this.schema = O, this.hook = u._allTables[g] ? u._allTables[g].hook : Bt(null, { creating: [se, c], reading: [S, o], updating: [we, c], deleting: [ge, c] });
4087
+ })), this.Transaction = (f = this, Mt(qa.prototype, function(g, O, b, x, A) {
4101
4088
  var N = this;
4102
4089
  g !== "readonly" && O.forEach(function(C) {
4103
4090
  C = (C = b[C]) === null || C === void 0 ? void 0 : C.yProps, C && (O = O.concat(C.map(function(R) {
4104
4091
  return R.updatesTable;
4105
4092
  })));
4106
- }), this.db = f, this.mode = g, this.storeNames = O, this.schema = b, this.chromeTransactionDurability = T, this.idbtrans = null, this.on = Bt(this, "complete", "error", "abort"), this.parent = A || null, this.active = !0, this._reculock = 0, this._blockedFuncs = [], this._resolve = null, this._reject = null, this._waitingFor = null, this._waitingQueue = null, this._spinCount = 0, this._completion = new X(function(C, R) {
4093
+ }), this.db = f, this.mode = g, this.storeNames = O, this.schema = b, this.chromeTransactionDurability = x, this.idbtrans = null, this.on = Bt(this, "complete", "error", "abort"), this.parent = A || null, this.active = !0, this._reculock = 0, this._blockedFuncs = [], this._resolve = null, this._reject = null, this._waitingFor = null, this._waitingQueue = null, this._spinCount = 0, this._completion = new $(function(C, R) {
4107
4094
  N._resolve = C, N._reject = R;
4108
4095
  }), this._completion.then(function() {
4109
4096
  N.active = !1, N.on.complete.fire();
4110
4097
  }, function(C) {
4111
4098
  var R = N.active;
4112
- return N.active = !1, N.on.error.fire(C), N.parent ? N.parent._reject(C) : R && N.idbtrans && N.idbtrans.abort(), we(C);
4099
+ return N.active = !1, N.on.error.fire(C), N.parent ? N.parent._reject(C) : R && N.idbtrans && N.idbtrans.abort(), _e(C);
4113
4100
  });
4114
- })), this.Version = (p = this, Mt(Va.prototype, function(g) {
4101
+ })), this.Version = (p = this, Mt(Wa.prototype, function(g) {
4115
4102
  this.db = p, this._cfg = { version: g, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
4116
4103
  })), this.WhereClause = (v = this, Mt(Pr.prototype, function(g, O, b) {
4117
- if (this.db = v, this._ctx = { table: g, index: O === ":id" ? null : O, or: b }, this._cmp = this._ascending = re, this._descending = function(T, A) {
4118
- return re(A, T);
4119
- }, this._max = function(T, A) {
4120
- return 0 < re(T, A) ? T : A;
4121
- }, this._min = function(T, A) {
4122
- return re(T, A) < 0 ? T : A;
4104
+ if (this.db = v, this._ctx = { table: g, index: O === ":id" ? null : O, or: b }, this._cmp = this._ascending = re, this._descending = function(x, A) {
4105
+ return re(A, x);
4106
+ }, this._max = function(x, A) {
4107
+ return 0 < re(x, A) ? x : A;
4108
+ }, this._min = function(x, A) {
4109
+ return re(x, A) < 0 ? x : A;
4123
4110
  }, this._IDBKeyRange = v._deps.IDBKeyRange, !this._IDBKeyRange) throw new z.MissingAPI();
4124
4111
  })), this.on("versionchange", function(g) {
4125
4112
  0 < g.newVersion ? console.warn("Another connection wants to upgrade database '".concat(n.name, "'. Closing db now to resume the upgrade.")) : console.warn("Another connection wants to delete database '".concat(n.name, "'. Closing db now to resume the delete request.")), n.close({ disableAutoOpen: !1 });
4126
4113
  }), this.on("blocked", function(g) {
4127
4114
  !g.newVersion || g.newVersion < g.oldVersion ? console.warn("Dexie.delete('".concat(n.name, "') was blocked")) : console.warn("Upgrade '".concat(n.name, "' blocked by other connection holding version ").concat(g.oldVersion / 10));
4128
- }), this._maxKey = Lt(t.IDBKeyRange), this._createTransaction = function(g, O, b, T) {
4129
- return new n.Transaction(g, O, b, n._options.chromeTransactionDurability, T);
4115
+ }), this._maxKey = Lt(t.IDBKeyRange), this._createTransaction = function(g, O, b, x) {
4116
+ return new n.Transaction(g, O, b, n._options.chromeTransactionDurability, x);
4130
4117
  }, this._fireOnBlocked = function(g) {
4131
4118
  n.on("blocked").fire(g), At.filter(function(O) {
4132
4119
  return O.name === n.name && O !== n && !O._state.vcFired;
4133
4120
  }).map(function(O) {
4134
4121
  return O.on("versionchange").fire(g);
4135
4122
  });
4136
- }, this.use(Wa), this.use(Ha), this.use(Ya), this.use(Xa), this.use($a);
4137
- var x = new Proxy(this, { get: function(g, O, b) {
4123
+ }, this.use(Ha), this.use(ti), this.use(Za), this.use(za), this.use(Qa);
4124
+ var T = new Proxy(this, { get: function(g, O, b) {
4138
4125
  if (O === "_vip") return !0;
4139
4126
  if (O === "table") return function(A) {
4140
- return wn(n.table(A), x);
4127
+ return wn(n.table(A), T);
4141
4128
  };
4142
- var T = Reflect.get(g, O, b);
4143
- return T instanceof Cr ? wn(T, x) : O === "tables" ? T.map(function(A) {
4144
- return wn(A, x);
4129
+ var x = Reflect.get(g, O, b);
4130
+ return x instanceof Cr ? wn(x, T) : O === "tables" ? x.map(function(A) {
4131
+ return wn(A, T);
4145
4132
  }) : O === "_createTransaction" ? function() {
4146
- return wn(T.apply(this, arguments), x);
4147
- } : T;
4133
+ return wn(x.apply(this, arguments), T);
4134
+ } : x;
4148
4135
  } });
4149
- this.vip = x, r.forEach(function(g) {
4136
+ this.vip = T, r.forEach(function(g) {
4150
4137
  return g(n);
4151
4138
  });
4152
4139
  }
4153
- var _n, Le = typeof Symbol < "u" && "observable" in Symbol ? Symbol.observable : "@@observable", Za = (ir.prototype.subscribe = function(e, t, n) {
4140
+ var _n, Le = typeof Symbol < "u" && "observable" in Symbol ? Symbol.observable : "@@observable", ni = (ir.prototype.subscribe = function(e, t, n) {
4154
4141
  return this._subscribe(e && typeof e != "function" ? e : { next: e, error: t, complete: n });
4155
4142
  }, ir.prototype[Le] = function() {
4156
4143
  return this;
@@ -4164,27 +4151,27 @@ function Pi() {
4164
4151
  _n = { indexedDB: null, IDBKeyRange: null };
4165
4152
  }
4166
4153
  function zr(e) {
4167
- var t, n = !1, r = new Za(function(a) {
4168
- var u = bt(e), f, p = !1, v = {}, w = {}, x = { get closed() {
4154
+ var t, n = !1, r = new ni(function(a) {
4155
+ var u = bt(e), f, p = !1, v = {}, w = {}, T = { get closed() {
4169
4156
  return p;
4170
4157
  }, unsubscribe: function() {
4171
4158
  p || (p = !0, f && f.abort(), g && ut.storagemutated.unsubscribe(b));
4172
4159
  } };
4173
- a.start && a.start(x);
4160
+ a.start && a.start(T);
4174
4161
  var g = !1, O = function() {
4175
- return Fn(T);
4162
+ return Fn(x);
4176
4163
  }, b = function(A) {
4177
4164
  yn(v, A), Hn(w, v) && O();
4178
- }, T = function() {
4165
+ }, x = function() {
4179
4166
  var A, N, C;
4180
4167
  !p && _n.indexedDB && (v = {}, A = {}, f && f.abort(), f = new AbortController(), C = (function(R) {
4181
- var k = Tt();
4168
+ var k = xt();
4182
4169
  try {
4183
4170
  u && Nt();
4184
4171
  var P = at(e, R);
4185
4172
  return P = u ? P.finally(it) : P;
4186
4173
  } finally {
4187
- k && xt();
4174
+ k && Tt();
4188
4175
  }
4189
4176
  })(N = { subscr: A, signal: f.signal, requery: O, querier: e, trans: null }), Promise.resolve(C).then(function(R) {
4190
4177
  n = !0, t = R, p || N.signal.aborted || (v = {}, (function(k) {
@@ -4199,7 +4186,7 @@ function Pi() {
4199
4186
  });
4200
4187
  }));
4201
4188
  };
4202
- return setTimeout(O, 0), x;
4189
+ return setTimeout(O, 0), T;
4203
4190
  });
4204
4191
  return r.hasValue = function() {
4205
4192
  return n;
@@ -4234,7 +4221,7 @@ function Pi() {
4234
4221
  });
4235
4222
  }) : Wn(n, t).toCollection().primaryKeys()).then(e);
4236
4223
  } catch {
4237
- return we(new z.MissingAPI());
4224
+ return _e(new z.MissingAPI());
4238
4225
  }
4239
4226
  var t, n;
4240
4227
  }, defineClass: function() {
@@ -4247,23 +4234,23 @@ function Pi() {
4247
4234
  return function() {
4248
4235
  try {
4249
4236
  var t = tr(e.apply(this, arguments));
4250
- return t && typeof t.then == "function" ? t : X.resolve(t);
4237
+ return t && typeof t.then == "function" ? t : $.resolve(t);
4251
4238
  } catch (n) {
4252
- return we(n);
4239
+ return _e(n);
4253
4240
  }
4254
4241
  };
4255
4242
  }, spawn: function(e, t, n) {
4256
4243
  try {
4257
4244
  var r = tr(e.apply(n, t || []));
4258
- return r && typeof r.then == "function" ? r : X.resolve(r);
4245
+ return r && typeof r.then == "function" ? r : $.resolve(r);
4259
4246
  } catch (a) {
4260
- return we(a);
4247
+ return _e(a);
4261
4248
  }
4262
4249
  }, currentTransaction: { get: function() {
4263
4250
  return Y.trans || null;
4264
4251
  } }, waitFor: function(e, t) {
4265
- return t = X.resolve(typeof e == "function" ? yt.ignoreTransaction(e) : e).timeout(t || 6e4), Y.trans ? Y.trans.waitFor(t) : t;
4266
- }, Promise: X, debug: { get: function() {
4252
+ return t = $.resolve(typeof e == "function" ? yt.ignoreTransaction(e) : e).timeout(t || 6e4), Y.trans ? Y.trans.waitFor(t) : t;
4253
+ }, Promise: $, debug: { get: function() {
4267
4254
  return Ne;
4268
4255
  }, set: function(e) {
4269
4256
  Ae(e);
@@ -4295,7 +4282,7 @@ function Pi() {
4295
4282
  }
4296
4283
  }), addEventListener("pageshow", function(e) {
4297
4284
  !He.disableBfCache && e.persisted && (Ne && console.debug("Dexie: handling persisted pageshow"), Qr(), or({ all: new Se(-1 / 0, [[]]) }));
4298
- })), X.rejectionMapper = function(e, t) {
4285
+ })), $.rejectionMapper = function(e, t) {
4299
4286
  return !e || e instanceof et || e instanceof TypeError || e instanceof SyntaxError || !e.name || !_t[e.name] ? e : (t = new _t[e.name](t || e.message, e), "stack" in e && M(t, "stack", { get: function() {
4300
4287
  return this.inner.stack;
4301
4288
  } }), t);
@@ -4307,10 +4294,10 @@ function Pi() {
4307
4294
  return new jt({ remove: e });
4308
4295
  }, default: He, RangeSet: Se, mergeRanges: Gt, rangesOverlap: Kr }), { default: He }), He;
4309
4296
  });
4310
- })(xn)), xn.exports;
4297
+ })(Tn)), Tn.exports;
4311
4298
  }
4312
4299
  var Fi = Pi();
4313
- const hr = /* @__PURE__ */ ba(Fi), Zr = /* @__PURE__ */ Symbol.for("Dexie"), Je = globalThis[Zr] || (globalThis[Zr] = hr);
4300
+ const hr = /* @__PURE__ */ xa(Fi), na = /* @__PURE__ */ Symbol.for("Dexie"), Je = globalThis[na] || (globalThis[na] = hr);
4314
4301
  if (hr.semVer !== Je.semVer)
4315
4302
  throw new Error(`Two different versions of Dexie loaded in the same app: ${hr.semVer} and ${Je.semVer}`);
4316
4303
  const {
@@ -4325,7 +4312,7 @@ const {
4325
4312
  add: Po,
4326
4313
  remove: Fo,
4327
4314
  DexieYProvider: Bo
4328
- } = Je, Jr = "_changeLog", ea = "_meta";
4315
+ } = Je, ra = "_changeLog", aa = "_meta";
4329
4316
  class Bi {
4330
4317
  constructor(s, l) {
4331
4318
  this.name = s;
@@ -4337,7 +4324,7 @@ class Bi {
4337
4324
  if (d)
4338
4325
  for (const [y, _] of Object.entries(d))
4339
4326
  h[y] = _.schema;
4340
- h[Jr] = "++sequenceNumber, id", h[ea] = "key", this.databaseInstance.version(1).stores(h);
4327
+ h[ra] = "++sequenceNumber, id", h[aa] = "key", this.databaseInstance.version(1).stores(h);
4341
4328
  }
4342
4329
  async get(s) {
4343
4330
  return this.databaseInstance.table(this.tableName).get(s);
@@ -4346,10 +4333,10 @@ class Bi {
4346
4333
  return this.databaseInstance.table(this.tableName).where({ tagName: s }).toArray();
4347
4334
  }
4348
4335
  get changeLogTable() {
4349
- return this.databaseInstance.table(Jr);
4336
+ return this.databaseInstance.table(ra);
4350
4337
  }
4351
4338
  get metaTable() {
4352
- return this.databaseInstance.table(ea);
4339
+ return this.databaseInstance.table(aa);
4353
4340
  }
4354
4341
  async getHead() {
4355
4342
  return (await this.metaTable.get("head"))?.value ?? 0;
@@ -4367,7 +4354,7 @@ class Bi {
4367
4354
  this.changeLogTable,
4368
4355
  this.metaTable,
4369
4356
  async () => {
4370
- const F = i.length > 0 ? await y.bulkGet(i.map((M) => M.id)) : [], $ = d.length > 0 ? await y.bulkGet(d) : [];
4357
+ const F = i.length > 0 ? await y.bulkGet(i.map((M) => M.id)) : [], X = d.length > 0 ? await y.bulkGet(d) : [];
4371
4358
  if (l.length > 0)
4372
4359
  try {
4373
4360
  await y.bulkAdd(l), D += l.length, h(D, _);
@@ -4415,7 +4402,7 @@ class Bi {
4415
4402
  before: F[B],
4416
4403
  after: M
4417
4404
  })),
4418
- deletes: $.filter(Boolean)
4405
+ deletes: X.filter(Boolean)
4419
4406
  }
4420
4407
  };
4421
4408
  await this.changeLogTable.add(fe), await this.setHead(Q);
@@ -4488,7 +4475,7 @@ function Mi(m) {
4488
4475
  y[_] = D.schema;
4489
4476
  return h.version(1).stores(y), h;
4490
4477
  }
4491
- async function wa(m) {
4478
+ async function Ta(m) {
4492
4479
  const { databaseInstance: s, elementsTableName: l, records: i } = m, d = s.table(l);
4493
4480
  await s.transaction("rw", d, () => d.bulkAdd(i));
4494
4481
  }
@@ -4503,17 +4490,17 @@ async function ji(m) {
4503
4490
  const D = { ...y };
4504
4491
  if (y.attributes) {
4505
4492
  const F = [..._.attributes];
4506
- for (const $ of y.attributes) {
4507
- const G = F.findIndex((Q) => Q.name === $.name);
4508
- G >= 0 ? F[G] = $ : F.push($);
4493
+ for (const X of y.attributes) {
4494
+ const G = F.findIndex((Q) => Q.name === X.name);
4495
+ G >= 0 ? F[G] = X : F.push(X);
4509
4496
  }
4510
4497
  D.attributes = F;
4511
4498
  }
4512
4499
  if (y.children) {
4513
4500
  const F = [..._.children];
4514
- for (const $ of y.children) {
4515
- const G = F.findIndex((Q) => Q.id === $.id);
4516
- G >= 0 ? F[G] = $ : F.push($);
4501
+ for (const X of y.children) {
4502
+ const G = F.findIndex((Q) => Q.id === X.id);
4503
+ G >= 0 ? F[G] = X : F.push(X);
4517
4504
  }
4518
4505
  D.children = F;
4519
4506
  }
@@ -4531,8 +4518,8 @@ async function Mo(m) {
4531
4518
  if (!_) continue;
4532
4519
  const D = [..._.attributes];
4533
4520
  for (const F of y) {
4534
- const $ = D.findIndex((G) => G.name === F.name);
4535
- $ >= 0 ? D[$] = F : D.push(F);
4521
+ const X = D.findIndex((G) => G.name === F.name);
4522
+ X >= 0 ? D[X] = F : D.push(F);
4536
4523
  }
4537
4524
  await d.update(h, { attributes: D });
4538
4525
  }
@@ -4576,13 +4563,13 @@ function Vi(m) {
4576
4563
  delete Wt[s];
4577
4564
  }
4578
4565
  var lr = {};
4579
- const Gi = {}, Xi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4566
+ const Gi = {}, $i = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4580
4567
  __proto__: null,
4581
4568
  default: Gi
4582
- }, Symbol.toStringTag, { value: "Module" })), $i = /* @__PURE__ */ Si(Xi);
4583
- var ta;
4569
+ }, Symbol.toStringTag, { value: "Module" })), Xi = /* @__PURE__ */ Si($i);
4570
+ var ia;
4584
4571
  function Wi() {
4585
- return ta || (ta = 1, (function(m) {
4572
+ return ia || (ia = 1, (function(m) {
4586
4573
  (function(s) {
4587
4574
  s.parser = function(c, o) {
4588
4575
  return new i(c, o);
@@ -4647,25 +4634,25 @@ function Wi() {
4647
4634
  je(c);
4648
4635
  break;
4649
4636
  case "cdata":
4650
- ye(c, "oncdata", c.cdata), c.cdata = "";
4637
+ ve(c, "oncdata", c.cdata), c.cdata = "";
4651
4638
  break;
4652
4639
  case "script":
4653
- ye(c, "onscript", c.script), c.script = "";
4640
+ ve(c, "onscript", c.script), c.script = "";
4654
4641
  break;
4655
4642
  default:
4656
4643
  Ie(c, "Max buffer length exceeded: " + l[E]);
4657
4644
  }
4658
4645
  S = Math.max(S, ge);
4659
4646
  }
4660
- var be = s.MAX_BUFFER_LENGTH - S;
4661
- c.bufferCheckPosition = be + c.position;
4647
+ var we = s.MAX_BUFFER_LENGTH - S;
4648
+ c.bufferCheckPosition = we + c.position;
4662
4649
  }
4663
4650
  function h(c) {
4664
4651
  for (var o = 0, S = l.length; o < S; o++)
4665
4652
  c[l[o]] = "";
4666
4653
  }
4667
4654
  function y(c) {
4668
- je(c), c.cdata !== "" && (ye(c, "oncdata", c.cdata), c.cdata = ""), c.script !== "" && (ye(c, "onscript", c.script), c.script = "");
4655
+ je(c), c.cdata !== "" && (ve(c, "oncdata", c.cdata), c.cdata = ""), c.script !== "" && (ve(c, "onscript", c.script), c.script = "");
4669
4656
  }
4670
4657
  i.prototype = {
4671
4658
  end: function() {
@@ -4684,7 +4671,7 @@ function Wi() {
4684
4671
  };
4685
4672
  var _;
4686
4673
  try {
4687
- _ = $i.Stream;
4674
+ _ = Xi.Stream;
4688
4675
  } catch {
4689
4676
  _ = function() {
4690
4677
  };
@@ -4697,7 +4684,7 @@ function Wi() {
4697
4684
  function F(c, o) {
4698
4685
  return new G(c, o);
4699
4686
  }
4700
- function $(c, o) {
4687
+ function X(c, o) {
4701
4688
  if (c.length >= 2) {
4702
4689
  if (c[0] === 255 && c[1] === 254)
4703
4690
  return "utf-16le";
@@ -4736,7 +4723,7 @@ function Wi() {
4736
4723
  }
4737
4724
  }), G.prototype._decodeBuffer = function(c, o) {
4738
4725
  if (this._decoderBuffer && (c = Buffer.concat([this._decoderBuffer, c]), this._decoderBuffer = null), !this._decoder) {
4739
- var S = $(c, o);
4726
+ var S = X(c, o);
4740
4727
  if (!S)
4741
4728
  return this._decoderBuffer = c, "";
4742
4729
  this._parser.encoding = S, this._decoder = new TextDecoder(S);
@@ -4766,7 +4753,7 @@ function Wi() {
4766
4753
  E.splice(0, 0, c), S.emit.apply(S, E);
4767
4754
  }), _.prototype.on.call(S, c, o);
4768
4755
  };
4769
- var Q = "[CDATA[", fe = "DOCTYPE", M = "http://www.w3.org/XML/1998/namespace", B = "http://www.w3.org/2000/xmlns/", ue = { xml: M, xmlns: B }, ie = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/, xe = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/, te = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/, H = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;
4756
+ var Q = "[CDATA[", fe = "DOCTYPE", M = "http://www.w3.org/XML/1998/namespace", B = "http://www.w3.org/2000/xmlns/", ue = { xml: M, xmlns: B }, ie = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/, Te = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/, te = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/, H = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;
4770
4757
  function Z(c) {
4771
4758
  return c === " " || c === `
4772
4759
  ` || c === "\r" || c === " ";
@@ -5147,7 +5134,7 @@ function Wi() {
5147
5134
  );
5148
5135
  }
5149
5136
  }
5150
- function ye(c, o, S) {
5137
+ function ve(c, o, S) {
5151
5138
  c.textNode && je(c), Ue(c, o, S);
5152
5139
  }
5153
5140
  function je(c) {
@@ -5173,7 +5160,7 @@ Char: ` + c.c), o = new Error(o), c.error = o, Ue(c, "onerror", o), c;
5173
5160
  function et(c) {
5174
5161
  c.strict || (c.tagName = c.tagName[c.looseCase]());
5175
5162
  var o = c.tags[c.tags.length - 1] || c, S = c.tag = { name: c.tagName, attributes: {} };
5176
- c.opt.xmlns && (S.ns = o.ns), c.attribList.length = 0, ye(c, "onopentagstart", S);
5163
+ c.opt.xmlns && (S.ns = o.ns), c.attribList.length = 0, ve(c, "onopentagstart", S);
5177
5164
  }
5178
5165
  function wt(c, o) {
5179
5166
  var S = c.indexOf(":"), E = S < 0 ? ["", c] : c.split(":"), se = E[0], ge = E[1];
@@ -5205,7 +5192,7 @@ Actual: ` + c.attribValue
5205
5192
  }
5206
5193
  c.attribList.push([c.attribName, c.attribValue]);
5207
5194
  } else
5208
- c.tag.attributes[c.attribName] = c.attribValue, ye(c, "onattribute", {
5195
+ c.tag.attributes[c.attribName] = c.attribValue, ve(c, "onattribute", {
5209
5196
  name: c.attribName,
5210
5197
  value: c.attribValue
5211
5198
  });
@@ -5219,13 +5206,13 @@ Actual: ` + c.attribValue
5219
5206
  "Unbound namespace prefix: " + JSON.stringify(c.tagName)
5220
5207
  ), S.uri = E.prefix);
5221
5208
  var se = c.tags[c.tags.length - 1] || c;
5222
- S.ns && se.ns !== S.ns && Object.keys(S.ns).forEach(function(Xe) {
5223
- ye(c, "onopennamespace", {
5224
- prefix: Xe,
5225
- uri: S.ns[Xe]
5209
+ S.ns && se.ns !== S.ns && Object.keys(S.ns).forEach(function($e) {
5210
+ ve(c, "onopennamespace", {
5211
+ prefix: $e,
5212
+ uri: S.ns[$e]
5226
5213
  });
5227
5214
  });
5228
- for (var ge = 0, be = c.attribList.length; ge < be; ge++) {
5215
+ for (var ge = 0, we = c.attribList.length; ge < we; ge++) {
5229
5216
  var Re = c.attribList[ge], Oe = Re[0], Ne = Re[1], Ae = wt(Oe, !0), Fe = Ae.prefix, zt = Ae.local, nt = Fe === "" ? "" : S.ns[Fe] || "", Ve = {
5230
5217
  name: Oe,
5231
5218
  value: Ne,
@@ -5236,11 +5223,11 @@ Actual: ` + c.attribValue
5236
5223
  Fe && Fe !== "xmlns" && !nt && (ce(
5237
5224
  c,
5238
5225
  "Unbound namespace prefix: " + JSON.stringify(Fe)
5239
- ), Ve.uri = Fe), c.tag.attributes[Oe] = Ve, ye(c, "onattribute", Ve);
5226
+ ), Ve.uri = Fe), c.tag.attributes[Oe] = Ve, ve(c, "onattribute", Ve);
5240
5227
  }
5241
5228
  c.attribList.length = 0;
5242
5229
  }
5243
- c.tag.isSelfClosing = !!o, c.sawRoot = !0, c.tags.push(c.tag), ye(c, "onopentag", c.tag), o || (!c.noscript && c.tagName.toLowerCase() === "script" ? c.state = I.SCRIPT : c.state = I.TEXT, c.tag = null, c.tagName = ""), c.attribName = c.attribValue = "", c.attribList.length = 0;
5230
+ c.tag.isSelfClosing = !!o, c.sawRoot = !0, c.tags.push(c.tag), ve(c, "onopentag", c.tag), o || (!c.noscript && c.tagName.toLowerCase() === "script" ? c.state = I.SCRIPT : c.state = I.TEXT, c.tag = null, c.tagName = ""), c.attribName = c.attribValue = "", c.attribList.length = 0;
5244
5231
  }
5245
5232
  function lt(c) {
5246
5233
  if (!c.tagName) {
@@ -5252,7 +5239,7 @@ Actual: ` + c.attribValue
5252
5239
  c.script += "</" + c.tagName + ">", c.tagName = "", c.state = I.SCRIPT;
5253
5240
  return;
5254
5241
  }
5255
- ye(c, "onscript", c.script), c.script = "";
5242
+ ve(c, "onscript", c.script), c.script = "";
5256
5243
  }
5257
5244
  var o = c.tags.length, S = c.tagName;
5258
5245
  c.strict || (S = S[c.looseCase]());
@@ -5269,15 +5256,15 @@ Actual: ` + c.attribValue
5269
5256
  }
5270
5257
  c.tagName = S;
5271
5258
  for (var ge = c.tags.length; ge-- > o; ) {
5272
- var be = c.tag = c.tags.pop();
5273
- c.tagName = c.tag.name, ye(c, "onclosetag", c.tagName);
5259
+ var we = c.tag = c.tags.pop();
5260
+ c.tagName = c.tag.name, ve(c, "onclosetag", c.tagName);
5274
5261
  var Re = {};
5275
- for (var Oe in be.ns)
5276
- Re[Oe] = be.ns[Oe];
5262
+ for (var Oe in we.ns)
5263
+ Re[Oe] = we.ns[Oe];
5277
5264
  var Ne = c.tags[c.tags.length - 1] || c;
5278
- c.opt.xmlns && be.ns !== Ne.ns && Object.keys(be.ns).forEach(function(Ae) {
5279
- var Fe = be.ns[Ae];
5280
- ye(c, "onclosenamespace", { prefix: Ae, uri: Fe });
5265
+ c.opt.xmlns && we.ns !== Ne.ns && Object.keys(we.ns).forEach(function(Ae) {
5266
+ var Fe = we.ns[Ae];
5267
+ ve(c, "onclosenamespace", { prefix: Ae, uri: Fe });
5281
5268
  });
5282
5269
  }
5283
5270
  o === 0 && (c.closedRoot = !0), c.tagName = c.attribValue = c.attribName = "", c.attribList.length = 0, c.state = I.TEXT;
@@ -5353,16 +5340,16 @@ Actual: ` + c.attribValue
5353
5340
  o.state = I.COMMENT, o.comment = "", o.sgmlDecl = "";
5354
5341
  continue;
5355
5342
  }
5356
- o.doctype && o.doctype !== !0 && o.sgmlDecl ? (o.state = I.DOCTYPE_DTD, o.doctype += "<!" + o.sgmlDecl + E, o.sgmlDecl = "") : (o.sgmlDecl + E).toUpperCase() === Q ? (ye(o, "onopencdata"), o.state = I.CDATA, o.sgmlDecl = "", o.cdata = "") : (o.sgmlDecl + E).toUpperCase() === fe ? (o.state = I.DOCTYPE, (o.doctype || o.sawRoot) && ce(
5343
+ o.doctype && o.doctype !== !0 && o.sgmlDecl ? (o.state = I.DOCTYPE_DTD, o.doctype += "<!" + o.sgmlDecl + E, o.sgmlDecl = "") : (o.sgmlDecl + E).toUpperCase() === Q ? (ve(o, "onopencdata"), o.state = I.CDATA, o.sgmlDecl = "", o.cdata = "") : (o.sgmlDecl + E).toUpperCase() === fe ? (o.state = I.DOCTYPE, (o.doctype || o.sawRoot) && ce(
5357
5344
  o,
5358
5345
  "Inappropriately located doctype declaration"
5359
- ), o.doctype = "", o.sgmlDecl = "") : E === ">" ? (ye(o, "onsgmldeclaration", o.sgmlDecl), o.sgmlDecl = "", o.state = I.TEXT) : (de(E) && (o.state = I.SGML_DECL_QUOTED), o.sgmlDecl += E);
5346
+ ), o.doctype = "", o.sgmlDecl = "") : E === ">" ? (ve(o, "onsgmldeclaration", o.sgmlDecl), o.sgmlDecl = "", o.state = I.TEXT) : (de(E) && (o.state = I.SGML_DECL_QUOTED), o.sgmlDecl += E);
5360
5347
  continue;
5361
5348
  case I.SGML_DECL_QUOTED:
5362
5349
  E === o.q && (o.state = I.SGML_DECL, o.q = ""), o.sgmlDecl += E;
5363
5350
  continue;
5364
5351
  case I.DOCTYPE:
5365
- E === ">" ? (o.state = I.TEXT, ye(o, "ondoctype", o.doctype), o.doctype = !0) : (o.doctype += E, E === "[" ? o.state = I.DOCTYPE_DTD : de(E) && (o.state = I.DOCTYPE_QUOTED, o.q = E));
5352
+ E === ">" ? (o.state = I.TEXT, ve(o, "ondoctype", o.doctype), o.doctype = !0) : (o.doctype += E, E === "[" ? o.state = I.DOCTYPE_DTD : de(E) && (o.state = I.DOCTYPE_QUOTED, o.q = E));
5366
5353
  continue;
5367
5354
  case I.DOCTYPE_QUOTED:
5368
5355
  o.doctype += E, E === o.q && (o.q = "", o.state = I.DOCTYPE);
@@ -5377,7 +5364,7 @@ Actual: ` + c.attribValue
5377
5364
  E === "-" ? o.state = I.COMMENT_ENDING : o.comment += E;
5378
5365
  continue;
5379
5366
  case I.COMMENT_ENDING:
5380
- E === "-" ? (o.state = I.COMMENT_ENDED, o.comment = ze(o.opt, o.comment), o.comment && ye(o, "oncomment", o.comment), o.comment = "") : (o.comment += "-" + E, o.state = I.COMMENT);
5367
+ E === "-" ? (o.state = I.COMMENT_ENDED, o.comment = ze(o.opt, o.comment), o.comment && ve(o, "oncomment", o.comment), o.comment = "") : (o.comment += "-" + E, o.state = I.COMMENT);
5381
5368
  continue;
5382
5369
  case I.COMMENT_ENDED:
5383
5370
  E !== ">" ? (ce(o, "Malformed comment"), o.comment += "--" + E, o.state = I.COMMENT) : o.doctype && o.doctype !== !0 ? o.state = I.DOCTYPE_DTD : o.state = I.TEXT;
@@ -5392,7 +5379,7 @@ Actual: ` + c.attribValue
5392
5379
  E === "]" ? o.state = I.CDATA_ENDING_2 : (o.cdata += "]" + E, o.state = I.CDATA);
5393
5380
  continue;
5394
5381
  case I.CDATA_ENDING_2:
5395
- E === ">" ? (o.cdata && ye(o, "oncdata", o.cdata), ye(o, "onclosecdata"), o.cdata = "", o.state = I.TEXT) : E === "]" ? o.cdata += "]" : (o.cdata += "]]" + E, o.state = I.CDATA);
5382
+ E === ">" ? (o.cdata && ve(o, "oncdata", o.cdata), ve(o, "onclosecdata"), o.cdata = "", o.state = I.TEXT) : E === "]" ? o.cdata += "]" : (o.cdata += "]]" + E, o.state = I.CDATA);
5396
5383
  continue;
5397
5384
  case I.PROC_INST:
5398
5385
  E === "?" ? o.state = I.PROC_INST_ENDING : Z(E) ? o.state = I.PROC_INST_BODY : o.procInstName += E;
@@ -5408,12 +5395,12 @@ Actual: ` + c.attribValue
5408
5395
  name: o.procInstName,
5409
5396
  body: o.procInstBody
5410
5397
  };
5411
- kt(o, Ne), ye(o, "onprocessinginstruction", Ne), o.procInstName = o.procInstBody = "", o.state = I.TEXT;
5398
+ kt(o, Ne), ve(o, "onprocessinginstruction", Ne), o.procInstName = o.procInstBody = "", o.state = I.TEXT;
5412
5399
  } else
5413
5400
  o.procInstBody += "?" + E, o.state = I.PROC_INST_BODY;
5414
5401
  continue;
5415
5402
  case I.OPEN_TAG:
5416
- me(xe, E) ? o.tagName += E : (et(o), E === ">" ? Me(o) : E === "/" ? o.state = I.OPEN_TAG_SLASH : (Z(E) || ce(o, "Invalid character in tag name"), o.state = I.ATTRIB));
5403
+ me(Te, E) ? o.tagName += E : (et(o), E === ">" ? Me(o) : E === "/" ? o.state = I.OPEN_TAG_SLASH : (Z(E) || ce(o, "Invalid character in tag name"), o.state = I.ATTRIB));
5417
5404
  continue;
5418
5405
  case I.OPEN_TAG_SLASH:
5419
5406
  E === ">" ? (Me(o, !0), lt(o)) : (ce(
@@ -5427,7 +5414,7 @@ Actual: ` + c.attribValue
5427
5414
  E === ">" ? Me(o) : E === "/" ? o.state = I.OPEN_TAG_SLASH : me(ie, E) ? (o.attribName = E, o.attribValue = "", o.state = I.ATTRIB_NAME) : ce(o, "Invalid attribute name");
5428
5415
  continue;
5429
5416
  case I.ATTRIB_NAME:
5430
- E === "=" ? o.state = I.ATTRIB_VALUE : E === ">" ? (ce(o, "Attribute without value"), o.attribValue = o.attribName, tt(o), Me(o)) : Z(E) ? o.state = I.ATTRIB_NAME_SAW_WHITE : me(xe, E) ? o.attribName += E : ce(o, "Invalid attribute name");
5417
+ E === "=" ? o.state = I.ATTRIB_VALUE : E === ">" ? (ce(o, "Attribute without value"), o.attribValue = o.attribName, tt(o), Me(o)) : Z(E) ? o.state = I.ATTRIB_NAME_SAW_WHITE : me(Te, E) ? o.attribName += E : ce(o, "Invalid attribute name");
5431
5418
  continue;
5432
5419
  case I.ATTRIB_NAME_SAW_WHITE:
5433
5420
  if (E === "=")
@@ -5435,7 +5422,7 @@ Actual: ` + c.attribValue
5435
5422
  else {
5436
5423
  if (Z(E))
5437
5424
  continue;
5438
- ce(o, "Attribute without value"), o.tag.attributes[o.attribName] = "", o.attribValue = "", ye(o, "onattribute", {
5425
+ ce(o, "Attribute without value"), o.tag.attributes[o.attribName] = "", o.attribValue = "", ve(o, "onattribute", {
5439
5426
  name: o.attribName,
5440
5427
  value: ""
5441
5428
  }), o.attribName = "", E === ">" ? Me(o) : me(ie, E) ? (o.attribName = E, o.state = I.ATTRIB_NAME) : (ce(o, "Invalid attribute name"), o.state = I.ATTRIB);
@@ -5465,7 +5452,7 @@ Actual: ` + c.attribValue
5465
5452
  continue;
5466
5453
  case I.CLOSE_TAG:
5467
5454
  if (o.tagName)
5468
- E === ">" ? lt(o) : me(xe, E) ? o.tagName += E : o.script ? (o.script += "</" + o.tagName + E, o.tagName = "", o.state = I.SCRIPT) : (Z(E) || ce(o, "Invalid tagname in closing tag"), o.state = I.CLOSE_TAG_SAW_WHITE);
5455
+ E === ">" ? lt(o) : me(Te, E) ? o.tagName += E : o.script ? (o.script += "</" + o.tagName + E, o.tagName = "", o.state = I.SCRIPT) : (Z(E) || ce(o, "Invalid tagname in closing tag"), o.state = I.CLOSE_TAG_SAW_WHITE);
5469
5456
  else {
5470
5457
  if (Z(E))
5471
5458
  continue;
@@ -5480,16 +5467,16 @@ Actual: ` + c.attribValue
5480
5467
  case I.TEXT_ENTITY:
5481
5468
  case I.ATTRIB_VALUE_ENTITY_Q:
5482
5469
  case I.ATTRIB_VALUE_ENTITY_U:
5483
- var be, Re;
5470
+ var we, Re;
5484
5471
  switch (o.state) {
5485
5472
  case I.TEXT_ENTITY:
5486
- be = I.TEXT, Re = "textNode";
5473
+ we = I.TEXT, Re = "textNode";
5487
5474
  break;
5488
5475
  case I.ATTRIB_VALUE_ENTITY_Q:
5489
- be = I.ATTRIB_VALUE_QUOTED, Re = "attribValue";
5476
+ we = I.ATTRIB_VALUE_QUOTED, Re = "attribValue";
5490
5477
  break;
5491
5478
  case I.ATTRIB_VALUE_ENTITY_U:
5492
- be = I.ATTRIB_VALUE_UNQUOTED, Re = "attribValue";
5479
+ we = I.ATTRIB_VALUE_UNQUOTED, Re = "attribValue";
5493
5480
  break;
5494
5481
  }
5495
5482
  if (E === ";") {
@@ -5500,8 +5487,8 @@ Actual: ` + c.attribValue
5500
5487
  ), (o.entityDepth += 1) > o.opt.maxEntityDepth && Ie(
5501
5488
  o,
5502
5489
  "Parsed entity depth exceeds max entity depth"
5503
- ), o.entity = "", o.state = be, o.write(Oe), o.entityDepth -= 1) : (o[Re] += Oe, o.entity = "", o.state = be);
5504
- } else me(o.entity.length ? H : te, E) ? o.entity += E : (ce(o, "Invalid character in entity name"), o[Re] += "&" + o.entity + E, o.entity = "", o.state = be);
5490
+ ), o.entity = "", o.state = we, o.write(Oe), o.entityDepth -= 1) : (o[Re] += Oe, o.entity = "", o.state = we);
5491
+ } else me(o.entity.length ? H : te, E) ? o.entity += E : (ce(o, "Invalid character in entity name"), o[Re] += "&" + o.entity + E, o.entity = "", o.state = we);
5505
5492
  continue;
5506
5493
  default:
5507
5494
  throw new Error(o, "Unknown state: " + o.state);
@@ -5510,7 +5497,7 @@ Actual: ` + c.attribValue
5510
5497
  }
5511
5498
  String.fromCodePoint || (function() {
5512
5499
  var c = String.fromCharCode, o = Math.floor, S = function() {
5513
- var E = 16384, se = [], ge, be, Re = -1, Oe = arguments.length;
5500
+ var E = 16384, se = [], ge, we, Re = -1, Oe = arguments.length;
5514
5501
  if (!Oe)
5515
5502
  return "";
5516
5503
  for (var Ne = ""; ++Re < Oe; ) {
@@ -5520,7 +5507,7 @@ Actual: ` + c.attribValue
5520
5507
  Ae > 1114111 || // not a valid Unicode code point
5521
5508
  o(Ae) !== Ae)
5522
5509
  throw RangeError("Invalid code point: " + Ae);
5523
- Ae <= 65535 ? se.push(Ae) : (Ae -= 65536, ge = (Ae >> 10) + 55296, be = Ae % 1024 + 56320, se.push(ge, be)), (Re + 1 === Oe || se.length > E) && (Ne += c.apply(null, se), se.length = 0);
5510
+ Ae <= 65535 ? se.push(Ae) : (Ae -= 65536, ge = (Ae >> 10) + 55296, we = Ae % 1024 + 56320, se.push(ge, we)), (Re + 1 === Oe || se.length > E) && (Ne += c.apply(null, se), se.length = 0);
5524
5511
  }
5525
5512
  return Ne;
5526
5513
  };
@@ -5589,11 +5576,11 @@ function Qi(m) {
5589
5576
  const _ = no(s, h.defaultNamespace), D = io({ attributes: s.attributes, useCustomRecordsIds: d }), F = oo({
5590
5577
  attributes: s.attributes,
5591
5578
  useCustomRecordsIds: d
5592
- }), $ = ro(F), G = ao(l.stack), Q = {
5579
+ }), X = ro(F), G = ao(l.stack), Q = {
5593
5580
  id: D,
5594
5581
  tagName: y,
5595
5582
  namespace: _,
5596
- attributes: $,
5583
+ attributes: X,
5597
5584
  value: "",
5598
5585
  parent: G,
5599
5586
  children: []
@@ -5677,14 +5664,14 @@ function ao(m) {
5677
5664
  return s ? { id: s.id, tagName: s.tagName } : null;
5678
5665
  }
5679
5666
  function io(m) {
5680
- const { attributes: s, useCustomRecordsIds: l } = m, i = s[sa];
5667
+ const { attributes: s, useCustomRecordsIds: l } = m, i = s[fa];
5681
5668
  return l && i && i.value ? i.value : crypto.randomUUID();
5682
5669
  }
5683
5670
  function oo(m) {
5684
5671
  const { attributes: s, useCustomRecordsIds: l } = m;
5685
- return l ? Object.values(s).filter((i) => i.name !== sa) : Object.values(s);
5672
+ return l ? Object.values(s).filter((i) => i.name !== fa) : Object.values(s);
5686
5673
  }
5687
- const na = {
5674
+ const oa = {
5688
5675
  useBrowserApi: !0,
5689
5676
  chunkSize: 32 * 1024,
5690
5677
  // 32KB
@@ -5693,8 +5680,8 @@ const na = {
5693
5680
  async function Ko(m) {
5694
5681
  const { files: s, dialecteConfig: l, useCustomRecordsIds: i = !1 } = m, d = [];
5695
5682
  if (s.length === 0) throw new Error("No files provided for import.");
5696
- const { importOptions: h = na, supportedFileExtensions: y } = l.io, _ = {
5697
- ...na,
5683
+ const { importOptions: h = oa, supportedFileExtensions: y } = l.io, _ = {
5684
+ ...oa,
5698
5685
  ...h
5699
5686
  };
5700
5687
  for (const D of s) {
@@ -5735,8 +5722,8 @@ async function co(m) {
5735
5722
  batchSize: i.batchSize
5736
5723
  }
5737
5724
  }), l.io.hooks?.afterImport) {
5738
- const { creates: D, updates: F, deletes: $ } = await l.io.hooks.afterImport();
5739
- D?.length && await wa({ databaseInstance: y, elementsTableName: _, records: D }), F?.length && await ji({ databaseInstance: y, elementsTableName: _, updates: F }), $?.length && await Ki({ databaseInstance: y, elementsTableName: _, ids: $ });
5725
+ const { creates: D, updates: F, deletes: X } = await l.io.hooks.afterImport();
5726
+ D?.length && await Ta({ databaseInstance: y, elementsTableName: _, records: D }), F?.length && await ji({ databaseInstance: y, elementsTableName: _, updates: F }), X?.length && await Ki({ databaseInstance: y, elementsTableName: _, ids: X });
5740
5727
  }
5741
5728
  return h;
5742
5729
  } catch (_) {
@@ -5761,13 +5748,13 @@ async function lo(m) {
5761
5748
  });
5762
5749
  }
5763
5750
  async function pr(m) {
5764
- const { databaseInstance: s, elementsTableName: l, reader: i, sax: d, textDecoder: h, buffer: y, options: _ } = m, { chunkSize: D, batchSize: F } = _, { done: $, value: G } = await i.read();
5765
- if ($) {
5751
+ const { databaseInstance: s, elementsTableName: l, reader: i, sax: d, textDecoder: h, buffer: y, options: _ } = m, { chunkSize: D, batchSize: F } = _, { done: X, value: G } = await i.read();
5752
+ if (X) {
5766
5753
  if (y.length > 0) {
5767
5754
  const fe = h.decode(y);
5768
5755
  d.parser.write(fe);
5769
5756
  }
5770
- return d.parser.close(), await ra({
5757
+ return d.parser.close(), await sa({
5771
5758
  databaseInstance: s,
5772
5759
  elementsTableName: l,
5773
5760
  sax: d,
@@ -5781,7 +5768,7 @@ async function pr(m) {
5781
5768
  const fe = Q.slice(0, D);
5782
5769
  Q = Q.slice(D);
5783
5770
  const M = h.decode(fe, { stream: !0 });
5784
- d.parser.write(M), await ra({
5771
+ d.parser.write(M), await sa({
5785
5772
  databaseInstance: s,
5786
5773
  elementsTableName: l,
5787
5774
  sax: d,
@@ -5790,23 +5777,23 @@ async function pr(m) {
5790
5777
  }
5791
5778
  return await pr({ ...m, buffer: Q });
5792
5779
  }
5793
- async function ra(m) {
5780
+ async function sa(m) {
5794
5781
  const { databaseInstance: s, elementsTableName: l, sax: i, batchSize: d } = m;
5795
5782
  if (i.getSize() >= d) {
5796
5783
  const y = i.drainBatch(), _ = Ui({
5797
5784
  currentBatch: y
5798
5785
  });
5799
- await wa({
5786
+ await Ta({
5800
5787
  databaseInstance: s,
5801
5788
  elementsTableName: l,
5802
5789
  records: _
5803
5790
  });
5804
5791
  }
5805
5792
  }
5806
- const _a = "_temp-idb-id";
5807
- var $t = { exports: {} }, Tn = { exports: {} }, aa;
5793
+ const Na = "_temp-idb-id";
5794
+ var Xt = { exports: {} }, xn = { exports: {} }, ua;
5808
5795
  function fo() {
5809
- return aa || (aa = 1, (function(m, s) {
5796
+ return ua || (ua = 1, (function(m, s) {
5810
5797
  Object.defineProperty(s, "__esModule", { value: !0 }), s.ParsingError = void 0;
5811
5798
  class l extends Error {
5812
5799
  constructor(H, Z) {
@@ -5816,7 +5803,7 @@ function fo() {
5816
5803
  s.ParsingError = l;
5817
5804
  let i;
5818
5805
  function d() {
5819
- return D(!1) || Q() || G() || $() || _();
5806
+ return D(!1) || Q() || G() || X() || _();
5820
5807
  }
5821
5808
  function h() {
5822
5809
  return B(/\s*/), D(!0) || G() || F() || _();
@@ -5912,7 +5899,7 @@ function fo() {
5912
5899
  };
5913
5900
  }
5914
5901
  }
5915
- function $() {
5902
+ function X() {
5916
5903
  if (i.xml.startsWith("<![CDATA[")) {
5917
5904
  const te = i.xml.indexOf("]]>");
5918
5905
  if (te > -1) {
@@ -5975,7 +5962,7 @@ function fo() {
5975
5962
  function ie(te) {
5976
5963
  return i.xml.indexOf(te) === 0;
5977
5964
  }
5978
- function xe(te, H = {}) {
5965
+ function Te(te, H = {}) {
5979
5966
  te = te.trim();
5980
5967
  const Z = H.filter || (() => !0);
5981
5968
  return i = {
@@ -5983,13 +5970,13 @@ function fo() {
5983
5970
  options: Object.assign(Object.assign({}, H), { filter: Z, strictMode: H.strictMode === !0 })
5984
5971
  }, y();
5985
5972
  }
5986
- m.exports = xe, s.default = xe;
5987
- })(Tn, Tn.exports)), Tn.exports;
5973
+ m.exports = Te, s.default = Te;
5974
+ })(xn, xn.exports)), xn.exports;
5988
5975
  }
5989
- var ia = $t.exports, oa;
5976
+ var ca = Xt.exports, la;
5990
5977
  function ho() {
5991
- return oa || (oa = 1, (function(m, s) {
5992
- var l = ia && ia.__importDefault || function(M) {
5978
+ return la || (la = 1, (function(m, s) {
5979
+ var l = ca && ca.__importDefault || function(M) {
5993
5980
  return M && M.__esModule ? M : { default: M };
5994
5981
  };
5995
5982
  Object.defineProperty(s, "__esModule", { value: !0 });
@@ -6013,7 +6000,7 @@ function ho() {
6013
6000
  }
6014
6001
  function _(M, B, ue) {
6015
6002
  if (M.type === "Element")
6016
- $(M, B, ue);
6003
+ X(M, B, ue);
6017
6004
  else if (M.type === "ProcessingInstruction")
6018
6005
  Q(M, B);
6019
6006
  else if (typeof M.content == "string")
@@ -6032,7 +6019,7 @@ function ho() {
6032
6019
  const ue = "/" + M.join("/"), ie = M[M.length - 1];
6033
6020
  return B.includes(ie) || B.includes(ue);
6034
6021
  }
6035
- function $(M, B, ue) {
6022
+ function X(M, B, ue) {
6036
6023
  if (B.path.push(M.name), !ue && B.content.length > 0 && d(B), y(B, "<" + M.name), G(B, M.attributes), M.children === null || B.options.forceSelfClosingEmptyTag && M.children.length === 0) {
6037
6024
  const ie = B.options.whiteSpaceAtEndOfSelfclosingTag ? " />" : "/>";
6038
6025
  y(B, ie);
@@ -6041,17 +6028,17 @@ function ho() {
6041
6028
  else {
6042
6029
  const ie = M.children;
6043
6030
  y(B, ">"), B.level++;
6044
- let xe = M.attributes["xml:space"] === "preserve" || ue, te = !1;
6045
- if (!xe && B.options.ignoredPaths && (te = F(B.path, B.options.ignoredPaths), xe = te), !xe && B.options.collapseContent) {
6031
+ let Te = M.attributes["xml:space"] === "preserve" || ue, te = !1;
6032
+ if (!Te && B.options.ignoredPaths && (te = F(B.path, B.options.ignoredPaths), Te = te), !Te && B.options.collapseContent) {
6046
6033
  let H = !1, Z = !1, de = !1;
6047
6034
  ie.forEach(function(le, me) {
6048
6035
  le.type === "Text" ? (le.content.includes(`
6049
6036
  `) ? (Z = !0, le.content = le.content.trim()) : (me === 0 || me === ie.length - 1) && !ue && le.content.trim().length === 0 && (le.content = ""), (le.content.trim().length > 0 || ie.length === 1) && (H = !0)) : le.type === "CDATA" ? H = !0 : de = !0;
6050
- }), H && (!de || !Z) && (xe = !0);
6037
+ }), H && (!de || !Z) && (Te = !0);
6051
6038
  }
6052
6039
  ie.forEach(function(H) {
6053
- _(H, B, ue || xe);
6054
- }), B.level--, !ue && !xe && d(B), te && h(B), y(B, "</" + M.name + ">");
6040
+ _(H, B, ue || Te);
6041
+ }), B.level--, !ue && !Te && d(B), te && h(B), y(B, "</" + M.name + ">");
6055
6042
  }
6056
6043
  B.path.pop();
6057
6044
  }
@@ -6074,8 +6061,8 @@ function ho() {
6074
6061
  `, B.whiteSpaceAtEndOfSelfclosingTag = B.whiteSpaceAtEndOfSelfclosingTag === !0, B.throwOnFailure = B.throwOnFailure !== !1, B.attributeQuotes = "attributeQuotes" in B ? B.attributeQuotes : "double";
6075
6062
  try {
6076
6063
  const ue = (0, i.default)(M, { filter: B.filter, strictMode: B.strictMode }), ie = { content: "", level: 0, options: B, path: [] };
6077
- return ue.declaration && Q(ue.declaration, ie), ue.children.forEach(function(xe) {
6078
- _(xe, ie, !1);
6064
+ return ue.declaration && Q(ue.declaration, ie), ue.children.forEach(function(Te) {
6065
+ _(Te, ie, !1);
6079
6066
  }), B.lineSeparator ? ie.content.replace(/\r\n/g, `
6080
6067
  `).replace(/\n/g, B.lineSeparator) : ie.content;
6081
6068
  } catch (ue) {
@@ -6085,10 +6072,10 @@ function ho() {
6085
6072
  }
6086
6073
  }
6087
6074
  fe.minify = (M, B = {}) => fe(M, Object.assign(Object.assign({}, B), { indentation: "", lineSeparator: "" })), m.exports = fe, s.default = fe;
6088
- })($t, $t.exports)), $t.exports;
6075
+ })(Xt, Xt.exports)), Xt.exports;
6089
6076
  }
6090
6077
  var po = /* @__PURE__ */ ho();
6091
- const mo = /* @__PURE__ */ ba(po);
6078
+ const mo = /* @__PURE__ */ xa(po);
6092
6079
  function go(m) {
6093
6080
  return mo(m);
6094
6081
  }
@@ -6101,18 +6088,18 @@ async function yo(m) {
6101
6088
  suggestedName: i,
6102
6089
  types: [
6103
6090
  {
6104
- description: "FSD Files",
6091
+ description: `${s.replace(/^\./, "").toUpperCase()} Files`,
6105
6092
  accept: { "application/xml": [s] }
6106
6093
  }
6107
6094
  ]
6108
6095
  })).createWritable();
6109
6096
  await G.write(F), await G.close();
6110
- } catch ($) {
6111
- $.name !== "AbortError" && console.error("Save failed:", $);
6097
+ } catch (X) {
6098
+ X.name !== "AbortError" && console.error("Save failed:", X);
6112
6099
  }
6113
6100
  else {
6114
- const $ = URL.createObjectURL(F), G = document.createElement("a");
6115
- G.href = $, G.download = i, document.body.appendChild(G), G.click(), G.remove(), URL.revokeObjectURL($);
6101
+ const X = URL.createObjectURL(F), G = document.createElement("a");
6102
+ G.href = X, G.download = i, document.body.appendChild(G), G.click(), G.remove(), URL.revokeObjectURL(X);
6116
6103
  }
6117
6104
  }
6118
6105
  async function qo(m) {
@@ -6162,28 +6149,28 @@ async function bo(m) {
6162
6149
  null
6163
6150
  ), F = await s.table(_).where({ tagName: h }).first();
6164
6151
  if (!F) throw new Error(`No ${h} root element found in DB`);
6165
- const $ = D.createElementNS(
6152
+ const X = D.createElementNS(
6166
6153
  F.namespace.uri,
6167
6154
  F.tagName
6168
6155
  );
6169
- return $.setAttribute("xmlns", F.namespace.uri), F.attributes && Ta({
6156
+ return X.setAttribute("xmlns", F.namespace.uri), F.attributes && Oa({
6170
6157
  dialecteConfig: l,
6171
6158
  document: D,
6172
- element: $,
6159
+ element: X,
6173
6160
  attributes: F.attributes,
6174
6161
  isRoot: !0
6175
- }), Na({ dialecteConfig: l, rootElement: $, namespace: F.namespace }), F.value && ($.textContent = F.value.trim()), i && $.setAttribute(_a, F.id), D.appendChild($), await Ea({
6162
+ }), Da({ dialecteConfig: l, rootElement: X, namespace: F.namespace }), F.value && (X.textContent = F.value.trim()), i && X.setAttribute(Na, F.id), D.appendChild(X), await Aa({
6176
6163
  databaseInstance: s,
6177
6164
  dialecteConfig: l,
6178
6165
  elementsTableName: _,
6179
6166
  withDatabaseIds: i,
6180
6167
  xmlDocument: D,
6181
6168
  databaseRecord: F,
6182
- parentDomElement: $
6169
+ parentDomElement: X
6183
6170
  });
6184
6171
  }
6185
6172
  }
6186
- async function Ea(m) {
6173
+ async function Aa(m) {
6187
6174
  const {
6188
6175
  databaseInstance: s,
6189
6176
  dialecteConfig: l,
@@ -6194,15 +6181,15 @@ async function Ea(m) {
6194
6181
  parentDomElement: _
6195
6182
  } = m;
6196
6183
  if (!y.children) return;
6197
- const D = y.children.map((Q) => Q.id), $ = await s.table(i).bulkGet(D);
6184
+ const D = y.children.map((Q) => Q.id), X = await s.table(i).bulkGet(D);
6198
6185
  Eo({
6199
- childrenRecords: $,
6186
+ childrenRecords: X,
6200
6187
  parentRecord: y
6201
6188
  });
6202
6189
  const G = _o({
6203
6190
  parentTagName: y.tagName,
6204
6191
  availableChildren: l.children,
6205
- childrenRecords: $
6192
+ childrenRecords: X
6206
6193
  });
6207
6194
  for (const Q of G) {
6208
6195
  const fe = wo({
@@ -6212,7 +6199,7 @@ async function Ea(m) {
6212
6199
  defaultNamespace: l.namespaces.default,
6213
6200
  withDatabaseIds: d
6214
6201
  });
6215
- _.appendChild(fe), await Ea({
6202
+ _.appendChild(fe), await Aa({
6216
6203
  databaseInstance: s,
6217
6204
  dialecteConfig: l,
6218
6205
  elementsTableName: i,
@@ -6227,32 +6214,32 @@ async function Ea(m) {
6227
6214
  function wo(m) {
6228
6215
  const { dialecteConfig: s, document: l, record: i, defaultNamespace: d, withDatabaseIds: h } = m;
6229
6216
  let y;
6230
- return !(i.namespace.uri === d.uri) && i.namespace.prefix && i.namespace.prefix !== "xmlns" ? (xa({
6217
+ return !(i.namespace.uri === d.uri) && i.namespace.prefix && i.namespace.prefix !== "xmlns" ? (Ca({
6231
6218
  dialecteConfig: s,
6232
6219
  document: l,
6233
6220
  namespace: i.namespace
6234
6221
  }), y = l.createElementNS(
6235
6222
  i.namespace.uri,
6236
6223
  `${i.namespace.prefix}:${i.tagName}`
6237
- )) : y = l.createElementNS(i.namespace.uri, i.tagName), i.attributes && Ta({
6224
+ )) : y = l.createElementNS(i.namespace.uri, i.tagName), i.attributes && Oa({
6238
6225
  dialecteConfig: s,
6239
6226
  document: l,
6240
6227
  element: y,
6241
6228
  attributes: i.attributes,
6242
6229
  isRoot: !1
6243
- }), i.value && (y.textContent = i.value.trim()), h && y.setAttribute(_a, i.id), y;
6230
+ }), i.value && (y.textContent = i.value.trim()), h && y.setAttribute(Na, i.id), y;
6244
6231
  }
6245
- function Ta(m) {
6232
+ function Oa(m) {
6246
6233
  const { dialecteConfig: s, document: l, element: i, attributes: d, isRoot: h } = m;
6247
6234
  for (const y of d)
6248
- if (!To(y))
6249
- if (Aa(y)) {
6235
+ if (!xo(y))
6236
+ if (Ia(y)) {
6250
6237
  const _ = y.namespace?.prefix || "";
6251
6238
  if (!_) {
6252
6239
  i.setAttribute(y.name, String(y.value));
6253
6240
  continue;
6254
6241
  }
6255
- h || xa({
6242
+ h || Ca({
6256
6243
  dialecteConfig: s,
6257
6244
  document: l,
6258
6245
  namespace: y.namespace
@@ -6261,13 +6248,13 @@ function Ta(m) {
6261
6248
  i.setAttributeNS(y.namespace.uri, F, String(y.value));
6262
6249
  } else i.setAttribute(y.name, String(y.value));
6263
6250
  }
6264
- function xa(m) {
6251
+ function Ca(m) {
6265
6252
  const { dialecteConfig: s, document: l, namespace: i } = m, d = l.documentElement;
6266
6253
  if (!d || !i.prefix || i.prefix === "xmlns") return;
6267
6254
  const h = "http://www.w3.org/2000/xmlns/";
6268
- d.getAttributeNS(h, i.prefix) === null && (d.setAttributeNS(h, `xmlns:${i.prefix}`, i.uri), Na({ dialecteConfig: s, rootElement: d, namespace: i }));
6255
+ d.getAttributeNS(h, i.prefix) === null && (d.setAttributeNS(h, `xmlns:${i.prefix}`, i.uri), Da({ dialecteConfig: s, rootElement: d, namespace: i }));
6269
6256
  }
6270
- function Na(m) {
6257
+ function Da(m) {
6271
6258
  const { dialecteConfig: s, rootElement: l, namespace: i } = m, d = Object.entries(
6272
6259
  s.definition[s.rootElementName].attributes.details
6273
6260
  ).filter(([y, _]) => i.uri === s.namespaces.default.uri ? !_.namespace : _.namespace?.prefix === i.prefix && _.namespace?.uri === i.uri);
@@ -6276,8 +6263,8 @@ function Na(m) {
6276
6263
  const D = y.includes(":") && y.split(":").pop() || y;
6277
6264
  if (!(_.namespace ? l.hasAttributeNS(_.namespace.uri, D) : l.hasAttribute(D)))
6278
6265
  if (_.namespace) {
6279
- const $ = `${_.namespace.prefix}:${D}`;
6280
- l.setAttributeNS(_.namespace.uri, $, _.default || "");
6266
+ const X = `${_.namespace.prefix}:${D}`;
6267
+ l.setAttributeNS(_.namespace.uri, X, _.default || "");
6281
6268
  } else
6282
6269
  l.setAttribute(D, _.default || "");
6283
6270
  }
@@ -6308,21 +6295,21 @@ function Eo(m) {
6308
6295
  );
6309
6296
  }
6310
6297
  }
6311
- function Aa(m) {
6298
+ function Ia(m) {
6312
6299
  return m !== null && typeof m == "object" && "namespace" in m && !!m.namespace;
6313
6300
  }
6314
- function To(m) {
6315
- return !!(m.name === "xmlns" || m.name.startsWith("xmlns:") || Aa(m) && m.namespace?.prefix === "xmlns");
6301
+ function xo(m) {
6302
+ return !!(m.name === "xmlns" || m.name.startsWith("xmlns:") || Ia(m) && m.namespace?.prefix === "xmlns");
6316
6303
  }
6317
6304
  function Lo(m) {
6318
- const { config: s, storage: l, extensions: i, hooks: d } = m, h = ua({ base: i?.base, custom: i?.custom }), y = Oa(l, s);
6319
- return new va(y, s, h, d);
6305
+ const { config: s, storage: l, extensions: i, hooks: d } = m, h = da({ base: i?.base, custom: i?.custom }), y = Ra(l, s);
6306
+ return new Ea(y, s, h, d);
6320
6307
  }
6321
6308
  async function Uo(m) {
6322
- const { config: s, storage: l, extensions: i, hooks: d } = m, h = ua({ base: i?.base, custom: i?.custom }), y = Oa(l, s), _ = s.definition[s.rootElementName], D = Object.entries(_?.attributes.details ?? {}).filter(([, F]) => F.required).map(([F, $]) => ({
6309
+ const { config: s, storage: l, extensions: i, hooks: d } = m, h = da({ base: i?.base, custom: i?.custom }), y = Ra(l, s), _ = s.definition[s.rootElementName], D = Object.entries(_?.attributes.details ?? {}).filter(([, F]) => F.required).map(([F, X]) => ({
6323
6310
  name: F,
6324
- value: $.fixed ?? $.default ?? "",
6325
- ...$.namespace ? { namespace: $.namespace } : {}
6311
+ value: X.fixed ?? X.default ?? "",
6312
+ ...X.namespace ? { namespace: X.namespace } : {}
6326
6313
  }));
6327
6314
  return await y.commit({
6328
6315
  creates: [
@@ -6340,22 +6327,22 @@ async function Uo(m) {
6340
6327
  deletes: [],
6341
6328
  onProgress: () => {
6342
6329
  }
6343
- }), new va(y, s, h, d);
6330
+ }), new Ea(y, s, h, d);
6344
6331
  }
6345
- function Oa(m, s) {
6332
+ function Ra(m, s) {
6346
6333
  return m.type === "local" ? new Bi(m.databaseName, s) : m.store;
6347
6334
  }
6348
6335
  export {
6349
- ha as A,
6336
+ ya as A,
6350
6337
  so as B,
6351
- Xt as C,
6338
+ $t as C,
6352
6339
  Bi as D,
6353
6340
  mr as E,
6354
- ma as Q,
6355
- _a as T,
6356
- va as a,
6341
+ ba as Q,
6342
+ Na as T,
6343
+ Ea as a,
6357
6344
  Ii as b,
6358
- wa as c,
6345
+ Ta as c,
6359
6346
  Ki as d,
6360
6347
  qo as e,
6361
6348
  Mo as f,
@@ -6363,20 +6350,20 @@ export {
6363
6350
  Uo as h,
6364
6351
  Ko as i,
6365
6352
  jo as j,
6366
- ii as k,
6353
+ ci as k,
6367
6354
  Nn as l,
6368
- oi as m,
6355
+ li as m,
6369
6356
  go as n,
6370
6357
  Lo as o,
6371
- pi as p,
6372
- mi as q,
6373
- gi as r,
6374
- yi as s,
6375
- ri as t,
6376
- ai as u,
6358
+ Hr as p,
6359
+ Zr as q,
6360
+ Jr as r,
6361
+ ea as s,
6362
+ si as t,
6363
+ ui as u,
6377
6364
  uo as v,
6378
- Te as w,
6365
+ xe as w,
6379
6366
  mo as x,
6380
- ca as y,
6381
- la as z
6367
+ ha as y,
6368
+ pa as z
6382
6369
  };