@readium/navigator-html-injectables 2.1.1 → 2.2.1

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,5 +1,5 @@
1
- const _e = Math.pow(2, 32), me = () => Math.round(Math.random() * _e).toString(36), Ye = () => `${Math.round(performance.now())}-${me()}-${me()}`, F = 1;
2
- class Ke {
1
+ const et = Math.pow(2, 32), xe = () => Math.round(Math.random() * et).toString(36), tt = () => `${Math.round(performance.now())}-${xe()}-${xe()}`, B = 1;
2
+ class it {
3
3
  constructor(e) {
4
4
  this.destination = null, this.registrar = /* @__PURE__ */ new Map(), this.origin = "", this.channelId = "", this.receiver = this.receive.bind(this), this.preLog = [], this.wnd = e, e.addEventListener("message", this.receiver);
5
5
  }
@@ -10,8 +10,8 @@ class Ke {
10
10
  if (!(!("_readium" in t) || !t._readium || t._readium <= 0)) {
11
11
  if (t.key === "_ping") {
12
12
  if (!this.destination) {
13
- if (this.destination = e.source, this.origin = e.origin, this.channelId = t._channel, t._readium !== F) {
14
- t._readium > F ? this.send("error", `received comms version ${t._readium} higher than ${F}`) : this.send("error", `received comms version ${t._readium} lower than ${F}`), this.destination = null, this.origin = "", this.channelId = "";
13
+ if (this.destination = e.source, this.origin = e.origin, this.channelId = t._channel, t._readium !== B) {
14
+ t._readium > B ? this.send("error", `received comms version ${t._readium} higher than ${B}`) : this.send("error", `received comms version ${t._readium} lower than ${B}`), this.destination = null, this.origin = "", this.channelId = "";
15
15
  return;
16
16
  }
17
17
  this.send("_pong", void 0), this.preLog.forEach((i) => this.send("log", i)), this.preLog = [];
@@ -30,21 +30,21 @@ class Ke {
30
30
  e.strict && this.send("_unhandled", e);
31
31
  return;
32
32
  }
33
- t.forEach((i) => i.cb(e.data, (r) => {
34
- this.send("_ack", r, e.id);
33
+ t.forEach((i) => i.cb(e.data, (s) => {
34
+ this.send("_ack", s, e.id);
35
35
  }));
36
36
  }
37
37
  register(e, t, i) {
38
- Array.isArray(e) || (e = [e]), e.forEach((r) => {
39
- const n = this.registrar.get(r);
38
+ Array.isArray(e) || (e = [e]), e.forEach((s) => {
39
+ const n = this.registrar.get(s);
40
40
  if (n && n.length >= 0) {
41
- if (n.find((l) => l.module === t)) throw new Error(`Trying to register another callback for combination of event ${r} and module ${t}`);
41
+ if (n.find((l) => l.module === t)) throw new Error(`Trying to register another callback for combination of event ${s} and module ${t}`);
42
42
  n.push({
43
43
  cb: i,
44
44
  module: t
45
- }), this.registrar.set(r, n);
45
+ }), this.registrar.set(s, n);
46
46
  } else
47
- this.registrar.set(r, [{
47
+ this.registrar.set(s, [{
48
48
  cb: i,
49
49
  module: t
50
50
  }]);
@@ -52,12 +52,12 @@ class Ke {
52
52
  }
53
53
  unregister(e, t) {
54
54
  Array.isArray(e) || (e = [e]), e.forEach((i) => {
55
- const r = this.registrar.get(i);
56
- !r || r.length === 0 || r.splice(r.findIndex((n) => n.module === t), 1);
55
+ const s = this.registrar.get(i);
56
+ !s || s.length === 0 || s.splice(s.findIndex((n) => n.module === t), 1);
57
57
  });
58
58
  }
59
59
  unregisterAll(e) {
60
- this.registrar.forEach((t, i) => this.registrar.set(i, t.filter((r) => r.module !== e)));
60
+ this.registrar.forEach((t, i) => this.registrar.set(i, t.filter((s) => s.module !== e)));
61
61
  }
62
62
  log(...e) {
63
63
  this.destination ? this.send("log", e) : this.preLog.push(e);
@@ -68,12 +68,12 @@ class Ke {
68
68
  destroy() {
69
69
  this.destination = null, this.channelId = "", this.preLog = [], this.registrar.clear(), this.wnd.removeEventListener("message", this.receiver);
70
70
  }
71
- send(e, t, i = void 0, r = []) {
71
+ send(e, t, i = void 0, s = []) {
72
72
  if (!this.destination) throw Error("Attempted to send comms message before destination has been initialized");
73
73
  const n = {
74
- _readium: F,
74
+ _readium: B,
75
75
  _channel: this.channelId,
76
- id: i ?? Ye(),
76
+ id: i ?? tt(),
77
77
  // scrict,
78
78
  key: e,
79
79
  data: t
@@ -81,23 +81,23 @@ class Ke {
81
81
  try {
82
82
  this.destination.postMessage(n, {
83
83
  targetOrigin: this.origin,
84
- transfer: r
84
+ transfer: s
85
85
  });
86
86
  } catch (o) {
87
- if (r.length > 0) throw o;
88
- this.destination.postMessage(n, this.origin, r);
87
+ if (s.length > 0) throw o;
88
+ this.destination.postMessage(n, this.origin, s);
89
89
  }
90
90
  }
91
91
  }
92
- const M = class z {
92
+ const N = class F {
93
93
  constructor(e) {
94
94
  if (typeof e == "string") {
95
- if (!z.VALID_MODES.has(e.toLowerCase()))
95
+ if (!F.VALID_MODES.has(e.toLowerCase()))
96
96
  return;
97
97
  this.value = e.toLowerCase();
98
98
  } else {
99
99
  const t = e.filter(
100
- (i) => z.VALID_MODES.has(i.toLowerCase())
100
+ (i) => F.VALID_MODES.has(i.toLowerCase())
101
101
  );
102
102
  if (t.length === 0)
103
103
  return;
@@ -110,11 +110,11 @@ const M = class z {
110
110
  static deserialize(e) {
111
111
  if (!e) return;
112
112
  if (typeof e == "string")
113
- return new z(e);
113
+ return new F(e);
114
114
  if (!Array.isArray(e)) return;
115
- const t = e.filter((i) => i ? z.VALID_MODES.has(i.toLowerCase()) : !1);
115
+ const t = e.filter((i) => i ? F.VALID_MODES.has(i.toLowerCase()) : !1);
116
116
  if (t.length !== 0)
117
- return new z(t);
117
+ return new F(t);
118
118
  }
119
119
  /**
120
120
  * Serializes a [PrimaryAccessMode] to its RWPM JSON representation.
@@ -123,8 +123,8 @@ const M = class z {
123
123
  return this.value;
124
124
  }
125
125
  };
126
- M.VALID_MODES = /* @__PURE__ */ new Set(["auditory", "tactile", "textual", "visual"]), M.AUDITORY = new M("auditory"), M.TACTILE = new M("tactile"), M.TEXTUAL = new M("textual"), M.VISUAL = new M("visual");
127
- class oe {
126
+ N.VALID_MODES = /* @__PURE__ */ new Set(["auditory", "tactile", "textual", "visual"]), N.AUDITORY = new N("auditory"), N.TACTILE = new N("tactile"), N.TEXTUAL = new N("textual"), N.VISUAL = new N("visual");
127
+ class de {
128
128
  /**
129
129
  * Creates a [Encryption].
130
130
  */
@@ -136,7 +136,7 @@ class oe {
136
136
  */
137
137
  static deserialize(e) {
138
138
  if (e && e.algorithm)
139
- return new oe({
139
+ return new de({
140
140
  algorithm: e.algorithm,
141
141
  compression: e.compression,
142
142
  originalLength: e.originalLength,
@@ -152,7 +152,7 @@ class oe {
152
152
  return this.compression !== void 0 && (e.compression = this.compression), this.originalLength !== void 0 && (e.originalLength = this.originalLength), this.profile !== void 0 && (e.profile = this.profile), this.scheme !== void 0 && (e.scheme = this.scheme), e;
153
153
  }
154
154
  }
155
- class S {
155
+ class C {
156
156
  constructor(e) {
157
157
  this.otherProperties = e;
158
158
  }
@@ -164,7 +164,7 @@ class S {
164
164
  */
165
165
  static deserialize(e) {
166
166
  if (e)
167
- return new S(e);
167
+ return new C(e);
168
168
  }
169
169
  /**
170
170
  * Serializes a [Properties] to its RWPM JSON representation.
@@ -179,46 +179,46 @@ class S {
179
179
  const t = Object.assign({}, this.otherProperties);
180
180
  for (const i in e)
181
181
  t[i] = e[i];
182
- return new S(t);
182
+ return new C(t);
183
183
  }
184
184
  }
185
- Object.defineProperty(S.prototype, "encryption", {
185
+ Object.defineProperty(C.prototype, "encryption", {
186
186
  get: function() {
187
- return oe.deserialize(this.otherProperties.encrypted);
187
+ return de.deserialize(this.otherProperties.encrypted);
188
188
  }
189
189
  });
190
- function Ze(s) {
191
- return s && Array.isArray(s) ? s : void 0;
190
+ function st(r) {
191
+ return r && Array.isArray(r) ? r : void 0;
192
192
  }
193
- function De(s) {
194
- return s && typeof s == "string" ? [s] : Ze(s);
193
+ function $e(r) {
194
+ return r && typeof r == "string" ? [r] : st(r);
195
195
  }
196
- function ge(s) {
197
- return typeof s == "string" ? new Date(s) : void 0;
196
+ function Te(r) {
197
+ return typeof r == "string" ? new Date(r) : void 0;
198
198
  }
199
- function V(s) {
200
- return isNaN(s) ? void 0 : s;
199
+ function G(r) {
200
+ return isNaN(r) ? void 0 : r;
201
201
  }
202
- function w(s) {
203
- return V(s) !== void 0 && Math.sign(s) >= 0 ? s : void 0;
202
+ function S(r) {
203
+ return G(r) !== void 0 && Math.sign(r) >= 0 ? r : void 0;
204
204
  }
205
- function Je(s) {
205
+ function rt(r) {
206
206
  const e = new Array();
207
- return s.forEach((t) => e.push(t)), e;
207
+ return r.forEach((t) => e.push(t)), e;
208
208
  }
209
209
  class a {
210
210
  /** Creates a MediaType object. */
211
211
  constructor(e) {
212
- let t, i, r = e.mediaType.replace(/\s/g, "").split(";");
213
- const n = r[0].split("/");
212
+ let t, i, s = e.mediaType.replace(/\s/g, "").split(";");
213
+ const n = s[0].split("/");
214
214
  if (n.length === 2) {
215
215
  if (t = n[0].toLowerCase().trim(), i = n[1].toLowerCase().trim(), t.length === 0 || i.length === 0)
216
216
  throw new Error("Invalid media type");
217
217
  } else
218
218
  throw new Error("Invalid media type");
219
219
  const o = {};
220
- for (let p = 1; p < r.length; p++) {
221
- const y = r[p].split("=");
220
+ for (let p = 1; p < s.length; p++) {
221
+ const y = s[p].split("=");
222
222
  if (y.length === 2) {
223
223
  const d = y[0].toLocaleLowerCase(), f = d === "charset" ? y[1].toUpperCase() : y[1];
224
224
  o[d] = f;
@@ -270,11 +270,11 @@ class a {
270
270
  return !1;
271
271
  const i = new Set(
272
272
  Object.entries(this.parameters).map(([n, o]) => `${n}=${o}`)
273
- ), r = new Set(
273
+ ), s = new Set(
274
274
  Object.entries(t.parameters).map(([n, o]) => `${n}=${o}`)
275
275
  );
276
276
  for (const n of Array.from(i.values()))
277
- if (!r.has(n))
277
+ if (!s.has(n))
278
278
  return !1;
279
279
  return !0;
280
280
  }
@@ -661,7 +661,7 @@ class a {
661
661
  });
662
662
  }
663
663
  }
664
- class ye {
664
+ class we {
665
665
  constructor(e) {
666
666
  this.uri = e, this.parameters = this.getParameters(e);
667
667
  }
@@ -671,7 +671,7 @@ class ye {
671
671
  getParameters(e) {
672
672
  const t = /\{\??([^}]+)\}/g, i = e.match(t);
673
673
  return i ? new Set(
674
- i.join(",").replace(t, "$1").split(",").map((r) => r.trim())
674
+ i.join(",").replace(t, "$1").split(",").map((s) => s.trim())
675
675
  ) : /* @__PURE__ */ new Set();
676
676
  }
677
677
  /** Expands the URI by replacing the template variables by the given parameters.
@@ -679,17 +679,17 @@ class ye {
679
679
  * See RFC 6570 on URI template: https://tools.ietf.org/html/rfc6570
680
680
  */
681
681
  expand(e) {
682
- const t = (r) => r.split(",").map((n) => {
682
+ const t = (s) => s.split(",").map((n) => {
683
683
  const o = e[n];
684
684
  return o ? encodeURIComponent(o) : "";
685
- }).join(","), i = (r) => "?" + r.split(",").map((n) => {
685
+ }).join(","), i = (s) => "?" + s.split(",").map((n) => {
686
686
  const o = n.split("=")[0], l = e[o];
687
687
  return l ? `${o}=${encodeURIComponent(l)}` : "";
688
688
  }).join("&");
689
- return this.uri.replace(/\{(\??)([^}]+)\}/g, (...r) => r[1] ? i(r[2]) : t(r[2]));
689
+ return this.uri.replace(/\{(\??)([^}]+)\}/g, (...s) => s[1] ? i(s[2]) : t(s[2]));
690
690
  }
691
691
  }
692
- class v {
692
+ class b {
693
693
  /**
694
694
  * Creates a [Locations].
695
695
  */
@@ -701,7 +701,7 @@ class v {
701
701
  */
702
702
  static deserialize(e) {
703
703
  if (!e) return;
704
- const t = V(e.progression), i = V(e.totalProgression), r = V(e.position), n = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set([
704
+ const t = G(e.progression), i = G(e.totalProgression), s = G(e.position), n = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set([
705
705
  "fragment",
706
706
  "fragments",
707
707
  "progression",
@@ -710,11 +710,11 @@ class v {
710
710
  ]);
711
711
  return Object.entries(e).forEach(([l, u]) => {
712
712
  o.has(l) || n.set(l, u);
713
- }), new v({
714
- fragments: De(e.fragments || e.fragment),
713
+ }), new b({
714
+ fragments: $e(e.fragments || e.fragment),
715
715
  progression: t !== void 0 && t >= 0 && t <= 1 ? t : void 0,
716
716
  totalProgression: i !== void 0 && i >= 0 && i <= 1 ? i : void 0,
717
- position: r !== void 0 && r > 0 ? r : void 0,
717
+ position: s !== void 0 && s > 0 ? s : void 0,
718
718
  otherLocations: n.size === 0 ? void 0 : n
719
719
  });
720
720
  }
@@ -726,7 +726,7 @@ class v {
726
726
  return this.fragments && (e.fragments = this.fragments), this.progression !== void 0 && (e.progression = this.progression), this.totalProgression !== void 0 && (e.totalProgression = this.totalProgression), this.position !== void 0 && (e.position = this.position), this.otherLocations && this.otherLocations.forEach((t, i) => e[i] = t), e;
727
727
  }
728
728
  }
729
- class W {
729
+ class D {
730
730
  /**
731
731
  * Creates a [Text].
732
732
  */
@@ -738,7 +738,7 @@ class W {
738
738
  */
739
739
  static deserialize(e) {
740
740
  if (e)
741
- return new W({
741
+ return new D({
742
742
  after: e.after,
743
743
  before: e.before,
744
744
  highlight: e.highlight
@@ -752,24 +752,24 @@ class W {
752
752
  return this.after !== void 0 && (e.after = this.after), this.before !== void 0 && (e.before = this.before), this.highlight !== void 0 && (e.highlight = this.highlight), e;
753
753
  }
754
754
  }
755
- class L {
755
+ class I {
756
756
  /**
757
757
  * Creates a [Locator].
758
758
  */
759
759
  constructor(e) {
760
- this.href = e.href, this.type = e.type, this.title = e.title, this.locations = e.locations ? e.locations : new v({}), this.text = e.text;
760
+ this.href = e.href, this.type = e.type, this.title = e.title, this.locations = e.locations ? e.locations : new b({}), this.text = e.text;
761
761
  }
762
762
  /**
763
763
  * Parses a [Link] from its RWPM JSON representation.
764
764
  */
765
765
  static deserialize(e) {
766
766
  if (e && e.href && e.type)
767
- return new L({
767
+ return new I({
768
768
  href: e.href,
769
769
  type: e.type,
770
770
  title: e.title,
771
- locations: v.deserialize(e.locations),
772
- text: W.deserialize(e.text)
771
+ locations: b.deserialize(e.locations),
772
+ text: D.deserialize(e.text)
773
773
  });
774
774
  }
775
775
  /**
@@ -783,16 +783,16 @@ class L {
783
783
  * Shortcut to get a copy of the [Locator] with different [Locations] sub-properties.
784
784
  */
785
785
  copyWithLocations(e) {
786
- return new L({
786
+ return new I({
787
787
  href: this.href,
788
788
  type: this.type,
789
789
  title: this.title,
790
790
  text: this.text,
791
- locations: new v({ ...this.locations, ...e })
791
+ locations: new b({ ...this.locations, ...e })
792
792
  });
793
793
  }
794
794
  }
795
- class D {
795
+ class U {
796
796
  /**
797
797
  * Creates a [Link].
798
798
  */
@@ -804,21 +804,21 @@ class D {
804
804
  */
805
805
  static deserialize(e) {
806
806
  if (!(!e || typeof e.href != "string"))
807
- return new D({
807
+ return new U({
808
808
  href: e.href,
809
809
  templated: e.templated,
810
810
  type: e.type,
811
811
  title: e.title,
812
812
  rels: e.rel ? Array.isArray(e.rel) ? new Set(e.rel) : /* @__PURE__ */ new Set([e.rel]) : void 0,
813
- properties: S.deserialize(e.properties),
814
- height: w(e.height),
815
- width: w(e.width),
816
- size: w(e.size),
817
- duration: w(e.duration),
818
- bitrate: w(e.bitrate),
819
- languages: De(e.language),
820
- alternates: j.deserialize(e.alternate),
821
- children: j.deserialize(e.children)
813
+ properties: C.deserialize(e.properties),
814
+ height: S(e.height),
815
+ width: S(e.width),
816
+ size: S(e.size),
817
+ duration: S(e.duration),
818
+ bitrate: S(e.bitrate),
819
+ languages: $e(e.language),
820
+ alternates: Y.deserialize(e.alternate),
821
+ children: Y.deserialize(e.children)
822
822
  });
823
823
  }
824
824
  /**
@@ -826,7 +826,7 @@ class D {
826
826
  */
827
827
  serialize() {
828
828
  const e = { href: this.href };
829
- return this.templated !== void 0 && (e.templated = this.templated), this.type !== void 0 && (e.type = this.type), this.title !== void 0 && (e.title = this.title), this.rels && (e.rel = Je(this.rels)), this.properties && (e.properties = this.properties.serialize()), this.height !== void 0 && (e.height = this.height), this.width !== void 0 && (e.width = this.width), this.size !== void 0 && (e.size = this.size), this.duration !== void 0 && (e.duration = this.duration), this.bitrate !== void 0 && (e.bitrate = this.bitrate), this.languages && (e.language = this.languages), this.alternates && (e.alternate = this.alternates.serialize()), this.children && (e.children = this.children.serialize()), e;
829
+ return this.templated !== void 0 && (e.templated = this.templated), this.type !== void 0 && (e.type = this.type), this.title !== void 0 && (e.title = this.title), this.rels && (e.rel = rt(this.rels)), this.properties && (e.properties = this.properties.serialize()), this.height !== void 0 && (e.height = this.height), this.width !== void 0 && (e.width = this.width), this.size !== void 0 && (e.size = this.size), this.duration !== void 0 && (e.duration = this.duration), this.bitrate !== void 0 && (e.bitrate = this.bitrate), this.languages && (e.language = this.languages), this.alternates && (e.alternate = this.alternates.serialize()), this.children && (e.children = this.children.serialize()), e;
830
830
  }
831
831
  /** MediaType of the linked resource. */
832
832
  get mediaType() {
@@ -843,14 +843,14 @@ class D {
843
843
  }
844
844
  /** List of URI template parameter keys, if the `Link` is templated. */
845
845
  get templateParameters() {
846
- return this.templated ? new ye(this.href).parameters : /* @__PURE__ */ new Set();
846
+ return this.templated ? new we(this.href).parameters : /* @__PURE__ */ new Set();
847
847
  }
848
848
  /** Expands the `Link`'s HREF by replacing URI template variables by the given parameters.
849
849
  * See RFC 6570 on URI template: https://tools.ietf.org/html/rfc6570
850
850
  */
851
851
  expandTemplate(e) {
852
- return new D({
853
- href: new ye(this.href).expand(e),
852
+ return new U({
853
+ href: new we(this.href).expand(e),
854
854
  templated: !1
855
855
  });
856
856
  }
@@ -858,25 +858,25 @@ class D {
858
858
  * Makes a copy of this [Link] after merging in the given additional other [properties].
859
859
  */
860
860
  addProperties(e) {
861
- const t = D.deserialize(this.serialize());
862
- return t.properties = t.properties ? t.properties?.add(e) : new S(e), t;
861
+ const t = U.deserialize(this.serialize());
862
+ return t.properties = t.properties ? t.properties?.add(e) : new C(e), t;
863
863
  }
864
864
  /**
865
865
  * Creates a [Locator] from a reading order [Link].
866
866
  */
867
867
  get locator() {
868
868
  let e = this.href.split("#");
869
- return new L({
869
+ return new I({
870
870
  href: e.length > 0 && e[0] !== void 0 ? e[0] : this.href,
871
871
  type: this.type ?? "",
872
872
  title: this.title,
873
- locations: new v({
873
+ locations: new b({
874
874
  fragments: e.length > 1 && e[1] !== void 0 ? [e[1]] : []
875
875
  })
876
876
  });
877
877
  }
878
878
  }
879
- class j {
879
+ class Y {
880
880
  /**
881
881
  * Creates a [Links].
882
882
  */
@@ -888,8 +888,8 @@ class j {
888
888
  */
889
889
  static deserialize(e) {
890
890
  if (e && Array.isArray(e))
891
- return new j(
892
- e.map((t) => D.deserialize(t)).filter((t) => t !== void 0)
891
+ return new Y(
892
+ e.map((t) => U.deserialize(t)).filter((t) => t !== void 0)
893
893
  );
894
894
  }
895
895
  /**
@@ -931,8 +931,8 @@ class j {
931
931
  /** Finds all the links matching any of the given media types. */
932
932
  filterByMediaTypes(e) {
933
933
  const t = (i) => {
934
- for (const r of e)
935
- if (i.mediaType.matches(r))
934
+ for (const s of e)
935
+ if (i.mediaType.matches(s))
936
936
  return !0;
937
937
  return !1;
938
938
  };
@@ -970,10 +970,10 @@ class j {
970
970
  return this.items.filter((e) => e.type);
971
971
  }
972
972
  }
973
- S.prototype.getContains = function() {
973
+ C.prototype.getContains = function() {
974
974
  return new Set(this.otherProperties.contains || []);
975
975
  };
976
- class q {
976
+ class K {
977
977
  /**
978
978
  * Creates a [DomRange].
979
979
  */
@@ -985,10 +985,10 @@ class q {
985
985
  */
986
986
  static deserialize(e) {
987
987
  if (!(e && e.cssSelector)) return;
988
- let t = w(e.textNodeIndex);
988
+ let t = S(e.textNodeIndex);
989
989
  if (t === void 0) return;
990
- let i = w(e.charOffset);
991
- return i === void 0 && (i = w(e.offset)), new q({
990
+ let i = S(e.charOffset);
991
+ return i === void 0 && (i = S(e.offset)), new K({
992
992
  cssSelector: e.cssSelector,
993
993
  textNodeIndex: t,
994
994
  charOffset: i
@@ -1005,7 +1005,7 @@ class q {
1005
1005
  return this.charOffset !== void 0 && (e.charOffset = this.charOffset), e;
1006
1006
  }
1007
1007
  }
1008
- class ae {
1008
+ class pe {
1009
1009
  /**
1010
1010
  * Creates a [DomRange].
1011
1011
  */
@@ -1017,11 +1017,11 @@ class ae {
1017
1017
  */
1018
1018
  static deserialize(e) {
1019
1019
  if (!e) return;
1020
- let t = q.deserialize(e.start);
1020
+ let t = K.deserialize(e.start);
1021
1021
  if (t)
1022
- return new ae({
1022
+ return new pe({
1023
1023
  start: t,
1024
- end: q.deserialize(e.end)
1024
+ end: K.deserialize(e.end)
1025
1025
  });
1026
1026
  }
1027
1027
  /**
@@ -1032,48 +1032,48 @@ class ae {
1032
1032
  return this.end && (e.end = this.end.serialize()), e;
1033
1033
  }
1034
1034
  }
1035
- v.prototype.getCssSelector = function() {
1035
+ b.prototype.getCssSelector = function() {
1036
1036
  return this.otherLocations?.get("cssSelector");
1037
1037
  };
1038
- v.prototype.getPartialCfi = function() {
1038
+ b.prototype.getPartialCfi = function() {
1039
1039
  return this.otherLocations?.get("partialCfi");
1040
1040
  };
1041
- v.prototype.getDomRange = function() {
1042
- return ae.deserialize(this.otherLocations?.get("domRange"));
1041
+ b.prototype.getDomRange = function() {
1042
+ return pe.deserialize(this.otherLocations?.get("domRange"));
1043
1043
  };
1044
- v.prototype.fragmentParameters = function() {
1044
+ b.prototype.fragmentParameters = function() {
1045
1045
  return new Map(
1046
- this.fragments.map((s) => s.startsWith("#") ? s.slice(1) : s).join("&").split("&").filter((s) => !s.startsWith("#")).map((s) => s.split("=")).filter((s) => s.length === 2).map((s) => [
1047
- s[0].trim().toLowerCase(),
1048
- s[1].trim()
1046
+ this.fragments.map((r) => r.startsWith("#") ? r.slice(1) : r).join("&").split("&").filter((r) => !r.startsWith("#")).map((r) => r.split("=")).filter((r) => r.length === 2).map((r) => [
1047
+ r[0].trim().toLowerCase(),
1048
+ r[1].trim()
1049
1049
  ])
1050
1050
  );
1051
1051
  };
1052
- v.prototype.htmlId = function() {
1052
+ b.prototype.htmlId = function() {
1053
1053
  if (!this.fragments.length) return;
1054
- let s = this.fragments.find((e) => e.length && !e.includes("="));
1055
- if (!s) {
1054
+ let r = this.fragments.find((e) => e.length && !e.includes("="));
1055
+ if (!r) {
1056
1056
  const e = this.fragmentParameters();
1057
- e.has("id") ? s = e.get("id") : e.has("name") && (s = e.get("name"));
1057
+ e.has("id") ? r = e.get("id") : e.has("name") && (r = e.get("name"));
1058
1058
  }
1059
- return s?.startsWith("#") ? s.slice(1) : s;
1059
+ return r?.startsWith("#") ? r.slice(1) : r;
1060
1060
  };
1061
- v.prototype.page = function() {
1062
- const s = parseInt(this.fragmentParameters().get("page"));
1063
- if (!isNaN(s) && s >= 0) return s;
1061
+ b.prototype.page = function() {
1062
+ const r = parseInt(this.fragmentParameters().get("page"));
1063
+ if (!isNaN(r) && r >= 0) return r;
1064
1064
  };
1065
- v.prototype.time = function() {
1066
- const s = parseInt(this.fragmentParameters().get("t"));
1067
- if (!isNaN(s)) return s;
1065
+ b.prototype.time = function() {
1066
+ const r = parseInt(this.fragmentParameters().get("t"));
1067
+ if (!isNaN(r)) return r;
1068
1068
  };
1069
- v.prototype.space = function() {
1070
- const s = this.fragmentParameters();
1071
- if (!s.has("xywh")) return;
1072
- const e = s.get("xywh").split(",").map((t) => parseInt(t));
1069
+ b.prototype.space = function() {
1070
+ const r = this.fragmentParameters();
1071
+ if (!r.has("xywh")) return;
1072
+ const e = r.get("xywh").split(",").map((t) => parseInt(t));
1073
1073
  if (e.length === 4 && !e.some(isNaN))
1074
1074
  return e;
1075
1075
  };
1076
- class le {
1076
+ class fe {
1077
1077
  /** Creates a [Price]. */
1078
1078
  constructor(e) {
1079
1079
  this.currency = e.currency, this.value = e.value;
@@ -1086,9 +1086,9 @@ class le {
1086
1086
  let t = e.currency;
1087
1087
  if (!(t && typeof t == "string" && t.length > 0))
1088
1088
  return;
1089
- let i = w(e.value);
1089
+ let i = S(e.value);
1090
1090
  if (i !== void 0)
1091
- return new le({ currency: t, value: i });
1091
+ return new fe({ currency: t, value: i });
1092
1092
  }
1093
1093
  /**
1094
1094
  * Serializes a [Price] to its RWPM JSON representation.
@@ -1097,7 +1097,7 @@ class le {
1097
1097
  return { currency: this.currency, value: this.value };
1098
1098
  }
1099
1099
  }
1100
- class U {
1100
+ class H {
1101
1101
  /** Creates a [Acquisition]. */
1102
1102
  constructor(e) {
1103
1103
  this.type = e.type, this.children = e.children;
@@ -1107,14 +1107,14 @@ class U {
1107
1107
  */
1108
1108
  static deserialize(e) {
1109
1109
  if (e && e.type)
1110
- return new U({
1110
+ return new H({
1111
1111
  type: e.type,
1112
- children: U.deserializeArray(e.children)
1112
+ children: H.deserializeArray(e.children)
1113
1113
  });
1114
1114
  }
1115
1115
  static deserializeArray(e) {
1116
1116
  if (Array.isArray(e))
1117
- return e.map((t) => U.deserialize(t)).filter((t) => t !== void 0);
1117
+ return e.map((t) => H.deserialize(t)).filter((t) => t !== void 0);
1118
1118
  }
1119
1119
  /**
1120
1120
  * Serializes a [Acquisition] to its RWPM JSON representation.
@@ -1124,7 +1124,7 @@ class U {
1124
1124
  return this.children && (e.children = this.children.map((t) => t.serialize())), e;
1125
1125
  }
1126
1126
  }
1127
- class he {
1127
+ class me {
1128
1128
  /** Creates a [Price]. */
1129
1129
  constructor(e) {
1130
1130
  this.total = e.total, this.position = e.position;
@@ -1134,9 +1134,9 @@ class he {
1134
1134
  */
1135
1135
  static deserialize(e) {
1136
1136
  if (e)
1137
- return new he({
1138
- total: w(e.total),
1139
- position: w(e.position)
1137
+ return new me({
1138
+ total: S(e.total),
1139
+ position: S(e.position)
1140
1140
  });
1141
1141
  }
1142
1142
  /**
@@ -1147,7 +1147,7 @@ class he {
1147
1147
  return this.total !== void 0 && (e.total = this.total), this.position !== void 0 && (e.position = this.position), e;
1148
1148
  }
1149
1149
  }
1150
- class ce {
1150
+ class ge {
1151
1151
  /** Creates a [Copies]. */
1152
1152
  constructor(e) {
1153
1153
  this.total = e.total, this.available = e.available;
@@ -1157,9 +1157,9 @@ class ce {
1157
1157
  */
1158
1158
  static deserialize(e) {
1159
1159
  if (e)
1160
- return new ce({
1161
- total: w(e.total),
1162
- available: w(e.available)
1160
+ return new ge({
1161
+ total: S(e.total),
1162
+ available: S(e.available)
1163
1163
  });
1164
1164
  }
1165
1165
  /**
@@ -1170,7 +1170,7 @@ class ce {
1170
1170
  return this.total !== void 0 && (e.total = this.total), this.available !== void 0 && (e.available = this.available), e;
1171
1171
  }
1172
1172
  }
1173
- class ue {
1173
+ class ye {
1174
1174
  /** Creates a [Availability]. */
1175
1175
  constructor(e) {
1176
1176
  this.state = e.state, this.since = e.since, this.until = e.until;
@@ -1180,10 +1180,10 @@ class ue {
1180
1180
  */
1181
1181
  static deserialize(e) {
1182
1182
  if (e && e.state)
1183
- return new ue({
1183
+ return new ye({
1184
1184
  state: e.state,
1185
- since: ge(e.since),
1186
- until: ge(e.until)
1185
+ since: Te(e.since),
1186
+ until: Te(e.until)
1187
1187
  });
1188
1188
  }
1189
1189
  /**
@@ -1194,98 +1194,98 @@ class ue {
1194
1194
  return this.since !== void 0 && (e.since = this.since.toISOString()), this.until !== void 0 && (e.until = this.until.toISOString()), e;
1195
1195
  }
1196
1196
  }
1197
- S.prototype.getNumberOfItems = function() {
1198
- return w(this.otherProperties.numberOfItems);
1197
+ C.prototype.getNumberOfItems = function() {
1198
+ return S(this.otherProperties.numberOfItems);
1199
1199
  };
1200
- S.prototype.getPrice = function() {
1201
- return le.deserialize(this.otherProperties.price);
1200
+ C.prototype.getPrice = function() {
1201
+ return fe.deserialize(this.otherProperties.price);
1202
1202
  };
1203
- S.prototype.getIndirectAcquisitions = function() {
1204
- const s = this.otherProperties.indirectAcquisition;
1205
- if (s && Array.isArray(s))
1206
- return s.map((e) => U.deserialize(e)).filter((e) => e !== void 0);
1203
+ C.prototype.getIndirectAcquisitions = function() {
1204
+ const r = this.otherProperties.indirectAcquisition;
1205
+ if (r && Array.isArray(r))
1206
+ return r.map((e) => H.deserialize(e)).filter((e) => e !== void 0);
1207
1207
  };
1208
- S.prototype.getHolds = function() {
1209
- return he.deserialize(this.otherProperties.holds);
1208
+ C.prototype.getHolds = function() {
1209
+ return me.deserialize(this.otherProperties.holds);
1210
1210
  };
1211
- S.prototype.getCopies = function() {
1212
- return ce.deserialize(this.otherProperties.copies);
1211
+ C.prototype.getCopies = function() {
1212
+ return ge.deserialize(this.otherProperties.copies);
1213
1213
  };
1214
- S.prototype.getAvailability = function() {
1215
- return ue.deserialize(this.otherProperties.availability);
1214
+ C.prototype.getAvailability = function() {
1215
+ return ye.deserialize(this.otherProperties.availability);
1216
1216
  };
1217
- S.prototype.getAuthenticate = function() {
1218
- return D.deserialize(this.otherProperties.authenticate);
1217
+ C.prototype.getAuthenticate = function() {
1218
+ return U.deserialize(this.otherProperties.authenticate);
1219
1219
  };
1220
- const Qe = "CssSelectorGenerator";
1221
- function ve(s = "unknown problem", ...e) {
1222
- console.warn(`${Qe}: ${s}`, ...e);
1220
+ const nt = "CssSelectorGenerator";
1221
+ function Se(r = "unknown problem", ...e) {
1222
+ console.warn(`${nt}: ${r}`, ...e);
1223
1223
  }
1224
- function et(s) {
1225
- return s instanceof RegExp;
1224
+ function ot(r) {
1225
+ return r instanceof RegExp;
1226
1226
  }
1227
- function tt(s) {
1228
- return s.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".+");
1227
+ function at(r) {
1228
+ return r.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".+");
1229
1229
  }
1230
- function it(s) {
1231
- const e = s.map((t) => {
1232
- if (et(t))
1230
+ function lt(r) {
1231
+ const e = r.map((t) => {
1232
+ if (ot(t))
1233
1233
  return (i) => t.test(i);
1234
1234
  if (typeof t == "function")
1235
1235
  return (i) => {
1236
- const r = t(i);
1237
- return typeof r != "boolean" ? (ve("pattern matcher function invalid", "Provided pattern matching function does not return boolean. It's result will be ignored.", t), !1) : r;
1236
+ const s = t(i);
1237
+ return typeof s != "boolean" ? (Se("pattern matcher function invalid", "Provided pattern matching function does not return boolean. It's result will be ignored.", t), !1) : s;
1238
1238
  };
1239
1239
  if (typeof t == "string") {
1240
- const i = new RegExp("^" + tt(t) + "$");
1241
- return (r) => i.test(r);
1240
+ const i = new RegExp("^" + at(t) + "$");
1241
+ return (s) => i.test(s);
1242
1242
  }
1243
- return ve("pattern matcher invalid", "Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.", t), () => !1;
1243
+ return Se("pattern matcher invalid", "Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.", t), () => !1;
1244
1244
  });
1245
1245
  return (t) => e.some((i) => i(t));
1246
1246
  }
1247
- it([
1247
+ lt([
1248
1248
  "class",
1249
1249
  "id",
1250
1250
  // Angular attributes
1251
1251
  "ng-*"
1252
1252
  ]);
1253
- class Z {
1253
+ class X {
1254
1254
  }
1255
- function Ee(s) {
1256
- return s.split("").reverse().join("");
1255
+ function Ce(r) {
1256
+ return r.split("").reverse().join("");
1257
1257
  }
1258
- function st(s, e, t) {
1259
- const i = Ee(e);
1260
- return t.map((r) => {
1261
- const n = Math.max(0, r.end - e.length - r.errors), o = Ee(s.slice(n, r.end));
1258
+ function ht(r, e, t) {
1259
+ const i = Ce(e);
1260
+ return t.map((s) => {
1261
+ const n = Math.max(0, s.end - e.length - s.errors), o = Ce(r.slice(n, s.end));
1262
1262
  return {
1263
- start: We(o, i, r.errors).reduce((u, h) => r.end - h.end < u ? r.end - h.end : u, r.end),
1264
- end: r.end,
1265
- errors: r.errors
1263
+ start: ke(o, i, s.errors).reduce((u, h) => s.end - h.end < u ? s.end - h.end : u, s.end),
1264
+ end: s.end,
1265
+ errors: s.errors
1266
1266
  };
1267
1267
  });
1268
1268
  }
1269
- function J(s) {
1270
- return (s | -s) >> 31 & 1;
1269
+ function ie(r) {
1270
+ return (r | -r) >> 31 & 1;
1271
1271
  }
1272
- function be(s, e, t, i) {
1273
- let r = s.P[t], n = s.M[t];
1274
- const o = i >>> 31, l = e[t] | o, u = l | n, h = (l & r) + r ^ r | l;
1275
- let c = n | ~(h | r), m = r & h;
1276
- const p = J(c & s.lastRowMask[t]) - J(m & s.lastRowMask[t]);
1277
- return c <<= 1, m <<= 1, m |= o, c |= J(i) - o, r = m | ~(u | c), n = c & u, s.P[t] = r, s.M[t] = n, p;
1272
+ function Pe(r, e, t, i) {
1273
+ let s = r.P[t], n = r.M[t];
1274
+ const o = i >>> 31, l = e[t] | o, u = l | n, h = (l & s) + s ^ s | l;
1275
+ let c = n | ~(h | s), m = s & h;
1276
+ const p = ie(c & r.lastRowMask[t]) - ie(m & r.lastRowMask[t]);
1277
+ return c <<= 1, m <<= 1, m |= o, c |= ie(i) - o, s = m | ~(u | c), n = c & u, r.P[t] = s, r.M[t] = n, p;
1278
1278
  }
1279
- function We(s, e, t) {
1279
+ function ke(r, e, t) {
1280
1280
  if (e.length === 0)
1281
1281
  return [];
1282
1282
  t = Math.min(t, e.length);
1283
- const i = [], r = 32, n = Math.ceil(e.length / r) - 1, o = {
1283
+ const i = [], s = 32, n = Math.ceil(e.length / s) - 1, o = {
1284
1284
  P: new Uint32Array(n + 1),
1285
1285
  M: new Uint32Array(n + 1),
1286
1286
  lastRowMask: new Uint32Array(n + 1)
1287
1287
  };
1288
- o.lastRowMask.fill(1 << 31), o.lastRowMask[n] = 1 << (e.length - 1) % r;
1288
+ o.lastRowMask.fill(1 << 31), o.lastRowMask[n] = 1 << (e.length - 1) % s;
1289
1289
  const l = new Uint32Array(n + 1), u = /* @__PURE__ */ new Map(), h = [];
1290
1290
  for (let p = 0; p < 256; p++)
1291
1291
  h.push(l);
@@ -1297,39 +1297,39 @@ function We(s, e, t) {
1297
1297
  u.set(y, d), y < h.length && (h[y] = d);
1298
1298
  for (let f = 0; f <= n; f += 1) {
1299
1299
  d[f] = 0;
1300
- for (let g = 0; g < r; g += 1) {
1301
- const E = f * r + g;
1300
+ for (let g = 0; g < s; g += 1) {
1301
+ const E = f * s + g;
1302
1302
  if (E >= e.length)
1303
1303
  continue;
1304
1304
  e.charCodeAt(E) === y && (d[f] |= 1 << g);
1305
1305
  }
1306
1306
  }
1307
1307
  }
1308
- let c = Math.max(0, Math.ceil(t / r) - 1);
1308
+ let c = Math.max(0, Math.ceil(t / s) - 1);
1309
1309
  const m = new Uint32Array(n + 1);
1310
1310
  for (let p = 0; p <= c; p += 1)
1311
- m[p] = (p + 1) * r;
1311
+ m[p] = (p + 1) * s;
1312
1312
  m[n] = e.length;
1313
1313
  for (let p = 0; p <= c; p += 1)
1314
1314
  o.P[p] = -1, o.M[p] = 0;
1315
- for (let p = 0; p < s.length; p += 1) {
1316
- const y = s.charCodeAt(p);
1315
+ for (let p = 0; p < r.length; p += 1) {
1316
+ const y = r.charCodeAt(p);
1317
1317
  let d;
1318
1318
  y < h.length ? d = h[y] : (d = u.get(y), typeof d > "u" && (d = l));
1319
1319
  let f = 0;
1320
1320
  for (let g = 0; g <= c; g += 1)
1321
- f = be(o, d, g, f), m[g] += f;
1321
+ f = Pe(o, d, g, f), m[g] += f;
1322
1322
  if (m[c] - f <= t && c < n && (d[c + 1] & 1 || f < 0)) {
1323
1323
  c += 1, o.P[c] = -1, o.M[c] = 0;
1324
1324
  let g;
1325
1325
  if (c === n) {
1326
- const E = e.length % r;
1327
- g = E === 0 ? r : E;
1326
+ const E = e.length % s;
1327
+ g = E === 0 ? s : E;
1328
1328
  } else
1329
- g = r;
1330
- m[c] = m[c - 1] + g - f + be(o, d, c, f);
1329
+ g = s;
1330
+ m[c] = m[c - 1] + g - f + Pe(o, d, c, f);
1331
1331
  } else
1332
- for (; c > 0 && m[c] >= t + r; )
1332
+ for (; c > 0 && m[c] >= t + s; )
1333
1333
  c -= 1;
1334
1334
  c === n && m[c] <= t && (m[c] < t && i.splice(0, i.length), i.push({
1335
1335
  start: -1,
@@ -1339,65 +1339,65 @@ function We(s, e, t) {
1339
1339
  }
1340
1340
  return i;
1341
1341
  }
1342
- function rt(s, e, t) {
1343
- const i = We(s, e, t);
1344
- return st(s, e, i);
1342
+ function ct(r, e, t) {
1343
+ const i = ke(r, e, t);
1344
+ return ht(r, e, i);
1345
1345
  }
1346
- function Fe(s, e, t) {
1346
+ function Ve(r, e, t) {
1347
1347
  let i = 0;
1348
- const r = [];
1348
+ const s = [];
1349
1349
  for (; i !== -1; )
1350
- i = s.indexOf(e, i), i !== -1 && (r.push({
1350
+ i = r.indexOf(e, i), i !== -1 && (s.push({
1351
1351
  start: i,
1352
1352
  end: i + e.length,
1353
1353
  errors: 0
1354
1354
  }), i += 1);
1355
- return r.length > 0 ? r : rt(s, e, t);
1355
+ return s.length > 0 ? s : ct(r, e, t);
1356
1356
  }
1357
- function xe(s, e) {
1358
- return e.length === 0 || s.length === 0 ? 0 : 1 - Fe(s, e, e.length)[0].errors / e.length;
1357
+ function Ae(r, e) {
1358
+ return e.length === 0 || r.length === 0 ? 0 : 1 - Ve(r, e, e.length)[0].errors / e.length;
1359
1359
  }
1360
- function nt(s, e, t = {}) {
1360
+ function ut(r, e, t = {}) {
1361
1361
  if (e.length === 0)
1362
1362
  return null;
1363
- const i = Math.min(256, e.length / 2), r = Fe(s, e, i);
1364
- if (r.length === 0)
1363
+ const i = Math.min(256, e.length / 2), s = Ve(r, e, i);
1364
+ if (s.length === 0)
1365
1365
  return null;
1366
1366
  const n = (l) => {
1367
- const p = 1 - l.errors / e.length, y = t.prefix ? xe(
1368
- s.slice(
1367
+ const p = 1 - l.errors / e.length, y = t.prefix ? Ae(
1368
+ r.slice(
1369
1369
  Math.max(0, l.start - t.prefix.length),
1370
1370
  l.start
1371
1371
  ),
1372
1372
  t.prefix
1373
- ) : 1, d = t.suffix ? xe(
1374
- s.slice(l.end, l.end + t.suffix.length),
1373
+ ) : 1, d = t.suffix ? Ae(
1374
+ r.slice(l.end, l.end + t.suffix.length),
1375
1375
  t.suffix
1376
1376
  ) : 1;
1377
1377
  let f = 1;
1378
- return typeof t.hint == "number" && (f = 1 - Math.abs(l.start - t.hint) / s.length), (50 * p + 20 * y + 20 * d + 2 * f) / 92;
1379
- }, o = r.map((l) => ({
1378
+ return typeof t.hint == "number" && (f = 1 - Math.abs(l.start - t.hint) / r.length), (50 * p + 20 * y + 20 * d + 2 * f) / 92;
1379
+ }, o = s.map((l) => ({
1380
1380
  start: l.start,
1381
1381
  end: l.end,
1382
1382
  score: n(l)
1383
1383
  }));
1384
1384
  return o.sort((l, u) => u.score - l.score), o[0];
1385
1385
  }
1386
- function Q(s, e, t) {
1386
+ function se(r, e, t) {
1387
1387
  const i = t === 1 ? e : e - 1;
1388
- if (s.charAt(i).trim() !== "")
1388
+ if (r.charAt(i).trim() !== "")
1389
1389
  return e;
1390
- let r, n;
1391
- if (t === 2 ? (r = s.substring(0, e), n = r.trimEnd()) : (r = s.substring(e), n = r.trimStart()), !n.length)
1390
+ let s, n;
1391
+ if (t === 2 ? (s = r.substring(0, e), n = s.trimEnd()) : (s = r.substring(e), n = s.trimStart()), !n.length)
1392
1392
  return -1;
1393
- const o = r.length - n.length;
1393
+ const o = s.length - n.length;
1394
1394
  return t === 2 ? e - o : e + o;
1395
1395
  }
1396
- function Te(s, e) {
1397
- const t = s.commonAncestorContainer.ownerDocument.createNodeIterator(
1398
- s.commonAncestorContainer,
1396
+ function Me(r, e) {
1397
+ const t = r.commonAncestorContainer.ownerDocument.createNodeIterator(
1398
+ r.commonAncestorContainer,
1399
1399
  NodeFilter.SHOW_TEXT
1400
- ), i = e === 1 ? s.startContainer : s.endContainer, r = e === 1 ? s.endContainer : s.startContainer;
1400
+ ), i = e === 1 ? r.startContainer : r.endContainer, s = e === 1 ? r.endContainer : r.startContainer;
1401
1401
  let n = t.nextNode();
1402
1402
  for (; n && n !== i; )
1403
1403
  n = t.nextNode();
@@ -1406,42 +1406,42 @@ function Te(s, e) {
1406
1406
  const l = () => {
1407
1407
  if (n = e === 1 ? t.nextNode() : t.previousNode(), n) {
1408
1408
  const u = n.textContent, h = e === 1 ? 0 : u.length;
1409
- o = Q(u, h, e);
1409
+ o = se(u, h, e);
1410
1410
  }
1411
1411
  };
1412
- for (; n && o === -1 && n !== r; )
1412
+ for (; n && o === -1 && n !== s; )
1413
1413
  l();
1414
1414
  if (n && o >= 0)
1415
1415
  return { node: n, offset: o };
1416
1416
  throw new RangeError("No text nodes with non-whitespace text found in range");
1417
1417
  }
1418
- function ot(s) {
1419
- if (!s.toString().trim().length)
1418
+ function dt(r) {
1419
+ if (!r.toString().trim().length)
1420
1420
  throw new RangeError("Range contains no non-whitespace text");
1421
- if (s.startContainer.nodeType !== Node.TEXT_NODE)
1421
+ if (r.startContainer.nodeType !== Node.TEXT_NODE)
1422
1422
  throw new RangeError("Range startContainer is not a text node");
1423
- if (s.endContainer.nodeType !== Node.TEXT_NODE)
1423
+ if (r.endContainer.nodeType !== Node.TEXT_NODE)
1424
1424
  throw new RangeError("Range endContainer is not a text node");
1425
- const e = s.cloneRange();
1425
+ const e = r.cloneRange();
1426
1426
  let t = !1, i = !1;
1427
- const r = {
1428
- start: Q(
1429
- s.startContainer.textContent,
1430
- s.startOffset,
1427
+ const s = {
1428
+ start: se(
1429
+ r.startContainer.textContent,
1430
+ r.startOffset,
1431
1431
  1
1432
1432
  /* Forwards */
1433
1433
  ),
1434
- end: Q(
1435
- s.endContainer.textContent,
1436
- s.endOffset,
1434
+ end: se(
1435
+ r.endContainer.textContent,
1436
+ r.endOffset,
1437
1437
  2
1438
1438
  /* Backwards */
1439
1439
  )
1440
1440
  };
1441
- if (r.start >= 0 && (e.setStart(s.startContainer, r.start), t = !0), r.end > 0 && (e.setEnd(s.endContainer, r.end), i = !0), t && i)
1441
+ if (s.start >= 0 && (e.setStart(r.startContainer, s.start), t = !0), s.end > 0 && (e.setEnd(r.endContainer, s.end), i = !0), t && i)
1442
1442
  return e;
1443
1443
  if (!t) {
1444
- const { node: n, offset: o } = Te(
1444
+ const { node: n, offset: o } = Me(
1445
1445
  e,
1446
1446
  1
1447
1447
  /* Forwards */
@@ -1449,7 +1449,7 @@ function ot(s) {
1449
1449
  n && o >= 0 && e.setStart(n, o);
1450
1450
  }
1451
1451
  if (!i) {
1452
- const { node: n, offset: o } = Te(
1452
+ const { node: n, offset: o } = Me(
1453
1453
  e,
1454
1454
  2
1455
1455
  /* Backwards */
@@ -1458,37 +1458,37 @@ function ot(s) {
1458
1458
  }
1459
1459
  return e;
1460
1460
  }
1461
- function Ue(s) {
1462
- switch (s.nodeType) {
1461
+ function je(r) {
1462
+ switch (r.nodeType) {
1463
1463
  case Node.ELEMENT_NODE:
1464
1464
  case Node.TEXT_NODE:
1465
- return s.textContent?.length ?? 0;
1465
+ return r.textContent?.length ?? 0;
1466
1466
  default:
1467
1467
  return 0;
1468
1468
  }
1469
1469
  }
1470
- function we(s) {
1471
- let e = s.previousSibling, t = 0;
1470
+ function Ne(r) {
1471
+ let e = r.previousSibling, t = 0;
1472
1472
  for (; e; )
1473
- t += Ue(e), e = e.previousSibling;
1473
+ t += je(e), e = e.previousSibling;
1474
1474
  return t;
1475
1475
  }
1476
- function Be(s, ...e) {
1476
+ function qe(r, ...e) {
1477
1477
  let t = e.shift();
1478
- const i = s.ownerDocument.createNodeIterator(
1479
- s,
1478
+ const i = r.ownerDocument.createNodeIterator(
1479
+ r,
1480
1480
  NodeFilter.SHOW_TEXT
1481
- ), r = [];
1481
+ ), s = [];
1482
1482
  let n = i.nextNode(), o, l = 0;
1483
1483
  for (; t !== void 0 && n; )
1484
- o = n, l + o.data.length > t ? (r.push({ node: o, offset: t - l }), t = e.shift()) : (n = i.nextNode(), l += o.data.length);
1484
+ o = n, l + o.data.length > t ? (s.push({ node: o, offset: t - l }), t = e.shift()) : (n = i.nextNode(), l += o.data.length);
1485
1485
  for (; t !== void 0 && o && l === t; )
1486
- r.push({ node: o, offset: o.data.length }), t = e.shift();
1486
+ s.push({ node: o, offset: o.data.length }), t = e.shift();
1487
1487
  if (t !== void 0)
1488
1488
  throw new RangeError("Offset exceeds text length");
1489
- return r;
1489
+ return s;
1490
1490
  }
1491
- class A {
1491
+ class M {
1492
1492
  constructor(e, t) {
1493
1493
  if (t < 0)
1494
1494
  throw new Error("Offset is invalid");
@@ -1505,8 +1505,8 @@ class A {
1505
1505
  throw new Error("Parent is not an ancestor of current element");
1506
1506
  let t = this.element, i = this.offset;
1507
1507
  for (; t !== e; )
1508
- i += we(t), t = t.parentElement;
1509
- return new A(t, i);
1508
+ i += Ne(t), t = t.parentElement;
1509
+ return new M(t, i);
1510
1510
  }
1511
1511
  /**
1512
1512
  * Resolve the position to a specific text node and offset within that node.
@@ -1527,7 +1527,7 @@ class A {
1527
1527
  */
1528
1528
  resolve(e = {}) {
1529
1529
  try {
1530
- return Be(this.element, this.offset)[0];
1530
+ return qe(this.element, this.offset)[0];
1531
1531
  } catch (t) {
1532
1532
  if (this.offset === 0 && e.direction !== void 0) {
1533
1533
  const i = document.createTreeWalker(
@@ -1535,10 +1535,10 @@ class A {
1535
1535
  NodeFilter.SHOW_TEXT
1536
1536
  );
1537
1537
  i.currentNode = this.element;
1538
- const r = e.direction === 1, n = r ? i.nextNode() : i.previousNode();
1538
+ const s = e.direction === 1, n = s ? i.nextNode() : i.previousNode();
1539
1539
  if (!n)
1540
1540
  throw t;
1541
- return { node: n, offset: r ? 0 : n.data.length };
1541
+ return { node: n, offset: s ? 0 : n.data.length };
1542
1542
  } else
1543
1543
  throw t;
1544
1544
  }
@@ -1550,9 +1550,9 @@ class A {
1550
1550
  static fromCharOffset(e, t) {
1551
1551
  switch (e.nodeType) {
1552
1552
  case Node.TEXT_NODE:
1553
- return A.fromPoint(e, t);
1553
+ return M.fromPoint(e, t);
1554
1554
  case Node.ELEMENT_NODE:
1555
- return new A(e, t);
1555
+ return new M(e, t);
1556
1556
  default:
1557
1557
  throw new Error("Node is not an element or text node");
1558
1558
  }
@@ -1570,23 +1570,23 @@ class A {
1570
1570
  throw new Error("Text node offset is out of range");
1571
1571
  if (!e.parentElement)
1572
1572
  throw new Error("Text node has no parent");
1573
- const i = we(e) + t;
1574
- return new A(e.parentElement, i);
1573
+ const i = Ne(e) + t;
1574
+ return new M(e.parentElement, i);
1575
1575
  }
1576
1576
  case Node.ELEMENT_NODE: {
1577
1577
  if (t < 0 || t > e.childNodes.length)
1578
1578
  throw new Error("Child node offset is out of range");
1579
1579
  let i = 0;
1580
- for (let r = 0; r < t; r++)
1581
- i += Ue(e.childNodes[r]);
1582
- return new A(e, i);
1580
+ for (let s = 0; s < t; s++)
1581
+ i += je(e.childNodes[s]);
1582
+ return new M(e, i);
1583
1583
  }
1584
1584
  default:
1585
1585
  throw new Error("Point is not in an element or text node");
1586
1586
  }
1587
1587
  }
1588
1588
  }
1589
- class O {
1589
+ class R {
1590
1590
  constructor(e, t) {
1591
1591
  this.start = e, this.end = t;
1592
1592
  }
@@ -1596,7 +1596,7 @@ class O {
1596
1596
  * `end.element`.
1597
1597
  */
1598
1598
  relativeTo(e) {
1599
- return new O(
1599
+ return new R(
1600
1600
  this.start.relativeTo(e),
1601
1601
  this.end.relativeTo(e)
1602
1602
  );
@@ -1612,7 +1612,7 @@ class O {
1612
1612
  */
1613
1613
  toRange() {
1614
1614
  let e, t;
1615
- this.start.element === this.end.element && this.start.offset <= this.end.offset ? [e, t] = Be(
1615
+ this.start.element === this.end.element && this.start.offset <= this.end.offset ? [e, t] = qe(
1616
1616
  this.start.element,
1617
1617
  this.start.offset,
1618
1618
  this.end.offset
@@ -1630,20 +1630,20 @@ class O {
1630
1630
  * Create a TextRange from a (DOM) Range
1631
1631
  */
1632
1632
  static fromRange(e) {
1633
- const t = A.fromPoint(
1633
+ const t = M.fromPoint(
1634
1634
  e.startContainer,
1635
1635
  e.startOffset
1636
- ), i = A.fromPoint(e.endContainer, e.endOffset);
1637
- return new O(t, i);
1636
+ ), i = M.fromPoint(e.endContainer, e.endOffset);
1637
+ return new R(t, i);
1638
1638
  }
1639
1639
  /**
1640
1640
  * Create a TextRange representing the `start`th to `end`th characters in
1641
1641
  * `root`
1642
1642
  */
1643
1643
  static fromOffsets(e, t, i) {
1644
- return new O(
1645
- new A(e, t),
1646
- new A(e, i)
1644
+ return new R(
1645
+ new M(e, t),
1646
+ new M(e, i)
1647
1647
  );
1648
1648
  }
1649
1649
  /**
@@ -1651,23 +1651,23 @@ class O {
1651
1651
  * whitespace
1652
1652
  */
1653
1653
  static trimmedRange(e) {
1654
- return ot(O.fromRange(e).toRange());
1654
+ return dt(R.fromRange(e).toRange());
1655
1655
  }
1656
1656
  }
1657
- class X {
1657
+ class Z {
1658
1658
  constructor(e, t, i) {
1659
1659
  this.root = e, this.start = t, this.end = i;
1660
1660
  }
1661
1661
  static fromRange(e, t) {
1662
- const i = O.fromRange(t).relativeTo(e);
1663
- return new X(
1662
+ const i = R.fromRange(t).relativeTo(e);
1663
+ return new Z(
1664
1664
  e,
1665
1665
  i.start.offset,
1666
1666
  i.end.offset
1667
1667
  );
1668
1668
  }
1669
1669
  static fromSelector(e, t) {
1670
- return new X(e, t.start, t.end);
1670
+ return new Z(e, t.start, t.end);
1671
1671
  }
1672
1672
  toSelector() {
1673
1673
  return {
@@ -1677,10 +1677,10 @@ class X {
1677
1677
  };
1678
1678
  }
1679
1679
  toRange() {
1680
- return O.fromOffsets(this.root, this.start, this.end).toRange();
1680
+ return R.fromOffsets(this.root, this.start, this.end).toRange();
1681
1681
  }
1682
1682
  }
1683
- class G {
1683
+ class J {
1684
1684
  /**
1685
1685
  * @param root - A root element from which to anchor.
1686
1686
  */
@@ -1693,15 +1693,15 @@ class G {
1693
1693
  * Will throw if `range` does not contain any text nodes.
1694
1694
  */
1695
1695
  static fromRange(e, t) {
1696
- const i = e.textContent, r = O.fromRange(t).relativeTo(e), n = r.start.offset, o = r.end.offset, l = 32;
1697
- return new G(e, i.slice(n, o), {
1696
+ const i = e.textContent, s = R.fromRange(t).relativeTo(e), n = s.start.offset, o = s.end.offset, l = 32;
1697
+ return new J(e, i.slice(n, o), {
1698
1698
  prefix: i.slice(Math.max(0, n - l), n),
1699
1699
  suffix: i.slice(o, Math.min(i.length, o + l))
1700
1700
  });
1701
1701
  }
1702
1702
  static fromSelector(e, t) {
1703
- const { prefix: i, suffix: r } = t;
1704
- return new G(e, t.exact, { prefix: i, suffix: r });
1703
+ const { prefix: i, suffix: s } = t;
1704
+ return new J(e, t.exact, { prefix: i, suffix: s });
1705
1705
  }
1706
1706
  toSelector() {
1707
1707
  return {
@@ -1715,26 +1715,26 @@ class G {
1715
1715
  return this.toPositionAnchor(e).toRange();
1716
1716
  }
1717
1717
  toPositionAnchor(e = {}) {
1718
- const t = this.root.textContent, i = nt(t, this.exact, {
1718
+ const t = this.root.textContent, i = ut(t, this.exact, {
1719
1719
  ...this.context,
1720
1720
  hint: e.hint
1721
1721
  });
1722
1722
  if (!i)
1723
1723
  throw new Error("Quote not found");
1724
- return new X(this.root, i.start, i.end);
1724
+ return new Z(this.root, i.start, i.end);
1725
1725
  }
1726
1726
  }
1727
- function at(s) {
1728
- const e = s.tagName.toUpperCase();
1727
+ function pt(r) {
1728
+ const e = r.tagName.toUpperCase();
1729
1729
  return e === "IMG" || e === "VIDEO" || e === "AUDIO" || e === "IFRAME" || e === "OBJECT" || e === "EMBED" || e === "CANVAS";
1730
1730
  }
1731
- function de(s, e) {
1731
+ function ee(r, e) {
1732
1732
  try {
1733
1733
  const t = e.locations, i = e.text;
1734
1734
  if (i && i.highlight) {
1735
- let r;
1736
- t && t.getCssSelector() && (r = s.querySelector(t.getCssSelector())), r || (r = s.body);
1737
- const n = new G(r, i.highlight, {
1735
+ let s;
1736
+ t && t.getCssSelector() && (s = r.querySelector(t.getCssSelector())), s || (s = r.body);
1737
+ const n = new J(s, i.highlight, {
1738
1738
  prefix: i.before,
1739
1739
  suffix: i.after
1740
1740
  });
@@ -1745,15 +1745,15 @@ function de(s, e) {
1745
1745
  }
1746
1746
  }
1747
1747
  if (t) {
1748
- let r = null;
1749
- if (!r && t.getCssSelector() && (r = s.querySelector(t.getCssSelector())), !r && t.fragments) {
1748
+ let s = null;
1749
+ if (!s && t.getCssSelector() && (s = r.querySelector(t.getCssSelector())), !s && t.fragments) {
1750
1750
  for (const n of t.fragments)
1751
- if (r = s.getElementById(n), r)
1751
+ if (s = r.getElementById(n), s)
1752
1752
  break;
1753
1753
  }
1754
- if (r) {
1755
- const n = s.createRange();
1756
- return r.childNodes.length === 0 || at(r) ? (n.selectNode(r), n) : (n.setStartBefore(r), n.setEndAfter(r), n);
1754
+ if (s) {
1755
+ const n = r.createRange();
1756
+ return s.childNodes.length === 0 || pt(s) ? (n.selectNode(s), n) : (n.setStartBefore(s), n.setEndAfter(s), n);
1757
1757
  }
1758
1758
  }
1759
1759
  } catch (t) {
@@ -1761,12 +1761,12 @@ function de(s, e) {
1761
1761
  }
1762
1762
  return null;
1763
1763
  }
1764
- function lt(s, e) {
1765
- let t = s.getClientRects();
1766
- t.length || s.commonAncestorContainer.nodeType === Node.ELEMENT_NODE && (t = s.commonAncestorContainer.getClientRects());
1767
- const i = 1, r = [];
1764
+ function ft(r, e) {
1765
+ let t = r.getClientRects();
1766
+ t.length || r.commonAncestorContainer.nodeType === Node.ELEMENT_NODE && (t = r.commonAncestorContainer.getClientRects());
1767
+ const i = 1, s = [];
1768
1768
  for (const h of t)
1769
- r.push({
1769
+ s.push({
1770
1770
  bottom: h.bottom,
1771
1771
  height: h.height,
1772
1772
  left: h.left,
@@ -1774,10 +1774,10 @@ function lt(s, e) {
1774
1774
  top: h.top,
1775
1775
  width: h.width
1776
1776
  });
1777
- const n = ke(
1778
- r,
1777
+ const n = Xe(
1778
+ s,
1779
1779
  i
1780
- ), o = ct(n, i), l = $e(o), u = 4;
1780
+ ), o = gt(n, i), l = _e(o), u = 4;
1781
1781
  for (let h = l.length - 1; h >= 0; h--) {
1782
1782
  const c = l[h];
1783
1783
  if (!(c.width * c.height > u))
@@ -1788,168 +1788,168 @@ function lt(s, e) {
1788
1788
  }
1789
1789
  return l;
1790
1790
  }
1791
- function ke(s, e, t) {
1792
- for (let i = 0; i < s.length; i++)
1793
- for (let r = i + 1; r < s.length; r++) {
1794
- const n = s[i], o = s[r];
1791
+ function Xe(r, e, t) {
1792
+ for (let i = 0; i < r.length; i++)
1793
+ for (let s = i + 1; s < r.length; s++) {
1794
+ const n = r[i], o = r[s];
1795
1795
  if (n === o)
1796
1796
  continue;
1797
- const l = C(n.top, o.top, e) && C(n.bottom, o.bottom, e), u = C(n.left, o.left, e) && C(n.right, o.right, e);
1798
- if (l && !u && He(n, o, e)) {
1799
- const m = s.filter((y) => y !== n && y !== o), p = ht(n, o);
1800
- return m.push(p), ke(
1797
+ const l = P(n.top, o.top, e) && P(n.bottom, o.bottom, e), u = P(n.left, o.left, e) && P(n.right, o.right, e);
1798
+ if (l && !u && Ge(n, o, e)) {
1799
+ const m = r.filter((y) => y !== n && y !== o), p = mt(n, o);
1800
+ return m.push(p), Xe(
1801
1801
  m,
1802
1802
  e
1803
1803
  );
1804
1804
  }
1805
1805
  }
1806
- return s;
1806
+ return r;
1807
1807
  }
1808
- function ht(s, e) {
1809
- const t = Math.min(s.left, e.left), i = Math.max(s.right, e.right), r = Math.min(s.top, e.top), n = Math.max(s.bottom, e.bottom);
1808
+ function mt(r, e) {
1809
+ const t = Math.min(r.left, e.left), i = Math.max(r.right, e.right), s = Math.min(r.top, e.top), n = Math.max(r.bottom, e.bottom);
1810
1810
  return {
1811
1811
  bottom: n,
1812
- height: n - r,
1812
+ height: n - s,
1813
1813
  left: t,
1814
1814
  right: i,
1815
- top: r,
1815
+ top: s,
1816
1816
  width: i - t
1817
1817
  };
1818
1818
  }
1819
- function ct(s, e) {
1820
- const t = new Set(s);
1821
- for (const i of s) {
1819
+ function gt(r, e) {
1820
+ const t = new Set(r);
1821
+ for (const i of r) {
1822
1822
  if (!(i.width > 1 && i.height > 1)) {
1823
1823
  t.delete(i);
1824
1824
  continue;
1825
1825
  }
1826
- for (const n of s)
1827
- if (i !== n && t.has(n) && ut(n, i, e)) {
1826
+ for (const n of r)
1827
+ if (i !== n && t.has(n) && yt(n, i, e)) {
1828
1828
  t.delete(i);
1829
1829
  break;
1830
1830
  }
1831
1831
  }
1832
1832
  return Array.from(t);
1833
1833
  }
1834
- function ut(s, e, t) {
1835
- return H(s, e.left, e.top, t) && H(s, e.right, e.top, t) && H(s, e.left, e.bottom, t) && H(s, e.right, e.bottom, t);
1834
+ function yt(r, e, t) {
1835
+ return _(r, e.left, e.top, t) && _(r, e.right, e.top, t) && _(r, e.left, e.bottom, t) && _(r, e.right, e.bottom, t);
1836
1836
  }
1837
- function H(s, e, t, i) {
1838
- return (s.left < e || C(s.left, e, i)) && (s.right > e || C(s.right, e, i)) && (s.top < t || C(s.top, t, i)) && (s.bottom > t || C(s.bottom, t, i));
1837
+ function _(r, e, t, i) {
1838
+ return (r.left < e || P(r.left, e, i)) && (r.right > e || P(r.right, e, i)) && (r.top < t || P(r.top, t, i)) && (r.bottom > t || P(r.bottom, t, i));
1839
1839
  }
1840
- function $e(s) {
1841
- for (let e = 0; e < s.length; e++)
1842
- for (let t = e + 1; t < s.length; t++) {
1843
- const i = s[e], r = s[t];
1844
- if (i !== r && He(i, r, -1)) {
1840
+ function _e(r) {
1841
+ for (let e = 0; e < r.length; e++)
1842
+ for (let t = e + 1; t < r.length; t++) {
1843
+ const i = r[e], s = r[t];
1844
+ if (i !== s && Ge(i, s, -1)) {
1845
1845
  let n = [], o;
1846
- const l = Se(i, r);
1846
+ const l = Oe(i, s);
1847
1847
  if (l.length === 1)
1848
1848
  n = l, o = i;
1849
1849
  else {
1850
- const h = Se(r, i);
1851
- l.length < h.length ? (n = l, o = i) : (n = h, o = r);
1850
+ const h = Oe(s, i);
1851
+ l.length < h.length ? (n = l, o = i) : (n = h, o = s);
1852
1852
  }
1853
- const u = s.filter((h) => h !== o);
1854
- return Array.prototype.push.apply(u, n), $e(u);
1853
+ const u = r.filter((h) => h !== o);
1854
+ return Array.prototype.push.apply(u, n), _e(u);
1855
1855
  }
1856
1856
  }
1857
- return s;
1857
+ return r;
1858
1858
  }
1859
- function Se(s, e) {
1860
- const t = dt(e, s);
1859
+ function Oe(r, e) {
1860
+ const t = vt(e, r);
1861
1861
  if (t.height === 0 || t.width === 0)
1862
- return [s];
1862
+ return [r];
1863
1863
  const i = [];
1864
1864
  {
1865
- const r = {
1866
- bottom: s.bottom,
1865
+ const s = {
1866
+ bottom: r.bottom,
1867
1867
  height: 0,
1868
- left: s.left,
1868
+ left: r.left,
1869
1869
  right: t.left,
1870
- top: s.top,
1870
+ top: r.top,
1871
1871
  width: 0
1872
1872
  };
1873
- r.width = r.right - r.left, r.height = r.bottom - r.top, r.height !== 0 && r.width !== 0 && i.push(r);
1873
+ s.width = s.right - s.left, s.height = s.bottom - s.top, s.height !== 0 && s.width !== 0 && i.push(s);
1874
1874
  }
1875
1875
  {
1876
- const r = {
1876
+ const s = {
1877
1877
  bottom: t.top,
1878
1878
  height: 0,
1879
1879
  left: t.left,
1880
1880
  right: t.right,
1881
- top: s.top,
1881
+ top: r.top,
1882
1882
  width: 0
1883
1883
  };
1884
- r.width = r.right - r.left, r.height = r.bottom - r.top, r.height !== 0 && r.width !== 0 && i.push(r);
1884
+ s.width = s.right - s.left, s.height = s.bottom - s.top, s.height !== 0 && s.width !== 0 && i.push(s);
1885
1885
  }
1886
1886
  {
1887
- const r = {
1888
- bottom: s.bottom,
1887
+ const s = {
1888
+ bottom: r.bottom,
1889
1889
  height: 0,
1890
1890
  left: t.left,
1891
1891
  right: t.right,
1892
1892
  top: t.bottom,
1893
1893
  width: 0
1894
1894
  };
1895
- r.width = r.right - r.left, r.height = r.bottom - r.top, r.height !== 0 && r.width !== 0 && i.push(r);
1895
+ s.width = s.right - s.left, s.height = s.bottom - s.top, s.height !== 0 && s.width !== 0 && i.push(s);
1896
1896
  }
1897
1897
  {
1898
- const r = {
1899
- bottom: s.bottom,
1898
+ const s = {
1899
+ bottom: r.bottom,
1900
1900
  height: 0,
1901
1901
  left: t.right,
1902
- right: s.right,
1903
- top: s.top,
1902
+ right: r.right,
1903
+ top: r.top,
1904
1904
  width: 0
1905
1905
  };
1906
- r.width = r.right - r.left, r.height = r.bottom - r.top, r.height !== 0 && r.width !== 0 && i.push(r);
1906
+ s.width = s.right - s.left, s.height = s.bottom - s.top, s.height !== 0 && s.width !== 0 && i.push(s);
1907
1907
  }
1908
1908
  return i;
1909
1909
  }
1910
- function dt(s, e) {
1911
- const t = Math.max(s.left, e.left), i = Math.min(s.right, e.right), r = Math.max(s.top, e.top), n = Math.min(s.bottom, e.bottom);
1910
+ function vt(r, e) {
1911
+ const t = Math.max(r.left, e.left), i = Math.min(r.right, e.right), s = Math.max(r.top, e.top), n = Math.min(r.bottom, e.bottom);
1912
1912
  return {
1913
1913
  bottom: n,
1914
- height: Math.max(0, n - r),
1914
+ height: Math.max(0, n - s),
1915
1915
  left: t,
1916
1916
  right: i,
1917
- top: r,
1917
+ top: s,
1918
1918
  width: Math.max(0, i - t)
1919
1919
  };
1920
1920
  }
1921
- function He(s, e, t) {
1922
- return (s.left < e.right || t >= 0 && C(s.left, e.right, t)) && (e.left < s.right || t >= 0 && C(e.left, s.right, t)) && (s.top < e.bottom || t >= 0 && C(s.top, e.bottom, t)) && (e.top < s.bottom || t >= 0 && C(e.top, s.bottom, t));
1921
+ function Ge(r, e, t) {
1922
+ return (r.left < e.right || t >= 0 && P(r.left, e.right, t)) && (e.left < r.right || t >= 0 && P(e.left, r.right, t)) && (r.top < e.bottom || t >= 0 && P(r.top, e.bottom, t)) && (e.top < r.bottom || t >= 0 && P(e.top, r.bottom, t));
1923
1923
  }
1924
- function C(s, e, t) {
1925
- return Math.abs(s - e) <= t;
1924
+ function P(r, e, t) {
1925
+ return Math.abs(r - e) <= t;
1926
1926
  }
1927
- function Ve(s) {
1928
- const e = {}, t = s.document.documentElement.style;
1929
- for (const i in s.document.documentElement.style)
1927
+ function ve(r) {
1928
+ const e = {}, t = r.document.documentElement.style;
1929
+ for (const i in r.document.documentElement.style)
1930
1930
  Object.hasOwn(t, i) && !Number.isNaN(Number.parseInt(i)) && (e[t[i]] = t.getPropertyValue(t[i]));
1931
1931
  return e;
1932
1932
  }
1933
- function pt(s, e) {
1934
- const t = Ve(s);
1933
+ function Ye(r, e) {
1934
+ const t = ve(r);
1935
1935
  Object.keys(t).forEach((i) => {
1936
- e.hasOwnProperty(i) || pe(s, i);
1937
- }), Object.entries(e).forEach(([i, r]) => {
1938
- t[i] !== r && _(s, i, r);
1936
+ e.hasOwnProperty(i) || te(r, i);
1937
+ }), Object.entries(e).forEach(([i, s]) => {
1938
+ t[i] !== s && j(r, i, s);
1939
1939
  });
1940
1940
  }
1941
- function Ce(s, e) {
1942
- return s.document.documentElement.style.getPropertyValue(e);
1941
+ function Le(r, e) {
1942
+ return r.document.documentElement.style.getPropertyValue(e);
1943
1943
  }
1944
- function _(s, e, t) {
1945
- s.document.documentElement.style.setProperty(e, t);
1944
+ function j(r, e, t) {
1945
+ r.document.documentElement.style.setProperty(e, t);
1946
1946
  }
1947
- function pe(s, e) {
1948
- s.document.documentElement.style.removeProperty(e);
1947
+ function te(r, e) {
1948
+ r.document.documentElement.style.removeProperty(e);
1949
1949
  }
1950
- const ft = (s) => {
1951
- if (s.startsWith("rgb")) {
1952
- const e = s.match(/rgb\((\d+),\s(\d+),\s(\d+)(?:,\s(\d+))?\)/);
1950
+ const bt = (r) => {
1951
+ if (r.startsWith("rgb")) {
1952
+ const e = r.match(/rgb\((\d+),\s(\d+),\s(\d+)(?:,\s(\d+))?\)/);
1953
1953
  if (e)
1954
1954
  return {
1955
1955
  r: parseInt(e[1], 10),
@@ -1957,8 +1957,8 @@ const ft = (s) => {
1957
1957
  b: parseInt(e[3], 10),
1958
1958
  a: e[4] ? parseInt(e[4], 10) / 255 : 1
1959
1959
  };
1960
- } else if (s.startsWith("#")) {
1961
- const e = s.slice(1);
1960
+ } else if (r.startsWith("#")) {
1961
+ const e = r.slice(1);
1962
1962
  if (e.length === 3 || e.length === 4)
1963
1963
  return {
1964
1964
  r: parseInt(e[0] + e[0], 16) / 255,
@@ -1975,20 +1975,20 @@ const ft = (s) => {
1975
1975
  };
1976
1976
  }
1977
1977
  return { r: 0, g: 0, b: 0, a: 1 };
1978
- }, mt = (s) => 0.2126 * s.r * s.a + 0.7152 * s.g * s.a + 0.0722 * s.b * s.a, gt = (s) => {
1979
- const e = ft(s);
1980
- return mt(e) < 128;
1978
+ }, Et = (r) => 0.2126 * r.r * r.a + 0.7152 * r.g * r.a + 0.0722 * r.b * r.a, xt = (r) => {
1979
+ const e = bt(r);
1980
+ return Et(e) < 128;
1981
1981
  };
1982
- var yt = /* @__PURE__ */ ((s) => (s.Wrap = "wrap", s.Viewport = "viewport", s.Bounds = "bounds", s.Page = "page", s))(yt || {}), vt = /* @__PURE__ */ ((s) => (s.Boxes = "boxes", s.Bounds = "bounds", s))(vt || {});
1983
- const Et = () => "Highlight" in window, Pe = ["IMG", "IMAGE", "AUDIO", "VIDEO", "SVG"];
1984
- class bt {
1982
+ var Tt = /* @__PURE__ */ ((r) => (r.Wrap = "wrap", r.Viewport = "viewport", r.Bounds = "bounds", r.Page = "page", r))(Tt || {}), wt = /* @__PURE__ */ ((r) => (r.Boxes = "boxes", r.Bounds = "bounds", r))(wt || {});
1983
+ const St = () => "Highlight" in window, Ie = ["IMG", "IMAGE", "AUDIO", "VIDEO", "SVG"];
1984
+ class Ct {
1985
1985
  /**
1986
1986
  * Creates a DecorationGroup object
1987
1987
  * @param id Unique HTML ID-adhering name of the group
1988
1988
  * @param name Human-readable name of the group
1989
1989
  */
1990
- constructor(e, t, i, r) {
1991
- this.wnd = e, this.comms = t, this.id = i, this.name = r, this.items = [], this.lastItemId = 0, this.container = void 0, this.activateable = !1, this.experimentalHighlights = !1, this.currentRender = 0, Et() && (this.experimentalHighlights = !0, this.notTextFlag = /* @__PURE__ */ new Map());
1990
+ constructor(e, t, i, s) {
1991
+ this.wnd = e, this.comms = t, this.id = i, this.name = s, this.items = [], this.lastItemId = 0, this.container = void 0, this.activateable = !1, this.experimentalHighlights = !1, this.currentRender = 0, St() && (this.experimentalHighlights = !0, this.notTextFlag = /* @__PURE__ */ new Map());
1992
1992
  }
1993
1993
  get activeable() {
1994
1994
  return this.activateable;
@@ -2001,13 +2001,13 @@ class bt {
2001
2001
  * @param decoration Decoration to add
2002
2002
  */
2003
2003
  add(e) {
2004
- const t = `${this.id}-${this.lastItemId++}`, i = de(this.wnd.document, e.locator);
2004
+ const t = `${this.id}-${this.lastItemId++}`, i = ee(this.wnd.document, e.locator);
2005
2005
  if (!i) {
2006
2006
  this.comms.log("Can't locate DOM range for decoration", e);
2007
2007
  return;
2008
2008
  }
2009
- const r = i.commonAncestorContainer;
2010
- r.nodeType !== Node.TEXT_NODE && this.experimentalHighlights && (Pe.includes(r.nodeName.toUpperCase()) && this.notTextFlag?.set(t, !0), r.querySelector(Pe.join(", ").toLowerCase()) && this.notTextFlag?.set(t, !0), (r.textContent?.trim() || "").length === 0 && this.notTextFlag?.set(t, !0));
2009
+ const s = i.commonAncestorContainer;
2010
+ s.nodeType !== Node.TEXT_NODE && this.experimentalHighlights && (Ie.includes(s.nodeName.toUpperCase()) && this.notTextFlag?.set(t, !0), s.querySelector(Ie.join(", ").toLowerCase()) && this.notTextFlag?.set(t, !0), (s.textContent?.trim() || "").length === 0 && this.notTextFlag?.set(t, !0));
2011
2011
  const n = {
2012
2012
  decoration: e,
2013
2013
  id: t,
@@ -2020,7 +2020,7 @@ class bt {
2020
2020
  * @param identifier ID of item to remove
2021
2021
  */
2022
2022
  remove(e) {
2023
- const t = this.items.findIndex((r) => r.decoration.id === e);
2023
+ const t = this.items.findIndex((s) => s.decoration.id === e);
2024
2024
  if (t < 0) return;
2025
2025
  const i = this.items[t];
2026
2026
  this.items.splice(t, 1), i.clickableElements = void 0, i.container && (i.container.remove(), i.container = void 0), this.experimentalHighlights && !this.notTextFlag?.has(i.id) && this.wnd.CSS.highlights.get(this.id)?.delete(i.range), this.notTextFlag?.delete(i.id);
@@ -2062,11 +2062,11 @@ class bt {
2062
2062
  return this.experimentalLayout(e);
2063
2063
  const t = this.wnd.document.createElement("div");
2064
2064
  t.setAttribute("id", e.id), t.style.setProperty("pointer-events", "none");
2065
- const i = this.wnd.innerWidth, r = parseInt(
2065
+ const i = this.wnd.innerWidth, s = parseInt(
2066
2066
  getComputedStyle(this.wnd.document.documentElement).getPropertyValue(
2067
2067
  "column-count"
2068
2068
  )
2069
- ), n = i / (r || 1), o = this.wnd.document.scrollingElement, l = o.scrollLeft, u = o.scrollTop, h = (d, f, g) => {
2069
+ ), n = i / (s || 1), o = this.wnd.document.scrollingElement, l = o.scrollLeft, u = o.scrollTop, h = (d, f, g) => {
2070
2070
  if (d.style.position = "absolute", e.decoration?.style?.width === "viewport") {
2071
2071
  d.style.width = `${i}px`, d.style.height = `${f.height}px`;
2072
2072
  let E = Math.floor(f.left / i) * i;
@@ -2081,7 +2081,7 @@ class bt {
2081
2081
  d.style.width = `${f.width}px`, d.style.height = `${f.height}px`, d.style.left = `${f.left + l}px`, d.style.top = `${f.top + u}px`;
2082
2082
  }, c = e.range.getBoundingClientRect();
2083
2083
  let m = this.wnd.document.createElement("template");
2084
- const p = Ce(this.wnd, "--USER__appearance") === "readium-night-on" || gt(Ce(this.wnd, "--USER__backgroundColor"));
2084
+ const p = Le(this.wnd, "--USER__appearance") === "readium-night-on" || xt(Le(this.wnd, "--USER__backgroundColor"));
2085
2085
  m.innerHTML = `
2086
2086
  <div
2087
2087
  class="r2-highlight-0"
@@ -2100,7 +2100,7 @@ class bt {
2100
2100
  const d = y.cloneNode(!0);
2101
2101
  d.style.setProperty("pointer-events", "none"), h(d, c, c), t.append(d);
2102
2102
  } else {
2103
- let d = lt(
2103
+ let d = ft(
2104
2104
  e.range
2105
2105
  );
2106
2106
  d = d.sort((f, g) => f.top < g.top ? -1 : f.top > g.top ? 1 : 0);
@@ -2139,7 +2139,7 @@ class bt {
2139
2139
  this.experimentalHighlights && this.wnd.CSS.highlights.delete(this.id), this.container && (this.container.remove(), this.container = void 0);
2140
2140
  }
2141
2141
  }
2142
- const B = class B extends Z {
2142
+ const $ = class $ extends X {
2143
2143
  constructor() {
2144
2144
  super(...arguments), this.resizeFrame = 0, this.lastGroupId = 0, this.groups = /* @__PURE__ */ new Map(), this.handleResizer = this.handleResize.bind(this);
2145
2145
  }
@@ -2154,9 +2154,9 @@ const B = class B extends Z {
2154
2154
  }, 50);
2155
2155
  }
2156
2156
  mount(e, t) {
2157
- return this.wnd = e, t.register("decorate", B.moduleName, (i, r) => {
2157
+ return this.wnd = e, t.register("decorate", $.moduleName, (i, s) => {
2158
2158
  const n = i;
2159
- n.decoration && n.decoration.locator && (n.decoration.locator = L.deserialize(n.decoration.locator)), this.groups.has(n.group) || this.groups.set(n.group, new bt(
2159
+ n.decoration && n.decoration.locator && (n.decoration.locator = I.deserialize(n.decoration.locator)), this.groups.has(n.group) || this.groups.set(n.group, new Ct(
2160
2160
  e,
2161
2161
  t,
2162
2162
  `readium-decoration-${this.lastGroupId++}`,
@@ -2177,16 +2177,16 @@ const B = class B extends Z {
2177
2177
  o?.update(n.decoration);
2178
2178
  break;
2179
2179
  }
2180
- r(!0);
2180
+ s(!0);
2181
2181
  }), this.resizeObserver = new ResizeObserver(() => e.requestAnimationFrame(() => this.handleResize())), this.resizeObserver.observe(e.document.body), e.addEventListener("orientationchange", this.handleResizer), e.addEventListener("resize", this.handleResizer), t.log("Decorator Mounted"), !0;
2182
2182
  }
2183
2183
  unmount(e, t) {
2184
- return e.removeEventListener("orientationchange", this.handleResizer), e.removeEventListener("resize", this.handleResizer), t.unregisterAll(B.moduleName), this.resizeObserver.disconnect(), this.cleanup(), t.log("Decorator Unmounted"), !0;
2184
+ return e.removeEventListener("orientationchange", this.handleResizer), e.removeEventListener("resize", this.handleResizer), t.unregisterAll($.moduleName), this.resizeObserver.disconnect(), this.cleanup(), t.log("Decorator Unmounted"), !0;
2185
2185
  }
2186
2186
  };
2187
- B.moduleName = "decorator";
2188
- let ee = B;
2189
- const Ae = "readium-snapper-style", k = class k extends Z {
2187
+ $.moduleName = "decorator";
2188
+ let re = $;
2189
+ const Re = "readium-snapper-style", k = class k extends X {
2190
2190
  constructor() {
2191
2191
  super(...arguments), this.protected = !1;
2192
2192
  }
@@ -2199,59 +2199,59 @@ const Ae = "readium-snapper-style", k = class k extends Z {
2199
2199
  }
2200
2200
  mount(e, t) {
2201
2201
  const i = e.document.createElement("style");
2202
- return i.dataset.readium = "true", i.id = Ae, i.textContent = this.buildStyles(), e.document.head.appendChild(i), t.register("protect", k.moduleName, (r, n) => {
2202
+ return i.dataset.readium = "true", i.id = Re, i.textContent = this.buildStyles(), e.document.head.appendChild(i), t.register("protect", k.moduleName, (s, n) => {
2203
2203
  this.protected = !0, i.textContent = this.buildStyles(), n(!0);
2204
- }), t.register("unprotect", k.moduleName, (r, n) => {
2204
+ }), t.register("unprotect", k.moduleName, (s, n) => {
2205
2205
  this.protected = !1, i.textContent = this.buildStyles(), n(!0);
2206
2206
  }), t.log("Snapper Mounted"), !0;
2207
2207
  }
2208
2208
  unmount(e, t) {
2209
- return e.document.getElementById(Ae)?.remove(), t.log("Snapper Unmounted"), !0;
2209
+ return e.document.getElementById(Re)?.remove(), t.log("Snapper Unmounted"), !0;
2210
2210
  }
2211
2211
  };
2212
2212
  k.moduleName = "snapper";
2213
- let Y = k;
2214
- function I(s) {
2215
- return s.document.body.dir.toLowerCase() === "rtl";
2213
+ let q = k;
2214
+ function z(r) {
2215
+ return r.document.body.dir.toLowerCase() === "rtl";
2216
2216
  }
2217
- function je(s) {
2217
+ function Ke(r) {
2218
2218
  return parseInt(
2219
- s.getComputedStyle(
2220
- s.document.documentElement
2219
+ r.getComputedStyle(
2220
+ r.document.documentElement
2221
2221
  ).getPropertyValue("column-count")
2222
2222
  );
2223
2223
  }
2224
- function Me(s) {
2225
- const e = getComputedStyle(s), t = parseFloat(e.paddingTop || "0"), i = parseFloat(e.paddingBottom || "0");
2226
- return s.clientHeight - t - i;
2224
+ function ze(r) {
2225
+ const e = getComputedStyle(r), t = parseFloat(e.paddingTop || "0"), i = parseFloat(e.paddingBottom || "0");
2226
+ return r.clientHeight - t - i;
2227
2227
  }
2228
- function Ne(s) {
2229
- const e = je(s);
2228
+ function De(r) {
2229
+ const e = Ke(r);
2230
2230
  if (!e)
2231
2231
  return !1;
2232
- const t = s.document.querySelectorAll("div[id^='readium-virtual-page']");
2232
+ const t = r.document.querySelectorAll("div[id^='readium-virtual-page']");
2233
2233
  for (const h of t)
2234
2234
  h.remove();
2235
- const i = t.length, r = s.document.scrollingElement.scrollWidth, n = s.visualViewport.width, l = Math.round(r / n * e) % e, u = e === 1 || l === 0 ? 0 : e - l;
2235
+ const i = t.length, s = r.document.scrollingElement.scrollWidth, n = r.visualViewport.width, l = Math.round(s / n * e) % e, u = e === 1 || l === 0 ? 0 : e - l;
2236
2236
  if (u > 0)
2237
2237
  for (let h = 0; h < u; h++) {
2238
- const c = s.document.createElement("div");
2239
- c.setAttribute("id", `readium-virtual-page-${h}`), c.dataset.readium = "true", CSS.supports("break-before", "column") ? c.style.breakBefore = "column" : (CSS.supports("break-inside", "avoid-column") && (c.style.breakInside = "avoid-column"), c.style.height = Me(s.document.documentElement) + "px"), c.innerHTML = "&#8203;", s.document.body.appendChild(c);
2238
+ const c = r.document.createElement("div");
2239
+ c.setAttribute("id", `readium-virtual-page-${h}`), c.dataset.readium = "true", CSS.supports("break-before", "column") ? c.style.breakBefore = "column" : (CSS.supports("break-inside", "avoid-column") && (c.style.breakInside = "avoid-column"), c.style.height = ze(r.document.documentElement) + "px"), c.innerHTML = "&#8203;", r.document.body.appendChild(c);
2240
2240
  }
2241
2241
  return i !== u;
2242
2242
  }
2243
- function xt(s) {
2244
- const e = s.document.createElement("style");
2245
- e.appendChild(s.document.createTextNode("*{}")), s.document.body.appendChild(e), s.document.body.removeChild(e);
2243
+ function Ze(r) {
2244
+ const e = r.document.createElement("style");
2245
+ e.appendChild(r.document.createTextNode("*{}")), r.document.body.appendChild(e), r.document.body.removeChild(e);
2246
2246
  }
2247
- function Tt(s) {
2248
- return s < 0.5 ? 2 * s * s : -1 + (4 - 2 * s) * s;
2247
+ function Pt(r) {
2248
+ return r < 0.5 ? 2 * r * r : -1 + (4 - 2 * r) * r;
2249
2249
  }
2250
- function T(s) {
2251
- const e = s.getSelection();
2250
+ function v(r) {
2251
+ const e = r.getSelection();
2252
2252
  e && e.removeAllRanges();
2253
2253
  }
2254
- const wt = [
2254
+ const At = [
2255
2255
  "a",
2256
2256
  "audio",
2257
2257
  "button",
@@ -2265,48 +2265,48 @@ const wt = [
2265
2265
  "textarea",
2266
2266
  "video"
2267
2267
  ];
2268
- function qe(s) {
2269
- return wt.indexOf(s.nodeName.toLowerCase()) !== -1 || s.hasAttribute("contenteditable") && s.getAttribute("contenteditable")?.toLowerCase() !== "false" ? s : s.parentElement ? qe(s.parentElement) : null;
2268
+ function Je(r) {
2269
+ return At.indexOf(r.nodeName.toLowerCase()) !== -1 || r.hasAttribute("contenteditable") && r.getAttribute("contenteditable")?.toLowerCase() !== "false" ? r : r.parentElement ? Je(r.parentElement) : null;
2270
2270
  }
2271
- function Xe(s, e) {
2272
- const t = Ge(s, s.document.body, e), i = s._readium_cssSelectorGenerator.getCssSelector(t, {
2271
+ function be(r, e) {
2272
+ const t = Qe(r, r.document.body, e), i = r._readium_cssSelectorGenerator.getCssSelector(t, {
2273
2273
  selectors: ["tag", "id", "class", "nthchild", "nthoftype", "attribute"]
2274
2274
  });
2275
- return new L({
2275
+ return new I({
2276
2276
  href: "#",
2277
2277
  type: "application/xhtml+xml",
2278
- locations: new v({
2278
+ locations: new b({
2279
2279
  otherLocations: /* @__PURE__ */ new Map([
2280
2280
  ["cssSelector", i]
2281
2281
  ])
2282
2282
  }),
2283
- text: new W({
2283
+ text: new D({
2284
2284
  highlight: t.textContent || void 0
2285
2285
  })
2286
2286
  });
2287
2287
  }
2288
- function Ge(s, e, t) {
2288
+ function Qe(r, e, t) {
2289
2289
  for (var i = 0; i < e.children.length; i++) {
2290
- const r = e.children[i];
2291
- if (!Pt(r) && St(s, r, t))
2292
- return Ct(s, r) ? r : Ge(s, r, t);
2290
+ const s = e.children[i];
2291
+ if (!Ot(s) && Mt(r, s, t))
2292
+ return Nt(r, s) ? s : Qe(r, s, t);
2293
2293
  }
2294
2294
  return e;
2295
2295
  }
2296
- function St(s, e, t) {
2296
+ function Mt(r, e, t) {
2297
2297
  if (e === document.body || e === document.documentElement)
2298
2298
  return !0;
2299
2299
  if (!document || !document.documentElement || !document.body)
2300
2300
  return !1;
2301
2301
  const i = e.getBoundingClientRect();
2302
- return t ? i.bottom > 0 && i.top < s.innerHeight : i.right > 0 && i.left < s.innerWidth;
2302
+ return t ? i.bottom > 0 && i.top < r.innerHeight : i.right > 0 && i.left < r.innerWidth;
2303
2303
  }
2304
- function Ct(s, e) {
2304
+ function Nt(r, e) {
2305
2305
  const t = e.getBoundingClientRect();
2306
- return t.top >= 0 && t.left >= 0 && t.bottom <= s.innerHeight && t.right <= s.innerWidth;
2306
+ return t.top >= 0 && t.left >= 0 && t.bottom <= r.innerHeight && t.right <= r.innerWidth;
2307
2307
  }
2308
- function Pt(s) {
2309
- const e = getComputedStyle(s);
2308
+ function Ot(r) {
2309
+ const e = getComputedStyle(r);
2310
2310
  if (e) {
2311
2311
  const t = e.getPropertyValue("display");
2312
2312
  if (t != "block" && t != "list-item" || e.getPropertyValue("opacity") === "0")
@@ -2314,7 +2314,7 @@ function Pt(s) {
2314
2314
  }
2315
2315
  return !1;
2316
2316
  }
2317
- const Oe = "readium-column-snapper-style", At = 200, b = class b extends Y {
2317
+ const We = "readium-column-snapper-style", Lt = 200, x = class x extends q {
2318
2318
  constructor() {
2319
2319
  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);
2320
2320
  }
@@ -2325,20 +2325,20 @@ const Oe = "readium-column-snapper-style", At = 200, b = class b extends Y {
2325
2325
  return this.doc().scrollLeft > 0 ? this.doc().scrollLeft : this.alreadyScrollLeft;
2326
2326
  }
2327
2327
  snapOffset(e) {
2328
- const t = e + (I(this.wnd) ? -1 : 1);
2328
+ const t = e + (z(this.wnd) ? -1 : 1);
2329
2329
  return t - t % this.wnd.innerWidth;
2330
2330
  }
2331
2331
  reportProgress() {
2332
- const e = this.wnd.scrollX, t = this.cachedScrollWidth, i = Math.max(0, Math.min(1, e / t)), r = Math.max(0, Math.min(1, (e + this.wnd.innerWidth) / t));
2332
+ const e = this.wnd.scrollX, t = this.cachedScrollWidth, i = Math.max(0, Math.min(1, e / t)), s = Math.max(0, Math.min(1, (e + this.wnd.innerWidth) / t));
2333
2333
  this.comms.send("progress", {
2334
2334
  start: i,
2335
- end: r
2335
+ end: s
2336
2336
  });
2337
2337
  }
2338
2338
  shake() {
2339
2339
  if (this.overscroll !== 0 || this.shakeTimeout !== 0) return;
2340
2340
  const e = this.doc();
2341
- e.classList.add(I(this.wnd) ? "readium-bounce-l" : "readium-bounce-r");
2341
+ e.classList.add(z(this.wnd) ? "readium-bounce-l" : "readium-bounce-r");
2342
2342
  const t = this.scrollOffset();
2343
2343
  this.shakeTimeout = this.wnd.setTimeout(() => {
2344
2344
  e.classList.remove("readium-bounce-l"), e.classList.remove("readium-bounce-r"), this.shakeTimeout = 0, this.doc().scrollLeft = t;
@@ -2352,27 +2352,27 @@ const Oe = "readium-column-snapper-style", At = 200, b = class b extends Y {
2352
2352
  }
2353
2353
  // Snaps the current offset to the page width.
2354
2354
  snapCurrentOffset(e = !1, t = !1) {
2355
- const i = this.wnd.scrollX > 0 ? this.wnd.scrollX : this.alreadyScrollLeft, r = this.doc(), n = this.dragOffset(), o = je(this.wnd), l = Math.min(Math.max(0, i), this.cachedScrollWidth), u = I(this.wnd) ? -1 : 1, h = (
2355
+ const i = this.wnd.scrollX > 0 ? this.wnd.scrollX : this.alreadyScrollLeft, s = this.doc(), n = this.dragOffset(), o = Ke(this.wnd), l = Math.min(Math.max(0, i), this.cachedScrollWidth), u = z(this.wnd) ? -1 : 1, h = (
2356
2356
  // The hurdle to overcome in order to change pages
2357
2357
  u * (this.wnd.innerWidth / 3) * (u * n > 0 ? 2 : 1)
2358
2358
  ), c = this.snapOffset(l + h);
2359
2359
  if (e && c !== this.scrollOffset()) {
2360
2360
  this.snappingCancelled = !1;
2361
- const m = (f, g, E, R) => E > R ? g : f + (g - f) * Tt(E / R), p = (
2361
+ const m = (f, g, E, W) => E > W ? g : f + (g - f) * Pt(E / W), p = (
2362
2362
  /*Math.abs(startX - (this.useTransform ? currentOffset : 0)) < 10 ? 1 : */
2363
- At * o
2363
+ Lt * o
2364
2364
  );
2365
2365
  let y;
2366
2366
  const d = (f) => {
2367
2367
  if (this.snappingCancelled) return;
2368
2368
  y || (y = f);
2369
- const g = f - y, E = m(this.overscroll, 0, g, p), R = m(i, c, g, p);
2370
- r.scrollLeft = R, this.overscroll !== 0 && (r.style.transform = `translate3d(${-E}px, 0px, 0px)`), g < p ? this.wnd.requestAnimationFrame(d) : (this.clearTouches(), r.style.removeProperty("transform"), r.scrollLeft = c, t || this.reportProgress());
2369
+ const g = f - y, E = m(this.overscroll, 0, g, p), W = m(i, c, g, p);
2370
+ s.scrollLeft = W, this.overscroll !== 0 && (s.style.transform = `translate3d(${-E}px, 0px, 0px)`), g < p ? this.wnd.requestAnimationFrame(d) : (this.clearTouches(), s.style.removeProperty("transform"), s.scrollLeft = c, t || this.reportProgress());
2371
2371
  };
2372
2372
  this.wnd.requestAnimationFrame(d);
2373
2373
  } else
2374
- r.style.removeProperty("transform"), this.wnd.requestAnimationFrame(() => {
2375
- r.scrollLeft = c, this.clearTouches(), t || this.reportProgress();
2374
+ s.style.removeProperty("transform"), this.wnd.requestAnimationFrame(() => {
2375
+ s.scrollLeft = c, this.clearTouches(), t || this.reportProgress();
2376
2376
  });
2377
2377
  }
2378
2378
  dragOffset() {
@@ -2407,15 +2407,15 @@ const Oe = "readium-column-snapper-style", At = 200, b = class b extends Y {
2407
2407
  }
2408
2408
  onTouchMove(e) {
2409
2409
  if (this.touchState === 0) return;
2410
- this.touchState === 1 && (this.touchState = 2, T(this.wnd)), this.endingX = e.touches[0].clientX;
2410
+ this.touchState === 1 && (this.touchState = 2, v(this.wnd)), this.endingX = e.touches[0].clientX;
2411
2411
  const t = this.dragOffset(), i = this.alreadyScrollLeft + t;
2412
2412
  i < 0 ? (this.overscroll = i, this.doc().style.transform = `translate3d(${-this.overscroll}px, 0px, 0px)`) : i + this.wnd.innerWidth > this.cachedScrollWidth ? (this.overscroll = i, this.doc().style.transform = `translate3d(${-i}px, 0px, 0px)`) : (this.overscroll = 0, this.doc().style.removeProperty("transform"), this.doc().scrollLeft = this.alreadyScrollLeft + t);
2413
2413
  }
2414
2414
  mount(e, t) {
2415
2415
  if (this.wnd = e, this.comms = t, !super.mount(e, t)) return !1;
2416
- e.navigator.epubReadingSystem.layoutStyle = "paginated";
2416
+ e.navigator.epubReadingSystem && (e.navigator.epubReadingSystem.layoutStyle = "paginated");
2417
2417
  const i = e.document.createElement("style");
2418
- i.dataset.readium = "true", i.id = Oe, i.textContent = `
2418
+ i.dataset.readium = "true", i.id = We, i.textContent = `
2419
2419
  @keyframes readium-bounce-l-animation {
2420
2420
  0%, 100% {transform: translate3d(0, 0, 0);}
2421
2421
  50% {transform: translate3d(-50px, 0, 0);}
@@ -2451,23 +2451,23 @@ const Oe = "readium-column-snapper-style", At = 200, b = class b extends Y {
2451
2451
  }
2452
2452
  `, e.document.head.appendChild(i), this.resizeObserver = new ResizeObserver(() => {
2453
2453
  e.requestAnimationFrame(() => {
2454
- e && Ne(e);
2454
+ e && De(e);
2455
2455
  }), this.onWidthChange();
2456
2456
  }), this.resizeObserver.observe(e.document.body), this.mutationObserver = new MutationObserver((n) => {
2457
2457
  for (const o of n)
2458
2458
  if (o.target === this.wnd.document.documentElement) {
2459
2459
  const l = o.oldValue, u = o.target.getAttribute("style"), h = /transform\s*:\s*([^;]+)/, c = l?.match(h), m = u?.match(h);
2460
2460
  (!c && !m || c && !m || c && m && c[1] !== m[1]) && (e.requestAnimationFrame(() => {
2461
- e && Ne(e);
2461
+ e && De(e);
2462
2462
  }), this.onWidthChange());
2463
2463
  } else
2464
2464
  e.requestAnimationFrame(() => this.cachedScrollWidth = this.doc().scrollWidth);
2465
2465
  }), e.frameElement && this.mutationObserver.observe(e.frameElement, { attributes: !0, attributeFilter: ["style"] }), this.mutationObserver.observe(e.document, { attributes: !0, attributeFilter: ["style"] }), this.mutationObserver.observe(e.document.documentElement, { attributes: !0, attributeFilter: ["style"] });
2466
- const r = (n) => {
2466
+ const s = (n) => {
2467
2467
  const o = this.doc().scrollLeft;
2468
2468
  return this.doc().scrollLeft = this.snapOffset(n), o !== this.doc().scrollLeft;
2469
2469
  };
2470
- return e.addEventListener("orientationchange", this.onWidthChanger), e.addEventListener("resize", this.onWidthChanger), e.requestAnimationFrame(() => this.cachedScrollWidth = this.doc().scrollWidth), t.register("go_progression", b.moduleName, (n, o) => {
2470
+ return e.addEventListener("orientationchange", this.onWidthChanger), e.addEventListener("resize", this.onWidthChanger), e.requestAnimationFrame(() => this.cachedScrollWidth = this.doc().scrollWidth), t.register("go_progression", x.moduleName, (n, o) => {
2471
2471
  const l = n;
2472
2472
  if (l < 0 || l > 1) {
2473
2473
  t.send("error", {
@@ -2477,26 +2477,26 @@ const Oe = "readium-column-snapper-style", At = 200, b = class b extends Y {
2477
2477
  }
2478
2478
  this.wnd.requestAnimationFrame(() => {
2479
2479
  this.cachedScrollWidth = this.doc().scrollWidth;
2480
- const u = this.cachedScrollWidth, h = I(e) ? -1 : 1, c = u * l * h;
2481
- this.doc().scrollLeft = this.snapOffset(c), this.reportProgress(), T(this.wnd), o(!0);
2480
+ const u = this.cachedScrollWidth, h = z(e) ? -1 : 1, c = u * l * h;
2481
+ this.doc().scrollLeft = this.snapOffset(c), this.reportProgress(), v(this.wnd), o(!0);
2482
2482
  });
2483
- }), t.register("go_id", b.moduleName, (n, o) => {
2483
+ }), t.register("go_id", x.moduleName, (n, o) => {
2484
2484
  const l = e.document.getElementById(n);
2485
2485
  if (!l) {
2486
2486
  o(!1);
2487
2487
  return;
2488
2488
  }
2489
2489
  this.wnd.requestAnimationFrame(() => {
2490
- this.doc().scrollLeft = this.snapOffset(l.getBoundingClientRect().left + e.scrollX), this.reportProgress(), T(this.wnd), o(!0);
2490
+ this.doc().scrollLeft = this.snapOffset(l.getBoundingClientRect().left + e.scrollX), this.reportProgress(), v(this.wnd), o(!0);
2491
2491
  });
2492
- }), t.register("go_text", b.moduleName, (n, o) => {
2492
+ }), t.register("go_text", x.moduleName, (n, o) => {
2493
2493
  let l;
2494
2494
  Array.isArray(n) && (n.length > 1 && (l = n[1]), n = n[0]);
2495
- const u = W.deserialize(n), h = de(this.wnd.document, new L({
2495
+ const u = D.deserialize(n), h = ee(this.wnd.document, new I({
2496
2496
  href: e.location.href,
2497
2497
  type: "text/html",
2498
2498
  text: u,
2499
- locations: l ? new v({
2499
+ locations: l ? new b({
2500
2500
  otherLocations: /* @__PURE__ */ new Map([
2501
2501
  ["cssSelector", l]
2502
2502
  ])
@@ -2507,54 +2507,54 @@ const Oe = "readium-column-snapper-style", At = 200, b = class b extends Y {
2507
2507
  return;
2508
2508
  }
2509
2509
  this.wnd.requestAnimationFrame(() => {
2510
- this.doc().scrollLeft = this.snapOffset(h.getBoundingClientRect().left + e.scrollX), this.reportProgress(), T(this.wnd), o(!0);
2510
+ this.doc().scrollLeft = this.snapOffset(h.getBoundingClientRect().left + e.scrollX), this.reportProgress(), v(this.wnd), o(!0);
2511
2511
  });
2512
- }), t.register("go_end", b.moduleName, (n, o) => {
2513
- const l = I(e) ? -1 : 1;
2512
+ }), t.register("go_end", x.moduleName, (n, o) => {
2513
+ const l = z(e) ? -1 : 1;
2514
2514
  this.wnd.requestAnimationFrame(() => {
2515
2515
  this.cachedScrollWidth = this.doc().scrollWidth;
2516
2516
  const u = this.cachedScrollWidth * l;
2517
2517
  if (this.doc().scrollLeft === u) return o(!1);
2518
- this.doc().scrollLeft = this.snapOffset(u), this.reportProgress(), T(this.wnd), o(!0);
2518
+ this.doc().scrollLeft = this.snapOffset(u), this.reportProgress(), v(this.wnd), o(!0);
2519
2519
  });
2520
- }), t.register("go_start", b.moduleName, (n, o) => {
2520
+ }), t.register("go_start", x.moduleName, (n, o) => {
2521
2521
  this.wnd.requestAnimationFrame(() => {
2522
2522
  if (this.doc().scrollLeft === 0) return o(!1);
2523
- this.doc().scrollLeft = 0, this.reportProgress(), T(this.wnd), o(!0);
2523
+ this.doc().scrollLeft = 0, this.reportProgress(), v(this.wnd), o(!0);
2524
2524
  });
2525
- }), t.register("go_prev", b.moduleName, (n, o) => {
2525
+ }), t.register("go_prev", x.moduleName, (n, o) => {
2526
2526
  this.wnd.requestAnimationFrame(() => {
2527
2527
  this.cachedScrollWidth = this.doc().scrollWidth;
2528
- const l = e.scrollX - e.innerWidth, u = I(e) ? -(this.cachedScrollWidth - e.innerWidth) : 0, h = r(Math.max(l, u));
2529
- h && (this.reportProgress(), T(this.wnd)), o(h);
2528
+ const l = e.scrollX - e.innerWidth, u = z(e) ? -(this.cachedScrollWidth - e.innerWidth) : 0, h = s(Math.max(l, u));
2529
+ h && (this.reportProgress(), v(this.wnd)), o(h);
2530
2530
  });
2531
- }), t.register("go_next", b.moduleName, (n, o) => {
2531
+ }), t.register("go_next", x.moduleName, (n, o) => {
2532
2532
  this.wnd.requestAnimationFrame(() => {
2533
2533
  this.cachedScrollWidth = this.doc().scrollWidth;
2534
- const l = e.scrollX + e.innerWidth, u = I(e) ? 0 : this.cachedScrollWidth - e.innerWidth, h = r(Math.min(l, u));
2535
- h && (this.reportProgress(), T(this.wnd)), o(h);
2534
+ const l = e.scrollX + e.innerWidth, u = z(e) ? 0 : this.cachedScrollWidth - e.innerWidth, h = s(Math.min(l, u));
2535
+ h && (this.reportProgress(), v(this.wnd)), o(h);
2536
2536
  });
2537
- }), t.register("unfocus", b.moduleName, (n, o) => {
2538
- this.snappingCancelled = !0, T(this.wnd), o(!0);
2539
- }), t.register("shake", b.moduleName, (n, o) => {
2537
+ }), t.register("unfocus", x.moduleName, (n, o) => {
2538
+ this.snappingCancelled = !0, v(this.wnd), o(!0);
2539
+ }), t.register("shake", x.moduleName, (n, o) => {
2540
2540
  this.shake(), o(!0);
2541
- }), t.register("focus", b.moduleName, (n, o) => {
2541
+ }), t.register("focus", x.moduleName, (n, o) => {
2542
2542
  this.wnd.requestAnimationFrame(() => {
2543
2543
  this.cachedScrollWidth = this.doc().scrollWidth, this.snapCurrentOffset(!1, !0), this.reportProgress(), o(!0);
2544
2544
  });
2545
- }), t.register("first_visible_locator", b.moduleName, (n, o) => {
2546
- const l = Xe(e, !1);
2545
+ }), t.register("first_visible_locator", x.moduleName, (n, o) => {
2546
+ const l = be(e, !1);
2547
2547
  this.comms.send("first_visible_locator", l.serialize()), o(!0);
2548
2548
  }), e.addEventListener("touchstart", this.onTouchStarter, { passive: !0 }), e.addEventListener("touchend", this.onTouchEnder, { passive: !0 }), e.addEventListener("touchmove", this.onTouchMover, { passive: !0 }), e.document.addEventListener("touchstart", () => {
2549
2549
  }), t.log("ColumnSnapper Mounted"), !0;
2550
2550
  }
2551
2551
  unmount(e, t) {
2552
- return this.snappingCancelled = !0, t.unregisterAll(b.moduleName), this.resizeObserver.disconnect(), this.mutationObserver.disconnect(), e.removeEventListener("touchstart", this.onTouchStarter), e.removeEventListener("touchend", this.onTouchEnder), e.removeEventListener("touchmove", this.onTouchMover), e.removeEventListener("orientationchange", this.onWidthChanger), e.removeEventListener("resize", this.onWidthChanger), e.document.getElementById(Oe)?.remove(), t.log("ColumnSnapper Unmounted"), super.unmount(e, t);
2552
+ return this.snappingCancelled = !0, t.unregisterAll(x.moduleName), this.resizeObserver.disconnect(), this.mutationObserver.disconnect(), e.removeEventListener("touchstart", this.onTouchStarter), e.removeEventListener("touchend", this.onTouchEnder), e.removeEventListener("touchmove", this.onTouchMover), e.removeEventListener("orientationchange", this.onWidthChanger), e.removeEventListener("resize", this.onWidthChanger), e.document.getElementById(We)?.remove(), t.log("ColumnSnapper Unmounted"), super.unmount(e, t);
2553
2553
  }
2554
2554
  };
2555
- b.moduleName = "column_snapper";
2556
- let te = b;
2557
- const Le = "readium-scroll-snapper-style", x = class x extends Y {
2555
+ x.moduleName = "column_snapper";
2556
+ let ne = x;
2557
+ const Fe = "readium-scroll-snapper-style", T = class T extends q {
2558
2558
  constructor() {
2559
2559
  super(...arguments), this.initialScrollHandled = !1, this.isScrolling = !1, this.lastScrollTop = 0, this.isResizing = !1, this.resizeDebounce = null, this.handleScroll = () => {
2560
2560
  if (this.comms.ready && !this.isResizing) {
@@ -2575,16 +2575,16 @@ const Le = "readium-scroll-snapper-style", x = class x extends Y {
2575
2575
  }
2576
2576
  reportProgress() {
2577
2577
  if (!this.comms.ready) return;
2578
- const e = Math.ceil(this.doc().scrollTop), t = this.doc().scrollHeight, i = this.wnd.innerHeight, r = Math.max(0, Math.min(1, e / t)), n = Math.max(0, Math.min(1, (e + i) / t));
2578
+ const e = Math.ceil(this.doc().scrollTop), t = this.doc().scrollHeight, i = this.wnd.innerHeight, s = Math.max(0, Math.min(1, e / t)), n = Math.max(0, Math.min(1, (e + i) / t));
2579
2579
  this.comms.send("progress", {
2580
- start: r,
2580
+ start: s,
2581
2581
  end: n
2582
2582
  });
2583
2583
  }
2584
2584
  mount(e, t) {
2585
- this.wnd = e, this.comms = t, this.initialScrollHandled = !1, this.lastScrollTop = 0, this.isResizing = !1, this.resizeDebounce && (this.wnd.clearTimeout(this.resizeDebounce), this.resizeDebounce = null), e.navigator.epubReadingSystem.layoutStyle = "scrolling";
2585
+ this.wnd = e, this.comms = t, this.initialScrollHandled = !1, this.lastScrollTop = 0, this.isResizing = !1, this.resizeDebounce && (this.wnd.clearTimeout(this.resizeDebounce), this.resizeDebounce = null), e.navigator.epubReadingSystem && (e.navigator.epubReadingSystem.layoutStyle = "scrolling");
2586
2586
  const i = e.document.createElement("style");
2587
- return i.dataset.readium = "true", i.id = Le, i.textContent = `
2587
+ return i.dataset.readium = "true", i.id = Fe, i.textContent = `
2588
2588
  * {
2589
2589
  scrollbar-width: none; /* for Firefox */
2590
2590
  }
@@ -2596,12 +2596,12 @@ const Le = "readium-scroll-snapper-style", x = class x extends Y {
2596
2596
  this.resizeDebounce && this.wnd.clearTimeout(this.resizeDebounce), this.isResizing = !0, this.resizeDebounce = this.wnd.setTimeout(() => {
2597
2597
  this.isResizing = !1, this.resizeDebounce = null, this.reportProgress();
2598
2598
  }, 50);
2599
- }), this.resizeObserver.observe(e.document.body), e.addEventListener("scroll", this.handleScroll, { passive: !0 }), t.register("force_webkit_recalc", x.moduleName, () => {
2600
- xt(this.wnd);
2601
- const r = this.doc().scrollTop;
2602
- r > 1 ? this.doc().scrollTop = r - 1 : this.doc().scrollTop = r + 1, this.doc().scrollTop = r;
2603
- }), t.register("go_progression", x.moduleName, (r, n) => {
2604
- const o = r;
2599
+ }), this.resizeObserver.observe(e.document.body), e.addEventListener("scroll", this.handleScroll, { passive: !0 }), t.register("force_webkit_recalc", T.moduleName, () => {
2600
+ Ze(this.wnd);
2601
+ const s = this.doc().scrollTop;
2602
+ s > 1 ? this.doc().scrollTop = s - 1 : this.doc().scrollTop = s + 1, this.doc().scrollTop = s;
2603
+ }), t.register("go_progression", T.moduleName, (s, n) => {
2604
+ const o = s;
2605
2605
  if (o < 0 || o > 1) {
2606
2606
  t.send("error", {
2607
2607
  message: "go_progression must be given a position from 0.0 to 1.0"
@@ -2609,25 +2609,25 @@ const Le = "readium-scroll-snapper-style", x = class x extends Y {
2609
2609
  return;
2610
2610
  }
2611
2611
  this.wnd.requestAnimationFrame(() => {
2612
- this.doc().scrollTop = this.doc().offsetHeight * o, this.reportProgress(), T(this.wnd), n(!0);
2612
+ this.doc().scrollTop = this.doc().offsetHeight * o, this.reportProgress(), v(this.wnd), n(!0);
2613
2613
  });
2614
- }), t.register("go_id", x.moduleName, (r, n) => {
2615
- const o = e.document.getElementById(r);
2614
+ }), t.register("go_id", T.moduleName, (s, n) => {
2615
+ const o = e.document.getElementById(s);
2616
2616
  if (!o) {
2617
2617
  n(!1);
2618
2618
  return;
2619
2619
  }
2620
2620
  this.wnd.requestAnimationFrame(() => {
2621
- this.doc().scrollTop = o.getBoundingClientRect().top + e.scrollY - e.innerHeight / 2, this.reportProgress(), T(this.wnd), n(!0);
2621
+ this.doc().scrollTop = o.getBoundingClientRect().top + e.scrollY - e.innerHeight / 2, this.reportProgress(), v(this.wnd), n(!0);
2622
2622
  });
2623
- }), t.register("go_text", x.moduleName, (r, n) => {
2623
+ }), t.register("go_text", T.moduleName, (s, n) => {
2624
2624
  let o;
2625
- Array.isArray(r) && (r.length > 1 && (o = r[1]), r = r[0]);
2626
- const l = W.deserialize(r), u = de(this.wnd.document, new L({
2625
+ Array.isArray(s) && (s.length > 1 && (o = s[1]), s = s[0]);
2626
+ const l = D.deserialize(s), u = ee(this.wnd.document, new I({
2627
2627
  href: e.location.href,
2628
2628
  type: "text/html",
2629
2629
  text: l,
2630
- locations: o ? new v({
2630
+ locations: o ? new b({
2631
2631
  otherLocations: /* @__PURE__ */ new Map([
2632
2632
  ["cssSelector", o]
2633
2633
  ])
@@ -2638,43 +2638,143 @@ const Le = "readium-scroll-snapper-style", x = class x extends Y {
2638
2638
  return;
2639
2639
  }
2640
2640
  this.wnd.requestAnimationFrame(() => {
2641
- this.doc().scrollTop = u.getBoundingClientRect().top + e.scrollY - e.innerHeight / 2, this.reportProgress(), T(this.wnd), n(!0);
2641
+ this.doc().scrollTop = u.getBoundingClientRect().top + e.scrollY - e.innerHeight / 2, this.reportProgress(), v(this.wnd), n(!0);
2642
2642
  });
2643
- }), t.register("go_start", x.moduleName, (r, n) => {
2643
+ }), t.register("go_start", T.moduleName, (s, n) => {
2644
2644
  if (this.doc().scrollTop === 0) return n(!1);
2645
2645
  this.doc().scrollTop = 0, this.reportProgress(), n(!0);
2646
- }), t.register("go_end", x.moduleName, (r, n) => {
2646
+ }), t.register("go_end", T.moduleName, (s, n) => {
2647
2647
  if (this.doc().scrollTop === this.doc().scrollHeight - this.doc().offsetHeight) return n(!1);
2648
2648
  this.doc().scrollTop = this.doc().scrollHeight - this.doc().offsetHeight, this.reportProgress(), n(!0);
2649
- }), t.register("unfocus", x.moduleName, (r, n) => {
2650
- T(this.wnd), n(!0);
2649
+ }), t.register("unfocus", T.moduleName, (s, n) => {
2650
+ v(this.wnd), n(!0);
2651
2651
  }), t.register([
2652
2652
  "go_next",
2653
2653
  "go_prev"
2654
- ], x.moduleName, (r, n) => n(!1)), t.register("focus", x.moduleName, (r, n) => {
2654
+ ], T.moduleName, (s, n) => n(!1)), t.register("focus", T.moduleName, (s, n) => {
2655
2655
  this.reportProgress(), n(!0);
2656
- }), t.register("first_visible_locator", x.moduleName, (r, n) => {
2657
- const o = Xe(e, !0);
2656
+ }), t.register("first_visible_locator", T.moduleName, (s, n) => {
2657
+ const o = be(e, !0);
2658
2658
  this.comms.send("first_visible_locator", o.serialize()), n(!0);
2659
2659
  }), t.log("ScrollSnapper Mounted"), !0;
2660
2660
  }
2661
2661
  unmount(e, t) {
2662
- return t.unregisterAll(x.moduleName), this.resizeObserver.disconnect(), this.handleScroll && e.removeEventListener("scroll", this.handleScroll), e.document.getElementById(Le)?.remove(), t.log("ScrollSnapper Unmounted"), !0;
2662
+ return t.unregisterAll(T.moduleName), this.resizeObserver.disconnect(), this.handleScroll && e.removeEventListener("scroll", this.handleScroll), e.document.getElementById(Fe)?.remove(), t.log("ScrollSnapper Unmounted"), !0;
2663
+ }
2664
+ };
2665
+ T.moduleName = "scroll_snapper";
2666
+ let oe = T;
2667
+ const w = class w extends q {
2668
+ constructor() {
2669
+ super(...arguments), this.initialScrollHandled = !1, this.isScrolling = !1, this.lastScrollTop = 0, this.isResizing = !1, this.resizeDebounce = null, this.handleScroll = () => {
2670
+ if (this.comms.ready && !this.isResizing) {
2671
+ if (!this.initialScrollHandled) {
2672
+ this.lastScrollTop = this.doc().scrollTop, this.initialScrollHandled = !0, this.reportProgress();
2673
+ return;
2674
+ }
2675
+ this.isScrolling || (this.isScrolling = !0, this.wnd.requestAnimationFrame(() => {
2676
+ this.reportProgress();
2677
+ const e = this.doc().scrollTop, t = e - this.lastScrollTop;
2678
+ this.lastScrollTop = e, this.comms.send("scroll", t), this.isScrolling = !1;
2679
+ }));
2680
+ }
2681
+ };
2682
+ }
2683
+ doc() {
2684
+ return this.wnd.document.scrollingElement;
2685
+ }
2686
+ reportProgress() {
2687
+ if (!this.comms.ready) return;
2688
+ const e = Math.ceil(this.doc().scrollTop), t = this.doc().scrollHeight, i = this.wnd.innerHeight, s = Math.max(0, Math.min(1, e / t)), n = Math.max(0, Math.min(1, (e + i) / t));
2689
+ this.comms.send("progress", {
2690
+ start: s,
2691
+ end: n
2692
+ });
2693
+ }
2694
+ mount(e, t) {
2695
+ return this.wnd = e, this.comms = t, this.initialScrollHandled = !1, this.lastScrollTop = 0, this.isResizing = !1, this.resizeDebounce && (this.wnd.clearTimeout(this.resizeDebounce), this.resizeDebounce = null), this.resizeObserver = new ResizeObserver(() => {
2696
+ this.resizeDebounce && this.wnd.clearTimeout(this.resizeDebounce), this.isResizing = !0, this.resizeDebounce = this.wnd.setTimeout(() => {
2697
+ this.isResizing = !1, this.resizeDebounce = null, this.reportProgress();
2698
+ }, 50);
2699
+ }), this.resizeObserver.observe(e.document.body), e.addEventListener("scroll", this.handleScroll, { passive: !0 }), t.register("force_webkit_recalc", w.moduleName, () => {
2700
+ Ze(this.wnd);
2701
+ const i = this.doc().scrollTop;
2702
+ i > 1 ? this.doc().scrollTop = i - 1 : this.doc().scrollTop = i + 1, this.doc().scrollTop = i;
2703
+ }), t.register("go_progression", w.moduleName, (i, s) => {
2704
+ const n = i;
2705
+ if (n < 0 || n > 1) {
2706
+ t.send("error", {
2707
+ message: "go_progression must be given a position from 0.0 to 1.0"
2708
+ }), s(!1);
2709
+ return;
2710
+ }
2711
+ this.wnd.requestAnimationFrame(() => {
2712
+ this.doc().scrollTop = this.doc().offsetHeight * n, this.reportProgress(), v(this.wnd), s(!0);
2713
+ });
2714
+ }), this.comms.register("go_id", w.moduleName, (i, s) => {
2715
+ const n = e.document.getElementById(i);
2716
+ if (!n) {
2717
+ s(!1);
2718
+ return;
2719
+ }
2720
+ this.wnd.requestAnimationFrame(() => {
2721
+ this.doc().scrollTop = n.getBoundingClientRect().top + e.scrollY - e.innerHeight / 2, this.reportProgress(), v(this.wnd), s(!0);
2722
+ });
2723
+ }), t.register("go_text", w.moduleName, (i, s) => {
2724
+ let n;
2725
+ Array.isArray(i) && (i.length > 1 && (n = i[1]), i = i[0]);
2726
+ const o = D.deserialize(i), l = ee(this.wnd.document, new I({
2727
+ href: e.location.href,
2728
+ type: "text/html",
2729
+ text: o,
2730
+ locations: n ? new b({
2731
+ otherLocations: /* @__PURE__ */ new Map([
2732
+ ["cssSelector", n]
2733
+ ])
2734
+ }) : void 0
2735
+ }));
2736
+ if (!l) {
2737
+ s(!1);
2738
+ return;
2739
+ }
2740
+ this.wnd.requestAnimationFrame(() => {
2741
+ this.doc().scrollTop = l.getBoundingClientRect().top + e.scrollY - e.innerHeight / 2, this.reportProgress(), v(this.wnd), s(!0);
2742
+ });
2743
+ }), t.register("go_start", w.moduleName, (i, s) => {
2744
+ if (this.doc().scrollTop === 0) return s(!1);
2745
+ this.doc().scrollTop = 0, this.reportProgress(), s(!0);
2746
+ }), t.register("go_end", w.moduleName, (i, s) => {
2747
+ if (this.doc().scrollTop === this.doc().scrollHeight - this.doc().offsetHeight) return s(!1);
2748
+ this.doc().scrollTop = this.doc().scrollHeight - this.doc().offsetHeight, this.reportProgress(), s(!0);
2749
+ }), t.register("unfocus", w.moduleName, (i, s) => {
2750
+ v(this.wnd), s(!0);
2751
+ }), t.register([
2752
+ "go_next",
2753
+ "go_prev"
2754
+ ], w.moduleName, (i, s) => s(!1)), t.register("focus", w.moduleName, (i, s) => {
2755
+ this.reportProgress(), s(!0);
2756
+ }), t.register("first_visible_locator", w.moduleName, (i, s) => {
2757
+ const n = be(e, !0);
2758
+ t.send("first_visible_locator", n.serialize()), s(!0);
2759
+ }), t.log("WebPubSnapper Mounted"), !0;
2760
+ }
2761
+ unmount(e, t) {
2762
+ return t.unregisterAll(w.moduleName), this.resizeObserver.disconnect(), this.handleScroll && e.removeEventListener("scroll", this.handleScroll), t.log("WebPubSnapper Unmounted"), !0;
2663
2763
  }
2664
2764
  };
2665
- x.moduleName = "scroll_snapper";
2666
- let ie = x;
2667
- const fe = class fe extends Z {
2765
+ w.moduleName = "webpub_snapper";
2766
+ let ae = w;
2767
+ const Ee = class Ee extends X {
2668
2768
  constructor() {
2669
2769
  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);
2670
2770
  }
2671
2771
  onPointUp(e) {
2672
2772
  const t = this.wnd.getSelection();
2673
2773
  if (t && t.toString()?.length > 0) {
2674
- const r = t.getRangeAt(0)?.getClientRects();
2675
- if (!r || r.length === 0)
2774
+ const s = t.getRangeAt(0)?.getClientRects();
2775
+ if (!s || s.length === 0)
2676
2776
  return;
2677
- const n = r[0], o = {
2777
+ const n = s[0], o = {
2678
2778
  text: t.toString(),
2679
2779
  x: n.x,
2680
2780
  y: n.y,
@@ -2696,7 +2796,7 @@ const fe = class fe extends Z {
2696
2796
  y: e.clientY * i,
2697
2797
  targetFrameSrc: this.wnd.location.href,
2698
2798
  targetElement: e.target.outerHTML,
2699
- interactiveElement: qe(e.target)?.outerHTML,
2799
+ interactiveElement: Je(e.target)?.outerHTML,
2700
2800
  cssSelector: this.wnd._readium_cssSelectorGenerator.getCssSelector(e.target)
2701
2801
  }), this.pointerMoved = !1;
2702
2802
  }
@@ -2732,9 +2832,9 @@ const fe = class fe extends Z {
2732
2832
  return e.document.removeEventListener("pointerdown", this.onPointerDown), e.document.removeEventListener("pointerup", this.onPointerUp), e.document.removeEventListener("contextmenu", this.onContextMenu), e.document.removeEventListener("pointermove", this.onPointerMove), e.document.removeEventListener("click", this.onClicker), t.log("Peripherals Unmounted"), !0;
2733
2833
  }
2734
2834
  };
2735
- fe.moduleName = "peripherals";
2736
- let se = fe;
2737
- const $ = class $ extends Z {
2835
+ Ee.moduleName = "peripherals";
2836
+ let le = Ee;
2837
+ const V = class V extends X {
2738
2838
  constructor() {
2739
2839
  super(...arguments), this.mediaPlayingCount = 0, this.allAnimations = /* @__PURE__ */ new Set();
2740
2840
  }
@@ -2754,13 +2854,13 @@ const $ = class $ extends Z {
2754
2854
  Reflect.apply(t[1], t[2], t[3]);
2755
2855
  break;
2756
2856
  case 1:
2757
- const i = t[1], r = t[2];
2857
+ const i = t[1], s = t[2];
2758
2858
  e.removeEventListener(i.type, e._readium_eventBlocker, !0);
2759
2859
  const n = new Event(i.type, {
2760
2860
  bubbles: i.bubbles,
2761
2861
  cancelable: i.cancelable
2762
2862
  });
2763
- r ? r.dispatchEvent(n) : e.dispatchEvent(n);
2863
+ s ? s.dispatchEvent(n) : e.dispatchEvent(n);
2764
2864
  break;
2765
2865
  }
2766
2866
  }
@@ -2784,9 +2884,9 @@ const $ = class $ extends Z {
2784
2884
  ), Reflect.defineProperty(e.navigator, "epubReadingSystem", {
2785
2885
  value: {
2786
2886
  name: "readium-ts-toolkit",
2787
- version: "2.1.1",
2788
- hasFeature: (r, n = "") => {
2789
- switch (r) {
2887
+ version: "2.2.1",
2888
+ hasFeature: (s, n = "") => {
2889
+ switch (s) {
2790
2890
  case "dom-manipulation":
2791
2891
  return !0;
2792
2892
  case "layout-changes":
@@ -2807,18 +2907,18 @@ const $ = class $ extends Z {
2807
2907
  }
2808
2908
  },
2809
2909
  writable: !1
2810
- }), "getAnimations" in e.document && e.document.getAnimations().forEach((r) => {
2811
- r.cancel(), this.allAnimations.add(r);
2812
- }), t.register("activate", $.moduleName, (r, n) => {
2910
+ }), "getAnimations" in e.document && e.document.getAnimations().forEach((s) => {
2911
+ s.cancel(), this.allAnimations.add(s);
2912
+ }), t.register("activate", V.moduleName, (s, n) => {
2813
2913
  this.allAnimations.forEach((o) => {
2814
2914
  o.cancel(), o.play();
2815
2915
  }), n(!0);
2816
- }), t.register("unfocus", $.moduleName, (r, n) => {
2916
+ }), t.register("unfocus", V.moduleName, (s, n) => {
2817
2917
  this.pauseAllMedia(e), this.allAnimations.forEach((o) => o.pause()), n(!0);
2818
2918
  });
2819
2919
  const i = e.document.querySelectorAll("audio,video");
2820
- for (let r = 0; r < i.length; r++) {
2821
- const n = i[r];
2920
+ for (let s = 0; s < i.length; s++) {
2921
+ const n = i[s];
2822
2922
  n.addEventListener("play", this.onMediaPlayEvent, {
2823
2923
  passive: !0
2824
2924
  }), n.addEventListener("pause", this.onMediaPauseEvent, {
@@ -2831,46 +2931,46 @@ const $ = class $ extends Z {
2831
2931
  return e.removeEventListener("error", this.wndOnErr), e.removeEventListener("play", this.onMediaPlayEvent), e.removeEventListener("pause", this.onMediaPauseEvent), this.allAnimations.forEach((i) => i.cancel()), this.allAnimations.clear(), t.log("Setup Unmounted"), !0;
2832
2932
  }
2833
2933
  };
2834
- $.moduleName = "setup";
2835
- let K = $;
2836
- const Ie = "readium-viewport", N = class N extends K {
2934
+ V.moduleName = "setup";
2935
+ let Q = V;
2936
+ const Ue = "readium-viewport", O = class O extends Q {
2837
2937
  onViewportWidthChanged(e) {
2838
2938
  const t = e.target;
2839
- _(t, "--RS__viewportWidth", `${t.innerWidth}px`);
2939
+ j(t, "--RS__viewportWidth", `${t.innerWidth}px`);
2840
2940
  }
2841
2941
  mount(e, t) {
2842
2942
  if (!super.mount(e, t)) return !1;
2843
2943
  const i = e.document.createElement("meta");
2844
- return i.dataset.readium = "true", i.setAttribute("name", "viewport"), i.setAttribute("id", Ie), i.setAttribute(
2944
+ return i.dataset.readium = "true", i.setAttribute("name", "viewport"), i.setAttribute("id", Ue), i.setAttribute(
2845
2945
  "content",
2846
2946
  "width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no"
2847
2947
  ), e.document.head.appendChild(i), e.addEventListener("orientationchange", this.onViewportWidthChanged), e.addEventListener("resize", this.onViewportWidthChanged), this.onViewportWidthChanged({
2848
2948
  target: e
2849
- }), t.register("get_properties", N.moduleName, (r, n) => {
2850
- Ve(e), n(!0);
2851
- }), t.register("update_properties", N.moduleName, (r, n) => {
2852
- r["--RS__viewportWidth"] = `${e.innerWidth}px`, pt(e, r), n(!0);
2853
- }), t.register("set_property", N.moduleName, (r, n) => {
2854
- const o = r;
2855
- _(e, o[0], o[1]), n(!0);
2856
- }), t.register("remove_property", N.moduleName, (r, n) => {
2857
- pe(e, r), n(!0);
2858
- }), t.register("activate", N.moduleName, (r, n) => {
2949
+ }), t.register("get_properties", O.moduleName, (s, n) => {
2950
+ ve(e), n(!0);
2951
+ }), t.register("update_properties", O.moduleName, (s, n) => {
2952
+ s["--RS__viewportWidth"] = `${e.innerWidth}px`, Ye(e, s), n(!0);
2953
+ }), t.register("set_property", O.moduleName, (s, n) => {
2954
+ const o = s;
2955
+ j(e, o[0], o[1]), n(!0);
2956
+ }), t.register("remove_property", O.moduleName, (s, n) => {
2957
+ te(e, s), n(!0);
2958
+ }), t.register("activate", O.moduleName, (s, n) => {
2859
2959
  this.unblock(e), n(!0);
2860
2960
  }), t.log("ReflowableSetup Mounted"), !0;
2861
2961
  }
2862
2962
  unmount(e, t) {
2863
- return t.unregisterAll(N.moduleName), e.document.head.querySelector(`#${Ie}`)?.remove(), e.removeEventListener("orientationchange", this.onViewportWidthChanged), t.log("ReflowableSetup Unmounted"), super.unmount(e, t);
2963
+ return t.unregisterAll(O.moduleName), e.document.head.querySelector(`#${Ue}`)?.remove(), e.removeEventListener("orientationchange", this.onViewportWidthChanged), t.log("ReflowableSetup Unmounted"), super.unmount(e, t);
2864
2964
  }
2865
2965
  };
2866
- N.moduleName = "reflowable_setup";
2867
- let re = N;
2868
- const Re = "readium-fixed-style", P = class P extends K {
2966
+ O.moduleName = "reflowable_setup";
2967
+ let he = O;
2968
+ const Be = "readium-fixed-style", A = class A extends Q {
2869
2969
  mount(e, t) {
2870
2970
  if (!super.mount(e, t)) return !1;
2871
- e.navigator.epubReadingSystem.layoutStyle = "paginated";
2971
+ e.navigator.epubReadingSystem && (e.navigator.epubReadingSystem.layoutStyle = "paginated");
2872
2972
  const i = e.document.createElement("style");
2873
- return i.id = Re, i.dataset.readium = "true", i.textContent = `
2973
+ return i.id = Be, i.dataset.readium = "true", i.textContent = `
2874
2974
  html, body {
2875
2975
  text-size-adjust: none;
2876
2976
  -ms-text-size-adjust: none;
@@ -2882,13 +2982,13 @@ const Re = "readium-fixed-style", P = class P extends K {
2882
2982
  min-height: 100%;
2883
2983
 
2884
2984
  /*cursor: var() TODO*/
2885
- }`, e.document.head.appendChild(i), t.register("set_property", P.moduleName, (r, n) => {
2886
- const o = r;
2887
- _(e, o[0], o[1]), n(!0);
2888
- }), t.register("remove_property", P.moduleName, (r, n) => {
2889
- pe(e, r), n(!0);
2890
- }), t.register("first_visible_locator", P.moduleName, (r, n) => n(!1)), t.register("unfocus", P.moduleName, (r, n) => {
2891
- T(e), n(!0);
2985
+ }`, e.document.head.appendChild(i), t.register("set_property", A.moduleName, (s, n) => {
2986
+ const o = s;
2987
+ j(e, o[0], o[1]), n(!0);
2988
+ }), t.register("remove_property", A.moduleName, (s, n) => {
2989
+ te(e, s), n(!0);
2990
+ }), t.register("first_visible_locator", A.moduleName, (s, n) => n(!1)), t.register("unfocus", A.moduleName, (s, n) => {
2991
+ v(e), n(!0);
2892
2992
  }), t.register([
2893
2993
  "focus",
2894
2994
  "go_next",
@@ -2898,55 +2998,95 @@ const Re = "readium-fixed-style", P = class P extends K {
2898
2998
  "go_start",
2899
2999
  "go_text",
2900
3000
  "go_progression"
2901
- ], P.moduleName, (r, n) => n(!0)), t.register("activate", P.moduleName, (r, n) => {
3001
+ ], A.moduleName, (s, n) => n(!0)), t.register("activate", A.moduleName, (s, n) => {
2902
3002
  this.unblock(e), n(!0);
2903
3003
  }), t.log("FixedSetup Mounted"), !0;
2904
3004
  }
2905
3005
  unmount(e, t) {
2906
- return t.unregisterAll(P.moduleName), e.document.getElementById(Re)?.remove(), t.log("FixedSetup Unmounted"), super.unmount(e, t);
3006
+ return t.unregisterAll(A.moduleName), e.document.getElementById(Be)?.remove(), t.log("FixedSetup Unmounted"), super.unmount(e, t);
2907
3007
  }
2908
3008
  };
2909
- P.moduleName = "fixed_setup";
2910
- let ne = P;
2911
- const Nt = [
3009
+ A.moduleName = "fixed_setup";
3010
+ let ce = A;
3011
+ const L = class L extends X {
3012
+ wndOnErr(e) {
3013
+ this.comms?.send("error", {
3014
+ message: e.message,
3015
+ filename: e.filename,
3016
+ lineno: e.lineno,
3017
+ colno: e.colno
3018
+ });
3019
+ }
3020
+ mount(e, t) {
3021
+ return this.comms = t, e.addEventListener(
3022
+ "error",
3023
+ this.wndOnErr,
3024
+ !1
3025
+ ), t.register("get_properties", L.moduleName, (i, s) => {
3026
+ ve(e), s(!0);
3027
+ }), t.register("update_properties", L.moduleName, (i, s) => {
3028
+ Ye(e, i), s(!0);
3029
+ }), t.register("set_property", L.moduleName, (i, s) => {
3030
+ const n = i;
3031
+ j(e, n[0], n[1]), s(!0);
3032
+ }), t.register("remove_property", L.moduleName, (i, s) => {
3033
+ te(e, i), s(!0);
3034
+ }), t.register("activate", L.moduleName, (i, s) => {
3035
+ s(!0);
3036
+ }), t.log("WebPubSetup Mounted"), !0;
3037
+ }
3038
+ unmount(e, t) {
3039
+ return t.unregisterAll(L.moduleName), e.removeEventListener("error", this.wndOnErr), t.log("WebPubSetup Unmounted"), !0;
3040
+ }
3041
+ };
3042
+ L.moduleName = "webpub_setup";
3043
+ let ue = L;
3044
+ const Rt = [
2912
3045
  "fixed_setup",
2913
3046
  "decorator",
2914
3047
  "peripherals"
2915
- ], Ot = [
3048
+ ], zt = [
2916
3049
  "reflowable_setup",
2917
3050
  "decorator",
2918
3051
  "peripherals",
2919
3052
  "column_snapper",
2920
3053
  "scroll_snapper"
2921
- ], ze = new Map([
3054
+ ], Dt = [
3055
+ "webpub_setup",
3056
+ "webpub_snapper",
3057
+ "decorator",
3058
+ "peripherals"
3059
+ ], He = new Map([
2922
3060
  // All modules go here
2923
- ne,
3061
+ ce,
3062
+ he,
3063
+ ue,
3064
+ ae,
3065
+ le,
2924
3066
  re,
2925
- se,
2926
- ee,
2927
- te,
2928
- ie
2929
- ].map((s) => [s.moduleName, s]));
2930
- class Lt {
3067
+ ne,
3068
+ oe
3069
+ ].map((r) => [r.moduleName, r]));
3070
+ class Wt {
2931
3071
  /**
2932
3072
  * @param wnd Window instance to operate on
2933
3073
  * @param initialModules List of initial modules to load
2934
3074
  */
2935
3075
  constructor(e = window, t = []) {
2936
- this.loadedModules = [], this.wnd = e, this.comms = new Ke(e);
3076
+ this.loadedModules = [], this.wnd = e, this.comms = new it(e);
2937
3077
  const i = [...new Set(t)];
2938
3078
  if (i.length) {
2939
3079
  if (typeof e > "u")
2940
3080
  throw Error("Loader is not in a web browser");
2941
- e.parent !== e && this.comms.log("Loader is probably in a frame"), this.loadedModules = i.map((r) => {
2942
- const n = this.loadModule(r);
3081
+ e.parent !== e && this.comms.log("Loader is probably in a frame"), this.loadedModules = i.map((s) => {
3082
+ const n = this.loadModule(s);
2943
3083
  if (n)
2944
3084
  return n.mount(this.wnd, this.comms), n;
2945
- }).filter((r) => r !== void 0);
3085
+ }).filter((s) => s !== void 0);
2946
3086
  }
2947
3087
  }
2948
3088
  loadModule(e) {
2949
- const t = ze.get(e);
3089
+ const t = He.get(e);
2950
3090
  return t === void 0 ? (this.comms.log(`Module "${name}" does not exist in the library`), t) : new t();
2951
3091
  }
2952
3092
  /**
@@ -2964,10 +3104,10 @@ class Lt {
2964
3104
  * @returns Success
2965
3105
  */
2966
3106
  removeModule(e) {
2967
- const t = ze.get(e);
3107
+ const t = He.get(e);
2968
3108
  if (t === void 0)
2969
3109
  return this.comms.log(`Module "${e}" does not exist in the library`), !1;
2970
- const i = this.loadedModules.findIndex((r) => r instanceof t);
3110
+ const i = this.loadedModules.findIndex((s) => s instanceof t);
2971
3111
  return i < 0 ? !1 : (this.loadedModules[i].unmount(this.wnd, this.comms), this.loadedModules.splice(i, 1), !0);
2972
3112
  }
2973
3113
  /**
@@ -2978,16 +3118,17 @@ class Lt {
2978
3118
  }
2979
3119
  }
2980
3120
  export {
2981
- F as COMMS_VERSION,
2982
- Ke as Comms,
2983
- ee as Decorator,
2984
- Nt as FXLModules,
2985
- vt as Layout,
2986
- Lt as Loader,
2987
- Z as Module,
2988
- ze as ModuleLibrary,
2989
- se as Peripherals,
2990
- Ot as ReflowableModules,
2991
- yt as Width,
2992
- Ye as mid
3121
+ B as COMMS_VERSION,
3122
+ it as Comms,
3123
+ re as Decorator,
3124
+ Rt as FXLModules,
3125
+ wt as Layout,
3126
+ Wt as Loader,
3127
+ X as Module,
3128
+ He as ModuleLibrary,
3129
+ le as Peripherals,
3130
+ zt as ReflowableModules,
3131
+ Dt as WebPubModules,
3132
+ Tt as Width,
3133
+ tt as mid
2993
3134
  };