@readium/navigator 2.4.0-alpha.7 → 2.4.0-alpha.9

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
@@ -111,7 +111,7 @@ const f = class f {
111
111
  }
112
112
  };
113
113
  f.NONE = new f("none"), f.ANNOTATIONS = new f("annotations"), f.ARIA = new f("ARIA"), f.INDEX = new f("index"), f.PAGE_BREAK_MARKERS = new f("pageBreakMarkers"), f.PAGE_NAVIGATION = new f("pageNavigation"), f.PRINT_PAGE_NUMBERS = new f("printPageNumbers"), f.READING_ORDER = new f("readingOrder"), f.STRUCTURAL_NAVIGATION = new f("structuralNavigation"), f.TABLE_OF_CONTENTS = new f("tableOfContents"), f.TAGGED_PDF = new f("taggedPDF"), f.ALTERNATIVE_TEXT = new f("alternativeText"), f.AUDIO_DESCRIPTION = new f("audioDescription"), f.CAPTIONS = new f("captions"), f.CLOSED_CAPTIONS = new f("closedCaptions"), f.DESCRIBED_MATH = new f("describedMath"), f.LONG_DESCRIPTION = new f("longDescription"), f.OPEN_CAPTIONS = new f("openCaptions"), f.SIGN_LANGUAGE = new f("signLanguage"), f.TRANSCRIPT = new f("transcript"), f.DISPLAY_TRANSFORMABILITY = new f("displayTransformability"), f.SYNCHRONIZED_AUDIO_TEXT = new f("synchronizedAudioText"), f.TIMING_CONTROL = new f("timingControl"), f.UNLOCKED = new f("unlocked"), f.CHEM_ML = new f("ChemML"), f.LATEX = new f("latex"), f.LATEX_CHEMISTRY = new f("latex-chemistry"), f.MATH_ML = new f("MathML"), f.MATH_ML_CHEMISTRY = new f("MathML-chemistry"), f.TTS_MARKUP = new f("ttsMarkup"), f.HIGH_CONTRAST_AUDIO = new f("highContrastAudio"), f.HIGH_CONTRAST_DISPLAY = new f("highContrastDisplay"), f.LARGE_PRINT = new f("largePrint"), f.BRAILLE = new f("braille"), f.TACTILE_GRAPHIC = new f("tactileGraphic"), f.TACTILE_OBJECT = new f("tactileObject"), f.FULL_RUBY_ANNOTATIONS = new f("fullRubyAnnotations"), f.HORIZONTAL_WRITING = new f("horizontalWriting"), f.RUBY_ANNOTATIONS = new f("rubyAnnotations"), f.VERTICAL_WRITING = new f("verticalWriting"), f.WITH_ADDITIONAL_WORD_SEGMENTATION = new f("withAdditionalWordSegmentation"), f.WITHOUT_ADDITIONAL_WORD_SEGMENTATION = new f("withoutAdditionalWordSegmentation");
114
- let Ft = f;
114
+ let Nt = f;
115
115
  const C = class C {
116
116
  constructor(t) {
117
117
  this.value = t;
@@ -938,8 +938,8 @@ class B {
938
938
  duration: W(t.duration),
939
939
  bitrate: W(t.bitrate),
940
940
  languages: Li(t.language),
941
- alternates: Nt.deserialize(t.alternate),
942
- children: Nt.deserialize(t.children)
941
+ alternates: Ft.deserialize(t.alternate),
942
+ children: Ft.deserialize(t.children)
943
943
  });
944
944
  }
945
945
  /**
@@ -997,7 +997,7 @@ class B {
997
997
  });
998
998
  }
999
999
  }
1000
- class Nt {
1000
+ class Ft {
1001
1001
  /**
1002
1002
  * Creates a [Links].
1003
1003
  */
@@ -1009,7 +1009,7 @@ class Nt {
1009
1009
  */
1010
1010
  static deserialize(t) {
1011
1011
  if (t && Array.isArray(t))
1012
- return new Nt(
1012
+ return new Ft(
1013
1013
  t.map((e) => B.deserialize(e)).filter((e) => e !== void 0)
1014
1014
  );
1015
1015
  }
@@ -1091,7 +1091,7 @@ class Nt {
1091
1091
  return this.items.filter((t) => t.type);
1092
1092
  }
1093
1093
  }
1094
- var Oi = /* @__PURE__ */ ((s) => (s.EPUB = "https://readium.org/webpub-manifest/profiles/epub", s.AUDIOBOOK = "https://readium.org/webpub-manifest/profiles/audiobook", s.DIVINA = "https://readium.org/webpub-manifest/profiles/divina", s.PDF = "https://readium.org/webpub-manifest/profiles/pdf", s))(Oi || {}), N = /* @__PURE__ */ ((s) => (s.ltr = "ltr", s.rtl = "rtl", s))(N || {});
1094
+ var Oi = /* @__PURE__ */ ((s) => (s.EPUB = "https://readium.org/webpub-manifest/profiles/epub", s.AUDIOBOOK = "https://readium.org/webpub-manifest/profiles/audiobook", s.DIVINA = "https://readium.org/webpub-manifest/profiles/divina", s.PDF = "https://readium.org/webpub-manifest/profiles/pdf", s))(Oi || {}), F = /* @__PURE__ */ ((s) => (s.ltr = "ltr", s.rtl = "rtl", s))(F || {});
1095
1095
  j.prototype.getContains = function() {
1096
1096
  return new Set(this.otherProperties.contains || []);
1097
1097
  };
@@ -2012,7 +2012,7 @@ function Mi(s, t, e) {
2012
2012
  if (r === o)
2013
2013
  continue;
2014
2014
  const a = V(r.top, o.top, t) && V(r.bottom, o.bottom, t), l = V(r.left, o.left, t) && V(r.right, o.right, t);
2015
- if (a && !l && Fi(r, o, t)) {
2015
+ if (a && !l && Ni(r, o, t)) {
2016
2016
  const u = s.filter((y) => y !== r && y !== o), m = Ln(r, o);
2017
2017
  return u.push(m), Mi(
2018
2018
  u,
@@ -2058,7 +2058,7 @@ function Ui(s) {
2058
2058
  for (let t = 0; t < s.length; t++)
2059
2059
  for (let e = t + 1; e < s.length; e++) {
2060
2060
  const i = s[t], n = s[e];
2061
- if (i !== n && Fi(i, n, -1)) {
2061
+ if (i !== n && Ni(i, n, -1)) {
2062
2062
  let r = [], o;
2063
2063
  const a = ei(i, n);
2064
2064
  if (a.length === 1)
@@ -2135,7 +2135,7 @@ function Tn(s, t) {
2135
2135
  width: Math.max(0, i - e)
2136
2136
  };
2137
2137
  }
2138
- function Fi(s, t, e) {
2138
+ function Ni(s, t, e) {
2139
2139
  return (s.left < t.right || e >= 0 && V(s.left, t.right, e)) && (t.left < s.right || e >= 0 && V(t.left, s.right, e)) && (s.top < t.bottom || e >= 0 && V(s.top, t.bottom, e)) && (t.top < s.bottom || e >= 0 && V(t.top, s.bottom, e));
2140
2140
  }
2141
2141
  function V(s, t, e) {
@@ -2147,7 +2147,7 @@ function Te(s) {
2147
2147
  Object.hasOwn(e, i) && !Number.isNaN(Number.parseInt(i)) && (t[e[i]] = e.getPropertyValue(e[i]));
2148
2148
  return t;
2149
2149
  }
2150
- function Ni(s, t) {
2150
+ function Fi(s, t) {
2151
2151
  const e = Te(s);
2152
2152
  Object.keys(e).forEach((i) => {
2153
2153
  t.hasOwnProperty(i) || te(s, i);
@@ -2239,7 +2239,7 @@ const ct = { r: 255, g: 255, b: 255, a: 1 }, st = /* @__PURE__ */ new Map(), An
2239
2239
  const e = pe(s, t), i = ni(e, { r: 255, g: 255, b: 255, a: 1 }), n = ni(e, { r: 0, g: 0, b: 0, a: 1 });
2240
2240
  return i > n;
2241
2241
  }, Mn = (s, t = null) => me(s, t) ? "white" : "black", ri = "#FFFF00", Un = () => "Highlight" in window, si = ["IMG", "IMAGE", "AUDIO", "VIDEO", "SVG"];
2242
- class Fn {
2242
+ class Nn {
2243
2243
  /**
2244
2244
  * Creates a DecorationGroup object
2245
2245
  * @param id Unique HTML ID-adhering name of the group
@@ -2430,7 +2430,7 @@ const wt = class wt extends ft {
2430
2430
  mount(t, e) {
2431
2431
  return this.wnd = t, e.register("decorate", wt.moduleName, (i, n) => {
2432
2432
  const r = i;
2433
- r.decoration && r.decoration.locator && (r.decoration.locator = H.deserialize(r.decoration.locator)), this.groups.has(r.group) || this.groups.set(r.group, new Fn(
2433
+ r.decoration && r.decoration.locator && (r.decoration.locator = H.deserialize(r.decoration.locator)), this.groups.has(r.group) || this.groups.set(r.group, new Nn(
2434
2434
  t,
2435
2435
  e,
2436
2436
  `readium-decoration-${this.lastGroupId++}`,
@@ -2531,7 +2531,7 @@ function Ii(s) {
2531
2531
  const t = s.document.createElement("style");
2532
2532
  t.appendChild(s.document.createTextNode("*{}")), s.document.body.appendChild(t), s.document.body.removeChild(t);
2533
2533
  }
2534
- function Nn(s) {
2534
+ function Fn(s) {
2535
2535
  return s < 0.5 ? 2 * s * s : -1 + (4 - 2 * s) * s;
2536
2536
  }
2537
2537
  function T(s) {
@@ -2711,7 +2711,7 @@ const hi = "readium-column-snapper-style", Gn = 200, U = class U extends Et {
2711
2711
  ), c = this.snapOffset(a + h), u = c > this.scrollOffset() ? "right" : "left";
2712
2712
  if (this.checkSuspiciousSnap(u, Math.abs(c - this.scrollOffset())), t && c !== this.scrollOffset()) {
2713
2713
  this.snappingCancelled = !1;
2714
- const m = (b, _, z, Q) => z > Q ? _ : b + (_ - b) * Nn(z / Q), y = (
2714
+ const m = (b, _, z, Q) => z > Q ? _ : b + (_ - b) * Fn(z / Q), y = (
2715
2715
  /*Math.abs(startX - (this.useTransform ? currentOffset : 0)) < 10 ? 1 : */
2716
2716
  Gn * o
2717
2717
  );
@@ -3622,7 +3622,7 @@ const _t = class _t extends ft {
3622
3622
  ), Reflect.defineProperty(t.navigator, "epubReadingSystem", {
3623
3623
  value: {
3624
3624
  name: "readium-ts-toolkit",
3625
- version: "2.4.0-alpha.7",
3625
+ version: "2.4.0-alpha.9",
3626
3626
  hasFeature: (n, r = "") => {
3627
3627
  switch (n) {
3628
3628
  case "dom-manipulation":
@@ -3687,7 +3687,7 @@ const di = "readium-viewport", K = class K extends Ht {
3687
3687
  }), e.register("get_properties", K.moduleName, (n, r) => {
3688
3688
  Te(t), r(!0);
3689
3689
  }), e.register("update_properties", K.moduleName, (n, r) => {
3690
- n["--RS__viewportWidth"] = `${t.innerWidth}px`, Ni(t, n), r(!0);
3690
+ n["--RS__viewportWidth"] = `${t.innerWidth}px`, Fi(t, n), r(!0);
3691
3691
  }), e.register("set_property", K.moduleName, (n, r) => {
3692
3692
  const o = n;
3693
3693
  Pt(t, o[0], o[1]), r(!0);
@@ -3763,7 +3763,7 @@ const Z = class Z extends ft {
3763
3763
  ), e.register("get_properties", Z.moduleName, (i, n) => {
3764
3764
  Te(t), n(!0);
3765
3765
  }), e.register("update_properties", Z.moduleName, (i, n) => {
3766
- Ni(t, i), n(!0);
3766
+ Fi(t, i), n(!0);
3767
3767
  }), e.register("set_property", Z.moduleName, (i, n) => {
3768
3768
  const r = i;
3769
3769
  Pt(t, r[0], r[1]), n(!0);
@@ -3984,13 +3984,13 @@ class ji extends er {
3984
3984
  * Moves to the left content portion (eg. page) relative to the reading progression direction.
3985
3985
  */
3986
3986
  goLeft(t = !1, e) {
3987
- this.readingProgression === N.ltr ? this.goBackward(t, e) : this.readingProgression === N.rtl && this.goForward(t, e);
3987
+ this.readingProgression === F.ltr ? this.goBackward(t, e) : this.readingProgression === F.rtl && this.goForward(t, e);
3988
3988
  }
3989
3989
  /**
3990
3990
  * Moves to the right content portion (eg. page) relative to the reading progression direction.
3991
3991
  */
3992
3992
  goRight(t = !1, e) {
3993
- this.readingProgression === N.ltr ? this.goForward(t, e) : this.readingProgression === N.rtl && this.goBackward(t, e);
3993
+ this.readingProgression === F.ltr ? this.goForward(t, e) : this.readingProgression === F.rtl && this.goBackward(t, e);
3994
3994
  }
3995
3995
  }
3996
3996
  class ir {
@@ -4246,7 +4246,7 @@ class ar extends Yi {
4246
4246
  const Y = new Yi(), L = new ar();
4247
4247
  class lr {
4248
4248
  constructor(t, e = {}, i = []) {
4249
- this.hidden = !0, this.destroyed = !1, this.currModules = [], this.frame = document.createElement("iframe"), this.frame.classList.add("readium-navigator-iframe"), this.frame.style.visibility = "hidden", this.frame.style.setProperty("aria-hidden", "true"), this.frame.style.opacity = "0", this.frame.style.position = "absolute", this.frame.style.pointerEvents = "none", this.frame.style.transition = "visibility 0s, opacity 0.1s linear", this.frame.style.backgroundColor = "#FFFFFF", this.source = t, this.contentProtectionConfig = { ...e }, this.keyboardPeripheralsConfig = [...i];
4249
+ this.hidden = !0, this.destroyed = !1, this.currModules = [], this.frame = document.createElement("iframe"), this.frame.classList.add("readium-navigator-iframe"), this.frame.style.visibility = "hidden", this.frame.ariaHidden = "true", this.frame.style.opacity = "0", this.frame.style.position = "absolute", this.frame.style.pointerEvents = "none", this.frame.style.transition = "visibility 0s, opacity 0.1s linear", this.frame.style.backgroundColor = "#FFFFFF", this.source = t, this.contentProtectionConfig = { ...e }, this.keyboardPeripheralsConfig = [...i];
4250
4250
  }
4251
4251
  async load(t = []) {
4252
4252
  return new Promise((e, i) => {
@@ -4289,7 +4289,7 @@ class lr {
4289
4289
  }
4290
4290
  async hide() {
4291
4291
  if (!this.destroyed) {
4292
- if (this.frame.style.visibility = "hidden", this.frame.style.setProperty("aria-hidden", "true"), this.frame.style.opacity = "0", this.frame.style.pointerEvents = "none", this.hidden = !0, this.frame.parentElement)
4292
+ if (this.frame.style.visibility = "hidden", this.frame.ariaHidden = "true", this.frame.style.opacity = "0", this.frame.style.pointerEvents = "none", this.hidden = !0, this.frame.parentElement)
4293
4293
  return this.comms === void 0 || !this.comms.ready ? void 0 : new Promise((t, e) => {
4294
4294
  this.comms?.send("unfocus", void 0, (i) => {
4295
4295
  this.comms?.halt(), t();
@@ -4306,7 +4306,7 @@ class lr {
4306
4306
  this.comms?.send("focus", void 0, () => {
4307
4307
  this.applyContentProtection();
4308
4308
  const n = () => {
4309
- this.frame.style.removeProperty("visibility"), this.frame.style.removeProperty("aria-hidden"), this.frame.style.removeProperty("opacity"), this.frame.style.removeProperty("pointer-events"), this.hidden = !1, Y.UA.WebKit && this.comms?.send("force_webkit_recalc", void 0), e();
4309
+ this.frame.style.removeProperty("visibility"), this.frame.ariaHidden = null, this.frame.style.removeProperty("opacity"), this.frame.style.removeProperty("pointer-events"), this.hidden = !1, Y.UA.WebKit && this.comms?.send("force_webkit_recalc", void 0), e();
4310
4310
  };
4311
4311
  t !== void 0 ? this.comms?.send("go_progression", t, n) : n();
4312
4312
  });
@@ -4758,7 +4758,7 @@ function fr(s, t) {
4758
4758
  function yr(s, t) {
4759
4759
  return s == null || t == null || s >= t ? s : void 0;
4760
4760
  }
4761
- function F(s) {
4761
+ function N(s) {
4762
4762
  return typeof s == "string" ? s : s === null ? null : void 0;
4763
4763
  }
4764
4764
  function P(s) {
@@ -4792,7 +4792,7 @@ function Ki(s) {
4792
4792
  }
4793
4793
  class xt {
4794
4794
  constructor(t = {}) {
4795
- this.fontFamily = F(t.fontFamily), this.fontWeight = q(t.fontWeight, it.range), this.hyphens = P(t.hyphens), this.iOSPatch = P(t.iOSPatch), this.iPadOSPatch = P(t.iPadOSPatch), this.letterSpacing = v(t.letterSpacing), this.ligatures = P(t.ligatures), this.lineHeight = v(t.lineHeight), this.noRuby = P(t.noRuby), this.paragraphIndent = v(t.paragraphIndent), this.paragraphSpacing = v(t.paragraphSpacing), this.textAlign = ie(t.textAlign, J), this.textNormalization = P(t.textNormalization), this.wordSpacing = v(t.wordSpacing), this.zoom = q(t.zoom, Zt.range);
4795
+ this.fontFamily = N(t.fontFamily), this.fontWeight = q(t.fontWeight, it.range), this.hyphens = P(t.hyphens), this.iOSPatch = P(t.iOSPatch), this.iPadOSPatch = P(t.iPadOSPatch), this.letterSpacing = v(t.letterSpacing), this.ligatures = P(t.ligatures), this.lineHeight = v(t.lineHeight), this.noRuby = P(t.noRuby), this.paragraphIndent = v(t.paragraphIndent), this.paragraphSpacing = v(t.paragraphSpacing), this.textAlign = ie(t.textAlign, J), this.textNormalization = P(t.textNormalization), this.wordSpacing = v(t.wordSpacing), this.zoom = q(t.zoom, Zt.range);
4796
4796
  }
4797
4797
  static serialize(t) {
4798
4798
  const { ...e } = t;
@@ -4815,7 +4815,7 @@ class xt {
4815
4815
  }
4816
4816
  class Sr {
4817
4817
  constructor(t) {
4818
- this.fontFamily = F(t.fontFamily) || null, this.fontWeight = q(t.fontWeight, it.range) || null, this.hyphens = P(t.hyphens) ?? null, this.iOSPatch = t.iOSPatch === !1 ? !1 : (L.OS.iOS || L.OS.iPadOS) && L.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : L.OS.iPadOS && L.iOSRequest === "desktop", this.letterSpacing = v(t.letterSpacing) || null, this.ligatures = P(t.ligatures) ?? null, this.lineHeight = v(t.lineHeight) || null, this.noRuby = P(t.noRuby) ?? !1, this.paragraphIndent = v(t.paragraphIndent) ?? null, this.paragraphSpacing = v(t.paragraphSpacing) ?? null, this.textAlign = ie(t.textAlign, J) || null, this.textNormalization = P(t.textNormalization) ?? !1, this.wordSpacing = v(t.wordSpacing) || null, this.zoom = q(t.zoom, Zt.range) || 1, this.experiments = Ki(t.experiments) ?? null;
4818
+ this.fontFamily = N(t.fontFamily) || null, this.fontWeight = q(t.fontWeight, it.range) || null, this.hyphens = P(t.hyphens) ?? null, this.iOSPatch = t.iOSPatch === !1 ? !1 : (L.OS.iOS || L.OS.iPadOS) && L.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : L.OS.iPadOS && L.iOSRequest === "desktop", this.letterSpacing = v(t.letterSpacing) || null, this.ligatures = P(t.ligatures) ?? null, this.lineHeight = v(t.lineHeight) || null, this.noRuby = P(t.noRuby) ?? !1, this.paragraphIndent = v(t.paragraphIndent) ?? null, this.paragraphSpacing = v(t.paragraphSpacing) ?? null, this.textAlign = ie(t.textAlign, J) || null, this.textNormalization = P(t.textNormalization) ?? !1, this.wordSpacing = v(t.wordSpacing) || null, this.zoom = q(t.zoom, Zt.range) || 1, this.experiments = Ki(t.experiments) ?? null;
4819
4819
  }
4820
4820
  }
4821
4821
  class gi {
@@ -4961,7 +4961,7 @@ class fi {
4961
4961
  }
4962
4962
  get isDisplayTransformable() {
4963
4963
  return this.metadata?.accessibility?.feature?.some(
4964
- (t) => t.value === Ft.DISPLAY_TRANSFORMABILITY.value
4964
+ (t) => t.value === Nt.DISPLAY_TRANSFORMABILITY.value
4965
4965
  ) ?? !1;
4966
4966
  }
4967
4967
  get fontFamily() {
@@ -5681,7 +5681,7 @@ onmessage = function(event) {
5681
5681
  time: performance.now() - startTime
5682
5682
  })
5683
5683
  }
5684
- `, Fe = class Fe {
5684
+ `, Ne = class Ne {
5685
5685
  constructor(t, e) {
5686
5686
  this.callbacks = /* @__PURE__ */ new Map(), this.worker = t, this.blobUrl = e, this.worker.onmessage = (i) => {
5687
5687
  const n = i.data, r = n.id, o = this.callbacks.get(n.id);
@@ -5706,8 +5706,8 @@ onmessage = function(event) {
5706
5706
  this.worker.terminate(), URL.revokeObjectURL(this.blobUrl);
5707
5707
  }
5708
5708
  };
5709
- Fe.workerScript = xr;
5710
- let Jt = Fe;
5709
+ Ne.workerScript = xr;
5710
+ let Jt = Ne;
5711
5711
  function Ue(s) {
5712
5712
  return typeof window < "u" && console ? console[s] : (...t) => {
5713
5713
  };
@@ -6133,7 +6133,7 @@ class Ur extends ji {
6133
6133
  }
6134
6134
  get hasDisplayTransformability() {
6135
6135
  return this.pub.metadata?.accessibility?.feature?.some(
6136
- (t) => t.value === Ft.DISPLAY_TRANSFORMABILITY.value
6136
+ (t) => t.value === Nt.DISPLAY_TRANSFORMABILITY.value
6137
6137
  ) ?? !1;
6138
6138
  }
6139
6139
  eventListener(t, e) {
@@ -6363,7 +6363,7 @@ class Ur extends ji {
6363
6363
  });
6364
6364
  }
6365
6365
  }
6366
- const ps = Ur, Fr = (s) => {
6366
+ const ps = Ur, Nr = (s) => {
6367
6367
  const t = s.join(" ");
6368
6368
  return [
6369
6369
  // 'self' is useless because the document is loaded from a blob: URL
@@ -6412,17 +6412,14 @@ class on {
6412
6412
  }
6413
6413
  async buildHtmlFrame(t = !1) {
6414
6414
  if (!this.currentResource) throw new Error("No resource loaded");
6415
- const e = await this.currentResource.link(), i = await this.currentResource.readAsString();
6415
+ const e = await this.currentResource.link(), i = await this.currentResource.readAsXML();
6416
6416
  if (!i) throw new Error(`Failed reading item ${e.href}`);
6417
- const n = new DOMParser().parseFromString(
6418
- i,
6419
- e.mediaType.string
6420
- ), r = n.querySelector("parsererror");
6421
- if (r) {
6422
- const o = r.querySelector("div");
6423
- throw new Error(`Failed parsing item ${e.href}: ${o?.textContent || r.textContent}`);
6417
+ const n = i.querySelector("parsererror");
6418
+ if (n) {
6419
+ const r = n.querySelector("div");
6420
+ throw new Error(`Failed parsing item ${e.href}: ${r?.textContent || n.textContent}`);
6424
6421
  }
6425
- return this.injector && await this.injector.injectForDocument(n, e), this.finalizeDOM(n, this.pub.baseURL, e.toURL(this.baseURL) || "", e.mediaType, t, this.cssProperties);
6422
+ return this.injector && await this.injector.injectForDocument(i, e), this.finalizeDOM(i, this.pub.baseURL, e.toURL(this.baseURL) || "", e.mediaType, t, this.cssProperties);
6426
6423
  }
6427
6424
  async buildImageFrame() {
6428
6425
  if (!this.currentResource) throw new Error("No resource loaded");
@@ -6432,7 +6429,7 @@ class on {
6432
6429
  o.name = "viewport", o.content = `width=${t.width}, height=${t.height}`, o.dataset.readium = "true", i.head.appendChild(o);
6433
6430
  }
6434
6431
  const n = document.createElement("img");
6435
- n.src = e || "", n.alt = t.title || "", n.decoding = "async", i.body.appendChild(n), this.injector && await this.injector.injectForDocument(i, new B({
6432
+ n.src = e || "", n.alt = t.title || "", await n.decode(), i.body.appendChild(n), this.injector && await this.injector.injectForDocument(i, new B({
6436
6433
  // Temporary solution to address injector only expecting (X)HTML
6437
6434
  // documents for injection, which we are technically providing
6438
6435
  href: "readium-image-frame.xhtml",
@@ -6471,7 +6468,7 @@ class on {
6471
6468
  c.href = i, c.dataset.readium = "true", t.head.firstChild.before(c);
6472
6469
  }
6473
6470
  const h = t.createElement("meta");
6474
- return h.httpEquiv = "Content-Security-Policy", h.content = Fr(l), h.dataset.readium = "true", t.head.firstChild.before(h), URL.createObjectURL(
6471
+ return h.httpEquiv = "Content-Security-Policy", h.content = Nr(l), h.dataset.readium = "true", t.head.firstChild.before(h), URL.createObjectURL(
6475
6472
  new Blob([new XMLSerializer().serializeToString(t)], {
6476
6473
  type: n.isHTML ? n.string : "application/xhtml+xml"
6477
6474
  // Fallback to XHTML
@@ -6479,9 +6476,9 @@ class on {
6479
6476
  );
6480
6477
  }
6481
6478
  }
6482
- class Nr {
6479
+ class Fr {
6483
6480
  constructor(t, e = {}, i = []) {
6484
- this.hidden = !0, this.destroyed = !1, this.currModules = [], this.frame = document.createElement("iframe"), this.frame.sandbox.value = "allow-same-origin allow-scripts", this.frame.classList.add("readium-navigator-iframe"), this.frame.style.visibility = "hidden", this.frame.style.setProperty("aria-hidden", "true"), this.frame.style.opacity = "0", this.frame.style.position = "absolute", this.frame.style.pointerEvents = "none", this.frame.style.transition = "visibility 0s, opacity 0.1s linear", this.source = t, this.contentProtectionConfig = { ...e }, this.keyboardPeripheralsConfig = [...i];
6481
+ this.hidden = !0, this.destroyed = !1, this.currModules = [], this.frame = document.createElement("iframe"), this.frame.sandbox.value = "allow-same-origin allow-scripts", this.frame.classList.add("readium-navigator-iframe"), this.frame.style.visibility = "hidden", this.frame.ariaHidden = "true", this.frame.style.opacity = "0", this.frame.style.position = "absolute", this.frame.style.pointerEvents = "none", this.frame.style.transition = "visibility 0s, opacity 0.1s linear", this.source = t, this.contentProtectionConfig = { ...e }, this.keyboardPeripheralsConfig = [...i];
6485
6482
  }
6486
6483
  async load(t) {
6487
6484
  return new Promise((e, i) => {
@@ -6524,7 +6521,7 @@ class Nr {
6524
6521
  }
6525
6522
  async hide() {
6526
6523
  if (!this.destroyed) {
6527
- if (this.frame.style.visibility = "hidden", this.frame.style.setProperty("aria-hidden", "true"), this.frame.style.opacity = "0", this.frame.style.pointerEvents = "none", this.hidden = !0, this.frame.parentElement)
6524
+ if (this.frame.style.visibility = "hidden", this.frame.ariaHidden = "true", this.frame.style.opacity = "0", this.frame.style.pointerEvents = "none", this.hidden = !0, this.frame.parentElement)
6528
6525
  return this.comms === void 0 || !this.comms.ready ? void 0 : new Promise((t, e) => {
6529
6526
  this.comms?.send("unfocus", void 0, (i) => {
6530
6527
  this.comms?.halt(), t();
@@ -6541,7 +6538,7 @@ class Nr {
6541
6538
  this.comms?.send("focus", void 0, () => {
6542
6539
  this.applyContentProtection();
6543
6540
  const n = () => {
6544
- this.frame.style.removeProperty("visibility"), this.frame.style.removeProperty("aria-hidden"), this.frame.style.removeProperty("opacity"), this.frame.style.removeProperty("pointer-events"), this.hidden = !1, Y.UA.WebKit && this.comms?.send("force_webkit_recalc", void 0), e();
6541
+ this.frame.style.removeProperty("visibility"), this.frame.style.removeProperty("opacity"), this.frame.style.removeProperty("pointer-events"), this.frame.ariaHidden = null, this.hidden = !1, Y.UA.WebKit && this.comms?.send("force_webkit_recalc", void 0), e();
6545
6542
  };
6546
6543
  t !== void 0 ? this.comms?.send("go_progression", t, n) : n();
6547
6544
  });
@@ -6631,7 +6628,7 @@ class Dr {
6631
6628
  injector: this.injector
6632
6629
  }
6633
6630
  ));
6634
- const b = new Nr(await this.blobs.get(d).build(), this.contentProtectionConfig, this.keyboardPeripheralsConfig);
6631
+ const b = new Fr(await this.blobs.get(d).build(), this.contentProtectionConfig, this.keyboardPeripheralsConfig);
6635
6632
  d !== o && await b.hide(), this.container.appendChild(b.iframe), await b.load(i), this.pool.set(d, b);
6636
6633
  };
6637
6634
  try {
@@ -6687,7 +6684,7 @@ class Dr {
6687
6684
  }
6688
6685
  class Ir {
6689
6686
  constructor(t, e, i, n = {}, r = []) {
6690
- this.frameIsAppended = !1, this.currModules = [], this.pageSize = void 0, this.cachedPage = void 0, this.peripherals = t, this.debugHref = i, this.contentProtectionConfig = { ...n }, this.keyboardPeripheralsConfig = [...r], this.frame = document.createElement("iframe"), this.frame.sandbox.value = "allow-same-origin allow-scripts", this.frame.classList.add("readium-navigator-iframe"), this.frame.classList.add("blank"), this.frame.scrolling = "no", this.frame.style.visibility = "hidden", this.frame.style.setProperty("aria-hidden", "true"), this.frame.style.display = "none", this.frame.style.position = "absolute", this.frame.style.pointerEvents = "none", this.frame.style.transformOrigin = "0 0", this.frame.style.transform = "scale(1)", this.frame.style.background = "#fff", this.frame.style.touchAction = "none", this.frame.dataset.originalHref = i, this.source = "about:blank", this.wrapper = document.createElement("div"), this.wrapper.style.position = "relative", this.wrapper.style.float = this.wrapper.style.cssFloat = e === N.rtl ? "right" : "left";
6687
+ this.frameIsAppended = !1, this.currModules = [], this.viewportSize = void 0, this.cachedPage = void 0, this.peripherals = t, this.debugHref = i, this.contentProtectionConfig = { ...n }, this.keyboardPeripheralsConfig = [...r], this.frame = document.createElement("iframe"), this.frame.sandbox.value = "allow-same-origin allow-scripts", this.frame.classList.add("readium-navigator-iframe"), this.frame.classList.add("blank"), this.frame.scrolling = "no", this.frame.style.visibility = "hidden", this.frame.ariaHidden = "true", this.frame.style.display = "none", this.frame.style.position = "absolute", this.frame.style.pointerEvents = "none", this.frame.style.transformOrigin = "0 0", this.frame.style.transform = "scale(1)", this.frame.style.background = "#fff", this.frame.style.touchAction = "none", this.frame.dataset.originalHref = i, this.source = "about:blank", this.wrapper = document.createElement("div"), this.wrapper.style.position = "relative", this.wrapper.style.contain = "strict", this.wrapper.style.float = this.wrapper.style.cssFloat = e === F.rtl ? "right" : "left";
6691
6688
  }
6692
6689
  async load(t, e) {
6693
6690
  return this.frameIsAppended || (this.wrapper.appendChild(this.frame), this.frameIsAppended = !0), this.source === e && this.loadPromise && [...this.currModules].sort().join("|") === [...t].sort().join("|") ? this.loadPromise : (this.loaded && this.source !== e && this.window.stop(), this.source = e, this.loadPromise = new Promise((i, n) => {
@@ -6724,7 +6721,7 @@ class Ir {
6724
6721
  }
6725
6722
  // Parses the page size from the viewport meta tag of the loaded resource.
6726
6723
  loadPageSize() {
6727
- if (this.pageSize) return this.pageSize;
6724
+ if (this.viewportSize) return this.viewportSize;
6728
6725
  const t = this.frame.contentWindow, e = t.document.head.querySelector(
6729
6726
  "meta[name=viewport]"
6730
6727
  );
@@ -6734,12 +6731,12 @@ class Ir {
6734
6731
  for (; n = i.exec(e.content); )
6735
6732
  n[1] === "width" ? r = Number.parseFloat(n[2]) : n[1] === "height" && (o = Number.parseFloat(n[2]));
6736
6733
  if (r > 0 && o > 0)
6737
- return { width: r, height: o };
6734
+ return this.viewportSize = { width: r, height: o }, this.viewportSize;
6738
6735
  }
6739
- return this.pageSize = {
6736
+ return {
6740
6737
  width: t.document.body.scrollWidth,
6741
6738
  height: t.document.body.scrollHeight
6742
- }, this.pageSize;
6739
+ };
6743
6740
  }
6744
6741
  update(t) {
6745
6742
  if (!this.loaded) return;
@@ -6756,14 +6753,14 @@ class Ir {
6756
6753
  this.frame.style.left = `${o / 2}px`;
6757
6754
  } else
6758
6755
  this.frame.style.left = "0px";
6759
- this.frame.style.removeProperty("visibility"), this.frame.style.removeProperty("aria-hidden"), this.frame.style.removeProperty("pointer-events"), this.frame.classList.remove("blank"), this.frame.classList.add("loaded");
6756
+ this.frame.style.removeProperty("visibility"), this.frame.ariaHidden = null, this.frame.style.removeProperty("pointer-events"), this.frame.classList.remove("blank"), this.frame.classList.add("loaded");
6760
6757
  }
6761
6758
  async destroy() {
6762
6759
  await this.unfocus(), this.loader?.destroy(), this.wrapper.remove();
6763
6760
  }
6764
6761
  async unload() {
6765
6762
  if (this.loaded)
6766
- return this.deselect(), this.frame.style.visibility = "hidden", this.frame.style.setProperty("aria-hidden", "true"), this.frame.style.pointerEvents = "none", this.frame.classList.add("blank"), this.frame.classList.remove("loaded"), this.comms?.halt(), this.loader?.destroy(), this.comms = void 0, this.frame.blur(), new Promise((t, e) => {
6763
+ return this.deselect(), this.frame.style.visibility = "hidden", this.frame.ariaHidden = "true", this.frame.style.pointerEvents = "none", this.frame.classList.add("blank"), this.frame.classList.remove("loaded"), this.comms?.halt(), this.loader?.destroy(), this.comms = void 0, this.frame.blur(), new Promise((t, e) => {
6767
6764
  this.frame.addEventListener("load", () => {
6768
6765
  try {
6769
6766
  this.showPromise = void 0, t();
@@ -6774,7 +6771,7 @@ class Ir {
6774
6771
  this.showPromise = void 0, e(i.error);
6775
6772
  } catch {
6776
6773
  }
6777
- }, { once: !0 }), this.source = "about:blank", this.frame.contentWindow.location.replace("about:blank"), this.frame.style.display = "none";
6774
+ }, { once: !0 }), this.source = "about:blank", this.frame.contentWindow.location.replace("about:blank"), this.frame.style.display = "none", this.frame.style.width = "0px", this.frame.style.height = "0px";
6778
6775
  });
6779
6776
  }
6780
6777
  deselect() {
@@ -7159,7 +7156,7 @@ class jr {
7159
7156
  "center"
7160
7157
  ) : (
7161
7158
  // Center it
7162
- ((this.shift ? 0 : 1) + n - this.nLandscape) % 2 ? t.metadata.readingProgression === N.rtl ? "right" : "left" : t.metadata.readingProgression === N.rtl ? "left" : "right"
7159
+ ((this.shift ? 0 : 1) + n - this.nLandscape) % 2 ? t.metadata.readingProgression === F.rtl ? "right" : "left" : t.metadata.readingProgression === F.rtl ? "left" : "right"
7163
7160
  )
7164
7161
  })), (r || i.properties?.otherProperties.addBlank) && this.nLandscape++;
7165
7162
  }), e && (this.spreads = []), this.buildSpreads(t.readingOrder);
@@ -7189,7 +7186,7 @@ class jr {
7189
7186
  const Ei = 8, Ci = 5, $r = 300, Xr = 15e3, Yr = 250, qr = 150, Kr = 500;
7190
7187
  class Zr {
7191
7188
  constructor(t, e, i, n, r, o) {
7192
- if (this.pool = /* @__PURE__ */ new Map(), this.blobs = /* @__PURE__ */ new Map(), this.inprogress = /* @__PURE__ */ new Map(), this.delayedShow = /* @__PURE__ */ new Map(), this.delayedTimeout = /* @__PURE__ */ new Map(), this.previousFrames = [], this.injector = null, this.width = 0, this.height = 0, this.transform = "", this.currentSlide = 0, this.spread = !0, this.orientationInternal = -1, this.container = t, this.positions = e, this.pub = i, this.injector = n ?? null, this.contentProtectionConfig = r || {}, this.keyboardPeripheralsConfig = o || [], this.spreadPresentation = i.metadata.otherMetadata?.spread || Ee.auto, this.pub.metadata.effectiveReadingProgression !== N.rtl && this.pub.metadata.effectiveReadingProgression !== N.ltr)
7189
+ if (this.pool = /* @__PURE__ */ new Map(), this.blobs = /* @__PURE__ */ new Map(), this.inprogress = /* @__PURE__ */ new Map(), this.delayedShow = /* @__PURE__ */ new Map(), this.delayedTimeout = /* @__PURE__ */ new Map(), this.previousFrames = [], this.injector = null, this.width = 0, this.height = 0, this.transform = "", this.currentSlide = 0, this.spread = !0, this.orientationInternal = -1, this.container = t, this.positions = e, this.pub = i, this.injector = n ?? null, this.contentProtectionConfig = r || {}, this.keyboardPeripheralsConfig = o || [], this.spreadPresentation = i.metadata.otherMetadata?.spread || Ee.auto, this.pub.metadata.effectiveReadingProgression !== F.rtl && this.pub.metadata.effectiveReadingProgression !== F.ltr)
7193
7190
  throw Error("Unsupported reading progression for EPUB");
7194
7191
  this.spreader = new jr(this.pub), this.containerHeightCached = t.clientHeight, this.bookElement = document.createElement("div"), this.bookElement.ariaLabel = "Book", this.bookElement.tabIndex = -1, this.updateBookStyle(!0), this.spineElement = document.createElement("div"), this.spineElement.ariaLabel = "Spine", this.bookElement.appendChild(this.spineElement), this.container.appendChild(this.bookElement), this.updateSpineStyle(!0), this.peripherals = new Gr(this);
7195
7192
  const a = document.createDocumentFragment();
@@ -7230,7 +7227,7 @@ class Zr {
7230
7227
  this.width = this.bookElement.clientWidth, this.height = this.bookElement.clientHeight;
7231
7228
  }
7232
7229
  get rtl() {
7233
- return this.pub.metadata.effectiveReadingProgression === N.rtl;
7230
+ return this.pub.metadata.effectiveReadingProgression === F.rtl;
7234
7231
  }
7235
7232
  get single() {
7236
7233
  return !this.spread || this.portrait;
@@ -7425,8 +7422,8 @@ class Zr {
7425
7422
  let Q = !1;
7426
7423
  const hn = window.setTimeout(async () => {
7427
7424
  this.delayedTimeout.set(d, 0);
7428
- const cn = this.makeSpread(this.reAlign(p)), dn = this.spreadPosition(cn, b), Ne = this.pool.get(d);
7429
- await Ne.load(i, await this.blobs.get(d).build(!0)), this.peripherals.isScaled || await Ne.show(dn), this.delayedShow.delete(d), Q = !0, _();
7425
+ const cn = this.makeSpread(this.reAlign(p)), dn = this.spreadPosition(cn, b), Fe = this.pool.get(d);
7426
+ await Fe.load(i, await this.blobs.get(d).build(!0)), this.peripherals.isScaled || await Fe.show(dn), this.delayedShow.delete(d), Q = !0, _();
7430
7427
  }, $r);
7431
7428
  setTimeout(() => {
7432
7429
  !Q && this.delayedShow.has(d) && z(`Offscreen load timeout: ${d}`);
@@ -7507,7 +7504,7 @@ class Zr {
7507
7504
  }
7508
7505
  class Ot {
7509
7506
  constructor(t = {}) {
7510
- this.backgroundColor = F(t.backgroundColor), this.blendFilter = P(t.blendFilter), this.constraint = v(t.constraint), this.columnCount = v(t.columnCount), this.darkenFilter = pt(t.darkenFilter), this.deprecatedFontSize = P(t.deprecatedFontSize), this.fontFamily = F(t.fontFamily), this.fontSize = q(t.fontSize, Gt.range), this.fontSizeNormalize = P(t.fontSizeNormalize), this.fontOpticalSizing = P(t.fontOpticalSizing), this.fontWeight = q(t.fontWeight, it.range), this.fontWidth = q(t.fontWidth, jt.range), this.hyphens = P(t.hyphens), this.invertFilter = pt(t.invertFilter), this.invertGaijiFilter = pt(t.invertGaijiFilter), this.iOSPatch = P(t.iOSPatch), this.iPadOSPatch = P(t.iPadOSPatch), this.letterSpacing = v(t.letterSpacing), this.ligatures = P(t.ligatures), this.lineHeight = v(t.lineHeight), this.linkColor = F(t.linkColor), this.noRuby = P(t.noRuby), this.pageGutter = v(t.pageGutter), this.paragraphIndent = v(t.paragraphIndent), this.paragraphSpacing = v(t.paragraphSpacing), this.scroll = P(t.scroll), this.scrollPaddingTop = v(t.scrollPaddingTop), this.scrollPaddingBottom = v(t.scrollPaddingBottom), this.scrollPaddingLeft = v(t.scrollPaddingLeft), this.scrollPaddingRight = v(t.scrollPaddingRight), this.selectionBackgroundColor = F(t.selectionBackgroundColor), this.selectionTextColor = F(t.selectionTextColor), this.textAlign = ie(t.textAlign, J), this.textColor = F(t.textColor), this.textNormalization = P(t.textNormalization), this.visitedColor = F(t.visitedColor), this.wordSpacing = v(t.wordSpacing), this.optimalLineLength = v(t.optimalLineLength), this.maximalLineLength = v(t.maximalLineLength), this.minimalLineLength = v(t.minimalLineLength);
7507
+ this.backgroundColor = N(t.backgroundColor), this.blendFilter = P(t.blendFilter), this.constraint = v(t.constraint), this.columnCount = v(t.columnCount), this.darkenFilter = pt(t.darkenFilter), this.deprecatedFontSize = P(t.deprecatedFontSize), this.fontFamily = N(t.fontFamily), this.fontSize = q(t.fontSize, Gt.range), this.fontSizeNormalize = P(t.fontSizeNormalize), this.fontOpticalSizing = P(t.fontOpticalSizing), this.fontWeight = q(t.fontWeight, it.range), this.fontWidth = q(t.fontWidth, jt.range), this.hyphens = P(t.hyphens), this.invertFilter = pt(t.invertFilter), this.invertGaijiFilter = pt(t.invertGaijiFilter), this.iOSPatch = P(t.iOSPatch), this.iPadOSPatch = P(t.iPadOSPatch), this.letterSpacing = v(t.letterSpacing), this.ligatures = P(t.ligatures), this.lineHeight = v(t.lineHeight), this.linkColor = N(t.linkColor), this.noRuby = P(t.noRuby), this.pageGutter = v(t.pageGutter), this.paragraphIndent = v(t.paragraphIndent), this.paragraphSpacing = v(t.paragraphSpacing), this.scroll = P(t.scroll), this.scrollPaddingTop = v(t.scrollPaddingTop), this.scrollPaddingBottom = v(t.scrollPaddingBottom), this.scrollPaddingLeft = v(t.scrollPaddingLeft), this.scrollPaddingRight = v(t.scrollPaddingRight), this.selectionBackgroundColor = N(t.selectionBackgroundColor), this.selectionTextColor = N(t.selectionTextColor), this.textAlign = ie(t.textAlign, J), this.textColor = N(t.textColor), this.textNormalization = P(t.textNormalization), this.visitedColor = N(t.visitedColor), this.wordSpacing = v(t.wordSpacing), this.optimalLineLength = v(t.optimalLineLength), this.maximalLineLength = v(t.maximalLineLength), this.minimalLineLength = v(t.minimalLineLength);
7511
7508
  }
7512
7509
  static serialize(t) {
7513
7510
  const { ...e } = t;
@@ -7530,7 +7527,7 @@ class Ot {
7530
7527
  }
7531
7528
  class Jr {
7532
7529
  constructor(t) {
7533
- this.backgroundColor = F(t.backgroundColor) || null, this.blendFilter = P(t.blendFilter) ?? !1, this.constraint = v(t.constraint) || 0, this.columnCount = v(t.columnCount) || null, this.darkenFilter = pt(t.darkenFilter) ?? !1, this.deprecatedFontSize = P(t.deprecatedFontSize), (this.deprecatedFontSize === !1 || this.deprecatedFontSize === null) && (this.deprecatedFontSize = !CSS.supports("zoom", "1")), this.fontFamily = F(t.fontFamily) || null, this.fontSize = q(t.fontSize, Gt.range) || 1, this.fontSizeNormalize = P(t.fontSizeNormalize) ?? !1, this.fontOpticalSizing = P(t.fontOpticalSizing) ?? null, this.fontWeight = q(t.fontWeight, it.range) || null, this.fontWidth = q(t.fontWidth, jt.range) || null, this.hyphens = P(t.hyphens) ?? null, this.invertFilter = pt(t.invertFilter) ?? !1, this.invertGaijiFilter = pt(t.invertGaijiFilter) ?? !1, this.iOSPatch = t.iOSPatch === !1 ? !1 : (L.OS.iOS || L.OS.iPadOS) && L.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : L.OS.iPadOS && L.iOSRequest === "desktop", this.letterSpacing = v(t.letterSpacing) || null, this.ligatures = P(t.ligatures) ?? null, this.lineHeight = v(t.lineHeight) || null, this.linkColor = F(t.linkColor) || null, this.noRuby = P(t.noRuby) ?? !1, this.pageGutter = le(v(t.pageGutter), 20), this.paragraphIndent = v(t.paragraphIndent) ?? null, this.paragraphSpacing = v(t.paragraphSpacing) ?? null, this.scroll = P(t.scroll) ?? !1, this.scrollPaddingTop = v(t.scrollPaddingTop) ?? null, this.scrollPaddingBottom = v(t.scrollPaddingBottom) ?? null, this.scrollPaddingLeft = v(t.scrollPaddingLeft) ?? null, this.scrollPaddingRight = v(t.scrollPaddingRight) ?? null, this.selectionBackgroundColor = F(t.selectionBackgroundColor) || null, this.selectionTextColor = F(t.selectionTextColor) || null, this.textAlign = ie(t.textAlign, J) || null, this.textColor = F(t.textColor) || null, this.textNormalization = P(t.textNormalization) ?? !1, this.visitedColor = F(t.visitedColor) || null, this.wordSpacing = v(t.wordSpacing) || null, this.optimalLineLength = v(t.optimalLineLength) || 65, this.maximalLineLength = le(yr(t.maximalLineLength, this.optimalLineLength), 80), this.minimalLineLength = le(fr(t.minimalLineLength, this.optimalLineLength), 40), this.experiments = Ki(t.experiments) || null;
7530
+ this.backgroundColor = N(t.backgroundColor) || null, this.blendFilter = P(t.blendFilter) ?? !1, this.constraint = v(t.constraint) || 0, this.columnCount = v(t.columnCount) || null, this.darkenFilter = pt(t.darkenFilter) ?? !1, this.deprecatedFontSize = P(t.deprecatedFontSize), (this.deprecatedFontSize === !1 || this.deprecatedFontSize === null) && (this.deprecatedFontSize = !CSS.supports("zoom", "1")), this.fontFamily = N(t.fontFamily) || null, this.fontSize = q(t.fontSize, Gt.range) || 1, this.fontSizeNormalize = P(t.fontSizeNormalize) ?? !1, this.fontOpticalSizing = P(t.fontOpticalSizing) ?? null, this.fontWeight = q(t.fontWeight, it.range) || null, this.fontWidth = q(t.fontWidth, jt.range) || null, this.hyphens = P(t.hyphens) ?? null, this.invertFilter = pt(t.invertFilter) ?? !1, this.invertGaijiFilter = pt(t.invertGaijiFilter) ?? !1, this.iOSPatch = t.iOSPatch === !1 ? !1 : (L.OS.iOS || L.OS.iPadOS) && L.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : L.OS.iPadOS && L.iOSRequest === "desktop", this.letterSpacing = v(t.letterSpacing) || null, this.ligatures = P(t.ligatures) ?? null, this.lineHeight = v(t.lineHeight) || null, this.linkColor = N(t.linkColor) || null, this.noRuby = P(t.noRuby) ?? !1, this.pageGutter = le(v(t.pageGutter), 20), this.paragraphIndent = v(t.paragraphIndent) ?? null, this.paragraphSpacing = v(t.paragraphSpacing) ?? null, this.scroll = P(t.scroll) ?? !1, this.scrollPaddingTop = v(t.scrollPaddingTop) ?? null, this.scrollPaddingBottom = v(t.scrollPaddingBottom) ?? null, this.scrollPaddingLeft = v(t.scrollPaddingLeft) ?? null, this.scrollPaddingRight = v(t.scrollPaddingRight) ?? null, this.selectionBackgroundColor = N(t.selectionBackgroundColor) || null, this.selectionTextColor = N(t.selectionTextColor) || null, this.textAlign = ie(t.textAlign, J) || null, this.textColor = N(t.textColor) || null, this.textNormalization = P(t.textNormalization) ?? !1, this.visitedColor = N(t.visitedColor) || null, this.wordSpacing = v(t.wordSpacing) || null, this.optimalLineLength = v(t.optimalLineLength) || 65, this.maximalLineLength = le(yr(t.maximalLineLength, this.optimalLineLength), 80), this.minimalLineLength = le(fr(t.minimalLineLength, this.optimalLineLength), 40), this.experiments = Ki(t.experiments) || null;
7534
7531
  }
7535
7532
  }
7536
7533
  const Qr = "#FFFFFF", ts = "#121212", es = "#0000EE", is = "#551A8B", ns = "#b4d8fe", rs = "inherit", lt = {
@@ -7683,7 +7680,7 @@ class xi {
7683
7680
  return new A({
7684
7681
  initialValue: this.preferences.hyphens,
7685
7682
  effectiveValue: this.settings.hyphens || !1,
7686
- isEffective: this.layout !== S.fixed && this.metadata?.effectiveReadingProgression === N.ltr && this.preferences.hyphens !== null,
7683
+ isEffective: this.layout !== S.fixed && this.metadata?.effectiveReadingProgression === F.ltr && this.preferences.hyphens !== null,
7687
7684
  onChange: (t) => {
7688
7685
  this.updatePreference("hyphens", t || null);
7689
7686
  }
@@ -9661,9 +9658,9 @@ class ln extends ji {
9661
9658
  }
9662
9659
  } else console.log("Clicked on", o);
9663
9660
  } else {
9664
- if (this._layout === S.fixed && this.framePool.doNotDisturb && (n.doNotDisturb = !0), this._layout === S.fixed && (this.currentProgression === N.rtl || this.currentProgression === N.ltr) && this.framePool.currentFrames.length > 1) {
9661
+ if (this._layout === S.fixed && this.framePool.doNotDisturb && (n.doNotDisturb = !0), this._layout === S.fixed && (this.currentProgression === F.rtl || this.currentProgression === F.ltr) && this.framePool.currentFrames.length > 1) {
9665
9662
  const l = this.framePool.currentFrames;
9666
- n.targetFrameSrc === l[this.currentProgression === N.rtl ? 0 : 1]?.source && (n.x += (l[this.currentProgression === N.rtl ? 1 : 0]?.iframe.contentWindow?.innerWidth ?? 0) * window.devicePixelRatio);
9663
+ n.targetFrameSrc === l[this.currentProgression === F.rtl ? 0 : 1]?.source && (n.x += (l[this.currentProgression === F.rtl ? 1 : 0]?.iframe.contentWindow?.innerWidth ?? 0) * window.devicePixelRatio);
9667
9664
  }
9668
9665
  if (t === "click" ? this.listeners.click(n) : this.listeners.tap(n)) break;
9669
9666
  const a = (this._cframes.length === 2 ? this._cframes[0].window.innerWidth + this._cframes[1].window.innerWidth : this._cframes[0].window.innerWidth) * window.devicePixelRatio / 4;
@@ -10094,7 +10091,7 @@ export {
10094
10091
  Gr as FXLPeripherals,
10095
10092
  jr as FXLSpreader,
10096
10093
  Ct as FrameComms,
10097
- Nr as FrameManager,
10094
+ Fr as FrameManager,
10098
10095
  Dr as FramePoolManager,
10099
10096
  Wr as HorizontalThird,
10100
10097
  tn as Injector,
@@ -10130,7 +10127,7 @@ export {
10130
10127
  fr as ensureLessThanOrEqual,
10131
10128
  yr as ensureMoreThanOrEqual,
10132
10129
  v as ensureNonNegative,
10133
- F as ensureString,
10130
+ N as ensureString,
10134
10131
  q as ensureValueInRange,
10135
10132
  Me as experiments,
10136
10133
  ot as filterRangeConfig,