@readium/navigator 2.5.6 → 2.5.7

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,
@@ -3384,7 +3384,7 @@ class hn {
3384
3384
  };
3385
3385
  }
3386
3386
  }
3387
- const ot = class ot extends Et {
3387
+ const at = class at extends Et {
3388
3388
  constructor() {
3389
3389
  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
3390
  if (!this.isBulkCopyProtectionEnabled || !this.bulkCopyProtector)
@@ -3509,8 +3509,8 @@ const ot = class ot extends Et {
3509
3509
  }
3510
3510
  addBulkCopyProtection(t = {}) {
3511
3511
  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;
3512
+ const e = cs, i = t ? { ...e, ...t } : e;
3513
+ 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
3514
  }
3515
3515
  removeBulkCopyProtection() {
3516
3516
  !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 +3518,7 @@ const ot = class ot extends Et {
3518
3518
  addSelectionMonitoring(t) {
3519
3519
  if (this.isSelectionMonitoringEnabled || !this.wnd) return;
3520
3520
  const e = t || ln;
3521
- this.selectionAnalyzer = new us(e), this.wnd.document.addEventListener("selectionchange", this.handleSelection), this.isSelectionMonitoringEnabled = !0;
3521
+ this.selectionAnalyzer = new ps(e), this.wnd.document.addEventListener("selectionchange", this.handleSelection), this.isSelectionMonitoringEnabled = !0;
3522
3522
  }
3523
3523
  removeSelectionMonitoring() {
3524
3524
  !this.isSelectionMonitoringEnabled || !this.wnd || (this.wnd.document.removeEventListener("selectionchange", this.handleSelection), this.selectionAnalyzer?.clear(), this.selectionAnalyzer = null, this.isSelectionMonitoringEnabled = !1);
@@ -3578,7 +3578,7 @@ const ot = class ot extends Et {
3578
3578
  }
3579
3579
  }
3580
3580
  registerProtectionHandlers() {
3581
- this.comms?.register("peripherals_protection", ot.moduleName, (t, e) => {
3581
+ this.comms?.register("peripherals_protection", at.moduleName, (t, e) => {
3582
3582
  const i = t;
3583
3583
  if (!this.configApplied) {
3584
3584
  if (this.configApplied = !0, i.monitorSelection) {
@@ -3596,9 +3596,9 @@ const ot = class ot extends Et {
3596
3596
  }), 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
3597
  }
3598
3598
  e(!0);
3599
- }), this.comms?.register("unfocus", ot.moduleName, (t, e) => {
3599
+ }), this.comms?.register("unfocus", at.moduleName, (t, e) => {
3600
3600
  this.disableKeyboardPeripherals(), e(!0);
3601
- }), this.comms?.register("keyboard_peripherals", ot.moduleName, (t, e) => {
3601
+ }), this.comms?.register("keyboard_peripherals", at.moduleName, (t, e) => {
3602
3602
  const i = t;
3603
3603
  i && i.length > 0 && (this.enableKeyboardPeripherals(i), this.comms?.log(`Keyboard peripherals enabled: ${i.map((n) => n.type).join(", ")}`)), e(!0);
3604
3604
  });
@@ -3607,11 +3607,11 @@ const ot = class ot extends Et {
3607
3607
  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
3608
  }
3609
3609
  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;
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(at.moduleName), this.configApplied = !1, e.log("Peripherals Unmounted"), !0;
3611
3611
  }
3612
3612
  };
3613
- ot.moduleName = "peripherals";
3614
- let xe = ot;
3613
+ at.moduleName = "peripherals";
3614
+ let xe = at;
3615
3615
  const At = class At extends Et {
3616
3616
  constructor() {
3617
3617
  super(...arguments), this.mediaPlayingCount = 0, this.allAnimations = /* @__PURE__ */ new Set();
@@ -3662,7 +3662,7 @@ const At = class At extends Et {
3662
3662
  ), Reflect.defineProperty(t.navigator, "epubReadingSystem", {
3663
3663
  value: {
3664
3664
  name: "readium-ts-toolkit",
3665
- version: "2.5.6",
3665
+ version: "2.5.7",
3666
3666
  hasFeature: (n, s = "") => {
3667
3667
  switch (n) {
3668
3668
  case "dom-manipulation":
@@ -3766,7 +3766,7 @@ const xi = "readium-fixed-style", q = class q extends Gt {
3766
3766
  }), e.register("remove_property", q.moduleName, (n, s) => {
3767
3767
  re(t, n), s(!0);
3768
3768
  }), e.register("first_visible_locator", q.moduleName, (n, s) => s(!1)), e.register("unfocus", q.moduleName, (n, s) => {
3769
- O(t), s(!0);
3769
+ R(t), s(!0);
3770
3770
  }), e.register([
3771
3771
  "focus",
3772
3772
  "go_next",
@@ -3785,7 +3785,7 @@ const xi = "readium-fixed-style", q = class q extends Gt {
3785
3785
  }
3786
3786
  };
3787
3787
  q.moduleName = "fixed_setup";
3788
- let Oe = q;
3788
+ let Re = q;
3789
3789
  const Q = class Q extends Et {
3790
3790
  wndOnErr(t) {
3791
3791
  this.comms?.send("error", {
@@ -3818,9 +3818,9 @@ const Q = class Q extends Et {
3818
3818
  }
3819
3819
  };
3820
3820
  Q.moduleName = "webpub_setup";
3821
- let Re = Q;
3821
+ let Oe = Q;
3822
3822
  var nt;
3823
- let ps = (nt = class extends Et {
3823
+ let fs = (nt = class extends Et {
3824
3824
  constructor() {
3825
3825
  super(...arguments), this.styleElement = null, this.beforePrintHandler = null, this.configApplied = !1;
3826
3826
  }
@@ -3911,7 +3911,7 @@ const ki = "readium-cjk-vertical-snapper-style", B = class B extends St {
3911
3911
  this.patternAnalyzer || (this.patternAnalyzer = new ae(je), this.isScrollProtectionEnabled = !0, this.comms?.log("Scroll protection enabled"));
3912
3912
  }
3913
3913
  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");
3914
+ 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
3915
  const i = t.document.createElement("style");
3916
3916
  return i.dataset.readium = "true", i.id = ki, i.textContent = `
3917
3917
  * {
@@ -3942,7 +3942,7 @@ const ki = "readium-cjk-vertical-snapper-style", B = class B extends St {
3942
3942
  }
3943
3943
  this.wnd.requestAnimationFrame(() => {
3944
3944
  const a = this.scrollable() * o;
3945
- this.doc().scrollLeft = this.verticalLR ? a : -a, this.reportProgress(), O(this.wnd), s(!0);
3945
+ this.doc().scrollLeft = this.verticalLR ? a : -a, this.reportProgress(), R(this.wnd), s(!0);
3946
3946
  });
3947
3947
  }), e.register("go_id", B.moduleName, (n, s) => {
3948
3948
  const o = t.document.getElementById(n);
@@ -3951,7 +3951,7 @@ const ki = "readium-cjk-vertical-snapper-style", B = class B extends St {
3951
3951
  return;
3952
3952
  }
3953
3953
  this.wnd.requestAnimationFrame(() => {
3954
- this.doc().scrollLeft += o.getBoundingClientRect().left - t.innerWidth / 2, this.reportProgress(), O(this.wnd), s(!0);
3954
+ this.doc().scrollLeft += o.getBoundingClientRect().left - t.innerWidth / 2, this.reportProgress(), R(this.wnd), s(!0);
3955
3955
  });
3956
3956
  }), e.register("go_text", B.moduleName, (n, s) => {
3957
3957
  let o;
@@ -3969,7 +3969,7 @@ const ki = "readium-cjk-vertical-snapper-style", B = class B extends St {
3969
3969
  return;
3970
3970
  }
3971
3971
  this.wnd.requestAnimationFrame(() => {
3972
- this.doc().scrollLeft += l.getBoundingClientRect().left - t.innerWidth / 2, this.reportProgress(), O(this.wnd), s(!0);
3972
+ this.doc().scrollLeft += l.getBoundingClientRect().left - t.innerWidth / 2, this.reportProgress(), R(this.wnd), s(!0);
3973
3973
  });
3974
3974
  }), e.register("go_start", B.moduleName, (n, s) => {
3975
3975
  if (this.doc().scrollLeft === 0) return s(!1);
@@ -3981,7 +3981,7 @@ const ki = "readium-cjk-vertical-snapper-style", B = class B extends St {
3981
3981
  "go_next",
3982
3982
  "go_prev"
3983
3983
  ], B.moduleName, (n, s) => s(!1)), e.register("unfocus", B.moduleName, (n, s) => {
3984
- O(this.wnd), s(!0);
3984
+ R(this.wnd), s(!0);
3985
3985
  }), e.register("scroll_protection", B.moduleName, (n, s) => {
3986
3986
  this.enableScrollProtection(), s(!0);
3987
3987
  }), e.register("focus", B.moduleName, (n, s) => {
@@ -3997,7 +3997,7 @@ const ki = "readium-cjk-vertical-snapper-style", B = class B extends St {
3997
3997
  };
3998
3998
  B.moduleName = "cjk_vertical_snapper";
3999
3999
  let Ae = B;
4000
- const fs = [
4000
+ const ms = [
4001
4001
  "fixed_setup",
4002
4002
  "decorator",
4003
4003
  "peripherals",
@@ -4010,7 +4010,7 @@ const fs = [
4010
4010
  "scroll_snapper",
4011
4011
  "cjk_vertical_snapper",
4012
4012
  "print_protection"
4013
- ], ms = [
4013
+ ], ys = [
4014
4014
  "webpub_setup",
4015
4015
  "webpub_snapper",
4016
4016
  "decorator",
@@ -4018,16 +4018,16 @@ const fs = [
4018
4018
  "print_protection"
4019
4019
  ], Te = new Map([
4020
4020
  // All modules go here
4021
- Oe,
4022
- ke,
4023
4021
  Re,
4022
+ ke,
4023
+ Oe,
4024
4024
  Le,
4025
4025
  xe,
4026
4026
  Ee,
4027
4027
  Ce,
4028
4028
  _e,
4029
4029
  Ae,
4030
- ps
4030
+ fs
4031
4031
  ].map((r) => [r.moduleName, r]));
4032
4032
  class Pt {
4033
4033
  /**
@@ -4035,7 +4035,7 @@ class Pt {
4035
4035
  * @param initialModules List of initial modules to load
4036
4036
  */
4037
4037
  constructor(t = window, e = []) {
4038
- this.loadedModules = [], this.wnd = t, this.comms = new zn(t);
4038
+ this.loadedModules = [], this.wnd = t, this.comms = new Dn(t);
4039
4039
  const i = [...new Set(e)];
4040
4040
  if (i.length) {
4041
4041
  if (typeof t > "u")
@@ -4079,7 +4079,7 @@ class Pt {
4079
4079
  this.comms.destroy(), this.loadedModules.forEach((t) => t.unmount(this.wnd, this.comms)), this.loadedModules = [];
4080
4080
  }
4081
4081
  }
4082
- const ys = {
4082
+ const bs = {
4083
4083
  type: "developer_tools",
4084
4084
  keyCombos: [
4085
4085
  { keyCode: 73, meta: !0, alt: !0 },
@@ -4113,7 +4113,7 @@ const ys = {
4113
4113
  { keyCode: 123, meta: !0, alt: !0 }
4114
4114
  // Cmd+Option+F12
4115
4115
  ]
4116
- }, bs = {
4116
+ }, ws = {
4117
4117
  type: "select_all",
4118
4118
  keyCombos: [
4119
4119
  { keyCode: 65, meta: !0 },
@@ -4121,7 +4121,7 @@ const ys = {
4121
4121
  { keyCode: 65, ctrl: !0 }
4122
4122
  // Ctrl+A
4123
4123
  ]
4124
- }, ws = {
4124
+ }, vs = {
4125
4125
  type: "print",
4126
4126
  keyCombos: [
4127
4127
  { keyCode: 80, meta: !0 },
@@ -4137,7 +4137,7 @@ const ys = {
4137
4137
  { keyCode: 80, ctrl: !0, alt: !0 }
4138
4138
  // Ctrl+Alt+P
4139
4139
  ]
4140
- }, vs = {
4140
+ }, Ss = {
4141
4141
  type: "save",
4142
4142
  keyCombos: [
4143
4143
  { keyCode: 83, meta: !0 },
@@ -4155,7 +4155,7 @@ class cn {
4155
4155
  const i = [], n = e.filter(
4156
4156
  (s) => !["developer_tools", "select_all", "print", "save"].includes(s.type)
4157
4157
  );
4158
- t.disableSelectAll && i.push(bs), t.disableSave && i.push(vs), t.monitorDevTools && i.push(ys), t.protectPrinting?.disable && i.push(ws);
4158
+ t.disableSelectAll && i.push(ws), t.disableSave && i.push(Ss), t.monitorDevTools && i.push(bs), t.protectPrinting?.disable && i.push(vs);
4159
4159
  for (const s of n) {
4160
4160
  const o = s.keyCombos.filter(
4161
4161
  (a) => !i.some(
@@ -4186,9 +4186,9 @@ class dn extends cn {
4186
4186
  this.readingProgression === M.ltr ? this.goForward(t, e) : this.readingProgression === M.rtl && this.goBackward(t, e);
4187
4187
  }
4188
4188
  }
4189
- class Ss extends cn {
4189
+ class Ps extends cn {
4190
4190
  }
4191
- class Ps {
4191
+ class Es {
4192
4192
  constructor(t, e, i, n) {
4193
4193
  this.injector = null, this.pub = t, this.item = i, this.burl = i.toURL(e) || "", this.cssProperties = n.cssProperties, this.injector = n.injector ?? null;
4194
4194
  }
@@ -4238,7 +4238,7 @@ class Ps {
4238
4238
  return n + o;
4239
4239
  }
4240
4240
  }
4241
- const Es = 1e4;
4241
+ const Cs = 1e4;
4242
4242
  class Nt {
4243
4243
  constructor(t, e) {
4244
4244
  this.registry = /* @__PURE__ */ new Map(), this._ready = !1, this.listenerBuffer = [], this.handler = this.handle.bind(this), this.wnd = t, this.origin = e;
@@ -4249,7 +4249,7 @@ class Nt {
4249
4249
  }
4250
4250
  this.gc = setInterval(() => {
4251
4251
  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));
4252
+ performance.now() - i.time > Cs && (console.warn(n, "event for", i.key, "was never handled!"), this.registry.delete(n));
4253
4253
  });
4254
4254
  }, 5e3), window.addEventListener("message", this.handler), this.send("_ping", void 0);
4255
4255
  }
@@ -4305,7 +4305,7 @@ class Nt {
4305
4305
  key: t
4306
4306
  }), this.wnd.postMessage(
4307
4307
  {
4308
- _readium: gt,
4308
+ _readium: mt,
4309
4309
  _channel: this.channelId,
4310
4310
  id: o,
4311
4311
  data: e,
@@ -4318,12 +4318,12 @@ class Nt {
4318
4318
  ), o;
4319
4319
  }
4320
4320
  }
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;
4321
+ const _s = "'Iowan Old Style', Sitka, 'Sitka Text', Palatino, 'Book Antiqua', 'URW Palladio L', P052, serif", Ls = {
4322
+ oldStyleTf: _s
4323
+ }, xs = 16, Ri = Ls.oldStyleTf;
4324
4324
  class kt {
4325
4325
  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);
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 || 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
4327
  }
4328
4328
  updateMultipliers() {
4329
4329
  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 +4332,7 @@ class kt {
4332
4332
  // Not filtering because pretty much everything can
4333
4333
  // trigger a recomputation anyway.
4334
4334
  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();
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 || 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
4336
  }
4337
4337
  get baseFontSize() {
4338
4338
  return this._baseFontSize;
@@ -4429,7 +4429,7 @@ class fn {
4429
4429
  }, []) };
4430
4430
  }
4431
4431
  }
4432
- class xs extends fn {
4432
+ class ks extends fn {
4433
4433
  get iOSRequest() {
4434
4434
  const t = pn(), e = un();
4435
4435
  if (this.OS.iOS && !this.OS.iPadOS)
@@ -4438,7 +4438,7 @@ class xs extends fn {
4438
4438
  return /\(iPad;/.test(e) || t && /^iPad(OS)?$/.test(t.platform) ? "mobile" : "desktop";
4439
4439
  }
4440
4440
  }
4441
- const J = new fn(), T = new xs();
4441
+ const J = new fn(), T = new ks();
4442
4442
  function bt(r) {
4443
4443
  const t = r.languages?.[0]?.toLowerCase(), e = r.readingProgression;
4444
4444
  if (t) {
@@ -4476,7 +4476,7 @@ class $e {
4476
4476
  this.unsubs.forEach((t) => t()), this.unsubs = [], this.conditionValues.clear();
4477
4477
  }
4478
4478
  }
4479
- class ks {
4479
+ class Rs {
4480
4480
  constructor(t, e = {}, i = []) {
4481
4481
  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
4482
  }
@@ -4598,52 +4598,56 @@ class Os {
4598
4598
  const o = n[s].href;
4599
4599
  this.inprogress.has(o) && await this.inprogress.get(o);
4600
4600
  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);
4601
+ const c = [], d = [];
4602
+ t.readingOrder.items.forEach((u, p) => {
4603
+ 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));
4604
+ }), c.forEach(async (u) => {
4605
+ d.includes(u) || this.pool.has(u) && (await this.pool.get(u)?.destroy(), this.pool.delete(u));
4606
+ }), this.currentBaseURL !== void 0 && t.baseURL !== this.currentBaseURL && (this.blobs.forEach((u) => {
4607
+ this.injector?.releaseBlobUrl?.(u), URL.revokeObjectURL(u);
4608
4608
  }), 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));
4609
+ const f = async (u) => {
4610
+ if (this.pendingUpdates.has(u) && this.pendingUpdates.get(u)?.inPool === !1) {
4611
+ const v = this.blobs.get(u);
4612
+ v && (this.injector?.releaseBlobUrl?.(v), URL.revokeObjectURL(v), this.blobs.delete(u), this.pendingUpdates.delete(u));
4613
4613
  }
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);
4614
+ if (this.pool.has(u)) {
4615
+ const v = this.pool.get(u);
4616
+ if (!this.blobs.has(u))
4617
+ await v.destroy(), this.pool.delete(u), this.pendingUpdates.delete(u);
4618
4618
  else {
4619
- await P.load(i);
4619
+ await v.load(i);
4620
4620
  return;
4621
4621
  }
4622
4622
  }
4623
- const f = t.readingOrder.findWithHref(d);
4624
- if (!f) return;
4625
- if (!this.blobs.has(d)) {
4626
- const R = await new Ps(
4623
+ const p = t.readingOrder.findWithHref(u);
4624
+ if (!p) return;
4625
+ if (!this.blobs.has(u)) {
4626
+ const O = await new Es(
4627
4627
  t,
4628
4628
  this.currentBaseURL || "",
4629
- f,
4629
+ p,
4630
4630
  {
4631
4631
  cssProperties: this.currentCssProperties,
4632
4632
  injector: this.injector
4633
4633
  }
4634
4634
  ).build();
4635
- this.blobs.set(d, R);
4635
+ this.blobs.set(u, O);
4636
4636
  }
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);
4637
+ const b = new Rs(this.blobs.get(u), this.contentProtectionConfig, this.keyboardPeripheralsConfig);
4638
+ u !== o && await b.hide(), this.container.appendChild(b.iframe), await b.load(i), this.pool.set(u, b);
4639
4639
  };
4640
4640
  try {
4641
- await Promise.all(u.map((d) => p(d)));
4642
- } catch (d) {
4643
- h(d);
4641
+ await Promise.all(d.map((u) => f(u)));
4642
+ } catch (u) {
4643
+ h(u);
4644
4644
  }
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();
4645
+ const g = this.pool.get(o);
4646
+ 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)) {
4647
+ const u = this.container.ownerDocument.activeElement;
4648
+ u && u.tagName === "IFRAME" && u !== g.iframe && g.iframe.focus({ preventScroll: !0 });
4649
+ }
4650
+ l();
4647
4651
  });
4648
4652
  this.inprogress.set(o, a), await a, this.inprogress.delete(o);
4649
4653
  }
@@ -4688,41 +4692,41 @@ class Os {
4688
4692
  }), t;
4689
4693
  }
4690
4694
  }
4691
- var ge, Ri;
4692
- function Rs() {
4693
- if (Ri) return ge;
4694
- Ri = 1;
4695
+ var me, Oi;
4696
+ function As() {
4697
+ if (Oi) return me;
4698
+ Oi = 1;
4695
4699
  function r(n) {
4696
4700
  if (typeof n != "string")
4697
4701
  throw new TypeError("Path must be a string. Received " + JSON.stringify(n));
4698
4702
  }
4699
4703
  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);
4704
+ for (var o = "", a = 0, l = -1, h = 0, c, d = 0; d <= n.length; ++d) {
4705
+ if (d < n.length)
4706
+ c = n.charCodeAt(d);
4703
4707
  else {
4704
4708
  if (c === 47)
4705
4709
  break;
4706
4710
  c = 47;
4707
4711
  }
4708
4712
  if (c === 47) {
4709
- if (!(l === u - 1 || h === 1)) if (l !== u - 1 && h === 2) {
4713
+ if (!(l === d - 1 || h === 1)) if (l !== d - 1 && h === 2) {
4710
4714
  if (o.length < 2 || a !== 2 || o.charCodeAt(o.length - 1) !== 46 || o.charCodeAt(o.length - 2) !== 46) {
4711
4715
  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;
4716
+ var f = o.lastIndexOf("/");
4717
+ if (f !== o.length - 1) {
4718
+ f === -1 ? (o = "", a = 0) : (o = o.slice(0, f), a = o.length - 1 - o.lastIndexOf("/")), l = d, h = 0;
4715
4719
  continue;
4716
4720
  }
4717
4721
  } else if (o.length === 2 || o.length === 1) {
4718
- o = "", a = 0, l = u, h = 0;
4722
+ o = "", a = 0, l = d, h = 0;
4719
4723
  continue;
4720
4724
  }
4721
4725
  }
4722
4726
  s && (o.length > 0 ? o += "/.." : o = "..", a = 2);
4723
4727
  } 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;
4728
+ o.length > 0 ? o += "/" + n.slice(l + 1, d) : o = n.slice(l + 1, d), a = d - l - 1;
4729
+ l = d, h = 0;
4726
4730
  } else c === 46 && h !== -1 ? ++h : h = -1;
4727
4731
  }
4728
4732
  return o;
@@ -4763,25 +4767,25 @@ function Rs() {
4763
4767
  ;
4764
4768
  for (var l = s.length, h = l - a, c = 1; c < o.length && o.charCodeAt(c) === 47; ++c)
4765
4769
  ;
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));
4770
+ for (var d = o.length, f = d - c, g = h < f ? h : f, u = -1, p = 0; p <= g; ++p) {
4771
+ if (p === g) {
4772
+ if (f > g) {
4773
+ if (o.charCodeAt(c + p) === 47)
4774
+ return o.slice(c + p + 1);
4775
+ if (p === 0)
4776
+ return o.slice(c + p);
4777
+ } else h > g && (s.charCodeAt(a + p) === 47 ? u = p : p === 0 && (u = 0));
4774
4778
  break;
4775
4779
  }
4776
- var w = s.charCodeAt(a + f), P = o.charCodeAt(c + f);
4777
- if (w !== P)
4780
+ var b = s.charCodeAt(a + p), v = o.charCodeAt(c + p);
4781
+ if (b !== v)
4778
4782
  break;
4779
- w === 47 && (d = f);
4783
+ b === 47 && (u = p);
4780
4784
  }
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));
4785
+ var O = "";
4786
+ for (p = a + u + 1; p <= l; ++p)
4787
+ (p === l || s.charCodeAt(p) === 47) && (O.length === 0 ? O += ".." : O += "/..");
4788
+ return O.length > 0 ? O + o.slice(c + u) : (c += u, o.charCodeAt(c) === 47 && ++c, o.slice(c));
4785
4789
  },
4786
4790
  _makeLong: function(s) {
4787
4791
  return s;
@@ -4804,18 +4808,18 @@ function Rs() {
4804
4808
  var a = 0, l = -1, h = !0, c;
4805
4809
  if (o !== void 0 && o.length > 0 && o.length <= s.length) {
4806
4810
  if (o.length === s.length && o === s) return "";
4807
- var u = o.length - 1, p = -1;
4811
+ var d = o.length - 1, f = -1;
4808
4812
  for (c = s.length - 1; c >= 0; --c) {
4809
- var m = s.charCodeAt(c);
4810
- if (m === 47) {
4813
+ var g = s.charCodeAt(c);
4814
+ if (g === 47) {
4811
4815
  if (!h) {
4812
4816
  a = c + 1;
4813
4817
  break;
4814
4818
  }
4815
4819
  } else
4816
- p === -1 && (h = !1, p = c + 1), u >= 0 && (m === o.charCodeAt(u) ? --u === -1 && (l = c) : (u = -1, l = p));
4820
+ f === -1 && (h = !1, f = c + 1), d >= 0 && (g === o.charCodeAt(d) ? --d === -1 && (l = c) : (d = -1, l = f));
4817
4821
  }
4818
- return a === l ? l = p : l === -1 && (l = s.length), s.slice(a, l);
4822
+ return a === l ? l = f : l === -1 && (l = s.length), s.slice(a, l);
4819
4823
  } else {
4820
4824
  for (c = s.length - 1; c >= 0; --c)
4821
4825
  if (s.charCodeAt(c) === 47) {
@@ -4829,16 +4833,16 @@ function Rs() {
4829
4833
  },
4830
4834
  extname: function(s) {
4831
4835
  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) {
4836
+ for (var o = -1, a = 0, l = -1, h = !0, c = 0, d = s.length - 1; d >= 0; --d) {
4837
+ var f = s.charCodeAt(d);
4838
+ if (f === 47) {
4835
4839
  if (!h) {
4836
- a = u + 1;
4840
+ a = d + 1;
4837
4841
  break;
4838
4842
  }
4839
4843
  continue;
4840
4844
  }
4841
- l === -1 && (h = !1, l = u + 1), p === 46 ? o === -1 ? o = u : c !== 1 && (c = 1) : o !== -1 && (c = -1);
4845
+ l === -1 && (h = !1, l = d + 1), f === 46 ? o === -1 ? o = d : c !== 1 && (c = 1) : o !== -1 && (c = -1);
4842
4846
  }
4843
4847
  return o === -1 || l === -1 || // We saw a non-dot character immediately before the dot
4844
4848
  c === 0 || // The (right-most) trimmed path component is exactly '..'
@@ -4855,66 +4859,66 @@ function Rs() {
4855
4859
  if (s.length === 0) return o;
4856
4860
  var a = s.charCodeAt(0), l = a === 47, h;
4857
4861
  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;
4862
+ for (var c = -1, d = 0, f = -1, g = !0, u = s.length - 1, p = 0; u >= h; --u) {
4863
+ if (a = s.charCodeAt(u), a === 47) {
4864
+ if (!g) {
4865
+ d = u + 1;
4862
4866
  break;
4863
4867
  }
4864
4868
  continue;
4865
4869
  }
4866
- p === -1 && (m = !1, p = d + 1), a === 46 ? c === -1 ? c = d : f !== 1 && (f = 1) : c !== -1 && (f = -1);
4870
+ f === -1 && (g = !1, f = u + 1), a === 46 ? c === -1 ? c = u : p !== 1 && (p = 1) : c !== -1 && (p = -1);
4867
4871
  }
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;
4872
+ return c === -1 || f === -1 || // We saw a non-dot character immediately before the dot
4873
+ p === 0 || // The (right-most) trimmed path component is exactly '..'
4874
+ 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
4875
  },
4872
4876
  sep: "/",
4873
4877
  delimiter: ":",
4874
4878
  win32: null,
4875
4879
  posix: null
4876
4880
  };
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,
4881
+ return i.posix = i, me = i, me;
4882
+ }
4883
+ var Xt = As();
4884
+ 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 = {
4885
+ experimentalHeaderFiltering: Ts,
4886
+ experimentalZoom: Ns
4887
+ }, Fs = { disabled: [], added: [] }, Is = { disabled: ["bodyHyphens", "a11yNormalize", "letterSpacing"], added: [] }, zs = {
4888
+ ltr: Fs,
4889
+ rtl: Is,
4886
4890
  "cjk-horizontal": { disabled: ["textAlign", "bodyHyphens", "a11yNormalize", "ligatures", "paraIndent", "wordSpacing"], added: ["noRuby"] },
4887
4891
  "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,
4892
+ }, 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 = {
4893
+ latin: Ds,
4894
+ am: Ws,
4895
+ ar: Us,
4896
+ bn: Hs,
4897
+ bo: Bs,
4898
+ chr: Vs,
4899
+ fa: js,
4900
+ gu: $s,
4901
+ he: Gs,
4902
+ hi: Xs,
4903
+ hy: Ys,
4904
+ iu: qs,
4905
+ ja: Ks,
4906
+ km: Js,
4907
+ kn: Zs,
4908
+ ko: Qs,
4909
+ lo: tr,
4910
+ ml: er,
4911
+ or: ir,
4912
+ pa: nr,
4913
+ si: sr,
4914
+ ta: rr,
4915
+ te: or,
4916
+ th: ar,
4917
+ zh: lr,
4914
4918
  "zh-Hant": { baseFontFamily: "'方體', 'PingFang TC', '黑體', 'Heiti TC', 'Microsoft JhengHei UI', 'Microsoft JhengHei', Roboto, Noto, 'Noto Sans CJK TC', sans-serif", lineHeightCompensation: 1.167 },
4915
4919
  "zh-TW": { baseFontFamily: "'方體', 'PingFang TC', '黑體', 'Heiti TC', 'Microsoft JhengHei UI', 'Microsoft JhengHei', Roboto, Noto, 'Noto Sans CJK TC', sans-serif", lineHeightCompensation: 1.167 },
4916
4920
  "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;
4921
+ }, Ge = Ms, mo = zs, go = hr;
4918
4922
  var tt = /* @__PURE__ */ ((r) => (r.start = "start", r.left = "left", r.right = "right", r.justify = "justify", r))(tt || {});
4919
4923
  const ut = {
4920
4924
  range: [0, 100],
@@ -4986,7 +4990,7 @@ class le {
4986
4990
  return `${t}rem`;
4987
4991
  }
4988
4992
  }
4989
- class gn extends le {
4993
+ class mn extends le {
4990
4994
  constructor(t) {
4991
4995
  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
4996
  }
@@ -4995,7 +4999,7 @@ class gn extends le {
4995
4999
  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
5000
  }
4997
5001
  }
4998
- class hr extends le {
5002
+ class cr extends le {
4999
5003
  constructor(t) {
5000
5004
  super(), this.experiments = t.experiments ?? null;
5001
5005
  }
@@ -5006,7 +5010,7 @@ class hr extends le {
5006
5010
  }), t;
5007
5011
  }
5008
5012
  }
5009
- class cr {
5013
+ class dr {
5010
5014
  constructor(t) {
5011
5015
  this.rsProperties = t.rsProperties, this.userProperties = t.userProperties;
5012
5016
  }
@@ -5029,13 +5033,13 @@ class cr {
5029
5033
  wordSpacing: t.wordSpacing,
5030
5034
  zoom: t.zoom
5031
5035
  };
5032
- this.userProperties = new gn(e);
5036
+ this.userProperties = new mn(e);
5033
5037
  }
5034
5038
  }
5035
- function dr(r, t) {
5039
+ function ur(r, t) {
5036
5040
  return r == null || t == null || r <= t ? r : void 0;
5037
5041
  }
5038
- function ur(r, t) {
5042
+ function pr(r, t) {
5039
5043
  return r == null || t == null || r >= t ? r : void 0;
5040
5044
  }
5041
5045
  function W(r) {
@@ -5051,7 +5055,7 @@ function he(r, t) {
5051
5055
  function wt(r) {
5052
5056
  return typeof r == "boolean" || typeof r == "number" && r >= 0 ? r : r === null ? null : void 0;
5053
5057
  }
5054
- function v(r) {
5058
+ function S(r) {
5055
5059
  if (r !== void 0)
5056
5060
  return r === null ? null : r < 0 ? void 0 : r;
5057
5061
  }
@@ -5063,16 +5067,16 @@ function F(r, t) {
5063
5067
  const e = Math.min(...t), i = Math.max(...t);
5064
5068
  return r >= e && r <= i ? r : void 0;
5065
5069
  }
5066
- function me(r, t) {
5070
+ function ge(r, t) {
5067
5071
  return r === void 0 ? t : r;
5068
5072
  }
5069
- function mn(r) {
5073
+ function gn(r) {
5070
5074
  if (r !== void 0)
5071
5075
  return r === null ? null : r.filter((t) => t in Ge);
5072
5076
  }
5073
5077
  class Mt {
5074
5078
  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);
5079
+ 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
5080
  }
5077
5081
  static serialize(t) {
5078
5082
  const { ...e } = t;
@@ -5093,9 +5097,9 @@ class Mt {
5093
5097
  return new Mt(e);
5094
5098
  }
5095
5099
  }
5096
- class pr {
5100
+ class fr {
5097
5101
  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;
5102
+ 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
5103
  }
5100
5104
  }
5101
5105
  class Ai {
@@ -5424,7 +5428,7 @@ const bn = (r) => {
5424
5428
  t.attributes && Object.entries(t.attributes).forEach(([e, i]) => {
5425
5429
  e === "type" || e === "rel" || e === "href" || e === "src" || i != null && (typeof i == "boolean" ? i && r.setAttribute(e, "") : r.setAttribute(e, i));
5426
5430
  });
5427
- }, fr = (r, t, e) => {
5431
+ }, mr = (r, t, e) => {
5428
5432
  const i = r.createElement("script");
5429
5433
  i.dataset.readium = "true", t.id && (i.id = t.id);
5430
5434
  const n = t.type || bn(t);
@@ -5521,7 +5525,7 @@ class vn {
5521
5525
  }
5522
5526
  createElement(t, e, i) {
5523
5527
  if (e.as === "script")
5524
- return fr(t, e, i);
5528
+ return mr(t, e, i);
5525
5529
  if (e.as === "link")
5526
5530
  return Ni(t, e, i);
5527
5531
  throw new Error(`Unsupported element type: ${e.as}`);
@@ -5853,7 +5857,7 @@ const vt = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").repl
5853
5857
 
5854
5858
  :root[style*="readium-iPadOSPatch-on"] p:not(:has(b, cite, em, i, q, s, small, span, strong)):first-line{
5855
5859
  -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
5860
+ }`, 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
5861
  window._readium_blockedEvents = [];
5858
5862
  window._readium_blockEvents = false; // WebPub doesn't need event blocking
5859
5863
  window._readium_eventBlocker = null;
@@ -5871,7 +5875,7 @@ window._readium_eventBlocker = null;
5871
5875
  });
5872
5876
  })();
5873
5877
  `;
5874
- function yr(r) {
5878
+ function br(r) {
5875
5879
  const t = r.filter((s) => s.mediaType.isHTML).map((s) => s.href), e = t.length > 0 ? t : [/\.html$/, /\.xhtml$/, /\/$/], i = [
5876
5880
  // CSS Selector Generator - always injected
5877
5881
  {
@@ -5885,7 +5889,7 @@ function yr(r) {
5885
5889
  id: "webpub-execution",
5886
5890
  as: "script",
5887
5891
  target: "head",
5888
- blob: new Blob([vt(mr)], { type: "text/javascript" })
5892
+ blob: new Blob([vt(yr)], { type: "text/javascript" })
5889
5893
  }
5890
5894
  ], n = [
5891
5895
  // Onload Proxy - conditional (has executable scripts)
@@ -5913,7 +5917,7 @@ function yr(r) {
5913
5917
  }
5914
5918
  ];
5915
5919
  }
5916
- class br {
5920
+ class wr {
5917
5921
  constructor(t) {
5918
5922
  if (this.detectedTools = /* @__PURE__ */ new Set(), !t.onDetected)
5919
5923
  throw new Error("onDetected callback is required");
@@ -5945,11 +5949,11 @@ class br {
5945
5949
  this.observer?.disconnect(), this.observer = void 0, this.detectedTools.clear();
5946
5950
  }
5947
5951
  }
5948
- let wr = 0;
5949
- function vr() {
5950
- return ++wr;
5952
+ let vr = 0;
5953
+ function Sr() {
5954
+ return ++vr;
5951
5955
  }
5952
- const Sr = `
5956
+ const Pr = `
5953
5957
  onmessage = function(event) {
5954
5958
  var action = event.data;
5955
5959
  var startTime = performance.now()
@@ -5970,7 +5974,7 @@ onmessage = function(event) {
5970
5974
  }, this.log = (...i) => this.send("log", ...i), this.table = (...i) => this.send("table", ...i), this.clear = (...i) => this.send("clear", ...i);
5971
5975
  }
5972
5976
  async send(t, ...e) {
5973
- const i = vr();
5977
+ const i = Sr();
5974
5978
  return new Promise((n, s) => {
5975
5979
  this.callbacks.set(i, n), this.worker.postMessage({
5976
5980
  id: i,
@@ -5985,13 +5989,13 @@ onmessage = function(event) {
5985
5989
  this.worker.terminate(), URL.revokeObjectURL(this.blobUrl);
5986
5990
  }
5987
5991
  };
5988
- Je.workerScript = Sr;
5992
+ Je.workerScript = Pr;
5989
5993
  let se = Je;
5990
5994
  function Xe(r) {
5991
5995
  return typeof window < "u" && console ? console[r] : (...t) => {
5992
5996
  };
5993
5997
  }
5994
- const Pr = Xe("log"), Mi = Xe("table"), Er = Xe("clear");
5998
+ const Er = Xe("log"), Mi = Xe("table"), Cr = Xe("clear");
5995
5999
  async function Fi() {
5996
6000
  if (typeof navigator < "u" && navigator.brave && navigator.brave.isBrave)
5997
6001
  try {
@@ -6004,10 +6008,10 @@ async function Fi() {
6004
6008
  }
6005
6009
  return !1;
6006
6010
  }
6007
- function Cr(r) {
6011
+ function _r(r) {
6008
6012
  return r.excludes.some((t) => t()) ? !1 : r.includes.some((t) => t());
6009
6013
  }
6010
- class _r {
6014
+ class Lr {
6011
6015
  constructor(t = {}) {
6012
6016
  if (this.isOpen = !1, this.checkCount = 0, this.maxChecks = 10, this.maxPrintTime = 0, this.largeObjectArray = null, this.options = {
6013
6017
  onDetected: t.onDetected || (() => {
@@ -6069,14 +6073,14 @@ class _r {
6069
6073
  return (await this.workerConsole.log(t)).time;
6070
6074
  {
6071
6075
  const e = performance.now();
6072
- return Pr(t), performance.now() - e;
6076
+ return Er(t), performance.now() - e;
6073
6077
  }
6074
6078
  }
6075
6079
  /**
6076
6080
  * Check if performance-based detection is enabled for current browser
6077
6081
  */
6078
6082
  isPerformanceDetectionEnabled() {
6079
- return Cr({
6083
+ return _r({
6080
6084
  includes: [
6081
6085
  () => !!J.UA.Chrome,
6082
6086
  () => !!J.UA.Chromium,
@@ -6099,7 +6103,7 @@ class _r {
6099
6103
  if (!this.isPerformanceDetectionEnabled())
6100
6104
  return !1;
6101
6105
  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;
6106
+ 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
6107
  }
6104
6108
  /**
6105
6109
  * Debugger-based detection (fallback method)
@@ -6154,7 +6158,7 @@ class _r {
6154
6158
  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
6159
  }
6156
6160
  }
6157
- class Lr {
6161
+ class xr {
6158
6162
  constructor(t) {
6159
6163
  if (this.detected = !1, !t.onDetected)
6160
6164
  throw new Error("onDetected callback is required");
@@ -6189,7 +6193,7 @@ class Lr {
6189
6193
  this.observer?.disconnect(), this.observer = void 0, this.detected = !1;
6190
6194
  }
6191
6195
  }
6192
- class xr {
6196
+ class kr {
6193
6197
  constructor(t = {}) {
6194
6198
  this.styleElement = null, this.beforePrintHandler = null, this.onPrintAttempt = t.onPrintAttempt, t.disable && this.setupPrintProtection(t.watermark);
6195
6199
  }
@@ -6215,7 +6219,7 @@ class xr {
6215
6219
  this.beforePrintHandler && (window.removeEventListener("beforeprint", this.beforePrintHandler), this.beforePrintHandler = null), this.styleElement?.parentNode && (this.styleElement.parentNode.removeChild(this.styleElement), this.styleElement = null);
6216
6220
  }
6217
6221
  }
6218
- class kr {
6222
+ class Rr {
6219
6223
  constructor(t = {}) {
6220
6224
  this.onContextMenuBlocked = t.onContextMenuBlocked, this.contextMenuHandler = this.handleContextMenu.bind(this), document.addEventListener("contextmenu", this.contextMenuHandler, !0), window.addEventListener("unload", () => this.destroy());
6221
6225
  }
@@ -6234,10 +6238,10 @@ class kr {
6234
6238
  this.contextMenuHandler && (document.removeEventListener("contextmenu", this.contextMenuHandler, !0), this.contextMenuHandler = void 0);
6235
6239
  }
6236
6240
  }
6237
- const at = "readium:navigator:suspiciousActivity";
6241
+ const lt = "readium:navigator:suspiciousActivity";
6238
6242
  class Ye {
6239
6243
  dispatchSuspiciousActivity(t, e) {
6240
- const i = new CustomEvent(at, {
6244
+ const i = new CustomEvent(lt, {
6241
6245
  detail: {
6242
6246
  type: t,
6243
6247
  timestamp: Date.now(),
@@ -6247,7 +6251,7 @@ class Ye {
6247
6251
  window.dispatchEvent(i);
6248
6252
  }
6249
6253
  constructor(t = {}) {
6250
- t.monitorDevTools && (this.devToolsDetector = new _r({
6254
+ t.monitorDevTools && (this.devToolsDetector = new Lr({
6251
6255
  onDetected: () => {
6252
6256
  this.dispatchSuspiciousActivity("developer_tools", {
6253
6257
  targetFrameSrc: "",
@@ -6260,20 +6264,20 @@ class Ye {
6260
6264
  metaKey: !1
6261
6265
  });
6262
6266
  }
6263
- })), t.checkAutomation && (this.automationDetector = new br({
6267
+ })), t.checkAutomation && (this.automationDetector = new wr({
6264
6268
  onDetected: (e) => {
6265
6269
  this.dispatchSuspiciousActivity("automation_detected", { tool: e });
6266
6270
  }
6267
- })), t.checkIFrameEmbedding && (this.iframeEmbeddingDetector = new Lr({
6271
+ })), t.checkIFrameEmbedding && (this.iframeEmbeddingDetector = new xr({
6268
6272
  onDetected: (e) => {
6269
6273
  this.dispatchSuspiciousActivity("iframe_embedding_detected", { isCrossOrigin: e });
6270
6274
  }
6271
- })), t.protectPrinting?.disable && (this.printProtector = new xr({
6275
+ })), t.protectPrinting?.disable && (this.printProtector = new kr({
6272
6276
  ...t.protectPrinting,
6273
6277
  onPrintAttempt: () => {
6274
6278
  this.dispatchSuspiciousActivity("print", {});
6275
6279
  }
6276
- })), t.disableContextMenu && (this.contextMenuProtector = new kr({
6280
+ })), t.disableContextMenu && (this.contextMenuProtector = new Rr({
6277
6281
  onContextMenuBlocked: (e) => {
6278
6282
  this.dispatchSuspiciousActivity("context_menu", e);
6279
6283
  }
@@ -6283,7 +6287,7 @@ class Ye {
6283
6287
  this.automationDetector?.destroy(), this.devToolsDetector?.destroy(), this.iframeEmbeddingDetector?.destroy(), this.printProtector?.destroy(), this.contextMenuProtector?.destroy();
6284
6288
  }
6285
6289
  }
6286
- const lt = "readium:navigator:keyboardPeripheral";
6290
+ const ht = "readium:navigator:keyboardPeripheral";
6287
6291
  class qe {
6288
6292
  constructor(t = {}) {
6289
6293
  this.keyManager = new hn(), this.setupKeyboardPeripherals(t.keyboardPeripherals || []);
@@ -6291,7 +6295,7 @@ class qe {
6291
6295
  setupKeyboardPeripherals(t) {
6292
6296
  if (t.length > 0) {
6293
6297
  const e = (i) => {
6294
- const n = new CustomEvent(lt, {
6298
+ const n = new CustomEvent(ht, {
6295
6299
  detail: i
6296
6300
  });
6297
6301
  window.dispatchEvent(n);
@@ -6332,17 +6336,17 @@ const Or = (r) => ({
6332
6336
  peripheral: r.peripheral || (() => {
6333
6337
  })
6334
6338
  });
6335
- class Rr extends dn {
6339
+ class Ar extends dn {
6336
6340
  constructor(t, e, i, n = void 0, s = { preferences: {}, defaults: {} }) {
6337
6341
  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
6342
  readingOrder: [],
6339
6343
  progressions: /* @__PURE__ */ new Map(),
6340
6344
  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 })
6345
+ }, 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({
6346
+ rsProperties: new cr({ experiments: this._settings.experiments || null }),
6347
+ userProperties: new mn({ zoom: this._settings.zoom })
6344
6348
  });
6345
- const o = yr(e.readingOrder.items), a = s.injectables || { rules: [], allowedDomains: [] };
6349
+ const o = br(e.readingOrder.items), a = s.injectables || { rules: [], allowedDomains: [] };
6346
6350
  if (this._injector = new vn({
6347
6351
  rules: [...o, ...a.rules],
6348
6352
  allowedDomains: a.allowedDomains
@@ -6352,12 +6356,12 @@ class Rr extends dn {
6352
6356
  ), (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
6357
  const { type: h, ...c } = l.detail;
6354
6358
  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({
6359
+ }, window.addEventListener(lt, this._suspiciousActivityListener)), this._keyboardPeripherals.length > 0 && (this._keyboardPeripheralsManager = new qe({
6356
6360
  keyboardPeripherals: this._keyboardPeripherals
6357
6361
  }), this._keyboardPeripheralListener = (l) => {
6358
6362
  const h = l.detail;
6359
6363
  this.listeners.peripheral(h);
6360
- }, window.addEventListener(lt, this._keyboardPeripheralListener)), n && typeof n.copyWithLocations == "function") {
6364
+ }, window.addEventListener(ht, this._keyboardPeripheralListener)), n && typeof n.copyWithLocations == "function") {
6361
6365
  this.currentLocation = n;
6362
6366
  const l = this.pub.readingOrder.findIndexWithHref(n.href);
6363
6367
  l >= 0 && (this.currentIndex = l);
@@ -6459,12 +6463,12 @@ class Rr extends dn {
6459
6463
  if (h.startsWith("http://") || h.startsWith("https://"))
6460
6464
  c = h;
6461
6465
  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;
6466
+ const f = new URL(this.currentLocation.href);
6467
+ c = new URL(h, f).href;
6464
6468
  } else
6465
6469
  c = Xt.join(Xt.dirname(this.currentLocation.href), h);
6466
- const u = this.pub.readingOrder.findWithHref(c);
6467
- u ? this.goLink(u, !1, () => {
6470
+ const d = this.pub.readingOrder.findWithHref(c);
6471
+ d ? this.goLink(d, !1, () => {
6468
6472
  }) : (console.warn(`Internal link not found in readingOrder: ${c}`), this.listeners.handleLocator(new $({
6469
6473
  href: h
6470
6474
  }).locator));
@@ -6508,7 +6512,7 @@ class Rr extends dn {
6508
6512
  }
6509
6513
  }
6510
6514
  determineModules() {
6511
- const t = ms.slice(), e = bt(this.pub.metadata);
6515
+ const t = ys.slice(), e = bt(this.pub.metadata);
6512
6516
  return e === "cjk-vertical" || e === "mongolian-vertical" ? t.map((i) => i === "webpub_snapper" ? "cjk_vertical_snapper" : i) : t;
6513
6517
  }
6514
6518
  attachListener() {
@@ -6521,7 +6525,7 @@ class Rr extends dn {
6521
6525
  throw Error("Link for " + this.currentLocation.href + " not found!");
6522
6526
  }
6523
6527
  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();
6528
+ 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
6529
  }
6526
6530
  async changeResource(t) {
6527
6531
  if (t === 0) return !1;
@@ -6661,7 +6665,7 @@ class Rr extends dn {
6661
6665
  });
6662
6666
  }
6663
6667
  }
6664
- const mo = Rr, Ar = (r) => {
6668
+ const yo = Ar, Tr = (r) => {
6665
6669
  const t = r.join(" ");
6666
6670
  return [
6667
6671
  // 'self' is useless because the document is loaded from a blob: URL
@@ -6693,7 +6697,7 @@ class En {
6693
6697
  async build(t = !1) {
6694
6698
  if (this.item.mediaType.isHTML)
6695
6699
  return await this.buildHtmlFrame(t);
6696
- if (this.item.mediaType.isBitmap || this.item.mediaType.equals(g.SVG))
6700
+ if (this.item.mediaType.isBitmap || this.item.mediaType.equals(m.SVG))
6697
6701
  return this.buildImageFrame();
6698
6702
  throw Error("Unsupported frame mediatype " + this.item.mediaType.string);
6699
6703
  }
@@ -6726,21 +6730,21 @@ class En {
6726
6730
  ...e ? [e] : [],
6727
6731
  ...a
6728
6732
  ])].filter(Boolean);
6729
- if (o && !s && this.setProperties(o, t), t.body.querySelectorAll("img").forEach((u) => {
6730
- u.setAttribute("fetchpriority", "high");
6733
+ if (o && !s && this.setProperties(o, t), t.body.querySelectorAll("img").forEach((d) => {
6734
+ d.setAttribute("fetchpriority", "high");
6731
6735
  }), 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);
6736
+ const d = this.pub.metadata.languages[0];
6737
+ if (n === m.XHTML) {
6738
+ const f = t.documentElement.lang || t.documentElement.getAttribute("xml:lang"), g = t.body.lang || t.body.getAttribute("xml:lang");
6739
+ 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));
6740
+ } else n === m.HTML && !t.documentElement.lang && (t.documentElement.lang = d);
6737
6741
  }
6738
6742
  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);
6743
+ const d = t.createElement("base");
6744
+ d.href = i, d.dataset.readium = "true", t.head.firstChild.before(d);
6741
6745
  }
6742
6746
  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(
6747
+ return c.httpEquiv = "Content-Security-Policy", c.content = Tr(l), c.dataset.readium = "true", t.head.firstChild.before(c), URL.createObjectURL(
6744
6748
  new Blob([new XMLSerializer().serializeToString(t)], {
6745
6749
  type: n.isHTML ? n.string : "application/xhtml+xml"
6746
6750
  // Fallback to XHTML
@@ -6854,7 +6858,7 @@ class Cn {
6854
6858
  }
6855
6859
  }
6856
6860
  const Ii = 5, zi = 3;
6857
- class Tr {
6861
+ class Nr {
6858
6862
  constructor(t, e, i, n, s, o) {
6859
6863
  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
6864
  }
@@ -6879,54 +6883,58 @@ class Tr {
6879
6883
  const o = this.positions[s].href;
6880
6884
  this.inprogress.has(o) && await this.inprogress.get(o);
6881
6885
  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);
6886
+ const c = [], d = [];
6887
+ this.positions.forEach((u, p) => {
6888
+ (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));
6889
+ }), c.forEach(async (u) => {
6890
+ 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 }));
6891
+ }), this.currentBaseURL !== void 0 && t.baseURL !== this.currentBaseURL && (this.blobs.forEach((u) => {
6892
+ this.injector?.releaseBlobUrl?.(u), URL.revokeObjectURL(u);
6889
6893
  }), 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));
6894
+ const f = async (u) => {
6895
+ if (n && (this.blobs.forEach((v) => {
6896
+ this.injector?.releaseBlobUrl?.(v), URL.revokeObjectURL(v);
6897
+ }), this.blobs.clear(), this.pendingUpdates.clear()), this.pendingUpdates.has(u) && this.pendingUpdates.get(u)?.inPool === !1) {
6898
+ const v = this.blobs.get(u);
6899
+ v && (this.injector?.releaseBlobUrl?.(v), URL.revokeObjectURL(v), this.blobs.delete(u), this.pendingUpdates.delete(u));
6896
6900
  }
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);
6901
+ if (this.pool.has(u)) {
6902
+ const v = this.pool.get(u);
6903
+ if (!this.blobs.has(u))
6904
+ await v.destroy(), this.pool.delete(u), this.pendingUpdates.delete(u);
6901
6905
  else {
6902
- await P.load(i);
6906
+ await v.load(i);
6903
6907
  return;
6904
6908
  }
6905
6909
  }
6906
- const f = t.readingOrder.findWithHref(d);
6907
- if (!f) return;
6908
- if (!this.blobs.has(d)) {
6909
- const R = await new En(
6910
+ const p = t.readingOrder.findWithHref(u);
6911
+ if (!p) return;
6912
+ if (!this.blobs.has(u)) {
6913
+ const O = await new En(
6910
6914
  t,
6911
6915
  this.currentBaseURL || "",
6912
- f,
6916
+ p,
6913
6917
  {
6914
6918
  cssProperties: this.currentCssProperties,
6915
6919
  injector: this.injector
6916
6920
  }
6917
6921
  ).build();
6918
- this.blobs.set(d, R);
6922
+ this.blobs.set(u, O);
6919
6923
  }
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);
6924
+ const b = new Cn(this.blobs.get(u), this.contentProtectionConfig, this.keyboardPeripheralsConfig);
6925
+ u !== o && await b.hide(), this.container.appendChild(b.iframe), await b.load(i), this.pool.set(u, b);
6922
6926
  };
6923
6927
  try {
6924
- await Promise.all(u.map((d) => p(d)));
6925
- } catch (d) {
6926
- h(d);
6928
+ await Promise.all(d.map((u) => f(u)));
6929
+ } catch (u) {
6930
+ h(u);
6931
+ }
6932
+ const g = this.pool.get(o);
6933
+ 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)) {
6934
+ const u = this.container.ownerDocument.activeElement;
6935
+ u && u.tagName === "IFRAME" && u !== g.iframe && g.iframe.focus({ preventScroll: !0 });
6927
6936
  }
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();
6937
+ l();
6930
6938
  });
6931
6939
  this.inprogress.set(o, a), await a, this.inprogress.delete(o);
6932
6940
  }
@@ -6971,7 +6979,7 @@ class Tr {
6971
6979
  }), t;
6972
6980
  }
6973
6981
  }
6974
- class Nr {
6982
+ class Mr {
6975
6983
  constructor(t, e, i, n = {}, s = []) {
6976
6984
  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
6985
  }
@@ -7033,10 +7041,10 @@ class Nr {
7033
7041
  const i = Math.min(this.wrapper.clientWidth / e.width, this.wrapper.clientHeight / e.height);
7034
7042
  this.frame.style.transform = `scale(${i})`;
7035
7043
  const n = this.frame.getBoundingClientRect(), s = this.wrapper.clientHeight - n.height;
7036
- if (this.frame.style.top = `${s / 2}px`, t === G.left) {
7044
+ if (this.frame.style.top = `${s / 2}px`, t === X.left) {
7037
7045
  const o = this.wrapper.clientWidth - n.width;
7038
7046
  this.frame.style.left = `${o}px`;
7039
- } else if (t === G.center) {
7047
+ } else if (t === X.center) {
7040
7048
  const o = this.wrapper.clientWidth - n.width;
7041
7049
  this.frame.style.left = `${o / 2}px`;
7042
7050
  } else
@@ -7142,8 +7150,8 @@ class Nr {
7142
7150
  return this.loader;
7143
7151
  }
7144
7152
  }
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 {
7153
+ 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 || {});
7154
+ class zr {
7147
7155
  constructor() {
7148
7156
  this.outerWidth = 0, this.outerHeight = 0, this.HTML = document.documentElement, this.Head = document.head, this.Body = document.body;
7149
7157
  }
@@ -7191,7 +7199,7 @@ class Ir {
7191
7199
  };
7192
7200
  }
7193
7201
  }
7194
- class zr {
7202
+ class Dr {
7195
7203
  constructor() {
7196
7204
  this._DOM = {
7197
7205
  show: !1,
@@ -7210,7 +7218,7 @@ class zr {
7210
7218
  }
7211
7219
  }
7212
7220
  const Di = 6, ye = 1.02, Wi = 50;
7213
- class Dr {
7221
+ class Wr {
7214
7222
  constructor(t, e = !1) {
7215
7223
  this.dragState = 0, this.minimumMoved = !1, this.pan = {
7216
7224
  startX: 0,
@@ -7229,7 +7237,7 @@ class Dr {
7229
7237
  target: { X: 0, Y: 0 },
7230
7238
  touchN: 0,
7231
7239
  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());
7240
+ }, 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
7241
  }
7234
7242
  get scale() {
7235
7243
  return this._scale;
@@ -7361,16 +7369,16 @@ class Dr {
7361
7369
  const l = this.coordinator.getTouchCenter(t);
7362
7370
  if (this.debugger?.show) {
7363
7371
  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)}`;
7372
+ const g = this.coordinator.getBibiEventCoord(t, 1);
7373
+ 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
7374
  }
7367
7375
  l.X -= this.manager.width / 2, l.Y -= this.manager.height / 2;
7368
7376
  let h = -l.X / s;
7369
7377
  h += l.X / this.scale, this.pinch.target.X += h, l.X += this.pinch.target.X * this.scale / this.pinch.startScale;
7370
7378
  let c = -l.Y / s;
7371
7379
  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)}`);
7380
+ 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;
7381
+ 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
7382
  }
7375
7383
  const o = this.frameBounds.width / 6, a = this.frameBounds.height / 6;
7376
7384
  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 +7439,7 @@ Overscroll: ${this.pan.overscrollX.toFixed(2)},${this.pan.overscrollY.toFixed(2)
7431
7439
  }
7432
7440
  }
7433
7441
  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 {
7442
+ class Ur {
7435
7443
  // TODO getter
7436
7444
  constructor(t) {
7437
7445
  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 +7468,13 @@ class Wr {
7460
7468
  if (i.length > 1)
7461
7469
  return;
7462
7470
  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;
7471
+ 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
7472
  }), this.shift || this.index(t, !0);
7465
7473
  }
7466
7474
  buildSpreads(t) {
7467
7475
  let e = [];
7468
7476
  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);
7477
+ !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
7478
  }), e.length > 0 && this.spreads.push(e);
7471
7479
  }
7472
7480
  currentSpread(t, e) {
@@ -7476,13 +7484,13 @@ class Wr {
7476
7484
  return this.spreads.find((e) => e.includes(t)) || void 0;
7477
7485
  }
7478
7486
  }
7479
- const Ui = 8, Hi = 5, Ur = 300, Hr = 15e3, Br = 250, Vr = 150, jr = 500;
7480
- class $r {
7487
+ const Ui = 8, Hi = 5, Hr = 300, Br = 15e3, Vr = 250, jr = 150, $r = 500;
7488
+ class Gr {
7481
7489
  constructor(t, e, i, n, s, o) {
7482
7490
  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
7491
  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);
7492
+ 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) => {
7493
+ const l = new Mr(this.peripherals, this.pub.metadata.effectiveReadingProgression, a.href, this.contentProtectionConfig, this.keyboardPeripheralsConfig);
7486
7494
  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
7495
  });
7488
7496
  }
@@ -7507,7 +7515,7 @@ class $r {
7507
7515
  const a = this.spreader.findByLink(o);
7508
7516
  i.update(this.spreadPosition(a, o));
7509
7517
  });
7510
- }, Br);
7518
+ }, Vr);
7511
7519
  }
7512
7520
  /**
7513
7521
  * It is important that these values be cached to avoid spamming them on redraws, they are expensive.
@@ -7534,7 +7542,7 @@ class $r {
7534
7542
  let i = "0";
7535
7543
  this.updateDimensions(), this.perPage > 1 && (i = `${this.width / 2}px`);
7536
7544
  const n = {
7537
- transition: t ? `all ${e ? Vr : jr}ms ease-out` : "all 0ms ease-out",
7545
+ transition: t ? `all ${e ? jr : $r}ms ease-out` : "all 0ms ease-out",
7538
7546
  marginRight: this.rtl ? i : "0",
7539
7547
  marginLeft: this.rtl ? "0" : i,
7540
7548
  width: `${this.width / this.perPage * this.length}px`,
@@ -7669,7 +7677,7 @@ class $r {
7669
7677
  return t % 2 && !this.single && t++, t;
7670
7678
  }
7671
7679
  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;
7680
+ 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
7681
  }
7674
7682
  async waitForItem(t) {
7675
7683
  if (this.inprogress.has(t) && await this.inprogress.get(t), this.delayedShow.has(t)) {
@@ -7692,54 +7700,56 @@ class $r {
7692
7700
  for (const l of o)
7693
7701
  await this.waitForItem(l.href);
7694
7702
  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(
7703
+ const c = [], d = [];
7704
+ this.positions.forEach((p, b) => {
7705
+ (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));
7706
+ }), c.forEach(async (p) => {
7707
+ d.includes(p) || this.pool.has(p) && (this.cancelShowing(p), await this.pool.get(p)?.unload());
7708
+ }), this.currentBaseURL !== void 0 && t.baseURL !== this.currentBaseURL && (this.blobs.forEach((p) => URL.revokeObjectURL(p)), this.blobs.clear()), this.currentBaseURL = t.baseURL;
7709
+ const f = async (p) => {
7710
+ const b = t.readingOrder.findIndexWithHref(p), v = t.readingOrder.items[b];
7711
+ if (v) {
7712
+ if (!this.blobs.has(p)) {
7713
+ const G = await new En(
7706
7714
  t,
7707
7715
  this.currentBaseURL || "",
7708
- w,
7716
+ v,
7709
7717
  {
7710
7718
  injector: this.injector
7711
7719
  }
7712
7720
  ).build(!0);
7713
- this.blobs.set(d, R);
7721
+ this.blobs.set(p, G);
7714
7722
  }
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);
7723
+ this.delayedShow.has(p) || this.delayedShow.set(p, new Promise((O, G) => {
7724
+ let ot = !1;
7725
+ const ct = window.setTimeout(async () => {
7726
+ this.delayedTimeout.set(p, 0);
7727
+ const xn = this.makeSpread(this.reAlign(b)), kn = this.spreadPosition(xn, v), Ze = this.pool.get(p);
7728
+ await Ze.load(i, this.blobs.get(p)), this.peripherals.isScaled || await Ze.show(kn), this.delayedShow.delete(p), ot = !0, O();
7729
+ }, Hr);
7722
7730
  setTimeout(() => {
7723
- !Y && this.delayedShow.has(d) && R(`Offscreen load timeout: ${d}`);
7724
- }, Hr), this.delayedTimeout.set(d, ht);
7731
+ !ot && this.delayedShow.has(p) && G(`Offscreen load timeout: ${p}`);
7732
+ }, Br), this.delayedTimeout.set(p, ct);
7725
7733
  }));
7726
7734
  }
7727
7735
  };
7728
7736
  try {
7729
- await Promise.all(u.map((d) => p(d)));
7730
- } catch (d) {
7731
- h(d);
7737
+ await Promise.all(d.map((p) => f(p)));
7738
+ } catch (p) {
7739
+ h(p);
7732
7740
  }
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));
7741
+ const g = [];
7742
+ for (const p of o) {
7743
+ const b = this.pool.get(p.href), v = this.blobs.get(p.href);
7744
+ 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
7745
  }
7738
7746
  for (; this.previousFrames.length > 0; ) {
7739
- const d = this.previousFrames.shift();
7740
- d && !m.includes(d) && await d.unfocus();
7747
+ const p = this.previousFrames.shift();
7748
+ p && !g.includes(p) && await p.unfocus();
7741
7749
  }
7742
- this.previousFrames = m, l();
7750
+ this.previousFrames = g;
7751
+ const u = this.container.ownerDocument.activeElement;
7752
+ u && u.tagName === "IFRAME" && !g.some((p) => p.iframe === u) && g[0]?.iframe.focus({ preventScroll: !0 }), l();
7743
7753
  });
7744
7754
  for (const l of o)
7745
7755
  this.inprogress.set(l.href, a);
@@ -7799,7 +7809,7 @@ class $r {
7799
7809
  }
7800
7810
  class Ft {
7801
7811
  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);
7812
+ 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
7813
  }
7804
7814
  static serialize(t) {
7805
7815
  const { ...e } = t;
@@ -7820,22 +7830,22 @@ class Ft {
7820
7830
  return new Ft(e);
7821
7831
  }
7822
7832
  }
7823
- class Gr {
7833
+ class Xr {
7824
7834
  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;
7835
+ 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
7836
  }
7827
7837
  }
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
7838
+ const Yr = "#FFFFFF", qr = "#121212", Kr = "#0000EE", Jr = "#551A8B", Zr = "#b4d8fe", Qr = "inherit", ft = {
7839
+ backgroundColor: Yr,
7840
+ textColor: qr,
7841
+ linkColor: Kr,
7842
+ visitedColor: Jr,
7843
+ selectionBackgroundColor: Zr,
7844
+ selectionTextColor: Qr
7835
7845
  };
7836
7846
  class Bi {
7837
7847
  constructor(t, e, i) {
7838
- this.preferences = t, this.settings = e, this.metadata = i, this.layout = this.metadata?.effectiveLayout || b.reflowable;
7848
+ this.preferences = t, this.settings = e, this.metadata = i, this.layout = this.metadata?.effectiveLayout || w.reflowable;
7839
7849
  }
7840
7850
  clear() {
7841
7851
  this.preferences = new Ft({ optimalLineLength: 65 });
@@ -7867,7 +7877,7 @@ class Bi {
7867
7877
  return new N({
7868
7878
  initialValue: this.preferences.columnCount,
7869
7879
  effectiveValue: this.settings.columnCount || null,
7870
- isEffective: this.layout !== b.fixed && !this.settings.scroll,
7880
+ isEffective: this.layout !== w.fixed && !this.settings.scroll,
7871
7881
  onChange: (t) => {
7872
7882
  this.updatePreference("columnCount", t ?? null);
7873
7883
  }
@@ -7899,7 +7909,7 @@ class Bi {
7899
7909
  return new A({
7900
7910
  initialValue: this.preferences.deprecatedFontSize,
7901
7911
  effectiveValue: CSS.supports("zoom", "1") ? this.settings.deprecatedFontSize || !1 : !0,
7902
- isEffective: this.layout !== b.fixed,
7912
+ isEffective: this.layout !== w.fixed,
7903
7913
  onChange: (t) => {
7904
7914
  this.updatePreference("deprecatedFontSize", t ?? null);
7905
7915
  }
@@ -7909,7 +7919,7 @@ class Bi {
7909
7919
  return new N({
7910
7920
  initialValue: this.preferences.fontFamily,
7911
7921
  effectiveValue: this.settings.fontFamily || null,
7912
- isEffective: this.layout !== b.fixed,
7922
+ isEffective: this.layout !== w.fixed,
7913
7923
  onChange: (t) => {
7914
7924
  this.updatePreference("fontFamily", t ?? null);
7915
7925
  }
@@ -7919,7 +7929,7 @@ class Bi {
7919
7929
  return new x({
7920
7930
  initialValue: this.preferences.fontSize,
7921
7931
  effectiveValue: this.settings.fontSize || 1,
7922
- isEffective: this.layout !== b.fixed,
7932
+ isEffective: this.layout !== w.fixed,
7923
7933
  onChange: (t) => {
7924
7934
  this.updatePreference("fontSize", t ?? null);
7925
7935
  },
@@ -7931,7 +7941,7 @@ class Bi {
7931
7941
  return new A({
7932
7942
  initialValue: this.preferences.fontSizeNormalize,
7933
7943
  effectiveValue: this.settings.fontSizeNormalize || !1,
7934
- isEffective: this.layout !== b.fixed && this.preferences.fontSizeNormalize !== null,
7944
+ isEffective: this.layout !== w.fixed && this.preferences.fontSizeNormalize !== null,
7935
7945
  onChange: (t) => {
7936
7946
  this.updatePreference("fontSizeNormalize", t ?? null);
7937
7947
  }
@@ -7941,7 +7951,7 @@ class Bi {
7941
7951
  return new A({
7942
7952
  initialValue: this.preferences.fontOpticalSizing,
7943
7953
  effectiveValue: this.settings.fontOpticalSizing || !0,
7944
- isEffective: this.layout !== b.fixed && this.preferences.fontOpticalSizing !== null,
7954
+ isEffective: this.layout !== w.fixed && this.preferences.fontOpticalSizing !== null,
7945
7955
  onChange: (t) => {
7946
7956
  this.updatePreference("fontOpticalSizing", t ?? null);
7947
7957
  }
@@ -7951,7 +7961,7 @@ class Bi {
7951
7961
  return new x({
7952
7962
  initialValue: this.preferences.fontWeight,
7953
7963
  effectiveValue: this.settings.fontWeight || 400,
7954
- isEffective: this.layout !== b.fixed && this.preferences.fontWeight !== null,
7964
+ isEffective: this.layout !== w.fixed && this.preferences.fontWeight !== null,
7955
7965
  onChange: (t) => {
7956
7966
  this.updatePreference("fontWeight", t ?? null);
7957
7967
  },
@@ -7963,7 +7973,7 @@ class Bi {
7963
7973
  return new x({
7964
7974
  initialValue: this.preferences.fontWidth,
7965
7975
  effectiveValue: this.settings.fontWidth || 100,
7966
- isEffective: this.layout !== b.fixed && this.preferences.fontWidth !== null,
7976
+ isEffective: this.layout !== w.fixed && this.preferences.fontWidth !== null,
7967
7977
  onChange: (t) => {
7968
7978
  this.updatePreference("fontWidth", t ?? null);
7969
7979
  },
@@ -7975,7 +7985,7 @@ class Bi {
7975
7985
  return new A({
7976
7986
  initialValue: this.preferences.hyphens,
7977
7987
  effectiveValue: this.settings.hyphens || !1,
7978
- isEffective: this.layout !== b.fixed && this.metadata?.effectiveReadingProgression === M.ltr && this.preferences.hyphens !== null,
7988
+ isEffective: this.layout !== w.fixed && this.metadata?.effectiveReadingProgression === M.ltr && this.preferences.hyphens !== null,
7979
7989
  onChange: (t) => {
7980
7990
  this.updatePreference("hyphens", t ?? null);
7981
7991
  }
@@ -8009,7 +8019,7 @@ class Bi {
8009
8019
  return new A({
8010
8020
  initialValue: this.preferences.iOSPatch,
8011
8021
  effectiveValue: this.settings.iOSPatch || !1,
8012
- isEffective: this.layout !== b.fixed,
8022
+ isEffective: this.layout !== w.fixed,
8013
8023
  onChange: (t) => {
8014
8024
  this.updatePreference("iOSPatch", t ?? null);
8015
8025
  }
@@ -8019,7 +8029,7 @@ class Bi {
8019
8029
  return new A({
8020
8030
  initialValue: this.preferences.iPadOSPatch,
8021
8031
  effectiveValue: this.settings.iPadOSPatch || !1,
8022
- isEffective: this.layout !== b.fixed,
8032
+ isEffective: this.layout !== w.fixed,
8023
8033
  onChange: (t) => {
8024
8034
  this.updatePreference("iPadOSPatch", t ?? null);
8025
8035
  }
@@ -8029,7 +8039,7 @@ class Bi {
8029
8039
  return new x({
8030
8040
  initialValue: this.preferences.letterSpacing,
8031
8041
  effectiveValue: this.settings.letterSpacing || 0,
8032
- isEffective: this.layout !== b.fixed && this.preferences.letterSpacing !== null,
8042
+ isEffective: this.layout !== w.fixed && this.preferences.letterSpacing !== null,
8033
8043
  onChange: (t) => {
8034
8044
  this.updatePreference("letterSpacing", t ?? null);
8035
8045
  },
@@ -8042,7 +8052,7 @@ class Bi {
8042
8052
  initialValue: this.preferences.ligatures,
8043
8053
  effectiveValue: this.settings.ligatures || !0,
8044
8054
  isEffective: (() => {
8045
- if (this.preferences.ligatures === null || this.layout === b.fixed)
8055
+ if (this.preferences.ligatures === null || this.layout === w.fixed)
8046
8056
  return !1;
8047
8057
  const t = this.metadata?.languages?.[0]?.toLowerCase();
8048
8058
  return !(t && ["zh", "ja", "ko", "mn-mong"].some((e) => t.startsWith(e)));
@@ -8056,7 +8066,7 @@ class Bi {
8056
8066
  return new x({
8057
8067
  initialValue: this.preferences.lineHeight,
8058
8068
  effectiveValue: this.settings.lineHeight,
8059
- isEffective: this.layout !== b.fixed && this.preferences.lineHeight !== null,
8069
+ isEffective: this.layout !== w.fixed && this.preferences.lineHeight !== null,
8060
8070
  onChange: (t) => {
8061
8071
  this.updatePreference("lineHeight", t ?? null);
8062
8072
  },
@@ -8068,7 +8078,7 @@ class Bi {
8068
8078
  return new N({
8069
8079
  initialValue: this.preferences.linkColor,
8070
8080
  effectiveValue: this.settings.linkColor || ft.linkColor,
8071
- isEffective: this.layout !== b.fixed && this.preferences.linkColor !== null,
8081
+ isEffective: this.layout !== w.fixed && this.preferences.linkColor !== null,
8072
8082
  onChange: (t) => {
8073
8083
  this.updatePreference("linkColor", t ?? null);
8074
8084
  }
@@ -8078,7 +8088,7 @@ class Bi {
8078
8088
  return new x({
8079
8089
  initialValue: this.preferences.maximalLineLength,
8080
8090
  effectiveValue: this.settings.maximalLineLength,
8081
- isEffective: this.layout !== b.fixed,
8091
+ isEffective: this.layout !== w.fixed,
8082
8092
  onChange: (t) => {
8083
8093
  this.updatePreference("maximalLineLength", t);
8084
8094
  },
@@ -8090,7 +8100,7 @@ class Bi {
8090
8100
  return new x({
8091
8101
  initialValue: this.preferences.minimalLineLength,
8092
8102
  effectiveValue: this.settings.minimalLineLength,
8093
- isEffective: this.layout !== b.fixed,
8103
+ isEffective: this.layout !== w.fixed,
8094
8104
  onChange: (t) => {
8095
8105
  this.updatePreference("minimalLineLength", t);
8096
8106
  },
@@ -8102,7 +8112,7 @@ class Bi {
8102
8112
  return new A({
8103
8113
  initialValue: this.preferences.noRuby,
8104
8114
  effectiveValue: this.settings.noRuby || !1,
8105
- isEffective: this.layout !== b.fixed && this.metadata?.languages?.includes("ja") || !1,
8115
+ isEffective: this.layout !== w.fixed && this.metadata?.languages?.includes("ja") || !1,
8106
8116
  onChange: (t) => {
8107
8117
  this.updatePreference("noRuby", t ?? null);
8108
8118
  }
@@ -8112,7 +8122,7 @@ class Bi {
8112
8122
  return new x({
8113
8123
  initialValue: this.preferences.optimalLineLength,
8114
8124
  effectiveValue: this.settings.optimalLineLength,
8115
- isEffective: this.layout !== b.fixed,
8125
+ isEffective: this.layout !== w.fixed,
8116
8126
  onChange: (t) => {
8117
8127
  this.updatePreference("optimalLineLength", t);
8118
8128
  },
@@ -8124,7 +8134,7 @@ class Bi {
8124
8134
  return new N({
8125
8135
  initialValue: this.preferences.pageGutter,
8126
8136
  effectiveValue: this.settings.pageGutter,
8127
- isEffective: this.layout !== b.fixed && !this.settings.scroll,
8137
+ isEffective: this.layout !== w.fixed && !this.settings.scroll,
8128
8138
  onChange: (t) => {
8129
8139
  this.updatePreference("pageGutter", t ?? null);
8130
8140
  }
@@ -8134,7 +8144,7 @@ class Bi {
8134
8144
  return new x({
8135
8145
  initialValue: this.preferences.paragraphIndent,
8136
8146
  effectiveValue: this.settings.paragraphIndent || 0,
8137
- isEffective: this.layout !== b.fixed && this.preferences.paragraphIndent !== null,
8147
+ isEffective: this.layout !== w.fixed && this.preferences.paragraphIndent !== null,
8138
8148
  onChange: (t) => {
8139
8149
  this.updatePreference("paragraphIndent", t ?? null);
8140
8150
  },
@@ -8146,7 +8156,7 @@ class Bi {
8146
8156
  return new x({
8147
8157
  initialValue: this.preferences.paragraphSpacing,
8148
8158
  effectiveValue: this.settings.paragraphSpacing || 0,
8149
- isEffective: this.layout !== b.fixed && this.preferences.paragraphSpacing !== null,
8159
+ isEffective: this.layout !== w.fixed && this.preferences.paragraphSpacing !== null,
8150
8160
  onChange: (t) => {
8151
8161
  this.updatePreference("paragraphSpacing", t ?? null);
8152
8162
  },
@@ -8158,7 +8168,7 @@ class Bi {
8158
8168
  return new A({
8159
8169
  initialValue: this.preferences.scroll,
8160
8170
  effectiveValue: this.settings.scroll || !1,
8161
- isEffective: this.layout !== b.fixed,
8171
+ isEffective: this.layout !== w.fixed,
8162
8172
  onChange: (t) => {
8163
8173
  this.updatePreference("scroll", t ?? null);
8164
8174
  }
@@ -8168,7 +8178,7 @@ class Bi {
8168
8178
  return new N({
8169
8179
  initialValue: this.preferences.scrollPaddingTop,
8170
8180
  effectiveValue: this.settings.scrollPaddingTop || 0,
8171
- isEffective: this.layout !== b.fixed && !!this.settings.scroll && this.preferences.scrollPaddingTop !== null,
8181
+ isEffective: this.layout !== w.fixed && !!this.settings.scroll && this.preferences.scrollPaddingTop !== null,
8172
8182
  onChange: (t) => {
8173
8183
  this.updatePreference("scrollPaddingTop", t ?? null);
8174
8184
  }
@@ -8178,7 +8188,7 @@ class Bi {
8178
8188
  return new N({
8179
8189
  initialValue: this.preferences.scrollPaddingBottom,
8180
8190
  effectiveValue: this.settings.scrollPaddingBottom || 0,
8181
- isEffective: this.layout !== b.fixed && !!this.settings.scroll && this.preferences.scrollPaddingBottom !== null,
8191
+ isEffective: this.layout !== w.fixed && !!this.settings.scroll && this.preferences.scrollPaddingBottom !== null,
8182
8192
  onChange: (t) => {
8183
8193
  this.updatePreference("scrollPaddingBottom", t ?? null);
8184
8194
  }
@@ -8188,7 +8198,7 @@ class Bi {
8188
8198
  return new N({
8189
8199
  initialValue: this.preferences.scrollPaddingLeft,
8190
8200
  effectiveValue: this.settings.scrollPaddingLeft || 0,
8191
- isEffective: this.layout !== b.fixed && !!this.settings.scroll && this.preferences.scrollPaddingLeft !== null,
8201
+ isEffective: this.layout !== w.fixed && !!this.settings.scroll && this.preferences.scrollPaddingLeft !== null,
8192
8202
  onChange: (t) => {
8193
8203
  this.updatePreference("scrollPaddingLeft", t ?? null);
8194
8204
  }
@@ -8198,7 +8208,7 @@ class Bi {
8198
8208
  return new N({
8199
8209
  initialValue: this.preferences.scrollPaddingRight,
8200
8210
  effectiveValue: this.settings.scrollPaddingRight || 0,
8201
- isEffective: this.layout !== b.fixed && !!this.settings.scroll && this.preferences.scrollPaddingRight !== null,
8211
+ isEffective: this.layout !== w.fixed && !!this.settings.scroll && this.preferences.scrollPaddingRight !== null,
8202
8212
  onChange: (t) => {
8203
8213
  this.updatePreference("scrollPaddingRight", t ?? null);
8204
8214
  }
@@ -8208,7 +8218,7 @@ class Bi {
8208
8218
  return new N({
8209
8219
  initialValue: this.preferences.selectionBackgroundColor,
8210
8220
  effectiveValue: this.settings.selectionBackgroundColor || ft.selectionBackgroundColor,
8211
- isEffective: this.layout !== b.fixed && this.preferences.selectionBackgroundColor !== null,
8221
+ isEffective: this.layout !== w.fixed && this.preferences.selectionBackgroundColor !== null,
8212
8222
  onChange: (t) => {
8213
8223
  this.updatePreference("selectionBackgroundColor", t ?? null);
8214
8224
  }
@@ -8218,7 +8228,7 @@ class Bi {
8218
8228
  return new N({
8219
8229
  initialValue: this.preferences.selectionTextColor,
8220
8230
  effectiveValue: this.settings.selectionTextColor || ft.selectionTextColor,
8221
- isEffective: this.layout !== b.fixed && this.preferences.selectionTextColor !== null,
8231
+ isEffective: this.layout !== w.fixed && this.preferences.selectionTextColor !== null,
8222
8232
  onChange: (t) => {
8223
8233
  this.updatePreference("selectionTextColor", t ?? null);
8224
8234
  }
@@ -8228,7 +8238,7 @@ class Bi {
8228
8238
  return new yn({
8229
8239
  initialValue: this.preferences.textAlign,
8230
8240
  effectiveValue: this.settings.textAlign || tt.start,
8231
- isEffective: this.layout !== b.fixed && this.preferences.textAlign !== null,
8241
+ isEffective: this.layout !== w.fixed && this.preferences.textAlign !== null,
8232
8242
  onChange: (t) => {
8233
8243
  this.updatePreference("textAlign", t ?? null);
8234
8244
  },
@@ -8239,7 +8249,7 @@ class Bi {
8239
8249
  return new N({
8240
8250
  initialValue: this.preferences.textColor,
8241
8251
  effectiveValue: this.settings.textColor || ft.textColor,
8242
- isEffective: this.layout !== b.fixed && this.preferences.textColor !== null,
8252
+ isEffective: this.layout !== w.fixed && this.preferences.textColor !== null,
8243
8253
  onChange: (t) => {
8244
8254
  this.updatePreference("textColor", t ?? null);
8245
8255
  }
@@ -8249,7 +8259,7 @@ class Bi {
8249
8259
  return new A({
8250
8260
  initialValue: this.preferences.textNormalization,
8251
8261
  effectiveValue: this.settings.textNormalization || !1,
8252
- isEffective: this.layout !== b.fixed,
8262
+ isEffective: this.layout !== w.fixed,
8253
8263
  onChange: (t) => {
8254
8264
  this.updatePreference("textNormalization", t ?? null);
8255
8265
  }
@@ -8259,7 +8269,7 @@ class Bi {
8259
8269
  return new N({
8260
8270
  initialValue: this.preferences.visitedColor,
8261
8271
  effectiveValue: this.settings.visitedColor || ft.visitedColor,
8262
- isEffective: this.layout !== b.fixed && this.preferences.visitedColor !== null,
8272
+ isEffective: this.layout !== w.fixed && this.preferences.visitedColor !== null,
8263
8273
  onChange: (t) => {
8264
8274
  this.updatePreference("visitedColor", t ?? null);
8265
8275
  }
@@ -8269,7 +8279,7 @@ class Bi {
8269
8279
  return new x({
8270
8280
  initialValue: this.preferences.wordSpacing,
8271
8281
  effectiveValue: this.settings.wordSpacing || 0,
8272
- isEffective: this.layout !== b.fixed && this.preferences.wordSpacing !== null,
8282
+ isEffective: this.layout !== w.fixed && this.preferences.wordSpacing !== null,
8273
8283
  onChange: (t) => {
8274
8284
  this.updatePreference("wordSpacing", t ?? null);
8275
8285
  },
@@ -8287,7 +8297,7 @@ function Lt(r) {
8287
8297
  const t = getComputedStyle(r), e = parseFloat(t.paddingLeft || "0"), i = parseFloat(t.paddingRight || "0");
8288
8298
  return r.clientWidth - e - i;
8289
8299
  }
8290
- function Qr(r) {
8300
+ function to(r) {
8291
8301
  const t = getComputedStyle(r), e = parseFloat(t.paddingTop || "0"), i = parseFloat(t.paddingBottom || "0");
8292
8302
  return r.clientHeight - e - i;
8293
8303
  }
@@ -8300,7 +8310,7 @@ class _n extends le {
8300
8310
  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
8311
  }
8302
8312
  }
8303
- class to extends le {
8313
+ class eo extends le {
8304
8314
  constructor(t) {
8305
8315
  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
8316
  }
@@ -8311,7 +8321,7 @@ class to extends le {
8311
8321
  }), t;
8312
8322
  }
8313
8323
  }
8314
- class eo {
8324
+ class io {
8315
8325
  constructor(t) {
8316
8326
  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
8327
  }
@@ -8381,51 +8391,51 @@ class eo {
8381
8391
  // should be the same as uncompensated when scale >= 1
8382
8392
  paginate(t, e, i) {
8383
8393
  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;
8394
+ let d = 1, f = n;
8385
8395
  if (i === void 0)
8386
8396
  return {
8387
8397
  colCount: void 0,
8388
- effectiveContainerWidth: p,
8389
- effectiveLineLength: Math.round(p / u * o)
8398
+ effectiveContainerWidth: f,
8399
+ effectiveLineLength: Math.round(f / d * o)
8390
8400
  };
8391
8401
  if (i === null)
8392
8402
  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);
8403
+ d = Math.floor(n / a);
8404
+ const g = Math.round(d * (h * o));
8405
+ f = Math.min(g, n);
8396
8406
  } else
8397
- p = c();
8407
+ f = c();
8398
8408
  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;
8409
+ const g = Math.round(i * (l !== null ? l : a));
8410
+ if (n >= g)
8411
+ if (d = i, h === null)
8412
+ f = n;
8403
8413
  else {
8404
- const d = Math.round(u * (h * o));
8405
- p = Math.min(d, n);
8414
+ const u = Math.round(d * (h * o));
8415
+ f = Math.min(u, n);
8406
8416
  }
8407
8417
  else if (l !== null && n < Math.round(i * l))
8408
- if (u = Math.floor(n / l), u <= 1)
8409
- u = 1, p = c();
8418
+ if (d = Math.floor(n / l), d <= 1)
8419
+ d = 1, f = c();
8410
8420
  else {
8411
- const d = Math.round(u * (a * o));
8412
- p = Math.min(d, n);
8421
+ const u = Math.round(d * (a * o));
8422
+ f = Math.min(u, n);
8413
8423
  }
8414
8424
  else {
8415
- u = i;
8416
- const d = Math.round(u * (a * o));
8417
- p = Math.min(d, n);
8425
+ d = i;
8426
+ const u = Math.round(d * (a * o));
8427
+ f = Math.min(u, n);
8418
8428
  }
8419
8429
  } else
8420
- u = 1, p = c();
8430
+ d = 1, f = c();
8421
8431
  return {
8422
- colCount: u,
8423
- effectiveContainerWidth: p,
8424
- effectiveLineLength: Math.round(p / u / (t && t >= 1 ? t : 1) * o)
8432
+ colCount: d,
8433
+ effectiveContainerWidth: f,
8434
+ effectiveLineLength: Math.round(f / d / (t && t >= 1 ? t : 1) * o)
8425
8435
  };
8426
8436
  }
8427
8437
  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;
8438
+ 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
8439
  return { colCount: void 0, effectiveContainerWidth: i, effectiveLineLength: o };
8430
8440
  }
8431
8441
  // This behaves as paginate where colCount = 1
@@ -8435,8 +8445,8 @@ class eo {
8435
8445
  if (a === null)
8436
8446
  c = i;
8437
8447
  else {
8438
- const u = Math.min(Math.round(a * s), i);
8439
- c = e ? u : Math.round(u * s);
8448
+ const d = Math.min(Math.round(a * s), i);
8449
+ c = e ? d : Math.round(d * s);
8440
8450
  }
8441
8451
  return {
8442
8452
  colCount: l,
@@ -8452,7 +8462,7 @@ class eo {
8452
8462
  this.userProperties.colCount = t.colCount, this.userProperties.lineLength = t.effectiveLineLength, this.effectiveContainerWidth = t.effectiveContainerWidth, this.container.style.width = `${this.effectiveContainerWidth}px`;
8453
8463
  }
8454
8464
  }
8455
- const io = `// Note: we aren't blocking some of the events right now to try and be as nonintrusive as possible.
8465
+ const no = `// Note: we aren't blocking some of the events right now to try and be as nonintrusive as possible.
8456
8466
  // For a more comprehensive implementation, see https://github.com/hackademix/noscript/blob/3a83c0e4a506f175e38b0342dad50cdca3eae836/src/content/syncFetchPolicy.js#L142
8457
8467
  // The snippet of code at the beginning of this source is an attempt at defence against JS using persistent storage
8458
8468
  (function() {
@@ -8518,8 +8528,8 @@ const io = `// Note: we aren't blocking some of the events right now to try and
8518
8528
  window.addEventListener("load", window._readium_eventBlocker, true);
8519
8529
  })();
8520
8530
  `;
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 = [
8531
+ async function so(r, t) {
8532
+ 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
8533
  // CSS Selector Generator - always injected
8524
8534
  {
8525
8535
  id: "css-selector-generator",
@@ -8532,7 +8542,7 @@ async function no(r, t) {
8532
8542
  id: "execution-prevention",
8533
8543
  as: "script",
8534
8544
  target: "head",
8535
- blob: new Blob([vt(io)], { type: "text/javascript" }),
8545
+ blob: new Blob([vt(no)], { type: "text/javascript" }),
8536
8546
  condition: (a) => !!(a.querySelector("script") || a.querySelector("body[onload]:not(body[onload=''])"))
8537
8547
  }
8538
8548
  ], o = [
@@ -8550,21 +8560,21 @@ async function no(r, t) {
8550
8560
  let l, h, c;
8551
8561
  switch (a) {
8552
8562
  case "rtl": {
8553
- const [u, p, m] = await Promise.all([
8563
+ const [d, f, g] = await Promise.all([
8554
8564
  import("./ReadiumCSS-before-DwBLxUVH.js"),
8555
8565
  import("./ReadiumCSS-default-BhdLiyWp.js"),
8556
8566
  import("./ReadiumCSS-after-d5mC4cme.js")
8557
8567
  ]);
8558
- l = u.default, h = p.default, c = m.default;
8568
+ l = d.default, h = f.default, c = g.default;
8559
8569
  break;
8560
8570
  }
8561
8571
  case "cjk-horizontal": {
8562
- const [u, p, m] = await Promise.all([
8572
+ const [d, f, g] = await Promise.all([
8563
8573
  import("./ReadiumCSS-before-CG-KmDa3.js"),
8564
8574
  import("./ReadiumCSS-default-N65xNiIp.js"),
8565
8575
  import("./ReadiumCSS-after-XUKPAxfT.js")
8566
8576
  ]);
8567
- l = u.default, h = p.default, c = m.default;
8577
+ l = d.default, h = f.default, c = g.default;
8568
8578
  break;
8569
8579
  }
8570
8580
  case "cjk-vertical":
@@ -8572,21 +8582,21 @@ async function no(r, t) {
8572
8582
  // layout as CJK vertical-rl — it is an outlier handled by the
8573
8583
  // same stylesheet set per the Readium CSS spec.
8574
8584
  case "mongolian-vertical": {
8575
- const [u, p, m] = await Promise.all([
8585
+ const [d, f, g] = await Promise.all([
8576
8586
  import("./ReadiumCSS-before-BNTwR8Qm.js"),
8577
8587
  import("./ReadiumCSS-default-BesyZHRU.js"),
8578
8588
  import("./ReadiumCSS-after-ClF4TBzj.js")
8579
8589
  ]);
8580
- l = u.default, h = p.default, c = m.default;
8590
+ l = d.default, h = f.default, c = g.default;
8581
8591
  break;
8582
8592
  }
8583
8593
  default: {
8584
- const [u, p, m] = await Promise.all([
8594
+ const [d, f, g] = await Promise.all([
8585
8595
  import("./ReadiumCSS-before-8FMq19-x.js"),
8586
8596
  import("./ReadiumCSS-default-AIAk8uwU.js"),
8587
8597
  import("./ReadiumCSS-after-D7unrNI9.js")
8588
8598
  ]);
8589
- l = u.default, h = p.default, c = m.default;
8599
+ l = d.default, h = f.default, c = g.default;
8590
8600
  break;
8591
8601
  }
8592
8602
  }
@@ -8604,7 +8614,7 @@ async function no(r, t) {
8604
8614
  target: "head",
8605
8615
  blob: new Blob([_t(h)], { type: "text/css" }),
8606
8616
  rel: "stylesheet",
8607
- condition: (u) => !(u.querySelector("link[rel='stylesheet']") || u.querySelector("style") || u.querySelector("[style]:not([style=''])"))
8617
+ condition: (d) => !(d.querySelector("link[rel='stylesheet']") || d.querySelector("style") || d.querySelector("[style]:not([style=''])"))
8608
8618
  },
8609
8619
  // Readium CSS After - only for reflowable
8610
8620
  {
@@ -8615,12 +8625,12 @@ async function no(r, t) {
8615
8625
  rel: "stylesheet"
8616
8626
  }
8617
8627
  ), (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");
8628
+ const { default: f } = await import("./ReadiumCSS-ebpaj_fonts_patch-Dt2XliTg.js");
8619
8629
  o.push({
8620
8630
  id: "readium-css-ebpaj",
8621
8631
  as: "link",
8622
8632
  target: "head",
8623
- blob: new Blob([_t(p)], { type: "text/css" }),
8633
+ blob: new Blob([_t(f)], { type: "text/css" }),
8624
8634
  rel: "stylesheet"
8625
8635
  });
8626
8636
  }
@@ -8633,7 +8643,7 @@ async function no(r, t) {
8633
8643
  }
8634
8644
  ];
8635
8645
  }
8636
- const so = (r) => ({
8646
+ const ro = (r) => ({
8637
8647
  frameLoaded: r.frameLoaded || (() => {
8638
8648
  }),
8639
8649
  positionChanged: r.positionChanged || (() => {
@@ -8664,10 +8674,10 @@ class Ln extends dn {
8664
8674
  readingOrder: [],
8665
8675
  progressions: /* @__PURE__ */ new Map(),
8666
8676
  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 }),
8677
+ }, 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);
8678
+ const a = bt(e.metadata), l = a === "cjk-horizontal", h = a === "cjk-vertical", d = h || a === "mongolian-vertical", f = l || h;
8679
+ this._css = new io({
8680
+ rsProperties: new eo({ noVerticalPagination: d || void 0 }),
8671
8681
  userProperties: new _n({}),
8672
8682
  lineLengths: new kt({
8673
8683
  optimalChars: this._settings.optimalLineLength,
@@ -8677,33 +8687,33 @@ class Ln extends dn {
8677
8687
  fontFace: this._settings.fontFamily,
8678
8688
  letterSpacing: this._settings.letterSpacing,
8679
8689
  wordSpacing: this._settings.wordSpacing,
8680
- isCJK: p
8690
+ isCJK: f
8681
8691
  // sample: this.pub.metadata.description
8682
8692
  }),
8683
8693
  container: t,
8684
8694
  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(
8695
+ isCJKVertical: d
8696
+ }), 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
8697
  this._contentProtection,
8688
8698
  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({
8699
+ ), (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) => {
8700
+ const { type: u, ...p } = g.detail;
8701
+ u === "context_menu" ? this.listeners.contextMenu(p) : this.listeners.contentProtection(u, p);
8702
+ }, window.addEventListener(lt, this._suspiciousActivityListener)), this._keyboardPeripherals.length > 0 && (this._keyboardPeripheralsManager = new qe({
8693
8703
  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);
8704
+ }), this._keyboardPeripheralListener = (g) => {
8705
+ const u = g.detail;
8706
+ this.listeners.peripheral(u);
8707
+ }, 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
8708
  }
8699
8709
  static determineLayout(t, e) {
8700
8710
  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;
8711
+ if (i === w.fixed || t.metadata.otherMetadata && "http://openmangaformat.org/schema/1.0#version" in t.metadata.otherMetadata || t.metadata?.conformsTo?.includes(qi.DIVINA))
8712
+ return w.fixed;
8713
+ if (i === w.scrolled)
8714
+ return w.scrolled;
8705
8715
  const n = bt(t.metadata);
8706
- return n === "cjk-vertical" || n === "mongolian-vertical" || i === b.reflowable && e ? b.scrolled : b.reflowable;
8716
+ return n === "cjk-vertical" || n === "mongolian-vertical" || i === w.reflowable && e ? w.scrolled : w.reflowable;
8707
8717
  }
8708
8718
  async load() {
8709
8719
  if (this.positions?.length || (this.positions = await this.pub.positionsFromManifest()), !this._injector) {
@@ -8713,8 +8723,8 @@ class Ln extends dn {
8713
8723
  allowedDomains: this._injectablesConfig.allowedDomains
8714
8724
  });
8715
8725
  }
8716
- if (this._layout === b.fixed)
8717
- this.framePool = new $r(
8726
+ if (this._layout === w.fixed)
8727
+ this.framePool = new Gr(
8718
8728
  this.container,
8719
8729
  this.positions,
8720
8730
  this.pub,
@@ -8727,7 +8737,7 @@ class Ln extends dn {
8727
8737
  else {
8728
8738
  await this.updateCSS(!1);
8729
8739
  const t = this.compileCSSProperties(this._css);
8730
- this.framePool = new Tr(
8740
+ this.framePool = new Nr(
8731
8741
  this.container,
8732
8742
  this.positions,
8733
8743
  t,
@@ -8739,7 +8749,7 @@ class Ln extends dn {
8739
8749
  this.currentLocation === void 0 && (this.currentLocation = this.positions[0]), await this.resizeHandler(), await this.apply();
8740
8750
  }
8741
8751
  get settings() {
8742
- if (this._layout === b.fixed)
8752
+ if (this._layout === w.fixed)
8743
8753
  return Object.freeze({ ...this._settings });
8744
8754
  {
8745
8755
  const t = this._css.userProperties.colCount || this._css.rsProperties.colCount || this._settings.columnCount;
@@ -8754,7 +8764,7 @@ class Ln extends dn {
8754
8764
  }
8755
8765
  async applyPreferences() {
8756
8766
  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);
8767
+ 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
8768
  }
8759
8769
  // TODO: fit, etc.
8760
8770
  handleFXLPrefs(t, e) {
@@ -8774,11 +8784,11 @@ class Ln extends dn {
8774
8784
  async commitCSS(t) {
8775
8785
  if (!this.framePool) return;
8776
8786
  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();
8787
+ 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
8788
  }
8779
8789
  async resizeHandler() {
8780
8790
  const t = this.container.parentElement || document.documentElement;
8781
- if (this._layout === b.fixed) {
8791
+ if (this._layout === w.fixed) {
8782
8792
  if (this.container.style.width = `${Lt(t) - this._settings.constraint}px`, !this.framePool) return;
8783
8793
  this.framePool.resizeHandler();
8784
8794
  } else {
@@ -8862,7 +8872,7 @@ class Ln extends dn {
8862
8872
  }
8863
8873
  } else console.log("Clicked on", l);
8864
8874
  } 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) {
8875
+ 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
8876
  const c = this.framePool.currentFrames;
8867
8877
  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
8878
  }
@@ -8917,14 +8927,14 @@ class Ln extends dn {
8917
8927
  }
8918
8928
  determineModules() {
8919
8929
  let t = Array.from(Te.keys());
8920
- if (this._layout === b.fixed)
8921
- return t.filter((n) => fs.includes(n));
8930
+ if (this._layout === w.fixed)
8931
+ return t.filter((n) => ms.includes(n));
8922
8932
  t = t.filter((n) => gs.includes(n));
8923
8933
  const e = bt(this.pub.metadata);
8924
8934
  if (e === "cjk-vertical" || e === "mongolian-vertical")
8925
8935
  return t.filter((n) => n !== "column_snapper" && n !== "scroll_snapper");
8926
8936
  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;
8937
+ 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
8938
  }
8929
8939
  // Start listening to messages from the current iframe
8930
8940
  attachListener() {
@@ -8941,11 +8951,11 @@ class Ln extends dn {
8941
8951
  throw Error("Link for " + this.currentLocation.href + " not found!");
8942
8952
  }
8943
8953
  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();
8954
+ 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
8955
  }
8946
8956
  async changeResource(t) {
8947
8957
  if (t === 0) return !1;
8948
- if (this._layout === b.fixed) {
8958
+ if (this._layout === w.fixed) {
8949
8959
  const n = this.framePool, s = n.viewport.positions[0];
8950
8960
  if (t === 1) {
8951
8961
  if (!n.next(n.perPage)) return !1;
@@ -9028,7 +9038,7 @@ class Ln extends dn {
9028
9038
  e(!1);
9029
9039
  return;
9030
9040
  }
9031
- this._isNavigating = !0, this._layout === b.fixed ? this.changeResource(-1).then((i) => {
9041
+ this._isNavigating = !0, this._layout === w.fixed ? this.changeResource(-1).then((i) => {
9032
9042
  this._isNavigating = !1, e(i);
9033
9043
  }) : this._cframes[0]?.msg?.send("go_prev", void 0, async (i) => {
9034
9044
  if (i)
@@ -9044,7 +9054,7 @@ class Ln extends dn {
9044
9054
  e(!1);
9045
9055
  return;
9046
9056
  }
9047
- this._isNavigating = !0, this._layout === b.fixed ? this.changeResource(1).then((i) => {
9057
+ this._isNavigating = !0, this._layout === w.fixed ? this.changeResource(1).then((i) => {
9048
9058
  this._isNavigating = !1, e(i);
9049
9059
  }) : this._cframes[0]?.msg?.send("go_next", void 0, async (i) => {
9050
9060
  if (i)
@@ -9059,7 +9069,7 @@ class Ln extends dn {
9059
9069
  return this.currentLocation;
9060
9070
  }
9061
9071
  get viewport() {
9062
- return this._layout === b.fixed ? this.framePool ? this.framePool.viewport : { readingOrder: [], progressions: /* @__PURE__ */ new Map(), positions: null } : this.reflowViewport;
9072
+ return this._layout === w.fixed ? this.framePool ? this.framePool.viewport : { readingOrder: [], progressions: /* @__PURE__ */ new Map(), positions: null } : this.reflowViewport;
9063
9073
  }
9064
9074
  get isScrollStart() {
9065
9075
  const t = this.viewport.readingOrder[0];
@@ -9145,7 +9155,7 @@ class Ln extends dn {
9145
9155
  return this.go(t.locator, e, i);
9146
9156
  }
9147
9157
  }
9148
- const ro = `// PreservePitchProcessor.js
9158
+ const oo = `// PreservePitchProcessor.js
9149
9159
  // AudioWorklet processor for pitch preservation via pitch shifting.
9150
9160
  //
9151
9161
  // Architecture:
@@ -9370,7 +9380,7 @@ class Ke {
9370
9380
  if (n)
9371
9381
  await e.audioWorklet.addModule(n);
9372
9382
  else {
9373
- const o = new Blob([ro], { type: "text/javascript" });
9383
+ const o = new Blob([oo], { type: "text/javascript" });
9374
9384
  s.url = URL.createObjectURL(o), await e.audioWorklet.addModule(s.url);
9375
9385
  }
9376
9386
  } catch (o) {
@@ -9390,7 +9400,7 @@ class Ke {
9390
9400
  this.workletNode && (this.workletNode.disconnect(), this.workletNode = null), this.url && (URL.revokeObjectURL(this.url), this.url = null);
9391
9401
  }
9392
9402
  }
9393
- class oo {
9403
+ class ao {
9394
9404
  constructor(t) {
9395
9405
  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
9406
  }
@@ -9658,7 +9668,7 @@ class oo {
9658
9668
  }
9659
9669
  class ce {
9660
9670
  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);
9671
+ 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
9672
  }
9663
9673
  merging(t) {
9664
9674
  const e = { ...this };
@@ -9667,9 +9677,9 @@ class ce {
9667
9677
  return new ce(e);
9668
9678
  }
9669
9679
  }
9670
- class ao {
9680
+ class lo {
9671
9681
  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;
9682
+ 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
9683
  }
9674
9684
  }
9675
9685
  class ji {
@@ -9777,7 +9787,7 @@ class $i {
9777
9787
  }
9778
9788
  }
9779
9789
  const Gi = 1, Xi = 1;
9780
- class lo {
9790
+ class ho {
9781
9791
  constructor(t, e, i = {}) {
9782
9792
  this.pool = /* @__PURE__ */ new Map(), this._audioEngine = t, this._publication = e, this._supportedAudioTypes = this.detectSupportedAudioTypes(), i.disableRemotePlayback && (this._audioEngine.getMediaElement().disableRemotePlayback = !0);
9783
9793
  }
@@ -9854,7 +9864,7 @@ class lo {
9854
9864
  this.pool.clear();
9855
9865
  }
9856
9866
  }
9857
- class ho {
9867
+ class co {
9858
9868
  constructor(t = {}) {
9859
9869
  this.dragstartHandler = (e) => {
9860
9870
  e.preventDefault(), e.stopPropagation(), t.onDragDetected?.(Array.from(e.dataTransfer?.types ?? []));
@@ -9870,7 +9880,7 @@ class ho {
9870
9880
  document.removeEventListener("dragstart", this.dragstartHandler, !0), document.removeEventListener("dragover", this.dragoverHandler, !0), document.removeEventListener("drop", this.dropHandler, !0), window.removeEventListener("unload", this.unloadHandler);
9871
9881
  }
9872
9882
  }
9873
- class co {
9883
+ class uo {
9874
9884
  constructor(t = {}) {
9875
9885
  this.copyHandler = (e) => {
9876
9886
  e.preventDefault(), e.stopPropagation(), t.onCopyBlocked?.();
@@ -9880,16 +9890,16 @@ class co {
9880
9890
  document.removeEventListener("copy", this.copyHandler, !0), window.removeEventListener("unload", this.unloadHandler);
9881
9891
  }
9882
9892
  }
9883
- class uo extends Ye {
9893
+ class po extends Ye {
9884
9894
  constructor(t = {}) {
9885
- super(t), t.disableDragAndDrop && (this.dragAndDropProtector = new ho({
9895
+ super(t), t.disableDragAndDrop && (this.dragAndDropProtector = new co({
9886
9896
  onDragDetected: (e) => {
9887
9897
  this.dispatchSuspiciousActivity("drag_detected", { dataTransferTypes: e, targetFrameSrc: "" });
9888
9898
  },
9889
9899
  onDropDetected: (e, i) => {
9890
9900
  this.dispatchSuspiciousActivity("drop_detected", { dataTransferTypes: e, fileCount: i, targetFrameSrc: "" });
9891
9901
  }
9892
- })), t.protectCopy && (this.copyProtector = new co({
9902
+ })), t.protectCopy && (this.copyProtector = new uo({
9893
9903
  onCopyBlocked: () => {
9894
9904
  this.dispatchSuspiciousActivity("bulk_copy", { targetFrameSrc: "" });
9895
9905
  }
@@ -9899,7 +9909,7 @@ class uo extends Ye {
9899
9909
  super.destroy(), this.dragAndDropProtector?.destroy(), this.copyProtector?.destroy();
9900
9910
  }
9901
9911
  }
9902
- const po = (r) => ({
9912
+ const fo = (r) => ({
9903
9913
  trackLoaded: r.trackLoaded ?? (() => {
9904
9914
  }),
9905
9915
  positionChanged: r.positionChanged ?? (() => {
@@ -9931,21 +9941,21 @@ const po = (r) => ({
9931
9941
  remotePlaybackStateChanged: r.remotePlaybackStateChanged ?? (() => {
9932
9942
  })
9933
9943
  });
9934
- class yo extends Ss {
9944
+ class bo extends Ps {
9935
9945
  constructor(t, e, i, n = {
9936
9946
  preferences: {},
9937
9947
  defaults: {}
9938
9948
  }) {
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)
9949
+ 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
9950
  throw new Error("AudioNavigator: publication has an empty reading order");
9941
9951
  if (i)
9942
9952
  this.currentLocation = this.ensureLocatorLocations(i);
9943
9953
  else {
9944
- const u = this.pub.readingOrder.items[0];
9954
+ const d = this.pub.readingOrder.items[0];
9945
9955
  this.currentLocation = new I({
9946
- href: u.href,
9947
- type: u.type || "audio/mpeg",
9948
- title: u.title,
9956
+ href: d.href,
9957
+ type: d.type || "audio/mpeg",
9958
+ title: d.title,
9949
9959
  locations: new C({
9950
9960
  position: 1,
9951
9961
  progression: 0,
@@ -9957,7 +9967,7 @@ class yo extends Ss {
9957
9967
  const s = this.currentLocation.href.split("#")[0], o = this.hrefToTrackIndex(s);
9958
9968
  if (o === -1)
9959
9969
  throw new Error(`AudioNavigator: initial href "${s}" not found in reading order`);
9960
- const a = this.currentLocation.locations?.time() || 0, l = new oo({
9970
+ const a = this.currentLocation.locations?.time() || 0, l = new ao({
9961
9971
  playback: {
9962
9972
  state: {
9963
9973
  currentTime: a,
@@ -9967,19 +9977,19 @@ class yo extends Ss {
9967
9977
  index: o
9968
9978
  }
9969
9979
  });
9970
- this.pool = new lo(l, t, n.contentProtection);
9980
+ this.pool = new ho(l, t, n.contentProtection);
9971
9981
  const h = n.contentProtection || {};
9972
9982
  this._contentProtection = h;
9973
9983
  const c = this.mergeKeyboardPeripherals(
9974
9984
  h,
9975
9985
  n.keyboardPeripherals || []
9976
9986
  );
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(() => {
9987
+ (h.disableContextMenu || h.checkAutomation || h.checkIFrameEmbedding || h.monitorDevTools || h.protectPrinting?.disable || h.disableDragAndDrop || h.protectCopy) && (this._navigatorProtector = new po(h), this._suspiciousActivityListener = (d) => {
9988
+ const { type: f, ...g } = d.detail;
9989
+ f === "context_menu" ? this.listeners.contextMenu(g) : this.listeners.contentProtection(f, g);
9990
+ }, window.addEventListener(lt, this._suspiciousActivityListener)), c.length > 0 && (this._keyboardPeripheralsManager = new qe({ keyboardPeripherals: c }), this._keyboardPeripheralListener = (d) => {
9991
+ this.listeners.peripheral(d.detail);
9992
+ }, window.addEventListener(ht, this._keyboardPeripheralListener)), this.setupEventListeners(), this._isNavigating = !0, this.pool.setCurrentAudio(o, "forward"), this.applyPreferences(), this.waitForLoadedAndSeeked(a).then(() => {
9983
9993
  this._isNavigating = !1, this.listeners.trackLoaded(this.pool.audioEngine.getMediaElement()), this._notifyTimelineChange(this.currentLocator), this.listeners.positionChanged(this.currentLocator), this._setupRemotePlayback();
9984
9994
  }).catch(() => {
9985
9995
  this._isNavigating = !1;
@@ -10287,66 +10297,66 @@ class yo extends Ss {
10287
10297
  "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
10298
  }
10289
10299
  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();
10300
+ 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
10301
  }
10292
10302
  }
10293
10303
  export {
10294
- ao as AudioDefaults,
10295
- yo as AudioNavigator,
10304
+ lo as AudioDefaults,
10305
+ bo as AudioNavigator,
10296
10306
  ce as AudioPreferences,
10297
10307
  $i as AudioPreferencesEditor,
10298
10308
  ji as AudioSettings,
10299
10309
  A as BooleanPreference,
10300
10310
  yn as EnumPreference,
10301
- Gr as EpubDefaults,
10311
+ Xr as EpubDefaults,
10302
10312
  Ln as EpubNavigator,
10303
10313
  Ft as EpubPreferences,
10304
10314
  Bi as EpubPreferencesEditor,
10305
10315
  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,
10316
+ yo as ExperimentalWebPubNavigator,
10317
+ zr as FXLCoordinator,
10318
+ Mr as FXLFrameManager,
10319
+ Gr as FXLFramePoolManager,
10320
+ Wr as FXLPeripherals,
10321
+ Ur as FXLSpreader,
10312
10322
  Nt as FrameComms,
10313
10323
  Cn as FrameManager,
10314
- Tr as FramePoolManager,
10315
- Mr as HorizontalThird,
10324
+ Nr as FramePoolManager,
10325
+ Fr as HorizontalThird,
10316
10326
  vn as Injector,
10317
10327
  kt as LineLengths,
10318
- Ss as MediaNavigator,
10328
+ Ps as MediaNavigator,
10319
10329
  cn as Navigator,
10320
10330
  Ne as Orientation,
10321
10331
  N as Preference,
10322
10332
  le as Properties,
10323
- to as RSProperties,
10333
+ eo as RSProperties,
10324
10334
  x as RangePreference,
10325
- eo as ReadiumCSS,
10335
+ io as ReadiumCSS,
10326
10336
  Me as Spread,
10327
10337
  tt as TextAlignment,
10328
10338
  _n as UserProperties,
10329
- Fr as VerticalThird,
10339
+ Ir as VerticalThird,
10330
10340
  dn as VisualNavigator,
10331
- oo as WebAudioEngine,
10332
- Ps as WebPubBlobBuilder,
10333
- cr as WebPubCSS,
10334
- pr as WebPubDefaults,
10335
- ks as WebPubFrameManager,
10341
+ ao as WebAudioEngine,
10342
+ Es as WebPubBlobBuilder,
10343
+ dr as WebPubCSS,
10344
+ fr as WebPubDefaults,
10345
+ Rs as WebPubFrameManager,
10336
10346
  Os as WebPubFramePoolManager,
10337
- Rr as WebPubNavigator,
10347
+ Ar as WebPubNavigator,
10338
10348
  Mt as WebPubPreferences,
10339
10349
  Ti as WebPubPreferencesEditor,
10340
10350
  Ai as WebPubSettings,
10341
- hr as WebRSProperties,
10342
- gn as WebUserProperties,
10351
+ cr as WebRSProperties,
10352
+ mn as WebUserProperties,
10343
10353
  E as ensureBoolean,
10344
10354
  he as ensureEnumValue,
10345
- mn as ensureExperiment,
10355
+ gn as ensureExperiment,
10346
10356
  wt as ensureFilter,
10347
- dr as ensureLessThanOrEqual,
10348
- ur as ensureMoreThanOrEqual,
10349
- v as ensureNonNegative,
10357
+ ur as ensureLessThanOrEqual,
10358
+ pr as ensureMoreThanOrEqual,
10359
+ S as ensureNonNegative,
10350
10360
  W as ensureString,
10351
10361
  F as ensureValueInRange,
10352
10362
  Ge as experiments,
@@ -10364,10 +10374,10 @@ export {
10364
10374
  ne as playbackRateRangeConfig,
10365
10375
  J as sML,
10366
10376
  T as sMLWithRequest,
10367
- fo as settings,
10377
+ mo as settings,
10368
10378
  it as skipIntervalRangeConfig,
10369
10379
  ie as volumeRangeConfig,
10370
- me as withFallback,
10380
+ ge as withFallback,
10371
10381
  te as wordSpacingRangeConfig,
10372
10382
  ee as zoomRangeConfig
10373
10383
  };