@readium/navigator 2.5.2-beta.4 → 2.5.2

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.
Files changed (25) hide show
  1. package/dist/{ReadiumCSS-after-DBPN8It0.js → ReadiumCSS-after-BYNAMW5u.js} +4 -4
  2. package/dist/{ReadiumCSS-after-CVNJvQab.js → ReadiumCSS-after-C8SjJ_Rf.js} +4 -4
  3. package/dist/{ReadiumCSS-after-CPAYSG9F.js → ReadiumCSS-after-Dzd22Ssm.js} +6 -7
  4. package/dist/{ReadiumCSS-after-Cpw6SSeZ.js → ReadiumCSS-after-b-ykC0_O.js} +11 -12
  5. package/dist/ReadiumCSS-before-6kD9Qj82.js +529 -0
  6. package/dist/ReadiumCSS-before-CvMFpmud.js +529 -0
  7. package/dist/ReadiumCSS-before-crwPhKrV.js +529 -0
  8. package/dist/ReadiumCSS-before-usMdEglk.js +530 -0
  9. package/dist/{ReadiumCSS-default-BMLfH2r9.js → ReadiumCSS-default-BVp3Ygi2.js} +1 -1
  10. package/dist/{ReadiumCSS-default-C_BHdXWz.js → ReadiumCSS-default-CL_hP__L.js} +1 -1
  11. package/dist/{ReadiumCSS-default-BTgk8NbH.js → ReadiumCSS-default-nJgSC4Z_.js} +1 -1
  12. package/dist/{ReadiumCSS-default-C7kHIm6s.js → ReadiumCSS-default-vv7hNCaM.js} +1 -1
  13. package/dist/index.js +621 -581
  14. package/dist/index.umd.cjs +703 -290
  15. package/package.json +2 -2
  16. package/src/epub/fxl/FXLFrameManager.ts +13 -2
  17. package/src/epub/preferences/EpubPreferencesEditor.ts +6 -6
  18. package/src/helpers/lineLength.ts +1 -1
  19. package/src/preferences/Types.ts +21 -1
  20. package/types/src/epub/fxl/FXLFrameManager.d.ts +1 -0
  21. package/types/src/preferences/Types.d.ts +15 -0
  22. package/dist/ReadiumCSS-before-CA1r4W7i.js +0 -425
  23. package/dist/ReadiumCSS-before-D5x0zuZP.js +0 -425
  24. package/dist/ReadiumCSS-before-DXNoxSjL.js +0 -426
  25. package/dist/ReadiumCSS-before-DtkzLMzT.js +0 -425
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- const S = class S {
1
+ const v = class v {
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 v(t);
11
11
  }
12
12
  /**
13
13
  * Serializes an [AccessibilityProfile] to its RWPM JSON representation.
@@ -19,24 +19,24 @@ 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 === v.EPUB_A11Y_10_WCAG_20_A || this === v.EPUB_A11Y_11_WCAG_20_A || this === v.EPUB_A11Y_11_WCAG_21_A || this === v.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 === v.EPUB_A11Y_10_WCAG_20_AA || this === v.EPUB_A11Y_11_WCAG_20_AA || this === v.EPUB_A11Y_11_WCAG_21_AA || this === v.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 === v.EPUB_A11Y_10_WCAG_20_AAA || this === v.EPUB_A11Y_11_WCAG_20_AAA || this === v.EPUB_A11Y_11_WCAG_21_AAA || this === v.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 Ze = S;
39
- const C = class C {
37
+ v.EPUB_A11Y_10_WCAG_20_A = new v("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-a"), v.EPUB_A11Y_10_WCAG_20_AA = new v("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-aa"), v.EPUB_A11Y_10_WCAG_20_AAA = new v("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-aaa"), v.EPUB_A11Y_11_WCAG_20_A = new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-a"), v.EPUB_A11Y_11_WCAG_20_AA = new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-aa"), v.EPUB_A11Y_11_WCAG_20_AAA = new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-aaa"), v.EPUB_A11Y_11_WCAG_21_A = new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-a"), v.EPUB_A11Y_11_WCAG_21_AA = new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-aa"), v.EPUB_A11Y_11_WCAG_21_AAA = new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-aaa"), v.EPUB_A11Y_11_WCAG_22_A = new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-a"), v.EPUB_A11Y_11_WCAG_22_AA = new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-aa"), v.EPUB_A11Y_11_WCAG_22_AAA = new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-aaa");
38
+ let Qe = v;
39
+ const _ = class _ {
40
40
  constructor(t) {
41
41
  this.value = t;
42
42
  }
@@ -45,7 +45,7 @@ const C = class C {
45
45
  */
46
46
  static deserialize(t) {
47
47
  if (!(!t || typeof t != "string"))
48
- return new C(t);
48
+ return new _(t);
49
49
  }
50
50
  /**
51
51
  * Serializes an [AccessMode] to its RWPM JSON representation.
@@ -54,17 +54,17 @@ const C = class C {
54
54
  return this.value;
55
55
  }
56
56
  };
57
- C.AUDITORY = new C("auditory"), C.CHART_ON_VISUAL = new C("chartOnVisual"), C.CHEM_ON_VISUAL = new C("chemOnVisual"), C.COLOR_DEPENDENT = new C("colorDependent"), C.DIAGRAM_ON_VISUAL = new C("diagramOnVisual"), C.MATH_ON_VISUAL = new C("mathOnVisual"), C.MUSIC_ON_VISUAL = new C("musicOnVisual"), C.TACTILE = new C("tactile"), C.TEXT_ON_VISUAL = new C("textOnVisual"), C.TEXTUAL = new C("textual"), C.VISUAL = new C("visual");
58
- let Qe = C;
59
- const D = class D {
57
+ _.AUDITORY = new _("auditory"), _.CHART_ON_VISUAL = new _("chartOnVisual"), _.CHEM_ON_VISUAL = new _("chemOnVisual"), _.COLOR_DEPENDENT = new _("colorDependent"), _.DIAGRAM_ON_VISUAL = new _("diagramOnVisual"), _.MATH_ON_VISUAL = new _("mathOnVisual"), _.MUSIC_ON_VISUAL = new _("musicOnVisual"), _.TACTILE = new _("tactile"), _.TEXT_ON_VISUAL = new _("textOnVisual"), _.TEXTUAL = new _("textual"), _.VISUAL = new _("visual");
58
+ let ti = _;
59
+ const z = class z {
60
60
  constructor(t) {
61
61
  if (typeof t == "string") {
62
- if (!D.VALID_MODES.has(t.toLowerCase()))
62
+ if (!z.VALID_MODES.has(t.toLowerCase()))
63
63
  return;
64
64
  this.value = t.toLowerCase();
65
65
  } else {
66
66
  const e = t.filter(
67
- (i) => D.VALID_MODES.has(i.toLowerCase())
67
+ (i) => z.VALID_MODES.has(i.toLowerCase())
68
68
  );
69
69
  if (e.length === 0)
70
70
  return;
@@ -77,11 +77,11 @@ const D = class D {
77
77
  static deserialize(t) {
78
78
  if (!t) return;
79
79
  if (typeof t == "string")
80
- return new D(t);
80
+ return new z(t);
81
81
  if (!Array.isArray(t)) return;
82
- const e = t.filter((i) => i ? D.VALID_MODES.has(i.toLowerCase()) : !1);
82
+ const e = t.filter((i) => i ? z.VALID_MODES.has(i.toLowerCase()) : !1);
83
83
  if (e.length !== 0)
84
- return new D(e);
84
+ return new z(e);
85
85
  }
86
86
  /**
87
87
  * Serializes a [PrimaryAccessMode] to its RWPM JSON representation.
@@ -90,8 +90,8 @@ const D = class D {
90
90
  return this.value;
91
91
  }
92
92
  };
93
- D.VALID_MODES = /* @__PURE__ */ new Set(["auditory", "tactile", "textual", "visual"]), D.AUDITORY = new D("auditory"), D.TACTILE = new D("tactile"), D.TEXTUAL = new D("textual"), D.VISUAL = new D("visual");
94
- let ti = D;
93
+ z.VALID_MODES = /* @__PURE__ */ new Set(["auditory", "tactile", "textual", "visual"]), z.AUDITORY = new z("auditory"), z.TACTILE = new z("tactile"), z.TEXTUAL = new z("textual"), z.VISUAL = new z("visual");
94
+ let ei = z;
95
95
  const y = class y {
96
96
  constructor(t) {
97
97
  this.value = t;
@@ -111,7 +111,7 @@ const y = class y {
111
111
  }
112
112
  };
113
113
  y.NONE = new y("none"), y.ANNOTATIONS = new y("annotations"), y.ARIA = new y("ARIA"), y.INDEX = new y("index"), y.PAGE_BREAK_MARKERS = new y("pageBreakMarkers"), y.PAGE_NAVIGATION = new y("pageNavigation"), y.PRINT_PAGE_NUMBERS = new y("printPageNumbers"), y.READING_ORDER = new y("readingOrder"), y.STRUCTURAL_NAVIGATION = new y("structuralNavigation"), y.TABLE_OF_CONTENTS = new y("tableOfContents"), y.TAGGED_PDF = new y("taggedPDF"), y.ALTERNATIVE_TEXT = new y("alternativeText"), y.AUDIO_DESCRIPTION = new y("audioDescription"), y.CAPTIONS = new y("captions"), y.CLOSED_CAPTIONS = new y("closedCaptions"), y.DESCRIBED_MATH = new y("describedMath"), y.LONG_DESCRIPTION = new y("longDescription"), y.OPEN_CAPTIONS = new y("openCaptions"), y.SIGN_LANGUAGE = new y("signLanguage"), y.TRANSCRIPT = new y("transcript"), y.DISPLAY_TRANSFORMABILITY = new y("displayTransformability"), y.SYNCHRONIZED_AUDIO_TEXT = new y("synchronizedAudioText"), y.TIMING_CONTROL = new y("timingControl"), y.UNLOCKED = new y("unlocked"), y.CHEM_ML = new y("ChemML"), y.LATEX = new y("latex"), y.LATEX_CHEMISTRY = new y("latex-chemistry"), y.MATH_ML = new y("MathML"), y.MATH_ML_CHEMISTRY = new y("MathML-chemistry"), y.TTS_MARKUP = new y("ttsMarkup"), y.HIGH_CONTRAST_AUDIO = new y("highContrastAudio"), y.HIGH_CONTRAST_DISPLAY = new y("highContrastDisplay"), y.LARGE_PRINT = new y("largePrint"), y.BRAILLE = new y("braille"), y.TACTILE_GRAPHIC = new y("tactileGraphic"), y.TACTILE_OBJECT = new y("tactileObject"), y.FULL_RUBY_ANNOTATIONS = new y("fullRubyAnnotations"), y.HORIZONTAL_WRITING = new y("horizontalWriting"), y.RUBY_ANNOTATIONS = new y("rubyAnnotations"), y.VERTICAL_WRITING = new y("verticalWriting"), y.WITH_ADDITIONAL_WORD_SEGMENTATION = new y("withAdditionalWordSegmentation"), y.WITHOUT_ADDITIONAL_WORD_SEGMENTATION = new y("withoutAdditionalWordSegmentation");
114
- let Bt = y;
114
+ let Ht = y;
115
115
  const L = class L {
116
116
  constructor(t) {
117
117
  this.value = t;
@@ -131,7 +131,7 @@ const L = class L {
131
131
  }
132
132
  };
133
133
  L.FLASHING = new L("flashing"), L.NO_FLASHING_HAZARD = new L("noFlashingHazard"), L.UNKNOWN_FLASHING_HAZARD = new L("unknownFlashingHazard"), L.MOTION_SIMULATION = new L("motionSimulation"), L.NO_MOTION_SIMULATION_HAZARD = new L("noMotionSimulationHazard"), L.UNKNOWN_MOTION_SIMULATION_HAZARD = new L("unknownMotionSimulationHazard"), L.SOUND = new L("sound"), L.NO_SOUND_HAZARD = new L("noSoundHazard"), L.UNKNOWN_SOUND_HAZARD = new L("unknownSoundHazard"), L.UNKNOWN = new L("unknown"), L.NONE = new L("none");
134
- let ei = L;
134
+ let ii = L;
135
135
  const k = class k {
136
136
  constructor(t) {
137
137
  this.value = t;
@@ -151,10 +151,10 @@ const k = class k {
151
151
  }
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
- let ii = k;
155
- const ni = ["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 = {
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
156
  publication: kn
157
- }, si = {
157
+ }, ri = {
158
158
  fr: () => import("./fr-C5HEel98.js"),
159
159
  ar: () => import("./ar-DyHX_uy2.js"),
160
160
  da: () => import("./da-Dct0PS3E.js"),
@@ -165,10 +165,10 @@ const ni = ["en", "ar", "da", "fr", "it", "pt_PT", "sv"], kn = /* @__PURE__ */ J
165
165
  sv: () => import("./sv-BfzAFsVN.js")
166
166
  // 'tr': () => import('@edrlab/thorium-locales/publication-metadata/tr.json'),
167
167
  // 'uk': () => import('@edrlab/thorium-locales/publication-metadata/uk.json')
168
- }, ri = On?.publication?.metadata?.accessibility?.["display-guide"] || {};
168
+ }, oi = On?.publication?.metadata?.accessibility?.["display-guide"] || {};
169
169
  class gt {
170
170
  constructor() {
171
- this.currentLocaleCode = "en", this.locale = ri, this.loadedLocales = {}, this.loadedLocales.en = ri;
171
+ this.currentLocaleCode = "en", this.locale = oi, this.loadedLocales = {}, this.loadedLocales.en = oi;
172
172
  }
173
173
  static getInstance() {
174
174
  return gt.instance || (gt.instance = new gt()), gt.instance;
@@ -179,14 +179,14 @@ class gt {
179
179
  * @returns Promise indicating if the locale was loaded successfully
180
180
  */
181
181
  async loadLocale(t) {
182
- if (!ni.includes(t))
182
+ if (!si.includes(t))
183
183
  return console.warn(`Locale '${t}' is not enabled`), !1;
184
184
  if (t in this.loadedLocales)
185
185
  return !0;
186
186
  try {
187
- if (!(t in si))
187
+ if (!(t in ri))
188
188
  return console.warn(`Locale file not found for: ${t}`), !1;
189
- const n = (await si[t]()).default?.publication?.metadata?.accessibility?.["display-guide"];
189
+ const n = (await ri[t]()).default?.publication?.metadata?.accessibility?.["display-guide"];
190
190
  return n ? (this.loadedLocales[t] = n, !0) : (console.warn(`No accessibility strings found in locale ${t}`), !1);
191
191
  } catch (e) {
192
192
  return console.warn(`Failed to load locale ${t}:`, e), !1;
@@ -220,7 +220,7 @@ class gt {
220
220
  * Gets a list of available locale codes
221
221
  */
222
222
  getAvailableLocales() {
223
- return ni;
223
+ return si;
224
224
  }
225
225
  getNestedValue(t, e) {
226
226
  const i = e.split(".");
@@ -244,7 +244,7 @@ class gt {
244
244
  }
245
245
  gt.getInstance();
246
246
  var b = /* @__PURE__ */ ((r) => (r.reflowable = "reflowable", r.fixed = "fixed", r.scrolled = "scrolled", r))(b || {});
247
- class ze {
247
+ class Fe {
248
248
  /**
249
249
  * Creates a [Encryption].
250
250
  */
@@ -256,7 +256,7 @@ class ze {
256
256
  */
257
257
  static deserialize(t) {
258
258
  if (t && t.algorithm)
259
- return new ze({
259
+ return new Fe({
260
260
  algorithm: t.algorithm,
261
261
  compression: t.compression,
262
262
  originalLength: t.originalLength,
@@ -272,8 +272,8 @@ class ze {
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 X = /* @__PURE__ */ ((r) => (r.left = "left", r.right = "right", r.center = "center", r))(X || {});
276
- let G = class be {
275
+ var G = /* @__PURE__ */ ((r) => (r.left = "left", r.right = "right", r.center = "center", r))(G || {});
276
+ let X = class be {
277
277
  constructor(t) {
278
278
  this.otherProperties = t;
279
279
  }
@@ -303,18 +303,18 @@ let G = class be {
303
303
  return new be(e);
304
304
  }
305
305
  };
306
- Object.defineProperty(G.prototype, "encryption", {
306
+ Object.defineProperty(X.prototype, "encryption", {
307
307
  get: function() {
308
- return ze.deserialize(this.otherProperties.encrypted);
308
+ return Fe.deserialize(this.otherProperties.encrypted);
309
309
  }
310
310
  });
311
311
  function Rn(r) {
312
312
  return r && Array.isArray(r) ? r : void 0;
313
313
  }
314
- function Gi(r) {
314
+ function Yi(r) {
315
315
  return r && typeof r == "string" ? [r] : Rn(r);
316
316
  }
317
- function oi(r) {
317
+ function ai(r) {
318
318
  return typeof r == "string" ? new Date(r) : void 0;
319
319
  }
320
320
  function Ut(r) {
@@ -786,7 +786,7 @@ class m {
786
786
  });
787
787
  }
788
788
  }
789
- class ai {
789
+ class li {
790
790
  constructor(t) {
791
791
  this.uri = t, this.parameters = this.getParameters(t);
792
792
  }
@@ -814,7 +814,7 @@ class ai {
814
814
  return this.uri.replace(/\{(\??)([^}]+)\}/g, (...n) => n[1] ? i(n[2]) : e(n[2]));
815
815
  }
816
816
  }
817
- class _ {
817
+ class C {
818
818
  /**
819
819
  * Creates a [Locations].
820
820
  */
@@ -835,8 +835,8 @@ class _ {
835
835
  ]);
836
836
  return Object.entries(t).forEach(([a, l]) => {
837
837
  o.has(a) || s.set(a, l);
838
- }), new _({
839
- fragments: Gi(t.fragments || t.fragment),
838
+ }), new C({
839
+ fragments: Yi(t.fragments || t.fragment),
840
840
  progression: e !== void 0 && e >= 0 && e <= 1 ? e : void 0,
841
841
  totalProgression: i !== void 0 && i >= 0 && i <= 1 ? i : void 0,
842
842
  position: n !== void 0 && n > 0 ? n : void 0,
@@ -882,7 +882,7 @@ class I {
882
882
  * Creates a [Locator].
883
883
  */
884
884
  constructor(t) {
885
- this.href = t.href, this.type = t.type, this.title = t.title, this.locations = t.locations ? t.locations : new _({}), this.text = t.text;
885
+ this.href = t.href, this.type = t.type, this.title = t.title, this.locations = t.locations ? t.locations : new C({}), this.text = t.text;
886
886
  }
887
887
  /**
888
888
  * Parses a [Link] from its RWPM JSON representation.
@@ -893,7 +893,7 @@ class I {
893
893
  href: t.href,
894
894
  type: t.type,
895
895
  title: t.title,
896
- locations: _.deserialize(t.locations),
896
+ locations: C.deserialize(t.locations),
897
897
  text: rt.deserialize(t.text)
898
898
  });
899
899
  }
@@ -913,7 +913,7 @@ class I {
913
913
  type: this.type,
914
914
  title: this.title,
915
915
  text: this.text,
916
- locations: new _({ ...this.locations, ...t })
916
+ locations: new C({ ...this.locations, ...t })
917
917
  });
918
918
  }
919
919
  }
@@ -935,15 +935,15 @@ 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: G.deserialize(t.properties),
938
+ properties: X.deserialize(t.properties),
939
939
  height: V(t.height),
940
940
  width: V(t.width),
941
941
  size: V(t.size),
942
942
  duration: V(t.duration),
943
943
  bitrate: V(t.bitrate),
944
- languages: Gi(t.language),
945
- alternates: Ht.deserialize(t.alternate),
946
- children: Ht.deserialize(t.children)
944
+ languages: Yi(t.language),
945
+ alternates: Bt.deserialize(t.alternate),
946
+ children: Bt.deserialize(t.children)
947
947
  });
948
948
  }
949
949
  /**
@@ -968,14 +968,14 @@ class $ {
968
968
  }
969
969
  /** List of URI template parameter keys, if the `Link` is templated. */
970
970
  get templateParameters() {
971
- return this.templated ? new ai(this.href).parameters : /* @__PURE__ */ new Set();
971
+ return this.templated ? new li(this.href).parameters : /* @__PURE__ */ new Set();
972
972
  }
973
973
  /** Expands the `Link`'s HREF by replacing URI template variables by the given parameters.
974
974
  * See RFC 6570 on URI template: https://tools.ietf.org/html/rfc6570
975
975
  */
976
976
  expandTemplate(t) {
977
977
  return new $({
978
- href: new ai(this.href).expand(t),
978
+ href: new li(this.href).expand(t),
979
979
  templated: !1
980
980
  });
981
981
  }
@@ -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 G(t), e;
987
+ return e.properties = e.properties ? e.properties?.add(t) : new X(t), e;
988
988
  }
989
989
  /**
990
990
  * Creates a [Locator] from a reading order [Link].
@@ -995,13 +995,13 @@ class $ {
995
995
  href: t.length > 0 && t[0] !== void 0 ? t[0] : this.href,
996
996
  type: this.type ?? "",
997
997
  title: this.title,
998
- locations: new _({
998
+ locations: new C({
999
999
  fragments: t.length > 1 && t[1] !== void 0 ? [t[1]] : []
1000
1000
  })
1001
1001
  });
1002
1002
  }
1003
1003
  }
1004
- class Ht {
1004
+ class Bt {
1005
1005
  /**
1006
1006
  * Creates a [Links].
1007
1007
  */
@@ -1013,7 +1013,7 @@ class Ht {
1013
1013
  */
1014
1014
  static deserialize(t) {
1015
1015
  if (t && Array.isArray(t))
1016
- return new Ht(
1016
+ return new Bt(
1017
1017
  t.map((e) => $.deserialize(e)).filter((e) => e !== void 0)
1018
1018
  );
1019
1019
  }
@@ -1095,8 +1095,8 @@ class Ht {
1095
1095
  return this.items.filter((t) => t.type);
1096
1096
  }
1097
1097
  }
1098
- var Yi = /* @__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))(Yi || {}), N = /* @__PURE__ */ ((r) => (r.ltr = "ltr", r.rtl = "rtl", r))(N || {});
1099
- G.prototype.getContains = function() {
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() {
1100
1100
  return new Set(this.otherProperties.contains || []);
1101
1101
  };
1102
1102
  class Vt {
@@ -1158,16 +1158,16 @@ class Ie {
1158
1158
  return this.end && (t.end = this.end.serialize()), t;
1159
1159
  }
1160
1160
  }
1161
- _.prototype.getCssSelector = function() {
1161
+ C.prototype.getCssSelector = function() {
1162
1162
  return this.otherLocations?.get("cssSelector");
1163
1163
  };
1164
- _.prototype.getPartialCfi = function() {
1164
+ C.prototype.getPartialCfi = function() {
1165
1165
  return this.otherLocations?.get("partialCfi");
1166
1166
  };
1167
- _.prototype.getDomRange = function() {
1167
+ C.prototype.getDomRange = function() {
1168
1168
  return Ie.deserialize(this.otherLocations?.get("domRange"));
1169
1169
  };
1170
- _.prototype.fragmentParameters = function() {
1170
+ C.prototype.fragmentParameters = function() {
1171
1171
  return new Map(
1172
1172
  this.fragments.map((r) => r.startsWith("#") ? r.slice(1) : r).join("&").split("&").filter((r) => !r.startsWith("#")).map((r) => r.split("=")).filter((r) => r.length === 2).map((r) => [
1173
1173
  r[0].trim().toLowerCase(),
@@ -1175,7 +1175,7 @@ _.prototype.fragmentParameters = function() {
1175
1175
  ])
1176
1176
  );
1177
1177
  };
1178
- _.prototype.htmlId = function() {
1178
+ C.prototype.htmlId = function() {
1179
1179
  if (!this.fragments.length) return;
1180
1180
  let r = this.fragments.find((t) => t.length && !t.includes("="));
1181
1181
  if (!r) {
@@ -1184,22 +1184,22 @@ _.prototype.htmlId = function() {
1184
1184
  }
1185
1185
  return r?.startsWith("#") ? r.slice(1) : r;
1186
1186
  };
1187
- _.prototype.page = function() {
1187
+ C.prototype.page = function() {
1188
1188
  const r = parseInt(this.fragmentParameters().get("page"));
1189
1189
  if (!isNaN(r) && r >= 0) return r;
1190
1190
  };
1191
- _.prototype.time = function() {
1191
+ C.prototype.time = function() {
1192
1192
  const r = parseInt(this.fragmentParameters().get("t"));
1193
1193
  if (!isNaN(r)) return r;
1194
1194
  };
1195
- _.prototype.space = function() {
1195
+ C.prototype.space = function() {
1196
1196
  const r = this.fragmentParameters();
1197
1197
  if (!r.has("xywh")) return;
1198
1198
  const t = r.get("xywh").split(",").map((e) => parseInt(e));
1199
1199
  if (t.length === 4 && !t.some(isNaN))
1200
1200
  return t;
1201
1201
  };
1202
- class De {
1202
+ class ze {
1203
1203
  /** Creates a [Price]. */
1204
1204
  constructor(t) {
1205
1205
  this.currency = t.currency, this.value = t.value;
@@ -1214,7 +1214,7 @@ class De {
1214
1214
  return;
1215
1215
  let i = V(t.value);
1216
1216
  if (i !== void 0)
1217
- return new De({ currency: e, value: i });
1217
+ return new ze({ currency: e, value: i });
1218
1218
  }
1219
1219
  /**
1220
1220
  * Serializes a [Price] to its RWPM JSON representation.
@@ -1250,7 +1250,7 @@ class xt {
1250
1250
  return this.children && (t.children = this.children.map((e) => e.serialize())), t;
1251
1251
  }
1252
1252
  }
1253
- class Fe {
1253
+ class De {
1254
1254
  /** Creates a [Price]. */
1255
1255
  constructor(t) {
1256
1256
  this.total = t.total, this.position = t.position;
@@ -1260,7 +1260,7 @@ class Fe {
1260
1260
  */
1261
1261
  static deserialize(t) {
1262
1262
  if (t)
1263
- return new Fe({
1263
+ return new De({
1264
1264
  total: V(t.total),
1265
1265
  position: V(t.position)
1266
1266
  });
@@ -1308,8 +1308,8 @@ class Ue {
1308
1308
  if (t && t.state)
1309
1309
  return new Ue({
1310
1310
  state: t.state,
1311
- since: oi(t.since),
1312
- until: oi(t.until)
1311
+ since: ai(t.since),
1312
+ until: ai(t.until)
1313
1313
  });
1314
1314
  }
1315
1315
  /**
@@ -1320,64 +1320,64 @@ 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
- G.prototype.getNumberOfItems = function() {
1323
+ X.prototype.getNumberOfItems = function() {
1324
1324
  return V(this.otherProperties.numberOfItems);
1325
1325
  };
1326
- G.prototype.getPrice = function() {
1327
- return De.deserialize(this.otherProperties.price);
1326
+ X.prototype.getPrice = function() {
1327
+ return ze.deserialize(this.otherProperties.price);
1328
1328
  };
1329
- G.prototype.getIndirectAcquisitions = function() {
1329
+ X.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
- G.prototype.getHolds = function() {
1335
- return Fe.deserialize(this.otherProperties.holds);
1334
+ X.prototype.getHolds = function() {
1335
+ return De.deserialize(this.otherProperties.holds);
1336
1336
  };
1337
- G.prototype.getCopies = function() {
1337
+ X.prototype.getCopies = function() {
1338
1338
  return We.deserialize(this.otherProperties.copies);
1339
1339
  };
1340
- G.prototype.getAvailability = function() {
1340
+ X.prototype.getAvailability = function() {
1341
1341
  return Ue.deserialize(this.otherProperties.availability);
1342
1342
  };
1343
- G.prototype.getAuthenticate = function() {
1343
+ X.prototype.getAuthenticate = function() {
1344
1344
  return $.deserialize(this.otherProperties.authenticate);
1345
1345
  };
1346
1346
  const Tn = "CssSelectorGenerator";
1347
- function li(r = "unknown problem", ...t) {
1347
+ function hi(r = "unknown problem", ...t) {
1348
1348
  console.warn(`${Tn}: ${r}`, ...t);
1349
1349
  }
1350
- function Mn(r) {
1350
+ function Nn(r) {
1351
1351
  return r instanceof RegExp;
1352
1352
  }
1353
- function Nn(r) {
1353
+ function Mn(r) {
1354
1354
  return r.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".+");
1355
1355
  }
1356
- function zn(r) {
1356
+ function Fn(r) {
1357
1357
  const t = r.map((e) => {
1358
- if (Mn(e))
1358
+ if (Nn(e))
1359
1359
  return (i) => e.test(i);
1360
1360
  if (typeof e == "function")
1361
1361
  return (i) => {
1362
1362
  const n = e(i);
1363
- return typeof n != "boolean" ? (li("pattern matcher function invalid", "Provided pattern matching function does not return boolean. It's result will be ignored.", e), !1) : n;
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("^" + Nn(e) + "$");
1366
+ const i = new RegExp("^" + Mn(e) + "$");
1367
1367
  return (n) => i.test(n);
1368
1368
  }
1369
- return li("pattern matcher invalid", "Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.", e), () => !1;
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
- zn([
1373
+ Fn([
1374
1374
  "class",
1375
1375
  "id",
1376
1376
  // Angular attributes
1377
1377
  "ng-*"
1378
1378
  ]);
1379
- const In = Math.pow(2, 32), hi = () => Math.round(Math.random() * In).toString(36), we = () => `${Math.round(performance.now())}-${hi()}-${hi()}`, ft = 1;
1380
- class Dn {
1379
+ const In = Math.pow(2, 32), ci = () => Math.round(Math.random() * In).toString(36), we = () => `${Math.round(performance.now())}-${ci()}-${ci()}`, ft = 1;
1380
+ class zn {
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
  }
@@ -1469,15 +1469,15 @@ class Dn {
1469
1469
  }
1470
1470
  class Et {
1471
1471
  }
1472
- function ci(r) {
1472
+ function di(r) {
1473
1473
  return r.split("").reverse().join("");
1474
1474
  }
1475
- function Fn(r, t, e) {
1476
- const i = ci(t);
1475
+ function Dn(r, t, e) {
1476
+ const i = di(t);
1477
1477
  return e.map((n) => {
1478
- const s = Math.max(0, n.end - t.length - n.errors), o = ci(r.slice(s, n.end));
1478
+ const s = Math.max(0, n.end - t.length - n.errors), o = di(r.slice(s, n.end));
1479
1479
  return {
1480
- start: qi(o, i, n.errors).reduce((l, h) => n.end - h.end < l ? n.end - h.end : l, n.end),
1480
+ start: Ki(o, i, n.errors).reduce((l, h) => n.end - h.end < l ? n.end - h.end : l, n.end),
1481
1481
  end: n.end,
1482
1482
  errors: n.errors
1483
1483
  };
@@ -1486,14 +1486,14 @@ function Fn(r, t, e) {
1486
1486
  function de(r) {
1487
1487
  return (r | -r) >> 31 & 1;
1488
1488
  }
1489
- function di(r, t, e, i) {
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
1492
  let c = s | ~(h | n), u = n & h;
1493
1493
  const p = de(c & r.lastRowMask[e]) - de(u & r.lastRowMask[e]);
1494
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;
1495
1495
  }
1496
- function qi(r, t, e) {
1496
+ function Ki(r, t, e) {
1497
1497
  if (t.length === 0)
1498
1498
  return [];
1499
1499
  e = Math.min(e, t.length);
@@ -1535,7 +1535,7 @@ function qi(r, t, e) {
1535
1535
  g < h.length ? d = h[g] : (d = l.get(g), typeof d > "u" && (d = a));
1536
1536
  let f = 0;
1537
1537
  for (let w = 0; w <= c; w += 1)
1538
- f = di(o, d, w, f), u[w] += f;
1538
+ f = ui(o, d, w, f), u[w] += f;
1539
1539
  if (u[c] - f <= e && c < s && (d[c + 1] & 1 || f < 0)) {
1540
1540
  c += 1, o.P[c] = -1, o.M[c] = 0;
1541
1541
  let w;
@@ -1544,7 +1544,7 @@ function qi(r, t, e) {
1544
1544
  w = P === 0 ? n : P;
1545
1545
  } else
1546
1546
  w = n;
1547
- u[c] = u[c - 1] + w - f + di(o, d, c, f);
1547
+ u[c] = u[c - 1] + w - f + ui(o, d, c, f);
1548
1548
  } else
1549
1549
  for (; c > 0 && u[c] >= e + n; )
1550
1550
  c -= 1;
@@ -1557,10 +1557,10 @@ function qi(r, t, e) {
1557
1557
  return i;
1558
1558
  }
1559
1559
  function Wn(r, t, e) {
1560
- const i = qi(r, t, e);
1561
- return Fn(r, t, i);
1560
+ const i = Ki(r, t, e);
1561
+ return Dn(r, t, i);
1562
1562
  }
1563
- function Ki(r, t, e) {
1563
+ function Ji(r, t, e) {
1564
1564
  let i = 0;
1565
1565
  const n = [];
1566
1566
  for (; i !== -1; )
@@ -1571,23 +1571,23 @@ function Ki(r, t, e) {
1571
1571
  }), i += 1);
1572
1572
  return n.length > 0 ? n : Wn(r, t, e);
1573
1573
  }
1574
- function ui(r, t) {
1575
- return t.length === 0 || r.length === 0 ? 0 : 1 - Ki(r, t, t.length)[0].errors / t.length;
1574
+ function pi(r, t) {
1575
+ return t.length === 0 || r.length === 0 ? 0 : 1 - Ji(r, t, t.length)[0].errors / t.length;
1576
1576
  }
1577
1577
  function Un(r, t, e = {}) {
1578
1578
  if (t.length === 0)
1579
1579
  return null;
1580
- const i = Math.min(256, t.length / 2), n = Ki(r, t, i);
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, g = e.prefix ? ui(
1584
+ const p = 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 ? ui(
1590
+ ) : 1, d = e.suffix ? pi(
1591
1591
  r.slice(a.end, a.end + e.suffix.length),
1592
1592
  e.suffix
1593
1593
  ) : 1;
@@ -1600,7 +1600,7 @@ function Un(r, t, e = {}) {
1600
1600
  }));
1601
1601
  return o.sort((a, l) => l.score - a.score), o[0];
1602
1602
  }
1603
- function ve(r, t, e) {
1603
+ function Se(r, t, e) {
1604
1604
  const i = e === 1 ? t : t - 1;
1605
1605
  if (r.charAt(i).trim() !== "")
1606
1606
  return t;
@@ -1610,7 +1610,7 @@ function ve(r, t, e) {
1610
1610
  const o = n.length - s.length;
1611
1611
  return e === 2 ? t - o : t + o;
1612
1612
  }
1613
- function pi(r, t) {
1613
+ function fi(r, t) {
1614
1614
  const e = r.commonAncestorContainer.ownerDocument.createNodeIterator(
1615
1615
  r.commonAncestorContainer,
1616
1616
  NodeFilter.SHOW_TEXT
@@ -1623,7 +1623,7 @@ function pi(r, t) {
1623
1623
  const a = () => {
1624
1624
  if (s = t === 1 ? e.nextNode() : e.previousNode(), s) {
1625
1625
  const l = s.textContent, h = t === 1 ? 0 : l.length;
1626
- o = ve(l, h, t);
1626
+ o = Se(l, h, t);
1627
1627
  }
1628
1628
  };
1629
1629
  for (; s && o === -1 && s !== n; )
@@ -1632,7 +1632,7 @@ function pi(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 Bn(r) {
1635
+ function Hn(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)
@@ -1642,13 +1642,13 @@ function Bn(r) {
1642
1642
  const t = r.cloneRange();
1643
1643
  let e = !1, i = !1;
1644
1644
  const n = {
1645
- start: ve(
1645
+ start: Se(
1646
1646
  r.startContainer.textContent,
1647
1647
  r.startOffset,
1648
1648
  1
1649
1649
  /* Forwards */
1650
1650
  ),
1651
- end: ve(
1651
+ end: Se(
1652
1652
  r.endContainer.textContent,
1653
1653
  r.endOffset,
1654
1654
  2
@@ -1658,7 +1658,7 @@ function Bn(r) {
1658
1658
  if (n.start >= 0 && (t.setStart(r.startContainer, n.start), e = !0), n.end > 0 && (t.setEnd(r.endContainer, n.end), i = !0), e && i)
1659
1659
  return t;
1660
1660
  if (!e) {
1661
- const { node: s, offset: o } = pi(
1661
+ const { node: s, offset: o } = fi(
1662
1662
  t,
1663
1663
  1
1664
1664
  /* Forwards */
@@ -1666,7 +1666,7 @@ function Bn(r) {
1666
1666
  s && o >= 0 && t.setStart(s, o);
1667
1667
  }
1668
1668
  if (!i) {
1669
- const { node: s, offset: o } = pi(
1669
+ const { node: s, offset: o } = fi(
1670
1670
  t,
1671
1671
  2
1672
1672
  /* Backwards */
@@ -1675,7 +1675,7 @@ function Bn(r) {
1675
1675
  }
1676
1676
  return t;
1677
1677
  }
1678
- function Ji(r) {
1678
+ function Zi(r) {
1679
1679
  switch (r.nodeType) {
1680
1680
  case Node.ELEMENT_NODE:
1681
1681
  case Node.TEXT_NODE:
@@ -1684,13 +1684,13 @@ function Ji(r) {
1684
1684
  return 0;
1685
1685
  }
1686
1686
  }
1687
- function fi(r) {
1687
+ function mi(r) {
1688
1688
  let t = r.previousSibling, e = 0;
1689
1689
  for (; t; )
1690
- e += Ji(t), t = t.previousSibling;
1690
+ e += Zi(t), t = t.previousSibling;
1691
1691
  return e;
1692
1692
  }
1693
- function Zi(r, ...t) {
1693
+ function Qi(r, ...t) {
1694
1694
  let e = t.shift();
1695
1695
  const i = r.ownerDocument.createNodeIterator(
1696
1696
  r,
@@ -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 += fi(e), e = e.parentElement;
1725
+ i += mi(e), e = e.parentElement;
1726
1726
  return new K(e, i);
1727
1727
  }
1728
1728
  /**
@@ -1744,7 +1744,7 @@ class K {
1744
1744
  */
1745
1745
  resolve(t = {}) {
1746
1746
  try {
1747
- return Zi(this.element, this.offset)[0];
1747
+ return Qi(this.element, this.offset)[0];
1748
1748
  } catch (e) {
1749
1749
  if (this.offset === 0 && t.direction !== void 0) {
1750
1750
  const i = document.createTreeWalker(
@@ -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 = fi(t) + e;
1790
+ const i = mi(t) + e;
1791
1791
  return new K(t.parentElement, i);
1792
1792
  }
1793
1793
  case Node.ELEMENT_NODE: {
@@ -1795,7 +1795,7 @@ class K {
1795
1795
  throw new Error("Child node offset is out of range");
1796
1796
  let i = 0;
1797
1797
  for (let n = 0; n < e; n++)
1798
- i += Ji(t.childNodes[n]);
1798
+ i += Zi(t.childNodes[n]);
1799
1799
  return new K(t, i);
1800
1800
  }
1801
1801
  default:
@@ -1829,7 +1829,7 @@ class et {
1829
1829
  */
1830
1830
  toRange() {
1831
1831
  let t, e;
1832
- this.start.element === this.end.element && this.start.offset <= this.end.offset ? [t, e] = Zi(
1832
+ this.start.element === this.end.element && this.start.offset <= this.end.offset ? [t, e] = Qi(
1833
1833
  this.start.element,
1834
1834
  this.start.offset,
1835
1835
  this.end.offset
@@ -1868,7 +1868,7 @@ class et {
1868
1868
  * whitespace
1869
1869
  */
1870
1870
  static trimmedRange(t) {
1871
- return Bn(et.fromRange(t).toRange());
1871
+ return Hn(et.fromRange(t).toRange());
1872
1872
  }
1873
1873
  }
1874
1874
  class jt {
@@ -1941,7 +1941,7 @@ class $t {
1941
1941
  return new jt(this.root, i.start, i.end);
1942
1942
  }
1943
1943
  }
1944
- function Hn(r) {
1944
+ function Bn(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 || Hn(n) ? (s.selectNode(n), s) : (s.setStartBefore(n), s.setEndAfter(n), s);
1973
+ return n.childNodes.length === 0 || Bn(n) ? (s.selectNode(n), s) : (s.setStartBefore(n), s.setEndAfter(n), s);
1974
1974
  }
1975
1975
  }
1976
1976
  } catch (e) {
@@ -1991,10 +1991,10 @@ function Vn(r, t) {
1991
1991
  top: h.top,
1992
1992
  width: h.width
1993
1993
  });
1994
- const s = Qi(
1994
+ const s = tn(
1995
1995
  n,
1996
1996
  i
1997
- ), o = $n(s, i), a = tn(o), l = 4;
1997
+ ), o = $n(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))
@@ -2005,16 +2005,16 @@ function Vn(r, t) {
2005
2005
  }
2006
2006
  return a;
2007
2007
  }
2008
- function Qi(r, t, e) {
2008
+ function tn(r, t, e) {
2009
2009
  for (let i = 0; i < r.length; i++)
2010
2010
  for (let n = i + 1; n < r.length; n++) {
2011
2011
  const s = r[i], o = r[n];
2012
2012
  if (s === o)
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
- if (a && !l && en(s, o, t)) {
2015
+ if (a && !l && nn(s, o, t)) {
2016
2016
  const u = r.filter((g) => g !== s && g !== o), p = jn(s, o);
2017
- return u.push(p), Qi(
2017
+ return u.push(p), tn(
2018
2018
  u,
2019
2019
  t
2020
2020
  );
@@ -2041,40 +2041,40 @@ function $n(r, t) {
2041
2041
  continue;
2042
2042
  }
2043
2043
  for (const s of r)
2044
- if (i !== s && e.has(s) && Xn(s, i, t)) {
2044
+ if (i !== s && e.has(s) && Gn(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 Xn(r, t, e) {
2052
- return Dt(r, t.left, t.top, e) && Dt(r, t.right, t.top, e) && Dt(r, t.left, t.bottom, e) && Dt(r, t.right, t.bottom, e);
2051
+ function Gn(r, t, e) {
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
- function Dt(r, t, e, i) {
2054
+ function zt(r, t, e, i) {
2055
2055
  return (r.left < t || j(r.left, t, i)) && (r.right > t || j(r.right, t, i)) && (r.top < e || j(r.top, e, i)) && (r.bottom > e || j(r.bottom, e, i));
2056
2056
  }
2057
- function tn(r) {
2057
+ function en(r) {
2058
2058
  for (let t = 0; t < r.length; t++)
2059
2059
  for (let e = t + 1; e < r.length; e++) {
2060
2060
  const i = r[t], n = r[e];
2061
- if (i !== n && en(i, n, -1)) {
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);
2071
- return Array.prototype.push.apply(l, s), tn(l);
2071
+ return Array.prototype.push.apply(l, s), en(l);
2072
2072
  }
2073
2073
  }
2074
2074
  return r;
2075
2075
  }
2076
- function mi(r, t) {
2077
- const e = Gn(t, r);
2076
+ function gi(r, t) {
2077
+ const e = Xn(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 Gn(r, t) {
2127
+ function Xn(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,
@@ -2135,20 +2135,20 @@ function Gn(r, t) {
2135
2135
  width: Math.max(0, i - e)
2136
2136
  };
2137
2137
  }
2138
- function en(r, t, e) {
2138
+ function nn(r, t, e) {
2139
2139
  return (r.left < t.right || e >= 0 && j(r.left, t.right, e)) && (t.left < r.right || e >= 0 && j(t.left, r.right, e)) && (r.top < t.bottom || e >= 0 && j(r.top, t.bottom, e)) && (t.top < r.bottom || e >= 0 && j(t.top, r.bottom, e));
2140
2140
  }
2141
2141
  function j(r, t, e) {
2142
2142
  return Math.abs(r - t) <= e;
2143
2143
  }
2144
- function Be(r) {
2144
+ function He(r) {
2145
2145
  const t = {}, e = r.document.documentElement.style;
2146
2146
  for (const i in r.document.documentElement.style)
2147
2147
  Object.hasOwn(e, i) && !Number.isNaN(Number.parseInt(i)) && (t[e[i]] = e.getPropertyValue(e[i]));
2148
2148
  return t;
2149
2149
  }
2150
- function nn(r, t) {
2151
- const e = Be(r);
2150
+ function sn(r, t) {
2151
+ const e = He(r);
2152
2152
  Object.keys(e).forEach((i) => {
2153
2153
  t.hasOwnProperty(i) || re(r, i);
2154
2154
  }), Object.entries(t).forEach(([i, n]) => {
@@ -2164,17 +2164,17 @@ function Tt(r, t, e) {
2164
2164
  function re(r, t) {
2165
2165
  r.document.documentElement.style.removeProperty(t);
2166
2166
  }
2167
- let Ft = null, pe = null, _t = 0;
2167
+ let Dt = null, pe = null, Ct = 0;
2168
2168
  const mt = { r: 255, g: 255, b: 255, a: 1 }, ct = /* @__PURE__ */ new Map(), Yn = () => {
2169
- if (!Ft)
2169
+ if (!Dt)
2170
2170
  if (typeof OffscreenCanvas < "u")
2171
- Ft = new OffscreenCanvas(5, 5), pe = Ft.getContext("2d", {
2171
+ Dt = new OffscreenCanvas(5, 5), pe = Dt.getContext("2d", {
2172
2172
  willReadFrequently: !0,
2173
2173
  desynchronized: !0
2174
2174
  });
2175
2175
  else {
2176
2176
  const r = document.createElement("canvas");
2177
- r.width = 5, r.height = 5, Ft = r, pe = r.getContext("2d", {
2177
+ r.width = 5, r.height = 5, Dt = r, pe = r.getContext("2d", {
2178
2178
  willReadFrequently: !0,
2179
2179
  desynchronized: !0
2180
2180
  });
@@ -2203,7 +2203,7 @@ const mt = { r: 255, g: 255, b: 255, a: 1 }, ct = /* @__PURE__ */ new Map(), Yn
2203
2203
  console.warn(
2204
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).`
2205
2205
  );
2206
- }, Se = (r, t = null) => {
2206
+ }, ve = (r, t = null) => {
2207
2207
  const e = t ? `${r}|${t}` : r, i = ct.get(e);
2208
2208
  if (i !== void 0)
2209
2209
  return i ?? mt;
@@ -2213,11 +2213,11 @@ const mt = { r: 255, g: 255, b: 255, a: 1 }, ct = /* @__PURE__ */ new Map(), Yn
2213
2213
  if (!n)
2214
2214
  return Wt(r, "Could not get canvas context."), ct.set(e, null), mt;
2215
2215
  try {
2216
- _t === 0 && n.clearRect(0, 0, 5, 5);
2217
- const s = _t % 5, o = Math.floor(_t / 5);
2216
+ Ct === 0 && n.clearRect(0, 0, 5, 5);
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
- _t = (_t + 1) % 25;
2220
+ Ct = (Ct + 1) % 25;
2221
2221
  const [l, h, c, u] = a.data;
2222
2222
  if (u === 0)
2223
2223
  return Wt(r, "Fully transparent color."), ct.set(e, null), mt;
@@ -2229,16 +2229,16 @@ const mt = { r: 255, g: 255, b: 255, a: 1 }, ct = /* @__PURE__ */ new Map(), Yn
2229
2229
  }, fe = (r) => {
2230
2230
  const t = r / 255;
2231
2231
  return t <= 0.03928 ? t / 12.92 : Math.pow((t + 0.055) / 1.055, 2.4);
2232
- }, gi = (r) => {
2232
+ }, yi = (r) => {
2233
2233
  const t = fe(r.r), e = fe(r.g), i = fe(r.b);
2234
2234
  return 0.2126 * t + 0.7152 * e + 0.0722 * i;
2235
- }, yi = (r, t) => {
2236
- const e = typeof r == "string" ? Se(r) : r, i = typeof t == "string" ? Se(t) : t, n = gi(e), s = gi(i), o = Math.max(n, s), a = Math.min(n, s);
2235
+ }, bi = (r, t) => {
2236
+ const e = typeof r == "string" ? ve(r) : r, i = typeof t == "string" ? ve(t) : t, n = yi(e), s = yi(i), o = Math.max(n, s), a = Math.min(n, s);
2237
2237
  return (o + 0.05) / (a + 0.05);
2238
2238
  }, Pe = (r, t = null) => {
2239
- const e = Se(r, t), i = yi(e, { r: 255, g: 255, b: 255, a: 1 }), n = yi(e, { r: 0, g: 0, b: 0, a: 1 });
2239
+ const e = ve(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", bi = "#FFFF00", Jn = () => "Highlight" in window, wi = ["IMG", "IMAGE", "AUDIO", "VIDEO", "SVG"];
2241
+ }, Kn = (r, t = null) => Pe(r, t) ? "white" : "black", wi = "#FFFF00", Jn = () => "Highlight" in window, Si = ["IMG", "IMAGE", "AUDIO", "VIDEO", "SVG"];
2242
2242
  class Zn {
2243
2243
  /**
2244
2244
  * Creates a DecorationGroup object
@@ -2265,7 +2265,7 @@ class Zn {
2265
2265
  return;
2266
2266
  }
2267
2267
  const n = i.commonAncestorContainer;
2268
- n.nodeType !== Node.TEXT_NODE && this.experimentalHighlights && (wi.includes(n.nodeName.toUpperCase()) && this.notTextFlag?.set(e, !0), i.cloneContents().querySelector(wi.join(", ").toLowerCase()) && this.notTextFlag?.set(e, !0), (n.textContent?.trim() || "").length === 0 && this.notTextFlag?.set(e, !0));
2268
+ n.nodeType !== Node.TEXT_NODE && this.experimentalHighlights && (Si.includes(n.nodeName.toUpperCase()) && this.notTextFlag?.set(e, !0), i.cloneContents().querySelector(Si.join(", ").toLowerCase()) && this.notTextFlag?.set(e, !0), (n.textContent?.trim() || "").length === 0 && this.notTextFlag?.set(e, !0));
2269
2269
  const s = {
2270
2270
  decoration: t,
2271
2271
  id: e,
@@ -2306,7 +2306,7 @@ class Zn {
2306
2306
  experimentalLayout(t) {
2307
2307
  const [e, i] = this.requireContainer(!0);
2308
2308
  i.add(t.range);
2309
- const n = ue(this.wnd, "--USER__backgroundColor") || this.wnd.getComputedStyle(this.wnd.document.documentElement).getPropertyValue("background-color"), s = t.decoration?.style?.tint ?? bi;
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
2312
  color: ${Kn(s, n)};
@@ -2347,7 +2347,7 @@ class Zn {
2347
2347
  data-readium="true"
2348
2348
  class="readium-highlight"
2349
2349
  style="${[
2350
- `background-color: ${t.decoration?.style?.tint ?? bi} !important`,
2350
+ `background-color: ${t.decoration?.style?.tint ?? wi} !important`,
2351
2351
  //"opacity: 0.3 !important",
2352
2352
  `mix-blend-mode: ${p ? "exclusion" : "multiply"} !important`,
2353
2353
  "opacity: 1 !important",
@@ -2497,26 +2497,26 @@ const vi = "readium-snapper-style", Rt = class Rt extends Et {
2497
2497
  }
2498
2498
  };
2499
2499
  Rt.moduleName = "snapper";
2500
- let St = Rt;
2500
+ let vt = Rt;
2501
2501
  function Qn(r) {
2502
2502
  return (r.document.documentElement.dir || r.document.body.dir).toLowerCase() === "rtl";
2503
2503
  }
2504
2504
  function ts(r) {
2505
2505
  return (r.getComputedStyle(r.document.documentElement).writingMode || r.getComputedStyle(r.document.body).writingMode) === "vertical-lr";
2506
2506
  }
2507
- function sn(r) {
2507
+ function rn(r) {
2508
2508
  return parseInt(
2509
2509
  r.getComputedStyle(
2510
2510
  r.document.documentElement
2511
2511
  ).getPropertyValue("column-count")
2512
2512
  );
2513
2513
  }
2514
- function Si(r) {
2514
+ function Pi(r) {
2515
2515
  const t = getComputedStyle(r), e = parseFloat(t.paddingTop || "0"), i = parseFloat(t.paddingBottom || "0");
2516
2516
  return r.clientHeight - e - i;
2517
2517
  }
2518
- function Pi(r) {
2519
- const t = sn(r);
2518
+ function Ei(r) {
2519
+ const t = rn(r);
2520
2520
  if (!t)
2521
2521
  return !1;
2522
2522
  const e = r.document.querySelectorAll("div[id^='readium-virtual-page']");
@@ -2526,11 +2526,11 @@ function Pi(r) {
2526
2526
  if (l > 0)
2527
2527
  for (let h = 0; h < l; h++) {
2528
2528
  const c = r.document.createElement("div");
2529
- c.setAttribute("id", `readium-virtual-page-${h}`), c.dataset.readium = "true", CSS.supports("break-before", "column") ? c.style.breakBefore = "column" : (CSS.supports("break-inside", "avoid-column") && (c.style.breakInside = "avoid-column"), c.style.height = Si(r.document.documentElement) + "px"), c.innerHTML = "&#8203;", r.document.body.appendChild(c);
2529
+ c.setAttribute("id", `readium-virtual-page-${h}`), c.dataset.readium = "true", CSS.supports("break-before", "column") ? c.style.breakBefore = "column" : (CSS.supports("break-inside", "avoid-column") && (c.style.breakInside = "avoid-column"), c.style.height = Pi(r.document.documentElement) + "px"), c.innerHTML = "&#8203;", r.document.body.appendChild(c);
2530
2530
  }
2531
2531
  return i !== l;
2532
2532
  }
2533
- function He(r) {
2533
+ 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
  }
@@ -2557,22 +2557,22 @@ const is = [
2557
2557
  "video"
2558
2558
  ], ns = ["dialog", "radiogroup", "radio", "menu", "menuitem"];
2559
2559
  function Ve(r) {
2560
- return ss(r) ? null : rn(r) ? r : r.parentElement ? Ve(r.parentElement) : null;
2560
+ return ss(r) ? null : on(r) ? r : r.parentElement ? Ve(r.parentElement) : null;
2561
2561
  }
2562
2562
  function ss(r) {
2563
2563
  return r ? r.closest("[inert]") !== null || r.hasAttribute("disabled") : !0;
2564
2564
  }
2565
- function rn(r) {
2565
+ function on(r) {
2566
2566
  return r ? r.role && ns.includes(r.role) || r.tabIndex >= 0 ? !0 : is.includes(r.nodeName.toLowerCase()) || r.hasAttribute("contenteditable") && r.getAttribute("contenteditable")?.toLowerCase() !== "false" : !1;
2567
2567
  }
2568
2568
  function oe(r, t) {
2569
- const e = on(r, r.document.body, t), i = r._readium_cssSelectorGenerator.getCssSelector(e, {
2569
+ const e = an(r, r.document.body, t), i = r._readium_cssSelectorGenerator.getCssSelector(e, {
2570
2570
  selectors: ["tag", "id", "class", "nthchild", "nthoftype", "attribute"]
2571
2571
  });
2572
2572
  return new I({
2573
2573
  href: "#",
2574
2574
  type: "application/xhtml+xml",
2575
- locations: new _({
2575
+ locations: new C({
2576
2576
  otherLocations: /* @__PURE__ */ new Map([
2577
2577
  ["cssSelector", i]
2578
2578
  ])
@@ -2582,11 +2582,11 @@ function oe(r, t) {
2582
2582
  })
2583
2583
  });
2584
2584
  }
2585
- function on(r, t, e) {
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
2588
  if (!as(n) && rs(r, n, e))
2589
- return os(r, n) ? n : on(r, n, e);
2589
+ return os(r, n) ? n : an(r, n, e);
2590
2590
  }
2591
2591
  return t;
2592
2592
  }
@@ -2633,7 +2633,7 @@ const ls = {
2633
2633
  // Only trigger on near-perfect patterns
2634
2634
  maxConsistentScrolls: 20
2635
2635
  // Need many consistent scrolls
2636
- }, an = {
2636
+ }, ln = {
2637
2637
  maxSelectionsPerSecond: 500,
2638
2638
  minVariance: 50,
2639
2639
  historySize: 20
@@ -2677,7 +2677,7 @@ class ae {
2677
2677
  this.history = [], this.consistentScrollCount = 0;
2678
2678
  }
2679
2679
  }
2680
- const Ei = "readium-column-snapper-style", cs = 200, F = class F extends St {
2680
+ const Ci = "readium-column-snapper-style", cs = 200, D = class D extends vt {
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,7 +2733,7 @@ const Ei = "readium-column-snapper-style", cs = 200, F = class F 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 = sn(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, g = u > p ? "right" : "left";
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, g = u > p ? "right" : "left";
2737
2737
  if (this.checkSuspiciousSnap(g, Math.abs(u - p)), t && u !== p) {
2738
2738
  this.snappingCancelled = !1;
2739
2739
  const d = (R, Y, lt, ht) => lt > ht ? Y : R + (Y - R) * es(lt / ht), f = cs * n;
@@ -2813,7 +2813,7 @@ const Ei = "readium-column-snapper-style", cs = 200, F = class F extends St {
2813
2813
  if (this.wnd = t, this.comms = e, this.rtl = Qn(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
- i.dataset.readium = "true", i.id = Ei, i.textContent = `
2816
+ i.dataset.readium = "true", i.id = Ci, i.textContent = `
2817
2817
  @keyframes readium-bounce-l-animation {
2818
2818
  0%, 100% {transform: translate3d(0, 0, 0);}
2819
2819
  50% {transform: translate3d(-50px, 0, 0);}
@@ -2849,18 +2849,18 @@ const Ei = "readium-column-snapper-style", cs = 200, F = class F extends St {
2849
2849
  }
2850
2850
  `, t.document.head.appendChild(i), this.resizeObserver = new ResizeObserver(() => {
2851
2851
  t.requestAnimationFrame(() => {
2852
- t && Pi(t);
2852
+ t && Ei(t);
2853
2853
  }), this.onWidthChange();
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
2857
  const l = a.oldValue, h = a.target.getAttribute("style"), c = /transform\s*:\s*([^;]+)/, u = l?.match(c), p = h?.match(c);
2858
2858
  (!u && !p || u && !p || u && p && u[1] !== p[1]) && (t.requestAnimationFrame(() => {
2859
- t && Pi(t);
2859
+ t && Ei(t);
2860
2860
  }), this.onWidthChange());
2861
2861
  } else
2862
2862
  t.requestAnimationFrame(() => this.cachedScrollWidth = this.doc().scrollWidth);
2863
- }), t.frameElement && this.mutationObserver.observe(t.frameElement, { attributes: !0, attributeFilter: ["style"] }), this.mutationObserver.observe(t.document, { attributes: !0, attributeFilter: ["style"] }), this.mutationObserver.observe(t.document.documentElement, { attributes: !0, attributeFilter: ["style"] }), e.register("scroll_protection", F.moduleName, (o, a) => {
2863
+ }), t.frameElement && this.mutationObserver.observe(t.frameElement, { attributes: !0, attributeFilter: ["style"] }), this.mutationObserver.observe(t.document, { attributes: !0, attributeFilter: ["style"] }), this.mutationObserver.observe(t.document.documentElement, { attributes: !0, attributeFilter: ["style"] }), e.register("scroll_protection", D.moduleName, (o, a) => {
2864
2864
  this.enableSnapProtection(), a(!0);
2865
2865
  });
2866
2866
  const n = (o) => {
@@ -2870,7 +2870,7 @@ const Ei = "readium-column-snapper-style", cs = 200, F = class F extends St {
2870
2870
  const a = this.doc().scrollLeft, l = this.snapNormOffset(Math.max(0, Math.min(this.cachedScrollWidth - t.innerWidth, o)));
2871
2871
  return this.doc().scrollLeft = -l, a !== this.doc().scrollLeft;
2872
2872
  };
2873
- return t.addEventListener("orientationchange", this.onWidthChanger), t.addEventListener("resize", this.onWidthChanger), t.requestAnimationFrame(() => this.cachedScrollWidth = this.doc().scrollWidth), e.register("go_progression", F.moduleName, (o, a) => {
2873
+ return t.addEventListener("orientationchange", this.onWidthChanger), t.addEventListener("resize", this.onWidthChanger), t.requestAnimationFrame(() => this.cachedScrollWidth = this.doc().scrollWidth), e.register("go_progression", D.moduleName, (o, a) => {
2874
2874
  const l = o;
2875
2875
  if (l < 0 || l > 1) {
2876
2876
  e.send("error", {
@@ -2883,7 +2883,7 @@ const Ei = "readium-column-snapper-style", cs = 200, F = class F extends St {
2883
2883
  const c = (this.cachedScrollWidth - t.innerWidth) * l;
2884
2884
  this.rtl ? this.doc().scrollLeft = -this.snapNormOffset(c) : this.doc().scrollLeft = this.snapOffset(c), this.reportProgress(), O(this.wnd), a(!0);
2885
2885
  });
2886
- }), e.register("go_id", F.moduleName, (o, a) => {
2886
+ }), e.register("go_id", D.moduleName, (o, a) => {
2887
2887
  const l = t.document.getElementById(o);
2888
2888
  if (!l) {
2889
2889
  a(!1);
@@ -2892,14 +2892,14 @@ const Ei = "readium-column-snapper-style", cs = 200, F = class F extends St {
2892
2892
  this.wnd.requestAnimationFrame(() => {
2893
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);
2894
2894
  });
2895
- }), e.register("go_text", F.moduleName, (o, a) => {
2895
+ }), e.register("go_text", D.moduleName, (o, a) => {
2896
2896
  let l;
2897
2897
  Array.isArray(o) && (o.length > 1 && (l = o[1]), o = o[0]);
2898
2898
  const h = rt.deserialize(o), c = It(this.wnd.document, new I({
2899
2899
  href: t.location.href,
2900
2900
  type: "text/html",
2901
2901
  text: h,
2902
- locations: l ? new _({
2902
+ locations: l ? new C({
2903
2903
  otherLocations: /* @__PURE__ */ new Map([
2904
2904
  ["cssSelector", l]
2905
2905
  ])
@@ -2912,51 +2912,51 @@ const Ei = "readium-column-snapper-style", cs = 200, F = class F extends St {
2912
2912
  this.wnd.requestAnimationFrame(() => {
2913
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);
2914
2914
  });
2915
- }), e.register("go_end", F.moduleName, (o, a) => {
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
2920
  this.doc().scrollLeft = l, this.reportProgress(), O(this.wnd), a(!0);
2921
2921
  });
2922
- }), e.register("go_start", F.moduleName, (o, a) => {
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
2925
  this.doc().scrollLeft = 0, this.reportProgress(), O(this.wnd), a(!0);
2926
2926
  });
2927
- }), e.register("go_prev", F.moduleName, (o, a) => {
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
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);
2932
2932
  });
2933
- }), e.register("go_next", F.moduleName, (o, a) => {
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
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);
2938
2938
  });
2939
- }), e.register("unfocus", F.moduleName, (o, a) => {
2939
+ }), e.register("unfocus", D.moduleName, (o, a) => {
2940
2940
  this.snappingCancelled = !0, O(this.wnd), a(!0);
2941
- }), e.register("shake", F.moduleName, (o, a) => {
2941
+ }), e.register("shake", D.moduleName, (o, a) => {
2942
2942
  this.shake(), a(!0);
2943
- }), e.register("focus", F.moduleName, (o, a) => {
2943
+ }), e.register("focus", D.moduleName, (o, a) => {
2944
2944
  this.wnd.requestAnimationFrame(() => {
2945
2945
  this.cachedScrollWidth = this.doc().scrollWidth, this.snapCurrentOffset(!1, !0), this.reportProgress(), a(!0);
2946
2946
  });
2947
- }), e.register("first_visible_locator", F.moduleName, (o, a) => {
2947
+ }), e.register("first_visible_locator", D.moduleName, (o, a) => {
2948
2948
  const l = oe(t, !1);
2949
2949
  this.comms.send("first_visible_locator", l.serialize()), a(!0);
2950
2950
  }), t.addEventListener("touchstart", this.onTouchStarter, { passive: !0 }), t.addEventListener("touchend", this.onTouchEnder, { passive: !0 }), t.addEventListener("touchmove", this.onTouchMover, { passive: !0 }), t.document.addEventListener("touchstart", () => {
2951
2951
  }), e.log("ColumnSnapper Mounted"), !0;
2952
2952
  }
2953
2953
  unmount(t, e) {
2954
- return this.snappingCancelled = !0, e.unregisterAll(F.moduleName), this.resizeObserver.disconnect(), this.mutationObserver.disconnect(), this.patternAnalyzer && (this.patternAnalyzer.clear(), this.patternAnalyzer = null, this.isSnapProtectionEnabled = !1), t.removeEventListener("touchstart", this.onTouchStarter), t.removeEventListener("touchend", this.onTouchEnder), t.removeEventListener("touchmove", this.onTouchMover), t.removeEventListener("orientationchange", this.onWidthChanger), t.removeEventListener("resize", this.onWidthChanger), t.document.getElementById(Ei)?.remove(), e.log("ColumnSnapper Unmounted"), super.unmount(t, e);
2954
+ return this.snappingCancelled = !0, e.unregisterAll(D.moduleName), this.resizeObserver.disconnect(), this.mutationObserver.disconnect(), this.patternAnalyzer && (this.patternAnalyzer.clear(), this.patternAnalyzer = null, this.isSnapProtectionEnabled = !1), t.removeEventListener("touchstart", this.onTouchStarter), t.removeEventListener("touchend", this.onTouchEnder), t.removeEventListener("touchmove", this.onTouchMover), t.removeEventListener("orientationchange", this.onWidthChanger), t.removeEventListener("resize", this.onWidthChanger), t.document.getElementById(Ci)?.remove(), e.log("ColumnSnapper Unmounted"), super.unmount(t, e);
2955
2955
  }
2956
2956
  };
2957
- F.moduleName = "column_snapper";
2958
- let _e = F;
2959
- const _i = "readium-scroll-snapper-style", U = class U extends St {
2957
+ D.moduleName = "column_snapper";
2958
+ let Ce = D;
2959
+ const _i = "readium-scroll-snapper-style", U = class U extends vt {
2960
2960
  constructor() {
2961
2961
  super(...arguments), this.patternAnalyzer = null, this.lastScrollTime = 0, this.isScrollProtectionEnabled = !1, this.initialScrollHandled = !1, this.isScrolling = !1, this.lastScrollTop = 0, this.isResizing = !1, this.resizeDebounce = null, this.handleScroll = (t) => {
2962
2962
  if (this.comms.ready && !this.isResizing) {
@@ -3020,7 +3020,7 @@ const _i = "readium-scroll-snapper-style", U = class U extends St {
3020
3020
  this.isResizing = !1, this.resizeDebounce = null, this.reportProgress();
3021
3021
  }, 50);
3022
3022
  }), this.resizeObserver.observe(t.document.body), t.addEventListener("scroll", this.handleScroll, { passive: !0 }), e.register("force_webkit_recalc", U.moduleName, () => {
3023
- He(this.wnd);
3023
+ Be(this.wnd);
3024
3024
  const n = this.doc().scrollTop;
3025
3025
  n > 1 ? this.doc().scrollTop = n - 1 : this.doc().scrollTop = n + 1, this.doc().scrollTop = n;
3026
3026
  }), e.register("go_progression", U.moduleName, (n, s) => {
@@ -3050,7 +3050,7 @@ const _i = "readium-scroll-snapper-style", U = class U extends St {
3050
3050
  href: t.location.href,
3051
3051
  type: "text/html",
3052
3052
  text: a,
3053
- locations: o ? new _({
3053
+ locations: o ? new C({
3054
3054
  otherLocations: /* @__PURE__ */ new Map([
3055
3055
  ["cssSelector", o]
3056
3056
  ])
@@ -3088,8 +3088,8 @@ const _i = "readium-scroll-snapper-style", U = class U extends St {
3088
3088
  }
3089
3089
  };
3090
3090
  U.moduleName = "scroll_snapper";
3091
- let Ce = U;
3092
- const B = class B extends St {
3091
+ let _e = U;
3092
+ const H = class H extends vt {
3093
3093
  constructor() {
3094
3094
  super(...arguments), this.patternAnalyzer = null, this.lastScrollTime = 0, this.isScrollProtectionEnabled = !1, this.initialScrollHandled = !1, this.isScrolling = !1, this.lastScrollTop = 0, this.isResizing = !1, this.resizeDebounce = null, this.handleScroll = (t) => {
3095
3095
  if (this.comms.ready && !this.isResizing) {
@@ -3142,11 +3142,11 @@ const B = class B extends St {
3142
3142
  this.resizeDebounce && this.wnd.clearTimeout(this.resizeDebounce), this.isResizing = !0, this.resizeDebounce = this.wnd.setTimeout(() => {
3143
3143
  this.isResizing = !1, this.resizeDebounce = null, this.reportProgress();
3144
3144
  }, 50);
3145
- }), this.resizeObserver.observe(t.document.body), t.addEventListener("scroll", this.handleScroll, { passive: !0 }), e.register("force_webkit_recalc", B.moduleName, () => {
3146
- He(this.wnd);
3145
+ }), this.resizeObserver.observe(t.document.body), t.addEventListener("scroll", this.handleScroll, { passive: !0 }), e.register("force_webkit_recalc", H.moduleName, () => {
3146
+ Be(this.wnd);
3147
3147
  const i = this.doc().scrollTop;
3148
3148
  i > 1 ? this.doc().scrollTop = i - 1 : this.doc().scrollTop = i + 1, this.doc().scrollTop = i;
3149
- }), e.register("go_progression", B.moduleName, (i, n) => {
3149
+ }), e.register("go_progression", H.moduleName, (i, n) => {
3150
3150
  const s = i;
3151
3151
  if (s < 0 || s > 1) {
3152
3152
  e.send("error", {
@@ -3157,7 +3157,7 @@ const B = class B extends St {
3157
3157
  this.wnd.requestAnimationFrame(() => {
3158
3158
  this.doc().scrollTop = this.doc().offsetHeight * s, this.reportProgress(), O(this.wnd), n(!0);
3159
3159
  });
3160
- }), e.register("go_id", B.moduleName, (i, n) => {
3160
+ }), e.register("go_id", H.moduleName, (i, n) => {
3161
3161
  const s = t.document.getElementById(i);
3162
3162
  if (!s) {
3163
3163
  n(!1);
@@ -3166,14 +3166,14 @@ const B = class B extends St {
3166
3166
  this.wnd.requestAnimationFrame(() => {
3167
3167
  this.doc().scrollTop = s.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), O(this.wnd), n(!0);
3168
3168
  });
3169
- }), e.register("go_text", B.moduleName, (i, n) => {
3169
+ }), e.register("go_text", H.moduleName, (i, n) => {
3170
3170
  let s;
3171
3171
  Array.isArray(i) && (i.length > 1 && (s = i[1]), i = i[0]);
3172
3172
  const o = rt.deserialize(i), a = It(this.wnd.document, new I({
3173
3173
  href: t.location.href,
3174
3174
  type: "text/html",
3175
3175
  text: o,
3176
- locations: s ? new _({
3176
+ locations: s ? new C({
3177
3177
  otherLocations: /* @__PURE__ */ new Map([
3178
3178
  ["cssSelector", s]
3179
3179
  ])
@@ -3186,32 +3186,32 @@ const B = class B extends St {
3186
3186
  this.wnd.requestAnimationFrame(() => {
3187
3187
  this.doc().scrollTop = a.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), O(this.wnd), n(!0);
3188
3188
  });
3189
- }), e.register("go_start", B.moduleName, (i, n) => {
3189
+ }), e.register("go_start", H.moduleName, (i, n) => {
3190
3190
  if (this.doc().scrollTop === 0) return n(!1);
3191
3191
  this.doc().scrollTop = 0, this.reportProgress(), n(!0);
3192
- }), e.register("go_end", B.moduleName, (i, n) => {
3192
+ }), e.register("go_end", H.moduleName, (i, n) => {
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
- }), e.register("unfocus", B.moduleName, (i, n) => {
3195
+ }), e.register("unfocus", H.moduleName, (i, n) => {
3196
3196
  O(this.wnd), n(!0);
3197
- }), e.register("scroll_protection", B.moduleName, (i, n) => {
3197
+ }), e.register("scroll_protection", H.moduleName, (i, n) => {
3198
3198
  this.enableScrollProtection(), n(!0);
3199
3199
  }), e.register([
3200
3200
  "go_next",
3201
3201
  "go_prev"
3202
- ], B.moduleName, (i, n) => n(!1)), e.register("focus", B.moduleName, (i, n) => {
3202
+ ], H.moduleName, (i, n) => n(!1)), e.register("focus", H.moduleName, (i, n) => {
3203
3203
  this.reportProgress(), n(!0);
3204
- }), e.register("first_visible_locator", B.moduleName, (i, n) => {
3204
+ }), e.register("first_visible_locator", H.moduleName, (i, n) => {
3205
3205
  const s = oe(t, !0);
3206
3206
  e.send("first_visible_locator", s.serialize()), n(!0);
3207
3207
  }), e.log("WebPubSnapper Mounted"), !0;
3208
3208
  }
3209
3209
  unmount(t, e) {
3210
- return e.unregisterAll(B.moduleName), this.resizeObserver.disconnect(), this.handleScroll && t.removeEventListener("scroll", this.handleScroll), this.patternAnalyzer && (this.patternAnalyzer.clear(), this.patternAnalyzer = null, this.isScrollProtectionEnabled = !1), e.log("WebPubSnapper Unmounted"), !0;
3210
+ return e.unregisterAll(H.moduleName), this.resizeObserver.disconnect(), this.handleScroll && t.removeEventListener("scroll", this.handleScroll), this.patternAnalyzer && (this.patternAnalyzer.clear(), this.patternAnalyzer = null, this.isScrollProtectionEnabled = !1), e.log("WebPubSnapper Unmounted"), !0;
3211
3211
  }
3212
3212
  };
3213
- B.moduleName = "webpub_snapper";
3214
- let Le = B;
3213
+ H.moduleName = "webpub_snapper";
3214
+ let Le = H;
3215
3215
  class ds {
3216
3216
  constructor(t, e) {
3217
3217
  this.window = t, this.copyHistory = [], this.lastSelectionLength = 0, this.lastSelectionTime = 0, this.options = e;
@@ -3253,7 +3253,7 @@ class ds {
3253
3253
  }
3254
3254
  }
3255
3255
  class us {
3256
- constructor(t = an) {
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
  }
3259
3259
  analyze(t) {
@@ -3294,7 +3294,7 @@ class us {
3294
3294
  this.events = [], this.selectionStartTime = 0, this.lastSelectionTime = 0, this.lastSelectionPosition = 0, this.selectionPatterns = [], this.lastSelectedText = "";
3295
3295
  }
3296
3296
  }
3297
- class ln {
3297
+ class hn {
3298
3298
  /**
3299
3299
  * Checks if the given keyboard event matches any of the provided key combinations
3300
3300
  */
@@ -3376,7 +3376,7 @@ class ln {
3376
3376
  const l = a.suppressOnInteractiveElement;
3377
3377
  if (l) {
3378
3378
  const h = (n?.document ?? document).activeElement;
3379
- if (Array.isArray(l) ? l.some((c) => h?.matches(c)) : rn(h)) return;
3379
+ if (Array.isArray(l) ? l.some((c) => h?.matches(c)) : on(h)) return;
3380
3380
  }
3381
3381
  o.preventDefault(), o.stopPropagation(), a.handler(o);
3382
3382
  return;
@@ -3386,7 +3386,7 @@ class ln {
3386
3386
  }
3387
3387
  const yt = class yt extends Et {
3388
3388
  constructor() {
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 ln(), this.keyDownHandler = null, this.preventBulkCopy = (t) => {
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)
3391
3391
  return !0;
3392
3392
  if (!this.bulkCopyProtector.shouldAllowCopy(t)) {
@@ -3517,7 +3517,7 @@ const yt = class yt extends Et {
3517
3517
  }
3518
3518
  addSelectionMonitoring(t) {
3519
3519
  if (this.isSelectionMonitoringEnabled || !this.wnd) return;
3520
- const e = t || an;
3520
+ const e = t || ln;
3521
3521
  this.selectionAnalyzer = new us(e), this.wnd.document.addEventListener("selectionchange", this.handleSelection), this.isSelectionMonitoringEnabled = !0;
3522
3522
  }
3523
3523
  removeSelectionMonitoring() {
@@ -3660,7 +3660,7 @@ const At = class At extends Et {
3660
3660
  ), Reflect.defineProperty(t.navigator, "epubReadingSystem", {
3661
3661
  value: {
3662
3662
  name: "readium-ts-toolkit",
3663
- version: "2.5.2-beta.4",
3663
+ version: "2.5.2",
3664
3664
  hasFeature: (n, s = "") => {
3665
3665
  switch (n) {
3666
3666
  case "dom-manipulation":
@@ -3708,8 +3708,8 @@ const At = class At extends Et {
3708
3708
  }
3709
3709
  };
3710
3710
  At.moduleName = "setup";
3711
- let Xt = At;
3712
- const Ci = "readium-viewport", Z = class Z extends Xt {
3711
+ let Gt = At;
3712
+ const Li = "readium-viewport", Z = class Z extends Gt {
3713
3713
  onViewportWidthChanged(t) {
3714
3714
  const e = t.target;
3715
3715
  Tt(e, "--RS__viewportWidth", `${e.innerWidth}px`);
@@ -3717,15 +3717,15 @@ const Ci = "readium-viewport", Z = class Z extends Xt {
3717
3717
  mount(t, e) {
3718
3718
  if (!super.mount(t, e)) return !1;
3719
3719
  const i = t.document.createElement("meta");
3720
- return i.dataset.readium = "true", i.setAttribute("name", "viewport"), i.setAttribute("id", Ci), i.setAttribute(
3720
+ return i.dataset.readium = "true", i.setAttribute("name", "viewport"), i.setAttribute("id", Li), i.setAttribute(
3721
3721
  "content",
3722
3722
  "width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no"
3723
3723
  ), t.document.head.appendChild(i), t.addEventListener("orientationchange", this.onViewportWidthChanged), t.addEventListener("resize", this.onViewportWidthChanged), this.onViewportWidthChanged({
3724
3724
  target: t
3725
3725
  }), e.register("get_properties", Z.moduleName, (n, s) => {
3726
- Be(t), s(!0);
3726
+ He(t), s(!0);
3727
3727
  }), e.register("update_properties", Z.moduleName, (n, s) => {
3728
- n["--RS__viewportWidth"] = `${t.innerWidth}px`, nn(t, n), s(!0);
3728
+ n["--RS__viewportWidth"] = `${t.innerWidth}px`, sn(t, n), s(!0);
3729
3729
  }), e.register("set_property", Z.moduleName, (n, s) => {
3730
3730
  const o = n;
3731
3731
  Tt(t, o[0], o[1]), s(!0);
@@ -3736,17 +3736,17 @@ const Ci = "readium-viewport", Z = class Z extends Xt {
3736
3736
  }), e.log("ReflowableSetup Mounted"), !0;
3737
3737
  }
3738
3738
  unmount(t, e) {
3739
- return e.unregisterAll(Z.moduleName), t.document.head.querySelector(`#${Ci}`)?.remove(), t.removeEventListener("orientationchange", this.onViewportWidthChanged), e.log("ReflowableSetup Unmounted"), super.unmount(t, e);
3739
+ return e.unregisterAll(Z.moduleName), t.document.head.querySelector(`#${Li}`)?.remove(), t.removeEventListener("orientationchange", this.onViewportWidthChanged), e.log("ReflowableSetup Unmounted"), super.unmount(t, e);
3740
3740
  }
3741
3741
  };
3742
3742
  Z.moduleName = "reflowable_setup";
3743
3743
  let ke = Z;
3744
- const Li = "readium-fixed-style", q = class q extends Xt {
3744
+ const xi = "readium-fixed-style", q = class q extends Gt {
3745
3745
  mount(t, e) {
3746
3746
  if (!super.mount(t, e)) return !1;
3747
3747
  t.navigator.epubReadingSystem && (t.navigator.epubReadingSystem.layoutStyle = "paginated");
3748
3748
  const i = t.document.createElement("style");
3749
- return i.id = Li, i.dataset.readium = "true", i.textContent = `
3749
+ return i.id = xi, i.dataset.readium = "true", i.textContent = `
3750
3750
  html, body {
3751
3751
  text-size-adjust: none;
3752
3752
  -ms-text-size-adjust: none;
@@ -3779,7 +3779,7 @@ const Li = "readium-fixed-style", q = class q extends Xt {
3779
3779
  }), e.log("FixedSetup Mounted"), !0;
3780
3780
  }
3781
3781
  unmount(t, e) {
3782
- return e.unregisterAll(q.moduleName), t.document.getElementById(Li)?.remove(), e.log("FixedSetup Unmounted"), super.unmount(t, e);
3782
+ return e.unregisterAll(q.moduleName), t.document.getElementById(xi)?.remove(), e.log("FixedSetup Unmounted"), super.unmount(t, e);
3783
3783
  }
3784
3784
  };
3785
3785
  q.moduleName = "fixed_setup";
@@ -3799,9 +3799,9 @@ const Q = class Q extends Et {
3799
3799
  this.wndOnErr,
3800
3800
  !1
3801
3801
  ), e.register("get_properties", Q.moduleName, (i, n) => {
3802
- Be(t), n(!0);
3802
+ He(t), n(!0);
3803
3803
  }), e.register("update_properties", Q.moduleName, (i, n) => {
3804
- nn(t, i), n(!0);
3804
+ sn(t, i), n(!0);
3805
3805
  }), e.register("set_property", Q.moduleName, (i, n) => {
3806
3806
  const s = i;
3807
3807
  Tt(t, s[0], s[1]), n(!0);
@@ -3854,7 +3854,7 @@ let ps = (nt = class extends Et {
3854
3854
  return this.beforePrintHandler && (t.removeEventListener("beforeprint", this.beforePrintHandler), this.beforePrintHandler = null), this.styleElement?.parentNode && (this.styleElement.parentNode.removeChild(this.styleElement), this.styleElement = null), this.comms?.unregisterAll(nt.moduleName), this.configApplied = !1, !0;
3855
3855
  }
3856
3856
  }, nt.moduleName = "print_protection", nt);
3857
- const xi = "readium-cjk-vertical-snapper-style", H = class H extends St {
3857
+ const ki = "readium-cjk-vertical-snapper-style", B = class B extends vt {
3858
3858
  constructor() {
3859
3859
  super(...arguments), this.patternAnalyzer = null, this.lastScrollTime = 0, this.isScrollProtectionEnabled = !1, this.initialScrollHandled = !1, this.isScrolling = !1, this.lastScrollLeft = 0, this.isResizing = !1, this.resizeDebounce = null, this.verticalLR = !1, this.handleScroll = (t) => {
3860
3860
  if (this.comms.ready && !this.isResizing) {
@@ -3911,7 +3911,7 @@ const xi = "readium-cjk-vertical-snapper-style", H = class H extends St {
3911
3911
  mount(t, e) {
3912
3912
  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");
3913
3913
  const i = t.document.createElement("style");
3914
- return i.dataset.readium = "true", i.id = xi, i.textContent = `
3914
+ return i.dataset.readium = "true", i.id = ki, i.textContent = `
3915
3915
  * {
3916
3916
  scrollbar-width: none;
3917
3917
  }
@@ -3926,11 +3926,11 @@ const xi = "readium-cjk-vertical-snapper-style", H = class H extends St {
3926
3926
  this.resizeDebounce && this.wnd.clearTimeout(this.resizeDebounce), this.isResizing = !0, this.resizeDebounce = this.wnd.setTimeout(() => {
3927
3927
  this.isResizing = !1, this.resizeDebounce = null, this.reportProgress();
3928
3928
  }, 50);
3929
- }), this.resizeObserver.observe(t.document.body), t.addEventListener("scroll", this.handleScroll, { passive: !0 }), e.register("force_webkit_recalc", H.moduleName, () => {
3930
- He(this.wnd);
3929
+ }), this.resizeObserver.observe(t.document.body), t.addEventListener("scroll", this.handleScroll, { passive: !0 }), e.register("force_webkit_recalc", B.moduleName, () => {
3930
+ Be(this.wnd);
3931
3931
  const n = this.doc().scrollLeft;
3932
3932
  this.verticalLR ? this.doc().scrollLeft = n > 1 ? n - 1 : n + 1 : this.doc().scrollLeft = n < -1 ? n + 1 : n - 1, this.doc().scrollLeft = n;
3933
- }), e.register("go_progression", H.moduleName, (n, s) => {
3933
+ }), e.register("go_progression", B.moduleName, (n, s) => {
3934
3934
  const o = n;
3935
3935
  if (o < 0 || o > 1) {
3936
3936
  e.send("error", {
@@ -3942,7 +3942,7 @@ const xi = "readium-cjk-vertical-snapper-style", H = class H extends St {
3942
3942
  const a = this.scrollable() * o;
3943
3943
  this.doc().scrollLeft = this.verticalLR ? a : -a, this.reportProgress(), O(this.wnd), s(!0);
3944
3944
  });
3945
- }), e.register("go_id", H.moduleName, (n, s) => {
3945
+ }), e.register("go_id", B.moduleName, (n, s) => {
3946
3946
  const o = t.document.getElementById(n);
3947
3947
  if (!o) {
3948
3948
  s(!1);
@@ -3951,14 +3951,14 @@ const xi = "readium-cjk-vertical-snapper-style", H = class H extends St {
3951
3951
  this.wnd.requestAnimationFrame(() => {
3952
3952
  this.doc().scrollLeft += o.getBoundingClientRect().left - t.innerWidth / 2, this.reportProgress(), O(this.wnd), s(!0);
3953
3953
  });
3954
- }), e.register("go_text", H.moduleName, (n, s) => {
3954
+ }), e.register("go_text", B.moduleName, (n, s) => {
3955
3955
  let o;
3956
3956
  Array.isArray(n) && (n.length > 1 && (o = n[1]), n = n[0]);
3957
3957
  const a = rt.deserialize(n), l = It(this.wnd.document, new I({
3958
3958
  href: t.location.href,
3959
3959
  type: "text/html",
3960
3960
  text: a,
3961
- locations: o ? new _({
3961
+ locations: o ? new C({
3962
3962
  otherLocations: /* @__PURE__ */ new Map([["cssSelector", o]])
3963
3963
  }) : void 0
3964
3964
  }));
@@ -3969,32 +3969,32 @@ const xi = "readium-cjk-vertical-snapper-style", H = class H extends St {
3969
3969
  this.wnd.requestAnimationFrame(() => {
3970
3970
  this.doc().scrollLeft += l.getBoundingClientRect().left - t.innerWidth / 2, this.reportProgress(), O(this.wnd), s(!0);
3971
3971
  });
3972
- }), e.register("go_start", H.moduleName, (n, s) => {
3972
+ }), e.register("go_start", B.moduleName, (n, s) => {
3973
3973
  if (this.doc().scrollLeft === 0) return s(!1);
3974
3974
  this.doc().scrollLeft = 0, this.reportProgress(), s(!0);
3975
- }), e.register("go_end", H.moduleName, (n, s) => {
3975
+ }), e.register("go_end", B.moduleName, (n, s) => {
3976
3976
  if (Math.abs(this.doc().scrollLeft) === this.scrollable()) return s(!1);
3977
3977
  this.doc().scrollLeft = this.verticalLR ? this.scrollable() : -this.scrollable(), this.reportProgress(), s(!0);
3978
3978
  }), e.register([
3979
3979
  "go_next",
3980
3980
  "go_prev"
3981
- ], H.moduleName, (n, s) => s(!1)), e.register("unfocus", H.moduleName, (n, s) => {
3981
+ ], B.moduleName, (n, s) => s(!1)), e.register("unfocus", B.moduleName, (n, s) => {
3982
3982
  O(this.wnd), s(!0);
3983
- }), e.register("scroll_protection", H.moduleName, (n, s) => {
3983
+ }), e.register("scroll_protection", B.moduleName, (n, s) => {
3984
3984
  this.enableScrollProtection(), s(!0);
3985
- }), e.register("focus", H.moduleName, (n, s) => {
3985
+ }), e.register("focus", B.moduleName, (n, s) => {
3986
3986
  this.reportProgress(), s(!0);
3987
- }), e.register("first_visible_locator", H.moduleName, (n, s) => {
3987
+ }), e.register("first_visible_locator", B.moduleName, (n, s) => {
3988
3988
  const o = oe(t, !0);
3989
3989
  this.comms.send("first_visible_locator", o.serialize()), s(!0);
3990
3990
  }), e.log("CJKVerticalSnapper Mounted"), !0;
3991
3991
  }
3992
3992
  unmount(t, e) {
3993
- return e.unregisterAll(H.moduleName), this.resizeObserver.disconnect(), this.handleScroll && t.removeEventListener("scroll", this.handleScroll), t.document.getElementById(xi)?.remove(), this.patternAnalyzer && (this.patternAnalyzer.clear(), this.patternAnalyzer = null, this.isScrollProtectionEnabled = !1), e.log("CJKVerticalSnapper Unmounted"), !0;
3993
+ return e.unregisterAll(B.moduleName), this.resizeObserver.disconnect(), this.handleScroll && t.removeEventListener("scroll", this.handleScroll), t.document.getElementById(ki)?.remove(), this.patternAnalyzer && (this.patternAnalyzer.clear(), this.patternAnalyzer = null, this.isScrollProtectionEnabled = !1), e.log("CJKVerticalSnapper Unmounted"), !0;
3994
3994
  }
3995
3995
  };
3996
- H.moduleName = "cjk_vertical_snapper";
3997
- let Ae = H;
3996
+ B.moduleName = "cjk_vertical_snapper";
3997
+ let Ae = B;
3998
3998
  const fs = [
3999
3999
  "fixed_setup",
4000
4000
  "decorator",
@@ -4022,8 +4022,8 @@ const fs = [
4022
4022
  Le,
4023
4023
  xe,
4024
4024
  Ee,
4025
- _e,
4026
4025
  Ce,
4026
+ _e,
4027
4027
  Ae,
4028
4028
  ps
4029
4029
  ].map((r) => [r.moduleName, r]));
@@ -4033,7 +4033,7 @@ class Pt {
4033
4033
  * @param initialModules List of initial modules to load
4034
4034
  */
4035
4035
  constructor(t = window, e = []) {
4036
- this.loadedModules = [], this.wnd = t, this.comms = new Dn(t);
4036
+ this.loadedModules = [], this.wnd = t, this.comms = new zn(t);
4037
4037
  const i = [...new Set(e)];
4038
4038
  if (i.length) {
4039
4039
  if (typeof t > "u")
@@ -4135,7 +4135,7 @@ const ys = {
4135
4135
  { keyCode: 80, ctrl: !0, alt: !0 }
4136
4136
  // Ctrl+Alt+P
4137
4137
  ]
4138
- }, vs = {
4138
+ }, Ss = {
4139
4139
  type: "save",
4140
4140
  keyCombos: [
4141
4141
  { keyCode: 83, meta: !0 },
@@ -4144,7 +4144,7 @@ const ys = {
4144
4144
  // Ctrl+S
4145
4145
  ]
4146
4146
  };
4147
- class hn {
4147
+ class cn {
4148
4148
  /**
4149
4149
  * Merges keyboard peripherals from content protection config with user-provided peripherals
4150
4150
  * Content protection peripherals are added first for priority, then user peripherals are added only if they don't conflict
@@ -4153,7 +4153,7 @@ class hn {
4153
4153
  const i = [], n = e.filter(
4154
4154
  (s) => !["developer_tools", "select_all", "print", "save"].includes(s.type)
4155
4155
  );
4156
- t.disableSelectAll && i.push(bs), t.disableSave && i.push(vs), t.monitorDevTools && i.push(ys), t.protectPrinting?.disable && i.push(ws);
4156
+ t.disableSelectAll && i.push(bs), t.disableSave && i.push(Ss), t.monitorDevTools && i.push(ys), t.protectPrinting?.disable && i.push(ws);
4157
4157
  for (const s of n) {
4158
4158
  const o = s.keyCombos.filter(
4159
4159
  (a) => !i.some(
@@ -4170,21 +4170,21 @@ class hn {
4170
4170
  return i;
4171
4171
  }
4172
4172
  }
4173
- class cn extends hn {
4173
+ class dn extends cn {
4174
4174
  /**
4175
4175
  * Moves to the left content portion (eg. page) relative to the reading progression direction.
4176
4176
  */
4177
4177
  goLeft(t = !1, e) {
4178
- this.readingProgression === N.ltr ? this.goBackward(t, e) : this.readingProgression === N.rtl && this.goForward(t, e);
4178
+ this.readingProgression === M.ltr ? this.goBackward(t, e) : this.readingProgression === M.rtl && this.goForward(t, e);
4179
4179
  }
4180
4180
  /**
4181
4181
  * Moves to the right content portion (eg. page) relative to the reading progression direction.
4182
4182
  */
4183
4183
  goRight(t = !1, e) {
4184
- this.readingProgression === N.ltr ? this.goForward(t, e) : this.readingProgression === N.rtl && this.goBackward(t, e);
4184
+ this.readingProgression === M.ltr ? this.goForward(t, e) : this.readingProgression === M.rtl && this.goBackward(t, e);
4185
4185
  }
4186
4186
  }
4187
- class Ss extends hn {
4187
+ class vs extends cn {
4188
4188
  }
4189
4189
  class Ps {
4190
4190
  constructor(t, e, i, n) {
@@ -4237,7 +4237,7 @@ class Ps {
4237
4237
  }
4238
4238
  }
4239
4239
  const Es = 1e4;
4240
- class Mt {
4240
+ class Nt {
4241
4241
  constructor(t, e) {
4242
4242
  this.registry = /* @__PURE__ */ new Map(), this._ready = !1, this.listenerBuffer = [], this.handler = this.handle.bind(this), this.wnd = t, this.origin = e;
4243
4243
  try {
@@ -4316,12 +4316,12 @@ class Mt {
4316
4316
  ), o;
4317
4317
  }
4318
4318
  }
4319
- const _s = "'Iowan Old Style', Sitka, 'Sitka Text', Palatino, 'Book Antiqua', 'URW Palladio L', P052, serif", Cs = {
4320
- RS__oldStyleTf: _s
4321
- }, Ls = 16, ki = Cs.RS__oldStyleTf;
4319
+ const Cs = "'Iowan Old Style', Sitka, 'Sitka Text', Palatino, 'Book Antiqua', 'URW Palladio L', P052, serif", _s = {
4320
+ oldStyleTf: Cs
4321
+ }, Ls = 16, Oi = _s.oldStyleTf;
4322
4322
  class kt {
4323
4323
  constructor(t) {
4324
- 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 || ki, 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);
4324
+ 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);
4325
4325
  }
4326
4326
  updateMultipliers() {
4327
4327
  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;
@@ -4330,7 +4330,7 @@ class kt {
4330
4330
  // Not filtering because pretty much everything can
4331
4331
  // trigger a recomputation anyway.
4332
4332
  update(t) {
4333
- 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 || ki), 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();
4333
+ 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();
4334
4334
  }
4335
4335
  get baseFontSize() {
4336
4336
  return this._baseFontSize;
@@ -4393,10 +4393,10 @@ class kt {
4393
4393
  return this.getLineLengthFallback();
4394
4394
  }
4395
4395
  }
4396
- const dn = () => typeof navigator > "u" ? "" : navigator.userAgent || "", un = () => typeof navigator > "u" ? void 0 : navigator.userAgentData || void 0;
4397
- class pn {
4396
+ const un = () => typeof navigator > "u" ? "" : navigator.userAgent || "", pn = () => typeof navigator > "u" ? void 0 : navigator.userAgentData || void 0;
4397
+ class fn {
4398
4398
  constructor() {
4399
- const t = un(), e = dn(), i = (s) => (typeof s == "string" || typeof s == "number") && s ? String(s).replace(/_/g, ".").split(".").map((o) => parseInt(o) || 0) : [], n = (s = "") => {
4399
+ const t = pn(), e = un(), i = (s) => (typeof s == "string" || typeof s == "number") && s ? String(s).replace(/_/g, ".").split(".").map((o) => parseInt(o) || 0) : [], n = (s = "") => {
4400
4400
  if (!s) return [];
4401
4401
  const o = new RegExp("^.*" + s + "[ :\\/]?(\\d+([\\._]\\d+)*).*$");
4402
4402
  return o.test(e) ? i(e.replace(o, "$1")) : [];
@@ -4427,27 +4427,27 @@ class pn {
4427
4427
  }, []) };
4428
4428
  }
4429
4429
  }
4430
- class xs extends pn {
4430
+ class xs extends fn {
4431
4431
  get iOSRequest() {
4432
- const t = un(), e = dn();
4432
+ const t = pn(), e = un();
4433
4433
  if (this.OS.iOS && !this.OS.iPadOS)
4434
4434
  return "mobile";
4435
4435
  if (this.OS.iPadOS)
4436
4436
  return /\(iPad;/.test(e) || t && /^iPad(OS)?$/.test(t.platform) ? "mobile" : "desktop";
4437
4437
  }
4438
4438
  }
4439
- const J = new pn(), T = new xs();
4439
+ const J = new fn(), T = new xs();
4440
4440
  function bt(r) {
4441
4441
  const t = r.languages?.[0]?.toLowerCase(), e = r.readingProgression;
4442
4442
  if (t) {
4443
4443
  if (t.startsWith("zh") || t.startsWith("ja") || t.startsWith("ko"))
4444
- return e === N.rtl ? "cjk-vertical" : "cjk-horizontal";
4444
+ return e === M.rtl ? "cjk-vertical" : "cjk-horizontal";
4445
4445
  if (t.startsWith("mn-mong")) return "mongolian-vertical";
4446
4446
  if (t.startsWith("ar") || t.startsWith("fa") || t.startsWith("he")) return "rtl";
4447
4447
  }
4448
4448
  return "ltr";
4449
4449
  }
4450
- class fn {
4450
+ class $e {
4451
4451
  constructor(t, e) {
4452
4452
  this.config = t, this.onUpdate = e, this.unsubs = [], this.conditionValues = /* @__PURE__ */ new Map();
4453
4453
  }
@@ -4512,7 +4512,7 @@ class ks {
4512
4512
  });
4513
4513
  }
4514
4514
  applyContentProtection() {
4515
- this.comms || this.comms.resume(), this.comms.send("peripherals_protection", this.contentProtectionConfig), this.keyboardPeripheralsConfig && this.keyboardPeripheralsConfig.length > 0 && (this.conditionBridge?.destroy(), this.conditionBridge = new fn(
4515
+ this.comms || this.comms.resume(), this.comms.send("peripherals_protection", this.contentProtectionConfig), this.keyboardPeripheralsConfig && this.keyboardPeripheralsConfig.length > 0 && (this.conditionBridge?.destroy(), this.conditionBridge = new $e(
4516
4516
  this.keyboardPeripheralsConfig,
4517
4517
  (t) => {
4518
4518
  t.length > 0 && this.comms.send("keyboard_peripherals", t);
@@ -4536,7 +4536,7 @@ class ks {
4536
4536
  async show(t) {
4537
4537
  if (this.destroyed) throw Error("Trying to show frame when it doesn't exist");
4538
4538
  if (!this.frame.parentElement) throw Error("Trying to show frame that is not attached to the DOM");
4539
- return this.comms ? this.comms.resume() : this.comms = new Mt(this.frame.contentWindow, this.source), new Promise((e, i) => {
4539
+ return this.comms ? this.comms.resume() : this.comms = new Nt(this.frame.contentWindow, this.source), new Promise((e, i) => {
4540
4540
  this.comms?.send("activate", void 0, () => {
4541
4541
  this.comms?.send("focus", void 0, () => {
4542
4542
  this.applyContentProtection();
@@ -4549,7 +4549,7 @@ class ks {
4549
4549
  });
4550
4550
  }
4551
4551
  setCSSProperties(t) {
4552
- this.destroyed || !this.frame.contentWindow || (this.hidden && (this.comms ? this.comms?.resume() : this.comms = new Mt(this.frame.contentWindow, this.source)), this.comms?.send("update_properties", t), this.hidden && this.comms?.halt());
4552
+ this.destroyed || !this.frame.contentWindow || (this.hidden && (this.comms ? this.comms?.resume() : this.comms = new Nt(this.frame.contentWindow, this.source)), this.comms?.send("update_properties", t), this.hidden && this.comms?.halt());
4553
4553
  }
4554
4554
  get iframe() {
4555
4555
  if (this.destroyed) throw Error("Trying to use frame when it doesn't exist");
@@ -4686,10 +4686,10 @@ class Os {
4686
4686
  }), t;
4687
4687
  }
4688
4688
  }
4689
- var me, Oi;
4689
+ var me, Ri;
4690
4690
  function Rs() {
4691
- if (Oi) return me;
4692
- Oi = 1;
4691
+ if (Ri) return me;
4692
+ Ri = 1;
4693
4693
  function r(n) {
4694
4694
  if (typeof n != "string")
4695
4695
  throw new TypeError("Path must be a string. Received " + JSON.stringify(n));
@@ -4874,11 +4874,45 @@ function Rs() {
4874
4874
  };
4875
4875
  return i.posix = i, me = i, me;
4876
4876
  }
4877
- var Gt = Rs();
4878
- const As = { description: "Attempts to filter out paragraphs that are implicitly headings or part of headers", scope: "RS", value: "readium-experimentalHeaderFiltering-on" }, Ts = { description: "Attemps 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 = {
4877
+ var Xt = Rs();
4878
+ 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 = {
4879
4879
  experimentalHeaderFiltering: As,
4880
4880
  experimentalZoom: Ts
4881
- }, $e = Ms;
4881
+ }, Ms = { disabled: ["bodyHyphens", "a11yNormalize", "letterSpacing"], added: [] }, Fs = {
4882
+ default: { disabled: [], added: [] },
4883
+ rtl: Ms,
4884
+ "cjk-horizontal": { disabled: ["textAlign", "bodyHyphens", "a11yNormalize", "ligatures", "paraIndent", "wordSpacing"], added: ["noRuby"] },
4885
+ "cjk-vertical": { disabled: ["colCount", "textAlign", "bodyHyphens", "a11yNormalize", "ligatures", "paraIndent", "wordSpacing"], added: ["noRuby"] }
4886
+ }, Is = { baseFontFamily: "Kefa, Nyala, Roboto, Noto, 'Noto Sans Ethiopic', serif", lineHeightCompensation: 1.167 }, zs = { baseFontFamily: "'Geeza Pro', 'Arabic Typesetting', Roboto, Noto, 'Noto Naskh Arabic', 'Times New Roman', serif" }, Ds = { baseFontFamily: "'Kohinoor Bangla', 'Bangla Sangam MN', Vrinda, Roboto, Noto, 'Noto Sans Bengali', sans-serif", lineHeightCompensation: 1.067 }, Ws = { baseFontFamily: "Kailasa, 'Microsoft Himalaya', Roboto, Noto, 'Noto Sans Tibetan', sans-serif" }, Us = { baseFontFamily: "'Plantagenet Cherokee', Roboto, Noto, 'Noto Sans Cherokee'", lineHeightCompensation: 1.167 }, Hs = { baseFontFamily: "'Geeza Pro', 'Arabic Typesetting', Roboto, Noto, 'Noto Naskh Arabic', 'Times New Roman', serif" }, Bs = { baseFontFamily: "'Gujarati Sangam MN', 'Nirmala UI', Shruti, Roboto, Noto, 'Noto Sans Gujarati', sans-serif", lineHeightCompensation: 1.167 }, Vs = { baseFontFamily: "'New Peninim MT', 'Arial Hebrew', Gisha, 'Times New Roman', Roboto, Noto, 'Noto Sans Hebrew', sans-serif", lineHeightCompensation: 1.1 }, js = { baseFontFamily: "'Kohinoor Devanagari', 'Devanagari Sangam MN', Kokila, 'Nirmala UI', Roboto, Noto, 'Noto Sans Devanagari', sans-serif", lineHeightCompensation: 1.1 }, $s = { baseFontFamily: "Mshtakan, Sylfaen, Roboto, Noto, 'Noto Serif Armenian', serif" }, Gs = { baseFontFamily: "'Euphemia UCAS', Euphemia, Roboto, Noto, 'Noto Sans Canadian Aboriginal', sans-serif" }, Xs = { 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 }, Ys = { baseFontFamily: "'Khmer Sangam MN', 'Leelawadee UI', 'Khmer UI', Roboto, Noto, 'Noto Sans Khmer', sans-serif", lineHeightCompensation: 1.067 }, qs = { baseFontFamily: "'Kannada Sangam MN', 'Nirmala UI', Tunga, Roboto, Noto, 'Noto Sans Kannada', sans-serif", lineHeightCompensation: 1.1 }, Ks = { baseFontFamily: "'Nanum Gothic', 'Apple SD Gothic Neo', 'Malgun Gothic', Roboto, Noto, 'Noto Sans CJK KR', sans-serif", lineHeightCompensation: 1.167 }, Js = { baseFontFamily: "'Lao Sangam MN', 'Leelawadee UI', 'Lao UI', Roboto, Noto, 'Noto Sans Lao', sans-serif" }, Zs = { baseFontFamily: "'Malayalam Sangam MN', 'Nirmala UI', Kartika, Roboto, Noto, 'Noto Sans Malayalam', sans-serif", lineHeightCompensation: 1.067 }, Qs = { baseFontFamily: "'Oriya Sangam MN', 'Nirmala UI', Kalinga, Roboto, Noto, 'Noto Sans Oriya', sans-serif", lineHeightCompensation: 1.167 }, tr = { baseFontFamily: "'Gurmukhi MN', 'Nirmala UI', Kartika, Roboto, Noto, 'Noto Sans Gurmukhi', sans-serif", lineHeightCompensation: 1.1 }, er = { baseFontFamily: "'Sinhala Sangam MN', 'Nirmala UI', 'Iskoola Pota', Roboto, Noto, 'Noto Sans Sinhala', sans-serif", lineHeightCompensation: 1.167 }, ir = { baseFontFamily: "'Tamil Sangam MN', 'Nirmala UI', Latha, Roboto, Noto, 'Noto Sans Tamil', sans-serif", lineHeightCompensation: 1.067 }, nr = { baseFontFamily: "'Kohinoor Telugu', 'Telugu Sangam MN', 'Nirmala UI', Gautami, Roboto, Noto, 'Noto Sans Telugu', sans-serif" }, sr = { baseFontFamily: "Thonburi, 'Leelawadee UI', 'Cordia New', Roboto, Noto, 'Noto Sans Thai', sans-serif", lineHeightCompensation: 1.067 }, rr = { baseFontFamily: "'方体', 'PingFang SC', '黑体', 'Heiti SC', 'Microsoft JhengHei UI', 'Microsoft JhengHei', Roboto, Noto, 'Noto Sans CJK SC', sans-serif", lineHeightCompensation: 1.167 }, or = {
4887
+ default: { baseFontFamily: "var(--RS__oldStyleTf)", lineHeightCompensation: 1 },
4888
+ am: Is,
4889
+ ar: zs,
4890
+ bn: Ds,
4891
+ bo: Ws,
4892
+ chr: Us,
4893
+ fa: Hs,
4894
+ gu: Bs,
4895
+ he: Vs,
4896
+ hi: js,
4897
+ hy: $s,
4898
+ iu: Gs,
4899
+ ja: Xs,
4900
+ km: Ys,
4901
+ kn: qs,
4902
+ ko: Ks,
4903
+ lo: Js,
4904
+ ml: Zs,
4905
+ or: Qs,
4906
+ pa: tr,
4907
+ si: er,
4908
+ ta: ir,
4909
+ te: nr,
4910
+ th: sr,
4911
+ zh: rr,
4912
+ "zh-Hant": { baseFontFamily: "'方體', 'PingFang TC', '黑體', 'Heiti TC', 'Microsoft JhengHei UI', 'Microsoft JhengHei', Roboto, Noto, 'Noto Sans CJK TC', sans-serif", lineHeightCompensation: 1.167 },
4913
+ "zh-TW": { baseFontFamily: "'方體', 'PingFang TC', '黑體', 'Heiti TC', 'Microsoft JhengHei UI', 'Microsoft JhengHei', Roboto, Noto, 'Noto Sans CJK TC', sans-serif", lineHeightCompensation: 1.167 },
4914
+ "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 }
4915
+ }, Ge = Ns, uo = Fs, po = or;
4882
4916
  var tt = /* @__PURE__ */ ((r) => (r.start = "start", r.left = "left", r.right = "right", r.justify = "justify", r))(tt || {});
4883
4917
  const dt = {
4884
4918
  range: [0, 100],
@@ -4896,7 +4930,7 @@ const dt = {
4896
4930
  range: [0, 1],
4897
4931
  step: 0.125
4898
4932
  }, Jt = {
4899
- range: [1, 2],
4933
+ range: [1, 2.5],
4900
4934
  step: 0.1
4901
4935
  }, ut = {
4902
4936
  range: [20, 100],
@@ -4959,18 +4993,18 @@ class mn extends le {
4959
4993
  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;
4960
4994
  }
4961
4995
  }
4962
- class Ns extends le {
4996
+ class ar extends le {
4963
4997
  constructor(t) {
4964
4998
  super(), this.experiments = t.experiments ?? null;
4965
4999
  }
4966
5000
  toCSSProperties() {
4967
5001
  const t = {};
4968
5002
  return this.experiments && this.experiments.forEach((e) => {
4969
- t["--RS__" + e] = $e[e].value;
5003
+ t["--RS__" + e] = Ge[e].value;
4970
5004
  }), t;
4971
5005
  }
4972
5006
  }
4973
- class zs {
5007
+ class lr {
4974
5008
  constructor(t) {
4975
5009
  this.rsProperties = t.rsProperties, this.userProperties = t.userProperties;
4976
5010
  }
@@ -4996,10 +5030,10 @@ class zs {
4996
5030
  this.userProperties = new mn(e);
4997
5031
  }
4998
5032
  }
4999
- function Is(r, t) {
5033
+ function hr(r, t) {
5000
5034
  return r == null || t == null || r <= t ? r : void 0;
5001
5035
  }
5002
- function Ds(r, t) {
5036
+ function cr(r, t) {
5003
5037
  return r == null || t == null || r >= t ? r : void 0;
5004
5038
  }
5005
5039
  function W(r) {
@@ -5015,11 +5049,11 @@ function he(r, t) {
5015
5049
  function wt(r) {
5016
5050
  return typeof r == "boolean" || typeof r == "number" && r >= 0 ? r : r === null ? null : void 0;
5017
5051
  }
5018
- function v(r) {
5052
+ function S(r) {
5019
5053
  if (r !== void 0)
5020
5054
  return r === null ? null : r < 0 ? void 0 : r;
5021
5055
  }
5022
- function z(r, t) {
5056
+ function F(r, t) {
5023
5057
  if (r === void 0)
5024
5058
  return;
5025
5059
  if (r === null)
@@ -5032,11 +5066,11 @@ function ge(r, t) {
5032
5066
  }
5033
5067
  function gn(r) {
5034
5068
  if (r !== void 0)
5035
- return r === null ? null : r.filter((t) => t in $e);
5069
+ return r === null ? null : r.filter((t) => t in Ge);
5036
5070
  }
5037
- class Nt {
5071
+ class Mt {
5038
5072
  constructor(t = {}) {
5039
- this.fontFamily = W(t.fontFamily), this.fontWeight = z(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 = z(t.zoom, ee.range);
5073
+ 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);
5040
5074
  }
5041
5075
  static serialize(t) {
5042
5076
  const { ...e } = t;
@@ -5045,7 +5079,7 @@ class Nt {
5045
5079
  static deserialize(t) {
5046
5080
  try {
5047
5081
  const e = JSON.parse(t);
5048
- return new Nt(e);
5082
+ return new Mt(e);
5049
5083
  } catch (e) {
5050
5084
  return console.error("Failed to deserialize preferences:", e), null;
5051
5085
  }
@@ -5054,20 +5088,20 @@ class Nt {
5054
5088
  const e = { ...this };
5055
5089
  for (const i of Object.keys(t))
5056
5090
  t[i] !== void 0 && (e[i] = t[i]);
5057
- return new Nt(e);
5091
+ return new Mt(e);
5058
5092
  }
5059
5093
  }
5060
- class Fs {
5094
+ class dr {
5061
5095
  constructor(t) {
5062
- this.fontFamily = W(t.fontFamily) || null, this.fontWeight = z(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 = z(t.zoom, ee.range) || 1, this.experiments = gn(t.experiments) ?? null;
5096
+ 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;
5063
5097
  }
5064
5098
  }
5065
- class Ri {
5099
+ class Ai {
5066
5100
  constructor(t, e, i) {
5067
5101
  this.fontFamily = null, this.fontWeight = null, this.hyphens = null, this.iOSPatch = null, this.iPadOSPatch = null, this.letterSpacing = null, this.ligatures = null, this.lineHeight = null, this.noRuby = null, this.paragraphIndent = null, this.paragraphSpacing = null, this.textAlign = null, this.textNormalization = null, this.wordSpacing = null, i && (this.fontFamily = t.fontFamily || e.fontFamily || null, this.fontWeight = t.fontWeight !== void 0 ? t.fontWeight : e.fontWeight !== void 0 ? e.fontWeight : null, this.hyphens = typeof t.hyphens == "boolean" ? t.hyphens : e.hyphens ?? null, this.iOSPatch = t.iOSPatch === !1 ? !1 : t.iOSPatch === !0 ? (T.OS.iOS || T.OS.iPadOS) && T.iOSRequest === "mobile" : e.iOSPatch, this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : t.iPadOSPatch === !0 ? T.OS.iPadOS && T.iOSRequest === "desktop" : e.iPadOSPatch, this.letterSpacing = t.letterSpacing !== void 0 ? t.letterSpacing : e.letterSpacing !== void 0 ? e.letterSpacing : null, this.ligatures = typeof t.ligatures == "boolean" ? t.ligatures : e.ligatures ?? null, this.lineHeight = t.lineHeight !== void 0 ? t.lineHeight : e.lineHeight !== void 0 ? e.lineHeight : null, this.noRuby = typeof t.noRuby == "boolean" ? t.noRuby : e.noRuby ?? null, this.paragraphIndent = t.paragraphIndent !== void 0 ? t.paragraphIndent : e.paragraphIndent !== void 0 ? e.paragraphIndent : null, this.paragraphSpacing = t.paragraphSpacing !== void 0 ? t.paragraphSpacing : e.paragraphSpacing !== void 0 ? e.paragraphSpacing : null, this.textAlign = t.textAlign || e.textAlign || null, this.textNormalization = typeof t.textNormalization == "boolean" ? t.textNormalization : e.textNormalization ?? null, this.wordSpacing = t.wordSpacing !== void 0 ? t.wordSpacing : e.wordSpacing !== void 0 ? e.wordSpacing : null), this.zoom = t.zoom !== void 0 ? t.zoom : e.zoom !== void 0 ? e.zoom : null, this.experiments = e.experiments || null;
5068
5102
  }
5069
5103
  }
5070
- class M {
5104
+ class N {
5071
5105
  constructor({
5072
5106
  initialValue: t = null,
5073
5107
  effectiveValue: e,
@@ -5092,7 +5126,7 @@ class M {
5092
5126
  this._value = null;
5093
5127
  }
5094
5128
  }
5095
- class A extends M {
5129
+ class A extends N {
5096
5130
  set value(t) {
5097
5131
  this._value = t, this._onChange(this._value);
5098
5132
  }
@@ -5112,7 +5146,7 @@ class A extends M {
5112
5146
  this._value = !this._value, this._onChange(this._value);
5113
5147
  }
5114
5148
  }
5115
- class yn extends M {
5149
+ class yn extends N {
5116
5150
  constructor({
5117
5151
  initialValue: t = null,
5118
5152
  effectiveValue: e,
@@ -5143,7 +5177,7 @@ class yn extends M {
5143
5177
  this._value = null;
5144
5178
  }
5145
5179
  }
5146
- class x extends M {
5180
+ class x extends N {
5147
5181
  constructor({
5148
5182
  initialValue: t = null,
5149
5183
  effectiveValue: e,
@@ -5193,23 +5227,23 @@ class x extends M {
5193
5227
  this._value = null;
5194
5228
  }
5195
5229
  }
5196
- class Ai {
5230
+ class Ti {
5197
5231
  constructor(t, e, i) {
5198
5232
  this.preferences = t, this.settings = e, this.metadata = i;
5199
5233
  }
5200
5234
  clear() {
5201
- this.preferences = new Nt({});
5235
+ this.preferences = new Mt({});
5202
5236
  }
5203
5237
  updatePreference(t, e) {
5204
5238
  this.preferences[t] = e;
5205
5239
  }
5206
5240
  get isDisplayTransformable() {
5207
5241
  return this.metadata?.accessibility?.feature?.some(
5208
- (t) => t.value === Bt.DISPLAY_TRANSFORMABILITY.value
5242
+ (t) => t.value === Ht.DISPLAY_TRANSFORMABILITY.value
5209
5243
  ) ?? !1;
5210
5244
  }
5211
5245
  get fontFamily() {
5212
- return new M({
5246
+ return new N({
5213
5247
  initialValue: this.preferences.fontFamily,
5214
5248
  effectiveValue: this.settings.fontFamily || null,
5215
5249
  isEffective: this.isDisplayTransformable,
@@ -5388,18 +5422,18 @@ const bn = (r) => {
5388
5422
  t.attributes && Object.entries(t.attributes).forEach(([e, i]) => {
5389
5423
  e === "type" || e === "rel" || e === "href" || e === "src" || i != null && (typeof i == "boolean" ? i && r.setAttribute(e, "") : r.setAttribute(e, i));
5390
5424
  });
5391
- }, Ws = (r, t, e) => {
5425
+ }, ur = (r, t, e) => {
5392
5426
  const i = r.createElement("script");
5393
5427
  i.dataset.readium = "true", t.id && (i.id = t.id);
5394
5428
  const n = t.type || bn(t);
5395
5429
  return n && (i.type = n), wn(i, t), i.src = e, i;
5396
- }, Ti = (r, t, e) => {
5430
+ }, Ni = (r, t, e) => {
5397
5431
  const i = r.createElement("link");
5398
5432
  i.dataset.readium = "true", t.id && (i.id = t.id), t.rel && (i.rel = t.rel);
5399
5433
  const n = t.type || bn(t);
5400
5434
  return n && (i.type = n), wn(i, t), i.href = e, i;
5401
5435
  };
5402
- class vn {
5436
+ class Sn {
5403
5437
  constructor(t) {
5404
5438
  this.blobStore = /* @__PURE__ */ new Map(), this.createdBlobUrls = /* @__PURE__ */ new Set(), this.allowedDomains = [], this.injectableIdCounter = 0, this.allowedDomains = (t.allowedDomains || []).map((e) => {
5405
5439
  try {
@@ -5480,14 +5514,14 @@ class vn {
5480
5514
  ...e.attributes,
5481
5515
  as: e.as
5482
5516
  }
5483
- }, s = Ti(t, n, i);
5517
+ }, s = Ni(t, n, i);
5484
5518
  t.head.appendChild(s);
5485
5519
  }
5486
5520
  createElement(t, e, i) {
5487
5521
  if (e.as === "script")
5488
- return Ws(t, e, i);
5522
+ return ur(t, e, i);
5489
5523
  if (e.as === "link")
5490
- return Ti(t, e, i);
5524
+ return Ni(t, e, i);
5491
5525
  throw new Error(`Unsupported element type: ${e.as}`);
5492
5526
  }
5493
5527
  async applyRule(t, e) {
@@ -5544,8 +5578,8 @@ class vn {
5544
5578
  }
5545
5579
  }
5546
5580
  }
5547
- const vt = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").replace(/\n/g, "").replace(/\s+/g, " "), Ct = (r) => r.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g, "").replace(/ {2,}/g, " "), Us = `/*!
5548
- * Readium CSS v.2.0.0
5581
+ const St = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").replace(/\n/g, "").replace(/\s+/g, " "), _t = (r) => r.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g, "").replace(/ {2,}/g, " "), pr = `/*!
5582
+ * Readium CSS v.2.0.4
5549
5583
  * Copyright (c) 2017–2026. Readium Foundation. All rights reserved.
5550
5584
  * Use of this source code is governed by a BSD-style license which is detailed in the
5551
5585
  * LICENSE file present in the project repository where this source code is maintained.
@@ -5594,11 +5628,11 @@ const vt = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").repl
5594
5628
  :root[style*="--USER__bodyHyphens"] li,
5595
5629
  :root[style*="--USER__bodyHyphens"] div,
5596
5630
  :root[style*="--USER__bodyHyphens"] dd{
5597
- -webkit-hyphens:inherit;
5598
- -moz-hyphens:inherit;
5599
- -ms-hyphens:inherit;
5600
- -epub-hyphens:inherit;
5601
- hyphens:inherit;
5631
+ -webkit-hyphens:var(--USER__bodyHyphens) !important;
5632
+ -moz-hyphens:var(--USER__bodyHyphens) !important;
5633
+ -ms-hyphens:var(--USER__bodyHyphens) !important;
5634
+ -epub-hyphens:var(--USER__bodyHyphens) !important;
5635
+ hyphens:var(--USER__bodyHyphens) !important;
5602
5636
  }
5603
5637
 
5604
5638
  :root[style*="--USER__fontFamily"]{
@@ -5678,7 +5712,7 @@ const vt = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").repl
5678
5712
  :root[style*="--USER__lineHeight"] p,
5679
5713
  :root[style*="--USER__lineHeight"] li,
5680
5714
  :root[style*="--USER__lineHeight"] div{
5681
- line-height:inherit;
5715
+ line-height:var(--USER__lineHeight) !important;
5682
5716
  }
5683
5717
 
5684
5718
  :root[style*="--USER__paraSpacing"] p{
@@ -5698,8 +5732,7 @@ const vt = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").repl
5698
5732
  text-indent:var(--USER__paraIndent) !important;
5699
5733
  }
5700
5734
 
5701
- :root[style*="--USER__paraIndent"] p *,
5702
- :root[style*="--USER__paraIndent"] p:first-letter{
5735
+ :root[style*="--USER__paraIndent"] p *{
5703
5736
  text-indent:0 !important;
5704
5737
  }
5705
5738
 
@@ -5714,7 +5747,7 @@ const vt = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").repl
5714
5747
  :root[style*="--USER__wordSpacing"] div,
5715
5748
  :root[style*="--USER__wordSpacing"] dt,
5716
5749
  :root[style*="--USER__wordSpacing"] dd{
5717
- word-spacing:var(--USER__wordSpacing);
5750
+ word-spacing:var(--USER__wordSpacing) !important;
5718
5751
  }
5719
5752
 
5720
5753
  :root[style*="--USER__letterSpacing"] h1,
@@ -5728,8 +5761,8 @@ const vt = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").repl
5728
5761
  :root[style*="--USER__letterSpacing"] div,
5729
5762
  :root[style*="--USER__letterSpacing"] dt,
5730
5763
  :root[style*="--USER__letterSpacing"] dd{
5731
- letter-spacing:var(--USER__letterSpacing);
5732
- font-variant:none;
5764
+ letter-spacing:var(--USER__letterSpacing) !important;
5765
+ font-variant:none !important;
5733
5766
  }
5734
5767
 
5735
5768
  :root[style*="--USER__fontWeight"] body{
@@ -5818,7 +5851,7 @@ const vt = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").repl
5818
5851
 
5819
5852
  :root[style*="readium-iPadOSPatch-on"] p:not(:has(b, cite, em, i, q, s, small, span, strong)):first-line{
5820
5853
  -webkit-text-zoom:normal;
5821
- }`, 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})()));', Bs = `// WebPub-specific setup - no execution blocking needed
5854
+ }`, vn = '!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})()));', fr = `// WebPub-specific setup - no execution blocking needed
5822
5855
  window._readium_blockedEvents = [];
5823
5856
  window._readium_blockEvents = false; // WebPub doesn't need event blocking
5824
5857
  window._readium_eventBlocker = null;
@@ -5836,21 +5869,21 @@ window._readium_eventBlocker = null;
5836
5869
  });
5837
5870
  })();
5838
5871
  `;
5839
- function Hs(r) {
5872
+ function mr(r) {
5840
5873
  const t = r.filter((s) => s.mediaType.isHTML).map((s) => s.href), e = t.length > 0 ? t : [/\.html$/, /\.xhtml$/, /\/$/], i = [
5841
5874
  // CSS Selector Generator - always injected
5842
5875
  {
5843
5876
  id: "css-selector-generator",
5844
5877
  as: "script",
5845
5878
  target: "head",
5846
- blob: new Blob([vt(Sn)], { type: "text/javascript" })
5879
+ blob: new Blob([St(vn)], { type: "text/javascript" })
5847
5880
  },
5848
5881
  // WebPub Execution - always injected (sets up event blocking to false)
5849
5882
  {
5850
5883
  id: "webpub-execution",
5851
5884
  as: "script",
5852
5885
  target: "head",
5853
- blob: new Blob([vt(Bs)], { type: "text/javascript" })
5886
+ blob: new Blob([St(fr)], { type: "text/javascript" })
5854
5887
  }
5855
5888
  ], n = [
5856
5889
  // Onload Proxy - conditional (has executable scripts)
@@ -5858,7 +5891,7 @@ function Hs(r) {
5858
5891
  id: "onload-proxy",
5859
5892
  as: "script",
5860
5893
  target: "head",
5861
- blob: new Blob([vt(Pn)], { type: "text/javascript" }),
5894
+ blob: new Blob([St(Pn)], { type: "text/javascript" }),
5862
5895
  condition: (s) => !!(s.querySelector("script") || s.querySelector("body[onload]:not(body[onload=''])"))
5863
5896
  },
5864
5897
  // Readium CSS WebPub - always injected
@@ -5866,7 +5899,7 @@ function Hs(r) {
5866
5899
  id: "readium-css-webpub",
5867
5900
  as: "link",
5868
5901
  target: "head",
5869
- blob: new Blob([Ct(Us)], { type: "text/css" }),
5902
+ blob: new Blob([_t(pr)], { type: "text/css" }),
5870
5903
  rel: "stylesheet"
5871
5904
  }
5872
5905
  ];
@@ -5878,7 +5911,7 @@ function Hs(r) {
5878
5911
  }
5879
5912
  ];
5880
5913
  }
5881
- class Vs {
5914
+ class gr {
5882
5915
  constructor(t) {
5883
5916
  if (this.detectedTools = /* @__PURE__ */ new Set(), !t.onDetected)
5884
5917
  throw new Error("onDetected callback is required");
@@ -5910,11 +5943,11 @@ class Vs {
5910
5943
  this.observer?.disconnect(), this.observer = void 0, this.detectedTools.clear();
5911
5944
  }
5912
5945
  }
5913
- let js = 0;
5914
- function $s() {
5915
- return ++js;
5946
+ let yr = 0;
5947
+ function br() {
5948
+ return ++yr;
5916
5949
  }
5917
- const Xs = `
5950
+ const wr = `
5918
5951
  onmessage = function(event) {
5919
5952
  var action = event.data;
5920
5953
  var startTime = performance.now()
@@ -5925,7 +5958,7 @@ onmessage = function(event) {
5925
5958
  time: performance.now() - startTime
5926
5959
  })
5927
5960
  }
5928
- `, Ke = class Ke {
5961
+ `, Je = class Je {
5929
5962
  constructor(t, e) {
5930
5963
  this.callbacks = /* @__PURE__ */ new Map(), this.worker = t, this.blobUrl = e, this.worker.onmessage = (i) => {
5931
5964
  const n = i.data, s = n.id, o = this.callbacks.get(n.id);
@@ -5935,7 +5968,7 @@ onmessage = function(event) {
5935
5968
  }, this.log = (...i) => this.send("log", ...i), this.table = (...i) => this.send("table", ...i), this.clear = (...i) => this.send("clear", ...i);
5936
5969
  }
5937
5970
  async send(t, ...e) {
5938
- const i = $s();
5971
+ const i = br();
5939
5972
  return new Promise((n, s) => {
5940
5973
  this.callbacks.set(i, n), this.worker.postMessage({
5941
5974
  id: i,
@@ -5950,14 +5983,14 @@ onmessage = function(event) {
5950
5983
  this.worker.terminate(), URL.revokeObjectURL(this.blobUrl);
5951
5984
  }
5952
5985
  };
5953
- Ke.workerScript = Xs;
5954
- let se = Ke;
5986
+ Je.workerScript = wr;
5987
+ let se = Je;
5955
5988
  function Xe(r) {
5956
5989
  return typeof window < "u" && console ? console[r] : (...t) => {
5957
5990
  };
5958
5991
  }
5959
- const Gs = Xe("log"), Mi = Xe("table"), Ys = Xe("clear");
5960
- async function Ni() {
5992
+ const Sr = Xe("log"), Mi = Xe("table"), vr = Xe("clear");
5993
+ async function Fi() {
5961
5994
  if (typeof navigator < "u" && navigator.brave && navigator.brave.isBrave)
5962
5995
  try {
5963
5996
  return await Promise.race([
@@ -5969,10 +6002,10 @@ async function Ni() {
5969
6002
  }
5970
6003
  return !1;
5971
6004
  }
5972
- function qs(r) {
6005
+ function Pr(r) {
5973
6006
  return r.excludes.some((t) => t()) ? !1 : r.includes.some((t) => t());
5974
6007
  }
5975
- class Ks {
6008
+ class Er {
5976
6009
  constructor(t = {}) {
5977
6010
  if (this.isOpen = !1, this.checkCount = 0, this.maxChecks = 10, this.maxPrintTime = 0, this.largeObjectArray = null, this.options = {
5978
6011
  onDetected: t.onDetected || (() => {
@@ -6034,14 +6067,14 @@ class Ks {
6034
6067
  return (await this.workerConsole.log(t)).time;
6035
6068
  {
6036
6069
  const e = performance.now();
6037
- return Gs(t), performance.now() - e;
6070
+ return Sr(t), performance.now() - e;
6038
6071
  }
6039
6072
  }
6040
6073
  /**
6041
6074
  * Check if performance-based detection is enabled for current browser
6042
6075
  */
6043
6076
  isPerformanceDetectionEnabled() {
6044
- return qs({
6077
+ return Pr({
6045
6078
  includes: [
6046
6079
  () => !!J.UA.Chrome,
6047
6080
  () => !!J.UA.Chromium,
@@ -6064,14 +6097,14 @@ class Ks {
6064
6097
  if (!this.isPerformanceDetectionEnabled())
6065
6098
  return !1;
6066
6099
  const t = await this.calcTablePrintTime(), e = Math.max(await this.calcLogPrintTime(), await this.calcLogPrintTime());
6067
- return this.maxPrintTime = Math.max(this.maxPrintTime, e), this.workerConsole ? await this.workerConsole.clear() : Ys(), t === 0 ? !1 : this.maxPrintTime === 0 ? !!await Ni() : t > this.maxPrintTime * 10;
6100
+ return this.maxPrintTime = Math.max(this.maxPrintTime, e), this.workerConsole ? await this.workerConsole.clear() : vr(), t === 0 ? !1 : this.maxPrintTime === 0 ? !!await Fi() : t > this.maxPrintTime * 10;
6068
6101
  }
6069
6102
  /**
6070
6103
  * Debugger-based detection (fallback method)
6071
6104
  * WARNING: This method impacts user experience
6072
6105
  */
6073
6106
  async checkDebuggerBased() {
6074
- if (!this.isDebuggerDetectionEnabled() || await Ni())
6107
+ if (!this.isDebuggerDetectionEnabled() || await Fi())
6075
6108
  return !1;
6076
6109
  const t = performance.now();
6077
6110
  try {
@@ -6119,7 +6152,7 @@ class Ks {
6119
6152
  this.intervalId && (clearInterval(this.intervalId), this.intervalId = void 0), this.workerConsole && (this.workerConsole.destroy(), this.workerConsole = void 0), this.isOpen = !1, this.checkCount = 0;
6120
6153
  }
6121
6154
  }
6122
- class Js {
6155
+ class Cr {
6123
6156
  constructor(t) {
6124
6157
  if (this.detected = !1, !t.onDetected)
6125
6158
  throw new Error("onDetected callback is required");
@@ -6154,7 +6187,7 @@ class Js {
6154
6187
  this.observer?.disconnect(), this.observer = void 0, this.detected = !1;
6155
6188
  }
6156
6189
  }
6157
- class Zs {
6190
+ class _r {
6158
6191
  constructor(t = {}) {
6159
6192
  this.styleElement = null, this.beforePrintHandler = null, this.onPrintAttempt = t.onPrintAttempt, t.disable && this.setupPrintProtection(t.watermark);
6160
6193
  }
@@ -6180,7 +6213,7 @@ class Zs {
6180
6213
  this.beforePrintHandler && (window.removeEventListener("beforeprint", this.beforePrintHandler), this.beforePrintHandler = null), this.styleElement?.parentNode && (this.styleElement.parentNode.removeChild(this.styleElement), this.styleElement = null);
6181
6214
  }
6182
6215
  }
6183
- class Qs {
6216
+ class Lr {
6184
6217
  constructor(t = {}) {
6185
6218
  this.onContextMenuBlocked = t.onContextMenuBlocked, this.contextMenuHandler = this.handleContextMenu.bind(this), document.addEventListener("contextmenu", this.contextMenuHandler, !0), window.addEventListener("unload", () => this.destroy());
6186
6219
  }
@@ -6200,7 +6233,7 @@ class Qs {
6200
6233
  }
6201
6234
  }
6202
6235
  const ot = "readium:navigator:suspiciousActivity";
6203
- class Ge {
6236
+ class Ye {
6204
6237
  dispatchSuspiciousActivity(t, e) {
6205
6238
  const i = new CustomEvent(ot, {
6206
6239
  detail: {
@@ -6212,7 +6245,7 @@ class Ge {
6212
6245
  window.dispatchEvent(i);
6213
6246
  }
6214
6247
  constructor(t = {}) {
6215
- t.monitorDevTools && (this.devToolsDetector = new Ks({
6248
+ t.monitorDevTools && (this.devToolsDetector = new Er({
6216
6249
  onDetected: () => {
6217
6250
  this.dispatchSuspiciousActivity("developer_tools", {
6218
6251
  targetFrameSrc: "",
@@ -6225,20 +6258,20 @@ class Ge {
6225
6258
  metaKey: !1
6226
6259
  });
6227
6260
  }
6228
- })), t.checkAutomation && (this.automationDetector = new Vs({
6261
+ })), t.checkAutomation && (this.automationDetector = new gr({
6229
6262
  onDetected: (e) => {
6230
6263
  this.dispatchSuspiciousActivity("automation_detected", { tool: e });
6231
6264
  }
6232
- })), t.checkIFrameEmbedding && (this.iframeEmbeddingDetector = new Js({
6265
+ })), t.checkIFrameEmbedding && (this.iframeEmbeddingDetector = new Cr({
6233
6266
  onDetected: (e) => {
6234
6267
  this.dispatchSuspiciousActivity("iframe_embedding_detected", { isCrossOrigin: e });
6235
6268
  }
6236
- })), t.protectPrinting?.disable && (this.printProtector = new Zs({
6269
+ })), t.protectPrinting?.disable && (this.printProtector = new _r({
6237
6270
  ...t.protectPrinting,
6238
6271
  onPrintAttempt: () => {
6239
6272
  this.dispatchSuspiciousActivity("print", {});
6240
6273
  }
6241
- })), t.disableContextMenu && (this.contextMenuProtector = new Qs({
6274
+ })), t.disableContextMenu && (this.contextMenuProtector = new Lr({
6242
6275
  onContextMenuBlocked: (e) => {
6243
6276
  this.dispatchSuspiciousActivity("context_menu", e);
6244
6277
  }
@@ -6249,9 +6282,9 @@ class Ge {
6249
6282
  }
6250
6283
  }
6251
6284
  const at = "readium:navigator:keyboardPeripheral";
6252
- class Ye {
6285
+ class qe {
6253
6286
  constructor(t = {}) {
6254
- this.keyManager = new ln(), this.setupKeyboardPeripherals(t.keyboardPeripherals || []);
6287
+ this.keyManager = new hn(), this.setupKeyboardPeripherals(t.keyboardPeripherals || []);
6255
6288
  }
6256
6289
  setupKeyboardPeripherals(t) {
6257
6290
  if (t.length > 0) {
@@ -6274,7 +6307,7 @@ class Ye {
6274
6307
  this.keydownHandler && (document.removeEventListener("keydown", this.keydownHandler, !0), this.keydownHandler = void 0);
6275
6308
  }
6276
6309
  }
6277
- const tr = (r) => ({
6310
+ const xr = (r) => ({
6278
6311
  frameLoaded: r.frameLoaded || (() => {
6279
6312
  }),
6280
6313
  positionChanged: r.positionChanged || (() => {
@@ -6297,27 +6330,27 @@ const tr = (r) => ({
6297
6330
  peripheral: r.peripheral || (() => {
6298
6331
  })
6299
6332
  });
6300
- class er extends cn {
6333
+ class kr extends dn {
6301
6334
  constructor(t, e, i, n = void 0, s = { preferences: {}, defaults: {} }) {
6302
6335
  super(), this.currentIndex = 0, this._preferencesEditor = null, this._injector = null, this._navigatorProtector = null, this._keyboardPeripheralsManager = null, this._suspiciousActivityListener = null, this._keyboardPeripheralListener = null, this.webViewport = {
6303
6336
  readingOrder: [],
6304
6337
  progressions: /* @__PURE__ */ new Map(),
6305
6338
  positions: null
6306
- }, this.pub = e, this.container = t, this.listeners = tr(i), this._preferences = new Nt(s.preferences), this._defaults = new Fs(s.defaults), this._settings = new Ri(this._preferences, this._defaults, this.hasDisplayTransformability), this._css = new zs({
6307
- rsProperties: new Ns({ experiments: this._settings.experiments || null }),
6339
+ }, this.pub = e, this.container = t, this.listeners = xr(i), this._preferences = new Mt(s.preferences), this._defaults = new dr(s.defaults), this._settings = new Ai(this._preferences, this._defaults, this.hasDisplayTransformability), this._css = new lr({
6340
+ rsProperties: new ar({ experiments: this._settings.experiments || null }),
6308
6341
  userProperties: new mn({ zoom: this._settings.zoom })
6309
6342
  });
6310
- const o = Hs(e.readingOrder.items), a = s.injectables || { rules: [], allowedDomains: [] };
6311
- if (this._injector = new vn({
6343
+ const o = mr(e.readingOrder.items), a = s.injectables || { rules: [], allowedDomains: [] };
6344
+ if (this._injector = new Sn({
6312
6345
  rules: [...o, ...a.rules],
6313
6346
  allowedDomains: a.allowedDomains
6314
6347
  }), this._contentProtection = s.contentProtection || {}, this._keyboardPeripherals = this.mergeKeyboardPeripherals(
6315
6348
  this._contentProtection,
6316
6349
  s.keyboardPeripherals || []
6317
- ), (this._contentProtection.disableContextMenu || this._contentProtection.checkAutomation || this._contentProtection.checkIFrameEmbedding || this._contentProtection.monitorDevTools || this._contentProtection.protectPrinting?.disable) && (this._navigatorProtector = new Ge(this._contentProtection), this._suspiciousActivityListener = (l) => {
6350
+ ), (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) => {
6318
6351
  const { type: h, ...c } = l.detail;
6319
6352
  h === "context_menu" ? this.listeners.contextMenu(c) : this.listeners.contentProtection(h, c);
6320
- }, window.addEventListener(ot, this._suspiciousActivityListener)), this._keyboardPeripherals.length > 0 && (this._keyboardPeripheralsManager = new Ye({
6353
+ }, window.addEventListener(ot, this._suspiciousActivityListener)), this._keyboardPeripherals.length > 0 && (this._keyboardPeripheralsManager = new qe({
6321
6354
  keyboardPeripherals: this._keyboardPeripherals
6322
6355
  }), this._keyboardPeripheralListener = (l) => {
6323
6356
  const h = l.detail;
@@ -6345,13 +6378,13 @@ class er extends cn {
6345
6378
  return Object.freeze({ ...this._settings });
6346
6379
  }
6347
6380
  get preferencesEditor() {
6348
- return this._preferencesEditor === null && (this._preferencesEditor = new Ai(this._preferences, this.settings, this.pub.metadata)), this._preferencesEditor;
6381
+ return this._preferencesEditor === null && (this._preferencesEditor = new Ti(this._preferences, this.settings, this.pub.metadata)), this._preferencesEditor;
6349
6382
  }
6350
6383
  async submitPreferences(t) {
6351
6384
  this._preferences = this._preferences.merging(t), await this.applyPreferences();
6352
6385
  }
6353
6386
  async applyPreferences() {
6354
- this._settings = new Ri(this._preferences, this._defaults, this.hasDisplayTransformability), this._preferencesEditor !== null && (this._preferencesEditor = new Ai(this._preferences, this.settings, this.pub.metadata)), await this.updateCSS(!0);
6387
+ this._settings = new Ai(this._preferences, this._defaults, this.hasDisplayTransformability), this._preferencesEditor !== null && (this._preferencesEditor = new Ti(this._preferences, this.settings, this.pub.metadata)), await this.updateCSS(!0);
6355
6388
  }
6356
6389
  async updateCSS(t) {
6357
6390
  this._css.update(this._settings), t && await this.commitCSS(this._css);
@@ -6377,7 +6410,7 @@ class er extends cn {
6377
6410
  }
6378
6411
  get hasDisplayTransformability() {
6379
6412
  return this.pub.metadata?.accessibility?.feature?.some(
6380
- (t) => t.value === Bt.DISPLAY_TRANSFORMABILITY.value
6413
+ (t) => t.value === Ht.DISPLAY_TRANSFORMABILITY.value
6381
6414
  ) ?? !1;
6382
6415
  }
6383
6416
  eventListener(t, e) {
@@ -6427,7 +6460,7 @@ class er extends cn {
6427
6460
  const p = new URL(this.currentLocation.href);
6428
6461
  c = new URL(h, p).href;
6429
6462
  } else
6430
- c = Gt.join(Gt.dirname(this.currentLocation.href), h);
6463
+ c = Xt.join(Xt.dirname(this.currentLocation.href), h);
6431
6464
  const u = this.pub.readingOrder.findWithHref(c);
6432
6465
  u ? this.goLink(u, !1, () => {
6433
6466
  }) : (console.warn(`Internal link not found in readingOrder: ${c}`), this.listeners.handleLocator(new $({
@@ -6604,7 +6637,7 @@ class er extends cn {
6604
6637
  return this.pub.manifest.locatorFromLink(e) || new I({
6605
6638
  href: e.href,
6606
6639
  type: e.type || "text/html",
6607
- locations: new _({
6640
+ locations: new C({
6608
6641
  fragments: [],
6609
6642
  progression: n,
6610
6643
  position: this.currentIndex + 1
@@ -6612,7 +6645,7 @@ class er extends cn {
6612
6645
  });
6613
6646
  }
6614
6647
  }
6615
- const Fr = er, ir = (r) => {
6648
+ const fo = kr, Or = (r) => {
6616
6649
  const t = r.join(" ");
6617
6650
  return [
6618
6651
  // 'self' is useless because the document is loaded from a blob: URL
@@ -6686,12 +6719,12 @@ class En {
6686
6719
  g && !p ? (t.documentElement.lang = g, t.documentElement.setAttribute("xml:lang", g), t.body.removeAttribute("xml:lang"), t.body.removeAttribute("lang")) : p || (t.documentElement.lang = u, t.documentElement.setAttribute("xml:lang", u));
6687
6720
  } else n === m.HTML && !t.documentElement.lang && (t.documentElement.lang = u);
6688
6721
  }
6689
- if (bt(this.pub.metadata) === "rtl" && !t.documentElement.dir && !t.body.dir && (t.documentElement.dir = N.rtl), i !== void 0) {
6722
+ if (bt(this.pub.metadata) === "rtl" && !t.documentElement.dir && !t.body.dir && (t.documentElement.dir = M.rtl), i !== void 0) {
6690
6723
  const u = t.createElement("base");
6691
6724
  u.href = i, u.dataset.readium = "true", t.head.firstChild.before(u);
6692
6725
  }
6693
6726
  const c = t.createElement("meta");
6694
- return c.httpEquiv = "Content-Security-Policy", c.content = ir(l), c.dataset.readium = "true", t.head.firstChild.before(c), URL.createObjectURL(
6727
+ return c.httpEquiv = "Content-Security-Policy", c.content = Or(l), c.dataset.readium = "true", t.head.firstChild.before(c), URL.createObjectURL(
6695
6728
  new Blob([new XMLSerializer().serializeToString(t)], {
6696
6729
  type: n.isHTML ? n.string : "application/xhtml+xml"
6697
6730
  // Fallback to XHTML
@@ -6699,7 +6732,7 @@ class En {
6699
6732
  );
6700
6733
  }
6701
6734
  }
6702
- class _n {
6735
+ class Cn {
6703
6736
  constructor(t, e = {}, i = []) {
6704
6737
  this.hidden = !0, this.destroyed = !1, this.currModules = [], this.frame = document.createElement("iframe"), this.frame.sandbox.value = "allow-same-origin allow-scripts", this.frame.classList.add("readium-navigator-iframe"), this.frame.style.visibility = "hidden", this.frame.style.setProperty("aria-hidden", "true"), this.frame.style.opacity = "0", this.frame.style.position = "absolute", this.frame.style.pointerEvents = "none", this.frame.style.transition = "visibility 0s, opacity 0.1s linear", this.source = t, this.contentProtectionConfig = { ...e }, this.keyboardPeripheralsConfig = [...i];
6705
6738
  }
@@ -6737,7 +6770,7 @@ class _n {
6737
6770
  });
6738
6771
  }
6739
6772
  applyContentProtection() {
6740
- this.comms || this.comms.resume(), this.comms.send("peripherals_protection", this.contentProtectionConfig), this.keyboardPeripheralsConfig && this.keyboardPeripheralsConfig.length > 0 && (this.conditionBridge?.destroy(), this.conditionBridge = new fn(
6773
+ this.comms || this.comms.resume(), this.comms.send("peripherals_protection", this.contentProtectionConfig), this.keyboardPeripheralsConfig && this.keyboardPeripheralsConfig.length > 0 && (this.conditionBridge?.destroy(), this.conditionBridge = new $e(
6741
6774
  this.keyboardPeripheralsConfig,
6742
6775
  (t) => {
6743
6776
  t.length > 0 && this.comms.send("keyboard_peripherals", t);
@@ -6761,7 +6794,7 @@ class _n {
6761
6794
  async show(t) {
6762
6795
  if (this.destroyed) throw Error("Trying to show frame when it doesn't exist");
6763
6796
  if (!this.frame.parentElement) throw Error("Trying to show frame that is not attached to the DOM");
6764
- return this.comms ? this.comms.resume() : this.comms = new Mt(this.frame.contentWindow, this.source), new Promise((e, i) => {
6797
+ return this.comms ? this.comms.resume() : this.comms = new Nt(this.frame.contentWindow, this.source), new Promise((e, i) => {
6765
6798
  this.comms?.send("activate", void 0, () => {
6766
6799
  this.comms?.send("focus", void 0, () => {
6767
6800
  this.applyContentProtection();
@@ -6774,7 +6807,7 @@ class _n {
6774
6807
  });
6775
6808
  }
6776
6809
  setCSSProperties(t) {
6777
- this.destroyed || !this.frame.contentWindow || (this.hidden && (this.comms ? this.comms?.resume() : this.comms = new Mt(this.frame.contentWindow, this.source)), this.comms?.send("update_properties", t), this.hidden && this.comms?.halt());
6810
+ this.destroyed || !this.frame.contentWindow || (this.hidden && (this.comms ? this.comms?.resume() : this.comms = new Nt(this.frame.contentWindow, this.source)), this.comms?.send("update_properties", t), this.hidden && this.comms?.halt());
6778
6811
  }
6779
6812
  get iframe() {
6780
6813
  if (this.destroyed) throw Error("Trying to use frame when it doesn't exist");
@@ -6804,8 +6837,8 @@ class _n {
6804
6837
  return this.loader;
6805
6838
  }
6806
6839
  }
6807
- const zi = 5, Ii = 3;
6808
- class nr {
6840
+ const Ii = 5, zi = 3;
6841
+ class Rr {
6809
6842
  constructor(t, e, i, n, s, o) {
6810
6843
  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 || [];
6811
6844
  }
@@ -6832,7 +6865,7 @@ class nr {
6832
6865
  const a = new Promise(async (l, h) => {
6833
6866
  const c = [], u = [];
6834
6867
  this.positions.forEach((d, f) => {
6835
- (f > s + zi || f < s - zi) && (c.includes(d.href) || c.push(d.href)), f < s + Ii && f > s - Ii && (u.includes(d.href) || u.push(d.href));
6868
+ (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));
6836
6869
  }), c.forEach(async (d) => {
6837
6870
  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 }));
6838
6871
  }), this.currentBaseURL !== void 0 && t.baseURL !== this.currentBaseURL && (this.blobs.forEach((d) => {
@@ -6868,7 +6901,7 @@ class nr {
6868
6901
  ).build();
6869
6902
  this.blobs.set(d, R);
6870
6903
  }
6871
- const w = new _n(this.blobs.get(d), this.contentProtectionConfig, this.keyboardPeripheralsConfig);
6904
+ const w = new Cn(this.blobs.get(d), this.contentProtectionConfig, this.keyboardPeripheralsConfig);
6872
6905
  d !== o && await w.hide(), this.container.appendChild(w.iframe), await w.load(i), this.pool.set(d, w);
6873
6906
  };
6874
6907
  try {
@@ -6922,9 +6955,9 @@ class nr {
6922
6955
  }), t;
6923
6956
  }
6924
6957
  }
6925
- class sr {
6958
+ class Ar {
6926
6959
  constructor(t, e, i, n = {}, s = []) {
6927
- 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 === N.rtl ? "right" : "left", this.wrapper.appendChild(this.frame);
6960
+ 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);
6928
6961
  }
6929
6962
  async load(t, e) {
6930
6963
  return this.source === e && this.loadPromise && [...this.currModules].sort().join("|") === [...t].sort().join("|") ? this.loadPromise : (this.loaded && this.source !== e && this.window.stop(), this.source = e, this.loadPromise = new Promise((i, n) => {
@@ -6984,10 +7017,10 @@ class sr {
6984
7017
  const i = Math.min(this.wrapper.clientWidth / e.width, this.wrapper.clientHeight / e.height);
6985
7018
  this.frame.style.transform = `scale(${i})`;
6986
7019
  const n = this.frame.getBoundingClientRect(), s = this.wrapper.clientHeight - n.height;
6987
- if (this.frame.style.top = `${s / 2}px`, t === X.left) {
7020
+ if (this.frame.style.top = `${s / 2}px`, t === G.left) {
6988
7021
  const o = this.wrapper.clientWidth - n.width;
6989
7022
  this.frame.style.left = `${o}px`;
6990
- } else if (t === X.center) {
7023
+ } else if (t === G.center) {
6991
7024
  const o = this.wrapper.clientWidth - n.width;
6992
7025
  this.frame.style.left = `${o / 2}px`;
6993
7026
  } else
@@ -6995,7 +7028,7 @@ class sr {
6995
7028
  this.frame.style.removeProperty("visibility"), this.frame.style.removeProperty("aria-hidden"), this.frame.style.removeProperty("pointer-events"), this.frame.classList.remove("blank"), this.frame.classList.add("loaded");
6996
7029
  }
6997
7030
  async destroy() {
6998
- await this.unfocus(), this.loader?.destroy(), this.wrapper.remove();
7031
+ this.conditionBridge?.destroy(), await this.unfocus(), this.loader?.destroy(), this.wrapper.remove();
6999
7032
  }
7000
7033
  async unload() {
7001
7034
  if (this.loaded)
@@ -7026,7 +7059,12 @@ class sr {
7026
7059
  this.comms?.halt();
7027
7060
  }
7028
7061
  applyContentProtection() {
7029
- this.comms || this.comms.resume(), this.comms.send("peripherals_protection", this.contentProtectionConfig), this.keyboardPeripheralsConfig && this.keyboardPeripheralsConfig.length > 0 && this.comms.send("keyboard_peripherals", this.keyboardPeripheralsConfig), this.contentProtectionConfig.protectPrinting?.disable && this.comms.send("print_protection", this.contentProtectionConfig.protectPrinting);
7062
+ this.comms || this.comms.resume(), this.comms.send("peripherals_protection", this.contentProtectionConfig), this.keyboardPeripheralsConfig && this.keyboardPeripheralsConfig.length > 0 && (this.conditionBridge?.destroy(), this.conditionBridge = new $e(
7063
+ this.keyboardPeripheralsConfig,
7064
+ (t) => {
7065
+ t.length > 0 && this.comms.send("keyboard_peripherals", t);
7066
+ }
7067
+ ), this.conditionBridge.setup()), this.contentProtectionConfig.protectPrinting?.disable && this.comms.send("print_protection", this.contentProtectionConfig.protectPrinting);
7030
7068
  }
7031
7069
  async show(t) {
7032
7070
  if (!this.frame.parentElement) {
@@ -7037,7 +7075,7 @@ class sr {
7037
7075
  this.showPromise = void 0;
7038
7076
  return;
7039
7077
  }
7040
- return this.showPromise ? (this.cachedPage !== t && (this.update(t), this.cachedPage = t), this.showPromise) : (this.cachedPage = t, this.comms ? this.comms.resume() : this.comms = new Mt(this.frame.contentWindow, this.source), this.showPromise = new Promise((e, i) => {
7078
+ return this.showPromise ? (this.cachedPage !== t && (this.update(t), this.cachedPage = t), this.showPromise) : (this.cachedPage = t, this.comms ? this.comms.resume() : this.comms = new Nt(this.frame.contentWindow, this.source), this.showPromise = new Promise((e, i) => {
7041
7079
  this.comms.send("focus", void 0, (n) => {
7042
7080
  this.update(this.cachedPage), this.applyContentProtection(), e();
7043
7081
  });
@@ -7088,8 +7126,8 @@ class sr {
7088
7126
  return this.loader;
7089
7127
  }
7090
7128
  }
7091
- var rr = /* @__PURE__ */ ((r) => (r[r.Left = 0] = "Left", r[r.Center = 1] = "Center", r[r.Right = 2] = "Right", r))(rr || {}), or = /* @__PURE__ */ ((r) => (r[r.Top = 0] = "Top", r[r.Middle = 1] = "Middle", r[r.Bottom = 2] = "Bottom", r))(or || {});
7092
- class ar {
7129
+ var Tr = /* @__PURE__ */ ((r) => (r[r.Left = 0] = "Left", r[r.Center = 1] = "Center", r[r.Right = 2] = "Right", r))(Tr || {}), Nr = /* @__PURE__ */ ((r) => (r[r.Top = 0] = "Top", r[r.Middle = 1] = "Middle", r[r.Bottom = 2] = "Bottom", r))(Nr || {});
7130
+ class Mr {
7093
7131
  constructor() {
7094
7132
  this.outerWidth = 0, this.outerHeight = 0, this.HTML = document.documentElement, this.Head = document.head, this.Body = document.body;
7095
7133
  }
@@ -7137,7 +7175,7 @@ class ar {
7137
7175
  };
7138
7176
  }
7139
7177
  }
7140
- class lr {
7178
+ class Fr {
7141
7179
  constructor() {
7142
7180
  this._DOM = {
7143
7181
  show: !1,
@@ -7155,8 +7193,8 @@ class lr {
7155
7193
  return this._DOM;
7156
7194
  }
7157
7195
  }
7158
- const Di = 6, ye = 1.02, Fi = 50;
7159
- class hr {
7196
+ const Di = 6, ye = 1.02, Wi = 50;
7197
+ class Ir {
7160
7198
  constructor(t, e = !1) {
7161
7199
  this.dragState = 0, this.minimumMoved = !1, this.pan = {
7162
7200
  startX: 0,
@@ -7175,7 +7213,7 @@ class hr {
7175
7213
  target: { X: 0, Y: 0 },
7176
7214
  touchN: 0,
7177
7215
  startTranslate: { X: 0, Y: 0 }
7178
- }, 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 ar(), this.attachEvents(), e && (this.debugger = new lr());
7216
+ }, 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 Mr(), this.attachEvents(), e && (this.debugger = new Fr());
7179
7217
  }
7180
7218
  get scale() {
7181
7219
  return this._scale;
@@ -7271,7 +7309,7 @@ class hr {
7271
7309
  */
7272
7310
  touchendHandler(t) {
7273
7311
  if (t.stopPropagation(), !t.touches || t.touches.length === 0)
7274
- this.pan.endX && !this.isScaled ? (this.pinch.touchN && (this.pan.endX = this.pan.startX), this.updateAfterDrag()) : !this.pinch.touchN && Math.abs(this.pan.overscrollX) > Fi && Math.abs(this.pan.overscrollY) < Fi / 2 && (this.pan.startX = 0, this.pan.endX = -this.pan.overscrollX, this.updateAfterDrag()), this.dragState = 0, this.minimumMoved = !1, this.clearPinch(), this.debugger?.show && (this.debugger.DOM.center.style.display = "none", this.debugger.DOM.touch1.style.display = "none", this.debugger.DOM.touch2.style.display = "none");
7312
+ this.pan.endX && !this.isScaled ? (this.pinch.touchN && (this.pan.endX = this.pan.startX), this.updateAfterDrag()) : !this.pinch.touchN && Math.abs(this.pan.overscrollX) > Wi && Math.abs(this.pan.overscrollY) < Wi / 2 && (this.pan.startX = 0, this.pan.endX = -this.pan.overscrollX, this.updateAfterDrag()), this.dragState = 0, this.minimumMoved = !1, this.clearPinch(), this.debugger?.show && (this.debugger.DOM.center.style.display = "none", this.debugger.DOM.touch1.style.display = "none", this.debugger.DOM.touch2.style.display = "none");
7275
7313
  else if (t.touches.length === 1) {
7276
7314
  this.dragState = 1, t.touches[0].identifier !== this.pan.touchID && (this.pan.touchID = t.touches[0].identifier), this.debugger?.show && (this.debugger.DOM.center.style.display = "none", this.debugger.DOM.touch2.style.display = "none", this.debugger.DOM.pinchTarget.style.display = "none");
7277
7315
  const e = this.startTouch(t);
@@ -7376,8 +7414,8 @@ Overscroll: ${this.pan.overscrollX.toFixed(2)},${this.pan.overscrollY.toFixed(2)
7376
7414
  t > 0 && e > this.manager.threshold && this.manager.slength > this.manager.perPage ? this.manager.listener("no_less", void 0) : t < 0 && e > this.manager.threshold && this.manager.slength > this.manager.perPage && this.manager.listener("no_more", void 0), this.manager.slideToCurrent(!0, !0);
7377
7415
  }
7378
7416
  }
7379
- var Me = /* @__PURE__ */ ((r) => (r.auto = "auto", r.landscape = "landscape", r.portrait = "portrait", r))(Me || {}), Ne = /* @__PURE__ */ ((r) => (r.auto = "auto", r.both = "both", r.none = "none", r.landscape = "landscape", r))(Ne || {});
7380
- class cr {
7417
+ 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 || {});
7418
+ class zr {
7381
7419
  // TODO getter
7382
7420
  constructor(t) {
7383
7421
  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`);
@@ -7395,7 +7433,7 @@ class cr {
7395
7433
  "center"
7396
7434
  ) : (
7397
7435
  // Center it
7398
- ((this.shift ? 0 : 1) + n - this.nLandscape) % 2 ? t.metadata.readingProgression === N.rtl ? "right" : "left" : t.metadata.readingProgression === N.rtl ? "left" : "right"
7436
+ ((this.shift ? 0 : 1) + n - this.nLandscape) % 2 ? t.metadata.readingProgression === M.rtl ? "right" : "left" : t.metadata.readingProgression === M.rtl ? "left" : "right"
7399
7437
  )
7400
7438
  })), (s || i.properties?.otherProperties.addBlank) && this.nLandscape++;
7401
7439
  }), e && (this.spreads = []), this.buildSpreads(t.readingOrder);
@@ -7406,13 +7444,13 @@ class cr {
7406
7444
  if (i.length > 1)
7407
7445
  return;
7408
7446
  const s = i[0], o = s.properties?.otherProperties.orientation;
7409
- 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;
7447
+ 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;
7410
7448
  }), this.shift || this.index(t, !0);
7411
7449
  }
7412
7450
  buildSpreads(t) {
7413
7451
  let e = [];
7414
7452
  t.items.forEach((i, n) => {
7415
- !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);
7453
+ !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);
7416
7454
  }), e.length > 0 && this.spreads.push(e);
7417
7455
  }
7418
7456
  currentSpread(t, e) {
@@ -7422,14 +7460,14 @@ class cr {
7422
7460
  return this.spreads.find((e) => e.includes(t)) || void 0;
7423
7461
  }
7424
7462
  }
7425
- const Wi = 8, Ui = 5, dr = 300, ur = 15e3, pr = 250, fr = 150, mr = 500;
7426
- class gr {
7463
+ const Ui = 8, Hi = 5, Dr = 300, Wr = 15e3, Ur = 250, Hr = 150, Br = 500;
7464
+ class Vr {
7427
7465
  constructor(t, e, i, n, s, o) {
7428
- 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 || Ne.auto, this.pub.metadata.effectiveReadingProgression !== N.rtl && this.pub.metadata.effectiveReadingProgression !== N.ltr)
7466
+ 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)
7429
7467
  throw Error("Unsupported reading progression for EPUB");
7430
- this.spreader = new cr(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 hr(this), this.pub.readingOrder.items.forEach((a) => {
7431
- const l = new sr(this.peripherals, this.pub.metadata.effectiveReadingProgression, a.href, this.contentProtectionConfig, this.keyboardPeripheralsConfig);
7432
- this.spineElement.appendChild(l.element), this.pool.set(a.href, l), l.width = 100 / this.length * (a.properties?.otherProperties.orientation === Me.landscape || a.properties?.otherProperties.addBlank ? this.perPage : 1), l.height = this.height;
7468
+ this.spreader = new zr(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 Ir(this), this.pub.readingOrder.items.forEach((a) => {
7469
+ const l = new Ar(this.peripherals, this.pub.metadata.effectiveReadingProgression, a.href, this.contentProtectionConfig, this.keyboardPeripheralsConfig);
7470
+ 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;
7433
7471
  });
7434
7472
  }
7435
7473
  set listener(t) {
@@ -7449,11 +7487,11 @@ class gr {
7449
7487
  this.pool.forEach((i, n) => {
7450
7488
  let s = this.pub.readingOrder.items.findIndex((l) => l.href === n);
7451
7489
  const o = this.pub.readingOrder.items[s];
7452
- if (i.width = 100 / this.length * (o.properties?.otherProperties.orientation === Me.landscape || o.properties?.otherProperties.addBlank ? this.perPage : 1), i.height = this.height, !i.loaded) return;
7490
+ if (i.width = 100 / this.length * (o.properties?.otherProperties.orientation === Ne.landscape || o.properties?.otherProperties.addBlank ? this.perPage : 1), i.height = this.height, !i.loaded) return;
7453
7491
  const a = this.spreader.findByLink(o);
7454
7492
  i.update(this.spreadPosition(a, o));
7455
7493
  });
7456
- }, pr);
7494
+ }, Ur);
7457
7495
  }
7458
7496
  /**
7459
7497
  * It is important that these values be cached to avoid spamming them on redraws, they are expensive.
@@ -7462,7 +7500,7 @@ class gr {
7462
7500
  this.width = this.bookElement.clientWidth, this.height = this.bookElement.clientHeight;
7463
7501
  }
7464
7502
  get rtl() {
7465
- return this.pub.metadata.effectiveReadingProgression === N.rtl;
7503
+ return this.pub.metadata.effectiveReadingProgression === M.rtl;
7466
7504
  }
7467
7505
  get single() {
7468
7506
  return !this.spread || this.portrait;
@@ -7474,13 +7512,13 @@ class gr {
7474
7512
  return 50;
7475
7513
  }
7476
7514
  get portrait() {
7477
- return this.spreadPresentation === Ne.none ? !0 : (this.orientationInternal === -1 && (this.orientationInternal = this.containerHeightCached > this.container.clientWidth ? 1 : 0), this.orientationInternal === 1);
7515
+ return this.spreadPresentation === Me.none ? !0 : (this.orientationInternal === -1 && (this.orientationInternal = this.containerHeightCached > this.container.clientWidth ? 1 : 0), this.orientationInternal === 1);
7478
7516
  }
7479
7517
  updateSpineStyle(t, e = !0) {
7480
7518
  let i = "0";
7481
7519
  this.updateDimensions(), this.perPage > 1 && (i = `${this.width / 2}px`);
7482
7520
  const n = {
7483
- transition: t ? `all ${e ? fr : mr}ms ease-out` : "all 0ms ease-out",
7521
+ transition: t ? `all ${e ? Hr : Br}ms ease-out` : "all 0ms ease-out",
7484
7522
  marginRight: this.rtl ? i : "0",
7485
7523
  marginLeft: this.rtl ? "0" : i,
7486
7524
  width: `${this.width / this.perPage * this.length}px`,
@@ -7615,7 +7653,7 @@ class gr {
7615
7653
  return t % 2 && !this.single && t++, t;
7616
7654
  }
7617
7655
  spreadPosition(t, e) {
7618
- 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;
7656
+ 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;
7619
7657
  }
7620
7658
  async waitForItem(t) {
7621
7659
  if (this.inprogress.has(t) && await this.inprogress.get(t), this.delayedShow.has(t)) {
@@ -7640,7 +7678,7 @@ class gr {
7640
7678
  const a = new Promise(async (l, h) => {
7641
7679
  const c = [], u = [];
7642
7680
  this.positions.forEach((d, f) => {
7643
- (f > s + Wi || f < s - Wi) && (c.includes(d.href) || c.push(d.href)), f < s + Ui && f > s - Ui && (u.includes(d.href) || u.push(d.href));
7681
+ (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));
7644
7682
  }), c.forEach(async (d) => {
7645
7683
  u.includes(d) || this.pool.has(d) && (this.cancelShowing(d), await this.pool.get(d)?.unload());
7646
7684
  }), this.currentBaseURL !== void 0 && t.baseURL !== this.currentBaseURL && (this.blobs.forEach((d) => URL.revokeObjectURL(d)), this.blobs.clear()), this.currentBaseURL = t.baseURL;
@@ -7662,12 +7700,12 @@ class gr {
7662
7700
  let Y = !1;
7663
7701
  const lt = window.setTimeout(async () => {
7664
7702
  this.delayedTimeout.set(d, 0);
7665
- const ht = this.makeSpread(this.reAlign(f)), xn = this.spreadPosition(ht, w), Je = this.pool.get(d);
7666
- await Je.load(i, this.blobs.get(d)), this.peripherals.isScaled || await Je.show(xn), this.delayedShow.delete(d), Y = !0, P();
7667
- }, dr);
7703
+ const ht = this.makeSpread(this.reAlign(f)), xn = this.spreadPosition(ht, w), Ze = this.pool.get(d);
7704
+ await Ze.load(i, this.blobs.get(d)), this.peripherals.isScaled || await Ze.show(xn), this.delayedShow.delete(d), Y = !0, P();
7705
+ }, Dr);
7668
7706
  setTimeout(() => {
7669
7707
  !Y && this.delayedShow.has(d) && R(`Offscreen load timeout: ${d}`);
7670
- }, ur), this.delayedTimeout.set(d, lt);
7708
+ }, Wr), this.delayedTimeout.set(d, lt);
7671
7709
  }));
7672
7710
  }
7673
7711
  };
@@ -7743,9 +7781,9 @@ class gr {
7743
7781
  this.currentFrames?.forEach((t) => t?.deselect());
7744
7782
  }
7745
7783
  }
7746
- class zt {
7784
+ class Ft {
7747
7785
  constructor(t = {}) {
7748
- 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 = z(t.fontSize, Yt.range), this.fontSizeNormalize = E(t.fontSizeNormalize), this.fontOpticalSizing = E(t.fontOpticalSizing), this.fontWeight = z(t.fontWeight, st.range), this.fontWidth = z(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);
7786
+ 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);
7749
7787
  }
7750
7788
  static serialize(t) {
7751
7789
  const { ...e } = t;
@@ -7754,7 +7792,7 @@ class zt {
7754
7792
  static deserialize(t) {
7755
7793
  try {
7756
7794
  const e = JSON.parse(t);
7757
- return new zt(e);
7795
+ return new Ft(e);
7758
7796
  } catch (e) {
7759
7797
  return console.error("Failed to deserialize preferences:", e), null;
7760
7798
  }
@@ -7763,36 +7801,36 @@ class zt {
7763
7801
  const e = { ...this };
7764
7802
  for (const i of Object.keys(t))
7765
7803
  t[i] !== void 0 && (i !== "maximalLineLength" || t[i] === null || t[i] >= (t.optimalLineLength ?? e.optimalLineLength ?? 65)) && (i !== "minimalLineLength" || t[i] === null || t[i] <= (t.optimalLineLength ?? e.optimalLineLength ?? 65)) && (e[i] = t[i]);
7766
- return new zt(e);
7804
+ return new Ft(e);
7767
7805
  }
7768
7806
  }
7769
- class yr {
7807
+ class jr {
7770
7808
  constructor(t) {
7771
- 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 = z(t.fontSize, Yt.range) || 1, this.fontSizeNormalize = E(t.fontSizeNormalize) ?? !1, this.fontOpticalSizing = E(t.fontOpticalSizing) ?? null, this.fontWeight = z(t.fontWeight, st.range) || null, this.fontWidth = z(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 = ge(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 = ge(Ds(t.maximalLineLength, this.optimalLineLength), 80), this.minimalLineLength = ge(Is(t.minimalLineLength, this.optimalLineLength), 40), this.experiments = gn(t.experiments) || null;
7809
+ 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(cr(t.maximalLineLength, this.optimalLineLength), 80), this.minimalLineLength = ge(hr(t.minimalLineLength, this.optimalLineLength), 40), this.experiments = gn(t.experiments) || null;
7772
7810
  }
7773
7811
  }
7774
- const br = "#FFFFFF", wr = "#121212", vr = "#0000EE", Sr = "#551A8B", Pr = "#b4d8fe", Er = "inherit", pt = {
7775
- RS__backgroundColor: br,
7776
- RS__textColor: wr,
7777
- RS__linkColor: vr,
7778
- RS__visitedColor: Sr,
7779
- RS__selectionBackgroundColor: Pr,
7780
- RS__selectionTextColor: Er
7812
+ const $r = "#FFFFFF", Gr = "#121212", Xr = "#0000EE", Yr = "#551A8B", qr = "#b4d8fe", Kr = "inherit", pt = {
7813
+ backgroundColor: $r,
7814
+ textColor: Gr,
7815
+ linkColor: Xr,
7816
+ visitedColor: Yr,
7817
+ selectionBackgroundColor: qr,
7818
+ selectionTextColor: Kr
7781
7819
  };
7782
7820
  class Bi {
7783
7821
  constructor(t, e, i) {
7784
7822
  this.preferences = t, this.settings = e, this.metadata = i, this.layout = this.metadata?.effectiveLayout || b.reflowable;
7785
7823
  }
7786
7824
  clear() {
7787
- this.preferences = new zt({ optimalLineLength: 65 });
7825
+ this.preferences = new Ft({ optimalLineLength: 65 });
7788
7826
  }
7789
7827
  updatePreference(t, e) {
7790
7828
  this.preferences[t] = e;
7791
7829
  }
7792
7830
  get backgroundColor() {
7793
- return new M({
7831
+ return new N({
7794
7832
  initialValue: this.preferences.backgroundColor,
7795
- effectiveValue: this.settings.backgroundColor || pt.RS__backgroundColor,
7833
+ effectiveValue: this.settings.backgroundColor || pt.backgroundColor,
7796
7834
  isEffective: this.preferences.backgroundColor !== null,
7797
7835
  onChange: (t) => {
7798
7836
  this.updatePreference("backgroundColor", t ?? null);
@@ -7810,7 +7848,7 @@ class Bi {
7810
7848
  });
7811
7849
  }
7812
7850
  get columnCount() {
7813
- return new M({
7851
+ return new N({
7814
7852
  initialValue: this.preferences.columnCount,
7815
7853
  effectiveValue: this.settings.columnCount || null,
7816
7854
  isEffective: this.layout !== b.fixed && !this.settings.scroll,
@@ -7820,7 +7858,7 @@ class Bi {
7820
7858
  });
7821
7859
  }
7822
7860
  get constraint() {
7823
- return new M({
7861
+ return new N({
7824
7862
  initialValue: this.preferences.constraint,
7825
7863
  effectiveValue: this.preferences.constraint || 0,
7826
7864
  isEffective: !0,
@@ -7852,7 +7890,7 @@ class Bi {
7852
7890
  });
7853
7891
  }
7854
7892
  get fontFamily() {
7855
- return new M({
7893
+ return new N({
7856
7894
  initialValue: this.preferences.fontFamily,
7857
7895
  effectiveValue: this.settings.fontFamily || null,
7858
7896
  isEffective: this.layout !== b.fixed,
@@ -7921,7 +7959,7 @@ class Bi {
7921
7959
  return new A({
7922
7960
  initialValue: this.preferences.hyphens,
7923
7961
  effectiveValue: this.settings.hyphens || !1,
7924
- isEffective: this.layout !== b.fixed && this.metadata?.effectiveReadingProgression === N.ltr && this.preferences.hyphens !== null,
7962
+ isEffective: this.layout !== b.fixed && this.metadata?.effectiveReadingProgression === M.ltr && this.preferences.hyphens !== null,
7925
7963
  onChange: (t) => {
7926
7964
  this.updatePreference("hyphens", t ?? null);
7927
7965
  }
@@ -8011,9 +8049,9 @@ class Bi {
8011
8049
  });
8012
8050
  }
8013
8051
  get linkColor() {
8014
- return new M({
8052
+ return new N({
8015
8053
  initialValue: this.preferences.linkColor,
8016
- effectiveValue: this.settings.linkColor || pt.RS__linkColor,
8054
+ effectiveValue: this.settings.linkColor || pt.linkColor,
8017
8055
  isEffective: this.layout !== b.fixed && this.preferences.linkColor !== null,
8018
8056
  onChange: (t) => {
8019
8057
  this.updatePreference("linkColor", t ?? null);
@@ -8067,7 +8105,7 @@ class Bi {
8067
8105
  });
8068
8106
  }
8069
8107
  get pageGutter() {
8070
- return new M({
8108
+ return new N({
8071
8109
  initialValue: this.preferences.pageGutter,
8072
8110
  effectiveValue: this.settings.pageGutter,
8073
8111
  isEffective: this.layout !== b.fixed && !this.settings.scroll,
@@ -8111,7 +8149,7 @@ class Bi {
8111
8149
  });
8112
8150
  }
8113
8151
  get scrollPaddingTop() {
8114
- return new M({
8152
+ return new N({
8115
8153
  initialValue: this.preferences.scrollPaddingTop,
8116
8154
  effectiveValue: this.settings.scrollPaddingTop || 0,
8117
8155
  isEffective: this.layout !== b.fixed && !!this.settings.scroll && this.preferences.scrollPaddingTop !== null,
@@ -8121,7 +8159,7 @@ class Bi {
8121
8159
  });
8122
8160
  }
8123
8161
  get scrollPaddingBottom() {
8124
- return new M({
8162
+ return new N({
8125
8163
  initialValue: this.preferences.scrollPaddingBottom,
8126
8164
  effectiveValue: this.settings.scrollPaddingBottom || 0,
8127
8165
  isEffective: this.layout !== b.fixed && !!this.settings.scroll && this.preferences.scrollPaddingBottom !== null,
@@ -8131,7 +8169,7 @@ class Bi {
8131
8169
  });
8132
8170
  }
8133
8171
  get scrollPaddingLeft() {
8134
- return new M({
8172
+ return new N({
8135
8173
  initialValue: this.preferences.scrollPaddingLeft,
8136
8174
  effectiveValue: this.settings.scrollPaddingLeft || 0,
8137
8175
  isEffective: this.layout !== b.fixed && !!this.settings.scroll && this.preferences.scrollPaddingLeft !== null,
@@ -8141,7 +8179,7 @@ class Bi {
8141
8179
  });
8142
8180
  }
8143
8181
  get scrollPaddingRight() {
8144
- return new M({
8182
+ return new N({
8145
8183
  initialValue: this.preferences.scrollPaddingRight,
8146
8184
  effectiveValue: this.settings.scrollPaddingRight || 0,
8147
8185
  isEffective: this.layout !== b.fixed && !!this.settings.scroll && this.preferences.scrollPaddingRight !== null,
@@ -8151,9 +8189,9 @@ class Bi {
8151
8189
  });
8152
8190
  }
8153
8191
  get selectionBackgroundColor() {
8154
- return new M({
8192
+ return new N({
8155
8193
  initialValue: this.preferences.selectionBackgroundColor,
8156
- effectiveValue: this.settings.selectionBackgroundColor || pt.RS__selectionBackgroundColor,
8194
+ effectiveValue: this.settings.selectionBackgroundColor || pt.selectionBackgroundColor,
8157
8195
  isEffective: this.layout !== b.fixed && this.preferences.selectionBackgroundColor !== null,
8158
8196
  onChange: (t) => {
8159
8197
  this.updatePreference("selectionBackgroundColor", t ?? null);
@@ -8161,9 +8199,9 @@ class Bi {
8161
8199
  });
8162
8200
  }
8163
8201
  get selectionTextColor() {
8164
- return new M({
8202
+ return new N({
8165
8203
  initialValue: this.preferences.selectionTextColor,
8166
- effectiveValue: this.settings.selectionTextColor || pt.RS__selectionTextColor,
8204
+ effectiveValue: this.settings.selectionTextColor || pt.selectionTextColor,
8167
8205
  isEffective: this.layout !== b.fixed && this.preferences.selectionTextColor !== null,
8168
8206
  onChange: (t) => {
8169
8207
  this.updatePreference("selectionTextColor", t ?? null);
@@ -8182,9 +8220,9 @@ class Bi {
8182
8220
  });
8183
8221
  }
8184
8222
  get textColor() {
8185
- return new M({
8223
+ return new N({
8186
8224
  initialValue: this.preferences.textColor,
8187
- effectiveValue: this.settings.textColor || pt.RS__textColor,
8225
+ effectiveValue: this.settings.textColor || pt.textColor,
8188
8226
  isEffective: this.layout !== b.fixed && this.preferences.textColor !== null,
8189
8227
  onChange: (t) => {
8190
8228
  this.updatePreference("textColor", t ?? null);
@@ -8202,9 +8240,9 @@ class Bi {
8202
8240
  });
8203
8241
  }
8204
8242
  get visitedColor() {
8205
- return new M({
8243
+ return new N({
8206
8244
  initialValue: this.preferences.visitedColor,
8207
- effectiveValue: this.settings.visitedColor || pt.RS__visitedColor,
8245
+ effectiveValue: this.settings.visitedColor || pt.visitedColor,
8208
8246
  isEffective: this.layout !== b.fixed && this.preferences.visitedColor !== null,
8209
8247
  onChange: (t) => {
8210
8248
  this.updatePreference("visitedColor", t ?? null);
@@ -8224,7 +8262,7 @@ class Bi {
8224
8262
  });
8225
8263
  }
8226
8264
  }
8227
- class Hi {
8265
+ class Vi {
8228
8266
  constructor(t, e) {
8229
8267
  this.backgroundColor = t.backgroundColor || e.backgroundColor || null, this.blendFilter = typeof t.blendFilter == "boolean" ? t.blendFilter : e.blendFilter ?? null, this.columnCount = t.columnCount !== void 0 ? t.columnCount : e.columnCount !== void 0 ? e.columnCount : null, this.constraint = t.constraint || e.constraint, this.darkenFilter = typeof t.darkenFilter == "boolean" ? t.darkenFilter : e.darkenFilter ?? null, this.deprecatedFontSize = typeof t.deprecatedFontSize == "boolean" ? t.deprecatedFontSize : e.deprecatedFontSize ?? null, this.fontFamily = t.fontFamily || e.fontFamily || null, this.fontSize = t.fontSize !== void 0 ? t.fontSize : e.fontSize !== void 0 ? e.fontSize : null, this.fontSizeNormalize = typeof t.fontSizeNormalize == "boolean" ? t.fontSizeNormalize : e.fontSizeNormalize ?? null, this.fontOpticalSizing = typeof t.fontOpticalSizing == "boolean" ? t.fontOpticalSizing : e.fontOpticalSizing ?? null, this.fontWeight = t.fontWeight !== void 0 ? t.fontWeight : e.fontWeight !== void 0 ? e.fontWeight : null, this.fontWidth = t.fontWidth !== void 0 ? t.fontWidth : e.fontWidth !== void 0 ? e.fontWidth : null, this.hyphens = typeof t.hyphens == "boolean" ? t.hyphens : e.hyphens ?? null, this.invertFilter = typeof t.invertFilter == "boolean" ? t.invertFilter : e.invertFilter ?? null, this.invertGaijiFilter = typeof t.invertGaijiFilter == "boolean" ? t.invertGaijiFilter : e.invertGaijiFilter ?? null, this.iOSPatch = this.deprecatedFontSize || t.iOSPatch === !1 ? !1 : t.iOSPatch === !0 ? (T.OS.iOS || T.OS.iPadOS) && T.iOSRequest === "mobile" : e.iOSPatch, this.iPadOSPatch = this.deprecatedFontSize || t.iPadOSPatch === !1 ? !1 : t.iPadOSPatch === !0 ? T.OS.iPadOS && T.iOSRequest === "desktop" : e.iPadOSPatch, this.letterSpacing = t.letterSpacing !== void 0 ? t.letterSpacing : e.letterSpacing !== void 0 ? e.letterSpacing : null, this.ligatures = typeof t.ligatures == "boolean" ? t.ligatures : e.ligatures ?? null, this.lineHeight = t.lineHeight !== void 0 ? t.lineHeight : e.lineHeight !== void 0 ? e.lineHeight : null, this.linkColor = t.linkColor || e.linkColor || null, this.maximalLineLength = t.maximalLineLength === null ? null : t.maximalLineLength || e.maximalLineLength || null, this.minimalLineLength = t.minimalLineLength === null ? null : t.minimalLineLength || e.minimalLineLength || null, this.noRuby = typeof t.noRuby == "boolean" ? t.noRuby : e.noRuby ?? null, this.optimalLineLength = t.optimalLineLength || e.optimalLineLength, this.pageGutter = t.pageGutter !== void 0 ? t.pageGutter : e.pageGutter !== void 0 ? e.pageGutter : null, this.paragraphIndent = t.paragraphIndent !== void 0 ? t.paragraphIndent : e.paragraphIndent !== void 0 ? e.paragraphIndent : null, this.paragraphSpacing = t.paragraphSpacing !== void 0 ? t.paragraphSpacing : e.paragraphSpacing !== void 0 ? e.paragraphSpacing : null, this.scroll = typeof t.scroll == "boolean" ? t.scroll : e.scroll ?? null, this.scrollPaddingTop = t.scrollPaddingTop !== void 0 ? t.scrollPaddingTop : e.scrollPaddingTop !== void 0 ? e.scrollPaddingTop : null, this.scrollPaddingBottom = t.scrollPaddingBottom !== void 0 ? t.scrollPaddingBottom : e.scrollPaddingBottom !== void 0 ? e.scrollPaddingBottom : null, this.scrollPaddingLeft = t.scrollPaddingLeft !== void 0 ? t.scrollPaddingLeft : e.scrollPaddingLeft !== void 0 ? e.scrollPaddingLeft : null, this.scrollPaddingRight = t.scrollPaddingRight !== void 0 ? t.scrollPaddingRight : e.scrollPaddingRight !== void 0 ? e.scrollPaddingRight : null, this.selectionBackgroundColor = t.selectionBackgroundColor || e.selectionBackgroundColor || null, this.selectionTextColor = t.selectionTextColor || e.selectionTextColor || null, this.textAlign = t.textAlign || e.textAlign || null, this.textColor = t.textColor || e.textColor || null, this.textNormalization = typeof t.textNormalization == "boolean" ? t.textNormalization : e.textNormalization ?? null, this.visitedColor = t.visitedColor || e.visitedColor || null, this.wordSpacing = t.wordSpacing !== void 0 ? t.wordSpacing : e.wordSpacing !== void 0 ? e.wordSpacing : null, this.experiments = e.experiments || null;
8230
8268
  }
@@ -8233,11 +8271,11 @@ function Lt(r) {
8233
8271
  const t = getComputedStyle(r), e = parseFloat(t.paddingLeft || "0"), i = parseFloat(t.paddingRight || "0");
8234
8272
  return r.clientWidth - e - i;
8235
8273
  }
8236
- function _r(r) {
8274
+ function Jr(r) {
8237
8275
  const t = getComputedStyle(r), e = parseFloat(t.paddingTop || "0"), i = parseFloat(t.paddingBottom || "0");
8238
8276
  return r.clientHeight - e - i;
8239
8277
  }
8240
- class Cn extends le {
8278
+ class _n extends le {
8241
8279
  constructor(t) {
8242
8280
  super(), this.a11yNormalize = t.a11yNormalize ?? null, this.backgroundColor = t.backgroundColor ?? null, this.blendFilter = t.blendFilter ?? null, this.bodyHyphens = t.bodyHyphens ?? null, this.colCount = t.colCount ?? null, this.darkenFilter = t.darkenFilter ?? null, this.deprecatedFontSize = t.deprecatedFontSize ?? null, this.fontFamily = t.fontFamily ?? null, this.fontOpticalSizing = t.fontOpticalSizing ?? null, this.fontSize = t.fontSize ?? null, this.fontSizeNormalize = t.fontSizeNormalize ?? null, this.fontWeight = t.fontWeight ?? null, this.fontWidth = t.fontWidth ?? null, this.invertFilter = t.invertFilter ?? null, this.invertGaijiFilter = t.invertGaijiFilter ?? null, this.iOSPatch = t.iOSPatch ?? null, this.iPadOSPatch = t.iPadOSPatch ?? null, this.letterSpacing = t.letterSpacing ?? null, this.ligatures = t.ligatures ?? null, this.lineHeight = t.lineHeight ?? null, this.lineLength = t.lineLength ?? null, this.linkColor = t.linkColor ?? null, this.noRuby = t.noRuby ?? null, this.paraIndent = t.paraIndent ?? null, this.paraSpacing = t.paraSpacing ?? null, this.selectionBackgroundColor = t.selectionBackgroundColor ?? null, this.selectionTextColor = t.selectionTextColor ?? null, this.textAlign = t.textAlign ?? null, this.textColor = t.textColor ?? null, this.view = t.view ?? null, this.visitedColor = t.visitedColor ?? null, this.wordSpacing = t.wordSpacing ?? null;
8243
8281
  }
@@ -8246,18 +8284,18 @@ class Cn extends le {
8246
8284
  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;
8247
8285
  }
8248
8286
  }
8249
- class Cr extends le {
8287
+ class Zr extends le {
8250
8288
  constructor(t) {
8251
8289
  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;
8252
8290
  }
8253
8291
  toCSSProperties() {
8254
8292
  const t = {};
8255
8293
  return this.backgroundColor && (t["--RS__backgroundColor"] = this.backgroundColor), this.baseFontFamily && (t["--RS__baseFontFamily"] = this.baseFontFamily), this.baseFontSize != null && (t["--RS__baseFontSize"] = this.toRem(this.baseFontSize)), this.baseLineHeight != null && (t["--RS__baseLineHeight"] = this.toUnitless(this.baseLineHeight)), this.boxSizingMedia && (t["--RS__boxSizingMedia"] = this.boxSizingMedia), this.boxSizingTable && (t["--RS__boxSizingTable"] = this.boxSizingTable), this.colWidth != null && (t["--RS__colWidth"] = this.colWidth), this.colCount != null && (t["--RS__colCount"] = this.toUnitless(this.colCount)), this.colGap != null && (t["--RS__colGap"] = this.toPx(this.colGap)), this.codeFontFamily && (t["--RS__codeFontFamily"] = this.codeFontFamily), this.compFontFamily && (t["--RS__compFontFamily"] = this.compFontFamily), this.defaultLineLength != null && (t["--RS__defaultLineLength"] = this.toPx(this.defaultLineLength)), this.flowSpacing != null && (t["--RS__flowSpacing"] = this.toRem(this.flowSpacing)), this.humanistTf && (t["--RS__humanistTf"] = this.humanistTf), this.linkColor && (t["--RS__linkColor"] = this.linkColor), this.maxMediaWidth && (t["--RS__maxMediaWidth"] = this.toVw(this.maxMediaWidth)), this.maxMediaHeight && (t["--RS__maxMediaHeight"] = this.toVh(this.maxMediaHeight)), this.modernTf && (t["--RS__modernTf"] = this.modernTf), this.monospaceTf && (t["--RS__monospaceTf"] = this.monospaceTf), this.noOverflow && (t["--RS__disableOverflow"] = this.toFlag("noOverflow")), this.noVerticalPagination && (t["--RS__disablePagination"] = this.toFlag("noVerticalPagination")), this.oldStyleTf && (t["--RS__oldStyleTf"] = this.oldStyleTf), this.pageGutter != null && (t["--RS__pageGutter"] = this.toPx(this.pageGutter)), this.paraIndent != null && (t["--RS__paraIndent"] = this.toRem(this.paraIndent)), this.paraSpacing != null && (t["--RS__paraSpacing"] = this.toRem(this.paraSpacing)), this.primaryColor && (t["--RS__primaryColor"] = this.primaryColor), this.sansSerifJa && (t["--RS__sans-serif-ja"] = this.sansSerifJa), this.sansSerifJaV && (t["--RS__sans-serif-ja-v"] = this.sansSerifJaV), this.sansTf && (t["--RS__sansTf"] = this.sansTf), this.scrollPaddingBottom != null && (t["--RS__scrollPaddingBottom"] = this.toPx(this.scrollPaddingBottom)), this.scrollPaddingLeft != null && (t["--RS__scrollPaddingLeft"] = this.toPx(this.scrollPaddingLeft)), this.scrollPaddingRight != null && (t["--RS__scrollPaddingRight"] = this.toPx(this.scrollPaddingRight)), this.scrollPaddingTop != null && (t["--RS__scrollPaddingTop"] = this.toPx(this.scrollPaddingTop)), this.secondaryColor && (t["--RS__secondaryColor"] = this.secondaryColor), this.selectionBackgroundColor && (t["--RS__selectionBackgroundColor"] = this.selectionBackgroundColor), this.selectionTextColor && (t["--RS__selectionTextColor"] = this.selectionTextColor), this.serifJa && (t["--RS__serif-ja"] = this.serifJa), this.serifJaV && (t["--RS__serif-ja-v"] = this.serifJaV), this.textColor && (t["--RS__textColor"] = this.textColor), this.typeScale && (t["--RS__typeScale"] = this.toUnitless(this.typeScale)), this.visitedColor && (t["--RS__visitedColor"] = this.visitedColor), this.experiments && this.experiments.forEach((e) => {
8256
- t["--RS__" + e] = $e[e].value;
8294
+ t["--RS__" + e] = Ge[e].value;
8257
8295
  }), t;
8258
8296
  }
8259
8297
  }
8260
- class Lr {
8298
+ class Qr {
8261
8299
  constructor(t) {
8262
8300
  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);
8263
8301
  }
@@ -8307,7 +8345,7 @@ class Lr {
8307
8345
  visitedColor: t.visitedColor,
8308
8346
  wordSpacing: t.wordSpacing
8309
8347
  };
8310
- this.userProperties = new Cn(i);
8348
+ this.userProperties = new _n(i);
8311
8349
  }
8312
8350
  updateLayout(t, e, i, n) {
8313
8351
  return this.isCJKVertical ? this.computeCJKVerticalLength(t, e) : i ?? this.userProperties.view === "scroll" ? this.computeScrollLength(t, e) : this.paginate(t, e, n);
@@ -8371,7 +8409,7 @@ class Lr {
8371
8409
  };
8372
8410
  }
8373
8411
  computeCJKVerticalLength(t, e) {
8374
- const i = Math.round(Lt(this.containerParent) - this.constraint), n = Math.round(_r(this.containerParent)), s = this.getCompensatedMetrics(t, e), o = s.maximal !== null ? Math.min(Math.round(s.maximal * s.zoomCompensation), n) : n;
8412
+ const i = Math.round(Lt(this.containerParent) - this.constraint), n = Math.round(Jr(this.containerParent)), s = this.getCompensatedMetrics(t, e), o = s.maximal !== null ? Math.min(Math.round(s.maximal * s.zoomCompensation), n) : n;
8375
8413
  return { colCount: void 0, effectiveContainerWidth: i, effectiveLineLength: o };
8376
8414
  }
8377
8415
  // This behaves as paginate where colCount = 1
@@ -8398,7 +8436,7 @@ class Lr {
8398
8436
  this.userProperties.colCount = t.colCount, this.userProperties.lineLength = t.effectiveLineLength, this.effectiveContainerWidth = t.effectiveContainerWidth, this.container.style.width = `${this.effectiveContainerWidth}px`;
8399
8437
  }
8400
8438
  }
8401
- const xr = `// Note: we aren't blocking some of the events right now to try and be as nonintrusive as possible.
8439
+ const to = `// Note: we aren't blocking some of the events right now to try and be as nonintrusive as possible.
8402
8440
  // For a more comprehensive implementation, see https://github.com/hackademix/noscript/blob/3a83c0e4a506f175e38b0342dad50cdca3eae836/src/content/syncFetchPolicy.js#L142
8403
8441
  // The snippet of code at the beginning of this source is an attempt at defence against JS using persistent storage
8404
8442
  (function() {
@@ -8464,21 +8502,21 @@ const xr = `// Note: we aren't blocking some of the events right now to try and
8464
8502
  window.addEventListener("load", window._readium_eventBlocker, true);
8465
8503
  })();
8466
8504
  `;
8467
- async function kr(r, t) {
8505
+ async function eo(r, t) {
8468
8506
  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 = [
8469
8507
  // CSS Selector Generator - always injected
8470
8508
  {
8471
8509
  id: "css-selector-generator",
8472
8510
  as: "script",
8473
8511
  target: "head",
8474
- blob: new Blob([vt(Sn)], { type: "text/javascript" })
8512
+ blob: new Blob([St(vn)], { type: "text/javascript" })
8475
8513
  },
8476
8514
  // Execution Prevention - conditional (has executable scripts)
8477
8515
  {
8478
8516
  id: "execution-prevention",
8479
8517
  as: "script",
8480
8518
  target: "head",
8481
- blob: new Blob([vt(xr)], { type: "text/javascript" }),
8519
+ blob: new Blob([St(to)], { type: "text/javascript" }),
8482
8520
  condition: (a) => !!(a.querySelector("script") || a.querySelector("body[onload]:not(body[onload=''])"))
8483
8521
  }
8484
8522
  ], o = [
@@ -8487,7 +8525,7 @@ async function kr(r, t) {
8487
8525
  id: "onload-proxy",
8488
8526
  as: "script",
8489
8527
  target: "head",
8490
- blob: new Blob([vt(Pn)], { type: "text/javascript" }),
8528
+ blob: new Blob([St(Pn)], { type: "text/javascript" }),
8491
8529
  condition: (a) => !!(a.querySelector("script") || a.querySelector("body[onload]:not(body[onload=''])"))
8492
8530
  }
8493
8531
  ];
@@ -8497,18 +8535,18 @@ async function kr(r, t) {
8497
8535
  switch (a) {
8498
8536
  case "rtl": {
8499
8537
  const [u, p, g] = await Promise.all([
8500
- import("./ReadiumCSS-before-D5x0zuZP.js"),
8501
- import("./ReadiumCSS-default-C_BHdXWz.js"),
8502
- import("./ReadiumCSS-after-CPAYSG9F.js")
8538
+ import("./ReadiumCSS-before-CvMFpmud.js"),
8539
+ import("./ReadiumCSS-default-CL_hP__L.js"),
8540
+ import("./ReadiumCSS-after-Dzd22Ssm.js")
8503
8541
  ]);
8504
8542
  l = u.default, h = p.default, c = g.default;
8505
8543
  break;
8506
8544
  }
8507
8545
  case "cjk-horizontal": {
8508
8546
  const [u, p, g] = await Promise.all([
8509
- import("./ReadiumCSS-before-DtkzLMzT.js"),
8510
- import("./ReadiumCSS-default-BTgk8NbH.js"),
8511
- import("./ReadiumCSS-after-CVNJvQab.js")
8547
+ import("./ReadiumCSS-before-6kD9Qj82.js"),
8548
+ import("./ReadiumCSS-default-nJgSC4Z_.js"),
8549
+ import("./ReadiumCSS-after-C8SjJ_Rf.js")
8512
8550
  ]);
8513
8551
  l = u.default, h = p.default, c = g.default;
8514
8552
  break;
@@ -8519,18 +8557,18 @@ async function kr(r, t) {
8519
8557
  // same stylesheet set per the Readium CSS spec.
8520
8558
  case "mongolian-vertical": {
8521
8559
  const [u, p, g] = await Promise.all([
8522
- import("./ReadiumCSS-before-DXNoxSjL.js"),
8523
- import("./ReadiumCSS-default-BMLfH2r9.js"),
8524
- import("./ReadiumCSS-after-DBPN8It0.js")
8560
+ import("./ReadiumCSS-before-usMdEglk.js"),
8561
+ import("./ReadiumCSS-default-BVp3Ygi2.js"),
8562
+ import("./ReadiumCSS-after-BYNAMW5u.js")
8525
8563
  ]);
8526
8564
  l = u.default, h = p.default, c = g.default;
8527
8565
  break;
8528
8566
  }
8529
8567
  default: {
8530
8568
  const [u, p, g] = await Promise.all([
8531
- import("./ReadiumCSS-before-CA1r4W7i.js"),
8532
- import("./ReadiumCSS-default-C7kHIm6s.js"),
8533
- import("./ReadiumCSS-after-Cpw6SSeZ.js")
8569
+ import("./ReadiumCSS-before-crwPhKrV.js"),
8570
+ import("./ReadiumCSS-default-vv7hNCaM.js"),
8571
+ import("./ReadiumCSS-after-b-ykC0_O.js")
8534
8572
  ]);
8535
8573
  l = u.default, h = p.default, c = g.default;
8536
8574
  break;
@@ -8540,7 +8578,7 @@ async function kr(r, t) {
8540
8578
  id: "readium-css-before",
8541
8579
  as: "link",
8542
8580
  target: "head",
8543
- blob: new Blob([Ct(l)], { type: "text/css" }),
8581
+ blob: new Blob([_t(l)], { type: "text/css" }),
8544
8582
  rel: "stylesheet"
8545
8583
  }), o.unshift(
8546
8584
  // Readium CSS Default - only for reflowable AND no existing styles
@@ -8548,7 +8586,7 @@ async function kr(r, t) {
8548
8586
  id: "readium-css-default",
8549
8587
  as: "link",
8550
8588
  target: "head",
8551
- blob: new Blob([Ct(h)], { type: "text/css" }),
8589
+ blob: new Blob([_t(h)], { type: "text/css" }),
8552
8590
  rel: "stylesheet",
8553
8591
  condition: (u) => !(u.querySelector("link[rel='stylesheet']") || u.querySelector("style") || u.querySelector("[style]:not([style=''])"))
8554
8592
  },
@@ -8557,7 +8595,7 @@ async function kr(r, t) {
8557
8595
  id: "readium-css-after",
8558
8596
  as: "link",
8559
8597
  target: "head",
8560
- blob: new Blob([Ct(c)], { type: "text/css" }),
8598
+ blob: new Blob([_t(c)], { type: "text/css" }),
8561
8599
  rel: "stylesheet"
8562
8600
  }
8563
8601
  ), (a === "cjk-horizontal" || a === "cjk-vertical") && (r.description === "ebpaj-guide-1.0" || r.otherMetadata?.["ebpaj:guide-version"] !== void 0)) {
@@ -8566,7 +8604,7 @@ async function kr(r, t) {
8566
8604
  id: "readium-css-ebpaj",
8567
8605
  as: "link",
8568
8606
  target: "head",
8569
- blob: new Blob([Ct(p)], { type: "text/css" }),
8607
+ blob: new Blob([_t(p)], { type: "text/css" }),
8570
8608
  rel: "stylesheet"
8571
8609
  });
8572
8610
  }
@@ -8579,7 +8617,7 @@ async function kr(r, t) {
8579
8617
  }
8580
8618
  ];
8581
8619
  }
8582
- const Or = (r) => ({
8620
+ const io = (r) => ({
8583
8621
  frameLoaded: r.frameLoaded || (() => {
8584
8622
  }),
8585
8623
  positionChanged: r.positionChanged || (() => {
@@ -8604,17 +8642,17 @@ const Or = (r) => ({
8604
8642
  peripheral: r.peripheral || (() => {
8605
8643
  })
8606
8644
  });
8607
- class Ln extends cn {
8645
+ class Ln extends dn {
8608
8646
  constructor(t, e, i, n = [], s = void 0, o = { preferences: {}, defaults: {} }) {
8609
8647
  super(), this._preferencesEditor = null, this._injector = null, this._navigatorProtector = null, this._keyboardPeripheralsManager = null, this._suspiciousActivityListener = null, this._keyboardPeripheralListener = null, this.reflowViewport = {
8610
8648
  readingOrder: [],
8611
8649
  progressions: /* @__PURE__ */ new Map(),
8612
8650
  positions: null
8613
- }, this.pub = e, this.container = t, this.listeners = Or(i), this.currentLocation = s, n.length && (this.positions = n), this._preferences = new zt(o.preferences), this._defaults = new yr(o.defaults), this._settings = new Hi(this._preferences, this._defaults);
8651
+ }, this.pub = e, this.container = t, this.listeners = io(i), this.currentLocation = s, n.length && (this.positions = n), this._preferences = new Ft(o.preferences), this._defaults = new jr(o.defaults), this._settings = new Vi(this._preferences, this._defaults);
8614
8652
  const a = bt(e.metadata), l = a === "cjk-horizontal", h = a === "cjk-vertical", u = h || a === "mongolian-vertical", p = l || h;
8615
- this._css = new Lr({
8616
- rsProperties: new Cr({ noVerticalPagination: u || void 0 }),
8617
- userProperties: new Cn({}),
8653
+ this._css = new Qr({
8654
+ rsProperties: new Zr({ noVerticalPagination: u || void 0 }),
8655
+ userProperties: new _n({}),
8618
8656
  lineLengths: new kt({
8619
8657
  optimalChars: this._settings.optimalLineLength,
8620
8658
  minChars: this._settings.minimalLineLength,
@@ -8629,13 +8667,13 @@ class Ln extends cn {
8629
8667
  container: t,
8630
8668
  constraint: this._settings.constraint,
8631
8669
  isCJKVertical: u
8632
- }), this._layout = Ln.determineLayout(e, !!this._settings.scroll), this.currentProgression = e.metadata.effectiveReadingProgression, this._injectablesConfig = o.injectables || { rules: [], allowedDomains: [] }, this._readiumRulesPromise = kr(e.metadata, e.readingOrder.items), this._contentProtection = o.contentProtection || {}, this._keyboardPeripherals = this.mergeKeyboardPeripherals(
8670
+ }), this._layout = Ln.determineLayout(e, !!this._settings.scroll), this.currentProgression = e.metadata.effectiveReadingProgression, this._injectablesConfig = o.injectables || { rules: [], allowedDomains: [] }, this._readiumRulesPromise = eo(e.metadata, e.readingOrder.items), this._contentProtection = o.contentProtection || {}, this._keyboardPeripherals = this.mergeKeyboardPeripherals(
8633
8671
  this._contentProtection,
8634
8672
  o.keyboardPeripherals || []
8635
- ), (this._contentProtection.disableContextMenu || this._contentProtection.checkAutomation || this._contentProtection.checkIFrameEmbedding || this._contentProtection.monitorDevTools || this._contentProtection.protectPrinting?.disable) && (this._navigatorProtector = new Ge(this._contentProtection), this._suspiciousActivityListener = (g) => {
8673
+ ), (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) => {
8636
8674
  const { type: d, ...f } = g.detail;
8637
8675
  d === "context_menu" ? this.listeners.contextMenu(f) : this.listeners.contentProtection(d, f);
8638
- }, window.addEventListener(ot, this._suspiciousActivityListener)), this._keyboardPeripherals.length > 0 && (this._keyboardPeripheralsManager = new Ye({
8676
+ }, window.addEventListener(ot, this._suspiciousActivityListener)), this._keyboardPeripherals.length > 0 && (this._keyboardPeripheralsManager = new qe({
8639
8677
  keyboardPeripherals: this._keyboardPeripherals
8640
8678
  }), this._keyboardPeripheralListener = (g) => {
8641
8679
  const d = g.detail;
@@ -8644,7 +8682,7 @@ class Ln extends cn {
8644
8682
  }
8645
8683
  static determineLayout(t, e) {
8646
8684
  const i = t.metadata.effectiveLayout;
8647
- if (i === b.fixed || t.metadata.otherMetadata && "http://openmangaformat.org/schema/1.0#version" in t.metadata.otherMetadata || t.metadata?.conformsTo?.includes(Yi.DIVINA))
8685
+ if (i === b.fixed || t.metadata.otherMetadata && "http://openmangaformat.org/schema/1.0#version" in t.metadata.otherMetadata || t.metadata?.conformsTo?.includes(qi.DIVINA))
8648
8686
  return b.fixed;
8649
8687
  if (i === b.scrolled)
8650
8688
  return b.scrolled;
@@ -8654,13 +8692,13 @@ class Ln extends cn {
8654
8692
  async load() {
8655
8693
  if (this.positions?.length || (this.positions = await this.pub.positionsFromManifest()), !this._injector) {
8656
8694
  const t = await this._readiumRulesPromise;
8657
- this._injector = new vn({
8695
+ this._injector = new Sn({
8658
8696
  rules: [...t, ...this._injectablesConfig.rules],
8659
8697
  allowedDomains: this._injectablesConfig.allowedDomains
8660
8698
  });
8661
8699
  }
8662
8700
  if (this._layout === b.fixed)
8663
- this.framePool = new gr(
8701
+ this.framePool = new Vr(
8664
8702
  this.container,
8665
8703
  this.positions,
8666
8704
  this.pub,
@@ -8673,7 +8711,7 @@ class Ln extends cn {
8673
8711
  else {
8674
8712
  await this.updateCSS(!1);
8675
8713
  const t = this.compileCSSProperties(this._css);
8676
- this.framePool = new nr(
8714
+ this.framePool = new Rr(
8677
8715
  this.container,
8678
8716
  this.positions,
8679
8717
  t,
@@ -8700,7 +8738,7 @@ class Ln extends cn {
8700
8738
  }
8701
8739
  async applyPreferences() {
8702
8740
  const t = this._settings;
8703
- this._settings = new Hi(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);
8741
+ 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);
8704
8742
  }
8705
8743
  // TODO: fit, etc.
8706
8744
  handleFXLPrefs(t, e) {
@@ -8743,7 +8781,7 @@ class Ln extends cn {
8743
8781
  * TODO remove when settings management is incorporated
8744
8782
  */
8745
8783
  get _cframes() {
8746
- return (this.framePool?.currentFrames ?? []).filter((t) => !(t instanceof _n && t.isDestroyed));
8784
+ return (this.framePool?.currentFrames ?? []).filter((t) => !(t instanceof Cn && t.isDestroyed));
8747
8785
  }
8748
8786
  /**
8749
8787
  * Exposed to the public to compensate for lack of implemented readium conveniences
@@ -8798,7 +8836,7 @@ class Ln extends cn {
8798
8836
  else
8799
8837
  try {
8800
8838
  this.goLink(new $({
8801
- href: Gt.join(Gt.dirname(this.currentLocation.href), h)
8839
+ href: Xt.join(Xt.dirname(this.currentLocation.href), h)
8802
8840
  }), !1, () => {
8803
8841
  });
8804
8842
  } catch (c) {
@@ -8808,9 +8846,9 @@ class Ln extends cn {
8808
8846
  }
8809
8847
  } else console.log("Clicked on", l);
8810
8848
  } else {
8811
- if (this._layout === b.fixed && this.framePool.doNotDisturb && (n.doNotDisturb = !0), this._layout === b.fixed && (this.currentProgression === N.rtl || this.currentProgression === N.ltr) && this.framePool.currentFrames.length > 1) {
8849
+ 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) {
8812
8850
  const c = this.framePool.currentFrames;
8813
- n.targetFrameSrc === c[this.currentProgression === N.rtl ? 0 : 1]?.source && (n.x += (c[this.currentProgression === N.rtl ? 1 : 0]?.iframe.contentWindow?.innerWidth ?? 0) * window.devicePixelRatio);
8851
+ 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);
8814
8852
  }
8815
8853
  if (t === "click" ? this.listeners.click(n) : this.listeners.tap(n)) break;
8816
8854
  const h = (this._cframes.length === 2 ? this._cframes[0].window.innerWidth + this._cframes[1].window.innerWidth : this._cframes[0].window.innerWidth) * window.devicePixelRatio / 4;
@@ -9063,7 +9101,7 @@ class Ln extends cn {
9063
9101
  return this.go(t.locator, e, i);
9064
9102
  }
9065
9103
  }
9066
- const Rr = `// PreservePitchProcessor.js
9104
+ const no = `// PreservePitchProcessor.js
9067
9105
  // AudioWorklet processor for pitch preservation via pitch shifting.
9068
9106
  //
9069
9107
  // Architecture:
@@ -9278,17 +9316,17 @@ class PreservePitchProcessor extends AudioWorkletProcessor {
9278
9316
 
9279
9317
  registerProcessor('preserve-pitch-processor', PreservePitchProcessor);
9280
9318
  `;
9281
- class qe {
9319
+ class Ke {
9282
9320
  constructor(t) {
9283
9321
  this.workletNode = null, this.url = null, this.ctx = t;
9284
9322
  }
9285
9323
  static async createWorklet(t) {
9286
- const { ctx: e, pitchFactor: i, modulePath: n } = t, s = new qe(e);
9324
+ const { ctx: e, pitchFactor: i, modulePath: n } = t, s = new Ke(e);
9287
9325
  try {
9288
9326
  if (n)
9289
9327
  await e.audioWorklet.addModule(n);
9290
9328
  else {
9291
- const o = new Blob([Rr], { type: "text/javascript" });
9329
+ const o = new Blob([no], { type: "text/javascript" });
9292
9330
  s.url = URL.createObjectURL(o), await e.audioWorklet.addModule(s.url);
9293
9331
  }
9294
9332
  } catch (o) {
@@ -9308,7 +9346,7 @@ class qe {
9308
9346
  this.workletNode && (this.workletNode.disconnect(), this.workletNode = null), this.url && (URL.revokeObjectURL(this.url), this.url = null);
9309
9347
  }
9310
9348
  }
9311
- class Ar {
9349
+ class so {
9312
9350
  constructor(t) {
9313
9351
  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;
9314
9352
  }
@@ -9490,7 +9528,7 @@ class Ar {
9490
9528
  */
9491
9529
  setPlaybackRate(t, e) {
9492
9530
  this.mediaElement.playbackRate = t, e ? "preservesPitch" in this.mediaElement ? this.mediaElement.preservesPitch = !0 : this.activateWebAudio().then(() => {
9493
- this.worklet ? this.worklet.updatePitchFactor(1 / t) : qe.createWorklet({
9531
+ this.worklet ? this.worklet.updatePitchFactor(1 / t) : Ke.createWorklet({
9494
9532
  ctx: this.getOrCreateAudioContext(),
9495
9533
  pitchFactor: 1
9496
9534
  }).then((i) => {
@@ -9576,7 +9614,7 @@ class Ar {
9576
9614
  }
9577
9615
  class ce {
9578
9616
  constructor(t = {}) {
9579
- this.volume = z(t.volume, ie.range), this.playbackRate = z(t.playbackRate, ne.range), this.preservePitch = E(t.preservePitch), this.skipBackwardInterval = z(t.skipBackwardInterval, it.range), this.skipForwardInterval = z(t.skipForwardInterval, it.range), this.pollInterval = v(t.pollInterval), this.autoPlay = E(t.autoPlay), this.enableMediaSession = E(t.enableMediaSession);
9617
+ 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);
9580
9618
  }
9581
9619
  merging(t) {
9582
9620
  const e = { ...this };
@@ -9585,17 +9623,17 @@ class ce {
9585
9623
  return new ce(e);
9586
9624
  }
9587
9625
  }
9588
- class Tr {
9626
+ class ro {
9589
9627
  constructor(t = {}) {
9590
- this.volume = z(t.volume, ie.range) ?? 1, this.playbackRate = z(t.playbackRate, ne.range) ?? 1, this.preservePitch = E(t.preservePitch) ?? !0, this.skipBackwardInterval = z(t.skipBackwardInterval, it.range) ?? 10, this.skipForwardInterval = z(t.skipForwardInterval, it.range) ?? 10, this.pollInterval = v(t.pollInterval) ?? 1e3, this.autoPlay = E(t.autoPlay) ?? !0, this.enableMediaSession = E(t.enableMediaSession) ?? !0;
9628
+ 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;
9591
9629
  }
9592
9630
  }
9593
- class Vi {
9631
+ class ji {
9594
9632
  constructor(t, e) {
9595
9633
  this.volume = t.volume ?? e.volume, this.playbackRate = t.playbackRate ?? e.playbackRate, this.preservePitch = t.preservePitch ?? e.preservePitch, this.skipBackwardInterval = t.skipBackwardInterval ?? e.skipBackwardInterval, this.skipForwardInterval = t.skipForwardInterval ?? e.skipForwardInterval, this.pollInterval = t.pollInterval ?? e.pollInterval, this.autoPlay = t.autoPlay ?? e.autoPlay, this.enableMediaSession = t.enableMediaSession ?? e.enableMediaSession;
9596
9634
  }
9597
9635
  }
9598
- class ji {
9636
+ class $i {
9599
9637
  constructor(t, e) {
9600
9638
  this.preferences = t, this.settings = e;
9601
9639
  }
@@ -9664,7 +9702,7 @@ class ji {
9664
9702
  });
9665
9703
  }
9666
9704
  get pollInterval() {
9667
- return new M({
9705
+ return new N({
9668
9706
  initialValue: this.preferences.pollInterval,
9669
9707
  effectiveValue: this.settings.pollInterval,
9670
9708
  isEffective: this.preferences.pollInterval !== null,
@@ -9694,8 +9732,8 @@ class ji {
9694
9732
  });
9695
9733
  }
9696
9734
  }
9697
- const $i = 1, Xi = 1;
9698
- class Mr {
9735
+ const Gi = 1, Xi = 1;
9736
+ class oo {
9699
9737
  constructor(t, e, i = {}) {
9700
9738
  this.pool = /* @__PURE__ */ new Map(), this._audioEngine = t, this._publication = e, this._supportedAudioTypes = this.detectSupportedAudioTypes(), i.disableRemotePlayback && (this._audioEngine.getMediaElement().disableRemotePlayback = !0);
9701
9739
  }
@@ -9747,7 +9785,7 @@ class Mr {
9747
9785
  for (let n = 0; n < e.length; n++) {
9748
9786
  if (n === t) continue;
9749
9787
  const s = this.pickPlayableHref(e[n]);
9750
- n >= t - Xi && n <= t + Xi ? (this.ensure(s), i.add(s)) : n >= t - $i && n <= t + $i && this.pool.has(s) && i.add(s);
9788
+ n >= t - Xi && n <= t + Xi ? (this.ensure(s), i.add(s)) : n >= t - Gi && n <= t + Gi && this.pool.has(s) && i.add(s);
9751
9789
  }
9752
9790
  for (const [n, s] of this.pool)
9753
9791
  i.has(n) || (s.removeAttribute("src"), s.load(), this.pool.delete(n));
@@ -9772,7 +9810,7 @@ class Mr {
9772
9810
  this.pool.clear();
9773
9811
  }
9774
9812
  }
9775
- class Nr {
9813
+ class ao {
9776
9814
  constructor(t = {}) {
9777
9815
  this.dragstartHandler = (e) => {
9778
9816
  e.preventDefault(), e.stopPropagation(), t.onDragDetected?.(Array.from(e.dataTransfer?.types ?? []));
@@ -9788,7 +9826,7 @@ class Nr {
9788
9826
  document.removeEventListener("dragstart", this.dragstartHandler, !0), document.removeEventListener("dragover", this.dragoverHandler, !0), document.removeEventListener("drop", this.dropHandler, !0), window.removeEventListener("unload", this.unloadHandler);
9789
9827
  }
9790
9828
  }
9791
- class zr {
9829
+ class lo {
9792
9830
  constructor(t = {}) {
9793
9831
  this.copyHandler = (e) => {
9794
9832
  e.preventDefault(), e.stopPropagation(), t.onCopyBlocked?.();
@@ -9798,16 +9836,16 @@ class zr {
9798
9836
  document.removeEventListener("copy", this.copyHandler, !0), window.removeEventListener("unload", this.unloadHandler);
9799
9837
  }
9800
9838
  }
9801
- class Ir extends Ge {
9839
+ class ho extends Ye {
9802
9840
  constructor(t = {}) {
9803
- super(t), t.disableDragAndDrop && (this.dragAndDropProtector = new Nr({
9841
+ super(t), t.disableDragAndDrop && (this.dragAndDropProtector = new ao({
9804
9842
  onDragDetected: (e) => {
9805
9843
  this.dispatchSuspiciousActivity("drag_detected", { dataTransferTypes: e, targetFrameSrc: "" });
9806
9844
  },
9807
9845
  onDropDetected: (e, i) => {
9808
9846
  this.dispatchSuspiciousActivity("drop_detected", { dataTransferTypes: e, fileCount: i, targetFrameSrc: "" });
9809
9847
  }
9810
- })), t.protectCopy && (this.copyProtector = new zr({
9848
+ })), t.protectCopy && (this.copyProtector = new lo({
9811
9849
  onCopyBlocked: () => {
9812
9850
  this.dispatchSuspiciousActivity("bulk_copy", { targetFrameSrc: "" });
9813
9851
  }
@@ -9817,7 +9855,7 @@ class Ir extends Ge {
9817
9855
  super.destroy(), this.dragAndDropProtector?.destroy(), this.copyProtector?.destroy();
9818
9856
  }
9819
9857
  }
9820
- const Dr = (r) => ({
9858
+ const co = (r) => ({
9821
9859
  trackLoaded: r.trackLoaded ?? (() => {
9822
9860
  }),
9823
9861
  positionChanged: r.positionChanged ?? (() => {
@@ -9849,12 +9887,12 @@ const Dr = (r) => ({
9849
9887
  remotePlaybackStateChanged: r.remotePlaybackStateChanged ?? (() => {
9850
9888
  })
9851
9889
  });
9852
- class Wr extends Ss {
9890
+ class mo extends vs {
9853
9891
  constructor(t, e, i, n = {
9854
9892
  preferences: {},
9855
9893
  defaults: {}
9856
9894
  }) {
9857
- 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 = Dr(e), this._preferences = new ce(n.preferences), this._defaults = new Tr(n.defaults), this._settings = new Vi(this._preferences, this._defaults), t.readingOrder.items.length === 0)
9895
+ 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 = co(e), this._preferences = new ce(n.preferences), this._defaults = new ro(n.defaults), this._settings = new ji(this._preferences, this._defaults), t.readingOrder.items.length === 0)
9858
9896
  throw new Error("AudioNavigator: publication has an empty reading order");
9859
9897
  if (i)
9860
9898
  this.currentLocation = this.ensureLocatorLocations(i);
@@ -9864,7 +9902,7 @@ class Wr extends Ss {
9864
9902
  href: u.href,
9865
9903
  type: u.type || "audio/mpeg",
9866
9904
  title: u.title,
9867
- locations: new _({
9905
+ locations: new C({
9868
9906
  position: 1,
9869
9907
  progression: 0,
9870
9908
  totalProgression: 0,
@@ -9875,7 +9913,7 @@ class Wr extends Ss {
9875
9913
  const s = this.currentLocation.href.split("#")[0], o = this.hrefToTrackIndex(s);
9876
9914
  if (o === -1)
9877
9915
  throw new Error(`AudioNavigator: initial href "${s}" not found in reading order`);
9878
- const a = this.currentLocation.locations?.time() || 0, l = new Ar({
9916
+ const a = this.currentLocation.locations?.time() || 0, l = new so({
9879
9917
  playback: {
9880
9918
  state: {
9881
9919
  currentTime: a,
@@ -9885,17 +9923,17 @@ class Wr extends Ss {
9885
9923
  index: o
9886
9924
  }
9887
9925
  });
9888
- this.pool = new Mr(l, t, n.contentProtection);
9926
+ this.pool = new oo(l, t, n.contentProtection);
9889
9927
  const h = n.contentProtection || {};
9890
9928
  this._contentProtection = h;
9891
9929
  const c = this.mergeKeyboardPeripherals(
9892
9930
  h,
9893
9931
  n.keyboardPeripherals || []
9894
9932
  );
9895
- (h.disableContextMenu || h.checkAutomation || h.checkIFrameEmbedding || h.monitorDevTools || h.protectPrinting?.disable || h.disableDragAndDrop || h.protectCopy) && (this._navigatorProtector = new Ir(h), this._suspiciousActivityListener = (u) => {
9933
+ (h.disableContextMenu || h.checkAutomation || h.checkIFrameEmbedding || h.monitorDevTools || h.protectPrinting?.disable || h.disableDragAndDrop || h.protectCopy) && (this._navigatorProtector = new ho(h), this._suspiciousActivityListener = (u) => {
9896
9934
  const { type: p, ...g } = u.detail;
9897
9935
  p === "context_menu" ? this.listeners.contextMenu(g) : this.listeners.contentProtection(p, g);
9898
- }, window.addEventListener(ot, this._suspiciousActivityListener)), c.length > 0 && (this._keyboardPeripheralsManager = new Ye({ keyboardPeripherals: c }), this._keyboardPeripheralListener = (u) => {
9936
+ }, window.addEventListener(ot, this._suspiciousActivityListener)), c.length > 0 && (this._keyboardPeripheralsManager = new qe({ keyboardPeripherals: c }), this._keyboardPeripheralListener = (u) => {
9899
9937
  this.listeners.peripheral(u.detail);
9900
9938
  }, window.addEventListener(at, this._keyboardPeripheralListener)), this.setupEventListeners(), this._isNavigating = !0, this.pool.setCurrentAudio(o, "forward"), this.applyPreferences(), this.waitForLoadedAndSeeked(a).then(() => {
9901
9939
  this._isNavigating = !1, this.listeners.trackLoaded(this.pool.audioEngine.getMediaElement()), this._notifyTimelineChange(this.currentLocator), this.listeners.positionChanged(this.currentLocator), this._setupRemotePlayback();
@@ -9907,13 +9945,13 @@ class Wr extends Ss {
9907
9945
  return this._settings;
9908
9946
  }
9909
9947
  get preferencesEditor() {
9910
- return this._preferencesEditor === null && (this._preferencesEditor = new ji(this._preferences, this.settings)), this._preferencesEditor;
9948
+ return this._preferencesEditor === null && (this._preferencesEditor = new $i(this._preferences, this.settings)), this._preferencesEditor;
9911
9949
  }
9912
9950
  async submitPreferences(t) {
9913
9951
  this._preferences = this._preferences.merging(t), this.applyPreferences();
9914
9952
  }
9915
9953
  applyPreferences() {
9916
- this._settings = new Vi(this._preferences, this._defaults), this._preferencesEditor !== null && (this._preferencesEditor = new ji(this._preferences, this.settings)), this.pool.audioEngine.setVolume(this._settings.volume), this.pool.audioEngine.setPlaybackRate(this._settings.playbackRate, this._settings.preservePitch), this.positionPollInterval !== null && this.startPositionPolling(), this._settings.enableMediaSession && !this._mediaSessionEnabled ? (this._mediaSessionEnabled = !0, this.setupMediaSession()) : !this._settings.enableMediaSession && this._mediaSessionEnabled && (this._mediaSessionEnabled = !1, this.destroyMediaSession());
9954
+ this._settings = new ji(this._preferences, this._defaults), this._preferencesEditor !== null && (this._preferencesEditor = new $i(this._preferences, this.settings)), this.pool.audioEngine.setVolume(this._settings.volume), this.pool.audioEngine.setPlaybackRate(this._settings.playbackRate, this._settings.preservePitch), this.positionPollInterval !== null && this.startPositionPolling(), this._settings.enableMediaSession && !this._mediaSessionEnabled ? (this._mediaSessionEnabled = !0, this.setupMediaSession()) : !this._settings.enableMediaSession && this._mediaSessionEnabled && (this._mediaSessionEnabled = !1, this.destroyMediaSession());
9917
9955
  }
9918
9956
  get publication() {
9919
9957
  return this.pub;
@@ -9928,7 +9966,7 @@ class Wr extends Ss {
9928
9966
  ensureLocatorLocations(t) {
9929
9967
  return new I({
9930
9968
  ...t,
9931
- locations: t.locations instanceof _ ? t.locations : t.locations ? new _(t.locations) : void 0
9969
+ locations: t.locations instanceof C ? t.locations : t.locations ? new C(t.locations) : void 0
9932
9970
  });
9933
9971
  }
9934
9972
  /** Resolves a bare href (no fragment) to its index in the reading order. Returns -1 if not found. */
@@ -9963,7 +10001,7 @@ class Wr extends Ss {
9963
10001
  href: i.href,
9964
10002
  type: i.type || "audio/mpeg",
9965
10003
  title: i.title,
9966
- locations: new _({
10004
+ locations: new C({
9967
10005
  progression: n > 0 ? e / n : 0,
9968
10006
  position: t + 1,
9969
10007
  fragments: [`t=${e}`]
@@ -10007,7 +10045,7 @@ class Wr extends Ss {
10007
10045
  this.pool.audioEngine.on("error", (t) => {
10008
10046
  this.listeners.error(t, this.currentLocator);
10009
10047
  }), this.pool.audioEngine.on("ended", async () => {
10010
- this.stopPositionPolling(), this.currentLocation = this.currentLocation.copyWithLocations(new _({
10048
+ this.stopPositionPolling(), this.currentLocation = this.currentLocation.copyWithLocations(new C({
10011
10049
  position: this.currentTrackIndex() + 1,
10012
10050
  progression: 1,
10013
10051
  fragments: [`t=${this.duration}`]
@@ -10022,7 +10060,7 @@ class Wr extends Ss {
10022
10060
  if (this._isNavigating) return;
10023
10061
  this.listeners.seeking(!1);
10024
10062
  const t = this.currentTime, e = this.duration, i = e > 0 ? t / e : 0;
10025
- this.currentLocation = this.currentLocation.copyWithLocations(new _({
10063
+ this.currentLocation = this.currentLocation.copyWithLocations(new C({
10026
10064
  position: this.currentTrackIndex() + 1,
10027
10065
  progression: i,
10028
10066
  fragments: [`t=${t}`]
@@ -10081,7 +10119,7 @@ class Wr extends Ss {
10081
10119
  startPositionPolling() {
10082
10120
  this.stopPositionPolling(), this.positionPollInterval = setInterval(() => {
10083
10121
  const t = this.currentTime, e = this.duration, i = e > 0 ? t / e : 0;
10084
- this.currentLocation = this.currentLocation.copyWithLocations(new _({
10122
+ this.currentLocation = this.currentLocation.copyWithLocations(new C({
10085
10123
  position: this.currentTrackIndex() + 1,
10086
10124
  progression: i,
10087
10125
  fragments: [`t=${t}`]
@@ -10209,70 +10247,71 @@ class Wr extends Ss {
10209
10247
  }
10210
10248
  }
10211
10249
  export {
10212
- Tr as AudioDefaults,
10213
- Wr as AudioNavigator,
10250
+ ro as AudioDefaults,
10251
+ mo as AudioNavigator,
10214
10252
  ce as AudioPreferences,
10215
- ji as AudioPreferencesEditor,
10216
- Vi as AudioSettings,
10253
+ $i as AudioPreferencesEditor,
10254
+ ji as AudioSettings,
10217
10255
  A as BooleanPreference,
10218
10256
  yn as EnumPreference,
10219
- yr as EpubDefaults,
10257
+ jr as EpubDefaults,
10220
10258
  Ln as EpubNavigator,
10221
- zt as EpubPreferences,
10259
+ Ft as EpubPreferences,
10222
10260
  Bi as EpubPreferencesEditor,
10223
- Hi as EpubSettings,
10224
- Fr as ExperimentalWebPubNavigator,
10225
- ar as FXLCoordinator,
10226
- sr as FXLFrameManager,
10227
- gr as FXLFramePoolManager,
10228
- hr as FXLPeripherals,
10229
- cr as FXLSpreader,
10230
- Mt as FrameComms,
10231
- _n as FrameManager,
10232
- nr as FramePoolManager,
10233
- rr as HorizontalThird,
10234
- vn as Injector,
10261
+ Vi as EpubSettings,
10262
+ fo as ExperimentalWebPubNavigator,
10263
+ Mr as FXLCoordinator,
10264
+ Ar as FXLFrameManager,
10265
+ Vr as FXLFramePoolManager,
10266
+ Ir as FXLPeripherals,
10267
+ zr as FXLSpreader,
10268
+ Nt as FrameComms,
10269
+ Cn as FrameManager,
10270
+ Rr as FramePoolManager,
10271
+ Tr as HorizontalThird,
10272
+ Sn as Injector,
10235
10273
  kt as LineLengths,
10236
- Ss as MediaNavigator,
10237
- hn as Navigator,
10238
- Me as Orientation,
10239
- M as Preference,
10274
+ vs as MediaNavigator,
10275
+ cn as Navigator,
10276
+ Ne as Orientation,
10277
+ N as Preference,
10240
10278
  le as Properties,
10241
- Cr as RSProperties,
10279
+ Zr as RSProperties,
10242
10280
  x as RangePreference,
10243
- Lr as ReadiumCSS,
10244
- Ne as Spread,
10281
+ Qr as ReadiumCSS,
10282
+ Me as Spread,
10245
10283
  tt as TextAlignment,
10246
- Cn as UserProperties,
10247
- or as VerticalThird,
10248
- cn as VisualNavigator,
10249
- Ar as WebAudioEngine,
10284
+ _n as UserProperties,
10285
+ Nr as VerticalThird,
10286
+ dn as VisualNavigator,
10287
+ so as WebAudioEngine,
10250
10288
  Ps as WebPubBlobBuilder,
10251
- zs as WebPubCSS,
10252
- Fs as WebPubDefaults,
10289
+ lr as WebPubCSS,
10290
+ dr as WebPubDefaults,
10253
10291
  ks as WebPubFrameManager,
10254
10292
  Os as WebPubFramePoolManager,
10255
- er as WebPubNavigator,
10256
- Nt as WebPubPreferences,
10257
- Ai as WebPubPreferencesEditor,
10258
- Ri as WebPubSettings,
10259
- Ns as WebRSProperties,
10293
+ kr as WebPubNavigator,
10294
+ Mt as WebPubPreferences,
10295
+ Ti as WebPubPreferencesEditor,
10296
+ Ai as WebPubSettings,
10297
+ ar as WebRSProperties,
10260
10298
  mn as WebUserProperties,
10261
10299
  E as ensureBoolean,
10262
10300
  he as ensureEnumValue,
10263
10301
  gn as ensureExperiment,
10264
10302
  wt as ensureFilter,
10265
- Is as ensureLessThanOrEqual,
10266
- Ds as ensureMoreThanOrEqual,
10267
- v as ensureNonNegative,
10303
+ hr as ensureLessThanOrEqual,
10304
+ cr as ensureMoreThanOrEqual,
10305
+ S as ensureNonNegative,
10268
10306
  W as ensureString,
10269
- z as ensureValueInRange,
10270
- $e as experiments,
10307
+ F as ensureValueInRange,
10308
+ Ge as experiments,
10271
10309
  dt as filterRangeConfig,
10272
10310
  Yt as fontSizeRangeConfig,
10273
10311
  st as fontWeightRangeConfig,
10274
10312
  qt as fontWidthRangeConfig,
10275
10313
  bt as getScriptMode,
10314
+ po as i18n,
10276
10315
  Kt as letterSpacingRangeConfig,
10277
10316
  Jt as lineHeightRangeConfig,
10278
10317
  ut as lineLengthRangeConfig,
@@ -10281,6 +10320,7 @@ export {
10281
10320
  ne as playbackRateRangeConfig,
10282
10321
  J as sML,
10283
10322
  T as sMLWithRequest,
10323
+ uo as settings,
10284
10324
  it as skipIntervalRangeConfig,
10285
10325
  ie as volumeRangeConfig,
10286
10326
  ge as withFallback,