@ridp/threejs 1.1.3 → 1.1.4

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,11 +1,11 @@
1
- import * as bt from "three";
2
- import { TrianglesDrawMode as Ei, TriangleFanDrawMode as kr, TriangleStripDrawMode as Ds, Loader as Ns, FileLoader as Dn, SRGBColorSpace as at, LinearSRGBColorSpace as qe, BufferGeometry as Fs, BufferAttribute as en, Color as Qe, ColorManagement as Or, LoaderUtils as tn, MeshPhysicalMaterial as Ge, Vector2 as Nr, SpotLight as Si, PointLight as Ri, DirectionalLight as ki, Matrix4 as Nt, Vector3 as le, Quaternion as js, InstancedMesh as Oi, InstancedBufferAttribute as Mi, Object3D as Ks, TextureLoader as Pi, ImageBitmapLoader as Ci, InterleavedBuffer as Ii, InterleavedBufferAttribute as Li, LinearMipmapLinearFilter as Bs, NearestMipmapLinearFilter as Di, LinearMipmapNearestFilter as Ni, NearestMipmapNearestFilter as Fi, LinearFilter as Mr, NearestFilter as Us, RepeatWrapping as Pr, MirroredRepeatWrapping as ji, ClampToEdgeWrapping as Ki, PointsMaterial as Bi, Material as _r, LineBasicMaterial as Ui, MeshStandardMaterial as qs, DoubleSide as qi, MeshBasicMaterial as Zt, PropertyBinding as Gi, SkinnedMesh as Hi, Mesh as zi, LineSegments as Vi, Line as Xi, LineLoop as Wi, Points as Yi, Group as Ar, PerspectiveCamera as Gs, MathUtils as Lt, OrthographicCamera as Qi, Skeleton as $i, AnimationClip as Ji, Bone as Zi, InterpolateDiscrete as eo, InterpolateLinear as Hs, Texture as vs, VectorKeyframeTrack as bs, NumberKeyframeTrack as ws, QuaternionKeyframeTrack as _s, FrontSide as to, Interpolant as no, Box3 as Fn, Sphere as ro, Matrix3 as zs, Ray as so, WebGLRenderer as io, Scene as oo, Raycaster as ao } from "three";
3
- import { ref as xr, shallowRef as uo, onMounted as co, onUnmounted as lo, nextTick as As } from "vue";
1
+ import * as _t from "three";
2
+ import { TrianglesDrawMode as Ei, TriangleFanDrawMode as Or, TriangleStripDrawMode as Ds, Loader as Ns, FileLoader as Nn, SRGBColorSpace as ut, LinearSRGBColorSpace as Ge, BufferGeometry as Fs, BufferAttribute as Zt, Color as $e, ColorManagement as Mr, LoaderUtils as en, MeshPhysicalMaterial as He, Vector2 as Fr, SpotLight as Si, PointLight as Ri, DirectionalLight as ki, Matrix4 as Dt, Vector3 as le, Quaternion as js, InstancedMesh as Oi, InstancedBufferAttribute as Mi, Object3D as Ks, TextureLoader as Pi, ImageBitmapLoader as Ci, InterleavedBuffer as Ii, InterleavedBufferAttribute as Li, LinearMipmapLinearFilter as Bs, NearestMipmapLinearFilter as Di, LinearMipmapNearestFilter as Ni, NearestMipmapNearestFilter as Fi, LinearFilter as Pr, NearestFilter as Us, RepeatWrapping as Cr, MirroredRepeatWrapping as ji, ClampToEdgeWrapping as Ki, PointsMaterial as Bi, Material as Ar, LineBasicMaterial as Ui, MeshStandardMaterial as qs, DoubleSide as qi, MeshBasicMaterial as Jt, PropertyBinding as Gi, SkinnedMesh as Hi, Mesh as zi, LineSegments as Vi, Line as Xi, LineLoop as Wi, Points as Yi, Group as xr, PerspectiveCamera as Gs, MathUtils as It, OrthographicCamera as Qi, Skeleton as $i, AnimationClip as Ji, Bone as Zi, InterpolateDiscrete as eo, InterpolateLinear as Hs, Texture as vs, VectorKeyframeTrack as bs, NumberKeyframeTrack as ws, QuaternionKeyframeTrack as _s, FrontSide as to, Interpolant as no, Box3 as jn, Sphere as ro, Matrix3 as zs, Ray as so, WebGLRenderer as io, Scene as oo, Raycaster as ao } from "three";
3
+ import { ref as Tr, shallowRef as uo, onMounted as co, onUnmounted as lo, nextTick as As } from "vue";
4
4
  import { d as fo, j as ho, S as po, l as mo } from "./ImageLoader-CB_URfeZ.js";
5
5
  function xs(C, r) {
6
6
  if (r === Ei)
7
7
  return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), C;
8
- if (r === kr || r === Ds) {
8
+ if (r === Or || r === Ds) {
9
9
  let i = C.getIndex();
10
10
  if (i === null) {
11
11
  const l = [], p = C.getAttribute("position");
@@ -17,7 +17,7 @@ function xs(C, r) {
17
17
  return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."), C;
18
18
  }
19
19
  const a = i.count - 2, u = [];
20
- if (r === kr)
20
+ if (r === Or)
21
21
  for (let l = 1; l <= a; l++)
22
22
  u.push(i.getX(0)), u.push(i.getX(l)), u.push(i.getX(l + 1));
23
23
  else
@@ -29,7 +29,7 @@ function xs(C, r) {
29
29
  } else
30
30
  return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", r), C;
31
31
  }
32
- const Tr = /* @__PURE__ */ new WeakMap();
32
+ const Er = /* @__PURE__ */ new WeakMap();
33
33
  class yo extends Ns {
34
34
  /**
35
35
  * Constructs a new Draco loader.
@@ -87,7 +87,7 @@ class yo extends Ns {
87
87
  * @param {onErrorCallback} onError - Executed when errors occur.
88
88
  */
89
89
  load(r, i, a, u) {
90
- const c = new Dn(this.manager);
90
+ const c = new Nn(this.manager);
91
91
  c.setPath(this.path), c.setResponseType("arraybuffer"), c.setRequestHeader(this.requestHeader), c.setWithCredentials(this.withCredentials), c.load(r, (l) => {
92
92
  this.parse(l, i, u);
93
93
  }, a, u);
@@ -101,10 +101,10 @@ class yo extends Ns {
101
101
  */
102
102
  parse(r, i, a = () => {
103
103
  }) {
104
- this.decodeDracoFile(r, i, null, null, at, a).catch(a);
104
+ this.decodeDracoFile(r, i, null, null, ut, a).catch(a);
105
105
  }
106
106
  //
107
- decodeDracoFile(r, i, a, u, c = qe, l = () => {
107
+ decodeDracoFile(r, i, a, u, c = Ge, l = () => {
108
108
  }) {
109
109
  const p = {
110
110
  attributeIDs: a || this.defaultAttributeIDs,
@@ -116,8 +116,8 @@ class yo extends Ns {
116
116
  }
117
117
  decodeGeometry(r, i) {
118
118
  const a = JSON.stringify(i);
119
- if (Tr.has(r)) {
120
- const h = Tr.get(r);
119
+ if (Er.has(r)) {
120
+ const h = Er.get(r);
121
121
  if (h.key === a)
122
122
  return h.promise;
123
123
  if (r.byteLength === 0)
@@ -131,28 +131,28 @@ class yo extends Ns {
131
131
  }))).then((h) => this._createGeometry(h.geometry));
132
132
  return p.catch(() => !0).then(() => {
133
133
  u && c && this._releaseTask(u, c);
134
- }), Tr.set(r, {
134
+ }), Er.set(r, {
135
135
  key: a,
136
136
  promise: p
137
137
  }), p;
138
138
  }
139
139
  _createGeometry(r) {
140
140
  const i = new Fs();
141
- r.index && i.setIndex(new en(r.index.array, 1));
141
+ r.index && i.setIndex(new Zt(r.index.array, 1));
142
142
  for (let a = 0; a < r.attributes.length; a++) {
143
- const u = r.attributes[a], c = u.name, l = u.array, p = u.itemSize, h = new en(l, p);
143
+ const u = r.attributes[a], c = u.name, l = u.array, p = u.itemSize, h = new Zt(l, p);
144
144
  c === "color" && (this._assignVertexColorSpace(h, u.vertexColorSpace), h.normalized = !(l instanceof Float32Array)), i.setAttribute(c, h);
145
145
  }
146
146
  return i;
147
147
  }
148
148
  _assignVertexColorSpace(r, i) {
149
- if (i !== at) return;
150
- const a = new Qe();
149
+ if (i !== ut) return;
150
+ const a = new $e();
151
151
  for (let u = 0, c = r.count; u < c; u++)
152
- a.fromBufferAttribute(r, u), Or.toWorkingColorSpace(a, at), r.setXYZ(u, a.r, a.g, a.b);
152
+ a.fromBufferAttribute(r, u), Mr.toWorkingColorSpace(a, ut), r.setXYZ(u, a.r, a.g, a.b);
153
153
  }
154
154
  _loadLibrary(r, i) {
155
- const a = new Dn(this.manager);
155
+ const a = new Nn(this.manager);
156
156
  return a.setPath(this.decoderPath), a.setResponseType(i), a.setWithCredentials(this.withCredentials), new Promise((u, c) => {
157
157
  a.load(r, u, void 0, c);
158
158
  });
@@ -257,15 +257,15 @@ function go() {
257
257
  const X = { index: null, attributes: [] };
258
258
  for (const H in E) {
259
259
  const W = self[_[H]];
260
- let Z, oe;
260
+ let Z, ce;
261
261
  if (y.useUniqueIDs)
262
- oe = E[H], Z = p.GetAttributeByUniqueId(P, oe);
262
+ ce = E[H], Z = p.GetAttributeByUniqueId(P, ce);
263
263
  else {
264
- if (oe = p.GetAttributeId(P, l[E[H]]), oe === -1) continue;
265
- Z = p.GetAttribute(P, oe);
264
+ if (ce = p.GetAttributeId(P, l[E[H]]), ce === -1) continue;
265
+ Z = p.GetAttribute(P, ce);
266
266
  }
267
- const J = u(l, p, P, H, W, Z);
268
- H === "color" && (J.vertexColorSpace = y.vertexColorSpace), X.attributes.push(J);
267
+ const Y = u(l, p, P, H, W, Z);
268
+ H === "color" && (Y.vertexColorSpace = y.vertexColorSpace), X.attributes.push(Y);
269
269
  }
270
270
  return q === l.TRIANGULAR_MESH && (X.index = a(l, p, P)), l.destroy(P), X;
271
271
  }
@@ -362,14 +362,14 @@ class vo extends Ns {
362
362
  if (this.resourcePath !== "")
363
363
  l = this.resourcePath;
364
364
  else if (this.path !== "") {
365
- const y = tn.extractUrlBase(r);
366
- l = tn.resolveURL(y, this.path);
365
+ const y = en.extractUrlBase(r);
366
+ l = en.resolveURL(y, this.path);
367
367
  } else
368
- l = tn.extractUrlBase(r);
368
+ l = en.extractUrlBase(r);
369
369
  this.manager.itemStart(r);
370
370
  const p = function(y) {
371
371
  u ? u(y) : console.error(y), c.manager.itemError(r), c.manager.itemEnd(r);
372
- }, h = new Dn(this.manager);
372
+ }, h = new Nn(this.manager);
373
373
  h.setPath(this.path), h.setResponseType("arraybuffer"), h.setRequestHeader(this.requestHeader), h.setWithCredentials(this.withCredentials), h.load(r, function(y) {
374
374
  try {
375
375
  c.parse(y, l, function(E) {
@@ -568,8 +568,8 @@ class wo {
568
568
  if (u) return u;
569
569
  const c = i.json, h = ((c.extensions && c.extensions[this.name] || {}).lights || [])[r];
570
570
  let y;
571
- const E = new Qe(16777215);
572
- h.color !== void 0 && E.setRGB(h.color[0], h.color[1], h.color[2], qe);
571
+ const E = new $e(16777215);
572
+ h.color !== void 0 && E.setRGB(h.color[0], h.color[1], h.color[2], Ge);
573
573
  const _ = h.range !== void 0 ? h.range : 0;
574
574
  switch (h.type) {
575
575
  case "directional":
@@ -584,7 +584,7 @@ class wo {
584
584
  default:
585
585
  throw new Error("THREE.GLTFLoader: Unexpected light type: " + h.type);
586
586
  }
587
- return y.position.set(0, 0, 0), Ye(y, h), h.intensity !== void 0 && (y.intensity = h.intensity), y.name = i.createUniqueName(h.name || "light_" + r), u = Promise.resolve(y), i.cache.add(a, u), u;
587
+ return y.position.set(0, 0, 0), Qe(y, h), h.intensity !== void 0 && (y.intensity = h.intensity), y.name = i.createUniqueName(h.name || "light_" + r), u = Promise.resolve(y), i.cache.add(a, u), u;
588
588
  }
589
589
  getDependency(r, i) {
590
590
  if (r === "light")
@@ -602,18 +602,18 @@ class _o {
602
602
  this.name = ne.KHR_MATERIALS_UNLIT;
603
603
  }
604
604
  getMaterialType() {
605
- return Zt;
605
+ return Jt;
606
606
  }
607
607
  extendParams(r, i, a) {
608
608
  const u = [];
609
- r.color = new Qe(1, 1, 1), r.opacity = 1;
609
+ r.color = new $e(1, 1, 1), r.opacity = 1;
610
610
  const c = i.pbrMetallicRoughness;
611
611
  if (c) {
612
612
  if (Array.isArray(c.baseColorFactor)) {
613
613
  const l = c.baseColorFactor;
614
- r.color.setRGB(l[0], l[1], l[2], qe), r.opacity = l[3];
614
+ r.color.setRGB(l[0], l[1], l[2], Ge), r.opacity = l[3];
615
615
  }
616
- c.baseColorTexture !== void 0 && u.push(a.assignTexture(r, "map", c.baseColorTexture, at));
616
+ c.baseColorTexture !== void 0 && u.push(a.assignTexture(r, "map", c.baseColorTexture, ut));
617
617
  }
618
618
  return Promise.all(u);
619
619
  }
@@ -636,7 +636,7 @@ class xo {
636
636
  }
637
637
  getMaterialType(r) {
638
638
  const a = this.parser.json.materials[r];
639
- return !a.extensions || !a.extensions[this.name] ? null : Ge;
639
+ return !a.extensions || !a.extensions[this.name] ? null : He;
640
640
  }
641
641
  extendMaterialParams(r, i) {
642
642
  const a = this.parser, u = a.json.materials[r];
@@ -645,7 +645,7 @@ class xo {
645
645
  const c = [], l = u.extensions[this.name];
646
646
  if (l.clearcoatFactor !== void 0 && (i.clearcoat = l.clearcoatFactor), l.clearcoatTexture !== void 0 && c.push(a.assignTexture(i, "clearcoatMap", l.clearcoatTexture)), l.clearcoatRoughnessFactor !== void 0 && (i.clearcoatRoughness = l.clearcoatRoughnessFactor), l.clearcoatRoughnessTexture !== void 0 && c.push(a.assignTexture(i, "clearcoatRoughnessMap", l.clearcoatRoughnessTexture)), l.clearcoatNormalTexture !== void 0 && (c.push(a.assignTexture(i, "clearcoatNormalMap", l.clearcoatNormalTexture)), l.clearcoatNormalTexture.scale !== void 0)) {
647
647
  const p = l.clearcoatNormalTexture.scale;
648
- i.clearcoatNormalScale = new Nr(p, p);
648
+ i.clearcoatNormalScale = new Fr(p, p);
649
649
  }
650
650
  return Promise.all(c);
651
651
  }
@@ -656,7 +656,7 @@ class To {
656
656
  }
657
657
  getMaterialType(r) {
658
658
  const a = this.parser.json.materials[r];
659
- return !a.extensions || !a.extensions[this.name] ? null : Ge;
659
+ return !a.extensions || !a.extensions[this.name] ? null : He;
660
660
  }
661
661
  extendMaterialParams(r, i) {
662
662
  const u = this.parser.json.materials[r];
@@ -672,7 +672,7 @@ class Eo {
672
672
  }
673
673
  getMaterialType(r) {
674
674
  const a = this.parser.json.materials[r];
675
- return !a.extensions || !a.extensions[this.name] ? null : Ge;
675
+ return !a.extensions || !a.extensions[this.name] ? null : He;
676
676
  }
677
677
  extendMaterialParams(r, i) {
678
678
  const a = this.parser, u = a.json.materials[r];
@@ -688,20 +688,20 @@ class So {
688
688
  }
689
689
  getMaterialType(r) {
690
690
  const a = this.parser.json.materials[r];
691
- return !a.extensions || !a.extensions[this.name] ? null : Ge;
691
+ return !a.extensions || !a.extensions[this.name] ? null : He;
692
692
  }
693
693
  extendMaterialParams(r, i) {
694
694
  const a = this.parser, u = a.json.materials[r];
695
695
  if (!u.extensions || !u.extensions[this.name])
696
696
  return Promise.resolve();
697
697
  const c = [];
698
- i.sheenColor = new Qe(0, 0, 0), i.sheenRoughness = 0, i.sheen = 1;
698
+ i.sheenColor = new $e(0, 0, 0), i.sheenRoughness = 0, i.sheen = 1;
699
699
  const l = u.extensions[this.name];
700
700
  if (l.sheenColorFactor !== void 0) {
701
701
  const p = l.sheenColorFactor;
702
- i.sheenColor.setRGB(p[0], p[1], p[2], qe);
702
+ i.sheenColor.setRGB(p[0], p[1], p[2], Ge);
703
703
  }
704
- return l.sheenRoughnessFactor !== void 0 && (i.sheenRoughness = l.sheenRoughnessFactor), l.sheenColorTexture !== void 0 && c.push(a.assignTexture(i, "sheenColorMap", l.sheenColorTexture, at)), l.sheenRoughnessTexture !== void 0 && c.push(a.assignTexture(i, "sheenRoughnessMap", l.sheenRoughnessTexture)), Promise.all(c);
704
+ return l.sheenRoughnessFactor !== void 0 && (i.sheenRoughness = l.sheenRoughnessFactor), l.sheenColorTexture !== void 0 && c.push(a.assignTexture(i, "sheenColorMap", l.sheenColorTexture, ut)), l.sheenRoughnessTexture !== void 0 && c.push(a.assignTexture(i, "sheenRoughnessMap", l.sheenRoughnessTexture)), Promise.all(c);
705
705
  }
706
706
  }
707
707
  class Ro {
@@ -710,7 +710,7 @@ class Ro {
710
710
  }
711
711
  getMaterialType(r) {
712
712
  const a = this.parser.json.materials[r];
713
- return !a.extensions || !a.extensions[this.name] ? null : Ge;
713
+ return !a.extensions || !a.extensions[this.name] ? null : He;
714
714
  }
715
715
  extendMaterialParams(r, i) {
716
716
  const a = this.parser, u = a.json.materials[r];
@@ -726,7 +726,7 @@ class ko {
726
726
  }
727
727
  getMaterialType(r) {
728
728
  const a = this.parser.json.materials[r];
729
- return !a.extensions || !a.extensions[this.name] ? null : Ge;
729
+ return !a.extensions || !a.extensions[this.name] ? null : He;
730
730
  }
731
731
  extendMaterialParams(r, i) {
732
732
  const a = this.parser, u = a.json.materials[r];
@@ -735,7 +735,7 @@ class ko {
735
735
  const c = [], l = u.extensions[this.name];
736
736
  i.thickness = l.thicknessFactor !== void 0 ? l.thicknessFactor : 0, l.thicknessTexture !== void 0 && c.push(a.assignTexture(i, "thicknessMap", l.thicknessTexture)), i.attenuationDistance = l.attenuationDistance || 1 / 0;
737
737
  const p = l.attenuationColor || [1, 1, 1];
738
- return i.attenuationColor = new Qe().setRGB(p[0], p[1], p[2], qe), Promise.all(c);
738
+ return i.attenuationColor = new $e().setRGB(p[0], p[1], p[2], Ge), Promise.all(c);
739
739
  }
740
740
  }
741
741
  class Oo {
@@ -744,7 +744,7 @@ class Oo {
744
744
  }
745
745
  getMaterialType(r) {
746
746
  const a = this.parser.json.materials[r];
747
- return !a.extensions || !a.extensions[this.name] ? null : Ge;
747
+ return !a.extensions || !a.extensions[this.name] ? null : He;
748
748
  }
749
749
  extendMaterialParams(r, i) {
750
750
  const u = this.parser.json.materials[r];
@@ -760,7 +760,7 @@ class Mo {
760
760
  }
761
761
  getMaterialType(r) {
762
762
  const a = this.parser.json.materials[r];
763
- return !a.extensions || !a.extensions[this.name] ? null : Ge;
763
+ return !a.extensions || !a.extensions[this.name] ? null : He;
764
764
  }
765
765
  extendMaterialParams(r, i) {
766
766
  const a = this.parser, u = a.json.materials[r];
@@ -769,7 +769,7 @@ class Mo {
769
769
  const c = [], l = u.extensions[this.name];
770
770
  i.specularIntensity = l.specularFactor !== void 0 ? l.specularFactor : 1, l.specularTexture !== void 0 && c.push(a.assignTexture(i, "specularIntensityMap", l.specularTexture));
771
771
  const p = l.specularColorFactor || [1, 1, 1];
772
- return i.specularColor = new Qe().setRGB(p[0], p[1], p[2], qe), l.specularColorTexture !== void 0 && c.push(a.assignTexture(i, "specularColorMap", l.specularColorTexture, at)), Promise.all(c);
772
+ return i.specularColor = new $e().setRGB(p[0], p[1], p[2], Ge), l.specularColorTexture !== void 0 && c.push(a.assignTexture(i, "specularColorMap", l.specularColorTexture, ut)), Promise.all(c);
773
773
  }
774
774
  }
775
775
  class Po {
@@ -778,7 +778,7 @@ class Po {
778
778
  }
779
779
  getMaterialType(r) {
780
780
  const a = this.parser.json.materials[r];
781
- return !a.extensions || !a.extensions[this.name] ? null : Ge;
781
+ return !a.extensions || !a.extensions[this.name] ? null : He;
782
782
  }
783
783
  extendMaterialParams(r, i) {
784
784
  const a = this.parser, u = a.json.materials[r];
@@ -794,7 +794,7 @@ class Co {
794
794
  }
795
795
  getMaterialType(r) {
796
796
  const a = this.parser.json.materials[r];
797
- return !a.extensions || !a.extensions[this.name] ? null : Ge;
797
+ return !a.extensions || !a.extensions[this.name] ? null : He;
798
798
  }
799
799
  extendMaterialParams(r, i) {
800
800
  const a = this.parser, u = a.json.materials[r];
@@ -925,25 +925,25 @@ class Fo {
925
925
  return p.length < 1 ? null : (p.push(this.parser.createNodeMesh(r)), Promise.all(p).then((y) => {
926
926
  const E = y.pop(), _ = E.isGroup ? E.children : [E], P = y[0].count, L = [];
927
927
  for (const q of _) {
928
- const X = new Nt(), H = new le(), W = new js(), Z = new le(1, 1, 1), oe = new Oi(q.geometry, q.material, P);
929
- for (let J = 0; J < P; J++)
930
- h.TRANSLATION && H.fromBufferAttribute(h.TRANSLATION, J), h.ROTATION && W.fromBufferAttribute(h.ROTATION, J), h.SCALE && Z.fromBufferAttribute(h.SCALE, J), oe.setMatrixAt(J, X.compose(H, W, Z));
931
- for (const J in h)
932
- if (J === "_COLOR_0") {
933
- const Ae = h[J];
934
- oe.instanceColor = new Mi(Ae.array, Ae.itemSize, Ae.normalized);
935
- } else J !== "TRANSLATION" && J !== "ROTATION" && J !== "SCALE" && q.geometry.setAttribute(J, h[J]);
936
- Ks.prototype.copy.call(oe, q), this.parser.assignFinalMaterial(oe), L.push(oe);
928
+ const X = new Dt(), H = new le(), W = new js(), Z = new le(1, 1, 1), ce = new Oi(q.geometry, q.material, P);
929
+ for (let Y = 0; Y < P; Y++)
930
+ h.TRANSLATION && H.fromBufferAttribute(h.TRANSLATION, Y), h.ROTATION && W.fromBufferAttribute(h.ROTATION, Y), h.SCALE && Z.fromBufferAttribute(h.SCALE, Y), ce.setMatrixAt(Y, X.compose(H, W, Z));
931
+ for (const Y in h)
932
+ if (Y === "_COLOR_0") {
933
+ const Ae = h[Y];
934
+ ce.instanceColor = new Mi(Ae.array, Ae.itemSize, Ae.normalized);
935
+ } else Y !== "TRANSLATION" && Y !== "ROTATION" && Y !== "SCALE" && q.geometry.setAttribute(Y, h[Y]);
936
+ Ks.prototype.copy.call(ce, q), this.parser.assignFinalMaterial(ce), L.push(ce);
937
937
  }
938
938
  return E.isGroup ? (E.clear(), E.add(...L), E) : L[0];
939
939
  }));
940
940
  }
941
941
  }
942
- const Vs = "glTF", Jt = 12, Ts = { JSON: 1313821514, BIN: 5130562 };
942
+ const Vs = "glTF", $t = 12, Ts = { JSON: 1313821514, BIN: 5130562 };
943
943
  class jo {
944
944
  constructor(r) {
945
945
  this.name = ne.KHR_BINARY_GLTF, this.content = null, this.body = null;
946
- const i = new DataView(r, 0, Jt), a = new TextDecoder();
946
+ const i = new DataView(r, 0, $t), a = new TextDecoder();
947
947
  if (this.header = {
948
948
  magic: a.decode(new Uint8Array(r.slice(0, 4))),
949
949
  version: i.getUint32(4, !0),
@@ -952,17 +952,17 @@ class jo {
952
952
  throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");
953
953
  if (this.header.version < 2)
954
954
  throw new Error("THREE.GLTFLoader: Legacy binary file detected.");
955
- const u = this.header.length - Jt, c = new DataView(r, Jt);
955
+ const u = this.header.length - $t, c = new DataView(r, $t);
956
956
  let l = 0;
957
957
  for (; l < u; ) {
958
958
  const p = c.getUint32(l, !0);
959
959
  l += 4;
960
960
  const h = c.getUint32(l, !0);
961
961
  if (l += 4, h === Ts.JSON) {
962
- const y = new Uint8Array(r, Jt + l, p);
962
+ const y = new Uint8Array(r, $t + l, p);
963
963
  this.content = a.decode(y);
964
964
  } else if (h === Ts.BIN) {
965
- const y = Jt + l;
965
+ const y = $t + l;
966
966
  this.body = r.slice(y, y + p);
967
967
  }
968
968
  l += p;
@@ -980,13 +980,13 @@ class Ko {
980
980
  decodePrimitive(r, i) {
981
981
  const a = this.json, u = this.dracoLoader, c = r.extensions[this.name].bufferView, l = r.extensions[this.name].attributes, p = {}, h = {}, y = {};
982
982
  for (const E in l) {
983
- const _ = Cr[E] || E.toLowerCase();
983
+ const _ = Ir[E] || E.toLowerCase();
984
984
  p[_] = l[E];
985
985
  }
986
986
  for (const E in r.attributes) {
987
- const _ = Cr[E] || E.toLowerCase();
987
+ const _ = Ir[E] || E.toLowerCase();
988
988
  if (l[E] !== void 0) {
989
- const P = a.accessors[r.attributes[E]], L = Dt[P.componentType];
989
+ const P = a.accessors[r.attributes[E]], L = Lt[P.componentType];
990
990
  y[_] = L.name, h[_] = P.normalized === !0;
991
991
  }
992
992
  }
@@ -998,7 +998,7 @@ class Ko {
998
998
  H !== void 0 && (X.normalized = H);
999
999
  }
1000
1000
  _(L);
1001
- }, p, y, qe, P);
1001
+ }, p, y, Ge, P);
1002
1002
  });
1003
1003
  });
1004
1004
  }
@@ -1027,10 +1027,10 @@ class Xs extends no {
1027
1027
  return i;
1028
1028
  }
1029
1029
  interpolate_(r, i, a, u) {
1030
- const c = this.resultBuffer, l = this.sampleValues, p = this.valueSize, h = p * 2, y = p * 3, E = u - i, _ = (a - i) / E, P = _ * _, L = P * _, q = r * y, X = q - y, H = -2 * L + 3 * P, W = L - P, Z = 1 - H, oe = W - P + _;
1031
- for (let J = 0; J !== p; J++) {
1032
- const Ae = l[X + J + p], ve = l[X + J + h] * E, ce = l[q + J + p], Fe = l[q + J] * E;
1033
- c[J] = Z * Ae + oe * ve + H * ce + W * Fe;
1030
+ const c = this.resultBuffer, l = this.sampleValues, p = this.valueSize, h = p * 2, y = p * 3, E = u - i, _ = (a - i) / E, P = _ * _, L = P * _, q = r * y, X = q - y, H = -2 * L + 3 * P, W = L - P, Z = 1 - H, ce = W - P + _;
1031
+ for (let Y = 0; Y !== p; Y++) {
1032
+ const Ae = l[X + Y + p], ve = l[X + Y + h] * E, ae = l[q + Y + p], Le = l[q + Y] * E;
1033
+ c[Y] = Z * Ae + ce * ve + H * ae + W * Le;
1034
1034
  }
1035
1035
  return c;
1036
1036
  }
@@ -1050,7 +1050,7 @@ const Ie = {
1050
1050
  TRIANGLES: 4,
1051
1051
  TRIANGLE_STRIP: 5,
1052
1052
  TRIANGLE_FAN: 6
1053
- }, Dt = {
1053
+ }, Lt = {
1054
1054
  5120: Int8Array,
1055
1055
  5121: Uint8Array,
1056
1056
  5122: Int16Array,
@@ -1059,7 +1059,7 @@ const Ie = {
1059
1059
  5126: Float32Array
1060
1060
  }, Es = {
1061
1061
  9728: Us,
1062
- 9729: Mr,
1062
+ 9729: Pr,
1063
1063
  9984: Fi,
1064
1064
  9985: Ni,
1065
1065
  9986: Di,
@@ -1067,8 +1067,8 @@ const Ie = {
1067
1067
  }, Ss = {
1068
1068
  33071: Ki,
1069
1069
  33648: ji,
1070
- 10497: Pr
1071
- }, Er = {
1070
+ 10497: Cr
1071
+ }, Sr = {
1072
1072
  SCALAR: 1,
1073
1073
  VEC2: 2,
1074
1074
  VEC3: 3,
@@ -1076,7 +1076,7 @@ const Ie = {
1076
1076
  MAT2: 4,
1077
1077
  MAT3: 9,
1078
1078
  MAT4: 16
1079
- }, Cr = {
1079
+ }, Ir = {
1080
1080
  POSITION: "position",
1081
1081
  NORMAL: "normal",
1082
1082
  TANGENT: "tangent",
@@ -1087,7 +1087,7 @@ const Ie = {
1087
1087
  COLOR_0: "color",
1088
1088
  WEIGHTS_0: "skinWeight",
1089
1089
  JOINTS_0: "skinIndex"
1090
- }, ot = {
1090
+ }, at = {
1091
1091
  scale: "scale",
1092
1092
  translation: "position",
1093
1093
  rotation: "quaternion",
@@ -1098,7 +1098,7 @@ const Ie = {
1098
1098
  // keyframe track will be initialized with a default interpolation type, then modified.
1099
1099
  LINEAR: Hs,
1100
1100
  STEP: eo
1101
- }, Sr = {
1101
+ }, Rr = {
1102
1102
  OPAQUE: "OPAQUE",
1103
1103
  MASK: "MASK",
1104
1104
  BLEND: "BLEND"
@@ -1114,11 +1114,11 @@ function zo(C) {
1114
1114
  side: to
1115
1115
  })), C.DefaultMaterial;
1116
1116
  }
1117
- function wt(C, r, i) {
1117
+ function At(C, r, i) {
1118
1118
  for (const a in i.extensions)
1119
1119
  C[a] === void 0 && (r.userData.gltfExtensions = r.userData.gltfExtensions || {}, r.userData.gltfExtensions[a] = i.extensions[a]);
1120
1120
  }
1121
- function Ye(C, r) {
1121
+ function Qe(C, r) {
1122
1122
  r.extras !== void 0 && (typeof r.extras == "object" ? Object.assign(C.userData, r.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + r.extras));
1123
1123
  }
1124
1124
  function Vo(C, r, i) {
@@ -1170,19 +1170,19 @@ function Xo(C, r) {
1170
1170
  function Wo(C) {
1171
1171
  let r;
1172
1172
  const i = C.extensions && C.extensions[ne.KHR_DRACO_MESH_COMPRESSION];
1173
- if (i ? r = "draco:" + i.bufferView + ":" + i.indices + ":" + Rr(i.attributes) : r = C.indices + ":" + Rr(C.attributes) + ":" + C.mode, C.targets !== void 0)
1173
+ if (i ? r = "draco:" + i.bufferView + ":" + i.indices + ":" + kr(i.attributes) : r = C.indices + ":" + kr(C.attributes) + ":" + C.mode, C.targets !== void 0)
1174
1174
  for (let a = 0, u = C.targets.length; a < u; a++)
1175
- r += ":" + Rr(C.targets[a]);
1175
+ r += ":" + kr(C.targets[a]);
1176
1176
  return r;
1177
1177
  }
1178
- function Rr(C) {
1178
+ function kr(C) {
1179
1179
  let r = "";
1180
1180
  const i = Object.keys(C).sort();
1181
1181
  for (let a = 0, u = i.length; a < u; a++)
1182
1182
  r += i[a] + ":" + C[i[a]] + ";";
1183
1183
  return r;
1184
1184
  }
1185
- function Ir(C) {
1185
+ function Lr(C) {
1186
1186
  switch (C) {
1187
1187
  case Int8Array:
1188
1188
  return 1 / 127;
@@ -1199,7 +1199,7 @@ function Ir(C) {
1199
1199
  function Yo(C) {
1200
1200
  return C.search(/\.jpe?g($|\?)/i) > 0 || C.search(/^data\:image\/jpeg/) === 0 ? "image/jpeg" : C.search(/\.webp($|\?)/i) > 0 || C.search(/^data\:image\/webp/) === 0 ? "image/webp" : C.search(/\.ktx2($|\?)/i) > 0 || C.search(/^data\:image\/ktx2/) === 0 ? "image/ktx2" : "image/png";
1201
1201
  }
1202
- const Qo = new Nt();
1202
+ const Qo = new Dt();
1203
1203
  class $o {
1204
1204
  constructor(r = {}, i = {}) {
1205
1205
  this.json = r, this.extensions = {}, this.plugins = {}, this.options = i, this.cache = new bo(), this.associations = /* @__PURE__ */ new Map(), this.primitiveCache = {}, this.nodeCache = {}, this.meshCache = { refs: {}, uses: {} }, this.cameraCache = { refs: {}, uses: {} }, this.lightCache = { refs: {}, uses: {} }, this.sourceCache = {}, this.textureCache = {}, this.nodeNamesUsed = {};
@@ -1210,7 +1210,7 @@ class $o {
1210
1210
  const h = p.match(/Version\/(\d+)/);
1211
1211
  u = a && h ? parseInt(h[1], 10) : -1, c = p.indexOf("Firefox") > -1, l = c ? p.match(/Firefox\/([0-9]+)\./)[1] : -1;
1212
1212
  }
1213
- typeof createImageBitmap > "u" || a && u < 17 || c && l < 98 ? this.textureLoader = new Pi(this.options.manager) : this.textureLoader = new Ci(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new Dn(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
1213
+ typeof createImageBitmap > "u" || a && u < 17 || c && l < 98 ? this.textureLoader = new Pi(this.options.manager) : this.textureLoader = new Ci(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new Nn(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
1214
1214
  }
1215
1215
  setExtensions(r) {
1216
1216
  this.extensions = r;
@@ -1240,7 +1240,7 @@ class $o {
1240
1240
  parser: a,
1241
1241
  userData: {}
1242
1242
  };
1243
- return wt(c, p, u), Ye(p, u), Promise.all(a._invokeAll(function(h) {
1243
+ return At(c, p, u), Qe(p, u), Promise.all(a._invokeAll(function(h) {
1244
1244
  return h.afterRoot && h.afterRoot(p);
1245
1245
  })).then(function() {
1246
1246
  for (const h of p.scenes)
@@ -1421,7 +1421,7 @@ class $o {
1421
1421
  return Promise.resolve(this.extensions[ne.KHR_BINARY_GLTF].body);
1422
1422
  const u = this.options;
1423
1423
  return new Promise(function(c, l) {
1424
- a.load(tn.resolveURL(i.uri, u.path), c, void 0, function() {
1424
+ a.load(en.resolveURL(i.uri, u.path), c, void 0, function() {
1425
1425
  l(new Error('THREE.GLTFLoader: Failed to load buffer "' + i.uri + '".'));
1426
1426
  });
1427
1427
  });
@@ -1450,25 +1450,25 @@ class $o {
1450
1450
  loadAccessor(r) {
1451
1451
  const i = this, a = this.json, u = this.json.accessors[r];
1452
1452
  if (u.bufferView === void 0 && u.sparse === void 0) {
1453
- const l = Er[u.type], p = Dt[u.componentType], h = u.normalized === !0, y = new p(u.count * l);
1454
- return Promise.resolve(new en(y, l, h));
1453
+ const l = Sr[u.type], p = Lt[u.componentType], h = u.normalized === !0, y = new p(u.count * l);
1454
+ return Promise.resolve(new Zt(y, l, h));
1455
1455
  }
1456
1456
  const c = [];
1457
1457
  return u.bufferView !== void 0 ? c.push(this.getDependency("bufferView", u.bufferView)) : c.push(null), u.sparse !== void 0 && (c.push(this.getDependency("bufferView", u.sparse.indices.bufferView)), c.push(this.getDependency("bufferView", u.sparse.values.bufferView))), Promise.all(c).then(function(l) {
1458
- const p = l[0], h = Er[u.type], y = Dt[u.componentType], E = y.BYTES_PER_ELEMENT, _ = E * h, P = u.byteOffset || 0, L = u.bufferView !== void 0 ? a.bufferViews[u.bufferView].byteStride : void 0, q = u.normalized === !0;
1458
+ const p = l[0], h = Sr[u.type], y = Lt[u.componentType], E = y.BYTES_PER_ELEMENT, _ = E * h, P = u.byteOffset || 0, L = u.bufferView !== void 0 ? a.bufferViews[u.bufferView].byteStride : void 0, q = u.normalized === !0;
1459
1459
  let X, H;
1460
1460
  if (L && L !== _) {
1461
1461
  const W = Math.floor(P / L), Z = "InterleavedBuffer:" + u.bufferView + ":" + u.componentType + ":" + W + ":" + u.count;
1462
- let oe = i.cache.get(Z);
1463
- oe || (X = new y(p, W * L, u.count * L / E), oe = new Ii(X, L / E), i.cache.add(Z, oe)), H = new Li(oe, h, P % L / E, q);
1462
+ let ce = i.cache.get(Z);
1463
+ ce || (X = new y(p, W * L, u.count * L / E), ce = new Ii(X, L / E), i.cache.add(Z, ce)), H = new Li(ce, h, P % L / E, q);
1464
1464
  } else
1465
- p === null ? X = new y(u.count * h) : X = new y(p, P, u.count * h), H = new en(X, h, q);
1465
+ p === null ? X = new y(u.count * h) : X = new y(p, P, u.count * h), H = new Zt(X, h, q);
1466
1466
  if (u.sparse !== void 0) {
1467
- const W = Er.SCALAR, Z = Dt[u.sparse.indices.componentType], oe = u.sparse.indices.byteOffset || 0, J = u.sparse.values.byteOffset || 0, Ae = new Z(l[1], oe, u.sparse.count * W), ve = new y(l[2], J, u.sparse.count * h);
1468
- p !== null && (H = new en(H.array.slice(), H.itemSize, H.normalized)), H.normalized = !1;
1469
- for (let ce = 0, Fe = Ae.length; ce < Fe; ce++) {
1470
- const Pe = Ae[ce];
1471
- if (H.setX(Pe, ve[ce * h]), h >= 2 && H.setY(Pe, ve[ce * h + 1]), h >= 3 && H.setZ(Pe, ve[ce * h + 2]), h >= 4 && H.setW(Pe, ve[ce * h + 3]), h >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
1467
+ const W = Sr.SCALAR, Z = Lt[u.sparse.indices.componentType], ce = u.sparse.indices.byteOffset || 0, Y = u.sparse.values.byteOffset || 0, Ae = new Z(l[1], ce, u.sparse.count * W), ve = new y(l[2], Y, u.sparse.count * h);
1468
+ p !== null && (H = new Zt(H.array.slice(), H.itemSize, H.normalized)), H.normalized = !1;
1469
+ for (let ae = 0, Le = Ae.length; ae < Le; ae++) {
1470
+ const Me = Ae[ae];
1471
+ if (H.setX(Me, ve[ae * h]), h >= 2 && H.setY(Me, ve[ae * h + 1]), h >= 3 && H.setZ(Me, ve[ae * h + 2]), h >= 4 && H.setW(Me, ve[ae * h + 3]), h >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
1472
1472
  }
1473
1473
  H.normalized = q;
1474
1474
  }
@@ -1498,7 +1498,7 @@ class $o {
1498
1498
  const y = this.loadImageSource(i, a).then(function(E) {
1499
1499
  E.flipY = !1, E.name = l.name || p.name || "", E.name === "" && typeof p.uri == "string" && p.uri.startsWith("data:image/") === !1 && (E.name = p.uri);
1500
1500
  const P = (c.samplers || {})[l.sampler] || {};
1501
- return E.magFilter = Es[P.magFilter] || Mr, E.minFilter = Es[P.minFilter] || Bs, E.wrapS = Ss[P.wrapS] || Pr, E.wrapT = Ss[P.wrapT] || Pr, E.generateMipmaps = !E.isCompressedTexture && E.minFilter !== Us && E.minFilter !== Mr, u.associations.set(E, { textures: r }), E;
1501
+ return E.magFilter = Es[P.magFilter] || Pr, E.minFilter = Es[P.minFilter] || Bs, E.wrapS = Ss[P.wrapS] || Cr, E.wrapT = Ss[P.wrapT] || Cr, E.generateMipmaps = !E.isCompressedTexture && E.minFilter !== Us && E.minFilter !== Pr, u.associations.set(E, { textures: r }), E;
1502
1502
  }).catch(function() {
1503
1503
  return null;
1504
1504
  });
@@ -1524,10 +1524,10 @@ class $o {
1524
1524
  i.isImageBitmapLoader === !0 && (q = function(X) {
1525
1525
  const H = new vs(X);
1526
1526
  H.needsUpdate = !0, P(H);
1527
- }), i.load(tn.resolveURL(_, c.path), q, void 0, L);
1527
+ }), i.load(en.resolveURL(_, c.path), q, void 0, L);
1528
1528
  });
1529
1529
  }).then(function(_) {
1530
- return y === !0 && p.revokeObjectURL(h), Ye(_, l), _.userData.mimeType = l.mimeType || Yo(l.uri), _;
1530
+ return y === !0 && p.revokeObjectURL(h), Qe(_, l), _.userData.mimeType = l.mimeType || Yo(l.uri), _;
1531
1531
  }).catch(function(_) {
1532
1532
  throw console.error("THREE.GLTFLoader: Couldn't load texture", h), _;
1533
1533
  });
@@ -1574,11 +1574,11 @@ class $o {
1574
1574
  if (r.isPoints) {
1575
1575
  const p = "PointsMaterial:" + a.uuid;
1576
1576
  let h = this.cache.get(p);
1577
- h || (h = new Bi(), _r.prototype.copy.call(h, a), h.color.copy(a.color), h.map = a.map, h.sizeAttenuation = !1, this.cache.add(p, h)), a = h;
1577
+ h || (h = new Bi(), Ar.prototype.copy.call(h, a), h.color.copy(a.color), h.map = a.map, h.sizeAttenuation = !1, this.cache.add(p, h)), a = h;
1578
1578
  } else if (r.isLine) {
1579
1579
  const p = "LineBasicMaterial:" + a.uuid;
1580
1580
  let h = this.cache.get(p);
1581
- h || (h = new Ui(), _r.prototype.copy.call(h, a), h.color.copy(a.color), h.map = a.map, this.cache.add(p, h)), a = h;
1581
+ h || (h = new Ui(), Ar.prototype.copy.call(h, a), h.color.copy(a.color), h.map = a.map, this.cache.add(p, h)), a = h;
1582
1582
  }
1583
1583
  if (u || c || l) {
1584
1584
  let p = "ClonedMaterial:" + a.uuid + ":";
@@ -1607,29 +1607,29 @@ class $o {
1607
1607
  l = _.getMaterialType(), y.push(_.extendParams(p, c, i));
1608
1608
  } else {
1609
1609
  const _ = c.pbrMetallicRoughness || {};
1610
- if (p.color = new Qe(1, 1, 1), p.opacity = 1, Array.isArray(_.baseColorFactor)) {
1610
+ if (p.color = new $e(1, 1, 1), p.opacity = 1, Array.isArray(_.baseColorFactor)) {
1611
1611
  const P = _.baseColorFactor;
1612
- p.color.setRGB(P[0], P[1], P[2], qe), p.opacity = P[3];
1612
+ p.color.setRGB(P[0], P[1], P[2], Ge), p.opacity = P[3];
1613
1613
  }
1614
- _.baseColorTexture !== void 0 && y.push(i.assignTexture(p, "map", _.baseColorTexture, at)), p.metalness = _.metallicFactor !== void 0 ? _.metallicFactor : 1, p.roughness = _.roughnessFactor !== void 0 ? _.roughnessFactor : 1, _.metallicRoughnessTexture !== void 0 && (y.push(i.assignTexture(p, "metalnessMap", _.metallicRoughnessTexture)), y.push(i.assignTexture(p, "roughnessMap", _.metallicRoughnessTexture))), l = this._invokeOne(function(P) {
1614
+ _.baseColorTexture !== void 0 && y.push(i.assignTexture(p, "map", _.baseColorTexture, ut)), p.metalness = _.metallicFactor !== void 0 ? _.metallicFactor : 1, p.roughness = _.roughnessFactor !== void 0 ? _.roughnessFactor : 1, _.metallicRoughnessTexture !== void 0 && (y.push(i.assignTexture(p, "metalnessMap", _.metallicRoughnessTexture)), y.push(i.assignTexture(p, "roughnessMap", _.metallicRoughnessTexture))), l = this._invokeOne(function(P) {
1615
1615
  return P.getMaterialType && P.getMaterialType(r);
1616
1616
  }), y.push(Promise.all(this._invokeAll(function(P) {
1617
1617
  return P.extendMaterialParams && P.extendMaterialParams(r, p);
1618
1618
  })));
1619
1619
  }
1620
1620
  c.doubleSided === !0 && (p.side = qi);
1621
- const E = c.alphaMode || Sr.OPAQUE;
1622
- if (E === Sr.BLEND ? (p.transparent = !0, p.depthWrite = !1) : (p.transparent = !1, E === Sr.MASK && (p.alphaTest = c.alphaCutoff !== void 0 ? c.alphaCutoff : 0.5)), c.normalTexture !== void 0 && l !== Zt && (y.push(i.assignTexture(p, "normalMap", c.normalTexture)), p.normalScale = new Nr(1, 1), c.normalTexture.scale !== void 0)) {
1621
+ const E = c.alphaMode || Rr.OPAQUE;
1622
+ if (E === Rr.BLEND ? (p.transparent = !0, p.depthWrite = !1) : (p.transparent = !1, E === Rr.MASK && (p.alphaTest = c.alphaCutoff !== void 0 ? c.alphaCutoff : 0.5)), c.normalTexture !== void 0 && l !== Jt && (y.push(i.assignTexture(p, "normalMap", c.normalTexture)), p.normalScale = new Fr(1, 1), c.normalTexture.scale !== void 0)) {
1623
1623
  const _ = c.normalTexture.scale;
1624
1624
  p.normalScale.set(_, _);
1625
1625
  }
1626
- if (c.occlusionTexture !== void 0 && l !== Zt && (y.push(i.assignTexture(p, "aoMap", c.occlusionTexture)), c.occlusionTexture.strength !== void 0 && (p.aoMapIntensity = c.occlusionTexture.strength)), c.emissiveFactor !== void 0 && l !== Zt) {
1626
+ if (c.occlusionTexture !== void 0 && l !== Jt && (y.push(i.assignTexture(p, "aoMap", c.occlusionTexture)), c.occlusionTexture.strength !== void 0 && (p.aoMapIntensity = c.occlusionTexture.strength)), c.emissiveFactor !== void 0 && l !== Jt) {
1627
1627
  const _ = c.emissiveFactor;
1628
- p.emissive = new Qe().setRGB(_[0], _[1], _[2], qe);
1628
+ p.emissive = new $e().setRGB(_[0], _[1], _[2], Ge);
1629
1629
  }
1630
- return c.emissiveTexture !== void 0 && l !== Zt && y.push(i.assignTexture(p, "emissiveMap", c.emissiveTexture, at)), Promise.all(y).then(function() {
1630
+ return c.emissiveTexture !== void 0 && l !== Jt && y.push(i.assignTexture(p, "emissiveMap", c.emissiveTexture, ut)), Promise.all(y).then(function() {
1631
1631
  const _ = new l(p);
1632
- return c.name && (_.name = c.name), Ye(_, c), i.associations.set(_, { materials: r }), c.extensions && wt(u, _, c), _;
1632
+ return c.name && (_.name = c.name), Qe(_, c), i.associations.set(_, { materials: r }), c.extensions && At(u, _, c), _;
1633
1633
  });
1634
1634
  }
1635
1635
  /**
@@ -1691,7 +1691,7 @@ class $o {
1691
1691
  let W;
1692
1692
  const Z = y[L];
1693
1693
  if (H.mode === Ie.TRIANGLES || H.mode === Ie.TRIANGLE_STRIP || H.mode === Ie.TRIANGLE_FAN || H.mode === void 0)
1694
- W = c.isSkinnedMesh === !0 ? new Hi(X, Z) : new zi(X, Z), W.isSkinnedMesh === !0 && W.normalizeSkinWeights(), H.mode === Ie.TRIANGLE_STRIP ? W.geometry = xs(W.geometry, Ds) : H.mode === Ie.TRIANGLE_FAN && (W.geometry = xs(W.geometry, kr));
1694
+ W = c.isSkinnedMesh === !0 ? new Hi(X, Z) : new zi(X, Z), W.isSkinnedMesh === !0 && W.normalizeSkinWeights(), H.mode === Ie.TRIANGLE_STRIP ? W.geometry = xs(W.geometry, Ds) : H.mode === Ie.TRIANGLE_FAN && (W.geometry = xs(W.geometry, Or));
1695
1695
  else if (H.mode === Ie.LINES)
1696
1696
  W = new Vi(X, Z);
1697
1697
  else if (H.mode === Ie.LINE_STRIP)
@@ -1702,7 +1702,7 @@ class $o {
1702
1702
  W = new Yi(X, Z);
1703
1703
  else
1704
1704
  throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + H.mode);
1705
- Object.keys(W.geometry.morphAttributes).length > 0 && Xo(W, c), W.name = i.createUniqueName(c.name || "mesh_" + r), Ye(W, c), H.extensions && wt(u, W, H), i.assignFinalMaterial(W), _.push(W);
1705
+ Object.keys(W.geometry.morphAttributes).length > 0 && Xo(W, c), W.name = i.createUniqueName(c.name || "mesh_" + r), Qe(W, c), H.extensions && At(u, W, H), i.assignFinalMaterial(W), _.push(W);
1706
1706
  }
1707
1707
  for (let L = 0, q = _.length; L < q; L++)
1708
1708
  i.associations.set(_[L], {
@@ -1710,9 +1710,9 @@ class $o {
1710
1710
  primitives: L
1711
1711
  });
1712
1712
  if (_.length === 1)
1713
- return c.extensions && wt(u, _[0], c), _[0];
1714
- const P = new Ar();
1715
- c.extensions && wt(u, P, c), i.associations.set(P, { meshes: r });
1713
+ return c.extensions && At(u, _[0], c), _[0];
1714
+ const P = new xr();
1715
+ c.extensions && At(u, P, c), i.associations.set(P, { meshes: r });
1716
1716
  for (let L = 0, q = _.length; L < q; L++)
1717
1717
  P.add(_[L]);
1718
1718
  return P;
@@ -1732,7 +1732,7 @@ class $o {
1732
1732
  console.warn("THREE.GLTFLoader: Missing camera parameters.");
1733
1733
  return;
1734
1734
  }
1735
- return a.type === "perspective" ? i = new Gs(Lt.radToDeg(u.yfov), u.aspectRatio || 1, u.znear || 1, u.zfar || 2e6) : a.type === "orthographic" && (i = new Qi(-u.xmag, u.xmag, u.ymag, -u.ymag, u.znear, u.zfar)), a.name && (i.name = this.createUniqueName(a.name)), Ye(i, a), Promise.resolve(i);
1735
+ return a.type === "perspective" ? i = new Gs(It.radToDeg(u.yfov), u.aspectRatio || 1, u.znear || 1, u.zfar || 2e6) : a.type === "orthographic" && (i = new Qi(-u.xmag, u.xmag, u.ymag, -u.ymag, u.znear, u.zfar)), a.name && (i.name = this.createUniqueName(a.name)), Qe(i, a), Promise.resolve(i);
1736
1736
  }
1737
1737
  /**
1738
1738
  * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins
@@ -1751,7 +1751,7 @@ class $o {
1751
1751
  const _ = l[y];
1752
1752
  if (_) {
1753
1753
  p.push(_);
1754
- const P = new Nt();
1754
+ const P = new Dt();
1755
1755
  c !== null && P.fromArray(c.array, y * 16), h.push(P);
1756
1756
  } else
1757
1757
  console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', i.joints[y]);
@@ -1780,14 +1780,14 @@ class $o {
1780
1780
  Promise.all(E)
1781
1781
  ]).then(function(_) {
1782
1782
  const P = _[0], L = _[1], q = _[2], X = _[3], H = _[4], W = [];
1783
- for (let Z = 0, oe = P.length; Z < oe; Z++) {
1784
- const J = P[Z], Ae = L[Z], ve = q[Z], ce = X[Z], Fe = H[Z];
1785
- if (J === void 0) continue;
1786
- J.updateMatrix && J.updateMatrix();
1787
- const Pe = a._createAnimationTracks(J, Ae, ve, ce, Fe);
1788
- if (Pe)
1789
- for (let me = 0; me < Pe.length; me++)
1790
- W.push(Pe[me]);
1783
+ for (let Z = 0, ce = P.length; Z < ce; Z++) {
1784
+ const Y = P[Z], Ae = L[Z], ve = q[Z], ae = X[Z], Le = H[Z];
1785
+ if (Y === void 0) continue;
1786
+ Y.updateMatrix && Y.updateMatrix();
1787
+ const Me = a._createAnimationTracks(Y, Ae, ve, ae, Le);
1788
+ if (Me)
1789
+ for (let Je = 0; Je < Me.length; Je++)
1790
+ W.push(Me[Je]);
1791
1791
  }
1792
1792
  return new Ji(c, void 0, W);
1793
1793
  });
@@ -1846,11 +1846,11 @@ class $o {
1846
1846
  p.push(y);
1847
1847
  }), this.nodeCache[r] = Promise.all(p).then(function(y) {
1848
1848
  let E;
1849
- if (c.isBone === !0 ? E = new Zi() : y.length > 1 ? E = new Ar() : y.length === 1 ? E = y[0] : E = new Ks(), E !== y[0])
1849
+ if (c.isBone === !0 ? E = new Zi() : y.length > 1 ? E = new xr() : y.length === 1 ? E = y[0] : E = new Ks(), E !== y[0])
1850
1850
  for (let _ = 0, P = y.length; _ < P; _++)
1851
1851
  E.add(y[_]);
1852
- if (c.name && (E.userData.name = c.name, E.name = l), Ye(E, c), c.extensions && wt(a, E, c), c.matrix !== void 0) {
1853
- const _ = new Nt();
1852
+ if (c.name && (E.userData.name = c.name, E.name = l), Qe(E, c), c.extensions && At(a, E, c), c.matrix !== void 0) {
1853
+ const _ = new Dt();
1854
1854
  _.fromArray(c.matrix), E.applyMatrix4(_);
1855
1855
  } else
1856
1856
  c.translation !== void 0 && E.position.fromArray(c.translation), c.rotation !== void 0 && E.quaternion.fromArray(c.rotation), c.scale !== void 0 && E.scale.fromArray(c.scale);
@@ -1865,8 +1865,8 @@ class $o {
1865
1865
  * @return {Promise<Group>}
1866
1866
  */
1867
1867
  loadScene(r) {
1868
- const i = this.extensions, a = this.json.scenes[r], u = this, c = new Ar();
1869
- a.name && (c.name = u.createUniqueName(a.name)), Ye(c, a), a.extensions && wt(i, c, a);
1868
+ const i = this.extensions, a = this.json.scenes[r], u = this, c = new xr();
1869
+ a.name && (c.name = u.createUniqueName(a.name)), Qe(c, a), a.extensions && At(i, c, a);
1870
1870
  const l = a.nodes || [], p = [];
1871
1871
  for (let h = 0, y = l.length; h < y; h++)
1872
1872
  p.push(u.getDependency("node", l[h]));
@@ -1876,7 +1876,7 @@ class $o {
1876
1876
  const y = (E) => {
1877
1877
  const _ = /* @__PURE__ */ new Map();
1878
1878
  for (const [P, L] of u.associations)
1879
- (P instanceof _r || P instanceof vs) && _.set(P, L);
1879
+ (P instanceof Ar || P instanceof vs) && _.set(P, L);
1880
1880
  return E.traverse((P) => {
1881
1881
  const L = u.associations.get(P);
1882
1882
  L != null && _.set(P, L);
@@ -1887,19 +1887,19 @@ class $o {
1887
1887
  }
1888
1888
  _createAnimationTracks(r, i, a, u, c) {
1889
1889
  const l = [], p = r.name ? r.name : r.uuid, h = [];
1890
- ot[c.path] === ot.weights ? r.traverse(function(P) {
1890
+ at[c.path] === at.weights ? r.traverse(function(P) {
1891
1891
  P.morphTargetInfluences && h.push(P.name ? P.name : P.uuid);
1892
1892
  }) : h.push(p);
1893
1893
  let y;
1894
- switch (ot[c.path]) {
1895
- case ot.weights:
1894
+ switch (at[c.path]) {
1895
+ case at.weights:
1896
1896
  y = ws;
1897
1897
  break;
1898
- case ot.rotation:
1898
+ case at.rotation:
1899
1899
  y = _s;
1900
1900
  break;
1901
- case ot.translation:
1902
- case ot.scale:
1901
+ case at.translation:
1902
+ case at.scale:
1903
1903
  y = bs;
1904
1904
  break;
1905
1905
  default:
@@ -1918,7 +1918,7 @@ class $o {
1918
1918
  const E = u.interpolation !== void 0 ? Ho[u.interpolation] : Hs, _ = this._getArrayFromAccessor(a);
1919
1919
  for (let P = 0, L = h.length; P < L; P++) {
1920
1920
  const q = new y(
1921
- h[P] + "." + ot[c.path],
1921
+ h[P] + "." + at[c.path],
1922
1922
  i.array,
1923
1923
  _,
1924
1924
  E
@@ -1930,7 +1930,7 @@ class $o {
1930
1930
  _getArrayFromAccessor(r) {
1931
1931
  let i = r.array;
1932
1932
  if (r.normalized) {
1933
- const a = Ir(i.constructor), u = new Float32Array(i.length);
1933
+ const a = Lr(i.constructor), u = new Float32Array(i.length);
1934
1934
  for (let c = 0, l = i.length; c < l; c++)
1935
1935
  u[c] = i[c] * a;
1936
1936
  i = u;
@@ -1945,7 +1945,7 @@ class $o {
1945
1945
  }
1946
1946
  }
1947
1947
  function Jo(C, r, i) {
1948
- const a = r.attributes, u = new Fn();
1948
+ const a = r.attributes, u = new jn();
1949
1949
  if (a.POSITION !== void 0) {
1950
1950
  const p = i.json.accessors[a.POSITION], h = p.min, y = p.max;
1951
1951
  if (h !== void 0 && y !== void 0) {
@@ -1953,7 +1953,7 @@ function Jo(C, r, i) {
1953
1953
  new le(h[0], h[1], h[2]),
1954
1954
  new le(y[0], y[1], y[2])
1955
1955
  ), p.normalized) {
1956
- const E = Ir(Dt[p.componentType]);
1956
+ const E = Lr(Lt[p.componentType]);
1957
1957
  u.min.multiplyScalar(E), u.max.multiplyScalar(E);
1958
1958
  }
1959
1959
  } else {
@@ -1971,7 +1971,7 @@ function Jo(C, r, i) {
1971
1971
  const P = i.json.accessors[_.POSITION], L = P.min, q = P.max;
1972
1972
  if (L !== void 0 && q !== void 0) {
1973
1973
  if (h.setX(Math.max(Math.abs(L[0]), Math.abs(q[0]))), h.setY(Math.max(Math.abs(L[1]), Math.abs(q[1]))), h.setZ(Math.max(Math.abs(L[2]), Math.abs(q[2]))), P.normalized) {
1974
- const X = Ir(Dt[P.componentType]);
1974
+ const X = Lr(Lt[P.componentType]);
1975
1975
  h.multiplyScalar(X);
1976
1976
  }
1977
1977
  p.max(h);
@@ -1993,7 +1993,7 @@ function Rs(C, r, i) {
1993
1993
  });
1994
1994
  }
1995
1995
  for (const l in a) {
1996
- const p = Cr[l] || l.toLowerCase();
1996
+ const p = Ir[l] || l.toLowerCase();
1997
1997
  p in C.attributes || u.push(c(a[l], p));
1998
1998
  }
1999
1999
  if (r.indices !== void 0 && !C.index) {
@@ -2002,7 +2002,7 @@ function Rs(C, r, i) {
2002
2002
  });
2003
2003
  u.push(l);
2004
2004
  }
2005
- return Or.workingColorSpace !== qe && "COLOR_0" in a && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Or.workingColorSpace}" not supported.`), Ye(C, r), Jo(C, r, i), Promise.all(u).then(function() {
2005
+ return Mr.workingColorSpace !== Ge && "COLOR_0" in a && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Mr.workingColorSpace}" not supported.`), Qe(C, r), Jo(C, r, i), Promise.all(u).then(function() {
2006
2006
  return r.targets !== void 0 ? Vo(C, r.targets, i) : C;
2007
2007
  });
2008
2008
  }
@@ -2013,15 +2013,15 @@ const se = {
2013
2013
  // basis vectors
2014
2014
  e: []
2015
2015
  // half width
2016
- }, ae = {
2016
+ }, oe = {
2017
2017
  c: null,
2018
2018
  // center
2019
2019
  u: [new le(), new le(), new le()],
2020
2020
  // basis vectors
2021
2021
  e: []
2022
2022
  // half width
2023
- }, pe = [[], [], []], Q = [[], [], []], he = [], _t = new le(), At = new le(), xt = new le(), be = new le(), ks = new le(), Os = new le(), Ne = new zs(), Ms = new Fn(), Cn = new Nt(), Ps = new Nt(), Cs = new so();
2024
- class Lr {
2023
+ }, pe = [[], [], []], $ = [[], [], []], he = [], xt = new le(), Tt = new le(), Et = new le(), be = new le(), ks = new le(), Os = new le(), De = new zs(), Ms = new jn(), In = new Dt(), Ps = new Dt(), Cs = new so();
2024
+ class Dr {
2025
2025
  /**
2026
2026
  * Constructs a new OBB.
2027
2027
  *
@@ -2078,13 +2078,13 @@ class Lr {
2078
2078
  */
2079
2079
  clampPoint(r, i) {
2080
2080
  const a = this.halfSize;
2081
- be.subVectors(r, this.center), this.rotation.extractBasis(_t, At, xt), i.copy(this.center);
2082
- const u = Lt.clamp(be.dot(_t), -a.x, a.x);
2083
- i.add(_t.multiplyScalar(u));
2084
- const c = Lt.clamp(be.dot(At), -a.y, a.y);
2085
- i.add(At.multiplyScalar(c));
2086
- const l = Lt.clamp(be.dot(xt), -a.z, a.z);
2087
- return i.add(xt.multiplyScalar(l)), i;
2081
+ be.subVectors(r, this.center), this.rotation.extractBasis(xt, Tt, Et), i.copy(this.center);
2082
+ const u = It.clamp(be.dot(xt), -a.x, a.x);
2083
+ i.add(xt.multiplyScalar(u));
2084
+ const c = It.clamp(be.dot(Tt), -a.y, a.y);
2085
+ i.add(Tt.multiplyScalar(c));
2086
+ const l = It.clamp(be.dot(Et), -a.z, a.z);
2087
+ return i.add(Et.multiplyScalar(l)), i;
2088
2088
  }
2089
2089
  /**
2090
2090
  * Returns `true` if the given point lies within this OBB.
@@ -2093,7 +2093,7 @@ class Lr {
2093
2093
  * @returns {boolean} - Whether the given point lies within this OBB or not.
2094
2094
  */
2095
2095
  containsPoint(r) {
2096
- return be.subVectors(r, this.center), this.rotation.extractBasis(_t, At, xt), Math.abs(be.dot(_t)) <= this.halfSize.x && Math.abs(be.dot(At)) <= this.halfSize.y && Math.abs(be.dot(xt)) <= this.halfSize.z;
2096
+ return be.subVectors(r, this.center), this.rotation.extractBasis(xt, Tt, Et), Math.abs(be.dot(xt)) <= this.halfSize.x && Math.abs(be.dot(Tt)) <= this.halfSize.y && Math.abs(be.dot(Et)) <= this.halfSize.z;
2097
2097
  }
2098
2098
  /**
2099
2099
  * Returns `true` if the given AABB intersects this OBB.
@@ -2121,20 +2121,20 @@ class Lr {
2121
2121
  * @returns {boolean} - Whether the given OBB intersects this OBB or not.
2122
2122
  */
2123
2123
  intersectsOBB(r, i = Number.EPSILON) {
2124
- se.c = this.center, se.e[0] = this.halfSize.x, se.e[1] = this.halfSize.y, se.e[2] = this.halfSize.z, this.rotation.extractBasis(se.u[0], se.u[1], se.u[2]), ae.c = r.center, ae.e[0] = r.halfSize.x, ae.e[1] = r.halfSize.y, ae.e[2] = r.halfSize.z, r.rotation.extractBasis(ae.u[0], ae.u[1], ae.u[2]);
2124
+ se.c = this.center, se.e[0] = this.halfSize.x, se.e[1] = this.halfSize.y, se.e[2] = this.halfSize.z, this.rotation.extractBasis(se.u[0], se.u[1], se.u[2]), oe.c = r.center, oe.e[0] = r.halfSize.x, oe.e[1] = r.halfSize.y, oe.e[2] = r.halfSize.z, r.rotation.extractBasis(oe.u[0], oe.u[1], oe.u[2]);
2125
2125
  for (let c = 0; c < 3; c++)
2126
2126
  for (let l = 0; l < 3; l++)
2127
- pe[c][l] = se.u[c].dot(ae.u[l]);
2128
- be.subVectors(ae.c, se.c), he[0] = be.dot(se.u[0]), he[1] = be.dot(se.u[1]), he[2] = be.dot(se.u[2]);
2127
+ pe[c][l] = se.u[c].dot(oe.u[l]);
2128
+ be.subVectors(oe.c, se.c), he[0] = be.dot(se.u[0]), he[1] = be.dot(se.u[1]), he[2] = be.dot(se.u[2]);
2129
2129
  for (let c = 0; c < 3; c++)
2130
2130
  for (let l = 0; l < 3; l++)
2131
- Q[c][l] = Math.abs(pe[c][l]) + i;
2131
+ $[c][l] = Math.abs(pe[c][l]) + i;
2132
2132
  let a, u;
2133
2133
  for (let c = 0; c < 3; c++)
2134
- if (a = se.e[c], u = ae.e[0] * Q[c][0] + ae.e[1] * Q[c][1] + ae.e[2] * Q[c][2], Math.abs(he[c]) > a + u) return !1;
2134
+ if (a = se.e[c], u = oe.e[0] * $[c][0] + oe.e[1] * $[c][1] + oe.e[2] * $[c][2], Math.abs(he[c]) > a + u) return !1;
2135
2135
  for (let c = 0; c < 3; c++)
2136
- if (a = se.e[0] * Q[0][c] + se.e[1] * Q[1][c] + se.e[2] * Q[2][c], u = ae.e[c], Math.abs(he[0] * pe[0][c] + he[1] * pe[1][c] + he[2] * pe[2][c]) > a + u) return !1;
2137
- return a = se.e[1] * Q[2][0] + se.e[2] * Q[1][0], u = ae.e[1] * Q[0][2] + ae.e[2] * Q[0][1], !(Math.abs(he[2] * pe[1][0] - he[1] * pe[2][0]) > a + u || (a = se.e[1] * Q[2][1] + se.e[2] * Q[1][1], u = ae.e[0] * Q[0][2] + ae.e[2] * Q[0][0], Math.abs(he[2] * pe[1][1] - he[1] * pe[2][1]) > a + u) || (a = se.e[1] * Q[2][2] + se.e[2] * Q[1][2], u = ae.e[0] * Q[0][1] + ae.e[1] * Q[0][0], Math.abs(he[2] * pe[1][2] - he[1] * pe[2][2]) > a + u) || (a = se.e[0] * Q[2][0] + se.e[2] * Q[0][0], u = ae.e[1] * Q[1][2] + ae.e[2] * Q[1][1], Math.abs(he[0] * pe[2][0] - he[2] * pe[0][0]) > a + u) || (a = se.e[0] * Q[2][1] + se.e[2] * Q[0][1], u = ae.e[0] * Q[1][2] + ae.e[2] * Q[1][0], Math.abs(he[0] * pe[2][1] - he[2] * pe[0][1]) > a + u) || (a = se.e[0] * Q[2][2] + se.e[2] * Q[0][2], u = ae.e[0] * Q[1][1] + ae.e[1] * Q[1][0], Math.abs(he[0] * pe[2][2] - he[2] * pe[0][2]) > a + u) || (a = se.e[0] * Q[1][0] + se.e[1] * Q[0][0], u = ae.e[1] * Q[2][2] + ae.e[2] * Q[2][1], Math.abs(he[1] * pe[0][0] - he[0] * pe[1][0]) > a + u) || (a = se.e[0] * Q[1][1] + se.e[1] * Q[0][1], u = ae.e[0] * Q[2][2] + ae.e[2] * Q[2][0], Math.abs(he[1] * pe[0][1] - he[0] * pe[1][1]) > a + u) || (a = se.e[0] * Q[1][2] + se.e[1] * Q[0][2], u = ae.e[0] * Q[2][1] + ae.e[1] * Q[2][0], Math.abs(he[1] * pe[0][2] - he[0] * pe[1][2]) > a + u));
2136
+ if (a = se.e[0] * $[0][c] + se.e[1] * $[1][c] + se.e[2] * $[2][c], u = oe.e[c], Math.abs(he[0] * pe[0][c] + he[1] * pe[1][c] + he[2] * pe[2][c]) > a + u) return !1;
2137
+ return a = se.e[1] * $[2][0] + se.e[2] * $[1][0], u = oe.e[1] * $[0][2] + oe.e[2] * $[0][1], !(Math.abs(he[2] * pe[1][0] - he[1] * pe[2][0]) > a + u || (a = se.e[1] * $[2][1] + se.e[2] * $[1][1], u = oe.e[0] * $[0][2] + oe.e[2] * $[0][0], Math.abs(he[2] * pe[1][1] - he[1] * pe[2][1]) > a + u) || (a = se.e[1] * $[2][2] + se.e[2] * $[1][2], u = oe.e[0] * $[0][1] + oe.e[1] * $[0][0], Math.abs(he[2] * pe[1][2] - he[1] * pe[2][2]) > a + u) || (a = se.e[0] * $[2][0] + se.e[2] * $[0][0], u = oe.e[1] * $[1][2] + oe.e[2] * $[1][1], Math.abs(he[0] * pe[2][0] - he[2] * pe[0][0]) > a + u) || (a = se.e[0] * $[2][1] + se.e[2] * $[0][1], u = oe.e[0] * $[1][2] + oe.e[2] * $[1][0], Math.abs(he[0] * pe[2][1] - he[2] * pe[0][1]) > a + u) || (a = se.e[0] * $[2][2] + se.e[2] * $[0][2], u = oe.e[0] * $[1][1] + oe.e[1] * $[1][0], Math.abs(he[0] * pe[2][2] - he[2] * pe[0][2]) > a + u) || (a = se.e[0] * $[1][0] + se.e[1] * $[0][0], u = oe.e[1] * $[2][2] + oe.e[2] * $[2][1], Math.abs(he[1] * pe[0][0] - he[0] * pe[1][0]) > a + u) || (a = se.e[0] * $[1][1] + se.e[1] * $[0][1], u = oe.e[0] * $[2][2] + oe.e[2] * $[2][0], Math.abs(he[1] * pe[0][1] - he[0] * pe[1][1]) > a + u) || (a = se.e[0] * $[1][2] + se.e[1] * $[0][2], u = oe.e[0] * $[2][1] + oe.e[1] * $[2][0], Math.abs(he[1] * pe[0][2] - he[0] * pe[1][2]) > a + u));
2138
2138
  }
2139
2139
  /**
2140
2140
  * Returns `true` if the given plane intersects this OBB.
@@ -2143,8 +2143,8 @@ class Lr {
2143
2143
  * @returns {boolean} Whether the given plane intersects this OBB or not.
2144
2144
  */
2145
2145
  intersectsPlane(r) {
2146
- this.rotation.extractBasis(_t, At, xt);
2147
- const i = this.halfSize.x * Math.abs(r.normal.dot(_t)) + this.halfSize.y * Math.abs(r.normal.dot(At)) + this.halfSize.z * Math.abs(r.normal.dot(xt)), a = r.normal.dot(this.center) - r.constant;
2146
+ this.rotation.extractBasis(xt, Tt, Et);
2147
+ const i = this.halfSize.x * Math.abs(r.normal.dot(xt)) + this.halfSize.y * Math.abs(r.normal.dot(Tt)) + this.halfSize.z * Math.abs(r.normal.dot(Et)), a = r.normal.dot(this.center) - r.constant;
2148
2148
  return Math.abs(a) <= i;
2149
2149
  }
2150
2150
  /**
@@ -2156,7 +2156,7 @@ class Lr {
2156
2156
  * @return {?Vector3} The intersection point. If no intersection is detected, `null` is returned.
2157
2157
  */
2158
2158
  intersectRay(r, i) {
2159
- return this.getSize(ks), Ms.setFromCenterAndSize(be.set(0, 0, 0), ks), Cn.setFromMatrix3(this.rotation), Cn.setPosition(this.center), Ps.copy(Cn).invert(), Cs.copy(r).applyMatrix4(Ps), Cs.intersectBox(Ms, i) ? i.applyMatrix4(Cn) : null;
2159
+ return this.getSize(ks), Ms.setFromCenterAndSize(be.set(0, 0, 0), ks), In.setFromMatrix3(this.rotation), In.setPosition(this.center), Ps.copy(In).invert(), Cs.copy(r).applyMatrix4(Ps), Cs.intersectBox(Ms, i) ? i.applyMatrix4(In) : null;
2160
2160
  }
2161
2161
  /**
2162
2162
  * Returns `true` if the given ray intersects this OBB.
@@ -2197,24 +2197,25 @@ class Lr {
2197
2197
  const i = r.elements;
2198
2198
  let a = be.set(i[0], i[1], i[2]).length();
2199
2199
  const u = be.set(i[4], i[5], i[6]).length(), c = be.set(i[8], i[9], i[10]).length();
2200
- r.determinant() < 0 && (a = -a), Ne.setFromMatrix4(r);
2200
+ r.determinant() < 0 && (a = -a), De.setFromMatrix4(r);
2201
2201
  const p = 1 / a, h = 1 / u, y = 1 / c;
2202
- return Ne.elements[0] *= p, Ne.elements[1] *= p, Ne.elements[2] *= p, Ne.elements[3] *= h, Ne.elements[4] *= h, Ne.elements[5] *= h, Ne.elements[6] *= y, Ne.elements[7] *= y, Ne.elements[8] *= y, this.rotation.multiply(Ne), this.halfSize.x *= a, this.halfSize.y *= u, this.halfSize.z *= c, be.setFromMatrixPosition(r), this.center.add(be), this;
2202
+ return De.elements[0] *= p, De.elements[1] *= p, De.elements[2] *= p, De.elements[3] *= h, De.elements[4] *= h, De.elements[5] *= h, De.elements[6] *= y, De.elements[7] *= y, De.elements[8] *= y, this.rotation.multiply(De), this.halfSize.x *= a, this.halfSize.y *= u, this.halfSize.z *= c, be.setFromMatrixPosition(r), this.center.add(be), this;
2203
2203
  }
2204
2204
  }
2205
- const Zo = new Lr(), ea = {
2205
+ const Zo = new Dr(), ea = {
2206
2206
  enableDamping: !0,
2207
2207
  dampingFactor: 0.25,
2208
2208
  screenSpacePanning: !1,
2209
2209
  minDistance: 0.1,
2210
2210
  maxDistance: 1e3,
2211
- maxPolarAngle: Lt.degToRad(60)
2211
+ maxPolarAngle: It.degToRad(60)
2212
2212
  };
2213
2213
  function la(C, r) {
2214
2214
  const i = Object.assign(
2215
2215
  {
2216
2216
  css3d: !1,
2217
2217
  stats: !1,
2218
+ renderType: "change",
2218
2219
  control: {
2219
2220
  init: !0,
2220
2221
  options: {}
@@ -2223,102 +2224,110 @@ function la(C, r) {
2223
2224
  r || {}
2224
2225
  );
2225
2226
  let a, u, c, l = [];
2226
- const p = xr(!1), h = uo(), y = xr(0), E = xr(0), _ = new io({
2227
+ const p = Tr(!1), h = uo(), y = Tr(0), E = Tr(0), _ = new io({
2227
2228
  antialias: !0,
2228
2229
  alpha: !0,
2229
2230
  precision: "mediump",
2230
2231
  logarithmicDepthBuffer: !0
2231
2232
  }), P = new oo({}), L = new Gs(50, 1, 0.1, 2e3), q = Math.tan(Math.PI / 180 * L.fov / 2);
2233
+ let X = !1;
2232
2234
  _.setPixelRatio(window.devicePixelRatio);
2233
- function X() {
2235
+ function H() {
2234
2236
  p.value = !1;
2235
- const me = Ae();
2236
- y.value = me[0], E.value = me[1], L.aspect = y.value / E.value, L.position.set(47, 39, 100), L.fov = 360 / Math.PI * Math.atan(q * (E.value / y.value)), L.lookAt(0, 0, 0), L.updateProjectionMatrix(), _.setSize(y.value, E.value), a.appendChild(_.domElement), i.stats && ve(), i.css3d && Fe();
2237
- let Le;
2237
+ const me = Le();
2238
+ y.value = me[0], E.value = me[1], L.aspect = y.value / E.value, L.position.set(47, 39, 100), L.fov = 360 / Math.PI * Math.atan(q * (E.value / y.value)), L.lookAt(0, 0, 0), L.updateProjectionMatrix(), _.setSize(y.value, E.value), a.appendChild(_.domElement), i.stats && Me(), i.css3d && tn();
2239
+ let Ne;
2238
2240
  if (i.control && i.control.init) {
2239
- Le = fo(L, _.domElement);
2240
- const Re = Object.assign(
2241
+ Ne = fo(L, _.domElement);
2242
+ const Pe = Object.assign(
2241
2243
  ea,
2242
2244
  i.control.options || {}
2243
2245
  );
2244
- Object.keys(Re).forEach((ke) => {
2245
- Le[ke] = Re[ke];
2246
+ Object.keys(Pe).forEach((ze) => {
2247
+ Ne[ze] = Pe[ze];
2246
2248
  });
2247
2249
  }
2248
- return As(() => p.value = !0), Le;
2249
- }
2250
- function H(me) {
2251
- me.preventDefault(), cancelAnimationFrame(oe);
2250
+ return As(() => p.value = !0), Ne;
2252
2251
  }
2253
2252
  function W(me) {
2254
- me.preventDefault(), X(), oe();
2253
+ me.preventDefault(), cancelAnimationFrame(Y);
2255
2254
  }
2256
2255
  function Z(me) {
2256
+ me.preventDefault(), H(), Y();
2257
+ }
2258
+ function ce(me) {
2257
2259
  l.push(me);
2258
2260
  }
2259
- function oe(me) {
2260
- l && l.length && l.forEach((Le) => {
2261
- typeof Le == "function" && Le();
2262
- }), h.value && h.value.update(), _.render(P, L), u && u.update(), c && c.render(P, L), requestAnimationFrame(oe);
2261
+ function Y(me) {
2262
+ l && l.length && l.forEach((Ne) => {
2263
+ typeof Ne == "function" && Ne();
2264
+ }), i.renderType === "loop" && Ae(), requestAnimationFrame(Y);
2265
+ }
2266
+ function Ae() {
2267
+ X = !1, u && u.update(), h.value && h.value.update(), _.render(P, L), c && c.render(P, L);
2268
+ }
2269
+ function ve() {
2270
+ X || (X = !0, requestAnimationFrame(Ae));
2263
2271
  }
2264
- function J() {
2272
+ function ae() {
2265
2273
  As(() => {
2266
- const me = Ae();
2267
- y.value = me[0], E.value = me[1], L.aspect = y.value / E.value, L.fov = 360 / Math.PI * Math.atan(q * (E.value / y.value)), L.updateProjectionMatrix(), L.lookAt(P.position), _.render(P, L), _.setSize(y.value, E.value), c && c.setSize(y.value, E.value);
2274
+ const me = Le();
2275
+ y.value = me[0], E.value = me[1], L.aspect = y.value / E.value, L.fov = 360 / Math.PI * Math.atan(q * (E.value / y.value)), L.updateProjectionMatrix(), L.lookAt(P.position), _.setSize(y.value, E.value), c && c.setSize(y.value, E.value), _.render(P, L);
2268
2276
  });
2269
2277
  }
2270
- function Ae() {
2278
+ function Le() {
2271
2279
  return a = document.querySelector(C), [a.clientWidth, a.clientHeight];
2272
2280
  }
2273
- function ve() {
2281
+ function Me() {
2274
2282
  u = new po(), u.dom.style.cssText = "position:absolute;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000", a.appendChild(u.dom);
2275
2283
  }
2276
- function ce(me, Le, Re, ke, nn) {
2277
- const Tt = new Fn().setFromObject(me), Et = Tt.getSize(new le()).length(), He = Tt.getCenter(new le());
2278
- nn && He.add(nn);
2279
- const Je = Et * Le * 0.5, De = Lt.degToRad(Re.fov * 0.5), Ft = Je / Math.tan(De), je = new le().subVectors(Re.position, He).multiply(new le(1, 1, 1)).normalize().multiplyScalar(Ft).add(He), ze = {
2284
+ function Je(me, Ne, Pe, ze, nn) {
2285
+ const Fe = new jn().setFromObject(me), Ve = Fe.getSize(new le()).length(), xe = Fe.getCenter(new le());
2286
+ nn && xe.add(nn);
2287
+ const Kn = Ve * Ne * 0.5, Ze = It.degToRad(Pe.fov * 0.5), sn = Kn / Math.tan(Ze), je = new le().subVectors(Pe.position, xe).multiply(new le(1, 1, 1)).normalize().multiplyScalar(sn).add(xe), Ke = {
2280
2288
  x: je.x,
2281
2289
  y: je.y,
2282
2290
  z: je.z,
2283
- lookAt_x: He.x,
2284
- lookAt_y: He.y,
2285
- lookAt_z: He.z
2291
+ lookAt_x: xe.x,
2292
+ lookAt_y: xe.y,
2293
+ lookAt_z: xe.z
2286
2294
  };
2287
- return Re.position.set(ze.x, ze.y, ze.z), Re.lookAt(
2288
- ze.lookAt_x,
2289
- ze.lookAt_y,
2290
- ze.lookAt_z
2291
- ), Re.updateProjectionMatrix(), ke.target.copy(He), ke.update(), Et;
2295
+ return Pe.position.set(Ke.x, Ke.y, Ke.z), Pe.lookAt(
2296
+ Ke.lookAt_x,
2297
+ Ke.lookAt_y,
2298
+ Ke.lookAt_z
2299
+ ), Pe.updateProjectionMatrix(), ze.target.copy(xe), ze.update(), Ve;
2292
2300
  }
2293
- function Fe() {
2301
+ function tn() {
2294
2302
  c = new mo(), c.setSize(y.value, E.value), c.domElement.style.position = "absolute", c.domElement.style.top = 0, c.domElement.style.left = 0, c.domElement.style.pointerEvents = "none", a.appendChild(c.domElement);
2295
2303
  }
2296
- function Pe() {
2304
+ function ct() {
2297
2305
  ho(P);
2298
2306
  }
2299
2307
  return co(() => {
2300
- h.value = X(), _.domElement.addEventListener("resize", J, !1), _.domElement.addEventListener(
2308
+ h.value = H(), _.domElement.addEventListener("resize", ae, !1), _.domElement.addEventListener(
2301
2309
  "webglcontextlost",
2302
- H,
2310
+ W,
2303
2311
  !1
2304
2312
  ), _.domElement.addEventListener(
2305
2313
  "webglcontextrestored",
2306
- W,
2314
+ Z,
2307
2315
  !1
2308
- ), requestAnimationFrame(oe);
2316
+ ), i.renderType === "loop" ? requestAnimationFrame(Y) : i.renderType === "change" && h.value && h.value.addEventListener("change", ve);
2309
2317
  }), lo(() => {
2310
- cancelAnimationFrame(oe), _.domElement.removeEventListener("resize", J, !1), _.domElement.removeEventListener(
2318
+ cancelAnimationFrame(Y), _.domElement.removeEventListener("resize", ae, !1), _.domElement.removeEventListener(
2311
2319
  "webglcontextlost",
2312
- H,
2320
+ W,
2313
2321
  !1
2314
2322
  ), _.domElement.removeEventListener(
2315
2323
  "webglcontextrestored",
2316
- W,
2324
+ Z,
2317
2325
  !1
2318
- ), Pe();
2326
+ ), ct();
2319
2327
  }), {
2320
- addAnimate: Z,
2321
- frameArea: ce,
2328
+ addAnimate: ce,
2329
+ frameArea: Je,
2330
+ onRender: Ae,
2322
2331
  scene: P,
2323
2332
  camera: L,
2324
2333
  control: h,
@@ -2331,7 +2340,7 @@ function la(C, r) {
2331
2340
  const fa = (C = "app") => {
2332
2341
  const r = new ao();
2333
2342
  r.params.Line.threshold = 8;
2334
- const i = new Nr(), a = document.getElementById(C);
2343
+ const i = new Fr(), a = document.getElementById(C);
2335
2344
  function u(p, h) {
2336
2345
  const { scaleX: y, scaleY: E } = l(a), { clientWidth: _, clientHeight: P } = h, L = h.getBoundingClientRect(), q = _ * y, X = P * E, H = p.clientX - L.left, W = p.clientY - L.top;
2337
2346
  return i.x = (p.clientX - L.left) / q * 2 - 1, i.y = -((p.clientY - L.top) / X) * 2 + 1, { pointer: i, x: H, y: W };
@@ -2358,17 +2367,17 @@ const fa = (C = "app") => {
2358
2367
  getScale: l,
2359
2368
  getIntersects: c
2360
2369
  };
2361
- }, We = [], ha = new Qe(16711680), da = () => {
2370
+ }, Ye = [], ha = new $e(16711680), da = () => {
2362
2371
  const C = () => {
2363
- We.splice(0);
2372
+ Ye.splice(0);
2364
2373
  }, r = (p, h) => {
2365
2374
  h.traverse((y) => {
2366
2375
  y && i(p, y);
2367
2376
  });
2368
2377
  }, i = (p, h) => {
2369
2378
  if (h.userData.needCheck && (h.autoUpdateMatrix = !1, h.updateMatrix(), h.updateMatrixWorld(), h.isMesh)) {
2370
- const y = new Fn(new le()).setFromObject(h);
2371
- h.geometry.userData.obb = new Lr(), h.geometry.userData.obb.halfSize.copy(y.getSize(new le())).multiplyScalar(0.5).multiplyScalar(0.88), h.userData.obb = new Lr(), h.userData.originColor = h.material.color.clone(), h.userData.parentUid = p, We.push({
2379
+ const y = new jn(new le()).setFromObject(h);
2380
+ h.geometry.userData.obb = new Dr(), h.geometry.userData.obb.halfSize.copy(y.getSize(new le())).multiplyScalar(0.5).multiplyScalar(0.88), h.userData.obb = new Dr(), h.userData.originColor = h.material.color.clone(), h.userData.parentUid = p, Ye.push({
2372
2381
  object: h,
2373
2382
  parentUid: p
2374
2383
  });
@@ -2377,18 +2386,18 @@ const fa = (C = "app") => {
2377
2386
  return {
2378
2387
  resetObbs: C,
2379
2388
  initObb: r,
2380
- getObbObjectByParentUid: (p) => We.filter((h) => h.parentUid === p),
2389
+ getObbObjectByParentUid: (p) => Ye.filter((h) => h.parentUid === p),
2381
2390
  addObbFromArray: (p, h) => {
2382
2391
  for (let y = 0, E = h.length; y < E; y++)
2383
2392
  i(p, h[y]);
2384
2393
  },
2385
2394
  removeObbFromArray: (p) => {
2386
- const h = We.filter((y) => !p.includes(y.object));
2387
- We.splice(0, We.length, ...h);
2395
+ const h = Ye.filter((y) => !p.includes(y.object));
2396
+ Ye.splice(0, Ye.length, ...h);
2388
2397
  },
2389
2398
  removeUidObb: (p) => {
2390
- for (let h = We.length - 1; h >= 0; h--)
2391
- We[h].parentUid === p && We.splice(h, 1);
2399
+ for (let h = Ye.length - 1; h >= 0; h--)
2400
+ Ye[h].parentUid === p && Ye.splice(h, 1);
2392
2401
  }
2393
2402
  };
2394
2403
  };
@@ -2396,7 +2405,7 @@ var ta = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
2396
2405
  function na(C) {
2397
2406
  return C && C.__esModule && Object.prototype.hasOwnProperty.call(C, "default") ? C.default : C;
2398
2407
  }
2399
- var Ln = { exports: {} }, ra = Ln.exports, Is;
2408
+ var Dn = { exports: {} }, ra = Dn.exports, Is;
2400
2409
  function sa() {
2401
2410
  return Is || (Is = 1, function(C, r) {
2402
2411
  (function(i, a) {
@@ -2447,10 +2456,10 @@ function sa() {
2447
2456
  function Z(e, t, n) {
2448
2457
  return W.call(e, t, n);
2449
2458
  }
2450
- function oe(e, t) {
2459
+ function ce(e, t) {
2451
2460
  return t(e);
2452
2461
  }
2453
- function J(e) {
2462
+ function Y(e) {
2454
2463
  if (!e) throw new Error("Assertion Failed");
2455
2464
  }
2456
2465
  function Ae(e) {
@@ -2472,69 +2481,69 @@ function sa() {
2472
2481
  return m == null ? void 0 : ve(m, t.substr(d + 1));
2473
2482
  }
2474
2483
  }
2475
- function ce(e, t, n) {
2484
+ function ae(e, t, n) {
2476
2485
  if (e && t !== void 0 && !("isFrozen" in Object && Object.isFrozen(e))) if (typeof t != "string" && "length" in t) {
2477
- J(typeof n != "string" && "length" in n);
2478
- for (var s = 0, o = t.length; s < o; ++s) ce(e, t[s], n[s]);
2486
+ Y(typeof n != "string" && "length" in n);
2487
+ for (var s = 0, o = t.length; s < o; ++s) ae(e, t[s], n[s]);
2479
2488
  } else {
2480
2489
  var f, d, m = t.indexOf(".");
2481
- m !== -1 ? (f = t.substr(0, m), (d = t.substr(m + 1)) === "" ? n === void 0 ? p(e) && !isNaN(parseInt(f)) ? e.splice(f, 1) : delete e[f] : e[f] = n : ce(m = !(m = e[f]) || !_(e, f) ? e[f] = {} : m, d, n)) : n === void 0 ? p(e) && !isNaN(parseInt(t)) ? e.splice(t, 1) : delete e[t] : e[t] = n;
2490
+ m !== -1 ? (f = t.substr(0, m), (d = t.substr(m + 1)) === "" ? n === void 0 ? p(e) && !isNaN(parseInt(f)) ? e.splice(f, 1) : delete e[f] : e[f] = n : ae(m = !(m = e[f]) || !_(e, f) ? e[f] = {} : m, d, n)) : n === void 0 ? p(e) && !isNaN(parseInt(t)) ? e.splice(t, 1) : delete e[t] : e[t] = n;
2482
2491
  }
2483
2492
  }
2484
- function Fe(e) {
2493
+ function Le(e) {
2485
2494
  var t, n = {};
2486
2495
  for (t in e) _(e, t) && (n[t] = e[t]);
2487
2496
  return n;
2488
2497
  }
2489
- var Pe = [].concat;
2490
- function me(e) {
2491
- return Pe.apply([], e);
2498
+ var Me = [].concat;
2499
+ function Je(e) {
2500
+ return Me.apply([], e);
2492
2501
  }
2493
- var ct = "BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(me([8, 16, 32, 64].map(function(e) {
2502
+ var ft = "BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(Je([8, 16, 32, 64].map(function(e) {
2494
2503
  return ["Int", "Uint", "Float"].map(function(t) {
2495
2504
  return t + e + "Array";
2496
2505
  });
2497
2506
  }))).filter(function(e) {
2498
2507
  return c[e];
2499
- }), Le = new Set(ct.map(function(e) {
2508
+ }), tn = new Set(ft.map(function(e) {
2500
2509
  return c[e];
2501
- })), Re = null;
2502
- function ke(e) {
2503
- return Re = /* @__PURE__ */ new WeakMap(), e = function t(n) {
2510
+ })), ct = null;
2511
+ function me(e) {
2512
+ return ct = /* @__PURE__ */ new WeakMap(), e = function t(n) {
2504
2513
  if (!n || typeof n != "object") return n;
2505
- var s = Re.get(n);
2514
+ var s = ct.get(n);
2506
2515
  if (s) return s;
2507
2516
  if (p(n)) {
2508
- s = [], Re.set(n, s);
2517
+ s = [], ct.set(n, s);
2509
2518
  for (var o = 0, f = n.length; o < f; ++o) s.push(t(n[o]));
2510
- } else if (Le.has(n.constructor)) s = n;
2519
+ } else if (tn.has(n.constructor)) s = n;
2511
2520
  else {
2512
2521
  var d, m = y(n);
2513
- for (d in s = m === Object.prototype ? {} : Object.create(m), Re.set(n, s), n) _(n, d) && (s[d] = t(n[d]));
2522
+ for (d in s = m === Object.prototype ? {} : Object.create(m), ct.set(n, s), n) _(n, d) && (s[d] = t(n[d]));
2514
2523
  }
2515
2524
  return s;
2516
- }(e), Re = null, e;
2525
+ }(e), ct = null, e;
2517
2526
  }
2518
- var nn = {}.toString;
2519
- function Tt(e) {
2520
- return nn.call(e).slice(8, -1);
2527
+ var Ne = {}.toString;
2528
+ function Pe(e) {
2529
+ return Ne.call(e).slice(8, -1);
2521
2530
  }
2522
- var Et = typeof Symbol < "u" ? Symbol.iterator : "@@iterator", He = typeof Et == "symbol" ? function(e) {
2531
+ var ze = typeof Symbol < "u" ? Symbol.iterator : "@@iterator", nn = typeof ze == "symbol" ? function(e) {
2523
2532
  var t;
2524
- return e != null && (t = e[Et]) && t.apply(e);
2533
+ return e != null && (t = e[ze]) && t.apply(e);
2525
2534
  } : function() {
2526
2535
  return null;
2527
2536
  };
2528
- function $e(e, t) {
2537
+ function Fe(e, t) {
2529
2538
  return t = e.indexOf(t), 0 <= t && e.splice(t, 1), 0 <= t;
2530
2539
  }
2531
- var Je = {};
2532
- function De(e) {
2540
+ var Ve = {};
2541
+ function xe(e) {
2533
2542
  var t, n, s, o;
2534
2543
  if (arguments.length === 1) {
2535
2544
  if (p(e)) return e.slice();
2536
- if (this === Je && typeof e == "string") return [e];
2537
- if (o = He(e)) {
2545
+ if (this === Ve && typeof e == "string") return [e];
2546
+ if (o = nn(e)) {
2538
2547
  for (n = []; !(s = o.next()).done; ) n.push(s.value);
2539
2548
  return n;
2540
2549
  }
@@ -2546,15 +2555,15 @@ function sa() {
2546
2555
  for (t = arguments.length, n = new Array(t); t--; ) n[t] = arguments[t];
2547
2556
  return n;
2548
2557
  }
2549
- var Ft = typeof Symbol < "u" ? function(e) {
2558
+ var rn = typeof Symbol < "u" ? function(e) {
2550
2559
  return e[Symbol.toStringTag] === "AsyncFunction";
2551
2560
  } : function() {
2552
2561
  return !1;
2553
- }, Bt = ["Unknown", "Constraint", "Data", "TransactionInactive", "ReadOnly", "Version", "NotFound", "InvalidState", "InvalidAccess", "Abort", "Timeout", "QuotaExceeded", "Syntax", "DataClone"], Ce = ["Modify", "Bulk", "OpenFailed", "VersionChange", "Schema", "Upgrade", "InvalidTable", "MissingAPI", "NoSuchDatabase", "InvalidArgument", "SubTransaction", "Unsupported", "Internal", "DatabaseClosed", "PrematureCommit", "ForeignAwait"].concat(Bt), Fr = { VersionChanged: "Database version changed by other database connection", DatabaseClosed: "Database has been closed", Abort: "Transaction aborted", TransactionInactive: "Transaction has already completed or failed", MissingAPI: "IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb" };
2554
- function je(e, t) {
2562
+ }, Kt = ["Unknown", "Constraint", "Data", "TransactionInactive", "ReadOnly", "Version", "NotFound", "InvalidState", "InvalidAccess", "Abort", "Timeout", "QuotaExceeded", "Syntax", "DataClone"], Ce = ["Modify", "Bulk", "OpenFailed", "VersionChange", "Schema", "Upgrade", "InvalidTable", "MissingAPI", "NoSuchDatabase", "InvalidArgument", "SubTransaction", "Unsupported", "Internal", "DatabaseClosed", "PrematureCommit", "ForeignAwait"].concat(Kt), Kn = { VersionChanged: "Database version changed by other database connection", DatabaseClosed: "Database has been closed", Abort: "Transaction aborted", TransactionInactive: "Transaction has already completed or failed", MissingAPI: "IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb" };
2563
+ function Ze(e, t) {
2555
2564
  this.name = e, this.message = t;
2556
2565
  }
2557
- function ze(e, t) {
2566
+ function sn(e, t) {
2558
2567
  return e + ". Errors: " + Object.keys(t).map(function(n) {
2559
2568
  return t[n].toString();
2560
2569
  }).filter(function(n, s, o) {
@@ -2562,44 +2571,44 @@ function sa() {
2562
2571
  }).join(`
2563
2572
  `);
2564
2573
  }
2565
- function rn(e, t, n, s) {
2566
- this.failures = t, this.failedKeys = s, this.successCount = n, this.message = ze(e, t);
2574
+ function Nt(e, t, n, s) {
2575
+ this.failures = t, this.failedKeys = s, this.successCount = n, this.message = sn(e, t);
2567
2576
  }
2568
- function St(e, t) {
2577
+ function je(e, t) {
2569
2578
  this.name = "BulkError", this.failures = Object.keys(t).map(function(n) {
2570
2579
  return t[n];
2571
- }), this.failuresByPos = t, this.message = ze(e, this.failures);
2580
+ }), this.failuresByPos = t, this.message = sn(e, this.failures);
2572
2581
  }
2573
- X(je).from(Error).extend({ toString: function() {
2582
+ X(Ze).from(Error).extend({ toString: function() {
2574
2583
  return this.name + ": " + this.message;
2575
- } }), X(rn).from(je), X(St).from(je);
2576
- var jn = Ce.reduce(function(e, t) {
2584
+ } }), X(Nt).from(Ze), X(je).from(Ze);
2585
+ var Ke = Ce.reduce(function(e, t) {
2577
2586
  return e[t] = t + "Error", e;
2578
- }, {}), Ws = je, V = Ce.reduce(function(e, t) {
2587
+ }, {}), Ws = Ze, V = Ce.reduce(function(e, t) {
2579
2588
  var n = t + "Error";
2580
2589
  function s(o, f) {
2581
2590
  this.name = n, o ? typeof o == "string" ? (this.message = "".concat(o).concat(f ? `
2582
- ` + f : ""), this.inner = f || null) : typeof o == "object" && (this.message = "".concat(o.name, " ").concat(o.message), this.inner = o) : (this.message = Fr[t] || n, this.inner = null);
2591
+ ` + f : ""), this.inner = f || null) : typeof o == "object" && (this.message = "".concat(o.name, " ").concat(o.message), this.inner = o) : (this.message = Kn[t] || n, this.inner = null);
2583
2592
  }
2584
2593
  return X(s).from(Ws), e[t] = s, e;
2585
2594
  }, {});
2586
2595
  V.Syntax = SyntaxError, V.Type = TypeError, V.Range = RangeError;
2587
- var jr = Bt.reduce(function(e, t) {
2596
+ var jr = Kt.reduce(function(e, t) {
2588
2597
  return e[t + "Error"] = V[t], e;
2589
- }, {}), sn = Ce.reduce(function(e, t) {
2598
+ }, {}), on = Ce.reduce(function(e, t) {
2590
2599
  return ["Syntax", "Type", "Range"].indexOf(t) === -1 && (e[t + "Error"] = V[t]), e;
2591
2600
  }, {});
2592
2601
  function ue() {
2593
2602
  }
2594
- function jt(e) {
2603
+ function Ft(e) {
2595
2604
  return e;
2596
2605
  }
2597
2606
  function Ys(e, t) {
2598
- return e == null || e === jt ? t : function(n) {
2607
+ return e == null || e === Ft ? t : function(n) {
2599
2608
  return t(e(n));
2600
2609
  };
2601
2610
  }
2602
- function ut(e, t) {
2611
+ function lt(e, t) {
2603
2612
  return function() {
2604
2613
  e.apply(this, arguments), t.apply(this, arguments);
2605
2614
  };
@@ -2611,14 +2620,14 @@ function sa() {
2611
2620
  var s = this.onsuccess, o = this.onerror;
2612
2621
  this.onsuccess = null, this.onerror = null;
2613
2622
  var f = t.apply(this, arguments);
2614
- return s && (this.onsuccess = this.onsuccess ? ut(s, this.onsuccess) : s), o && (this.onerror = this.onerror ? ut(o, this.onerror) : o), f !== void 0 ? f : n;
2623
+ return s && (this.onsuccess = this.onsuccess ? lt(s, this.onsuccess) : s), o && (this.onerror = this.onerror ? lt(o, this.onerror) : o), f !== void 0 ? f : n;
2615
2624
  };
2616
2625
  }
2617
2626
  function $s(e, t) {
2618
2627
  return e === ue ? t : function() {
2619
2628
  e.apply(this, arguments);
2620
2629
  var n = this.onsuccess, s = this.onerror;
2621
- this.onsuccess = this.onerror = null, t.apply(this, arguments), n && (this.onsuccess = this.onsuccess ? ut(n, this.onsuccess) : n), s && (this.onerror = this.onerror ? ut(s, this.onerror) : s);
2630
+ this.onsuccess = this.onerror = null, t.apply(this, arguments), n && (this.onsuccess = this.onsuccess ? lt(n, this.onsuccess) : n), s && (this.onerror = this.onerror ? lt(s, this.onerror) : s);
2622
2631
  };
2623
2632
  }
2624
2633
  function Js(e, t) {
@@ -2626,7 +2635,7 @@ function sa() {
2626
2635
  var s = e.apply(this, arguments);
2627
2636
  h(n, s);
2628
2637
  var o = this.onsuccess, f = this.onerror;
2629
- return this.onsuccess = null, this.onerror = null, n = t.apply(this, arguments), o && (this.onsuccess = this.onsuccess ? ut(o, this.onsuccess) : o), f && (this.onerror = this.onerror ? ut(f, this.onerror) : f), s === void 0 ? n === void 0 ? void 0 : n : h(s, n);
2638
+ return this.onsuccess = null, this.onerror = null, n = t.apply(this, arguments), o && (this.onsuccess = this.onsuccess ? lt(o, this.onsuccess) : o), f && (this.onerror = this.onerror ? lt(f, this.onerror) : f), s === void 0 ? n === void 0 ? void 0 : n : h(s, n);
2630
2639
  };
2631
2640
  }
2632
2641
  function Zs(e, t) {
@@ -2634,7 +2643,7 @@ function sa() {
2634
2643
  return t.apply(this, arguments) !== !1 && e.apply(this, arguments);
2635
2644
  };
2636
2645
  }
2637
- function Kn(e, t) {
2646
+ function Bn(e, t) {
2638
2647
  return e === ue ? t : function() {
2639
2648
  var n = e.apply(this, arguments);
2640
2649
  if (n && typeof n.then == "function") {
@@ -2646,147 +2655,147 @@ function sa() {
2646
2655
  return t.apply(this, arguments);
2647
2656
  };
2648
2657
  }
2649
- sn.ModifyError = rn, sn.DexieError = je, sn.BulkError = St;
2650
- var Ke = typeof location < "u" && /^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);
2658
+ on.ModifyError = Nt, on.DexieError = Ze, on.BulkError = je;
2659
+ var Be = typeof location < "u" && /^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);
2651
2660
  function Kr(e) {
2652
- Ke = e;
2661
+ Be = e;
2653
2662
  }
2654
- var Kt = {}, Br = 100, ct = typeof Promise > "u" ? [] : function() {
2663
+ var jt = {}, Br = 100, ft = typeof Promise > "u" ? [] : function() {
2655
2664
  var e = Promise.resolve();
2656
2665
  if (typeof crypto > "u" || !crypto.subtle) return [e, y(e), e];
2657
2666
  var t = crypto.subtle.digest("SHA-512", new Uint8Array([0]));
2658
2667
  return [t, y(t), e];
2659
- }(), Bt = ct[0], Ce = ct[1], ct = ct[2], Ce = Ce && Ce.then, lt = Bt && Bt.constructor, Bn = !!ct, Ut = function(e, t) {
2660
- qt.push([e, t]), on && (queueMicrotask(ti), on = !1);
2661
- }, Un = !0, on = !0, ft = [], an = [], qn = jt, Ze = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: ue, pgp: !1, env: {}, finalize: ue }, z = Ze, qt = [], ht = 0, un = [];
2668
+ }(), Kt = ft[0], Ce = ft[1], ft = ft[2], Ce = Ce && Ce.then, ht = Kt && Kt.constructor, Un = !!ft, Bt = function(e, t) {
2669
+ Ut.push([e, t]), an && (queueMicrotask(ti), an = !1);
2670
+ }, qn = !0, an = !0, dt = [], un = [], Gn = Ft, et = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: ue, pgp: !1, env: {}, finalize: ue }, z = et, Ut = [], pt = 0, cn = [];
2662
2671
  function U(e) {
2663
2672
  if (typeof this != "object") throw new TypeError("Promises must be constructed via new");
2664
2673
  this._listeners = [], this._lib = !1;
2665
2674
  var t = this._PSD = z;
2666
2675
  if (typeof e != "function") {
2667
- if (e !== Kt) throw new TypeError("Not a function");
2668
- return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 && Hn(this, this._value));
2676
+ if (e !== jt) throw new TypeError("Not a function");
2677
+ return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 && zn(this, this._value));
2669
2678
  }
2670
2679
  this._state = null, this._value = null, ++t.ref, function n(s, o) {
2671
2680
  try {
2672
2681
  o(function(f) {
2673
2682
  if (s._state === null) {
2674
2683
  if (f === s) throw new TypeError("A promise cannot be resolved with itself.");
2675
- var d = s._lib && Rt();
2684
+ var d = s._lib && St();
2676
2685
  f && typeof f.then == "function" ? n(s, function(m, v) {
2677
2686
  f instanceof U ? f._then(m, v) : f.then(m, v);
2678
- }) : (s._state = !0, s._value = f, qr(s)), d && kt();
2687
+ }) : (s._state = !0, s._value = f, qr(s)), d && Rt();
2679
2688
  }
2680
- }, Hn.bind(null, s));
2689
+ }, zn.bind(null, s));
2681
2690
  } catch (f) {
2682
- Hn(s, f);
2691
+ zn(s, f);
2683
2692
  }
2684
2693
  }(this, e);
2685
2694
  }
2686
- var Gn = { get: function() {
2687
- var e = z, t = hn;
2695
+ var Hn = { get: function() {
2696
+ var e = z, t = dn;
2688
2697
  function n(s, o) {
2689
- var f = this, d = !e.global && (e !== z || t !== hn), m = d && !tt(), v = new U(function(w, T) {
2690
- zn(f, new Ur(Hr(s, e, d, m), Hr(o, e, d, m), w, T, e));
2698
+ var f = this, d = !e.global && (e !== z || t !== dn), m = d && !nt(), v = new U(function(w, T) {
2699
+ Vn(f, new Ur(Hr(s, e, d, m), Hr(o, e, d, m), w, T, e));
2691
2700
  });
2692
2701
  return this._consoleTask && (v._consoleTask = this._consoleTask), v;
2693
2702
  }
2694
- return n.prototype = Kt, n;
2703
+ return n.prototype = jt, n;
2695
2704
  }, set: function(e) {
2696
- q(this, "then", e && e.prototype === Kt ? Gn : { get: function() {
2705
+ q(this, "then", e && e.prototype === jt ? Hn : { get: function() {
2697
2706
  return e;
2698
- }, set: Gn.set });
2707
+ }, set: Hn.set });
2699
2708
  } };
2700
2709
  function Ur(e, t, n, s, o) {
2701
2710
  this.onFulfilled = typeof e == "function" ? e : null, this.onRejected = typeof t == "function" ? t : null, this.resolve = n, this.reject = s, this.psd = o;
2702
2711
  }
2703
- function Hn(e, t) {
2712
+ function zn(e, t) {
2704
2713
  var n, s;
2705
- an.push(t), e._state === null && (n = e._lib && Rt(), t = qn(t), e._state = !1, e._value = t, s = e, ft.some(function(o) {
2714
+ un.push(t), e._state === null && (n = e._lib && St(), t = Gn(t), e._state = !1, e._value = t, s = e, dt.some(function(o) {
2706
2715
  return o._value === s._value;
2707
- }) || ft.push(s), qr(e), n && kt());
2716
+ }) || dt.push(s), qr(e), n && Rt());
2708
2717
  }
2709
2718
  function qr(e) {
2710
2719
  var t = e._listeners;
2711
2720
  e._listeners = [];
2712
- for (var n = 0, s = t.length; n < s; ++n) zn(e, t[n]);
2721
+ for (var n = 0, s = t.length; n < s; ++n) Vn(e, t[n]);
2713
2722
  var o = e._PSD;
2714
- --o.ref || o.finalize(), ht === 0 && (++ht, Ut(function() {
2715
- --ht == 0 && Vn();
2723
+ --o.ref || o.finalize(), pt === 0 && (++pt, Bt(function() {
2724
+ --pt == 0 && Xn();
2716
2725
  }, []));
2717
2726
  }
2718
- function zn(e, t) {
2727
+ function Vn(e, t) {
2719
2728
  if (e._state !== null) {
2720
2729
  var n = e._state ? t.onFulfilled : t.onRejected;
2721
2730
  if (n === null) return (e._state ? t.resolve : t.reject)(e._value);
2722
- ++t.psd.ref, ++ht, Ut(ei, [n, e, t]);
2731
+ ++t.psd.ref, ++pt, Bt(ei, [n, e, t]);
2723
2732
  } else e._listeners.push(t);
2724
2733
  }
2725
2734
  function ei(e, t, n) {
2726
2735
  try {
2727
2736
  var s, o = t._value;
2728
- !t._state && an.length && (an = []), s = Ke && t._consoleTask ? t._consoleTask.run(function() {
2737
+ !t._state && un.length && (un = []), s = Be && t._consoleTask ? t._consoleTask.run(function() {
2729
2738
  return e(o);
2730
- }) : e(o), t._state || an.indexOf(o) !== -1 || function(f) {
2731
- for (var d = ft.length; d; ) if (ft[--d]._value === f._value) return ft.splice(d, 1);
2739
+ }) : e(o), t._state || un.indexOf(o) !== -1 || function(f) {
2740
+ for (var d = dt.length; d; ) if (dt[--d]._value === f._value) return dt.splice(d, 1);
2732
2741
  }(t), n.resolve(s);
2733
2742
  } catch (f) {
2734
2743
  n.reject(f);
2735
2744
  } finally {
2736
- --ht == 0 && Vn(), --n.psd.ref || n.psd.finalize();
2745
+ --pt == 0 && Xn(), --n.psd.ref || n.psd.finalize();
2737
2746
  }
2738
2747
  }
2739
2748
  function ti() {
2740
- dt(Ze, function() {
2741
- Rt() && kt();
2749
+ mt(et, function() {
2750
+ St() && Rt();
2742
2751
  });
2743
2752
  }
2744
- function Rt() {
2745
- var e = Un;
2746
- return on = Un = !1, e;
2753
+ function St() {
2754
+ var e = qn;
2755
+ return an = qn = !1, e;
2747
2756
  }
2748
- function kt() {
2757
+ function Rt() {
2749
2758
  var e, t, n;
2750
2759
  do
2751
- for (; 0 < qt.length; ) for (e = qt, qt = [], n = e.length, t = 0; t < n; ++t) {
2760
+ for (; 0 < Ut.length; ) for (e = Ut, Ut = [], n = e.length, t = 0; t < n; ++t) {
2752
2761
  var s = e[t];
2753
2762
  s[0].apply(null, s[1]);
2754
2763
  }
2755
- while (0 < qt.length);
2756
- on = Un = !0;
2764
+ while (0 < Ut.length);
2765
+ an = qn = !0;
2757
2766
  }
2758
- function Vn() {
2759
- var e = ft;
2760
- ft = [], e.forEach(function(s) {
2767
+ function Xn() {
2768
+ var e = dt;
2769
+ dt = [], e.forEach(function(s) {
2761
2770
  s._PSD.onunhandled.call(null, s._value, s);
2762
2771
  });
2763
- for (var t = un.slice(0), n = t.length; n; ) t[--n]();
2772
+ for (var t = cn.slice(0), n = t.length; n; ) t[--n]();
2764
2773
  }
2765
- function cn(e) {
2766
- return new U(Kt, !1, e);
2774
+ function ln(e) {
2775
+ return new U(jt, !1, e);
2767
2776
  }
2768
2777
  function de(e, t) {
2769
2778
  var n = z;
2770
2779
  return function() {
2771
- var s = Rt(), o = z;
2780
+ var s = St(), o = z;
2772
2781
  try {
2773
- return nt(n, !0), e.apply(this, arguments);
2782
+ return rt(n, !0), e.apply(this, arguments);
2774
2783
  } catch (f) {
2775
2784
  t && t(f);
2776
2785
  } finally {
2777
- nt(o, !1), s && kt();
2786
+ rt(o, !1), s && Rt();
2778
2787
  }
2779
2788
  };
2780
2789
  }
2781
- P(U.prototype, { then: Gn, _then: function(e, t) {
2782
- zn(this, new Ur(null, null, e, t, z));
2790
+ P(U.prototype, { then: Hn, _then: function(e, t) {
2791
+ Vn(this, new Ur(null, null, e, t, z));
2783
2792
  }, catch: function(e) {
2784
2793
  if (arguments.length === 1) return this.then(null, e);
2785
2794
  var t = e, n = arguments[1];
2786
2795
  return typeof t == "function" ? this.then(null, function(s) {
2787
- return (s instanceof t ? n : cn)(s);
2796
+ return (s instanceof t ? n : ln)(s);
2788
2797
  }) : this.then(null, function(s) {
2789
- return (s && s.name === t ? n : cn)(s);
2798
+ return (s && s.name === t ? n : ln)(s);
2790
2799
  });
2791
2800
  }, finally: function(e) {
2792
2801
  return this.then(function(t) {
@@ -2795,7 +2804,7 @@ function sa() {
2795
2804
  });
2796
2805
  }, function(t) {
2797
2806
  return U.resolve(e()).then(function() {
2798
- return cn(t);
2807
+ return ln(t);
2799
2808
  });
2800
2809
  });
2801
2810
  }, timeout: function(e, t) {
@@ -2806,8 +2815,8 @@ function sa() {
2806
2815
  }, e);
2807
2816
  n.then(s, o).finally(clearTimeout.bind(null, f));
2808
2817
  }) : this;
2809
- } }), typeof Symbol < "u" && Symbol.toStringTag && q(U.prototype, Symbol.toStringTag, "Dexie.Promise"), Ze.env = Gr(), P(U, { all: function() {
2810
- var e = De.apply(null, arguments).map(dn);
2818
+ } }), typeof Symbol < "u" && Symbol.toStringTag && q(U.prototype, Symbol.toStringTag, "Dexie.Promise"), et.env = Gr(), P(U, { all: function() {
2819
+ var e = xe.apply(null, arguments).map(pn);
2811
2820
  return new U(function(t, n) {
2812
2821
  e.length === 0 && t([]);
2813
2822
  var s = e.length;
@@ -2820,9 +2829,9 @@ function sa() {
2820
2829
  }, resolve: function(e) {
2821
2830
  return e instanceof U ? e : e && typeof e.then == "function" ? new U(function(t, n) {
2822
2831
  e.then(t, n);
2823
- }) : new U(Kt, !0, e);
2824
- }, reject: cn, race: function() {
2825
- var e = De.apply(null, arguments).map(dn);
2832
+ }) : new U(jt, !0, e);
2833
+ }, reject: ln, race: function() {
2834
+ var e = xe.apply(null, arguments).map(pn);
2826
2835
  return new U(function(t, n) {
2827
2836
  e.map(function(s) {
2828
2837
  return U.resolve(s).then(t, n);
@@ -2833,33 +2842,33 @@ function sa() {
2833
2842
  }, set: function(e) {
2834
2843
  return z = e;
2835
2844
  } }, totalEchoes: { get: function() {
2836
- return hn;
2837
- } }, newPSD: et, usePSD: dt, scheduler: { get: function() {
2838
- return Ut;
2845
+ return dn;
2846
+ } }, newPSD: tt, usePSD: mt, scheduler: { get: function() {
2847
+ return Bt;
2839
2848
  }, set: function(e) {
2840
- Ut = e;
2849
+ Bt = e;
2841
2850
  } }, rejectionMapper: { get: function() {
2842
- return qn;
2851
+ return Gn;
2843
2852
  }, set: function(e) {
2844
- qn = e;
2853
+ Gn = e;
2845
2854
  } }, follow: function(e, t) {
2846
2855
  return new U(function(n, s) {
2847
- return et(function(o, f) {
2856
+ return tt(function(o, f) {
2848
2857
  var d = z;
2849
- d.unhandleds = [], d.onunhandled = f, d.finalize = ut(function() {
2858
+ d.unhandleds = [], d.onunhandled = f, d.finalize = lt(function() {
2850
2859
  var m, v = this;
2851
2860
  m = function() {
2852
2861
  v.unhandleds.length === 0 ? o() : f(v.unhandleds[0]);
2853
- }, un.push(function w() {
2854
- m(), un.splice(un.indexOf(w), 1);
2855
- }), ++ht, Ut(function() {
2856
- --ht == 0 && Vn();
2862
+ }, cn.push(function w() {
2863
+ m(), cn.splice(cn.indexOf(w), 1);
2864
+ }), ++pt, Bt(function() {
2865
+ --pt == 0 && Xn();
2857
2866
  }, []);
2858
2867
  }, d.finalize), e();
2859
2868
  }, t, n, s);
2860
2869
  });
2861
- } }), lt && (lt.allSettled && q(U, "allSettled", function() {
2862
- var e = De.apply(null, arguments).map(dn);
2870
+ } }), ht && (ht.allSettled && q(U, "allSettled", function() {
2871
+ var e = xe.apply(null, arguments).map(pn);
2863
2872
  return new U(function(t) {
2864
2873
  e.length === 0 && t([]);
2865
2874
  var n = e.length, s = new Array(n);
@@ -2873,8 +2882,8 @@ function sa() {
2873
2882
  });
2874
2883
  });
2875
2884
  });
2876
- }), lt.any && typeof AggregateError < "u" && q(U, "any", function() {
2877
- var e = De.apply(null, arguments).map(dn);
2885
+ }), ht.any && typeof AggregateError < "u" && q(U, "any", function() {
2886
+ var e = xe.apply(null, arguments).map(pn);
2878
2887
  return new U(function(t, n) {
2879
2888
  e.length === 0 && n(new AggregateError([]));
2880
2889
  var s = e.length, o = new Array(s);
@@ -2886,76 +2895,76 @@ function sa() {
2886
2895
  });
2887
2896
  });
2888
2897
  });
2889
- }), lt.withResolvers && (U.withResolvers = lt.withResolvers));
2890
- var we = { awaits: 0, echoes: 0, id: 0 }, ni = 0, ln = [], fn = 0, hn = 0, ri = 0;
2891
- function et(e, t, n, s) {
2898
+ }), ht.withResolvers && (U.withResolvers = ht.withResolvers));
2899
+ var we = { awaits: 0, echoes: 0, id: 0 }, ni = 0, fn = [], hn = 0, dn = 0, ri = 0;
2900
+ function tt(e, t, n, s) {
2892
2901
  var o = z, f = Object.create(o);
2893
- return f.parent = o, f.ref = 0, f.global = !1, f.id = ++ri, Ze.env, f.env = Bn ? { Promise: U, PromiseProp: { value: U, configurable: !0, writable: !0 }, all: U.all, race: U.race, allSettled: U.allSettled, any: U.any, resolve: U.resolve, reject: U.reject } : {}, t && h(f, t), ++o.ref, f.finalize = function() {
2902
+ return f.parent = o, f.ref = 0, f.global = !1, f.id = ++ri, et.env, f.env = Un ? { Promise: U, PromiseProp: { value: U, configurable: !0, writable: !0 }, all: U.all, race: U.race, allSettled: U.allSettled, any: U.any, resolve: U.resolve, reject: U.reject } : {}, t && h(f, t), ++o.ref, f.finalize = function() {
2894
2903
  --this.parent.ref || this.parent.finalize();
2895
- }, s = dt(f, e, n, s), f.ref === 0 && f.finalize(), s;
2904
+ }, s = mt(f, e, n, s), f.ref === 0 && f.finalize(), s;
2896
2905
  }
2897
- function Ot() {
2906
+ function kt() {
2898
2907
  return we.id || (we.id = ++ni), ++we.awaits, we.echoes += Br, we.id;
2899
2908
  }
2900
- function tt() {
2909
+ function nt() {
2901
2910
  return !!we.awaits && (--we.awaits == 0 && (we.id = 0), we.echoes = we.awaits * Br, !0);
2902
2911
  }
2903
- function dn(e) {
2904
- return we.echoes && e && e.constructor === lt ? (Ot(), e.then(function(t) {
2905
- return tt(), t;
2912
+ function pn(e) {
2913
+ return we.echoes && e && e.constructor === ht ? (kt(), e.then(function(t) {
2914
+ return nt(), t;
2906
2915
  }, function(t) {
2907
- return tt(), ye(t);
2916
+ return nt(), ye(t);
2908
2917
  })) : e;
2909
2918
  }
2910
2919
  function si() {
2911
- var e = ln[ln.length - 1];
2912
- ln.pop(), nt(e, !1);
2920
+ var e = fn[fn.length - 1];
2921
+ fn.pop(), rt(e, !1);
2913
2922
  }
2914
- function nt(e, t) {
2923
+ function rt(e, t) {
2915
2924
  var n, s = z;
2916
- (t ? !we.echoes || fn++ && e === z : !fn || --fn && e === z) || queueMicrotask(t ? (function(o) {
2917
- ++hn, we.echoes && --we.echoes != 0 || (we.echoes = we.awaits = we.id = 0), ln.push(z), nt(o, !0);
2918
- }).bind(null, e) : si), e !== z && (z = e, s === Ze && (Ze.env = Gr()), Bn && (n = Ze.env.Promise, t = e.env, (s.global || e.global) && (Object.defineProperty(c, "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))));
2925
+ (t ? !we.echoes || hn++ && e === z : !hn || --hn && e === z) || queueMicrotask(t ? (function(o) {
2926
+ ++dn, we.echoes && --we.echoes != 0 || (we.echoes = we.awaits = we.id = 0), fn.push(z), rt(o, !0);
2927
+ }).bind(null, e) : si), e !== z && (z = e, s === et && (et.env = Gr()), Un && (n = et.env.Promise, t = e.env, (s.global || e.global) && (Object.defineProperty(c, "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))));
2919
2928
  }
2920
2929
  function Gr() {
2921
2930
  var e = c.Promise;
2922
- return Bn ? { Promise: e, PromiseProp: Object.getOwnPropertyDescriptor(c, "Promise"), all: e.all, race: e.race, allSettled: e.allSettled, any: e.any, resolve: e.resolve, reject: e.reject } : {};
2931
+ return Un ? { Promise: e, PromiseProp: Object.getOwnPropertyDescriptor(c, "Promise"), all: e.all, race: e.race, allSettled: e.allSettled, any: e.any, resolve: e.resolve, reject: e.reject } : {};
2923
2932
  }
2924
- function dt(e, t, n, s, o) {
2933
+ function mt(e, t, n, s, o) {
2925
2934
  var f = z;
2926
2935
  try {
2927
- return nt(e, !0), t(n, s, o);
2936
+ return rt(e, !0), t(n, s, o);
2928
2937
  } finally {
2929
- nt(f, !1);
2938
+ rt(f, !1);
2930
2939
  }
2931
2940
  }
2932
2941
  function Hr(e, t, n, s) {
2933
2942
  return typeof e != "function" ? e : function() {
2934
2943
  var o = z;
2935
- n && Ot(), nt(t, !0);
2944
+ n && kt(), rt(t, !0);
2936
2945
  try {
2937
2946
  return e.apply(this, arguments);
2938
2947
  } finally {
2939
- nt(o, !1), s && queueMicrotask(tt);
2948
+ rt(o, !1), s && queueMicrotask(nt);
2940
2949
  }
2941
2950
  };
2942
2951
  }
2943
- function Xn(e) {
2944
- Promise === lt && we.echoes === 0 ? fn === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
2952
+ function Wn(e) {
2953
+ Promise === ht && we.echoes === 0 ? hn === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
2945
2954
  }
2946
- ("" + Ce).indexOf("[native code]") === -1 && (Ot = tt = ue);
2947
- var ye = U.reject, pt = "￿", Ve = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", zr = "String expected.", Mt = [], pn = "__dbnames", Wn = "readonly", Yn = "readwrite";
2948
- function mt(e, t) {
2955
+ ("" + Ce).indexOf("[native code]") === -1 && (kt = nt = ue);
2956
+ var ye = U.reject, yt = "￿", Xe = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", zr = "String expected.", Ot = [], mn = "__dbnames", Yn = "readonly", Qn = "readwrite";
2957
+ function gt(e, t) {
2949
2958
  return e ? t ? function() {
2950
2959
  return e.apply(this, arguments) && t.apply(this, arguments);
2951
2960
  } : e : t;
2952
2961
  }
2953
2962
  var Vr = { type: 3, lower: -1 / 0, lowerOpen: !1, upper: [[]], upperOpen: !1 };
2954
- function mn(e) {
2963
+ function yn(e) {
2955
2964
  return typeof e != "string" || /\./.test(e) ? function(t) {
2956
2965
  return t;
2957
2966
  } : function(t) {
2958
- return t[e] === void 0 && e in t && delete (t = ke(t))[e], t;
2967
+ return t[e] === void 0 && e in t && delete (t = me(t))[e], t;
2959
2968
  };
2960
2969
  }
2961
2970
  function Xr() {
@@ -2990,20 +2999,20 @@ function sa() {
2990
2999
  }
2991
3000
  function Wr(e) {
2992
3001
  var t = typeof e;
2993
- return t != "object" ? t : ArrayBuffer.isView(e) ? "binary" : (e = Tt(e), e === "ArrayBuffer" ? "binary" : e);
3002
+ return t != "object" ? t : ArrayBuffer.isView(e) ? "binary" : (e = Pe(e), e === "ArrayBuffer" ? "binary" : e);
2994
3003
  }
2995
3004
  function Yr(e) {
2996
3005
  return e instanceof Uint8Array ? e : ArrayBuffer.isView(e) ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : new Uint8Array(e);
2997
3006
  }
2998
3007
  var Qr = (fe.prototype._trans = function(e, t, n) {
2999
- var s = this._tx || z.trans, o = this.name, f = Ke && typeof console < "u" && console.createTask && console.createTask("Dexie: ".concat(e === "readonly" ? "read" : "write", " ").concat(this.name));
3008
+ var s = this._tx || z.trans, o = this.name, f = Be && typeof console < "u" && console.createTask && console.createTask("Dexie: ".concat(e === "readonly" ? "read" : "write", " ").concat(this.name));
3000
3009
  function d(w, T, g) {
3001
3010
  if (!g.schema[o]) throw new V.NotFound("Table " + o + " not part of transaction");
3002
3011
  return t(g.idbtrans, g);
3003
3012
  }
3004
- var m = Rt();
3013
+ var m = St();
3005
3014
  try {
3006
- var v = s && s.db._novip === this.db._novip ? s === z.trans ? s._promise(e, d, n) : et(function() {
3015
+ var v = s && s.db._novip === this.db._novip ? s === z.trans ? s._promise(e, d, n) : tt(function() {
3007
3016
  return s._promise(e, d, n);
3008
3017
  }, { trans: s, transless: z.transless || z }) : function w(T, g, R, b) {
3009
3018
  if (T.idbdb && (T._state.openComplete || z.letThrough || T._vip)) {
@@ -3011,12 +3020,12 @@ function sa() {
3011
3020
  try {
3012
3021
  x.create(), T._state.PR1398_maxLoop = 3;
3013
3022
  } catch (S) {
3014
- return S.name === jn.InvalidState && T.isOpen() && 0 < --T._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), T.close({ disableAutoOpen: !1 }), T.open().then(function() {
3023
+ return S.name === Ke.InvalidState && T.isOpen() && 0 < --T._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), T.close({ disableAutoOpen: !1 }), T.open().then(function() {
3015
3024
  return w(T, g, R, b);
3016
3025
  })) : ye(S);
3017
3026
  }
3018
3027
  return x._promise(g, function(S, A) {
3019
- return et(function() {
3028
+ return tt(function() {
3020
3029
  return z.trans = x, b(S, A, x);
3021
3030
  });
3022
3031
  }).then(function(S) {
@@ -3042,7 +3051,7 @@ function sa() {
3042
3051
  return console.trace(w), ye(w);
3043
3052
  })), v;
3044
3053
  } finally {
3045
- m && kt();
3054
+ m && Rt();
3046
3055
  }
3047
3056
  }, fe.prototype.get = function(e, t) {
3048
3057
  var n = this;
@@ -3067,20 +3076,20 @@ function sa() {
3067
3076
  }).sort(function(m, v) {
3068
3077
  return m.keyPath.length - v.keyPath.length;
3069
3078
  })[0];
3070
- if (n && this.db._maxKey !== pt) {
3079
+ if (n && this.db._maxKey !== yt) {
3071
3080
  var f = n.keyPath.slice(0, t.length);
3072
3081
  return this.where(f).equals(f.map(function(v) {
3073
3082
  return e[v];
3074
3083
  }));
3075
3084
  }
3076
- !n && Ke && console.warn("The query ".concat(JSON.stringify(e), " on ").concat(this.name, " would benefit from a ") + "compound index [".concat(t.join("+"), "]"));
3085
+ !n && Be && console.warn("The query ".concat(JSON.stringify(e), " on ").concat(this.name, " would benefit from a ") + "compound index [".concat(t.join("+"), "]"));
3077
3086
  var s = this.schema.idxByName;
3078
3087
  function o(m, v) {
3079
3088
  return re(m, v) === 0;
3080
3089
  }
3081
3090
  var d = t.reduce(function(g, v) {
3082
3091
  var w = g[0], T = g[1], g = s[v], R = e[v];
3083
- return [w || g, w || !g ? mt(T, g && g.multi ? function(b) {
3092
+ return [w || g, w || !g ? gt(T, g && g.multi ? function(b) {
3084
3093
  return b = ve(b, v), p(b) && b.some(function(x) {
3085
3094
  return o(R, x);
3086
3095
  });
@@ -3142,13 +3151,13 @@ function sa() {
3142
3151
  });
3143
3152
  }, fe.prototype.add = function(e, t) {
3144
3153
  var n = this, s = this.schema.primKey, o = s.auto, f = s.keyPath, d = e;
3145
- return f && o && (d = mn(f)(e)), this._trans("readwrite", function(m) {
3154
+ return f && o && (d = yn(f)(e)), this._trans("readwrite", function(m) {
3146
3155
  return n.core.mutate({ trans: m, type: "add", keys: t != null ? [t] : null, values: [d] });
3147
3156
  }).then(function(m) {
3148
3157
  return m.numFailures ? U.reject(m.failures[0]) : m.lastResult;
3149
3158
  }).then(function(m) {
3150
3159
  if (f) try {
3151
- ce(e, f, m);
3160
+ ae(e, f, m);
3152
3161
  } catch {
3153
3162
  }
3154
3163
  return m;
@@ -3157,13 +3166,13 @@ function sa() {
3157
3166
  return typeof e != "object" || p(e) ? this.where(":id").equals(e).modify(t) : (e = ve(e, this.schema.primKey.keyPath), e === void 0 ? ye(new V.InvalidArgument("Given object does not contain its primary key")) : this.where(":id").equals(e).modify(t));
3158
3167
  }, fe.prototype.put = function(e, t) {
3159
3168
  var n = this, s = this.schema.primKey, o = s.auto, f = s.keyPath, d = e;
3160
- return f && o && (d = mn(f)(e)), this._trans("readwrite", function(m) {
3169
+ return f && o && (d = yn(f)(e)), this._trans("readwrite", function(m) {
3161
3170
  return n.core.mutate({ trans: m, type: "put", values: [d], keys: t != null ? [t] : null });
3162
3171
  }).then(function(m) {
3163
3172
  return m.numFailures ? U.reject(m.failures[0]) : m.lastResult;
3164
3173
  }).then(function(m) {
3165
3174
  if (f) try {
3166
- ce(e, f, m);
3175
+ ae(e, f, m);
3167
3176
  } catch {
3168
3177
  }
3169
3178
  return m;
@@ -3197,11 +3206,11 @@ function sa() {
3197
3206
  var w = s.schema.primKey, m = w.auto, w = w.keyPath;
3198
3207
  if (w && o) throw new V.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
3199
3208
  if (o && o.length !== e.length) throw new V.InvalidArgument("Arguments objects and keys must have the same length");
3200
- var v = e.length, w = w && m ? e.map(mn(w)) : e;
3209
+ var v = e.length, w = w && m ? e.map(yn(w)) : e;
3201
3210
  return s.core.mutate({ trans: d, type: "add", keys: o, values: w, wantResults: f }).then(function(x) {
3202
3211
  var g = x.numFailures, R = x.results, b = x.lastResult, x = x.failures;
3203
3212
  if (g === 0) return f ? R : b;
3204
- throw new St("".concat(s.name, ".bulkAdd(): ").concat(g, " of ").concat(v, " operations failed"), x);
3213
+ throw new je("".concat(s.name, ".bulkAdd(): ").concat(g, " of ").concat(v, " operations failed"), x);
3205
3214
  });
3206
3215
  });
3207
3216
  }, fe.prototype.bulkPut = function(e, t, n) {
@@ -3210,11 +3219,11 @@ function sa() {
3210
3219
  var w = s.schema.primKey, m = w.auto, w = w.keyPath;
3211
3220
  if (w && o) throw new V.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
3212
3221
  if (o && o.length !== e.length) throw new V.InvalidArgument("Arguments objects and keys must have the same length");
3213
- var v = e.length, w = w && m ? e.map(mn(w)) : e;
3222
+ var v = e.length, w = w && m ? e.map(yn(w)) : e;
3214
3223
  return s.core.mutate({ trans: d, type: "put", keys: o, values: w, wantResults: f }).then(function(x) {
3215
3224
  var g = x.numFailures, R = x.results, b = x.lastResult, x = x.failures;
3216
3225
  if (g === 0) return f ? R : b;
3217
- throw new St("".concat(s.name, ".bulkPut(): ").concat(g, " of ").concat(v, " operations failed"), x);
3226
+ throw new je("".concat(s.name, ".bulkPut(): ").concat(g, " of ").concat(v, " operations failed"), x);
3218
3227
  });
3219
3228
  });
3220
3229
  }, fe.prototype.bulkUpdate = function(e) {
@@ -3233,7 +3242,7 @@ function sa() {
3233
3242
  var O = k[A], M = x[O];
3234
3243
  if (O === t.schema.primKey.keyPath) {
3235
3244
  if (re(M, b) !== 0) throw new V.Constraint("Cannot update primary key in bulkUpdate()");
3236
- } else ce(S, O, M);
3245
+ } else ae(S, O, M);
3237
3246
  }
3238
3247
  f.push(R), v.push(b), w.push(S);
3239
3248
  }
@@ -3246,7 +3255,7 @@ function sa() {
3246
3255
  var A, k = S[x], O = f[Number(k)];
3247
3256
  O != null && (A = b[k], delete b[k], b[O] = A);
3248
3257
  }
3249
- throw new St("".concat(t.name, ".bulkUpdate(): ").concat(R, " of ").concat(T, " operations failed"), b);
3258
+ throw new je("".concat(t.name, ".bulkUpdate(): ").concat(R, " of ").concat(T, " operations failed"), b);
3250
3259
  });
3251
3260
  });
3252
3261
  });
@@ -3257,12 +3266,12 @@ function sa() {
3257
3266
  }).then(function(d) {
3258
3267
  var o = d.numFailures, f = d.lastResult, d = d.failures;
3259
3268
  if (o === 0) return f;
3260
- throw new St("".concat(t.name, ".bulkDelete(): ").concat(o, " of ").concat(n, " operations failed"), d);
3269
+ throw new je("".concat(t.name, ".bulkDelete(): ").concat(o, " of ").concat(n, " operations failed"), d);
3261
3270
  });
3262
3271
  }, fe);
3263
3272
  function fe() {
3264
3273
  }
3265
- function Gt(e) {
3274
+ function qt(e) {
3266
3275
  function t(d, m) {
3267
3276
  if (m) {
3268
3277
  for (var v = arguments.length, w = new Array(v - 1); --v; ) w[v - 1] = arguments[v];
@@ -3292,7 +3301,7 @@ function sa() {
3292
3301
  if (p(R)) f(g, w[g][0], w[g][1]);
3293
3302
  else {
3294
3303
  if (R !== "asap") throw new V.InvalidArgument("Invalid event config");
3295
- var b = f(g, jt, function() {
3304
+ var b = f(g, Ft, function() {
3296
3305
  for (var x = arguments.length, S = new Array(x); x--; ) S[x] = arguments[x];
3297
3306
  b.subscribers.forEach(function(A) {
3298
3307
  Ae(function() {
@@ -3304,33 +3313,33 @@ function sa() {
3304
3313
  });
3305
3314
  }
3306
3315
  }
3307
- function Ht(e, t) {
3316
+ function Gt(e, t) {
3308
3317
  return X(t).from({ prototype: e }), t;
3309
3318
  }
3310
- function Pt(e, t) {
3319
+ function Mt(e, t) {
3311
3320
  return !(e.filter || e.algorithm || e.or) && (t ? e.justLimit : !e.replayFilter);
3312
3321
  }
3313
- function Qn(e, t) {
3314
- e.filter = mt(e.filter, t);
3322
+ function $n(e, t) {
3323
+ e.filter = gt(e.filter, t);
3315
3324
  }
3316
- function $n(e, t, n) {
3325
+ function Jn(e, t, n) {
3317
3326
  var s = e.replayFilter;
3318
3327
  e.replayFilter = s ? function() {
3319
- return mt(s(), t());
3328
+ return gt(s(), t());
3320
3329
  } : t, e.justLimit = n && !s;
3321
3330
  }
3322
- function yn(e, t) {
3331
+ function gn(e, t) {
3323
3332
  if (e.isPrimKey) return t.primaryKey;
3324
3333
  var n = t.getIndexByKeyPath(e.index);
3325
3334
  if (!n) throw new V.Schema("KeyPath " + e.index + " on object store " + t.name + " is not indexed");
3326
3335
  return n;
3327
3336
  }
3328
3337
  function $r(e, t, n) {
3329
- var s = yn(e, t.schema);
3338
+ var s = gn(e, t.schema);
3330
3339
  return t.openCursor({ trans: n, values: !e.keysOnly, reverse: e.dir === "prev", unique: !!e.unique, query: { index: s, range: e.range } });
3331
3340
  }
3332
- function gn(e, t, n, s) {
3333
- var o = e.replayFilter ? mt(e.filter, e.replayFilter()) : e.filter;
3341
+ function vn(e, t, n, s) {
3342
+ var o = e.replayFilter ? gt(e.filter, e.replayFilter()) : e.filter;
3334
3343
  if (e.or) {
3335
3344
  var f = {}, d = function(m, v, w) {
3336
3345
  var T, g;
@@ -3342,7 +3351,7 @@ function sa() {
3342
3351
  };
3343
3352
  return Promise.all([e.or._iterate(d, n), Jr($r(e, s, n), e.algorithm, d, !e.keysOnly && e.valueMapper)]);
3344
3353
  }
3345
- return Jr($r(e, s, n), mt(e.algorithm, o), t, !e.keysOnly && e.valueMapper);
3354
+ return Jr($r(e, s, n), gt(e.algorithm, o), t, !e.keysOnly && e.valueMapper);
3346
3355
  }
3347
3356
  function Jr(e, t, n, s) {
3348
3357
  var o = de(s ? function(f, d, m) {
@@ -3365,7 +3374,7 @@ function sa() {
3365
3374
  });
3366
3375
  });
3367
3376
  }
3368
- var zt = (Zr.prototype.execute = function(e) {
3377
+ var Ht = (Zr.prototype.execute = function(e) {
3369
3378
  var t = this["@@propmod"];
3370
3379
  if (t.add !== void 0) {
3371
3380
  var n = t.add;
@@ -3404,9 +3413,9 @@ function sa() {
3404
3413
  return t.error ? t.table._trans(null, ye.bind(null, t.error)) : t.table._trans("readwrite", e, "locked");
3405
3414
  }, ie.prototype._addAlgorithm = function(e) {
3406
3415
  var t = this._ctx;
3407
- t.algorithm = mt(t.algorithm, e);
3416
+ t.algorithm = gt(t.algorithm, e);
3408
3417
  }, ie.prototype._iterate = function(e, t) {
3409
- return gn(this._ctx, e, t, this._ctx.table.core);
3418
+ return vn(this._ctx, e, t, this._ctx.table.core);
3410
3419
  }, ie.prototype.clone = function(e) {
3411
3420
  var t = Object.create(this.constructor.prototype), n = Object.create(this._ctx);
3412
3421
  return e && h(n, e), t._ctx = n, t;
@@ -3415,17 +3424,17 @@ function sa() {
3415
3424
  }, ie.prototype.each = function(e) {
3416
3425
  var t = this._ctx;
3417
3426
  return this._read(function(n) {
3418
- return gn(t, e, n, t.table.core);
3427
+ return vn(t, e, n, t.table.core);
3419
3428
  });
3420
3429
  }, ie.prototype.count = function(e) {
3421
3430
  var t = this;
3422
3431
  return this._read(function(n) {
3423
3432
  var s = t._ctx, o = s.table.core;
3424
- if (Pt(s, !0)) return o.count({ trans: n, query: { index: yn(s, o.schema), range: s.range } }).then(function(d) {
3433
+ if (Mt(s, !0)) return o.count({ trans: n, query: { index: gn(s, o.schema), range: s.range } }).then(function(d) {
3425
3434
  return Math.min(d, s.limit);
3426
3435
  });
3427
3436
  var f = 0;
3428
- return gn(s, function() {
3437
+ return vn(s, function() {
3429
3438
  return ++f, !1;
3430
3439
  }, n, o).then(function() {
3431
3440
  return f;
@@ -3447,14 +3456,14 @@ function sa() {
3447
3456
  var t = this;
3448
3457
  return this._read(function(n) {
3449
3458
  var s = t._ctx;
3450
- if (s.dir === "next" && Pt(s, !0) && 0 < s.limit) {
3451
- var o = s.valueMapper, f = yn(s, s.table.core.schema);
3459
+ if (s.dir === "next" && Mt(s, !0) && 0 < s.limit) {
3460
+ var o = s.valueMapper, f = gn(s, s.table.core.schema);
3452
3461
  return s.table.core.query({ trans: n, limit: s.limit, values: !0, query: { index: f, range: s.range } }).then(function(m) {
3453
3462
  return m = m.result, o ? m.map(o) : m;
3454
3463
  });
3455
3464
  }
3456
3465
  var d = [];
3457
- return gn(s, function(m) {
3466
+ return vn(s, function(m) {
3458
3467
  return d.push(m);
3459
3468
  }, n, s.table.core).then(function() {
3460
3469
  return d;
@@ -3462,28 +3471,28 @@ function sa() {
3462
3471
  }, e);
3463
3472
  }, ie.prototype.offset = function(e) {
3464
3473
  var t = this._ctx;
3465
- return e <= 0 || (t.offset += e, Pt(t) ? $n(t, function() {
3474
+ return e <= 0 || (t.offset += e, Mt(t) ? Jn(t, function() {
3466
3475
  var n = e;
3467
3476
  return function(s, o) {
3468
3477
  return n === 0 || (n === 1 ? --n : o(function() {
3469
3478
  s.advance(n), n = 0;
3470
3479
  }), !1);
3471
3480
  };
3472
- }) : $n(t, function() {
3481
+ }) : Jn(t, function() {
3473
3482
  var n = e;
3474
3483
  return function() {
3475
3484
  return --n < 0;
3476
3485
  };
3477
3486
  })), this;
3478
3487
  }, ie.prototype.limit = function(e) {
3479
- return this._ctx.limit = Math.min(this._ctx.limit, e), $n(this._ctx, function() {
3488
+ return this._ctx.limit = Math.min(this._ctx.limit, e), Jn(this._ctx, function() {
3480
3489
  var t = e;
3481
3490
  return function(n, s, o) {
3482
3491
  return --t <= 0 && s(o), 0 <= t;
3483
3492
  };
3484
3493
  }, !0), this;
3485
3494
  }, ie.prototype.until = function(e, t) {
3486
- return Qn(this._ctx, function(n, s, o) {
3495
+ return $n(this._ctx, function(n, s, o) {
3487
3496
  return !e(n.value) || (s(o), t);
3488
3497
  }), this;
3489
3498
  }, ie.prototype.first = function(e) {
@@ -3494,9 +3503,9 @@ function sa() {
3494
3503
  return this.reverse().first(e);
3495
3504
  }, ie.prototype.filter = function(e) {
3496
3505
  var t;
3497
- return Qn(this._ctx, function(n) {
3506
+ return $n(this._ctx, function(n) {
3498
3507
  return e(n.value);
3499
- }), (t = this._ctx).isMatch = mt(t.isMatch, e), this;
3508
+ }), (t = this._ctx).isMatch = gt(t.isMatch, e), this;
3500
3509
  }, ie.prototype.and = function(e) {
3501
3510
  return this.filter(e);
3502
3511
  }, ie.prototype.or = function(e) {
@@ -3528,8 +3537,8 @@ function sa() {
3528
3537
  }).then(e);
3529
3538
  }, ie.prototype.primaryKeys = function(e) {
3530
3539
  var t = this._ctx;
3531
- if (t.dir === "next" && Pt(t, !0) && 0 < t.limit) return this._read(function(s) {
3532
- var o = yn(t, t.table.core.schema);
3540
+ if (t.dir === "next" && Mt(t, !0) && 0 < t.limit) return this._read(function(s) {
3541
+ var o = gn(t, t.table.core.schema);
3533
3542
  return t.table.core.query({ trans: s, values: !1, limit: t.limit, query: { index: o, range: t.range } });
3534
3543
  }).then(function(s) {
3535
3544
  return s.result;
@@ -3553,7 +3562,7 @@ function sa() {
3553
3562
  var e = this._ctx, e = e.index && e.table.schema.idxByName[e.index];
3554
3563
  if (!e || !e.multi) return this;
3555
3564
  var t = {};
3556
- return Qn(this._ctx, function(o) {
3565
+ return $n(this._ctx, function(o) {
3557
3566
  var s = o.primaryKey.toString(), o = _(t, s);
3558
3567
  return t[s] = !0, !o;
3559
3568
  }), this;
@@ -3564,7 +3573,7 @@ function sa() {
3564
3573
  d = typeof e == "function" ? e : (o = l(e), f = o.length, function(A) {
3565
3574
  for (var k = !1, O = 0; O < f; ++O) {
3566
3575
  var M = o[O], I = e[M], D = ve(A, M);
3567
- I instanceof zt ? (ce(A, M, I.execute(D)), k = !0) : D !== I && (ce(A, M, I), k = !0);
3576
+ I instanceof Ht ? (ae(A, M, I.execute(D)), k = !0) : D !== I && (ae(A, M, I), k = !0);
3568
3577
  }
3569
3578
  return k;
3570
3579
  });
@@ -3584,8 +3593,8 @@ function sa() {
3584
3593
  var I = Math.min(T, A.length - M);
3585
3594
  return m.getMany({ trans: s, keys: A.slice(M, M + I), cache: "immutable" }).then(function(D) {
3586
3595
  for (var K = [], N = [], F = v ? [] : null, B = [], j = 0; j < I; ++j) {
3587
- var G = D[j], $ = { value: ke(G), primKey: A[M + j] };
3588
- d.call($, $.value, $) !== !1 && ($.value == null ? B.push(A[M + j]) : v || re(w(G), w($.value)) === 0 ? (N.push($.value), v && F.push(A[M + j])) : (B.push(A[M + j]), K.push($.value)));
3596
+ var G = D[j], J = { value: me(G), primKey: A[M + j] };
3597
+ d.call(J, J.value, J) !== !1 && (J.value == null ? B.push(A[M + j]) : v || re(w(G), w(J.value)) === 0 ? (N.push(J.value), v && F.push(A[M + j])) : (B.push(A[M + j]), K.push(J.value)));
3589
3598
  }
3590
3599
  return Promise.resolve(0 < K.length && m.mutate({ trans: s, type: "add", values: K }).then(function(ee) {
3591
3600
  for (var te in ee.failures) B.splice(parseInt(te), 1);
@@ -3595,7 +3604,7 @@ function sa() {
3595
3604
  return R(N.length, ee);
3596
3605
  });
3597
3606
  }).then(function() {
3598
- return (0 < B.length || O && e === Jn) && m.mutate({ trans: s, type: "delete", keys: B, criteria: O, isAdditionalChunk: 0 < M }).then(function(ee) {
3607
+ return (0 < B.length || O && e === Zn) && m.mutate({ trans: s, type: "delete", keys: B, criteria: O, isAdditionalChunk: 0 < M }).then(function(ee) {
3599
3608
  return R(B.length, ee);
3600
3609
  });
3601
3610
  }).then(function() {
@@ -3603,31 +3612,31 @@ function sa() {
3603
3612
  });
3604
3613
  });
3605
3614
  }
3606
- var O = Pt(n) && n.limit === 1 / 0 && (typeof e != "function" || e === Jn) && { index: n.index, range: n.range };
3615
+ var O = Mt(n) && n.limit === 1 / 0 && (typeof e != "function" || e === Zn) && { index: n.index, range: n.range };
3607
3616
  return k(0).then(function() {
3608
- if (0 < b.length) throw new rn("Error modifying one or more objects", b, x, S);
3617
+ if (0 < b.length) throw new Nt("Error modifying one or more objects", b, x, S);
3609
3618
  return A.length;
3610
3619
  });
3611
3620
  });
3612
3621
  });
3613
3622
  }, ie.prototype.delete = function() {
3614
3623
  var e = this._ctx, t = e.range;
3615
- return Pt(e) && (e.isPrimKey || t.type === 3) ? this._write(function(n) {
3624
+ return Mt(e) && (e.isPrimKey || t.type === 3) ? this._write(function(n) {
3616
3625
  var s = e.table.core.schema.primaryKey, o = t;
3617
3626
  return e.table.core.count({ trans: n, query: { index: s, range: o } }).then(function(f) {
3618
3627
  return e.table.core.mutate({ trans: n, type: "deleteRange", range: o }).then(function(d) {
3619
3628
  var m = d.failures;
3620
- if (d.lastResult, d.results, d = d.numFailures, d) throw new rn("Could not delete some values", Object.keys(m).map(function(v) {
3629
+ if (d.lastResult, d.results, d = d.numFailures, d) throw new Nt("Could not delete some values", Object.keys(m).map(function(v) {
3621
3630
  return m[v];
3622
3631
  }), f - d);
3623
3632
  return f - d;
3624
3633
  });
3625
3634
  });
3626
- }) : this.modify(Jn);
3635
+ }) : this.modify(Zn);
3627
3636
  }, ie);
3628
3637
  function ie() {
3629
3638
  }
3630
- var Jn = function(e, t) {
3639
+ var Zn = function(e, t) {
3631
3640
  return t.value = null;
3632
3641
  };
3633
3642
  function oi(e, t) {
@@ -3636,19 +3645,19 @@ function sa() {
3636
3645
  function ai(e, t) {
3637
3646
  return t < e ? -1 : e === t ? 0 : 1;
3638
3647
  }
3639
- function Oe(e, t, n) {
3648
+ function ke(e, t, n) {
3640
3649
  return e = e instanceof ts ? new e.Collection(e) : e, e._ctx.error = new (n || TypeError)(t), e;
3641
3650
  }
3642
- function Ct(e) {
3651
+ function Pt(e) {
3643
3652
  return new e.Collection(e, function() {
3644
3653
  return es("");
3645
3654
  }).limit(0);
3646
3655
  }
3647
- function vn(e, t, n, s) {
3656
+ function bn(e, t, n, s) {
3648
3657
  var o, f, d, m, v, w, T, g = n.length;
3649
3658
  if (!n.every(function(x) {
3650
3659
  return typeof x == "string";
3651
- })) return Oe(e, zr);
3660
+ })) return ke(e, zr);
3652
3661
  function R(x) {
3653
3662
  o = x === "next" ? function(A) {
3654
3663
  return A.toUpperCase();
@@ -3671,7 +3680,7 @@ function sa() {
3671
3680
  }), T = (w = x) === "next" ? "" : s;
3672
3681
  }
3673
3682
  R("next"), e = new e.Collection(e, function() {
3674
- return rt(m[0], v[g - 1] + s);
3683
+ return st(m[0], v[g - 1] + s);
3675
3684
  }), e._ondirectionchange = function(x) {
3676
3685
  R(x);
3677
3686
  };
@@ -3683,12 +3692,12 @@ function sa() {
3683
3692
  if (t(O, v, b)) return !0;
3684
3693
  for (var M = null, I = b; I < g; ++I) {
3685
3694
  var D = function(K, N, F, B, j, G) {
3686
- for (var $ = Math.min(K.length, B.length), ee = -1, te = 0; te < $; ++te) {
3687
- var Me = N[te];
3688
- if (Me !== B[te]) return j(K[te], F[te]) < 0 ? K.substr(0, te) + F[te] + F.substr(te + 1) : j(K[te], B[te]) < 0 ? K.substr(0, te) + B[te] + F.substr(te + 1) : 0 <= ee ? K.substr(0, ee) + N[ee] + F.substr(ee + 1) : null;
3689
- j(K[te], Me) < 0 && (ee = te);
3695
+ for (var J = Math.min(K.length, B.length), ee = -1, te = 0; te < J; ++te) {
3696
+ var Oe = N[te];
3697
+ if (Oe !== B[te]) return j(K[te], F[te]) < 0 ? K.substr(0, te) + F[te] + F.substr(te + 1) : j(K[te], B[te]) < 0 ? K.substr(0, te) + B[te] + F.substr(te + 1) : 0 <= ee ? K.substr(0, ee) + N[ee] + F.substr(ee + 1) : null;
3698
+ j(K[te], Oe) < 0 && (ee = te);
3690
3699
  }
3691
- return $ < B.length && G === "next" ? K + F.substr(K.length) : $ < K.length && G === "prev" ? K.substr(0, F.length) : ee < 0 ? null : K.substr(0, ee) + B[ee] + F.substr(ee + 1);
3700
+ return J < B.length && G === "next" ? K + F.substr(K.length) : J < K.length && G === "prev" ? K.substr(0, F.length) : ee < 0 ? null : K.substr(0, ee) + B[ee] + F.substr(ee + 1);
3692
3701
  }(k, O, m[I], v[I], d, w);
3693
3702
  D === null && M === null ? b = I + 1 : (M === null || 0 < d(M, D)) && (M = D);
3694
3703
  }
@@ -3697,7 +3706,7 @@ function sa() {
3697
3706
  } : A), !1;
3698
3707
  }), e;
3699
3708
  }
3700
- function rt(e, t, n, s) {
3709
+ function st(e, t, n, s) {
3701
3710
  return { type: 2, lower: e, upper: t, lowerOpen: n, upperOpen: s };
3702
3711
  }
3703
3712
  function es(e) {
@@ -3708,64 +3717,64 @@ function sa() {
3708
3717
  }, enumerable: !1, configurable: !0 }), _e.prototype.between = function(e, t, n, s) {
3709
3718
  n = n !== !1, s = s === !0;
3710
3719
  try {
3711
- return 0 < this._cmp(e, t) || this._cmp(e, t) === 0 && (n || s) && (!n || !s) ? Ct(this) : new this.Collection(this, function() {
3712
- return rt(e, t, !n, !s);
3720
+ return 0 < this._cmp(e, t) || this._cmp(e, t) === 0 && (n || s) && (!n || !s) ? Pt(this) : new this.Collection(this, function() {
3721
+ return st(e, t, !n, !s);
3713
3722
  });
3714
3723
  } catch {
3715
- return Oe(this, Ve);
3724
+ return ke(this, Xe);
3716
3725
  }
3717
3726
  }, _e.prototype.equals = function(e) {
3718
- return e == null ? Oe(this, Ve) : new this.Collection(this, function() {
3727
+ return e == null ? ke(this, Xe) : new this.Collection(this, function() {
3719
3728
  return es(e);
3720
3729
  });
3721
3730
  }, _e.prototype.above = function(e) {
3722
- return e == null ? Oe(this, Ve) : new this.Collection(this, function() {
3723
- return rt(e, void 0, !0);
3731
+ return e == null ? ke(this, Xe) : new this.Collection(this, function() {
3732
+ return st(e, void 0, !0);
3724
3733
  });
3725
3734
  }, _e.prototype.aboveOrEqual = function(e) {
3726
- return e == null ? Oe(this, Ve) : new this.Collection(this, function() {
3727
- return rt(e, void 0, !1);
3735
+ return e == null ? ke(this, Xe) : new this.Collection(this, function() {
3736
+ return st(e, void 0, !1);
3728
3737
  });
3729
3738
  }, _e.prototype.below = function(e) {
3730
- return e == null ? Oe(this, Ve) : new this.Collection(this, function() {
3731
- return rt(void 0, e, !1, !0);
3739
+ return e == null ? ke(this, Xe) : new this.Collection(this, function() {
3740
+ return st(void 0, e, !1, !0);
3732
3741
  });
3733
3742
  }, _e.prototype.belowOrEqual = function(e) {
3734
- return e == null ? Oe(this, Ve) : new this.Collection(this, function() {
3735
- return rt(void 0, e);
3743
+ return e == null ? ke(this, Xe) : new this.Collection(this, function() {
3744
+ return st(void 0, e);
3736
3745
  });
3737
3746
  }, _e.prototype.startsWith = function(e) {
3738
- return typeof e != "string" ? Oe(this, zr) : this.between(e, e + pt, !0, !0);
3747
+ return typeof e != "string" ? ke(this, zr) : this.between(e, e + yt, !0, !0);
3739
3748
  }, _e.prototype.startsWithIgnoreCase = function(e) {
3740
- return e === "" ? this.startsWith(e) : vn(this, function(t, n) {
3749
+ return e === "" ? this.startsWith(e) : bn(this, function(t, n) {
3741
3750
  return t.indexOf(n[0]) === 0;
3742
- }, [e], pt);
3751
+ }, [e], yt);
3743
3752
  }, _e.prototype.equalsIgnoreCase = function(e) {
3744
- return vn(this, function(t, n) {
3753
+ return bn(this, function(t, n) {
3745
3754
  return t === n[0];
3746
3755
  }, [e], "");
3747
3756
  }, _e.prototype.anyOfIgnoreCase = function() {
3748
- var e = De.apply(Je, arguments);
3749
- return e.length === 0 ? Ct(this) : vn(this, function(t, n) {
3757
+ var e = xe.apply(Ve, arguments);
3758
+ return e.length === 0 ? Pt(this) : bn(this, function(t, n) {
3750
3759
  return n.indexOf(t) !== -1;
3751
3760
  }, e, "");
3752
3761
  }, _e.prototype.startsWithAnyOfIgnoreCase = function() {
3753
- var e = De.apply(Je, arguments);
3754
- return e.length === 0 ? Ct(this) : vn(this, function(t, n) {
3762
+ var e = xe.apply(Ve, arguments);
3763
+ return e.length === 0 ? Pt(this) : bn(this, function(t, n) {
3755
3764
  return n.some(function(s) {
3756
3765
  return t.indexOf(s) === 0;
3757
3766
  });
3758
- }, e, pt);
3767
+ }, e, yt);
3759
3768
  }, _e.prototype.anyOf = function() {
3760
- var e = this, t = De.apply(Je, arguments), n = this._cmp;
3769
+ var e = this, t = xe.apply(Ve, arguments), n = this._cmp;
3761
3770
  try {
3762
3771
  t.sort(n);
3763
3772
  } catch {
3764
- return Oe(this, Ve);
3773
+ return ke(this, Xe);
3765
3774
  }
3766
- if (t.length === 0) return Ct(this);
3775
+ if (t.length === 0) return Pt(this);
3767
3776
  var s = new this.Collection(this, function() {
3768
- return rt(t[0], t[t.length - 1]);
3777
+ return st(t[0], t[t.length - 1]);
3769
3778
  });
3770
3779
  s._ondirectionchange = function(f) {
3771
3780
  n = f === "next" ? e._ascending : e._descending, t.sort(n);
@@ -3780,12 +3789,12 @@ function sa() {
3780
3789
  }, _e.prototype.notEqual = function(e) {
3781
3790
  return this.inAnyRange([[-1 / 0, e], [e, this.db._maxKey]], { includeLowers: !1, includeUppers: !1 });
3782
3791
  }, _e.prototype.noneOf = function() {
3783
- var e = De.apply(Je, arguments);
3792
+ var e = xe.apply(Ve, arguments);
3784
3793
  if (e.length === 0) return new this.Collection(this);
3785
3794
  try {
3786
3795
  e.sort(this._ascending);
3787
3796
  } catch {
3788
- return Oe(this, Ve);
3797
+ return ke(this, Xe);
3789
3798
  }
3790
3799
  var t = e.reduce(function(n, s) {
3791
3800
  return n ? n.concat([[n[n.length - 1][1], s]]) : [[-1 / 0, s]];
@@ -3793,10 +3802,10 @@ function sa() {
3793
3802
  return t.push([e[e.length - 1], this.db._maxKey]), this.inAnyRange(t, { includeLowers: !1, includeUppers: !1 });
3794
3803
  }, _e.prototype.inAnyRange = function(k, t) {
3795
3804
  var n = this, s = this._cmp, o = this._ascending, f = this._descending, d = this._min, m = this._max;
3796
- if (k.length === 0) return Ct(this);
3805
+ if (k.length === 0) return Pt(this);
3797
3806
  if (!k.every(function(O) {
3798
3807
  return O[0] !== void 0 && O[1] !== void 0 && o(O[0], O[1]) <= 0;
3799
- })) return Oe(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", V.InvalidArgument);
3808
+ })) 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", V.InvalidArgument);
3800
3809
  var v = !t || t.includeLowers !== !1, w = t && t.includeUppers === !0, T, g = o;
3801
3810
  function R(O, M) {
3802
3811
  return g(O[0], M[0]);
@@ -3813,7 +3822,7 @@ function sa() {
3813
3822
  return I === D && O.push(M), O;
3814
3823
  }, [])).sort(R);
3815
3824
  } catch {
3816
- return Oe(this, Ve);
3825
+ return ke(this, Xe);
3817
3826
  }
3818
3827
  var b = 0, x = w ? function(O) {
3819
3828
  return 0 < o(O, T[b][1]);
@@ -3824,7 +3833,7 @@ function sa() {
3824
3833
  } : function(O) {
3825
3834
  return 0 <= f(O, T[b][0]);
3826
3835
  }, A = x, k = new this.Collection(this, function() {
3827
- return rt(T[0][0], T[T.length - 1][1], !v, !w);
3836
+ return st(T[0][0], T[T.length - 1][1], !v, !w);
3828
3837
  });
3829
3838
  return k._ondirectionchange = function(O) {
3830
3839
  g = O === "next" ? (A = x, o) : (A = S, f), T.sort(R);
@@ -3835,41 +3844,41 @@ function sa() {
3835
3844
  }), !1);
3836
3845
  }), k;
3837
3846
  }, _e.prototype.startsWithAnyOf = function() {
3838
- var e = De.apply(Je, arguments);
3847
+ var e = xe.apply(Ve, arguments);
3839
3848
  return e.every(function(t) {
3840
3849
  return typeof t == "string";
3841
- }) ? e.length === 0 ? Ct(this) : this.inAnyRange(e.map(function(t) {
3842
- return [t, t + pt];
3843
- })) : Oe(this, "startsWithAnyOf() only works with strings");
3850
+ }) ? e.length === 0 ? Pt(this) : this.inAnyRange(e.map(function(t) {
3851
+ return [t, t + yt];
3852
+ })) : ke(this, "startsWithAnyOf() only works with strings");
3844
3853
  }, _e);
3845
3854
  function _e() {
3846
3855
  }
3847
- function Be(e) {
3856
+ function Ue(e) {
3848
3857
  return de(function(t) {
3849
- return Vt(t), e(t.target.error), !1;
3858
+ return zt(t), e(t.target.error), !1;
3850
3859
  });
3851
3860
  }
3852
- function Vt(e) {
3861
+ function zt(e) {
3853
3862
  e.stopPropagation && e.stopPropagation(), e.preventDefault && e.preventDefault();
3854
3863
  }
3855
- var Xt = "storagemutated", Zn = "x-storagemutated-1", st = Gt(null, Xt), ui = (Ue.prototype._lock = function() {
3856
- return J(!z.global), ++this._reculock, this._reculock !== 1 || z.global || (z.lockOwnerFor = this), this;
3857
- }, Ue.prototype._unlock = function() {
3858
- if (J(!z.global), --this._reculock == 0) for (z.global || (z.lockOwnerFor = null); 0 < this._blockedFuncs.length && !this._locked(); ) {
3864
+ var Vt = "storagemutated", er = "x-storagemutated-1", it = qt(null, Vt), ui = (qe.prototype._lock = function() {
3865
+ return Y(!z.global), ++this._reculock, this._reculock !== 1 || z.global || (z.lockOwnerFor = this), this;
3866
+ }, qe.prototype._unlock = function() {
3867
+ if (Y(!z.global), --this._reculock == 0) for (z.global || (z.lockOwnerFor = null); 0 < this._blockedFuncs.length && !this._locked(); ) {
3859
3868
  var e = this._blockedFuncs.shift();
3860
3869
  try {
3861
- dt(e[1], e[0]);
3870
+ mt(e[1], e[0]);
3862
3871
  } catch {
3863
3872
  }
3864
3873
  }
3865
3874
  return this;
3866
- }, Ue.prototype._locked = function() {
3875
+ }, qe.prototype._locked = function() {
3867
3876
  return this._reculock && z.lockOwnerFor !== this;
3868
- }, Ue.prototype.create = function(e) {
3877
+ }, qe.prototype.create = function(e) {
3869
3878
  var t = this;
3870
3879
  if (!this.mode) return this;
3871
3880
  var n = this.db.idbdb, s = this.db._state.dbOpenError;
3872
- if (J(!this.idbtrans), !e && !n) switch (s && s.name) {
3881
+ if (Y(!this.idbtrans), !e && !n) switch (s && s.name) {
3873
3882
  case "DatabaseClosedError":
3874
3883
  throw new V.DatabaseClosed(s);
3875
3884
  case "MissingAPIError":
@@ -3878,14 +3887,14 @@ function sa() {
3878
3887
  throw new V.OpenFailed(s);
3879
3888
  }
3880
3889
  if (!this.active) throw new V.TransactionInactive();
3881
- return J(this._completion._state === null), (e = this.idbtrans = e || (this.db.core || n).transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability })).onerror = de(function(o) {
3882
- Vt(o), t._reject(e.error);
3890
+ return Y(this._completion._state === null), (e = this.idbtrans = e || (this.db.core || n).transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability })).onerror = de(function(o) {
3891
+ zt(o), t._reject(e.error);
3883
3892
  }), e.onabort = de(function(o) {
3884
- Vt(o), t.active && t._reject(new V.Abort(e.error)), t.active = !1, t.on("abort").fire(o);
3893
+ zt(o), t.active && t._reject(new V.Abort(e.error)), t.active = !1, t.on("abort").fire(o);
3885
3894
  }), e.oncomplete = de(function() {
3886
- t.active = !1, t._resolve(), "mutatedParts" in e && st.storagemutated.fire(e.mutatedParts);
3895
+ t.active = !1, t._resolve(), "mutatedParts" in e && it.storagemutated.fire(e.mutatedParts);
3887
3896
  }), this;
3888
- }, Ue.prototype._promise = function(e, t, n) {
3897
+ }, qe.prototype._promise = function(e, t, n) {
3889
3898
  var s = this;
3890
3899
  if (e === "readwrite" && this.mode !== "readwrite") return ye(new V.ReadOnly("Transaction is readonly"));
3891
3900
  if (!this.active) return ye(new V.TransactionInactive());
@@ -3894,7 +3903,7 @@ function sa() {
3894
3903
  s._promise(e, t, n).then(f, d);
3895
3904
  }, z]);
3896
3905
  });
3897
- if (n) return et(function() {
3906
+ if (n) return tt(function() {
3898
3907
  var f = new U(function(d, m) {
3899
3908
  s._lock();
3900
3909
  var v = t(d, m, s);
@@ -3909,9 +3918,9 @@ function sa() {
3909
3918
  m && m.then && m.then(f, d);
3910
3919
  });
3911
3920
  return o._lib = !0, o;
3912
- }, Ue.prototype._root = function() {
3921
+ }, qe.prototype._root = function() {
3913
3922
  return this.parent ? this.parent._root() : this;
3914
- }, Ue.prototype.waitFor = function(e) {
3923
+ }, qe.prototype.waitFor = function(e) {
3915
3924
  var t, n = this._root(), s = U.resolve(e);
3916
3925
  n._waitingFor ? n._waitingFor = n._waitingFor.then(function() {
3917
3926
  return s;
@@ -3929,24 +3938,24 @@ function sa() {
3929
3938
  n._waitingFor === o && (n._waitingFor = null);
3930
3939
  });
3931
3940
  });
3932
- }, Ue.prototype.abort = function() {
3941
+ }, qe.prototype.abort = function() {
3933
3942
  this.active && (this.active = !1, this.idbtrans && this.idbtrans.abort(), this._reject(new V.Abort()));
3934
- }, Ue.prototype.table = function(e) {
3943
+ }, qe.prototype.table = function(e) {
3935
3944
  var t = this._memoizedTables || (this._memoizedTables = {});
3936
3945
  if (_(t, e)) return t[e];
3937
3946
  var n = this.schema[e];
3938
3947
  if (!n) throw new V.NotFound("Table " + e + " not part of transaction");
3939
3948
  return n = new this.db.Table(e, n, this), n.core = this.db.core.table(e), t[e] = n;
3940
- }, Ue);
3941
- function Ue() {
3949
+ }, qe);
3950
+ function qe() {
3942
3951
  }
3943
- function er(e, t, n, s, o, f, d) {
3952
+ function tr(e, t, n, s, o, f, d) {
3944
3953
  return { name: e, keyPath: t, unique: n, multi: s, auto: o, compound: f, src: (n && !d ? "&" : "") + (s ? "*" : "") + (o ? "++" : "") + ns(t) };
3945
3954
  }
3946
3955
  function ns(e) {
3947
3956
  return typeof e == "string" ? e : e ? "[" + [].join.call(e, "+") + "]" : "";
3948
3957
  }
3949
- function tr(e, t, n) {
3958
+ function nr(e, t, n) {
3950
3959
  return { name: e, primKey: t, indexes: n, mappedClass: null, idxByName: (s = function(o) {
3951
3960
  return [o.name, o];
3952
3961
  }, n.reduce(function(o, f, d) {
@@ -3954,18 +3963,18 @@ function sa() {
3954
3963
  }, {})) };
3955
3964
  var s;
3956
3965
  }
3957
- var Wt = function(e) {
3966
+ var Xt = function(e) {
3958
3967
  try {
3959
- return e.only([[]]), Wt = function() {
3968
+ return e.only([[]]), Xt = function() {
3960
3969
  return [[]];
3961
3970
  }, [[]];
3962
3971
  } catch {
3963
- return Wt = function() {
3964
- return pt;
3965
- }, pt;
3972
+ return Xt = function() {
3973
+ return yt;
3974
+ }, yt;
3966
3975
  }
3967
3976
  };
3968
- function nr(e) {
3977
+ function rr(e) {
3969
3978
  return e == null ? function() {
3970
3979
  } : typeof e == "string" ? (t = e).split(".").length === 1 ? function(n) {
3971
3980
  return n[t];
@@ -3980,7 +3989,7 @@ function sa() {
3980
3989
  return [].slice.call(e);
3981
3990
  }
3982
3991
  var ci = 0;
3983
- function Yt(e) {
3992
+ function Wt(e) {
3984
3993
  return e == null ? ":id" : typeof e == "string" ? e : "[".concat(e.join("+"), "]");
3985
3994
  }
3986
3995
  function li(e, t, v) {
@@ -4001,28 +4010,28 @@ function sa() {
4001
4010
  var j, G = (O || M || { length: 1 }).length;
4002
4011
  if (O && M && O.length !== M.length) throw new Error("Given keys array must have same length as given values array.");
4003
4012
  if (G === 0) return D({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
4004
- function $(Se) {
4005
- ++Me, Vt(Se);
4013
+ function J(Re) {
4014
+ ++Oe, zt(Re);
4006
4015
  }
4007
- var ee = [], te = [], Me = 0;
4016
+ var ee = [], te = [], Oe = 0;
4008
4017
  if (k === "deleteRange") {
4009
- if (I.type === 4) return D({ numFailures: Me, failures: te, results: [], lastResult: void 0 });
4018
+ if (I.type === 4) return D({ numFailures: Oe, failures: te, results: [], lastResult: void 0 });
4010
4019
  I.type === 3 ? ee.push(j = N.clear()) : ee.push(j = N.delete(s(I)));
4011
4020
  } else {
4012
- var F = B ? F ? [M, O] : [M, null] : [O, null], Y = F[0], Te = F[1];
4013
- if (B) for (var Ee = 0; Ee < G; ++Ee) ee.push(j = Te && Te[Ee] !== void 0 ? N[k](Y[Ee], Te[Ee]) : N[k](Y[Ee])), j.onerror = $;
4014
- else for (Ee = 0; Ee < G; ++Ee) ee.push(j = N[k](Y[Ee])), j.onerror = $;
4021
+ var F = B ? F ? [M, O] : [M, null] : [O, null], Q = F[0], Ee = F[1];
4022
+ if (B) for (var Se = 0; Se < G; ++Se) ee.push(j = Ee && Ee[Se] !== void 0 ? N[k](Q[Se], Ee[Se]) : N[k](Q[Se])), j.onerror = J;
4023
+ else for (Se = 0; Se < G; ++Se) ee.push(j = N[k](Q[Se])), j.onerror = J;
4015
4024
  }
4016
- function Pn(Se) {
4017
- Se = Se.target.result, ee.forEach(function(vt, wr) {
4018
- return vt.error != null && (te[wr] = vt.error);
4019
- }), D({ numFailures: Me, failures: te, results: k === "delete" ? O : ee.map(function(vt) {
4020
- return vt.result;
4021
- }), lastResult: Se });
4025
+ function Cn(Re) {
4026
+ Re = Re.target.result, ee.forEach(function(wt, _r) {
4027
+ return wt.error != null && (te[_r] = wt.error);
4028
+ }), D({ numFailures: Oe, failures: te, results: k === "delete" ? O : ee.map(function(wt) {
4029
+ return wt.result;
4030
+ }), lastResult: Re });
4022
4031
  }
4023
- j.onerror = function(Se) {
4024
- $(Se), Pn(Se);
4025
- }, j.onsuccess = Pn;
4032
+ j.onerror = function(Re) {
4033
+ J(Re), Cn(Re);
4034
+ }, j.onsuccess = Cn;
4026
4035
  });
4027
4036
  }, getMany: function(S) {
4028
4037
  var A = S.trans, k = S.keys;
@@ -4030,7 +4039,7 @@ function sa() {
4030
4039
  O = de(O);
4031
4040
  for (var I, D = A.objectStore(x), K = k.length, N = new Array(K), F = 0, B = 0, j = function(ee) {
4032
4041
  ee = ee.target, N[ee._pos] = ee.result, ++B === F && O(N);
4033
- }, G = Be(M), $ = 0; $ < K; ++$) k[$] != null && ((I = D.get(k[$]))._pos = $, I.onsuccess = j, I.onerror = G, ++F);
4042
+ }, G = Ue(M), J = 0; J < K; ++J) k[J] != null && ((I = D.get(k[J]))._pos = J, I.onsuccess = j, I.onerror = G, ++F);
4034
4043
  F === 0 && O(N);
4035
4044
  });
4036
4045
  }, get: function(S) {
@@ -4040,7 +4049,7 @@ function sa() {
4040
4049
  var I = A.objectStore(x).get(k);
4041
4050
  I.onsuccess = function(D) {
4042
4051
  return O(D.target.result);
4043
- }, I.onerror = Be(M);
4052
+ }, I.onerror = Ue(M);
4044
4053
  });
4045
4054
  }, query: (b = w, function(S) {
4046
4055
  return new Promise(function(A, k) {
@@ -4049,49 +4058,49 @@ function sa() {
4049
4058
  if (K === 0) return A({ result: [] });
4050
4059
  b ? ((N = D ? B.getAll(j, N) : B.getAllKeys(j, N)).onsuccess = function(G) {
4051
4060
  return A({ result: G.target.result });
4052
- }, N.onerror = Be(k)) : (O = 0, M = !D && "openKeyCursor" in B ? B.openKeyCursor(j) : B.openCursor(j), I = [], M.onsuccess = function(G) {
4053
- var $ = M.result;
4054
- return $ ? (I.push(D ? $.value : $.primaryKey), ++O === K ? A({ result: I }) : void $.continue()) : A({ result: I });
4055
- }, M.onerror = Be(k));
4061
+ }, N.onerror = Ue(k)) : (O = 0, M = !D && "openKeyCursor" in B ? B.openKeyCursor(j) : B.openCursor(j), I = [], M.onsuccess = function(G) {
4062
+ var J = M.result;
4063
+ return J ? (I.push(D ? J.value : J.primaryKey), ++O === K ? A({ result: I }) : void J.continue()) : A({ result: I });
4064
+ }, M.onerror = Ue(k));
4056
4065
  });
4057
4066
  }), openCursor: function(S) {
4058
4067
  var A = S.trans, k = S.values, O = S.query, M = S.reverse, I = S.unique;
4059
4068
  return new Promise(function(D, K) {
4060
4069
  D = de(D);
4061
4070
  var B = O.index, N = O.range, F = A.objectStore(x), F = B.isPrimaryKey ? F : F.index(B.name), B = M ? I ? "prevunique" : "prev" : I ? "nextunique" : "next", j = !k && "openKeyCursor" in F ? F.openKeyCursor(s(N), B) : F.openCursor(s(N), B);
4062
- j.onerror = Be(K), j.onsuccess = de(function(G) {
4063
- var $, ee, te, Me, Y = j.result;
4064
- Y ? (Y.___id = ++ci, Y.done = !1, $ = Y.continue.bind(Y), ee = (ee = Y.continuePrimaryKey) && ee.bind(Y), te = Y.advance.bind(Y), Me = function() {
4071
+ j.onerror = Ue(K), j.onsuccess = de(function(G) {
4072
+ var J, ee, te, Oe, Q = j.result;
4073
+ Q ? (Q.___id = ++ci, Q.done = !1, J = Q.continue.bind(Q), ee = (ee = Q.continuePrimaryKey) && ee.bind(Q), te = Q.advance.bind(Q), Oe = function() {
4065
4074
  throw new Error("Cursor not stopped");
4066
- }, Y.trans = A, Y.stop = Y.continue = Y.continuePrimaryKey = Y.advance = function() {
4075
+ }, Q.trans = A, Q.stop = Q.continue = Q.continuePrimaryKey = Q.advance = function() {
4067
4076
  throw new Error("Cursor not started");
4068
- }, Y.fail = de(K), Y.next = function() {
4069
- var Te = this, Ee = 1;
4077
+ }, Q.fail = de(K), Q.next = function() {
4078
+ var Ee = this, Se = 1;
4070
4079
  return this.start(function() {
4071
- return Ee-- ? Te.continue() : Te.stop();
4080
+ return Se-- ? Ee.continue() : Ee.stop();
4072
4081
  }).then(function() {
4073
- return Te;
4082
+ return Ee;
4074
4083
  });
4075
- }, Y.start = function(Te) {
4076
- function Ee() {
4084
+ }, Q.start = function(Ee) {
4085
+ function Se() {
4077
4086
  if (j.result) try {
4078
- Te();
4079
- } catch (Se) {
4080
- Y.fail(Se);
4087
+ Ee();
4088
+ } catch (Re) {
4089
+ Q.fail(Re);
4081
4090
  }
4082
- else Y.done = !0, Y.start = function() {
4091
+ else Q.done = !0, Q.start = function() {
4083
4092
  throw new Error("Cursor behind last entry");
4084
- }, Y.stop();
4093
+ }, Q.stop();
4085
4094
  }
4086
- var Pn = new Promise(function(Se, vt) {
4087
- Se = de(Se), j.onerror = Be(vt), Y.fail = vt, Y.stop = function(wr) {
4088
- Y.stop = Y.continue = Y.continuePrimaryKey = Y.advance = Me, Se(wr);
4095
+ var Cn = new Promise(function(Re, wt) {
4096
+ Re = de(Re), j.onerror = Ue(wt), Q.fail = wt, Q.stop = function(_r) {
4097
+ Q.stop = Q.continue = Q.continuePrimaryKey = Q.advance = Oe, Re(_r);
4089
4098
  };
4090
4099
  });
4091
- return j.onsuccess = de(function(Se) {
4092
- j.onsuccess = Ee, Ee();
4093
- }), Y.continue = $, Y.continuePrimaryKey = ee, Y.advance = te, Ee(), Pn;
4094
- }, D(Y)) : D(null);
4100
+ return j.onsuccess = de(function(Re) {
4101
+ j.onsuccess = Se, Se();
4102
+ }), Q.continue = J, Q.continuePrimaryKey = ee, Q.advance = te, Se(), Cn;
4103
+ }, D(Q)) : D(null);
4095
4104
  }, K);
4096
4105
  });
4097
4106
  }, count: function(S) {
@@ -4100,29 +4109,29 @@ function sa() {
4100
4109
  var K = k.objectStore(x), N = O.isPrimaryKey ? K : K.index(O.name), K = s(M), N = K ? N.count(K) : N.count();
4101
4110
  N.onsuccess = de(function(F) {
4102
4111
  return I(F.target.result);
4103
- }), N.onerror = Be(D);
4112
+ }), N.onerror = Ue(D);
4104
4113
  });
4105
4114
  } };
4106
4115
  }
4107
4116
  var f, d, m, T = (d = v, m = rs((f = e).objectStoreNames), { schema: { name: f.name, tables: m.map(function(R) {
4108
4117
  return d.objectStore(R);
4109
4118
  }).map(function(R) {
4110
- var b = R.keyPath, A = R.autoIncrement, x = p(b), S = {}, A = { name: R.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: b == null, compound: x, keyPath: b, autoIncrement: A, unique: !0, extractKey: nr(b) }, indexes: rs(R.indexNames).map(function(k) {
4119
+ var b = R.keyPath, A = R.autoIncrement, x = p(b), S = {}, A = { name: R.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: b == null, compound: x, keyPath: b, autoIncrement: A, unique: !0, extractKey: rr(b) }, indexes: rs(R.indexNames).map(function(k) {
4111
4120
  return R.index(k);
4112
4121
  }).map(function(I) {
4113
- var O = I.name, M = I.unique, D = I.multiEntry, I = I.keyPath, D = { name: O, compound: p(I), keyPath: I, unique: M, multiEntry: D, extractKey: nr(I) };
4114
- return S[Yt(I)] = D;
4122
+ var O = I.name, M = I.unique, D = I.multiEntry, I = I.keyPath, D = { name: O, compound: p(I), keyPath: I, unique: M, multiEntry: D, extractKey: rr(I) };
4123
+ return S[Wt(I)] = D;
4115
4124
  }), getIndexByKeyPath: function(k) {
4116
- return S[Yt(k)];
4125
+ return S[Wt(k)];
4117
4126
  } };
4118
- return S[":id"] = A.primaryKey, b != null && (S[Yt(b)] = A.primaryKey), A;
4127
+ return S[":id"] = A.primaryKey, b != null && (S[Wt(b)] = A.primaryKey), A;
4119
4128
  }) }, hasGetAll: 0 < m.length && "getAll" in d.objectStore(m[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(o), g = {};
4120
4129
  return T.forEach(function(R) {
4121
4130
  return g[R.name] = R;
4122
4131
  }), { stack: "dbcore", transaction: e.transaction.bind(e), table: function(R) {
4123
4132
  if (!g[R]) throw new Error("Table '".concat(R, "' not found"));
4124
4133
  return g[R];
4125
- }, MIN_KEY: -1 / 0, MAX_KEY: Wt(t), schema: v };
4134
+ }, MIN_KEY: -1 / 0, MAX_KEY: Xt(t), schema: v };
4126
4135
  }
4127
4136
  function fi(e, t, n, s) {
4128
4137
  var o = n.IDBKeyRange;
@@ -4130,7 +4139,7 @@ function sa() {
4130
4139
  return d = d.create, a(a({}, f), d(f));
4131
4140
  }, s)) };
4132
4141
  }
4133
- function bn(e, s) {
4142
+ function wn(e, s) {
4134
4143
  var n = s.db, s = fi(e._middlewares, n, e._deps, s);
4135
4144
  e.core = s.dbcore, e.tables.forEach(function(o) {
4136
4145
  var f = o.name;
@@ -4139,7 +4148,7 @@ function sa() {
4139
4148
  }) && (o.core = e.core.table(f), e[f] instanceof e.Table && (e[f].core = o.core));
4140
4149
  });
4141
4150
  }
4142
- function wn(e, t, n, s) {
4151
+ function _n(e, t, n, s) {
4143
4152
  n.forEach(function(o) {
4144
4153
  var f = s[o];
4145
4154
  t.forEach(function(d) {
@@ -4154,7 +4163,7 @@ function sa() {
4154
4163
  });
4155
4164
  });
4156
4165
  }
4157
- function rr(e, t) {
4166
+ function sr(e, t) {
4158
4167
  t.forEach(function(n) {
4159
4168
  for (var s in n) n[s] instanceof e.Table && delete n[s];
4160
4169
  });
@@ -4164,45 +4173,45 @@ function sa() {
4164
4173
  }
4165
4174
  function di(e, t, n, s) {
4166
4175
  var o = e._dbSchema;
4167
- n.objectStoreNames.contains("$meta") && !o.$meta && (o.$meta = tr("$meta", is("")[0], []), e._storeNames.push("$meta"));
4176
+ n.objectStoreNames.contains("$meta") && !o.$meta && (o.$meta = nr("$meta", is("")[0], []), e._storeNames.push("$meta"));
4168
4177
  var f = e._createTransaction("readwrite", e._storeNames, o);
4169
4178
  f.create(n), f._completion.catch(s);
4170
4179
  var d = f._reject.bind(f), m = z.transless || z;
4171
- et(function() {
4172
- return z.trans = f, z.transless = m, t !== 0 ? (bn(e, n), w = t, ((v = f).storeNames.includes("$meta") ? v.table("$meta").get("version").then(function(T) {
4180
+ tt(function() {
4181
+ return z.trans = f, z.transless = m, t !== 0 ? (wn(e, n), w = t, ((v = f).storeNames.includes("$meta") ? v.table("$meta").get("version").then(function(T) {
4173
4182
  return T ?? w;
4174
4183
  }) : U.resolve(w)).then(function(T) {
4175
- return R = T, b = f, x = n, S = [], T = (g = e)._versions, A = g._dbSchema = An(0, g.idbdb, x), (T = T.filter(function(k) {
4184
+ return R = T, b = f, x = n, S = [], T = (g = e)._versions, A = g._dbSchema = xn(0, g.idbdb, x), (T = T.filter(function(k) {
4176
4185
  return k._cfg.version >= R;
4177
4186
  })).length !== 0 ? (T.forEach(function(k) {
4178
4187
  S.push(function() {
4179
4188
  var O = A, M = k._cfg.dbschema;
4180
- xn(g, O, x), xn(g, M, x), A = g._dbSchema = M;
4181
- var I = sr(O, M);
4189
+ Tn(g, O, x), Tn(g, M, x), A = g._dbSchema = M;
4190
+ var I = ir(O, M);
4182
4191
  I.add.forEach(function(B) {
4183
- ir(x, B[0], B[1].primKey, B[1].indexes);
4192
+ or(x, B[0], B[1].primKey, B[1].indexes);
4184
4193
  }), I.change.forEach(function(B) {
4185
4194
  if (B.recreate) throw new V.Upgrade("Not yet support for changing primary key");
4186
4195
  var j = x.objectStore(B.name);
4187
4196
  B.add.forEach(function(G) {
4188
- return _n(j, G);
4197
+ return An(j, G);
4189
4198
  }), B.change.forEach(function(G) {
4190
- j.deleteIndex(G.name), _n(j, G);
4199
+ j.deleteIndex(G.name), An(j, G);
4191
4200
  }), B.del.forEach(function(G) {
4192
4201
  return j.deleteIndex(G);
4193
4202
  });
4194
4203
  });
4195
4204
  var D = k._cfg.contentUpgrade;
4196
4205
  if (D && k._cfg.version > R) {
4197
- bn(g, x), b._memoizedTables = {};
4198
- var K = Fe(M);
4206
+ wn(g, x), b._memoizedTables = {};
4207
+ var K = Le(M);
4199
4208
  I.del.forEach(function(B) {
4200
4209
  K[B] = O[B];
4201
- }), rr(g, [g.Transaction.prototype]), wn(g, [g.Transaction.prototype], l(K), K), b.schema = K;
4202
- var N, F = Ft(D);
4203
- return F && Ot(), I = U.follow(function() {
4210
+ }), sr(g, [g.Transaction.prototype]), _n(g, [g.Transaction.prototype], l(K), K), b.schema = K;
4211
+ var N, F = rn(D);
4212
+ return F && kt(), I = U.follow(function() {
4204
4213
  var B;
4205
- (N = D(b)) && F && (B = tt.bind(null, null), N.then(B, B));
4214
+ (N = D(b)) && F && (B = nt.bind(null, null), N.then(B, B));
4206
4215
  }), N && typeof N.then == "function" ? U.resolve(N) : I.then(function() {
4207
4216
  return N;
4208
4217
  });
@@ -4211,7 +4220,7 @@ function sa() {
4211
4220
  var M, I, D = k._cfg.dbschema;
4212
4221
  M = D, I = O, [].slice.call(I.db.objectStoreNames).forEach(function(K) {
4213
4222
  return M[K] == null && I.db.deleteObjectStore(K);
4214
- }), rr(g, [g.Transaction.prototype]), wn(g, [g.Transaction.prototype], g._storeNames, g._dbSchema), b.schema = g._dbSchema;
4223
+ }), sr(g, [g.Transaction.prototype]), _n(g, [g.Transaction.prototype], g._storeNames, g._dbSchema), b.schema = g._dbSchema;
4215
4224
  }), S.push(function(O) {
4216
4225
  g.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(g.idbdb.version / 10) === k._cfg.version ? (g.idbdb.deleteObjectStore("$meta"), delete g._dbSchema.$meta, g._storeNames = g._storeNames.filter(function(M) {
4217
4226
  return M !== "$meta";
@@ -4224,8 +4233,8 @@ function sa() {
4224
4233
  })) : U.resolve();
4225
4234
  var g, R, b, x, S, A;
4226
4235
  }).catch(d)) : (l(o).forEach(function(T) {
4227
- ir(n, T, o[T].primKey, o[T].indexes);
4228
- }), bn(e, n), void U.follow(function() {
4236
+ or(n, T, o[T].primKey, o[T].indexes);
4237
+ }), wn(e, n), void U.follow(function() {
4229
4238
  return e.on.populate.fire(f);
4230
4239
  }).catch(d));
4231
4240
  var v, w;
@@ -4233,20 +4242,20 @@ function sa() {
4233
4242
  }
4234
4243
  function pi(e, t) {
4235
4244
  ss(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");
4236
- var n = An(0, e.idbdb, t);
4237
- xn(e, e._dbSchema, t);
4238
- for (var s = 0, o = sr(n, e._dbSchema).change; s < o.length; s++) {
4245
+ var n = xn(0, e.idbdb, t);
4246
+ Tn(e, e._dbSchema, t);
4247
+ for (var s = 0, o = ir(n, e._dbSchema).change; s < o.length; s++) {
4239
4248
  var f = function(d) {
4240
4249
  if (d.change.length || d.recreate) return console.warn("Unable to patch indexes of table ".concat(d.name, " because it has changes on the type of index or primary key.")), { value: void 0 };
4241
4250
  var m = t.objectStore(d.name);
4242
4251
  d.add.forEach(function(v) {
4243
- Ke && console.debug("Dexie upgrade patch: Creating missing index ".concat(d.name, ".").concat(v.src)), _n(m, v);
4252
+ Be && console.debug("Dexie upgrade patch: Creating missing index ".concat(d.name, ".").concat(v.src)), An(m, v);
4244
4253
  });
4245
4254
  }(o[s]);
4246
4255
  if (typeof f == "object") return f.value;
4247
4256
  }
4248
4257
  }
4249
- function sr(e, t) {
4258
+ function ir(e, t) {
4250
4259
  var n, s = { del: [], add: [], change: [] };
4251
4260
  for (n in e) t[n] || s.del.push(n);
4252
4261
  for (n in t) {
@@ -4267,31 +4276,31 @@ function sa() {
4267
4276
  }
4268
4277
  return s;
4269
4278
  }
4270
- function ir(e, t, n, s) {
4279
+ function or(e, t, n, s) {
4271
4280
  var o = e.db.createObjectStore(t, n.keyPath ? { keyPath: n.keyPath, autoIncrement: n.auto } : { autoIncrement: n.auto });
4272
4281
  return s.forEach(function(f) {
4273
- return _n(o, f);
4282
+ return An(o, f);
4274
4283
  }), o;
4275
4284
  }
4276
4285
  function ss(e, t) {
4277
4286
  l(e).forEach(function(n) {
4278
- t.db.objectStoreNames.contains(n) || (Ke && console.debug("Dexie: Creating missing table", n), ir(t, n, e[n].primKey, e[n].indexes));
4287
+ t.db.objectStoreNames.contains(n) || (Be && console.debug("Dexie: Creating missing table", n), or(t, n, e[n].primKey, e[n].indexes));
4279
4288
  });
4280
4289
  }
4281
- function _n(e, t) {
4290
+ function An(e, t) {
4282
4291
  e.createIndex(t.name, t.keyPath, { unique: t.unique, multiEntry: t.multi });
4283
4292
  }
4284
- function An(e, t, n) {
4293
+ function xn(e, t, n) {
4285
4294
  var s = {};
4286
4295
  return Z(t.objectStoreNames, 0).forEach(function(o) {
4287
- for (var f = n.objectStore(o), d = er(ns(w = f.keyPath), w || "", !0, !1, !!f.autoIncrement, w && typeof w != "string", !0), m = [], v = 0; v < f.indexNames.length; ++v) {
4288
- var T = f.index(f.indexNames[v]), w = T.keyPath, T = er(T.name, w, !!T.unique, !!T.multiEntry, !1, w && typeof w != "string", !1);
4296
+ for (var f = n.objectStore(o), d = tr(ns(w = f.keyPath), w || "", !0, !1, !!f.autoIncrement, w && typeof w != "string", !0), m = [], v = 0; v < f.indexNames.length; ++v) {
4297
+ var T = f.index(f.indexNames[v]), w = T.keyPath, T = tr(T.name, w, !!T.unique, !!T.multiEntry, !1, w && typeof w != "string", !1);
4289
4298
  m.push(T);
4290
4299
  }
4291
- s[o] = tr(o, d, m);
4300
+ s[o] = nr(o, d, m);
4292
4301
  }), s;
4293
4302
  }
4294
- function xn(e, t, n) {
4303
+ function Tn(e, t, n) {
4295
4304
  for (var s = n.db.objectStoreNames, o = 0; o < s.length; ++o) {
4296
4305
  var f = s[o], d = n.objectStore(f);
4297
4306
  e._hasGetAll = "getAll" in d;
@@ -4305,10 +4314,10 @@ function sa() {
4305
4314
  function is(e) {
4306
4315
  return e.split(",").map(function(t, n) {
4307
4316
  var s = (t = t.trim()).replace(/([&*]|\+\+)/g, ""), o = /^\[/.test(s) ? s.match(/^\[(.*)\]$/)[1].split("+") : s;
4308
- return er(s, o || null, /\&/.test(t), /\*/.test(t), /\+\+/.test(t), p(o), n === 0);
4317
+ return tr(s, o || null, /\&/.test(t), /\*/.test(t), /\+\+/.test(t), p(o), n === 0);
4309
4318
  });
4310
4319
  }
4311
- var mi = (Tn.prototype._parseStoresSpec = function(e, t) {
4320
+ var mi = (En.prototype._parseStoresSpec = function(e, t) {
4312
4321
  l(e).forEach(function(n) {
4313
4322
  if (e[n] !== null) {
4314
4323
  var s = is(e[n]), o = s.shift();
@@ -4316,71 +4325,71 @@ function sa() {
4316
4325
  s.forEach(function(f) {
4317
4326
  if (f.auto) throw new V.Schema("Only primary key can be marked as autoIncrement (++)");
4318
4327
  if (!f.keyPath) throw new V.Schema("Index must have a name and cannot be an empty string");
4319
- }), t[n] = tr(n, o, s);
4328
+ }), t[n] = nr(n, o, s);
4320
4329
  }
4321
4330
  });
4322
- }, Tn.prototype.stores = function(n) {
4331
+ }, En.prototype.stores = function(n) {
4323
4332
  var t = this.db;
4324
4333
  this._cfg.storesSource = this._cfg.storesSource ? h(this._cfg.storesSource, n) : n;
4325
4334
  var n = t._versions, s = {}, o = {};
4326
4335
  return n.forEach(function(f) {
4327
4336
  h(s, f._cfg.storesSource), o = f._cfg.dbschema = {}, f._parseStoresSpec(s, o);
4328
- }), t._dbSchema = o, rr(t, [t._allTables, t, t.Transaction.prototype]), wn(t, [t._allTables, t, t.Transaction.prototype, this._cfg.tables], l(o), o), t._storeNames = l(o), this;
4329
- }, Tn.prototype.upgrade = function(e) {
4330
- return this._cfg.contentUpgrade = Kn(this._cfg.contentUpgrade || ue, e), this;
4331
- }, Tn);
4332
- function Tn() {
4337
+ }), t._dbSchema = o, sr(t, [t._allTables, t, t.Transaction.prototype]), _n(t, [t._allTables, t, t.Transaction.prototype, this._cfg.tables], l(o), o), t._storeNames = l(o), this;
4338
+ }, En.prototype.upgrade = function(e) {
4339
+ return this._cfg.contentUpgrade = Bn(this._cfg.contentUpgrade || ue, e), this;
4340
+ }, En);
4341
+ function En() {
4333
4342
  }
4334
- function or(e, t) {
4343
+ function ar(e, t) {
4335
4344
  var n = e._dbNamesDB;
4336
- return n || (n = e._dbNamesDB = new Xe(pn, { addons: [], indexedDB: e, IDBKeyRange: t })).version(1).stores({ dbnames: "name" }), n.table("dbnames");
4345
+ return n || (n = e._dbNamesDB = new We(mn, { addons: [], indexedDB: e, IDBKeyRange: t })).version(1).stores({ dbnames: "name" }), n.table("dbnames");
4337
4346
  }
4338
- function ar(e) {
4347
+ function ur(e) {
4339
4348
  return e && typeof e.databases == "function";
4340
4349
  }
4341
- function ur(e) {
4342
- return et(function() {
4350
+ function cr(e) {
4351
+ return tt(function() {
4343
4352
  return z.letThrough = !0, e();
4344
4353
  });
4345
4354
  }
4346
- function cr(e) {
4355
+ function lr(e) {
4347
4356
  return !("from" in e);
4348
4357
  }
4349
- var xe = function(e, t) {
4358
+ var Te = function(e, t) {
4350
4359
  if (!this) {
4351
- var n = new xe();
4360
+ var n = new Te();
4352
4361
  return e && "d" in e && h(n, e), n;
4353
4362
  }
4354
4363
  h(this, arguments.length ? { d: 1, from: e, to: 1 < arguments.length ? t : e } : { d: 0 });
4355
4364
  };
4356
- function Qt(e, t, n) {
4365
+ function Yt(e, t, n) {
4357
4366
  var s = re(t, n);
4358
4367
  if (!isNaN(s)) {
4359
4368
  if (0 < s) throw RangeError();
4360
- if (cr(e)) return h(e, { from: t, to: n, d: 1 });
4369
+ if (lr(e)) return h(e, { from: t, to: n, d: 1 });
4361
4370
  var o = e.l, s = e.r;
4362
- if (re(n, e.from) < 0) return o ? Qt(o, t, n) : e.l = { from: t, to: n, d: 1, l: null, r: null }, as(e);
4363
- if (0 < re(t, e.to)) return s ? Qt(s, t, n) : e.r = { from: t, to: n, d: 1, l: null, r: null }, as(e);
4364
- re(t, e.from) < 0 && (e.from = t, e.l = null, e.d = s ? s.d + 1 : 1), 0 < re(n, e.to) && (e.to = n, e.r = null, e.d = e.l ? e.l.d + 1 : 1), n = !e.r, o && !e.l && $t(e, o), s && n && $t(e, s);
4371
+ if (re(n, e.from) < 0) return o ? Yt(o, t, n) : e.l = { from: t, to: n, d: 1, l: null, r: null }, as(e);
4372
+ if (0 < re(t, e.to)) return s ? Yt(s, t, n) : e.r = { from: t, to: n, d: 1, l: null, r: null }, as(e);
4373
+ re(t, e.from) < 0 && (e.from = t, e.l = null, e.d = s ? s.d + 1 : 1), 0 < re(n, e.to) && (e.to = n, e.r = null, e.d = e.l ? e.l.d + 1 : 1), n = !e.r, o && !e.l && Qt(e, o), s && n && Qt(e, s);
4365
4374
  }
4366
4375
  }
4367
- function $t(e, t) {
4368
- cr(t) || function n(s, v) {
4376
+ function Qt(e, t) {
4377
+ lr(t) || function n(s, v) {
4369
4378
  var f = v.from, d = v.to, m = v.l, v = v.r;
4370
- Qt(s, f, d), m && n(s, m), v && n(s, v);
4379
+ Yt(s, f, d), m && n(s, m), v && n(s, v);
4371
4380
  }(e, t);
4372
4381
  }
4373
4382
  function os(e, t) {
4374
- var n = En(t), s = n.next();
4383
+ var n = Sn(t), s = n.next();
4375
4384
  if (s.done) return !1;
4376
- for (var o = s.value, f = En(e), d = f.next(o.from), m = d.value; !s.done && !d.done; ) {
4385
+ for (var o = s.value, f = Sn(e), d = f.next(o.from), m = d.value; !s.done && !d.done; ) {
4377
4386
  if (re(m.from, o.to) <= 0 && 0 <= re(m.to, o.from)) return !0;
4378
4387
  re(o.from, m.from) < 0 ? o = (s = n.next(m.from)).value : m = (d = f.next(o.from)).value;
4379
4388
  }
4380
4389
  return !1;
4381
4390
  }
4382
- function En(e) {
4383
- var t = cr(e) ? null : { s: 0, n: e };
4391
+ function Sn(e) {
4392
+ var t = lr(e) ? null : { s: 0, n: e };
4384
4393
  return { next: function(n) {
4385
4394
  for (var s = 0 < arguments.length; t; ) switch (t.s) {
4386
4395
  case 0:
@@ -4407,48 +4416,48 @@ function sa() {
4407
4416
  var t = n.r, n = n.l;
4408
4417
  return (t ? n ? Math.max(t.d, n.d) : t.d : n ? n.d : 0) + 1;
4409
4418
  }
4410
- function Sn(e, t) {
4419
+ function Rn(e, t) {
4411
4420
  return l(t).forEach(function(n) {
4412
- e[n] ? $t(e[n], t[n]) : e[n] = function s(o) {
4421
+ e[n] ? Qt(e[n], t[n]) : e[n] = function s(o) {
4413
4422
  var f, d, m = {};
4414
- for (f in o) _(o, f) && (d = o[f], m[f] = !d || typeof d != "object" || Le.has(d.constructor) ? d : s(d));
4423
+ for (f in o) _(o, f) && (d = o[f], m[f] = !d || typeof d != "object" || tn.has(d.constructor) ? d : s(d));
4415
4424
  return m;
4416
4425
  }(t[n]);
4417
4426
  }), e;
4418
4427
  }
4419
- function lr(e, t) {
4428
+ function fr(e, t) {
4420
4429
  return e.all || t.all || Object.keys(e).some(function(n) {
4421
4430
  return t[n] && os(t[n], e[n]);
4422
4431
  });
4423
4432
  }
4424
- P(xe.prototype, ((Ce = { add: function(e) {
4425
- return $t(this, e), this;
4433
+ P(Te.prototype, ((Ce = { add: function(e) {
4434
+ return Qt(this, e), this;
4426
4435
  }, addKey: function(e) {
4427
- return Qt(this, e, e), this;
4436
+ return Yt(this, e, e), this;
4428
4437
  }, addKeys: function(e) {
4429
4438
  var t = this;
4430
4439
  return e.forEach(function(n) {
4431
- return Qt(t, n, n);
4440
+ return Yt(t, n, n);
4432
4441
  }), this;
4433
4442
  }, hasKey: function(e) {
4434
- var t = En(this).next(e).value;
4443
+ var t = Sn(this).next(e).value;
4435
4444
  return t && re(t.from, e) <= 0 && 0 <= re(t.to, e);
4436
- } })[Et] = function() {
4437
- return En(this);
4445
+ } })[ze] = function() {
4446
+ return Sn(this);
4438
4447
  }, Ce));
4439
- var yt = {}, fr = {}, hr = !1;
4440
- function Rn(e) {
4441
- Sn(fr, e), hr || (hr = !0, setTimeout(function() {
4442
- hr = !1, dr(fr, !(fr = {}));
4448
+ var vt = {}, hr = {}, dr = !1;
4449
+ function kn(e) {
4450
+ Rn(hr, e), dr || (dr = !0, setTimeout(function() {
4451
+ dr = !1, pr(hr, !(hr = {}));
4443
4452
  }, 0));
4444
4453
  }
4445
- function dr(e, t) {
4454
+ function pr(e, t) {
4446
4455
  t === void 0 && (t = !1);
4447
4456
  var n = /* @__PURE__ */ new Set();
4448
- if (e.all) for (var s = 0, o = Object.values(yt); s < o.length; s++) cs(d = o[s], e, n, t);
4457
+ if (e.all) for (var s = 0, o = Object.values(vt); s < o.length; s++) cs(d = o[s], e, n, t);
4449
4458
  else for (var f in e) {
4450
4459
  var d, m = /^idb\:\/\/(.*)\/(.*)\//.exec(f);
4451
- m && (f = m[1], m = m[2], (d = yt["idb://".concat(f, "/").concat(m)]) && cs(d, e, n, t));
4460
+ m && (f = m[1], m = m[2], (d = vt["idb://".concat(f, "/").concat(m)]) && cs(d, e, n, t));
4452
4461
  }
4453
4462
  n.forEach(function(v) {
4454
4463
  return v();
@@ -4458,7 +4467,7 @@ function sa() {
4458
4467
  for (var o = [], f = 0, d = Object.entries(e.queries.query); f < d.length; f++) {
4459
4468
  for (var m = d[f], v = m[0], w = [], T = 0, g = m[1]; T < g.length; T++) {
4460
4469
  var R = g[T];
4461
- lr(t, R.obsSet) ? R.subscribers.forEach(function(A) {
4470
+ fr(t, R.obsSet) ? R.subscribers.forEach(function(A) {
4462
4471
  return n.add(A);
4463
4472
  }) : s && w.push(R);
4464
4473
  }
@@ -4484,28 +4493,28 @@ function sa() {
4484
4493
  if (d(), !n) throw new V.MissingAPI();
4485
4494
  var x = e.name, S = t.autoSchema || !o ? n.open(x) : n.open(x, o);
4486
4495
  if (!S) throw new V.MissingAPI();
4487
- S.onerror = Be(b), S.onblocked = de(e._fireOnBlocked), S.onupgradeneeded = de(function(A) {
4496
+ S.onerror = Ue(b), S.onblocked = de(e._fireOnBlocked), S.onupgradeneeded = de(function(A) {
4488
4497
  var k;
4489
- T = S.transaction, t.autoSchema && !e._options.allowEmptyDB ? (S.onerror = Vt, T.abort(), S.result.close(), (k = n.deleteDatabase(x)).onsuccess = k.onerror = de(function() {
4498
+ T = S.transaction, t.autoSchema && !e._options.allowEmptyDB ? (S.onerror = zt, T.abort(), S.result.close(), (k = n.deleteDatabase(x)).onsuccess = k.onerror = de(function() {
4490
4499
  b(new V.NoSuchDatabase("Database ".concat(x, " doesnt exist")));
4491
- })) : (T.onerror = Be(b), A = A.oldVersion > Math.pow(2, 62) ? 0 : A.oldVersion, g = A < 1, e.idbdb = S.result, f && pi(e, T), di(e, A / 10, T, b));
4500
+ })) : (T.onerror = Ue(b), A = A.oldVersion > Math.pow(2, 62) ? 0 : A.oldVersion, g = A < 1, e.idbdb = S.result, f && pi(e, T), di(e, A / 10, T, b));
4492
4501
  }, b), S.onsuccess = de(function() {
4493
4502
  T = null;
4494
4503
  var A, k, O, M, I, D = e.idbdb = S.result, K = Z(D.objectStoreNames);
4495
4504
  if (0 < K.length) try {
4496
4505
  var N = D.transaction((M = K).length === 1 ? M[0] : M, "readonly");
4497
- if (t.autoSchema) k = D, O = N, (A = e).verno = k.version / 10, O = A._dbSchema = An(0, k, O), A._storeNames = Z(k.objectStoreNames, 0), wn(A, [A._allTables], l(O), O);
4498
- else if (xn(e, e._dbSchema, N), ((I = sr(An(0, (I = e).idbdb, N), I._dbSchema)).add.length || I.change.some(function(F) {
4506
+ if (t.autoSchema) k = D, O = N, (A = e).verno = k.version / 10, O = A._dbSchema = xn(0, k, O), A._storeNames = Z(k.objectStoreNames, 0), _n(A, [A._allTables], l(O), O);
4507
+ else if (Tn(e, e._dbSchema, N), ((I = ir(xn(0, (I = e).idbdb, N), I._dbSchema)).add.length || I.change.some(function(F) {
4499
4508
  return F.add.length || F.change.length;
4500
4509
  })) && !f) 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."), D.close(), o = D.version + 1, f = !0, R(m());
4501
- bn(e, N);
4510
+ wn(e, N);
4502
4511
  } catch {
4503
4512
  }
4504
- Mt.push(e), D.onversionchange = de(function(F) {
4513
+ Ot.push(e), D.onversionchange = de(function(F) {
4505
4514
  t.vcFired = !0, e.on("versionchange").fire(F);
4506
4515
  }), D.onclose = de(function(F) {
4507
4516
  e.on("close").fire(F);
4508
- }), g && (I = e._deps, N = x, D = I.indexedDB, I = I.IDBKeyRange, ar(D) || N === pn || or(D, I).put({ name: N }).catch(ue)), R();
4517
+ }), g && (I = e._deps, N = x, D = I.indexedDB, I = I.IDBKeyRange, ur(D) || N === mn || ar(D, I).put({ name: N }).catch(ue)), R();
4509
4518
  }, b);
4510
4519
  }).catch(function(R) {
4511
4520
  switch (R == null ? void 0 : R.name) {
@@ -4527,12 +4536,12 @@ function sa() {
4527
4536
  }).finally(function() {
4528
4537
  return clearInterval(v);
4529
4538
  }) : Promise.resolve()).then(m)]).then(function() {
4530
- return d(), t.onReadyBeingFired = [], U.resolve(ur(function() {
4539
+ return d(), t.onReadyBeingFired = [], U.resolve(cr(function() {
4531
4540
  return e.on.ready.fire(e.vip);
4532
4541
  })).then(function R() {
4533
4542
  if (0 < t.onReadyBeingFired.length) {
4534
- var b = t.onReadyBeingFired.reduce(Kn, ue);
4535
- return t.onReadyBeingFired = [], U.resolve(ur(function() {
4543
+ var b = t.onReadyBeingFired.reduce(Bn, ue);
4544
+ return t.onReadyBeingFired = [], U.resolve(cr(function() {
4536
4545
  return b(e.vip);
4537
4546
  })).then(R);
4538
4547
  }
@@ -4552,12 +4561,12 @@ function sa() {
4552
4561
  var R;
4553
4562
  return g && (R = {}, e.tables.forEach(function(b) {
4554
4563
  b.schema.indexes.forEach(function(x) {
4555
- x.name && (R["idb://".concat(e.name, "/").concat(b.name, "/").concat(x.name)] = new xe(-1 / 0, [[[]]]));
4556
- }), R["idb://".concat(e.name, "/").concat(b.name, "/")] = R["idb://".concat(e.name, "/").concat(b.name, "/:dels")] = new xe(-1 / 0, [[[]]]);
4557
- }), st(Xt).fire(R), dr(R, !0)), e;
4564
+ x.name && (R["idb://".concat(e.name, "/").concat(b.name, "/").concat(x.name)] = new Te(-1 / 0, [[[]]]));
4565
+ }), R["idb://".concat(e.name, "/").concat(b.name, "/")] = R["idb://".concat(e.name, "/").concat(b.name, "/:dels")] = new Te(-1 / 0, [[[]]]);
4566
+ }), it(Vt).fire(R), pr(R, !0)), e;
4558
4567
  });
4559
4568
  }
4560
- function pr(e) {
4569
+ function mr(e) {
4561
4570
  function t(f) {
4562
4571
  return e.next(f);
4563
4572
  }
@@ -4572,7 +4581,7 @@ function sa() {
4572
4581
  }
4573
4582
  return o(t)();
4574
4583
  }
4575
- function kn(e, t, n) {
4584
+ function On(e, t, n) {
4576
4585
  for (var s = p(e) ? e.slice() : [e], o = 0; o < n; ++o) s.push(t);
4577
4586
  return s;
4578
4587
  }
@@ -4580,7 +4589,7 @@ function sa() {
4580
4589
  return a(a({}, e), { table: function(t) {
4581
4590
  var n = e.table(t), s = n.schema, o = {}, f = [];
4582
4591
  function d(g, R, b) {
4583
- var x = Yt(g), S = o[x] = o[x] || [], A = g == null ? 0 : typeof g == "string" ? 1 : g.length, k = 0 < R, k = a(a({}, b), { name: k ? "".concat(x, "(virtual-from:").concat(b.name, ")") : b.name, lowLevelIndex: b, isVirtual: k, keyTail: R, keyLength: A, extractKey: nr(g), unique: !k && b.unique });
4592
+ var x = Wt(g), S = o[x] = o[x] || [], A = g == null ? 0 : typeof g == "string" ? 1 : g.length, k = 0 < R, k = a(a({}, b), { name: k ? "".concat(x, "(virtual-from:").concat(b.name, ")") : b.name, lowLevelIndex: b, isVirtual: k, keyTail: R, keyLength: A, extractKey: rr(g), unique: !k && b.unique });
4584
4593
  return S.push(k), k.isPrimaryKey || f.push(k), 1 < A && d(A === 2 ? g[0] : g.slice(0, A - 1), R + 1, b), S.sort(function(O, M) {
4585
4594
  return O.keyTail - M.keyTail;
4586
4595
  }), k;
@@ -4592,10 +4601,10 @@ function sa() {
4592
4601
  }
4593
4602
  function T(g) {
4594
4603
  var R, b = g.query.index;
4595
- return b.isVirtual ? a(a({}, g), { query: { index: b.lowLevelIndex, range: (R = g.query.range, b = b.keyTail, { type: R.type === 1 ? 2 : R.type, lower: kn(R.lower, R.lowerOpen ? e.MAX_KEY : e.MIN_KEY, b), lowerOpen: !0, upper: kn(R.upper, R.upperOpen ? e.MIN_KEY : e.MAX_KEY, b), upperOpen: !0 }) } }) : g;
4604
+ return b.isVirtual ? a(a({}, g), { query: { index: b.lowLevelIndex, range: (R = g.query.range, b = b.keyTail, { type: R.type === 1 ? 2 : R.type, lower: On(R.lower, R.lowerOpen ? e.MAX_KEY : e.MIN_KEY, b), lowerOpen: !0, upper: On(R.upper, R.upperOpen ? e.MIN_KEY : e.MAX_KEY, b), upperOpen: !0 }) } }) : g;
4596
4605
  }
4597
4606
  return a(a({}, n), { schema: a(a({}, s), { primaryKey: t, indexes: f, getIndexByKeyPath: function(g) {
4598
- return (g = o[Yt(g)]) && g[0];
4607
+ return (g = o[Wt(g)]) && g[0];
4599
4608
  } }), count: function(g) {
4600
4609
  return n.count(T(g));
4601
4610
  }, query: function(g) {
@@ -4607,9 +4616,9 @@ function sa() {
4607
4616
  }) : n.openCursor(g);
4608
4617
  function A(k) {
4609
4618
  return Object.create(k, { continue: { value: function(O) {
4610
- O != null ? k.continue(kn(O, g.reverse ? e.MAX_KEY : e.MIN_KEY, b)) : g.unique ? k.continue(k.key.slice(0, S).concat(g.reverse ? e.MIN_KEY : e.MAX_KEY, b)) : k.continue();
4619
+ O != null ? k.continue(On(O, g.reverse ? e.MAX_KEY : e.MIN_KEY, b)) : g.unique ? k.continue(k.key.slice(0, S).concat(g.reverse ? e.MIN_KEY : e.MAX_KEY, b)) : k.continue();
4611
4620
  } }, continuePrimaryKey: { value: function(O, M) {
4612
- k.continuePrimaryKey(kn(O, e.MAX_KEY, b), M);
4621
+ k.continuePrimaryKey(On(O, e.MAX_KEY, b), M);
4613
4622
  } }, primaryKey: { get: function() {
4614
4623
  return k.primaryKey;
4615
4624
  } }, key: { get: function() {
@@ -4622,15 +4631,15 @@ function sa() {
4622
4631
  } });
4623
4632
  } });
4624
4633
  } };
4625
- function mr(e, t, n, s) {
4634
+ function yr(e, t, n, s) {
4626
4635
  return n = n || {}, s = s || "", l(e).forEach(function(o) {
4627
4636
  var f, d, m;
4628
- _(t, o) ? (f = e[o], d = t[o], typeof f == "object" && typeof d == "object" && f && d ? (m = Tt(f)) !== Tt(d) ? n[s + o] = t[o] : m === "Object" ? mr(f, d, n, s + o + ".") : f !== d && (n[s + o] = t[o]) : f !== d && (n[s + o] = t[o])) : n[s + o] = void 0;
4637
+ _(t, o) ? (f = e[o], d = t[o], typeof f == "object" && typeof d == "object" && f && d ? (m = Pe(f)) !== Pe(d) ? n[s + o] = t[o] : m === "Object" ? yr(f, d, n, s + o + ".") : f !== d && (n[s + o] = t[o]) : f !== d && (n[s + o] = t[o])) : n[s + o] = void 0;
4629
4638
  }), l(t).forEach(function(o) {
4630
4639
  _(e, o) || (n[s + o] = t[o]);
4631
4640
  }), n;
4632
4641
  }
4633
- function yr(e, t) {
4642
+ function gr(e, t) {
4634
4643
  return t.type === "delete" ? t.keys : t.keys || t.values.map(e.extractKey);
4635
4644
  }
4636
4645
  var vi = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: function(e) {
@@ -4669,13 +4678,13 @@ function sa() {
4669
4678
  }
4670
4679
  return n.mutate(o);
4671
4680
  function T(g) {
4672
- var R, b, x, S = z.trans, A = g.keys || yr(s, g);
4681
+ var R, b, x, S = z.trans, A = g.keys || gr(s, g);
4673
4682
  if (!A) throw new Error("Keys missing");
4674
4683
  return (g = g.type === "add" || g.type === "put" ? a(a({}, g), { keys: A }) : a({}, g)).type !== "delete" && (g.values = u([], g.values)), g.keys && (g.keys = u([], g.keys)), R = n, x = A, ((b = g).type === "add" ? Promise.resolve([]) : R.getMany({ trans: b.trans, keys: x, cache: "immutable" })).then(function(k) {
4675
4684
  var O = A.map(function(M, I) {
4676
4685
  var D, K, N, F = k[I], B = { onerror: null, onsuccess: null };
4677
- return g.type === "delete" ? m.fire.call(B, M, F, S) : g.type === "add" || F === void 0 ? (D = v.fire.call(B, M, g.values[I], S), M == null && D != null && (g.keys[I] = M = D, s.outbound || ce(g.values[I], s.keyPath, M))) : (D = mr(F, g.values[I]), (K = w.fire.call(B, D, M, F, S)) && (N = g.values[I], Object.keys(K).forEach(function(j) {
4678
- _(N, j) ? N[j] = K[j] : ce(N, j, K[j]);
4686
+ return g.type === "delete" ? m.fire.call(B, M, F, S) : g.type === "add" || F === void 0 ? (D = v.fire.call(B, M, g.values[I], S), M == null && D != null && (g.keys[I] = M = D, s.outbound || ae(g.values[I], s.keyPath, M))) : (D = yr(F, g.values[I]), (K = w.fire.call(B, D, M, F, S)) && (N = g.values[I], Object.keys(K).forEach(function(j) {
4687
+ _(N, j) ? N[j] = K[j] : ae(N, j, K[j]);
4679
4688
  }))), B;
4680
4689
  });
4681
4690
  return n.mutate(g).then(function(M) {
@@ -4697,7 +4706,7 @@ function sa() {
4697
4706
  function ls(e, t, n) {
4698
4707
  try {
4699
4708
  if (!t || t.keys.length < e.length) return null;
4700
- for (var s = [], o = 0, f = 0; o < t.keys.length && f < e.length; ++o) re(t.keys[o], e[f]) === 0 && (s.push(n ? ke(t.values[o]) : t.values[o]), ++f);
4709
+ for (var s = [], o = 0, f = 0; o < t.keys.length && f < e.length; ++o) re(t.keys[o], e[f]) === 0 && (s.push(n ? me(t.values[o]) : t.values[o]), ++f);
4701
4710
  return s.length === e.length ? s : null;
4702
4711
  } catch {
4703
4712
  return null;
@@ -4710,7 +4719,7 @@ function sa() {
4710
4719
  if (!s.cache) return n.getMany(s);
4711
4720
  var o = ls(s.keys, s.trans._cache, s.cache === "clone");
4712
4721
  return o ? U.resolve(o) : n.getMany(s).then(function(f) {
4713
- return s.trans._cache = { keys: s.keys, values: s.cache === "clone" ? ke(f) : f }, f;
4722
+ return s.trans._cache = { keys: s.keys, values: s.cache === "clone" ? me(f) : f }, f;
4714
4723
  });
4715
4724
  }, mutate: function(s) {
4716
4725
  return s.type !== "add" && (s.trans._cache = null), n.mutate(s);
@@ -4732,7 +4741,7 @@ function sa() {
4732
4741
  }
4733
4742
  }
4734
4743
  var wi = { stack: "dbcore", level: 0, name: "Observability", create: function(e) {
4735
- var t = e.schema.name, n = new xe(e.MIN_KEY, e.MAX_KEY);
4744
+ var t = e.schema.name, n = new Te(e.MIN_KEY, e.MAX_KEY);
4736
4745
  return a(a({}, e), { transaction: function(s, o, f) {
4737
4746
  if (z.subscr && o !== "readonly") throw new V.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(z.querier));
4738
4747
  return e.transaction(s, o, f);
@@ -4741,59 +4750,59 @@ function sa() {
4741
4750
  return b.compound && b.keyPath.includes(d.keyPath);
4742
4751
  }), T = a(a({}, o), { mutate: function(b) {
4743
4752
  function x(j) {
4744
- return j = "idb://".concat(t, "/").concat(s, "/").concat(j), M[j] || (M[j] = new xe());
4753
+ return j = "idb://".concat(t, "/").concat(s, "/").concat(j), M[j] || (M[j] = new Te());
4745
4754
  }
4746
- var S, A, k, O = b.trans, M = b.mutatedParts || (b.mutatedParts = {}), I = x(""), D = x(":dels"), K = b.type, B = b.type === "deleteRange" ? [b.range] : b.type === "delete" ? [b.keys] : b.values.length < 50 ? [yr(d, b).filter(function(j) {
4755
+ var S, A, k, O = b.trans, M = b.mutatedParts || (b.mutatedParts = {}), I = x(""), D = x(":dels"), K = b.type, B = b.type === "deleteRange" ? [b.range] : b.type === "delete" ? [b.keys] : b.values.length < 50 ? [gr(d, b).filter(function(j) {
4747
4756
  return j;
4748
4757
  }), b.values] : [], N = B[0], F = B[1], B = b.trans._cache;
4749
4758
  return p(N) ? (I.addKeys(N), (B = K === "delete" || N.length === F.length ? ls(N, B) : null) || D.addKeys(N), (B || F) && (S = x, A = B, k = F, f.indexes.forEach(function(j) {
4750
4759
  var G = S(j.name || "");
4751
- function $(te) {
4760
+ function J(te) {
4752
4761
  return te != null ? j.extractKey(te) : null;
4753
4762
  }
4754
4763
  function ee(te) {
4755
- return j.multiEntry && p(te) ? te.forEach(function(Me) {
4756
- return G.addKey(Me);
4764
+ return j.multiEntry && p(te) ? te.forEach(function(Oe) {
4765
+ return G.addKey(Oe);
4757
4766
  }) : G.addKey(te);
4758
4767
  }
4759
- (A || k).forEach(function(te, Te) {
4760
- var Y = A && $(A[Te]), Te = k && $(k[Te]);
4761
- re(Y, Te) !== 0 && (Y != null && ee(Y), Te != null && ee(Te));
4768
+ (A || k).forEach(function(te, Ee) {
4769
+ var Q = A && J(A[Ee]), Ee = k && J(k[Ee]);
4770
+ re(Q, Ee) !== 0 && (Q != null && ee(Q), Ee != null && ee(Ee));
4762
4771
  });
4763
4772
  }))) : N ? (F = { from: (F = N.lower) !== null && F !== void 0 ? F : e.MIN_KEY, to: (F = N.upper) !== null && F !== void 0 ? F : e.MAX_KEY }, D.add(F), I.add(F)) : (I.add(n), D.add(n), f.indexes.forEach(function(j) {
4764
4773
  return x(j.name).add(n);
4765
4774
  })), o.mutate(b).then(function(j) {
4766
4775
  return !N || b.type !== "add" && b.type !== "put" || (I.addKeys(j.results), w && w.forEach(function(G) {
4767
- for (var $ = b.values.map(function(Y) {
4768
- return G.extractKey(Y);
4769
- }), ee = G.keyPath.findIndex(function(Y) {
4770
- return Y === d.keyPath;
4771
- }), te = 0, Me = j.results.length; te < Me; ++te) $[te][ee] = j.results[te];
4772
- x(G.name).addKeys($);
4773
- })), O.mutatedParts = Sn(O.mutatedParts || {}, M), j;
4776
+ for (var J = b.values.map(function(Q) {
4777
+ return G.extractKey(Q);
4778
+ }), ee = G.keyPath.findIndex(function(Q) {
4779
+ return Q === d.keyPath;
4780
+ }), te = 0, Oe = j.results.length; te < Oe; ++te) J[te][ee] = j.results[te];
4781
+ x(G.name).addKeys(J);
4782
+ })), O.mutatedParts = Rn(O.mutatedParts || {}, M), j;
4774
4783
  });
4775
4784
  } }), g = function(x) {
4776
4785
  var S = x.query, x = S.index, S = S.range;
4777
- return [x, new xe((x = S.lower) !== null && x !== void 0 ? x : e.MIN_KEY, (S = S.upper) !== null && S !== void 0 ? S : e.MAX_KEY)];
4786
+ return [x, new Te((x = S.lower) !== null && x !== void 0 ? x : e.MIN_KEY, (S = S.upper) !== null && S !== void 0 ? S : e.MAX_KEY)];
4778
4787
  }, R = { get: function(b) {
4779
- return [d, new xe(b.key)];
4788
+ return [d, new Te(b.key)];
4780
4789
  }, getMany: function(b) {
4781
- return [d, new xe().addKeys(b.keys)];
4790
+ return [d, new Te().addKeys(b.keys)];
4782
4791
  }, count: g, query: g, openCursor: g };
4783
4792
  return l(R).forEach(function(b) {
4784
4793
  T[b] = function(x) {
4785
4794
  var S = z.subscr, A = !!S, k = fs(z, o) && hs(b, x) ? x.obsSet = {} : S;
4786
4795
  if (A) {
4787
4796
  var O = function(F) {
4788
- return F = "idb://".concat(t, "/").concat(s, "/").concat(F), k[F] || (k[F] = new xe());
4797
+ return F = "idb://".concat(t, "/").concat(s, "/").concat(F), k[F] || (k[F] = new Te());
4789
4798
  }, M = O(""), I = O(":dels"), S = R[b](x), A = S[0], S = S[1];
4790
4799
  if ((b === "query" && A.isPrimaryKey && !x.values ? I : O(A.name || "")).add(S), !A.isPrimaryKey) {
4791
4800
  if (b !== "count") {
4792
4801
  var D = b === "query" && v && x.values && o.query(a(a({}, x), { values: !1 }));
4793
4802
  return o[b].apply(this, arguments).then(function(F) {
4794
4803
  if (b === "query") {
4795
- if (v && x.values) return D.then(function($) {
4796
- return $ = $.result, M.addKeys($), F;
4804
+ if (v && x.values) return D.then(function(J) {
4805
+ return J = J.result, M.addKeys(J), F;
4797
4806
  });
4798
4807
  var B = x.values ? F.result.map(m) : F.result;
4799
4808
  (x.values ? M : I).addKeys(B);
@@ -4802,8 +4811,8 @@ function sa() {
4802
4811
  return j && Object.create(j, { key: { get: function() {
4803
4812
  return I.addKey(j.primaryKey), j.key;
4804
4813
  } }, primaryKey: { get: function() {
4805
- var $ = j.primaryKey;
4806
- return I.addKey($), $;
4814
+ var J = j.primaryKey;
4815
+ return I.addKey(J), J;
4807
4816
  } }, value: { get: function() {
4808
4817
  return G && M.addKey(j.primaryKey), j.value;
4809
4818
  } } });
@@ -4829,7 +4838,7 @@ function sa() {
4829
4838
  return !(f in n.failures);
4830
4839
  })), t);
4831
4840
  }
4832
- function gr(e, t) {
4841
+ function vr(e, t) {
4833
4842
  return n = e, ((s = t).lower === void 0 || (s.lowerOpen ? 0 < re(n, s.lower) : 0 <= re(n, s.lower))) && (e = e, (t = t).upper === void 0 || (t.upperOpen ? re(e, t.upper) < 0 : re(e, t.upper) <= 0));
4834
4843
  var n, s;
4835
4844
  }
@@ -4837,15 +4846,15 @@ function sa() {
4837
4846
  if (!R || R.length === 0) return e;
4838
4847
  var d = t.query.index, m = d.multiEntry, v = t.query.range, w = s.schema.primaryKey.extractKey, T = d.extractKey, g = (d.lowLevelIndex || d).extractKey, R = R.reduce(function(b, x) {
4839
4848
  var S = b, A = [];
4840
- if (x.type === "add" || x.type === "put") for (var k = new xe(), O = x.values.length - 1; 0 <= O; --O) {
4849
+ if (x.type === "add" || x.type === "put") for (var k = new Te(), O = x.values.length - 1; 0 <= O; --O) {
4841
4850
  var M, I = x.values[O], D = w(I);
4842
4851
  k.hasKey(D) || (M = T(I), (m && p(M) ? M.some(function(j) {
4843
- return gr(j, v);
4844
- }) : gr(M, v)) && (k.addKey(D), A.push(I)));
4852
+ return vr(j, v);
4853
+ }) : vr(M, v)) && (k.addKey(D), A.push(I)));
4845
4854
  }
4846
4855
  switch (x.type) {
4847
4856
  case "add":
4848
- var K = new xe().addKeys(t.values ? b.map(function(G) {
4857
+ var K = new Te().addKeys(t.values ? b.map(function(G) {
4849
4858
  return w(G);
4850
4859
  }) : b), S = b.concat(t.values ? A.filter(function(G) {
4851
4860
  return G = w(G), !K.hasKey(G) && (K.addKey(G), !0);
@@ -4856,7 +4865,7 @@ function sa() {
4856
4865
  }));
4857
4866
  break;
4858
4867
  case "put":
4859
- var N = new xe().addKeys(x.values.map(function(G) {
4868
+ var N = new Te().addKeys(x.values.map(function(G) {
4860
4869
  return w(G);
4861
4870
  }));
4862
4871
  S = b.filter(function(G) {
@@ -4866,7 +4875,7 @@ function sa() {
4866
4875
  }));
4867
4876
  break;
4868
4877
  case "delete":
4869
- var F = new xe().addKeys(x.keys);
4878
+ var F = new Te().addKeys(x.keys);
4870
4879
  S = b.filter(function(G) {
4871
4880
  return !F.hasKey(t.values ? w(G) : G);
4872
4881
  });
@@ -4874,7 +4883,7 @@ function sa() {
4874
4883
  case "deleteRange":
4875
4884
  var B = x.range;
4876
4885
  S = b.filter(function(G) {
4877
- return !gr(w(G), B);
4886
+ return !vr(w(G), B);
4878
4887
  });
4879
4888
  }
4880
4889
  return S;
@@ -4911,7 +4920,7 @@ function sa() {
4911
4920
  e.subscribers.add(n), s.addEventListener("abort", function() {
4912
4921
  var o, f;
4913
4922
  e.subscribers.delete(n), e.subscribers.size === 0 && (o = e, f = t, setTimeout(function() {
4914
- o.subscribers.size === 0 && $e(f, o);
4923
+ o.subscribers.size === 0 && Fe(f, o);
4915
4924
  }, 3e3));
4916
4925
  });
4917
4926
  }
@@ -4923,21 +4932,21 @@ function sa() {
4923
4932
  return function() {
4924
4933
  if (f.abort(), s === "readwrite") {
4925
4934
  for (var w = /* @__PURE__ */ new Set(), T = 0, g = n; T < g.length; T++) {
4926
- var R = g[T], b = yt["idb://".concat(t, "/").concat(R)];
4935
+ var R = g[T], b = vt["idb://".concat(t, "/").concat(R)];
4927
4936
  if (b) {
4928
4937
  var x = e.table(R), S = b.optimisticOps.filter(function(G) {
4929
4938
  return G.trans === m;
4930
4939
  });
4931
- if (m._explicit && v && m.mutatedParts) for (var A = 0, k = Object.values(b.queries.query); A < k.length; A++) for (var O = 0, M = (K = k[A]).slice(); O < M.length; O++) lr((N = M[O]).obsSet, m.mutatedParts) && ($e(K, N), N.subscribers.forEach(function(G) {
4940
+ if (m._explicit && v && m.mutatedParts) for (var A = 0, k = Object.values(b.queries.query); A < k.length; A++) for (var O = 0, M = (K = k[A]).slice(); O < M.length; O++) fr((N = M[O]).obsSet, m.mutatedParts) && (Fe(K, N), N.subscribers.forEach(function(G) {
4932
4941
  return w.add(G);
4933
4942
  }));
4934
4943
  else if (0 < S.length) {
4935
4944
  b.optimisticOps = b.optimisticOps.filter(function(G) {
4936
4945
  return G.trans !== m;
4937
4946
  });
4938
- for (var I = 0, D = Object.values(b.queries.query); I < D.length; I++) for (var K, N, F, B = 0, j = (K = D[I]).slice(); B < j.length; B++) (N = j[B]).res != null && m.mutatedParts && (v && !N.dirty ? (F = Object.isFrozen(N.res), F = ps(N.res, N.req, S, x, N, F), N.dirty ? ($e(K, N), N.subscribers.forEach(function(G) {
4947
+ for (var I = 0, D = Object.values(b.queries.query); I < D.length; I++) for (var K, N, F, B = 0, j = (K = D[I]).slice(); B < j.length; B++) (N = j[B]).res != null && m.mutatedParts && (v && !N.dirty ? (F = Object.isFrozen(N.res), F = ps(N.res, N.req, S, x, N, F), N.dirty ? (Fe(K, N), N.subscribers.forEach(function(G) {
4939
4948
  return w.add(G);
4940
- })) : F !== N.res && (N.res = F, N.promise = U.resolve({ result: F }))) : (N.dirty && $e(K, N), N.subscribers.forEach(function(G) {
4949
+ })) : F !== N.res && (N.res = F, N.promise = U.resolve({ result: F }))) : (N.dirty && Fe(K, N), N.subscribers.forEach(function(G) {
4941
4950
  return w.add(G);
4942
4951
  })));
4943
4952
  }
@@ -4954,26 +4963,26 @@ function sa() {
4954
4963
  return a(a({}, s), { mutate: function(f) {
4955
4964
  var d = z.trans;
4956
4965
  if (o.outbound || d.db._options.cache === "disabled" || d.explicit || d.idbtrans.mode !== "readwrite") return s.mutate(f);
4957
- var m = yt["idb://".concat(t, "/").concat(n)];
4958
- return m ? (d = s.mutate(f), f.type !== "add" && f.type !== "put" || !(50 <= f.values.length || yr(o, f).some(function(v) {
4966
+ var m = vt["idb://".concat(t, "/").concat(n)];
4967
+ return m ? (d = s.mutate(f), f.type !== "add" && f.type !== "put" || !(50 <= f.values.length || gr(o, f).some(function(v) {
4959
4968
  return v == null;
4960
- })) ? (m.optimisticOps.push(f), f.mutatedParts && Rn(f.mutatedParts), d.then(function(v) {
4961
- 0 < v.numFailures && ($e(m.optimisticOps, f), (v = ds(0, f, v)) && m.optimisticOps.push(v), f.mutatedParts && Rn(f.mutatedParts));
4969
+ })) ? (m.optimisticOps.push(f), f.mutatedParts && kn(f.mutatedParts), d.then(function(v) {
4970
+ 0 < v.numFailures && (Fe(m.optimisticOps, f), (v = ds(0, f, v)) && m.optimisticOps.push(v), f.mutatedParts && kn(f.mutatedParts));
4962
4971
  }), d.catch(function() {
4963
- $e(m.optimisticOps, f), f.mutatedParts && Rn(f.mutatedParts);
4972
+ Fe(m.optimisticOps, f), f.mutatedParts && kn(f.mutatedParts);
4964
4973
  })) : d.then(function(v) {
4965
4974
  var w = ds(0, a(a({}, f), { values: f.values.map(function(T, g) {
4966
4975
  var R;
4967
- return v.failures[g] ? T : (T = (R = o.keyPath) !== null && R !== void 0 && R.includes(".") ? ke(T) : a({}, T), ce(T, o.keyPath, v.results[g]), T);
4976
+ return v.failures[g] ? T : (T = (R = o.keyPath) !== null && R !== void 0 && R.includes(".") ? me(T) : a({}, T), ae(T, o.keyPath, v.results[g]), T);
4968
4977
  }) }), v);
4969
4978
  m.optimisticOps.push(w), queueMicrotask(function() {
4970
- return f.mutatedParts && Rn(f.mutatedParts);
4979
+ return f.mutatedParts && kn(f.mutatedParts);
4971
4980
  });
4972
4981
  }), d) : s.mutate(f);
4973
4982
  }, query: function(f) {
4974
4983
  if (!fs(z, s) || !hs("query", f)) return s.query(f);
4975
4984
  var d = ((w = z.trans) === null || w === void 0 ? void 0 : w.db._options.cache) === "immutable", g = z, m = g.requery, v = g.signal, w = function(x, S, A, k) {
4976
- var O = yt["idb://".concat(x, "/").concat(S)];
4985
+ var O = vt["idb://".concat(x, "/").concat(S)];
4977
4986
  if (!O) return [];
4978
4987
  if (!(S = O.queries[A])) return [null, !1, O, null];
4979
4988
  var M = S[(k.query ? k.query.index.name : null) || ""];
@@ -4997,22 +5006,22 @@ function sa() {
4997
5006
  if (T && (T.res = S), d) {
4998
5007
  for (var A = 0, k = S.length; A < k; ++A) Object.freeze(S[A]);
4999
5008
  Object.freeze(S);
5000
- } else x.result = ke(S);
5009
+ } else x.result = me(S);
5001
5010
  return x;
5002
5011
  }).catch(function(x) {
5003
- return b && T && $e(b, T), Promise.reject(x);
5004
- }), T = { obsSet: f.obsSet, promise: g, subscribers: /* @__PURE__ */ new Set(), type: "query", req: f, dirty: !1 }, b ? b.push(T) : (b = [T], (R = R || (yt["idb://".concat(t, "/").concat(n)] = { queries: { query: {}, count: {} }, objs: /* @__PURE__ */ new Map(), optimisticOps: [], unsignaledParts: {} })).queries.query[f.query.index.name || ""] = b)), Ai(T, b, m, v), T.promise.then(function(x) {
5012
+ return b && T && Fe(b, T), Promise.reject(x);
5013
+ }), T = { obsSet: f.obsSet, promise: g, subscribers: /* @__PURE__ */ new Set(), type: "query", req: f, dirty: !1 }, b ? b.push(T) : (b = [T], (R = R || (vt["idb://".concat(t, "/").concat(n)] = { queries: { query: {}, count: {} }, objs: /* @__PURE__ */ new Map(), optimisticOps: [], unsignaledParts: {} })).queries.query[f.query.index.name || ""] = b)), Ai(T, b, m, v), T.promise.then(function(x) {
5005
5014
  return { result: ps(x.result, f, R == null ? void 0 : R.optimisticOps, s, T, d) };
5006
5015
  });
5007
5016
  } });
5008
5017
  } });
5009
5018
  } };
5010
- function On(e, t) {
5019
+ function Mn(e, t) {
5011
5020
  return new Proxy(e, { get: function(n, s, o) {
5012
5021
  return s === "db" ? t : Reflect.get(n, s, o);
5013
5022
  } });
5014
5023
  }
5015
- var Xe = (ge.prototype.version = function(e) {
5024
+ var We = (ge.prototype.version = function(e) {
5016
5025
  if (isNaN(e) || e < 0.1) throw new V.Type("Given version is not a positive number");
5017
5026
  if (e = Math.round(10 * e) / 10, this.idbdb || this._state.isBeingOpened) throw new V.Schema("Cannot add version when database is open");
5018
5027
  this.verno = Math.max(this.verno, e);
@@ -5042,12 +5051,12 @@ function sa() {
5042
5051
  })), this;
5043
5052
  }, ge.prototype.open = function() {
5044
5053
  var e = this;
5045
- return dt(Ze, function() {
5054
+ return mt(et, function() {
5046
5055
  return yi(e);
5047
5056
  });
5048
5057
  }, ge.prototype._close = function() {
5049
- var e = this._state, t = Mt.indexOf(this);
5050
- if (0 <= t && Mt.splice(t, 1), this.idbdb) {
5058
+ var e = this._state, t = Ot.indexOf(this);
5059
+ if (0 <= t && Ot.splice(t, 1), this.idbdb) {
5051
5060
  try {
5052
5061
  this.idbdb.close();
5053
5062
  } catch {
@@ -5072,8 +5081,8 @@ function sa() {
5072
5081
  var m = t._deps.indexedDB.deleteDatabase(t.name);
5073
5082
  m.onsuccess = de(function() {
5074
5083
  var v, w, T;
5075
- v = t._deps, w = t.name, T = v.indexedDB, v = v.IDBKeyRange, ar(T) || w === pn || or(T, v).delete(w).catch(ue), o();
5076
- }), m.onerror = Be(f), m.onblocked = t._fireOnBlocked;
5084
+ v = t._deps, w = t.name, T = v.indexedDB, v = v.IDBKeyRange, ur(T) || w === mn || ar(T, v).delete(w).catch(ue), o();
5085
+ }), m.onerror = Ue(f), m.onblocked = t._fireOnBlocked;
5077
5086
  }
5078
5087
  if (n) throw new V.InvalidArgument("Invalid closeOptions argument to db.delete()");
5079
5088
  s.isBeingOpened ? s.dbReadyPromise.then(d) : d();
@@ -5099,7 +5108,7 @@ function sa() {
5099
5108
  var o = arguments.length;
5100
5109
  if (o < 2) throw new V.InvalidArgument("Too few arguments");
5101
5110
  for (var f = new Array(o - 1); --o; ) f[o - 1] = arguments[o];
5102
- return s = f.pop(), [t, me(f), s];
5111
+ return s = f.pop(), [t, Je(f), s];
5103
5112
  }).apply(this, arguments);
5104
5113
  return this._transaction.apply(this, e);
5105
5114
  }, ge.prototype._transaction = function(e, t, n) {
@@ -5111,13 +5120,13 @@ function sa() {
5111
5120
  if (d = t.map(function(w) {
5112
5121
  if (w = w instanceof s.Table ? w.name : w, typeof w != "string") throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");
5113
5122
  return w;
5114
- }), e == "r" || e === Wn) f = Wn;
5123
+ }), e == "r" || e === Yn) f = Yn;
5115
5124
  else {
5116
- if (e != "rw" && e != Yn) throw new V.InvalidArgument("Invalid transaction mode: " + e);
5117
- f = Yn;
5125
+ if (e != "rw" && e != Qn) throw new V.InvalidArgument("Invalid transaction mode: " + e);
5126
+ f = Qn;
5118
5127
  }
5119
5128
  if (o) {
5120
- if (o.mode === Wn && f === Yn) {
5129
+ if (o.mode === Yn && f === Qn) {
5121
5130
  if (!m) throw new V.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");
5122
5131
  o = null;
5123
5132
  }
@@ -5140,14 +5149,14 @@ function sa() {
5140
5149
  else try {
5141
5150
  A.create(), A.idbtrans._explicit = !0, T._state.PR1398_maxLoop = 3;
5142
5151
  } catch (M) {
5143
- return M.name === jn.InvalidState && T.isOpen() && 0 < --T._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), T.close({ disableAutoOpen: !1 }), T.open().then(function() {
5152
+ return M.name === Ke.InvalidState && T.isOpen() && 0 < --T._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), T.close({ disableAutoOpen: !1 }), T.open().then(function() {
5144
5153
  return w(T, g, R, null, x);
5145
5154
  })) : ye(M);
5146
5155
  }
5147
- var k, O = Ft(x);
5148
- return O && Ot(), S = U.follow(function() {
5156
+ var k, O = rn(x);
5157
+ return O && kt(), S = U.follow(function() {
5149
5158
  var M;
5150
- (k = x.call(A, A)) && (O ? (M = tt.bind(null, null), k.then(M, M)) : typeof k.next == "function" && typeof k.throw == "function" && (k = pr(k)));
5159
+ (k = x.call(A, A)) && (O ? (M = nt.bind(null, null), k.then(M, M)) : typeof k.next == "function" && typeof k.throw == "function" && (k = mr(k)));
5151
5160
  }, S), (k && typeof k.then == "function" ? U.resolve(k).then(function(M) {
5152
5161
  return A.active ? M : ye(new V.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
5153
5162
  }) : S.then(function() {
@@ -5161,7 +5170,7 @@ function sa() {
5161
5170
  });
5162
5171
  });
5163
5172
  }).bind(null, this, f, d, o, n);
5164
- return o ? o._promise(f, v, "lock") : z.trans ? dt(z.transless, function() {
5173
+ return o ? o._promise(f, v, "lock") : z.trans ? mt(z.transless, function() {
5165
5174
  return s._whenReady(v);
5166
5175
  }) : this._whenReady(v);
5167
5176
  }, ge.prototype.table = function(e) {
@@ -5178,7 +5187,7 @@ function sa() {
5178
5187
  w.dbReadyResolve = g;
5179
5188
  }), w.openCanceller = new U(function(g, R) {
5180
5189
  w.cancelOpen = R;
5181
- }), this._state = w, this.name = e, this.on = Gt(this, "populate", "blocked", "versionchange", "close", { ready: [Kn, ue] }), this.on.ready.subscribe = oe(this.on.ready.subscribe, function(g) {
5190
+ }), this._state = w, this.name = e, this.on = qt(this, "populate", "blocked", "versionchange", "close", { ready: [Bn, ue] }), this.on.ready.subscribe = ce(this.on.ready.subscribe, function(g) {
5182
5191
  return function(R, b) {
5183
5192
  ge.vip(function() {
5184
5193
  var x, S = n._state;
@@ -5187,7 +5196,7 @@ function sa() {
5187
5196
  }));
5188
5197
  });
5189
5198
  };
5190
- }), this.Collection = (o = this, Ht(ii.prototype, function(k, A) {
5199
+ }), this.Collection = (o = this, Gt(ii.prototype, function(k, A) {
5191
5200
  this.db = o;
5192
5201
  var b = Vr, x = null;
5193
5202
  if (A) try {
@@ -5196,12 +5205,12 @@ function sa() {
5196
5205
  x = O;
5197
5206
  }
5198
5207
  var S = k._ctx, A = S.table, k = A.hook.reading.fire;
5199
- this._ctx = { table: A, index: S.index, isPrimKey: !S.index || A.schema.primKey.keyPath && S.index === A.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: S.or, valueMapper: k !== jt ? k : null };
5200
- })), this.Table = (f = this, Ht(Qr.prototype, function(g, R, b) {
5201
- this.db = f, this._tx = b, this.name = g, this.schema = R, this.hook = f._allTables[g] ? f._allTables[g].hook : Gt(null, { creating: [Qs, ue], reading: [Ys, jt], updating: [Js, ue], deleting: [$s, ue] });
5202
- })), this.Transaction = (d = this, Ht(ui.prototype, function(g, R, b, x, S) {
5208
+ this._ctx = { table: A, index: S.index, isPrimKey: !S.index || A.schema.primKey.keyPath && S.index === A.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: S.or, valueMapper: k !== Ft ? k : null };
5209
+ })), this.Table = (f = this, Gt(Qr.prototype, function(g, R, b) {
5210
+ this.db = f, this._tx = b, this.name = g, this.schema = R, this.hook = f._allTables[g] ? f._allTables[g].hook : qt(null, { creating: [Qs, ue], reading: [Ys, Ft], updating: [Js, ue], deleting: [$s, ue] });
5211
+ })), this.Transaction = (d = this, Gt(ui.prototype, function(g, R, b, x, S) {
5203
5212
  var A = this;
5204
- this.db = d, this.mode = g, this.storeNames = R, this.schema = b, this.chromeTransactionDurability = x, this.idbtrans = null, this.on = Gt(this, "complete", "error", "abort"), this.parent = S || 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 U(function(k, O) {
5213
+ this.db = d, this.mode = g, this.storeNames = R, this.schema = b, this.chromeTransactionDurability = x, this.idbtrans = null, this.on = qt(this, "complete", "error", "abort"), this.parent = S || 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 U(function(k, O) {
5205
5214
  A._resolve = k, A._reject = O;
5206
5215
  }), this._completion.then(function() {
5207
5216
  A.active = !1, A.on.complete.fire();
@@ -5209,9 +5218,9 @@ function sa() {
5209
5218
  var O = A.active;
5210
5219
  return A.active = !1, A.on.error.fire(k), A.parent ? A.parent._reject(k) : O && A.idbtrans && A.idbtrans.abort(), ye(k);
5211
5220
  });
5212
- })), this.Version = (m = this, Ht(mi.prototype, function(g) {
5221
+ })), this.Version = (m = this, Gt(mi.prototype, function(g) {
5213
5222
  this.db = m, this._cfg = { version: g, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
5214
- })), this.WhereClause = (v = this, Ht(ts.prototype, function(g, R, b) {
5223
+ })), this.WhereClause = (v = this, Gt(ts.prototype, function(g, R, b) {
5215
5224
  if (this.db = v, this._ctx = { table: g, index: R === ":id" ? null : R, or: b }, this._cmp = this._ascending = re, this._descending = function(x, S) {
5216
5225
  return re(S, x);
5217
5226
  }, this._max = function(x, S) {
@@ -5223,10 +5232,10 @@ function sa() {
5223
5232
  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 });
5224
5233
  }), this.on("blocked", function(g) {
5225
5234
  !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));
5226
- }), this._maxKey = Wt(t.IDBKeyRange), this._createTransaction = function(g, R, b, x) {
5235
+ }), this._maxKey = Xt(t.IDBKeyRange), this._createTransaction = function(g, R, b, x) {
5227
5236
  return new n.Transaction(g, R, b, n._options.chromeTransactionDurability, x);
5228
5237
  }, this._fireOnBlocked = function(g) {
5229
- n.on("blocked").fire(g), Mt.filter(function(R) {
5238
+ n.on("blocked").fire(g), Ot.filter(function(R) {
5230
5239
  return R.name === n.name && R !== n && !R._state.vcFired;
5231
5240
  }).map(function(R) {
5232
5241
  return R.on("versionchange").fire(g);
@@ -5235,64 +5244,64 @@ function sa() {
5235
5244
  var T = new Proxy(this, { get: function(g, R, b) {
5236
5245
  if (R === "_vip") return !0;
5237
5246
  if (R === "table") return function(S) {
5238
- return On(n.table(S), T);
5247
+ return Mn(n.table(S), T);
5239
5248
  };
5240
5249
  var x = Reflect.get(g, R, b);
5241
- return x instanceof Qr ? On(x, T) : R === "tables" ? x.map(function(S) {
5242
- return On(S, T);
5250
+ return x instanceof Qr ? Mn(x, T) : R === "tables" ? x.map(function(S) {
5251
+ return Mn(S, T);
5243
5252
  }) : R === "_createTransaction" ? function() {
5244
- return On(x.apply(this, arguments), T);
5253
+ return Mn(x.apply(this, arguments), T);
5245
5254
  } : x;
5246
5255
  } });
5247
5256
  this.vip = T, s.forEach(function(g) {
5248
5257
  return g(n);
5249
5258
  });
5250
5259
  }
5251
- var Mn, Ce = typeof Symbol < "u" && "observable" in Symbol ? Symbol.observable : "@@observable", Ti = (vr.prototype.subscribe = function(e, t, n) {
5260
+ var Pn, Ce = typeof Symbol < "u" && "observable" in Symbol ? Symbol.observable : "@@observable", Ti = (br.prototype.subscribe = function(e, t, n) {
5252
5261
  return this._subscribe(e && typeof e != "function" ? e : { next: e, error: t, complete: n });
5253
- }, vr.prototype[Ce] = function() {
5262
+ }, br.prototype[Ce] = function() {
5254
5263
  return this;
5255
- }, vr);
5256
- function vr(e) {
5264
+ }, br);
5265
+ function br(e) {
5257
5266
  this._subscribe = e;
5258
5267
  }
5259
5268
  try {
5260
- Mn = { indexedDB: c.indexedDB || c.mozIndexedDB || c.webkitIndexedDB || c.msIndexedDB, IDBKeyRange: c.IDBKeyRange || c.webkitIDBKeyRange };
5269
+ Pn = { indexedDB: c.indexedDB || c.mozIndexedDB || c.webkitIndexedDB || c.msIndexedDB, IDBKeyRange: c.IDBKeyRange || c.webkitIDBKeyRange };
5261
5270
  } catch {
5262
- Mn = { indexedDB: null, IDBKeyRange: null };
5271
+ Pn = { indexedDB: null, IDBKeyRange: null };
5263
5272
  }
5264
5273
  function ys(e) {
5265
5274
  var t, n = !1, s = new Ti(function(o) {
5266
- var f = Ft(e), d, m = !1, v = {}, w = {}, T = { get closed() {
5275
+ var f = rn(e), d, m = !1, v = {}, w = {}, T = { get closed() {
5267
5276
  return m;
5268
5277
  }, unsubscribe: function() {
5269
- m || (m = !0, d && d.abort(), g && st.storagemutated.unsubscribe(b));
5278
+ m || (m = !0, d && d.abort(), g && it.storagemutated.unsubscribe(b));
5270
5279
  } };
5271
5280
  o.start && o.start(T);
5272
5281
  var g = !1, R = function() {
5273
- return Xn(x);
5282
+ return Wn(x);
5274
5283
  }, b = function(S) {
5275
- Sn(v, S), lr(w, v) && R();
5284
+ Rn(v, S), fr(w, v) && R();
5276
5285
  }, x = function() {
5277
5286
  var S, A, k;
5278
- !m && Mn.indexedDB && (v = {}, S = {}, d && d.abort(), d = new AbortController(), k = function(O) {
5279
- var M = Rt();
5287
+ !m && Pn.indexedDB && (v = {}, S = {}, d && d.abort(), d = new AbortController(), k = function(O) {
5288
+ var M = St();
5280
5289
  try {
5281
- f && Ot();
5282
- var I = et(e, O);
5283
- return I = f ? I.finally(tt) : I;
5290
+ f && kt();
5291
+ var I = tt(e, O);
5292
+ return I = f ? I.finally(nt) : I;
5284
5293
  } finally {
5285
- M && kt();
5294
+ M && Rt();
5286
5295
  }
5287
5296
  }(A = { subscr: S, signal: d.signal, requery: R, querier: e, trans: null }), Promise.resolve(k).then(function(O) {
5288
5297
  n = !0, t = O, m || A.signal.aborted || (v = {}, function(M) {
5289
5298
  for (var I in M) if (_(M, I)) return;
5290
5299
  return 1;
5291
- }(w = S) || g || (st(Xt, b), g = !0), Xn(function() {
5300
+ }(w = S) || g || (it(Vt, b), g = !0), Wn(function() {
5292
5301
  return !m && o.next && o.next(O);
5293
5302
  }));
5294
5303
  }, function(O) {
5295
- n = !1, ["DatabaseClosedError", "AbortError"].includes(O == null ? void 0 : O.name) || m || Xn(function() {
5304
+ n = !1, ["DatabaseClosedError", "AbortError"].includes(O == null ? void 0 : O.name) || m || Wn(function() {
5296
5305
  m || o.error && o.error(O);
5297
5306
  });
5298
5307
  }));
@@ -5305,32 +5314,32 @@ function sa() {
5305
5314
  return t;
5306
5315
  }, s;
5307
5316
  }
5308
- var gt = Xe;
5309
- function br(e) {
5310
- var t = it;
5317
+ var bt = We;
5318
+ function wr(e) {
5319
+ var t = ot;
5311
5320
  try {
5312
- it = !0, st.storagemutated.fire(e), dr(e, !0);
5321
+ ot = !0, it.storagemutated.fire(e), pr(e, !0);
5313
5322
  } finally {
5314
- it = t;
5323
+ ot = t;
5315
5324
  }
5316
5325
  }
5317
- P(gt, a(a({}, sn), { delete: function(e) {
5318
- return new gt(e, { addons: [] }).delete();
5326
+ P(bt, a(a({}, on), { delete: function(e) {
5327
+ return new bt(e, { addons: [] }).delete();
5319
5328
  }, exists: function(e) {
5320
- return new gt(e, { addons: [] }).open().then(function(t) {
5329
+ return new bt(e, { addons: [] }).open().then(function(t) {
5321
5330
  return t.close(), !0;
5322
5331
  }).catch("NoSuchDatabaseError", function() {
5323
5332
  return !1;
5324
5333
  });
5325
5334
  }, getDatabaseNames: function(e) {
5326
5335
  try {
5327
- return t = gt.dependencies, n = t.indexedDB, t = t.IDBKeyRange, (ar(n) ? Promise.resolve(n.databases()).then(function(s) {
5336
+ return t = bt.dependencies, n = t.indexedDB, t = t.IDBKeyRange, (ur(n) ? Promise.resolve(n.databases()).then(function(s) {
5328
5337
  return s.map(function(o) {
5329
5338
  return o.name;
5330
5339
  }).filter(function(o) {
5331
- return o !== pn;
5340
+ return o !== mn;
5332
5341
  });
5333
- }) : or(n, t).toCollection().primaryKeys()).then(e);
5342
+ }) : ar(n, t).toCollection().primaryKeys()).then(e);
5334
5343
  } catch {
5335
5344
  return ye(new V.MissingAPI());
5336
5345
  }
@@ -5340,11 +5349,11 @@ function sa() {
5340
5349
  h(this, e);
5341
5350
  };
5342
5351
  }, ignoreTransaction: function(e) {
5343
- return z.trans ? dt(z.transless, e) : e();
5344
- }, vip: ur, async: function(e) {
5352
+ return z.trans ? mt(z.transless, e) : e();
5353
+ }, vip: cr, async: function(e) {
5345
5354
  return function() {
5346
5355
  try {
5347
- var t = pr(e.apply(this, arguments));
5356
+ var t = mr(e.apply(this, arguments));
5348
5357
  return t && typeof t.then == "function" ? t : U.resolve(t);
5349
5358
  } catch (n) {
5350
5359
  return ye(n);
@@ -5352,7 +5361,7 @@ function sa() {
5352
5361
  };
5353
5362
  }, spawn: function(e, t, n) {
5354
5363
  try {
5355
- var s = pr(e.apply(n, t || []));
5364
+ var s = mr(e.apply(n, t || []));
5356
5365
  return s && typeof s.then == "function" ? s : U.resolve(s);
5357
5366
  } catch (o) {
5358
5367
  return ye(o);
@@ -5360,57 +5369,57 @@ function sa() {
5360
5369
  }, currentTransaction: { get: function() {
5361
5370
  return z.trans || null;
5362
5371
  } }, waitFor: function(e, t) {
5363
- return t = U.resolve(typeof e == "function" ? gt.ignoreTransaction(e) : e).timeout(t || 6e4), z.trans ? z.trans.waitFor(t) : t;
5372
+ return t = U.resolve(typeof e == "function" ? bt.ignoreTransaction(e) : e).timeout(t || 6e4), z.trans ? z.trans.waitFor(t) : t;
5364
5373
  }, Promise: U, debug: { get: function() {
5365
- return Ke;
5374
+ return Be;
5366
5375
  }, set: function(e) {
5367
5376
  Kr(e);
5368
- } }, derive: X, extend: h, props: P, override: oe, Events: Gt, on: st, liveQuery: ys, extendObservabilitySet: Sn, getByKeyPath: ve, setByKeyPath: ce, delByKeyPath: function(e, t) {
5369
- typeof t == "string" ? ce(e, t, void 0) : "length" in t && [].map.call(t, function(n) {
5370
- ce(e, n, void 0);
5377
+ } }, derive: X, extend: h, props: P, override: ce, Events: qt, on: it, liveQuery: ys, extendObservabilitySet: Rn, getByKeyPath: ve, setByKeyPath: ae, delByKeyPath: function(e, t) {
5378
+ typeof t == "string" ? ae(e, t, void 0) : "length" in t && [].map.call(t, function(n) {
5379
+ ae(e, n, void 0);
5371
5380
  });
5372
- }, shallowClone: Fe, deepClone: ke, getObjectDiff: mr, cmp: re, asap: Ae, minKey: -1 / 0, addons: [], connections: Mt, errnames: jn, dependencies: Mn, cache: yt, semVer: "4.0.11", version: "4.0.11".split(".").map(function(e) {
5381
+ }, shallowClone: Le, deepClone: me, getObjectDiff: yr, cmp: re, asap: Ae, minKey: -1 / 0, addons: [], connections: Ot, errnames: Ke, dependencies: Pn, cache: vt, semVer: "4.0.11", version: "4.0.11".split(".").map(function(e) {
5373
5382
  return parseInt(e);
5374
5383
  }).reduce(function(e, t, n) {
5375
5384
  return e + t / Math.pow(10, 2 * n);
5376
- }) })), gt.maxKey = Wt(gt.dependencies.IDBKeyRange), typeof dispatchEvent < "u" && typeof addEventListener < "u" && (st(Xt, function(e) {
5377
- it || (e = new CustomEvent(Zn, { detail: e }), it = !0, dispatchEvent(e), it = !1);
5378
- }), addEventListener(Zn, function(e) {
5379
- e = e.detail, it || br(e);
5385
+ }) })), bt.maxKey = Xt(bt.dependencies.IDBKeyRange), typeof dispatchEvent < "u" && typeof addEventListener < "u" && (it(Vt, function(e) {
5386
+ ot || (e = new CustomEvent(er, { detail: e }), ot = !0, dispatchEvent(e), ot = !1);
5387
+ }), addEventListener(er, function(e) {
5388
+ e = e.detail, ot || wr(e);
5380
5389
  }));
5381
- var It, it = !1, gs = function() {
5390
+ var Ct, ot = !1, gs = function() {
5382
5391
  };
5383
5392
  return typeof BroadcastChannel < "u" && ((gs = function() {
5384
- (It = new BroadcastChannel(Zn)).onmessage = function(e) {
5385
- return e.data && br(e.data);
5393
+ (Ct = new BroadcastChannel(er)).onmessage = function(e) {
5394
+ return e.data && wr(e.data);
5386
5395
  };
5387
- })(), typeof It.unref == "function" && It.unref(), st(Xt, function(e) {
5388
- it || It.postMessage(e);
5396
+ })(), typeof Ct.unref == "function" && Ct.unref(), it(Vt, function(e) {
5397
+ ot || Ct.postMessage(e);
5389
5398
  })), typeof addEventListener < "u" && (addEventListener("pagehide", function(e) {
5390
- if (!Xe.disableBfCache && e.persisted) {
5391
- Ke && console.debug("Dexie: handling persisted pagehide"), It != null && It.close();
5392
- for (var t = 0, n = Mt; t < n.length; t++) n[t].close({ disableAutoOpen: !1 });
5399
+ if (!We.disableBfCache && e.persisted) {
5400
+ Be && console.debug("Dexie: handling persisted pagehide"), Ct != null && Ct.close();
5401
+ for (var t = 0, n = Ot; t < n.length; t++) n[t].close({ disableAutoOpen: !1 });
5393
5402
  }
5394
5403
  }), addEventListener("pageshow", function(e) {
5395
- !Xe.disableBfCache && e.persisted && (Ke && console.debug("Dexie: handling persisted pageshow"), gs(), br({ all: new xe(-1 / 0, [[]]) }));
5404
+ !We.disableBfCache && e.persisted && (Be && console.debug("Dexie: handling persisted pageshow"), gs(), wr({ all: new Te(-1 / 0, [[]]) }));
5396
5405
  })), U.rejectionMapper = function(e, t) {
5397
- return !e || e instanceof je || e instanceof TypeError || e instanceof SyntaxError || !e.name || !jr[e.name] ? e : (t = new jr[e.name](t || e.message, e), "stack" in e && q(t, "stack", { get: function() {
5406
+ return !e || e instanceof Ze || e instanceof TypeError || e instanceof SyntaxError || !e.name || !jr[e.name] ? e : (t = new jr[e.name](t || e.message, e), "stack" in e && q(t, "stack", { get: function() {
5398
5407
  return this.inner.stack;
5399
5408
  } }), t);
5400
- }, Kr(Ke), a(Xe, Object.freeze({ __proto__: null, Dexie: Xe, liveQuery: ys, Entity: Xr, cmp: re, PropModification: zt, replacePrefix: function(e, t) {
5401
- return new zt({ replacePrefix: [e, t] });
5409
+ }, Kr(Be), a(We, Object.freeze({ __proto__: null, Dexie: We, liveQuery: ys, Entity: Xr, cmp: re, PropModification: Ht, replacePrefix: function(e, t) {
5410
+ return new Ht({ replacePrefix: [e, t] });
5402
5411
  }, add: function(e) {
5403
- return new zt({ add: e });
5412
+ return new Ht({ add: e });
5404
5413
  }, remove: function(e) {
5405
- return new zt({ remove: e });
5406
- }, default: Xe, RangeSet: xe, mergeRanges: $t, rangesOverlap: os }), { default: Xe }), Xe;
5414
+ return new Ht({ remove: e });
5415
+ }, default: We, RangeSet: Te, mergeRanges: Qt, rangesOverlap: os }), { default: We }), We;
5407
5416
  });
5408
- }(Ln)), Ln.exports;
5417
+ }(Dn)), Dn.exports;
5409
5418
  }
5410
5419
  var ia = sa();
5411
- const Dr = /* @__PURE__ */ na(ia), Ls = Symbol.for("Dexie"), Nn = globalThis[Ls] || (globalThis[Ls] = Dr);
5412
- if (Dr.semVer !== Nn.semVer)
5413
- throw new Error(`Two different versions of Dexie loaded in the same app: ${Dr.semVer} and ${Nn.semVer}`);
5420
+ const Nr = /* @__PURE__ */ na(ia), Ls = Symbol.for("Dexie"), Fn = globalThis[Ls] || (globalThis[Ls] = Nr);
5421
+ if (Nr.semVer !== Fn.semVer)
5422
+ throw new Error(`Two different versions of Dexie loaded in the same app: ${Nr.semVer} and ${Fn.semVer}`);
5414
5423
  const {
5415
5424
  liveQuery: pa,
5416
5425
  mergeRanges: ma,
@@ -5422,7 +5431,7 @@ const {
5422
5431
  replacePrefix: _a,
5423
5432
  add: Aa,
5424
5433
  remove: xa
5425
- } = Nn;
5434
+ } = Fn;
5426
5435
  class oa {
5427
5436
  /**
5428
5437
  * 构造函数
@@ -5434,7 +5443,7 @@ class oa {
5434
5443
  this.version = i, this.dbName = r, this.dbInit();
5435
5444
  }
5436
5445
  dbInit() {
5437
- this.db = new Nn(this.dbName), this.materialMap = {}, this.db.version(this.version).stores({ models: "&version, path, data" });
5446
+ this.db = new Fn(this.dbName), this.materialMap = {}, this.db.version(this.version).stores({ models: "&version, path, data" });
5438
5447
  }
5439
5448
  /**
5440
5449
  * 获取 Dexie 数据库实例
@@ -5502,12 +5511,12 @@ class oa {
5502
5511
  * @returns {THREE.BufferGeometry} 反序列化后的几何体
5503
5512
  */
5504
5513
  reSerGeometry(r) {
5505
- const { type: i, attributes: a, index: u } = r, c = new bt.BufferGeometry();
5514
+ const { type: i, attributes: a, index: u } = r, c = new _t.BufferGeometry();
5506
5515
  return Object.keys(a).forEach((l) => {
5507
5516
  const { type: p, array: h, itemSize: y } = a[l];
5508
5517
  c.setAttribute(
5509
5518
  l,
5510
- new bt.BufferAttribute(new Float32Array(h), y)
5519
+ new _t.BufferAttribute(new Float32Array(h), y)
5511
5520
  );
5512
5521
  }), u && c.setIndex(u.array), c;
5513
5522
  }
@@ -5539,9 +5548,9 @@ class oa {
5539
5548
  */
5540
5549
  reSerMaterial(r) {
5541
5550
  if (this.materialMap[r.name]) return this.materialMap[r.name];
5542
- const { type: i, ...a } = r, u = i || "MeshStandardMaterial", c = new bt[u]({ ...a });
5551
+ const { type: i, ...a } = r, u = i || "MeshStandardMaterial", c = new _t[u]({ ...a });
5543
5552
  if (r.map) {
5544
- const l = new bt.TextureLoader().load(r.map);
5553
+ const l = new _t.TextureLoader().load(r.map);
5545
5554
  c.map = l;
5546
5555
  }
5547
5556
  return c.needsUpdate = !0, this.materialMap[r.name] = c, c;
@@ -5556,13 +5565,13 @@ class oa {
5556
5565
  switch (r.type) {
5557
5566
  case "Mesh":
5558
5567
  const a = this.reSerGeometry(r.geometry), u = this.reSerMaterial(r.material);
5559
- i = new bt.Mesh(a, u);
5568
+ i = new _t.Mesh(a, u);
5560
5569
  break;
5561
5570
  case "Group":
5562
- i = new bt.Group();
5571
+ i = new _t.Group();
5563
5572
  break;
5564
5573
  case "Object3D":
5565
- i = new bt.Object3D();
5574
+ i = new _t.Object3D();
5566
5575
  break;
5567
5576
  default:
5568
5577
  return console.warn(`Unsupported object type: ${r.type}`), null;
@@ -5611,7 +5620,7 @@ class oa {
5611
5620
  }
5612
5621
  }
5613
5622
  }
5614
- let In;
5623
+ let Ln;
5615
5624
  const Ta = () => {
5616
5625
  const C = new vo(), r = new yo();
5617
5626
  r.setDecoderPath("/draco/"), C.setDRACOLoader(r);
@@ -5624,11 +5633,11 @@ const Ta = () => {
5624
5633
  });
5625
5634
  }
5626
5635
  async function u(c, l, p) {
5627
- In || (In = new oa());
5628
- const h = await In.loadCachedModel(l);
5636
+ Ln || (Ln = new oa());
5637
+ const h = await Ln.loadCachedModel(l);
5629
5638
  return h || new Promise((y, E) => {
5630
5639
  C.load(c, y, p, E);
5631
- }).then(async (y) => (await In.cacheModel(c, y.scene, l), y.scene));
5640
+ }).then(async (y) => (await Ln.cacheModel(c, y.scene, l), y.scene));
5632
5641
  }
5633
5642
  return {
5634
5643
  load: i,
@@ -5642,6 +5651,6 @@ export {
5642
5651
  da as b,
5643
5652
  Ta as c,
5644
5653
  ha as i,
5645
- We as o,
5654
+ Ye as o,
5646
5655
  la as u
5647
5656
  };