@readium/navigator 2.0.0-beta.13 → 2.0.0-beta.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- let VA = class qe {
1
+ let jA = class Ke {
2
2
  /**
3
3
  * Creates a [Encryption].
4
4
  */
@@ -10,7 +10,7 @@ let VA = class qe {
10
10
  */
11
11
  static deserialize(t) {
12
12
  if (t && t.algorithm)
13
- return new qe({
13
+ return new Ke({
14
14
  algorithm: t.algorithm,
15
15
  compression: t.compression,
16
16
  originalLength: t.originalLength,
@@ -55,10 +55,10 @@ class y {
55
55
  }
56
56
  Object.defineProperty(y.prototype, "encryption", {
57
57
  get: function() {
58
- return VA.deserialize(this.otherProperties.encrypted);
58
+ return jA.deserialize(this.otherProperties.encrypted);
59
59
  }
60
60
  });
61
- var p = /* @__PURE__ */ ((n) => (n.fixed = "fixed", n.reflowable = "reflowable", n))(p || {}), it = /* @__PURE__ */ ((n) => (n.auto = "auto", n.landscape = "landscape", n.portrait = "portrait", n))(it || {}), J = /* @__PURE__ */ ((n) => (n.left = "left", n.right = "right", n.center = "center", n))(J || {}), Ut = /* @__PURE__ */ ((n) => (n.auto = "auto", n.both = "both", n.none = "none", n.landscape = "landscape", n))(Ut || {});
61
+ var p = /* @__PURE__ */ ((i) => (i.fixed = "fixed", i.reflowable = "reflowable", i))(p || {}), it = /* @__PURE__ */ ((i) => (i.auto = "auto", i.landscape = "landscape", i.portrait = "portrait", i))(it || {}), J = /* @__PURE__ */ ((i) => (i.left = "left", i.right = "right", i.center = "center", i))(J || {}), Ut = /* @__PURE__ */ ((i) => (i.auto = "auto", i.both = "both", i.none = "none", i.landscape = "landscape", i))(Ut || {});
62
62
  y.prototype.getContains = function() {
63
63
  return new Set(this.otherProperties.contains || []);
64
64
  };
@@ -68,16 +68,16 @@ y.prototype.getLayout = function() {
68
68
  let Ct = class u {
69
69
  /** Creates a MediaType object. */
70
70
  constructor(t) {
71
- let e, A, i = t.mediaType.replace(/\s/g, "").split(";");
72
- const r = i[0].split("/");
71
+ let e, A, n = t.mediaType.replace(/\s/g, "").split(";");
72
+ const r = n[0].split("/");
73
73
  if (r.length === 2) {
74
74
  if (e = r[0].toLowerCase().trim(), A = r[1].toLowerCase().trim(), e.length === 0 || A.length === 0)
75
75
  throw new Error("Invalid media type");
76
76
  } else
77
77
  throw new Error("Invalid media type");
78
78
  const s = {};
79
- for (let g = 1; g < i.length; g++) {
80
- const m = i[g].split("=");
79
+ for (let g = 1; g < n.length; g++) {
80
+ const m = n[g].split("=");
81
81
  if (m.length === 2) {
82
82
  const M = m[0].toLocaleLowerCase(), B = M === "charset" ? m[1].toUpperCase() : m[1];
83
83
  s[M] = B;
@@ -129,11 +129,11 @@ let Ct = class u {
129
129
  return !1;
130
130
  const A = new Set(
131
131
  Object.entries(this.parameters).map(([r, s]) => `${r}=${s}`)
132
- ), i = new Set(
132
+ ), n = new Set(
133
133
  Object.entries(e.parameters).map(([r, s]) => `${r}=${s}`)
134
134
  );
135
135
  for (const r of Array.from(A.values()))
136
- if (!i.has(r))
136
+ if (!n.has(r))
137
137
  return !1;
138
138
  return !0;
139
139
  }
@@ -519,7 +519,7 @@ let Ct = class u {
519
519
  fileExtension: "zip"
520
520
  });
521
521
  }
522
- }, Me = class {
522
+ }, me = class {
523
523
  constructor(t) {
524
524
  this.uri = t, this.parameters = this.getParameters(t);
525
525
  }
@@ -529,7 +529,7 @@ let Ct = class u {
529
529
  getParameters(t) {
530
530
  const e = /\{\??([^}]+)\}/g, A = t.match(e);
531
531
  return A ? new Set(
532
- A.join(",").replace(e, "$1").split(",").map((i) => i.trim())
532
+ A.join(",").replace(e, "$1").split(",").map((n) => n.trim())
533
533
  ) : /* @__PURE__ */ new Set();
534
534
  }
535
535
  /** Expands the URI by replacing the template variables by the given parameters.
@@ -537,36 +537,36 @@ let Ct = class u {
537
537
  * See RFC 6570 on URI template: https://tools.ietf.org/html/rfc6570
538
538
  */
539
539
  expand(t) {
540
- const e = (i) => i.split(",").map((r) => {
540
+ const e = (n) => n.split(",").map((r) => {
541
541
  const s = t[r];
542
542
  return s ? encodeURIComponent(s) : "";
543
- }).join(","), A = (i) => "?" + i.split(",").map((r) => {
543
+ }).join(","), A = (n) => "?" + n.split(",").map((r) => {
544
544
  const s = r.split("=")[0], o = t[s];
545
545
  return o ? `${s}=${encodeURIComponent(o)}` : "";
546
546
  }).join("&");
547
- return this.uri.replace(/\{(\??)([^}]+)\}/g, (...i) => i[1] ? A(i[2]) : e(i[2]));
547
+ return this.uri.replace(/\{(\??)([^}]+)\}/g, (...n) => n[1] ? A(n[2]) : e(n[2]));
548
548
  }
549
549
  };
550
- function PA(n) {
551
- return n && n instanceof Array ? n : void 0;
550
+ function VA(i) {
551
+ return i && i instanceof Array ? i : void 0;
552
552
  }
553
- function _e(n) {
554
- return n && typeof n == "string" ? [n] : PA(n);
553
+ function qe(i) {
554
+ return i && typeof i == "string" ? [i] : VA(i);
555
555
  }
556
- function fe(n) {
557
- return typeof n == "string" ? new Date(n) : void 0;
556
+ function Me(i) {
557
+ return typeof i == "string" ? new Date(i) : void 0;
558
558
  }
559
- function Bt(n) {
560
- return isNaN(n) ? void 0 : n;
559
+ function Bt(i) {
560
+ return isNaN(i) ? void 0 : i;
561
561
  }
562
- function V(n) {
563
- return Bt(n) !== void 0 && Math.sign(n) >= 0 ? n : void 0;
562
+ function P(i) {
563
+ return Bt(i) !== void 0 && Math.sign(i) >= 0 ? i : void 0;
564
564
  }
565
- function DA(n) {
565
+ function PA(i) {
566
566
  const t = new Array();
567
- return n.forEach((e) => t.push(e)), t;
567
+ return i.forEach((e) => t.push(e)), t;
568
568
  }
569
- let H = class $e {
569
+ class T {
570
570
  /**
571
571
  * Creates a [Locations].
572
572
  */
@@ -579,7 +579,7 @@ let H = class $e {
579
579
  static deserialize(t) {
580
580
  if (!t)
581
581
  return;
582
- const e = Bt(t.progression), A = Bt(t.totalProgression), i = Bt(t.position), r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set([
582
+ const e = Bt(t.progression), A = Bt(t.totalProgression), n = Bt(t.position), r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set([
583
583
  "fragment",
584
584
  "fragments",
585
585
  "progression",
@@ -588,11 +588,11 @@ let H = class $e {
588
588
  ]);
589
589
  return Object.entries(t).forEach(([o, a]) => {
590
590
  s.has(o) || r.set(o, a);
591
- }), new $e({
592
- fragments: _e(t.fragments || t.fragment),
591
+ }), new T({
592
+ fragments: qe(t.fragments || t.fragment),
593
593
  progression: e !== void 0 && e >= 0 && e <= 1 ? e : void 0,
594
594
  totalProgression: A !== void 0 && A >= 0 && A <= 1 ? A : void 0,
595
- position: i !== void 0 && i > 0 ? i : void 0,
595
+ position: n !== void 0 && n > 0 ? n : void 0,
596
596
  otherLocations: r.size === 0 ? void 0 : r
597
597
  });
598
598
  }
@@ -603,7 +603,8 @@ let H = class $e {
603
603
  const t = {};
604
604
  return this.fragments && (t.fragments = this.fragments), this.progression !== void 0 && (t.progression = this.progression), this.totalProgression !== void 0 && (t.totalProgression = this.totalProgression), this.position !== void 0 && (t.position = this.position), this.otherLocations && this.otherLocations.forEach((e, A) => t[A] = e), t;
605
605
  }
606
- }, vA = class tA {
606
+ }
607
+ let DA = class _e {
607
608
  /**
608
609
  * Creates a [Text].
609
610
  */
@@ -615,7 +616,7 @@ let H = class $e {
615
616
  */
616
617
  static deserialize(t) {
617
618
  if (t)
618
- return new tA({
619
+ return new _e({
619
620
  after: t.after,
620
621
  before: t.before,
621
622
  highlight: t.highlight
@@ -633,7 +634,7 @@ let H = class $e {
633
634
  * Creates a [Locator].
634
635
  */
635
636
  constructor(t) {
636
- this.href = t.href, this.type = t.type, this.title = t.title, this.locations = t.locations ? t.locations : new H({}), this.text = t.text;
637
+ this.href = t.href, this.type = t.type, this.title = t.title, this.locations = t.locations ? t.locations : new T({}), this.text = t.text;
637
638
  }
638
639
  /**
639
640
  * Parses a [Link] from its RWPM JSON representation.
@@ -644,8 +645,8 @@ let H = class $e {
644
645
  href: t.href,
645
646
  type: t.type,
646
647
  title: t.title,
647
- locations: H.deserialize(t.locations),
648
- text: vA.deserialize(t.text)
648
+ locations: T.deserialize(t.locations),
649
+ text: DA.deserialize(t.text)
649
650
  });
650
651
  }
651
652
  /**
@@ -664,7 +665,7 @@ let H = class $e {
664
665
  type: this.type,
665
666
  title: this.title,
666
667
  text: this.text,
667
- locations: new H({ ...this.locations, ...t })
668
+ locations: new T({ ...this.locations, ...t })
668
669
  });
669
670
  }
670
671
  };
@@ -687,13 +688,13 @@ class X {
687
688
  title: t.title,
688
689
  rels: t.rel ? t.rel instanceof Array ? new Set(t.rel) : /* @__PURE__ */ new Set([t.rel]) : void 0,
689
690
  properties: y.deserialize(t.properties),
690
- height: V(t.height),
691
- width: V(t.width),
692
- duration: V(t.duration),
693
- bitrate: V(t.bitrate),
694
- languages: _e(t.language),
695
- alternates: pe.deserialize(t.alternate),
696
- children: pe.deserialize(t.children)
691
+ height: P(t.height),
692
+ width: P(t.width),
693
+ duration: P(t.duration),
694
+ bitrate: P(t.bitrate),
695
+ languages: qe(t.language),
696
+ alternates: fe.deserialize(t.alternate),
697
+ children: fe.deserialize(t.children)
697
698
  });
698
699
  }
699
700
  /**
@@ -701,7 +702,7 @@ class X {
701
702
  */
702
703
  serialize() {
703
704
  const t = { href: this.href };
704
- return this.templated !== void 0 && (t.templated = this.templated), this.type !== void 0 && (t.type = this.type), this.title !== void 0 && (t.title = this.title), this.rels && (t.rel = DA(this.rels)), this.properties && (t.properties = this.properties.serialize()), this.height !== void 0 && (t.height = this.height), this.width !== void 0 && (t.width = this.width), this.duration !== void 0 && (t.duration = this.duration), this.bitrate !== void 0 && (t.bitrate = this.bitrate), this.languages && (t.language = this.languages), this.alternates && (t.alternate = this.alternates.serialize()), this.children && (t.children = this.children.serialize()), t;
705
+ return this.templated !== void 0 && (t.templated = this.templated), this.type !== void 0 && (t.type = this.type), this.title !== void 0 && (t.title = this.title), this.rels && (t.rel = PA(this.rels)), this.properties && (t.properties = this.properties.serialize()), this.height !== void 0 && (t.height = this.height), this.width !== void 0 && (t.width = this.width), this.duration !== void 0 && (t.duration = this.duration), this.bitrate !== void 0 && (t.bitrate = this.bitrate), this.languages && (t.language = this.languages), this.alternates && (t.alternate = this.alternates.serialize()), this.children && (t.children = this.children.serialize()), t;
705
706
  }
706
707
  /** MediaType of the linked resource. */
707
708
  get mediaType() {
@@ -719,14 +720,14 @@ class X {
719
720
  }
720
721
  /** List of URI template parameter keys, if the `Link` is templated. */
721
722
  get templateParameters() {
722
- return this.templated ? new Me(this.href).parameters : /* @__PURE__ */ new Set();
723
+ return this.templated ? new me(this.href).parameters : /* @__PURE__ */ new Set();
723
724
  }
724
725
  /** Expands the `Link`'s HREF by replacing URI template variables by the given parameters.
725
726
  * See RFC 6570 on URI template: https://tools.ietf.org/html/rfc6570
726
727
  */
727
728
  expandTemplate(t) {
728
729
  return new X({
729
- href: new Me(this.href).expand(t),
730
+ href: new me(this.href).expand(t),
730
731
  templated: !1
731
732
  });
732
733
  }
@@ -747,13 +748,13 @@ class X {
747
748
  href: t.length > 0 && t[0] !== void 0 ? t[0] : this.href,
748
749
  type: this.type ?? "",
749
750
  title: this.title,
750
- locations: new H({
751
+ locations: new T({
751
752
  fragments: t.length > 1 && t[1] !== void 0 ? [t[1]] : []
752
753
  })
753
754
  });
754
755
  }
755
756
  }
756
- let pe = class eA {
757
+ let fe = class $e {
757
758
  /**
758
759
  * Creates a [Links].
759
760
  */
@@ -765,7 +766,7 @@ let pe = class eA {
765
766
  */
766
767
  static deserialize(t) {
767
768
  if (t && t instanceof Array)
768
- return new eA(
769
+ return new $e(
769
770
  t.map((e) => X.deserialize(e)).filter((e) => e !== void 0)
770
771
  );
771
772
  }
@@ -808,8 +809,8 @@ let pe = class eA {
808
809
  /** Finds all the links matching any of the given media types. */
809
810
  filterByMediaTypes(t) {
810
811
  const e = (A) => {
811
- for (const i of t)
812
- if (A.mediaType.matches(i))
812
+ for (const n of t)
813
+ if (A.mediaType.matches(n))
813
814
  return !0;
814
815
  return !1;
815
816
  };
@@ -846,7 +847,7 @@ let pe = class eA {
846
847
  filterLinksHasType() {
847
848
  return this.items.filter((t) => t.type);
848
849
  }
849
- }, Be = class AA {
850
+ }, pe = class tA {
850
851
  /**
851
852
  * Creates a [DomRange].
852
853
  */
@@ -859,11 +860,11 @@ let pe = class eA {
859
860
  static deserialize(t) {
860
861
  if (!(t && t.cssSelector))
861
862
  return;
862
- let e = V(t.textNodeIndex);
863
+ let e = P(t.textNodeIndex);
863
864
  if (e === void 0)
864
865
  return;
865
- let A = V(t.charOffset);
866
- return A === void 0 && (A = V(t.offset)), new AA({
866
+ let A = P(t.charOffset);
867
+ return A === void 0 && (A = P(t.offset)), new tA({
867
868
  cssSelector: t.cssSelector,
868
869
  textNodeIndex: e,
869
870
  charOffset: A
@@ -879,8 +880,7 @@ let pe = class eA {
879
880
  };
880
881
  return this.charOffset !== void 0 && (t.charOffset = this.charOffset), t;
881
882
  }
882
- };
883
- class te {
883
+ }, bA = class eA {
884
884
  /**
885
885
  * Creates a [DomRange].
886
886
  */
@@ -893,11 +893,11 @@ class te {
893
893
  static deserialize(t) {
894
894
  if (!t)
895
895
  return;
896
- let e = Be.deserialize(t.start);
896
+ let e = pe.deserialize(t.start);
897
897
  if (e)
898
- return new te({
898
+ return new eA({
899
899
  start: e,
900
- end: Be.deserialize(t.end)
900
+ end: pe.deserialize(t.end)
901
901
  });
902
902
  }
903
903
  /**
@@ -907,56 +907,56 @@ class te {
907
907
  const t = { start: this.start.serialize() };
908
908
  return this.end && (t.end = this.end.serialize()), t;
909
909
  }
910
- }
911
- H.prototype.getCssSelector = function() {
912
- var n;
913
- return (n = this.otherLocations) == null ? void 0 : n.get("cssSelector");
914
910
  };
915
- H.prototype.getPartialCfi = function() {
916
- var n;
917
- return (n = this.otherLocations) == null ? void 0 : n.get("partialCfi");
911
+ T.prototype.getCssSelector = function() {
912
+ var i;
913
+ return (i = this.otherLocations) == null ? void 0 : i.get("cssSelector");
918
914
  };
919
- H.prototype.getDomRange = function() {
920
- var n;
921
- return te.deserialize((n = this.otherLocations) == null ? void 0 : n.get("domRange"));
915
+ T.prototype.getPartialCfi = function() {
916
+ var i;
917
+ return (i = this.otherLocations) == null ? void 0 : i.get("partialCfi");
922
918
  };
923
- H.prototype.fragmentParameters = function() {
919
+ T.prototype.getDomRange = function() {
920
+ var i;
921
+ return bA.deserialize((i = this.otherLocations) == null ? void 0 : i.get("domRange"));
922
+ };
923
+ T.prototype.fragmentParameters = function() {
924
924
  return new Map(
925
- this.fragments.map((n) => n.startsWith("#") ? n.slice(1) : n).join("&").split("&").filter((n) => !n.startsWith("#")).map((n) => n.split("=")).filter((n) => n.length === 2).map((n) => [
926
- n[0].trim().toLowerCase(),
927
- n[1].trim()
925
+ this.fragments.map((i) => i.startsWith("#") ? i.slice(1) : i).join("&").split("&").filter((i) => !i.startsWith("#")).map((i) => i.split("=")).filter((i) => i.length === 2).map((i) => [
926
+ i[0].trim().toLowerCase(),
927
+ i[1].trim()
928
928
  ])
929
929
  );
930
930
  };
931
- H.prototype.htmlId = function() {
931
+ T.prototype.htmlId = function() {
932
932
  if (!this.fragments.length)
933
933
  return;
934
- let n = this.fragments.find((t) => t.length && !t.includes("="));
935
- if (!n) {
934
+ let i = this.fragments.find((t) => t.length && !t.includes("="));
935
+ if (!i) {
936
936
  const t = this.fragmentParameters();
937
- t.has("id") ? n = t.get("id") : t.has("name") && (n = t.get("name"));
937
+ t.has("id") ? i = t.get("id") : t.has("name") && (i = t.get("name"));
938
938
  }
939
- return n != null && n.startsWith("#") ? n.slice(1) : n;
939
+ return i != null && i.startsWith("#") ? i.slice(1) : i;
940
940
  };
941
- H.prototype.page = function() {
942
- const n = parseInt(this.fragmentParameters().get("page"));
943
- if (!isNaN(n) && n >= 0)
944
- return n;
941
+ T.prototype.page = function() {
942
+ const i = parseInt(this.fragmentParameters().get("page"));
943
+ if (!isNaN(i) && i >= 0)
944
+ return i;
945
945
  };
946
- H.prototype.time = function() {
947
- const n = parseInt(this.fragmentParameters().get("t"));
948
- if (!isNaN(n))
949
- return n;
946
+ T.prototype.time = function() {
947
+ const i = parseInt(this.fragmentParameters().get("t"));
948
+ if (!isNaN(i))
949
+ return i;
950
950
  };
951
- H.prototype.space = function() {
952
- const n = this.fragmentParameters();
953
- if (!n.has("xywh"))
951
+ T.prototype.space = function() {
952
+ const i = this.fragmentParameters();
953
+ if (!i.has("xywh"))
954
954
  return;
955
- const t = n.get("xywh").split(",").map((e) => parseInt(e));
955
+ const t = i.get("xywh").split(",").map((e) => parseInt(e));
956
956
  if (t.length === 4 && !t.some(isNaN))
957
957
  return t;
958
958
  };
959
- class ee {
959
+ let vA = class AA {
960
960
  /** Creates a [Price]. */
961
961
  constructor(t) {
962
962
  this.currency = t.currency, this.value = t.value;
@@ -970,9 +970,9 @@ class ee {
970
970
  let e = t.currency;
971
971
  if (!(e && typeof e == "string" && e.length > 0))
972
972
  return;
973
- let A = V(t.value);
973
+ let A = P(t.value);
974
974
  if (A !== void 0)
975
- return new ee({ currency: e, value: A });
975
+ return new AA({ currency: e, value: A });
976
976
  }
977
977
  /**
978
978
  * Serializes a [Price] to its RWPM JSON representation.
@@ -980,8 +980,7 @@ class ee {
980
980
  serialize() {
981
981
  return { currency: this.currency, value: this.value };
982
982
  }
983
- }
984
- let bA = class Et {
983
+ }, GA = class Et {
985
984
  /** Creates a [Acquisition]. */
986
985
  constructor(t) {
987
986
  this.type = t.type, this.children = t.children;
@@ -1007,7 +1006,8 @@ let bA = class Et {
1007
1006
  const t = { type: this.type };
1008
1007
  return this.children && (t.children = this.children.map((e) => e.serialize())), t;
1009
1008
  }
1010
- }, GA = class iA {
1009
+ };
1010
+ class te {
1011
1011
  /** Creates a [Price]. */
1012
1012
  constructor(t) {
1013
1013
  this.total = t.total, this.position = t.position;
@@ -1017,9 +1017,9 @@ let bA = class Et {
1017
1017
  */
1018
1018
  static deserialize(t) {
1019
1019
  if (t)
1020
- return new iA({
1021
- total: V(t.total),
1022
- position: V(t.position)
1020
+ return new te({
1021
+ total: P(t.total),
1022
+ position: P(t.position)
1023
1023
  });
1024
1024
  }
1025
1025
  /**
@@ -1029,8 +1029,8 @@ let bA = class Et {
1029
1029
  const t = {};
1030
1030
  return this.total !== void 0 && (t.total = this.total), this.position !== void 0 && (t.position = this.position), t;
1031
1031
  }
1032
- };
1033
- class Ae {
1032
+ }
1033
+ class ee {
1034
1034
  /** Creates a [Copies]. */
1035
1035
  constructor(t) {
1036
1036
  this.total = t.total, this.available = t.available;
@@ -1040,9 +1040,9 @@ class Ae {
1040
1040
  */
1041
1041
  static deserialize(t) {
1042
1042
  if (t)
1043
- return new Ae({
1044
- total: V(t.total),
1045
- available: V(t.available)
1043
+ return new ee({
1044
+ total: P(t.total),
1045
+ available: P(t.available)
1046
1046
  });
1047
1047
  }
1048
1048
  /**
@@ -1053,7 +1053,7 @@ class Ae {
1053
1053
  return this.total !== void 0 && (t.total = this.total), this.available !== void 0 && (t.available = this.available), t;
1054
1054
  }
1055
1055
  }
1056
- let HA = class nA {
1056
+ let HA = class iA {
1057
1057
  /** Creates a [Availability]. */
1058
1058
  constructor(t) {
1059
1059
  this.state = t.state, this.since = t.since, this.until = t.until;
@@ -1063,10 +1063,10 @@ let HA = class nA {
1063
1063
  */
1064
1064
  static deserialize(t) {
1065
1065
  if (t && t.state)
1066
- return new nA({
1066
+ return new iA({
1067
1067
  state: t.state,
1068
- since: fe(t.since),
1069
- until: fe(t.until)
1068
+ since: Me(t.since),
1069
+ until: Me(t.until)
1070
1070
  });
1071
1071
  }
1072
1072
  /**
@@ -1078,21 +1078,21 @@ let HA = class nA {
1078
1078
  }
1079
1079
  };
1080
1080
  y.prototype.getNumberOfItems = function() {
1081
- return V(this.otherProperties.numberOfItems);
1081
+ return P(this.otherProperties.numberOfItems);
1082
1082
  };
1083
1083
  y.prototype.getPrice = function() {
1084
- return ee.deserialize(this.otherProperties.price);
1084
+ return vA.deserialize(this.otherProperties.price);
1085
1085
  };
1086
1086
  y.prototype.getIndirectAcquisitions = function() {
1087
- const n = this.otherProperties.indirectAcquisition;
1088
- if (n && n instanceof Array)
1089
- return n.map((t) => bA.deserialize(t)).filter((t) => t !== void 0);
1087
+ const i = this.otherProperties.indirectAcquisition;
1088
+ if (i && i instanceof Array)
1089
+ return i.map((t) => GA.deserialize(t)).filter((t) => t !== void 0);
1090
1090
  };
1091
1091
  y.prototype.getHolds = function() {
1092
- return GA.deserialize(this.otherProperties.holds);
1092
+ return te.deserialize(this.otherProperties.holds);
1093
1093
  };
1094
1094
  y.prototype.getCopies = function() {
1095
- return Ae.deserialize(this.otherProperties.copies);
1095
+ return ee.deserialize(this.otherProperties.copies);
1096
1096
  };
1097
1097
  y.prototype.getAvailability = function() {
1098
1098
  return HA.deserialize(this.otherProperties.availability);
@@ -1100,7 +1100,7 @@ y.prototype.getAvailability = function() {
1100
1100
  y.prototype.getAuthenticate = function() {
1101
1101
  return X.deserialize(this.otherProperties.authenticate);
1102
1102
  };
1103
- var w = /* @__PURE__ */ ((n) => (n.auto = "auto", n.btt = "btt", n.ltr = "ltr", n.rtl = "rtl", n.ttb = "ttb", n))(w || {});
1103
+ var w = /* @__PURE__ */ ((i) => (i.auto = "auto", i.btt = "btt", i.ltr = "ltr", i.rtl = "rtl", i.ttb = "ttb", i))(w || {});
1104
1104
  y.prototype.getClipped = function() {
1105
1105
  return this.otherProperties.clipped;
1106
1106
  };
@@ -1120,38 +1120,38 @@ y.prototype.getSpread = function() {
1120
1120
  return this.otherProperties.spread || void 0;
1121
1121
  };
1122
1122
  var K;
1123
- (function(n) {
1124
- n.NONE = "none", n.DESCENDANT = "descendant", n.CHILD = "child";
1123
+ (function(i) {
1124
+ i.NONE = "none", i.DESCENDANT = "descendant", i.CHILD = "child";
1125
1125
  })(K || (K = {}));
1126
1126
  var v;
1127
- (function(n) {
1128
- n.id = "id", n.class = "class", n.tag = "tag", n.attribute = "attribute", n.nthchild = "nthchild", n.nthoftype = "nthoftype";
1127
+ (function(i) {
1128
+ i.id = "id", i.class = "class", i.tag = "tag", i.attribute = "attribute", i.nthchild = "nthchild", i.nthoftype = "nthoftype";
1129
1129
  })(v || (v = {}));
1130
1130
  const kA = "CssSelectorGenerator";
1131
- function Ee(n = "unknown problem", ...t) {
1132
- console.warn(`${kA}: ${n}`, ...t);
1131
+ function Be(i = "unknown problem", ...t) {
1132
+ console.warn(`${kA}: ${i}`, ...t);
1133
1133
  }
1134
1134
  v.id, v.class, v.tag, v.attribute, Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY;
1135
- function JA(n) {
1136
- return n instanceof RegExp;
1135
+ function JA(i) {
1136
+ return i instanceof RegExp;
1137
1137
  }
1138
- function WA(n) {
1139
- return n.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".+");
1138
+ function WA(i) {
1139
+ return i.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".+");
1140
1140
  }
1141
- function LA(n) {
1142
- const t = n.map((e) => {
1141
+ function LA(i) {
1142
+ const t = i.map((e) => {
1143
1143
  if (JA(e))
1144
1144
  return (A) => e.test(A);
1145
1145
  if (typeof e == "function")
1146
1146
  return (A) => {
1147
- const i = e(A);
1148
- return typeof i != "boolean" ? (Ee("pattern matcher function invalid", "Provided pattern matching function does not return boolean. It's result will be ignored.", e), !1) : i;
1147
+ const n = e(A);
1148
+ return typeof n != "boolean" ? (Be("pattern matcher function invalid", "Provided pattern matching function does not return boolean. It's result will be ignored.", e), !1) : n;
1149
1149
  };
1150
1150
  if (typeof e == "string") {
1151
1151
  const A = new RegExp("^" + WA(e) + "$");
1152
- return (i) => A.test(i);
1152
+ return (n) => A.test(n);
1153
1153
  }
1154
- return Ee("pattern matcher invalid", "Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.", e), () => !1;
1154
+ return Be("pattern matcher invalid", "Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.", e), () => !1;
1155
1155
  });
1156
1156
  return (e) => t.some((A) => A(e));
1157
1157
  }
@@ -1180,24 +1180,24 @@ class qA extends KA {
1180
1180
  this.readingProgression === w.ltr || this.readingProgression === w.ttb || this.readingProgression === w.auto ? this.goForward(t, e) : (this.readingProgression === w.rtl || this.readingProgression === w.btt) && this.goBackward(t, e);
1181
1181
  }
1182
1182
  }
1183
- const _A = `@namespace url(http://www.w3.org/1999/xhtml);@namespace epub url(http://www.idpf.org/2007/ops);@namespace m url(http://www.w3.org/1998/Math/MathML);@namespace svg url(http://www.w3.org/2000/svg);:root{--RS__viewportWidth:100%;--RS__pageGutter:0;--RS__defaultLineLength:40rem;--RS__colGap:0;--RS__colCount:1;--RS__colWidth:100vw}@page{margin:0!important}:root{position:relative;-webkit-column-width:var(--RS__colWidth);-moz-column-width:var(--RS__colWidth);column-width:var(--RS__colWidth);-webkit-column-count:var(--RS__colCount);-moz-column-count:var(--RS__colCount);column-count:var(--RS__colCount);-webkit-column-gap:var(--RS__colGap);-moz-column-gap:var(--RS__colGap);column-gap:var(--RS__colGap);-moz-column-fill:auto;column-fill:auto;width:var(--RS__viewportWidth);height:100vh;max-width:var(--RS__viewportWidth);max-height:100vh;min-width:var(--RS__viewportWidth);min-height:100vh;padding:0!important;margin:0!important;font-size:1rem!important;box-sizing:border-box;-webkit-touch-callout:none}body{width:100%;max-width:var(--RS__defaultLineLength)!important;padding:0 var(--RS__pageGutter)!important;margin:0 auto!important;box-sizing:border-box}:root:not([style*=readium-noOverflow-on]) body{overflow:hidden}@supports (overflow: clip){:root:not([style*=readium-noOverflow-on]){overflow:clip}:root:not([style*=readium-noOverflow-on]) body{overflow:clip;overflow-clip-margin:content-box}}:root[style*=readium-scroll-on]{-webkit-columns:auto auto!important;-moz-columns:auto auto!important;columns:auto auto!important;width:auto!important;height:auto!important;max-width:none!important;max-height:none!important;min-width:0!important;min-height:0!important}:root[style*=readium-scroll-on] body{max-width:var(--RS__defaultLineLength)!important;box-sizing:border-box!important}:root[style*=readium-scroll-on]:not([style*=readium-noOverflow-on]) body{overflow:auto}@supports (overflow: clip){:root[style*=readium-scroll-on]:not([style*=readium-noOverflow-on]){overflow:auto}:root[style*=readium-scroll-on]:not([style*=readium-noOverflow-on]) body{overflow:clip}}:root[style*=readium-scroll-on][style*=--RS__scrollPaddingTop] body{padding-top:var(--RS__scrollPaddingTop)!important}:root[style*=readium-scroll-on][style*=--RS__scrollPaddingBottom] body{padding-bottom:var(--RS__scrollPaddingBottom)!important}:root[style*=readium-scroll-on][style*=--RS__scrollPaddingLeft] body{padding-left:var(--RS__scrollPaddingLeft)!important}:root[style*=readium-scroll-on][style*=--RS__scrollPaddingRight] body{padding-right:var(--RS__scrollPaddingRight)!important}:root[style*=readium-night-on]{--RS__selectionTextColor:inherit;--RS__selectionBackgroundColor:#b4d8fe;--RS__visitedColor:#0099E5;--RS__linkColor:#63caff;--RS__textColor:#FEFEFE;--RS__backgroundColor:#000000}:root[style*=readium-night-on] *:not(a){color:inherit!important;background-color:transparent!important;border-color:currentcolor!important}:root[style*=readium-night-on] svg text{fill:currentcolor!important;stroke:none!important}:root[style*=readium-night-on] a:link,:root[style*=readium-night-on] a:link *{color:var(--RS__linkColor)!important}:root[style*=readium-night-on] a:visited,:root[style*=readium-night-on] a:visited *{color:var(--RS__visitedColor)!important}:root[style*=readium-night-on] img[class*=gaiji],:root[style*=readium-night-on] *[epub\\:type~=titlepage] img:only-child,:root[style*=readium-night-on] *[epub|type~=titlepage] img:only-child{-webkit-filter:invert(100%);filter:invert(100%)}:root[style*=readium-sepia-on]{--RS__selectionTextColor:inherit;--RS__selectionBackgroundColor:#b4d8fe;--RS__visitedColor:#551A8B;--RS__linkColor:#0000EE;--RS__textColor:#121212;--RS__backgroundColor:#faf4e8}:root[style*=readium-sepia-on] *:not(a){color:inherit!important;background-color:transparent!important}:root[style*=readium-sepia-on] a:link,:root[style*=readium-sepia-on] a:link *{color:var(--RS__linkColor)}:root[style*=readium-sepia-on] a:visited,:root[style*=readium-sepia-on] a:visited *{color:var(--RS__visitedColor)}@media screen and (-ms-high-contrast: active){:root{color:windowText!important;background-color:window!important}:root :not(#\\#):not(#\\#):not(#\\#),:root :not(#\\#):not(#\\#):not(#\\#) :not(#\\#):not(#\\#):not(#\\#) :root :not(#\\#):not(#\\#):not(#\\#) :not(#\\#):not(#\\#):not(#\\#) :not(#\\#):not(#\\#):not(#\\#){color:inherit!important;background-color:inherit!important}.readiumCSS-mo-active-default{color:highlightText!important;background-color:highlight!important}}@media screen and (-ms-high-contrast: white-on-black){:root[style*=readium-night-on] img[class*=gaiji],:root[style*=readium-night-on] *[epub\\:type~=titlepage] img:only-child,:root[style*=readium-night-on] *[epub|type~=titlepage] img:only-child{-webkit-filter:none!important;filter:none!important}:root[style*=readium-night-on][style*=readium-invert-on] img{-webkit-filter:none!important;filter:none!important}:root[style*=readium-night-on][style*=readium-darken-on][style*=readium-invert-on] img{-webkit-filter:brightness(80%);filter:brightness(80%)}}@media screen and (inverted-colors){:root[style*=readium-night-on] img[class*=gaiji],:root[style*=readium-night-on] *[epub\\:type~=titlepage] img:only-child,:root[style*=readium-night-on] *[epub|type~=titlepage] img:only-child{-webkit-filter:none!important;filter:none!important}:root[style*=readium-night-on][style*=readium-invert-on] img{-webkit-filter:none!important;filter:none!important}:root[style*=readium-night-on][style*=readium-darken-on][style*=readium-invert-on] img{-webkit-filter:brightness(80%);filter:brightness(80%)}}:root[style*=--USER__backgroundColor]{background-color:var(--USER__backgroundColor)!important}:root[style*=--USER__backgroundColor] *{background-color:transparent!important}:root[style*=--USER__textColor]{color:var(--USER__textColor)!important}:root[style*=--USER__textColor] *:not(a){color:inherit!important;background-color:transparent!important;border-color:currentcolor!important}:root[style*=--USER__textColor] svg text{fill:currentcolor!important;stroke:none!important}:root[style*=--USER__linkColor] a:link,:root[style*=--USER__linkColor] a:link *{color:var(--USER__linkColor)!important}:root[style*=--USER__visitedColor] a:visited,:root[style*=--USER__visitedColor] a:visited *{color:var(--USER__visitedColor)!important}:root[style*=--USER__selectionBackgroundColor][style*=--USER__selectionTextColor] ::-moz-selection{color:var(--USER__selectionTextColor)!important;background-color:var(--USER__selectionBackgroundColor)!important}:root[style*=--USER__selectionBackgroundColor][style*=--USER__selectionTextColor] ::selection{color:var(--USER__selectionTextColor)!important;background-color:var(--USER__selectionBackgroundColor)!important}:root[style*=--USER__colCount]{-webkit-column-count:var(--USER__colCount);-moz-column-count:var(--USER__colCount);column-count:var(--USER__colCount);--RS__colWidth:auto}:root[style*="--USER__colCount: 0"],:root[style*="--USER__colCount:0"]{-webkit-column-count:1;-moz-column-count:1;column-count:1}:root[style*="--USER__colCount: 0"],:root[style*="--USER__colCount:0"],:root[style*="--USER__colCount: 1"],:root[style*="--USER__colCount:1"]{--RS__colWidth:100vw}:root[style*=--USER__lineLength] body{max-width:var(--USER__lineLength)!important}:root[style*=--USER__textAlign]{text-align:var(--USER__textAlign)}:root[style*=--USER__textAlign] body,:root[style*=--USER__textAlign] p:not(blockquote p):not(figcaption p):not(hgroup p),:root[style*=--USER__textAlign] li,:root[style*=--USER__textAlign] dd{text-align:var(--USER__textAlign)!important;-moz-text-align-last:auto!important;-epub-text-align-last:auto!important;text-align-last:auto!important}:root[style*=--USER__bodyHyphens]{-webkit-hyphens:var(--USER__bodyHyphens)!important;-moz-hyphens:var(--USER__bodyHyphens)!important;-ms-hyphens:var(--USER__bodyHyphens)!important;-epub-hyphens:var(--USER__bodyHyphens)!important;hyphens:var(--USER__bodyHyphens)!important}:root[style*=--USER__bodyHyphens] body,:root[style*=--USER__bodyHyphens] p,:root[style*=--USER__bodyHyphens] li,:root[style*=--USER__bodyHyphens] div,:root[style*=--USER__bodyHyphens] dd{-webkit-hyphens:inherit;-moz-hyphens:inherit;-ms-hyphens:inherit;-epub-hyphens:inherit;hyphens:inherit}:root[style*=--USER__fontFamily]{font-family:var(--USER__fontFamily)!important}:root[style*=--USER__fontFamily] *{font-family:revert!important}:root[style*=AccessibleDfA]{font-family:AccessibleDfA,Verdana,Tahoma,Trebuchet MS,sans-serif!important}:root[style*="IA Writer Duospace"]{font-family:IA Writer Duospace,Menlo,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier,monospace!important}:root[style*=AccessibleDfA],:root[style*="IA Writer Duospace"],:root[style*=readium-a11y-on]{font-style:normal!important;font-weight:400!important}:root[style*=AccessibleDfA] *:not(code):not(var):not(kbd):not(samp),:root[style*="IA Writer Duospace"] *:not(code):not(var):not(kbd):not(samp),:root[style*=readium-a11y-on] *:not(code):not(var):not(kbd):not(samp){font-family:inherit!important;font-style:inherit!important;font-weight:inherit!important}:root[style*=AccessibleDfA] *,:root[style*="IA Writer Duospace"] *,:root[style*=readium-a11y-on] *{text-decoration:none!important;font-variant-caps:normal!important;font-variant-numeric:normal!important;font-variant-position:normal!important}:root[style*=AccessibleDfA] sup,:root[style*="IA Writer Duospace"] sup,:root[style*=readium-a11y-on] sup,:root[style*=AccessibleDfA] sub,:root[style*="IA Writer Duospace"] sub,:root[style*=readium-a11y-on] sub{font-size:1rem!important;vertical-align:baseline!important}:root:not([style*=readium-deprecatedFontSize-on]):not([style*=readium-iOSPatch-on])[style*=--USER__fontSize] body{zoom:var(--USER__fontSize)!important}:root[style*=readium-iOSPatch-on][style*=--USER__fontSize] body{-webkit-text-size-adjust:var(--USER__fontSize)!important}@supports not (zoom: 1){:root[style*=--USER__fontSize]{font-size:var(--USER__fontSize)!important}}:root[style*=readium-deprecatedFontSize-on][style*=--USER__fontSize]{font-size:var(--USER__fontSize)!important}:root[style*=--USER__lineHeight]{line-height:var(--USER__lineHeight)!important}:root[style*=--USER__lineHeight] body,:root[style*=--USER__lineHeight] p,:root[style*=--USER__lineHeight] li,:root[style*=--USER__lineHeight] div{line-height:inherit}:root[style*=--USER__paraSpacing] p{margin-top:var(--USER__paraSpacing)!important;margin-bottom:var(--USER__paraSpacing)!important}:root[style*=--USER__paraIndent] p{text-indent:var(--USER__paraIndent)!important}:root[style*=--USER__paraIndent] p *,:root[style*=--USER__paraIndent] p:first-letter{text-indent:0!important}:root[style*=--USER__wordSpacing] h1,:root[style*=--USER__wordSpacing] h2,:root[style*=--USER__wordSpacing] h3,:root[style*=--USER__wordSpacing] h4,:root[style*=--USER__wordSpacing] h5,:root[style*=--USER__wordSpacing] h6,:root[style*=--USER__wordSpacing] p,:root[style*=--USER__wordSpacing] li,:root[style*=--USER__wordSpacing] div,:root[style*=--USER__wordSpacing] dt,:root[style*=--USER__wordSpacing] dd{word-spacing:var(--USER__wordSpacing)}:root[style*=--USER__letterSpacing] h1,:root[style*=--USER__letterSpacing] h2,:root[style*=--USER__letterSpacing] h3,:root[style*=--USER__letterSpacing] h4,:root[style*=--USER__letterSpacing] h5,:root[style*=--USER__letterSpacing] h6,:root[style*=--USER__letterSpacing] p,:root[style*=--USER__letterSpacing] li,:root[style*=--USER__letterSpacing] div,:root[style*=--USER__letterSpacing] dt,:root[style*=--USER__letterSpacing] dd{letter-spacing:var(--USER__letterSpacing);font-variant:none}:root[style*=--USER__fontWeight] body{font-weight:var(--USER__fontWeight)!important}:root[style*=--USER__fontWeight] b,:root[style*=--USER__fontWeight] strong{font-weight:bolder}:root[style*=--USER__fontWidth] body{font-stretch:var(--USER__fontWidth)!important}:root[style*=--USER__fontOpticalSizing] body{font-optical-sizing:var(--USER__fontOpticalSizing)!important}:root[style*=readium-blend-on] svg,:root[style*=readium-blend-on] img{background-color:transparent!important;mix-blend-mode:multiply!important}:root[style*=--USER__darkenImages] img{-webkit-filter:brightness(var(--USER__darkenImages))!important;filter:brightness(var(--USER__darkenImages))!important}:root[style*=readium-darken-on] img{-webkit-filter:brightness(80%)!important;filter:brightness(80%)!important}:root[style*=--USER__invertImages] img{-webkit-filter:invert(var(--USER__invertImages))!important;filter:invert(var(--USER__invertImages))!important}:root[style*=readium-invert-on] img{-webkit-filter:invert(100%)!important;filter:invert(100%)!important}:root[style*=--USER__darkenImages][style*=--USER__invertImages] img{-webkit-filter:brightness(var(--USER__darkenImages)) invert(var(--USER__invertImages))!important;filter:brightness(var(--USER__darkenImages)) invert(var(--USER__invertImages))!important}:root[style*=readium-darken-on][style*=--USER__invertImages] img{-webkit-filter:brightness(80%) invert(var(--USER__invertImages))!important;filter:brightness(80%) invert(var(--USER__invertImages))!important}:root[style*=--USER__darkenImages][style*=readium-invert-on] img{-webkit-filter:brightness(var(--USER__darkenImages)) invert(100%)!important;filter:brightness(var(--USER__darkenImages)) invert(100%)!important}:root[style*=readium-darken-on][style*=readium-invert-on] img{-webkit-filter:brightness(80%) invert(100%)!important;filter:brightness(80%) invert(100%)!important}:root[style*=--USER__invertGaiji] img[class*=gaiji]{-webkit-filter:invert(var(--USER__invertGaiji))!important;filter:invert(var(--USER__invertGaiji))!important}:root[style*=readium-invertGaiji-on] img[class*=gaiji]{-webkit-filter:invert(100%)!important;filter:invert(100%)!important}:root[style*=readium-normalize-on]{--USER__typeScale:1.2}:root[style*=readium-normalize-on] p,:root[style*=readium-normalize-on] li,:root[style*=readium-normalize-on] div,:root[style*=readium-normalize-on] pre,:root[style*=readium-normalize-on] dd{font-size:1rem!important}:root[style*=readium-normalize-on] h1{font-size:1.75rem!important;font-size:calc(((1rem * var(--USER__typeScale)) * var(--USER__typeScale)) * var(--USER__typeScale))!important}:root[style*=readium-normalize-on] h2{font-size:1.5rem!important;font-size:calc((1rem * var(--USER__typeScale)) * var(--USER__typeScale))!important}:root[style*=readium-normalize-on] h3{font-size:1.25rem!important;font-size:calc(1rem * var(--USER__typeScale))!important}:root[style*=readium-normalize-on] h4,:root[style*=readium-normalize-on] h5,:root[style*=readium-normalize-on] h6{font-size:1rem!important}:root[style*=readium-normalize-on] small{font-size:smaller!important}:root[style*=readium-normalize-on] sub,:root[style*=readium-normalize-on] sup{font-size:67.5%!important}:root[style*=readium-normalize-on][style*=--USER__typeScale] h1{font-size:calc(((1rem * var(--USER__typeScale)) * var(--USER__typeScale)) * var(--USER__typeScale))!important}:root[style*=readium-normalize-on][style*=--USER__typeScale] h2{font-size:calc((1rem * var(--USER__typeScale)) * var(--USER__typeScale))!important}:root[style*=readium-normalize-on][style*=--USER__typeScale] h3{font-size:calc(1rem * var(--USER__typeScale))!important}:root[style*=readium-iPadOSPatch-on] body{-webkit-text-size-adjust:none}:root[style*=readium-iPadOSPatch-on] p,:root[style*=readium-iPadOSPatch-on] h1,:root[style*=readium-iPadOSPatch-on] h2,:root[style*=readium-iPadOSPatch-on] h3,:root[style*=readium-iPadOSPatch-on] h4,:root[style*=readium-iPadOSPatch-on] h5,:root[style*=readium-iPadOSPatch-on] h6,:root[style*=readium-iPadOSPatch-on] li,:root[style*=readium-iPadOSPatch-on] th,:root[style*=readium-iPadOSPatch-on] td,:root[style*=readium-iPadOSPatch-on] dt,:root[style*=readium-iPadOSPatch-on] dd,:root[style*=readium-iPadOSPatch-on] pre,:root[style*=readium-iPadOSPatch-on] address,:root[style*=readium-iPadOSPatch-on] details,:root[style*=readium-iPadOSPatch-on] summary,:root[style*=readium-iPadOSPatch-on] figcaption,:root[style*=readium-iPadOSPatch-on] div:not(:has(p,h1,h2,h3,h4,h5,h6,li,th,td,dt,dd,pre,address,aside,details,figcaption,summary)),:root[style*=readium-iPadOSPatch-on] aside:not(:has(p,h1,h2,h3,h4,h5,h6,li,th,td,dt,dd,pre,address,aside,details,figcaption,summary)){-webkit-text-zoom:reset}:root[style*=readium-iPadOSPatch-on] abbr,:root[style*=readium-iPadOSPatch-on] b,:root[style*=readium-iPadOSPatch-on] bdi,:root[style*=readium-iPadOSPatch-on] bdo,:root[style*=readium-iPadOSPatch-on] cite,:root[style*=readium-iPadOSPatch-on] code,:root[style*=readium-iPadOSPatch-on] dfn,:root[style*=readium-iPadOSPatch-on] em,:root[style*=readium-iPadOSPatch-on] i,:root[style*=readium-iPadOSPatch-on] kbd,:root[style*=readium-iPadOSPatch-on] mark,:root[style*=readium-iPadOSPatch-on] q,:root[style*=readium-iPadOSPatch-on] rp,:root[style*=readium-iPadOSPatch-on] rt,:root[style*=readium-iPadOSPatch-on] ruby,:root[style*=readium-iPadOSPatch-on] s,:root[style*=readium-iPadOSPatch-on] samp,:root[style*=readium-iPadOSPatch-on] small,:root[style*=readium-iPadOSPatch-on] span,:root[style*=readium-iPadOSPatch-on] strong,:root[style*=readium-iPadOSPatch-on] sub,:root[style*=readium-iPadOSPatch-on] sup,:root[style*=readium-iPadOSPatch-on] time,:root[style*=readium-iPadOSPatch-on] u,:root[style*=readium-iPadOSPatch-on] var{-webkit-text-zoom:normal}:root[style*=readium-iPadOSPatch-on] p:not(:has(b,cite,em,i,q,s,small,span,strong)):first-line{-webkit-text-zoom:normal}
1183
+ const _A = `@namespace url(http://www.w3.org/1999/xhtml);@namespace epub url(http://www.idpf.org/2007/ops);@namespace m url(http://www.w3.org/1998/Math/MathML);@namespace svg url(http://www.w3.org/2000/svg);:root{--RS__viewportWidth:100%;--RS__pageGutter:0;--RS__defaultLineLength:40rem;--RS__colGap:0;--RS__colCount:1;--RS__colWidth:100vw}@page{margin:0!important}:root{position:relative;-webkit-column-width:var(--RS__colWidth);-moz-column-width:var(--RS__colWidth);column-width:var(--RS__colWidth);-webkit-column-count:var(--RS__colCount);-moz-column-count:var(--RS__colCount);column-count:var(--RS__colCount);-webkit-column-gap:var(--RS__colGap);-moz-column-gap:var(--RS__colGap);column-gap:var(--RS__colGap);-moz-column-fill:auto;column-fill:auto;width:var(--RS__viewportWidth);height:100vh;max-width:var(--RS__viewportWidth);max-height:100vh;min-width:var(--RS__viewportWidth);min-height:100vh;padding:0!important;margin:0!important;font-size:1rem!important;box-sizing:border-box;-webkit-touch-callout:none}body{width:100%;max-width:var(--RS__defaultLineLength)!important;padding:0 var(--RS__pageGutter)!important;margin:0 auto!important;box-sizing:border-box}:root:not([style*=readium-noOverflow-on]) body{overflow:hidden}@supports (overflow: clip){:root:not([style*=readium-noOverflow-on]){overflow:clip}:root:not([style*=readium-noOverflow-on]) body{overflow:clip;overflow-clip-margin:content-box}}:root[style*=readium-scroll-on]{-webkit-columns:auto auto!important;-moz-columns:auto auto!important;columns:auto auto!important;width:auto!important;height:auto!important;max-width:none!important;max-height:none!important;min-width:0!important;min-height:0!important}:root[style*=readium-scroll-on] body{max-width:var(--RS__defaultLineLength)!important;box-sizing:border-box!important}:root[style*=readium-scroll-on]:not([style*=readium-noOverflow-on]) body{overflow:auto}@supports (overflow: clip){:root[style*=readium-scroll-on]:not([style*=readium-noOverflow-on]){overflow:auto}:root[style*=readium-scroll-on]:not([style*=readium-noOverflow-on]) body{overflow:clip}}:root[style*=readium-scroll-on][style*=--RS__scrollPaddingTop] body{padding-top:var(--RS__scrollPaddingTop)!important}:root[style*=readium-scroll-on][style*=--RS__scrollPaddingBottom] body{padding-bottom:var(--RS__scrollPaddingBottom)!important}:root[style*=readium-scroll-on][style*=--RS__scrollPaddingLeft] body{padding-left:var(--RS__scrollPaddingLeft)!important}:root[style*=readium-scroll-on][style*=--RS__scrollPaddingRight] body{padding-right:var(--RS__scrollPaddingRight)!important}:root[style*=readium-night-on]{--RS__selectionTextColor:inherit;--RS__selectionBackgroundColor:#b4d8fe;--RS__visitedColor:#0099E5;--RS__linkColor:#63caff;--RS__textColor:#FEFEFE;--RS__backgroundColor:#000000}:root[style*=readium-night-on] *:not(a){color:inherit!important;background-color:transparent!important;border-color:currentcolor!important}:root[style*=readium-night-on] svg text{fill:currentcolor!important;stroke:none!important}:root[style*=readium-night-on] a:link,:root[style*=readium-night-on] a:link *{color:var(--RS__linkColor)!important}:root[style*=readium-night-on] a:visited,:root[style*=readium-night-on] a:visited *{color:var(--RS__visitedColor)!important}:root[style*=readium-night-on] img[class*=gaiji],:root[style*=readium-night-on] *[epub\\:type~=titlepage] img:only-child,:root[style*=readium-night-on] *[epub|type~=titlepage] img:only-child{-webkit-filter:invert(100%);filter:invert(100%)}:root[style*=readium-sepia-on]{--RS__selectionTextColor:inherit;--RS__selectionBackgroundColor:#b4d8fe;--RS__visitedColor:#551A8B;--RS__linkColor:#0000EE;--RS__textColor:#121212;--RS__backgroundColor:#faf4e8}:root[style*=readium-sepia-on] *:not(a){color:inherit!important;background-color:transparent!important}:root[style*=readium-sepia-on] a:link,:root[style*=readium-sepia-on] a:link *{color:var(--RS__linkColor)}:root[style*=readium-sepia-on] a:visited,:root[style*=readium-sepia-on] a:visited *{color:var(--RS__visitedColor)}@media screen and (-ms-high-contrast: active){:root{color:windowText!important;background-color:window!important}:root :not(#\\#):not(#\\#):not(#\\#),:root :not(#\\#):not(#\\#):not(#\\#) :not(#\\#):not(#\\#):not(#\\#) :root :not(#\\#):not(#\\#):not(#\\#) :not(#\\#):not(#\\#):not(#\\#) :not(#\\#):not(#\\#):not(#\\#){color:inherit!important;background-color:inherit!important}.readiumCSS-mo-active-default{color:highlightText!important;background-color:highlight!important}}@media screen and (-ms-high-contrast: white-on-black){:root[style*=readium-night-on] img[class*=gaiji],:root[style*=readium-night-on] *[epub\\:type~=titlepage] img:only-child,:root[style*=readium-night-on] *[epub|type~=titlepage] img:only-child{-webkit-filter:none!important;filter:none!important}:root[style*=readium-night-on][style*=readium-invert-on] img{-webkit-filter:none!important;filter:none!important}:root[style*=readium-night-on][style*=readium-darken-on][style*=readium-invert-on] img{-webkit-filter:brightness(80%);filter:brightness(80%)}}@media screen and (inverted-colors){:root[style*=readium-night-on] img[class*=gaiji],:root[style*=readium-night-on] *[epub\\:type~=titlepage] img:only-child,:root[style*=readium-night-on] *[epub|type~=titlepage] img:only-child{-webkit-filter:none!important;filter:none!important}:root[style*=readium-night-on][style*=readium-invert-on] img{-webkit-filter:none!important;filter:none!important}:root[style*=readium-night-on][style*=readium-darken-on][style*=readium-invert-on] img{-webkit-filter:brightness(80%);filter:brightness(80%)}}:root[style*=--USER__backgroundColor]{background-color:var(--USER__backgroundColor)!important}:root[style*=--USER__backgroundColor] *{background-color:transparent!important}:root[style*=--USER__textColor]{color:var(--USER__textColor)!important}:root[style*=--USER__textColor] *:not(a){color:inherit!important;background-color:transparent!important;border-color:currentcolor!important}:root[style*=--USER__textColor] svg text{fill:currentcolor!important;stroke:none!important}:root[style*=--USER__linkColor] a:link,:root[style*=--USER__linkColor] a:link *{color:var(--USER__linkColor)!important}:root[style*=--USER__visitedColor] a:visited,:root[style*=--USER__visitedColor] a:visited *{color:var(--USER__visitedColor)!important}:root[style*=--USER__selectionBackgroundColor][style*=--USER__selectionTextColor] ::-moz-selection{color:var(--USER__selectionTextColor)!important;background-color:var(--USER__selectionBackgroundColor)!important}:root[style*=--USER__selectionBackgroundColor][style*=--USER__selectionTextColor] ::selection{color:var(--USER__selectionTextColor)!important;background-color:var(--USER__selectionBackgroundColor)!important}:root[style*=--USER__colCount]{-webkit-column-count:var(--USER__colCount);-moz-column-count:var(--USER__colCount);column-count:var(--USER__colCount);--RS__colWidth:auto}:root[style*="--USER__colCount: 0"],:root[style*="--USER__colCount:0"]{-webkit-column-count:1;-moz-column-count:1;column-count:1}:root[style*="--USER__colCount: 0"],:root[style*="--USER__colCount:0"],:root[style*="--USER__colCount: 1"],:root[style*="--USER__colCount:1"]{--RS__colWidth:100vw}:root[style*=--USER__lineLength] body{max-width:var(--USER__lineLength)!important}:root[style*=--USER__textAlign]{text-align:var(--USER__textAlign)}:root[style*=--USER__textAlign] body,:root[style*=--USER__textAlign] p:not(blockquote p):not(figcaption p):not(hgroup p),:root[style*=--USER__textAlign] li,:root[style*=--USER__textAlign] dd{text-align:var(--USER__textAlign)!important;-moz-text-align-last:auto!important;-epub-text-align-last:auto!important;text-align-last:auto!important}:root[style*=--USER__bodyHyphens]{-webkit-hyphens:var(--USER__bodyHyphens)!important;-moz-hyphens:var(--USER__bodyHyphens)!important;-ms-hyphens:var(--USER__bodyHyphens)!important;-epub-hyphens:var(--USER__bodyHyphens)!important;hyphens:var(--USER__bodyHyphens)!important}:root[style*=--USER__bodyHyphens] body,:root[style*=--USER__bodyHyphens] p,:root[style*=--USER__bodyHyphens] li,:root[style*=--USER__bodyHyphens] div,:root[style*=--USER__bodyHyphens] dd{-webkit-hyphens:inherit;-moz-hyphens:inherit;-ms-hyphens:inherit;-epub-hyphens:inherit;hyphens:inherit}:root[style*=--USER__fontFamily]{font-family:var(--USER__fontFamily)!important}:root[style*=--USER__fontFamily] *{font-family:revert!important}:root[style*=AccessibleDfA]{font-family:AccessibleDfA,Verdana,Tahoma,Trebuchet MS,sans-serif!important}:root[style*="IA Writer Duospace"]{font-family:IA Writer Duospace,Menlo,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier,monospace!important}:root[style*=AccessibleDfA],:root[style*="IA Writer Duospace"],:root[style*=readium-a11y-on]{font-style:normal!important;font-weight:400!important}:root[style*=AccessibleDfA] *:not(code):not(var):not(kbd):not(samp),:root[style*="IA Writer Duospace"] *:not(code):not(var):not(kbd):not(samp),:root[style*=readium-a11y-on] *:not(code):not(var):not(kbd):not(samp){font-family:inherit!important;font-style:inherit!important;font-weight:inherit!important}:root[style*=AccessibleDfA] *,:root[style*="IA Writer Duospace"] *,:root[style*=readium-a11y-on] *{text-decoration:none!important;font-variant-caps:normal!important;font-variant-numeric:normal!important;font-variant-position:normal!important}:root[style*=AccessibleDfA] sup,:root[style*="IA Writer Duospace"] sup,:root[style*=readium-a11y-on] sup,:root[style*=AccessibleDfA] sub,:root[style*="IA Writer Duospace"] sub,:root[style*=readium-a11y-on] sub{font-size:1rem!important;vertical-align:baseline!important}:root:not([style*=readium-deprecatedFontSize-on])[style*=--USER__fontSize] body{zoom:var(--USER__fontSize)!important}@supports not (zoom: 1){:root[style*=--USER__fontSize]{font-size:var(--USER__fontSize)!important}}:root[style*=readium-deprecatedFontSize-on][style*=--USER__fontSize]{font-size:var(--USER__fontSize)!important}:root[style*=--USER__lineHeight]{line-height:var(--USER__lineHeight)!important}:root[style*=--USER__lineHeight] body,:root[style*=--USER__lineHeight] p,:root[style*=--USER__lineHeight] li,:root[style*=--USER__lineHeight] div{line-height:inherit}:root[style*=--USER__paraSpacing] p{margin-top:var(--USER__paraSpacing)!important;margin-bottom:var(--USER__paraSpacing)!important}:root[style*=--USER__paraIndent] p{text-indent:var(--USER__paraIndent)!important}:root[style*=--USER__paraIndent] p *,:root[style*=--USER__paraIndent] p:first-letter{text-indent:0!important}:root[style*=--USER__wordSpacing] h1,:root[style*=--USER__wordSpacing] h2,:root[style*=--USER__wordSpacing] h3,:root[style*=--USER__wordSpacing] h4,:root[style*=--USER__wordSpacing] h5,:root[style*=--USER__wordSpacing] h6,:root[style*=--USER__wordSpacing] p,:root[style*=--USER__wordSpacing] li,:root[style*=--USER__wordSpacing] div,:root[style*=--USER__wordSpacing] dt,:root[style*=--USER__wordSpacing] dd{word-spacing:var(--USER__wordSpacing)}:root[style*=--USER__letterSpacing] h1,:root[style*=--USER__letterSpacing] h2,:root[style*=--USER__letterSpacing] h3,:root[style*=--USER__letterSpacing] h4,:root[style*=--USER__letterSpacing] h5,:root[style*=--USER__letterSpacing] h6,:root[style*=--USER__letterSpacing] p,:root[style*=--USER__letterSpacing] li,:root[style*=--USER__letterSpacing] div,:root[style*=--USER__letterSpacing] dt,:root[style*=--USER__letterSpacing] dd{letter-spacing:var(--USER__letterSpacing);font-variant:none}:root[style*=--USER__fontWeight] body{font-weight:var(--USER__fontWeight)!important}:root[style*=--USER__fontWeight] b,:root[style*=--USER__fontWeight] strong{font-weight:bolder}:root[style*=--USER__fontWidth] body{font-stretch:var(--USER__fontWidth)!important}:root[style*=--USER__fontOpticalSizing] body{font-optical-sizing:var(--USER__fontOpticalSizing)!important}:root[style*=readium-blend-on] svg,:root[style*=readium-blend-on] img{background-color:transparent!important;mix-blend-mode:multiply!important}:root[style*=--USER__darkenImages] img{-webkit-filter:brightness(var(--USER__darkenImages))!important;filter:brightness(var(--USER__darkenImages))!important}:root[style*=readium-darken-on] img{-webkit-filter:brightness(80%)!important;filter:brightness(80%)!important}:root[style*=--USER__invertImages] img{-webkit-filter:invert(var(--USER__invertImages))!important;filter:invert(var(--USER__invertImages))!important}:root[style*=readium-invert-on] img{-webkit-filter:invert(100%)!important;filter:invert(100%)!important}:root[style*=--USER__darkenImages][style*=--USER__invertImages] img{-webkit-filter:brightness(var(--USER__darkenImages)) invert(var(--USER__invertImages))!important;filter:brightness(var(--USER__darkenImages)) invert(var(--USER__invertImages))!important}:root[style*=readium-darken-on][style*=--USER__invertImages] img{-webkit-filter:brightness(80%) invert(var(--USER__invertImages))!important;filter:brightness(80%) invert(var(--USER__invertImages))!important}:root[style*=--USER__darkenImages][style*=readium-invert-on] img{-webkit-filter:brightness(var(--USER__darkenImages)) invert(100%)!important;filter:brightness(var(--USER__darkenImages)) invert(100%)!important}:root[style*=readium-darken-on][style*=readium-invert-on] img{-webkit-filter:brightness(80%) invert(100%)!important;filter:brightness(80%) invert(100%)!important}:root[style*=--USER__invertGaiji] img[class*=gaiji]{-webkit-filter:invert(var(--USER__invertGaiji))!important;filter:invert(var(--USER__invertGaiji))!important}:root[style*=readium-invertGaiji-on] img[class*=gaiji]{-webkit-filter:invert(100%)!important;filter:invert(100%)!important}:root[style*=readium-normalize-on]{--USER__typeScale:1.2}:root[style*=readium-normalize-on] p,:root[style*=readium-normalize-on] li,:root[style*=readium-normalize-on] div,:root[style*=readium-normalize-on] pre,:root[style*=readium-normalize-on] dd{font-size:1rem!important}:root[style*=readium-normalize-on] h1{font-size:1.75rem!important;font-size:calc(((1rem * var(--USER__typeScale)) * var(--USER__typeScale)) * var(--USER__typeScale))!important}:root[style*=readium-normalize-on] h2{font-size:1.5rem!important;font-size:calc((1rem * var(--USER__typeScale)) * var(--USER__typeScale))!important}:root[style*=readium-normalize-on] h3{font-size:1.25rem!important;font-size:calc(1rem * var(--USER__typeScale))!important}:root[style*=readium-normalize-on] h4,:root[style*=readium-normalize-on] h5,:root[style*=readium-normalize-on] h6{font-size:1rem!important}:root[style*=readium-normalize-on] small{font-size:smaller!important}:root[style*=readium-normalize-on] sub,:root[style*=readium-normalize-on] sup{font-size:67.5%!important}:root[style*=readium-normalize-on][style*=--USER__typeScale] h1{font-size:calc(((1rem * var(--USER__typeScale)) * var(--USER__typeScale)) * var(--USER__typeScale))!important}:root[style*=readium-normalize-on][style*=--USER__typeScale] h2{font-size:calc((1rem * var(--USER__typeScale)) * var(--USER__typeScale))!important}:root[style*=readium-normalize-on][style*=--USER__typeScale] h3{font-size:calc(1rem * var(--USER__typeScale))!important}:root[style*=readium-iPadOSPatch-on] body{-webkit-text-size-adjust:none}:root[style*=readium-iPadOSPatch-on] p,:root[style*=readium-iPadOSPatch-on] h1,:root[style*=readium-iPadOSPatch-on] h2,:root[style*=readium-iPadOSPatch-on] h3,:root[style*=readium-iPadOSPatch-on] h4,:root[style*=readium-iPadOSPatch-on] h5,:root[style*=readium-iPadOSPatch-on] h6,:root[style*=readium-iPadOSPatch-on] li,:root[style*=readium-iPadOSPatch-on] th,:root[style*=readium-iPadOSPatch-on] td,:root[style*=readium-iPadOSPatch-on] dt,:root[style*=readium-iPadOSPatch-on] dd,:root[style*=readium-iPadOSPatch-on] pre,:root[style*=readium-iPadOSPatch-on] address,:root[style*=readium-iPadOSPatch-on] details,:root[style*=readium-iPadOSPatch-on] summary,:root[style*=readium-iPadOSPatch-on] figcaption,:root[style*=readium-iPadOSPatch-on] div:not(:has(p,h1,h2,h3,h4,h5,h6,li,th,td,dt,dd,pre,address,aside,details,figcaption,summary)),:root[style*=readium-iPadOSPatch-on] aside:not(:has(p,h1,h2,h3,h4,h5,h6,li,th,td,dt,dd,pre,address,aside,details,figcaption,summary)){-webkit-text-zoom:reset}:root[style*=readium-iPadOSPatch-on] abbr,:root[style*=readium-iPadOSPatch-on] b,:root[style*=readium-iPadOSPatch-on] bdi,:root[style*=readium-iPadOSPatch-on] bdo,:root[style*=readium-iPadOSPatch-on] cite,:root[style*=readium-iPadOSPatch-on] code,:root[style*=readium-iPadOSPatch-on] dfn,:root[style*=readium-iPadOSPatch-on] em,:root[style*=readium-iPadOSPatch-on] i,:root[style*=readium-iPadOSPatch-on] kbd,:root[style*=readium-iPadOSPatch-on] mark,:root[style*=readium-iPadOSPatch-on] q,:root[style*=readium-iPadOSPatch-on] rp,:root[style*=readium-iPadOSPatch-on] rt,:root[style*=readium-iPadOSPatch-on] ruby,:root[style*=readium-iPadOSPatch-on] s,:root[style*=readium-iPadOSPatch-on] samp,:root[style*=readium-iPadOSPatch-on] small,:root[style*=readium-iPadOSPatch-on] span,:root[style*=readium-iPadOSPatch-on] strong,:root[style*=readium-iPadOSPatch-on] sub,:root[style*=readium-iPadOSPatch-on] sup,:root[style*=readium-iPadOSPatch-on] time,:root[style*=readium-iPadOSPatch-on] u,:root[style*=readium-iPadOSPatch-on] var{-webkit-text-zoom:normal}:root[style*=readium-iPadOSPatch-on] p:not(:has(b,cite,em,i,q,s,small,span,strong)):first-line{-webkit-text-zoom:normal}
1184
1184
  `, $A = `@namespace url(http://www.w3.org/1999/xhtml);@namespace epub url(http://www.idpf.org/2007/ops);@namespace m url(http://www.w3.org/1998/Math/MathML);@namespace svg url(http://www.w3.org/2000/svg);@-ms-viewport{width:device-width}@viewport{width:device-width;zoom:1}:root{--RS__monospaceTf:ui-monospace, "Andale Mono", "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;--RS__humanistTf:Seravek, Calibri, "Gill Sans Nova", Roboto, Ubuntu, "DejaVu Sans", source-sans-pro, sans-serif;--RS__sansTf:-ui-sans-serif, -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", Inter, Roboto, "Helvetica Neue", "Arial Nova", "Liberation Sans", Arial, sans-serif;--RS__modernTf:Athelas, Constantia, Charter, "Bitstream Charter", Cambria, "Georgia Pro", Georgia, serif;--RS__oldStyleTf:"Iowan Old Style", Sitka, "Sitka Text", Palatino, "Book Antiqua", "URW Palladio L", P052, serif;--RS__baseFontFamily:var(--RS__oldStyleTf);--RS__lineHeightCompensation:1;--RS__baseLineHeight:calc(1.5 * var(--RS__lineHeightCompensation));--RS__selectionTextColor:inherit;--RS__selectionBackgroundColor:#b4d8fe;--RS__visitedColor:#551A8B;--RS__linkColor:#0000EE;--RS__textColor:#121212;--RS__backgroundColor:#FFFFFF;color:var(--RS__textColor)!important;background-color:var(--RS__backgroundColor)!important}::-moz-selection{color:var(--RS__selectionTextColor);background-color:var(--RS__selectionBackgroundColor)}::selection{color:var(--RS__selectionTextColor);background-color:var(--RS__selectionBackgroundColor)}html{font-family:var(--RS__baseFontFamily);line-height:1.6;line-height:var(--RS__baseLineHeight);text-rendering:optimizelegibility}h1,h2,h3{line-height:normal}:lang(ja),:lang(zh),:lang(ko){word-wrap:break-word;-webkit-line-break:strict;-epub-line-break:strict;line-break:strict}math{font-family:"Latin Modern Math","STIX Two Math","XITS Math","STIX Math","Libertinus Math","TeX Gyre Termes Math","TeX Gyre Bonum Math",TeX Gyre Schola,"DejaVu Math TeX Gyre","TeX Gyre Pagella Math","Asana Math","Cambria Math","Lucida Bright Math","Minion Math",STIXGeneral,STIXSizeOneSym,Symbol,Times New Roman,serif}:lang(am){--RS__baseFontFamily:kefa, nyala, roboto, noto, "Noto Sans Ethiopic", serif;--RS__lineHeightCompensation:1.167}:lang(ar){--RS__baseFontFamily:"Geeza Pro", "Arabic Typesetting", roboto, noto, "Noto Naskh Arabic", "Times New Roman", serif}:lang(bn){--RS__baseFontFamily:"Kohinoor Bangla", "Bangla Sangam MN", vrinda, roboto, noto, "Noto Sans Bengali", sans-serif;--RS__lineHeightCompensation:1.067}:lang(bo){--RS__baseFontFamily:kailasa, "Microsoft Himalaya", roboto, noto, "Noto Sans Tibetan", sans-serif}:lang(chr){--RS__baseFontFamily:"Plantagenet Cherokee", roboto, noto, "Noto Sans Cherokee";--RS__lineHeightCompensation:1.167}:lang(fa){--RS__baseFontFamily:"Geeza Pro", "Arabic Typesetting", roboto, noto, "Noto Naskh Arabic", "Times New Roman", serif}:lang(gu){--RS__baseFontFamily:"Gujarati Sangam MN", "Nirmala UI", shruti, roboto, noto, "Noto Sans Gujarati", sans-serif;--RS__lineHeightCompensation:1.167}:lang(he){--RS__baseFontFamily:"New Peninim MT", "Arial Hebrew", gisha, "Times New Roman", roboto, noto, "Noto Sans Hebrew" sans-serif;--RS__lineHeightCompensation:1.1}:lang(hi){--RS__baseFontFamily:"Kohinoor Devanagari", "Devanagari Sangam MN", kokila, "Nirmala UI", roboto, noto, "Noto Sans Devanagari", sans-serif;--RS__lineHeightCompensation:1.1}:lang(hy){--RS__baseFontFamily:mshtakan, sylfaen, roboto, noto, "Noto Serif Armenian", serif}:lang(iu){--RS__baseFontFamily:"Euphemia UCAS", euphemia, roboto, noto, "Noto Sans Canadian Aboriginal", sans-serif}:lang(ja){--RS__baseFontFamily:yugothic, "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Meiryo UI", "MS Gothic", roboto, noto, "Noto Sans CJK JP", sans-serif;--RS__lineHeightCompensation:1.167;--RS__serif-ja:"Hiragino Mincho ProN", "Hiragino Mincho Pro", "YuMincho", "BIZ UDPMincho", "Yu Mincho", "MS P明朝", "MS PMincho", serif;--RS__sans-serif-ja:"Hiragino Sans", "Hiragino Kaku Gothic ProN", "Hiragino Kaku Gothic Pro", "ヒラギノ角ゴ W3", "YuGothic", "Yu Gothic Medium", "BIZ UDPGothic", "Yu Gothic", "MS Pゴシック", "MS PGothic", sans-serif;--RS__serif-ja-v:"Hiragino Mincho ProN", "Hiragino Mincho Pro", "YuMincho", "BIZ UDMincho", "Yu Mincho", "MS明朝", "MS Mincho", serif;--RS__sans-serif-ja-v:"Hiragino Sans", "Hiragino Kaku Gothic ProN", "Hiragino Kaku Gothic Pro", "ヒラギノ角ゴ W3", "YuGothic", "Yu Gothic Medium", "BIZ UDGothic", "Yu Gothic", "MSゴシック", "MS Gothic", sans-serif}:lang(km){--RS__baseFontFamily:"Khmer Sangam MN", "Leelawadee UI", "Khmer UI", roboto, noto, "Noto Sans Khmer", sans-serif;--RS__lineHeightCompensation:1.067}:lang(kn){--RS__baseFontFamily:"Kannada Sangam MN", "Nirmala UI", tunga, roboto, noto, "Noto Sans Kannada", sans-serif;--RS__lineHeightCompensation:1.1}:lang(ko){--RS__baseFontFamily:"Nanum Gothic", "Apple SD Gothic Neo", "Malgun Gothic", roboto, noto, "Noto Sans CJK KR", sans-serif;--RS__lineHeightCompensation:1.167}:lang(lo){--RS__baseFontFamily:"Lao Sangam MN", "Leelawadee UI", "Lao UI", roboto, noto, "Noto Sans Lao", sans-serif}:lang(ml){--RS__baseFontFamily:"Malayalam Sangam MN", "Nirmala UI", kartika, roboto, noto, "Noto Sans Malayalam", sans-serif;--RS__lineHeightCompensation:1.067}:lang(or){--RS__baseFontFamily:"Oriya Sangam MN", "Nirmala UI", kalinga, roboto, noto, "Noto Sans Oriya", sans-serif;--RS__lineHeightCompensation:1.167}:lang(pa){--RS__baseFontFamily:"Gurmukhi MN", "Nirmala UI", kartika, roboto, noto, "Noto Sans Gurmukhi", sans-serif;--RS__lineHeightCompensation:1.1}:lang(si){--RS__baseFontFamily:"Sinhala Sangam MN", "Nirmala UI", "Iskoola Pota", roboto, noto, "Noto Sans Sinhala", sans-serif;--RS__lineHeightCompensation:1.167}:lang(ta){--RS__baseFontFamily:"Tamil Sangam MN", "Nirmala UI", latha, roboto, noto, "Noto Sans Tamil", sans-serif;--RS__lineHeightCompensation:1.067}:lang(te){--RS__baseFontFamily:"Kohinoor Telugu", "Telugu Sangam MN", "Nirmala UI", gautami, roboto, noto, "Noto Sans Telugu", sans-serif}:lang(th){--RS__baseFontFamily:"Thonburi", "Leelawadee UI", "Cordia New", roboto, noto, "Noto Sans Thai", sans-serif;--RS__lineHeightCompensation:1.067}:lang(zh){--RS__baseFontFamily:"方体", "PingFang SC", "黑体", "Heiti SC", "Microsoft JhengHei UI", "Microsoft JhengHei", roboto, noto, "Noto Sans CJK SC", sans-serif;--RS__lineHeightCompensation:1.167}:lang(zh-Hant),:lang(zh-TW){--RS__baseFontFamily:"方體", "PingFang TC", "黑體", "Heiti TC", "Microsoft JhengHei UI", "Microsoft JhengHei", roboto, noto, "Noto Sans CJK TC", sans-serif;--RS__lineHeightCompensation:1.167}:lang(zh-HK){--RS__baseFontFamily:"方體", "PingFang HK", "方體", "PingFang TC", "黑體", "Heiti TC", "Microsoft JhengHei UI", "Microsoft JhengHei", roboto, noto, "Noto Sans CJK TC", sans-serif;--RS__lineHeightCompensation:1.167}@font-face{font-family:AccessibleDfA;font-style:normal;font-weight:400;src:local("AccessibleDfA"),url(./assets/AccessibleDfA-Regular.woff2) format("woff2"),url(./assets/AccessibleDfA-Regular.woff) format("woff")}@font-face{font-family:AccessibleDfA;font-style:normal;font-weight:700;src:local("AccessibleDfA"),url(./assets/AccessibleDfA-Bold.woff2) format("woff2")}@font-face{font-family:AccessibleDfA;font-style:italic;font-weight:400;src:local("AccessibleDfA"),url(./assets/AccessibleDfA-Italic.woff2) format("woff2")}@font-face{font-family:IA Writer Duospace;font-style:normal;font-weight:400;src:local("iAWriterDuospace-Regular"),url(./assets/iAWriterDuospace-Regular.ttf) format("truetype")}body{widows:2;orphans:2}figcaption,th,td{widows:1;orphans:1}h2,h3,h4,h5,h6,dt,hr,caption{-webkit-column-break-after:avoid;page-break-after:avoid;break-after:avoid}h1,h2,h3,h4,h5,h6,dt,figure,tr{-webkit-column-break-inside:avoid;page-break-inside:avoid;break-inside:avoid}body{-webkit-hyphenate-character:"-";-moz-hyphenate-character:"-";-ms-hyphenate-character:"-";hyphenate-character:"-";-webkit-hyphenate-limit-lines:3;-ms-hyphenate-limit-lines:3;hyphenate-limit-lines:3}h1,h2,h3,h4,h5,h6,dt,figcaption,pre,caption,address,center,code,var{-ms-hyphens:none;-moz-hyphens:none;-webkit-hyphens:none;-epub-hyphens:none;hyphens:none}body{font-variant-numeric:oldstyle-nums proportional-nums}:lang(ja) body,:lang(zh) body,:lang(ko) body{font-variant-numeric:lining-nums proportional-nums}h1,h2,h3,h4,h5,h6,dt{font-variant-numeric:lining-nums proportional-nums}table{font-variant-numeric:lining-nums tabular-nums}code,var{font-variant-ligatures:none;font-variant-numeric:lining-nums tabular-nums slashed-zero}rt{font-variant-east-asian:ruby}:lang(ar){font-variant-ligatures:common-ligatures}:lang(ko){font-kerning:normal}hr{color:inherit;border-color:currentcolor}table,th,td{border-color:currentcolor}figure,blockquote{margin:1em 5%}ul,ol{padding-left:5%}dd{margin-left:5%}pre{white-space:pre-wrap;-ms-tab-size:2;-moz-tab-size:2;-webkit-tab-size:2;tab-size:2}abbr[title],acronym[title]{text-decoration:dotted underline}nobr wbr{white-space:normal}ruby>rt,ruby>rp{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}*:lang(ja):not(:lang(ja-Latn)):not(:lang(ja-Cyrl)),*:lang(zh):not(:lang(zh-Latn)):not(:lang(zh-Cyrl)),*:lang(ko):not(:lang(ko-Latn)):not(:lang(ko-Cyrl)),:lang(ja):not(:lang(ja-Latn)):not(:lang(ja-Cyrl)) cite,:lang(ja):not(:lang(ja-Latn)):not(:lang(ja-Cyrl)) dfn,:lang(ja):not(:lang(ja-Latn)):not(:lang(ja-Cyrl)) em,:lang(ja):not(:lang(ja-Latn)):not(:lang(ja-Cyrl)) i,:lang(zh):not(:lang(zh-Latn)):not(:lang(zh-Cyrl)) cite,:lang(zh):not(:lang(zh-Latn)):not(:lang(zh-Cyrl)) dfn,:lang(zh):not(:lang(zh-Latn)):not(:lang(zh-Cyrl)) em,:lang(zh):not(:lang(zh-Latn)):not(:lang(zh-Cyrl)) i,:lang(ko):not(:lang(ko-Latn)):not(:lang(ko-Cyrl)) cite,:lang(ko):not(:lang(ko-Latn)):not(:lang(ko-Cyrl)) dfn,:lang(ko):not(:lang(ko-Latn)):not(:lang(ko-Cyrl)) em,:lang(ko):not(:lang(ko-Latn)):not(:lang(ko-Cyrl)) i{font-style:normal}:lang(ja) a,:lang(zh) a,:lang(ko) a{text-decoration:none}:root{--RS__maxMediaWidth:100%;--RS__maxMediaHeight:95vh;--RS__boxSizingMedia:border-box;--RS__boxSizingTable:border-box}a,a span,span a,h1,h2,h3,h4,h5,h6{word-wrap:break-word}div{max-width:var(--RS__maxMediaWidth)}img,svg|svg,video{object-fit:contain;width:auto;height:auto;max-width:var(--RS__maxMediaWidth);max-height:var(--RS__maxMediaHeight)!important;box-sizing:var(--RS__boxSizingMedia);-webkit-column-break-inside:avoid;page-break-inside:avoid;break-inside:avoid}audio{max-width:100%;-webkit-column-break-inside:avoid;page-break-inside:avoid;break-inside:avoid}table{max-width:var(--RS__maxMediaWidth);box-sizing:var(--RS__boxSizingTable)}
1185
1185
  `, ti = `@namespace url(http://www.w3.org/1999/xhtml);@namespace epub url(http://www.idpf.org/2007/ops);@namespace m url(http://www.w3.org/1998/Math/MathML);@namespace svg url(http://www.w3.org/2000/svg);:root{--RS__compFontFamily:var(--RS__baseFontFamily);--RS__codeFontFamily:var(--RS__monospaceTf);--RS__typeScale:1.125;--RS__baseFontSize:100%;--RS__flowSpacing:1.5rem;--RS__paraSpacing:0;--RS__paraIndent:1em;--RS__linkColor:#0000EE;--RS__visitedColor:#551A8B;--RS__primaryColor:;--RS__secondaryColor:}body{font-size:var(--RS__baseFontSize)}h1,h2,h3,h4,h5,h6{font-family:var(--RS__compFontFamily)}blockquote,figure,p,pre,aside,footer,form,hr{margin-top:var(--RS__flowSpacing);margin-bottom:var(--RS__flowSpacing)}p{margin-top:var(--RS__paraSpacing);margin-bottom:var(--RS__paraSpacing);text-indent:var(--RS__paraIndent)}h1+p,h2+p,h3+p,h4+p,h5+p,h6+p,hr+p{text-indent:0}pre{font-family:var(--RS__codeFontFamily)}code,kbd,samp,tt{font-family:var(--RS__codeFontFamily)}sub,sup{position:relative;font-size:67.5%;line-height:1}sub{bottom:-.2ex}sup{bottom:0}:link{color:var(--RS__linkColor)}:visited{color:var(--RS__visitedColor)}h1{margin-top:calc(var(--RS__flowSpacing) * 2);margin-bottom:calc(var(--RS__flowSpacing) * 2);font-size:calc(((1em * var(--RS__typeScale)) * var(--RS__typeScale)) * var(--RS__typeScale))}h2{margin-top:calc(var(--RS__flowSpacing) * 2);margin-bottom:var(--RS__flowSpacing);font-size:calc((1em * var(--RS__typeScale)) * var(--RS__typeScale))}h3{margin-top:var(--RS__flowSpacing);margin-bottom:var(--RS__flowSpacing);font-size:calc(1em * var(--RS__typeScale))}h4{margin-top:var(--RS__flowSpacing);margin-bottom:var(--RS__flowSpacing);font-size:1em}h5{margin-top:var(--RS__flowSpacing);margin-bottom:var(--RS__flowSpacing);font-size:1em;font-variant:small-caps}h6{margin-top:var(--RS__flowSpacing);margin-bottom:0;font-size:1em;text-transform:lowercase;font-variant:small-caps}dl,ol,ul{margin-top:var(--RS__flowSpacing);margin-bottom:var(--RS__flowSpacing)}table{margin:var(--RS__flowSpacing) 0;border:1px solid currentcolor;border-collapse:collapse;empty-cells:show}thead,tbody,tfoot,table>tr{vertical-align:top}th{text-align:left}th,td{padding:4px;border:1px solid currentcolor}
1186
- `, $ = (n, t) => URL.createObjectURL(new Blob([n], { type: t })), rA = (n) => n.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").replace(/\n/g, "").replace(/\s+/g, " "), vt = (n) => n.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g, "").replace(/ {2,}/g, " ").replace(/url\((?!(https?:)?\/\/)("?)\/([^\)]+)/g, `url($2${window.location.origin}/$3`), ie = (n, t) => {
1187
- const e = n.createElement("script");
1186
+ `, $ = (i, t) => URL.createObjectURL(new Blob([i], { type: t })), nA = (i) => i.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").replace(/\n/g, "").replace(/\s+/g, " "), bt = (i) => i.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g, "").replace(/ {2,}/g, " ").replace(/url\((?!(https?:)?\/\/)("?)\/([^\)]+)/g, `url($2${window.location.origin}/$3`), Ae = (i, t) => {
1187
+ const e = i.createElement("script");
1188
1188
  return e.dataset.readium = "true", e.src = t.startsWith("blob:") ? t : $(t, "text/javascript"), e;
1189
- }, bt = (n, t) => {
1190
- const e = n.createElement("link");
1189
+ }, vt = (i, t) => {
1190
+ const e = i.createElement("link");
1191
1191
  return e.dataset.readium = "true", e.rel = "stylesheet", e.type = "text/css", e.href = t.startsWith("blob:") ? t : $(t, "text/css"), e;
1192
- }, Gt = /* @__PURE__ */ new Map(), st = (n, t) => {
1193
- if (Gt.has(n))
1194
- return Gt.get(n);
1192
+ }, Gt = /* @__PURE__ */ new Map(), st = (i, t) => {
1193
+ if (Gt.has(i))
1194
+ return Gt.get(i);
1195
1195
  const e = t();
1196
- return Gt.set(n, e), e;
1197
- }, ei = (n) => ie(n, st("css-selector-generator", () => $(
1196
+ return Gt.set(i, e), e;
1197
+ }, ei = (i) => Ae(i, st("css-selector-generator", () => $(
1198
1198
  '!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports._readium_cssSelectorGenerator=e():t._readium_cssSelectorGenerator=e()}(self,(()=>(()=>{"use strict";var t,e,n={d:(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},o={};function r(t){return t&&t instanceof Element}function i(t="unknown problem",...e){console.warn(`CssSelectorGenerator: ${t}`,...e)}n.r(o),n.d(o,{default:()=>z,getCssSelector:()=>U}),function(t){t.NONE="none",t.DESCENDANT="descendant",t.CHILD="child"}(t||(t={})),function(t){t.id="id",t.class="class",t.tag="tag",t.attribute="attribute",t.nthchild="nthchild",t.nthoftype="nthoftype"}(e||(e={}));const c={selectors:[e.id,e.class,e.tag,e.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY};function u(t){return t instanceof RegExp}function s(t){return["string","function"].includes(typeof t)||u(t)}function l(t){return Array.isArray(t)?t.filter(s):[]}function a(t){const e=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(t){return t instanceof Node}(t)&&e.includes(t.nodeType)}function f(t,e){if(a(t))return t.contains(e)||i("element root mismatch","Provided root does not contain the element. This will most likely result in producing a fallback selector using element\'s real root node. If you plan to use the selector using provided root (e.g. `root.querySelector`), it will nto work as intended."),t;const n=e.getRootNode({composed:!1});return a(n)?(n!==document&&i("shadow root inferred","You did not provide a root and the element is a child of Shadow DOM. This will produce a selector using ShadowRoot as a root. If you plan to use the selector using document as a root (e.g. `document.querySelector`), it will not work as intended."),n):e.ownerDocument.querySelector(":root")}function d(t){return"number"==typeof t?t:Number.POSITIVE_INFINITY}function m(t=[]){const[e=[],...n]=t;return 0===n.length?e:n.reduce(((t,e)=>t.filter((t=>e.includes(t)))),e)}function p(t){return[].concat(...t)}function h(t){const e=t.map((t=>{if(u(t))return e=>t.test(e);if("function"==typeof t)return e=>{const n=t(e);return"boolean"!=typeof n?(i("pattern matcher function invalid","Provided pattern matching function does not return boolean. It\'s result will be ignored.",t),!1):n};if("string"==typeof t){const e=new RegExp("^"+t.replace(/[|\\\\{}()[\\]^$+?.]/g,"\\\\$&").replace(/\\*/g,".+")+"$");return t=>e.test(t)}return i("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",t),()=>!1}));return t=>e.some((e=>e(t)))}function g(t,e,n){const o=Array.from(f(n,t[0]).querySelectorAll(e));return o.length===t.length&&t.every((t=>o.includes(t)))}function y(t,e){e=null!=e?e:function(t){return t.ownerDocument.querySelector(":root")}(t);const n=[];let o=t;for(;r(o)&&o!==e;)n.push(o),o=o.parentElement;return n}function b(t,e){return m(t.map((t=>y(t,e))))}const N={[t.NONE]:{type:t.NONE,value:""},[t.DESCENDANT]:{type:t.DESCENDANT,value:" > "},[t.CHILD]:{type:t.CHILD,value:" "}},S=new RegExp(["^$","\\\\s"].join("|")),E=new RegExp(["^$"].join("|")),w=[e.nthoftype,e.tag,e.id,e.class,e.attribute,e.nthchild],v=h(["class","id","ng-*"]);function C({nodeName:t}){return`[${t}]`}function O({nodeName:t,nodeValue:e}){return`[${t}=\'${L(e)}\']`}function T(t){const e=Array.from(t.attributes).filter((e=>function({nodeName:t},e){const n=e.tagName.toLowerCase();return!(["input","option"].includes(n)&&"value"===t||v(t))}(e,t)));return[...e.map(C),...e.map(O)]}function I(t){return(t.getAttribute("class")||"").trim().split(/\\s+/).filter((t=>!E.test(t))).map((t=>`.${L(t)}`))}function x(t){const e=t.getAttribute("id")||"",n=`#${L(e)}`,o=t.getRootNode({composed:!1});return!S.test(e)&&g([t],n,o)?[n]:[]}function j(t){const e=t.parentNode;if(e){const n=Array.from(e.childNodes).filter(r).indexOf(t);if(n>-1)return[`:nth-child(${n+1})`]}return[]}function A(t){return[L(t.tagName.toLowerCase())]}function D(t){const e=[...new Set(p(t.map(A)))];return 0===e.length||e.length>1?[]:[e[0]]}function $(t){const e=D([t])[0],n=t.parentElement;if(n){const o=Array.from(n.children).filter((t=>t.tagName.toLowerCase()===e)),r=o.indexOf(t);if(r>-1)return[`${e}:nth-of-type(${r+1})`]}return[]}function R(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){const n=[];let o=0,r=k(1);for(;r.length<=t.length&&o<e;)o+=1,n.push(r.map((e=>t[e]))),r=P(r,t.length-1);return n}function P(t=[],e=0){const n=t.length;if(0===n)return[];const o=[...t];o[n-1]+=1;for(let t=n-1;t>=0;t--)if(o[t]>e){if(0===t)return k(n+1);o[t-1]++,o[t]=o[t-1]+1}return o[n-1]>e?k(n+1):o}function k(t=1){return Array.from(Array(t).keys())}const _=":".charCodeAt(0).toString(16).toUpperCase(),M=/[ !"#$%&\'()\\[\\]{|}<>*+,./;=?@^`~\\\\]/;function L(t=""){var e,n;return null!==(n=null===(e=null===CSS||void 0===CSS?void 0:CSS.escape)||void 0===e?void 0:e.call(CSS,t))&&void 0!==n?n:function(t=""){return t.split("").map((t=>":"===t?`\\\\${_} `:M.test(t)?`\\\\${t}`:escape(t).replace(/%/g,"\\\\"))).join("")}(t)}const q={tag:D,id:function(t){return 0===t.length||t.length>1?[]:x(t[0])},class:function(t){return m(t.map(I))},attribute:function(t){return m(t.map(T))},nthchild:function(t){return m(t.map(j))},nthoftype:function(t){return m(t.map($))}},F={tag:A,id:x,class:I,attribute:T,nthchild:j,nthoftype:$};function V(t){return t.includes(e.tag)||t.includes(e.nthoftype)?[...t]:[...t,e.tag]}function Y(t={}){const n=[...w];return t[e.tag]&&t[e.nthoftype]&&n.splice(n.indexOf(e.tag),1),n.map((e=>{return(o=t)[n=e]?o[n].join(""):"";var n,o})).join("")}function B(t,e,n="",o){const r=function(t,e){return""===e?t:function(t,e){return[...t.map((t=>e+" "+t)),...t.map((t=>e+" > "+t))]}(t,e)}(function(t,e,n){const o=function(t,e){const{blacklist:n,whitelist:o,combineWithinSelector:r,maxCombinations:i}=e,c=h(n),u=h(o);return function(t){const{selectors:e,includeTag:n}=t,o=[].concat(e);return n&&!o.includes("tag")&&o.push("tag"),o}(e).reduce(((e,n)=>{const o=function(t,e){var n;return(null!==(n=q[e])&&void 0!==n?n:()=>[])(t)}(t,n),s=function(t=[],e,n){return t.filter((t=>n(t)||!e(t)))}(o,c,u),l=function(t=[],e){return t.sort(((t,n)=>{const o=e(t),r=e(n);return o&&!r?-1:!o&&r?1:0}))}(s,u);return e[n]=r?R(l,{maxResults:i}):l.map((t=>[t])),e}),{})}(t,n),r=function(t,e){return function(t){const{selectors:e,combineBetweenSelectors:n,includeTag:o,maxCandidates:r}=t,i=n?R(e,{maxResults:r}):e.map((t=>[t]));return o?i.map(V):i}(e).map((e=>function(t,e){const n={};return t.forEach((t=>{const o=e[t];o.length>0&&(n[t]=o)})),function(t={}){let e=[];return Object.entries(t).forEach((([t,n])=>{e=n.flatMap((n=>0===e.length?[{[t]:n}]:e.map((e=>Object.assign(Object.assign({},e),{[t]:n})))))})),e}(n).map(Y)}(e,t))).filter((t=>t.length>0))}(o,n),i=p(r);return[...new Set(i)]}(t,o.root,o),n);for(const e of r)if(g(t,e,o.root))return e;return null}function G(t){return{value:t,include:!1}}function W({selectors:t,operator:n}){let o=[...w];t[e.tag]&&t[e.nthoftype]&&(o=o.filter((t=>t!==e.tag)));let r="";return o.forEach((e=>{(t[e]||[]).forEach((({value:t,include:e})=>{e&&(r+=t)}))})),n.value+r}function H(n){return[":root",...y(n).reverse().map((n=>{const o=function(e,n,o=t.NONE){const r={};return n.forEach((t=>{Reflect.set(r,t,function(t,e){return F[e](t)}(e,t).map(G))})),{element:e,operator:N[o],selectors:r}}(n,[e.nthchild],t.DESCENDANT);return o.selectors.nthchild.forEach((t=>{t.include=!0})),o})).map(W)].join("")}function U(t,n={}){const o=function(t){const e=(Array.isArray(t)?t:[t]).filter(r);return[...new Set(e)]}(t),i=function(t,n={}){const o=Object.assign(Object.assign({},c),n);return{selectors:(r=o.selectors,Array.isArray(r)?r.filter((t=>{return n=e,o=t,Object.values(n).includes(o);var n,o})):[]),whitelist:l(o.whitelist),blacklist:l(o.blacklist),root:f(o.root,t),combineWithinSelector:!!o.combineWithinSelector,combineBetweenSelectors:!!o.combineBetweenSelectors,includeTag:!!o.includeTag,maxCombinations:d(o.maxCombinations),maxCandidates:d(o.maxCandidates)};var r}(o[0],n);let u="",s=i.root;function a(){return function(t,e,n="",o){if(0===t.length)return null;const r=[t.length>1?t:[],...b(t,e).map((t=>[t]))];for(const t of r){const e=B(t,0,n,o);if(e)return{foundElements:t,selector:e}}return null}(o,s,u,i)}let m=a();for(;m;){const{foundElements:t,selector:e}=m;if(g(o,e,i.root))return e;s=t[0],u=e,m=a()}return o.length>1?o.map((t=>U(t,i))).join(", "):function(t){return t.map(H).join(", ")}(o)}const z=U;return o})()));',
1199
1199
  "text/javascript"
1200
- ))), Ai = (n) => ie(n, st("JS-Before", () => $(rA(
1200
+ ))), Ai = (i) => Ae(i, st("JS-Before", () => $(nA(
1201
1201
  `
1202
1202
  window._readium_blockedEvents = [];
1203
1203
  window._readium_blockEvents = true;
@@ -1211,7 +1211,7 @@ const _A = `@namespace url(http://www.w3.org/1999/xhtml);@namespace epub url(htt
1211
1211
  };
1212
1212
  window.addEventListener("DOMContentLoaded", window._readium_eventBlocker, true);
1213
1213
  window.addEventListener("load", window._readium_eventBlocker, true);`
1214
- ), "text/javascript"))), ii = (n) => ie(n, st("JS-After", () => $(rA(
1214
+ ), "text/javascript"))), ii = (i) => Ae(i, st("JS-After", () => $(nA(
1215
1215
  `
1216
1216
  if(window.onload) window.onload = new Proxy(window.onload, {
1217
1217
  apply: function(target, receiver, args) {
@@ -1225,9 +1225,9 @@ const _A = `@namespace url(http://www.w3.org/1999/xhtml);@namespace epub url(htt
1225
1225
  }
1226
1226
  });`
1227
1227
  ), "text/javascript")));
1228
- class sA {
1229
- constructor(t, e, A, i) {
1230
- this.pub = t, this.item = A, this.burl = A.toURL(e) || "", this.cssProperties = i;
1228
+ class rA {
1229
+ constructor(t, e, A, n) {
1230
+ this.pub = t, this.item = A, this.burl = A.toURL(e) || "", this.cssProperties = n;
1231
1231
  }
1232
1232
  async build(t = !1) {
1233
1233
  if (this.item.mediaType.isHTML)
@@ -1243,10 +1243,10 @@ class sA {
1243
1243
  const A = new DOMParser().parseFromString(
1244
1244
  e,
1245
1245
  this.item.mediaType.string
1246
- ), i = A.querySelector("parsererror");
1247
- if (i) {
1248
- const r = i.querySelector("div");
1249
- throw new Error(`Failed parsing item ${this.item.href}: ${(r == null ? void 0 : r.textContent) || i.textContent}`);
1246
+ ), n = A.querySelector("parsererror");
1247
+ if (n) {
1248
+ const r = n.querySelector("div");
1249
+ throw new Error(`Failed parsing item ${this.item.href}: ${(r == null ? void 0 : r.textContent) || n.textContent}`);
1250
1250
  }
1251
1251
  return this.finalizeDOM(A, this.burl, this.item.mediaType, t, this.cssProperties);
1252
1252
  }
@@ -1266,17 +1266,17 @@ class sA {
1266
1266
  }
1267
1267
  setProperties(t, e) {
1268
1268
  for (const A in t) {
1269
- const i = t[A];
1270
- i && e.documentElement.style.setProperty(A, i);
1269
+ const n = t[A];
1270
+ n && e.documentElement.style.setProperty(A, n);
1271
1271
  }
1272
1272
  }
1273
- finalizeDOM(t, e, A, i = !1, r) {
1273
+ finalizeDOM(t, e, A, n = !1, r) {
1274
1274
  var o;
1275
1275
  if (!t)
1276
1276
  return "";
1277
- if (!i) {
1278
- const a = bt(t, st("ReadiumCSS-before", () => $(vt($A), "text/css")));
1279
- t.head.firstChild ? t.head.firstChild.before(a) : t.head.appendChild(a), this.hasStyle(t) || a.after(bt(t, st("ReadiumCSS-default", () => $(vt(ti), "text/css")))), t.head.appendChild(bt(t, st("ReadiumCSS-after", () => $(vt(_A), "text/css")))), r && this.setProperties(r, t);
1277
+ if (!n) {
1278
+ const a = vt(t, st("ReadiumCSS-before", () => $(bt($A), "text/css")));
1279
+ t.head.firstChild ? t.head.firstChild.before(a) : t.head.appendChild(a), this.hasStyle(t) || a.after(vt(t, st("ReadiumCSS-default", () => $(bt(ti), "text/css")))), t.head.appendChild(vt(t, st("ReadiumCSS-after", () => $(bt(_A), "text/css")))), r && this.setProperties(r, t);
1280
1280
  }
1281
1281
  if (t.body.querySelectorAll("img").forEach((a) => {
1282
1282
  a.setAttribute("fetchpriority", "high");
@@ -1301,7 +1301,7 @@ class sA {
1301
1301
  );
1302
1302
  }
1303
1303
  }
1304
- const ni = Math.pow(2, 32), we = () => Math.round(Math.random() * ni).toString(36), Ot = () => `${Math.round(performance.now())}-${we()}-${we()}`, rt = 1;
1304
+ const ni = Math.pow(2, 32), Ee = () => Math.round(Math.random() * ni).toString(36), Ot = () => `${Math.round(performance.now())}-${Ee()}-${Ee()}`, rt = 1;
1305
1305
  class ri {
1306
1306
  constructor(t) {
1307
1307
  this.destination = null, this.registrar = /* @__PURE__ */ new Map(), this.origin = "", this.channelId = "", this.receiver = this.receive.bind(this), this.preLog = [], this.wnd = t, t.addEventListener("message", this.receiver);
@@ -1336,22 +1336,22 @@ class ri {
1336
1336
  t.strict && this.send("_unhandled", t);
1337
1337
  return;
1338
1338
  }
1339
- e.forEach((A) => A.cb(t.data, (i) => {
1340
- this.send("_ack", i, t.id);
1339
+ e.forEach((A) => A.cb(t.data, (n) => {
1340
+ this.send("_ack", n, t.id);
1341
1341
  }));
1342
1342
  }
1343
1343
  register(t, e, A) {
1344
- Array.isArray(t) || (t = [t]), t.forEach((i) => {
1345
- const r = this.registrar.get(i);
1344
+ Array.isArray(t) || (t = [t]), t.forEach((n) => {
1345
+ const r = this.registrar.get(n);
1346
1346
  if (r && r.length >= 0) {
1347
1347
  if (r.find((s) => s.module === e))
1348
- throw new Error(`Trying to register another callback for combination of event ${i} and module ${e}`);
1348
+ throw new Error(`Trying to register another callback for combination of event ${n} and module ${e}`);
1349
1349
  r.push({
1350
1350
  cb: A,
1351
1351
  module: e
1352
- }), this.registrar.set(i, r);
1352
+ }), this.registrar.set(n, r);
1353
1353
  } else
1354
- this.registrar.set(i, [{
1354
+ this.registrar.set(n, [{
1355
1355
  cb: A,
1356
1356
  module: e
1357
1357
  }]);
@@ -1359,12 +1359,12 @@ class ri {
1359
1359
  }
1360
1360
  unregister(t, e) {
1361
1361
  Array.isArray(t) || (t = [t]), t.forEach((A) => {
1362
- const i = this.registrar.get(A);
1363
- !i || i.length === 0 || i.splice(i.findIndex((r) => r.module === e), 1);
1362
+ const n = this.registrar.get(A);
1363
+ !n || n.length === 0 || n.splice(n.findIndex((r) => r.module === e), 1);
1364
1364
  });
1365
1365
  }
1366
1366
  unregisterAll(t) {
1367
- this.registrar.forEach((e, A) => this.registrar.set(A, e.filter((i) => i.module !== t)));
1367
+ this.registrar.forEach((e, A) => this.registrar.set(A, e.filter((n) => n.module !== t)));
1368
1368
  }
1369
1369
  log(...t) {
1370
1370
  this.destination ? this.send("log", t) : this.preLog.push(t);
@@ -1375,7 +1375,7 @@ class ri {
1375
1375
  destroy() {
1376
1376
  this.destination = null, this.channelId = "", this.preLog = [], this.registrar.clear(), this.wnd.removeEventListener("message", this.receiver);
1377
1377
  }
1378
- send(t, e, A = void 0, i = []) {
1378
+ send(t, e, A = void 0, n = []) {
1379
1379
  if (!this.destination)
1380
1380
  throw Error("Attempted to send comms message before destination has been initialized");
1381
1381
  const r = {
@@ -1389,16 +1389,16 @@ class ri {
1389
1389
  try {
1390
1390
  this.destination.postMessage(r, {
1391
1391
  targetOrigin: this.origin,
1392
- transfer: i
1392
+ transfer: n
1393
1393
  });
1394
1394
  } catch (s) {
1395
- if (i.length > 0)
1395
+ if (n.length > 0)
1396
1396
  throw s;
1397
- this.destination.postMessage(r, this.origin, i);
1397
+ this.destination.postMessage(r, this.origin, n);
1398
1398
  }
1399
1399
  }
1400
1400
  }
1401
- class ne {
1401
+ class ie {
1402
1402
  /**
1403
1403
  * Creates a [Encryption].
1404
1404
  */
@@ -1410,7 +1410,7 @@ class ne {
1410
1410
  */
1411
1411
  static deserialize(t) {
1412
1412
  if (t && t.algorithm)
1413
- return new ne({
1413
+ return new ie({
1414
1414
  algorithm: t.algorithm,
1415
1415
  compression: t.compression,
1416
1416
  originalLength: t.originalLength,
@@ -1455,7 +1455,7 @@ class R {
1455
1455
  }
1456
1456
  Object.defineProperty(R.prototype, "encryption", {
1457
1457
  get: function() {
1458
- return ne.deserialize(this.otherProperties.encrypted);
1458
+ return ie.deserialize(this.otherProperties.encrypted);
1459
1459
  }
1460
1460
  });
1461
1461
  R.prototype.getContains = function() {
@@ -1467,16 +1467,16 @@ R.prototype.getLayout = function() {
1467
1467
  class d {
1468
1468
  /** Creates a MediaType object. */
1469
1469
  constructor(t) {
1470
- let e, A, i = t.mediaType.replace(/\s/g, "").split(";");
1471
- const r = i[0].split("/");
1470
+ let e, A, n = t.mediaType.replace(/\s/g, "").split(";");
1471
+ const r = n[0].split("/");
1472
1472
  if (r.length === 2) {
1473
1473
  if (e = r[0].toLowerCase().trim(), A = r[1].toLowerCase().trim(), e.length === 0 || A.length === 0)
1474
1474
  throw new Error("Invalid media type");
1475
1475
  } else
1476
1476
  throw new Error("Invalid media type");
1477
1477
  const s = {};
1478
- for (let g = 1; g < i.length; g++) {
1479
- const m = i[g].split("=");
1478
+ for (let g = 1; g < n.length; g++) {
1479
+ const m = n[g].split("=");
1480
1480
  if (m.length === 2) {
1481
1481
  const M = m[0].toLocaleLowerCase(), B = M === "charset" ? m[1].toUpperCase() : m[1];
1482
1482
  s[M] = B;
@@ -1528,11 +1528,11 @@ class d {
1528
1528
  return !1;
1529
1529
  const A = new Set(
1530
1530
  Object.entries(this.parameters).map(([r, s]) => `${r}=${s}`)
1531
- ), i = new Set(
1531
+ ), n = new Set(
1532
1532
  Object.entries(e.parameters).map(([r, s]) => `${r}=${s}`)
1533
1533
  );
1534
1534
  for (const r of Array.from(A.values()))
1535
- if (!i.has(r))
1535
+ if (!n.has(r))
1536
1536
  return !1;
1537
1537
  return !0;
1538
1538
  }
@@ -1919,7 +1919,7 @@ class d {
1919
1919
  });
1920
1920
  }
1921
1921
  }
1922
- class Ie {
1922
+ class we {
1923
1923
  constructor(t) {
1924
1924
  this.uri = t, this.parameters = this.getParameters(t);
1925
1925
  }
@@ -1929,7 +1929,7 @@ class Ie {
1929
1929
  getParameters(t) {
1930
1930
  const e = /\{\??([^}]+)\}/g, A = t.match(e);
1931
1931
  return A ? new Set(
1932
- A.join(",").replace(e, "$1").split(",").map((i) => i.trim())
1932
+ A.join(",").replace(e, "$1").split(",").map((n) => n.trim())
1933
1933
  ) : /* @__PURE__ */ new Set();
1934
1934
  }
1935
1935
  /** Expands the URI by replacing the template variables by the given parameters.
@@ -1937,34 +1937,34 @@ class Ie {
1937
1937
  * See RFC 6570 on URI template: https://tools.ietf.org/html/rfc6570
1938
1938
  */
1939
1939
  expand(t) {
1940
- const e = (i) => i.split(",").map((r) => {
1940
+ const e = (n) => n.split(",").map((r) => {
1941
1941
  const s = t[r];
1942
1942
  return s ? encodeURIComponent(s) : "";
1943
- }).join(","), A = (i) => "?" + i.split(",").map((r) => {
1943
+ }).join(","), A = (n) => "?" + n.split(",").map((r) => {
1944
1944
  const s = r.split("=")[0], o = t[s];
1945
1945
  return o ? `${s}=${encodeURIComponent(o)}` : "";
1946
1946
  }).join("&");
1947
- return this.uri.replace(/\{(\??)([^}]+)\}/g, (...i) => i[1] ? A(i[2]) : e(i[2]));
1947
+ return this.uri.replace(/\{(\??)([^}]+)\}/g, (...n) => n[1] ? A(n[2]) : e(n[2]));
1948
1948
  }
1949
1949
  }
1950
- function si(n) {
1951
- return n && n instanceof Array ? n : void 0;
1950
+ function si(i) {
1951
+ return i && i instanceof Array ? i : void 0;
1952
1952
  }
1953
- function oA(n) {
1954
- return n && typeof n == "string" ? [n] : si(n);
1953
+ function sA(i) {
1954
+ return i && typeof i == "string" ? [i] : si(i);
1955
1955
  }
1956
- function Fe(n) {
1957
- return typeof n == "string" ? new Date(n) : void 0;
1956
+ function Ie(i) {
1957
+ return typeof i == "string" ? new Date(i) : void 0;
1958
1958
  }
1959
- function wt(n) {
1960
- return isNaN(n) ? void 0 : n;
1959
+ function wt(i) {
1960
+ return isNaN(i) ? void 0 : i;
1961
1961
  }
1962
- function P(n) {
1963
- return wt(n) !== void 0 && Math.sign(n) >= 0 ? n : void 0;
1962
+ function D(i) {
1963
+ return wt(i) !== void 0 && Math.sign(i) >= 0 ? i : void 0;
1964
1964
  }
1965
- function oi(n) {
1965
+ function oi(i) {
1966
1966
  const t = new Array();
1967
- return n.forEach((e) => t.push(e)), t;
1967
+ return i.forEach((e) => t.push(e)), t;
1968
1968
  }
1969
1969
  class z {
1970
1970
  /**
@@ -1979,7 +1979,7 @@ class z {
1979
1979
  static deserialize(t) {
1980
1980
  if (!t)
1981
1981
  return;
1982
- const e = wt(t.progression), A = wt(t.totalProgression), i = wt(t.position), r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set([
1982
+ const e = wt(t.progression), A = wt(t.totalProgression), n = wt(t.position), r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set([
1983
1983
  "fragment",
1984
1984
  "fragments",
1985
1985
  "progression",
@@ -1989,10 +1989,10 @@ class z {
1989
1989
  return Object.entries(t).forEach(([o, a]) => {
1990
1990
  s.has(o) || r.set(o, a);
1991
1991
  }), new z({
1992
- fragments: oA(t.fragments || t.fragment),
1992
+ fragments: sA(t.fragments || t.fragment),
1993
1993
  progression: e !== void 0 && e >= 0 && e <= 1 ? e : void 0,
1994
1994
  totalProgression: A !== void 0 && A >= 0 && A <= 1 ? A : void 0,
1995
- position: i !== void 0 && i > 0 ? i : void 0,
1995
+ position: n !== void 0 && n > 0 ? n : void 0,
1996
1996
  otherLocations: r.size === 0 ? void 0 : r
1997
1997
  });
1998
1998
  }
@@ -2089,11 +2089,11 @@ class ot {
2089
2089
  title: t.title,
2090
2090
  rels: t.rel ? t.rel instanceof Array ? new Set(t.rel) : /* @__PURE__ */ new Set([t.rel]) : void 0,
2091
2091
  properties: R.deserialize(t.properties),
2092
- height: P(t.height),
2093
- width: P(t.width),
2094
- duration: P(t.duration),
2095
- bitrate: P(t.bitrate),
2096
- languages: oA(t.language),
2092
+ height: D(t.height),
2093
+ width: D(t.width),
2094
+ duration: D(t.duration),
2095
+ bitrate: D(t.bitrate),
2096
+ languages: sA(t.language),
2097
2097
  alternates: yt.deserialize(t.alternate),
2098
2098
  children: yt.deserialize(t.children)
2099
2099
  });
@@ -2121,14 +2121,14 @@ class ot {
2121
2121
  }
2122
2122
  /** List of URI template parameter keys, if the `Link` is templated. */
2123
2123
  get templateParameters() {
2124
- return this.templated ? new Ie(this.href).parameters : /* @__PURE__ */ new Set();
2124
+ return this.templated ? new we(this.href).parameters : /* @__PURE__ */ new Set();
2125
2125
  }
2126
2126
  /** Expands the `Link`'s HREF by replacing URI template variables by the given parameters.
2127
2127
  * See RFC 6570 on URI template: https://tools.ietf.org/html/rfc6570
2128
2128
  */
2129
2129
  expandTemplate(t) {
2130
2130
  return new ot({
2131
- href: new Ie(this.href).expand(t),
2131
+ href: new we(this.href).expand(t),
2132
2132
  templated: !1
2133
2133
  });
2134
2134
  }
@@ -2210,8 +2210,8 @@ class yt {
2210
2210
  /** Finds all the links matching any of the given media types. */
2211
2211
  filterByMediaTypes(t) {
2212
2212
  const e = (A) => {
2213
- for (const i of t)
2214
- if (A.mediaType.matches(i))
2213
+ for (const n of t)
2214
+ if (A.mediaType.matches(n))
2215
2215
  return !0;
2216
2216
  return !1;
2217
2217
  };
@@ -2262,11 +2262,11 @@ class Rt {
2262
2262
  static deserialize(t) {
2263
2263
  if (!(t && t.cssSelector))
2264
2264
  return;
2265
- let e = P(t.textNodeIndex);
2265
+ let e = D(t.textNodeIndex);
2266
2266
  if (e === void 0)
2267
2267
  return;
2268
- let A = P(t.charOffset);
2269
- return A === void 0 && (A = P(t.offset)), new Rt({
2268
+ let A = D(t.charOffset);
2269
+ return A === void 0 && (A = D(t.offset)), new Rt({
2270
2270
  cssSelector: t.cssSelector,
2271
2271
  textNodeIndex: e,
2272
2272
  charOffset: A
@@ -2283,7 +2283,7 @@ class Rt {
2283
2283
  return this.charOffset !== void 0 && (t.charOffset = this.charOffset), t;
2284
2284
  }
2285
2285
  }
2286
- class re {
2286
+ class ne {
2287
2287
  /**
2288
2288
  * Creates a [DomRange].
2289
2289
  */
@@ -2298,7 +2298,7 @@ class re {
2298
2298
  return;
2299
2299
  let e = Rt.deserialize(t.start);
2300
2300
  if (e)
2301
- return new re({
2301
+ return new ne({
2302
2302
  start: e,
2303
2303
  end: Rt.deserialize(t.end)
2304
2304
  });
@@ -2312,54 +2312,54 @@ class re {
2312
2312
  }
2313
2313
  }
2314
2314
  z.prototype.getCssSelector = function() {
2315
- var n;
2316
- return (n = this.otherLocations) == null ? void 0 : n.get("cssSelector");
2315
+ var i;
2316
+ return (i = this.otherLocations) == null ? void 0 : i.get("cssSelector");
2317
2317
  };
2318
2318
  z.prototype.getPartialCfi = function() {
2319
- var n;
2320
- return (n = this.otherLocations) == null ? void 0 : n.get("partialCfi");
2319
+ var i;
2320
+ return (i = this.otherLocations) == null ? void 0 : i.get("partialCfi");
2321
2321
  };
2322
2322
  z.prototype.getDomRange = function() {
2323
- var n;
2324
- return re.deserialize((n = this.otherLocations) == null ? void 0 : n.get("domRange"));
2323
+ var i;
2324
+ return ne.deserialize((i = this.otherLocations) == null ? void 0 : i.get("domRange"));
2325
2325
  };
2326
2326
  z.prototype.fragmentParameters = function() {
2327
2327
  return new Map(
2328
- this.fragments.map((n) => n.startsWith("#") ? n.slice(1) : n).join("&").split("&").filter((n) => !n.startsWith("#")).map((n) => n.split("=")).filter((n) => n.length === 2).map((n) => [
2329
- n[0].trim().toLowerCase(),
2330
- n[1].trim()
2328
+ this.fragments.map((i) => i.startsWith("#") ? i.slice(1) : i).join("&").split("&").filter((i) => !i.startsWith("#")).map((i) => i.split("=")).filter((i) => i.length === 2).map((i) => [
2329
+ i[0].trim().toLowerCase(),
2330
+ i[1].trim()
2331
2331
  ])
2332
2332
  );
2333
2333
  };
2334
2334
  z.prototype.htmlId = function() {
2335
2335
  if (!this.fragments.length)
2336
2336
  return;
2337
- let n = this.fragments.find((t) => t.length && !t.includes("="));
2338
- if (!n) {
2337
+ let i = this.fragments.find((t) => t.length && !t.includes("="));
2338
+ if (!i) {
2339
2339
  const t = this.fragmentParameters();
2340
- t.has("id") ? n = t.get("id") : t.has("name") && (n = t.get("name"));
2340
+ t.has("id") ? i = t.get("id") : t.has("name") && (i = t.get("name"));
2341
2341
  }
2342
- return n != null && n.startsWith("#") ? n.slice(1) : n;
2342
+ return i != null && i.startsWith("#") ? i.slice(1) : i;
2343
2343
  };
2344
2344
  z.prototype.page = function() {
2345
- const n = parseInt(this.fragmentParameters().get("page"));
2346
- if (!isNaN(n) && n >= 0)
2347
- return n;
2345
+ const i = parseInt(this.fragmentParameters().get("page"));
2346
+ if (!isNaN(i) && i >= 0)
2347
+ return i;
2348
2348
  };
2349
2349
  z.prototype.time = function() {
2350
- const n = parseInt(this.fragmentParameters().get("t"));
2351
- if (!isNaN(n))
2352
- return n;
2350
+ const i = parseInt(this.fragmentParameters().get("t"));
2351
+ if (!isNaN(i))
2352
+ return i;
2353
2353
  };
2354
2354
  z.prototype.space = function() {
2355
- const n = this.fragmentParameters();
2356
- if (!n.has("xywh"))
2355
+ const i = this.fragmentParameters();
2356
+ if (!i.has("xywh"))
2357
2357
  return;
2358
- const t = n.get("xywh").split(",").map((e) => parseInt(e));
2358
+ const t = i.get("xywh").split(",").map((e) => parseInt(e));
2359
2359
  if (t.length === 4 && !t.some(isNaN))
2360
2360
  return t;
2361
2361
  };
2362
- class se {
2362
+ class re {
2363
2363
  /** Creates a [Price]. */
2364
2364
  constructor(t) {
2365
2365
  this.currency = t.currency, this.value = t.value;
@@ -2373,9 +2373,9 @@ class se {
2373
2373
  let e = t.currency;
2374
2374
  if (!(e && typeof e == "string" && e.length > 0))
2375
2375
  return;
2376
- let A = P(t.value);
2376
+ let A = D(t.value);
2377
2377
  if (A !== void 0)
2378
- return new se({ currency: e, value: A });
2378
+ return new re({ currency: e, value: A });
2379
2379
  }
2380
2380
  /**
2381
2381
  * Serializes a [Price] to its RWPM JSON representation.
@@ -2411,7 +2411,7 @@ class dt {
2411
2411
  return this.children && (t.children = this.children.map((e) => e.serialize())), t;
2412
2412
  }
2413
2413
  }
2414
- class oe {
2414
+ class se {
2415
2415
  /** Creates a [Price]. */
2416
2416
  constructor(t) {
2417
2417
  this.total = t.total, this.position = t.position;
@@ -2421,9 +2421,9 @@ class oe {
2421
2421
  */
2422
2422
  static deserialize(t) {
2423
2423
  if (t)
2424
- return new oe({
2425
- total: P(t.total),
2426
- position: P(t.position)
2424
+ return new se({
2425
+ total: D(t.total),
2426
+ position: D(t.position)
2427
2427
  });
2428
2428
  }
2429
2429
  /**
@@ -2434,7 +2434,7 @@ class oe {
2434
2434
  return this.total !== void 0 && (t.total = this.total), this.position !== void 0 && (t.position = this.position), t;
2435
2435
  }
2436
2436
  }
2437
- class ae {
2437
+ class oe {
2438
2438
  /** Creates a [Copies]. */
2439
2439
  constructor(t) {
2440
2440
  this.total = t.total, this.available = t.available;
@@ -2444,9 +2444,9 @@ class ae {
2444
2444
  */
2445
2445
  static deserialize(t) {
2446
2446
  if (t)
2447
- return new ae({
2448
- total: P(t.total),
2449
- available: P(t.available)
2447
+ return new oe({
2448
+ total: D(t.total),
2449
+ available: D(t.available)
2450
2450
  });
2451
2451
  }
2452
2452
  /**
@@ -2457,7 +2457,7 @@ class ae {
2457
2457
  return this.total !== void 0 && (t.total = this.total), this.available !== void 0 && (t.available = this.available), t;
2458
2458
  }
2459
2459
  }
2460
- class le {
2460
+ class ae {
2461
2461
  /** Creates a [Availability]. */
2462
2462
  constructor(t) {
2463
2463
  this.state = t.state, this.since = t.since, this.until = t.until;
@@ -2467,10 +2467,10 @@ class le {
2467
2467
  */
2468
2468
  static deserialize(t) {
2469
2469
  if (t && t.state)
2470
- return new le({
2470
+ return new ae({
2471
2471
  state: t.state,
2472
- since: Fe(t.since),
2473
- until: Fe(t.until)
2472
+ since: Ie(t.since),
2473
+ until: Ie(t.until)
2474
2474
  });
2475
2475
  }
2476
2476
  /**
@@ -2482,24 +2482,24 @@ class le {
2482
2482
  }
2483
2483
  }
2484
2484
  R.prototype.getNumberOfItems = function() {
2485
- return P(this.otherProperties.numberOfItems);
2485
+ return D(this.otherProperties.numberOfItems);
2486
2486
  };
2487
2487
  R.prototype.getPrice = function() {
2488
- return se.deserialize(this.otherProperties.price);
2488
+ return re.deserialize(this.otherProperties.price);
2489
2489
  };
2490
2490
  R.prototype.getIndirectAcquisitions = function() {
2491
- const n = this.otherProperties.indirectAcquisition;
2492
- if (n && n instanceof Array)
2493
- return n.map((t) => dt.deserialize(t)).filter((t) => t !== void 0);
2491
+ const i = this.otherProperties.indirectAcquisition;
2492
+ if (i && i instanceof Array)
2493
+ return i.map((t) => dt.deserialize(t)).filter((t) => t !== void 0);
2494
2494
  };
2495
2495
  R.prototype.getHolds = function() {
2496
- return oe.deserialize(this.otherProperties.holds);
2496
+ return se.deserialize(this.otherProperties.holds);
2497
2497
  };
2498
2498
  R.prototype.getCopies = function() {
2499
- return ae.deserialize(this.otherProperties.copies);
2499
+ return oe.deserialize(this.otherProperties.copies);
2500
2500
  };
2501
2501
  R.prototype.getAvailability = function() {
2502
- return le.deserialize(this.otherProperties.availability);
2502
+ return ae.deserialize(this.otherProperties.availability);
2503
2503
  };
2504
2504
  R.prototype.getAuthenticate = function() {
2505
2505
  return ot.deserialize(this.otherProperties.authenticate);
@@ -2523,43 +2523,43 @@ R.prototype.getSpread = function() {
2523
2523
  return this.otherProperties.spread || void 0;
2524
2524
  };
2525
2525
  var q;
2526
- (function(n) {
2527
- n.NONE = "none", n.DESCENDANT = "descendant", n.CHILD = "child";
2526
+ (function(i) {
2527
+ i.NONE = "none", i.DESCENDANT = "descendant", i.CHILD = "child";
2528
2528
  })(q || (q = {}));
2529
- var b;
2530
- (function(n) {
2531
- n.id = "id", n.class = "class", n.tag = "tag", n.attribute = "attribute", n.nthchild = "nthchild", n.nthoftype = "nthoftype";
2532
- })(b || (b = {}));
2529
+ var G;
2530
+ (function(i) {
2531
+ i.id = "id", i.class = "class", i.tag = "tag", i.attribute = "attribute", i.nthchild = "nthchild", i.nthoftype = "nthoftype";
2532
+ })(G || (G = {}));
2533
2533
  const ai = "CssSelectorGenerator";
2534
- function Ue(n = "unknown problem", ...t) {
2535
- console.warn(`${ai}: ${n}`, ...t);
2534
+ function Fe(i = "unknown problem", ...t) {
2535
+ console.warn(`${ai}: ${i}`, ...t);
2536
2536
  }
2537
- b.id, b.class, b.tag, b.attribute;
2538
- function li(n) {
2539
- return n instanceof RegExp;
2537
+ G.id, G.class, G.tag, G.attribute;
2538
+ function li(i) {
2539
+ return i instanceof RegExp;
2540
2540
  }
2541
- function hi(n) {
2542
- return n.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".+");
2541
+ function hi(i) {
2542
+ return i.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".+");
2543
2543
  }
2544
- function ci(n) {
2545
- const t = n.map((e) => {
2544
+ function ci(i) {
2545
+ const t = i.map((e) => {
2546
2546
  if (li(e))
2547
2547
  return (A) => e.test(A);
2548
2548
  if (typeof e == "function")
2549
2549
  return (A) => {
2550
- const i = e(A);
2551
- return typeof i != "boolean" ? (Ue("pattern matcher function invalid", "Provided pattern matching function does not return boolean. It's result will be ignored.", e), !1) : i;
2550
+ const n = e(A);
2551
+ return typeof n != "boolean" ? (Fe("pattern matcher function invalid", "Provided pattern matching function does not return boolean. It's result will be ignored.", e), !1) : n;
2552
2552
  };
2553
2553
  if (typeof e == "string") {
2554
2554
  const A = new RegExp("^" + hi(e) + "$");
2555
- return (i) => A.test(i);
2555
+ return (n) => A.test(n);
2556
2556
  }
2557
- return Ue("pattern matcher invalid", "Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.", e), () => !1;
2557
+ return Fe("pattern matcher invalid", "Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.", e), () => !1;
2558
2558
  });
2559
2559
  return (e) => t.some((A) => A(e));
2560
2560
  }
2561
2561
  q.NONE + "", q.NONE, q.DESCENDANT + "", q.DESCENDANT, q.CHILD + "", q.CHILD;
2562
- b.nthoftype, b.tag, b.id, b.class, b.attribute, b.nthchild;
2562
+ G.nthoftype, G.tag, G.id, G.class, G.attribute, G.nthchild;
2563
2563
  ci([
2564
2564
  "class",
2565
2565
  "id",
@@ -2568,40 +2568,40 @@ ci([
2568
2568
  ]);
2569
2569
  class Vt {
2570
2570
  }
2571
- function Ce(n) {
2572
- return n.split("").reverse().join("");
2571
+ function Ue(i) {
2572
+ return i.split("").reverse().join("");
2573
2573
  }
2574
- function gi(n, t, e) {
2575
- const A = Ce(t);
2576
- return e.map((i) => {
2577
- const r = Math.max(0, i.end - t.length - i.errors), s = Ce(n.slice(r, i.end));
2574
+ function gi(i, t, e) {
2575
+ const A = Ue(t);
2576
+ return e.map((n) => {
2577
+ const r = Math.max(0, n.end - t.length - n.errors), s = Ue(i.slice(r, n.end));
2578
2578
  return {
2579
- start: aA(s, A, i.errors).reduce((o, a) => i.end - a.end < o ? i.end - a.end : o, i.end),
2580
- end: i.end,
2581
- errors: i.errors
2579
+ start: oA(s, A, n.errors).reduce((o, a) => n.end - a.end < o ? n.end - a.end : o, n.end),
2580
+ end: n.end,
2581
+ errors: n.errors
2582
2582
  };
2583
2583
  });
2584
2584
  }
2585
- function Ht(n) {
2586
- return (n | -n) >> 31 & 1;
2585
+ function Ht(i) {
2586
+ return (i | -i) >> 31 & 1;
2587
2587
  }
2588
- function ye(n, t, e, A) {
2589
- let i = n.P[e], r = n.M[e];
2590
- const s = A >>> 31, o = t[e] | s, a = o | r, l = (o & i) + i ^ i | o;
2591
- let h = r | ~(l | i), c = i & l;
2592
- const g = Ht(h & n.lastRowMask[e]) - Ht(c & n.lastRowMask[e]);
2593
- return h <<= 1, c <<= 1, c |= s, h |= Ht(A) - s, i = c | ~(a | h), r = h & a, n.P[e] = i, n.M[e] = r, g;
2588
+ function Ce(i, t, e, A) {
2589
+ let n = i.P[e], r = i.M[e];
2590
+ const s = A >>> 31, o = t[e] | s, a = o | r, l = (o & n) + n ^ n | o;
2591
+ let h = r | ~(l | n), c = n & l;
2592
+ const g = Ht(h & i.lastRowMask[e]) - Ht(c & i.lastRowMask[e]);
2593
+ return h <<= 1, c <<= 1, c |= s, h |= Ht(A) - s, n = c | ~(a | h), r = h & a, i.P[e] = n, i.M[e] = r, g;
2594
2594
  }
2595
- function aA(n, t, e) {
2595
+ function oA(i, t, e) {
2596
2596
  if (t.length === 0)
2597
2597
  return [];
2598
2598
  e = Math.min(e, t.length);
2599
- const A = [], i = 32, r = Math.ceil(t.length / i) - 1, s = {
2599
+ const A = [], n = 32, r = Math.ceil(t.length / n) - 1, s = {
2600
2600
  P: new Uint32Array(r + 1),
2601
2601
  M: new Uint32Array(r + 1),
2602
2602
  lastRowMask: new Uint32Array(r + 1)
2603
2603
  };
2604
- s.lastRowMask.fill(1 << 31), s.lastRowMask[r] = 1 << (t.length - 1) % i;
2604
+ s.lastRowMask.fill(1 << 31), s.lastRowMask[r] = 1 << (t.length - 1) % n;
2605
2605
  const o = new Uint32Array(r + 1), a = /* @__PURE__ */ new Map(), l = [];
2606
2606
  for (let g = 0; g < 256; g++)
2607
2607
  l.push(o);
@@ -2613,37 +2613,37 @@ function aA(n, t, e) {
2613
2613
  a.set(m, M), m < l.length && (l[m] = M);
2614
2614
  for (let B = 0; B <= r; B += 1) {
2615
2615
  M[B] = 0;
2616
- for (let f = 0; f < i; f += 1) {
2617
- const I = B * i + f;
2616
+ for (let f = 0; f < n; f += 1) {
2617
+ const I = B * n + f;
2618
2618
  I >= t.length || t.charCodeAt(I) === m && (M[B] |= 1 << f);
2619
2619
  }
2620
2620
  }
2621
2621
  }
2622
- let h = Math.max(0, Math.ceil(e / i) - 1);
2622
+ let h = Math.max(0, Math.ceil(e / n) - 1);
2623
2623
  const c = new Uint32Array(r + 1);
2624
2624
  for (let g = 0; g <= h; g += 1)
2625
- c[g] = (g + 1) * i;
2625
+ c[g] = (g + 1) * n;
2626
2626
  c[r] = t.length;
2627
2627
  for (let g = 0; g <= h; g += 1)
2628
2628
  s.P[g] = -1, s.M[g] = 0;
2629
- for (let g = 0; g < n.length; g += 1) {
2630
- const m = n.charCodeAt(g);
2629
+ for (let g = 0; g < i.length; g += 1) {
2630
+ const m = i.charCodeAt(g);
2631
2631
  let M;
2632
2632
  m < l.length ? M = l[m] : (M = a.get(m), typeof M > "u" && (M = o));
2633
2633
  let B = 0;
2634
2634
  for (let f = 0; f <= h; f += 1)
2635
- B = ye(s, M, f, B), c[f] += B;
2635
+ B = Ce(s, M, f, B), c[f] += B;
2636
2636
  if (c[h] - B <= e && h < r && (M[h + 1] & 1 || B < 0)) {
2637
2637
  h += 1, s.P[h] = -1, s.M[h] = 0;
2638
2638
  let f;
2639
2639
  if (h === r) {
2640
- const I = t.length % i;
2641
- f = I === 0 ? i : I;
2640
+ const I = t.length % n;
2641
+ f = I === 0 ? n : I;
2642
2642
  } else
2643
- f = i;
2644
- c[h] = c[h - 1] + f - B + ye(s, M, h, B);
2643
+ f = n;
2644
+ c[h] = c[h - 1] + f - B + Ce(s, M, h, B);
2645
2645
  } else
2646
- for (; h > 0 && c[h] >= e + i; )
2646
+ for (; h > 0 && c[h] >= e + n; )
2647
2647
  h -= 1;
2648
2648
  h === r && c[h] <= e && (c[h] < e && A.splice(0, A.length), A.push({
2649
2649
  start: -1,
@@ -2653,67 +2653,67 @@ function aA(n, t, e) {
2653
2653
  }
2654
2654
  return A;
2655
2655
  }
2656
- function di(n, t, e) {
2657
- const A = aA(n, t, e);
2658
- return gi(n, t, A);
2656
+ function di(i, t, e) {
2657
+ const A = oA(i, t, e);
2658
+ return gi(i, t, A);
2659
2659
  }
2660
- function lA(n, t, e) {
2660
+ function aA(i, t, e) {
2661
2661
  let A = 0;
2662
- const i = [];
2662
+ const n = [];
2663
2663
  for (; A !== -1; )
2664
- A = n.indexOf(t, A), A !== -1 && (i.push({
2664
+ A = i.indexOf(t, A), A !== -1 && (n.push({
2665
2665
  start: A,
2666
2666
  end: A + t.length,
2667
2667
  errors: 0
2668
2668
  }), A += 1);
2669
- return i.length > 0 ? i : di(n, t, e);
2669
+ return n.length > 0 ? n : di(i, t, e);
2670
2670
  }
2671
- function Re(n, t) {
2672
- return t.length === 0 || n.length === 0 ? 0 : 1 - lA(n, t, t.length)[0].errors / t.length;
2671
+ function ye(i, t) {
2672
+ return t.length === 0 || i.length === 0 ? 0 : 1 - aA(i, t, t.length)[0].errors / t.length;
2673
2673
  }
2674
- function ui(n, t, e = {}) {
2674
+ function ui(i, t, e = {}) {
2675
2675
  if (t.length === 0)
2676
2676
  return null;
2677
- const A = Math.min(256, t.length / 2), i = lA(n, t, A);
2678
- if (i.length === 0)
2677
+ const A = Math.min(256, t.length / 2), n = aA(i, t, A);
2678
+ if (n.length === 0)
2679
2679
  return null;
2680
2680
  const r = (o) => {
2681
- const a = 1 - o.errors / t.length, l = e.prefix ? Re(
2682
- n.slice(
2681
+ const a = 1 - o.errors / t.length, l = e.prefix ? ye(
2682
+ i.slice(
2683
2683
  Math.max(0, o.start - e.prefix.length),
2684
2684
  o.start
2685
2685
  ),
2686
2686
  e.prefix
2687
- ) : 1, h = e.suffix ? Re(
2688
- n.slice(o.end, o.end + e.suffix.length),
2687
+ ) : 1, h = e.suffix ? ye(
2688
+ i.slice(o.end, o.end + e.suffix.length),
2689
2689
  e.suffix
2690
2690
  ) : 1;
2691
2691
  let c = 1;
2692
- typeof e.hint == "number" && (c = 1 - Math.abs(o.start - e.hint) / n.length);
2692
+ typeof e.hint == "number" && (c = 1 - Math.abs(o.start - e.hint) / i.length);
2693
2693
  const g = 50 * a + 20 * l + 20 * h + 2 * c, m = 50 + 20 + 20 + 2;
2694
2694
  return g / m;
2695
- }, s = i.map((o) => ({
2695
+ }, s = n.map((o) => ({
2696
2696
  start: o.start,
2697
2697
  end: o.end,
2698
2698
  score: r(o)
2699
2699
  }));
2700
2700
  return s.sort((o, a) => a.score - o.score), s[0];
2701
2701
  }
2702
- function Xt(n, t, e) {
2702
+ function Xt(i, t, e) {
2703
2703
  const A = e === 1 ? t : t - 1;
2704
- if (n.charAt(A).trim() !== "")
2704
+ if (i.charAt(A).trim() !== "")
2705
2705
  return t;
2706
- let i, r;
2707
- if (e === 2 ? (i = n.substring(0, t), r = i.trimEnd()) : (i = n.substring(t), r = i.trimStart()), !r.length)
2706
+ let n, r;
2707
+ if (e === 2 ? (n = i.substring(0, t), r = n.trimEnd()) : (n = i.substring(t), r = n.trimStart()), !r.length)
2708
2708
  return -1;
2709
- const s = i.length - r.length;
2709
+ const s = n.length - r.length;
2710
2710
  return e === 2 ? t - s : t + s;
2711
2711
  }
2712
- function Qe(n, t) {
2713
- const e = n.commonAncestorContainer.ownerDocument.createNodeIterator(
2714
- n.commonAncestorContainer,
2712
+ function Re(i, t) {
2713
+ const e = i.commonAncestorContainer.ownerDocument.createNodeIterator(
2714
+ i.commonAncestorContainer,
2715
2715
  NodeFilter.SHOW_TEXT
2716
- ), A = t === 1 ? n.startContainer : n.endContainer, i = t === 1 ? n.endContainer : n.startContainer;
2716
+ ), A = t === 1 ? i.startContainer : i.endContainer, n = t === 1 ? i.endContainer : i.startContainer;
2717
2717
  let r = e.nextNode();
2718
2718
  for (; r && r !== A; )
2719
2719
  r = e.nextNode();
@@ -2725,39 +2725,39 @@ function Qe(n, t) {
2725
2725
  s = Xt(a, l, t);
2726
2726
  }
2727
2727
  };
2728
- for (; r && s === -1 && r !== i; )
2728
+ for (; r && s === -1 && r !== n; )
2729
2729
  o();
2730
2730
  if (r && s >= 0)
2731
2731
  return { node: r, offset: s };
2732
2732
  throw new RangeError("No text nodes with non-whitespace text found in range");
2733
2733
  }
2734
- function mi(n) {
2735
- if (!n.toString().trim().length)
2734
+ function mi(i) {
2735
+ if (!i.toString().trim().length)
2736
2736
  throw new RangeError("Range contains no non-whitespace text");
2737
- if (n.startContainer.nodeType !== Node.TEXT_NODE)
2737
+ if (i.startContainer.nodeType !== Node.TEXT_NODE)
2738
2738
  throw new RangeError("Range startContainer is not a text node");
2739
- if (n.endContainer.nodeType !== Node.TEXT_NODE)
2739
+ if (i.endContainer.nodeType !== Node.TEXT_NODE)
2740
2740
  throw new RangeError("Range endContainer is not a text node");
2741
- const t = n.cloneRange();
2741
+ const t = i.cloneRange();
2742
2742
  let e = !1, A = !1;
2743
- const i = {
2743
+ const n = {
2744
2744
  start: Xt(
2745
- n.startContainer.textContent,
2746
- n.startOffset,
2745
+ i.startContainer.textContent,
2746
+ i.startOffset,
2747
2747
  1
2748
2748
  /* Forwards */
2749
2749
  ),
2750
2750
  end: Xt(
2751
- n.endContainer.textContent,
2752
- n.endOffset,
2751
+ i.endContainer.textContent,
2752
+ i.endOffset,
2753
2753
  2
2754
2754
  /* Backwards */
2755
2755
  )
2756
2756
  };
2757
- if (i.start >= 0 && (t.setStart(n.startContainer, i.start), e = !0), i.end > 0 && (t.setEnd(n.endContainer, i.end), A = !0), e && A)
2757
+ if (n.start >= 0 && (t.setStart(i.startContainer, n.start), e = !0), n.end > 0 && (t.setEnd(i.endContainer, n.end), A = !0), e && A)
2758
2758
  return t;
2759
2759
  if (!e) {
2760
- const { node: r, offset: s } = Qe(
2760
+ const { node: r, offset: s } = Re(
2761
2761
  t,
2762
2762
  1
2763
2763
  /* Forwards */
@@ -2765,7 +2765,7 @@ function mi(n) {
2765
2765
  r && s >= 0 && t.setStart(r, s);
2766
2766
  }
2767
2767
  if (!A) {
2768
- const { node: r, offset: s } = Qe(
2768
+ const { node: r, offset: s } = Re(
2769
2769
  t,
2770
2770
  2
2771
2771
  /* Backwards */
@@ -2774,36 +2774,36 @@ function mi(n) {
2774
2774
  }
2775
2775
  return t;
2776
2776
  }
2777
- function hA(n) {
2777
+ function lA(i) {
2778
2778
  var t;
2779
- switch (n.nodeType) {
2779
+ switch (i.nodeType) {
2780
2780
  case Node.ELEMENT_NODE:
2781
2781
  case Node.TEXT_NODE:
2782
- return ((t = n.textContent) == null ? void 0 : t.length) ?? 0;
2782
+ return ((t = i.textContent) == null ? void 0 : t.length) ?? 0;
2783
2783
  default:
2784
2784
  return 0;
2785
2785
  }
2786
2786
  }
2787
- function ze(n) {
2788
- let t = n.previousSibling, e = 0;
2787
+ function Qe(i) {
2788
+ let t = i.previousSibling, e = 0;
2789
2789
  for (; t; )
2790
- e += hA(t), t = t.previousSibling;
2790
+ e += lA(t), t = t.previousSibling;
2791
2791
  return e;
2792
2792
  }
2793
- function cA(n, ...t) {
2793
+ function hA(i, ...t) {
2794
2794
  let e = t.shift();
2795
- const A = n.ownerDocument.createNodeIterator(
2796
- n,
2795
+ const A = i.ownerDocument.createNodeIterator(
2796
+ i,
2797
2797
  NodeFilter.SHOW_TEXT
2798
- ), i = [];
2798
+ ), n = [];
2799
2799
  let r = A.nextNode(), s, o = 0;
2800
2800
  for (; e !== void 0 && r; )
2801
- s = r, o + s.data.length > e ? (i.push({ node: s, offset: e - o }), e = t.shift()) : (r = A.nextNode(), o += s.data.length);
2801
+ s = r, o + s.data.length > e ? (n.push({ node: s, offset: e - o }), e = t.shift()) : (r = A.nextNode(), o += s.data.length);
2802
2802
  for (; e !== void 0 && s && o === e; )
2803
- i.push({ node: s, offset: s.data.length }), e = t.shift();
2803
+ n.push({ node: s, offset: s.data.length }), e = t.shift();
2804
2804
  if (e !== void 0)
2805
2805
  throw new RangeError("Offset exceeds text length");
2806
- return i;
2806
+ return n;
2807
2807
  }
2808
2808
  class L {
2809
2809
  constructor(t, e) {
@@ -2822,7 +2822,7 @@ class L {
2822
2822
  throw new Error("Parent is not an ancestor of current element");
2823
2823
  let e = this.element, A = this.offset;
2824
2824
  for (; e !== t; )
2825
- A += ze(e), e = e.parentElement;
2825
+ A += Qe(e), e = e.parentElement;
2826
2826
  return new L(e, A);
2827
2827
  }
2828
2828
  /**
@@ -2844,7 +2844,7 @@ class L {
2844
2844
  */
2845
2845
  resolve(t = {}) {
2846
2846
  try {
2847
- return cA(this.element, this.offset)[0];
2847
+ return hA(this.element, this.offset)[0];
2848
2848
  } catch (e) {
2849
2849
  if (this.offset === 0 && t.direction !== void 0) {
2850
2850
  const A = document.createTreeWalker(
@@ -2852,10 +2852,10 @@ class L {
2852
2852
  NodeFilter.SHOW_TEXT
2853
2853
  );
2854
2854
  A.currentNode = this.element;
2855
- const i = t.direction === 1, r = i ? A.nextNode() : A.previousNode();
2855
+ const n = t.direction === 1, r = n ? A.nextNode() : A.previousNode();
2856
2856
  if (!r)
2857
2857
  throw e;
2858
- return { node: r, offset: i ? 0 : r.data.length };
2858
+ return { node: r, offset: n ? 0 : r.data.length };
2859
2859
  } else
2860
2860
  throw e;
2861
2861
  }
@@ -2887,15 +2887,15 @@ class L {
2887
2887
  throw new Error("Text node offset is out of range");
2888
2888
  if (!t.parentElement)
2889
2889
  throw new Error("Text node has no parent");
2890
- const A = ze(t) + e;
2890
+ const A = Qe(t) + e;
2891
2891
  return new L(t.parentElement, A);
2892
2892
  }
2893
2893
  case Node.ELEMENT_NODE: {
2894
2894
  if (e < 0 || e > t.childNodes.length)
2895
2895
  throw new Error("Child node offset is out of range");
2896
2896
  let A = 0;
2897
- for (let i = 0; i < e; i++)
2898
- A += hA(t.childNodes[i]);
2897
+ for (let n = 0; n < e; n++)
2898
+ A += lA(t.childNodes[n]);
2899
2899
  return new L(t, A);
2900
2900
  }
2901
2901
  default:
@@ -2929,7 +2929,7 @@ class _ {
2929
2929
  */
2930
2930
  toRange() {
2931
2931
  let t, e;
2932
- this.start.element === this.end.element && this.start.offset <= this.end.offset ? [t, e] = cA(
2932
+ this.start.element === this.end.element && this.start.offset <= this.end.offset ? [t, e] = hA(
2933
2933
  this.start.element,
2934
2934
  this.start.offset,
2935
2935
  this.end.offset
@@ -3010,15 +3010,15 @@ class zt {
3010
3010
  * Will throw if `range` does not contain any text nodes.
3011
3011
  */
3012
3012
  static fromRange(t, e) {
3013
- const A = t.textContent, i = _.fromRange(e).relativeTo(t), r = i.start.offset, s = i.end.offset, o = 32;
3013
+ const A = t.textContent, n = _.fromRange(e).relativeTo(t), r = n.start.offset, s = n.end.offset, o = 32;
3014
3014
  return new zt(t, A.slice(r, s), {
3015
3015
  prefix: A.slice(Math.max(0, r - o), r),
3016
3016
  suffix: A.slice(s, Math.min(A.length, s + o))
3017
3017
  });
3018
3018
  }
3019
3019
  static fromSelector(t, e) {
3020
- const { prefix: A, suffix: i } = e;
3021
- return new zt(t, e.exact, { prefix: A, suffix: i });
3020
+ const { prefix: A, suffix: n } = e;
3021
+ return new zt(t, e.exact, { prefix: A, suffix: n });
3022
3022
  }
3023
3023
  toSelector() {
3024
3024
  return {
@@ -3041,17 +3041,17 @@ class zt {
3041
3041
  return new Qt(this.root, A.start, A.end);
3042
3042
  }
3043
3043
  }
3044
- function Mi(n) {
3045
- const t = n.tagName.toUpperCase();
3044
+ function Mi(i) {
3045
+ const t = i.tagName.toUpperCase();
3046
3046
  return t === "IMG" || t === "VIDEO" || t === "AUDIO" || t === "IFRAME" || t === "OBJECT" || t === "EMBED" || t === "CANVAS";
3047
3047
  }
3048
- function he(n, t) {
3048
+ function le(i, t) {
3049
3049
  try {
3050
3050
  const e = t.locations, A = t.text;
3051
3051
  if (A && A.highlight) {
3052
- let i;
3053
- e && e.getCssSelector() && (i = n.querySelector(e.getCssSelector())), i || (i = n.body);
3054
- const r = new zt(i, A.highlight, {
3052
+ let n;
3053
+ e && e.getCssSelector() && (n = i.querySelector(e.getCssSelector())), n || (n = i.body);
3054
+ const r = new zt(n, A.highlight, {
3055
3055
  prefix: A.before,
3056
3056
  suffix: A.after
3057
3057
  });
@@ -3062,15 +3062,15 @@ function he(n, t) {
3062
3062
  }
3063
3063
  }
3064
3064
  if (e) {
3065
- let i = null;
3066
- if (!i && e.getCssSelector() && (i = n.querySelector(e.getCssSelector())), !i && e.fragments) {
3065
+ let n = null;
3066
+ if (!n && e.getCssSelector() && (n = i.querySelector(e.getCssSelector())), !n && e.fragments) {
3067
3067
  for (const r of e.fragments)
3068
- if (i = n.getElementById(r), i)
3068
+ if (n = i.getElementById(r), n)
3069
3069
  break;
3070
3070
  }
3071
- if (i) {
3072
- const r = n.createRange();
3073
- return i.childNodes.length === 0 || Mi(i) ? (r.selectNode(i), r) : (r.setStartBefore(i), r.setEndAfter(i), r);
3071
+ if (n) {
3072
+ const r = i.createRange();
3073
+ return n.childNodes.length === 0 || Mi(n) ? (r.selectNode(n), r) : (r.setStartBefore(n), r.setEndAfter(n), r);
3074
3074
  }
3075
3075
  }
3076
3076
  } catch (e) {
@@ -3078,12 +3078,12 @@ function he(n, t) {
3078
3078
  }
3079
3079
  return null;
3080
3080
  }
3081
- function fi(n, t) {
3082
- let e = n.getClientRects();
3083
- e.length || n.commonAncestorContainer.nodeType === Node.ELEMENT_NODE && (e = n.commonAncestorContainer.getClientRects());
3084
- const A = 1, i = [];
3081
+ function fi(i, t) {
3082
+ let e = i.getClientRects();
3083
+ e.length || i.commonAncestorContainer.nodeType === Node.ELEMENT_NODE && (e = i.commonAncestorContainer.getClientRects());
3084
+ const A = 1, n = [];
3085
3085
  for (const l of e)
3086
- i.push({
3086
+ n.push({
3087
3087
  bottom: l.bottom,
3088
3088
  height: l.height,
3089
3089
  left: l.left,
@@ -3091,11 +3091,11 @@ function fi(n, t) {
3091
3091
  top: l.top,
3092
3092
  width: l.width
3093
3093
  });
3094
- const r = gA(
3095
- i,
3094
+ const r = cA(
3095
+ n,
3096
3096
  A,
3097
3097
  t
3098
- ), s = Bi(r, A), o = dA(s), a = 2 * 2;
3098
+ ), s = Bi(r, A), o = gA(s), a = 2 * 2;
3099
3099
  for (let l = o.length - 1; l >= 0; l--) {
3100
3100
  const h = o[l];
3101
3101
  if (!(h.width * h.height > a))
@@ -3106,169 +3106,169 @@ function fi(n, t) {
3106
3106
  }
3107
3107
  return o;
3108
3108
  }
3109
- function gA(n, t, e) {
3110
- for (let A = 0; A < n.length; A++)
3111
- for (let i = A + 1; i < n.length; i++) {
3112
- const r = n[A], s = n[i];
3109
+ function cA(i, t, e) {
3110
+ for (let A = 0; A < i.length; A++)
3111
+ for (let n = A + 1; n < i.length; n++) {
3112
+ const r = i[A], s = i[n];
3113
3113
  if (r === s)
3114
3114
  continue;
3115
- const o = G(r.top, s.top, t) && G(r.bottom, s.bottom, t), a = G(r.left, s.left, t) && G(r.right, s.right, t);
3116
- if ((a && !e || o && !a) && uA(r, s, t)) {
3117
- const l = n.filter((c) => c !== r && c !== s), h = pi(r, s);
3118
- return l.push(h), gA(
3115
+ const o = H(r.top, s.top, t) && H(r.bottom, s.bottom, t), a = H(r.left, s.left, t) && H(r.right, s.right, t);
3116
+ if ((a && !e || o && !a) && dA(r, s, t)) {
3117
+ const l = i.filter((c) => c !== r && c !== s), h = pi(r, s);
3118
+ return l.push(h), cA(
3119
3119
  l,
3120
3120
  t,
3121
3121
  e
3122
3122
  );
3123
3123
  }
3124
3124
  }
3125
- return n;
3125
+ return i;
3126
3126
  }
3127
- function pi(n, t) {
3128
- const e = Math.min(n.left, t.left), A = Math.max(n.right, t.right), i = Math.min(n.top, t.top), r = Math.max(n.bottom, t.bottom);
3127
+ function pi(i, t) {
3128
+ const e = Math.min(i.left, t.left), A = Math.max(i.right, t.right), n = Math.min(i.top, t.top), r = Math.max(i.bottom, t.bottom);
3129
3129
  return {
3130
3130
  bottom: r,
3131
- height: r - i,
3131
+ height: r - n,
3132
3132
  left: e,
3133
3133
  right: A,
3134
- top: i,
3134
+ top: n,
3135
3135
  width: A - e
3136
3136
  };
3137
3137
  }
3138
- function Bi(n, t) {
3139
- const e = new Set(n);
3140
- for (const A of n) {
3138
+ function Bi(i, t) {
3139
+ const e = new Set(i);
3140
+ for (const A of i) {
3141
3141
  if (!(A.width > 1 && A.height > 1)) {
3142
3142
  e.delete(A);
3143
3143
  continue;
3144
3144
  }
3145
- for (const i of n)
3146
- if (A !== i && e.has(i) && Ei(i, A, t)) {
3145
+ for (const n of i)
3146
+ if (A !== n && e.has(n) && Ei(n, A, t)) {
3147
3147
  e.delete(A);
3148
3148
  break;
3149
3149
  }
3150
3150
  }
3151
3151
  return Array.from(e);
3152
3152
  }
3153
- function Ei(n, t, e) {
3154
- return pt(n, t.left, t.top, e) && pt(n, t.right, t.top, e) && pt(n, t.left, t.bottom, e) && pt(n, t.right, t.bottom, e);
3153
+ function Ei(i, t, e) {
3154
+ return pt(i, t.left, t.top, e) && pt(i, t.right, t.top, e) && pt(i, t.left, t.bottom, e) && pt(i, t.right, t.bottom, e);
3155
3155
  }
3156
- function pt(n, t, e, A) {
3157
- return (n.left < t || G(n.left, t, A)) && (n.right > t || G(n.right, t, A)) && (n.top < e || G(n.top, e, A)) && (n.bottom > e || G(n.bottom, e, A));
3156
+ function pt(i, t, e, A) {
3157
+ return (i.left < t || H(i.left, t, A)) && (i.right > t || H(i.right, t, A)) && (i.top < e || H(i.top, e, A)) && (i.bottom > e || H(i.bottom, e, A));
3158
3158
  }
3159
- function dA(n) {
3160
- for (let t = 0; t < n.length; t++)
3161
- for (let e = t + 1; e < n.length; e++) {
3162
- const A = n[t], i = n[e];
3163
- if (A !== i && uA(A, i, -1)) {
3159
+ function gA(i) {
3160
+ for (let t = 0; t < i.length; t++)
3161
+ for (let e = t + 1; e < i.length; e++) {
3162
+ const A = i[t], n = i[e];
3163
+ if (A !== n && dA(A, n, -1)) {
3164
3164
  let r = [], s;
3165
- const o = Ye(A, i);
3165
+ const o = ze(A, n);
3166
3166
  if (o.length === 1)
3167
3167
  r = o, s = A;
3168
3168
  else {
3169
- const l = Ye(i, A);
3170
- o.length < l.length ? (r = o, s = A) : (r = l, s = i);
3169
+ const l = ze(n, A);
3170
+ o.length < l.length ? (r = o, s = A) : (r = l, s = n);
3171
3171
  }
3172
- const a = n.filter((l) => l !== s);
3173
- return Array.prototype.push.apply(a, r), dA(a);
3172
+ const a = i.filter((l) => l !== s);
3173
+ return Array.prototype.push.apply(a, r), gA(a);
3174
3174
  }
3175
3175
  }
3176
- return n;
3176
+ return i;
3177
3177
  }
3178
- function Ye(n, t) {
3179
- const e = wi(t, n);
3178
+ function ze(i, t) {
3179
+ const e = wi(t, i);
3180
3180
  if (e.height === 0 || e.width === 0)
3181
- return [n];
3181
+ return [i];
3182
3182
  const A = [];
3183
3183
  {
3184
- const i = {
3185
- bottom: n.bottom,
3184
+ const n = {
3185
+ bottom: i.bottom,
3186
3186
  height: 0,
3187
- left: n.left,
3187
+ left: i.left,
3188
3188
  right: e.left,
3189
- top: n.top,
3189
+ top: i.top,
3190
3190
  width: 0
3191
3191
  };
3192
- i.width = i.right - i.left, i.height = i.bottom - i.top, i.height !== 0 && i.width !== 0 && A.push(i);
3192
+ n.width = n.right - n.left, n.height = n.bottom - n.top, n.height !== 0 && n.width !== 0 && A.push(n);
3193
3193
  }
3194
3194
  {
3195
- const i = {
3195
+ const n = {
3196
3196
  bottom: e.top,
3197
3197
  height: 0,
3198
3198
  left: e.left,
3199
3199
  right: e.right,
3200
- top: n.top,
3200
+ top: i.top,
3201
3201
  width: 0
3202
3202
  };
3203
- i.width = i.right - i.left, i.height = i.bottom - i.top, i.height !== 0 && i.width !== 0 && A.push(i);
3203
+ n.width = n.right - n.left, n.height = n.bottom - n.top, n.height !== 0 && n.width !== 0 && A.push(n);
3204
3204
  }
3205
3205
  {
3206
- const i = {
3207
- bottom: n.bottom,
3206
+ const n = {
3207
+ bottom: i.bottom,
3208
3208
  height: 0,
3209
3209
  left: e.left,
3210
3210
  right: e.right,
3211
3211
  top: e.bottom,
3212
3212
  width: 0
3213
3213
  };
3214
- i.width = i.right - i.left, i.height = i.bottom - i.top, i.height !== 0 && i.width !== 0 && A.push(i);
3214
+ n.width = n.right - n.left, n.height = n.bottom - n.top, n.height !== 0 && n.width !== 0 && A.push(n);
3215
3215
  }
3216
3216
  {
3217
- const i = {
3218
- bottom: n.bottom,
3217
+ const n = {
3218
+ bottom: i.bottom,
3219
3219
  height: 0,
3220
3220
  left: e.right,
3221
- right: n.right,
3222
- top: n.top,
3221
+ right: i.right,
3222
+ top: i.top,
3223
3223
  width: 0
3224
3224
  };
3225
- i.width = i.right - i.left, i.height = i.bottom - i.top, i.height !== 0 && i.width !== 0 && A.push(i);
3225
+ n.width = n.right - n.left, n.height = n.bottom - n.top, n.height !== 0 && n.width !== 0 && A.push(n);
3226
3226
  }
3227
3227
  return A;
3228
3228
  }
3229
- function wi(n, t) {
3230
- const e = Math.max(n.left, t.left), A = Math.min(n.right, t.right), i = Math.max(n.top, t.top), r = Math.min(n.bottom, t.bottom);
3229
+ function wi(i, t) {
3230
+ const e = Math.max(i.left, t.left), A = Math.min(i.right, t.right), n = Math.max(i.top, t.top), r = Math.min(i.bottom, t.bottom);
3231
3231
  return {
3232
3232
  bottom: r,
3233
- height: Math.max(0, r - i),
3233
+ height: Math.max(0, r - n),
3234
3234
  left: e,
3235
3235
  right: A,
3236
- top: i,
3236
+ top: n,
3237
3237
  width: Math.max(0, A - e)
3238
3238
  };
3239
3239
  }
3240
- function uA(n, t, e) {
3241
- return (n.left < t.right || e >= 0 && G(n.left, t.right, e)) && (t.left < n.right || e >= 0 && G(t.left, n.right, e)) && (n.top < t.bottom || e >= 0 && G(n.top, t.bottom, e)) && (t.top < n.bottom || e >= 0 && G(t.top, n.bottom, e));
3240
+ function dA(i, t, e) {
3241
+ return (i.left < t.right || e >= 0 && H(i.left, t.right, e)) && (t.left < i.right || e >= 0 && H(t.left, i.right, e)) && (i.top < t.bottom || e >= 0 && H(i.top, t.bottom, e)) && (t.top < i.bottom || e >= 0 && H(t.top, i.bottom, e));
3242
3242
  }
3243
- function G(n, t, e) {
3244
- return Math.abs(n - t) <= e;
3243
+ function H(i, t, e) {
3244
+ return Math.abs(i - t) <= e;
3245
3245
  }
3246
- function mA(n) {
3247
- const t = {}, e = n.document.documentElement.style;
3248
- for (const A in n.document.documentElement.style)
3246
+ function uA(i) {
3247
+ const t = {}, e = i.document.documentElement.style;
3248
+ for (const A in i.document.documentElement.style)
3249
3249
  Object.hasOwn(e, A) && !Number.isNaN(Number.parseInt(A)) && (t[e[A]] = e.getPropertyValue(e[A]));
3250
3250
  return t;
3251
3251
  }
3252
- function Ii(n, t) {
3253
- const e = mA(n);
3252
+ function Ii(i, t) {
3253
+ const e = uA(i);
3254
3254
  Object.keys(e).forEach((A) => {
3255
- t.hasOwnProperty(A) || ce(n, A);
3256
- }), Object.entries(t).forEach(([A, i]) => {
3257
- e[A] !== i && Yt(n, A, i);
3255
+ t.hasOwnProperty(A) || he(i, A);
3256
+ }), Object.entries(t).forEach(([A, n]) => {
3257
+ e[A] !== n && Yt(i, A, n);
3258
3258
  });
3259
3259
  }
3260
- function Ne(n, t) {
3261
- return n.document.documentElement.style.getPropertyValue(t);
3260
+ function Ye(i, t) {
3261
+ return i.document.documentElement.style.getPropertyValue(t);
3262
3262
  }
3263
- function Yt(n, t, e) {
3264
- n.document.documentElement.style.setProperty(t, e);
3263
+ function Yt(i, t, e) {
3264
+ i.document.documentElement.style.setProperty(t, e);
3265
3265
  }
3266
- function ce(n, t) {
3267
- n.document.documentElement.style.removeProperty(t);
3266
+ function he(i, t) {
3267
+ i.document.documentElement.style.removeProperty(t);
3268
3268
  }
3269
- const Fi = (n) => {
3270
- if (n.startsWith("rgb")) {
3271
- const t = n.match(/rgb\((\d+),\s(\d+),\s(\d+)(?:,\s(\d+))?\)/);
3269
+ const Fi = (i) => {
3270
+ if (i.startsWith("rgb")) {
3271
+ const t = i.match(/rgb\((\d+),\s(\d+),\s(\d+)(?:,\s(\d+))?\)/);
3272
3272
  if (t)
3273
3273
  return {
3274
3274
  r: parseInt(t[1], 10),
@@ -3276,8 +3276,8 @@ const Fi = (n) => {
3276
3276
  b: parseInt(t[3], 10),
3277
3277
  a: t[4] ? parseInt(t[4], 10) / 255 : 1
3278
3278
  };
3279
- } else if (n.startsWith("#")) {
3280
- const t = n.slice(1);
3279
+ } else if (i.startsWith("#")) {
3280
+ const t = i.slice(1);
3281
3281
  if (t.length === 3 || t.length === 4)
3282
3282
  return {
3283
3283
  r: parseInt(t[0] + t[0], 16) / 255,
@@ -3294,18 +3294,18 @@ const Fi = (n) => {
3294
3294
  };
3295
3295
  }
3296
3296
  return { r: 0, g: 0, b: 0, a: 1 };
3297
- }, Ui = (n) => 0.2126 * n.r * n.a + 0.7152 * n.g * n.a + 0.0722 * n.b * n.a, Ci = (n) => {
3298
- const t = Fi(n);
3297
+ }, Ui = (i) => 0.2126 * i.r * i.a + 0.7152 * i.g * i.a + 0.0722 * i.b * i.a, Ci = (i) => {
3298
+ const t = Fi(i);
3299
3299
  return Ui(t) < 128;
3300
- }, yi = () => "Highlight" in window, Se = ["IMG", "IMAGE", "AUDIO", "VIDEO", "SVG"];
3300
+ }, yi = () => "Highlight" in window, Ne = ["IMG", "IMAGE", "AUDIO", "VIDEO", "SVG"];
3301
3301
  class Ri {
3302
3302
  /**
3303
3303
  * Creates a DecorationGroup object
3304
3304
  * @param id Unique HTML ID-adhering name of the group
3305
3305
  * @param name Human-readable name of the group
3306
3306
  */
3307
- constructor(t, e, A, i) {
3308
- this.wnd = t, this.comms = e, this.id = A, this.name = i, this.items = [], this.lastItemId = 0, this.container = void 0, this.activateable = !1, this.experimentalHighlights = !1, this.currentRender = 0, yi() && (this.experimentalHighlights = !0, this.notTextFlag = /* @__PURE__ */ new Map());
3307
+ constructor(t, e, A, n) {
3308
+ this.wnd = t, this.comms = e, this.id = A, this.name = n, this.items = [], this.lastItemId = 0, this.container = void 0, this.activateable = !1, this.experimentalHighlights = !1, this.currentRender = 0, yi() && (this.experimentalHighlights = !0, this.notTextFlag = /* @__PURE__ */ new Map());
3309
3309
  }
3310
3310
  get activeable() {
3311
3311
  return this.activateable;
@@ -3318,14 +3318,14 @@ class Ri {
3318
3318
  * @param decoration Decoration to add
3319
3319
  */
3320
3320
  add(t) {
3321
- var e, A, i, r;
3322
- const s = `${this.id}-${this.lastItemId++}`, o = he(this.wnd.document, t.locator);
3321
+ var e, A, n, r;
3322
+ const s = `${this.id}-${this.lastItemId++}`, o = le(this.wnd.document, t.locator);
3323
3323
  if (!o) {
3324
3324
  this.comms.log("Can't locate DOM range for decoration", t);
3325
3325
  return;
3326
3326
  }
3327
3327
  const a = o.commonAncestorContainer;
3328
- a.nodeType !== Node.TEXT_NODE && this.experimentalHighlights && (Se.includes(a.nodeName.toUpperCase()) && ((e = this.notTextFlag) == null || e.set(s, !0)), a.querySelector(Se.join(", ").toLowerCase()) && ((A = this.notTextFlag) == null || A.set(s, !0)), (((i = a.textContent) == null ? void 0 : i.trim()) || "").length === 0 && ((r = this.notTextFlag) == null || r.set(s, !0)));
3328
+ a.nodeType !== Node.TEXT_NODE && this.experimentalHighlights && (Ne.includes(a.nodeName.toUpperCase()) && ((e = this.notTextFlag) == null || e.set(s, !0)), a.querySelector(Ne.join(", ").toLowerCase()) && ((A = this.notTextFlag) == null || A.set(s, !0)), (((n = a.textContent) == null ? void 0 : n.trim()) || "").length === 0 && ((r = this.notTextFlag) == null || r.set(s, !0)));
3329
3329
  const l = {
3330
3330
  decoration: t,
3331
3331
  id: s,
@@ -3339,11 +3339,11 @@ class Ri {
3339
3339
  */
3340
3340
  remove(t) {
3341
3341
  var e, A;
3342
- const i = this.items.findIndex((s) => s.decoration.id === t);
3343
- if (i < 0)
3342
+ const n = this.items.findIndex((s) => s.decoration.id === t);
3343
+ if (n < 0)
3344
3344
  return;
3345
- const r = this.items[i];
3346
- if (this.items.splice(i, 1), r.clickableElements = void 0, r.container && (r.container.remove(), r.container = void 0), this.experimentalHighlights && !((e = this.notTextFlag) != null && e.has(r.id))) {
3345
+ const r = this.items[n];
3346
+ if (this.items.splice(n, 1), r.clickableElements = void 0, r.container && (r.container.remove(), r.container = void 0), this.experimentalHighlights && !((e = this.notTextFlag) != null && e.has(r.id))) {
3347
3347
  const s = this.wnd.CSS.highlights.get(this.id);
3348
3348
  s == null || s.delete(r.range);
3349
3349
  }
@@ -3372,8 +3372,8 @@ class Ri {
3372
3372
  }
3373
3373
  experimentalLayout(t) {
3374
3374
  var e, A;
3375
- const [i, r] = this.requireContainer(!0);
3376
- r.add(t.range), i.innerHTML = `
3375
+ const [n, r] = this.requireContainer(!0);
3376
+ r.add(t.range), n.innerHTML = `
3377
3377
  ::highlight(${this.id}) {
3378
3378
  color: black;
3379
3379
  background-color: ${((A = (e = t.decoration) == null ? void 0 : e.style) == null ? void 0 : A.tint) ?? "yellow"};
@@ -3384,7 +3384,7 @@ class Ri {
3384
3384
  * @param item
3385
3385
  */
3386
3386
  layout(t) {
3387
- var e, A, i, r, s;
3387
+ var e, A, n, r, s;
3388
3388
  if (this.experimentalHighlights && !((e = this.notTextFlag) != null && e.has(t.id)))
3389
3389
  return this.experimentalLayout(t);
3390
3390
  const o = this.wnd.document.createElement("div");
@@ -3393,15 +3393,15 @@ class Ri {
3393
3393
  getComputedStyle(this.wnd.document.documentElement).getPropertyValue(
3394
3394
  "column-count"
3395
3395
  )
3396
- ), h = a / (l || 1), c = this.wnd.document.scrollingElement, g = c.scrollLeft, m = c.scrollTop, M = (E, F, T) => {
3397
- var ft, gt, ge, de, ue, me;
3396
+ ), h = a / (l || 1), c = this.wnd.document.scrollingElement, g = c.scrollLeft, m = c.scrollTop, M = (E, F, j) => {
3397
+ var ft, gt, ce, ge, de, ue;
3398
3398
  if (E.style.position = "absolute", ((gt = (ft = t.decoration) == null ? void 0 : ft.style) == null ? void 0 : gt.width) === "viewport") {
3399
3399
  E.style.width = `${a}px`, E.style.height = `${F.height}px`;
3400
3400
  let Dt = Math.floor(F.left / a) * a;
3401
3401
  E.style.left = `${Dt + g}px`, E.style.top = `${F.top + m}px`;
3402
- } else if (((de = (ge = t.decoration) == null ? void 0 : ge.style) == null ? void 0 : de.width) === "bounds")
3403
- E.style.width = `${T.width}px`, E.style.height = `${F.height}px`, E.style.left = `${T.left + g}px`, E.style.top = `${F.top + m}px`;
3404
- else if (((me = (ue = t.decoration) == null ? void 0 : ue.style) == null ? void 0 : me.width) === "page") {
3402
+ } else if (((ge = (ce = t.decoration) == null ? void 0 : ce.style) == null ? void 0 : ge.width) === "bounds")
3403
+ E.style.width = `${j.width}px`, E.style.height = `${F.height}px`, E.style.left = `${j.left + g}px`, E.style.top = `${F.top + m}px`;
3404
+ else if (((ue = (de = t.decoration) == null ? void 0 : de.style) == null ? void 0 : ue.width) === "page") {
3405
3405
  E.style.width = `${h}px`, E.style.height = `${F.height}px`;
3406
3406
  let Dt = Math.floor(F.left / h) * h;
3407
3407
  E.style.left = `${Dt + g}px`, E.style.top = `${F.top + m}px`;
@@ -3409,12 +3409,12 @@ class Ri {
3409
3409
  E.style.width = `${F.width}px`, E.style.height = `${F.height}px`, E.style.left = `${F.left + g}px`, E.style.top = `${F.top + m}px`;
3410
3410
  }, B = t.range.getBoundingClientRect();
3411
3411
  let f = this.wnd.document.createElement("template");
3412
- const I = Ne(this.wnd, "--USER__appearance") === "readium-night-on" || Ci(Ne(this.wnd, "--USER__backgroundColor"));
3412
+ const I = Ye(this.wnd, "--USER__appearance") === "readium-night-on" || Ci(Ye(this.wnd, "--USER__backgroundColor"));
3413
3413
  f.innerHTML = `
3414
3414
  <div
3415
3415
  class="r2-highlight-0"
3416
3416
  style="${[
3417
- `background-color: ${((i = (A = t.decoration) == null ? void 0 : A.style) == null ? void 0 : i.tint) ?? "yellow"} !important`,
3417
+ `background-color: ${((n = (A = t.decoration) == null ? void 0 : A.style) == null ? void 0 : n.tint) ?? "yellow"} !important`,
3418
3418
  //"opacity: 0.3 !important",
3419
3419
  `mix-blend-mode: ${I ? "exclusion" : "multiply"} !important`,
3420
3420
  "opacity: 1 !important",
@@ -3433,10 +3433,10 @@ class Ri {
3433
3433
  !0
3434
3434
  // doNotMergeHorizontallyAlignedRects
3435
3435
  );
3436
- E = E.sort((F, T) => F.top < T.top ? -1 : F.top > T.top ? 1 : 0);
3436
+ E = E.sort((F, j) => F.top < j.top ? -1 : F.top > j.top ? 1 : 0);
3437
3437
  for (let F of E) {
3438
- const T = C.cloneNode(!0);
3439
- T.style.setProperty("pointer-events", "none"), M(T, F, B), o.append(T);
3438
+ const j = C.cloneNode(!0);
3439
+ j.style.setProperty("pointer-events", "none"), M(j, F, B), o.append(j);
3440
3440
  }
3441
3441
  }
3442
3442
  t.container = o, t.clickableElements = Array.from(
@@ -3471,7 +3471,7 @@ class Ri {
3471
3471
  this.experimentalHighlights && this.wnd.CSS.highlights.delete(this.id), this.container && (this.container.remove(), this.container = void 0);
3472
3472
  }
3473
3473
  }
3474
- const MA = class Zt extends Vt {
3474
+ const mA = class Zt extends Vt {
3475
3475
  constructor() {
3476
3476
  super(...arguments), this.resizeFrame = 0, this.lastGroupId = 0, this.groups = /* @__PURE__ */ new Map(), this.handleResizer = this.handleResize.bind(this);
3477
3477
  }
@@ -3486,7 +3486,7 @@ const MA = class Zt extends Vt {
3486
3486
  }, 50);
3487
3487
  }
3488
3488
  mount(t, e) {
3489
- return this.wnd = t, e.register("decorate", Zt.moduleName, (A, i) => {
3489
+ return this.wnd = t, e.register("decorate", Zt.moduleName, (A, n) => {
3490
3490
  const r = A;
3491
3491
  r.decoration && r.decoration.locator && (r.decoration.locator = tt.deserialize(r.decoration.locator)), this.groups.has(r.group) || this.groups.set(r.group, new Ri(
3492
3492
  t,
@@ -3509,16 +3509,16 @@ const MA = class Zt extends Vt {
3509
3509
  s == null || s.update(r.decoration);
3510
3510
  break;
3511
3511
  }
3512
- i(!0);
3512
+ n(!0);
3513
3513
  }), this.resizeObserver = new ResizeObserver(() => t.requestAnimationFrame(() => this.handleResize())), this.resizeObserver.observe(t.document.body), t.addEventListener("orientationchange", this.handleResizer), t.addEventListener("resize", this.handleResizer), e.log("Decorator Mounted"), !0;
3514
3514
  }
3515
3515
  unmount(t, e) {
3516
3516
  return t.removeEventListener("orientationchange", this.handleResizer), t.removeEventListener("resize", this.handleResizer), e.unregisterAll(Zt.moduleName), this.resizeObserver.disconnect(), this.cleanup(), e.log("Decorator Unmounted"), !0;
3517
3517
  }
3518
3518
  };
3519
- MA.moduleName = "decorator";
3520
- let Qi = MA;
3521
- const xe = "readium-snapper-style", fA = class Kt extends Vt {
3519
+ mA.moduleName = "decorator";
3520
+ let Qi = mA;
3521
+ const Se = "readium-snapper-style", MA = class Kt extends Vt {
3522
3522
  constructor() {
3523
3523
  super(...arguments), this.protected = !1;
3524
3524
  }
@@ -3531,57 +3531,57 @@ const xe = "readium-snapper-style", fA = class Kt extends Vt {
3531
3531
  }
3532
3532
  mount(t, e) {
3533
3533
  const A = t.document.createElement("style");
3534
- return A.dataset.readium = "true", A.id = xe, A.textContent = this.buildStyles(), t.document.head.appendChild(A), e.register("protect", Kt.moduleName, (i, r) => {
3534
+ return A.dataset.readium = "true", A.id = Se, A.textContent = this.buildStyles(), t.document.head.appendChild(A), e.register("protect", Kt.moduleName, (n, r) => {
3535
3535
  this.protected = !0, A.textContent = this.buildStyles(), r(!0);
3536
- }), e.register("unprotect", Kt.moduleName, (i, r) => {
3536
+ }), e.register("unprotect", Kt.moduleName, (n, r) => {
3537
3537
  this.protected = !1, A.textContent = this.buildStyles(), r(!0);
3538
3538
  }), e.log("Snapper Mounted"), !0;
3539
3539
  }
3540
3540
  unmount(t, e) {
3541
3541
  var A;
3542
- return (A = t.document.getElementById(xe)) == null || A.remove(), e.log("Snapper Unmounted"), !0;
3542
+ return (A = t.document.getElementById(Se)) == null || A.remove(), e.log("Snapper Unmounted"), !0;
3543
3543
  }
3544
3544
  };
3545
- fA.moduleName = "snapper";
3546
- let pA = fA;
3547
- function et(n) {
3548
- return n.document.body.dir.toLowerCase() === "rtl";
3545
+ MA.moduleName = "snapper";
3546
+ let fA = MA;
3547
+ function et(i) {
3548
+ return i.document.body.dir.toLowerCase() === "rtl";
3549
3549
  }
3550
- function BA(n) {
3550
+ function pA(i) {
3551
3551
  return parseInt(
3552
- n.getComputedStyle(
3553
- n.document.documentElement
3552
+ i.getComputedStyle(
3553
+ i.document.documentElement
3554
3554
  ).getPropertyValue("column-count")
3555
3555
  );
3556
3556
  }
3557
- function zi(n) {
3558
- const t = getComputedStyle(n), e = parseFloat(t.paddingTop || "0"), A = parseFloat(t.paddingBottom || "0");
3559
- return n.clientHeight - e - A;
3557
+ function zi(i) {
3558
+ const t = getComputedStyle(i), e = parseFloat(t.paddingTop || "0"), A = parseFloat(t.paddingBottom || "0");
3559
+ return i.clientHeight - e - A;
3560
3560
  }
3561
- function Te(n) {
3562
- const t = BA(n);
3561
+ function xe(i) {
3562
+ const t = pA(i);
3563
3563
  if (!t)
3564
3564
  return !1;
3565
- const e = n.document.querySelectorAll("div[id^='readium-virtual-page']");
3565
+ const e = i.document.querySelectorAll("div[id^='readium-virtual-page']");
3566
3566
  for (const a of e)
3567
3567
  a.remove();
3568
- const A = e.length, i = n.document.scrollingElement.scrollWidth, r = n.visualViewport.width, s = Math.round(i / r * t) % t, o = t === 1 || s === 0 ? 0 : t - s;
3568
+ const A = e.length, n = i.document.scrollingElement.scrollWidth, r = i.visualViewport.width, s = Math.round(n / r * t) % t, o = t === 1 || s === 0 ? 0 : t - s;
3569
3569
  if (o > 0)
3570
3570
  for (let a = 0; a < o; a++) {
3571
- const l = n.document.createElement("div");
3572
- l.setAttribute("id", `readium-virtual-page-${a}`), l.dataset.readium = "true", CSS.supports("break-before", "column") ? l.style.breakBefore = "column" : (CSS.supports("break-inside", "avoid-column") && (l.style.breakInside = "avoid-column"), l.style.height = zi(n.document.documentElement) + "px"), l.innerHTML = "&#8203;", n.document.body.appendChild(l);
3571
+ const l = i.document.createElement("div");
3572
+ l.setAttribute("id", `readium-virtual-page-${a}`), l.dataset.readium = "true", CSS.supports("break-before", "column") ? l.style.breakBefore = "column" : (CSS.supports("break-inside", "avoid-column") && (l.style.breakInside = "avoid-column"), l.style.height = zi(i.document.documentElement) + "px"), l.innerHTML = "&#8203;", i.document.body.appendChild(l);
3573
3573
  }
3574
3574
  return A !== o;
3575
3575
  }
3576
- function Yi(n) {
3577
- const t = n.document.createElement("style");
3578
- t.appendChild(n.document.createTextNode("*{}")), n.document.body.appendChild(t), n.document.body.removeChild(t);
3576
+ function Yi(i) {
3577
+ const t = i.document.createElement("style");
3578
+ t.appendChild(i.document.createTextNode("*{}")), i.document.body.appendChild(t), i.document.body.removeChild(t);
3579
3579
  }
3580
- function Ni(n) {
3581
- return n < 0.5 ? 2 * n * n : -1 + (4 - 2 * n) * n;
3580
+ function Ni(i) {
3581
+ return i < 0.5 ? 2 * i * i : -1 + (4 - 2 * i) * i;
3582
3582
  }
3583
- function S(n) {
3584
- const t = n.getSelection();
3583
+ function S(i) {
3584
+ const t = i.getSelection();
3585
3585
  t && t.removeAllRanges();
3586
3586
  }
3587
3587
  const Si = [
@@ -3598,12 +3598,12 @@ const Si = [
3598
3598
  "textarea",
3599
3599
  "video"
3600
3600
  ];
3601
- function EA(n) {
3601
+ function BA(i) {
3602
3602
  var t;
3603
- return Si.indexOf(n.nodeName.toLowerCase()) !== -1 || n.hasAttribute("contenteditable") && ((t = n.getAttribute("contenteditable")) == null ? void 0 : t.toLowerCase()) !== "false" ? n : n.parentElement ? EA(n.parentElement) : null;
3603
+ return Si.indexOf(i.nodeName.toLowerCase()) !== -1 || i.hasAttribute("contenteditable") && ((t = i.getAttribute("contenteditable")) == null ? void 0 : t.toLowerCase()) !== "false" ? i : i.parentElement ? BA(i.parentElement) : null;
3604
3604
  }
3605
- function wA(n, t) {
3606
- const e = IA(n, n.document.body, t), A = n._readium_cssSelectorGenerator.getCssSelector(e, {
3605
+ function EA(i, t) {
3606
+ const e = wA(i, i.document.body, t), A = i._readium_cssSelectorGenerator.getCssSelector(e, {
3607
3607
  selectors: ["tag", "id", "class", "nthchild", "nthoftype", "attribute"]
3608
3608
  });
3609
3609
  return new tt({
@@ -3619,28 +3619,28 @@ function wA(n, t) {
3619
3619
  })
3620
3620
  });
3621
3621
  }
3622
- function IA(n, t, e) {
3622
+ function wA(i, t, e) {
3623
3623
  for (var A = 0; A < t.children.length; A++) {
3624
- const i = t.children[A];
3625
- if (!ji(i) && xi(n, i, e))
3626
- return Ti(n, i) ? i : IA(n, i, e);
3624
+ const n = t.children[A];
3625
+ if (!ji(n) && xi(i, n, e))
3626
+ return Ti(i, n) ? n : wA(i, n, e);
3627
3627
  }
3628
3628
  return t;
3629
3629
  }
3630
- function xi(n, t, e) {
3630
+ function xi(i, t, e) {
3631
3631
  if (t === document.body || t === document.documentElement)
3632
3632
  return !0;
3633
3633
  if (!document || !document.documentElement || !document.body)
3634
3634
  return !1;
3635
3635
  const A = t.getBoundingClientRect();
3636
- return e ? A.bottom > 0 && A.top < n.innerHeight : A.right > 0 && A.left < n.innerWidth;
3636
+ return e ? A.bottom > 0 && A.top < i.innerHeight : A.right > 0 && A.left < i.innerWidth;
3637
3637
  }
3638
- function Ti(n, t) {
3638
+ function Ti(i, t) {
3639
3639
  const e = t.getBoundingClientRect();
3640
- return e.top >= 0 && e.left >= 0 && e.bottom <= n.innerHeight && e.right <= n.innerWidth;
3640
+ return e.top >= 0 && e.left >= 0 && e.bottom <= i.innerHeight && e.right <= i.innerWidth;
3641
3641
  }
3642
- function ji(n) {
3643
- const t = getComputedStyle(n);
3642
+ function ji(i) {
3643
+ const t = getComputedStyle(i);
3644
3644
  if (t) {
3645
3645
  const e = t.getPropertyValue("display");
3646
3646
  if (e != "block" && e != "list-item" || t.getPropertyValue("opacity") === "0")
@@ -3648,7 +3648,7 @@ function ji(n) {
3648
3648
  }
3649
3649
  return !1;
3650
3650
  }
3651
- const je = "readium-column-snapper-style", Vi = 200, FA = class j extends pA {
3651
+ const Te = "readium-column-snapper-style", Vi = 200, IA = class V extends fA {
3652
3652
  constructor() {
3653
3653
  super(...arguments), this.shakeTimeout = 0, this.snappingCancelled = !1, this.alreadyScrollLeft = 0, this.overscroll = 0, this.cachedScrollWidth = 0, this.touchState = 0, this.startingX = void 0, this.endingX = void 0, this.onTouchStarter = this.onTouchStart.bind(this), this.onTouchEnder = this.onTouchEnd.bind(this), this.onWidthChanger = this.onWidthChange.bind(this), this.onTouchMover = this.onTouchMove.bind(this);
3654
3654
  }
@@ -3663,10 +3663,10 @@ const je = "readium-column-snapper-style", Vi = 200, FA = class j extends pA {
3663
3663
  return e - e % this.wnd.innerWidth;
3664
3664
  }
3665
3665
  reportProgress() {
3666
- const t = this.wnd.scrollX, e = this.cachedScrollWidth, A = Math.max(0, Math.min(1, t / e)), i = Math.max(0, Math.min(1, (t + this.wnd.innerWidth) / e));
3666
+ const t = this.wnd.scrollX, e = this.cachedScrollWidth, A = Math.max(0, Math.min(1, t / e)), n = Math.max(0, Math.min(1, (t + this.wnd.innerWidth) / e));
3667
3667
  this.comms.send("progress", {
3668
3668
  start: A,
3669
- end: i
3669
+ end: n
3670
3670
  });
3671
3671
  }
3672
3672
  shake() {
@@ -3688,7 +3688,7 @@ const je = "readium-column-snapper-style", Vi = 200, FA = class j extends pA {
3688
3688
  }
3689
3689
  // Snaps the current offset to the page width.
3690
3690
  snapCurrentOffset(t = !1, e = !1) {
3691
- const A = this.wnd.scrollX > 0 ? this.wnd.scrollX : this.alreadyScrollLeft, i = this.doc(), r = this.dragOffset(), s = BA(this.wnd), o = Math.min(Math.max(0, A), this.cachedScrollWidth), a = et(this.wnd) ? -1 : 1, l = (
3691
+ const A = this.wnd.scrollX > 0 ? this.wnd.scrollX : this.alreadyScrollLeft, n = this.doc(), r = this.dragOffset(), s = pA(this.wnd), o = Math.min(Math.max(0, A), this.cachedScrollWidth), a = et(this.wnd) ? -1 : 1, l = (
3692
3692
  // The hurdle to overcome in order to change pages
3693
3693
  a * (this.wnd.innerWidth / 3) * (a * r > 0 ? 2 : 1)
3694
3694
  ), h = this.snapOffset(o + l);
@@ -3704,12 +3704,12 @@ const je = "readium-column-snapper-style", Vi = 200, FA = class j extends pA {
3704
3704
  return;
3705
3705
  m || (m = B);
3706
3706
  const f = B - m, I = c(this.overscroll, 0, f, g), C = c(A, h, f, g);
3707
- i.scrollLeft = C, this.overscroll !== 0 && (i.style.transform = `translate3d(${-I}px, 0px, 0px)`), f < g ? this.wnd.requestAnimationFrame(M) : (this.clearTouches(), i.style.removeProperty("transform"), i.scrollLeft = h, e || this.reportProgress());
3707
+ n.scrollLeft = C, this.overscroll !== 0 && (n.style.transform = `translate3d(${-I}px, 0px, 0px)`), f < g ? this.wnd.requestAnimationFrame(M) : (this.clearTouches(), n.style.removeProperty("transform"), n.scrollLeft = h, e || this.reportProgress());
3708
3708
  };
3709
3709
  this.wnd.requestAnimationFrame(M);
3710
3710
  } else
3711
- i.style.removeProperty("transform"), this.wnd.requestAnimationFrame(() => {
3712
- i.scrollLeft = h, this.clearTouches(), e || this.reportProgress();
3711
+ n.style.removeProperty("transform"), this.wnd.requestAnimationFrame(() => {
3712
+ n.scrollLeft = h, this.clearTouches(), e || this.reportProgress();
3713
3713
  });
3714
3714
  }
3715
3715
  dragOffset() {
@@ -3754,7 +3754,7 @@ const je = "readium-column-snapper-style", Vi = 200, FA = class j extends pA {
3754
3754
  return !1;
3755
3755
  t.navigator.epubReadingSystem.layoutStyle = "paginated";
3756
3756
  const A = t.document.createElement("style");
3757
- A.dataset.readium = "true", A.id = je, A.textContent = `
3757
+ A.dataset.readium = "true", A.id = Te, A.textContent = `
3758
3758
  @keyframes readium-bounce-l-animation {
3759
3759
  0%, 100% {transform: translate3d(0, 0, 0);}
3760
3760
  50% {transform: translate3d(-50px, 0, 0);}
@@ -3790,23 +3790,23 @@ const je = "readium-column-snapper-style", Vi = 200, FA = class j extends pA {
3790
3790
  }
3791
3791
  `, t.document.head.appendChild(A), this.resizeObserver = new ResizeObserver(() => {
3792
3792
  t.requestAnimationFrame(() => {
3793
- t && Te(t);
3793
+ t && xe(t);
3794
3794
  }), this.onWidthChange();
3795
3795
  }), this.resizeObserver.observe(t.document.body), this.mutationObserver = new MutationObserver((r) => {
3796
3796
  for (const s of r)
3797
3797
  if (s.target === this.wnd.document.documentElement) {
3798
3798
  const o = s.oldValue, a = s.target.getAttribute("style"), l = /transform\s*:\s*([^;]+)/, h = o == null ? void 0 : o.match(l), c = a == null ? void 0 : a.match(l);
3799
3799
  (!h && !c || h && !c || h && c && h[1] !== c[1]) && (t.requestAnimationFrame(() => {
3800
- t && Te(t);
3800
+ t && xe(t);
3801
3801
  }), this.onWidthChange());
3802
3802
  } else
3803
3803
  t.requestAnimationFrame(() => this.cachedScrollWidth = this.doc().scrollWidth);
3804
3804
  }), t.frameElement && this.mutationObserver.observe(t.frameElement, { attributes: !0, attributeFilter: ["style"] }), this.mutationObserver.observe(t.document, { attributes: !0, attributeFilter: ["style"] }), this.mutationObserver.observe(t.document.documentElement, { attributes: !0, attributeFilter: ["style"] });
3805
- const i = (r) => {
3805
+ const n = (r) => {
3806
3806
  const s = this.doc().scrollLeft;
3807
3807
  return this.doc().scrollLeft = this.snapOffset(r), s !== this.doc().scrollLeft;
3808
3808
  };
3809
- return t.addEventListener("orientationchange", this.onWidthChanger), t.addEventListener("resize", this.onWidthChanger), t.requestAnimationFrame(() => this.cachedScrollWidth = this.doc().scrollWidth), e.register("go_progression", j.moduleName, (r, s) => {
3809
+ return t.addEventListener("orientationchange", this.onWidthChanger), t.addEventListener("resize", this.onWidthChanger), t.requestAnimationFrame(() => this.cachedScrollWidth = this.doc().scrollWidth), e.register("go_progression", V.moduleName, (r, s) => {
3810
3810
  const o = r;
3811
3811
  if (o < 0 || o > 1) {
3812
3812
  e.send("error", {
@@ -3819,7 +3819,7 @@ const je = "readium-column-snapper-style", Vi = 200, FA = class j extends pA {
3819
3819
  const a = this.cachedScrollWidth, l = et(t) ? -1 : 1, h = a * o * l;
3820
3820
  this.doc().scrollLeft = this.snapOffset(h), this.reportProgress(), S(this.wnd), s(!0);
3821
3821
  });
3822
- }), e.register("go_id", j.moduleName, (r, s) => {
3822
+ }), e.register("go_id", V.moduleName, (r, s) => {
3823
3823
  const o = t.document.getElementById(r);
3824
3824
  if (!o) {
3825
3825
  s(!1);
@@ -3828,10 +3828,10 @@ const je = "readium-column-snapper-style", Vi = 200, FA = class j extends pA {
3828
3828
  this.wnd.requestAnimationFrame(() => {
3829
3829
  this.doc().scrollLeft = this.snapOffset(o.getBoundingClientRect().left + t.scrollX), this.reportProgress(), S(this.wnd), s(!0);
3830
3830
  });
3831
- }), e.register("go_text", j.moduleName, (r, s) => {
3831
+ }), e.register("go_text", V.moduleName, (r, s) => {
3832
3832
  let o;
3833
3833
  Array.isArray(r) && (r.length > 1 && (o = r[1]), r = r[0]);
3834
- const a = ct.deserialize(r), l = he(this.wnd.document, new tt({
3834
+ const a = ct.deserialize(r), l = le(this.wnd.document, new tt({
3835
3835
  href: t.location.href,
3836
3836
  type: "text/html",
3837
3837
  text: a,
@@ -3848,7 +3848,7 @@ const je = "readium-column-snapper-style", Vi = 200, FA = class j extends pA {
3848
3848
  this.wnd.requestAnimationFrame(() => {
3849
3849
  this.doc().scrollLeft = this.snapOffset(l.getBoundingClientRect().left + t.scrollX), this.reportProgress(), S(this.wnd), s(!0);
3850
3850
  });
3851
- }), e.register("go_end", j.moduleName, (r, s) => {
3851
+ }), e.register("go_end", V.moduleName, (r, s) => {
3852
3852
  const o = et(t) ? -1 : 1;
3853
3853
  this.wnd.requestAnimationFrame(() => {
3854
3854
  this.cachedScrollWidth = this.doc().scrollWidth;
@@ -3857,69 +3857,77 @@ const je = "readium-column-snapper-style", Vi = 200, FA = class j extends pA {
3857
3857
  return s(!1);
3858
3858
  this.doc().scrollLeft = this.snapOffset(a), this.reportProgress(), S(this.wnd), s(!0);
3859
3859
  });
3860
- }), e.register("go_start", j.moduleName, (r, s) => {
3860
+ }), e.register("go_start", V.moduleName, (r, s) => {
3861
3861
  this.wnd.requestAnimationFrame(() => {
3862
3862
  if (this.doc().scrollLeft === 0)
3863
3863
  return s(!1);
3864
3864
  this.doc().scrollLeft = 0, this.reportProgress(), S(this.wnd), s(!0);
3865
3865
  });
3866
- }), e.register("go_prev", j.moduleName, (r, s) => {
3866
+ }), e.register("go_prev", V.moduleName, (r, s) => {
3867
3867
  this.wnd.requestAnimationFrame(() => {
3868
3868
  this.cachedScrollWidth = this.doc().scrollWidth;
3869
- const o = t.scrollX - t.innerWidth, a = et(t) ? -(this.cachedScrollWidth - t.innerWidth) : 0, l = i(Math.max(o, a));
3869
+ const o = t.scrollX - t.innerWidth, a = et(t) ? -(this.cachedScrollWidth - t.innerWidth) : 0, l = n(Math.max(o, a));
3870
3870
  l && (this.reportProgress(), S(this.wnd)), s(l);
3871
3871
  });
3872
- }), e.register("go_next", j.moduleName, (r, s) => {
3872
+ }), e.register("go_next", V.moduleName, (r, s) => {
3873
3873
  this.wnd.requestAnimationFrame(() => {
3874
3874
  this.cachedScrollWidth = this.doc().scrollWidth;
3875
- const o = t.scrollX + t.innerWidth, a = et(t) ? 0 : this.cachedScrollWidth - t.innerWidth, l = i(Math.min(o, a));
3875
+ const o = t.scrollX + t.innerWidth, a = et(t) ? 0 : this.cachedScrollWidth - t.innerWidth, l = n(Math.min(o, a));
3876
3876
  l && (this.reportProgress(), S(this.wnd)), s(l);
3877
3877
  });
3878
- }), e.register("unfocus", j.moduleName, (r, s) => {
3878
+ }), e.register("unfocus", V.moduleName, (r, s) => {
3879
3879
  this.snappingCancelled = !0, S(this.wnd), s(!0);
3880
- }), e.register("shake", j.moduleName, (r, s) => {
3880
+ }), e.register("shake", V.moduleName, (r, s) => {
3881
3881
  this.shake(), s(!0);
3882
- }), e.register("focus", j.moduleName, (r, s) => {
3882
+ }), e.register("focus", V.moduleName, (r, s) => {
3883
3883
  this.wnd.requestAnimationFrame(() => {
3884
3884
  this.cachedScrollWidth = this.doc().scrollWidth, this.snapCurrentOffset(!1, !0), this.reportProgress(), s(!0);
3885
3885
  });
3886
- }), e.register("first_visible_locator", j.moduleName, (r, s) => {
3887
- const o = wA(t, !1);
3886
+ }), e.register("first_visible_locator", V.moduleName, (r, s) => {
3887
+ const o = EA(t, !1);
3888
3888
  this.comms.send("first_visible_locator", o.serialize()), s(!0);
3889
3889
  }), t.addEventListener("touchstart", this.onTouchStarter, { passive: !0 }), t.addEventListener("touchend", this.onTouchEnder, { passive: !0 }), t.addEventListener("touchmove", this.onTouchMover, { passive: !0 }), t.document.addEventListener("touchstart", () => {
3890
3890
  }), e.log("ColumnSnapper Mounted"), !0;
3891
3891
  }
3892
3892
  unmount(t, e) {
3893
3893
  var A;
3894
- return this.snappingCancelled = !0, e.unregisterAll(j.moduleName), this.resizeObserver.disconnect(), this.mutationObserver.disconnect(), t.removeEventListener("touchstart", this.onTouchStarter), t.removeEventListener("touchend", this.onTouchEnder), t.removeEventListener("touchmove", this.onTouchMover), t.removeEventListener("orientationchange", this.onWidthChanger), t.removeEventListener("resize", this.onWidthChanger), (A = t.document.getElementById(je)) == null || A.remove(), e.log("ColumnSnapper Unmounted"), super.unmount(t, e);
3894
+ return this.snappingCancelled = !0, e.unregisterAll(V.moduleName), this.resizeObserver.disconnect(), this.mutationObserver.disconnect(), t.removeEventListener("touchstart", this.onTouchStarter), t.removeEventListener("touchend", this.onTouchEnder), t.removeEventListener("touchmove", this.onTouchMover), t.removeEventListener("orientationchange", this.onWidthChanger), t.removeEventListener("resize", this.onWidthChanger), (A = t.document.getElementById(Te)) == null || A.remove(), e.log("ColumnSnapper Unmounted"), super.unmount(t, e);
3895
3895
  }
3896
3896
  };
3897
- FA.moduleName = "column_snapper";
3898
- let Pi = FA;
3899
- const Ve = "readium-scroll-snapper-style", UA = class D extends pA {
3897
+ IA.moduleName = "column_snapper";
3898
+ let Pi = IA;
3899
+ const je = "readium-scroll-snapper-style", FA = class b extends fA {
3900
3900
  constructor() {
3901
- super(...arguments), this.scrollEndTimer = null, this.SCROLL_END_DELAY = 100, this.handleScroll = () => {
3902
- this.scrollEndTimer !== null && this.wnd.clearTimeout(this.scrollEndTimer), this.scrollEndTimer = this.wnd.setTimeout(() => {
3903
- this.onScrollEnd();
3904
- }, this.SCROLL_END_DELAY);
3905
- }, this.onScrollEnd = () => {
3906
- this.scrollEndTimer = null, this.reportProgress();
3901
+ super(...arguments), this.initialScrollHandled = !1, this.isScrolling = !1, this.lastScrollTop = 0, this.isResizing = !1, this.resizeDebounce = null, this.handleScroll = () => {
3902
+ if (this.comms.ready && !this.isResizing) {
3903
+ if (!this.initialScrollHandled) {
3904
+ this.lastScrollTop = this.doc().scrollTop, this.initialScrollHandled = !0, this.reportProgress();
3905
+ return;
3906
+ }
3907
+ this.isScrolling || (this.isScrolling = !0, this.wnd.requestAnimationFrame(() => {
3908
+ this.reportProgress();
3909
+ const t = this.doc().scrollTop, e = t - this.lastScrollTop;
3910
+ this.lastScrollTop = t, this.comms.send("scroll", e), this.isScrolling = !1;
3911
+ }));
3912
+ }
3907
3913
  };
3908
3914
  }
3909
3915
  doc() {
3910
3916
  return this.wnd.document.scrollingElement;
3911
3917
  }
3912
3918
  reportProgress() {
3913
- const t = Math.ceil(this.doc().scrollTop), e = this.doc().scrollHeight, A = this.wnd.innerHeight, i = Math.max(0, Math.min(1, t / e)), r = Math.max(0, Math.min(1, (t + A) / e));
3919
+ if (!this.comms.ready)
3920
+ return;
3921
+ const t = Math.ceil(this.doc().scrollTop), e = this.doc().scrollHeight, A = this.wnd.innerHeight, n = Math.max(0, Math.min(1, t / e)), r = Math.max(0, Math.min(1, (t + A) / e));
3914
3922
  this.comms.send("progress", {
3915
- start: i,
3923
+ start: n,
3916
3924
  end: r
3917
3925
  });
3918
3926
  }
3919
3927
  mount(t, e) {
3920
- this.wnd = t, this.comms = e, t.navigator.epubReadingSystem.layoutStyle = "scrolling";
3928
+ this.wnd = t, this.comms = e, this.initialScrollHandled = !1, this.lastScrollTop = 0, this.isResizing = !1, this.resizeDebounce && (this.wnd.clearTimeout(this.resizeDebounce), this.resizeDebounce = null), t.navigator.epubReadingSystem.layoutStyle = "scrolling";
3921
3929
  const A = t.document.createElement("style");
3922
- return A.dataset.readium = "true", A.id = Ve, A.textContent = `
3930
+ return A.dataset.readium = "true", A.id = je, A.textContent = `
3923
3931
  * {
3924
3932
  scrollbar-width: none; /* for Firefox */
3925
3933
  }
@@ -3928,15 +3936,15 @@ const Ve = "readium-scroll-snapper-style", UA = class D extends pA {
3928
3936
  display: none; /* for Chrome, Safari, and Opera */
3929
3937
  }
3930
3938
  `, t.document.head.appendChild(A), this.resizeObserver = new ResizeObserver(() => {
3931
- this.comms.ready && this.handleScroll();
3932
- }), this.resizeObserver.observe(t.document.body), t.addEventListener("scroll", this.handleScroll, {
3933
- passive: !0
3934
- }), e.register("force_webkit_recalc", D.moduleName, () => {
3939
+ this.resizeDebounce && this.wnd.clearTimeout(this.resizeDebounce), this.isResizing = !0, this.resizeDebounce = this.wnd.setTimeout(() => {
3940
+ this.isResizing = !1, this.resizeDebounce = null, this.reportProgress();
3941
+ }, 50);
3942
+ }), this.resizeObserver.observe(t.document.body), t.addEventListener("scroll", this.handleScroll, { passive: !0 }), e.register("force_webkit_recalc", b.moduleName, () => {
3935
3943
  Yi(this.wnd);
3936
- const i = this.doc().scrollTop;
3937
- i > 1 ? this.doc().scrollTop = i - 1 : this.doc().scrollTop = i + 1, this.doc().scrollTop = i;
3938
- }), e.register("go_progression", D.moduleName, (i, r) => {
3939
- const s = i;
3944
+ const n = this.doc().scrollTop;
3945
+ n > 1 ? this.doc().scrollTop = n - 1 : this.doc().scrollTop = n + 1, this.doc().scrollTop = n;
3946
+ }), e.register("go_progression", b.moduleName, (n, r) => {
3947
+ const s = n;
3940
3948
  if (s < 0 || s > 1) {
3941
3949
  e.send("error", {
3942
3950
  message: "go_progression must be given a position from 0.0 to 1.0"
@@ -3946,8 +3954,8 @@ const Ve = "readium-scroll-snapper-style", UA = class D extends pA {
3946
3954
  this.wnd.requestAnimationFrame(() => {
3947
3955
  this.doc().scrollTop = this.doc().offsetHeight * s, this.reportProgress(), S(this.wnd), r(!0);
3948
3956
  });
3949
- }), e.register("go_id", D.moduleName, (i, r) => {
3950
- const s = t.document.getElementById(i);
3957
+ }), e.register("go_id", b.moduleName, (n, r) => {
3958
+ const s = t.document.getElementById(n);
3951
3959
  if (!s) {
3952
3960
  r(!1);
3953
3961
  return;
@@ -3955,10 +3963,10 @@ const Ve = "readium-scroll-snapper-style", UA = class D extends pA {
3955
3963
  this.wnd.requestAnimationFrame(() => {
3956
3964
  this.doc().scrollTop = s.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), S(this.wnd), r(!0);
3957
3965
  });
3958
- }), e.register("go_text", D.moduleName, (i, r) => {
3966
+ }), e.register("go_text", b.moduleName, (n, r) => {
3959
3967
  let s;
3960
- Array.isArray(i) && (i.length > 1 && (s = i[1]), i = i[0]);
3961
- const o = ct.deserialize(i), a = he(this.wnd.document, new tt({
3968
+ Array.isArray(n) && (n.length > 1 && (s = n[1]), n = n[0]);
3969
+ const o = ct.deserialize(n), a = le(this.wnd.document, new tt({
3962
3970
  href: t.location.href,
3963
3971
  type: "text/html",
3964
3972
  text: o,
@@ -3975,39 +3983,39 @@ const Ve = "readium-scroll-snapper-style", UA = class D extends pA {
3975
3983
  this.wnd.requestAnimationFrame(() => {
3976
3984
  this.doc().scrollTop = a.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), S(this.wnd), r(!0);
3977
3985
  });
3978
- }), e.register("go_start", D.moduleName, (i, r) => {
3986
+ }), e.register("go_start", b.moduleName, (n, r) => {
3979
3987
  if (this.doc().scrollTop === 0)
3980
3988
  return r(!1);
3981
3989
  this.doc().scrollTop = 0, this.reportProgress(), r(!0);
3982
- }), e.register("go_end", D.moduleName, (i, r) => {
3990
+ }), e.register("go_end", b.moduleName, (n, r) => {
3983
3991
  if (this.doc().scrollTop === this.doc().scrollHeight - this.doc().offsetHeight)
3984
3992
  return r(!1);
3985
3993
  this.doc().scrollTop = this.doc().scrollHeight - this.doc().offsetHeight, this.reportProgress(), r(!0);
3986
- }), e.register("unfocus", D.moduleName, (i, r) => {
3994
+ }), e.register("unfocus", b.moduleName, (n, r) => {
3987
3995
  S(this.wnd), r(!0);
3988
3996
  }), e.register([
3989
3997
  "go_next",
3990
3998
  "go_prev"
3991
- ], D.moduleName, (i, r) => r(!1)), e.register("focus", D.moduleName, (i, r) => {
3999
+ ], b.moduleName, (n, r) => r(!1)), e.register("focus", b.moduleName, (n, r) => {
3992
4000
  this.reportProgress(), r(!0);
3993
- }), e.register("first_visible_locator", D.moduleName, (i, r) => {
3994
- const s = wA(t, !0);
4001
+ }), e.register("first_visible_locator", b.moduleName, (n, r) => {
4002
+ const s = EA(t, !0);
3995
4003
  this.comms.send("first_visible_locator", s.serialize()), r(!0);
3996
4004
  }), e.log("ScrollSnapper Mounted"), !0;
3997
4005
  }
3998
4006
  unmount(t, e) {
3999
4007
  var A;
4000
- return e.unregisterAll(D.moduleName), this.resizeObserver.disconnect(), this.handleScroll && t.removeEventListener("scroll", this.handleScroll), (A = t.document.getElementById(Ve)) == null || A.remove(), this.scrollEndTimer !== null && (clearTimeout(this.scrollEndTimer), this.scrollEndTimer = null), e.log("ScrollSnapper Unmounted"), !0;
4008
+ return e.unregisterAll(b.moduleName), this.resizeObserver.disconnect(), this.handleScroll && t.removeEventListener("scroll", this.handleScroll), (A = t.document.getElementById(je)) == null || A.remove(), e.log("ScrollSnapper Unmounted"), !0;
4001
4009
  }
4002
4010
  };
4003
- UA.moduleName = "scroll_snapper";
4004
- let Di = UA;
4005
- class CA extends Vt {
4011
+ FA.moduleName = "scroll_snapper";
4012
+ let Di = FA;
4013
+ class UA extends Vt {
4006
4014
  constructor() {
4007
4015
  super(...arguments), this.pointerMoved = !1, this.onPointerUp = this.onPointUp.bind(this), this.onPointerMove = this.onPointMove.bind(this), this.onPointerDown = this.onPointDown.bind(this), this.onContextMenu = this.onContext.bind(this), this.onClicker = this.onClick.bind(this);
4008
4016
  }
4009
4017
  onPointUp(t) {
4010
- var e, A, i, r, s;
4018
+ var e, A, n, r, s;
4011
4019
  const o = this.wnd.getSelection();
4012
4020
  if (o && ((e = o.toString()) == null ? void 0 : e.length) > 0) {
4013
4021
  const l = (A = o.getRangeAt(0)) == null ? void 0 : A.getClientRects();
@@ -4019,7 +4027,7 @@ class CA extends Vt {
4019
4027
  y: h.y,
4020
4028
  width: h.width,
4021
4029
  height: h.height,
4022
- targetFrameSrc: (r = (i = this.wnd) == null ? void 0 : i.location) == null ? void 0 : r.href
4030
+ targetFrameSrc: (r = (n = this.wnd) == null ? void 0 : n.location) == null ? void 0 : r.href
4023
4031
  };
4024
4032
  this.comms.send("text_selected", c);
4025
4033
  }
@@ -4036,7 +4044,7 @@ class CA extends Vt {
4036
4044
  y: t.clientY * a,
4037
4045
  targetFrameSrc: this.wnd.location.href,
4038
4046
  targetElement: t.target.outerHTML,
4039
- interactiveElement: (s = EA(t.target)) == null ? void 0 : s.outerHTML,
4047
+ interactiveElement: (s = BA(t.target)) == null ? void 0 : s.outerHTML,
4040
4048
  cssSelector: this.wnd._readium_cssSelectorGenerator.getCssSelector(t.target)
4041
4049
  }), this.pointerMoved = !1;
4042
4050
  }
@@ -4072,8 +4080,8 @@ class CA extends Vt {
4072
4080
  return t.document.removeEventListener("pointerdown", this.onPointerDown), t.document.removeEventListener("pointerup", this.onPointerUp), t.document.removeEventListener("contextmenu", this.onContextMenu), t.document.removeEventListener("pointermove", this.onPointerMove), t.document.removeEventListener("click", this.onClicker), e.log("Peripherals Unmounted"), !0;
4073
4081
  }
4074
4082
  }
4075
- CA.moduleName = "peripherals";
4076
- const yA = class qt extends Vt {
4083
+ UA.moduleName = "peripherals";
4084
+ const CA = class qt extends Vt {
4077
4085
  constructor() {
4078
4086
  super(...arguments), this.mediaPlayingCount = 0, this.allAnimations = /* @__PURE__ */ new Set();
4079
4087
  }
@@ -4095,11 +4103,11 @@ const yA = class qt extends Vt {
4095
4103
  Reflect.apply(A[1], A[2], A[3]);
4096
4104
  break;
4097
4105
  case 1:
4098
- const i = A[1], r = A[2];
4099
- t.removeEventListener(i.type, t._readium_eventBlocker, !0);
4100
- const s = new Event(i.type, {
4101
- bubbles: i.bubbles,
4102
- cancelable: i.cancelable
4106
+ const n = A[1], r = A[2];
4107
+ t.removeEventListener(n.type, t._readium_eventBlocker, !0);
4108
+ const s = new Event(n.type, {
4109
+ bubbles: n.bubbles,
4110
+ cancelable: n.cancelable
4103
4111
  });
4104
4112
  r ? r.dispatchEvent(s) : t.dispatchEvent(s);
4105
4113
  break;
@@ -4127,9 +4135,9 @@ const yA = class qt extends Vt {
4127
4135
  ), Reflect.defineProperty(t.navigator, "epubReadingSystem", {
4128
4136
  value: {
4129
4137
  name: "readium-ts-toolkit",
4130
- version: "2.0.0-beta.6",
4131
- hasFeature: (i, r = "") => {
4132
- switch (i) {
4138
+ version: "2.0.0-beta.7",
4139
+ hasFeature: (n, r = "") => {
4140
+ switch (n) {
4133
4141
  case "dom-manipulation":
4134
4142
  return !0;
4135
4143
  case "layout-changes":
@@ -4150,18 +4158,18 @@ const yA = class qt extends Vt {
4150
4158
  }
4151
4159
  },
4152
4160
  writable: !1
4153
- }), "getAnimations" in t.document && t.document.getAnimations().forEach((i) => {
4154
- i.cancel(), this.allAnimations.add(i);
4155
- }), e.register("activate", qt.moduleName, (i, r) => {
4161
+ }), "getAnimations" in t.document && t.document.getAnimations().forEach((n) => {
4162
+ n.cancel(), this.allAnimations.add(n);
4163
+ }), e.register("activate", qt.moduleName, (n, r) => {
4156
4164
  this.allAnimations.forEach((s) => {
4157
4165
  s.cancel(), s.play();
4158
4166
  }), r(!0);
4159
- }), e.register("unfocus", qt.moduleName, (i, r) => {
4167
+ }), e.register("unfocus", qt.moduleName, (n, r) => {
4160
4168
  this.pauseAllMedia(t), this.allAnimations.forEach((s) => s.pause()), r(!0);
4161
4169
  });
4162
4170
  const A = t.document.querySelectorAll("audio,video");
4163
- for (let i = 0; i < A.length; i++) {
4164
- const r = A[i];
4171
+ for (let n = 0; n < A.length; n++) {
4172
+ const r = A[n];
4165
4173
  r.addEventListener("play", this.onMediaPlayEvent, {
4166
4174
  passive: !0
4167
4175
  }), r.addEventListener("pause", this.onMediaPauseEvent, {
@@ -4174,9 +4182,9 @@ const yA = class qt extends Vt {
4174
4182
  return t.removeEventListener("error", this.wndOnErr), t.removeEventListener("play", this.onMediaPlayEvent), t.removeEventListener("pause", this.onMediaPauseEvent), this.allAnimations.forEach((A) => A.cancel()), this.allAnimations.clear(), e.log("Setup Unmounted"), !0;
4175
4183
  }
4176
4184
  };
4177
- yA.moduleName = "setup";
4178
- let RA = yA;
4179
- const Pe = "readium-viewport", QA = class At extends RA {
4185
+ CA.moduleName = "setup";
4186
+ let yA = CA;
4187
+ const Ve = "readium-viewport", RA = class At extends yA {
4180
4188
  onViewportWidthChanged(t) {
4181
4189
  const e = t.target;
4182
4190
  Yt(e, "--RS__viewportWidth", `${e.innerWidth}px`);
@@ -4185,38 +4193,38 @@ const Pe = "readium-viewport", QA = class At extends RA {
4185
4193
  if (!super.mount(t, e))
4186
4194
  return !1;
4187
4195
  const A = t.document.createElement("meta");
4188
- return A.dataset.readium = "true", A.setAttribute("name", "viewport"), A.setAttribute("id", Pe), A.setAttribute(
4196
+ return A.dataset.readium = "true", A.setAttribute("name", "viewport"), A.setAttribute("id", Ve), A.setAttribute(
4189
4197
  "content",
4190
4198
  "width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no"
4191
4199
  ), t.document.head.appendChild(A), t.addEventListener("orientationchange", this.onViewportWidthChanged), t.addEventListener("resize", this.onViewportWidthChanged), this.onViewportWidthChanged({
4192
4200
  target: t
4193
- }), e.register("get_properties", At.moduleName, (i, r) => {
4194
- mA(t), r(!0);
4195
- }), e.register("update_properties", At.moduleName, (i, r) => {
4196
- i["--RS__viewportWidth"] = `${t.innerWidth}px`, Ii(t, i), r(!0);
4197
- }), e.register("set_property", At.moduleName, (i, r) => {
4198
- const s = i;
4201
+ }), e.register("get_properties", At.moduleName, (n, r) => {
4202
+ uA(t), r(!0);
4203
+ }), e.register("update_properties", At.moduleName, (n, r) => {
4204
+ n["--RS__viewportWidth"] = `${t.innerWidth}px`, Ii(t, n), r(!0);
4205
+ }), e.register("set_property", At.moduleName, (n, r) => {
4206
+ const s = n;
4199
4207
  Yt(t, s[0], s[1]), r(!0);
4200
- }), e.register("remove_property", At.moduleName, (i, r) => {
4201
- ce(t, i), r(!0);
4202
- }), e.register("activate", At.moduleName, (i, r) => {
4208
+ }), e.register("remove_property", At.moduleName, (n, r) => {
4209
+ he(t, n), r(!0);
4210
+ }), e.register("activate", At.moduleName, (n, r) => {
4203
4211
  this.unblock(t), r(!0);
4204
4212
  }), e.log("ReflowableSetup Mounted"), !0;
4205
4213
  }
4206
4214
  unmount(t, e) {
4207
4215
  var A;
4208
- return e.unregisterAll(At.moduleName), (A = t.document.head.querySelector(`#${Pe}`)) == null || A.remove(), t.removeEventListener("orientationchange", this.onViewportWidthChanged), e.log("ReflowableSetup Unmounted"), super.unmount(t, e);
4216
+ return e.unregisterAll(At.moduleName), (A = t.document.head.querySelector(`#${Ve}`)) == null || A.remove(), t.removeEventListener("orientationchange", this.onViewportWidthChanged), e.log("ReflowableSetup Unmounted"), super.unmount(t, e);
4209
4217
  }
4210
4218
  };
4211
- QA.moduleName = "reflowable_setup";
4212
- let vi = QA;
4213
- const De = "readium-fixed-style", zA = class Z extends RA {
4219
+ RA.moduleName = "reflowable_setup";
4220
+ let bi = RA;
4221
+ const Pe = "readium-fixed-style", QA = class Z extends yA {
4214
4222
  mount(t, e) {
4215
4223
  if (!super.mount(t, e))
4216
4224
  return !1;
4217
4225
  t.navigator.epubReadingSystem.layoutStyle = "paginated";
4218
4226
  const A = t.document.createElement("style");
4219
- return A.id = De, A.dataset.readium = "true", A.textContent = `
4227
+ return A.id = Pe, A.dataset.readium = "true", A.textContent = `
4220
4228
  html, body {
4221
4229
  text-size-adjust: none;
4222
4230
  -ms-text-size-adjust: none;
@@ -4228,12 +4236,12 @@ const De = "readium-fixed-style", zA = class Z extends RA {
4228
4236
  min-height: 100%;
4229
4237
 
4230
4238
  /*cursor: var() TODO*/
4231
- }`, t.document.head.appendChild(A), e.register("set_property", Z.moduleName, (i, r) => {
4232
- const s = i;
4239
+ }`, t.document.head.appendChild(A), e.register("set_property", Z.moduleName, (n, r) => {
4240
+ const s = n;
4233
4241
  Yt(t, s[0], s[1]), r(!0);
4234
- }), e.register("remove_property", Z.moduleName, (i, r) => {
4235
- ce(t, i), r(!0);
4236
- }), e.register("first_visible_locator", Z.moduleName, (i, r) => r(!1)), e.register("unfocus", Z.moduleName, (i, r) => {
4242
+ }), e.register("remove_property", Z.moduleName, (n, r) => {
4243
+ he(t, n), r(!0);
4244
+ }), e.register("first_visible_locator", Z.moduleName, (n, r) => r(!1)), e.register("unfocus", Z.moduleName, (n, r) => {
4237
4245
  S(t), r(!0);
4238
4246
  }), e.register([
4239
4247
  "focus",
@@ -4244,17 +4252,17 @@ const De = "readium-fixed-style", zA = class Z extends RA {
4244
4252
  "go_start",
4245
4253
  "go_text",
4246
4254
  "go_progression"
4247
- ], Z.moduleName, (i, r) => r(!0)), e.register("activate", Z.moduleName, (i, r) => {
4255
+ ], Z.moduleName, (n, r) => r(!0)), e.register("activate", Z.moduleName, (n, r) => {
4248
4256
  this.unblock(t), r(!0);
4249
4257
  }), e.log("FixedSetup Mounted"), !0;
4250
4258
  }
4251
4259
  unmount(t, e) {
4252
4260
  var A;
4253
- return e.unregisterAll(Z.moduleName), (A = t.document.getElementById(De)) == null || A.remove(), e.log("FixedSetup Unmounted"), super.unmount(t, e);
4261
+ return e.unregisterAll(Z.moduleName), (A = t.document.getElementById(Pe)) == null || A.remove(), e.log("FixedSetup Unmounted"), super.unmount(t, e);
4254
4262
  }
4255
4263
  };
4256
- zA.moduleName = "fixed_setup";
4257
- let bi = zA;
4264
+ QA.moduleName = "fixed_setup";
4265
+ let vi = QA;
4258
4266
  const Gi = [
4259
4267
  "fixed_setup",
4260
4268
  "decorator",
@@ -4267,13 +4275,13 @@ const Gi = [
4267
4275
  "scroll_snapper"
4268
4276
  ], _t = new Map([
4269
4277
  // All modules go here
4270
- bi,
4271
4278
  vi,
4272
- CA,
4279
+ bi,
4280
+ UA,
4273
4281
  Qi,
4274
4282
  Pi,
4275
4283
  Di
4276
- ].map((n) => [n.moduleName, n]));
4284
+ ].map((i) => [i.moduleName, i]));
4277
4285
  class Nt {
4278
4286
  /**
4279
4287
  * @param wnd Window instance to operate on
@@ -4285,11 +4293,11 @@ class Nt {
4285
4293
  if (A.length) {
4286
4294
  if (typeof t > "u")
4287
4295
  throw Error("Loader is not in a web browser");
4288
- t.parent !== t && this.comms.log("Loader is probably in a frame"), this.loadedModules = A.map((i) => {
4289
- const r = this.loadModule(i);
4296
+ t.parent !== t && this.comms.log("Loader is probably in a frame"), this.loadedModules = A.map((n) => {
4297
+ const r = this.loadModule(n);
4290
4298
  if (r)
4291
4299
  return r.mount(this.wnd, this.comms), r;
4292
- }).filter((i) => i !== void 0);
4300
+ }).filter((n) => n !== void 0);
4293
4301
  }
4294
4302
  }
4295
4303
  loadModule(t) {
@@ -4314,7 +4322,7 @@ class Nt {
4314
4322
  const e = _t.get(t);
4315
4323
  if (e === void 0)
4316
4324
  return this.comms.log(`Module "${t}" does not exist in the library`), !1;
4317
- const A = this.loadedModules.findIndex((i) => i instanceof e);
4325
+ const A = this.loadedModules.findIndex((n) => n instanceof e);
4318
4326
  return A < 0 ? !1 : (this.loadedModules[A].unmount(this.wnd, this.comms), this.loadedModules.splice(A, 1), !0);
4319
4327
  }
4320
4328
  /**
@@ -4334,8 +4342,8 @@ class $t {
4334
4342
  this.channelId = Ot();
4335
4343
  }
4336
4344
  this.gc = setInterval(() => {
4337
- this.registry.forEach((A, i) => {
4338
- performance.now() - A.time > ki && (console.warn(i, "event for", A.key, "was never handled!"), this.registry.delete(i));
4345
+ this.registry.forEach((A, n) => {
4346
+ performance.now() - A.time > ki && (console.warn(n, "event for", A.key, "was never handled!"), this.registry.delete(n));
4339
4347
  });
4340
4348
  }, 5e3), window.addEventListener("message", this.handler), this.send("_ping", void 0);
4341
4349
  }
@@ -4384,7 +4392,7 @@ class $t {
4384
4392
  * Send a message to the window using postMessage-based comms communication
4385
4393
  * @returns Identifier associated with the message
4386
4394
  */
4387
- send(t, e, A, i = !1, r = []) {
4395
+ send(t, e, A, n = !1, r = []) {
4388
4396
  const s = Ot();
4389
4397
  return A && this.registry.set(s, {
4390
4398
  // Add callback to the registry
@@ -4398,7 +4406,7 @@ class $t {
4398
4406
  id: s,
4399
4407
  data: e,
4400
4408
  key: t,
4401
- strict: i
4409
+ strict: n
4402
4410
  },
4403
4411
  "/",
4404
4412
  // Same origin
@@ -4412,10 +4420,10 @@ const Ji = "'Iowan Old Style', Sitka, 'Sitka Text', Palatino, 'Book Antiqua', 'U
4412
4420
  RS__sansTf: Li,
4413
4421
  RS__humanistTf: Oi,
4414
4422
  RS__monospaceTf: Xi
4415
- }, Ki = 16, ve = Zi.RS__oldStyleTf;
4423
+ }, Ki = 16, De = Zi.RS__oldStyleTf;
4416
4424
  class ut {
4417
4425
  constructor(t) {
4418
- this._optimalLineLength = null, this._canvas = document.createElement("canvas"), this._optimalChars = t.optimalChars, this._minChars = t.minChars, this._maxChars = t.maxChars, this._baseFontSize = t.baseFontSize || Ki, this._fontFace = t.fontFace || ve, this._sample = t.sample || null, this._pageGutter = t.pageGutter || 0, this._letterSpacing = t.letterSpacing ? Math.round(t.letterSpacing * this._baseFontSize) : 0, this._wordSpacing = t.wordSpacing ? Math.round(t.wordSpacing * this._baseFontSize) : 0, this._isCJK = t.isCJK || !1, this._getRelative = t.getRelative || !1, this._padding = this._pageGutter * 2, this._minDivider = this._minChars && this._minChars < this._optimalChars ? this._optimalChars / this._minChars : this._minChars === null ? null : 1, this._maxMultiplier = this._maxChars && this._maxChars > this._optimalChars ? this._maxChars / this._optimalChars : this._maxChars === null ? null : 1, this._approximatedWordSpaces = ut.approximateWordSpaces(this._optimalChars, this._sample);
4426
+ this._optimalLineLength = null, this._canvas = document.createElement("canvas"), this._optimalChars = t.optimalChars, this._minChars = t.minChars, this._maxChars = t.maxChars, this._baseFontSize = t.baseFontSize || Ki, this._fontFace = t.fontFace || De, this._sample = t.sample || null, this._pageGutter = t.pageGutter || 0, this._letterSpacing = t.letterSpacing ? Math.round(t.letterSpacing * this._baseFontSize) : 0, this._wordSpacing = t.wordSpacing ? Math.round(t.wordSpacing * this._baseFontSize) : 0, this._isCJK = t.isCJK || !1, this._getRelative = t.getRelative || !1, this._padding = this._pageGutter * 2, this._minDivider = this._minChars && this._minChars < this._optimalChars ? this._optimalChars / this._minChars : this._minChars === null ? null : 1, this._maxMultiplier = this._maxChars && this._maxChars > this._optimalChars ? this._maxChars / this._optimalChars : this._maxChars === null ? null : 1, this._approximatedWordSpaces = ut.approximateWordSpaces(this._optimalChars, this._sample);
4419
4427
  }
4420
4428
  updateMultipliers() {
4421
4429
  this._minDivider = this._minChars && this._minChars < this._optimalChars ? this._optimalChars / this._minChars : this._minChars === null ? null : 1, this._maxMultiplier = this._maxChars && this._maxChars > this._optimalChars ? this._maxChars / this._optimalChars : this._maxChars === null ? null : 1;
@@ -4424,7 +4432,7 @@ class ut {
4424
4432
  // Not filtering because pretty much everything can
4425
4433
  // trigger a recomputation anyway.
4426
4434
  update(t) {
4427
- t.optimalChars && (this._optimalChars = t.optimalChars), t.minChars !== void 0 && (this._minChars = t.minChars), t.maxChars !== void 0 && (this._maxChars = t.maxChars), t.baseFontSize && (this._baseFontSize = t.baseFontSize), t.fontFace !== void 0 && (this._fontFace = t.fontFace || ve), t.letterSpacing && (this._letterSpacing = t.letterSpacing), t.wordSpacing && (this._wordSpacing = t.wordSpacing), t.isCJK != null && (this._isCJK = t.isCJK), t.pageGutter && (this._pageGutter = t.pageGutter), t.getRelative && (this._getRelative = t.getRelative), t.sample && (this._sample = t.sample, this._approximatedWordSpaces = ut.approximateWordSpaces(this._optimalChars, this._sample)), this.updateMultipliers(), this._optimalLineLength = this.getOptimalLineLength();
4435
+ t.optimalChars && (this._optimalChars = t.optimalChars), t.minChars !== void 0 && (this._minChars = t.minChars), t.maxChars !== void 0 && (this._maxChars = t.maxChars), t.baseFontSize && (this._baseFontSize = t.baseFontSize), t.fontFace !== void 0 && (this._fontFace = t.fontFace || De), t.letterSpacing && (this._letterSpacing = t.letterSpacing), t.wordSpacing && (this._wordSpacing = t.wordSpacing), t.isCJK != null && (this._isCJK = t.isCJK), t.pageGutter && (this._pageGutter = t.pageGutter), t.getRelative && (this._getRelative = t.getRelative), t.sample && (this._sample = t.sample, this._approximatedWordSpaces = ut.approximateWordSpaces(this._optimalChars, this._sample)), this.updateMultipliers(), this._optimalLineLength = this.getOptimalLineLength();
4428
4436
  }
4429
4437
  get baseFontSize() {
4430
4438
  return this._baseFontSize;
@@ -4449,8 +4457,8 @@ class ut {
4449
4457
  static approximateWordSpaces(t, e) {
4450
4458
  let A = 0;
4451
4459
  if (e && e.length >= t) {
4452
- const i = e.match(/([\s]+)/gi);
4453
- A = (i ? i.length : 0) * (t / e.length);
4460
+ const n = e.match(/([\s]+)/gi);
4461
+ A = (n ? n.length : 0) * (t / e.length);
4454
4462
  }
4455
4463
  return A;
4456
4464
  }
@@ -4480,8 +4488,8 @@ class ut {
4480
4488
  if (e.font = `${this._baseFontSize}px ${t}`, this._sample && this._sample.length >= this._optimalChars && (A = this._sample.slice(0, this._optimalChars)), Object.hasOwn(e, "letterSpacing") && Object.hasOwn(e, "wordSpacing"))
4481
4489
  return e.letterSpacing = this._letterSpacing.toString() + "px", e.wordSpacing = this._wordSpacing.toString() + "px", e.measureText(A).width;
4482
4490
  {
4483
- const i = this._letterSpacing * (this._optimalChars - 1), r = this._wordSpacing * ut.approximateWordSpaces(this._optimalChars, this._sample);
4484
- return e.measureText(A).width + i + r;
4491
+ const n = this._letterSpacing * (this._optimalChars - 1), r = this._wordSpacing * ut.approximateWordSpaces(this._optimalChars, this._sample);
4492
+ return e.measureText(A).width + n + r;
4485
4493
  }
4486
4494
  } else
4487
4495
  return this.getLineLengthFallback();
@@ -4497,16 +4505,16 @@ class ut {
4497
4505
  * Portions of this code come from the sML library
4498
4506
  * Current version: 1.0.36
4499
4507
  */
4500
- const YA = () => typeof navigator > "u" ? "" : navigator.userAgent || "", NA = () => typeof navigator > "u" ? void 0 : navigator.userAgentData || void 0;
4501
- class SA {
4508
+ const zA = () => typeof navigator > "u" ? "" : navigator.userAgent || "", YA = () => typeof navigator > "u" ? void 0 : navigator.userAgentData || void 0;
4509
+ class NA {
4502
4510
  constructor() {
4503
- const t = NA(), e = YA(), A = (r) => (typeof r == "string" || typeof r == "number") && r ? String(r).replace(/_/g, ".").split(".").map((s) => parseInt(s) || 0) : [], i = (r = "") => {
4511
+ const t = YA(), e = zA(), A = (r) => (typeof r == "string" || typeof r == "number") && r ? String(r).replace(/_/g, ".").split(".").map((s) => parseInt(s) || 0) : [], n = (r = "") => {
4504
4512
  if (!r)
4505
4513
  return [];
4506
4514
  const s = new RegExp("^.*" + r + "[ :\\/]?(\\d+([\\._]\\d+)*).*$");
4507
4515
  return s.test(e) ? A(e.replace(s, "$1")) : [];
4508
4516
  };
4509
- this.OS = ((r) => (/(macOS|Mac OS X)/.test(e) ? (/\(iP(hone|od touch);/.test(e) && (r.iOS = i("CPU (?:iPhone )?OS ")), /\(iPad;/.test(e) ? r.iOS = r.iPadOS = i("CPU (?:iPhone )?OS ") : /(macOS|Mac OS X) \d/.test(e) && (document.ontouchend !== void 0 ? r.iOS = r.iPadOS = i() : r.macOS = i("(?:macOS|Mac OS X) "))) : /Windows( NT)? \d/.test(e) ? r.Windows = ((s) => s[0] !== 6 || !s[1] ? s : s[1] === 1 ? [7] : s[1] === 2 ? [8] : [8, 1])(i("Windows(?: NT)?")) : /Android \d/.test(e) ? r.Android = i("Android") : /CrOS/.test(e) ? r.ChromeOS = i() : /X11;/.test(e) && (r.Linux = i()), r))({}), t && t.getHighEntropyValues(["architecture", "model", "platform", "platformVersion", "uaFullVersion"]).then((r) => ((s) => {
4517
+ this.OS = ((r) => (/(macOS|Mac OS X)/.test(e) ? (/\(iP(hone|od touch);/.test(e) && (r.iOS = n("CPU (?:iPhone )?OS ")), /\(iPad;/.test(e) ? r.iOS = r.iPadOS = n("CPU (?:iPhone )?OS ") : /(macOS|Mac OS X) \d/.test(e) && (document.ontouchend !== void 0 ? r.iOS = r.iPadOS = n() : r.macOS = n("(?:macOS|Mac OS X) "))) : /Windows( NT)? \d/.test(e) ? r.Windows = ((s) => s[0] !== 6 || !s[1] ? s : s[1] === 1 ? [7] : s[1] === 2 ? [8] : [8, 1])(n("Windows(?: NT)?")) : /Android \d/.test(e) ? r.Android = n("Android") : /CrOS/.test(e) ? r.ChromeOS = n() : /X11;/.test(e) && (r.Linux = n()), r))({}), t && t.getHighEntropyValues(["architecture", "model", "platform", "platformVersion", "uaFullVersion"]).then((r) => ((s) => {
4510
4518
  const o = r.platform, a = r.platformVersion;
4511
4519
  if (!(!o || !a)) {
4512
4520
  if (/^i(OS|P(hone|od touch))$/.test(o))
@@ -4533,7 +4541,7 @@ class SA {
4533
4541
  const o = t.brands.reduce((a, l) => (a[l.brand] = [l.version * 1], a), {});
4534
4542
  o["Google Chrome"] ? (s = !0, r.Blink = r.Chromium = o.Chromium || [], r.Chrome = o["Google Chrome"]) : o["Microsoft Edge"] ? (s = !0, r.Blink = r.Chromium = o.Chromium || [], r.Edge = o["Microsoft Edge"]) : o.Opera && (s = !0, r.Blink = r.Chromium = o.Chromium || [], r.Opera = o.Opera);
4535
4543
  }
4536
- return s || (/ Gecko\/\d/.test(e) ? (r.Gecko = i("rv"), / Waterfox\/\d/.test(e) ? r.Waterfox = i("Waterfox") : / Firefox\/\d/.test(e) && (r.Firefox = i("Firefox"))) : / Edge\/\d/.test(e) ? (r.EdgeHTML = i("Edge"), r.Edge = r.EdgeHTML) : / Chrom(ium|e)\/\d/.test(e) ? (r.Blink = r.Chromium = ((o) => o[0] ? o : i("Chrome"))(i("Chromium")), / EdgA?\/\d/.test(e) ? r.Edge = ((o) => o[0] ? o : i("Edg"))(i("EdgA")) : / OPR\/\d/.test(e) ? r.Opera = i("OPR") : / Vivaldi\/\d/.test(e) ? r.Vivaldi = i("Vivaldi") : / Silk\/\d/.test(e) ? r.Silk = i("Silk") : / UCBrowser\/\d/.test(e) ? r.UCBrowser = i("UCBrowser") : / Phoebe\/\d/.test(e) ? r.Phoebe = i("Phoebe") : r.Chrome = ((o) => o[0] ? o : r.Chromium)(i("Chrome"))) : / AppleWebKit\/\d/.test(e) ? (r.WebKit = i("AppleWebKit"), / CriOS \d/.test(e) ? r.Chrome = i("CriOS") : / FxiOS \d/.test(e) ? r.Firefox = i("FxiOS") : / EdgiOS\/\d/.test(e) ? r.Edge = i("EdgiOS") : / Version\/\d/.test(e) && (r.Safari = i("Version"))) : / Trident\/\d/.test(e) && (r.Trident = i("Trident"), r.InternetExplorer = ((o) => o[0] ? o : i("MSIE"))(i("rv")))), /[\[; ]FB(AN|_IAB)\//.test(e) && (r.Facebook = i("FBAV")), / Line\/\d/.test(e) && (r.LINE = i("Line")), r;
4544
+ return s || (/ Gecko\/\d/.test(e) ? (r.Gecko = n("rv"), / Waterfox\/\d/.test(e) ? r.Waterfox = n("Waterfox") : / Firefox\/\d/.test(e) && (r.Firefox = n("Firefox"))) : / Edge\/\d/.test(e) ? (r.EdgeHTML = n("Edge"), r.Edge = r.EdgeHTML) : / Chrom(ium|e)\/\d/.test(e) ? (r.Blink = r.Chromium = ((o) => o[0] ? o : n("Chrome"))(n("Chromium")), / EdgA?\/\d/.test(e) ? r.Edge = ((o) => o[0] ? o : n("Edg"))(n("EdgA")) : / OPR\/\d/.test(e) ? r.Opera = n("OPR") : / Vivaldi\/\d/.test(e) ? r.Vivaldi = n("Vivaldi") : / Silk\/\d/.test(e) ? r.Silk = n("Silk") : / UCBrowser\/\d/.test(e) ? r.UCBrowser = n("UCBrowser") : / Phoebe\/\d/.test(e) ? r.Phoebe = n("Phoebe") : r.Chrome = ((o) => o[0] ? o : r.Chromium)(n("Chrome"))) : / AppleWebKit\/\d/.test(e) ? (r.WebKit = n("AppleWebKit"), / CriOS \d/.test(e) ? r.Chrome = n("CriOS") : / FxiOS \d/.test(e) ? r.Firefox = n("FxiOS") : / EdgiOS\/\d/.test(e) ? r.Edge = n("EdgiOS") : / Version\/\d/.test(e) && (r.Safari = n("Version"))) : / Trident\/\d/.test(e) && (r.Trident = n("Trident"), r.InternetExplorer = ((o) => o[0] ? o : n("MSIE"))(n("rv")))), /[\[; ]FB(AN|_IAB)\//.test(e) && (r.Facebook = n("FBAV")), / Line\/\d/.test(e) && (r.LINE = n("Line")), r;
4537
4545
  })({}), this.Env = { get: () => [this.OS, this.UA].reduce((r, s) => {
4538
4546
  for (const o in s)
4539
4547
  s[o] && r.push(o);
@@ -4541,23 +4549,23 @@ class SA {
4541
4549
  }, []) };
4542
4550
  }
4543
4551
  }
4544
- class qi extends SA {
4552
+ class qi extends NA {
4545
4553
  get iOSRequest() {
4546
- const t = NA(), e = YA();
4554
+ const t = YA(), e = zA();
4547
4555
  if (this.OS.iOS && !this.OS.iPadOS)
4548
4556
  return "mobile";
4549
4557
  if (this.OS.iPadOS)
4550
4558
  return /\(iPad;/.test(e) || t && /^iPad(OS)?$/.test(t.platform) ? "mobile" : "desktop";
4551
4559
  }
4552
4560
  }
4553
- const It = new SA(), O = new qi();
4561
+ const It = new NA(), O = new qi();
4554
4562
  class _i {
4555
4563
  constructor(t) {
4556
4564
  this.hidden = !0, this.destroyed = !1, this.currModules = [], this.frame = document.createElement("iframe"), this.frame.classList.add("readium-navigator-iframe"), this.frame.style.visibility = "hidden", this.frame.style.setProperty("aria-hidden", "true"), this.frame.style.opacity = "0", this.frame.style.position = "absolute", this.frame.style.pointerEvents = "none", this.frame.style.transition = "visibility 0s, opacity 0.1s linear", this.source = t;
4557
4565
  }
4558
4566
  async load(t) {
4559
4567
  return new Promise((e, A) => {
4560
- var i;
4568
+ var n;
4561
4569
  if (this.loader) {
4562
4570
  const r = this.frame.contentWindow;
4563
4571
  if ([...this.currModules].sort().join("|") === [...t].sort().join("|")) {
@@ -4567,7 +4575,7 @@ class _i {
4567
4575
  }
4568
4576
  return;
4569
4577
  }
4570
- (i = this.comms) == null || i.halt(), this.loader.destroy(), this.loader = new Nt(r, t), this.currModules = t, this.comms = void 0;
4578
+ (n = this.comms) == null || n.halt(), this.loader.destroy(), this.loader = new Nt(r, t), this.currModules = t, this.comms = void 0;
4571
4579
  try {
4572
4580
  e(r);
4573
4581
  } catch {
@@ -4598,8 +4606,8 @@ class _i {
4598
4606
  if (!this.destroyed) {
4599
4607
  if (this.frame.style.visibility = "hidden", this.frame.style.setProperty("aria-hidden", "true"), this.frame.style.opacity = "0", this.frame.style.pointerEvents = "none", this.hidden = !0, this.frame.parentElement)
4600
4608
  return this.comms === void 0 || !this.comms.ready ? void 0 : new Promise((e, A) => {
4601
- var i;
4602
- (i = this.comms) == null || i.send("unfocus", void 0, (r) => {
4609
+ var n;
4610
+ (n = this.comms) == null || n.send("unfocus", void 0, (r) => {
4603
4611
  var s;
4604
4612
  (s = this.comms) == null || s.halt(), e();
4605
4613
  });
@@ -4613,8 +4621,8 @@ class _i {
4613
4621
  if (!this.frame.parentElement)
4614
4622
  throw Error("Trying to show frame that is not attached to the DOM");
4615
4623
  return this.comms ? this.comms.resume() : this.comms = new $t(this.frame.contentWindow, this.source), new Promise((e, A) => {
4616
- var i;
4617
- (i = this.comms) == null || i.send("activate", void 0, () => {
4624
+ var n;
4625
+ (n = this.comms) == null || n.send("activate", void 0, () => {
4618
4626
  var r;
4619
4627
  (r = this.comms) == null || r.send("focus", void 0, () => {
4620
4628
  var o;
@@ -4628,8 +4636,8 @@ class _i {
4628
4636
  });
4629
4637
  }
4630
4638
  setCSSProperties(t) {
4631
- var e, A, i;
4632
- this.destroyed || !this.frame.contentWindow || (this.hidden && (this.comms ? (e = this.comms) == null || e.resume() : this.comms = new $t(this.frame.contentWindow, this.source)), (A = this.comms) == null || A.send("update_properties", t), this.hidden && ((i = this.comms) == null || i.halt()));
4639
+ var e, A, n;
4640
+ this.destroyed || !this.frame.contentWindow || (this.hidden && (this.comms ? (e = this.comms) == null || e.resume() : this.comms = new $t(this.frame.contentWindow, this.source)), (A = this.comms) == null || A.send("update_properties", t), this.hidden && ((n = this.comms) == null || n.halt()));
4633
4641
  }
4634
4642
  get iframe() {
4635
4643
  if (this.destroyed)
@@ -4659,7 +4667,7 @@ class _i {
4659
4667
  return this.loader;
4660
4668
  }
4661
4669
  }
4662
- const be = 5, Ge = 3;
4670
+ const be = 5, ve = 3;
4663
4671
  class $i {
4664
4672
  constructor(t, e, A) {
4665
4673
  this.pool = /* @__PURE__ */ new Map(), this.blobs = /* @__PURE__ */ new Map(), this.inprogress = /* @__PURE__ */ new Map(), this.pendingUpdates = /* @__PURE__ */ new Map(), this.container = t, this.positions = e, this.currentCssProperties = A;
@@ -4670,14 +4678,14 @@ class $i {
4670
4678
  for (; e.value; )
4671
4679
  A.push(e.value), e = t.next();
4672
4680
  A.length > 0 && await Promise.allSettled(A), this.inprogress.clear();
4673
- let i = this.pool.values(), r = i.next();
4681
+ let n = this.pool.values(), r = n.next();
4674
4682
  for (; r.value; )
4675
- await r.value.destroy(), r = i.next();
4683
+ await r.value.destroy(), r = n.next();
4676
4684
  this.pool.clear(), this.blobs.forEach((s) => URL.revokeObjectURL(s)), this.container.childNodes.forEach((s) => {
4677
4685
  (s.nodeType === Node.ELEMENT_NODE || s.nodeType === Node.TEXT_NODE) && s.remove();
4678
4686
  });
4679
4687
  }
4680
- async update(t, e, A, i = !1) {
4688
+ async update(t, e, A, n = !1) {
4681
4689
  let r = this.positions.findIndex((a) => a.locations.position === e.locations.position);
4682
4690
  if (r < 0)
4683
4691
  throw Error(`Locator not found in position list: ${e.locations.position} > ${this.positions.reduce((a, l) => l.locations.position || 0 > a ? l.locations.position || 0 : a, 0)}`);
@@ -4687,14 +4695,14 @@ class $i {
4687
4695
  var M, B;
4688
4696
  const h = [], c = [];
4689
4697
  this.positions.forEach((f, I) => {
4690
- (I > r + be || I < r - be) && (h.includes(f.href) || h.push(f.href)), I < r + Ge && I > r - Ge && (c.includes(f.href) || c.push(f.href));
4698
+ (I > r + be || I < r - be) && (h.includes(f.href) || h.push(f.href)), I < r + ve && I > r - ve && (c.includes(f.href) || c.push(f.href));
4691
4699
  }), h.forEach(async (f) => {
4692
4700
  var I;
4693
4701
  c.includes(f) || this.pool.has(f) && (await ((I = this.pool.get(f)) == null ? void 0 : I.destroy()), this.pool.delete(f), this.pendingUpdates.has(f) && this.pendingUpdates.set(f, { inPool: !1 }));
4694
4702
  }), this.currentBaseURL !== void 0 && t.baseURL !== this.currentBaseURL && (this.blobs.forEach((f) => URL.revokeObjectURL(f)), this.blobs.clear()), this.currentBaseURL = t.baseURL;
4695
4703
  const g = async (f) => {
4696
4704
  var E;
4697
- if (i && (this.blobs.forEach((F) => URL.revokeObjectURL(F)), this.blobs.clear(), this.pendingUpdates.clear()), this.pendingUpdates.has(f) && ((E = this.pendingUpdates.get(f)) == null ? void 0 : E.inPool) === !1) {
4705
+ if (n && (this.blobs.forEach((F) => URL.revokeObjectURL(F)), this.blobs.clear(), this.pendingUpdates.clear()), this.pendingUpdates.has(f) && ((E = this.pendingUpdates.get(f)) == null ? void 0 : E.inPool) === !1) {
4698
4706
  const F = this.blobs.get(f);
4699
4707
  F && (URL.revokeObjectURL(F), this.blobs.delete(f), this.pendingUpdates.delete(f));
4700
4708
  }
@@ -4711,8 +4719,8 @@ class $i {
4711
4719
  if (!I)
4712
4720
  return;
4713
4721
  if (!this.blobs.has(f)) {
4714
- const T = await new sA(t, this.currentBaseURL || "", I, this.currentCssProperties).build();
4715
- this.blobs.set(f, T);
4722
+ const j = await new rA(t, this.currentBaseURL || "", I, this.currentCssProperties).build();
4723
+ this.blobs.set(f, j);
4716
4724
  }
4717
4725
  const C = new _i(this.blobs.get(f));
4718
4726
  f !== s && await C.hide(), this.container.appendChild(C.iframe), await C.load(A), this.pool.set(f, C);
@@ -4723,17 +4731,17 @@ class $i {
4723
4731
  l(f);
4724
4732
  }
4725
4733
  const m = this.pool.get(s);
4726
- ((m == null ? void 0 : m.source) !== ((M = this._currentFrame) == null ? void 0 : M.source) || i) && (await ((B = this._currentFrame) == null ? void 0 : B.hide()), m && await m.load(A), m && await m.show(e.locations.progression), this._currentFrame = m), a();
4734
+ ((m == null ? void 0 : m.source) !== ((M = this._currentFrame) == null ? void 0 : M.source) || n) && (await ((B = this._currentFrame) == null ? void 0 : B.hide()), m && await m.load(A), m && await m.show(e.locations.progression), this._currentFrame = m), a();
4727
4735
  });
4728
4736
  this.inprogress.set(s, o), await o, this.inprogress.delete(s);
4729
4737
  }
4730
4738
  setCSSProperties(t) {
4731
- if (!((A, i) => {
4732
- const r = Object.keys(A), s = Object.keys(i);
4739
+ if (!((A, n) => {
4740
+ const r = Object.keys(A), s = Object.keys(n);
4733
4741
  if (r.length !== s.length)
4734
4742
  return !1;
4735
4743
  for (const o of r)
4736
- if (A[o] !== i[o])
4744
+ if (A[o] !== n[o])
4737
4745
  return !1;
4738
4746
  return !0;
4739
4747
  })(this.currentCssProperties || {}, t)) {
@@ -4774,7 +4782,7 @@ class tn {
4774
4782
  this.currModules = [], this.cachedPage = void 0, this.peripherals = t, this.debugHref = A, this.frame = document.createElement("iframe"), this.frame.classList.add("readium-navigator-iframe"), this.frame.classList.add("blank"), this.frame.scrolling = "no", this.frame.style.visibility = "hidden", this.frame.style.setProperty("aria-hidden", "true"), this.frame.style.display = "none", this.frame.style.position = "absolute", this.frame.style.pointerEvents = "none", this.frame.style.transformOrigin = "0 0", this.frame.style.transform = "scale(1)", this.frame.style.background = "#fff", this.frame.style.touchAction = "none", this.frame.dataset.originalHref = A, this.source = "about:blank", this.wrapper = document.createElement("div"), this.wrapper.style.position = "relative", this.wrapper.style.float = this.wrapper.style.cssFloat = e === w.rtl ? "right" : "left", this.wrapper.appendChild(this.frame);
4775
4783
  }
4776
4784
  async load(t, e) {
4777
- return this.source === e && this.loadPromise && [...this.currModules].sort().join("|") === [...t].sort().join("|") ? this.loadPromise : (this.loaded && this.source !== e && this.window.stop(), this.source = e, this.loadPromise = new Promise((A, i) => {
4785
+ return this.source === e && this.loadPromise && [...this.currModules].sort().join("|") === [...t].sort().join("|") ? this.loadPromise : (this.loaded && this.source !== e && this.window.stop(), this.source = e, this.loadPromise = new Promise((A, n) => {
4778
4786
  var r;
4779
4787
  if (this.loader && this.loaded) {
4780
4788
  const s = this.frame.contentWindow;
@@ -4801,7 +4809,7 @@ class tn {
4801
4809
  }
4802
4810
  }, { once: !0 }), this.frame.addEventListener("error", (s) => {
4803
4811
  try {
4804
- i(s.error), this.loadPromise = void 0;
4812
+ n(s.error), this.loadPromise = void 0;
4805
4813
  } catch {
4806
4814
  }
4807
4815
  }, { once: !0 }), this.frame.style.removeProperty("display"), this.frame.contentWindow.location.replace(this.source);
@@ -4814,9 +4822,9 @@ class tn {
4814
4822
  );
4815
4823
  if (e) {
4816
4824
  const A = /(\w+) *= *([^\s,]+)/g;
4817
- let i, r = 0, s = 0;
4818
- for (; i = A.exec(e.content); )
4819
- i[1] === "width" ? r = Number.parseFloat(i[2]) : i[1] === "height" && (s = Number.parseFloat(i[2]));
4825
+ let n, r = 0, s = 0;
4826
+ for (; n = A.exec(e.content); )
4827
+ n[1] === "width" ? r = Number.parseFloat(n[2]) : n[1] === "height" && (s = Number.parseFloat(n[2]));
4820
4828
  if (r > 0 && s > 0)
4821
4829
  return { width: r, height: s };
4822
4830
  }
@@ -4832,12 +4840,12 @@ class tn {
4832
4840
  this.frame.style.height = `${e.height}px`, this.frame.style.width = `${e.width}px`;
4833
4841
  const A = Math.min(this.wrapper.clientWidth / e.width, this.wrapper.clientHeight / e.height);
4834
4842
  this.frame.style.transform = `scale(${A})`;
4835
- const i = this.frame.getBoundingClientRect(), r = this.wrapper.clientHeight - i.height;
4843
+ const n = this.frame.getBoundingClientRect(), r = this.wrapper.clientHeight - n.height;
4836
4844
  if (this.frame.style.top = `${r / 2}px`, t === J.left) {
4837
- const s = this.wrapper.clientWidth - i.width;
4845
+ const s = this.wrapper.clientWidth - n.width;
4838
4846
  this.frame.style.left = `${s}px`;
4839
4847
  } else if (t === J.center) {
4840
- const s = this.wrapper.clientWidth - i.width;
4848
+ const s = this.wrapper.clientWidth - n.width;
4841
4849
  this.frame.style.left = `${s / 2}px`;
4842
4850
  } else
4843
4851
  this.frame.style.left = "0px";
@@ -4850,7 +4858,7 @@ class tn {
4850
4858
  async unload() {
4851
4859
  var t, e;
4852
4860
  if (this.loaded)
4853
- return this.deselect(), this.frame.style.visibility = "hidden", this.frame.style.setProperty("aria-hidden", "true"), this.frame.style.pointerEvents = "none", this.frame.classList.add("blank"), this.frame.classList.remove("loaded"), (t = this.comms) == null || t.halt(), (e = this.loader) == null || e.destroy(), this.comms = void 0, this.frame.blur(), new Promise((A, i) => {
4861
+ return this.deselect(), this.frame.style.visibility = "hidden", this.frame.style.setProperty("aria-hidden", "true"), this.frame.style.pointerEvents = "none", this.frame.classList.add("blank"), this.frame.classList.remove("loaded"), (t = this.comms) == null || t.halt(), (e = this.loader) == null || e.destroy(), this.comms = void 0, this.frame.blur(), new Promise((A, n) => {
4854
4862
  this.frame.addEventListener("load", () => {
4855
4863
  try {
4856
4864
  this.showPromise = void 0, A();
@@ -4858,7 +4866,7 @@ class tn {
4858
4866
  }
4859
4867
  }, { once: !0 }), this.frame.addEventListener("error", (r) => {
4860
4868
  try {
4861
- this.showPromise = void 0, i(r.error);
4869
+ this.showPromise = void 0, n(r.error);
4862
4870
  } catch {
4863
4871
  }
4864
4872
  }, { once: !0 }), this.source = "about:blank", this.frame.contentWindow.location.replace("about:blank"), this.frame.style.display = "none";
@@ -4872,8 +4880,8 @@ class tn {
4872
4880
  var t;
4873
4881
  if (this.frame.parentElement)
4874
4882
  return this.comms === void 0 ? void 0 : new Promise((e, A) => {
4875
- var i;
4876
- (i = this.comms) == null || i.send("unfocus", void 0, (r) => {
4883
+ var n;
4884
+ (n = this.comms) == null || n.send("unfocus", void 0, (r) => {
4877
4885
  var s;
4878
4886
  (s = this.comms) == null || s.halt(), this.showPromise = void 0, e();
4879
4887
  });
@@ -4890,7 +4898,7 @@ class tn {
4890
4898
  return;
4891
4899
  }
4892
4900
  return this.showPromise ? (this.cachedPage !== t && (this.update(t), this.cachedPage = t), this.showPromise) : (this.cachedPage = t, this.comms ? this.comms.resume() : this.comms = new $t(this.frame.contentWindow, this.source), this.showPromise = new Promise((e, A) => {
4893
- this.comms.send("focus", void 0, (i) => {
4901
+ this.comms.send("focus", void 0, (n) => {
4894
4902
  this.update(this.cachedPage), e();
4895
4903
  });
4896
4904
  }), this.showPromise);
@@ -4943,7 +4951,7 @@ class tn {
4943
4951
  return this.loader;
4944
4952
  }
4945
4953
  }
4946
- var en = /* @__PURE__ */ ((n) => (n[n.Left = 0] = "Left", n[n.Center = 1] = "Center", n[n.Right = 2] = "Right", n))(en || {}), An = /* @__PURE__ */ ((n) => (n[n.Top = 0] = "Top", n[n.Middle = 1] = "Middle", n[n.Bottom = 2] = "Bottom", n))(An || {});
4954
+ var en = /* @__PURE__ */ ((i) => (i[i.Left = 0] = "Left", i[i.Center = 1] = "Center", i[i.Right = 2] = "Right", i))(en || {}), An = /* @__PURE__ */ ((i) => (i[i.Top = 0] = "Top", i[i.Middle = 1] = "Middle", i[i.Bottom = 2] = "Bottom", i))(An || {});
4947
4955
  class nn {
4948
4956
  constructor() {
4949
4957
  this.outerWidth = 0, this.outerHeight = 0, this.HTML = document.documentElement, this.Head = document.head, this.Body = document.body;
@@ -4952,21 +4960,21 @@ class nn {
4952
4960
  It.OS.iOS || (this.outerHeight = window.outerHeight - window.innerHeight, It.OS.Android && It.UA.Chrome && window.screen.height > window.innerHeight && (this.outerHeight = (window.screen.height - window.innerHeight) / 1.5), this.outerWidth = window.outerWidth - window.innerWidth);
4953
4961
  }
4954
4962
  getBibiEventCoord(t, e = 0) {
4955
- var i;
4963
+ var n;
4956
4964
  const A = { X: 0, Y: 0 };
4957
- return /^touch/.test(t.type) ? (A.X = t.touches[e].screenX, A.Y = t.touches[e].screenY) : (A.X = t.screenX, A.Y = t.screenY), (((i = t.target.ownerDocument) == null ? void 0 : i.documentElement) || t.target.documentElement) === this.HTML && (A.X -= this.HTML.scrollLeft + this.Body.scrollLeft, A.Y -= this.HTML.scrollTop + this.Body.scrollTop), A.X -= this.outerWidth, A.Y -= this.outerHeight, A;
4965
+ return /^touch/.test(t.type) ? (A.X = t.touches[e].screenX, A.Y = t.touches[e].screenY) : (A.X = t.screenX, A.Y = t.screenY), (((n = t.target.ownerDocument) == null ? void 0 : n.documentElement) || t.target.documentElement) === this.HTML && (A.X -= this.HTML.scrollLeft + this.Body.scrollLeft, A.Y -= this.HTML.scrollTop + this.Body.scrollTop), A.X -= this.outerWidth, A.Y -= this.outerHeight, A;
4958
4966
  }
4959
4967
  getTouchDistance(t) {
4960
4968
  if (t.touches.length !== 2)
4961
4969
  return 0;
4962
- const e = t.touches[0].screenX - this.outerWidth, A = t.touches[0].screenY - this.outerHeight, i = t.touches[1].screenX - this.outerWidth, r = t.touches[1].screenY - this.outerHeight;
4963
- return Math.sqrt(Math.pow(i - e, 2) + Math.pow(r - A, 2));
4970
+ const e = t.touches[0].screenX - this.outerWidth, A = t.touches[0].screenY - this.outerHeight, n = t.touches[1].screenX - this.outerWidth, r = t.touches[1].screenY - this.outerHeight;
4971
+ return Math.sqrt(Math.pow(n - e, 2) + Math.pow(r - A, 2));
4964
4972
  }
4965
4973
  getTouchCenter(t) {
4966
4974
  if (t.touches.length !== 2)
4967
4975
  return null;
4968
- const e = this.HTML.scrollLeft + this.Body.scrollLeft, A = this.HTML.scrollTop + this.Body.scrollTop, i = t.touches[0].screenX - this.outerWidth - e, r = t.touches[0].screenY - this.outerHeight - A, s = t.touches[1].screenX - this.outerWidth - e, o = t.touches[1].screenY - this.outerHeight - A;
4969
- return { X: (i + s) / 2, Y: (r + o) / 2 };
4976
+ const e = this.HTML.scrollLeft + this.Body.scrollLeft, A = this.HTML.scrollTop + this.Body.scrollTop, n = t.touches[0].screenX - this.outerWidth - e, r = t.touches[0].screenY - this.outerHeight - A, s = t.touches[1].screenX - this.outerWidth - e, o = t.touches[1].screenY - this.outerHeight - A;
4977
+ return { X: (n + s) / 2, Y: (r + o) / 2 };
4970
4978
  }
4971
4979
  getBibiEvent(t) {
4972
4980
  if (!t)
@@ -4978,7 +4986,7 @@ class nn {
4978
4986
  };
4979
4987
  const e = this.getBibiEventCoord(t);
4980
4988
  let A = 0.3;
4981
- const i = {
4989
+ const n = {
4982
4990
  X: e.X / window.innerWidth,
4983
4991
  Y: e.Y / window.innerHeight
4984
4992
  };
@@ -4988,10 +4996,10 @@ class nn {
4988
4996
  X: null,
4989
4997
  Y: null
4990
4998
  };
4991
- return i.X < o ? l.X = 0 : a < i.X ? l.X = 2 : l.X = 1, i.Y < r ? l.Y = 0 : s < i.Y ? l.Y = 2 : l.Y = 1, {
4999
+ return n.X < o ? l.X = 0 : a < n.X ? l.X = 2 : l.X = 1, n.Y < r ? l.Y = 0 : s < n.Y ? l.Y = 2 : l.Y = 1, {
4992
5000
  Target: t.target,
4993
5001
  Coord: e,
4994
- Ratio: i,
5002
+ Ratio: n,
4995
5003
  Division: l
4996
5004
  };
4997
5005
  }
@@ -5014,7 +5022,7 @@ class rn {
5014
5022
  return this._DOM;
5015
5023
  }
5016
5024
  }
5017
- const He = 6, kt = 1.02, ke = 50;
5025
+ const Ge = 6, kt = 1.02, He = 50;
5018
5026
  class sn {
5019
5027
  constructor(t, e = !1) {
5020
5028
  this.dragState = 0, this.minimumMoved = !1, this.pan = {
@@ -5095,7 +5103,7 @@ class sn {
5095
5103
  * touchstart event handler
5096
5104
  */
5097
5105
  touchstartHandler(t) {
5098
- var i, r;
5106
+ var n, r;
5099
5107
  if (["TEXTAREA", "OPTION", "INPUT", "SELECT"].indexOf(t.target.nodeName) !== -1)
5100
5108
  return;
5101
5109
  switch (t.stopPropagation(), this.frameBounds = this.manager.currentBounds, this.coordinator.refreshOuterPixels(this.frameBounds), t.touches.length) {
@@ -5104,7 +5112,7 @@ class sn {
5104
5112
  case 2: {
5105
5113
  t.preventDefault(), this.pinch.startDistance = this.coordinator.getTouchDistance(t);
5106
5114
  const s = this.startTouch(t);
5107
- this.pan.startX = s.X, this.pan.startY = s.Y, this.dragState = 2, this.manager.updateBookStyle(!0), this.isScaled ? (this.pinch.target.X -= this.pan.translateX * (this.pinch.startScale / this.scale), this.pinch.target.Y -= this.pan.translateY * (this.pinch.startScale / this.scale), this.pinch.target = { X: 0, Y: 0 }, this.pinch.startScale = 1 / this.scale) : (this.pinch.target = { X: 0, Y: 0 }, this.pinch.startScale = this.scale), this.pinch.startTranslate = { X: this.pan.translateX, Y: this.pan.translateY }, (i = this.debugger) != null && i.show && (this.debugger.DOM.touch2.style.display = "", this.debugger.DOM.center.style.display = "", this.debugger.DOM.pinchTarget.style.display = "");
5115
+ this.pan.startX = s.X, this.pan.startY = s.Y, this.dragState = 2, this.manager.updateBookStyle(!0), this.isScaled ? (this.pinch.target.X -= this.pan.translateX * (this.pinch.startScale / this.scale), this.pinch.target.Y -= this.pan.translateY * (this.pinch.startScale / this.scale), this.pinch.target = { X: 0, Y: 0 }, this.pinch.startScale = 1 / this.scale) : (this.pinch.target = { X: 0, Y: 0 }, this.pinch.startScale = this.scale), this.pinch.startTranslate = { X: this.pan.translateX, Y: this.pan.translateY }, (n = this.debugger) != null && n.show && (this.debugger.DOM.touch2.style.display = "", this.debugger.DOM.center.style.display = "", this.debugger.DOM.pinchTarget.style.display = "");
5108
5116
  return;
5109
5117
  }
5110
5118
  case 1:
@@ -5130,11 +5138,11 @@ class sn {
5130
5138
  touchendHandler(t) {
5131
5139
  var e, A;
5132
5140
  if (t.stopPropagation(), !t.touches || t.touches.length === 0)
5133
- this.pan.endX && !this.isScaled ? (this.pinch.touchN && (this.pan.endX = this.pan.startX), this.updateAfterDrag()) : !this.pinch.touchN && Math.abs(this.pan.overscrollX) > ke && Math.abs(this.pan.overscrollY) < ke / 2 && (this.pan.startX = 0, this.pan.endX = -this.pan.overscrollX, this.updateAfterDrag()), this.dragState = 0, this.minimumMoved = !1, this.clearPinch(), (e = this.debugger) != null && e.show && (this.debugger.DOM.center.style.display = "none", this.debugger.DOM.touch1.style.display = "none", this.debugger.DOM.touch2.style.display = "none");
5141
+ this.pan.endX && !this.isScaled ? (this.pinch.touchN && (this.pan.endX = this.pan.startX), this.updateAfterDrag()) : !this.pinch.touchN && Math.abs(this.pan.overscrollX) > He && Math.abs(this.pan.overscrollY) < He / 2 && (this.pan.startX = 0, this.pan.endX = -this.pan.overscrollX, this.updateAfterDrag()), this.dragState = 0, this.minimumMoved = !1, this.clearPinch(), (e = this.debugger) != null && e.show && (this.debugger.DOM.center.style.display = "none", this.debugger.DOM.touch1.style.display = "none", this.debugger.DOM.touch2.style.display = "none");
5134
5142
  else if (t.touches.length === 1) {
5135
5143
  this.dragState = 1, t.touches[0].identifier !== this.pan.touchID && (this.pan.touchID = t.touches[0].identifier), (A = this.debugger) != null && A.show && (this.debugger.DOM.center.style.display = "none", this.debugger.DOM.touch2.style.display = "none", this.debugger.DOM.pinchTarget.style.display = "none");
5136
- const i = this.startTouch(t);
5137
- this.pan.startX = i.X, this.pan.startY = i.Y;
5144
+ const n = this.startTouch(t);
5145
+ this.pan.startX = n.X, this.pan.startY = n.Y;
5138
5146
  }
5139
5147
  window.setTimeout(() => {
5140
5148
  this.manager.updateBookStyle(!0), this.dragState === 0 && (this.scale < kt && (this.pan.translateX = 0, this.pan.translateY = 0), this.clearPan()), this.manager.updateBookStyle(!0);
@@ -5149,13 +5157,13 @@ class sn {
5149
5157
  const e = this.coordinator.getBibiEventCoord(t);
5150
5158
  Math.abs(this.pan.startY - e.Y) + Math.abs(this.pan.startX - e.X) > 5 && (this.minimumMoved || (this.manager.deselect(), this.minimumMoved = !0), this.dragState < 1 && (this.dragState = 1));
5151
5159
  const A = (s = this.coordinator) == null ? void 0 : s.getTouchDistance(t);
5152
- let i = !1;
5160
+ let n = !1;
5153
5161
  const r = this.scale;
5154
5162
  if (this.dragState === 2 && A) {
5155
5163
  if (this.pinch.touchN++, this.pinch.touchN < 4)
5156
5164
  return;
5157
5165
  let c = A / this.pinch.startDistance * this.scale;
5158
- c >= He && (c = He), c <= kt && (c = 1), this.scale = c, this.pinch.startDistance = A, i = !0;
5166
+ c >= Ge && (c = Ge), c <= kt && (c = 1), this.scale = c, this.pinch.startDistance = A, n = !0;
5159
5167
  }
5160
5168
  if (this.pan.letItGo === !1 && (this.pan.letItGo = Math.abs(this.pan.startY - e.Y) < Math.abs(this.pan.startX - e.X)), (o = this.debugger) != null && o.show && (this.debugger.DOM.touch1.style.top = `${e.Y - 10}px`, this.debugger.DOM.touch1.style.left = `${e.X - 10}px`, this.debugger.DOM.touch1.innerText = `${e.X.toFixed(2)},${e.Y.toFixed(2)}`), this.dragState > 0 && this.isScaled || this.dragState > 1) {
5161
5169
  if (this.dragState === 1) {
@@ -5180,12 +5188,12 @@ class sn {
5180
5188
  this.pan.translateX = f, this.pan.translateY = I, (l = this.debugger) != null && l.show && (this.debugger.DOM.pinchTarget.style.left = `${this.pinch.target.X * this.scale / this.pinch.startScale - 5 + this.manager.width / 2}px`, this.debugger.DOM.pinchTarget.style.top = `${this.pinch.target.Y * this.scale / this.pinch.startScale - 5 + this.manager.height / 2}px`, this.debugger.DOM.pinchTarget.innerText = `${(this.pinch.target.X * this.scale / this.pinch.startScale).toFixed(2)},${(this.pinch.target.Y * this.scale / this.pinch.startScale).toFixed(2)}`);
5181
5189
  }
5182
5190
  const c = this.frameBounds.width / 6, g = this.frameBounds.height / 6;
5183
- this.pan.translateX < -c && (this.pan.overscrollX = -(c + this.pan.translateX), this.pan.translateX = -c), this.pan.translateY < -g && (this.pan.overscrollY = -(g + this.pan.translateY), this.pan.translateY = -g), this.pan.translateX > c && (this.pan.overscrollX = c - this.pan.translateX, this.pan.translateX = c), this.pan.translateY > g && (this.pan.overscrollY = g - this.pan.translateY, this.pan.translateY = g), i = !0, (h = this.debugger) != null && h.show && (this.debugger.DOM.stats.innerText = `TX: ${this.pan.translateX.toFixed(2)}
5191
+ this.pan.translateX < -c && (this.pan.overscrollX = -(c + this.pan.translateX), this.pan.translateX = -c), this.pan.translateY < -g && (this.pan.overscrollY = -(g + this.pan.translateY), this.pan.translateY = -g), this.pan.translateX > c && (this.pan.overscrollX = c - this.pan.translateX, this.pan.translateX = c), this.pan.translateY > g && (this.pan.overscrollY = g - this.pan.translateY, this.pan.translateY = g), n = !0, (h = this.debugger) != null && h.show && (this.debugger.DOM.stats.innerText = `TX: ${this.pan.translateX.toFixed(2)}
5184
5192
  TY: ${this.pan.translateY.toFixed(2)}
5185
5193
  Zoom: ${this.scale.toFixed(2)}
5186
5194
  Overscroll: ${this.pan.overscrollX.toFixed(2)},${this.pan.overscrollY.toFixed(2)}`);
5187
5195
  }
5188
- if (i) {
5196
+ if (n) {
5189
5197
  this.manager.updateBookStyle();
5190
5198
  return;
5191
5199
  }
@@ -5243,10 +5251,10 @@ class on {
5243
5251
  this.shift = !0, this.spreads = [], this.nLandscape = 0, this.index(t), this.testShift(t), console.log(`Indexed ${this.spreads.length} spreads for ${t.readingOrder.items.length} items`);
5244
5252
  }
5245
5253
  index(t, e = !1) {
5246
- this.nLandscape = 0, t.readingOrder.items.forEach((A, i) => {
5254
+ this.nLandscape = 0, t.readingOrder.items.forEach((A, n) => {
5247
5255
  var s, o, a, l, h;
5248
- e || (t.readingOrder.items[i] = A.addProperties({
5249
- number: i + 1,
5256
+ e || (t.readingOrder.items[n] = A.addProperties({
5257
+ number: n + 1,
5250
5258
  isImage: ((s = A.type) == null ? void 0 : s.indexOf("image/")) === 0
5251
5259
  }));
5252
5260
  const r = ((o = A.properties) == null ? void 0 : o.getOrientation()) === it.landscape;
@@ -5256,26 +5264,26 @@ class on {
5256
5264
  "center"
5257
5265
  ) : (
5258
5266
  // Center it
5259
- ((this.shift ? 0 : 1) + i - this.nLandscape) % 2 ? t.metadata.readingProgression === w.rtl ? "right" : "left" : t.metadata.readingProgression === w.rtl ? "left" : "right"
5267
+ ((this.shift ? 0 : 1) + n - this.nLandscape) % 2 ? t.metadata.readingProgression === w.rtl ? "right" : "left" : t.metadata.readingProgression === w.rtl ? "left" : "right"
5260
5268
  )
5261
5269
  })), (r || (h = A.properties) != null && h.otherProperties.addBlank) && this.nLandscape++;
5262
5270
  }), e && (this.spreads = []), this.buildSpreads(t.readingOrder);
5263
5271
  }
5264
5272
  testShift(t) {
5265
5273
  let e = !1;
5266
- this.spreads.forEach((A, i) => {
5274
+ this.spreads.forEach((A, n) => {
5267
5275
  var o, a, l, h, c;
5268
5276
  if (A.length > 1)
5269
5277
  return;
5270
5278
  const r = A[0], s = (o = r.properties) == null ? void 0 : o.getOrientation();
5271
- i === 0 && (s === it.landscape || s !== it.portrait && ((r.width || 0) > (r.height || 0) || ((a = r.properties) == null ? void 0 : a.getSpread()) === Ut.both)) && (this.shift = !1), e && ((l = r.properties) == null ? void 0 : l.getPage()) === J.center && this.spreads[i - 1][0].addProperties({ addBlank: !0 }), s === it.portrait && ((h = r.properties) == null ? void 0 : h.getPage()) !== "center" && ((c = r.properties) == null ? void 0 : c.otherProperties.number) > 1 ? e = !0 : e = !1;
5279
+ n === 0 && (s === it.landscape || s !== it.portrait && ((r.width || 0) > (r.height || 0) || ((a = r.properties) == null ? void 0 : a.getSpread()) === Ut.both)) && (this.shift = !1), e && ((l = r.properties) == null ? void 0 : l.getPage()) === J.center && this.spreads[n - 1][0].addProperties({ addBlank: !0 }), s === it.portrait && ((h = r.properties) == null ? void 0 : h.getPage()) !== "center" && ((c = r.properties) == null ? void 0 : c.otherProperties.number) > 1 ? e = !0 : e = !1;
5272
5280
  }), this.shift || this.index(t, !0);
5273
5281
  }
5274
5282
  buildSpreads(t) {
5275
5283
  let e = [];
5276
- t.items.forEach((A, i) => {
5284
+ t.items.forEach((A, n) => {
5277
5285
  var r;
5278
- !i && this.shift ? this.spreads.push([A]) : ((r = A.properties) == null ? void 0 : r.getPage()) === J.center ? (e.length > 0 && this.spreads.push(e), this.spreads.push([A]), e = []) : e.length >= 2 ? (this.spreads.push(e), e = [A]) : e.push(A);
5286
+ !n && this.shift ? this.spreads.push([A]) : ((r = A.properties) == null ? void 0 : r.getPage()) === J.center ? (e.length > 0 && this.spreads.push(e), this.spreads.push([A]), e = []) : e.length >= 2 ? (this.spreads.push(e), e = [A]) : e.push(A);
5279
5287
  }), e.length > 0 && this.spreads.push(e);
5280
5288
  }
5281
5289
  currentSpread(t, e) {
@@ -5285,11 +5293,11 @@ class on {
5285
5293
  return this.spreads.find((e) => e.includes(t)) || void 0;
5286
5294
  }
5287
5295
  }
5288
- const Je = 8, We = 5, an = 300, ln = 15e3, hn = 250, cn = 150, gn = 500;
5296
+ const ke = 8, Je = 5, an = 300, ln = 15e3, hn = 250, cn = 150, gn = 500;
5289
5297
  class dn {
5290
5298
  constructor(t, e, A) {
5291
- var i;
5292
- if (this.pool = /* @__PURE__ */ new Map(), this.blobs = /* @__PURE__ */ new Map(), this.inprogress = /* @__PURE__ */ new Map(), this.delayedShow = /* @__PURE__ */ new Map(), this.delayedTimeout = /* @__PURE__ */ new Map(), this.previousFrames = [], this.width = 0, this.height = 0, this.transform = "", this.currentSlide = 0, this.spread = !0, this.orientationInternal = -1, this.container = t, this.positions = e, this.pub = A, this.spreadPresentation = ((i = A.metadata.getPresentation()) == null ? void 0 : i.spread) || Ut.auto, this.pub.metadata.effectiveReadingProgression !== w.rtl && this.pub.metadata.effectiveReadingProgression !== w.ltr)
5299
+ var n;
5300
+ if (this.pool = /* @__PURE__ */ new Map(), this.blobs = /* @__PURE__ */ new Map(), this.inprogress = /* @__PURE__ */ new Map(), this.delayedShow = /* @__PURE__ */ new Map(), this.delayedTimeout = /* @__PURE__ */ new Map(), this.previousFrames = [], this.width = 0, this.height = 0, this.transform = "", this.currentSlide = 0, this.spread = !0, this.orientationInternal = -1, this.container = t, this.positions = e, this.pub = A, this.spreadPresentation = ((n = A.metadata.getPresentation()) == null ? void 0 : n.spread) || Ut.auto, this.pub.metadata.effectiveReadingProgression !== w.rtl && this.pub.metadata.effectiveReadingProgression !== w.ltr)
5293
5301
  throw Error("Unsupported reading progression for EPUB");
5294
5302
  this.spreader = new on(this.pub), this.containerHeightCached = t.clientHeight, this.bookElement = document.createElement("div"), this.bookElement.ariaLabel = "Book", this.bookElement.tabIndex = -1, this.updateBookStyle(!0), this.spineElement = document.createElement("div"), this.spineElement.ariaLabel = "Spine", this.bookElement.appendChild(this.spineElement), this.container.appendChild(this.bookElement), this.updateSpineStyle(!0), this.peripherals = new sn(this), this.pub.readingOrder.items.forEach((r) => {
5295
5303
  var o, a;
@@ -5311,9 +5319,9 @@ class dn {
5311
5319
  */
5312
5320
  resizeHandler(t = !0, e = !0) {
5313
5321
  this.currentSlide + this.perPage > this.length && (this.currentSlide = this.length <= this.perPage ? 0 : this.length - 1), this.containerHeightCached = this.container.clientHeight, this.orientationInternal = -1, this.updateSpineStyle(!0), t && (this.currentSlide = this.reAlign(), this.slideToCurrent(!e, e)), clearTimeout(this.resizeTimeout), this.resizeTimeout = window.setTimeout(() => {
5314
- this.pool.forEach((A, i) => {
5322
+ this.pool.forEach((A, n) => {
5315
5323
  var a, l;
5316
- let r = this.pub.readingOrder.items.findIndex((h) => h.href === i);
5324
+ let r = this.pub.readingOrder.items.findIndex((h) => h.href === n);
5317
5325
  const s = this.pub.readingOrder.items[r];
5318
5326
  if (A.width = 100 / this.length * (((a = s.properties) == null ? void 0 : a.getOrientation()) === it.landscape || (l = s.properties) != null && l.otherProperties.addBlank ? this.perPage : 1), A.height = this.height, !A.loaded)
5319
5327
  return;
@@ -5346,7 +5354,7 @@ class dn {
5346
5354
  updateSpineStyle(t, e = !0) {
5347
5355
  let A = "0";
5348
5356
  this.updateDimensions(), this.perPage > 1 && (A = `${this.width / 2}px`);
5349
- const i = {
5357
+ const n = {
5350
5358
  transition: t ? `all ${e ? cn : gn}ms ease-out` : "all 0ms ease-out",
5351
5359
  marginRight: this.rtl ? A : "0",
5352
5360
  marginLeft: this.rtl ? "0" : A,
@@ -5355,12 +5363,12 @@ class dn {
5355
5363
  // Static (should be moved to CSS)
5356
5364
  contain: "content"
5357
5365
  };
5358
- Object.assign(this.spineElement.style, i);
5366
+ Object.assign(this.spineElement.style, n);
5359
5367
  }
5360
5368
  updateBookStyle(t = !1) {
5361
5369
  var e, A;
5362
5370
  if (t) {
5363
- const i = {
5371
+ const n = {
5364
5372
  overflow: "hidden",
5365
5373
  direction: this.pub.metadata.effectiveReadingProgression,
5366
5374
  cursor: "",
@@ -5374,7 +5382,7 @@ class dn {
5374
5382
  transition: (e = this.peripherals) != null && e.dragState ? "none" : "transform .15s ease-in-out",
5375
5383
  touchAction: "none"
5376
5384
  };
5377
- Object.assign(this.bookElement.style, i);
5385
+ Object.assign(this.bookElement.style, n);
5378
5386
  }
5379
5387
  this.bookElement.style.transform = `scale(${((A = this.peripherals) == null ? void 0 : A.scale) || 1})` + (this.peripherals ? ` translate3d(${this.peripherals.pan.translateX}px, ${this.peripherals.pan.translateY}px, 0px)` : "");
5380
5388
  }
@@ -5470,9 +5478,9 @@ class dn {
5470
5478
  for (; e.value; )
5471
5479
  A.push(e.value), e = t.next();
5472
5480
  A.length > 0 && await Promise.allSettled(A), this.inprogress.clear();
5473
- let i = this.pool.values(), r = i.next();
5481
+ let n = this.pool.values(), r = n.next();
5474
5482
  for (; r.value; )
5475
- await r.value.destroy(), r = i.next();
5483
+ await r.value.destroy(), r = n.next();
5476
5484
  this.pool.clear(), this.blobs.forEach((s) => URL.revokeObjectURL(s)), this.container.childNodes.forEach((s) => {
5477
5485
  (s.nodeType === Node.ELEMENT_NODE || s.nodeType === Node.TEXT_NODE) && s.remove();
5478
5486
  });
@@ -5498,7 +5506,7 @@ class dn {
5498
5506
  e > 0 && clearTimeout(e), this.delayedShow.delete(t);
5499
5507
  }
5500
5508
  }
5501
- async update(t, e, A, i = !1) {
5509
+ async update(t, e, A, n = !1) {
5502
5510
  let r = this.pub.readingOrder.items.findIndex((a) => a.href === e.href);
5503
5511
  if (r < 0)
5504
5512
  throw Error("Href not found in reading order");
@@ -5510,7 +5518,7 @@ class dn {
5510
5518
  const o = new Promise(async (a, l) => {
5511
5519
  const h = [], c = [];
5512
5520
  this.positions.forEach((M, B) => {
5513
- (B > r + Je || B < r - Je) && (h.includes(M.href) || h.push(M.href)), B < r + We && B > r - We && (c.includes(M.href) || c.push(M.href));
5521
+ (B > r + ke || B < r - ke) && (h.includes(M.href) || h.push(M.href)), B < r + Je && B > r - Je && (c.includes(M.href) || c.push(M.href));
5514
5522
  }), h.forEach(async (M) => {
5515
5523
  var B;
5516
5524
  c.includes(M) || this.pool.has(M) && (this.cancelShowing(M), await ((B = this.pool.get(M)) == null ? void 0 : B.unload()));
@@ -5519,14 +5527,14 @@ class dn {
5519
5527
  const B = t.readingOrder.findIndexWithHref(M), f = t.readingOrder.items[B];
5520
5528
  if (f) {
5521
5529
  if (!this.blobs.has(M)) {
5522
- const C = await new sA(t, this.currentBaseURL || "", f).build(!0);
5530
+ const C = await new rA(t, this.currentBaseURL || "", f).build(!0);
5523
5531
  this.blobs.set(M, C);
5524
5532
  }
5525
5533
  this.delayedShow.has(M) || this.delayedShow.set(M, new Promise((I, C) => {
5526
5534
  let E = !1;
5527
5535
  const F = window.setTimeout(async () => {
5528
5536
  this.delayedTimeout.set(M, 0);
5529
- const T = this.makeSpread(this.reAlign(B)), ft = this.spreadPosition(T, f), gt = this.pool.get(M);
5537
+ const j = this.makeSpread(this.reAlign(B)), ft = this.spreadPosition(j, f), gt = this.pool.get(M);
5530
5538
  await gt.load(A, this.blobs.get(M)), this.peripherals.isScaled || await gt.show(ft), this.delayedShow.delete(M), E = !0, I();
5531
5539
  }, an);
5532
5540
  setTimeout(() => {
@@ -5596,13 +5604,13 @@ class dn {
5596
5604
  }), t.positions = this.getCurrentNumbers(), t;
5597
5605
  }
5598
5606
  getCurrentNumbers() {
5599
- var e, A, i, r;
5607
+ var e, A, n, r;
5600
5608
  if (this.perPage < 2)
5601
5609
  return [(e = this.pub.readingOrder.items[this.currentSlide].properties) == null ? void 0 : e.otherProperties.number];
5602
5610
  const t = this.spreader.currentSpread(this.currentSlide, this.perPage);
5603
5611
  return t.length > 1 ? [
5604
5612
  (A = t[0].properties) == null ? void 0 : A.otherProperties.number,
5605
- (i = t[t.length - 1].properties) == null ? void 0 : i.otherProperties.number
5613
+ (n = t[t.length - 1].properties) == null ? void 0 : n.otherProperties.number
5606
5614
  ] : [(r = t[0].properties) == null ? void 0 : r.otherProperties.number];
5607
5615
  }
5608
5616
  deselect() {
@@ -5610,61 +5618,61 @@ class dn {
5610
5618
  (t = this.currentFrames) == null || t.forEach((e) => e == null ? void 0 : e.deselect());
5611
5619
  }
5612
5620
  }
5613
- function W(n) {
5614
- if (typeof n != "string")
5615
- throw new TypeError("Path must be a string. Received " + JSON.stringify(n));
5621
+ function W(i) {
5622
+ if (typeof i != "string")
5623
+ throw new TypeError("Path must be a string. Received " + JSON.stringify(i));
5616
5624
  }
5617
- function Le(n, t) {
5618
- for (var e = "", A = 0, i = -1, r = 0, s, o = 0; o <= n.length; ++o) {
5619
- if (o < n.length)
5620
- s = n.charCodeAt(o);
5625
+ function We(i, t) {
5626
+ for (var e = "", A = 0, n = -1, r = 0, s, o = 0; o <= i.length; ++o) {
5627
+ if (o < i.length)
5628
+ s = i.charCodeAt(o);
5621
5629
  else {
5622
5630
  if (s === 47)
5623
5631
  break;
5624
5632
  s = 47;
5625
5633
  }
5626
5634
  if (s === 47) {
5627
- if (!(i === o - 1 || r === 1))
5628
- if (i !== o - 1 && r === 2) {
5635
+ if (!(n === o - 1 || r === 1))
5636
+ if (n !== o - 1 && r === 2) {
5629
5637
  if (e.length < 2 || A !== 2 || e.charCodeAt(e.length - 1) !== 46 || e.charCodeAt(e.length - 2) !== 46) {
5630
5638
  if (e.length > 2) {
5631
5639
  var a = e.lastIndexOf("/");
5632
5640
  if (a !== e.length - 1) {
5633
- a === -1 ? (e = "", A = 0) : (e = e.slice(0, a), A = e.length - 1 - e.lastIndexOf("/")), i = o, r = 0;
5641
+ a === -1 ? (e = "", A = 0) : (e = e.slice(0, a), A = e.length - 1 - e.lastIndexOf("/")), n = o, r = 0;
5634
5642
  continue;
5635
5643
  }
5636
5644
  } else if (e.length === 2 || e.length === 1) {
5637
- e = "", A = 0, i = o, r = 0;
5645
+ e = "", A = 0, n = o, r = 0;
5638
5646
  continue;
5639
5647
  }
5640
5648
  }
5641
5649
  t && (e.length > 0 ? e += "/.." : e = "..", A = 2);
5642
5650
  } else
5643
- e.length > 0 ? e += "/" + n.slice(i + 1, o) : e = n.slice(i + 1, o), A = o - i - 1;
5644
- i = o, r = 0;
5651
+ e.length > 0 ? e += "/" + i.slice(n + 1, o) : e = i.slice(n + 1, o), A = o - n - 1;
5652
+ n = o, r = 0;
5645
5653
  } else
5646
5654
  s === 46 && r !== -1 ? ++r : r = -1;
5647
5655
  }
5648
5656
  return e;
5649
5657
  }
5650
- function un(n, t) {
5658
+ function un(i, t) {
5651
5659
  var e = t.dir || t.root, A = t.base || (t.name || "") + (t.ext || "");
5652
- return e ? e === t.root ? e + A : e + n + A : A;
5660
+ return e ? e === t.root ? e + A : e + i + A : A;
5653
5661
  }
5654
5662
  var at = {
5655
5663
  // path.resolve([from ...], to)
5656
5664
  resolve: function() {
5657
- for (var t = "", e = !1, A, i = arguments.length - 1; i >= -1 && !e; i--) {
5665
+ for (var t = "", e = !1, A, n = arguments.length - 1; n >= -1 && !e; n--) {
5658
5666
  var r;
5659
- i >= 0 ? r = arguments[i] : (A === void 0 && (A = process.cwd()), r = A), W(r), r.length !== 0 && (t = r + "/" + t, e = r.charCodeAt(0) === 47);
5667
+ n >= 0 ? r = arguments[n] : (A === void 0 && (A = process.cwd()), r = A), W(r), r.length !== 0 && (t = r + "/" + t, e = r.charCodeAt(0) === 47);
5660
5668
  }
5661
- return t = Le(t, !e), e ? t.length > 0 ? "/" + t : "/" : t.length > 0 ? t : ".";
5669
+ return t = We(t, !e), e ? t.length > 0 ? "/" + t : "/" : t.length > 0 ? t : ".";
5662
5670
  },
5663
5671
  normalize: function(t) {
5664
5672
  if (W(t), t.length === 0)
5665
5673
  return ".";
5666
5674
  var e = t.charCodeAt(0) === 47, A = t.charCodeAt(t.length - 1) === 47;
5667
- return t = Le(t, !e), t.length === 0 && !e && (t = "."), t.length > 0 && A && (t += "/"), e ? "/" + t : t;
5675
+ return t = We(t, !e), t.length === 0 && !e && (t = "."), t.length > 0 && A && (t += "/"), e ? "/" + t : t;
5668
5676
  },
5669
5677
  isAbsolute: function(t) {
5670
5678
  return W(t), t.length > 0 && t.charCodeAt(0) === 47;
@@ -5683,7 +5691,7 @@ var at = {
5683
5691
  return "";
5684
5692
  for (var A = 1; A < t.length && t.charCodeAt(A) === 47; ++A)
5685
5693
  ;
5686
- for (var i = t.length, r = i - A, s = 1; s < e.length && e.charCodeAt(s) === 47; ++s)
5694
+ for (var n = t.length, r = n - A, s = 1; s < e.length && e.charCodeAt(s) === 47; ++s)
5687
5695
  ;
5688
5696
  for (var o = e.length, a = o - s, l = r < a ? r : a, h = -1, c = 0; c <= l; ++c) {
5689
5697
  if (c === l) {
@@ -5702,8 +5710,8 @@ var at = {
5702
5710
  g === 47 && (h = c);
5703
5711
  }
5704
5712
  var M = "";
5705
- for (c = A + h + 1; c <= i; ++c)
5706
- (c === i || t.charCodeAt(c) === 47) && (M.length === 0 ? M += ".." : M += "/..");
5713
+ for (c = A + h + 1; c <= n; ++c)
5714
+ (c === n || t.charCodeAt(c) === 47) && (M.length === 0 ? M += ".." : M += "/..");
5707
5715
  return M.length > 0 ? M + e.slice(s + h) : (s += h, e.charCodeAt(s) === 47 && ++s, e.slice(s));
5708
5716
  },
5709
5717
  _makeLong: function(t) {
@@ -5712,21 +5720,21 @@ var at = {
5712
5720
  dirname: function(t) {
5713
5721
  if (W(t), t.length === 0)
5714
5722
  return ".";
5715
- for (var e = t.charCodeAt(0), A = e === 47, i = -1, r = !0, s = t.length - 1; s >= 1; --s)
5723
+ for (var e = t.charCodeAt(0), A = e === 47, n = -1, r = !0, s = t.length - 1; s >= 1; --s)
5716
5724
  if (e = t.charCodeAt(s), e === 47) {
5717
5725
  if (!r) {
5718
- i = s;
5726
+ n = s;
5719
5727
  break;
5720
5728
  }
5721
5729
  } else
5722
5730
  r = !1;
5723
- return i === -1 ? A ? "/" : "." : A && i === 1 ? "//" : t.slice(0, i);
5731
+ return n === -1 ? A ? "/" : "." : A && n === 1 ? "//" : t.slice(0, n);
5724
5732
  },
5725
5733
  basename: function(t, e) {
5726
5734
  if (e !== void 0 && typeof e != "string")
5727
5735
  throw new TypeError('"ext" argument must be a string');
5728
5736
  W(t);
5729
- var A = 0, i = -1, r = !0, s;
5737
+ var A = 0, n = -1, r = !0, s;
5730
5738
  if (e !== void 0 && e.length > 0 && e.length <= t.length) {
5731
5739
  if (e.length === t.length && e === t)
5732
5740
  return "";
@@ -5739,9 +5747,9 @@ var at = {
5739
5747
  break;
5740
5748
  }
5741
5749
  } else
5742
- a === -1 && (r = !1, a = s + 1), o >= 0 && (l === e.charCodeAt(o) ? --o === -1 && (i = s) : (o = -1, i = a));
5750
+ a === -1 && (r = !1, a = s + 1), o >= 0 && (l === e.charCodeAt(o) ? --o === -1 && (n = s) : (o = -1, n = a));
5743
5751
  }
5744
- return A === i ? i = a : i === -1 && (i = t.length), t.slice(A, i);
5752
+ return A === n ? n = a : n === -1 && (n = t.length), t.slice(A, n);
5745
5753
  } else {
5746
5754
  for (s = t.length - 1; s >= 0; --s)
5747
5755
  if (t.charCodeAt(s) === 47) {
@@ -5750,13 +5758,13 @@ var at = {
5750
5758
  break;
5751
5759
  }
5752
5760
  } else
5753
- i === -1 && (r = !1, i = s + 1);
5754
- return i === -1 ? "" : t.slice(A, i);
5761
+ n === -1 && (r = !1, n = s + 1);
5762
+ return n === -1 ? "" : t.slice(A, n);
5755
5763
  }
5756
5764
  },
5757
5765
  extname: function(t) {
5758
5766
  W(t);
5759
- for (var e = -1, A = 0, i = -1, r = !0, s = 0, o = t.length - 1; o >= 0; --o) {
5767
+ for (var e = -1, A = 0, n = -1, r = !0, s = 0, o = t.length - 1; o >= 0; --o) {
5760
5768
  var a = t.charCodeAt(o);
5761
5769
  if (a === 47) {
5762
5770
  if (!r) {
@@ -5765,11 +5773,11 @@ var at = {
5765
5773
  }
5766
5774
  continue;
5767
5775
  }
5768
- i === -1 && (r = !1, i = o + 1), a === 46 ? e === -1 ? e = o : s !== 1 && (s = 1) : e !== -1 && (s = -1);
5776
+ n === -1 && (r = !1, n = o + 1), a === 46 ? e === -1 ? e = o : s !== 1 && (s = 1) : e !== -1 && (s = -1);
5769
5777
  }
5770
- return e === -1 || i === -1 || // We saw a non-dot character immediately before the dot
5778
+ return e === -1 || n === -1 || // We saw a non-dot character immediately before the dot
5771
5779
  s === 0 || // The (right-most) trimmed path component is exactly '..'
5772
- s === 1 && e === i - 1 && e === A + 1 ? "" : t.slice(e, i);
5780
+ s === 1 && e === n - 1 && e === A + 1 ? "" : t.slice(e, n);
5773
5781
  },
5774
5782
  format: function(t) {
5775
5783
  if (t === null || typeof t != "object")
@@ -5781,8 +5789,8 @@ var at = {
5781
5789
  var e = { root: "", dir: "", base: "", ext: "", name: "" };
5782
5790
  if (t.length === 0)
5783
5791
  return e;
5784
- var A = t.charCodeAt(0), i = A === 47, r;
5785
- i ? (e.root = "/", r = 1) : r = 0;
5792
+ var A = t.charCodeAt(0), n = A === 47, r;
5793
+ n ? (e.root = "/", r = 1) : r = 0;
5786
5794
  for (var s = -1, o = 0, a = -1, l = !0, h = t.length - 1, c = 0; h >= r; --h) {
5787
5795
  if (A = t.charCodeAt(h), A === 47) {
5788
5796
  if (!l) {
@@ -5795,7 +5803,7 @@ var at = {
5795
5803
  }
5796
5804
  return s === -1 || a === -1 || // We saw a non-dot character immediately before the dot
5797
5805
  c === 0 || // The (right-most) trimmed path component is exactly '..'
5798
- c === 1 && s === a - 1 && s === o + 1 ? a !== -1 && (o === 0 && i ? e.base = e.name = t.slice(1, a) : e.base = e.name = t.slice(o, a)) : (o === 0 && i ? (e.name = t.slice(1, s), e.base = t.slice(1, a)) : (e.name = t.slice(o, s), e.base = t.slice(o, a)), e.ext = t.slice(s, a)), o > 0 ? e.dir = t.slice(0, o - 1) : i && (e.dir = "/"), e;
5806
+ c === 1 && s === a - 1 && s === o + 1 ? a !== -1 && (o === 0 && n ? e.base = e.name = t.slice(1, a) : e.base = e.name = t.slice(o, a)) : (o === 0 && n ? (e.name = t.slice(1, s), e.base = t.slice(1, a)) : (e.name = t.slice(o, s), e.base = t.slice(o, a)), e.ext = t.slice(s, a)), o > 0 ? e.dir = t.slice(0, o - 1) : n && (e.dir = "/"), e;
5799
5807
  },
5800
5808
  sep: "/",
5801
5809
  delimiter: ":",
@@ -5803,7 +5811,7 @@ var at = {
5803
5811
  posix: null
5804
5812
  };
5805
5813
  at.posix = at;
5806
- var Oe = at, mt = /* @__PURE__ */ ((n) => (n.start = "start", n.left = "left", n.right = "right", n.justify = "justify", n))(mt || {}), Pt = /* @__PURE__ */ ((n) => (n.sepia = "sepia", n.night = "night", n.custom = "custom", n))(Pt || {});
5814
+ var Le = at, mt = /* @__PURE__ */ ((i) => (i.start = "start", i.left = "left", i.right = "right", i.justify = "justify", i))(mt || {}), Pt = /* @__PURE__ */ ((i) => (i.sepia = "sepia", i.night = "night", i.custom = "custom", i))(Pt || {});
5807
5815
  const St = {
5808
5816
  range: [0.7, 4],
5809
5817
  step: 0.05
@@ -5814,39 +5822,39 @@ const St = {
5814
5822
  range: [50, 250],
5815
5823
  step: 10
5816
5824
  };
5817
- function mn(n, t) {
5818
- return n == null || t == null || n <= t ? n : void 0;
5825
+ function mn(i, t) {
5826
+ return i == null || t == null || i <= t ? i : void 0;
5819
5827
  }
5820
- function Mn(n, t) {
5821
- return n == null || t == null || n >= t ? n : void 0;
5828
+ function Mn(i, t) {
5829
+ return i == null || t == null || i >= t ? i : void 0;
5822
5830
  }
5823
- function x(n) {
5824
- return typeof n == "string" ? n : n === null ? null : void 0;
5831
+ function x(i) {
5832
+ return typeof i == "string" ? i : i === null ? null : void 0;
5825
5833
  }
5826
- function Q(n) {
5827
- return typeof n == "boolean" || n == null ? n : void 0;
5834
+ function Q(i) {
5835
+ return typeof i == "boolean" || i == null ? i : void 0;
5828
5836
  }
5829
- function jt(n, t) {
5830
- if (n !== void 0)
5831
- return n === null ? null : t[n] !== void 0 ? n : void 0;
5837
+ function jt(i, t) {
5838
+ if (i !== void 0)
5839
+ return i === null ? null : t[i] !== void 0 ? i : void 0;
5832
5840
  }
5833
- function lt(n) {
5834
- return typeof n == "boolean" || typeof n == "number" && n >= 0 ? n : n === null ? null : void 0;
5841
+ function lt(i) {
5842
+ return typeof i == "boolean" || typeof i == "number" && i >= 0 ? i : i === null ? null : void 0;
5835
5843
  }
5836
- function U(n) {
5837
- if (n !== void 0)
5838
- return n === null ? null : n < 0 ? void 0 : n;
5844
+ function U(i) {
5845
+ if (i !== void 0)
5846
+ return i === null ? null : i < 0 ? void 0 : i;
5839
5847
  }
5840
- function ht(n, t) {
5841
- if (n === void 0)
5848
+ function ht(i, t) {
5849
+ if (i === void 0)
5842
5850
  return;
5843
- if (n === null)
5851
+ if (i === null)
5844
5852
  return null;
5845
5853
  const e = Math.min(...t), A = Math.max(...t);
5846
- return n >= e && n <= A ? n : void 0;
5854
+ return i >= e && i <= A ? i : void 0;
5847
5855
  }
5848
- function Jt(n, t) {
5849
- return n === void 0 ? t : n;
5856
+ function Jt(i, t) {
5857
+ return i === void 0 ? t : i;
5850
5858
  }
5851
5859
  class Mt {
5852
5860
  constructor(t = {}) {
@@ -5881,9 +5889,9 @@ class Y {
5881
5889
  initialValue: t = null,
5882
5890
  effectiveValue: e,
5883
5891
  isEffective: A,
5884
- onChange: i
5892
+ onChange: n
5885
5893
  }) {
5886
- this._value = t, this._effectiveValue = e, this._isEffective = A, this._onChange = i;
5894
+ this._value = t, this._effectiveValue = e, this._isEffective = A, this._onChange = n;
5887
5895
  }
5888
5896
  set value(t) {
5889
5897
  this._value = t, this._onChange(this._value);
@@ -5921,15 +5929,15 @@ class k extends Y {
5921
5929
  this._value = !this._value, this._onChange(this._value);
5922
5930
  }
5923
5931
  }
5924
- class Xe extends Y {
5932
+ class Oe extends Y {
5925
5933
  constructor({
5926
5934
  initialValue: t = null,
5927
5935
  effectiveValue: e,
5928
5936
  isEffective: A,
5929
- onChange: i,
5937
+ onChange: n,
5930
5938
  supportedValues: r
5931
5939
  }) {
5932
- super({ initialValue: t, effectiveValue: e, isEffective: A, onChange: i }), this._supportedValues = r;
5940
+ super({ initialValue: t, effectiveValue: e, isEffective: A, onChange: n }), this._supportedValues = r;
5933
5941
  }
5934
5942
  set value(t) {
5935
5943
  if (t && !this._supportedValues.includes(t))
@@ -5957,11 +5965,11 @@ class N extends Y {
5957
5965
  initialValue: t = null,
5958
5966
  effectiveValue: e,
5959
5967
  isEffective: A,
5960
- onChange: i,
5968
+ onChange: n,
5961
5969
  supportedRange: r,
5962
5970
  step: s
5963
5971
  }) {
5964
- super({ initialValue: t, effectiveValue: e, isEffective: A, onChange: i }), this._supportedRange = r, this._step = s, this._decimals = this._step.toString().includes(".") ? this._step.toString().split(".")[1].length : 0;
5972
+ super({ initialValue: t, effectiveValue: e, isEffective: A, onChange: n }), this._supportedRange = r, this._step = s, this._decimals = this._step.toString().includes(".") ? this._step.toString().split(".")[1].length : 0;
5965
5973
  }
5966
5974
  set value(t) {
5967
5975
  if (t && (t < this._supportedRange[0] || t > this._supportedRange[1]))
@@ -6010,10 +6018,10 @@ const pn = "#FFFFFF", Bn = "#121212", En = "#0000EE", wn = "#551A8B", In = "#b4d
6010
6018
  RS__selectionBackgroundColor: In,
6011
6019
  RS__selectionTextColor: Fn
6012
6020
  };
6013
- class Ze {
6021
+ class Xe {
6014
6022
  constructor(t, e, A) {
6015
- var i, r;
6016
- this.preferences = t, this.settings = e, this.metadata = A, this.layout = ((r = (i = this.metadata) == null ? void 0 : i.getPresentation()) == null ? void 0 : r.layout) || p.reflowable;
6023
+ var n, r;
6024
+ this.preferences = t, this.settings = e, this.metadata = A, this.layout = ((r = (n = this.metadata) == null ? void 0 : n.getPresentation()) == null ? void 0 : r.layout) || p.reflowable;
6017
6025
  }
6018
6026
  clear() {
6019
6027
  this.preferences = new Mt({ optimalLineLength: 65 });
@@ -6404,7 +6412,7 @@ class Ze {
6404
6412
  });
6405
6413
  }
6406
6414
  get textAlign() {
6407
- return new Xe({
6415
+ return new Oe({
6408
6416
  initialValue: this.preferences.textAlign,
6409
6417
  effectiveValue: this.settings.textAlign || mt.start,
6410
6418
  isEffective: this.layout === p.reflowable && this.preferences.textAlign !== null,
@@ -6435,7 +6443,7 @@ class Ze {
6435
6443
  });
6436
6444
  }
6437
6445
  get theme() {
6438
- return new Xe({
6446
+ return new Oe({
6439
6447
  initialValue: this.preferences.theme,
6440
6448
  effectiveValue: this.settings.theme || null,
6441
6449
  isEffective: this.layout === p.reflowable,
@@ -6468,16 +6476,16 @@ class Ze {
6468
6476
  });
6469
6477
  }
6470
6478
  }
6471
- class Ke {
6479
+ class Ze {
6472
6480
  constructor(t, e) {
6473
6481
  this.backgroundColor = t.backgroundColor || e.backgroundColor || null, this.blendFilter = typeof t.blendFilter == "boolean" ? t.blendFilter : e.blendFilter ?? null, this.columnCount = t.columnCount !== void 0 ? t.columnCount : e.columnCount !== void 0 ? e.columnCount : null, this.constraint = t.constraint || e.constraint, this.darkenFilter = typeof t.darkenFilter == "boolean" ? t.darkenFilter : e.darkenFilter ?? null, this.deprecatedFontSize = typeof t.deprecatedFontSize == "boolean" ? t.deprecatedFontSize : e.deprecatedFontSize ?? null, this.fontFamily = t.fontFamily || e.fontFamily || null, this.fontSize = t.fontSize !== void 0 ? t.fontSize : e.fontSize !== void 0 ? e.fontSize : null, this.fontSizeNormalize = typeof t.fontSizeNormalize == "boolean" ? t.fontSizeNormalize : e.fontSizeNormalize ?? null, this.fontOpticalSizing = typeof t.fontOpticalSizing == "boolean" ? t.fontOpticalSizing : e.fontOpticalSizing ?? null, this.fontWeight = t.fontWeight !== void 0 ? t.fontWeight : e.fontWeight !== void 0 ? e.fontWeight : null, this.fontWidth = t.fontWidth !== void 0 ? t.fontWidth : e.fontWidth !== void 0 ? e.fontWidth : null, this.hyphens = typeof t.hyphens == "boolean" ? t.hyphens : e.hyphens ?? null, this.invertFilter = typeof t.invertFilter == "boolean" ? t.invertFilter : e.invertFilter ?? null, this.invertGaijiFilter = typeof t.invertGaijiFilter == "boolean" ? t.invertGaijiFilter : e.invertGaijiFilter ?? null, this.iOSPatch = this.deprecatedFontSize || t.iOSPatch === !1 ? !1 : t.iOSPatch === !0 ? (O.OS.iOS || O.OS.iPadOS) && O.iOSRequest === "mobile" : e.iOSPatch, this.iPadOSPatch = this.deprecatedFontSize || t.iPadOSPatch === !1 ? !1 : t.iPadOSPatch === !0 ? O.OS.iPadOS && O.iOSRequest === "desktop" : e.iPadOSPatch, this.letterSpacing = t.letterSpacing !== void 0 ? t.letterSpacing : e.letterSpacing !== void 0 ? e.letterSpacing : null, this.ligatures = typeof t.ligatures == "boolean" ? t.ligatures : e.ligatures ?? null, this.lineHeight = t.lineHeight !== void 0 ? t.lineHeight : e.lineHeight !== void 0 ? e.lineHeight : null, this.linkColor = t.linkColor || e.linkColor || null, this.maximalLineLength = t.maximalLineLength === null ? null : t.maximalLineLength || e.maximalLineLength || null, this.minimalLineLength = t.minimalLineLength === null ? null : t.minimalLineLength || e.minimalLineLength || null, this.noRuby = typeof t.noRuby == "boolean" ? t.noRuby : e.noRuby ?? null, this.optimalLineLength = t.optimalLineLength || e.optimalLineLength, this.pageGutter = t.pageGutter !== void 0 ? t.pageGutter : e.pageGutter !== void 0 ? e.pageGutter : null, this.paragraphIndent = t.paragraphIndent !== void 0 ? t.paragraphIndent : e.paragraphIndent !== void 0 ? e.paragraphIndent : null, this.paragraphSpacing = t.paragraphSpacing !== void 0 ? t.paragraphSpacing : e.paragraphSpacing !== void 0 ? e.paragraphSpacing : null, this.scroll = typeof t.scroll == "boolean" ? t.scroll : e.scroll ?? null, this.scrollPaddingTop = t.scrollPaddingTop !== void 0 ? t.scrollPaddingTop : e.scrollPaddingTop !== void 0 ? e.scrollPaddingTop : null, this.scrollPaddingBottom = t.scrollPaddingBottom !== void 0 ? t.scrollPaddingBottom : e.scrollPaddingBottom !== void 0 ? e.scrollPaddingBottom : null, this.selectionBackgroundColor = t.selectionBackgroundColor || e.selectionBackgroundColor || null, this.selectionTextColor = t.selectionTextColor || e.selectionTextColor || null, this.textAlign = t.textAlign || e.textAlign || null, this.textColor = t.textColor || e.textColor || null, this.textNormalization = typeof t.textNormalization == "boolean" ? t.textNormalization : e.textNormalization ?? null, this.theme = t.theme || e.theme || null, this.visitedColor = t.visitedColor || e.visitedColor || null, this.wordSpacing = t.wordSpacing !== void 0 ? t.wordSpacing : e.wordSpacing !== void 0 ? e.wordSpacing : null;
6474
6482
  }
6475
6483
  }
6476
- function Ft(n) {
6477
- const t = getComputedStyle(n), e = parseFloat(t.paddingLeft || "0"), A = parseFloat(t.paddingRight || "0");
6478
- return n.clientWidth - e - A;
6484
+ function Ft(i) {
6485
+ const t = getComputedStyle(i), e = parseFloat(t.paddingLeft || "0"), A = parseFloat(t.paddingRight || "0");
6486
+ return i.clientWidth - e - A;
6479
6487
  }
6480
- class xA {
6488
+ class SA {
6481
6489
  constructor() {
6482
6490
  }
6483
6491
  toFlag(t) {
@@ -6504,7 +6512,7 @@ class xA {
6504
6512
  return `${t}rem`;
6505
6513
  }
6506
6514
  }
6507
- class TA extends xA {
6515
+ class xA extends SA {
6508
6516
  constructor(t) {
6509
6517
  super(), this.a11yNormalize = t.a11yNormalize ?? null, this.appearance = t.appearance ?? null, this.backgroundColor = t.backgroundColor ?? null, this.blendFilter = t.blendFilter ?? null, this.bodyHyphens = t.bodyHyphens ?? null, this.colCount = t.colCount ?? null, this.darkenFilter = t.darkenFilter ?? null, this.deprecatedFontSize = t.deprecatedFontSize ?? null, this.fontFamily = t.fontFamily ?? null, this.fontOpticalSizing = t.fontOpticalSizing ?? null, this.fontSize = t.fontSize ?? null, this.fontSizeNormalize = t.fontSizeNormalize ?? null, this.fontWeight = t.fontWeight ?? null, this.fontWidth = t.fontWidth ?? null, this.invertFilter = t.invertFilter ?? null, this.invertGaijiFilter = t.invertGaijiFilter ?? null, this.iOSPatch = t.iOSPatch ?? null, this.iPadOSPatch = t.iPadOSPatch ?? null, this.letterSpacing = t.letterSpacing ?? null, this.ligatures = t.ligatures ?? null, this.lineHeight = t.lineHeight ?? null, this.lineLength = t.lineLength ?? null, this.linkColor = t.linkColor ?? null, this.noRuby = t.noRuby ?? null, this.paraIndent = t.paraIndent ?? null, this.paraSpacing = t.paraSpacing ?? null, this.selectionBackgroundColor = t.selectionBackgroundColor ?? null, this.selectionTextColor = t.selectionTextColor ?? null, this.textAlign = t.textAlign ?? null, this.textColor = t.textColor ?? null, this.view = t.view ?? null, this.visitedColor = t.visitedColor ?? null, this.wordSpacing = t.wordSpacing ?? null;
6510
6518
  }
@@ -6513,7 +6521,7 @@ class TA extends xA {
6513
6521
  return this.a11yNormalize && (t["--USER__a11yNormalize"] = this.toFlag("a11y")), this.appearance && (t["--USER__appearance"] = this.toFlag(this.appearance)), this.backgroundColor && (t["--USER__backgroundColor"] = this.backgroundColor), this.blendFilter && (t["--USER__blendFilter"] = this.toFlag("blend")), this.bodyHyphens && (t["--USER__bodyHyphens"] = this.bodyHyphens), this.colCount && (t["--USER__colCount"] = this.toUnitless(this.colCount)), this.darkenFilter === !0 ? t["--USER__darkenFilter"] = this.toFlag("darken") : typeof this.darkenFilter == "number" && (t["--USER__darkenFilter"] = this.toPercentage(this.darkenFilter)), this.deprecatedFontSize && (t["--USER__fontSizeImplementation"] = this.toFlag("deprecatedFontSize")), this.fontFamily && (t["--USER__fontFamily"] = this.fontFamily), this.fontOpticalSizing != null && (t["--USER__fontOpticalSizing"] = this.fontOpticalSizing), this.fontSize != null && (t["--USER__fontSize"] = this.toPercentage(this.fontSize, !0)), this.fontSizeNormalize && (t["--USER__fontSizeNormalize"] = this.toFlag("normalize")), this.fontWeight != null && (t["--USER__fontWeight"] = this.toUnitless(this.fontWeight)), this.fontWidth != null && (t["--USER__fontWidth"] = typeof this.fontWidth == "string" ? this.fontWidth : this.toUnitless(this.fontWidth)), this.invertFilter === !0 ? t["--USER__invertFilter"] = this.toFlag("invert") : typeof this.invertFilter == "number" && (t["--USER__invertFilter"] = this.toPercentage(this.invertFilter)), this.invertGaijiFilter === !0 ? t["--USER__invertGaiji"] = this.toFlag("invertGaiji") : typeof this.invertGaijiFilter == "number" && (t["--USER__invertGaiji"] = this.toPercentage(this.invertGaijiFilter)), this.iOSPatch && (t["--USER__iOSPatch"] = this.toFlag("iOSPatch")), this.iPadOSPatch && (t["--USER__iPadOSPatch"] = this.toFlag("iPadOSPatch")), this.letterSpacing != null && (t["--USER__letterSpacing"] = this.toRem(this.letterSpacing)), this.ligatures && (t["--USER__ligatures"] = this.ligatures), this.lineHeight != null && (t["--USER__lineHeight"] = this.toUnitless(this.lineHeight)), this.lineLength != null && (t["--USER__lineLength"] = this.toPx(this.lineLength)), this.linkColor && (t["--USER__linkColor"] = this.linkColor), this.noRuby && (t["--USER__noRuby"] = this.toFlag("noRuby")), this.paraIndent != null && (t["--USER__paraIndent"] = this.toRem(this.paraIndent)), this.paraSpacing != null && (t["--USER__paraSpacing"] = this.toRem(this.paraSpacing)), this.selectionBackgroundColor && (t["--USER__selectionBackgroundColor"] = this.selectionBackgroundColor), this.selectionTextColor && (t["--USER__selectionTextColor"] = this.selectionTextColor), this.textAlign && (t["--USER__textAlign"] = this.textAlign), this.textColor && (t["--USER__textColor"] = this.textColor), this.view && (t["--USER__view"] = this.toFlag(this.view)), this.visitedColor && (t["--USER__visitedColor"] = this.visitedColor), this.wordSpacing != null && (t["--USER__wordSpacing"] = this.toRem(this.wordSpacing)), t;
6514
6522
  }
6515
6523
  }
6516
- class Un extends xA {
6524
+ class Un extends SA {
6517
6525
  constructor(t) {
6518
6526
  super(), this.backgroundColor = t.backgroundColor ?? null, this.baseFontFamily = t.baseFontFamily ?? null, this.baseFontSize = t.baseFontSize ?? null, this.baseLineHeight = t.baseLineHeight ?? null, this.boxSizingMedia = t.boxSizingMedia ?? null, this.boxSizingTable = t.boxSizingTable ?? null, this.colWidth = t.colWidth ?? null, this.colCount = t.colCount ?? null, this.colGap = t.colGap ?? null, this.codeFontFamily = t.codeFontFamily ?? null, this.compFontFamily = t.compFontFamily ?? null, this.defaultLineLength = t.defaultLineLength ?? null, this.flowSpacing = t.flowSpacing ?? null, this.humanistTf = t.humanistTf ?? null, this.linkColor = t.linkColor ?? null, this.maxMediaWidth = t.maxMediaWidth ?? null, this.maxMediaHeight = t.maxMediaHeight ?? null, this.modernTf = t.modernTf ?? null, this.monospaceTf = t.monospaceTf ?? null, this.noOverflow = t.noOverflow ?? null, this.noVerticalPagination = t.noVerticalPagination ?? null, this.oldStyleTf = t.oldStyleTf ?? null, this.pageGutter = t.pageGutter ?? null, this.paraIndent = t.paraIndent ?? null, this.paraSpacing = t.paraSpacing ?? null, this.primaryColor = t.primaryColor ?? null, this.scrollPaddingBottom = t.scrollPaddingBottom ?? null, this.scrollPaddingTop = t.scrollPaddingTop ?? null, this.sansSerifJa = t.sansSerifJa ?? null, this.sansSerifJaV = t.sansSerifJaV ?? null, this.sansTf = t.sansTf ?? null, this.secondaryColor = t.secondaryColor ?? null, this.selectionBackgroundColor = t.selectionBackgroundColor ?? null, this.selectionTextColor = t.selectionTextColor ?? null, this.serifJa = t.serifJa ?? null, this.serifJaV = t.serifJaV ?? null, this.textColor = t.textColor ?? null, this.typeScale = t.typeScale ?? null, this.visitedColor = t.visitedColor ?? null;
6519
6527
  }
@@ -6573,16 +6581,16 @@ class Cn {
6573
6581
  visitedColor: t.visitedColor,
6574
6582
  wordSpacing: t.wordSpacing
6575
6583
  };
6576
- this.userProperties = new TA(A);
6584
+ this.userProperties = new xA(A);
6577
6585
  }
6578
- updateLayout(t, e, A, i) {
6579
- return A ?? this.userProperties.view === "scroll" ? this.computeScrollLength(t, e) : this.paginate(t, e, i);
6586
+ updateLayout(t, e, A, n) {
6587
+ return A ?? this.userProperties.view === "scroll" ? this.computeScrollLength(t, e) : this.paginate(t, e, n);
6580
6588
  }
6581
6589
  getCompensatedMetrics(t, e) {
6582
- const A = t || this.userProperties.fontSize || 1, i = A < 1 ? 1 / A : e ? A : 1;
6590
+ const A = t || this.userProperties.fontSize || 1, n = A < 1 ? 1 / A : e ? A : 1;
6583
6591
  return {
6584
6592
  zoomFactor: A,
6585
- zoomCompensation: i,
6593
+ zoomCompensation: n,
6586
6594
  optimal: Math.round(this.lineLengths.optimalLineLength) * A,
6587
6595
  minimal: this.lineLengths.minimalLineLength !== null ? Math.round(this.lineLengths.minimalLineLength * A) : null,
6588
6596
  maximal: this.lineLengths.maximalLineLength !== null ? Math.round(this.lineLengths.maximalLineLength * A) : null
@@ -6592,8 +6600,8 @@ class Cn {
6592
6600
  // TODO: As scroll shows, the effective line-length
6593
6601
  // should be the same as uncompensated when scale >= 1
6594
6602
  paginate(t, e, A) {
6595
- const i = Math.round(Ft(this.containerParent) - this.constraint), r = this.getCompensatedMetrics(t, e), s = r.zoomCompensation, o = r.optimal, a = r.minimal, l = r.maximal;
6596
- let h = 1, c = i;
6603
+ const n = Math.round(Ft(this.containerParent) - this.constraint), r = this.getCompensatedMetrics(t, e), s = r.zoomCompensation, o = r.optimal, a = r.minimal, l = r.maximal;
6604
+ let h = 1, c = n;
6597
6605
  if (A === void 0)
6598
6606
  return {
6599
6607
  colCount: void 0,
@@ -6601,36 +6609,36 @@ class Cn {
6601
6609
  effectiveLineLength: Math.round(c / h * s)
6602
6610
  };
6603
6611
  if (A === null)
6604
- if (i < o || l === null)
6605
- h = 1, c = i;
6612
+ if (n < o || l === null)
6613
+ h = 1, c = n;
6606
6614
  else {
6607
- h = Math.floor(i / o);
6615
+ h = Math.floor(n / o);
6608
6616
  const g = Math.round(h * (l * s));
6609
- c = Math.min(g, i);
6617
+ c = Math.min(g, n);
6610
6618
  }
6611
6619
  else if (A > 1) {
6612
6620
  const g = Math.round(A * (a !== null ? a : o));
6613
- if (i >= g)
6621
+ if (n >= g)
6614
6622
  if (h = A, l === null)
6615
- c = i;
6623
+ c = n;
6616
6624
  else {
6617
6625
  const m = Math.round(h * (l * s));
6618
- c = Math.min(m, i);
6626
+ c = Math.min(m, n);
6619
6627
  }
6620
6628
  else {
6621
- a !== null && i < Math.round(A * a) ? h = Math.floor(i / a) : h = A;
6629
+ a !== null && n < Math.round(A * a) ? h = Math.floor(n / a) : h = A;
6622
6630
  const m = Math.round(h * (o * s));
6623
- c = Math.min(m, i);
6631
+ c = Math.min(m, n);
6624
6632
  }
6625
- } else if (h = 1, i >= o)
6633
+ } else if (h = 1, n >= o)
6626
6634
  if (l === null)
6627
- c = i;
6635
+ c = n;
6628
6636
  else {
6629
6637
  const g = Math.round(l * s);
6630
- c = Math.min(g, i);
6638
+ c = Math.min(g, n);
6631
6639
  }
6632
6640
  else
6633
- c = i;
6641
+ c = n;
6634
6642
  return {
6635
6643
  colCount: h,
6636
6644
  effectiveContainerWidth: c,
@@ -6639,7 +6647,7 @@ class Cn {
6639
6647
  }
6640
6648
  // This behaves as paginate where colCount = 1
6641
6649
  computeScrollLength(t, e) {
6642
- const A = Math.round(Ft(this.containerParent) - this.constraint), i = this.getCompensatedMetrics(t && (t < 1 || e) ? t : 1, e), r = i.zoomCompensation, s = i.optimal, o = i.maximal;
6650
+ const A = Math.round(Ft(this.containerParent) - this.constraint), n = this.getCompensatedMetrics(t && (t < 1 || e) ? t : 1, e), r = n.zoomCompensation, s = n.optimal, o = n.maximal;
6643
6651
  let a, l = A, h = Math.round(s * r);
6644
6652
  if (o === null)
6645
6653
  h = A;
@@ -6661,32 +6669,34 @@ class Cn {
6661
6669
  this.userProperties.colCount = t.colCount, this.userProperties.lineLength = t.effectiveLineLength, this.effectiveContainerWidth = t.effectiveContainerWidth, this.container.style.width = `${this.effectiveContainerWidth}px`;
6662
6670
  }
6663
6671
  }
6664
- const yn = (n) => ({
6665
- frameLoaded: n.frameLoaded || (() => {
6672
+ const yn = (i) => ({
6673
+ frameLoaded: i.frameLoaded || (() => {
6666
6674
  }),
6667
- positionChanged: n.positionChanged || (() => {
6675
+ positionChanged: i.positionChanged || (() => {
6668
6676
  }),
6669
- tap: n.tap || (() => !1),
6670
- click: n.click || (() => !1),
6671
- zoom: n.zoom || (() => {
6677
+ tap: i.tap || (() => !1),
6678
+ click: i.click || (() => !1),
6679
+ zoom: i.zoom || (() => {
6672
6680
  }),
6673
- miscPointer: n.miscPointer || (() => {
6681
+ miscPointer: i.miscPointer || (() => {
6674
6682
  }),
6675
- customEvent: n.customEvent || (() => {
6683
+ scroll: i.scroll || (() => {
6676
6684
  }),
6677
- handleLocator: n.handleLocator || (() => !1),
6678
- textSelected: n.textSelected || (() => {
6685
+ customEvent: i.customEvent || (() => {
6686
+ }),
6687
+ handleLocator: i.handleLocator || (() => !1),
6688
+ textSelected: i.textSelected || (() => {
6679
6689
  })
6680
6690
  });
6681
- class jA extends qA {
6682
- constructor(t, e, A, i = [], r = void 0, s = { preferences: {}, defaults: {} }) {
6691
+ class TA extends qA {
6692
+ constructor(t, e, A, n = [], r = void 0, s = { preferences: {}, defaults: {} }) {
6683
6693
  super(), this._preferencesEditor = null, this.reflowViewport = {
6684
6694
  readingOrder: [],
6685
6695
  progressions: /* @__PURE__ */ new Map(),
6686
6696
  positions: null
6687
- }, this.pub = e, this.layout = jA.determineLayout(e), this.container = t, this.listeners = yn(A), this.currentLocation = r, i.length && (this.positions = i), this._preferences = new Mt(s.preferences), this._defaults = new fn(s.defaults), this._settings = new Ke(this._preferences, this._defaults), this._css = new Cn({
6697
+ }, this.pub = e, this.layout = TA.determineLayout(e), this.container = t, this.listeners = yn(A), this.currentLocation = r, n.length && (this.positions = n), this._preferences = new Mt(s.preferences), this._defaults = new fn(s.defaults), this._settings = new Ze(this._preferences, this._defaults), this._css = new Cn({
6688
6698
  rsProperties: new Un({}),
6689
- userProperties: new TA({}),
6699
+ userProperties: new xA({}),
6690
6700
  lineLengths: new ut({
6691
6701
  optimalChars: this._settings.optimalLineLength,
6692
6702
  minChars: this._settings.minimalLineLength,
@@ -6728,14 +6738,14 @@ class jA extends qA {
6728
6738
  }
6729
6739
  }
6730
6740
  get preferencesEditor() {
6731
- return this._preferencesEditor === null && (this._preferencesEditor = new Ze(this._preferences, this.settings, this.pub.metadata)), this._preferencesEditor;
6741
+ return this._preferencesEditor === null && (this._preferencesEditor = new Xe(this._preferences, this.settings, this.pub.metadata)), this._preferencesEditor;
6732
6742
  }
6733
6743
  async submitPreferences(t) {
6734
6744
  this._preferences = this._preferences.merging(t), await this.applyPreferences();
6735
6745
  }
6736
6746
  async applyPreferences() {
6737
6747
  const t = this._settings;
6738
- this._settings = new Ke(this._preferences, this._defaults), this._preferencesEditor !== null && (this._preferencesEditor = new Ze(this._preferences, this.settings, this.pub.metadata)), this.layout === p.fixed ? this.handleFXLPrefs(t, this._settings) : await this.updateCSS(!0);
6748
+ this._settings = new Ze(this._preferences, this._defaults), this._preferencesEditor !== null && (this._preferencesEditor = new Xe(this._preferences, this.settings, this.pub.metadata)), this.layout === p.fixed ? this.handleFXLPrefs(t, this._settings) : await this.updateCSS(!0);
6739
6749
  }
6740
6750
  // TODO: fit, etc.
6741
6751
  handleFXLPrefs(t, e) {
@@ -6746,10 +6756,10 @@ class jA extends qA {
6746
6756
  }
6747
6757
  compileCSSProperties(t) {
6748
6758
  const e = {};
6749
- for (const [A, i] of Object.entries(t.rsProperties.toCSSProperties()))
6750
- e[A] = i;
6751
- for (const [A, i] of Object.entries(t.userProperties.toCSSProperties()))
6752
- e[A] = i;
6759
+ for (const [A, n] of Object.entries(t.rsProperties.toCSSProperties()))
6760
+ e[A] = n;
6761
+ for (const [A, n] of Object.entries(t.userProperties.toCSSProperties()))
6762
+ e[A] = n;
6753
6763
  return e;
6754
6764
  }
6755
6765
  async commitCSS(t) {
@@ -6788,7 +6798,7 @@ class jA extends qA {
6788
6798
  * outside the readium-controller navigator. Be careful!
6789
6799
  */
6790
6800
  eventListener(t, e) {
6791
- var A, i, r, s, o, a;
6801
+ var A, n, r, s, o, a;
6792
6802
  switch (t) {
6793
6803
  case "_pong":
6794
6804
  this.listeners.frameLoaded(this._cframes[0].iframe.contentWindow), this.listeners.positionChanged(this.currentLocation);
@@ -6830,7 +6840,7 @@ class jA extends qA {
6830
6840
  else
6831
6841
  try {
6832
6842
  this.goLink(new X({
6833
- href: Oe.join(Oe.dirname(this.currentLocation.href), g)
6843
+ href: Le.join(Le.dirname(this.currentLocation.href), g)
6834
6844
  }), !1, () => {
6835
6845
  });
6836
6846
  } catch (m) {
@@ -6843,7 +6853,7 @@ class jA extends qA {
6843
6853
  } else {
6844
6854
  if (this.layout === p.fixed && this.framePool.doNotDisturb && (h.doNotDisturb = !0), this.layout === p.fixed && (this.currentProgression === w.rtl || this.currentProgression === w.ltr) && this.framePool.currentFrames.length > 1) {
6845
6855
  const m = this.framePool.currentFrames;
6846
- h.targetFrameSrc === ((i = m[this.currentProgression === w.rtl ? 0 : 1]) == null ? void 0 : i.source) && (h.x += (((s = (r = m[this.currentProgression === w.rtl ? 1 : 0]) == null ? void 0 : r.iframe.contentWindow) == null ? void 0 : s.innerWidth) ?? 0) * window.devicePixelRatio);
6856
+ h.targetFrameSrc === ((n = m[this.currentProgression === w.rtl ? 0 : 1]) == null ? void 0 : n.source) && (h.x += (((s = (r = m[this.currentProgression === w.rtl ? 1 : 0]) == null ? void 0 : r.iframe.contentWindow) == null ? void 0 : s.innerWidth) ?? 0) * window.devicePixelRatio);
6847
6857
  }
6848
6858
  if (t === "click" ? this.listeners.click(h) : this.listeners.tap(h))
6849
6859
  break;
@@ -6866,6 +6876,9 @@ class jA extends qA {
6866
6876
  break;
6867
6877
  case "swipe":
6868
6878
  break;
6879
+ case "scroll":
6880
+ this.listeners.scroll(e);
6881
+ break;
6869
6882
  case "zoom":
6870
6883
  this.listeners.zoom(e);
6871
6884
  break;
@@ -6890,8 +6903,8 @@ class jA extends qA {
6890
6903
  if (t.length === 0)
6891
6904
  throw Error("no cframe to attach listener to");
6892
6905
  t.forEach((e) => {
6893
- e.msg && (e.msg.listener = (A, i) => {
6894
- this.eventListener(A, i);
6906
+ e.msg && (e.msg.listener = (A, n) => {
6907
+ this.eventListener(A, n);
6895
6908
  });
6896
6909
  });
6897
6910
  }
@@ -6904,7 +6917,7 @@ class jA extends qA {
6904
6917
  await ((t = this.framePool) == null ? void 0 : t.destroy());
6905
6918
  }
6906
6919
  async changeResource(t) {
6907
- var i, r;
6920
+ var n, r;
6908
6921
  if (t === 0)
6909
6922
  return !1;
6910
6923
  if (this.layout === p.fixed) {
@@ -6940,7 +6953,7 @@ class jA extends qA {
6940
6953
  Math.min(this.pub.readingOrder.items.length - 1, e + t)
6941
6954
  );
6942
6955
  if (A === e)
6943
- return (r = (i = this._cframes[0]) == null ? void 0 : i.msg) == null || r.send("shake", void 0, async (s) => {
6956
+ return (r = (n = this._cframes[0]) == null ? void 0 : n.msg) == null || r.send("shake", void 0, async (s) => {
6944
6957
  }), !1;
6945
6958
  if (e > A) {
6946
6959
  for (let s = this.positions.length - 1; s >= 0; s--)
@@ -6959,8 +6972,8 @@ class jA extends qA {
6959
6972
  return await this.apply(), !0;
6960
6973
  }
6961
6974
  findLastPositionInProgressionRange(t, e) {
6962
- const A = t.findLastIndex((i) => {
6963
- const r = i.locations.progression;
6975
+ const A = t.findLastIndex((n) => {
6976
+ const r = n.locations.progression;
6964
6977
  return !!(r && r > e.start && r <= e.end);
6965
6978
  });
6966
6979
  return A !== -1 ? t[A] : void 0;
@@ -6969,20 +6982,20 @@ class jA extends qA {
6969
6982
  const e = this.positions.filter(
6970
6983
  (r) => r.href === this.currentLocation.href
6971
6984
  );
6972
- let A = this.currentLocation, i;
6985
+ let A = this.currentLocation, n;
6973
6986
  return e.some((r, s) => {
6974
6987
  const o = r.locations.progression ?? 0;
6975
6988
  if (t.start <= o) {
6976
6989
  A = r;
6977
6990
  const a = e.splice(s + 1, e.length);
6978
- return i = this.findLastPositionInProgressionRange(a, t), !0;
6991
+ return n = this.findLastPositionInProgressionRange(a, t), !0;
6979
6992
  } else
6980
6993
  return !1;
6981
- }), { first: A, last: i };
6994
+ }), { first: A, last: n };
6982
6995
  }
6983
6996
  updateViewport(t) {
6984
- var e, A, i;
6985
- this.reflowViewport.readingOrder = [], this.reflowViewport.progressions.clear(), this.reflowViewport.positions = null, this.currentLocation && (this.reflowViewport.readingOrder.push(this.currentLocation.href), this.reflowViewport.progressions.set(this.currentLocation.href, t), ((e = this.currentLocation.locations) == null ? void 0 : e.position) !== void 0 && (this.reflowViewport.positions = [this.currentLocation.locations.position], ((i = (A = this.lastLocationInView) == null ? void 0 : A.locations) == null ? void 0 : i.position) !== void 0 && this.reflowViewport.positions.push(this.lastLocationInView.locations.position)));
6997
+ var e, A, n;
6998
+ this.reflowViewport.readingOrder = [], this.reflowViewport.progressions.clear(), this.reflowViewport.positions = null, this.currentLocation && (this.reflowViewport.readingOrder.push(this.currentLocation.href), this.reflowViewport.progressions.set(this.currentLocation.href, t), ((e = this.currentLocation.locations) == null ? void 0 : e.position) !== void 0 && (this.reflowViewport.positions = [this.currentLocation.locations.position], ((n = (A = this.lastLocationInView) == null ? void 0 : A.locations) == null ? void 0 : n.position) !== void 0 && this.reflowViewport.positions.push(this.lastLocationInView.locations.position)));
6986
6999
  }
6987
7000
  async syncLocation(t) {
6988
7001
  const e = t, A = this.findNearestPositions(e);
@@ -6991,14 +7004,14 @@ class jA extends qA {
6991
7004
  }), this.lastLocationInView = A.last, this.updateViewport(e), this.listeners.positionChanged(this.currentLocation), await this.framePool.update(this.pub, this.currentLocation, this.determineModules());
6992
7005
  }
6993
7006
  goBackward(t, e) {
6994
- var A, i;
6995
- this.layout === p.fixed ? (this.changeResource(-1), e(!0)) : (i = (A = this._cframes[0]) == null ? void 0 : A.msg) == null || i.send("go_prev", void 0, async (r) => {
7007
+ var A, n;
7008
+ this.layout === p.fixed ? (this.changeResource(-1), e(!0)) : (n = (A = this._cframes[0]) == null ? void 0 : A.msg) == null || n.send("go_prev", void 0, async (r) => {
6996
7009
  e(r ? !0 : await this.changeResource(-1));
6997
7010
  });
6998
7011
  }
6999
7012
  goForward(t, e) {
7000
- var A, i;
7001
- this.layout === p.fixed ? (this.changeResource(1), e(!0)) : (i = (A = this._cframes[0]) == null ? void 0 : A.msg) == null || i.send("go_next", void 0, async (r) => {
7013
+ var A, n;
7014
+ this.layout === p.fixed ? (this.changeResource(1), e(!0)) : (n = (A = this._cframes[0]) == null ? void 0 : A.msg) == null || n.send("go_next", void 0, async (r) => {
7002
7015
  e(r ? !0 : await this.changeResource(1));
7003
7016
  });
7004
7017
  }
@@ -7039,25 +7052,25 @@ class jA extends qA {
7039
7052
  }
7040
7053
  async loadLocator(t, e) {
7041
7054
  var a, l;
7042
- let A = !1, i = typeof t.locations.getCssSelector == "function" && t.locations.getCssSelector();
7055
+ let A = !1, n = typeof t.locations.getCssSelector == "function" && t.locations.getCssSelector();
7043
7056
  if ((a = t.text) != null && a.highlight ? A = await new Promise((h, c) => {
7044
7057
  var g, m;
7045
7058
  this._cframes[0].msg.send(
7046
7059
  "go_text",
7047
- i ? [
7060
+ n ? [
7048
7061
  (g = t.text) == null ? void 0 : g.serialize(),
7049
- i
7062
+ n
7050
7063
  // Include CSS selector if it exists
7051
7064
  ] : (m = t.text) == null ? void 0 : m.serialize(),
7052
7065
  (M) => h(M)
7053
7066
  );
7054
- }) : i && (A = await new Promise((h, c) => {
7067
+ }) : n && (A = await new Promise((h, c) => {
7055
7068
  this._cframes[0].msg.send(
7056
7069
  "go_text",
7057
7070
  [
7058
7071
  "",
7059
7072
  // No text!
7060
- i
7073
+ n
7061
7074
  // Just CSS selector
7062
7075
  ],
7063
7076
  (g) => h(g)
@@ -7079,8 +7092,8 @@ class jA extends qA {
7079
7092
  }) : A = !0, e(A);
7080
7093
  }
7081
7094
  go(t, e, A) {
7082
- const i = t.href.split("#")[0];
7083
- let r = this.pub.readingOrder.findWithHref(i);
7095
+ const n = t.href.split("#")[0];
7096
+ let r = this.pub.readingOrder.findWithHref(n);
7084
7097
  if (!r)
7085
7098
  return A(this.listeners.handleLocator(t));
7086
7099
  this.currentLocation = this.positions.find((s) => s.href === r.href), this.apply().then(() => this.loadLocator(t, (s) => A(s))).then(() => {
@@ -7267,12 +7280,12 @@ class Qn {
7267
7280
  }
7268
7281
  export {
7269
7282
  k as BooleanPreference,
7270
- Xe as EnumPreference,
7283
+ Oe as EnumPreference,
7271
7284
  fn as EpubDefaults,
7272
- jA as EpubNavigator,
7285
+ TA as EpubNavigator,
7273
7286
  Mt as EpubPreferences,
7274
- Ze as EpubPreferencesEditor,
7275
- Ke as EpubSettings,
7287
+ Xe as EpubPreferencesEditor,
7288
+ Ze as EpubSettings,
7276
7289
  nn as FXLCoordinator,
7277
7290
  tn as FXLFrameManager,
7278
7291
  dn as FXLFramePoolManager,
@@ -7290,7 +7303,7 @@ export {
7290
7303
  Cn as ReadiumCSS,
7291
7304
  mt as TextAlignment,
7292
7305
  Pt as Theme,
7293
- TA as UserProperties,
7306
+ xA as UserProperties,
7294
7307
  An as VerticalThird,
7295
7308
  qA as VisualNavigator,
7296
7309
  Qn as WebAudioEngine,