@readium/navigator 2.5.6 → 2.5.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- const S = class S {
1
+ const P = class P {
2
2
  constructor(t) {
3
3
  this.uri = t;
4
4
  }
@@ -7,7 +7,7 @@ const S = class S {
7
7
  */
8
8
  static deserialize(t) {
9
9
  if (!(!t || typeof t != "string"))
10
- return new S(t);
10
+ return new P(t);
11
11
  }
12
12
  /**
13
13
  * Serializes an [AccessibilityProfile] to its RWPM JSON representation.
@@ -19,23 +19,23 @@ const S = class S {
19
19
  * Returns true if the profile is a WCAG Level A profile.
20
20
  */
21
21
  get isWCAGLevelA() {
22
- return this === S.EPUB_A11Y_10_WCAG_20_A || this === S.EPUB_A11Y_11_WCAG_20_A || this === S.EPUB_A11Y_11_WCAG_21_A || this === S.EPUB_A11Y_11_WCAG_22_A;
22
+ return this === P.EPUB_A11Y_10_WCAG_20_A || this === P.EPUB_A11Y_11_WCAG_20_A || this === P.EPUB_A11Y_11_WCAG_21_A || this === P.EPUB_A11Y_11_WCAG_22_A;
23
23
  }
24
24
  /**
25
25
  * Returns true if the profile is a WCAG Level AA profile.
26
26
  */
27
27
  get isWCAGLevelAA() {
28
- return this === S.EPUB_A11Y_10_WCAG_20_AA || this === S.EPUB_A11Y_11_WCAG_20_AA || this === S.EPUB_A11Y_11_WCAG_21_AA || this === S.EPUB_A11Y_11_WCAG_22_AA;
28
+ return this === P.EPUB_A11Y_10_WCAG_20_AA || this === P.EPUB_A11Y_11_WCAG_20_AA || this === P.EPUB_A11Y_11_WCAG_21_AA || this === P.EPUB_A11Y_11_WCAG_22_AA;
29
29
  }
30
30
  /**
31
31
  * Returns true if the profile is a WCAG Level AAA profile.
32
32
  */
33
33
  get isWCAGLevelAAA() {
34
- return this === S.EPUB_A11Y_10_WCAG_20_AAA || this === S.EPUB_A11Y_11_WCAG_20_AAA || this === S.EPUB_A11Y_11_WCAG_21_AAA || this === S.EPUB_A11Y_11_WCAG_22_AAA;
34
+ return this === P.EPUB_A11Y_10_WCAG_20_AAA || this === P.EPUB_A11Y_11_WCAG_20_AAA || this === P.EPUB_A11Y_11_WCAG_21_AAA || this === P.EPUB_A11Y_11_WCAG_22_AAA;
35
35
  }
36
36
  };
37
- S.EPUB_A11Y_10_WCAG_20_A = new S("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-a"), S.EPUB_A11Y_10_WCAG_20_AA = new S("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-aa"), S.EPUB_A11Y_10_WCAG_20_AAA = new S("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-aaa"), S.EPUB_A11Y_11_WCAG_20_A = new S("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-a"), S.EPUB_A11Y_11_WCAG_20_AA = new S("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-aa"), S.EPUB_A11Y_11_WCAG_20_AAA = new S("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-aaa"), S.EPUB_A11Y_11_WCAG_21_A = new S("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-a"), S.EPUB_A11Y_11_WCAG_21_AA = new S("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-aa"), S.EPUB_A11Y_11_WCAG_21_AAA = new S("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-aaa"), S.EPUB_A11Y_11_WCAG_22_A = new S("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-a"), S.EPUB_A11Y_11_WCAG_22_AA = new S("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-aa"), S.EPUB_A11Y_11_WCAG_22_AAA = new S("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-aaa");
38
- let Qe = S;
37
+ P.EPUB_A11Y_10_WCAG_20_A = new P("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-a"), P.EPUB_A11Y_10_WCAG_20_AA = new P("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-aa"), P.EPUB_A11Y_10_WCAG_20_AAA = new P("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-aaa"), P.EPUB_A11Y_11_WCAG_20_A = new P("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-a"), P.EPUB_A11Y_11_WCAG_20_AA = new P("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-aa"), P.EPUB_A11Y_11_WCAG_20_AAA = new P("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-aaa"), P.EPUB_A11Y_11_WCAG_21_A = new P("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-a"), P.EPUB_A11Y_11_WCAG_21_AA = new P("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-aa"), P.EPUB_A11Y_11_WCAG_21_AAA = new P("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-aaa"), P.EPUB_A11Y_11_WCAG_22_A = new P("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-a"), P.EPUB_A11Y_11_WCAG_22_AA = new P("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-aa"), P.EPUB_A11Y_11_WCAG_22_AAA = new P("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-aaa");
38
+ let Qe = P;
39
39
  const _ = class _ {
40
40
  constructor(t) {
41
41
  this.value = t;
@@ -152,8 +152,8 @@ const k = class k {
152
152
  };
153
153
  k.NONE = new k("none"), k.DOCUMENTED = new k("documented"), k.LEGAL = new k("legal"), k.TEMPORARY = new k("temporary"), k.TECHNICAL = new k("technical"), k.EAA_DISPROPORTIONATE_BURDEN = new k("eaa-disproportionate-burden"), k.EAA_FUNDAMENTAL_ALTERATION = new k("eaa-fundamental-alteration"), k.EAA_MICROENTERPRISE = new k("eaa-microenterprise"), k.EAA_TECHNICAL_IMPOSSIBILITY = new k("eaa-technical-impossibility"), k.EAA_TEMPORARY = new k("eaa-temporary");
154
154
  let ni = k;
155
- const si = ["en", "ar", "da", "fr", "it", "pt_PT", "sv"], kn = /* @__PURE__ */ JSON.parse(`{"format":{"audiobook":"Audiobook","audiobookJSON":"Audiobook Manifest","cbz":"Comic Book Archive","divina":"Divina Publication","divinaJSON":"Divina Publication Manifest","epub":"EPUB","lcpa":"LCP Protected Audiobook","lcpdf":"LCP Protected PDF","lcpl":"LCP License Document","pdf":"PDF","rwp":"Readium Web Publication","rwpm":"Readium Web Publication Manifest","zab":"Audiobook Archive","zip":"ZIP Archive"},"kind":{"audiobook_one":"audiobook","audiobook_other":"audiobooks","book_one":"book","book_other":"books","comic_one":"comic","comic_other":"comics","document_one":"document","document_other":"documents"},"metadata":{"accessibility":{"display-guide":{"accessibility-summary":{"no-metadata":"No information is available","publisher-contact":"For more information about the accessibility of this product, please contact the publisher: ","title":"Accessibility summary"},"additional-accessibility-information":{"aria":{"compact":"ARIA roles included","descriptive":"Content is enhanced with ARIA roles to optimize organization and facilitate navigation"},"audio-descriptions":"Audio descriptions","braille":"Braille","color-not-sole-means-of-conveying-information":"Color is not the sole means of conveying information","dyslexia-readability":"Dyslexia readability","full-ruby-annotations":"Full ruby annotations","high-contrast-between-foreground-and-background-audio":"High contrast between foreground and background audio","high-contrast-between-text-and-background":"High contrast between foreground text and background","large-print":"Large print","page-breaks":{"compact":"Page breaks included","descriptive":"Page breaks included from the original print source"},"ruby-annotations":"Some Ruby annotations","sign-language":"Sign language","tactile-graphics":{"compact":"Tactile graphics included","descriptive":"Tactile graphics have been integrated to facilitate access to visual elements for blind people"},"tactile-objects":"Tactile 3D objects","text-to-speech-hinting":"Text-to-speech hinting provided","title":"Additional accessibility information","ultra-high-contrast-between-text-and-background":"Ultra high contrast between text and background","visible-page-numbering":"Visible page numbering","without-background-sounds":"Without background sounds"},"conformance":{"a":{"compact":"This publication meets minimum accessibility standards","descriptive":"The publication contains a conformance statement that it meets the EPUB Accessibility and WCAG 2 Level A standard"},"aa":{"compact":"This publication meets accepted accessibility standards","descriptive":"The publication contains a conformance statement that it meets the EPUB Accessibility and WCAG 2 Level AA standard"},"aaa":{"compact":"This publication exceeds accepted accessibility standards","descriptive":"The publication contains a conformance statement that it meets the EPUB Accessibility and WCAG 2 Level AAA standard"},"certifier":"The publication was certified by ","certifier-credentials":"The certifier's credential is ","details":{"certification-info":"The publication was certified on ","certifier-report":"For more information refer to the certifier's report","claim":"This publication claims to meet","epub-accessibility-1-0":"EPUB Accessibility 1.0","epub-accessibility-1-1":"EPUB Accessibility 1.1","level-a":"Level A","level-aa":"Level AA","level-aaa":"Level AAA","wcag-2-0":{"compact":"WCAG 2.0","descriptive":"Web Content Accessibility Guidelines (WCAG) 2.0"},"wcag-2-1":{"compact":"WCAG 2.1","descriptive":"Web Content Accessibility Guidelines (WCAG) 2.1"},"wcag-2-2":{"compact":"WCAG 2.2","descriptive":"Web Content Accessibility Guidelines (WCAG) 2.2"}},"details-title":"Detailed conformance information","no":"No information is available","title":"Conformance","unknown-standard":"Conformance to accepted standards for accessibility of this publication cannot be determined"},"hazards":{"flashing":{"compact":"Flashing content","descriptive":"The publication contains flashing content that can cause photosensitive seizures"},"flashing-none":{"compact":"No flashing hazards","descriptive":"The publication does not contain flashing content that can cause photosensitive seizures"},"flashing-unknown":{"compact":"Flashing hazards not known","descriptive":"The presence of flashing content that can cause photosensitive seizures could not be determined"},"motion":{"compact":"Motion simulation","descriptive":"The publication contains motion simulations that can cause motion sickness"},"motion-none":{"compact":"No motion simulation hazards","descriptive":"The publication does not contain motion simulations that can cause motion sickness"},"motion-unknown":{"compact":"Motion simulation hazards not known","descriptive":"The presence of motion simulations that can cause motion sickness could not be determined"},"no-metadata":"No information is available","none":{"compact":"No hazards","descriptive":"The publication contains no hazards"},"sound":{"compact":"Sounds","descriptive":"The publication contains sounds that can cause sensitivity issues"},"sound-none":{"compact":"No sound hazards","descriptive":"The publication does not contain sounds that can cause sensitivity issues"},"sound-unknown":{"compact":"Sound hazards not known","descriptive":"The presence of sounds that can cause sensitivity issues could not be determined"},"title":"Hazards","unknown":"The presence of hazards is unknown"},"legal-considerations":{"exempt":{"compact":"Claims an accessibility exemption in some jurisdictions","descriptive":"This publication claims an accessibility exemption in some jurisdictions"},"no-metadata":"No information is available","title":"Legal considerations"},"navigation":{"index":{"compact":"Index","descriptive":"Index with links to referenced entries"},"no-metadata":"No information is available","page-navigation":{"compact":"Go to page","descriptive":"Page list to go to pages from the print source version"},"structural":{"compact":"Headings","descriptive":"Elements such as headings, tables, etc for structured navigation"},"title":"Navigation","toc":{"compact":"Table of contents","descriptive":"Table of contents to all chapters of the text via links"}},"rich-content":{"accessible-chemistry-as-latex":{"compact":"Chemical formulas in LaTeX","descriptive":"Chemical formulas in accessible format (LaTeX)"},"accessible-chemistry-as-mathml":{"compact":"Chemical formulas in MathML","descriptive":"Chemical formulas in accessible format (MathML)"},"accessible-math-as-latex":{"compact":"Math as LaTeX","descriptive":"Math formulas in accessible format (LaTeX)"},"accessible-math-described":"Text descriptions of math are provided","closed-captions":{"compact":"Videos have closed captions","descriptive":"Videos included in publications have closed captions"},"extended-descriptions":"Information-rich images are described by extended descriptions","math-as-mathml":{"compact":"Math as MathML","descriptive":"Math formulas in accessible format (MathML)"},"open-captions":{"compact":"Videos have open captions","descriptive":"Videos included in publications have open captions"},"title":"Rich content","transcript":"Transcript(s) provided","unknown":"No information is available"},"ways-of-reading":{"nonvisual-reading":{"alt-text":{"compact":"Has alternative text","descriptive":"Has alternative text descriptions for images"},"no-metadata":"No information about nonvisual reading is available","none":{"compact":"Not readable in read aloud or dynamic braille","descriptive":"The content is not readable as read aloud speech or dynamic braille"},"not-fully":{"compact":"Not fully readable in read aloud or dynamic braille","descriptive":"Not all of the content will be readable as read aloud speech or dynamic braille"},"readable":{"compact":"Readable in read aloud or dynamic braille","descriptive":"All content can be read as read aloud speech or dynamic braille"}},"prerecorded-audio":{"complementary":{"compact":"Prerecorded audio clips","descriptive":"Prerecorded audio clips are embedded in the content"},"no-metadata":"No information about prerecorded audio is available","only":{"compact":"Prerecorded audio only","descriptive":"Audiobook with no text alternative"},"synchronized":{"compact":"Prerecorded audio synchronized with text","descriptive":"All the content is available as prerecorded audio synchronized with text"}},"title":"Ways of reading","visual-adjustments":{"modifiable":{"compact":"Appearance can be modified","descriptive":"Appearance of the text and page layout can be modified according to the capabilities of the reading system (font family and font size, spaces between paragraphs, sentences, words, and letters, as well as color of background and text)"},"unknown":"No information about appearance modifiability is available","unmodifiable":{"compact":"Appearance cannot be modified","descriptive":"Text and page layout cannot be modified as the reading experience is close to a print version, but reading systems can still provide zooming options"}}}}},"altIdentifier_one":"alternate identifier","altIdentifier_other":"alternate identifiers","artist_one":"artist","artist_other":"artists","author_one":"author","author_other":"authors","collection_one":"editorial collection","collection_other":"editorial collections","colorist_one":"colorist","colorist_other":"colorists","contributor_one":"contributor","contributor_other":"contributors","description":"description","duration":"duration","editor_one":"editor","editor_other":"editors","identifier_one":"identifier","identifier_other":"identifiers","illustrator_one":"illustrator","illustrator_other":"illustrators","imprint_one":"imprint","imprint_other":"imprints","inker_one":"inker","inker_other":"inkers","language_one":"language","language_other":"languages","letterer_one":"letterer","letterer_other":"letterers","modified":"modification date","narrator_one":"narrator","narrator_other":"narrators","numberOfPages":"print length","penciler_one":"penciler","penciler_other":"pencilers","published":"publication date","publisher_one":"publisher","publisher_other":"publishers","series_one":"series","series_other":"series","subject_one":"subject","subject_other":"subjects","subtitle":"subtitle","title":"title","translator_one":"translator","translator_other":"translators"}}`), On = {
156
- publication: kn
155
+ const si = ["en", "ar", "da", "fr", "it", "pt_PT", "sv"], Rn = /* @__PURE__ */ JSON.parse(`{"format":{"audiobook":"Audiobook","audiobookJSON":"Audiobook Manifest","cbz":"Comic Book Archive","divina":"Divina Publication","divinaJSON":"Divina Publication Manifest","epub":"EPUB","lcpa":"LCP Protected Audiobook","lcpdf":"LCP Protected PDF","lcpl":"LCP License Document","pdf":"PDF","rwp":"Readium Web Publication","rwpm":"Readium Web Publication Manifest","zab":"Audiobook Archive","zip":"ZIP Archive"},"kind":{"audiobook_one":"audiobook","audiobook_other":"audiobooks","book_one":"book","book_other":"books","comic_one":"comic","comic_other":"comics","document_one":"document","document_other":"documents"},"metadata":{"accessibility":{"display-guide":{"accessibility-summary":{"no-metadata":"No information is available","publisher-contact":"For more information about the accessibility of this product, please contact the publisher: ","title":"Accessibility summary"},"additional-accessibility-information":{"aria":{"compact":"ARIA roles included","descriptive":"Content is enhanced with ARIA roles to optimize organization and facilitate navigation"},"audio-descriptions":"Audio descriptions","braille":"Braille","color-not-sole-means-of-conveying-information":"Color is not the sole means of conveying information","dyslexia-readability":"Dyslexia readability","full-ruby-annotations":"Full ruby annotations","high-contrast-between-foreground-and-background-audio":"High contrast between foreground and background audio","high-contrast-between-text-and-background":"High contrast between foreground text and background","large-print":"Large print","page-breaks":{"compact":"Page breaks included","descriptive":"Page breaks included from the original print source"},"ruby-annotations":"Some Ruby annotations","sign-language":"Sign language","tactile-graphics":{"compact":"Tactile graphics included","descriptive":"Tactile graphics have been integrated to facilitate access to visual elements for blind people"},"tactile-objects":"Tactile 3D objects","text-to-speech-hinting":"Text-to-speech hinting provided","title":"Additional accessibility information","ultra-high-contrast-between-text-and-background":"Ultra high contrast between text and background","visible-page-numbering":"Visible page numbering","without-background-sounds":"Without background sounds"},"conformance":{"a":{"compact":"This publication meets minimum accessibility standards","descriptive":"The publication contains a conformance statement that it meets the EPUB Accessibility and WCAG 2 Level A standard"},"aa":{"compact":"This publication meets accepted accessibility standards","descriptive":"The publication contains a conformance statement that it meets the EPUB Accessibility and WCAG 2 Level AA standard"},"aaa":{"compact":"This publication exceeds accepted accessibility standards","descriptive":"The publication contains a conformance statement that it meets the EPUB Accessibility and WCAG 2 Level AAA standard"},"certifier":"The publication was certified by ","certifier-credentials":"The certifier's credential is ","details":{"certification-info":"The publication was certified on ","certifier-report":"For more information refer to the certifier's report","claim":"This publication claims to meet","epub-accessibility-1-0":"EPUB Accessibility 1.0","epub-accessibility-1-1":"EPUB Accessibility 1.1","level-a":"Level A","level-aa":"Level AA","level-aaa":"Level AAA","wcag-2-0":{"compact":"WCAG 2.0","descriptive":"Web Content Accessibility Guidelines (WCAG) 2.0"},"wcag-2-1":{"compact":"WCAG 2.1","descriptive":"Web Content Accessibility Guidelines (WCAG) 2.1"},"wcag-2-2":{"compact":"WCAG 2.2","descriptive":"Web Content Accessibility Guidelines (WCAG) 2.2"}},"details-title":"Detailed conformance information","no":"No information is available","title":"Conformance","unknown-standard":"Conformance to accepted standards for accessibility of this publication cannot be determined"},"hazards":{"flashing":{"compact":"Flashing content","descriptive":"The publication contains flashing content that can cause photosensitive seizures"},"flashing-none":{"compact":"No flashing hazards","descriptive":"The publication does not contain flashing content that can cause photosensitive seizures"},"flashing-unknown":{"compact":"Flashing hazards not known","descriptive":"The presence of flashing content that can cause photosensitive seizures could not be determined"},"motion":{"compact":"Motion simulation","descriptive":"The publication contains motion simulations that can cause motion sickness"},"motion-none":{"compact":"No motion simulation hazards","descriptive":"The publication does not contain motion simulations that can cause motion sickness"},"motion-unknown":{"compact":"Motion simulation hazards not known","descriptive":"The presence of motion simulations that can cause motion sickness could not be determined"},"no-metadata":"No information is available","none":{"compact":"No hazards","descriptive":"The publication contains no hazards"},"sound":{"compact":"Sounds","descriptive":"The publication contains sounds that can cause sensitivity issues"},"sound-none":{"compact":"No sound hazards","descriptive":"The publication does not contain sounds that can cause sensitivity issues"},"sound-unknown":{"compact":"Sound hazards not known","descriptive":"The presence of sounds that can cause sensitivity issues could not be determined"},"title":"Hazards","unknown":"The presence of hazards is unknown"},"legal-considerations":{"exempt":{"compact":"Claims an accessibility exemption in some jurisdictions","descriptive":"This publication claims an accessibility exemption in some jurisdictions"},"no-metadata":"No information is available","title":"Legal considerations"},"navigation":{"index":{"compact":"Index","descriptive":"Index with links to referenced entries"},"no-metadata":"No information is available","page-navigation":{"compact":"Go to page","descriptive":"Page list to go to pages from the print source version"},"structural":{"compact":"Headings","descriptive":"Elements such as headings, tables, etc for structured navigation"},"title":"Navigation","toc":{"compact":"Table of contents","descriptive":"Table of contents to all chapters of the text via links"}},"rich-content":{"accessible-chemistry-as-latex":{"compact":"Chemical formulas in LaTeX","descriptive":"Chemical formulas in accessible format (LaTeX)"},"accessible-chemistry-as-mathml":{"compact":"Chemical formulas in MathML","descriptive":"Chemical formulas in accessible format (MathML)"},"accessible-math-as-latex":{"compact":"Math as LaTeX","descriptive":"Math formulas in accessible format (LaTeX)"},"accessible-math-described":"Text descriptions of math are provided","closed-captions":{"compact":"Videos have closed captions","descriptive":"Videos included in publications have closed captions"},"extended-descriptions":"Information-rich images are described by extended descriptions","math-as-mathml":{"compact":"Math as MathML","descriptive":"Math formulas in accessible format (MathML)"},"open-captions":{"compact":"Videos have open captions","descriptive":"Videos included in publications have open captions"},"title":"Rich content","transcript":"Transcript(s) provided","unknown":"No information is available"},"ways-of-reading":{"nonvisual-reading":{"alt-text":{"compact":"Has alternative text","descriptive":"Has alternative text descriptions for images"},"no-metadata":"No information about nonvisual reading is available","none":{"compact":"Not readable in read aloud or dynamic braille","descriptive":"The content is not readable as read aloud speech or dynamic braille"},"not-fully":{"compact":"Not fully readable in read aloud or dynamic braille","descriptive":"Not all of the content will be readable as read aloud speech or dynamic braille"},"readable":{"compact":"Readable in read aloud or dynamic braille","descriptive":"All content can be read as read aloud speech or dynamic braille"}},"prerecorded-audio":{"complementary":{"compact":"Prerecorded audio clips","descriptive":"Prerecorded audio clips are embedded in the content"},"no-metadata":"No information about prerecorded audio is available","only":{"compact":"Prerecorded audio only","descriptive":"Audiobook with no text alternative"},"synchronized":{"compact":"Prerecorded audio synchronized with text","descriptive":"All the content is available as prerecorded audio synchronized with text"}},"title":"Ways of reading","visual-adjustments":{"modifiable":{"compact":"Appearance can be modified","descriptive":"Appearance of the text and page layout can be modified according to the capabilities of the reading system (font family and font size, spaces between paragraphs, sentences, words, and letters, as well as color of background and text)"},"unknown":"No information about appearance modifiability is available","unmodifiable":{"compact":"Appearance cannot be modified","descriptive":"Text and page layout cannot be modified as the reading experience is close to a print version, but reading systems can still provide zooming options"}}}}},"altIdentifier_one":"alternate identifier","altIdentifier_other":"alternate identifiers","artist_one":"artist","artist_other":"artists","author_one":"author","author_other":"authors","collection_one":"editorial collection","collection_other":"editorial collections","colorist_one":"colorist","colorist_other":"colorists","contributor_one":"contributor","contributor_other":"contributors","description":"description","duration":"duration","editor_one":"editor","editor_other":"editors","identifier_one":"identifier","identifier_other":"identifiers","illustrator_one":"illustrator","illustrator_other":"illustrators","imprint_one":"imprint","imprint_other":"imprints","inker_one":"inker","inker_other":"inkers","language_one":"language","language_other":"languages","letterer_one":"letterer","letterer_other":"letterers","modified":"modification date","narrator_one":"narrator","narrator_other":"narrators","numberOfPages":"print length","penciler_one":"penciler","penciler_other":"pencilers","published":"publication date","publisher_one":"publisher","publisher_other":"publishers","series_one":"series","series_other":"series","subject_one":"subject","subject_other":"subjects","subtitle":"subtitle","title":"title","translator_one":"translator","translator_other":"translators"}}`), On = {
156
+ publication: Rn
157
157
  }, ri = {
158
158
  fr: () => import("./fr-C5HEel98.js"),
159
159
  ar: () => import("./ar-DyHX_uy2.js"),
@@ -243,7 +243,7 @@ class yt {
243
243
  }
244
244
  }
245
245
  yt.getInstance();
246
- var b = /* @__PURE__ */ ((r) => (r.reflowable = "reflowable", r.fixed = "fixed", r.scrolled = "scrolled", r))(b || {});
246
+ var w = /* @__PURE__ */ ((r) => (r.reflowable = "reflowable", r.fixed = "fixed", r.scrolled = "scrolled", r))(w || {});
247
247
  class Fe {
248
248
  /**
249
249
  * Creates a [Encryption].
@@ -272,8 +272,8 @@ class Fe {
272
272
  return this.compression !== void 0 && (t.compression = this.compression), this.originalLength !== void 0 && (t.originalLength = this.originalLength), this.profile !== void 0 && (t.profile = this.profile), this.scheme !== void 0 && (t.scheme = this.scheme), t;
273
273
  }
274
274
  }
275
- var G = /* @__PURE__ */ ((r) => (r.left = "left", r.right = "right", r.center = "center", r))(G || {});
276
- let X = class be {
275
+ var X = /* @__PURE__ */ ((r) => (r.left = "left", r.right = "right", r.center = "center", r))(X || {});
276
+ let Y = class be {
277
277
  constructor(t) {
278
278
  this.otherProperties = t;
279
279
  }
@@ -303,16 +303,16 @@ let X = class be {
303
303
  return new be(e);
304
304
  }
305
305
  };
306
- Object.defineProperty(X.prototype, "encryption", {
306
+ Object.defineProperty(Y.prototype, "encryption", {
307
307
  get: function() {
308
308
  return Fe.deserialize(this.otherProperties.encrypted);
309
309
  }
310
310
  });
311
- function Rn(r) {
311
+ function An(r) {
312
312
  return r && Array.isArray(r) ? r : void 0;
313
313
  }
314
314
  function Yi(r) {
315
- return r && typeof r == "string" ? [r] : Rn(r);
315
+ return r && typeof r == "string" ? [r] : An(r);
316
316
  }
317
317
  function ai(r) {
318
318
  return typeof r == "string" ? new Date(r) : void 0;
@@ -323,11 +323,11 @@ function Ut(r) {
323
323
  function V(r) {
324
324
  return Ut(r) !== void 0 && Math.sign(r) >= 0 ? r : void 0;
325
325
  }
326
- function An(r) {
326
+ function Tn(r) {
327
327
  const t = new Array();
328
328
  return r.forEach((e) => t.push(e)), t;
329
329
  }
330
- class g {
330
+ class m {
331
331
  /** Creates a MediaType object. */
332
332
  constructor(t) {
333
333
  let e, i, n = t.mediaType.replace(/\s/g, "").split(";");
@@ -338,25 +338,25 @@ class g {
338
338
  } else
339
339
  throw new Error("Invalid media type");
340
340
  const o = {};
341
- for (let p = 1; p < n.length; p++) {
342
- const m = n[p].split("=");
343
- if (m.length === 2) {
344
- const d = m[0].toLocaleLowerCase(), f = d === "charset" ? m[1].toUpperCase() : m[1];
345
- o[d] = f;
341
+ for (let f = 1; f < n.length; f++) {
342
+ const g = n[f].split("=");
343
+ if (g.length === 2) {
344
+ const u = g[0].toLocaleLowerCase(), p = u === "charset" ? g[1].toUpperCase() : g[1];
345
+ o[u] = p;
346
346
  }
347
347
  }
348
348
  const a = {}, l = Object.keys(o);
349
- l.sort((p, m) => p.localeCompare(m)), l.forEach((p) => a[p] = o[p]);
349
+ l.sort((f, g) => f.localeCompare(g)), l.forEach((f) => a[f] = o[f]);
350
350
  let h = "";
351
- for (const p in a) {
352
- const m = a[p];
353
- h += `;${p}=${m}`;
351
+ for (const f in a) {
352
+ const g = a[f];
353
+ h += `;${f}=${g}`;
354
354
  }
355
- const c = `${e}/${i}${h}`, u = a.encoding;
356
- this.string = c, this.type = e, this.subtype = i, this.parameters = a, this.encoding = u, this.name = t.name, this.fileExtension = t.fileExtension;
355
+ const c = `${e}/${i}${h}`, d = a.encoding;
356
+ this.string = c, this.type = e, this.subtype = i, this.parameters = a, this.encoding = d, this.name = t.name, this.fileExtension = t.fileExtension;
357
357
  }
358
358
  static parse(t) {
359
- return new g(t);
359
+ return new m(t);
360
360
  }
361
361
  /** Structured syntax suffix, e.g. `+zip` in `application/epub+zip`.
362
362
  * Gives a hint on the underlying structure of this media type.
@@ -386,7 +386,7 @@ class g {
386
386
  * - Wildcards are supported, meaning that `image/*` contains `image/png`
387
387
  */
388
388
  contains(t) {
389
- const e = typeof t == "string" ? g.parse({ mediaType: t }) : t;
389
+ const e = typeof t == "string" ? m.parse({ mediaType: t }) : t;
390
390
  if (!((this.type === "*" || this.type === e.type) && (this.subtype === "*" || this.subtype === e.subtype)))
391
391
  return !1;
392
392
  const i = new Set(
@@ -405,7 +405,7 @@ class g {
405
405
  * doesn't. This is basically like `contains`, but working in both direction.
406
406
  */
407
407
  matches(t) {
408
- const e = typeof t == "string" ? g.parse({ mediaType: t }) : t;
408
+ const e = typeof t == "string" ? m.parse({ mediaType: t }) : t;
409
409
  return this.contains(e) || e.contains(this);
410
410
  }
411
411
  /**
@@ -424,39 +424,39 @@ class g {
424
424
  /** Returns whether this media type is structured as a ZIP archive. */
425
425
  get isZIP() {
426
426
  return this.matchesAny(
427
- g.ZIP,
428
- g.LCP_PROTECTED_AUDIOBOOK,
429
- g.LCP_PROTECTED_PDF
427
+ m.ZIP,
428
+ m.LCP_PROTECTED_AUDIOBOOK,
429
+ m.LCP_PROTECTED_PDF
430
430
  ) || this.structuredSyntaxSuffix === "+zip";
431
431
  }
432
432
  /** Returns whether this media type is structured as a JSON file. */
433
433
  get isJSON() {
434
- return this.matchesAny(g.JSON) || this.structuredSyntaxSuffix === "+json";
434
+ return this.matchesAny(m.JSON) || this.structuredSyntaxSuffix === "+json";
435
435
  }
436
436
  /** Returns whether this media type is of an OPDS feed. */
437
437
  get isOPDS() {
438
438
  return this.matchesAny(
439
- g.OPDS1,
440
- g.OPDS1_ENTRY,
441
- g.OPDS2,
442
- g.OPDS2_PUBLICATION,
443
- g.OPDS_AUTHENTICATION
439
+ m.OPDS1,
440
+ m.OPDS1_ENTRY,
441
+ m.OPDS2,
442
+ m.OPDS2_PUBLICATION,
443
+ m.OPDS_AUTHENTICATION
444
444
  ) || this.structuredSyntaxSuffix === "+json";
445
445
  }
446
446
  /** Returns whether this media type is of an HTML document. */
447
447
  get isHTML() {
448
- return this.matchesAny(g.HTML, g.XHTML);
448
+ return this.matchesAny(m.HTML, m.XHTML);
449
449
  }
450
450
  /** Returns whether this media type is of a bitmap image, so excluding vectorial formats. */
451
451
  get isBitmap() {
452
452
  return this.matchesAny(
453
- g.AVIF,
454
- g.BMP,
455
- g.GIF,
456
- g.JPEG,
457
- g.PNG,
458
- g.TIFF,
459
- g.WEBP
453
+ m.AVIF,
454
+ m.BMP,
455
+ m.GIF,
456
+ m.JPEG,
457
+ m.PNG,
458
+ m.TIFF,
459
+ m.WEBP
460
460
  );
461
461
  }
462
462
  /** Returns whether this media type is of an audio clip. */
@@ -470,317 +470,317 @@ class g {
470
470
  /** Returns whether this media type is of a Readium Web Publication Manifest. */
471
471
  get isRWPM() {
472
472
  return this.matchesAny(
473
- g.READIUM_AUDIOBOOK_MANIFEST,
474
- g.DIVINA_MANIFEST,
475
- g.READIUM_WEBPUB_MANIFEST
473
+ m.READIUM_AUDIOBOOK_MANIFEST,
474
+ m.DIVINA_MANIFEST,
475
+ m.READIUM_WEBPUB_MANIFEST
476
476
  );
477
477
  }
478
478
  /** Returns whether this media type is of a publication file. */
479
479
  get isPublication() {
480
480
  return this.matchesAny(
481
- g.READIUM_AUDIOBOOK,
482
- g.READIUM_AUDIOBOOK_MANIFEST,
483
- g.CBZ,
484
- g.DIVINA,
485
- g.DIVINA_MANIFEST,
486
- g.EPUB,
487
- g.LCP_PROTECTED_AUDIOBOOK,
488
- g.LCP_PROTECTED_PDF,
489
- g.LPF,
490
- g.PDF,
491
- g.W3C_WPUB_MANIFEST,
492
- g.READIUM_WEBPUB,
493
- g.READIUM_WEBPUB_MANIFEST,
494
- g.ZAB
481
+ m.READIUM_AUDIOBOOK,
482
+ m.READIUM_AUDIOBOOK_MANIFEST,
483
+ m.CBZ,
484
+ m.DIVINA,
485
+ m.DIVINA_MANIFEST,
486
+ m.EPUB,
487
+ m.LCP_PROTECTED_AUDIOBOOK,
488
+ m.LCP_PROTECTED_PDF,
489
+ m.LPF,
490
+ m.PDF,
491
+ m.W3C_WPUB_MANIFEST,
492
+ m.READIUM_WEBPUB,
493
+ m.READIUM_WEBPUB_MANIFEST,
494
+ m.ZAB
495
495
  );
496
496
  }
497
497
  // Known Media Types
498
498
  static get AAC() {
499
- return g.parse({ mediaType: "audio/aac", fileExtension: "aac" });
499
+ return m.parse({ mediaType: "audio/aac", fileExtension: "aac" });
500
500
  }
501
501
  static get ACSM() {
502
- return g.parse({
502
+ return m.parse({
503
503
  mediaType: "application/vnd.adobe.adept+xml",
504
504
  name: "Adobe Content Server Message",
505
505
  fileExtension: "acsm"
506
506
  });
507
507
  }
508
508
  static get AIFF() {
509
- return g.parse({ mediaType: "audio/aiff", fileExtension: "aiff" });
509
+ return m.parse({ mediaType: "audio/aiff", fileExtension: "aiff" });
510
510
  }
511
511
  static get AVI() {
512
- return g.parse({
512
+ return m.parse({
513
513
  mediaType: "video/x-msvideo",
514
514
  fileExtension: "avi"
515
515
  });
516
516
  }
517
517
  static get AVIF() {
518
- return g.parse({ mediaType: "image/avif", fileExtension: "avif" });
518
+ return m.parse({ mediaType: "image/avif", fileExtension: "avif" });
519
519
  }
520
520
  static get BINARY() {
521
- return g.parse({ mediaType: "application/octet-stream" });
521
+ return m.parse({ mediaType: "application/octet-stream" });
522
522
  }
523
523
  static get BMP() {
524
- return g.parse({ mediaType: "image/bmp", fileExtension: "bmp" });
524
+ return m.parse({ mediaType: "image/bmp", fileExtension: "bmp" });
525
525
  }
526
526
  static get CBZ() {
527
- return g.parse({
527
+ return m.parse({
528
528
  mediaType: "application/vnd.comicbook+zip",
529
529
  name: "Comic Book Archive",
530
530
  fileExtension: "cbz"
531
531
  });
532
532
  }
533
533
  static get CSS() {
534
- return g.parse({ mediaType: "text/css", fileExtension: "css" });
534
+ return m.parse({ mediaType: "text/css", fileExtension: "css" });
535
535
  }
536
536
  static get DIVINA() {
537
- return g.parse({
537
+ return m.parse({
538
538
  mediaType: "application/divina+zip",
539
539
  name: "Digital Visual Narratives",
540
540
  fileExtension: "divina"
541
541
  });
542
542
  }
543
543
  static get DIVINA_MANIFEST() {
544
- return g.parse({
544
+ return m.parse({
545
545
  mediaType: "application/divina+json",
546
546
  name: "Digital Visual Narratives",
547
547
  fileExtension: "json"
548
548
  });
549
549
  }
550
550
  static get EPUB() {
551
- return g.parse({
551
+ return m.parse({
552
552
  mediaType: "application/epub+zip",
553
553
  name: "EPUB",
554
554
  fileExtension: "epub"
555
555
  });
556
556
  }
557
557
  static get GIF() {
558
- return g.parse({ mediaType: "image/gif", fileExtension: "gif" });
558
+ return m.parse({ mediaType: "image/gif", fileExtension: "gif" });
559
559
  }
560
560
  static get GZ() {
561
- return g.parse({
561
+ return m.parse({
562
562
  mediaType: "application/gzip",
563
563
  fileExtension: "gz"
564
564
  });
565
565
  }
566
566
  static get HTML() {
567
- return g.parse({ mediaType: "text/html", fileExtension: "html" });
567
+ return m.parse({ mediaType: "text/html", fileExtension: "html" });
568
568
  }
569
569
  static get JAVASCRIPT() {
570
- return g.parse({
570
+ return m.parse({
571
571
  mediaType: "text/javascript",
572
572
  fileExtension: "js"
573
573
  });
574
574
  }
575
575
  static get JPEG() {
576
- return g.parse({ mediaType: "image/jpeg", fileExtension: "jpeg" });
576
+ return m.parse({ mediaType: "image/jpeg", fileExtension: "jpeg" });
577
577
  }
578
578
  static get JSON() {
579
- return g.parse({ mediaType: "application/json" });
579
+ return m.parse({ mediaType: "application/json" });
580
580
  }
581
581
  static get LCP_LICENSE_DOCUMENT() {
582
- return g.parse({
582
+ return m.parse({
583
583
  mediaType: "application/vnd.readium.lcp.license.v1.0+json",
584
584
  name: "LCP License",
585
585
  fileExtension: "lcpl"
586
586
  });
587
587
  }
588
588
  static get LCP_PROTECTED_AUDIOBOOK() {
589
- return g.parse({
589
+ return m.parse({
590
590
  mediaType: "application/audiobook+lcp",
591
591
  name: "LCP Protected Audiobook",
592
592
  fileExtension: "lcpa"
593
593
  });
594
594
  }
595
595
  static get LCP_PROTECTED_PDF() {
596
- return g.parse({
596
+ return m.parse({
597
597
  mediaType: "application/pdf+lcp",
598
598
  name: "LCP Protected PDF",
599
599
  fileExtension: "lcpdf"
600
600
  });
601
601
  }
602
602
  static get LCP_STATUS_DOCUMENT() {
603
- return g.parse({
603
+ return m.parse({
604
604
  mediaType: "application/vnd.readium.license.status.v1.0+json"
605
605
  });
606
606
  }
607
607
  static get LPF() {
608
- return g.parse({
608
+ return m.parse({
609
609
  mediaType: "application/lpf+zip",
610
610
  fileExtension: "lpf"
611
611
  });
612
612
  }
613
613
  static get MP3() {
614
- return g.parse({ mediaType: "audio/mpeg", fileExtension: "mp3" });
614
+ return m.parse({ mediaType: "audio/mpeg", fileExtension: "mp3" });
615
615
  }
616
616
  static get MPEG() {
617
- return g.parse({ mediaType: "video/mpeg", fileExtension: "mpeg" });
617
+ return m.parse({ mediaType: "video/mpeg", fileExtension: "mpeg" });
618
618
  }
619
619
  static get NCX() {
620
- return g.parse({
620
+ return m.parse({
621
621
  mediaType: "application/x-dtbncx+xml",
622
622
  fileExtension: "ncx"
623
623
  });
624
624
  }
625
625
  static get OGG() {
626
- return g.parse({ mediaType: "audio/ogg", fileExtension: "oga" });
626
+ return m.parse({ mediaType: "audio/ogg", fileExtension: "oga" });
627
627
  }
628
628
  static get OGV() {
629
- return g.parse({ mediaType: "video/ogg", fileExtension: "ogv" });
629
+ return m.parse({ mediaType: "video/ogg", fileExtension: "ogv" });
630
630
  }
631
631
  static get OPDS1() {
632
- return g.parse({
632
+ return m.parse({
633
633
  mediaType: "application/atom+xml;profile=opds-catalog"
634
634
  });
635
635
  }
636
636
  static get OPDS1_ENTRY() {
637
- return g.parse({
637
+ return m.parse({
638
638
  mediaType: "application/atom+xml;type=entry;profile=opds-catalog"
639
639
  });
640
640
  }
641
641
  static get OPDS2() {
642
- return g.parse({ mediaType: "application/opds+json" });
642
+ return m.parse({ mediaType: "application/opds+json" });
643
643
  }
644
644
  static get OPDS2_PUBLICATION() {
645
- return g.parse({ mediaType: "application/opds-publication+json" });
645
+ return m.parse({ mediaType: "application/opds-publication+json" });
646
646
  }
647
647
  static get OPDS_AUTHENTICATION() {
648
- return g.parse({
648
+ return m.parse({
649
649
  mediaType: "application/opds-authentication+json"
650
650
  });
651
651
  }
652
652
  static get OPUS() {
653
- return g.parse({ mediaType: "audio/opus", fileExtension: "opus" });
653
+ return m.parse({ mediaType: "audio/opus", fileExtension: "opus" });
654
654
  }
655
655
  static get OTF() {
656
- return g.parse({ mediaType: "font/otf", fileExtension: "otf" });
656
+ return m.parse({ mediaType: "font/otf", fileExtension: "otf" });
657
657
  }
658
658
  static get PDF() {
659
- return g.parse({
659
+ return m.parse({
660
660
  mediaType: "application/pdf",
661
661
  name: "PDF",
662
662
  fileExtension: "pdf"
663
663
  });
664
664
  }
665
665
  static get PNG() {
666
- return g.parse({ mediaType: "image/png", fileExtension: "png" });
666
+ return m.parse({ mediaType: "image/png", fileExtension: "png" });
667
667
  }
668
668
  static get READIUM_AUDIOBOOK() {
669
- return g.parse({
669
+ return m.parse({
670
670
  mediaType: "application/audiobook+zip",
671
671
  name: "Readium Audiobook",
672
672
  fileExtension: "audiobook"
673
673
  });
674
674
  }
675
675
  static get READIUM_AUDIOBOOK_MANIFEST() {
676
- return g.parse({
676
+ return m.parse({
677
677
  mediaType: "application/audiobook+json",
678
678
  name: "Readium Audiobook",
679
679
  fileExtension: "json"
680
680
  });
681
681
  }
682
682
  static get READIUM_CONTENT_DOCUMENT() {
683
- return g.parse({
683
+ return m.parse({
684
684
  mediaType: "application/vnd.readium.content+json",
685
685
  name: "Readium Content Document",
686
686
  fileExtension: "json"
687
687
  });
688
688
  }
689
689
  static get READIUM_GUIDED_NAVIGATION_DOCUMENT() {
690
- return g.parse({
690
+ return m.parse({
691
691
  mediaType: "application/guided-navigation+json",
692
692
  name: "Readium Guided Navigation Document",
693
693
  fileExtension: "json"
694
694
  });
695
695
  }
696
696
  static get READIUM_POSITION_LIST() {
697
- return g.parse({
697
+ return m.parse({
698
698
  mediaType: "application/vnd.readium.position-list+json",
699
699
  name: "Readium Position List",
700
700
  fileExtension: "json"
701
701
  });
702
702
  }
703
703
  static get READIUM_WEBPUB() {
704
- return g.parse({
704
+ return m.parse({
705
705
  mediaType: "application/webpub+zip",
706
706
  name: "Readium Web Publication",
707
707
  fileExtension: "webpub"
708
708
  });
709
709
  }
710
710
  static get READIUM_WEBPUB_MANIFEST() {
711
- return g.parse({
711
+ return m.parse({
712
712
  mediaType: "application/webpub+json",
713
713
  name: "Readium Web Publication",
714
714
  fileExtension: "json"
715
715
  });
716
716
  }
717
717
  static get SMIL() {
718
- return g.parse({
718
+ return m.parse({
719
719
  mediaType: "application/smil+xml",
720
720
  fileExtension: "smil"
721
721
  });
722
722
  }
723
723
  static get SVG() {
724
- return g.parse({
724
+ return m.parse({
725
725
  mediaType: "image/svg+xml",
726
726
  fileExtension: "svg"
727
727
  });
728
728
  }
729
729
  static get TEXT() {
730
- return g.parse({ mediaType: "text/plain", fileExtension: "txt" });
730
+ return m.parse({ mediaType: "text/plain", fileExtension: "txt" });
731
731
  }
732
732
  static get TIFF() {
733
- return g.parse({ mediaType: "image/tiff", fileExtension: "tiff" });
733
+ return m.parse({ mediaType: "image/tiff", fileExtension: "tiff" });
734
734
  }
735
735
  static get TTF() {
736
- return g.parse({ mediaType: "font/ttf", fileExtension: "ttf" });
736
+ return m.parse({ mediaType: "font/ttf", fileExtension: "ttf" });
737
737
  }
738
738
  static get W3C_WPUB_MANIFEST() {
739
- return g.parse({
739
+ return m.parse({
740
740
  mediaType: "application/x.readium.w3c.wpub+json",
741
741
  name: "Web Publication",
742
742
  fileExtension: "json"
743
743
  });
744
744
  }
745
745
  static get WAV() {
746
- return g.parse({ mediaType: "audio/wav", fileExtension: "wav" });
746
+ return m.parse({ mediaType: "audio/wav", fileExtension: "wav" });
747
747
  }
748
748
  static get WEBM_AUDIO() {
749
- return g.parse({ mediaType: "audio/webm", fileExtension: "webm" });
749
+ return m.parse({ mediaType: "audio/webm", fileExtension: "webm" });
750
750
  }
751
751
  static get WEBM_VIDEO() {
752
- return g.parse({ mediaType: "video/webm", fileExtension: "webm" });
752
+ return m.parse({ mediaType: "video/webm", fileExtension: "webm" });
753
753
  }
754
754
  static get WEBP() {
755
- return g.parse({ mediaType: "image/webp", fileExtension: "webp" });
755
+ return m.parse({ mediaType: "image/webp", fileExtension: "webp" });
756
756
  }
757
757
  static get WOFF() {
758
- return g.parse({ mediaType: "font/woff", fileExtension: "woff" });
758
+ return m.parse({ mediaType: "font/woff", fileExtension: "woff" });
759
759
  }
760
760
  static get WOFF2() {
761
- return g.parse({ mediaType: "font/woff2", fileExtension: "woff2" });
761
+ return m.parse({ mediaType: "font/woff2", fileExtension: "woff2" });
762
762
  }
763
763
  static get XHTML() {
764
- return g.parse({
764
+ return m.parse({
765
765
  mediaType: "application/xhtml+xml",
766
766
  fileExtension: "xhtml"
767
767
  });
768
768
  }
769
769
  static get XML() {
770
- return g.parse({
770
+ return m.parse({
771
771
  mediaType: "application/xml",
772
772
  fileExtension: "xml"
773
773
  });
774
774
  }
775
775
  static get ZAB() {
776
- return g.parse({
776
+ return m.parse({
777
777
  mediaType: "application/x.readium.zab+zip",
778
778
  name: "Zipped Audio Book",
779
779
  fileExtension: "zab"
780
780
  });
781
781
  }
782
782
  static get ZIP() {
783
- return g.parse({
783
+ return m.parse({
784
784
  mediaType: "application/zip",
785
785
  fileExtension: "zip"
786
786
  });
@@ -935,7 +935,7 @@ class $ {
935
935
  type: t.type,
936
936
  title: t.title,
937
937
  rels: t.rel ? Array.isArray(t.rel) ? new Set(t.rel) : /* @__PURE__ */ new Set([t.rel]) : void 0,
938
- properties: X.deserialize(t.properties),
938
+ properties: Y.deserialize(t.properties),
939
939
  height: V(t.height),
940
940
  width: V(t.width),
941
941
  size: V(t.size),
@@ -951,11 +951,11 @@ class $ {
951
951
  */
952
952
  serialize() {
953
953
  const t = { href: this.href };
954
- return this.templated !== void 0 && (t.templated = this.templated), this.type !== void 0 && (t.type = this.type), this.title !== void 0 && (t.title = this.title), this.rels && (t.rel = An(this.rels)), this.properties && (t.properties = this.properties.serialize()), this.height !== void 0 && (t.height = this.height), this.width !== void 0 && (t.width = this.width), this.size !== void 0 && (t.size = this.size), this.duration !== void 0 && (t.duration = this.duration), this.bitrate !== void 0 && (t.bitrate = this.bitrate), this.languages && (t.language = this.languages), this.alternates && (t.alternate = this.alternates.serialize()), this.children && (t.children = this.children.serialize()), t;
954
+ return this.templated !== void 0 && (t.templated = this.templated), this.type !== void 0 && (t.type = this.type), this.title !== void 0 && (t.title = this.title), this.rels && (t.rel = Tn(this.rels)), this.properties && (t.properties = this.properties.serialize()), this.height !== void 0 && (t.height = this.height), this.width !== void 0 && (t.width = this.width), this.size !== void 0 && (t.size = this.size), this.duration !== void 0 && (t.duration = this.duration), this.bitrate !== void 0 && (t.bitrate = this.bitrate), this.languages && (t.language = this.languages), this.alternates && (t.alternate = this.alternates.serialize()), this.children && (t.children = this.children.serialize()), t;
955
955
  }
956
956
  /** MediaType of the linked resource. */
957
957
  get mediaType() {
958
- return this.type !== void 0 ? g.parse({ mediaType: this.type }) : g.BINARY;
958
+ return this.type !== void 0 ? m.parse({ mediaType: this.type }) : m.BINARY;
959
959
  }
960
960
  /** Computes an absolute URL to the link, relative to the given `baseURL`.
961
961
  * If the link's `href` is already absolute, the `baseURL` is ignored.
@@ -984,7 +984,7 @@ class $ {
984
984
  */
985
985
  addProperties(t) {
986
986
  const e = $.deserialize(this.serialize());
987
- return e.properties = e.properties ? e.properties?.add(t) : new X(t), e;
987
+ return e.properties = e.properties ? e.properties?.add(t) : new Y(t), e;
988
988
  }
989
989
  /**
990
990
  * Creates a [Locator] from a reading order [Link].
@@ -1096,7 +1096,7 @@ class Bt {
1096
1096
  }
1097
1097
  }
1098
1098
  var qi = /* @__PURE__ */ ((r) => (r.EPUB = "https://readium.org/webpub-manifest/profiles/epub", r.AUDIOBOOK = "https://readium.org/webpub-manifest/profiles/audiobook", r.DIVINA = "https://readium.org/webpub-manifest/profiles/divina", r.PDF = "https://readium.org/webpub-manifest/profiles/pdf", r))(qi || {}), M = /* @__PURE__ */ ((r) => (r.ltr = "ltr", r.rtl = "rtl", r))(M || {});
1099
- X.prototype.getContains = function() {
1099
+ Y.prototype.getContains = function() {
1100
1100
  return new Set(this.otherProperties.contains || []);
1101
1101
  };
1102
1102
  class Vt {
@@ -1320,42 +1320,42 @@ class Ue {
1320
1320
  return this.since !== void 0 && (t.since = this.since.toISOString()), this.until !== void 0 && (t.until = this.until.toISOString()), t;
1321
1321
  }
1322
1322
  }
1323
- X.prototype.getNumberOfItems = function() {
1323
+ Y.prototype.getNumberOfItems = function() {
1324
1324
  return V(this.otherProperties.numberOfItems);
1325
1325
  };
1326
- X.prototype.getPrice = function() {
1326
+ Y.prototype.getPrice = function() {
1327
1327
  return ze.deserialize(this.otherProperties.price);
1328
1328
  };
1329
- X.prototype.getIndirectAcquisitions = function() {
1329
+ Y.prototype.getIndirectAcquisitions = function() {
1330
1330
  const r = this.otherProperties.indirectAcquisition;
1331
1331
  if (r && Array.isArray(r))
1332
1332
  return r.map((t) => xt.deserialize(t)).filter((t) => t !== void 0);
1333
1333
  };
1334
- X.prototype.getHolds = function() {
1334
+ Y.prototype.getHolds = function() {
1335
1335
  return De.deserialize(this.otherProperties.holds);
1336
1336
  };
1337
- X.prototype.getCopies = function() {
1337
+ Y.prototype.getCopies = function() {
1338
1338
  return We.deserialize(this.otherProperties.copies);
1339
1339
  };
1340
- X.prototype.getAvailability = function() {
1340
+ Y.prototype.getAvailability = function() {
1341
1341
  return Ue.deserialize(this.otherProperties.availability);
1342
1342
  };
1343
- X.prototype.getAuthenticate = function() {
1343
+ Y.prototype.getAuthenticate = function() {
1344
1344
  return $.deserialize(this.otherProperties.authenticate);
1345
1345
  };
1346
- const Tn = "CssSelectorGenerator";
1346
+ const Nn = "CssSelectorGenerator";
1347
1347
  function hi(r = "unknown problem", ...t) {
1348
- console.warn(`${Tn}: ${r}`, ...t);
1348
+ console.warn(`${Nn}: ${r}`, ...t);
1349
1349
  }
1350
- function Nn(r) {
1350
+ function Mn(r) {
1351
1351
  return r instanceof RegExp;
1352
1352
  }
1353
- function Mn(r) {
1353
+ function Fn(r) {
1354
1354
  return r.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".+");
1355
1355
  }
1356
- function Fn(r) {
1356
+ function In(r) {
1357
1357
  const t = r.map((e) => {
1358
- if (Nn(e))
1358
+ if (Mn(e))
1359
1359
  return (i) => e.test(i);
1360
1360
  if (typeof e == "function")
1361
1361
  return (i) => {
@@ -1363,21 +1363,21 @@ function Fn(r) {
1363
1363
  return typeof n != "boolean" ? (hi("pattern matcher function invalid", "Provided pattern matching function does not return boolean. It's result will be ignored.", e), !1) : n;
1364
1364
  };
1365
1365
  if (typeof e == "string") {
1366
- const i = new RegExp("^" + Mn(e) + "$");
1366
+ const i = new RegExp("^" + Fn(e) + "$");
1367
1367
  return (n) => i.test(n);
1368
1368
  }
1369
1369
  return hi("pattern matcher invalid", "Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.", e), () => !1;
1370
1370
  });
1371
1371
  return (e) => t.some((i) => i(e));
1372
1372
  }
1373
- Fn([
1373
+ In([
1374
1374
  "class",
1375
1375
  "id",
1376
1376
  // Angular attributes
1377
1377
  "ng-*"
1378
1378
  ]);
1379
- const In = Math.pow(2, 32), ci = () => Math.round(Math.random() * In).toString(36), we = () => `${Math.round(performance.now())}-${ci()}-${ci()}`, gt = 1;
1380
- class zn {
1379
+ const zn = Math.pow(2, 32), ci = () => Math.round(Math.random() * zn).toString(36), we = () => `${Math.round(performance.now())}-${ci()}-${ci()}`, mt = 1;
1380
+ class Dn {
1381
1381
  constructor(t) {
1382
1382
  this.destination = null, this.registrar = /* @__PURE__ */ new Map(), this.origin = "", this.channelId = "", this.receiver = this.receive.bind(this), this.preLog = [], this.wnd = t, t.addEventListener("message", this.receiver);
1383
1383
  }
@@ -1388,8 +1388,8 @@ class zn {
1388
1388
  if (!(!("_readium" in e) || !e._readium || e._readium <= 0)) {
1389
1389
  if (e.key === "_ping") {
1390
1390
  if (!this.destination) {
1391
- if (this.destination = t.source, this.origin = t.origin, this.channelId = e._channel, e._readium !== gt) {
1392
- e._readium > gt ? this.send("error", `received comms version ${e._readium} higher than ${gt}`) : this.send("error", `received comms version ${e._readium} lower than ${gt}`), this.destination = null, this.origin = "", this.channelId = "";
1391
+ if (this.destination = t.source, this.origin = t.origin, this.channelId = e._channel, e._readium !== mt) {
1392
+ e._readium > mt ? this.send("error", `received comms version ${e._readium} higher than ${mt}`) : this.send("error", `received comms version ${e._readium} lower than ${mt}`), this.destination = null, this.origin = "", this.channelId = "";
1393
1393
  return;
1394
1394
  }
1395
1395
  this.send("_pong", void 0), this.preLog.forEach((i) => this.send("log", i)), this.preLog = [];
@@ -1449,7 +1449,7 @@ class zn {
1449
1449
  send(t, e, i = void 0, n = []) {
1450
1450
  if (!this.destination) throw Error("Attempted to send comms message before destination has been initialized");
1451
1451
  const s = {
1452
- _readium: gt,
1452
+ _readium: mt,
1453
1453
  _channel: this.channelId,
1454
1454
  id: i ?? we(),
1455
1455
  // scrict,
@@ -1472,7 +1472,7 @@ class Et {
1472
1472
  function di(r) {
1473
1473
  return r.split("").reverse().join("");
1474
1474
  }
1475
- function Dn(r, t, e) {
1475
+ function Wn(r, t, e) {
1476
1476
  const i = di(t);
1477
1477
  return e.map((n) => {
1478
1478
  const s = Math.max(0, n.end - t.length - n.errors), o = di(r.slice(s, n.end));
@@ -1489,9 +1489,9 @@ function de(r) {
1489
1489
  function ui(r, t, e, i) {
1490
1490
  let n = r.P[e], s = r.M[e];
1491
1491
  const o = i >>> 31, a = t[e] | o, l = a | s, h = (a & n) + n ^ n | a;
1492
- let c = s | ~(h | n), u = n & h;
1493
- const p = de(c & r.lastRowMask[e]) - de(u & r.lastRowMask[e]);
1494
- return c <<= 1, u <<= 1, u |= o, c |= de(i) - o, n = u | ~(l | c), s = c & l, r.P[e] = n, r.M[e] = s, p;
1492
+ let c = s | ~(h | n), d = n & h;
1493
+ const f = de(c & r.lastRowMask[e]) - de(d & r.lastRowMask[e]);
1494
+ return c <<= 1, d <<= 1, d |= o, c |= de(i) - o, n = d | ~(l | c), s = c & l, r.P[e] = n, r.M[e] = s, f;
1495
1495
  }
1496
1496
  function Ki(r, t, e) {
1497
1497
  if (t.length === 0)
@@ -1504,61 +1504,61 @@ function Ki(r, t, e) {
1504
1504
  };
1505
1505
  o.lastRowMask.fill(1 << 31), o.lastRowMask[s] = 1 << (t.length - 1) % n;
1506
1506
  const a = new Uint32Array(s + 1), l = /* @__PURE__ */ new Map(), h = [];
1507
- for (let p = 0; p < 256; p++)
1507
+ for (let f = 0; f < 256; f++)
1508
1508
  h.push(a);
1509
- for (let p = 0; p < t.length; p += 1) {
1510
- const m = t.charCodeAt(p);
1511
- if (l.has(m))
1509
+ for (let f = 0; f < t.length; f += 1) {
1510
+ const g = t.charCodeAt(f);
1511
+ if (l.has(g))
1512
1512
  continue;
1513
- const d = new Uint32Array(s + 1);
1514
- l.set(m, d), m < h.length && (h[m] = d);
1515
- for (let f = 0; f <= s; f += 1) {
1516
- d[f] = 0;
1517
- for (let w = 0; w < n; w += 1) {
1518
- const P = f * n + w;
1519
- if (P >= t.length)
1513
+ const u = new Uint32Array(s + 1);
1514
+ l.set(g, u), g < h.length && (h[g] = u);
1515
+ for (let p = 0; p <= s; p += 1) {
1516
+ u[p] = 0;
1517
+ for (let b = 0; b < n; b += 1) {
1518
+ const v = p * n + b;
1519
+ if (v >= t.length)
1520
1520
  continue;
1521
- t.charCodeAt(P) === m && (d[f] |= 1 << w);
1521
+ t.charCodeAt(v) === g && (u[p] |= 1 << b);
1522
1522
  }
1523
1523
  }
1524
1524
  }
1525
1525
  let c = Math.max(0, Math.ceil(e / n) - 1);
1526
- const u = new Uint32Array(s + 1);
1527
- for (let p = 0; p <= c; p += 1)
1528
- u[p] = (p + 1) * n;
1529
- u[s] = t.length;
1530
- for (let p = 0; p <= c; p += 1)
1531
- o.P[p] = -1, o.M[p] = 0;
1532
- for (let p = 0; p < r.length; p += 1) {
1533
- const m = r.charCodeAt(p);
1534
- let d;
1535
- m < h.length ? d = h[m] : (d = l.get(m), typeof d > "u" && (d = a));
1536
- let f = 0;
1537
- for (let w = 0; w <= c; w += 1)
1538
- f = ui(o, d, w, f), u[w] += f;
1539
- if (u[c] - f <= e && c < s && (d[c + 1] & 1 || f < 0)) {
1526
+ const d = new Uint32Array(s + 1);
1527
+ for (let f = 0; f <= c; f += 1)
1528
+ d[f] = (f + 1) * n;
1529
+ d[s] = t.length;
1530
+ for (let f = 0; f <= c; f += 1)
1531
+ o.P[f] = -1, o.M[f] = 0;
1532
+ for (let f = 0; f < r.length; f += 1) {
1533
+ const g = r.charCodeAt(f);
1534
+ let u;
1535
+ g < h.length ? u = h[g] : (u = l.get(g), typeof u > "u" && (u = a));
1536
+ let p = 0;
1537
+ for (let b = 0; b <= c; b += 1)
1538
+ p = ui(o, u, b, p), d[b] += p;
1539
+ if (d[c] - p <= e && c < s && (u[c + 1] & 1 || p < 0)) {
1540
1540
  c += 1, o.P[c] = -1, o.M[c] = 0;
1541
- let w;
1541
+ let b;
1542
1542
  if (c === s) {
1543
- const P = t.length % n;
1544
- w = P === 0 ? n : P;
1543
+ const v = t.length % n;
1544
+ b = v === 0 ? n : v;
1545
1545
  } else
1546
- w = n;
1547
- u[c] = u[c - 1] + w - f + ui(o, d, c, f);
1546
+ b = n;
1547
+ d[c] = d[c - 1] + b - p + ui(o, u, c, p);
1548
1548
  } else
1549
- for (; c > 0 && u[c] >= e + n; )
1549
+ for (; c > 0 && d[c] >= e + n; )
1550
1550
  c -= 1;
1551
- c === s && u[c] <= e && (u[c] < e && i.splice(0, i.length), i.push({
1551
+ c === s && d[c] <= e && (d[c] < e && i.splice(0, i.length), i.push({
1552
1552
  start: -1,
1553
- end: p + 1,
1554
- errors: u[c]
1555
- }), e = u[c]);
1553
+ end: f + 1,
1554
+ errors: d[c]
1555
+ }), e = d[c]);
1556
1556
  }
1557
1557
  return i;
1558
1558
  }
1559
- function Wn(r, t, e) {
1559
+ function Un(r, t, e) {
1560
1560
  const i = Ki(r, t, e);
1561
- return Dn(r, t, i);
1561
+ return Wn(r, t, i);
1562
1562
  }
1563
1563
  function Ji(r, t, e) {
1564
1564
  let i = 0;
@@ -1569,30 +1569,30 @@ function Ji(r, t, e) {
1569
1569
  end: i + t.length,
1570
1570
  errors: 0
1571
1571
  }), i += 1);
1572
- return n.length > 0 ? n : Wn(r, t, e);
1572
+ return n.length > 0 ? n : Un(r, t, e);
1573
1573
  }
1574
1574
  function pi(r, t) {
1575
1575
  return t.length === 0 || r.length === 0 ? 0 : 1 - Ji(r, t, t.length)[0].errors / t.length;
1576
1576
  }
1577
- function Un(r, t, e = {}) {
1577
+ function Hn(r, t, e = {}) {
1578
1578
  if (t.length === 0)
1579
1579
  return null;
1580
1580
  const i = Math.min(256, t.length / 2), n = Ji(r, t, i);
1581
1581
  if (n.length === 0)
1582
1582
  return null;
1583
1583
  const s = (a) => {
1584
- const p = 1 - a.errors / t.length, m = e.prefix ? pi(
1584
+ const f = 1 - a.errors / t.length, g = e.prefix ? pi(
1585
1585
  r.slice(
1586
1586
  Math.max(0, a.start - e.prefix.length),
1587
1587
  a.start
1588
1588
  ),
1589
1589
  e.prefix
1590
- ) : 1, d = e.suffix ? pi(
1590
+ ) : 1, u = e.suffix ? pi(
1591
1591
  r.slice(a.end, a.end + e.suffix.length),
1592
1592
  e.suffix
1593
1593
  ) : 1;
1594
- let f = 1;
1595
- return typeof e.hint == "number" && (f = 1 - Math.abs(a.start - e.hint) / r.length), (50 * p + 20 * m + 20 * d + 2 * f) / 92;
1594
+ let p = 1;
1595
+ return typeof e.hint == "number" && (p = 1 - Math.abs(a.start - e.hint) / r.length), (50 * f + 20 * g + 20 * u + 2 * p) / 92;
1596
1596
  }, o = n.map((a) => ({
1597
1597
  start: a.start,
1598
1598
  end: a.end,
@@ -1632,7 +1632,7 @@ function fi(r, t) {
1632
1632
  return { node: s, offset: o };
1633
1633
  throw new RangeError("No text nodes with non-whitespace text found in range");
1634
1634
  }
1635
- function Hn(r) {
1635
+ function Bn(r) {
1636
1636
  if (!r.toString().trim().length)
1637
1637
  throw new RangeError("Range contains no non-whitespace text");
1638
1638
  if (r.startContainer.nodeType !== Node.TEXT_NODE)
@@ -1684,7 +1684,7 @@ function Zi(r) {
1684
1684
  return 0;
1685
1685
  }
1686
1686
  }
1687
- function gi(r) {
1687
+ function mi(r) {
1688
1688
  let t = r.previousSibling, e = 0;
1689
1689
  for (; t; )
1690
1690
  e += Zi(t), t = t.previousSibling;
@@ -1722,7 +1722,7 @@ class K {
1722
1722
  throw new Error("Parent is not an ancestor of current element");
1723
1723
  let e = this.element, i = this.offset;
1724
1724
  for (; e !== t; )
1725
- i += gi(e), e = e.parentElement;
1725
+ i += mi(e), e = e.parentElement;
1726
1726
  return new K(e, i);
1727
1727
  }
1728
1728
  /**
@@ -1787,7 +1787,7 @@ class K {
1787
1787
  throw new Error("Text node offset is out of range");
1788
1788
  if (!t.parentElement)
1789
1789
  throw new Error("Text node has no parent");
1790
- const i = gi(t) + e;
1790
+ const i = mi(t) + e;
1791
1791
  return new K(t.parentElement, i);
1792
1792
  }
1793
1793
  case Node.ELEMENT_NODE: {
@@ -1868,7 +1868,7 @@ class et {
1868
1868
  * whitespace
1869
1869
  */
1870
1870
  static trimmedRange(t) {
1871
- return Hn(et.fromRange(t).toRange());
1871
+ return Bn(et.fromRange(t).toRange());
1872
1872
  }
1873
1873
  }
1874
1874
  class jt {
@@ -1932,7 +1932,7 @@ class $t {
1932
1932
  return this.toPositionAnchor(t).toRange();
1933
1933
  }
1934
1934
  toPositionAnchor(t = {}) {
1935
- const e = this.root.textContent, i = Un(e, this.exact, {
1935
+ const e = this.root.textContent, i = Hn(e, this.exact, {
1936
1936
  ...this.context,
1937
1937
  hint: t.hint
1938
1938
  });
@@ -1941,7 +1941,7 @@ class $t {
1941
1941
  return new jt(this.root, i.start, i.end);
1942
1942
  }
1943
1943
  }
1944
- function Bn(r) {
1944
+ function Vn(r) {
1945
1945
  const t = r.tagName.toUpperCase();
1946
1946
  return t === "IMG" || t === "VIDEO" || t === "AUDIO" || t === "IFRAME" || t === "OBJECT" || t === "EMBED" || t === "CANVAS";
1947
1947
  }
@@ -1970,7 +1970,7 @@ function It(r, t) {
1970
1970
  }
1971
1971
  if (n) {
1972
1972
  const s = r.createRange();
1973
- return n.childNodes.length === 0 || Bn(n) ? (s.selectNode(n), s) : (s.setStartBefore(n), s.setEndAfter(n), s);
1973
+ return n.childNodes.length === 0 || Vn(n) ? (s.selectNode(n), s) : (s.setStartBefore(n), s.setEndAfter(n), s);
1974
1974
  }
1975
1975
  }
1976
1976
  } catch (e) {
@@ -1978,7 +1978,7 @@ function It(r, t) {
1978
1978
  }
1979
1979
  return null;
1980
1980
  }
1981
- function Vn(r, t) {
1981
+ function jn(r, t) {
1982
1982
  let e = r.getClientRects();
1983
1983
  e.length || r.commonAncestorContainer.nodeType === Node.ELEMENT_NODE && (e = r.commonAncestorContainer.getClientRects());
1984
1984
  const i = 1, n = [];
@@ -1994,7 +1994,7 @@ function Vn(r, t) {
1994
1994
  const s = tn(
1995
1995
  n,
1996
1996
  i
1997
- ), o = $n(s, i), a = en(o), l = 4;
1997
+ ), o = Gn(s, i), a = en(o), l = 4;
1998
1998
  for (let h = a.length - 1; h >= 0; h--) {
1999
1999
  const c = a[h];
2000
2000
  if (!(c.width * c.height > l))
@@ -2013,16 +2013,16 @@ function tn(r, t, e) {
2013
2013
  continue;
2014
2014
  const a = j(s.top, o.top, t) && j(s.bottom, o.bottom, t), l = j(s.left, o.left, t) && j(s.right, o.right, t);
2015
2015
  if (a && !l && nn(s, o, t)) {
2016
- const u = r.filter((m) => m !== s && m !== o), p = jn(s, o);
2017
- return u.push(p), tn(
2018
- u,
2016
+ const d = r.filter((g) => g !== s && g !== o), f = $n(s, o);
2017
+ return d.push(f), tn(
2018
+ d,
2019
2019
  t
2020
2020
  );
2021
2021
  }
2022
2022
  }
2023
2023
  return r;
2024
2024
  }
2025
- function jn(r, t) {
2025
+ function $n(r, t) {
2026
2026
  const e = Math.min(r.left, t.left), i = Math.max(r.right, t.right), n = Math.min(r.top, t.top), s = Math.max(r.bottom, t.bottom);
2027
2027
  return {
2028
2028
  bottom: s,
@@ -2033,7 +2033,7 @@ function jn(r, t) {
2033
2033
  width: i - e
2034
2034
  };
2035
2035
  }
2036
- function $n(r, t) {
2036
+ function Gn(r, t) {
2037
2037
  const e = new Set(r);
2038
2038
  for (const i of r) {
2039
2039
  if (!(i.width > 1 && i.height > 1)) {
@@ -2041,14 +2041,14 @@ function $n(r, t) {
2041
2041
  continue;
2042
2042
  }
2043
2043
  for (const s of r)
2044
- if (i !== s && e.has(s) && Gn(s, i, t)) {
2044
+ if (i !== s && e.has(s) && Xn(s, i, t)) {
2045
2045
  e.delete(i);
2046
2046
  break;
2047
2047
  }
2048
2048
  }
2049
2049
  return Array.from(e);
2050
2050
  }
2051
- function Gn(r, t, e) {
2051
+ function Xn(r, t, e) {
2052
2052
  return zt(r, t.left, t.top, e) && zt(r, t.right, t.top, e) && zt(r, t.left, t.bottom, e) && zt(r, t.right, t.bottom, e);
2053
2053
  }
2054
2054
  function zt(r, t, e, i) {
@@ -2060,11 +2060,11 @@ function en(r) {
2060
2060
  const i = r[t], n = r[e];
2061
2061
  if (i !== n && nn(i, n, -1)) {
2062
2062
  let s = [], o;
2063
- const a = mi(i, n);
2063
+ const a = gi(i, n);
2064
2064
  if (a.length === 1)
2065
2065
  s = a, o = i;
2066
2066
  else {
2067
- const h = mi(n, i);
2067
+ const h = gi(n, i);
2068
2068
  a.length < h.length ? (s = a, o = i) : (s = h, o = n);
2069
2069
  }
2070
2070
  const l = r.filter((h) => h !== o);
@@ -2073,8 +2073,8 @@ function en(r) {
2073
2073
  }
2074
2074
  return r;
2075
2075
  }
2076
- function mi(r, t) {
2077
- const e = Xn(t, r);
2076
+ function gi(r, t) {
2077
+ const e = Yn(t, r);
2078
2078
  if (e.height === 0 || e.width === 0)
2079
2079
  return [r];
2080
2080
  const i = [];
@@ -2124,7 +2124,7 @@ function mi(r, t) {
2124
2124
  }
2125
2125
  return i;
2126
2126
  }
2127
- function Xn(r, t) {
2127
+ function Yn(r, t) {
2128
2128
  const e = Math.max(r.left, t.left), i = Math.min(r.right, t.right), n = Math.max(r.top, t.top), s = Math.min(r.bottom, t.bottom);
2129
2129
  return {
2130
2130
  bottom: s,
@@ -2165,7 +2165,7 @@ function re(r, t) {
2165
2165
  r.document.documentElement.style.removeProperty(t);
2166
2166
  }
2167
2167
  let Dt = null, pe = null, Ct = 0;
2168
- const mt = { r: 255, g: 255, b: 255, a: 1 }, dt = /* @__PURE__ */ new Map(), Yn = () => {
2168
+ const gt = { r: 255, g: 255, b: 255, a: 1 }, dt = /* @__PURE__ */ new Map(), qn = () => {
2169
2169
  if (!Dt)
2170
2170
  if (typeof OffscreenCanvas < "u")
2171
2171
  Dt = new OffscreenCanvas(5, 5), pe = Dt.getContext("2d", {
@@ -2180,7 +2180,7 @@ const mt = { r: 255, g: 255, b: 255, a: 1 }, dt = /* @__PURE__ */ new Map(), Yn
2180
2180
  });
2181
2181
  }
2182
2182
  return pe;
2183
- }, qn = (r) => {
2183
+ }, Kn = (r) => {
2184
2184
  if (!r) return !0;
2185
2185
  const t = r.trim().toLowerCase();
2186
2186
  return t.startsWith("var(") || [
@@ -2201,30 +2201,30 @@ const mt = { r: 255, g: 255, b: 255, a: 1 }, dt = /* @__PURE__ */ new Map(), Yn
2201
2201
  ].some((n) => t.includes(n));
2202
2202
  }, Wt = (r, t) => {
2203
2203
  console.warn(
2204
- `[Decorator] Could not parse color: "${r}". ${t} Falling back to ${JSON.stringify(mt)} to compute contrast. Please use a CSS color value that can be computed to RGB(A).`
2204
+ `[Decorator] Could not parse color: "${r}". ${t} Falling back to ${JSON.stringify(gt)} to compute contrast. Please use a CSS color value that can be computed to RGB(A).`
2205
2205
  );
2206
2206
  }, Se = (r, t = null) => {
2207
2207
  const e = t ? `${r}|${t}` : r, i = dt.get(e);
2208
2208
  if (i !== void 0)
2209
- return i ?? mt;
2210
- if (qn(r))
2211
- return Wt(r, "Unsupported color format or special value."), dt.set(e, null), mt;
2212
- const n = Yn();
2209
+ return i ?? gt;
2210
+ if (Kn(r))
2211
+ return Wt(r, "Unsupported color format or special value."), dt.set(e, null), gt;
2212
+ const n = qn();
2213
2213
  if (!n)
2214
- return Wt(r, "Could not get canvas context."), dt.set(e, null), mt;
2214
+ return Wt(r, "Could not get canvas context."), dt.set(e, null), gt;
2215
2215
  try {
2216
2216
  Ct === 0 && n.clearRect(0, 0, 5, 5);
2217
2217
  const s = Ct % 5, o = Math.floor(Ct / 5);
2218
2218
  n.clearRect(s, o, 1, 1), t && (n.fillStyle = t, n.fillRect(s, o, 1, 1)), n.fillStyle = r, n.fillRect(s, o, 1, 1);
2219
2219
  const a = n.getImageData(s, o, 1, 1);
2220
2220
  Ct = (Ct + 1) % 25;
2221
- const [l, h, c, u] = a.data;
2222
- if (u === 0)
2223
- return Wt(r, "Fully transparent color."), dt.set(e, null), mt;
2224
- const p = { r: l, g: h, b: c, a: u / 255 };
2225
- return dt.set(e, p), p;
2221
+ const [l, h, c, d] = a.data;
2222
+ if (d === 0)
2223
+ return Wt(r, "Fully transparent color."), dt.set(e, null), gt;
2224
+ const f = { r: l, g: h, b: c, a: d / 255 };
2225
+ return dt.set(e, f), f;
2226
2226
  } catch (s) {
2227
- return Wt(r, `Error: ${s instanceof Error ? s.message : String(s)}`), dt.set(e, null), mt;
2227
+ return Wt(r, `Error: ${s instanceof Error ? s.message : String(s)}`), dt.set(e, null), gt;
2228
2228
  }
2229
2229
  }, fe = (r) => {
2230
2230
  const t = r / 255;
@@ -2238,15 +2238,15 @@ const mt = { r: 255, g: 255, b: 255, a: 1 }, dt = /* @__PURE__ */ new Map(), Yn
2238
2238
  }, Pe = (r, t = null) => {
2239
2239
  const e = Se(r, t), i = bi(e, { r: 255, g: 255, b: 255, a: 1 }), n = bi(e, { r: 0, g: 0, b: 0, a: 1 });
2240
2240
  return i > n;
2241
- }, Kn = (r, t = null) => Pe(r, t) ? "white" : "black", wi = "#FFFF00", Jn = () => "Highlight" in window, vi = ["IMG", "IMAGE", "AUDIO", "VIDEO", "SVG"];
2242
- class Zn {
2241
+ }, Jn = (r, t = null) => Pe(r, t) ? "white" : "black", wi = "#FFFF00", Zn = () => "Highlight" in window, vi = ["IMG", "IMAGE", "AUDIO", "VIDEO", "SVG"];
2242
+ class Qn {
2243
2243
  /**
2244
2244
  * Creates a DecorationGroup object
2245
2245
  * @param id Unique HTML ID-adhering name of the group
2246
2246
  * @param name Human-readable name of the group
2247
2247
  */
2248
2248
  constructor(t, e, i, n) {
2249
- this.wnd = t, this.comms = e, this.id = i, this.name = n, this.items = [], this.lastItemId = 0, this.container = void 0, this.activateable = !1, this.experimentalHighlights = !1, this.currentRender = 0, Jn() && (this.experimentalHighlights = !0, this.notTextFlag = /* @__PURE__ */ new Map());
2249
+ this.wnd = t, this.comms = e, this.id = i, this.name = n, this.items = [], this.lastItemId = 0, this.container = void 0, this.activateable = !1, this.experimentalHighlights = !1, this.currentRender = 0, Zn() && (this.experimentalHighlights = !0, this.notTextFlag = /* @__PURE__ */ new Map());
2250
2250
  }
2251
2251
  get activeable() {
2252
2252
  return this.activateable;
@@ -2309,7 +2309,7 @@ class Zn {
2309
2309
  const n = ue(this.wnd, "--USER__backgroundColor") || this.wnd.getComputedStyle(this.wnd.document.documentElement).getPropertyValue("background-color"), s = t.decoration?.style?.tint ?? wi;
2310
2310
  e.innerHTML = `
2311
2311
  ::highlight(${this.id}) {
2312
- color: ${Kn(s, n)};
2312
+ color: ${Jn(s, n)};
2313
2313
  background-color: ${s};
2314
2314
  }`;
2315
2315
  }
@@ -2326,48 +2326,48 @@ class Zn {
2326
2326
  getComputedStyle(this.wnd.document.documentElement).getPropertyValue(
2327
2327
  "column-count"
2328
2328
  )
2329
- ), s = i / (n || 1), o = this.wnd.document.scrollingElement, a = o.scrollLeft, l = o.scrollTop, h = (d, f, w) => {
2330
- if (d.style.position = "absolute", t.decoration?.style?.width === "viewport") {
2331
- d.style.width = `${i}px`, d.style.height = `${f.height}px`;
2332
- let P = Math.floor(f.left / i) * i;
2333
- d.style.left = `${P + a}px`, d.style.top = `${f.top + l}px`;
2329
+ ), s = i / (n || 1), o = this.wnd.document.scrollingElement, a = o.scrollLeft, l = o.scrollTop, h = (u, p, b) => {
2330
+ if (u.style.position = "absolute", t.decoration?.style?.width === "viewport") {
2331
+ u.style.width = `${i}px`, u.style.height = `${p.height}px`;
2332
+ let v = Math.floor(p.left / i) * i;
2333
+ u.style.left = `${v + a}px`, u.style.top = `${p.top + l}px`;
2334
2334
  } else if (t.decoration?.style?.width === "bounds")
2335
- d.style.width = `${w.width}px`, d.style.height = `${f.height}px`, d.style.left = `${w.left + a}px`, d.style.top = `${f.top + l}px`;
2335
+ u.style.width = `${b.width}px`, u.style.height = `${p.height}px`, u.style.left = `${b.left + a}px`, u.style.top = `${p.top + l}px`;
2336
2336
  else if (t.decoration?.style?.width === "page") {
2337
- d.style.width = `${s}px`, d.style.height = `${f.height}px`;
2338
- let P = Math.floor(f.left / s) * s;
2339
- d.style.left = `${P + a}px`, d.style.top = `${f.top + l}px`;
2337
+ u.style.width = `${s}px`, u.style.height = `${p.height}px`;
2338
+ let v = Math.floor(p.left / s) * s;
2339
+ u.style.left = `${v + a}px`, u.style.top = `${p.top + l}px`;
2340
2340
  } else
2341
- d.style.width = `${f.width}px`, d.style.height = `${f.height}px`, d.style.left = `${f.left + a}px`, d.style.top = `${f.top + l}px`;
2341
+ u.style.width = `${p.width}px`, u.style.height = `${p.height}px`, u.style.left = `${p.left + a}px`, u.style.top = `${p.top + l}px`;
2342
2342
  }, c = t.range.getBoundingClientRect();
2343
- let u = this.wnd.document.createElement("template");
2344
- const p = this.getCurrentDarkMode();
2345
- u.innerHTML = `
2343
+ let d = this.wnd.document.createElement("template");
2344
+ const f = this.getCurrentDarkMode();
2345
+ d.innerHTML = `
2346
2346
  <div
2347
2347
  data-readium="true"
2348
2348
  class="readium-highlight"
2349
2349
  style="${[
2350
2350
  `background-color: ${t.decoration?.style?.tint ?? wi} !important`,
2351
2351
  //"opacity: 0.3 !important",
2352
- `mix-blend-mode: ${p ? "exclusion" : "multiply"} !important`,
2352
+ `mix-blend-mode: ${f ? "exclusion" : "multiply"} !important`,
2353
2353
  "opacity: 1 !important",
2354
2354
  "box-sizing: border-box !important"
2355
2355
  ].join("; ")}"
2356
2356
  >
2357
2357
  </div>
2358
2358
  `.trim();
2359
- const m = u.content.firstElementChild;
2359
+ const g = d.content.firstElementChild;
2360
2360
  if (t.decoration?.style?.layout === "bounds") {
2361
- const d = m.cloneNode(!0);
2362
- d.style.setProperty("pointer-events", "none"), h(d, c, c), e.append(d);
2361
+ const u = g.cloneNode(!0);
2362
+ u.style.setProperty("pointer-events", "none"), h(u, c, c), e.append(u);
2363
2363
  } else {
2364
- let d = Vn(
2364
+ let u = jn(
2365
2365
  t.range
2366
2366
  );
2367
- d = d.sort((f, w) => f.top < w.top ? -1 : f.top > w.top ? 1 : 0);
2368
- for (let f of d) {
2369
- const w = m.cloneNode(!0);
2370
- w.style.setProperty("pointer-events", "none"), h(w, f, c), e.append(w);
2367
+ u = u.sort((p, b) => p.top < b.top ? -1 : p.top > b.top ? 1 : 0);
2368
+ for (let p of u) {
2369
+ const b = g.cloneNode(!0);
2370
+ b.style.setProperty("pointer-events", "none"), h(b, p, c), e.append(b);
2371
2371
  }
2372
2372
  }
2373
2373
  t.container = e, t.clickableElements = Array.from(
@@ -2403,7 +2403,7 @@ class Zn {
2403
2403
  this.experimentalHighlights && this.wnd.CSS.highlights.delete(this.id), this.container && (this.container.remove(), this.container = void 0);
2404
2404
  }
2405
2405
  }
2406
- const Ot = class Ot extends Et {
2406
+ const Rt = class Rt extends Et {
2407
2407
  constructor() {
2408
2408
  super(...arguments), this.resizeFrame = 0, this.lastGroupId = 0, this.groups = /* @__PURE__ */ new Map(), this.handleResizer = this.handleResize.bind(this);
2409
2409
  }
@@ -2428,9 +2428,9 @@ const Ot = class Ot extends Et {
2428
2428
  }, 50);
2429
2429
  }
2430
2430
  mount(t, e) {
2431
- return this.wnd = t, e.register("decorate", Ot.moduleName, (i, n) => {
2431
+ return this.wnd = t, e.register("decorate", Rt.moduleName, (i, n) => {
2432
2432
  const s = i;
2433
- s.decoration && s.decoration.locator && (s.decoration.locator = I.deserialize(s.decoration.locator)), this.groups.has(s.group) || this.groups.set(s.group, new Zn(
2433
+ s.decoration && s.decoration.locator && (s.decoration.locator = I.deserialize(s.decoration.locator)), this.groups.has(s.group) || this.groups.set(s.group, new Qn(
2434
2434
  t,
2435
2435
  e,
2436
2436
  `readium-decoration-${this.lastGroupId++}`,
@@ -2455,8 +2455,8 @@ const Ot = class Ot extends Et {
2455
2455
  }), this.resizeObserver = new ResizeObserver(() => t.requestAnimationFrame(() => this.handleResize())), this.resizeObserver.observe(t.document.body), t.addEventListener("orientationchange", this.handleResizer), t.addEventListener("resize", this.handleResizer), this.backgroundObserver = new MutationObserver((i) => {
2456
2456
  i.some((s) => {
2457
2457
  if (s.type === "attributes" && s.attributeName === "style") {
2458
- const o = s.target, a = s.oldValue, l = o.getAttribute("style"), h = this.extractCustomProperty(a, "--USER__appearance"), c = this.extractCustomProperty(l, "--USER__appearance"), u = this.extractCustomProperty(a, "--USER__backgroundColor"), p = this.extractCustomProperty(l, "--USER__backgroundColor");
2459
- return h !== c || u !== p;
2458
+ const o = s.target, a = s.oldValue, l = o.getAttribute("style"), h = this.extractCustomProperty(a, "--USER__appearance"), c = this.extractCustomProperty(l, "--USER__appearance"), d = this.extractCustomProperty(a, "--USER__backgroundColor"), f = this.extractCustomProperty(l, "--USER__backgroundColor");
2459
+ return h !== c || d !== f;
2460
2460
  }
2461
2461
  return !1;
2462
2462
  }) && this.updateHighlightStyles();
@@ -2468,12 +2468,12 @@ const Ot = class Ot extends Et {
2468
2468
  }), e.log("Decorator Mounted"), !0;
2469
2469
  }
2470
2470
  unmount(t, e) {
2471
- return t.removeEventListener("orientationchange", this.handleResizer), t.removeEventListener("resize", this.handleResizer), e.unregisterAll(Ot.moduleName), this.resizeObserver.disconnect(), this.backgroundObserver.disconnect(), this.cleanup(), e.log("Decorator Unmounted"), !0;
2471
+ return t.removeEventListener("orientationchange", this.handleResizer), t.removeEventListener("resize", this.handleResizer), e.unregisterAll(Rt.moduleName), this.resizeObserver.disconnect(), this.backgroundObserver.disconnect(), this.cleanup(), e.log("Decorator Unmounted"), !0;
2472
2472
  }
2473
2473
  };
2474
- Ot.moduleName = "decorator";
2475
- let Ee = Ot;
2476
- const Si = "readium-snapper-style", Rt = class Rt extends Et {
2474
+ Rt.moduleName = "decorator";
2475
+ let Ee = Rt;
2476
+ const Si = "readium-snapper-style", Ot = class Ot extends Et {
2477
2477
  constructor() {
2478
2478
  super(...arguments), this.protected = !1;
2479
2479
  }
@@ -2486,9 +2486,9 @@ const Si = "readium-snapper-style", Rt = class Rt extends Et {
2486
2486
  }
2487
2487
  mount(t, e) {
2488
2488
  const i = t.document.createElement("style");
2489
- return i.dataset.readium = "true", i.id = Si, i.textContent = this.buildStyles(), t.document.head.appendChild(i), e.register("protect", Rt.moduleName, (n, s) => {
2489
+ return i.dataset.readium = "true", i.id = Si, i.textContent = this.buildStyles(), t.document.head.appendChild(i), e.register("protect", Ot.moduleName, (n, s) => {
2490
2490
  this.protected = !0, i.textContent = this.buildStyles(), s(!0);
2491
- }), e.register("unprotect", Rt.moduleName, (n, s) => {
2491
+ }), e.register("unprotect", Ot.moduleName, (n, s) => {
2492
2492
  this.protected = !1, i.textContent = this.buildStyles(), s(!0);
2493
2493
  }), e.log("Snapper Mounted"), !0;
2494
2494
  }
@@ -2496,12 +2496,12 @@ const Si = "readium-snapper-style", Rt = class Rt extends Et {
2496
2496
  return t.document.getElementById(Si)?.remove(), e.log("Snapper Unmounted"), !0;
2497
2497
  }
2498
2498
  };
2499
- Rt.moduleName = "snapper";
2500
- let St = Rt;
2501
- function Qn(r) {
2499
+ Ot.moduleName = "snapper";
2500
+ let St = Ot;
2501
+ function ts(r) {
2502
2502
  return (r.document.documentElement.dir || r.document.body.dir).toLowerCase() === "rtl";
2503
2503
  }
2504
- function ts(r) {
2504
+ function es(r) {
2505
2505
  return (r.getComputedStyle(r.document.documentElement).writingMode || r.getComputedStyle(r.document.body).writingMode) === "vertical-lr";
2506
2506
  }
2507
2507
  function rn(r) {
@@ -2534,14 +2534,14 @@ function Be(r) {
2534
2534
  const t = r.document.createElement("style");
2535
2535
  t.appendChild(r.document.createTextNode("*{}")), r.document.body.appendChild(t), r.document.body.removeChild(t);
2536
2536
  }
2537
- function es(r) {
2537
+ function is(r) {
2538
2538
  return r < 0.5 ? 2 * r * r : -1 + (4 - 2 * r) * r;
2539
2539
  }
2540
- function O(r) {
2540
+ function R(r) {
2541
2541
  const t = r.getSelection();
2542
2542
  t && t.removeAllRanges();
2543
2543
  }
2544
- const is = [
2544
+ const ns = [
2545
2545
  "a",
2546
2546
  "area",
2547
2547
  "audio",
@@ -2555,15 +2555,15 @@ const is = [
2555
2555
  "submit",
2556
2556
  "textarea",
2557
2557
  "video"
2558
- ], ns = ["dialog", "radiogroup", "radio", "menu", "menuitem"];
2558
+ ], ss = ["dialog", "radiogroup", "radio", "menu", "menuitem"];
2559
2559
  function Ve(r) {
2560
- return ss(r) ? null : on(r) ? r : r.parentElement ? Ve(r.parentElement) : null;
2560
+ return rs(r) ? null : on(r) ? r : r.parentElement ? Ve(r.parentElement) : null;
2561
2561
  }
2562
- function ss(r) {
2562
+ function rs(r) {
2563
2563
  return r ? r.closest("[inert]") !== null || r.hasAttribute("disabled") : !0;
2564
2564
  }
2565
2565
  function on(r) {
2566
- return r ? r.role && ns.includes(r.role) ? !0 : r.tagName.toLowerCase() === "iframe" ? !1 : r.tabIndex >= 0 ? !0 : is.includes(r.nodeName.toLowerCase()) || r.hasAttribute("contenteditable") && r.getAttribute("contenteditable")?.toLowerCase() !== "false" : !1;
2566
+ return r ? r.role && ss.includes(r.role) ? !0 : r.tagName.toLowerCase() === "iframe" ? !1 : r.tabIndex >= 0 ? !0 : ns.includes(r.nodeName.toLowerCase()) || r.hasAttribute("contenteditable") && r.getAttribute("contenteditable")?.toLowerCase() !== "false" : !1;
2567
2567
  }
2568
2568
  function oe(r, t) {
2569
2569
  const e = an(r, r.document.body, t), i = r._readium_cssSelectorGenerator.getCssSelector(e, {
@@ -2585,12 +2585,12 @@ function oe(r, t) {
2585
2585
  function an(r, t, e) {
2586
2586
  for (var i = 0; i < t.children.length; i++) {
2587
2587
  const n = t.children[i];
2588
- if (!as(n) && rs(r, n, e))
2589
- return os(r, n) ? n : an(r, n, e);
2588
+ if (!ls(n) && os(r, n, e))
2589
+ return as(r, n) ? n : an(r, n, e);
2590
2590
  }
2591
2591
  return t;
2592
2592
  }
2593
- function rs(r, t, e) {
2593
+ function os(r, t, e) {
2594
2594
  if (t === document.body || t === document.documentElement)
2595
2595
  return !0;
2596
2596
  if (!document || !document.documentElement || !document.body)
@@ -2598,11 +2598,11 @@ function rs(r, t, e) {
2598
2598
  const i = t.getBoundingClientRect();
2599
2599
  return e ? i.bottom > 0 && i.top < r.innerHeight : i.right > 0 && i.left < r.innerWidth;
2600
2600
  }
2601
- function os(r, t) {
2601
+ function as(r, t) {
2602
2602
  const e = t.getBoundingClientRect();
2603
2603
  return e.top >= 0 && e.left >= 0 && e.bottom <= r.innerHeight && e.right <= r.innerWidth;
2604
2604
  }
2605
- function as(r) {
2605
+ function ls(r) {
2606
2606
  const t = getComputedStyle(r);
2607
2607
  if (t) {
2608
2608
  const e = t.getPropertyValue("display");
@@ -2611,7 +2611,7 @@ function as(r) {
2611
2611
  }
2612
2612
  return !1;
2613
2613
  }
2614
- const ls = {
2614
+ const hs = {
2615
2615
  maxVelocity: 200,
2616
2616
  // Reasonable default for human-like scrolling (pixels/ms)
2617
2617
  minVariance: 0.01,
@@ -2637,7 +2637,7 @@ const ls = {
2637
2637
  maxSelectionsPerSecond: 500,
2638
2638
  minVariance: 50,
2639
2639
  historySize: 20
2640
- }, hs = {
2640
+ }, cs = {
2641
2641
  enabled: !0,
2642
2642
  maxSelectionPercent: 0.1,
2643
2643
  minThreshold: 100,
@@ -2646,7 +2646,7 @@ const ls = {
2646
2646
  };
2647
2647
  class ae {
2648
2648
  constructor(t = {}) {
2649
- this.history = [], this.consistentScrollCount = 0, this.options = { ...ls, ...t };
2649
+ this.history = [], this.consistentScrollCount = 0, this.options = { ...hs, ...t };
2650
2650
  }
2651
2651
  analyze(t, e, i) {
2652
2652
  if (i <= 0) return !1;
@@ -2656,19 +2656,19 @@ class ae {
2656
2656
  direction: t,
2657
2657
  velocity: n,
2658
2658
  distance: Math.abs(e)
2659
- }), this.history = this.history.filter((f) => s - f.timestamp < 2e3).slice(-(this.options.historySize || 20)), this.history.length < 3) return !1;
2659
+ }), this.history = this.history.filter((p) => s - p.timestamp < 2e3).slice(-(this.options.historySize || 20)), this.history.length < 3) return !1;
2660
2660
  if (n > this.options.maxVelocity)
2661
2661
  return this.resetAfterDetection(), !0;
2662
- const o = this.history.map((f) => f.velocity), a = this.history.map((f) => f.distance), l = o.reduce((f, w) => f + w, 0) / o.length, h = a.reduce((f, w) => f + w, 0) / a.length, c = o.reduce((f, w) => f + Math.pow(w - l, 2), 0) / o.length, u = a.reduce((f, w) => f + Math.pow(w - h, 2), 0) / a.length;
2663
- if (c < this.options.minVariance && u < h * 0.1) {
2662
+ const o = this.history.map((p) => p.velocity), a = this.history.map((p) => p.distance), l = o.reduce((p, b) => p + b, 0) / o.length, h = a.reduce((p, b) => p + b, 0) / a.length, c = o.reduce((p, b) => p + Math.pow(b - l, 2), 0) / o.length, d = a.reduce((p, b) => p + Math.pow(b - h, 2), 0) / a.length;
2663
+ if (c < this.options.minVariance && d < h * 0.1) {
2664
2664
  if (this.consistentScrollCount++, this.consistentScrollCount >= (this.options.maxConsistentScrolls || 10))
2665
2665
  return this.resetAfterDetection(), !0;
2666
2666
  } else
2667
2667
  this.consistentScrollCount = Math.max(0, this.consistentScrollCount - 1);
2668
- let p = 0, m = this.history[0].direction;
2669
- for (let f = 1; f < this.history.length; f++)
2670
- this.history[f].direction !== m && (p++, m = this.history[f].direction);
2671
- return p / this.history.length > (this.options.minDirectionChanges || 0.3) ? (this.resetAfterDetection(), !0) : !1;
2668
+ let f = 0, g = this.history[0].direction;
2669
+ for (let p = 1; p < this.history.length; p++)
2670
+ this.history[p].direction !== g && (f++, g = this.history[p].direction);
2671
+ return f / this.history.length > (this.options.minDirectionChanges || 0.3) ? (this.resetAfterDetection(), !0) : !1;
2672
2672
  }
2673
2673
  resetAfterDetection() {
2674
2674
  this.history = this.history.slice(-3), this.consistentScrollCount = 0;
@@ -2677,7 +2677,7 @@ class ae {
2677
2677
  this.history = [], this.consistentScrollCount = 0;
2678
2678
  }
2679
2679
  }
2680
- const Ci = "readium-column-snapper-style", cs = 200, D = class D extends St {
2680
+ const Ci = "readium-column-snapper-style", ds = 200, D = class D extends St {
2681
2681
  constructor() {
2682
2682
  super(...arguments), this.isSnapProtectionEnabled = !1, this.patternAnalyzer = null, this.lastTurnTime = 0, this.rtl = !1, 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);
2683
2683
  }
@@ -2733,21 +2733,21 @@ const Ci = "readium-column-snapper-style", cs = 200, D = class D extends St {
2733
2733
  }
2734
2734
  // Snaps the current offset to the page width.
2735
2735
  snapCurrentOffset(t = !1, e = !1) {
2736
- const i = this.doc(), n = rn(this.wnd), s = this.cachedScrollWidth - this.wnd.innerWidth, o = Math.min(Math.max(0, this.normScroll()), s), a = this.dragOffset(), l = this.rtl ? -a : a, h = this.wnd.innerWidth / 3 * (l > 0 ? 2 : 1), c = Math.min(s, Math.max(0, this.snapNormOffset(o + h))), u = this.rtl ? -c : c, p = this.rtl ? -o : o, m = u > p ? "right" : "left";
2737
- if (this.checkSuspiciousSnap(m, Math.abs(u - p)), t && u !== p) {
2736
+ const i = this.doc(), n = rn(this.wnd), s = this.cachedScrollWidth - this.wnd.innerWidth, o = Math.min(Math.max(0, this.normScroll()), s), a = this.dragOffset(), l = this.rtl ? -a : a, h = this.wnd.innerWidth / 3 * (l > 0 ? 2 : 1), c = Math.min(s, Math.max(0, this.snapNormOffset(o + h))), d = this.rtl ? -c : c, f = this.rtl ? -o : o, g = d > f ? "right" : "left";
2737
+ if (this.checkSuspiciousSnap(g, Math.abs(d - f)), t && d !== f) {
2738
2738
  this.snappingCancelled = !1;
2739
- const d = (R, Y, ht, ct) => ht > ct ? Y : R + (Y - R) * es(ht / ct), f = cs * n;
2740
- let w;
2741
- const P = (R) => {
2739
+ const u = (O, G, ot, ct) => ot > ct ? G : O + (G - O) * is(ot / ct), p = ds * n;
2740
+ let b;
2741
+ const v = (O) => {
2742
2742
  if (this.snappingCancelled) return;
2743
- w || (w = R);
2744
- const Y = R - w, ht = d(this.overscroll, 0, Y, f), ct = d(p, u, Y, f);
2745
- i.scrollLeft = ct, this.overscroll !== 0 && (i.style.transform = `translate3d(${-ht}px, 0px, 0px)`), Y < f ? this.wnd.requestAnimationFrame(P) : (this.clearTouches(), i.style.removeProperty("transform"), i.scrollLeft = u, e || this.reportProgress());
2743
+ b || (b = O);
2744
+ const G = O - b, ot = u(this.overscroll, 0, G, p), ct = u(f, d, G, p);
2745
+ i.scrollLeft = ct, this.overscroll !== 0 && (i.style.transform = `translate3d(${-ot}px, 0px, 0px)`), G < p ? this.wnd.requestAnimationFrame(v) : (this.clearTouches(), i.style.removeProperty("transform"), i.scrollLeft = d, e || this.reportProgress());
2746
2746
  };
2747
- this.wnd.requestAnimationFrame(P);
2747
+ this.wnd.requestAnimationFrame(v);
2748
2748
  } else
2749
2749
  i.style.removeProperty("transform"), this.wnd.requestAnimationFrame(() => {
2750
- i.scrollLeft = u, this.clearTouches(), e || this.reportProgress();
2750
+ i.scrollLeft = d, this.clearTouches(), e || this.reportProgress();
2751
2751
  });
2752
2752
  }
2753
2753
  dragOffset() {
@@ -2782,7 +2782,7 @@ const Ci = "readium-column-snapper-style", cs = 200, D = class D extends St {
2782
2782
  }
2783
2783
  onTouchMove(t) {
2784
2784
  if (this.touchState === 0) return;
2785
- this.touchState === 1 && (this.touchState = 2, O(this.wnd)), this.endingX = t.touches[0].clientX;
2785
+ this.touchState === 1 && (this.touchState = 2, R(this.wnd)), this.endingX = t.touches[0].clientX;
2786
2786
  const e = this.dragOffset(), i = this.alreadyScrollLeft + e, n = this.rtl ? -(this.cachedScrollWidth - this.wnd.innerWidth) : 0, s = this.rtl ? 0 : this.cachedScrollWidth - this.wnd.innerWidth;
2787
2787
  i < n ? (this.overscroll = i, this.doc().style.transform = `translate3d(${-this.overscroll}px, 0px, 0px)`) : i > s ? (this.overscroll = i, this.doc().style.transform = `translate3d(${-i}px, 0px, 0px)`) : (this.overscroll = 0, this.doc().style.removeProperty("transform"), this.doc().scrollLeft = i);
2788
2788
  }
@@ -2810,7 +2810,7 @@ const Ci = "readium-column-snapper-style", cs = 200, D = class D extends St {
2810
2810
  });
2811
2811
  }
2812
2812
  mount(t, e) {
2813
- if (this.wnd = t, this.comms = e, this.rtl = Qn(t), !super.mount(t, e)) return !1;
2813
+ if (this.wnd = t, this.comms = e, this.rtl = ts(t), !super.mount(t, e)) return !1;
2814
2814
  t.navigator.epubReadingSystem && (t.navigator.epubReadingSystem.layoutStyle = "paginated");
2815
2815
  const i = t.document.createElement("style");
2816
2816
  i.dataset.readium = "true", i.id = Ci, i.textContent = `
@@ -2854,8 +2854,8 @@ const Ci = "readium-column-snapper-style", cs = 200, D = class D extends St {
2854
2854
  }), this.resizeObserver.observe(t.document.body), this.mutationObserver = new MutationObserver((o) => {
2855
2855
  for (const a of o)
2856
2856
  if (a.target === this.wnd.document.documentElement) {
2857
- const l = a.oldValue, h = a.target.getAttribute("style"), c = /transform\s*:\s*([^;]+)/, u = l?.match(c), p = h?.match(c);
2858
- (!u && !p || u && !p || u && p && u[1] !== p[1]) && (t.requestAnimationFrame(() => {
2857
+ const l = a.oldValue, h = a.target.getAttribute("style"), c = /transform\s*:\s*([^;]+)/, d = l?.match(c), f = h?.match(c);
2858
+ (!d && !f || d && !f || d && f && d[1] !== f[1]) && (t.requestAnimationFrame(() => {
2859
2859
  t && Ei(t);
2860
2860
  }), this.onWidthChange());
2861
2861
  } else
@@ -2881,7 +2881,7 @@ const Ci = "readium-column-snapper-style", cs = 200, D = class D extends St {
2881
2881
  this.wnd.requestAnimationFrame(() => {
2882
2882
  this.cachedScrollWidth = this.doc().scrollWidth;
2883
2883
  const c = (this.cachedScrollWidth - t.innerWidth) * l;
2884
- this.rtl ? this.doc().scrollLeft = -this.snapNormOffset(c) : this.doc().scrollLeft = this.snapOffset(c), this.reportProgress(), O(this.wnd), a(!0);
2884
+ this.rtl ? this.doc().scrollLeft = -this.snapNormOffset(c) : this.doc().scrollLeft = this.snapOffset(c), this.reportProgress(), R(this.wnd), a(!0);
2885
2885
  });
2886
2886
  }), e.register("go_id", D.moduleName, (o, a) => {
2887
2887
  const l = t.document.getElementById(o);
@@ -2890,7 +2890,7 @@ const Ci = "readium-column-snapper-style", cs = 200, D = class D extends St {
2890
2890
  return;
2891
2891
  }
2892
2892
  this.wnd.requestAnimationFrame(() => {
2893
- this.rtl ? this.doc().scrollLeft = -this.snapNormOffset(l.getBoundingClientRect().left + t.scrollX) : this.doc().scrollLeft = this.snapOffset(l.getBoundingClientRect().left + t.scrollX), this.reportProgress(), O(this.wnd), a(!0);
2893
+ this.rtl ? this.doc().scrollLeft = -this.snapNormOffset(l.getBoundingClientRect().left + t.scrollX) : this.doc().scrollLeft = this.snapOffset(l.getBoundingClientRect().left + t.scrollX), this.reportProgress(), R(this.wnd), a(!0);
2894
2894
  });
2895
2895
  }), e.register("go_text", D.moduleName, (o, a) => {
2896
2896
  let l;
@@ -2910,34 +2910,34 @@ const Ci = "readium-column-snapper-style", cs = 200, D = class D extends St {
2910
2910
  return;
2911
2911
  }
2912
2912
  this.wnd.requestAnimationFrame(() => {
2913
- this.rtl ? this.doc().scrollLeft = -this.snapNormOffset(c.getBoundingClientRect().left + t.scrollX) : this.doc().scrollLeft = this.snapOffset(c.getBoundingClientRect().left + t.scrollX), this.reportProgress(), O(this.wnd), a(!0);
2913
+ this.rtl ? this.doc().scrollLeft = -this.snapNormOffset(c.getBoundingClientRect().left + t.scrollX) : this.doc().scrollLeft = this.snapOffset(c.getBoundingClientRect().left + t.scrollX), this.reportProgress(), R(this.wnd), a(!0);
2914
2914
  });
2915
2915
  }), e.register("go_end", D.moduleName, (o, a) => {
2916
2916
  this.wnd.requestAnimationFrame(() => {
2917
2917
  this.cachedScrollWidth = this.doc().scrollWidth;
2918
2918
  let l;
2919
2919
  if (this.rtl ? l = -this.snapNormOffset(this.cachedScrollWidth - t.innerWidth) : l = this.snapOffset(this.cachedScrollWidth), this.doc().scrollLeft === l) return a(!1);
2920
- this.doc().scrollLeft = l, this.reportProgress(), O(this.wnd), a(!0);
2920
+ this.doc().scrollLeft = l, this.reportProgress(), R(this.wnd), a(!0);
2921
2921
  });
2922
2922
  }), e.register("go_start", D.moduleName, (o, a) => {
2923
2923
  this.wnd.requestAnimationFrame(() => {
2924
2924
  if (this.doc().scrollLeft === 0) return a(!1);
2925
- this.doc().scrollLeft = 0, this.reportProgress(), O(this.wnd), a(!0);
2925
+ this.doc().scrollLeft = 0, this.reportProgress(), R(this.wnd), a(!0);
2926
2926
  });
2927
2927
  }), e.register("go_prev", D.moduleName, (o, a) => {
2928
2928
  this.wnd.requestAnimationFrame(() => {
2929
2929
  this.cachedScrollWidth = this.doc().scrollWidth;
2930
2930
  let l;
2931
- this.rtl ? l = s(this.normScroll() - t.innerWidth) : l = n(t.scrollX - t.innerWidth), this.reportProgress(), l && (O(this.wnd), this.checkSuspiciousSnap("left", this.wnd.innerWidth)), a(l);
2931
+ this.rtl ? l = s(this.normScroll() - t.innerWidth) : l = n(t.scrollX - t.innerWidth), this.reportProgress(), l && (R(this.wnd), this.checkSuspiciousSnap("left", this.wnd.innerWidth)), a(l);
2932
2932
  });
2933
2933
  }), e.register("go_next", D.moduleName, (o, a) => {
2934
2934
  this.wnd.requestAnimationFrame(() => {
2935
2935
  this.cachedScrollWidth = this.doc().scrollWidth;
2936
2936
  let l;
2937
- this.rtl ? l = s(this.normScroll() + t.innerWidth) : l = n(t.scrollX + t.innerWidth), this.reportProgress(), l && (O(this.wnd), this.checkSuspiciousSnap("right", this.wnd.innerWidth)), a(l);
2937
+ this.rtl ? l = s(this.normScroll() + t.innerWidth) : l = n(t.scrollX + t.innerWidth), this.reportProgress(), l && (R(this.wnd), this.checkSuspiciousSnap("right", this.wnd.innerWidth)), a(l);
2938
2938
  });
2939
2939
  }), e.register("unfocus", D.moduleName, (o, a) => {
2940
- this.snappingCancelled = !0, O(this.wnd), a(!0);
2940
+ this.snappingCancelled = !0, R(this.wnd), a(!0);
2941
2941
  }), e.register("shake", D.moduleName, (o, a) => {
2942
2942
  this.shake(), a(!0);
2943
2943
  }), e.register("focus", D.moduleName, (o, a) => {
@@ -3032,7 +3032,7 @@ const _i = "readium-scroll-snapper-style", U = class U extends St {
3032
3032
  return;
3033
3033
  }
3034
3034
  this.wnd.requestAnimationFrame(() => {
3035
- this.doc().scrollTop = this.doc().offsetHeight * o, this.reportProgress(), O(this.wnd), s(!0);
3035
+ this.doc().scrollTop = this.doc().offsetHeight * o, this.reportProgress(), R(this.wnd), s(!0);
3036
3036
  });
3037
3037
  }), e.register("go_id", U.moduleName, (n, s) => {
3038
3038
  const o = t.document.getElementById(n);
@@ -3041,7 +3041,7 @@ const _i = "readium-scroll-snapper-style", U = class U extends St {
3041
3041
  return;
3042
3042
  }
3043
3043
  this.wnd.requestAnimationFrame(() => {
3044
- this.doc().scrollTop = o.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), O(this.wnd), s(!0);
3044
+ this.doc().scrollTop = o.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), R(this.wnd), s(!0);
3045
3045
  });
3046
3046
  }), e.register("go_text", U.moduleName, (n, s) => {
3047
3047
  let o;
@@ -3061,7 +3061,7 @@ const _i = "readium-scroll-snapper-style", U = class U extends St {
3061
3061
  return;
3062
3062
  }
3063
3063
  this.wnd.requestAnimationFrame(() => {
3064
- this.doc().scrollTop = l.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), O(this.wnd), s(!0);
3064
+ this.doc().scrollTop = l.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), R(this.wnd), s(!0);
3065
3065
  });
3066
3066
  }), e.register("go_start", U.moduleName, (n, s) => {
3067
3067
  if (this.doc().scrollTop === 0) return s(!1);
@@ -3070,7 +3070,7 @@ const _i = "readium-scroll-snapper-style", U = class U extends St {
3070
3070
  if (this.doc().scrollTop === this.doc().scrollHeight - this.doc().offsetHeight) return s(!1);
3071
3071
  this.doc().scrollTop = this.doc().scrollHeight - this.doc().offsetHeight, this.reportProgress(), s(!0);
3072
3072
  }), e.register("unfocus", U.moduleName, (n, s) => {
3073
- O(this.wnd), s(!0);
3073
+ R(this.wnd), s(!0);
3074
3074
  }), e.register("scroll_protection", U.moduleName, (n, s) => {
3075
3075
  this.enableScrollProtection(), s(!0);
3076
3076
  }), e.register([
@@ -3155,7 +3155,7 @@ const H = class H extends St {
3155
3155
  return;
3156
3156
  }
3157
3157
  this.wnd.requestAnimationFrame(() => {
3158
- this.doc().scrollTop = this.doc().offsetHeight * s, this.reportProgress(), O(this.wnd), n(!0);
3158
+ this.doc().scrollTop = this.doc().offsetHeight * s, this.reportProgress(), R(this.wnd), n(!0);
3159
3159
  });
3160
3160
  }), e.register("go_id", H.moduleName, (i, n) => {
3161
3161
  const s = t.document.getElementById(i);
@@ -3164,7 +3164,7 @@ const H = class H extends St {
3164
3164
  return;
3165
3165
  }
3166
3166
  this.wnd.requestAnimationFrame(() => {
3167
- this.doc().scrollTop = s.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), O(this.wnd), n(!0);
3167
+ this.doc().scrollTop = s.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), R(this.wnd), n(!0);
3168
3168
  });
3169
3169
  }), e.register("go_text", H.moduleName, (i, n) => {
3170
3170
  let s;
@@ -3184,7 +3184,7 @@ const H = class H extends St {
3184
3184
  return;
3185
3185
  }
3186
3186
  this.wnd.requestAnimationFrame(() => {
3187
- this.doc().scrollTop = a.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), O(this.wnd), n(!0);
3187
+ this.doc().scrollTop = a.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), R(this.wnd), n(!0);
3188
3188
  });
3189
3189
  }), e.register("go_start", H.moduleName, (i, n) => {
3190
3190
  if (this.doc().scrollTop === 0) return n(!1);
@@ -3193,7 +3193,7 @@ const H = class H extends St {
3193
3193
  if (this.doc().scrollTop === this.doc().scrollHeight - this.doc().offsetHeight) return n(!1);
3194
3194
  this.doc().scrollTop = this.doc().scrollHeight - this.doc().offsetHeight, this.reportProgress(), n(!0);
3195
3195
  }), e.register("unfocus", H.moduleName, (i, n) => {
3196
- O(this.wnd), n(!0);
3196
+ R(this.wnd), n(!0);
3197
3197
  }), e.register("scroll_protection", H.moduleName, (i, n) => {
3198
3198
  this.enableScrollProtection(), n(!0);
3199
3199
  }), e.register([
@@ -3212,7 +3212,7 @@ const H = class H extends St {
3212
3212
  };
3213
3213
  H.moduleName = "webpub_snapper";
3214
3214
  let Le = H;
3215
- class ds {
3215
+ class us {
3216
3216
  constructor(t, e) {
3217
3217
  this.window = t, this.copyHistory = [], this.lastSelectionLength = 0, this.lastSelectionTime = 0, this.options = e;
3218
3218
  }
@@ -3241,18 +3241,18 @@ class ds {
3241
3241
  const l = o - this.lastSelectionTime < 100 && n > this.lastSelectionLength * 1.5, h = Math.min(
3242
3242
  s * this.options.maxSelectionPercent,
3243
3243
  this.options.absoluteMaxChars
3244
- ), c = this.isSuspiciousPattern(o), u = n > h || l || c;
3244
+ ), c = this.isSuspiciousPattern(o), d = n > h || l || c;
3245
3245
  return this.copyHistory.push({
3246
3246
  timestamp: o,
3247
3247
  length: n,
3248
- wasBlocked: u
3249
- }), u ? (t?.preventDefault(), !1) : (this.lastSelectionLength = n, this.lastSelectionTime = o, !0);
3248
+ wasBlocked: d
3249
+ }), d ? (t?.preventDefault(), !1) : (this.lastSelectionLength = n, this.lastSelectionTime = o, !0);
3250
3250
  }
3251
3251
  destroy() {
3252
3252
  this.lastSelectionLength = 0, this.lastSelectionTime = 0, this.copyHistory = [], this.options.enabled = !1;
3253
3253
  }
3254
3254
  }
3255
- class us {
3255
+ class ps {
3256
3256
  constructor(t = ln) {
3257
3257
  this.options = t, this.events = [], this.selectionStartTime = 0, this.lastSelectionTime = 0, this.lastSelectionPosition = 0, this.selectionPatterns = [], this.lastSelectedText = "";
3258
3258
  }
@@ -3332,8 +3332,8 @@ class hn {
3332
3332
  width: c.width,
3333
3333
  height: c.height
3334
3334
  });
3335
- const u = n.document.activeElement;
3336
- u && u !== n.document.body && (o = Ve(u)?.outerHTML);
3335
+ const d = n.document.activeElement;
3336
+ d && d !== n.document.body && (o = Ve(d)?.outerHTML);
3337
3337
  }
3338
3338
  return {
3339
3339
  type: e,
@@ -3371,20 +3371,22 @@ class hn {
3371
3371
  createUnifiedHandler(t, e, i, n) {
3372
3372
  const s = this.createKeyboardHandlers(t, e, i, n);
3373
3373
  return (o) => {
3374
- for (const a of s)
3375
- if (this.match(o, [a])) {
3376
- const l = a.suppressOnInteractiveElement;
3377
- if (l) {
3378
- const h = (n?.document ?? document).activeElement;
3379
- if (Array.isArray(l) ? l.some((c) => h?.matches(c)) : on(h)) return;
3374
+ if (o.isTrusted) {
3375
+ for (const a of s)
3376
+ if (this.match(o, [a])) {
3377
+ const l = a.suppressOnInteractiveElement;
3378
+ if (l) {
3379
+ const h = (n?.document ?? document).activeElement;
3380
+ if (Array.isArray(l) ? l.some((c) => h?.matches(c)) : on(h)) return;
3381
+ }
3382
+ o.preventDefault(), o.stopPropagation(), a.handler(o);
3383
+ return;
3380
3384
  }
3381
- o.preventDefault(), o.stopPropagation(), a.handler(o);
3382
- return;
3383
- }
3385
+ }
3384
3386
  };
3385
3387
  }
3386
3388
  }
3387
- const ot = class ot extends Et {
3389
+ const at = class at extends Et {
3388
3390
  constructor() {
3389
3391
  super(...arguments), this.configApplied = !1, this.cleanupCallbacks = [], this.pointerMoved = !1, this.isContextMenuEnabled = !1, this.isDragAndDropEnabled = !1, this.isSelectionMonitoringEnabled = !1, this.isBulkCopyProtectionEnabled = !1, this.selectionAnalyzer = null, this.currentSelection = null, this.bulkCopyProtector = null, this.keyManager = new hn(), this.keyDownHandler = null, this.preventBulkCopy = (t) => {
3390
3392
  if (!this.isBulkCopyProtectionEnabled || !this.bulkCopyProtector)
@@ -3509,8 +3511,8 @@ const ot = class ot extends Et {
3509
3511
  }
3510
3512
  addBulkCopyProtection(t = {}) {
3511
3513
  if (this.isBulkCopyProtectionEnabled || !this.wnd) return;
3512
- const e = hs, i = t ? { ...e, ...t } : e;
3513
- this.bulkCopyProtector = new ds(this.wnd, i), this.wnd.document.addEventListener("copy", this.preventBulkCopy, !0), this.wnd.document.addEventListener("cut", this.preventBulkCopy, !0), this.isBulkCopyProtectionEnabled = !0;
3514
+ const e = cs, i = t ? { ...e, ...t } : e;
3515
+ this.bulkCopyProtector = new us(this.wnd, i), this.wnd.document.addEventListener("copy", this.preventBulkCopy, !0), this.wnd.document.addEventListener("cut", this.preventBulkCopy, !0), this.isBulkCopyProtectionEnabled = !0;
3514
3516
  }
3515
3517
  removeBulkCopyProtection() {
3516
3518
  !this.isBulkCopyProtectionEnabled || !this.wnd || (this.wnd.document.removeEventListener("copy", this.preventBulkCopy, !0), this.wnd.document.removeEventListener("cut", this.preventBulkCopy, !0), this.bulkCopyProtector?.destroy(), this.bulkCopyProtector = null, this.isBulkCopyProtectionEnabled = !1);
@@ -3518,7 +3520,7 @@ const ot = class ot extends Et {
3518
3520
  addSelectionMonitoring(t) {
3519
3521
  if (this.isSelectionMonitoringEnabled || !this.wnd) return;
3520
3522
  const e = t || ln;
3521
- this.selectionAnalyzer = new us(e), this.wnd.document.addEventListener("selectionchange", this.handleSelection), this.isSelectionMonitoringEnabled = !0;
3523
+ this.selectionAnalyzer = new ps(e), this.wnd.document.addEventListener("selectionchange", this.handleSelection), this.isSelectionMonitoringEnabled = !0;
3522
3524
  }
3523
3525
  removeSelectionMonitoring() {
3524
3526
  !this.isSelectionMonitoringEnabled || !this.wnd || (this.wnd.document.removeEventListener("selectionchange", this.handleSelection), this.selectionAnalyzer?.clear(), this.selectionAnalyzer = null, this.isSelectionMonitoringEnabled = !1);
@@ -3578,7 +3580,7 @@ const ot = class ot extends Et {
3578
3580
  }
3579
3581
  }
3580
3582
  registerProtectionHandlers() {
3581
- this.comms?.register("peripherals_protection", ot.moduleName, (t, e) => {
3583
+ this.comms?.register("peripherals_protection", at.moduleName, (t, e) => {
3582
3584
  const i = t;
3583
3585
  if (!this.configApplied) {
3584
3586
  if (this.configApplied = !0, i.monitorSelection) {
@@ -3596,9 +3598,9 @@ const ot = class ot extends Et {
3596
3598
  }), this.comms?.log("Copy protection enabled")), i.disableContextMenu && (this.addContextMenuPrevention(), this.comms?.log("Context menu protection enabled")), i.disableDragAndDrop && (this.addDragAndDropPrevention(), this.comms?.log("Drag and drop protection enabled"));
3597
3599
  }
3598
3600
  e(!0);
3599
- }), this.comms?.register("unfocus", ot.moduleName, (t, e) => {
3601
+ }), this.comms?.register("unfocus", at.moduleName, (t, e) => {
3600
3602
  this.disableKeyboardPeripherals(), e(!0);
3601
- }), this.comms?.register("keyboard_peripherals", ot.moduleName, (t, e) => {
3603
+ }), this.comms?.register("keyboard_peripherals", at.moduleName, (t, e) => {
3602
3604
  const i = t;
3603
3605
  i && i.length > 0 && (this.enableKeyboardPeripherals(i), this.comms?.log(`Keyboard peripherals enabled: ${i.map((n) => n.type).join(", ")}`)), e(!0);
3604
3606
  });
@@ -3607,11 +3609,11 @@ const ot = class ot extends Et {
3607
3609
  return this.wnd = t, this.comms = e, this.registerProtectionHandlers(), t.document.addEventListener("pointerdown", this.onPointerDown), t.document.addEventListener("pointerup", this.onPointerUp), t.document.addEventListener("pointermove", this.onPointerMove), t.document.addEventListener("click", this.onClicker), e.log("Peripherals Mounted"), !0;
3608
3610
  }
3609
3611
  unmount(t, e) {
3610
- return this.removeBulkCopyProtection(), this.removeSelectionMonitoring(), this.removeContextMenuPrevention(), this.removeDragAndDropPrevention(), this.disableKeyboardPeripherals(), this.cleanupCallbacks.forEach((i) => i()), this.cleanupCallbacks = [], t.document.removeEventListener("pointerdown", this.onPointerDown), t.document.removeEventListener("pointerup", this.onPointerUp), t.document.removeEventListener("pointermove", this.onPointerMove), t.document.removeEventListener("click", this.onClicker), e.unregisterAll(ot.moduleName), this.configApplied = !1, e.log("Peripherals Unmounted"), !0;
3612
+ return this.removeBulkCopyProtection(), this.removeSelectionMonitoring(), this.removeContextMenuPrevention(), this.removeDragAndDropPrevention(), this.disableKeyboardPeripherals(), this.cleanupCallbacks.forEach((i) => i()), this.cleanupCallbacks = [], t.document.removeEventListener("pointerdown", this.onPointerDown), t.document.removeEventListener("pointerup", this.onPointerUp), t.document.removeEventListener("pointermove", this.onPointerMove), t.document.removeEventListener("click", this.onClicker), e.unregisterAll(at.moduleName), this.configApplied = !1, e.log("Peripherals Unmounted"), !0;
3611
3613
  }
3612
3614
  };
3613
- ot.moduleName = "peripherals";
3614
- let xe = ot;
3615
+ at.moduleName = "peripherals";
3616
+ let xe = at;
3615
3617
  const At = class At extends Et {
3616
3618
  constructor() {
3617
3619
  super(...arguments), this.mediaPlayingCount = 0, this.allAnimations = /* @__PURE__ */ new Set();
@@ -3662,7 +3664,7 @@ const At = class At extends Et {
3662
3664
  ), Reflect.defineProperty(t.navigator, "epubReadingSystem", {
3663
3665
  value: {
3664
3666
  name: "readium-ts-toolkit",
3665
- version: "2.5.6",
3667
+ version: "2.5.8",
3666
3668
  hasFeature: (n, s = "") => {
3667
3669
  switch (n) {
3668
3670
  case "dom-manipulation":
@@ -3766,7 +3768,7 @@ const xi = "readium-fixed-style", q = class q extends Gt {
3766
3768
  }), e.register("remove_property", q.moduleName, (n, s) => {
3767
3769
  re(t, n), s(!0);
3768
3770
  }), e.register("first_visible_locator", q.moduleName, (n, s) => s(!1)), e.register("unfocus", q.moduleName, (n, s) => {
3769
- O(t), s(!0);
3771
+ R(t), s(!0);
3770
3772
  }), e.register([
3771
3773
  "focus",
3772
3774
  "go_next",
@@ -3785,7 +3787,7 @@ const xi = "readium-fixed-style", q = class q extends Gt {
3785
3787
  }
3786
3788
  };
3787
3789
  q.moduleName = "fixed_setup";
3788
- let Oe = q;
3790
+ let Re = q;
3789
3791
  const Q = class Q extends Et {
3790
3792
  wndOnErr(t) {
3791
3793
  this.comms?.send("error", {
@@ -3818,9 +3820,9 @@ const Q = class Q extends Et {
3818
3820
  }
3819
3821
  };
3820
3822
  Q.moduleName = "webpub_setup";
3821
- let Re = Q;
3823
+ let Oe = Q;
3822
3824
  var nt;
3823
- let ps = (nt = class extends Et {
3825
+ let fs = (nt = class extends Et {
3824
3826
  constructor() {
3825
3827
  super(...arguments), this.styleElement = null, this.beforePrintHandler = null, this.configApplied = !1;
3826
3828
  }
@@ -3911,7 +3913,7 @@ const ki = "readium-cjk-vertical-snapper-style", B = class B extends St {
3911
3913
  this.patternAnalyzer || (this.patternAnalyzer = new ae(je), this.isScrollProtectionEnabled = !0, this.comms?.log("Scroll protection enabled"));
3912
3914
  }
3913
3915
  mount(t, e) {
3914
- this.wnd = t, this.comms = e, this.initialScrollHandled = !1, this.lastScrollLeft = 0, this.isResizing = !1, this.verticalLR = ts(t), this.resizeDebounce && (this.wnd.clearTimeout(this.resizeDebounce), this.resizeDebounce = null), t.navigator.epubReadingSystem && (t.navigator.epubReadingSystem.layoutStyle = "scrolling");
3916
+ this.wnd = t, this.comms = e, this.initialScrollHandled = !1, this.lastScrollLeft = 0, this.isResizing = !1, this.verticalLR = es(t), this.resizeDebounce && (this.wnd.clearTimeout(this.resizeDebounce), this.resizeDebounce = null), t.navigator.epubReadingSystem && (t.navigator.epubReadingSystem.layoutStyle = "scrolling");
3915
3917
  const i = t.document.createElement("style");
3916
3918
  return i.dataset.readium = "true", i.id = ki, i.textContent = `
3917
3919
  * {
@@ -3942,7 +3944,7 @@ const ki = "readium-cjk-vertical-snapper-style", B = class B extends St {
3942
3944
  }
3943
3945
  this.wnd.requestAnimationFrame(() => {
3944
3946
  const a = this.scrollable() * o;
3945
- this.doc().scrollLeft = this.verticalLR ? a : -a, this.reportProgress(), O(this.wnd), s(!0);
3947
+ this.doc().scrollLeft = this.verticalLR ? a : -a, this.reportProgress(), R(this.wnd), s(!0);
3946
3948
  });
3947
3949
  }), e.register("go_id", B.moduleName, (n, s) => {
3948
3950
  const o = t.document.getElementById(n);
@@ -3951,7 +3953,7 @@ const ki = "readium-cjk-vertical-snapper-style", B = class B extends St {
3951
3953
  return;
3952
3954
  }
3953
3955
  this.wnd.requestAnimationFrame(() => {
3954
- this.doc().scrollLeft += o.getBoundingClientRect().left - t.innerWidth / 2, this.reportProgress(), O(this.wnd), s(!0);
3956
+ this.doc().scrollLeft += o.getBoundingClientRect().left - t.innerWidth / 2, this.reportProgress(), R(this.wnd), s(!0);
3955
3957
  });
3956
3958
  }), e.register("go_text", B.moduleName, (n, s) => {
3957
3959
  let o;
@@ -3969,7 +3971,7 @@ const ki = "readium-cjk-vertical-snapper-style", B = class B extends St {
3969
3971
  return;
3970
3972
  }
3971
3973
  this.wnd.requestAnimationFrame(() => {
3972
- this.doc().scrollLeft += l.getBoundingClientRect().left - t.innerWidth / 2, this.reportProgress(), O(this.wnd), s(!0);
3974
+ this.doc().scrollLeft += l.getBoundingClientRect().left - t.innerWidth / 2, this.reportProgress(), R(this.wnd), s(!0);
3973
3975
  });
3974
3976
  }), e.register("go_start", B.moduleName, (n, s) => {
3975
3977
  if (this.doc().scrollLeft === 0) return s(!1);
@@ -3981,7 +3983,7 @@ const ki = "readium-cjk-vertical-snapper-style", B = class B extends St {
3981
3983
  "go_next",
3982
3984
  "go_prev"
3983
3985
  ], B.moduleName, (n, s) => s(!1)), e.register("unfocus", B.moduleName, (n, s) => {
3984
- O(this.wnd), s(!0);
3986
+ R(this.wnd), s(!0);
3985
3987
  }), e.register("scroll_protection", B.moduleName, (n, s) => {
3986
3988
  this.enableScrollProtection(), s(!0);
3987
3989
  }), e.register("focus", B.moduleName, (n, s) => {
@@ -3997,7 +3999,7 @@ const ki = "readium-cjk-vertical-snapper-style", B = class B extends St {
3997
3999
  };
3998
4000
  B.moduleName = "cjk_vertical_snapper";
3999
4001
  let Ae = B;
4000
- const fs = [
4002
+ const ms = [
4001
4003
  "fixed_setup",
4002
4004
  "decorator",
4003
4005
  "peripherals",
@@ -4010,7 +4012,7 @@ const fs = [
4010
4012
  "scroll_snapper",
4011
4013
  "cjk_vertical_snapper",
4012
4014
  "print_protection"
4013
- ], ms = [
4015
+ ], ys = [
4014
4016
  "webpub_setup",
4015
4017
  "webpub_snapper",
4016
4018
  "decorator",
@@ -4018,16 +4020,16 @@ const fs = [
4018
4020
  "print_protection"
4019
4021
  ], Te = new Map([
4020
4022
  // All modules go here
4021
- Oe,
4022
- ke,
4023
4023
  Re,
4024
+ ke,
4025
+ Oe,
4024
4026
  Le,
4025
4027
  xe,
4026
4028
  Ee,
4027
4029
  Ce,
4028
4030
  _e,
4029
4031
  Ae,
4030
- ps
4032
+ fs
4031
4033
  ].map((r) => [r.moduleName, r]));
4032
4034
  class Pt {
4033
4035
  /**
@@ -4035,7 +4037,7 @@ class Pt {
4035
4037
  * @param initialModules List of initial modules to load
4036
4038
  */
4037
4039
  constructor(t = window, e = []) {
4038
- this.loadedModules = [], this.wnd = t, this.comms = new zn(t);
4040
+ this.loadedModules = [], this.wnd = t, this.comms = new Dn(t);
4039
4041
  const i = [...new Set(e)];
4040
4042
  if (i.length) {
4041
4043
  if (typeof t > "u")
@@ -4079,7 +4081,7 @@ class Pt {
4079
4081
  this.comms.destroy(), this.loadedModules.forEach((t) => t.unmount(this.wnd, this.comms)), this.loadedModules = [];
4080
4082
  }
4081
4083
  }
4082
- const ys = {
4084
+ const bs = {
4083
4085
  type: "developer_tools",
4084
4086
  keyCombos: [
4085
4087
  { keyCode: 73, meta: !0, alt: !0 },
@@ -4113,7 +4115,7 @@ const ys = {
4113
4115
  { keyCode: 123, meta: !0, alt: !0 }
4114
4116
  // Cmd+Option+F12
4115
4117
  ]
4116
- }, bs = {
4118
+ }, ws = {
4117
4119
  type: "select_all",
4118
4120
  keyCombos: [
4119
4121
  { keyCode: 65, meta: !0 },
@@ -4121,7 +4123,7 @@ const ys = {
4121
4123
  { keyCode: 65, ctrl: !0 }
4122
4124
  // Ctrl+A
4123
4125
  ]
4124
- }, ws = {
4126
+ }, vs = {
4125
4127
  type: "print",
4126
4128
  keyCombos: [
4127
4129
  { keyCode: 80, meta: !0 },
@@ -4137,7 +4139,7 @@ const ys = {
4137
4139
  { keyCode: 80, ctrl: !0, alt: !0 }
4138
4140
  // Ctrl+Alt+P
4139
4141
  ]
4140
- }, vs = {
4142
+ }, Ss = {
4141
4143
  type: "save",
4142
4144
  keyCombos: [
4143
4145
  { keyCode: 83, meta: !0 },
@@ -4155,7 +4157,7 @@ class cn {
4155
4157
  const i = [], n = e.filter(
4156
4158
  (s) => !["developer_tools", "select_all", "print", "save"].includes(s.type)
4157
4159
  );
4158
- t.disableSelectAll && i.push(bs), t.disableSave && i.push(vs), t.monitorDevTools && i.push(ys), t.protectPrinting?.disable && i.push(ws);
4160
+ t.disableSelectAll && i.push(ws), t.disableSave && i.push(Ss), t.monitorDevTools && i.push(bs), t.protectPrinting?.disable && i.push(vs);
4159
4161
  for (const s of n) {
4160
4162
  const o = s.keyCombos.filter(
4161
4163
  (a) => !i.some(
@@ -4186,9 +4188,9 @@ class dn extends cn {
4186
4188
  this.readingProgression === M.ltr ? this.goForward(t, e) : this.readingProgression === M.rtl && this.goBackward(t, e);
4187
4189
  }
4188
4190
  }
4189
- class Ss extends cn {
4191
+ class Ps extends cn {
4190
4192
  }
4191
- class Ps {
4193
+ class Es {
4192
4194
  constructor(t, e, i, n) {
4193
4195
  this.injector = null, this.pub = t, this.item = i, this.burl = i.toURL(e) || "", this.cssProperties = n.cssProperties, this.injector = n.injector ?? null;
4194
4196
  }
@@ -4238,7 +4240,7 @@ class Ps {
4238
4240
  return n + o;
4239
4241
  }
4240
4242
  }
4241
- const Es = 1e4;
4243
+ const Cs = 1e4;
4242
4244
  class Nt {
4243
4245
  constructor(t, e) {
4244
4246
  this.registry = /* @__PURE__ */ new Map(), this._ready = !1, this.listenerBuffer = [], this.handler = this.handle.bind(this), this.wnd = t, this.origin = e;
@@ -4249,7 +4251,7 @@ class Nt {
4249
4251
  }
4250
4252
  this.gc = setInterval(() => {
4251
4253
  this.registry.forEach((i, n) => {
4252
- performance.now() - i.time > Es && (console.warn(n, "event for", i.key, "was never handled!"), this.registry.delete(n));
4254
+ performance.now() - i.time > Cs && (console.warn(n, "event for", i.key, "was never handled!"), this.registry.delete(n));
4253
4255
  });
4254
4256
  }, 5e3), window.addEventListener("message", this.handler), this.send("_ping", void 0);
4255
4257
  }
@@ -4305,7 +4307,7 @@ class Nt {
4305
4307
  key: t
4306
4308
  }), this.wnd.postMessage(
4307
4309
  {
4308
- _readium: gt,
4310
+ _readium: mt,
4309
4311
  _channel: this.channelId,
4310
4312
  id: o,
4311
4313
  data: e,
@@ -4318,12 +4320,12 @@ class Nt {
4318
4320
  ), o;
4319
4321
  }
4320
4322
  }
4321
- const Cs = "'Iowan Old Style', Sitka, 'Sitka Text', Palatino, 'Book Antiqua', 'URW Palladio L', P052, serif", _s = {
4322
- oldStyleTf: Cs
4323
- }, Ls = 16, Oi = _s.oldStyleTf;
4323
+ const _s = "'Iowan Old Style', Sitka, 'Sitka Text', Palatino, 'Book Antiqua', 'URW Palladio L', P052, serif", Ls = {
4324
+ oldStyleTf: _s
4325
+ }, xs = 16, Ri = Ls.oldStyleTf;
4324
4326
  class kt {
4325
4327
  constructor(t) {
4326
- this._optimalLineLength = null, this._canvas = document.createElement("canvas"), this._optimalChars = t.optimalChars, this._minChars = t.minChars, this._maxChars = t.maxChars, this._baseFontSize = t.baseFontSize || Ls, this._fontFace = t.fontFace || Oi, this._sample = t.sample || null, this._padding = t.padding ?? 0, this._letterSpacing = t.letterSpacing ? Math.round(t.letterSpacing * this._baseFontSize) : 0, this._wordSpacing = t.wordSpacing ? Math.round(t.wordSpacing * this._baseFontSize) : 0, this._isCJK = t.isCJK || !1, this._getRelative = t.getRelative || !1, this._minDivider = this._minChars && this._minChars < this._optimalChars ? this._optimalChars / this._minChars : this._minChars === null ? null : 1, this._maxMultiplier = this._maxChars && this._maxChars > this._optimalChars ? this._maxChars / this._optimalChars : this._maxChars === null ? null : 1, this._approximatedWordSpaces = kt.approximateWordSpaces(this._optimalChars, this._sample);
4328
+ this._optimalLineLength = null, this._canvas = document.createElement("canvas"), this._optimalChars = t.optimalChars, this._minChars = t.minChars, this._maxChars = t.maxChars, this._baseFontSize = t.baseFontSize || xs, this._fontFace = t.fontFace || Ri, this._sample = t.sample || null, this._padding = t.padding ?? 0, this._letterSpacing = t.letterSpacing ? Math.round(t.letterSpacing * this._baseFontSize) : 0, this._wordSpacing = t.wordSpacing ? Math.round(t.wordSpacing * this._baseFontSize) : 0, this._isCJK = t.isCJK || !1, this._getRelative = t.getRelative || !1, this._minDivider = this._minChars && this._minChars < this._optimalChars ? this._optimalChars / this._minChars : this._minChars === null ? null : 1, this._maxMultiplier = this._maxChars && this._maxChars > this._optimalChars ? this._maxChars / this._optimalChars : this._maxChars === null ? null : 1, this._approximatedWordSpaces = kt.approximateWordSpaces(this._optimalChars, this._sample);
4327
4329
  }
4328
4330
  updateMultipliers() {
4329
4331
  this._minDivider = this._minChars && this._minChars < this._optimalChars ? this._optimalChars / this._minChars : this._minChars === null ? null : 1, this._maxMultiplier = this._maxChars && this._maxChars > this._optimalChars ? this._maxChars / this._optimalChars : this._maxChars === null ? null : 1;
@@ -4332,7 +4334,7 @@ class kt {
4332
4334
  // Not filtering because pretty much everything can
4333
4335
  // trigger a recomputation anyway.
4334
4336
  update(t) {
4335
- t.optimalChars && (this._optimalChars = t.optimalChars), t.minChars !== void 0 && (this._minChars = t.minChars), t.maxChars !== void 0 && (this._maxChars = t.maxChars), t.baseFontSize && (this._baseFontSize = t.baseFontSize), t.fontFace !== void 0 && (this._fontFace = t.fontFace || Oi), t.letterSpacing && (this._letterSpacing = t.letterSpacing), t.wordSpacing && (this._wordSpacing = t.wordSpacing), t.isCJK != null && (this._isCJK = t.isCJK), t.padding !== void 0 && (this._padding = t.padding ?? 0), t.getRelative && (this._getRelative = t.getRelative), t.sample && (this._sample = t.sample, this._approximatedWordSpaces = kt.approximateWordSpaces(this._optimalChars, this._sample)), this.updateMultipliers(), this._optimalLineLength = this.getOptimalLineLength();
4337
+ t.optimalChars && (this._optimalChars = t.optimalChars), t.minChars !== void 0 && (this._minChars = t.minChars), t.maxChars !== void 0 && (this._maxChars = t.maxChars), t.baseFontSize && (this._baseFontSize = t.baseFontSize), t.fontFace !== void 0 && (this._fontFace = t.fontFace || Ri), t.letterSpacing && (this._letterSpacing = t.letterSpacing), t.wordSpacing && (this._wordSpacing = t.wordSpacing), t.isCJK != null && (this._isCJK = t.isCJK), t.padding !== void 0 && (this._padding = t.padding ?? 0), t.getRelative && (this._getRelative = t.getRelative), t.sample && (this._sample = t.sample, this._approximatedWordSpaces = kt.approximateWordSpaces(this._optimalChars, this._sample)), this.updateMultipliers(), this._optimalLineLength = this.getOptimalLineLength();
4336
4338
  }
4337
4339
  get baseFontSize() {
4338
4340
  return this._baseFontSize;
@@ -4429,7 +4431,7 @@ class fn {
4429
4431
  }, []) };
4430
4432
  }
4431
4433
  }
4432
- class xs extends fn {
4434
+ class ks extends fn {
4433
4435
  get iOSRequest() {
4434
4436
  const t = pn(), e = un();
4435
4437
  if (this.OS.iOS && !this.OS.iPadOS)
@@ -4438,7 +4440,7 @@ class xs extends fn {
4438
4440
  return /\(iPad;/.test(e) || t && /^iPad(OS)?$/.test(t.platform) ? "mobile" : "desktop";
4439
4441
  }
4440
4442
  }
4441
- const J = new fn(), T = new xs();
4443
+ const J = new fn(), T = new ks();
4442
4444
  function bt(r) {
4443
4445
  const t = r.languages?.[0]?.toLowerCase(), e = r.readingProgression;
4444
4446
  if (t) {
@@ -4476,7 +4478,7 @@ class $e {
4476
4478
  this.unsubs.forEach((t) => t()), this.unsubs = [], this.conditionValues.clear();
4477
4479
  }
4478
4480
  }
4479
- class ks {
4481
+ class Rs {
4480
4482
  constructor(t, e = {}, i = []) {
4481
4483
  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];
4482
4484
  }
@@ -4598,52 +4600,56 @@ class Os {
4598
4600
  const o = n[s].href;
4599
4601
  this.inprogress.has(o) && await this.inprogress.get(o);
4600
4602
  const a = new Promise(async (l, h) => {
4601
- const c = [], u = [];
4602
- t.readingOrder.items.forEach((d, f) => {
4603
- f !== s && f !== s - 1 && f !== s + 1 && (c.includes(d.href) || c.push(d.href)), f === s && (u.includes(d.href) || u.push(d.href));
4604
- }), c.forEach(async (d) => {
4605
- u.includes(d) || this.pool.has(d) && (await this.pool.get(d)?.destroy(), this.pool.delete(d));
4606
- }), this.currentBaseURL !== void 0 && t.baseURL !== this.currentBaseURL && (this.blobs.forEach((d) => {
4607
- this.injector?.releaseBlobUrl?.(d), URL.revokeObjectURL(d);
4603
+ const c = [], d = [];
4604
+ t.readingOrder.items.forEach((u, p) => {
4605
+ p !== s && p !== s - 1 && p !== s + 1 && (c.includes(u.href) || c.push(u.href)), p === s && (d.includes(u.href) || d.push(u.href));
4606
+ }), c.forEach(async (u) => {
4607
+ d.includes(u) || this.pool.has(u) && (await this.pool.get(u)?.destroy(), this.pool.delete(u));
4608
+ }), this.currentBaseURL !== void 0 && t.baseURL !== this.currentBaseURL && (this.blobs.forEach((u) => {
4609
+ this.injector?.releaseBlobUrl?.(u), URL.revokeObjectURL(u);
4608
4610
  }), this.blobs.clear()), this.currentBaseURL = t.baseURL;
4609
- const p = async (d) => {
4610
- if (this.pendingUpdates.has(d) && this.pendingUpdates.get(d)?.inPool === !1) {
4611
- const P = this.blobs.get(d);
4612
- P && (this.injector?.releaseBlobUrl?.(P), URL.revokeObjectURL(P), this.blobs.delete(d), this.pendingUpdates.delete(d));
4611
+ const f = async (u) => {
4612
+ if (this.pendingUpdates.has(u) && this.pendingUpdates.get(u)?.inPool === !1) {
4613
+ const v = this.blobs.get(u);
4614
+ v && (this.injector?.releaseBlobUrl?.(v), URL.revokeObjectURL(v), this.blobs.delete(u), this.pendingUpdates.delete(u));
4613
4615
  }
4614
- if (this.pool.has(d)) {
4615
- const P = this.pool.get(d);
4616
- if (!this.blobs.has(d))
4617
- await P.destroy(), this.pool.delete(d), this.pendingUpdates.delete(d);
4616
+ if (this.pool.has(u)) {
4617
+ const v = this.pool.get(u);
4618
+ if (!this.blobs.has(u))
4619
+ await v.destroy(), this.pool.delete(u), this.pendingUpdates.delete(u);
4618
4620
  else {
4619
- await P.load(i);
4621
+ await v.load(i);
4620
4622
  return;
4621
4623
  }
4622
4624
  }
4623
- const f = t.readingOrder.findWithHref(d);
4624
- if (!f) return;
4625
- if (!this.blobs.has(d)) {
4626
- const R = await new Ps(
4625
+ const p = t.readingOrder.findWithHref(u);
4626
+ if (!p) return;
4627
+ if (!this.blobs.has(u)) {
4628
+ const O = await new Es(
4627
4629
  t,
4628
4630
  this.currentBaseURL || "",
4629
- f,
4631
+ p,
4630
4632
  {
4631
4633
  cssProperties: this.currentCssProperties,
4632
4634
  injector: this.injector
4633
4635
  }
4634
4636
  ).build();
4635
- this.blobs.set(d, R);
4637
+ this.blobs.set(u, O);
4636
4638
  }
4637
- const w = new ks(this.blobs.get(d), this.contentProtectionConfig, this.keyboardPeripheralsConfig);
4638
- d !== o && await w.hide(), this.container.appendChild(w.iframe), await w.load(i), this.pool.set(d, w);
4639
+ const b = new Rs(this.blobs.get(u), this.contentProtectionConfig, this.keyboardPeripheralsConfig);
4640
+ u !== o && await b.hide(), this.container.appendChild(b.iframe), await b.load(i), this.pool.set(u, b);
4639
4641
  };
4640
4642
  try {
4641
- await Promise.all(u.map((d) => p(d)));
4642
- } catch (d) {
4643
- h(d);
4643
+ await Promise.all(d.map((u) => f(u)));
4644
+ } catch (u) {
4645
+ h(u);
4646
+ }
4647
+ const g = this.pool.get(o);
4648
+ if (g?.source !== this._currentFrame?.source && (await this._currentFrame?.hide(), g && await g.load(i), g && await g.show(e.locations.progression), this._currentFrame = g, g)) {
4649
+ const u = this.container.ownerDocument.activeElement;
4650
+ u && u.tagName === "IFRAME" && u !== g.iframe && g.iframe.focus({ preventScroll: !0 });
4644
4651
  }
4645
- const m = this.pool.get(o);
4646
- m?.source !== this._currentFrame?.source && (await this._currentFrame?.hide(), m && await m.load(i), m && await m.show(e.locations.progression), this._currentFrame = m), l();
4652
+ l();
4647
4653
  });
4648
4654
  this.inprogress.set(o, a), await a, this.inprogress.delete(o);
4649
4655
  }
@@ -4688,41 +4694,41 @@ class Os {
4688
4694
  }), t;
4689
4695
  }
4690
4696
  }
4691
- var ge, Ri;
4692
- function Rs() {
4693
- if (Ri) return ge;
4694
- Ri = 1;
4697
+ var me, Oi;
4698
+ function As() {
4699
+ if (Oi) return me;
4700
+ Oi = 1;
4695
4701
  function r(n) {
4696
4702
  if (typeof n != "string")
4697
4703
  throw new TypeError("Path must be a string. Received " + JSON.stringify(n));
4698
4704
  }
4699
4705
  function t(n, s) {
4700
- for (var o = "", a = 0, l = -1, h = 0, c, u = 0; u <= n.length; ++u) {
4701
- if (u < n.length)
4702
- c = n.charCodeAt(u);
4706
+ for (var o = "", a = 0, l = -1, h = 0, c, d = 0; d <= n.length; ++d) {
4707
+ if (d < n.length)
4708
+ c = n.charCodeAt(d);
4703
4709
  else {
4704
4710
  if (c === 47)
4705
4711
  break;
4706
4712
  c = 47;
4707
4713
  }
4708
4714
  if (c === 47) {
4709
- if (!(l === u - 1 || h === 1)) if (l !== u - 1 && h === 2) {
4715
+ if (!(l === d - 1 || h === 1)) if (l !== d - 1 && h === 2) {
4710
4716
  if (o.length < 2 || a !== 2 || o.charCodeAt(o.length - 1) !== 46 || o.charCodeAt(o.length - 2) !== 46) {
4711
4717
  if (o.length > 2) {
4712
- var p = o.lastIndexOf("/");
4713
- if (p !== o.length - 1) {
4714
- p === -1 ? (o = "", a = 0) : (o = o.slice(0, p), a = o.length - 1 - o.lastIndexOf("/")), l = u, h = 0;
4718
+ var f = o.lastIndexOf("/");
4719
+ if (f !== o.length - 1) {
4720
+ f === -1 ? (o = "", a = 0) : (o = o.slice(0, f), a = o.length - 1 - o.lastIndexOf("/")), l = d, h = 0;
4715
4721
  continue;
4716
4722
  }
4717
4723
  } else if (o.length === 2 || o.length === 1) {
4718
- o = "", a = 0, l = u, h = 0;
4724
+ o = "", a = 0, l = d, h = 0;
4719
4725
  continue;
4720
4726
  }
4721
4727
  }
4722
4728
  s && (o.length > 0 ? o += "/.." : o = "..", a = 2);
4723
4729
  } else
4724
- o.length > 0 ? o += "/" + n.slice(l + 1, u) : o = n.slice(l + 1, u), a = u - l - 1;
4725
- l = u, h = 0;
4730
+ o.length > 0 ? o += "/" + n.slice(l + 1, d) : o = n.slice(l + 1, d), a = d - l - 1;
4731
+ l = d, h = 0;
4726
4732
  } else c === 46 && h !== -1 ? ++h : h = -1;
4727
4733
  }
4728
4734
  return o;
@@ -4763,25 +4769,25 @@ function Rs() {
4763
4769
  ;
4764
4770
  for (var l = s.length, h = l - a, c = 1; c < o.length && o.charCodeAt(c) === 47; ++c)
4765
4771
  ;
4766
- for (var u = o.length, p = u - c, m = h < p ? h : p, d = -1, f = 0; f <= m; ++f) {
4767
- if (f === m) {
4768
- if (p > m) {
4769
- if (o.charCodeAt(c + f) === 47)
4770
- return o.slice(c + f + 1);
4771
- if (f === 0)
4772
- return o.slice(c + f);
4773
- } else h > m && (s.charCodeAt(a + f) === 47 ? d = f : f === 0 && (d = 0));
4772
+ for (var d = o.length, f = d - c, g = h < f ? h : f, u = -1, p = 0; p <= g; ++p) {
4773
+ if (p === g) {
4774
+ if (f > g) {
4775
+ if (o.charCodeAt(c + p) === 47)
4776
+ return o.slice(c + p + 1);
4777
+ if (p === 0)
4778
+ return o.slice(c + p);
4779
+ } else h > g && (s.charCodeAt(a + p) === 47 ? u = p : p === 0 && (u = 0));
4774
4780
  break;
4775
4781
  }
4776
- var w = s.charCodeAt(a + f), P = o.charCodeAt(c + f);
4777
- if (w !== P)
4782
+ var b = s.charCodeAt(a + p), v = o.charCodeAt(c + p);
4783
+ if (b !== v)
4778
4784
  break;
4779
- w === 47 && (d = f);
4785
+ b === 47 && (u = p);
4780
4786
  }
4781
- var R = "";
4782
- for (f = a + d + 1; f <= l; ++f)
4783
- (f === l || s.charCodeAt(f) === 47) && (R.length === 0 ? R += ".." : R += "/..");
4784
- return R.length > 0 ? R + o.slice(c + d) : (c += d, o.charCodeAt(c) === 47 && ++c, o.slice(c));
4787
+ var O = "";
4788
+ for (p = a + u + 1; p <= l; ++p)
4789
+ (p === l || s.charCodeAt(p) === 47) && (O.length === 0 ? O += ".." : O += "/..");
4790
+ return O.length > 0 ? O + o.slice(c + u) : (c += u, o.charCodeAt(c) === 47 && ++c, o.slice(c));
4785
4791
  },
4786
4792
  _makeLong: function(s) {
4787
4793
  return s;
@@ -4804,18 +4810,18 @@ function Rs() {
4804
4810
  var a = 0, l = -1, h = !0, c;
4805
4811
  if (o !== void 0 && o.length > 0 && o.length <= s.length) {
4806
4812
  if (o.length === s.length && o === s) return "";
4807
- var u = o.length - 1, p = -1;
4813
+ var d = o.length - 1, f = -1;
4808
4814
  for (c = s.length - 1; c >= 0; --c) {
4809
- var m = s.charCodeAt(c);
4810
- if (m === 47) {
4815
+ var g = s.charCodeAt(c);
4816
+ if (g === 47) {
4811
4817
  if (!h) {
4812
4818
  a = c + 1;
4813
4819
  break;
4814
4820
  }
4815
4821
  } else
4816
- p === -1 && (h = !1, p = c + 1), u >= 0 && (m === o.charCodeAt(u) ? --u === -1 && (l = c) : (u = -1, l = p));
4822
+ f === -1 && (h = !1, f = c + 1), d >= 0 && (g === o.charCodeAt(d) ? --d === -1 && (l = c) : (d = -1, l = f));
4817
4823
  }
4818
- return a === l ? l = p : l === -1 && (l = s.length), s.slice(a, l);
4824
+ return a === l ? l = f : l === -1 && (l = s.length), s.slice(a, l);
4819
4825
  } else {
4820
4826
  for (c = s.length - 1; c >= 0; --c)
4821
4827
  if (s.charCodeAt(c) === 47) {
@@ -4829,16 +4835,16 @@ function Rs() {
4829
4835
  },
4830
4836
  extname: function(s) {
4831
4837
  r(s);
4832
- for (var o = -1, a = 0, l = -1, h = !0, c = 0, u = s.length - 1; u >= 0; --u) {
4833
- var p = s.charCodeAt(u);
4834
- if (p === 47) {
4838
+ for (var o = -1, a = 0, l = -1, h = !0, c = 0, d = s.length - 1; d >= 0; --d) {
4839
+ var f = s.charCodeAt(d);
4840
+ if (f === 47) {
4835
4841
  if (!h) {
4836
- a = u + 1;
4842
+ a = d + 1;
4837
4843
  break;
4838
4844
  }
4839
4845
  continue;
4840
4846
  }
4841
- l === -1 && (h = !1, l = u + 1), p === 46 ? o === -1 ? o = u : c !== 1 && (c = 1) : o !== -1 && (c = -1);
4847
+ l === -1 && (h = !1, l = d + 1), f === 46 ? o === -1 ? o = d : c !== 1 && (c = 1) : o !== -1 && (c = -1);
4842
4848
  }
4843
4849
  return o === -1 || l === -1 || // We saw a non-dot character immediately before the dot
4844
4850
  c === 0 || // The (right-most) trimmed path component is exactly '..'
@@ -4855,66 +4861,66 @@ function Rs() {
4855
4861
  if (s.length === 0) return o;
4856
4862
  var a = s.charCodeAt(0), l = a === 47, h;
4857
4863
  l ? (o.root = "/", h = 1) : h = 0;
4858
- for (var c = -1, u = 0, p = -1, m = !0, d = s.length - 1, f = 0; d >= h; --d) {
4859
- if (a = s.charCodeAt(d), a === 47) {
4860
- if (!m) {
4861
- u = d + 1;
4864
+ for (var c = -1, d = 0, f = -1, g = !0, u = s.length - 1, p = 0; u >= h; --u) {
4865
+ if (a = s.charCodeAt(u), a === 47) {
4866
+ if (!g) {
4867
+ d = u + 1;
4862
4868
  break;
4863
4869
  }
4864
4870
  continue;
4865
4871
  }
4866
- p === -1 && (m = !1, p = d + 1), a === 46 ? c === -1 ? c = d : f !== 1 && (f = 1) : c !== -1 && (f = -1);
4872
+ f === -1 && (g = !1, f = u + 1), a === 46 ? c === -1 ? c = u : p !== 1 && (p = 1) : c !== -1 && (p = -1);
4867
4873
  }
4868
- return c === -1 || p === -1 || // We saw a non-dot character immediately before the dot
4869
- f === 0 || // The (right-most) trimmed path component is exactly '..'
4870
- f === 1 && c === p - 1 && c === u + 1 ? p !== -1 && (u === 0 && l ? o.base = o.name = s.slice(1, p) : o.base = o.name = s.slice(u, p)) : (u === 0 && l ? (o.name = s.slice(1, c), o.base = s.slice(1, p)) : (o.name = s.slice(u, c), o.base = s.slice(u, p)), o.ext = s.slice(c, p)), u > 0 ? o.dir = s.slice(0, u - 1) : l && (o.dir = "/"), o;
4874
+ return c === -1 || f === -1 || // We saw a non-dot character immediately before the dot
4875
+ p === 0 || // The (right-most) trimmed path component is exactly '..'
4876
+ p === 1 && c === f - 1 && c === d + 1 ? f !== -1 && (d === 0 && l ? o.base = o.name = s.slice(1, f) : o.base = o.name = s.slice(d, f)) : (d === 0 && l ? (o.name = s.slice(1, c), o.base = s.slice(1, f)) : (o.name = s.slice(d, c), o.base = s.slice(d, f)), o.ext = s.slice(c, f)), d > 0 ? o.dir = s.slice(0, d - 1) : l && (o.dir = "/"), o;
4871
4877
  },
4872
4878
  sep: "/",
4873
4879
  delimiter: ":",
4874
4880
  win32: null,
4875
4881
  posix: null
4876
4882
  };
4877
- return i.posix = i, ge = i, ge;
4878
- }
4879
- var Xt = Rs();
4880
- const As = { description: "Attempts to filter out paragraphs that are implicitly headings or part of headers", scope: "RS", value: "readium-experimentalHeaderFiltering-on" }, Ts = { description: "Attempts to filter out elements that are sized using viewport units and should not be scaled directly e.g. tables, images, iframes, etc.", scope: "RS", value: "readium-experimentalZoom-on" }, Ns = {
4881
- experimentalHeaderFiltering: As,
4882
- experimentalZoom: Ts
4883
- }, Ms = { disabled: [], added: [] }, Fs = { disabled: ["bodyHyphens", "a11yNormalize", "letterSpacing"], added: [] }, Is = {
4884
- ltr: Ms,
4885
- rtl: Fs,
4883
+ return i.posix = i, me = i, me;
4884
+ }
4885
+ var Xt = As();
4886
+ const Ts = { description: "Attempts to filter out paragraphs that are implicitly headings or part of headers", scope: "RS", value: "readium-experimentalHeaderFiltering-on" }, Ns = { description: "Attempts to filter out elements that are sized using viewport units and should not be scaled directly e.g. tables, images, iframes, etc.", scope: "RS", value: "readium-experimentalZoom-on" }, Ms = {
4887
+ experimentalHeaderFiltering: Ts,
4888
+ experimentalZoom: Ns
4889
+ }, Fs = { disabled: [], added: [] }, Is = { disabled: ["bodyHyphens", "a11yNormalize", "letterSpacing"], added: [] }, zs = {
4890
+ ltr: Fs,
4891
+ rtl: Is,
4886
4892
  "cjk-horizontal": { disabled: ["textAlign", "bodyHyphens", "a11yNormalize", "ligatures", "paraIndent", "wordSpacing"], added: ["noRuby"] },
4887
4893
  "cjk-vertical": { disabled: ["colCount", "textAlign", "bodyHyphens", "a11yNormalize", "ligatures", "paraIndent", "wordSpacing"], added: ["noRuby"] }
4888
- }, zs = { baseFontFamily: "var(--RS__oldStyleTf)", lineHeightCompensation: 1 }, Ds = { baseFontFamily: "Kefa, Nyala, Roboto, Noto, 'Noto Sans Ethiopic', serif", lineHeightCompensation: 1.167 }, Ws = { baseFontFamily: "'Geeza Pro', 'Arabic Typesetting', Roboto, Noto, 'Noto Naskh Arabic', 'Times New Roman', serif" }, Us = { baseFontFamily: "'Kohinoor Bangla', 'Bangla Sangam MN', Vrinda, Roboto, Noto, 'Noto Sans Bengali', sans-serif", lineHeightCompensation: 1.067 }, Hs = { baseFontFamily: "Kailasa, 'Microsoft Himalaya', Roboto, Noto, 'Noto Sans Tibetan', sans-serif" }, Bs = { baseFontFamily: "'Plantagenet Cherokee', Roboto, Noto, 'Noto Sans Cherokee'", lineHeightCompensation: 1.167 }, Vs = { baseFontFamily: "'Geeza Pro', 'Arabic Typesetting', Roboto, Noto, 'Noto Naskh Arabic', 'Times New Roman', serif" }, js = { baseFontFamily: "'Gujarati Sangam MN', 'Nirmala UI', Shruti, Roboto, Noto, 'Noto Sans Gujarati', sans-serif", lineHeightCompensation: 1.167 }, $s = { baseFontFamily: "'New Peninim MT', 'Arial Hebrew', Gisha, 'Times New Roman', Roboto, Noto, 'Noto Sans Hebrew', sans-serif", lineHeightCompensation: 1.1 }, Gs = { baseFontFamily: "'Kohinoor Devanagari', 'Devanagari Sangam MN', Kokila, 'Nirmala UI', Roboto, Noto, 'Noto Sans Devanagari', sans-serif", lineHeightCompensation: 1.1 }, Xs = { baseFontFamily: "Mshtakan, Sylfaen, Roboto, Noto, 'Noto Serif Armenian', serif" }, Ys = { baseFontFamily: "'Euphemia UCAS', Euphemia, Roboto, Noto, 'Noto Sans Canadian Aboriginal', sans-serif" }, qs = { baseFontFamily: "YuGothic, 'Hiragino Maru Gothic ProN', 'Hiragino Sans', 'Yu Gothic UI', 'Meiryo UI', 'MS Gothic', Roboto, Noto, 'Noto Sans CJK JP', sans-serif", lineHeightCompensation: 1.167 }, Ks = { baseFontFamily: "'Khmer Sangam MN', 'Leelawadee UI', 'Khmer UI', Roboto, Noto, 'Noto Sans Khmer', sans-serif", lineHeightCompensation: 1.067 }, Js = { baseFontFamily: "'Kannada Sangam MN', 'Nirmala UI', Tunga, Roboto, Noto, 'Noto Sans Kannada', sans-serif", lineHeightCompensation: 1.1 }, Zs = { baseFontFamily: "'Nanum Gothic', 'Apple SD Gothic Neo', 'Malgun Gothic', Roboto, Noto, 'Noto Sans CJK KR', sans-serif", lineHeightCompensation: 1.167 }, Qs = { baseFontFamily: "'Lao Sangam MN', 'Leelawadee UI', 'Lao UI', Roboto, Noto, 'Noto Sans Lao', sans-serif" }, tr = { baseFontFamily: "'Malayalam Sangam MN', 'Nirmala UI', Kartika, Roboto, Noto, 'Noto Sans Malayalam', sans-serif", lineHeightCompensation: 1.067 }, er = { baseFontFamily: "'Oriya Sangam MN', 'Nirmala UI', Kalinga, Roboto, Noto, 'Noto Sans Oriya', sans-serif", lineHeightCompensation: 1.167 }, ir = { baseFontFamily: "'Gurmukhi MN', 'Nirmala UI', Kartika, Roboto, Noto, 'Noto Sans Gurmukhi', sans-serif", lineHeightCompensation: 1.1 }, nr = { baseFontFamily: "'Sinhala Sangam MN', 'Nirmala UI', 'Iskoola Pota', Roboto, Noto, 'Noto Sans Sinhala', sans-serif", lineHeightCompensation: 1.167 }, sr = { baseFontFamily: "'Tamil Sangam MN', 'Nirmala UI', Latha, Roboto, Noto, 'Noto Sans Tamil', sans-serif", lineHeightCompensation: 1.067 }, rr = { baseFontFamily: "'Kohinoor Telugu', 'Telugu Sangam MN', 'Nirmala UI', Gautami, Roboto, Noto, 'Noto Sans Telugu', sans-serif" }, or = { baseFontFamily: "Thonburi, 'Leelawadee UI', 'Cordia New', Roboto, Noto, 'Noto Sans Thai', sans-serif", lineHeightCompensation: 1.067 }, ar = { baseFontFamily: "'方体', 'PingFang SC', '黑体', 'Heiti SC', 'Microsoft JhengHei UI', 'Microsoft JhengHei', Roboto, Noto, 'Noto Sans CJK SC', sans-serif", lineHeightCompensation: 1.167 }, lr = {
4889
- latin: zs,
4890
- am: Ds,
4891
- ar: Ws,
4892
- bn: Us,
4893
- bo: Hs,
4894
- chr: Bs,
4895
- fa: Vs,
4896
- gu: js,
4897
- he: $s,
4898
- hi: Gs,
4899
- hy: Xs,
4900
- iu: Ys,
4901
- ja: qs,
4902
- km: Ks,
4903
- kn: Js,
4904
- ko: Zs,
4905
- lo: Qs,
4906
- ml: tr,
4907
- or: er,
4908
- pa: ir,
4909
- si: nr,
4910
- ta: sr,
4911
- te: rr,
4912
- th: or,
4913
- zh: ar,
4894
+ }, Ds = { baseFontFamily: "var(--RS__oldStyleTf)", lineHeightCompensation: 1 }, Ws = { baseFontFamily: "Kefa, Nyala, Roboto, Noto, 'Noto Sans Ethiopic', serif", lineHeightCompensation: 1.167 }, Us = { baseFontFamily: "'Geeza Pro', 'Arabic Typesetting', Roboto, Noto, 'Noto Naskh Arabic', 'Times New Roman', serif" }, Hs = { baseFontFamily: "'Kohinoor Bangla', 'Bangla Sangam MN', Vrinda, Roboto, Noto, 'Noto Sans Bengali', sans-serif", lineHeightCompensation: 1.067 }, Bs = { baseFontFamily: "Kailasa, 'Microsoft Himalaya', Roboto, Noto, 'Noto Sans Tibetan', sans-serif" }, Vs = { baseFontFamily: "'Plantagenet Cherokee', Roboto, Noto, 'Noto Sans Cherokee'", lineHeightCompensation: 1.167 }, js = { baseFontFamily: "'Geeza Pro', 'Arabic Typesetting', Roboto, Noto, 'Noto Naskh Arabic', 'Times New Roman', serif" }, $s = { baseFontFamily: "'Gujarati Sangam MN', 'Nirmala UI', Shruti, Roboto, Noto, 'Noto Sans Gujarati', sans-serif", lineHeightCompensation: 1.167 }, Gs = { baseFontFamily: "'New Peninim MT', 'Arial Hebrew', Gisha, 'Times New Roman', Roboto, Noto, 'Noto Sans Hebrew', sans-serif", lineHeightCompensation: 1.1 }, Xs = { baseFontFamily: "'Kohinoor Devanagari', 'Devanagari Sangam MN', Kokila, 'Nirmala UI', Roboto, Noto, 'Noto Sans Devanagari', sans-serif", lineHeightCompensation: 1.1 }, Ys = { baseFontFamily: "Mshtakan, Sylfaen, Roboto, Noto, 'Noto Serif Armenian', serif" }, qs = { baseFontFamily: "'Euphemia UCAS', Euphemia, Roboto, Noto, 'Noto Sans Canadian Aboriginal', sans-serif" }, Ks = { baseFontFamily: "YuGothic, 'Hiragino Maru Gothic ProN', 'Hiragino Sans', 'Yu Gothic UI', 'Meiryo UI', 'MS Gothic', Roboto, Noto, 'Noto Sans CJK JP', sans-serif", lineHeightCompensation: 1.167 }, Js = { baseFontFamily: "'Khmer Sangam MN', 'Leelawadee UI', 'Khmer UI', Roboto, Noto, 'Noto Sans Khmer', sans-serif", lineHeightCompensation: 1.067 }, Zs = { baseFontFamily: "'Kannada Sangam MN', 'Nirmala UI', Tunga, Roboto, Noto, 'Noto Sans Kannada', sans-serif", lineHeightCompensation: 1.1 }, Qs = { baseFontFamily: "'Nanum Gothic', 'Apple SD Gothic Neo', 'Malgun Gothic', Roboto, Noto, 'Noto Sans CJK KR', sans-serif", lineHeightCompensation: 1.167 }, tr = { baseFontFamily: "'Lao Sangam MN', 'Leelawadee UI', 'Lao UI', Roboto, Noto, 'Noto Sans Lao', sans-serif" }, er = { baseFontFamily: "'Malayalam Sangam MN', 'Nirmala UI', Kartika, Roboto, Noto, 'Noto Sans Malayalam', sans-serif", lineHeightCompensation: 1.067 }, ir = { baseFontFamily: "'Oriya Sangam MN', 'Nirmala UI', Kalinga, Roboto, Noto, 'Noto Sans Oriya', sans-serif", lineHeightCompensation: 1.167 }, nr = { baseFontFamily: "'Gurmukhi MN', 'Nirmala UI', Kartika, Roboto, Noto, 'Noto Sans Gurmukhi', sans-serif", lineHeightCompensation: 1.1 }, sr = { baseFontFamily: "'Sinhala Sangam MN', 'Nirmala UI', 'Iskoola Pota', Roboto, Noto, 'Noto Sans Sinhala', sans-serif", lineHeightCompensation: 1.167 }, rr = { baseFontFamily: "'Tamil Sangam MN', 'Nirmala UI', Latha, Roboto, Noto, 'Noto Sans Tamil', sans-serif", lineHeightCompensation: 1.067 }, or = { baseFontFamily: "'Kohinoor Telugu', 'Telugu Sangam MN', 'Nirmala UI', Gautami, Roboto, Noto, 'Noto Sans Telugu', sans-serif" }, ar = { baseFontFamily: "Thonburi, 'Leelawadee UI', 'Cordia New', Roboto, Noto, 'Noto Sans Thai', sans-serif", lineHeightCompensation: 1.067 }, lr = { baseFontFamily: "'方体', 'PingFang SC', '黑体', 'Heiti SC', 'Microsoft JhengHei UI', 'Microsoft JhengHei', Roboto, Noto, 'Noto Sans CJK SC', sans-serif", lineHeightCompensation: 1.167 }, hr = {
4895
+ latin: Ds,
4896
+ am: Ws,
4897
+ ar: Us,
4898
+ bn: Hs,
4899
+ bo: Bs,
4900
+ chr: Vs,
4901
+ fa: js,
4902
+ gu: $s,
4903
+ he: Gs,
4904
+ hi: Xs,
4905
+ hy: Ys,
4906
+ iu: qs,
4907
+ ja: Ks,
4908
+ km: Js,
4909
+ kn: Zs,
4910
+ ko: Qs,
4911
+ lo: tr,
4912
+ ml: er,
4913
+ or: ir,
4914
+ pa: nr,
4915
+ si: sr,
4916
+ ta: rr,
4917
+ te: or,
4918
+ th: ar,
4919
+ zh: lr,
4914
4920
  "zh-Hant": { baseFontFamily: "'方體', 'PingFang TC', '黑體', 'Heiti TC', 'Microsoft JhengHei UI', 'Microsoft JhengHei', Roboto, Noto, 'Noto Sans CJK TC', sans-serif", lineHeightCompensation: 1.167 },
4915
4921
  "zh-TW": { baseFontFamily: "'方體', 'PingFang TC', '黑體', 'Heiti TC', 'Microsoft JhengHei UI', 'Microsoft JhengHei', Roboto, Noto, 'Noto Sans CJK TC', sans-serif", lineHeightCompensation: 1.167 },
4916
4922
  "zh-HK": { baseFontFamily: "'方體', 'PingFang HK', '方體', 'PingFang TC', '黑體', 'Heiti TC', 'Microsoft JhengHei UI', 'Microsoft JhengHei', Roboto, Noto, 'Noto Sans CJK TC', sans-serif", lineHeightCompensation: 1.167 }
4917
- }, Ge = Ns, fo = Is, go = lr;
4923
+ }, Ge = Ms, mo = zs, go = hr;
4918
4924
  var tt = /* @__PURE__ */ ((r) => (r.start = "start", r.left = "left", r.right = "right", r.justify = "justify", r))(tt || {});
4919
4925
  const ut = {
4920
4926
  range: [0, 100],
@@ -4986,7 +4992,7 @@ class le {
4986
4992
  return `${t}rem`;
4987
4993
  }
4988
4994
  }
4989
- class gn extends le {
4995
+ class mn extends le {
4990
4996
  constructor(t) {
4991
4997
  super(), this.a11yNormalize = t.a11yNormalize ?? null, this.bodyHyphens = t.bodyHyphens ?? null, this.fontFamily = t.fontFamily ?? null, this.fontWeight = t.fontWeight ?? null, this.iOSPatch = t.iOSPatch ?? null, this.iPadOSPatch = t.iPadOSPatch ?? null, this.letterSpacing = t.letterSpacing ?? null, this.ligatures = t.ligatures ?? null, this.lineHeight = t.lineHeight ?? null, this.noRuby = t.noRuby ?? null, this.paraIndent = t.paraIndent ?? null, this.paraSpacing = t.paraSpacing ?? null, this.textAlign = t.textAlign ?? null, this.wordSpacing = t.wordSpacing ?? null, this.zoom = t.zoom ?? null;
4992
4998
  }
@@ -4995,7 +5001,7 @@ class gn extends le {
4995
5001
  return this.a11yNormalize && (t["--USER__a11yNormalize"] = this.toFlag("a11y")), this.bodyHyphens && (t["--USER__bodyHyphens"] = this.bodyHyphens), this.fontFamily && (t["--USER__fontFamily"] = this.fontFamily), this.fontWeight != null && (t["--USER__fontWeight"] = this.toUnitless(this.fontWeight)), this.iOSPatch && (t["--USER__iOSPatch"] = this.toFlag("iOSPatch")), this.iPadOSPatch && (t["--USER__iPadOSPatch"] = this.toFlag("iPadOSPatch")), this.letterSpacing != null && (t["--USER__letterSpacing"] = this.toRem(this.letterSpacing)), this.ligatures && (t["--USER__ligatures"] = this.ligatures), this.lineHeight != null && (t["--USER__lineHeight"] = this.toUnitless(this.lineHeight)), this.noRuby && (t["--USER__noRuby"] = this.toFlag("noRuby")), this.paraIndent != null && (t["--USER__paraIndent"] = this.toRem(this.paraIndent)), this.paraSpacing != null && (t["--USER__paraSpacing"] = this.toRem(this.paraSpacing)), this.textAlign && (t["--USER__textAlign"] = this.textAlign), this.wordSpacing != null && (t["--USER__wordSpacing"] = this.toRem(this.wordSpacing)), this.zoom !== null && (t["--USER__zoom"] = this.toPercentage(this.zoom, !0)), t;
4996
5002
  }
4997
5003
  }
4998
- class hr extends le {
5004
+ class cr extends le {
4999
5005
  constructor(t) {
5000
5006
  super(), this.experiments = t.experiments ?? null;
5001
5007
  }
@@ -5006,7 +5012,7 @@ class hr extends le {
5006
5012
  }), t;
5007
5013
  }
5008
5014
  }
5009
- class cr {
5015
+ class dr {
5010
5016
  constructor(t) {
5011
5017
  this.rsProperties = t.rsProperties, this.userProperties = t.userProperties;
5012
5018
  }
@@ -5029,13 +5035,13 @@ class cr {
5029
5035
  wordSpacing: t.wordSpacing,
5030
5036
  zoom: t.zoom
5031
5037
  };
5032
- this.userProperties = new gn(e);
5038
+ this.userProperties = new mn(e);
5033
5039
  }
5034
5040
  }
5035
- function dr(r, t) {
5041
+ function ur(r, t) {
5036
5042
  return r == null || t == null || r <= t ? r : void 0;
5037
5043
  }
5038
- function ur(r, t) {
5044
+ function pr(r, t) {
5039
5045
  return r == null || t == null || r >= t ? r : void 0;
5040
5046
  }
5041
5047
  function W(r) {
@@ -5051,7 +5057,7 @@ function he(r, t) {
5051
5057
  function wt(r) {
5052
5058
  return typeof r == "boolean" || typeof r == "number" && r >= 0 ? r : r === null ? null : void 0;
5053
5059
  }
5054
- function v(r) {
5060
+ function S(r) {
5055
5061
  if (r !== void 0)
5056
5062
  return r === null ? null : r < 0 ? void 0 : r;
5057
5063
  }
@@ -5063,16 +5069,16 @@ function F(r, t) {
5063
5069
  const e = Math.min(...t), i = Math.max(...t);
5064
5070
  return r >= e && r <= i ? r : void 0;
5065
5071
  }
5066
- function me(r, t) {
5072
+ function ge(r, t) {
5067
5073
  return r === void 0 ? t : r;
5068
5074
  }
5069
- function mn(r) {
5075
+ function gn(r) {
5070
5076
  if (r !== void 0)
5071
5077
  return r === null ? null : r.filter((t) => t in Ge);
5072
5078
  }
5073
5079
  class Mt {
5074
5080
  constructor(t = {}) {
5075
- this.fontFamily = W(t.fontFamily), this.fontWeight = F(t.fontWeight, st.range), this.hyphens = E(t.hyphens), this.iOSPatch = E(t.iOSPatch), this.iPadOSPatch = E(t.iPadOSPatch), this.letterSpacing = v(t.letterSpacing), this.ligatures = E(t.ligatures), this.lineHeight = v(t.lineHeight), this.noRuby = E(t.noRuby), this.paragraphIndent = v(t.paragraphIndent), this.paragraphSpacing = v(t.paragraphSpacing), this.textAlign = he(t.textAlign, tt), this.textNormalization = E(t.textNormalization), this.wordSpacing = v(t.wordSpacing), this.zoom = F(t.zoom, ee.range);
5081
+ this.fontFamily = W(t.fontFamily), this.fontWeight = F(t.fontWeight, st.range), this.hyphens = E(t.hyphens), this.iOSPatch = E(t.iOSPatch), this.iPadOSPatch = E(t.iPadOSPatch), this.letterSpacing = S(t.letterSpacing), this.ligatures = E(t.ligatures), this.lineHeight = S(t.lineHeight), this.noRuby = E(t.noRuby), this.paragraphIndent = S(t.paragraphIndent), this.paragraphSpacing = S(t.paragraphSpacing), this.textAlign = he(t.textAlign, tt), this.textNormalization = E(t.textNormalization), this.wordSpacing = S(t.wordSpacing), this.zoom = F(t.zoom, ee.range);
5076
5082
  }
5077
5083
  static serialize(t) {
5078
5084
  const { ...e } = t;
@@ -5093,9 +5099,9 @@ class Mt {
5093
5099
  return new Mt(e);
5094
5100
  }
5095
5101
  }
5096
- class pr {
5102
+ class fr {
5097
5103
  constructor(t) {
5098
- this.fontFamily = W(t.fontFamily) || null, this.fontWeight = F(t.fontWeight, st.range) || null, this.hyphens = E(t.hyphens) ?? null, this.iOSPatch = t.iOSPatch === !1 ? !1 : (T.OS.iOS || T.OS.iPadOS) && T.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : T.OS.iPadOS && T.iOSRequest === "desktop", this.letterSpacing = v(t.letterSpacing) || null, this.ligatures = E(t.ligatures) ?? null, this.lineHeight = v(t.lineHeight) || null, this.noRuby = E(t.noRuby) ?? !1, this.paragraphIndent = v(t.paragraphIndent) ?? null, this.paragraphSpacing = v(t.paragraphSpacing) ?? null, this.textAlign = he(t.textAlign, tt) || null, this.textNormalization = E(t.textNormalization) ?? !1, this.wordSpacing = v(t.wordSpacing) || null, this.zoom = F(t.zoom, ee.range) || 1, this.experiments = mn(t.experiments) ?? null;
5104
+ this.fontFamily = W(t.fontFamily) || null, this.fontWeight = F(t.fontWeight, st.range) || null, this.hyphens = E(t.hyphens) ?? null, this.iOSPatch = t.iOSPatch === !1 ? !1 : (T.OS.iOS || T.OS.iPadOS) && T.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : T.OS.iPadOS && T.iOSRequest === "desktop", this.letterSpacing = S(t.letterSpacing) || null, this.ligatures = E(t.ligatures) ?? null, this.lineHeight = S(t.lineHeight) || null, this.noRuby = E(t.noRuby) ?? !1, this.paragraphIndent = S(t.paragraphIndent) ?? null, this.paragraphSpacing = S(t.paragraphSpacing) ?? null, this.textAlign = he(t.textAlign, tt) || null, this.textNormalization = E(t.textNormalization) ?? !1, this.wordSpacing = S(t.wordSpacing) || null, this.zoom = F(t.zoom, ee.range) || 1, this.experiments = gn(t.experiments) ?? null;
5099
5105
  }
5100
5106
  }
5101
5107
  class Ai {
@@ -5424,7 +5430,7 @@ const bn = (r) => {
5424
5430
  t.attributes && Object.entries(t.attributes).forEach(([e, i]) => {
5425
5431
  e === "type" || e === "rel" || e === "href" || e === "src" || i != null && (typeof i == "boolean" ? i && r.setAttribute(e, "") : r.setAttribute(e, i));
5426
5432
  });
5427
- }, fr = (r, t, e) => {
5433
+ }, mr = (r, t, e) => {
5428
5434
  const i = r.createElement("script");
5429
5435
  i.dataset.readium = "true", t.id && (i.id = t.id);
5430
5436
  const n = t.type || bn(t);
@@ -5521,7 +5527,7 @@ class vn {
5521
5527
  }
5522
5528
  createElement(t, e, i) {
5523
5529
  if (e.as === "script")
5524
- return fr(t, e, i);
5530
+ return mr(t, e, i);
5525
5531
  if (e.as === "link")
5526
5532
  return Ni(t, e, i);
5527
5533
  throw new Error(`Unsupported element type: ${e.as}`);
@@ -5853,7 +5859,7 @@ const vt = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").repl
5853
5859
 
5854
5860
  :root[style*="readium-iPadOSPatch-on"] p:not(:has(b, cite, em, i, q, s, small, span, strong)):first-line{
5855
5861
  -webkit-text-zoom:normal;
5856
- }`, Sn = '!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports._readium_cssSelectorGenerator=e():t._readium_cssSelectorGenerator=e()}(self,(()=>(()=>{"use strict";var t={d:(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return"object"==typeof t&&null!==t&&t.nodeType===Node.ELEMENT_NODE}t.r(e),t.d(e,{_readium_cssSelectorGenerator:()=>Z,default:()=>tt,getCssSelector:()=>X});const o={NONE:"",DESCENDANT:" ",CHILD:" > "},r={id:"id",class:"class",tag:"tag",attribute:"attribute",nthchild:"nthchild",nthoftype:"nthoftype"},i="_readium_cssSelectorGenerator";function c(t="unknown problem",...e){console.warn(`${i}: ${t}`,...e)}const s={selectors:[r.id,r.class,r.tag,r.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY,useScope:!1};function u(t){return t instanceof RegExp}function l(t){return["string","function"].includes(typeof t)||u(t)}function a(t){return Array.isArray(t)?t.filter(l):[]}function f(t){const e=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(t){return t instanceof Node}(t)&&e.includes(t.nodeType)}function d(t,e){if(f(t))return t.contains(e)||c("element root mismatch","Provided root does not contain the element. This will most likely result in producing a fallback selector using element\'s real root node. If you plan to use the selector using provided root (e.g. `root.querySelector`), it will not work as intended."),t;const n=e.getRootNode({composed:!1});return f(n)?(n!==document&&c("shadow root inferred","You did not provide a root and the element is a child of Shadow DOM. This will produce a selector using ShadowRoot as a root. If you plan to use the selector using document as a root (e.g. `document.querySelector`), it will not work as intended."),n):S(e)}function m(t){return"number"==typeof t?t:Number.POSITIVE_INFINITY}function p(t=[]){const[e=[],...n]=t;return 0===n.length?e:n.reduce(((t,e)=>t.filter((t=>e.includes(t)))),e)}function g(t){const e=t.map((t=>{if(u(t))return e=>t.test(e);if("function"==typeof t)return e=>{const n=t(e);return"boolean"!=typeof n?(c("pattern matcher function invalid","Provided pattern matching function does not return boolean. It\'s result will be ignored.",t),!1):n};if("string"==typeof t){const e=new RegExp("^"+t.replace(/[|\\\\{}()[\\]^$+?.]/g,"\\\\$&").replace(/\\*/g,".+")+"$");return t=>e.test(t)}return c("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",t),()=>!1}));return t=>e.some((e=>e(t)))}function h(t,e,n){const o=Array.from(d(n,t[0]).querySelectorAll(e));return o.length===t.length&&t.every((t=>o.includes(t)))}function y(t,e){e=null!=e?e:S(t);const o=[];let r=t;for(;n(r)&&r!==e;)o.push(r),r=r.parentElement;return o}function b(t,e){return p(t.map((t=>y(t,e))))}function S(t){return t.ownerDocument.querySelector(":root")}const N=", ",v=new RegExp(["^$","\\\\s"].join("|")),E=new RegExp(["^$"].join("|")),x=[r.nthoftype,r.tag,r.id,r.class,r.attribute,r.nthchild],w=g(["class","id","ng-*"]);function I({name:t}){return`[${t}]`}function T({name:t,value:e}){return`[${t}=\'${e}\']`}function O({nodeName:t,nodeValue:e}){return{name:F(t),value:F(null!=e?e:void 0)}}function C(t){const e=Array.from(t.attributes).filter((e=>function({nodeName:t,nodeValue:e},n){const o=n.tagName.toLowerCase();return!(["input","option"].includes(o)&&"value"===t||"src"===t&&(null==e?void 0:e.startsWith("data:"))||w(t))}(e,t))).map(O);return[...e.map(I),...e.map(T)]}function j(t){var e;return(null!==(e=t.getAttribute("class"))&&void 0!==e?e:"").trim().split(/\\s+/).filter((t=>!E.test(t))).map((t=>`.${F(t)}`))}function A(t){var e;const n=null!==(e=t.getAttribute("id"))&&void 0!==e?e:"",o=`#${F(n)}`,r=t.getRootNode({composed:!1});return!v.test(n)&&h([t],o,r)?[o]:[]}function R(t){var e;const n=null===(e=t.parentElement)||void 0===e?void 0:e.children;if(n)for(let e=0;e<n.length;e++)if(n[e]===t)return[`:nth-child(${String(e+1)})`];return[]}function $(t){return[F(t.tagName.toLowerCase())]}function D(t){const e=[...new Set((n=t.map($),[].concat(...n)))];var n;return 0===e.length||e.length>1?[]:[e[0]]}function k(t){const e=D([t])[0],n=t.parentElement;if(n){const o=Array.from(n.children).filter((t=>t.tagName.toLowerCase()===e)),r=o.indexOf(t);if(r>-1)return[`${e}:nth-of-type(${String(r+1)})`]}return[]}function*P(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){let n=0,o=L(1);for(;o.length<=t.length&&n<e;){n+=1;const e=o.map((e=>t[e]));yield e,o=_(o,t.length-1)}}function _(t=[],e=0){const n=t.length;if(0===n)return[];const o=[...t];o[n-1]+=1;for(let t=n-1;t>=0;t--)if(o[t]>e){if(0===t)return L(n+1);o[t-1]++,o[t]=o[t-1]+1}return o[n-1]>e?L(n+1):o}function L(t=1){return Array.from(Array(t).keys())}const M=":".charCodeAt(0).toString(16).toUpperCase(),V=/[ !"#$%&\'()\\[\\]{|}<>*+,./;=?@^`~\\\\]/;function F(t=""){return CSS?CSS.escape(t):function(t=""){return t.split("").map((t=>":"===t?`\\\\${M} `:V.test(t)?`\\\\${t}`:escape(t).replace(/%/g,"\\\\"))).join("")}(t)}const Y={tag:D,id:function(t){return 0===t.length||t.length>1?[]:A(t[0])},class:function(t){return p(t.map(j))},attribute:function(t){return p(t.map(C))},nthchild:function(t){return p(t.map(R))},nthoftype:function(t){return p(t.map(k))}},G={tag:$,id:A,class:j,attribute:C,nthchild:R,nthoftype:k};function W(t){return t.includes(r.tag)||t.includes(r.nthoftype)?[...t]:[...t,r.tag]}function*q(t,e){const n={};for(const o of t){const t=e[o];t&&t.length>0&&(n[o]=t)}for(const t of function*(t={}){const e=Object.entries(t);if(0===e.length)return;const n=[{index:e.length-1,partial:{}}];for(;n.length>0;){const t=n.pop();if(!t)break;const{index:o,partial:r}=t;if(o<0){yield r;continue}const[i,c]=e[o];for(let t=c.length-1;t>=0;t--)n.push({index:o-1,partial:Object.assign(Object.assign({},r),{[i]:c[t]})})}}(n))yield B(t)}function B(t={}){const e=[...x];return t[r.tag]&&t[r.nthoftype]&&e.splice(e.indexOf(r.tag),1),e.map((e=>{return(o=t)[n=e]?o[n].join(""):"";var n,o})).join("")}function H(t,e){return[...t.map((t=>e+o.DESCENDANT+t)),...t.map((t=>e+o.CHILD+t))]}function*U(t,e,n="",o){const r=function*(t,e){const n=new Set,o=function(t,e){const{blacklist:n,whitelist:o,combineWithinSelector:r,maxCombinations:i}=e,c=g(n),s=g(o);return function(t){const{selectors:e,includeTag:n}=t,o=[...e];return n&&!o.includes("tag")&&o.push("tag"),o}(e).reduce(((e,n)=>{const o=function(t,e){return(0,Y[e])(t)}(t,n),u=function(t=[],e,n){return t.filter((t=>n(t)||!e(t)))}(o,c,s),l=function(t=[],e){return t.sort(((t,n)=>{const o=e(t),r=e(n);return o&&!r?-1:!o&&r?1:0}))}(u,s);return e[n]=r?Array.from(P(l,{maxResults:i})):l.map((t=>[t])),e}),{})}(t,e);for(const t of function*(t,e){for(const n of function(t){const{selectors:e,combineBetweenSelectors:n,includeTag:o,maxCandidates:r}=t,i=n?function(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){return Array.from(P(t,{maxResults:e}))}(e,{maxResults:r}):e.map((t=>[t]));return o?i.map(W):i}(e))yield*q(n,t)}(o,e))n.has(t)||(n.add(t),yield t)}(t,o);for(const o of function*(t,e){if(""===e)yield*t;else for(const n of t)yield*H([n],e)}(r,n))h(t,o,e)&&(yield o)}function*z(t,e,n="",o){if(0===t.length)return null;const r=[t.length>1?t:[],...b(t,e).map((t=>[t]))];for(const t of r)for(const r of U(t,e,n,o))yield{foundElements:t,selector:r}}function J(t){return{value:t,include:!1}}function K({selectors:t,operator:e}){let n=[...x];t[r.tag]&&t[r.nthoftype]&&(n=n.filter((t=>t!==r.tag)));let o="";return n.forEach((e=>{var n;(null!==(n=t[e])&&void 0!==n?n:[]).forEach((({value:t,include:e})=>{e&&(o+=t)}))})),e+o}function Q(t,e){return t.map((t=>function(t,e){return[e?":scope":":root",...y(t,e).reverse().map((t=>{var e;const n=function(t,e,n=o.NONE){const r={};return e.forEach((e=>{Reflect.set(r,e,function(t,e){return G[e](t)}(t,e).map(J))})),{element:t,operator:n,selectors:r}}(t,[r.nthchild],o.CHILD);return(null!==(e=n.selectors.nthchild)&&void 0!==e?e:[]).forEach((t=>{t.include=!0})),n})).map(K)].join("")}(t,e))).join(N)}function X(t,e={}){return Z(t,Object.assign(Object.assign({},e),{maxResults:1})).next().value}function*Z(t,e={}){var o;const i=function(t){(t instanceof NodeList||t instanceof HTMLCollection)&&(t=Array.from(t));const e=(Array.isArray(t)?t:[t]).filter(n);return[...new Set(e)]}(t),c=function(t,e={}){const n=Object.assign(Object.assign({},s),e);return{selectors:(o=n.selectors,Array.isArray(o)?o.filter((t=>{return e=r,n=t,Object.values(e).includes(n);var e,n})):[]),whitelist:a(n.whitelist),blacklist:a(n.blacklist),root:d(n.root,t),combineWithinSelector:!!n.combineWithinSelector,combineBetweenSelectors:!!n.combineBetweenSelectors,includeTag:!!n.includeTag,maxCombinations:m(n.maxCombinations),maxCandidates:m(n.maxCandidates),useScope:!!n.useScope,maxResults:m(n.maxResults)};var o}(i[0],e),u=null!==(o=c.root)&&void 0!==o?o:S(i[0]);let l=0;for(const t of function*({elements:t,root:e,rootSelector:n="",options:o}){let r=e,i=n,c=!0;for(;c;){let n=!1;for(const c of z(t,r,i,o)){const{foundElements:o,selector:s}=c;if(n=!0,!h(t,s,e)){r=o[0],i=s;break}yield s}n||(c=!1)}}({elements:i,options:c,root:u,rootSelector:""}))if(yield t,l++,l>=c.maxResults)return;i.length>1&&(yield i.map((t=>X(t,c))).join(N),l++,l>=c.maxResults)||(yield Q(i,c.useScope?u:void 0))}const tt=X;return e})()));', mr = `// WebPub-specific setup - no execution blocking needed
5862
+ }`, Sn = '!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports._readium_cssSelectorGenerator=e():t._readium_cssSelectorGenerator=e()}(self,(()=>(()=>{"use strict";var t={d:(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return"object"==typeof t&&null!==t&&t.nodeType===Node.ELEMENT_NODE}t.r(e),t.d(e,{_readium_cssSelectorGenerator:()=>Z,default:()=>tt,getCssSelector:()=>X});const o={NONE:"",DESCENDANT:" ",CHILD:" > "},r={id:"id",class:"class",tag:"tag",attribute:"attribute",nthchild:"nthchild",nthoftype:"nthoftype"},i="_readium_cssSelectorGenerator";function c(t="unknown problem",...e){console.warn(`${i}: ${t}`,...e)}const s={selectors:[r.id,r.class,r.tag,r.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY,useScope:!1};function u(t){return t instanceof RegExp}function l(t){return["string","function"].includes(typeof t)||u(t)}function a(t){return Array.isArray(t)?t.filter(l):[]}function f(t){const e=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(t){return t instanceof Node}(t)&&e.includes(t.nodeType)}function d(t,e){if(f(t))return t.contains(e)||c("element root mismatch","Provided root does not contain the element. This will most likely result in producing a fallback selector using element\'s real root node. If you plan to use the selector using provided root (e.g. `root.querySelector`), it will not work as intended."),t;const n=e.getRootNode({composed:!1});return f(n)?(n!==document&&c("shadow root inferred","You did not provide a root and the element is a child of Shadow DOM. This will produce a selector using ShadowRoot as a root. If you plan to use the selector using document as a root (e.g. `document.querySelector`), it will not work as intended."),n):S(e)}function m(t){return"number"==typeof t?t:Number.POSITIVE_INFINITY}function p(t=[]){const[e=[],...n]=t;return 0===n.length?e:n.reduce(((t,e)=>t.filter((t=>e.includes(t)))),e)}function g(t){const e=t.map((t=>{if(u(t))return e=>t.test(e);if("function"==typeof t)return e=>{const n=t(e);return"boolean"!=typeof n?(c("pattern matcher function invalid","Provided pattern matching function does not return boolean. It\'s result will be ignored.",t),!1):n};if("string"==typeof t){const e=new RegExp("^"+t.replace(/[|\\\\{}()[\\]^$+?.]/g,"\\\\$&").replace(/\\*/g,".+")+"$");return t=>e.test(t)}return c("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",t),()=>!1}));return t=>e.some((e=>e(t)))}function h(t,e,n){const o=Array.from(d(n,t[0]).querySelectorAll(e));return o.length===t.length&&t.every((t=>o.includes(t)))}function y(t,e){e=null!=e?e:S(t);const o=[];let r=t;for(;n(r)&&r!==e;)o.push(r),r=r.parentElement;return o}function b(t,e){return p(t.map((t=>y(t,e))))}function S(t){return t.ownerDocument.querySelector(":root")}const N=", ",v=new RegExp(["^$","\\\\s"].join("|")),E=new RegExp(["^$"].join("|")),x=[r.nthoftype,r.tag,r.id,r.class,r.attribute,r.nthchild],w=g(["class","id","ng-*"]);function I({name:t}){return`[${t}]`}function T({name:t,value:e}){return`[${t}=\'${e}\']`}function O({nodeName:t,nodeValue:e}){return{name:F(t),value:F(null!=e?e:void 0)}}function C(t){const e=Array.from(t.attributes).filter((e=>function({nodeName:t,nodeValue:e},n){const o=n.tagName.toLowerCase();return!(["input","option"].includes(o)&&"value"===t||"src"===t&&(null==e?void 0:e.startsWith("data:"))||w(t))}(e,t))).map(O);return[...e.map(I),...e.map(T)]}function j(t){var e;return(null!==(e=t.getAttribute("class"))&&void 0!==e?e:"").trim().split(/\\s+/).filter((t=>!E.test(t))).map((t=>`.${F(t)}`))}function A(t){var e;const n=null!==(e=t.getAttribute("id"))&&void 0!==e?e:"",o=`#${F(n)}`,r=t.getRootNode({composed:!1});return!v.test(n)&&h([t],o,r)?[o]:[]}function R(t){var e;const n=null===(e=t.parentElement)||void 0===e?void 0:e.children;if(n)for(let e=0;e<n.length;e++)if(n[e]===t)return[`:nth-child(${String(e+1)})`];return[]}function $(t){return[F(t.tagName.toLowerCase())]}function D(t){const e=[...new Set((n=t.map($),[].concat(...n)))];var n;return 0===e.length||e.length>1?[]:[e[0]]}function k(t){const e=D([t])[0],n=t.parentElement;if(n){const o=Array.from(n.children).filter((t=>t.tagName.toLowerCase()===e)),r=o.indexOf(t);if(r>-1)return[`${e}:nth-of-type(${String(r+1)})`]}return[]}function*P(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){let n=0,o=L(1);for(;o.length<=t.length&&n<e;){n+=1;const e=o.map((e=>t[e]));yield e,o=_(o,t.length-1)}}function _(t=[],e=0){const n=t.length;if(0===n)return[];const o=[...t];o[n-1]+=1;for(let t=n-1;t>=0;t--)if(o[t]>e){if(0===t)return L(n+1);o[t-1]++,o[t]=o[t-1]+1}return o[n-1]>e?L(n+1):o}function L(t=1){return Array.from(Array(t).keys())}const M=":".charCodeAt(0).toString(16).toUpperCase(),V=/[ !"#$%&\'()\\[\\]{|}<>*+,./;=?@^`~\\\\]/;function F(t=""){return CSS?CSS.escape(t):function(t=""){return t.split("").map((t=>":"===t?`\\\\${M} `:V.test(t)?`\\\\${t}`:escape(t).replace(/%/g,"\\\\"))).join("")}(t)}const Y={tag:D,id:function(t){return 0===t.length||t.length>1?[]:A(t[0])},class:function(t){return p(t.map(j))},attribute:function(t){return p(t.map(C))},nthchild:function(t){return p(t.map(R))},nthoftype:function(t){return p(t.map(k))}},G={tag:$,id:A,class:j,attribute:C,nthchild:R,nthoftype:k};function W(t){return t.includes(r.tag)||t.includes(r.nthoftype)?[...t]:[...t,r.tag]}function*q(t,e){const n={};for(const o of t){const t=e[o];t&&t.length>0&&(n[o]=t)}for(const t of function*(t={}){const e=Object.entries(t);if(0===e.length)return;const n=[{index:e.length-1,partial:{}}];for(;n.length>0;){const t=n.pop();if(!t)break;const{index:o,partial:r}=t;if(o<0){yield r;continue}const[i,c]=e[o];for(let t=c.length-1;t>=0;t--)n.push({index:o-1,partial:Object.assign(Object.assign({},r),{[i]:c[t]})})}}(n))yield B(t)}function B(t={}){const e=[...x];return t[r.tag]&&t[r.nthoftype]&&e.splice(e.indexOf(r.tag),1),e.map((e=>{return(o=t)[n=e]?o[n].join(""):"";var n,o})).join("")}function H(t,e){return[...t.map((t=>e+o.DESCENDANT+t)),...t.map((t=>e+o.CHILD+t))]}function*U(t,e,n="",o){const r=function*(t,e){const n=new Set,o=function(t,e){const{blacklist:n,whitelist:o,combineWithinSelector:r,maxCombinations:i}=e,c=g(n),s=g(o);return function(t){const{selectors:e,includeTag:n}=t,o=[...e];return n&&!o.includes("tag")&&o.push("tag"),o}(e).reduce(((e,n)=>{const o=function(t,e){return(0,Y[e])(t)}(t,n),u=function(t=[],e,n){return t.filter((t=>n(t)||!e(t)))}(o,c,s),l=function(t=[],e){return t.sort(((t,n)=>{const o=e(t),r=e(n);return o&&!r?-1:!o&&r?1:0}))}(u,s);return e[n]=r?Array.from(P(l,{maxResults:i})):l.map((t=>[t])),e}),{})}(t,e);for(const t of function*(t,e){for(const n of function(t){const{selectors:e,combineBetweenSelectors:n,includeTag:o,maxCandidates:r}=t,i=n?function(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){return Array.from(P(t,{maxResults:e}))}(e,{maxResults:r}):e.map((t=>[t]));return o?i.map(W):i}(e))yield*q(n,t)}(o,e))n.has(t)||(n.add(t),yield t)}(t,o);for(const o of function*(t,e){if(""===e)yield*t;else for(const n of t)yield*H([n],e)}(r,n))h(t,o,e)&&(yield o)}function*z(t,e,n="",o){if(0===t.length)return null;const r=[t.length>1?t:[],...b(t,e).map((t=>[t]))];for(const t of r)for(const r of U(t,e,n,o))yield{foundElements:t,selector:r}}function J(t){return{value:t,include:!1}}function K({selectors:t,operator:e}){let n=[...x];t[r.tag]&&t[r.nthoftype]&&(n=n.filter((t=>t!==r.tag)));let o="";return n.forEach((e=>{var n;(null!==(n=t[e])&&void 0!==n?n:[]).forEach((({value:t,include:e})=>{e&&(o+=t)}))})),e+o}function Q(t,e){return t.map((t=>function(t,e){return[e?":scope":":root",...y(t,e).reverse().map((t=>{var e;const n=function(t,e,n=o.NONE){const r={};return e.forEach((e=>{Reflect.set(r,e,function(t,e){return G[e](t)}(t,e).map(J))})),{element:t,operator:n,selectors:r}}(t,[r.nthchild],o.CHILD);return(null!==(e=n.selectors.nthchild)&&void 0!==e?e:[]).forEach((t=>{t.include=!0})),n})).map(K)].join("")}(t,e))).join(N)}function X(t,e={}){return Z(t,Object.assign(Object.assign({},e),{maxResults:1})).next().value}function*Z(t,e={}){var o;const i=function(t){(t instanceof NodeList||t instanceof HTMLCollection)&&(t=Array.from(t));const e=(Array.isArray(t)?t:[t]).filter(n);return[...new Set(e)]}(t),c=function(t,e={}){const n=Object.assign(Object.assign({},s),e);return{selectors:(o=n.selectors,Array.isArray(o)?o.filter((t=>{return e=r,n=t,Object.values(e).includes(n);var e,n})):[]),whitelist:a(n.whitelist),blacklist:a(n.blacklist),root:d(n.root,t),combineWithinSelector:!!n.combineWithinSelector,combineBetweenSelectors:!!n.combineBetweenSelectors,includeTag:!!n.includeTag,maxCombinations:m(n.maxCombinations),maxCandidates:m(n.maxCandidates),useScope:!!n.useScope,maxResults:m(n.maxResults)};var o}(i[0],e),u=null!==(o=c.root)&&void 0!==o?o:S(i[0]);let l=0;for(const t of function*({elements:t,root:e,rootSelector:n="",options:o}){let r=e,i=n,c=!0;for(;c;){let n=!1;for(const c of z(t,r,i,o)){const{foundElements:o,selector:s}=c;if(n=!0,!h(t,s,e)){r=o[0],i=s;break}yield s}n||(c=!1)}}({elements:i,options:c,root:u,rootSelector:""}))if(yield t,l++,l>=c.maxResults)return;i.length>1&&(yield i.map((t=>X(t,c))).join(N),l++,l>=c.maxResults)||(yield Q(i,c.useScope?u:void 0))}const tt=X;return e})()));', yr = `// WebPub-specific setup - no execution blocking needed
5857
5863
  window._readium_blockedEvents = [];
5858
5864
  window._readium_blockEvents = false; // WebPub doesn't need event blocking
5859
5865
  window._readium_eventBlocker = null;
@@ -5871,7 +5877,7 @@ window._readium_eventBlocker = null;
5871
5877
  });
5872
5878
  })();
5873
5879
  `;
5874
- function yr(r) {
5880
+ function br(r) {
5875
5881
  const t = r.filter((s) => s.mediaType.isHTML).map((s) => s.href), e = t.length > 0 ? t : [/\.html$/, /\.xhtml$/, /\/$/], i = [
5876
5882
  // CSS Selector Generator - always injected
5877
5883
  {
@@ -5885,7 +5891,7 @@ function yr(r) {
5885
5891
  id: "webpub-execution",
5886
5892
  as: "script",
5887
5893
  target: "head",
5888
- blob: new Blob([vt(mr)], { type: "text/javascript" })
5894
+ blob: new Blob([vt(yr)], { type: "text/javascript" })
5889
5895
  }
5890
5896
  ], n = [
5891
5897
  // Onload Proxy - conditional (has executable scripts)
@@ -5913,7 +5919,7 @@ function yr(r) {
5913
5919
  }
5914
5920
  ];
5915
5921
  }
5916
- class br {
5922
+ class wr {
5917
5923
  constructor(t) {
5918
5924
  if (this.detectedTools = /* @__PURE__ */ new Set(), !t.onDetected)
5919
5925
  throw new Error("onDetected callback is required");
@@ -5945,11 +5951,11 @@ class br {
5945
5951
  this.observer?.disconnect(), this.observer = void 0, this.detectedTools.clear();
5946
5952
  }
5947
5953
  }
5948
- let wr = 0;
5949
- function vr() {
5950
- return ++wr;
5954
+ let vr = 0;
5955
+ function Sr() {
5956
+ return ++vr;
5951
5957
  }
5952
- const Sr = `
5958
+ const Pr = `
5953
5959
  onmessage = function(event) {
5954
5960
  var action = event.data;
5955
5961
  var startTime = performance.now()
@@ -5970,7 +5976,7 @@ onmessage = function(event) {
5970
5976
  }, this.log = (...i) => this.send("log", ...i), this.table = (...i) => this.send("table", ...i), this.clear = (...i) => this.send("clear", ...i);
5971
5977
  }
5972
5978
  async send(t, ...e) {
5973
- const i = vr();
5979
+ const i = Sr();
5974
5980
  return new Promise((n, s) => {
5975
5981
  this.callbacks.set(i, n), this.worker.postMessage({
5976
5982
  id: i,
@@ -5985,13 +5991,13 @@ onmessage = function(event) {
5985
5991
  this.worker.terminate(), URL.revokeObjectURL(this.blobUrl);
5986
5992
  }
5987
5993
  };
5988
- Je.workerScript = Sr;
5994
+ Je.workerScript = Pr;
5989
5995
  let se = Je;
5990
5996
  function Xe(r) {
5991
5997
  return typeof window < "u" && console ? console[r] : (...t) => {
5992
5998
  };
5993
5999
  }
5994
- const Pr = Xe("log"), Mi = Xe("table"), Er = Xe("clear");
6000
+ const Er = Xe("log"), Mi = Xe("table"), Cr = Xe("clear");
5995
6001
  async function Fi() {
5996
6002
  if (typeof navigator < "u" && navigator.brave && navigator.brave.isBrave)
5997
6003
  try {
@@ -6004,10 +6010,10 @@ async function Fi() {
6004
6010
  }
6005
6011
  return !1;
6006
6012
  }
6007
- function Cr(r) {
6013
+ function _r(r) {
6008
6014
  return r.excludes.some((t) => t()) ? !1 : r.includes.some((t) => t());
6009
6015
  }
6010
- class _r {
6016
+ class Lr {
6011
6017
  constructor(t = {}) {
6012
6018
  if (this.isOpen = !1, this.checkCount = 0, this.maxChecks = 10, this.maxPrintTime = 0, this.largeObjectArray = null, this.options = {
6013
6019
  onDetected: t.onDetected || (() => {
@@ -6069,14 +6075,14 @@ class _r {
6069
6075
  return (await this.workerConsole.log(t)).time;
6070
6076
  {
6071
6077
  const e = performance.now();
6072
- return Pr(t), performance.now() - e;
6078
+ return Er(t), performance.now() - e;
6073
6079
  }
6074
6080
  }
6075
6081
  /**
6076
6082
  * Check if performance-based detection is enabled for current browser
6077
6083
  */
6078
6084
  isPerformanceDetectionEnabled() {
6079
- return Cr({
6085
+ return _r({
6080
6086
  includes: [
6081
6087
  () => !!J.UA.Chrome,
6082
6088
  () => !!J.UA.Chromium,
@@ -6099,7 +6105,7 @@ class _r {
6099
6105
  if (!this.isPerformanceDetectionEnabled())
6100
6106
  return !1;
6101
6107
  const t = await this.calcTablePrintTime(), e = Math.max(await this.calcLogPrintTime(), await this.calcLogPrintTime());
6102
- return this.maxPrintTime = Math.max(this.maxPrintTime, e), this.workerConsole ? await this.workerConsole.clear() : Er(), t === 0 ? !1 : this.maxPrintTime === 0 ? !!await Fi() : t > this.maxPrintTime * 10;
6108
+ return this.maxPrintTime = Math.max(this.maxPrintTime, e), this.workerConsole ? await this.workerConsole.clear() : Cr(), t === 0 ? !1 : this.maxPrintTime === 0 ? !!await Fi() : t > this.maxPrintTime * 10;
6103
6109
  }
6104
6110
  /**
6105
6111
  * Debugger-based detection (fallback method)
@@ -6154,7 +6160,7 @@ class _r {
6154
6160
  this.intervalId && (clearInterval(this.intervalId), this.intervalId = void 0), this.workerConsole && (this.workerConsole.destroy(), this.workerConsole = void 0), this.isOpen = !1, this.checkCount = 0;
6155
6161
  }
6156
6162
  }
6157
- class Lr {
6163
+ class xr {
6158
6164
  constructor(t) {
6159
6165
  if (this.detected = !1, !t.onDetected)
6160
6166
  throw new Error("onDetected callback is required");
@@ -6189,7 +6195,7 @@ class Lr {
6189
6195
  this.observer?.disconnect(), this.observer = void 0, this.detected = !1;
6190
6196
  }
6191
6197
  }
6192
- class xr {
6198
+ class kr {
6193
6199
  constructor(t = {}) {
6194
6200
  this.styleElement = null, this.beforePrintHandler = null, this.onPrintAttempt = t.onPrintAttempt, t.disable && this.setupPrintProtection(t.watermark);
6195
6201
  }
@@ -6215,7 +6221,7 @@ class xr {
6215
6221
  this.beforePrintHandler && (window.removeEventListener("beforeprint", this.beforePrintHandler), this.beforePrintHandler = null), this.styleElement?.parentNode && (this.styleElement.parentNode.removeChild(this.styleElement), this.styleElement = null);
6216
6222
  }
6217
6223
  }
6218
- class kr {
6224
+ class Rr {
6219
6225
  constructor(t = {}) {
6220
6226
  this.onContextMenuBlocked = t.onContextMenuBlocked, this.contextMenuHandler = this.handleContextMenu.bind(this), document.addEventListener("contextmenu", this.contextMenuHandler, !0), window.addEventListener("unload", () => this.destroy());
6221
6227
  }
@@ -6234,10 +6240,10 @@ class kr {
6234
6240
  this.contextMenuHandler && (document.removeEventListener("contextmenu", this.contextMenuHandler, !0), this.contextMenuHandler = void 0);
6235
6241
  }
6236
6242
  }
6237
- const at = "readium:navigator:suspiciousActivity";
6243
+ const lt = "readium:navigator:suspiciousActivity";
6238
6244
  class Ye {
6239
6245
  dispatchSuspiciousActivity(t, e) {
6240
- const i = new CustomEvent(at, {
6246
+ const i = new CustomEvent(lt, {
6241
6247
  detail: {
6242
6248
  type: t,
6243
6249
  timestamp: Date.now(),
@@ -6247,7 +6253,7 @@ class Ye {
6247
6253
  window.dispatchEvent(i);
6248
6254
  }
6249
6255
  constructor(t = {}) {
6250
- t.monitorDevTools && (this.devToolsDetector = new _r({
6256
+ t.monitorDevTools && (this.devToolsDetector = new Lr({
6251
6257
  onDetected: () => {
6252
6258
  this.dispatchSuspiciousActivity("developer_tools", {
6253
6259
  targetFrameSrc: "",
@@ -6260,20 +6266,20 @@ class Ye {
6260
6266
  metaKey: !1
6261
6267
  });
6262
6268
  }
6263
- })), t.checkAutomation && (this.automationDetector = new br({
6269
+ })), t.checkAutomation && (this.automationDetector = new wr({
6264
6270
  onDetected: (e) => {
6265
6271
  this.dispatchSuspiciousActivity("automation_detected", { tool: e });
6266
6272
  }
6267
- })), t.checkIFrameEmbedding && (this.iframeEmbeddingDetector = new Lr({
6273
+ })), t.checkIFrameEmbedding && (this.iframeEmbeddingDetector = new xr({
6268
6274
  onDetected: (e) => {
6269
6275
  this.dispatchSuspiciousActivity("iframe_embedding_detected", { isCrossOrigin: e });
6270
6276
  }
6271
- })), t.protectPrinting?.disable && (this.printProtector = new xr({
6277
+ })), t.protectPrinting?.disable && (this.printProtector = new kr({
6272
6278
  ...t.protectPrinting,
6273
6279
  onPrintAttempt: () => {
6274
6280
  this.dispatchSuspiciousActivity("print", {});
6275
6281
  }
6276
- })), t.disableContextMenu && (this.contextMenuProtector = new kr({
6282
+ })), t.disableContextMenu && (this.contextMenuProtector = new Rr({
6277
6283
  onContextMenuBlocked: (e) => {
6278
6284
  this.dispatchSuspiciousActivity("context_menu", e);
6279
6285
  }
@@ -6283,7 +6289,7 @@ class Ye {
6283
6289
  this.automationDetector?.destroy(), this.devToolsDetector?.destroy(), this.iframeEmbeddingDetector?.destroy(), this.printProtector?.destroy(), this.contextMenuProtector?.destroy();
6284
6290
  }
6285
6291
  }
6286
- const lt = "readium:navigator:keyboardPeripheral";
6292
+ const ht = "readium:navigator:keyboardPeripheral";
6287
6293
  class qe {
6288
6294
  constructor(t = {}) {
6289
6295
  this.keyManager = new hn(), this.setupKeyboardPeripherals(t.keyboardPeripherals || []);
@@ -6291,7 +6297,7 @@ class qe {
6291
6297
  setupKeyboardPeripherals(t) {
6292
6298
  if (t.length > 0) {
6293
6299
  const e = (i) => {
6294
- const n = new CustomEvent(lt, {
6300
+ const n = new CustomEvent(ht, {
6295
6301
  detail: i
6296
6302
  });
6297
6303
  window.dispatchEvent(n);
@@ -6332,17 +6338,17 @@ const Or = (r) => ({
6332
6338
  peripheral: r.peripheral || (() => {
6333
6339
  })
6334
6340
  });
6335
- class Rr extends dn {
6341
+ class Ar extends dn {
6336
6342
  constructor(t, e, i, n = void 0, s = { preferences: {}, defaults: {} }) {
6337
6343
  super(), this.currentIndex = 0, this._preferencesEditor = null, this._injector = null, this._isNavigating = !1, this._navigatorProtector = null, this._keyboardPeripheralsManager = null, this._suspiciousActivityListener = null, this._keyboardPeripheralListener = null, this.webViewport = {
6338
6344
  readingOrder: [],
6339
6345
  progressions: /* @__PURE__ */ new Map(),
6340
6346
  positions: null
6341
- }, this.pub = e, this.container = t, this.listeners = Or(i), this._preferences = new Mt(s.preferences), this._defaults = new pr(s.defaults), this._settings = new Ai(this._preferences, this._defaults, this.hasDisplayTransformability), this._css = new cr({
6342
- rsProperties: new hr({ experiments: this._settings.experiments || null }),
6343
- userProperties: new gn({ zoom: this._settings.zoom })
6347
+ }, this.pub = e, this.container = t, this.listeners = Or(i), this._preferences = new Mt(s.preferences), this._defaults = new fr(s.defaults), this._settings = new Ai(this._preferences, this._defaults, this.hasDisplayTransformability), this._css = new dr({
6348
+ rsProperties: new cr({ experiments: this._settings.experiments || null }),
6349
+ userProperties: new mn({ zoom: this._settings.zoom })
6344
6350
  });
6345
- const o = yr(e.readingOrder.items), a = s.injectables || { rules: [], allowedDomains: [] };
6351
+ const o = br(e.readingOrder.items), a = s.injectables || { rules: [], allowedDomains: [] };
6346
6352
  if (this._injector = new vn({
6347
6353
  rules: [...o, ...a.rules],
6348
6354
  allowedDomains: a.allowedDomains
@@ -6352,12 +6358,12 @@ class Rr extends dn {
6352
6358
  ), (this._contentProtection.disableContextMenu || this._contentProtection.checkAutomation || this._contentProtection.checkIFrameEmbedding || this._contentProtection.monitorDevTools || this._contentProtection.protectPrinting?.disable) && (this._navigatorProtector = new Ye(this._contentProtection), this._suspiciousActivityListener = (l) => {
6353
6359
  const { type: h, ...c } = l.detail;
6354
6360
  h === "context_menu" ? this.listeners.contextMenu(c) : this.listeners.contentProtection(h, c);
6355
- }, window.addEventListener(at, this._suspiciousActivityListener)), this._keyboardPeripherals.length > 0 && (this._keyboardPeripheralsManager = new qe({
6361
+ }, window.addEventListener(lt, this._suspiciousActivityListener)), this._keyboardPeripherals.length > 0 && (this._keyboardPeripheralsManager = new qe({
6356
6362
  keyboardPeripherals: this._keyboardPeripherals
6357
6363
  }), this._keyboardPeripheralListener = (l) => {
6358
6364
  const h = l.detail;
6359
6365
  this.listeners.peripheral(h);
6360
- }, window.addEventListener(lt, this._keyboardPeripheralListener)), n && typeof n.copyWithLocations == "function") {
6366
+ }, window.addEventListener(ht, this._keyboardPeripheralListener)), n && typeof n.copyWithLocations == "function") {
6361
6367
  this.currentLocation = n;
6362
6368
  const l = this.pub.readingOrder.findIndexWithHref(n.href);
6363
6369
  l >= 0 && (this.currentIndex = l);
@@ -6459,12 +6465,12 @@ class Rr extends dn {
6459
6465
  if (h.startsWith("http://") || h.startsWith("https://"))
6460
6466
  c = h;
6461
6467
  else if (this.currentLocation.href.startsWith("http://") || this.currentLocation.href.startsWith("https://")) {
6462
- const p = new URL(this.currentLocation.href);
6463
- c = new URL(h, p).href;
6468
+ const f = new URL(this.currentLocation.href);
6469
+ c = new URL(h, f).href;
6464
6470
  } else
6465
6471
  c = Xt.join(Xt.dirname(this.currentLocation.href), h);
6466
- const u = this.pub.readingOrder.findWithHref(c);
6467
- u ? this.goLink(u, !1, () => {
6472
+ const d = this.pub.readingOrder.findWithHref(c);
6473
+ d ? this.goLink(d, !1, () => {
6468
6474
  }) : (console.warn(`Internal link not found in readingOrder: ${c}`), this.listeners.handleLocator(new $({
6469
6475
  href: h
6470
6476
  }).locator));
@@ -6508,7 +6514,7 @@ class Rr extends dn {
6508
6514
  }
6509
6515
  }
6510
6516
  determineModules() {
6511
- const t = ms.slice(), e = bt(this.pub.metadata);
6517
+ const t = ys.slice(), e = bt(this.pub.metadata);
6512
6518
  return e === "cjk-vertical" || e === "mongolian-vertical" ? t.map((i) => i === "webpub_snapper" ? "cjk_vertical_snapper" : i) : t;
6513
6519
  }
6514
6520
  attachListener() {
@@ -6521,7 +6527,7 @@ class Rr extends dn {
6521
6527
  throw Error("Link for " + this.currentLocation.href + " not found!");
6522
6528
  }
6523
6529
  async destroy() {
6524
- this._suspiciousActivityListener && window.removeEventListener(at, this._suspiciousActivityListener), this._keyboardPeripheralListener && window.removeEventListener(lt, this._keyboardPeripheralListener), this._navigatorProtector?.destroy(), this._keyboardPeripheralsManager?.destroy(), await this.framePool?.destroy();
6530
+ this._suspiciousActivityListener && window.removeEventListener(lt, this._suspiciousActivityListener), this._keyboardPeripheralListener && window.removeEventListener(ht, this._keyboardPeripheralListener), this._navigatorProtector?.destroy(), this._keyboardPeripheralsManager?.destroy(), await this.framePool?.destroy();
6525
6531
  }
6526
6532
  async changeResource(t) {
6527
6533
  if (t === 0) return !1;
@@ -6661,7 +6667,7 @@ class Rr extends dn {
6661
6667
  });
6662
6668
  }
6663
6669
  }
6664
- const mo = Rr, Ar = (r) => {
6670
+ const yo = Ar, Tr = (r) => {
6665
6671
  const t = r.join(" ");
6666
6672
  return [
6667
6673
  // 'self' is useless because the document is loaded from a blob: URL
@@ -6693,7 +6699,7 @@ class En {
6693
6699
  async build(t = !1) {
6694
6700
  if (this.item.mediaType.isHTML)
6695
6701
  return await this.buildHtmlFrame(t);
6696
- if (this.item.mediaType.isBitmap || this.item.mediaType.equals(g.SVG))
6702
+ if (this.item.mediaType.isBitmap || this.item.mediaType.equals(m.SVG))
6697
6703
  return this.buildImageFrame();
6698
6704
  throw Error("Unsupported frame mediatype " + this.item.mediaType.string);
6699
6705
  }
@@ -6726,21 +6732,21 @@ class En {
6726
6732
  ...e ? [e] : [],
6727
6733
  ...a
6728
6734
  ])].filter(Boolean);
6729
- if (o && !s && this.setProperties(o, t), t.body.querySelectorAll("img").forEach((u) => {
6730
- u.setAttribute("fetchpriority", "high");
6735
+ if (o && !s && this.setProperties(o, t), t.body.querySelectorAll("img").forEach((d) => {
6736
+ d.setAttribute("fetchpriority", "high");
6731
6737
  }), n.isHTML && this.pub.metadata.languages?.[0]) {
6732
- const u = this.pub.metadata.languages[0];
6733
- if (n === g.XHTML) {
6734
- const p = t.documentElement.lang || t.documentElement.getAttribute("xml:lang"), m = t.body.lang || t.body.getAttribute("xml:lang");
6735
- m && !p ? (t.documentElement.lang = m, t.documentElement.setAttribute("xml:lang", m), t.body.removeAttribute("xml:lang"), t.body.removeAttribute("lang")) : p || (t.documentElement.lang = u, t.documentElement.setAttribute("xml:lang", u));
6736
- } else n === g.HTML && !t.documentElement.lang && (t.documentElement.lang = u);
6738
+ const d = this.pub.metadata.languages[0];
6739
+ if (n === m.XHTML) {
6740
+ const f = t.documentElement.lang || t.documentElement.getAttribute("xml:lang"), g = t.body.lang || t.body.getAttribute("xml:lang");
6741
+ g && !f ? (t.documentElement.lang = g, t.documentElement.setAttribute("xml:lang", g), t.body.removeAttribute("xml:lang"), t.body.removeAttribute("lang")) : f || (t.documentElement.lang = d, t.documentElement.setAttribute("xml:lang", d));
6742
+ } else n === m.HTML && !t.documentElement.lang && (t.documentElement.lang = d);
6737
6743
  }
6738
6744
  if (bt(this.pub.metadata) === "rtl" && !t.documentElement.dir && !t.body.dir && (t.documentElement.dir = M.rtl), i !== void 0) {
6739
- const u = t.createElement("base");
6740
- u.href = i, u.dataset.readium = "true", t.head.firstChild.before(u);
6745
+ const d = t.createElement("base");
6746
+ d.href = i, d.dataset.readium = "true", t.head.firstChild.before(d);
6741
6747
  }
6742
6748
  const c = t.createElement("meta");
6743
- return c.httpEquiv = "Content-Security-Policy", c.content = Ar(l), c.dataset.readium = "true", t.head.firstChild.before(c), URL.createObjectURL(
6749
+ return c.httpEquiv = "Content-Security-Policy", c.content = Tr(l), c.dataset.readium = "true", t.head.firstChild.before(c), URL.createObjectURL(
6744
6750
  new Blob([new XMLSerializer().serializeToString(t)], {
6745
6751
  type: n.isHTML ? n.string : "application/xhtml+xml"
6746
6752
  // Fallback to XHTML
@@ -6854,7 +6860,7 @@ class Cn {
6854
6860
  }
6855
6861
  }
6856
6862
  const Ii = 5, zi = 3;
6857
- class Tr {
6863
+ class Nr {
6858
6864
  constructor(t, e, i, n, s, o) {
6859
6865
  this.pool = /* @__PURE__ */ new Map(), this.blobs = /* @__PURE__ */ new Map(), this.inprogress = /* @__PURE__ */ new Map(), this.pendingUpdates = /* @__PURE__ */ new Map(), this.injector = null, this.container = t, this.positions = e, this.currentCssProperties = i, this.injector = n ?? null, this.contentProtectionConfig = s || {}, this.keyboardPeripheralsConfig = o || [];
6860
6866
  }
@@ -6879,54 +6885,58 @@ class Tr {
6879
6885
  const o = this.positions[s].href;
6880
6886
  this.inprogress.has(o) && await this.inprogress.get(o);
6881
6887
  const a = new Promise(async (l, h) => {
6882
- const c = [], u = [];
6883
- this.positions.forEach((d, f) => {
6884
- (f > s + Ii || f < s - Ii) && (c.includes(d.href) || c.push(d.href)), f < s + zi && f > s - zi && (u.includes(d.href) || u.push(d.href));
6885
- }), c.forEach(async (d) => {
6886
- u.includes(d) || this.pool.has(d) && (await this.pool.get(d)?.destroy(), this.pool.delete(d), this.pendingUpdates.has(d) && this.pendingUpdates.set(d, { inPool: !1 }));
6887
- }), this.currentBaseURL !== void 0 && t.baseURL !== this.currentBaseURL && (this.blobs.forEach((d) => {
6888
- this.injector?.releaseBlobUrl?.(d), URL.revokeObjectURL(d);
6888
+ const c = [], d = [];
6889
+ this.positions.forEach((u, p) => {
6890
+ (p > s + Ii || p < s - Ii) && (c.includes(u.href) || c.push(u.href)), p < s + zi && p > s - zi && (d.includes(u.href) || d.push(u.href));
6891
+ }), c.forEach(async (u) => {
6892
+ d.includes(u) || this.pool.has(u) && (await this.pool.get(u)?.destroy(), this.pool.delete(u), this.pendingUpdates.has(u) && this.pendingUpdates.set(u, { inPool: !1 }));
6893
+ }), this.currentBaseURL !== void 0 && t.baseURL !== this.currentBaseURL && (this.blobs.forEach((u) => {
6894
+ this.injector?.releaseBlobUrl?.(u), URL.revokeObjectURL(u);
6889
6895
  }), this.blobs.clear()), this.currentBaseURL = t.baseURL;
6890
- const p = async (d) => {
6891
- if (n && (this.blobs.forEach((P) => {
6892
- this.injector?.releaseBlobUrl?.(P), URL.revokeObjectURL(P);
6893
- }), this.blobs.clear(), this.pendingUpdates.clear()), this.pendingUpdates.has(d) && this.pendingUpdates.get(d)?.inPool === !1) {
6894
- const P = this.blobs.get(d);
6895
- P && (this.injector?.releaseBlobUrl?.(P), URL.revokeObjectURL(P), this.blobs.delete(d), this.pendingUpdates.delete(d));
6896
+ const f = async (u) => {
6897
+ if (n && (this.blobs.forEach((v) => {
6898
+ this.injector?.releaseBlobUrl?.(v), URL.revokeObjectURL(v);
6899
+ }), this.blobs.clear(), this.pendingUpdates.clear()), this.pendingUpdates.has(u) && this.pendingUpdates.get(u)?.inPool === !1) {
6900
+ const v = this.blobs.get(u);
6901
+ v && (this.injector?.releaseBlobUrl?.(v), URL.revokeObjectURL(v), this.blobs.delete(u), this.pendingUpdates.delete(u));
6896
6902
  }
6897
- if (this.pool.has(d)) {
6898
- const P = this.pool.get(d);
6899
- if (!this.blobs.has(d))
6900
- await P.destroy(), this.pool.delete(d), this.pendingUpdates.delete(d);
6903
+ if (this.pool.has(u)) {
6904
+ const v = this.pool.get(u);
6905
+ if (!this.blobs.has(u))
6906
+ await v.destroy(), this.pool.delete(u), this.pendingUpdates.delete(u);
6901
6907
  else {
6902
- await P.load(i);
6908
+ await v.load(i);
6903
6909
  return;
6904
6910
  }
6905
6911
  }
6906
- const f = t.readingOrder.findWithHref(d);
6907
- if (!f) return;
6908
- if (!this.blobs.has(d)) {
6909
- const R = await new En(
6912
+ const p = t.readingOrder.findWithHref(u);
6913
+ if (!p) return;
6914
+ if (!this.blobs.has(u)) {
6915
+ const O = await new En(
6910
6916
  t,
6911
6917
  this.currentBaseURL || "",
6912
- f,
6918
+ p,
6913
6919
  {
6914
6920
  cssProperties: this.currentCssProperties,
6915
6921
  injector: this.injector
6916
6922
  }
6917
6923
  ).build();
6918
- this.blobs.set(d, R);
6924
+ this.blobs.set(u, O);
6919
6925
  }
6920
- const w = new Cn(this.blobs.get(d), this.contentProtectionConfig, this.keyboardPeripheralsConfig);
6921
- d !== o && await w.hide(), this.container.appendChild(w.iframe), await w.load(i), this.pool.set(d, w);
6926
+ const b = new Cn(this.blobs.get(u), this.contentProtectionConfig, this.keyboardPeripheralsConfig);
6927
+ u !== o && await b.hide(), this.container.appendChild(b.iframe), await b.load(i), this.pool.set(u, b);
6922
6928
  };
6923
6929
  try {
6924
- await Promise.all(u.map((d) => p(d)));
6925
- } catch (d) {
6926
- h(d);
6930
+ await Promise.all(d.map((u) => f(u)));
6931
+ } catch (u) {
6932
+ h(u);
6933
+ }
6934
+ const g = this.pool.get(o);
6935
+ if ((g?.source !== this._currentFrame?.source || n) && (await this._currentFrame?.hide(), g && await g.load(i), g && await g.show(e.locations.progression), this._currentFrame = g, g)) {
6936
+ const u = this.container.ownerDocument.activeElement;
6937
+ u && u.tagName === "IFRAME" && u !== g.iframe && g.iframe.focus({ preventScroll: !0 });
6927
6938
  }
6928
- const m = this.pool.get(o);
6929
- (m?.source !== this._currentFrame?.source || n) && (await this._currentFrame?.hide(), m && await m.load(i), m && await m.show(e.locations.progression), this._currentFrame = m), l();
6939
+ l();
6930
6940
  });
6931
6941
  this.inprogress.set(o, a), await a, this.inprogress.delete(o);
6932
6942
  }
@@ -6971,7 +6981,7 @@ class Tr {
6971
6981
  }), t;
6972
6982
  }
6973
6983
  }
6974
- class Nr {
6984
+ class Mr {
6975
6985
  constructor(t, e, i, n = {}, s = []) {
6976
6986
  this.currModules = [], this.cachedPage = void 0, this.peripherals = t, this.debugHref = i, this.contentProtectionConfig = { ...n }, this.keyboardPeripheralsConfig = [...s], 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 === M.rtl ? "right" : "left", this.wrapper.appendChild(this.frame);
6977
6987
  }
@@ -7033,10 +7043,10 @@ class Nr {
7033
7043
  const i = Math.min(this.wrapper.clientWidth / e.width, this.wrapper.clientHeight / e.height);
7034
7044
  this.frame.style.transform = `scale(${i})`;
7035
7045
  const n = this.frame.getBoundingClientRect(), s = this.wrapper.clientHeight - n.height;
7036
- if (this.frame.style.top = `${s / 2}px`, t === G.left) {
7046
+ if (this.frame.style.top = `${s / 2}px`, t === X.left) {
7037
7047
  const o = this.wrapper.clientWidth - n.width;
7038
7048
  this.frame.style.left = `${o}px`;
7039
- } else if (t === G.center) {
7049
+ } else if (t === X.center) {
7040
7050
  const o = this.wrapper.clientWidth - n.width;
7041
7051
  this.frame.style.left = `${o / 2}px`;
7042
7052
  } else
@@ -7142,8 +7152,8 @@ class Nr {
7142
7152
  return this.loader;
7143
7153
  }
7144
7154
  }
7145
- var Mr = /* @__PURE__ */ ((r) => (r[r.Left = 0] = "Left", r[r.Center = 1] = "Center", r[r.Right = 2] = "Right", r))(Mr || {}), Fr = /* @__PURE__ */ ((r) => (r[r.Top = 0] = "Top", r[r.Middle = 1] = "Middle", r[r.Bottom = 2] = "Bottom", r))(Fr || {});
7146
- class Ir {
7155
+ var Fr = /* @__PURE__ */ ((r) => (r[r.Left = 0] = "Left", r[r.Center = 1] = "Center", r[r.Right = 2] = "Right", r))(Fr || {}), Ir = /* @__PURE__ */ ((r) => (r[r.Top = 0] = "Top", r[r.Middle = 1] = "Middle", r[r.Bottom = 2] = "Bottom", r))(Ir || {});
7156
+ class zr {
7147
7157
  constructor() {
7148
7158
  this.outerWidth = 0, this.outerHeight = 0, this.HTML = document.documentElement, this.Head = document.head, this.Body = document.body;
7149
7159
  }
@@ -7191,7 +7201,7 @@ class Ir {
7191
7201
  };
7192
7202
  }
7193
7203
  }
7194
- class zr {
7204
+ class Dr {
7195
7205
  constructor() {
7196
7206
  this._DOM = {
7197
7207
  show: !1,
@@ -7210,7 +7220,7 @@ class zr {
7210
7220
  }
7211
7221
  }
7212
7222
  const Di = 6, ye = 1.02, Wi = 50;
7213
- class Dr {
7223
+ class Wr {
7214
7224
  constructor(t, e = !1) {
7215
7225
  this.dragState = 0, this.minimumMoved = !1, this.pan = {
7216
7226
  startX: 0,
@@ -7229,7 +7239,7 @@ class Dr {
7229
7239
  target: { X: 0, Y: 0 },
7230
7240
  touchN: 0,
7231
7241
  startTranslate: { X: 0, Y: 0 }
7232
- }, this._scale = 1, this.scaleDebouncer = 0, this.frameBounds = null, this.debugger = null, this.btouchstartHandler = this.touchstartHandler.bind(this), this.btouchendHandler = this.touchendHandler.bind(this), this.btouchmoveHandler = this.touchmoveHandler.bind(this), this.bdblclickHandler = this.dblclickHandler.bind(this), this.bmousedownHandler = this.mousedownHandler.bind(this), this.bmouseupHandler = this.mouseupHandler.bind(this), this.bmousemoveHandler = this.mousemoveHandler.bind(this), this.moveFrame = 0, this.manager = t, this.coordinator = new Ir(), this.attachEvents(), e && (this.debugger = new zr());
7242
+ }, this._scale = 1, this.scaleDebouncer = 0, this.frameBounds = null, this.debugger = null, this.btouchstartHandler = this.touchstartHandler.bind(this), this.btouchendHandler = this.touchendHandler.bind(this), this.btouchmoveHandler = this.touchmoveHandler.bind(this), this.bdblclickHandler = this.dblclickHandler.bind(this), this.bmousedownHandler = this.mousedownHandler.bind(this), this.bmouseupHandler = this.mouseupHandler.bind(this), this.bmousemoveHandler = this.mousemoveHandler.bind(this), this.moveFrame = 0, this.manager = t, this.coordinator = new zr(), this.attachEvents(), e && (this.debugger = new Dr());
7233
7243
  }
7234
7244
  get scale() {
7235
7245
  return this._scale;
@@ -7361,16 +7371,16 @@ class Dr {
7361
7371
  const l = this.coordinator.getTouchCenter(t);
7362
7372
  if (this.debugger?.show) {
7363
7373
  this.debugger.DOM.center.style.top = `${l.Y - 5}px`, this.debugger.DOM.center.style.left = `${l.X - 5}px`, this.debugger.DOM.center.innerText = `${l.X.toFixed(2)},${l.Y.toFixed(2)}`;
7364
- const m = this.coordinator.getBibiEventCoord(t, 1);
7365
- this.debugger.DOM.touch2.style.top = `${m.Y - 10}px`, this.debugger.DOM.touch2.style.left = `${m.X - 10}px`, this.debugger.DOM.touch2.innerText = `${m.X.toFixed(2)},${m.Y.toFixed(2)}`;
7374
+ const g = this.coordinator.getBibiEventCoord(t, 1);
7375
+ this.debugger.DOM.touch2.style.top = `${g.Y - 10}px`, this.debugger.DOM.touch2.style.left = `${g.X - 10}px`, this.debugger.DOM.touch2.innerText = `${g.X.toFixed(2)},${g.Y.toFixed(2)}`;
7366
7376
  }
7367
7377
  l.X -= this.manager.width / 2, l.Y -= this.manager.height / 2;
7368
7378
  let h = -l.X / s;
7369
7379
  h += l.X / this.scale, this.pinch.target.X += h, l.X += this.pinch.target.X * this.scale / this.pinch.startScale;
7370
7380
  let c = -l.Y / s;
7371
7381
  c += l.Y / this.scale, this.pinch.target.Y += c, l.Y += this.pinch.target.Y * this.scale / this.pinch.startScale;
7372
- let u = (l.X - (this.pan.startX - this.manager.width / 2)) * 1 / this.scale, p = (l.Y - (this.pan.startY - this.manager.height / 2)) * 1 / this.scale;
7373
- this.pan.translateX = u, this.pan.translateY = p, this.debugger?.show && (this.debugger.DOM.pinchTarget.style.left = `${this.pinch.target.X * this.scale / this.pinch.startScale - 5 + this.manager.width / 2}px`, this.debugger.DOM.pinchTarget.style.top = `${this.pinch.target.Y * this.scale / this.pinch.startScale - 5 + this.manager.height / 2}px`, this.debugger.DOM.pinchTarget.innerText = `${(this.pinch.target.X * this.scale / this.pinch.startScale).toFixed(2)},${(this.pinch.target.Y * this.scale / this.pinch.startScale).toFixed(2)}`);
7382
+ let d = (l.X - (this.pan.startX - this.manager.width / 2)) * 1 / this.scale, f = (l.Y - (this.pan.startY - this.manager.height / 2)) * 1 / this.scale;
7383
+ this.pan.translateX = d, this.pan.translateY = f, this.debugger?.show && (this.debugger.DOM.pinchTarget.style.left = `${this.pinch.target.X * this.scale / this.pinch.startScale - 5 + this.manager.width / 2}px`, this.debugger.DOM.pinchTarget.style.top = `${this.pinch.target.Y * this.scale / this.pinch.startScale - 5 + this.manager.height / 2}px`, this.debugger.DOM.pinchTarget.innerText = `${(this.pinch.target.X * this.scale / this.pinch.startScale).toFixed(2)},${(this.pinch.target.Y * this.scale / this.pinch.startScale).toFixed(2)}`);
7374
7384
  }
7375
7385
  const o = this.frameBounds.width / 6, a = this.frameBounds.height / 6;
7376
7386
  this.pan.translateX < -o && (this.pan.overscrollX = -(o + this.pan.translateX), this.pan.translateX = -o), this.pan.translateY < -a && (this.pan.overscrollY = -(a + this.pan.translateY), this.pan.translateY = -a), this.pan.translateX > o && (this.pan.overscrollX = o - this.pan.translateX, this.pan.translateX = o), this.pan.translateY > a && (this.pan.overscrollY = a - this.pan.translateY, this.pan.translateY = a), n = !0, this.debugger?.show && (this.debugger.DOM.stats.innerText = `TX: ${this.pan.translateX.toFixed(2)}
@@ -7431,7 +7441,7 @@ Overscroll: ${this.pan.overscrollX.toFixed(2)},${this.pan.overscrollY.toFixed(2)
7431
7441
  }
7432
7442
  }
7433
7443
  var Ne = /* @__PURE__ */ ((r) => (r.auto = "auto", r.landscape = "landscape", r.portrait = "portrait", r))(Ne || {}), Me = /* @__PURE__ */ ((r) => (r.auto = "auto", r.both = "both", r.none = "none", r.landscape = "landscape", r))(Me || {});
7434
- class Wr {
7444
+ class Ur {
7435
7445
  // TODO getter
7436
7446
  constructor(t) {
7437
7447
  this.shift = !0, this.spreads = [], this.nLandscape = 0, this.index(t), this.testShift(t), console.log(`Indexed ${this.spreads.length} spreads for ${t.readingOrder.items.length} items`);
@@ -7460,13 +7470,13 @@ class Wr {
7460
7470
  if (i.length > 1)
7461
7471
  return;
7462
7472
  const s = i[0], o = s.properties?.otherProperties.orientation;
7463
- n === 0 && (o === "landscape" || o !== "portrait" && ((s.width || 0) > (s.height || 0) || s.properties?.otherProperties.spread === "both")) && (this.shift = !1), e && s.properties?.page === G.center && this.spreads[n - 1][0].addProperties({ addBlank: !0 }), o === "portrait" && s.properties?.page !== "center" && s.properties?.otherProperties.number > 1 ? e = !0 : e = !1;
7473
+ n === 0 && (o === "landscape" || o !== "portrait" && ((s.width || 0) > (s.height || 0) || s.properties?.otherProperties.spread === "both")) && (this.shift = !1), e && s.properties?.page === X.center && this.spreads[n - 1][0].addProperties({ addBlank: !0 }), o === "portrait" && s.properties?.page !== "center" && s.properties?.otherProperties.number > 1 ? e = !0 : e = !1;
7464
7474
  }), this.shift || this.index(t, !0);
7465
7475
  }
7466
7476
  buildSpreads(t) {
7467
7477
  let e = [];
7468
7478
  t.items.forEach((i, n) => {
7469
- !n && this.shift ? this.spreads.push([i]) : i.properties?.page === G.center ? (e.length > 0 && this.spreads.push(e), this.spreads.push([i]), e = []) : e.length >= 2 ? (this.spreads.push(e), e = [i]) : e.push(i);
7479
+ !n && this.shift ? this.spreads.push([i]) : i.properties?.page === X.center ? (e.length > 0 && this.spreads.push(e), this.spreads.push([i]), e = []) : e.length >= 2 ? (this.spreads.push(e), e = [i]) : e.push(i);
7470
7480
  }), e.length > 0 && this.spreads.push(e);
7471
7481
  }
7472
7482
  currentSpread(t, e) {
@@ -7476,13 +7486,13 @@ class Wr {
7476
7486
  return this.spreads.find((e) => e.includes(t)) || void 0;
7477
7487
  }
7478
7488
  }
7479
- const Ui = 8, Hi = 5, Ur = 300, Hr = 15e3, Br = 250, Vr = 150, jr = 500;
7480
- class $r {
7489
+ const Ui = 8, Hi = 5, Hr = 300, Br = 15e3, Vr = 250, jr = 150, $r = 500;
7490
+ class Gr {
7481
7491
  constructor(t, e, i, n, s, o) {
7482
7492
  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 = s || {}, this.keyboardPeripheralsConfig = o || [], this.spreadPresentation = i.metadata.otherMetadata?.spread || Me.auto, this.pub.metadata.effectiveReadingProgression !== M.rtl && this.pub.metadata.effectiveReadingProgression !== M.ltr)
7483
7493
  throw Error("Unsupported reading progression for EPUB");
7484
- this.spreader = new Wr(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 Dr(this), this.pub.readingOrder.items.forEach((a) => {
7485
- const l = new Nr(this.peripherals, this.pub.metadata.effectiveReadingProgression, a.href, this.contentProtectionConfig, this.keyboardPeripheralsConfig);
7494
+ this.spreader = new Ur(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 Wr(this), this.pub.readingOrder.items.forEach((a) => {
7495
+ const l = new Mr(this.peripherals, this.pub.metadata.effectiveReadingProgression, a.href, this.contentProtectionConfig, this.keyboardPeripheralsConfig);
7486
7496
  this.spineElement.appendChild(l.element), this.pool.set(a.href, l), l.width = 100 / this.length * (a.properties?.otherProperties.orientation === Ne.landscape || a.properties?.otherProperties.addBlank ? this.perPage : 1), l.height = this.height;
7487
7497
  });
7488
7498
  }
@@ -7507,7 +7517,7 @@ class $r {
7507
7517
  const a = this.spreader.findByLink(o);
7508
7518
  i.update(this.spreadPosition(a, o));
7509
7519
  });
7510
- }, Br);
7520
+ }, Vr);
7511
7521
  }
7512
7522
  /**
7513
7523
  * It is important that these values be cached to avoid spamming them on redraws, they are expensive.
@@ -7534,7 +7544,7 @@ class $r {
7534
7544
  let i = "0";
7535
7545
  this.updateDimensions(), this.perPage > 1 && (i = `${this.width / 2}px`);
7536
7546
  const n = {
7537
- transition: t ? `all ${e ? Vr : jr}ms ease-out` : "all 0ms ease-out",
7547
+ transition: t ? `all ${e ? jr : $r}ms ease-out` : "all 0ms ease-out",
7538
7548
  marginRight: this.rtl ? i : "0",
7539
7549
  marginLeft: this.rtl ? "0" : i,
7540
7550
  width: `${this.width / this.perPage * this.length}px`,
@@ -7669,7 +7679,7 @@ class $r {
7669
7679
  return t % 2 && !this.single && t++, t;
7670
7680
  }
7671
7681
  spreadPosition(t, e) {
7672
- return this.perPage < 2 || t.length < 2 ? G.center : e.href === t[0].href ? this.rtl ? G.right : G.left : this.rtl ? G.left : G.right;
7682
+ return this.perPage < 2 || t.length < 2 ? X.center : e.href === t[0].href ? this.rtl ? X.right : X.left : this.rtl ? X.left : X.right;
7673
7683
  }
7674
7684
  async waitForItem(t) {
7675
7685
  if (this.inprogress.has(t) && await this.inprogress.get(t), this.delayedShow.has(t)) {
@@ -7692,54 +7702,56 @@ class $r {
7692
7702
  for (const l of o)
7693
7703
  await this.waitForItem(l.href);
7694
7704
  const a = new Promise(async (l, h) => {
7695
- const c = [], u = [];
7696
- this.positions.forEach((d, f) => {
7697
- (f > s + Ui || f < s - Ui) && (c.includes(d.href) || c.push(d.href)), f < s + Hi && f > s - Hi && (u.includes(d.href) || u.push(d.href));
7698
- }), c.forEach(async (d) => {
7699
- u.includes(d) || this.pool.has(d) && (this.cancelShowing(d), await this.pool.get(d)?.unload());
7700
- }), this.currentBaseURL !== void 0 && t.baseURL !== this.currentBaseURL && (this.blobs.forEach((d) => URL.revokeObjectURL(d)), this.blobs.clear()), this.currentBaseURL = t.baseURL;
7701
- const p = async (d) => {
7702
- const f = t.readingOrder.findIndexWithHref(d), w = t.readingOrder.items[f];
7703
- if (w) {
7704
- if (!this.blobs.has(d)) {
7705
- const R = await new En(
7705
+ const c = [], d = [];
7706
+ this.positions.forEach((p, b) => {
7707
+ (b > s + Ui || b < s - Ui) && (c.includes(p.href) || c.push(p.href)), b < s + Hi && b > s - Hi && (d.includes(p.href) || d.push(p.href));
7708
+ }), c.forEach(async (p) => {
7709
+ d.includes(p) || this.pool.has(p) && (this.cancelShowing(p), await this.pool.get(p)?.unload());
7710
+ }), this.currentBaseURL !== void 0 && t.baseURL !== this.currentBaseURL && (this.blobs.forEach((p) => URL.revokeObjectURL(p)), this.blobs.clear()), this.currentBaseURL = t.baseURL;
7711
+ const f = async (p) => {
7712
+ const b = t.readingOrder.findIndexWithHref(p), v = t.readingOrder.items[b];
7713
+ if (v) {
7714
+ if (!this.blobs.has(p)) {
7715
+ const G = await new En(
7706
7716
  t,
7707
7717
  this.currentBaseURL || "",
7708
- w,
7718
+ v,
7709
7719
  {
7710
7720
  injector: this.injector
7711
7721
  }
7712
7722
  ).build(!0);
7713
- this.blobs.set(d, R);
7723
+ this.blobs.set(p, G);
7714
7724
  }
7715
- this.delayedShow.has(d) || this.delayedShow.set(d, new Promise((P, R) => {
7716
- let Y = !1;
7717
- const ht = window.setTimeout(async () => {
7718
- this.delayedTimeout.set(d, 0);
7719
- const ct = this.makeSpread(this.reAlign(f)), xn = this.spreadPosition(ct, w), Ze = this.pool.get(d);
7720
- await Ze.load(i, this.blobs.get(d)), this.peripherals.isScaled || await Ze.show(xn), this.delayedShow.delete(d), Y = !0, P();
7721
- }, Ur);
7725
+ this.delayedShow.has(p) || this.delayedShow.set(p, new Promise((O, G) => {
7726
+ let ot = !1;
7727
+ const ct = window.setTimeout(async () => {
7728
+ this.delayedTimeout.set(p, 0);
7729
+ const xn = this.makeSpread(this.reAlign(b)), kn = this.spreadPosition(xn, v), Ze = this.pool.get(p);
7730
+ await Ze.load(i, this.blobs.get(p)), this.peripherals.isScaled || await Ze.show(kn), this.delayedShow.delete(p), ot = !0, O();
7731
+ }, Hr);
7722
7732
  setTimeout(() => {
7723
- !Y && this.delayedShow.has(d) && R(`Offscreen load timeout: ${d}`);
7724
- }, Hr), this.delayedTimeout.set(d, ht);
7733
+ !ot && this.delayedShow.has(p) && G(`Offscreen load timeout: ${p}`);
7734
+ }, Br), this.delayedTimeout.set(p, ct);
7725
7735
  }));
7726
7736
  }
7727
7737
  };
7728
7738
  try {
7729
- await Promise.all(u.map((d) => p(d)));
7730
- } catch (d) {
7731
- h(d);
7739
+ await Promise.all(d.map((p) => f(p)));
7740
+ } catch (p) {
7741
+ h(p);
7732
7742
  }
7733
- const m = [];
7734
- for (const d of o) {
7735
- const f = this.pool.get(d.href), w = this.blobs.get(d.href);
7736
- w && (this.cancelShowing(d.href), await f.load(i, w), await f.show(this.spreadPosition(o, d)), this.previousFrames.push(f), await f.activate(), m.push(f));
7743
+ const g = [];
7744
+ for (const p of o) {
7745
+ const b = this.pool.get(p.href), v = this.blobs.get(p.href);
7746
+ v && (this.cancelShowing(p.href), await b.load(i, v), await b.show(this.spreadPosition(o, p)), this.previousFrames.push(b), await b.activate(), g.push(b));
7737
7747
  }
7738
7748
  for (; this.previousFrames.length > 0; ) {
7739
- const d = this.previousFrames.shift();
7740
- d && !m.includes(d) && await d.unfocus();
7749
+ const p = this.previousFrames.shift();
7750
+ p && !g.includes(p) && await p.unfocus();
7741
7751
  }
7742
- this.previousFrames = m, l();
7752
+ this.previousFrames = g;
7753
+ const u = this.container.ownerDocument.activeElement;
7754
+ u && u.tagName === "IFRAME" && !g.some((p) => p.iframe === u) && g[0]?.iframe.focus({ preventScroll: !0 }), l();
7743
7755
  });
7744
7756
  for (const l of o)
7745
7757
  this.inprogress.set(l.href, a);
@@ -7799,7 +7811,7 @@ class $r {
7799
7811
  }
7800
7812
  class Ft {
7801
7813
  constructor(t = {}) {
7802
- this.backgroundColor = W(t.backgroundColor), this.blendFilter = E(t.blendFilter), this.constraint = v(t.constraint), this.columnCount = v(t.columnCount), this.darkenFilter = wt(t.darkenFilter), this.deprecatedFontSize = E(t.deprecatedFontSize), this.fontFamily = W(t.fontFamily), this.fontSize = F(t.fontSize, Yt.range), this.fontSizeNormalize = E(t.fontSizeNormalize), this.fontOpticalSizing = E(t.fontOpticalSizing), this.fontWeight = F(t.fontWeight, st.range), this.fontWidth = F(t.fontWidth, qt.range), this.hyphens = E(t.hyphens), this.invertFilter = wt(t.invertFilter), this.invertGaijiFilter = wt(t.invertGaijiFilter), this.iOSPatch = E(t.iOSPatch), this.iPadOSPatch = E(t.iPadOSPatch), this.letterSpacing = v(t.letterSpacing), this.ligatures = E(t.ligatures), this.lineHeight = v(t.lineHeight), this.linkColor = W(t.linkColor), this.noRuby = E(t.noRuby), this.pageGutter = v(t.pageGutter), this.paragraphIndent = v(t.paragraphIndent), this.paragraphSpacing = v(t.paragraphSpacing), this.scroll = E(t.scroll), this.scrollPaddingTop = v(t.scrollPaddingTop), this.scrollPaddingBottom = v(t.scrollPaddingBottom), this.scrollPaddingLeft = v(t.scrollPaddingLeft), this.scrollPaddingRight = v(t.scrollPaddingRight), this.selectionBackgroundColor = W(t.selectionBackgroundColor), this.selectionTextColor = W(t.selectionTextColor), this.textAlign = he(t.textAlign, tt), this.textColor = W(t.textColor), this.textNormalization = E(t.textNormalization), this.visitedColor = W(t.visitedColor), this.wordSpacing = v(t.wordSpacing), this.optimalLineLength = v(t.optimalLineLength), this.maximalLineLength = v(t.maximalLineLength), this.minimalLineLength = v(t.minimalLineLength);
7814
+ this.backgroundColor = W(t.backgroundColor), this.blendFilter = E(t.blendFilter), this.constraint = S(t.constraint), this.columnCount = S(t.columnCount), this.darkenFilter = wt(t.darkenFilter), this.deprecatedFontSize = E(t.deprecatedFontSize), this.fontFamily = W(t.fontFamily), this.fontSize = F(t.fontSize, Yt.range), this.fontSizeNormalize = E(t.fontSizeNormalize), this.fontOpticalSizing = E(t.fontOpticalSizing), this.fontWeight = F(t.fontWeight, st.range), this.fontWidth = F(t.fontWidth, qt.range), this.hyphens = E(t.hyphens), this.invertFilter = wt(t.invertFilter), this.invertGaijiFilter = wt(t.invertGaijiFilter), this.iOSPatch = E(t.iOSPatch), this.iPadOSPatch = E(t.iPadOSPatch), this.letterSpacing = S(t.letterSpacing), this.ligatures = E(t.ligatures), this.lineHeight = S(t.lineHeight), this.linkColor = W(t.linkColor), this.noRuby = E(t.noRuby), this.pageGutter = S(t.pageGutter), this.paragraphIndent = S(t.paragraphIndent), this.paragraphSpacing = S(t.paragraphSpacing), this.scroll = E(t.scroll), this.scrollPaddingTop = S(t.scrollPaddingTop), this.scrollPaddingBottom = S(t.scrollPaddingBottom), this.scrollPaddingLeft = S(t.scrollPaddingLeft), this.scrollPaddingRight = S(t.scrollPaddingRight), this.selectionBackgroundColor = W(t.selectionBackgroundColor), this.selectionTextColor = W(t.selectionTextColor), this.textAlign = he(t.textAlign, tt), this.textColor = W(t.textColor), this.textNormalization = E(t.textNormalization), this.visitedColor = W(t.visitedColor), this.wordSpacing = S(t.wordSpacing), this.optimalLineLength = S(t.optimalLineLength), this.maximalLineLength = S(t.maximalLineLength), this.minimalLineLength = S(t.minimalLineLength);
7803
7815
  }
7804
7816
  static serialize(t) {
7805
7817
  const { ...e } = t;
@@ -7820,22 +7832,22 @@ class Ft {
7820
7832
  return new Ft(e);
7821
7833
  }
7822
7834
  }
7823
- class Gr {
7835
+ class Xr {
7824
7836
  constructor(t) {
7825
- this.backgroundColor = W(t.backgroundColor) || null, this.blendFilter = E(t.blendFilter) ?? !1, this.constraint = v(t.constraint) || 0, this.columnCount = v(t.columnCount) || null, this.darkenFilter = wt(t.darkenFilter) ?? !1, this.deprecatedFontSize = E(t.deprecatedFontSize), (this.deprecatedFontSize === !1 || this.deprecatedFontSize === null) && (this.deprecatedFontSize = !CSS.supports("zoom", "1")), this.fontFamily = W(t.fontFamily) || null, this.fontSize = F(t.fontSize, Yt.range) || 1, this.fontSizeNormalize = E(t.fontSizeNormalize) ?? !1, this.fontOpticalSizing = E(t.fontOpticalSizing) ?? null, this.fontWeight = F(t.fontWeight, st.range) || null, this.fontWidth = F(t.fontWidth, qt.range) || null, this.hyphens = E(t.hyphens) ?? null, this.invertFilter = wt(t.invertFilter) ?? !1, this.invertGaijiFilter = wt(t.invertGaijiFilter) ?? !1, this.iOSPatch = t.iOSPatch === !1 ? !1 : (T.OS.iOS || T.OS.iPadOS) && T.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : T.OS.iPadOS && T.iOSRequest === "desktop", this.letterSpacing = v(t.letterSpacing) || null, this.ligatures = E(t.ligatures) ?? null, this.lineHeight = v(t.lineHeight) || null, this.linkColor = W(t.linkColor) || null, this.noRuby = E(t.noRuby) ?? !1, this.pageGutter = me(v(t.pageGutter), 20), this.paragraphIndent = v(t.paragraphIndent) ?? null, this.paragraphSpacing = v(t.paragraphSpacing) ?? null, this.scroll = E(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 = W(t.selectionBackgroundColor) || null, this.selectionTextColor = W(t.selectionTextColor) || null, this.textAlign = he(t.textAlign, tt) || null, this.textColor = W(t.textColor) || null, this.textNormalization = E(t.textNormalization) ?? !1, this.visitedColor = W(t.visitedColor) || null, this.wordSpacing = v(t.wordSpacing) || null, this.optimalLineLength = v(t.optimalLineLength) || 65, this.maximalLineLength = me(ur(t.maximalLineLength, this.optimalLineLength), 80), this.minimalLineLength = me(dr(t.minimalLineLength, this.optimalLineLength), 40), this.experiments = mn(t.experiments) || null;
7837
+ this.backgroundColor = W(t.backgroundColor) || null, this.blendFilter = E(t.blendFilter) ?? !1, this.constraint = S(t.constraint) || 0, this.columnCount = S(t.columnCount) || null, this.darkenFilter = wt(t.darkenFilter) ?? !1, this.deprecatedFontSize = E(t.deprecatedFontSize), (this.deprecatedFontSize === !1 || this.deprecatedFontSize === null) && (this.deprecatedFontSize = !CSS.supports("zoom", "1")), this.fontFamily = W(t.fontFamily) || null, this.fontSize = F(t.fontSize, Yt.range) || 1, this.fontSizeNormalize = E(t.fontSizeNormalize) ?? !1, this.fontOpticalSizing = E(t.fontOpticalSizing) ?? null, this.fontWeight = F(t.fontWeight, st.range) || null, this.fontWidth = F(t.fontWidth, qt.range) || null, this.hyphens = E(t.hyphens) ?? null, this.invertFilter = wt(t.invertFilter) ?? !1, this.invertGaijiFilter = wt(t.invertGaijiFilter) ?? !1, this.iOSPatch = t.iOSPatch === !1 ? !1 : (T.OS.iOS || T.OS.iPadOS) && T.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : T.OS.iPadOS && T.iOSRequest === "desktop", this.letterSpacing = S(t.letterSpacing) || null, this.ligatures = E(t.ligatures) ?? null, this.lineHeight = S(t.lineHeight) || null, this.linkColor = W(t.linkColor) || null, this.noRuby = E(t.noRuby) ?? !1, this.pageGutter = ge(S(t.pageGutter), 20), this.paragraphIndent = S(t.paragraphIndent) ?? null, this.paragraphSpacing = S(t.paragraphSpacing) ?? null, this.scroll = E(t.scroll) ?? !1, this.scrollPaddingTop = S(t.scrollPaddingTop) ?? null, this.scrollPaddingBottom = S(t.scrollPaddingBottom) ?? null, this.scrollPaddingLeft = S(t.scrollPaddingLeft) ?? null, this.scrollPaddingRight = S(t.scrollPaddingRight) ?? null, this.selectionBackgroundColor = W(t.selectionBackgroundColor) || null, this.selectionTextColor = W(t.selectionTextColor) || null, this.textAlign = he(t.textAlign, tt) || null, this.textColor = W(t.textColor) || null, this.textNormalization = E(t.textNormalization) ?? !1, this.visitedColor = W(t.visitedColor) || null, this.wordSpacing = S(t.wordSpacing) || null, this.optimalLineLength = S(t.optimalLineLength) || 65, this.maximalLineLength = ge(pr(t.maximalLineLength, this.optimalLineLength), 80), this.minimalLineLength = ge(ur(t.minimalLineLength, this.optimalLineLength), 40), this.experiments = gn(t.experiments) || null;
7826
7838
  }
7827
7839
  }
7828
- const Xr = "#FFFFFF", Yr = "#121212", qr = "#0000EE", Kr = "#551A8B", Jr = "#b4d8fe", Zr = "inherit", ft = {
7829
- backgroundColor: Xr,
7830
- textColor: Yr,
7831
- linkColor: qr,
7832
- visitedColor: Kr,
7833
- selectionBackgroundColor: Jr,
7834
- selectionTextColor: Zr
7840
+ const Yr = "#FFFFFF", qr = "#121212", Kr = "#0000EE", Jr = "#551A8B", Zr = "#b4d8fe", Qr = "inherit", ft = {
7841
+ backgroundColor: Yr,
7842
+ textColor: qr,
7843
+ linkColor: Kr,
7844
+ visitedColor: Jr,
7845
+ selectionBackgroundColor: Zr,
7846
+ selectionTextColor: Qr
7835
7847
  };
7836
7848
  class Bi {
7837
7849
  constructor(t, e, i) {
7838
- this.preferences = t, this.settings = e, this.metadata = i, this.layout = this.metadata?.effectiveLayout || b.reflowable;
7850
+ this.preferences = t, this.settings = e, this.metadata = i, this.layout = this.metadata?.effectiveLayout || w.reflowable;
7839
7851
  }
7840
7852
  clear() {
7841
7853
  this.preferences = new Ft({ optimalLineLength: 65 });
@@ -7867,7 +7879,7 @@ class Bi {
7867
7879
  return new N({
7868
7880
  initialValue: this.preferences.columnCount,
7869
7881
  effectiveValue: this.settings.columnCount || null,
7870
- isEffective: this.layout !== b.fixed && !this.settings.scroll,
7882
+ isEffective: this.layout !== w.fixed && !this.settings.scroll,
7871
7883
  onChange: (t) => {
7872
7884
  this.updatePreference("columnCount", t ?? null);
7873
7885
  }
@@ -7899,7 +7911,7 @@ class Bi {
7899
7911
  return new A({
7900
7912
  initialValue: this.preferences.deprecatedFontSize,
7901
7913
  effectiveValue: CSS.supports("zoom", "1") ? this.settings.deprecatedFontSize || !1 : !0,
7902
- isEffective: this.layout !== b.fixed,
7914
+ isEffective: this.layout !== w.fixed,
7903
7915
  onChange: (t) => {
7904
7916
  this.updatePreference("deprecatedFontSize", t ?? null);
7905
7917
  }
@@ -7909,7 +7921,7 @@ class Bi {
7909
7921
  return new N({
7910
7922
  initialValue: this.preferences.fontFamily,
7911
7923
  effectiveValue: this.settings.fontFamily || null,
7912
- isEffective: this.layout !== b.fixed,
7924
+ isEffective: this.layout !== w.fixed,
7913
7925
  onChange: (t) => {
7914
7926
  this.updatePreference("fontFamily", t ?? null);
7915
7927
  }
@@ -7919,7 +7931,7 @@ class Bi {
7919
7931
  return new x({
7920
7932
  initialValue: this.preferences.fontSize,
7921
7933
  effectiveValue: this.settings.fontSize || 1,
7922
- isEffective: this.layout !== b.fixed,
7934
+ isEffective: this.layout !== w.fixed,
7923
7935
  onChange: (t) => {
7924
7936
  this.updatePreference("fontSize", t ?? null);
7925
7937
  },
@@ -7931,7 +7943,7 @@ class Bi {
7931
7943
  return new A({
7932
7944
  initialValue: this.preferences.fontSizeNormalize,
7933
7945
  effectiveValue: this.settings.fontSizeNormalize || !1,
7934
- isEffective: this.layout !== b.fixed && this.preferences.fontSizeNormalize !== null,
7946
+ isEffective: this.layout !== w.fixed && this.preferences.fontSizeNormalize !== null,
7935
7947
  onChange: (t) => {
7936
7948
  this.updatePreference("fontSizeNormalize", t ?? null);
7937
7949
  }
@@ -7941,7 +7953,7 @@ class Bi {
7941
7953
  return new A({
7942
7954
  initialValue: this.preferences.fontOpticalSizing,
7943
7955
  effectiveValue: this.settings.fontOpticalSizing || !0,
7944
- isEffective: this.layout !== b.fixed && this.preferences.fontOpticalSizing !== null,
7956
+ isEffective: this.layout !== w.fixed && this.preferences.fontOpticalSizing !== null,
7945
7957
  onChange: (t) => {
7946
7958
  this.updatePreference("fontOpticalSizing", t ?? null);
7947
7959
  }
@@ -7951,7 +7963,7 @@ class Bi {
7951
7963
  return new x({
7952
7964
  initialValue: this.preferences.fontWeight,
7953
7965
  effectiveValue: this.settings.fontWeight || 400,
7954
- isEffective: this.layout !== b.fixed && this.preferences.fontWeight !== null,
7966
+ isEffective: this.layout !== w.fixed && this.preferences.fontWeight !== null,
7955
7967
  onChange: (t) => {
7956
7968
  this.updatePreference("fontWeight", t ?? null);
7957
7969
  },
@@ -7963,7 +7975,7 @@ class Bi {
7963
7975
  return new x({
7964
7976
  initialValue: this.preferences.fontWidth,
7965
7977
  effectiveValue: this.settings.fontWidth || 100,
7966
- isEffective: this.layout !== b.fixed && this.preferences.fontWidth !== null,
7978
+ isEffective: this.layout !== w.fixed && this.preferences.fontWidth !== null,
7967
7979
  onChange: (t) => {
7968
7980
  this.updatePreference("fontWidth", t ?? null);
7969
7981
  },
@@ -7975,7 +7987,7 @@ class Bi {
7975
7987
  return new A({
7976
7988
  initialValue: this.preferences.hyphens,
7977
7989
  effectiveValue: this.settings.hyphens || !1,
7978
- isEffective: this.layout !== b.fixed && this.metadata?.effectiveReadingProgression === M.ltr && this.preferences.hyphens !== null,
7990
+ isEffective: this.layout !== w.fixed && this.metadata?.effectiveReadingProgression === M.ltr && this.preferences.hyphens !== null,
7979
7991
  onChange: (t) => {
7980
7992
  this.updatePreference("hyphens", t ?? null);
7981
7993
  }
@@ -8009,7 +8021,7 @@ class Bi {
8009
8021
  return new A({
8010
8022
  initialValue: this.preferences.iOSPatch,
8011
8023
  effectiveValue: this.settings.iOSPatch || !1,
8012
- isEffective: this.layout !== b.fixed,
8024
+ isEffective: this.layout !== w.fixed,
8013
8025
  onChange: (t) => {
8014
8026
  this.updatePreference("iOSPatch", t ?? null);
8015
8027
  }
@@ -8019,7 +8031,7 @@ class Bi {
8019
8031
  return new A({
8020
8032
  initialValue: this.preferences.iPadOSPatch,
8021
8033
  effectiveValue: this.settings.iPadOSPatch || !1,
8022
- isEffective: this.layout !== b.fixed,
8034
+ isEffective: this.layout !== w.fixed,
8023
8035
  onChange: (t) => {
8024
8036
  this.updatePreference("iPadOSPatch", t ?? null);
8025
8037
  }
@@ -8029,7 +8041,7 @@ class Bi {
8029
8041
  return new x({
8030
8042
  initialValue: this.preferences.letterSpacing,
8031
8043
  effectiveValue: this.settings.letterSpacing || 0,
8032
- isEffective: this.layout !== b.fixed && this.preferences.letterSpacing !== null,
8044
+ isEffective: this.layout !== w.fixed && this.preferences.letterSpacing !== null,
8033
8045
  onChange: (t) => {
8034
8046
  this.updatePreference("letterSpacing", t ?? null);
8035
8047
  },
@@ -8042,7 +8054,7 @@ class Bi {
8042
8054
  initialValue: this.preferences.ligatures,
8043
8055
  effectiveValue: this.settings.ligatures || !0,
8044
8056
  isEffective: (() => {
8045
- if (this.preferences.ligatures === null || this.layout === b.fixed)
8057
+ if (this.preferences.ligatures === null || this.layout === w.fixed)
8046
8058
  return !1;
8047
8059
  const t = this.metadata?.languages?.[0]?.toLowerCase();
8048
8060
  return !(t && ["zh", "ja", "ko", "mn-mong"].some((e) => t.startsWith(e)));
@@ -8056,7 +8068,7 @@ class Bi {
8056
8068
  return new x({
8057
8069
  initialValue: this.preferences.lineHeight,
8058
8070
  effectiveValue: this.settings.lineHeight,
8059
- isEffective: this.layout !== b.fixed && this.preferences.lineHeight !== null,
8071
+ isEffective: this.layout !== w.fixed && this.preferences.lineHeight !== null,
8060
8072
  onChange: (t) => {
8061
8073
  this.updatePreference("lineHeight", t ?? null);
8062
8074
  },
@@ -8068,7 +8080,7 @@ class Bi {
8068
8080
  return new N({
8069
8081
  initialValue: this.preferences.linkColor,
8070
8082
  effectiveValue: this.settings.linkColor || ft.linkColor,
8071
- isEffective: this.layout !== b.fixed && this.preferences.linkColor !== null,
8083
+ isEffective: this.layout !== w.fixed && this.preferences.linkColor !== null,
8072
8084
  onChange: (t) => {
8073
8085
  this.updatePreference("linkColor", t ?? null);
8074
8086
  }
@@ -8078,7 +8090,7 @@ class Bi {
8078
8090
  return new x({
8079
8091
  initialValue: this.preferences.maximalLineLength,
8080
8092
  effectiveValue: this.settings.maximalLineLength,
8081
- isEffective: this.layout !== b.fixed,
8093
+ isEffective: this.layout !== w.fixed,
8082
8094
  onChange: (t) => {
8083
8095
  this.updatePreference("maximalLineLength", t);
8084
8096
  },
@@ -8090,7 +8102,7 @@ class Bi {
8090
8102
  return new x({
8091
8103
  initialValue: this.preferences.minimalLineLength,
8092
8104
  effectiveValue: this.settings.minimalLineLength,
8093
- isEffective: this.layout !== b.fixed,
8105
+ isEffective: this.layout !== w.fixed,
8094
8106
  onChange: (t) => {
8095
8107
  this.updatePreference("minimalLineLength", t);
8096
8108
  },
@@ -8102,7 +8114,7 @@ class Bi {
8102
8114
  return new A({
8103
8115
  initialValue: this.preferences.noRuby,
8104
8116
  effectiveValue: this.settings.noRuby || !1,
8105
- isEffective: this.layout !== b.fixed && this.metadata?.languages?.includes("ja") || !1,
8117
+ isEffective: this.layout !== w.fixed && this.metadata?.languages?.includes("ja") || !1,
8106
8118
  onChange: (t) => {
8107
8119
  this.updatePreference("noRuby", t ?? null);
8108
8120
  }
@@ -8112,7 +8124,7 @@ class Bi {
8112
8124
  return new x({
8113
8125
  initialValue: this.preferences.optimalLineLength,
8114
8126
  effectiveValue: this.settings.optimalLineLength,
8115
- isEffective: this.layout !== b.fixed,
8127
+ isEffective: this.layout !== w.fixed,
8116
8128
  onChange: (t) => {
8117
8129
  this.updatePreference("optimalLineLength", t);
8118
8130
  },
@@ -8124,7 +8136,7 @@ class Bi {
8124
8136
  return new N({
8125
8137
  initialValue: this.preferences.pageGutter,
8126
8138
  effectiveValue: this.settings.pageGutter,
8127
- isEffective: this.layout !== b.fixed && !this.settings.scroll,
8139
+ isEffective: this.layout !== w.fixed && !this.settings.scroll,
8128
8140
  onChange: (t) => {
8129
8141
  this.updatePreference("pageGutter", t ?? null);
8130
8142
  }
@@ -8134,7 +8146,7 @@ class Bi {
8134
8146
  return new x({
8135
8147
  initialValue: this.preferences.paragraphIndent,
8136
8148
  effectiveValue: this.settings.paragraphIndent || 0,
8137
- isEffective: this.layout !== b.fixed && this.preferences.paragraphIndent !== null,
8149
+ isEffective: this.layout !== w.fixed && this.preferences.paragraphIndent !== null,
8138
8150
  onChange: (t) => {
8139
8151
  this.updatePreference("paragraphIndent", t ?? null);
8140
8152
  },
@@ -8146,7 +8158,7 @@ class Bi {
8146
8158
  return new x({
8147
8159
  initialValue: this.preferences.paragraphSpacing,
8148
8160
  effectiveValue: this.settings.paragraphSpacing || 0,
8149
- isEffective: this.layout !== b.fixed && this.preferences.paragraphSpacing !== null,
8161
+ isEffective: this.layout !== w.fixed && this.preferences.paragraphSpacing !== null,
8150
8162
  onChange: (t) => {
8151
8163
  this.updatePreference("paragraphSpacing", t ?? null);
8152
8164
  },
@@ -8158,7 +8170,7 @@ class Bi {
8158
8170
  return new A({
8159
8171
  initialValue: this.preferences.scroll,
8160
8172
  effectiveValue: this.settings.scroll || !1,
8161
- isEffective: this.layout !== b.fixed,
8173
+ isEffective: this.layout !== w.fixed,
8162
8174
  onChange: (t) => {
8163
8175
  this.updatePreference("scroll", t ?? null);
8164
8176
  }
@@ -8168,7 +8180,7 @@ class Bi {
8168
8180
  return new N({
8169
8181
  initialValue: this.preferences.scrollPaddingTop,
8170
8182
  effectiveValue: this.settings.scrollPaddingTop || 0,
8171
- isEffective: this.layout !== b.fixed && !!this.settings.scroll && this.preferences.scrollPaddingTop !== null,
8183
+ isEffective: this.layout !== w.fixed && !!this.settings.scroll && this.preferences.scrollPaddingTop !== null,
8172
8184
  onChange: (t) => {
8173
8185
  this.updatePreference("scrollPaddingTop", t ?? null);
8174
8186
  }
@@ -8178,7 +8190,7 @@ class Bi {
8178
8190
  return new N({
8179
8191
  initialValue: this.preferences.scrollPaddingBottom,
8180
8192
  effectiveValue: this.settings.scrollPaddingBottom || 0,
8181
- isEffective: this.layout !== b.fixed && !!this.settings.scroll && this.preferences.scrollPaddingBottom !== null,
8193
+ isEffective: this.layout !== w.fixed && !!this.settings.scroll && this.preferences.scrollPaddingBottom !== null,
8182
8194
  onChange: (t) => {
8183
8195
  this.updatePreference("scrollPaddingBottom", t ?? null);
8184
8196
  }
@@ -8188,7 +8200,7 @@ class Bi {
8188
8200
  return new N({
8189
8201
  initialValue: this.preferences.scrollPaddingLeft,
8190
8202
  effectiveValue: this.settings.scrollPaddingLeft || 0,
8191
- isEffective: this.layout !== b.fixed && !!this.settings.scroll && this.preferences.scrollPaddingLeft !== null,
8203
+ isEffective: this.layout !== w.fixed && !!this.settings.scroll && this.preferences.scrollPaddingLeft !== null,
8192
8204
  onChange: (t) => {
8193
8205
  this.updatePreference("scrollPaddingLeft", t ?? null);
8194
8206
  }
@@ -8198,7 +8210,7 @@ class Bi {
8198
8210
  return new N({
8199
8211
  initialValue: this.preferences.scrollPaddingRight,
8200
8212
  effectiveValue: this.settings.scrollPaddingRight || 0,
8201
- isEffective: this.layout !== b.fixed && !!this.settings.scroll && this.preferences.scrollPaddingRight !== null,
8213
+ isEffective: this.layout !== w.fixed && !!this.settings.scroll && this.preferences.scrollPaddingRight !== null,
8202
8214
  onChange: (t) => {
8203
8215
  this.updatePreference("scrollPaddingRight", t ?? null);
8204
8216
  }
@@ -8208,7 +8220,7 @@ class Bi {
8208
8220
  return new N({
8209
8221
  initialValue: this.preferences.selectionBackgroundColor,
8210
8222
  effectiveValue: this.settings.selectionBackgroundColor || ft.selectionBackgroundColor,
8211
- isEffective: this.layout !== b.fixed && this.preferences.selectionBackgroundColor !== null,
8223
+ isEffective: this.layout !== w.fixed && this.preferences.selectionBackgroundColor !== null,
8212
8224
  onChange: (t) => {
8213
8225
  this.updatePreference("selectionBackgroundColor", t ?? null);
8214
8226
  }
@@ -8218,7 +8230,7 @@ class Bi {
8218
8230
  return new N({
8219
8231
  initialValue: this.preferences.selectionTextColor,
8220
8232
  effectiveValue: this.settings.selectionTextColor || ft.selectionTextColor,
8221
- isEffective: this.layout !== b.fixed && this.preferences.selectionTextColor !== null,
8233
+ isEffective: this.layout !== w.fixed && this.preferences.selectionTextColor !== null,
8222
8234
  onChange: (t) => {
8223
8235
  this.updatePreference("selectionTextColor", t ?? null);
8224
8236
  }
@@ -8228,7 +8240,7 @@ class Bi {
8228
8240
  return new yn({
8229
8241
  initialValue: this.preferences.textAlign,
8230
8242
  effectiveValue: this.settings.textAlign || tt.start,
8231
- isEffective: this.layout !== b.fixed && this.preferences.textAlign !== null,
8243
+ isEffective: this.layout !== w.fixed && this.preferences.textAlign !== null,
8232
8244
  onChange: (t) => {
8233
8245
  this.updatePreference("textAlign", t ?? null);
8234
8246
  },
@@ -8239,7 +8251,7 @@ class Bi {
8239
8251
  return new N({
8240
8252
  initialValue: this.preferences.textColor,
8241
8253
  effectiveValue: this.settings.textColor || ft.textColor,
8242
- isEffective: this.layout !== b.fixed && this.preferences.textColor !== null,
8254
+ isEffective: this.layout !== w.fixed && this.preferences.textColor !== null,
8243
8255
  onChange: (t) => {
8244
8256
  this.updatePreference("textColor", t ?? null);
8245
8257
  }
@@ -8249,7 +8261,7 @@ class Bi {
8249
8261
  return new A({
8250
8262
  initialValue: this.preferences.textNormalization,
8251
8263
  effectiveValue: this.settings.textNormalization || !1,
8252
- isEffective: this.layout !== b.fixed,
8264
+ isEffective: this.layout !== w.fixed,
8253
8265
  onChange: (t) => {
8254
8266
  this.updatePreference("textNormalization", t ?? null);
8255
8267
  }
@@ -8259,7 +8271,7 @@ class Bi {
8259
8271
  return new N({
8260
8272
  initialValue: this.preferences.visitedColor,
8261
8273
  effectiveValue: this.settings.visitedColor || ft.visitedColor,
8262
- isEffective: this.layout !== b.fixed && this.preferences.visitedColor !== null,
8274
+ isEffective: this.layout !== w.fixed && this.preferences.visitedColor !== null,
8263
8275
  onChange: (t) => {
8264
8276
  this.updatePreference("visitedColor", t ?? null);
8265
8277
  }
@@ -8269,7 +8281,7 @@ class Bi {
8269
8281
  return new x({
8270
8282
  initialValue: this.preferences.wordSpacing,
8271
8283
  effectiveValue: this.settings.wordSpacing || 0,
8272
- isEffective: this.layout !== b.fixed && this.preferences.wordSpacing !== null,
8284
+ isEffective: this.layout !== w.fixed && this.preferences.wordSpacing !== null,
8273
8285
  onChange: (t) => {
8274
8286
  this.updatePreference("wordSpacing", t ?? null);
8275
8287
  },
@@ -8287,7 +8299,7 @@ function Lt(r) {
8287
8299
  const t = getComputedStyle(r), e = parseFloat(t.paddingLeft || "0"), i = parseFloat(t.paddingRight || "0");
8288
8300
  return r.clientWidth - e - i;
8289
8301
  }
8290
- function Qr(r) {
8302
+ function to(r) {
8291
8303
  const t = getComputedStyle(r), e = parseFloat(t.paddingTop || "0"), i = parseFloat(t.paddingBottom || "0");
8292
8304
  return r.clientHeight - e - i;
8293
8305
  }
@@ -8300,7 +8312,7 @@ class _n extends le {
8300
8312
  return this.a11yNormalize && (t["--USER__a11yNormalize"] = this.toFlag("a11y")), this.backgroundColor && (t["--USER__backgroundColor"] = this.backgroundColor), this.blendFilter && (t["--USER__blendFilter"] = this.toFlag("blend")), this.bodyHyphens && (t["--USER__bodyHyphens"] = this.bodyHyphens), this.colCount && (t["--USER__colCount"] = this.toUnitless(this.colCount)), this.darkenFilter === !0 ? t["--USER__darkenFilter"] = this.toFlag("darken") : typeof this.darkenFilter == "number" && (t["--USER__darkenFilter"] = this.toPercentage(this.darkenFilter)), this.deprecatedFontSize && (t["--USER__fontSizeImplementation"] = this.toFlag("deprecatedFontSize")), this.fontFamily && (t["--USER__fontFamily"] = this.fontFamily), this.fontOpticalSizing != null && (t["--USER__fontOpticalSizing"] = this.fontOpticalSizing), this.fontSize != null && (t["--USER__fontSize"] = this.toPercentage(this.fontSize, !0)), this.fontSizeNormalize && (t["--USER__fontSizeNormalize"] = this.toFlag("normalize")), this.fontWeight != null && (t["--USER__fontWeight"] = this.toUnitless(this.fontWeight)), this.fontWidth != null && (t["--USER__fontWidth"] = typeof this.fontWidth == "string" ? this.fontWidth : this.toUnitless(this.fontWidth)), this.invertFilter === !0 ? t["--USER__invertFilter"] = this.toFlag("invert") : typeof this.invertFilter == "number" && (t["--USER__invertFilter"] = this.toPercentage(this.invertFilter)), this.invertGaijiFilter === !0 ? t["--USER__invertGaiji"] = this.toFlag("invertGaiji") : typeof this.invertGaijiFilter == "number" && (t["--USER__invertGaiji"] = this.toPercentage(this.invertGaijiFilter)), this.iOSPatch && (t["--USER__iOSPatch"] = this.toFlag("iOSPatch")), this.iPadOSPatch && (t["--USER__iPadOSPatch"] = this.toFlag("iPadOSPatch")), this.letterSpacing != null && (t["--USER__letterSpacing"] = this.toRem(this.letterSpacing)), this.ligatures && (t["--USER__ligatures"] = this.ligatures), this.lineHeight != null && (t["--USER__lineHeight"] = this.toUnitless(this.lineHeight)), this.lineLength != null && (t["--USER__lineLength"] = this.toPx(this.lineLength)), this.linkColor && (t["--USER__linkColor"] = this.linkColor), this.noRuby && (t["--USER__noRuby"] = this.toFlag("noRuby")), this.paraIndent != null && (t["--USER__paraIndent"] = this.toRem(this.paraIndent)), this.paraSpacing != null && (t["--USER__paraSpacing"] = this.toRem(this.paraSpacing)), this.selectionBackgroundColor && (t["--USER__selectionBackgroundColor"] = this.selectionBackgroundColor), this.selectionTextColor && (t["--USER__selectionTextColor"] = this.selectionTextColor), this.textAlign && (t["--USER__textAlign"] = this.textAlign), this.textColor && (t["--USER__textColor"] = this.textColor), this.view && (t["--USER__view"] = this.toFlag(this.view)), this.visitedColor && (t["--USER__visitedColor"] = this.visitedColor), this.wordSpacing != null && (t["--USER__wordSpacing"] = this.toRem(this.wordSpacing)), t;
8301
8313
  }
8302
8314
  }
8303
- class to extends le {
8315
+ class eo extends le {
8304
8316
  constructor(t) {
8305
8317
  super(), this.backgroundColor = t.backgroundColor ?? null, this.baseFontFamily = t.baseFontFamily ?? null, this.baseFontSize = t.baseFontSize ?? null, this.baseLineHeight = t.baseLineHeight ?? null, this.boxSizingMedia = t.boxSizingMedia ?? null, this.boxSizingTable = t.boxSizingTable ?? null, this.colWidth = t.colWidth ?? null, this.colCount = t.colCount ?? null, this.colGap = t.colGap ?? null, this.codeFontFamily = t.codeFontFamily ?? null, this.compFontFamily = t.compFontFamily ?? null, this.defaultLineLength = t.defaultLineLength ?? null, this.flowSpacing = t.flowSpacing ?? null, this.humanistTf = t.humanistTf ?? null, this.linkColor = t.linkColor ?? null, this.maxMediaWidth = t.maxMediaWidth ?? null, this.maxMediaHeight = t.maxMediaHeight ?? null, this.modernTf = t.modernTf ?? null, this.monospaceTf = t.monospaceTf ?? null, this.noOverflow = t.noOverflow ?? null, this.noVerticalPagination = t.noVerticalPagination ?? null, this.oldStyleTf = t.oldStyleTf ?? null, this.pageGutter = t.pageGutter ?? null, this.paraIndent = t.paraIndent ?? null, this.paraSpacing = t.paraSpacing ?? null, this.primaryColor = t.primaryColor ?? null, this.scrollPaddingBottom = t.scrollPaddingBottom ?? null, this.scrollPaddingLeft = t.scrollPaddingLeft ?? null, this.scrollPaddingRight = t.scrollPaddingRight ?? null, this.scrollPaddingTop = t.scrollPaddingTop ?? null, this.sansSerifJa = t.sansSerifJa ?? null, this.sansSerifJaV = t.sansSerifJaV ?? null, this.sansTf = t.sansTf ?? null, this.secondaryColor = t.secondaryColor ?? null, this.selectionBackgroundColor = t.selectionBackgroundColor ?? null, this.selectionTextColor = t.selectionTextColor ?? null, this.serifJa = t.serifJa ?? null, this.serifJaV = t.serifJaV ?? null, this.textColor = t.textColor ?? null, this.typeScale = t.typeScale ?? null, this.visitedColor = t.visitedColor ?? null, this.experiments = t.experiments ?? null;
8306
8318
  }
@@ -8311,7 +8323,7 @@ class to extends le {
8311
8323
  }), t;
8312
8324
  }
8313
8325
  }
8314
- class eo {
8326
+ class io {
8315
8327
  constructor(t) {
8316
8328
  this.rsProperties = t.rsProperties, this.userProperties = t.userProperties, this.lineLengths = t.lineLengths, this.container = t.container, this.containerParent = t.container.parentElement || document.documentElement, this.constraint = t.constraint, this.isCJKVertical = t.isCJKVertical ?? !1, this.cachedColCount = t.userProperties.colCount, this.effectiveContainerWidth = Lt(this.containerParent);
8317
8329
  }
@@ -8381,51 +8393,51 @@ class eo {
8381
8393
  // should be the same as uncompensated when scale >= 1
8382
8394
  paginate(t, e, i) {
8383
8395
  const n = Math.round(Lt(this.containerParent) - this.constraint), s = this.getCompensatedMetrics(t, e), { zoomCompensation: o, optimal: a, minimal: l, maximal: h } = s, c = () => n >= a && h !== null ? Math.min(Math.round(h * o), n) : n;
8384
- let u = 1, p = n;
8396
+ let d = 1, f = n;
8385
8397
  if (i === void 0)
8386
8398
  return {
8387
8399
  colCount: void 0,
8388
- effectiveContainerWidth: p,
8389
- effectiveLineLength: Math.round(p / u * o)
8400
+ effectiveContainerWidth: f,
8401
+ effectiveLineLength: Math.round(f / d * o)
8390
8402
  };
8391
8403
  if (i === null)
8392
8404
  if (n >= a && h !== null) {
8393
- u = Math.floor(n / a);
8394
- const m = Math.round(u * (h * o));
8395
- p = Math.min(m, n);
8405
+ d = Math.floor(n / a);
8406
+ const g = Math.round(d * (h * o));
8407
+ f = Math.min(g, n);
8396
8408
  } else
8397
- p = c();
8409
+ f = c();
8398
8410
  else if (i > 1) {
8399
- const m = Math.round(i * (l !== null ? l : a));
8400
- if (n >= m)
8401
- if (u = i, h === null)
8402
- p = n;
8411
+ const g = Math.round(i * (l !== null ? l : a));
8412
+ if (n >= g)
8413
+ if (d = i, h === null)
8414
+ f = n;
8403
8415
  else {
8404
- const d = Math.round(u * (h * o));
8405
- p = Math.min(d, n);
8416
+ const u = Math.round(d * (h * o));
8417
+ f = Math.min(u, n);
8406
8418
  }
8407
8419
  else if (l !== null && n < Math.round(i * l))
8408
- if (u = Math.floor(n / l), u <= 1)
8409
- u = 1, p = c();
8420
+ if (d = Math.floor(n / l), d <= 1)
8421
+ d = 1, f = c();
8410
8422
  else {
8411
- const d = Math.round(u * (a * o));
8412
- p = Math.min(d, n);
8423
+ const u = Math.round(d * (a * o));
8424
+ f = Math.min(u, n);
8413
8425
  }
8414
8426
  else {
8415
- u = i;
8416
- const d = Math.round(u * (a * o));
8417
- p = Math.min(d, n);
8427
+ d = i;
8428
+ const u = Math.round(d * (a * o));
8429
+ f = Math.min(u, n);
8418
8430
  }
8419
8431
  } else
8420
- u = 1, p = c();
8432
+ d = 1, f = c();
8421
8433
  return {
8422
- colCount: u,
8423
- effectiveContainerWidth: p,
8424
- effectiveLineLength: Math.round(p / u / (t && t >= 1 ? t : 1) * o)
8434
+ colCount: d,
8435
+ effectiveContainerWidth: f,
8436
+ effectiveLineLength: Math.round(f / d / (t && t >= 1 ? t : 1) * o)
8425
8437
  };
8426
8438
  }
8427
8439
  computeCJKVerticalLength(t, e) {
8428
- const i = Math.round(Lt(this.containerParent) - this.constraint), n = Math.round(Qr(this.containerParent)), s = this.getCompensatedMetrics(t, e), o = s.maximal !== null ? Math.min(Math.round(s.maximal * s.zoomCompensation), n) : n;
8440
+ const i = Math.round(Lt(this.containerParent) - this.constraint), n = Math.round(to(this.containerParent)), s = this.getCompensatedMetrics(t, e), o = s.maximal !== null ? Math.min(Math.round(s.maximal * s.zoomCompensation), n) : n;
8429
8441
  return { colCount: void 0, effectiveContainerWidth: i, effectiveLineLength: o };
8430
8442
  }
8431
8443
  // This behaves as paginate where colCount = 1
@@ -8435,8 +8447,8 @@ class eo {
8435
8447
  if (a === null)
8436
8448
  c = i;
8437
8449
  else {
8438
- const u = Math.min(Math.round(a * s), i);
8439
- c = e ? u : Math.round(u * s);
8450
+ const d = Math.min(Math.round(a * s), i);
8451
+ c = e ? d : Math.round(d * s);
8440
8452
  }
8441
8453
  return {
8442
8454
  colCount: l,
@@ -8452,7 +8464,7 @@ class eo {
8452
8464
  this.userProperties.colCount = t.colCount, this.userProperties.lineLength = t.effectiveLineLength, this.effectiveContainerWidth = t.effectiveContainerWidth, this.container.style.width = `${this.effectiveContainerWidth}px`;
8453
8465
  }
8454
8466
  }
8455
- const io = `// Note: we aren't blocking some of the events right now to try and be as nonintrusive as possible.
8467
+ const no = `// Note: we aren't blocking some of the events right now to try and be as nonintrusive as possible.
8456
8468
  // For a more comprehensive implementation, see https://github.com/hackademix/noscript/blob/3a83c0e4a506f175e38b0342dad50cdca3eae836/src/content/syncFetchPolicy.js#L142
8457
8469
  // The snippet of code at the beginning of this source is an attempt at defence against JS using persistent storage
8458
8470
  (function() {
@@ -8518,8 +8530,8 @@ const io = `// Note: we aren't blocking some of the events right now to try and
8518
8530
  window.addEventListener("load", window._readium_eventBlocker, true);
8519
8531
  })();
8520
8532
  `;
8521
- async function no(r, t) {
8522
- const e = r.effectiveLayout === b.fixed, i = t.filter((a) => a.mediaType.isHTML).map((a) => a.href), n = i.length > 0 ? i : [/\.xhtml$/, /\.html$/], s = [
8533
+ async function so(r, t) {
8534
+ const e = r.effectiveLayout === w.fixed, i = t.filter((a) => a.mediaType.isHTML).map((a) => a.href), n = i.length > 0 ? i : [/\.xhtml$/, /\.html$/], s = [
8523
8535
  // CSS Selector Generator - always injected
8524
8536
  {
8525
8537
  id: "css-selector-generator",
@@ -8532,7 +8544,7 @@ async function no(r, t) {
8532
8544
  id: "execution-prevention",
8533
8545
  as: "script",
8534
8546
  target: "head",
8535
- blob: new Blob([vt(io)], { type: "text/javascript" }),
8547
+ blob: new Blob([vt(no)], { type: "text/javascript" }),
8536
8548
  condition: (a) => !!(a.querySelector("script") || a.querySelector("body[onload]:not(body[onload=''])"))
8537
8549
  }
8538
8550
  ], o = [
@@ -8550,21 +8562,21 @@ async function no(r, t) {
8550
8562
  let l, h, c;
8551
8563
  switch (a) {
8552
8564
  case "rtl": {
8553
- const [u, p, m] = await Promise.all([
8565
+ const [d, f, g] = await Promise.all([
8554
8566
  import("./ReadiumCSS-before-DwBLxUVH.js"),
8555
8567
  import("./ReadiumCSS-default-BhdLiyWp.js"),
8556
8568
  import("./ReadiumCSS-after-d5mC4cme.js")
8557
8569
  ]);
8558
- l = u.default, h = p.default, c = m.default;
8570
+ l = d.default, h = f.default, c = g.default;
8559
8571
  break;
8560
8572
  }
8561
8573
  case "cjk-horizontal": {
8562
- const [u, p, m] = await Promise.all([
8574
+ const [d, f, g] = await Promise.all([
8563
8575
  import("./ReadiumCSS-before-CG-KmDa3.js"),
8564
8576
  import("./ReadiumCSS-default-N65xNiIp.js"),
8565
8577
  import("./ReadiumCSS-after-XUKPAxfT.js")
8566
8578
  ]);
8567
- l = u.default, h = p.default, c = m.default;
8579
+ l = d.default, h = f.default, c = g.default;
8568
8580
  break;
8569
8581
  }
8570
8582
  case "cjk-vertical":
@@ -8572,21 +8584,21 @@ async function no(r, t) {
8572
8584
  // layout as CJK vertical-rl — it is an outlier handled by the
8573
8585
  // same stylesheet set per the Readium CSS spec.
8574
8586
  case "mongolian-vertical": {
8575
- const [u, p, m] = await Promise.all([
8587
+ const [d, f, g] = await Promise.all([
8576
8588
  import("./ReadiumCSS-before-BNTwR8Qm.js"),
8577
8589
  import("./ReadiumCSS-default-BesyZHRU.js"),
8578
8590
  import("./ReadiumCSS-after-ClF4TBzj.js")
8579
8591
  ]);
8580
- l = u.default, h = p.default, c = m.default;
8592
+ l = d.default, h = f.default, c = g.default;
8581
8593
  break;
8582
8594
  }
8583
8595
  default: {
8584
- const [u, p, m] = await Promise.all([
8596
+ const [d, f, g] = await Promise.all([
8585
8597
  import("./ReadiumCSS-before-8FMq19-x.js"),
8586
8598
  import("./ReadiumCSS-default-AIAk8uwU.js"),
8587
8599
  import("./ReadiumCSS-after-D7unrNI9.js")
8588
8600
  ]);
8589
- l = u.default, h = p.default, c = m.default;
8601
+ l = d.default, h = f.default, c = g.default;
8590
8602
  break;
8591
8603
  }
8592
8604
  }
@@ -8604,7 +8616,7 @@ async function no(r, t) {
8604
8616
  target: "head",
8605
8617
  blob: new Blob([_t(h)], { type: "text/css" }),
8606
8618
  rel: "stylesheet",
8607
- condition: (u) => !(u.querySelector("link[rel='stylesheet']") || u.querySelector("style") || u.querySelector("[style]:not([style=''])"))
8619
+ condition: (d) => !(d.querySelector("link[rel='stylesheet']") || d.querySelector("style") || d.querySelector("[style]:not([style=''])"))
8608
8620
  },
8609
8621
  // Readium CSS After - only for reflowable
8610
8622
  {
@@ -8615,12 +8627,12 @@ async function no(r, t) {
8615
8627
  rel: "stylesheet"
8616
8628
  }
8617
8629
  ), (a === "cjk-horizontal" || a === "cjk-vertical") && (r.description === "ebpaj-guide-1.0" || r.otherMetadata?.["ebpaj:guide-version"] !== void 0)) {
8618
- const { default: p } = await import("./ReadiumCSS-ebpaj_fonts_patch-Dt2XliTg.js");
8630
+ const { default: f } = await import("./ReadiumCSS-ebpaj_fonts_patch-Dt2XliTg.js");
8619
8631
  o.push({
8620
8632
  id: "readium-css-ebpaj",
8621
8633
  as: "link",
8622
8634
  target: "head",
8623
- blob: new Blob([_t(p)], { type: "text/css" }),
8635
+ blob: new Blob([_t(f)], { type: "text/css" }),
8624
8636
  rel: "stylesheet"
8625
8637
  });
8626
8638
  }
@@ -8633,7 +8645,7 @@ async function no(r, t) {
8633
8645
  }
8634
8646
  ];
8635
8647
  }
8636
- const so = (r) => ({
8648
+ const ro = (r) => ({
8637
8649
  frameLoaded: r.frameLoaded || (() => {
8638
8650
  }),
8639
8651
  positionChanged: r.positionChanged || (() => {
@@ -8664,10 +8676,10 @@ class Ln extends dn {
8664
8676
  readingOrder: [],
8665
8677
  progressions: /* @__PURE__ */ new Map(),
8666
8678
  positions: null
8667
- }, this.pub = e, this.container = t, this.listeners = so(i), this.currentLocation = s, n.length && (this.positions = n), this._preferences = new Ft(o.preferences), this._defaults = new Gr(o.defaults), this._settings = new Vi(this._preferences, this._defaults);
8668
- const a = bt(e.metadata), l = a === "cjk-horizontal", h = a === "cjk-vertical", u = h || a === "mongolian-vertical", p = l || h;
8669
- this._css = new eo({
8670
- rsProperties: new to({ noVerticalPagination: u || void 0 }),
8679
+ }, this.pub = e, this.container = t, this.listeners = ro(i), this.currentLocation = s, n.length && (this.positions = n), this._preferences = new Ft(o.preferences), this._defaults = new Xr(o.defaults), this._settings = new Vi(this._preferences, this._defaults);
8680
+ const a = bt(e.metadata), l = a === "cjk-horizontal", h = a === "cjk-vertical", d = h || a === "mongolian-vertical", f = l || h;
8681
+ this._css = new io({
8682
+ rsProperties: new eo({ noVerticalPagination: d || void 0 }),
8671
8683
  userProperties: new _n({}),
8672
8684
  lineLengths: new kt({
8673
8685
  optimalChars: this._settings.optimalLineLength,
@@ -8677,33 +8689,33 @@ class Ln extends dn {
8677
8689
  fontFace: this._settings.fontFamily,
8678
8690
  letterSpacing: this._settings.letterSpacing,
8679
8691
  wordSpacing: this._settings.wordSpacing,
8680
- isCJK: p
8692
+ isCJK: f
8681
8693
  // sample: this.pub.metadata.description
8682
8694
  }),
8683
8695
  container: t,
8684
8696
  constraint: this._settings.constraint,
8685
- isCJKVertical: u
8686
- }), this._layout = Ln.determineLayout(e, !!this._settings.scroll), this.currentProgression = e.metadata.effectiveReadingProgression, this._injectablesConfig = o.injectables || { rules: [], allowedDomains: [] }, this._readiumRulesPromise = no(e.metadata, e.readingOrder.items), this._contentProtection = o.contentProtection || {}, this._keyboardPeripherals = this.mergeKeyboardPeripherals(
8697
+ isCJKVertical: d
8698
+ }), this._layout = Ln.determineLayout(e, !!this._settings.scroll), this.currentProgression = e.metadata.effectiveReadingProgression, this._injectablesConfig = o.injectables || { rules: [], allowedDomains: [] }, this._readiumRulesPromise = so(e.metadata, e.readingOrder.items), this._contentProtection = o.contentProtection || {}, this._keyboardPeripherals = this.mergeKeyboardPeripherals(
8687
8699
  this._contentProtection,
8688
8700
  o.keyboardPeripherals || []
8689
- ), (this._contentProtection.disableContextMenu || this._contentProtection.checkAutomation || this._contentProtection.checkIFrameEmbedding || this._contentProtection.monitorDevTools || this._contentProtection.protectPrinting?.disable) && (this._navigatorProtector = new Ye(this._contentProtection), this._suspiciousActivityListener = (m) => {
8690
- const { type: d, ...f } = m.detail;
8691
- d === "context_menu" ? this.listeners.contextMenu(f) : this.listeners.contentProtection(d, f);
8692
- }, window.addEventListener(at, this._suspiciousActivityListener)), this._keyboardPeripherals.length > 0 && (this._keyboardPeripheralsManager = new qe({
8701
+ ), (this._contentProtection.disableContextMenu || this._contentProtection.checkAutomation || this._contentProtection.checkIFrameEmbedding || this._contentProtection.monitorDevTools || this._contentProtection.protectPrinting?.disable) && (this._navigatorProtector = new Ye(this._contentProtection), this._suspiciousActivityListener = (g) => {
8702
+ const { type: u, ...p } = g.detail;
8703
+ u === "context_menu" ? this.listeners.contextMenu(p) : this.listeners.contentProtection(u, p);
8704
+ }, window.addEventListener(lt, this._suspiciousActivityListener)), this._keyboardPeripherals.length > 0 && (this._keyboardPeripheralsManager = new qe({
8693
8705
  keyboardPeripherals: this._keyboardPeripherals
8694
- }), this._keyboardPeripheralListener = (m) => {
8695
- const d = m.detail;
8696
- this.listeners.peripheral(d);
8697
- }, window.addEventListener(lt, this._keyboardPeripheralListener)), this.resizeObserver = new ResizeObserver(() => this.ownerWindow.requestAnimationFrame(async () => await this.resizeHandler())), this.resizeObserver.observe(this.container.parentElement || document.documentElement);
8706
+ }), this._keyboardPeripheralListener = (g) => {
8707
+ const u = g.detail;
8708
+ this.listeners.peripheral(u);
8709
+ }, window.addEventListener(ht, this._keyboardPeripheralListener)), this.resizeObserver = new ResizeObserver(() => this.ownerWindow.requestAnimationFrame(async () => await this.resizeHandler())), this.resizeObserver.observe(this.container.parentElement || document.documentElement);
8698
8710
  }
8699
8711
  static determineLayout(t, e) {
8700
8712
  const i = t.metadata.effectiveLayout;
8701
- if (i === b.fixed || t.metadata.otherMetadata && "http://openmangaformat.org/schema/1.0#version" in t.metadata.otherMetadata || t.metadata?.conformsTo?.includes(qi.DIVINA))
8702
- return b.fixed;
8703
- if (i === b.scrolled)
8704
- return b.scrolled;
8713
+ if (i === w.fixed || t.metadata.otherMetadata && "http://openmangaformat.org/schema/1.0#version" in t.metadata.otherMetadata || t.metadata?.conformsTo?.includes(qi.DIVINA))
8714
+ return w.fixed;
8715
+ if (i === w.scrolled)
8716
+ return w.scrolled;
8705
8717
  const n = bt(t.metadata);
8706
- return n === "cjk-vertical" || n === "mongolian-vertical" || i === b.reflowable && e ? b.scrolled : b.reflowable;
8718
+ return n === "cjk-vertical" || n === "mongolian-vertical" || i === w.reflowable && e ? w.scrolled : w.reflowable;
8707
8719
  }
8708
8720
  async load() {
8709
8721
  if (this.positions?.length || (this.positions = await this.pub.positionsFromManifest()), !this._injector) {
@@ -8713,8 +8725,8 @@ class Ln extends dn {
8713
8725
  allowedDomains: this._injectablesConfig.allowedDomains
8714
8726
  });
8715
8727
  }
8716
- if (this._layout === b.fixed)
8717
- this.framePool = new $r(
8728
+ if (this._layout === w.fixed)
8729
+ this.framePool = new Gr(
8718
8730
  this.container,
8719
8731
  this.positions,
8720
8732
  this.pub,
@@ -8727,7 +8739,7 @@ class Ln extends dn {
8727
8739
  else {
8728
8740
  await this.updateCSS(!1);
8729
8741
  const t = this.compileCSSProperties(this._css);
8730
- this.framePool = new Tr(
8742
+ this.framePool = new Nr(
8731
8743
  this.container,
8732
8744
  this.positions,
8733
8745
  t,
@@ -8739,7 +8751,7 @@ class Ln extends dn {
8739
8751
  this.currentLocation === void 0 && (this.currentLocation = this.positions[0]), await this.resizeHandler(), await this.apply();
8740
8752
  }
8741
8753
  get settings() {
8742
- if (this._layout === b.fixed)
8754
+ if (this._layout === w.fixed)
8743
8755
  return Object.freeze({ ...this._settings });
8744
8756
  {
8745
8757
  const t = this._css.userProperties.colCount || this._css.rsProperties.colCount || this._settings.columnCount;
@@ -8754,7 +8766,7 @@ class Ln extends dn {
8754
8766
  }
8755
8767
  async applyPreferences() {
8756
8768
  const t = this._settings;
8757
- this._settings = new Vi(this._preferences, this._defaults), this._preferencesEditor !== null && (this._preferencesEditor = new Bi(this._preferences, this.settings, this.pub.metadata)), this._layout === b.fixed ? this.handleFXLPrefs(t, this._settings) : await this.updateCSS(!0);
8769
+ this._settings = new Vi(this._preferences, this._defaults), this._preferencesEditor !== null && (this._preferencesEditor = new Bi(this._preferences, this.settings, this.pub.metadata)), this._layout === w.fixed ? this.handleFXLPrefs(t, this._settings) : await this.updateCSS(!0);
8758
8770
  }
8759
8771
  // TODO: fit, etc.
8760
8772
  handleFXLPrefs(t, e) {
@@ -8774,11 +8786,11 @@ class Ln extends dn {
8774
8786
  async commitCSS(t) {
8775
8787
  if (!this.framePool) return;
8776
8788
  const e = this.compileCSSProperties(t);
8777
- this.framePool.setCSSProperties(e), this._css.userProperties.view === "paged" && this._layout === b.scrolled ? await this.setLayout(b.reflowable) : this._css.userProperties.view === "scroll" && this._layout === b.reflowable && await this.setLayout(b.scrolled), this._css.setContainerWidth();
8789
+ this.framePool.setCSSProperties(e), this._css.userProperties.view === "paged" && this._layout === w.scrolled ? await this.setLayout(w.reflowable) : this._css.userProperties.view === "scroll" && this._layout === w.reflowable && await this.setLayout(w.scrolled), this._css.setContainerWidth();
8778
8790
  }
8779
8791
  async resizeHandler() {
8780
8792
  const t = this.container.parentElement || document.documentElement;
8781
- if (this._layout === b.fixed) {
8793
+ if (this._layout === w.fixed) {
8782
8794
  if (this.container.style.width = `${Lt(t) - this._settings.constraint}px`, !this.framePool) return;
8783
8795
  this.framePool.resizeHandler();
8784
8796
  } else {
@@ -8862,7 +8874,7 @@ class Ln extends dn {
8862
8874
  }
8863
8875
  } else console.log("Clicked on", l);
8864
8876
  } else {
8865
- if (this._layout === b.fixed && this.framePool.doNotDisturb && (n.doNotDisturb = !0), this._layout === b.fixed && (this.currentProgression === M.rtl || this.currentProgression === M.ltr) && this.framePool.currentFrames.length > 1) {
8877
+ if (this._layout === w.fixed && this.framePool.doNotDisturb && (n.doNotDisturb = !0), this._layout === w.fixed && (this.currentProgression === M.rtl || this.currentProgression === M.ltr) && this.framePool.currentFrames.length > 1) {
8866
8878
  const c = this.framePool.currentFrames;
8867
8879
  n.targetFrameSrc === c[this.currentProgression === M.rtl ? 0 : 1]?.source && (n.x += (c[this.currentProgression === M.rtl ? 1 : 0]?.iframe.contentWindow?.innerWidth ?? 0) * window.devicePixelRatio);
8868
8880
  }
@@ -8917,14 +8929,14 @@ class Ln extends dn {
8917
8929
  }
8918
8930
  determineModules() {
8919
8931
  let t = Array.from(Te.keys());
8920
- if (this._layout === b.fixed)
8921
- return t.filter((n) => fs.includes(n));
8932
+ if (this._layout === w.fixed)
8933
+ return t.filter((n) => ms.includes(n));
8922
8934
  t = t.filter((n) => gs.includes(n));
8923
8935
  const e = bt(this.pub.metadata);
8924
8936
  if (e === "cjk-vertical" || e === "mongolian-vertical")
8925
8937
  return t.filter((n) => n !== "column_snapper" && n !== "scroll_snapper");
8926
8938
  const i = t;
8927
- return this._layout === b.scrolled ? t = i.filter((n) => n !== "column_snapper" && n !== "cjk_vertical_snapper") : t = i.filter((n) => n !== "scroll_snapper" && n !== "cjk_vertical_snapper"), t;
8939
+ return this._layout === w.scrolled ? t = i.filter((n) => n !== "column_snapper" && n !== "cjk_vertical_snapper") : t = i.filter((n) => n !== "scroll_snapper" && n !== "cjk_vertical_snapper"), t;
8928
8940
  }
8929
8941
  // Start listening to messages from the current iframe
8930
8942
  attachListener() {
@@ -8941,11 +8953,11 @@ class Ln extends dn {
8941
8953
  throw Error("Link for " + this.currentLocation.href + " not found!");
8942
8954
  }
8943
8955
  async destroy() {
8944
- this._suspiciousActivityListener && window.removeEventListener(at, this._suspiciousActivityListener), this._keyboardPeripheralListener && window.removeEventListener(lt, this._keyboardPeripheralListener), this._navigatorProtector?.destroy(), this._keyboardPeripheralsManager?.destroy(), await this.framePool?.destroy();
8956
+ this._suspiciousActivityListener && window.removeEventListener(lt, this._suspiciousActivityListener), this._keyboardPeripheralListener && window.removeEventListener(ht, this._keyboardPeripheralListener), this._navigatorProtector?.destroy(), this._keyboardPeripheralsManager?.destroy(), await this.framePool?.destroy();
8945
8957
  }
8946
8958
  async changeResource(t) {
8947
8959
  if (t === 0) return !1;
8948
- if (this._layout === b.fixed) {
8960
+ if (this._layout === w.fixed) {
8949
8961
  const n = this.framePool, s = n.viewport.positions[0];
8950
8962
  if (t === 1) {
8951
8963
  if (!n.next(n.perPage)) return !1;
@@ -9028,7 +9040,7 @@ class Ln extends dn {
9028
9040
  e(!1);
9029
9041
  return;
9030
9042
  }
9031
- this._isNavigating = !0, this._layout === b.fixed ? this.changeResource(-1).then((i) => {
9043
+ this._isNavigating = !0, this._layout === w.fixed ? this.changeResource(-1).then((i) => {
9032
9044
  this._isNavigating = !1, e(i);
9033
9045
  }) : this._cframes[0]?.msg?.send("go_prev", void 0, async (i) => {
9034
9046
  if (i)
@@ -9044,7 +9056,7 @@ class Ln extends dn {
9044
9056
  e(!1);
9045
9057
  return;
9046
9058
  }
9047
- this._isNavigating = !0, this._layout === b.fixed ? this.changeResource(1).then((i) => {
9059
+ this._isNavigating = !0, this._layout === w.fixed ? this.changeResource(1).then((i) => {
9048
9060
  this._isNavigating = !1, e(i);
9049
9061
  }) : this._cframes[0]?.msg?.send("go_next", void 0, async (i) => {
9050
9062
  if (i)
@@ -9059,7 +9071,7 @@ class Ln extends dn {
9059
9071
  return this.currentLocation;
9060
9072
  }
9061
9073
  get viewport() {
9062
- return this._layout === b.fixed ? this.framePool ? this.framePool.viewport : { readingOrder: [], progressions: /* @__PURE__ */ new Map(), positions: null } : this.reflowViewport;
9074
+ return this._layout === w.fixed ? this.framePool ? this.framePool.viewport : { readingOrder: [], progressions: /* @__PURE__ */ new Map(), positions: null } : this.reflowViewport;
9063
9075
  }
9064
9076
  get isScrollStart() {
9065
9077
  const t = this.viewport.readingOrder[0];
@@ -9145,7 +9157,7 @@ class Ln extends dn {
9145
9157
  return this.go(t.locator, e, i);
9146
9158
  }
9147
9159
  }
9148
- const ro = `// PreservePitchProcessor.js
9160
+ const oo = `// PreservePitchProcessor.js
9149
9161
  // AudioWorklet processor for pitch preservation via pitch shifting.
9150
9162
  //
9151
9163
  // Architecture:
@@ -9370,7 +9382,7 @@ class Ke {
9370
9382
  if (n)
9371
9383
  await e.audioWorklet.addModule(n);
9372
9384
  else {
9373
- const o = new Blob([ro], { type: "text/javascript" });
9385
+ const o = new Blob([oo], { type: "text/javascript" });
9374
9386
  s.url = URL.createObjectURL(o), await e.audioWorklet.addModule(s.url);
9375
9387
  }
9376
9388
  } catch (o) {
@@ -9390,7 +9402,7 @@ class Ke {
9390
9402
  this.workletNode && (this.workletNode.disconnect(), this.workletNode = null), this.url && (URL.revokeObjectURL(this.url), this.url = null);
9391
9403
  }
9392
9404
  }
9393
- class oo {
9405
+ class ao {
9394
9406
  constructor(t) {
9395
9407
  this.audioContext = null, this.sourceNode = null, this.gainNode = null, this.listeners = {}, this.isMutedValue = !1, this.isPlayingValue = !1, this.isPausedValue = !1, this.isLoadingValue = !1, this.isLoadedValue = !1, this.isEndedValue = !1, this.isStoppedValue = !1, this.worklet = null, this.webAudioActive = !1, this.boundOnCanPlayThrough = this.onCanPlayThrough.bind(this), this.boundOnTimeUpdate = this.onTimeUpdate.bind(this), this.boundOnError = this.onError.bind(this), this.boundOnEnded = this.onEnded.bind(this), this.boundOnStalled = this.onStalled.bind(this), this.boundOnEmptied = this.onEmptied.bind(this), this.boundOnSuspend = this.onSuspend.bind(this), this.boundOnWaiting = this.onWaiting.bind(this), this.boundOnLoadedMetadata = this.onLoadedMetadata.bind(this), this.boundOnSeeking = this.onSeeking.bind(this), this.boundOnSeeked = this.onSeeked.bind(this), this.boundOnPlay = this.onPlay.bind(this), this.boundOnPlaying = this.onPlaying.bind(this), this.boundOnPause = this.onPause.bind(this), this.boundOnProgress = this.onProgress.bind(this), this.playback = t.playback, this.mediaElement = document.createElement("audio"), this.mediaElement.addEventListener("canplaythrough", this.boundOnCanPlayThrough), this.mediaElement.addEventListener("timeupdate", this.boundOnTimeUpdate), this.mediaElement.addEventListener("error", this.boundOnError), this.mediaElement.addEventListener("ended", this.boundOnEnded), this.mediaElement.addEventListener("stalled", this.boundOnStalled), this.mediaElement.addEventListener("emptied", this.boundOnEmptied), this.mediaElement.addEventListener("suspend", this.boundOnSuspend), this.mediaElement.addEventListener("waiting", this.boundOnWaiting), this.mediaElement.addEventListener("loadedmetadata", this.boundOnLoadedMetadata), this.mediaElement.addEventListener("seeking", this.boundOnSeeking), this.mediaElement.addEventListener("seeked", this.boundOnSeeked), this.mediaElement.addEventListener("play", this.boundOnPlay), this.mediaElement.addEventListener("playing", this.boundOnPlaying), this.mediaElement.addEventListener("pause", this.boundOnPause), this.mediaElement.addEventListener("progress", this.boundOnProgress), this.mediaElement.currentTime = this.playback.state.currentTime;
9396
9408
  }
@@ -9658,7 +9670,7 @@ class oo {
9658
9670
  }
9659
9671
  class ce {
9660
9672
  constructor(t = {}) {
9661
- this.volume = F(t.volume, ie.range), this.playbackRate = F(t.playbackRate, ne.range), this.preservePitch = E(t.preservePitch), this.skipBackwardInterval = F(t.skipBackwardInterval, it.range), this.skipForwardInterval = F(t.skipForwardInterval, it.range), this.pollInterval = v(t.pollInterval), this.autoPlay = E(t.autoPlay), this.enableMediaSession = E(t.enableMediaSession);
9673
+ this.volume = F(t.volume, ie.range), this.playbackRate = F(t.playbackRate, ne.range), this.preservePitch = E(t.preservePitch), this.skipBackwardInterval = F(t.skipBackwardInterval, it.range), this.skipForwardInterval = F(t.skipForwardInterval, it.range), this.pollInterval = S(t.pollInterval), this.autoPlay = E(t.autoPlay), this.enableMediaSession = E(t.enableMediaSession);
9662
9674
  }
9663
9675
  merging(t) {
9664
9676
  const e = { ...this };
@@ -9667,9 +9679,9 @@ class ce {
9667
9679
  return new ce(e);
9668
9680
  }
9669
9681
  }
9670
- class ao {
9682
+ class lo {
9671
9683
  constructor(t = {}) {
9672
- this.volume = F(t.volume, ie.range) ?? 1, this.playbackRate = F(t.playbackRate, ne.range) ?? 1, this.preservePitch = E(t.preservePitch) ?? !0, this.skipBackwardInterval = F(t.skipBackwardInterval, it.range) ?? 10, this.skipForwardInterval = F(t.skipForwardInterval, it.range) ?? 10, this.pollInterval = v(t.pollInterval) ?? 1e3, this.autoPlay = E(t.autoPlay) ?? !0, this.enableMediaSession = E(t.enableMediaSession) ?? !0;
9684
+ this.volume = F(t.volume, ie.range) ?? 1, this.playbackRate = F(t.playbackRate, ne.range) ?? 1, this.preservePitch = E(t.preservePitch) ?? !0, this.skipBackwardInterval = F(t.skipBackwardInterval, it.range) ?? 10, this.skipForwardInterval = F(t.skipForwardInterval, it.range) ?? 10, this.pollInterval = S(t.pollInterval) ?? 1e3, this.autoPlay = E(t.autoPlay) ?? !0, this.enableMediaSession = E(t.enableMediaSession) ?? !0;
9673
9685
  }
9674
9686
  }
9675
9687
  class ji {
@@ -9777,7 +9789,7 @@ class $i {
9777
9789
  }
9778
9790
  }
9779
9791
  const Gi = 1, Xi = 1;
9780
- class lo {
9792
+ class ho {
9781
9793
  constructor(t, e, i = {}) {
9782
9794
  this.pool = /* @__PURE__ */ new Map(), this._audioEngine = t, this._publication = e, this._supportedAudioTypes = this.detectSupportedAudioTypes(), i.disableRemotePlayback && (this._audioEngine.getMediaElement().disableRemotePlayback = !0);
9783
9795
  }
@@ -9854,7 +9866,7 @@ class lo {
9854
9866
  this.pool.clear();
9855
9867
  }
9856
9868
  }
9857
- class ho {
9869
+ class co {
9858
9870
  constructor(t = {}) {
9859
9871
  this.dragstartHandler = (e) => {
9860
9872
  e.preventDefault(), e.stopPropagation(), t.onDragDetected?.(Array.from(e.dataTransfer?.types ?? []));
@@ -9870,7 +9882,7 @@ class ho {
9870
9882
  document.removeEventListener("dragstart", this.dragstartHandler, !0), document.removeEventListener("dragover", this.dragoverHandler, !0), document.removeEventListener("drop", this.dropHandler, !0), window.removeEventListener("unload", this.unloadHandler);
9871
9883
  }
9872
9884
  }
9873
- class co {
9885
+ class uo {
9874
9886
  constructor(t = {}) {
9875
9887
  this.copyHandler = (e) => {
9876
9888
  e.preventDefault(), e.stopPropagation(), t.onCopyBlocked?.();
@@ -9880,16 +9892,16 @@ class co {
9880
9892
  document.removeEventListener("copy", this.copyHandler, !0), window.removeEventListener("unload", this.unloadHandler);
9881
9893
  }
9882
9894
  }
9883
- class uo extends Ye {
9895
+ class po extends Ye {
9884
9896
  constructor(t = {}) {
9885
- super(t), t.disableDragAndDrop && (this.dragAndDropProtector = new ho({
9897
+ super(t), t.disableDragAndDrop && (this.dragAndDropProtector = new co({
9886
9898
  onDragDetected: (e) => {
9887
9899
  this.dispatchSuspiciousActivity("drag_detected", { dataTransferTypes: e, targetFrameSrc: "" });
9888
9900
  },
9889
9901
  onDropDetected: (e, i) => {
9890
9902
  this.dispatchSuspiciousActivity("drop_detected", { dataTransferTypes: e, fileCount: i, targetFrameSrc: "" });
9891
9903
  }
9892
- })), t.protectCopy && (this.copyProtector = new co({
9904
+ })), t.protectCopy && (this.copyProtector = new uo({
9893
9905
  onCopyBlocked: () => {
9894
9906
  this.dispatchSuspiciousActivity("bulk_copy", { targetFrameSrc: "" });
9895
9907
  }
@@ -9899,7 +9911,7 @@ class uo extends Ye {
9899
9911
  super.destroy(), this.dragAndDropProtector?.destroy(), this.copyProtector?.destroy();
9900
9912
  }
9901
9913
  }
9902
- const po = (r) => ({
9914
+ const fo = (r) => ({
9903
9915
  trackLoaded: r.trackLoaded ?? (() => {
9904
9916
  }),
9905
9917
  positionChanged: r.positionChanged ?? (() => {
@@ -9931,21 +9943,21 @@ const po = (r) => ({
9931
9943
  remotePlaybackStateChanged: r.remotePlaybackStateChanged ?? (() => {
9932
9944
  })
9933
9945
  });
9934
- class yo extends Ss {
9946
+ class bo extends Ps {
9935
9947
  constructor(t, e, i, n = {
9936
9948
  preferences: {},
9937
9949
  defaults: {}
9938
9950
  }) {
9939
- if (super(), this.positionPollInterval = null, this.navigationId = 0, this._playIntent = !1, this._preferencesEditor = null, this._mediaSessionEnabled = !1, this._navigatorProtector = null, this._keyboardPeripheralsManager = null, this._suspiciousActivityListener = null, this._keyboardPeripheralListener = null, this._isNavigating = !1, this._isStalled = !1, this._stalledWatchdog = null, this._stalledCheckTime = 0, this.pub = t, this.listeners = po(e), this._preferences = new ce(n.preferences), this._defaults = new ao(n.defaults), this._settings = new ji(this._preferences, this._defaults), t.readingOrder.items.length === 0)
9951
+ if (super(), this.positionPollInterval = null, this.navigationId = 0, this._playIntent = !1, this._preferencesEditor = null, this._mediaSessionEnabled = !1, this._navigatorProtector = null, this._keyboardPeripheralsManager = null, this._suspiciousActivityListener = null, this._keyboardPeripheralListener = null, this._isNavigating = !1, this._isStalled = !1, this._stalledWatchdog = null, this._stalledCheckTime = 0, this.pub = t, this.listeners = fo(e), this._preferences = new ce(n.preferences), this._defaults = new lo(n.defaults), this._settings = new ji(this._preferences, this._defaults), t.readingOrder.items.length === 0)
9940
9952
  throw new Error("AudioNavigator: publication has an empty reading order");
9941
9953
  if (i)
9942
9954
  this.currentLocation = this.ensureLocatorLocations(i);
9943
9955
  else {
9944
- const u = this.pub.readingOrder.items[0];
9956
+ const d = this.pub.readingOrder.items[0];
9945
9957
  this.currentLocation = new I({
9946
- href: u.href,
9947
- type: u.type || "audio/mpeg",
9948
- title: u.title,
9958
+ href: d.href,
9959
+ type: d.type || "audio/mpeg",
9960
+ title: d.title,
9949
9961
  locations: new C({
9950
9962
  position: 1,
9951
9963
  progression: 0,
@@ -9957,7 +9969,7 @@ class yo extends Ss {
9957
9969
  const s = this.currentLocation.href.split("#")[0], o = this.hrefToTrackIndex(s);
9958
9970
  if (o === -1)
9959
9971
  throw new Error(`AudioNavigator: initial href "${s}" not found in reading order`);
9960
- const a = this.currentLocation.locations?.time() || 0, l = new oo({
9972
+ const a = this.currentLocation.locations?.time() || 0, l = new ao({
9961
9973
  playback: {
9962
9974
  state: {
9963
9975
  currentTime: a,
@@ -9967,19 +9979,19 @@ class yo extends Ss {
9967
9979
  index: o
9968
9980
  }
9969
9981
  });
9970
- this.pool = new lo(l, t, n.contentProtection);
9982
+ this.pool = new ho(l, t, n.contentProtection);
9971
9983
  const h = n.contentProtection || {};
9972
9984
  this._contentProtection = h;
9973
9985
  const c = this.mergeKeyboardPeripherals(
9974
9986
  h,
9975
9987
  n.keyboardPeripherals || []
9976
9988
  );
9977
- (h.disableContextMenu || h.checkAutomation || h.checkIFrameEmbedding || h.monitorDevTools || h.protectPrinting?.disable || h.disableDragAndDrop || h.protectCopy) && (this._navigatorProtector = new uo(h), this._suspiciousActivityListener = (u) => {
9978
- const { type: p, ...m } = u.detail;
9979
- p === "context_menu" ? this.listeners.contextMenu(m) : this.listeners.contentProtection(p, m);
9980
- }, window.addEventListener(at, this._suspiciousActivityListener)), c.length > 0 && (this._keyboardPeripheralsManager = new qe({ keyboardPeripherals: c }), this._keyboardPeripheralListener = (u) => {
9981
- this.listeners.peripheral(u.detail);
9982
- }, window.addEventListener(lt, this._keyboardPeripheralListener)), this.setupEventListeners(), this._isNavigating = !0, this.pool.setCurrentAudio(o, "forward"), this.applyPreferences(), this.waitForLoadedAndSeeked(a).then(() => {
9989
+ (h.disableContextMenu || h.checkAutomation || h.checkIFrameEmbedding || h.monitorDevTools || h.protectPrinting?.disable || h.disableDragAndDrop || h.protectCopy) && (this._navigatorProtector = new po(h), this._suspiciousActivityListener = (d) => {
9990
+ const { type: f, ...g } = d.detail;
9991
+ f === "context_menu" ? this.listeners.contextMenu(g) : this.listeners.contentProtection(f, g);
9992
+ }, window.addEventListener(lt, this._suspiciousActivityListener)), c.length > 0 && (this._keyboardPeripheralsManager = new qe({ keyboardPeripherals: c }), this._keyboardPeripheralListener = (d) => {
9993
+ this.listeners.peripheral(d.detail);
9994
+ }, window.addEventListener(ht, this._keyboardPeripheralListener)), this.setupEventListeners(), this._isNavigating = !0, this.pool.setCurrentAudio(o, "forward"), this.applyPreferences(), this.waitForLoadedAndSeeked(a).then(() => {
9983
9995
  this._isNavigating = !1, this.listeners.trackLoaded(this.pool.audioEngine.getMediaElement()), this._notifyTimelineChange(this.currentLocator), this.listeners.positionChanged(this.currentLocator), this._setupRemotePlayback();
9984
9996
  }).catch(() => {
9985
9997
  this._isNavigating = !1;
@@ -10287,66 +10299,66 @@ class yo extends Ss {
10287
10299
  "mediaSession" in navigator && (navigator.mediaSession.metadata = null, navigator.mediaSession.setActionHandler("play", null), navigator.mediaSession.setActionHandler("pause", null), navigator.mediaSession.setActionHandler("previoustrack", null), navigator.mediaSession.setActionHandler("nexttrack", null), navigator.mediaSession.setActionHandler("seekbackward", null), navigator.mediaSession.setActionHandler("seekforward", null));
10288
10300
  }
10289
10301
  destroy() {
10290
- this.stopPositionPolling(), this._stopStalledWatchdog(), this.destroyMediaSession(), this._suspiciousActivityListener && window.removeEventListener(at, this._suspiciousActivityListener), this._keyboardPeripheralListener && window.removeEventListener(lt, this._keyboardPeripheralListener), this._navigatorProtector?.destroy(), this._keyboardPeripheralsManager?.destroy(), this.pool.destroy();
10302
+ this.stopPositionPolling(), this._stopStalledWatchdog(), this.destroyMediaSession(), this._suspiciousActivityListener && window.removeEventListener(lt, this._suspiciousActivityListener), this._keyboardPeripheralListener && window.removeEventListener(ht, this._keyboardPeripheralListener), this._navigatorProtector?.destroy(), this._keyboardPeripheralsManager?.destroy(), this.pool.destroy();
10291
10303
  }
10292
10304
  }
10293
10305
  export {
10294
- ao as AudioDefaults,
10295
- yo as AudioNavigator,
10306
+ lo as AudioDefaults,
10307
+ bo as AudioNavigator,
10296
10308
  ce as AudioPreferences,
10297
10309
  $i as AudioPreferencesEditor,
10298
10310
  ji as AudioSettings,
10299
10311
  A as BooleanPreference,
10300
10312
  yn as EnumPreference,
10301
- Gr as EpubDefaults,
10313
+ Xr as EpubDefaults,
10302
10314
  Ln as EpubNavigator,
10303
10315
  Ft as EpubPreferences,
10304
10316
  Bi as EpubPreferencesEditor,
10305
10317
  Vi as EpubSettings,
10306
- mo as ExperimentalWebPubNavigator,
10307
- Ir as FXLCoordinator,
10308
- Nr as FXLFrameManager,
10309
- $r as FXLFramePoolManager,
10310
- Dr as FXLPeripherals,
10311
- Wr as FXLSpreader,
10318
+ yo as ExperimentalWebPubNavigator,
10319
+ zr as FXLCoordinator,
10320
+ Mr as FXLFrameManager,
10321
+ Gr as FXLFramePoolManager,
10322
+ Wr as FXLPeripherals,
10323
+ Ur as FXLSpreader,
10312
10324
  Nt as FrameComms,
10313
10325
  Cn as FrameManager,
10314
- Tr as FramePoolManager,
10315
- Mr as HorizontalThird,
10326
+ Nr as FramePoolManager,
10327
+ Fr as HorizontalThird,
10316
10328
  vn as Injector,
10317
10329
  kt as LineLengths,
10318
- Ss as MediaNavigator,
10330
+ Ps as MediaNavigator,
10319
10331
  cn as Navigator,
10320
10332
  Ne as Orientation,
10321
10333
  N as Preference,
10322
10334
  le as Properties,
10323
- to as RSProperties,
10335
+ eo as RSProperties,
10324
10336
  x as RangePreference,
10325
- eo as ReadiumCSS,
10337
+ io as ReadiumCSS,
10326
10338
  Me as Spread,
10327
10339
  tt as TextAlignment,
10328
10340
  _n as UserProperties,
10329
- Fr as VerticalThird,
10341
+ Ir as VerticalThird,
10330
10342
  dn as VisualNavigator,
10331
- oo as WebAudioEngine,
10332
- Ps as WebPubBlobBuilder,
10333
- cr as WebPubCSS,
10334
- pr as WebPubDefaults,
10335
- ks as WebPubFrameManager,
10343
+ ao as WebAudioEngine,
10344
+ Es as WebPubBlobBuilder,
10345
+ dr as WebPubCSS,
10346
+ fr as WebPubDefaults,
10347
+ Rs as WebPubFrameManager,
10336
10348
  Os as WebPubFramePoolManager,
10337
- Rr as WebPubNavigator,
10349
+ Ar as WebPubNavigator,
10338
10350
  Mt as WebPubPreferences,
10339
10351
  Ti as WebPubPreferencesEditor,
10340
10352
  Ai as WebPubSettings,
10341
- hr as WebRSProperties,
10342
- gn as WebUserProperties,
10353
+ cr as WebRSProperties,
10354
+ mn as WebUserProperties,
10343
10355
  E as ensureBoolean,
10344
10356
  he as ensureEnumValue,
10345
- mn as ensureExperiment,
10357
+ gn as ensureExperiment,
10346
10358
  wt as ensureFilter,
10347
- dr as ensureLessThanOrEqual,
10348
- ur as ensureMoreThanOrEqual,
10349
- v as ensureNonNegative,
10359
+ ur as ensureLessThanOrEqual,
10360
+ pr as ensureMoreThanOrEqual,
10361
+ S as ensureNonNegative,
10350
10362
  W as ensureString,
10351
10363
  F as ensureValueInRange,
10352
10364
  Ge as experiments,
@@ -10364,10 +10376,10 @@ export {
10364
10376
  ne as playbackRateRangeConfig,
10365
10377
  J as sML,
10366
10378
  T as sMLWithRequest,
10367
- fo as settings,
10379
+ mo as settings,
10368
10380
  it as skipIntervalRangeConfig,
10369
10381
  ie as volumeRangeConfig,
10370
- me as withFallback,
10382
+ ge as withFallback,
10371
10383
  te as wordSpacingRangeConfig,
10372
10384
  ee as zoomRangeConfig
10373
10385
  };