@readium/navigator 2.4.0-beta.1 → 2.4.0-beta.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.
- package/dist/index.js +518 -412
- package/dist/index.umd.cjs +18 -18
- package/package.json +1 -1
- package/src/audio/AudioNavigator.ts +77 -5
- package/src/audio/AudioPoolManager.ts +51 -22
- package/src/audio/protection/AudioNavigatorProtector.ts +38 -0
- package/src/protection/CopyProtector.ts +22 -0
- package/src/protection/DragAndDropProtector.ts +34 -0
- package/src/protection/NavigatorProtector.ts +3 -3
- package/types/src/audio/AudioNavigator.d.ts +11 -1
- package/types/src/audio/AudioPoolManager.d.ts +9 -7
- package/types/src/audio/protection/AudioNavigatorProtector.d.ts +8 -0
- package/types/src/protection/CopyProtector.d.ts +8 -0
- package/types/src/protection/DragAndDropProtector.d.ts +10 -0
- package/types/src/protection/NavigatorProtector.d.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -35,7 +35,7 @@ const _ = class _ {
|
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
_.EPUB_A11Y_10_WCAG_20_A = new _("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-a"), _.EPUB_A11Y_10_WCAG_20_AA = new _("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-aa"), _.EPUB_A11Y_10_WCAG_20_AAA = new _("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-aaa"), _.EPUB_A11Y_11_WCAG_20_A = new _("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-a"), _.EPUB_A11Y_11_WCAG_20_AA = new _("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-aa"), _.EPUB_A11Y_11_WCAG_20_AAA = new _("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-aaa"), _.EPUB_A11Y_11_WCAG_21_A = new _("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-a"), _.EPUB_A11Y_11_WCAG_21_AA = new _("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-aa"), _.EPUB_A11Y_11_WCAG_21_AAA = new _("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-aaa"), _.EPUB_A11Y_11_WCAG_22_A = new _("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-a"), _.EPUB_A11Y_11_WCAG_22_AA = new _("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-aa"), _.EPUB_A11Y_11_WCAG_22_AAA = new _("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-aaa");
|
|
38
|
-
let
|
|
38
|
+
let Ge = _;
|
|
39
39
|
const C = class C {
|
|
40
40
|
constructor(t) {
|
|
41
41
|
this.value = t;
|
|
@@ -55,16 +55,16 @@ const C = class C {
|
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
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
|
|
59
|
-
const
|
|
58
|
+
let $e = C;
|
|
59
|
+
const N = class N {
|
|
60
60
|
constructor(t) {
|
|
61
61
|
if (typeof t == "string") {
|
|
62
|
-
if (!
|
|
62
|
+
if (!N.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) =>
|
|
67
|
+
(i) => N.VALID_MODES.has(i.toLowerCase())
|
|
68
68
|
);
|
|
69
69
|
if (e.length === 0)
|
|
70
70
|
return;
|
|
@@ -77,11 +77,11 @@ const F = class F {
|
|
|
77
77
|
static deserialize(t) {
|
|
78
78
|
if (!t) return;
|
|
79
79
|
if (typeof t == "string")
|
|
80
|
-
return new
|
|
80
|
+
return new N(t);
|
|
81
81
|
if (!Array.isArray(t)) return;
|
|
82
|
-
const e = t.filter((i) => i ?
|
|
82
|
+
const e = t.filter((i) => i ? N.VALID_MODES.has(i.toLowerCase()) : !1);
|
|
83
83
|
if (e.length !== 0)
|
|
84
|
-
return new
|
|
84
|
+
return new N(e);
|
|
85
85
|
}
|
|
86
86
|
/**
|
|
87
87
|
* Serializes a [PrimaryAccessMode] to its RWPM JSON representation.
|
|
@@ -90,8 +90,8 @@ const F = class F {
|
|
|
90
90
|
return this.value;
|
|
91
91
|
}
|
|
92
92
|
};
|
|
93
|
-
|
|
94
|
-
let
|
|
93
|
+
N.VALID_MODES = /* @__PURE__ */ new Set(["auditory", "tactile", "textual", "visual"]), N.AUDITORY = new N("auditory"), N.TACTILE = new N("tactile"), N.TEXTUAL = new N("textual"), N.VISUAL = new N("visual");
|
|
94
|
+
let Xe = N;
|
|
95
95
|
const f = class f {
|
|
96
96
|
constructor(t) {
|
|
97
97
|
this.value = t;
|
|
@@ -131,7 +131,7 @@ const x = class x {
|
|
|
131
131
|
}
|
|
132
132
|
};
|
|
133
133
|
x.FLASHING = new x("flashing"), x.NO_FLASHING_HAZARD = new x("noFlashingHazard"), x.UNKNOWN_FLASHING_HAZARD = new x("unknownFlashingHazard"), x.MOTION_SIMULATION = new x("motionSimulation"), x.NO_MOTION_SIMULATION_HAZARD = new x("noMotionSimulationHazard"), x.UNKNOWN_MOTION_SIMULATION_HAZARD = new x("unknownMotionSimulationHazard"), x.SOUND = new x("sound"), x.NO_SOUND_HAZARD = new x("noSoundHazard"), x.UNKNOWN_SOUND_HAZARD = new x("unknownSoundHazard"), x.UNKNOWN = new x("unknown"), x.NONE = new x("none");
|
|
134
|
-
let
|
|
134
|
+
let Ye = x;
|
|
135
135
|
const L = class L {
|
|
136
136
|
constructor(t) {
|
|
137
137
|
this.value = t;
|
|
@@ -151,10 +151,10 @@ const L = class L {
|
|
|
151
151
|
}
|
|
152
152
|
};
|
|
153
153
|
L.NONE = new L("none"), L.DOCUMENTED = new L("documented"), L.LEGAL = new L("legal"), L.TEMPORARY = new L("temporary"), L.TECHNICAL = new L("technical"), L.EAA_DISPROPORTIONATE_BURDEN = new L("eaa-disproportionate-burden"), L.EAA_FUNDAMENTAL_ALTERATION = new L("eaa-fundamental-alteration"), L.EAA_MICROENTERPRISE = new L("eaa-microenterprise"), L.EAA_TECHNICAL_IMPOSSIBILITY = new L("eaa-technical-impossibility"), L.EAA_TEMPORARY = new L("eaa-temporary");
|
|
154
|
-
let
|
|
155
|
-
const Ye = ["en", "ar", "da", "fr", "it", "pt_PT", "sv"], vn = /* @__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"}}`), wn = {
|
|
154
|
+
let qe = L;
|
|
155
|
+
const Ke = ["en", "ar", "da", "fr", "it", "pt_PT", "sv"], vn = /* @__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"}}`), wn = {
|
|
156
156
|
publication: vn
|
|
157
|
-
},
|
|
157
|
+
}, Ze = {
|
|
158
158
|
fr: () => import("./fr-C5HEel98.js"),
|
|
159
159
|
ar: () => import("./ar-DyHX_uy2.js"),
|
|
160
160
|
da: () => import("./da-Dct0PS3E.js"),
|
|
@@ -165,13 +165,13 @@ const Ye = ["en", "ar", "da", "fr", "it", "pt_PT", "sv"], vn = /* @__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
|
-
},
|
|
169
|
-
class
|
|
168
|
+
}, Je = wn?.publication?.metadata?.accessibility?.["display-guide"] || {};
|
|
169
|
+
class mt {
|
|
170
170
|
constructor() {
|
|
171
|
-
this.currentLocaleCode = "en", this.locale =
|
|
171
|
+
this.currentLocaleCode = "en", this.locale = Je, this.loadedLocales = {}, this.loadedLocales.en = Je;
|
|
172
172
|
}
|
|
173
173
|
static getInstance() {
|
|
174
|
-
return
|
|
174
|
+
return mt.instance || (mt.instance = new mt()), mt.instance;
|
|
175
175
|
}
|
|
176
176
|
/**
|
|
177
177
|
* Loads a locale dynamically
|
|
@@ -179,14 +179,14 @@ class ut {
|
|
|
179
179
|
* @returns Promise indicating if the locale was loaded successfully
|
|
180
180
|
*/
|
|
181
181
|
async loadLocale(t) {
|
|
182
|
-
if (!
|
|
182
|
+
if (!Ke.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
|
|
187
|
+
if (!(t in Ze))
|
|
188
188
|
return console.warn(`Locale file not found for: ${t}`), !1;
|
|
189
|
-
const n = (await
|
|
189
|
+
const n = (await Ze[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 ut {
|
|
|
220
220
|
* Gets a list of available locale codes
|
|
221
221
|
*/
|
|
222
222
|
getAvailableLocales() {
|
|
223
|
-
return
|
|
223
|
+
return Ke;
|
|
224
224
|
}
|
|
225
225
|
getNestedValue(t, e) {
|
|
226
226
|
const i = e.split(".");
|
|
@@ -242,7 +242,7 @@ class ut {
|
|
|
242
242
|
return e === void 0 && this.currentLocaleCode !== "en" && (e = this.getNestedValue(this.loadedLocales.en, t)), e !== void 0 ? typeof e == "string" ? { compact: e, descriptive: e } : e : (console.warn(`Missing localization for key: ${t}`), { compact: "", descriptive: "" });
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
|
-
|
|
245
|
+
mt.getInstance();
|
|
246
246
|
var S = /* @__PURE__ */ ((s) => (s.reflowable = "reflowable", s.fixed = "fixed", s.scrolled = "scrolled", s))(S || {});
|
|
247
247
|
class ke {
|
|
248
248
|
/**
|
|
@@ -311,10 +311,10 @@ Object.defineProperty($.prototype, "encryption", {
|
|
|
311
311
|
function _n(s) {
|
|
312
312
|
return s && Array.isArray(s) ? s : void 0;
|
|
313
313
|
}
|
|
314
|
-
function
|
|
314
|
+
function Ui(s) {
|
|
315
315
|
return s && typeof s == "string" ? [s] : _n(s);
|
|
316
316
|
}
|
|
317
|
-
function
|
|
317
|
+
function Qe(s) {
|
|
318
318
|
return typeof s == "string" ? new Date(s) : void 0;
|
|
319
319
|
}
|
|
320
320
|
function Mt(s) {
|
|
@@ -786,7 +786,7 @@ class g {
|
|
|
786
786
|
});
|
|
787
787
|
}
|
|
788
788
|
}
|
|
789
|
-
class
|
|
789
|
+
class ti {
|
|
790
790
|
constructor(t) {
|
|
791
791
|
this.uri = t, this.parameters = this.getParameters(t);
|
|
792
792
|
}
|
|
@@ -836,7 +836,7 @@ class E {
|
|
|
836
836
|
return Object.entries(t).forEach(([a, l]) => {
|
|
837
837
|
o.has(a) || r.set(a, l);
|
|
838
838
|
}), new E({
|
|
839
|
-
fragments:
|
|
839
|
+
fragments: Ui(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,
|
|
@@ -851,7 +851,7 @@ class E {
|
|
|
851
851
|
return this.fragments && (t.fragments = this.fragments), this.progression !== void 0 && (t.progression = this.progression), this.totalProgression !== void 0 && (t.totalProgression = this.totalProgression), this.position !== void 0 && (t.position = this.position), this.otherLocations && this.otherLocations.forEach((e, i) => t[i] = e), t;
|
|
852
852
|
}
|
|
853
853
|
}
|
|
854
|
-
class
|
|
854
|
+
class at {
|
|
855
855
|
/**
|
|
856
856
|
* Creates a [Text].
|
|
857
857
|
*/
|
|
@@ -863,7 +863,7 @@ class st {
|
|
|
863
863
|
*/
|
|
864
864
|
static deserialize(t) {
|
|
865
865
|
if (t)
|
|
866
|
-
return new
|
|
866
|
+
return new at({
|
|
867
867
|
after: t.after,
|
|
868
868
|
before: t.before,
|
|
869
869
|
highlight: t.highlight
|
|
@@ -877,7 +877,7 @@ class st {
|
|
|
877
877
|
return this.after !== void 0 && (t.after = this.after), this.before !== void 0 && (t.before = this.before), this.highlight !== void 0 && (t.highlight = this.highlight), t;
|
|
878
878
|
}
|
|
879
879
|
}
|
|
880
|
-
class
|
|
880
|
+
class F {
|
|
881
881
|
/**
|
|
882
882
|
* Creates a [Locator].
|
|
883
883
|
*/
|
|
@@ -889,12 +889,12 @@ class N {
|
|
|
889
889
|
*/
|
|
890
890
|
static deserialize(t) {
|
|
891
891
|
if (t && t.href && t.type)
|
|
892
|
-
return new
|
|
892
|
+
return new F({
|
|
893
893
|
href: t.href,
|
|
894
894
|
type: t.type,
|
|
895
895
|
title: t.title,
|
|
896
896
|
locations: E.deserialize(t.locations),
|
|
897
|
-
text:
|
|
897
|
+
text: at.deserialize(t.text)
|
|
898
898
|
});
|
|
899
899
|
}
|
|
900
900
|
/**
|
|
@@ -908,7 +908,7 @@ class N {
|
|
|
908
908
|
* Shortcut to get a copy of the [Locator] with different [Locations] sub-properties.
|
|
909
909
|
*/
|
|
910
910
|
copyWithLocations(t) {
|
|
911
|
-
return new
|
|
911
|
+
return new F({
|
|
912
912
|
href: this.href,
|
|
913
913
|
type: this.type,
|
|
914
914
|
title: this.title,
|
|
@@ -941,7 +941,7 @@ class j {
|
|
|
941
941
|
size: B(t.size),
|
|
942
942
|
duration: B(t.duration),
|
|
943
943
|
bitrate: B(t.bitrate),
|
|
944
|
-
languages:
|
|
944
|
+
languages: Ui(t.language),
|
|
945
945
|
alternates: It.deserialize(t.alternate),
|
|
946
946
|
children: It.deserialize(t.children)
|
|
947
947
|
});
|
|
@@ -968,14 +968,14 @@ class j {
|
|
|
968
968
|
}
|
|
969
969
|
/** List of URI template parameter keys, if the `Link` is templated. */
|
|
970
970
|
get templateParameters() {
|
|
971
|
-
return this.templated ? new
|
|
971
|
+
return this.templated ? new ti(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 j({
|
|
978
|
-
href: new
|
|
978
|
+
href: new ti(this.href).expand(t),
|
|
979
979
|
templated: !1
|
|
980
980
|
});
|
|
981
981
|
}
|
|
@@ -991,7 +991,7 @@ class j {
|
|
|
991
991
|
*/
|
|
992
992
|
get locator() {
|
|
993
993
|
let t = this.href.split("#");
|
|
994
|
-
return new
|
|
994
|
+
return new F({
|
|
995
995
|
href: t.length > 0 && t[0] !== void 0 ? t[0] : this.href,
|
|
996
996
|
type: this.type ?? "",
|
|
997
997
|
title: this.title,
|
|
@@ -1095,7 +1095,7 @@ class It {
|
|
|
1095
1095
|
return this.items.filter((t) => t.type);
|
|
1096
1096
|
}
|
|
1097
1097
|
}
|
|
1098
|
-
var
|
|
1098
|
+
var Ii = /* @__PURE__ */ ((s) => (s.EPUB = "https://readium.org/webpub-manifest/profiles/epub", s.AUDIOBOOK = "https://readium.org/webpub-manifest/profiles/audiobook", s.DIVINA = "https://readium.org/webpub-manifest/profiles/divina", s.PDF = "https://readium.org/webpub-manifest/profiles/pdf", s))(Ii || {}), D = /* @__PURE__ */ ((s) => (s.ltr = "ltr", s.rtl = "rtl", s))(D || {});
|
|
1099
1099
|
$.prototype.getContains = function() {
|
|
1100
1100
|
return new Set(this.otherProperties.contains || []);
|
|
1101
1101
|
};
|
|
@@ -1223,7 +1223,7 @@ class Te {
|
|
|
1223
1223
|
return { currency: this.currency, value: this.value };
|
|
1224
1224
|
}
|
|
1225
1225
|
}
|
|
1226
|
-
class
|
|
1226
|
+
class wt {
|
|
1227
1227
|
/** Creates a [Acquisition]. */
|
|
1228
1228
|
constructor(t) {
|
|
1229
1229
|
this.type = t.type, this.children = t.children;
|
|
@@ -1233,14 +1233,14 @@ class bt {
|
|
|
1233
1233
|
*/
|
|
1234
1234
|
static deserialize(t) {
|
|
1235
1235
|
if (t && t.type)
|
|
1236
|
-
return new
|
|
1236
|
+
return new wt({
|
|
1237
1237
|
type: t.type,
|
|
1238
|
-
children:
|
|
1238
|
+
children: wt.deserializeArray(t.children)
|
|
1239
1239
|
});
|
|
1240
1240
|
}
|
|
1241
1241
|
static deserializeArray(t) {
|
|
1242
1242
|
if (Array.isArray(t))
|
|
1243
|
-
return t.map((e) =>
|
|
1243
|
+
return t.map((e) => wt.deserialize(e)).filter((e) => e !== void 0);
|
|
1244
1244
|
}
|
|
1245
1245
|
/**
|
|
1246
1246
|
* Serializes a [Acquisition] to its RWPM JSON representation.
|
|
@@ -1308,8 +1308,8 @@ class Me {
|
|
|
1308
1308
|
if (t && t.state)
|
|
1309
1309
|
return new Me({
|
|
1310
1310
|
state: t.state,
|
|
1311
|
-
since:
|
|
1312
|
-
until:
|
|
1311
|
+
since: Qe(t.since),
|
|
1312
|
+
until: Qe(t.until)
|
|
1313
1313
|
});
|
|
1314
1314
|
}
|
|
1315
1315
|
/**
|
|
@@ -1329,7 +1329,7 @@ $.prototype.getPrice = function() {
|
|
|
1329
1329
|
$.prototype.getIndirectAcquisitions = function() {
|
|
1330
1330
|
const s = this.otherProperties.indirectAcquisition;
|
|
1331
1331
|
if (s && Array.isArray(s))
|
|
1332
|
-
return s.map((t) =>
|
|
1332
|
+
return s.map((t) => wt.deserialize(t)).filter((t) => t !== void 0);
|
|
1333
1333
|
};
|
|
1334
1334
|
$.prototype.getHolds = function() {
|
|
1335
1335
|
return Ae.deserialize(this.otherProperties.holds);
|
|
@@ -1344,7 +1344,7 @@ $.prototype.getAuthenticate = function() {
|
|
|
1344
1344
|
return j.deserialize(this.otherProperties.authenticate);
|
|
1345
1345
|
};
|
|
1346
1346
|
const En = "CssSelectorGenerator";
|
|
1347
|
-
function
|
|
1347
|
+
function ei(s = "unknown problem", ...t) {
|
|
1348
1348
|
console.warn(`${En}: ${s}`, ...t);
|
|
1349
1349
|
}
|
|
1350
1350
|
function Cn(s) {
|
|
@@ -1360,13 +1360,13 @@ function Rn(s) {
|
|
|
1360
1360
|
if (typeof e == "function")
|
|
1361
1361
|
return (i) => {
|
|
1362
1362
|
const n = e(i);
|
|
1363
|
-
return typeof n != "boolean" ? (
|
|
1363
|
+
return typeof n != "boolean" ? (ei("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
1366
|
const i = new RegExp("^" + xn(e) + "$");
|
|
1367
1367
|
return (n) => i.test(n);
|
|
1368
1368
|
}
|
|
1369
|
-
return
|
|
1369
|
+
return ei("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
|
}
|
|
@@ -1376,7 +1376,7 @@ Rn([
|
|
|
1376
1376
|
// Angular attributes
|
|
1377
1377
|
"ng-*"
|
|
1378
1378
|
]);
|
|
1379
|
-
const Ln = Math.pow(2, 32),
|
|
1379
|
+
const Ln = Math.pow(2, 32), ii = () => Math.round(Math.random() * Ln).toString(36), ge = () => `${Math.round(performance.now())}-${ii()}-${ii()}`, ut = 1;
|
|
1380
1380
|
class kn {
|
|
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);
|
|
@@ -1388,8 +1388,8 @@ class kn {
|
|
|
1388
1388
|
if (!(!("_readium" in e) || !e._readium || e._readium <= 0)) {
|
|
1389
1389
|
if (e.key === "_ping") {
|
|
1390
1390
|
if (!this.destination) {
|
|
1391
|
-
if (this.destination = t.source, this.origin = t.origin, this.channelId = e._channel, e._readium !==
|
|
1392
|
-
e._readium >
|
|
1391
|
+
if (this.destination = t.source, this.origin = t.origin, this.channelId = e._channel, e._readium !== ut) {
|
|
1392
|
+
e._readium > ut ? this.send("error", `received comms version ${e._readium} higher than ${ut}`) : this.send("error", `received comms version ${e._readium} lower than ${ut}`), this.destination = null, this.origin = "", this.channelId = "";
|
|
1393
1393
|
return;
|
|
1394
1394
|
}
|
|
1395
1395
|
this.send("_pong", void 0), this.preLog.forEach((i) => this.send("log", i)), this.preLog = [];
|
|
@@ -1449,7 +1449,7 @@ class kn {
|
|
|
1449
1449
|
send(t, e, i = void 0, n = []) {
|
|
1450
1450
|
if (!this.destination) throw Error("Attempted to send comms message before destination has been initialized");
|
|
1451
1451
|
const r = {
|
|
1452
|
-
_readium:
|
|
1452
|
+
_readium: ut,
|
|
1453
1453
|
_channel: this.channelId,
|
|
1454
1454
|
id: i ?? ge(),
|
|
1455
1455
|
// scrict,
|
|
@@ -1467,17 +1467,17 @@ class kn {
|
|
|
1467
1467
|
}
|
|
1468
1468
|
}
|
|
1469
1469
|
}
|
|
1470
|
-
class
|
|
1470
|
+
class bt {
|
|
1471
1471
|
}
|
|
1472
|
-
function
|
|
1472
|
+
function ni(s) {
|
|
1473
1473
|
return s.split("").reverse().join("");
|
|
1474
1474
|
}
|
|
1475
1475
|
function On(s, t, e) {
|
|
1476
|
-
const i =
|
|
1476
|
+
const i = ni(t);
|
|
1477
1477
|
return e.map((n) => {
|
|
1478
|
-
const r = Math.max(0, n.end - t.length - n.errors), o =
|
|
1478
|
+
const r = Math.max(0, n.end - t.length - n.errors), o = ni(s.slice(r, n.end));
|
|
1479
1479
|
return {
|
|
1480
|
-
start:
|
|
1480
|
+
start: Di(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 On(s, t, e) {
|
|
|
1486
1486
|
function ae(s) {
|
|
1487
1487
|
return (s | -s) >> 31 & 1;
|
|
1488
1488
|
}
|
|
1489
|
-
function
|
|
1489
|
+
function ri(s, t, e, i) {
|
|
1490
1490
|
let n = s.P[e], r = s.M[e];
|
|
1491
1491
|
const o = i >>> 31, a = t[e] | o, l = a | r, h = (a & n) + n ^ n | a;
|
|
1492
1492
|
let c = r | ~(h | n), u = n & h;
|
|
1493
1493
|
const m = ae(c & s.lastRowMask[e]) - ae(u & s.lastRowMask[e]);
|
|
1494
1494
|
return c <<= 1, u <<= 1, u |= o, c |= ae(i) - o, n = u | ~(l | c), r = c & l, s.P[e] = n, s.M[e] = r, m;
|
|
1495
1495
|
}
|
|
1496
|
-
function
|
|
1496
|
+
function Di(s, t, e) {
|
|
1497
1497
|
if (t.length === 0)
|
|
1498
1498
|
return [];
|
|
1499
1499
|
e = Math.min(e, t.length);
|
|
@@ -1535,7 +1535,7 @@ function Ui(s, t, e) {
|
|
|
1535
1535
|
y < h.length ? d = h[y] : (d = l.get(y), typeof d > "u" && (d = a));
|
|
1536
1536
|
let p = 0;
|
|
1537
1537
|
for (let b = 0; b <= c; b += 1)
|
|
1538
|
-
p =
|
|
1538
|
+
p = ri(o, d, b, p), u[b] += p;
|
|
1539
1539
|
if (u[c] - p <= e && c < r && (d[c + 1] & 1 || p < 0)) {
|
|
1540
1540
|
c += 1, o.P[c] = -1, o.M[c] = 0;
|
|
1541
1541
|
let b;
|
|
@@ -1544,7 +1544,7 @@ function Ui(s, t, e) {
|
|
|
1544
1544
|
b = v === 0 ? n : v;
|
|
1545
1545
|
} else
|
|
1546
1546
|
b = n;
|
|
1547
|
-
u[c] = u[c - 1] + b - p +
|
|
1547
|
+
u[c] = u[c - 1] + b - p + ri(o, d, c, p);
|
|
1548
1548
|
} else
|
|
1549
1549
|
for (; c > 0 && u[c] >= e + n; )
|
|
1550
1550
|
c -= 1;
|
|
@@ -1557,10 +1557,10 @@ function Ui(s, t, e) {
|
|
|
1557
1557
|
return i;
|
|
1558
1558
|
}
|
|
1559
1559
|
function Tn(s, t, e) {
|
|
1560
|
-
const i =
|
|
1560
|
+
const i = Di(s, t, e);
|
|
1561
1561
|
return On(s, t, i);
|
|
1562
1562
|
}
|
|
1563
|
-
function
|
|
1563
|
+
function Wi(s, t, e) {
|
|
1564
1564
|
let i = 0;
|
|
1565
1565
|
const n = [];
|
|
1566
1566
|
for (; i !== -1; )
|
|
@@ -1571,23 +1571,23 @@ function Ii(s, t, e) {
|
|
|
1571
1571
|
}), i += 1);
|
|
1572
1572
|
return n.length > 0 ? n : Tn(s, t, e);
|
|
1573
1573
|
}
|
|
1574
|
-
function
|
|
1575
|
-
return t.length === 0 || s.length === 0 ? 0 : 1 -
|
|
1574
|
+
function si(s, t) {
|
|
1575
|
+
return t.length === 0 || s.length === 0 ? 0 : 1 - Wi(s, t, t.length)[0].errors / t.length;
|
|
1576
1576
|
}
|
|
1577
1577
|
function An(s, t, e = {}) {
|
|
1578
1578
|
if (t.length === 0)
|
|
1579
1579
|
return null;
|
|
1580
|
-
const i = Math.min(256, t.length / 2), n =
|
|
1580
|
+
const i = Math.min(256, t.length / 2), n = Wi(s, t, i);
|
|
1581
1581
|
if (n.length === 0)
|
|
1582
1582
|
return null;
|
|
1583
1583
|
const r = (a) => {
|
|
1584
|
-
const m = 1 - a.errors / t.length, y = e.prefix ?
|
|
1584
|
+
const m = 1 - a.errors / t.length, y = e.prefix ? si(
|
|
1585
1585
|
s.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 ?
|
|
1590
|
+
) : 1, d = e.suffix ? si(
|
|
1591
1591
|
s.slice(a.end, a.end + e.suffix.length),
|
|
1592
1592
|
e.suffix
|
|
1593
1593
|
) : 1;
|
|
@@ -1610,7 +1610,7 @@ function fe(s, t, e) {
|
|
|
1610
1610
|
const o = n.length - r.length;
|
|
1611
1611
|
return e === 2 ? t - o : t + o;
|
|
1612
1612
|
}
|
|
1613
|
-
function
|
|
1613
|
+
function oi(s, t) {
|
|
1614
1614
|
const e = s.commonAncestorContainer.ownerDocument.createNodeIterator(
|
|
1615
1615
|
s.commonAncestorContainer,
|
|
1616
1616
|
NodeFilter.SHOW_TEXT
|
|
@@ -1658,7 +1658,7 @@ function zn(s) {
|
|
|
1658
1658
|
if (n.start >= 0 && (t.setStart(s.startContainer, n.start), e = !0), n.end > 0 && (t.setEnd(s.endContainer, n.end), i = !0), e && i)
|
|
1659
1659
|
return t;
|
|
1660
1660
|
if (!e) {
|
|
1661
|
-
const { node: r, offset: o } =
|
|
1661
|
+
const { node: r, offset: o } = oi(
|
|
1662
1662
|
t,
|
|
1663
1663
|
1
|
|
1664
1664
|
/* Forwards */
|
|
@@ -1666,7 +1666,7 @@ function zn(s) {
|
|
|
1666
1666
|
r && o >= 0 && t.setStart(r, o);
|
|
1667
1667
|
}
|
|
1668
1668
|
if (!i) {
|
|
1669
|
-
const { node: r, offset: o } =
|
|
1669
|
+
const { node: r, offset: o } = oi(
|
|
1670
1670
|
t,
|
|
1671
1671
|
2
|
|
1672
1672
|
/* Backwards */
|
|
@@ -1675,7 +1675,7 @@ function zn(s) {
|
|
|
1675
1675
|
}
|
|
1676
1676
|
return t;
|
|
1677
1677
|
}
|
|
1678
|
-
function
|
|
1678
|
+
function Hi(s) {
|
|
1679
1679
|
switch (s.nodeType) {
|
|
1680
1680
|
case Node.ELEMENT_NODE:
|
|
1681
1681
|
case Node.TEXT_NODE:
|
|
@@ -1684,13 +1684,13 @@ function Di(s) {
|
|
|
1684
1684
|
return 0;
|
|
1685
1685
|
}
|
|
1686
1686
|
}
|
|
1687
|
-
function
|
|
1687
|
+
function ai(s) {
|
|
1688
1688
|
let t = s.previousSibling, e = 0;
|
|
1689
1689
|
for (; t; )
|
|
1690
|
-
e +=
|
|
1690
|
+
e += Hi(t), t = t.previousSibling;
|
|
1691
1691
|
return e;
|
|
1692
1692
|
}
|
|
1693
|
-
function
|
|
1693
|
+
function Bi(s, ...t) {
|
|
1694
1694
|
let e = t.shift();
|
|
1695
1695
|
const i = s.ownerDocument.createNodeIterator(
|
|
1696
1696
|
s,
|
|
@@ -1722,7 +1722,7 @@ class Y {
|
|
|
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 +=
|
|
1725
|
+
i += ai(e), e = e.parentElement;
|
|
1726
1726
|
return new Y(e, i);
|
|
1727
1727
|
}
|
|
1728
1728
|
/**
|
|
@@ -1744,7 +1744,7 @@ class Y {
|
|
|
1744
1744
|
*/
|
|
1745
1745
|
resolve(t = {}) {
|
|
1746
1746
|
try {
|
|
1747
|
-
return
|
|
1747
|
+
return Bi(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 Y {
|
|
|
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 =
|
|
1790
|
+
const i = ai(t) + e;
|
|
1791
1791
|
return new Y(t.parentElement, i);
|
|
1792
1792
|
}
|
|
1793
1793
|
case Node.ELEMENT_NODE: {
|
|
@@ -1795,7 +1795,7 @@ class Y {
|
|
|
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 +=
|
|
1798
|
+
i += Hi(t.childNodes[n]);
|
|
1799
1799
|
return new Y(t, i);
|
|
1800
1800
|
}
|
|
1801
1801
|
default:
|
|
@@ -1829,7 +1829,7 @@ class tt {
|
|
|
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] =
|
|
1832
|
+
this.start.element === this.end.element && this.start.offset <= this.end.offset ? [t, e] = Bi(
|
|
1833
1833
|
this.start.element,
|
|
1834
1834
|
this.start.offset,
|
|
1835
1835
|
this.end.offset
|
|
@@ -1978,7 +1978,7 @@ function ie(s, t) {
|
|
|
1978
1978
|
}
|
|
1979
1979
|
return null;
|
|
1980
1980
|
}
|
|
1981
|
-
function
|
|
1981
|
+
function Fn(s, t) {
|
|
1982
1982
|
let e = s.getClientRects();
|
|
1983
1983
|
e.length || s.commonAncestorContainer.nodeType === Node.ELEMENT_NODE && (e = s.commonAncestorContainer.getClientRects());
|
|
1984
1984
|
const i = 1, n = [];
|
|
@@ -1991,10 +1991,10 @@ function Nn(s, t) {
|
|
|
1991
1991
|
top: h.top,
|
|
1992
1992
|
width: h.width
|
|
1993
1993
|
});
|
|
1994
|
-
const r =
|
|
1994
|
+
const r = Vi(
|
|
1995
1995
|
n,
|
|
1996
1996
|
i
|
|
1997
|
-
), o = Un(r, i), a =
|
|
1997
|
+
), o = Un(r, i), a = ji(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 Nn(s, t) {
|
|
|
2005
2005
|
}
|
|
2006
2006
|
return a;
|
|
2007
2007
|
}
|
|
2008
|
-
function
|
|
2008
|
+
function Vi(s, t, e) {
|
|
2009
2009
|
for (let i = 0; i < s.length; i++)
|
|
2010
2010
|
for (let n = i + 1; n < s.length; n++) {
|
|
2011
2011
|
const r = s[i], o = s[n];
|
|
2012
2012
|
if (r === o)
|
|
2013
2013
|
continue;
|
|
2014
2014
|
const a = V(r.top, o.top, t) && V(r.bottom, o.bottom, t), l = V(r.left, o.left, t) && V(r.right, o.right, t);
|
|
2015
|
-
if (a && !l &&
|
|
2016
|
-
const u = s.filter((y) => y !== r && y !== o), m =
|
|
2017
|
-
return u.push(m),
|
|
2015
|
+
if (a && !l && Gi(r, o, t)) {
|
|
2016
|
+
const u = s.filter((y) => y !== r && y !== o), m = Nn(r, o);
|
|
2017
|
+
return u.push(m), Vi(
|
|
2018
2018
|
u,
|
|
2019
2019
|
t
|
|
2020
2020
|
);
|
|
@@ -2022,7 +2022,7 @@ function Hi(s, t, e) {
|
|
|
2022
2022
|
}
|
|
2023
2023
|
return s;
|
|
2024
2024
|
}
|
|
2025
|
-
function
|
|
2025
|
+
function Nn(s, t) {
|
|
2026
2026
|
const e = Math.min(s.left, t.left), i = Math.max(s.right, t.right), n = Math.min(s.top, t.top), r = Math.max(s.bottom, t.bottom);
|
|
2027
2027
|
return {
|
|
2028
2028
|
bottom: r,
|
|
@@ -2054,26 +2054,26 @@ function In(s, t, e) {
|
|
|
2054
2054
|
function Tt(s, t, e, i) {
|
|
2055
2055
|
return (s.left < t || V(s.left, t, i)) && (s.right > t || V(s.right, t, i)) && (s.top < e || V(s.top, e, i)) && (s.bottom > e || V(s.bottom, e, i));
|
|
2056
2056
|
}
|
|
2057
|
-
function
|
|
2057
|
+
function ji(s) {
|
|
2058
2058
|
for (let t = 0; t < s.length; t++)
|
|
2059
2059
|
for (let e = t + 1; e < s.length; e++) {
|
|
2060
2060
|
const i = s[t], n = s[e];
|
|
2061
|
-
if (i !== n &&
|
|
2061
|
+
if (i !== n && Gi(i, n, -1)) {
|
|
2062
2062
|
let r = [], o;
|
|
2063
|
-
const a =
|
|
2063
|
+
const a = li(i, n);
|
|
2064
2064
|
if (a.length === 1)
|
|
2065
2065
|
r = a, o = i;
|
|
2066
2066
|
else {
|
|
2067
|
-
const h =
|
|
2067
|
+
const h = li(n, i);
|
|
2068
2068
|
a.length < h.length ? (r = a, o = i) : (r = h, o = n);
|
|
2069
2069
|
}
|
|
2070
2070
|
const l = s.filter((h) => h !== o);
|
|
2071
|
-
return Array.prototype.push.apply(l, r),
|
|
2071
|
+
return Array.prototype.push.apply(l, r), ji(l);
|
|
2072
2072
|
}
|
|
2073
2073
|
}
|
|
2074
2074
|
return s;
|
|
2075
2075
|
}
|
|
2076
|
-
function
|
|
2076
|
+
function li(s, t) {
|
|
2077
2077
|
const e = Dn(t, s);
|
|
2078
2078
|
if (e.height === 0 || e.width === 0)
|
|
2079
2079
|
return [s];
|
|
@@ -2135,37 +2135,37 @@ function Dn(s, t) {
|
|
|
2135
2135
|
width: Math.max(0, i - e)
|
|
2136
2136
|
};
|
|
2137
2137
|
}
|
|
2138
|
-
function
|
|
2138
|
+
function Gi(s, t, e) {
|
|
2139
2139
|
return (s.left < t.right || e >= 0 && V(s.left, t.right, e)) && (t.left < s.right || e >= 0 && V(t.left, s.right, e)) && (s.top < t.bottom || e >= 0 && V(s.top, t.bottom, e)) && (t.top < s.bottom || e >= 0 && V(t.top, s.bottom, e));
|
|
2140
2140
|
}
|
|
2141
2141
|
function V(s, t, e) {
|
|
2142
2142
|
return Math.abs(s - t) <= e;
|
|
2143
2143
|
}
|
|
2144
|
-
function
|
|
2144
|
+
function Fe(s) {
|
|
2145
2145
|
const t = {}, e = s.document.documentElement.style;
|
|
2146
2146
|
for (const i in s.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
|
|
2151
|
-
const e =
|
|
2150
|
+
function $i(s, t) {
|
|
2151
|
+
const e = Fe(s);
|
|
2152
2152
|
Object.keys(e).forEach((i) => {
|
|
2153
2153
|
t.hasOwnProperty(i) || ne(s, i);
|
|
2154
2154
|
}), Object.entries(t).forEach(([i, n]) => {
|
|
2155
|
-
e[i] !== n &&
|
|
2155
|
+
e[i] !== n && xt(s, i, n);
|
|
2156
2156
|
});
|
|
2157
2157
|
}
|
|
2158
2158
|
function le(s, t) {
|
|
2159
2159
|
return s.document.documentElement.style.getPropertyValue(t);
|
|
2160
2160
|
}
|
|
2161
|
-
function
|
|
2161
|
+
function xt(s, t, e) {
|
|
2162
2162
|
s.document.documentElement.style.setProperty(t, e);
|
|
2163
2163
|
}
|
|
2164
2164
|
function ne(s, t) {
|
|
2165
2165
|
s.document.documentElement.style.removeProperty(t);
|
|
2166
2166
|
}
|
|
2167
|
-
let At = null, he = null,
|
|
2168
|
-
const
|
|
2167
|
+
let At = null, he = null, vt = 0;
|
|
2168
|
+
const pt = { r: 255, g: 255, b: 255, a: 1 }, lt = /* @__PURE__ */ new Map(), Wn = () => {
|
|
2169
2169
|
if (!At)
|
|
2170
2170
|
if (typeof OffscreenCanvas < "u")
|
|
2171
2171
|
At = new OffscreenCanvas(5, 5), he = At.getContext("2d", {
|
|
@@ -2201,44 +2201,44 @@ const dt = { r: 255, g: 255, b: 255, a: 1 }, ot = /* @__PURE__ */ new Map(), Wn
|
|
|
2201
2201
|
].some((n) => t.includes(n));
|
|
2202
2202
|
}, zt = (s, t) => {
|
|
2203
2203
|
console.warn(
|
|
2204
|
-
`[Decorator] Could not parse color: "${s}". ${t} Falling back to ${JSON.stringify(
|
|
2204
|
+
`[Decorator] Could not parse color: "${s}". ${t} Falling back to ${JSON.stringify(pt)} to compute contrast. Please use a CSS color value that can be computed to RGB(A).`
|
|
2205
2205
|
);
|
|
2206
2206
|
}, ye = (s, t = null) => {
|
|
2207
|
-
const e = t ? `${s}|${t}` : s, i =
|
|
2207
|
+
const e = t ? `${s}|${t}` : s, i = lt.get(e);
|
|
2208
2208
|
if (i !== void 0)
|
|
2209
|
-
return i ??
|
|
2209
|
+
return i ?? pt;
|
|
2210
2210
|
if (Hn(s))
|
|
2211
|
-
return zt(s, "Unsupported color format or special value."),
|
|
2211
|
+
return zt(s, "Unsupported color format or special value."), lt.set(e, null), pt;
|
|
2212
2212
|
const n = Wn();
|
|
2213
2213
|
if (!n)
|
|
2214
|
-
return zt(s, "Could not get canvas context."),
|
|
2214
|
+
return zt(s, "Could not get canvas context."), lt.set(e, null), pt;
|
|
2215
2215
|
try {
|
|
2216
|
-
|
|
2217
|
-
const r =
|
|
2216
|
+
vt === 0 && n.clearRect(0, 0, 5, 5);
|
|
2217
|
+
const r = vt % 5, o = Math.floor(vt / 5);
|
|
2218
2218
|
n.clearRect(r, o, 1, 1), t && (n.fillStyle = t, n.fillRect(r, o, 1, 1)), n.fillStyle = s, n.fillRect(r, o, 1, 1);
|
|
2219
2219
|
const a = n.getImageData(r, o, 1, 1);
|
|
2220
|
-
|
|
2220
|
+
vt = (vt + 1) % 25;
|
|
2221
2221
|
const [l, h, c, u] = a.data;
|
|
2222
2222
|
if (u === 0)
|
|
2223
|
-
return zt(s, "Fully transparent color."),
|
|
2223
|
+
return zt(s, "Fully transparent color."), lt.set(e, null), pt;
|
|
2224
2224
|
const m = { r: l, g: h, b: c, a: u / 255 };
|
|
2225
|
-
return
|
|
2225
|
+
return lt.set(e, m), m;
|
|
2226
2226
|
} catch (r) {
|
|
2227
|
-
return zt(s, `Error: ${r instanceof Error ? r.message : String(r)}`),
|
|
2227
|
+
return zt(s, `Error: ${r instanceof Error ? r.message : String(r)}`), lt.set(e, null), pt;
|
|
2228
2228
|
}
|
|
2229
2229
|
}, ce = (s) => {
|
|
2230
2230
|
const t = s / 255;
|
|
2231
2231
|
return t <= 0.03928 ? t / 12.92 : Math.pow((t + 0.055) / 1.055, 2.4);
|
|
2232
|
-
},
|
|
2232
|
+
}, hi = (s) => {
|
|
2233
2233
|
const t = ce(s.r), e = ce(s.g), i = ce(s.b);
|
|
2234
2234
|
return 0.2126 * t + 0.7152 * e + 0.0722 * i;
|
|
2235
|
-
},
|
|
2236
|
-
const e = typeof s == "string" ? ye(s) : s, i = typeof t == "string" ? ye(t) : t, n =
|
|
2235
|
+
}, ci = (s, t) => {
|
|
2236
|
+
const e = typeof s == "string" ? ye(s) : s, i = typeof t == "string" ? ye(t) : t, n = hi(e), r = hi(i), o = Math.max(n, r), a = Math.min(n, r);
|
|
2237
2237
|
return (o + 0.05) / (a + 0.05);
|
|
2238
2238
|
}, Se = (s, t = null) => {
|
|
2239
|
-
const e = ye(s, t), i =
|
|
2239
|
+
const e = ye(s, t), i = ci(e, { r: 255, g: 255, b: 255, a: 1 }), n = ci(e, { r: 0, g: 0, b: 0, a: 1 });
|
|
2240
2240
|
return i > n;
|
|
2241
|
-
}, Bn = (s, t = null) => Se(s, t) ? "white" : "black",
|
|
2241
|
+
}, Bn = (s, t = null) => Se(s, t) ? "white" : "black", di = "#FFFF00", Vn = () => "Highlight" in window, ui = ["IMG", "IMAGE", "AUDIO", "VIDEO", "SVG"];
|
|
2242
2242
|
class jn {
|
|
2243
2243
|
/**
|
|
2244
2244
|
* Creates a DecorationGroup object
|
|
@@ -2265,7 +2265,7 @@ class jn {
|
|
|
2265
2265
|
return;
|
|
2266
2266
|
}
|
|
2267
2267
|
const n = i.commonAncestorContainer;
|
|
2268
|
-
n.nodeType !== Node.TEXT_NODE && this.experimentalHighlights && (
|
|
2268
|
+
n.nodeType !== Node.TEXT_NODE && this.experimentalHighlights && (ui.includes(n.nodeName.toUpperCase()) && this.notTextFlag?.set(e, !0), i.cloneContents().querySelector(ui.join(", ").toLowerCase()) && this.notTextFlag?.set(e, !0), (n.textContent?.trim() || "").length === 0 && this.notTextFlag?.set(e, !0));
|
|
2269
2269
|
const r = {
|
|
2270
2270
|
decoration: t,
|
|
2271
2271
|
id: e,
|
|
@@ -2306,7 +2306,7 @@ class jn {
|
|
|
2306
2306
|
experimentalLayout(t) {
|
|
2307
2307
|
const [e, i] = this.requireContainer(!0);
|
|
2308
2308
|
i.add(t.range);
|
|
2309
|
-
const n = le(this.wnd, "--USER__backgroundColor") || this.wnd.getComputedStyle(this.wnd.document.documentElement).getPropertyValue("background-color"), r = t.decoration?.style?.tint ??
|
|
2309
|
+
const n = le(this.wnd, "--USER__backgroundColor") || this.wnd.getComputedStyle(this.wnd.document.documentElement).getPropertyValue("background-color"), r = t.decoration?.style?.tint ?? di;
|
|
2310
2310
|
e.innerHTML = `
|
|
2311
2311
|
::highlight(${this.id}) {
|
|
2312
2312
|
color: ${Bn(r, n)};
|
|
@@ -2347,7 +2347,7 @@ class jn {
|
|
|
2347
2347
|
data-readium="true"
|
|
2348
2348
|
class="readium-highlight"
|
|
2349
2349
|
style="${[
|
|
2350
|
-
`background-color: ${t.decoration?.style?.tint ??
|
|
2350
|
+
`background-color: ${t.decoration?.style?.tint ?? di} !important`,
|
|
2351
2351
|
//"opacity: 0.3 !important",
|
|
2352
2352
|
`mix-blend-mode: ${m ? "exclusion" : "multiply"} !important`,
|
|
2353
2353
|
"opacity: 1 !important",
|
|
@@ -2361,7 +2361,7 @@ class jn {
|
|
|
2361
2361
|
const d = y.cloneNode(!0);
|
|
2362
2362
|
d.style.setProperty("pointer-events", "none"), h(d, c, c), e.append(d);
|
|
2363
2363
|
} else {
|
|
2364
|
-
let d =
|
|
2364
|
+
let d = Fn(
|
|
2365
2365
|
t.range
|
|
2366
2366
|
);
|
|
2367
2367
|
d = d.sort((p, b) => p.top < b.top ? -1 : p.top > b.top ? 1 : 0);
|
|
@@ -2403,7 +2403,7 @@ class jn {
|
|
|
2403
2403
|
this.experimentalHighlights && this.wnd.CSS.highlights.delete(this.id), this.container && (this.container.remove(), this.container = void 0);
|
|
2404
2404
|
}
|
|
2405
2405
|
}
|
|
2406
|
-
const
|
|
2406
|
+
const Pt = class Pt extends bt {
|
|
2407
2407
|
constructor() {
|
|
2408
2408
|
super(...arguments), this.resizeFrame = 0, this.lastGroupId = 0, this.groups = /* @__PURE__ */ new Map(), this.handleResizer = this.handleResize.bind(this);
|
|
2409
2409
|
}
|
|
@@ -2428,9 +2428,9 @@ const wt = class wt extends yt {
|
|
|
2428
2428
|
}, 50);
|
|
2429
2429
|
}
|
|
2430
2430
|
mount(t, e) {
|
|
2431
|
-
return this.wnd = t, e.register("decorate",
|
|
2431
|
+
return this.wnd = t, e.register("decorate", Pt.moduleName, (i, n) => {
|
|
2432
2432
|
const r = i;
|
|
2433
|
-
r.decoration && r.decoration.locator && (r.decoration.locator =
|
|
2433
|
+
r.decoration && r.decoration.locator && (r.decoration.locator = F.deserialize(r.decoration.locator)), this.groups.has(r.group) || this.groups.set(r.group, new jn(
|
|
2434
2434
|
t,
|
|
2435
2435
|
e,
|
|
2436
2436
|
`readium-decoration-${this.lastGroupId++}`,
|
|
@@ -2468,12 +2468,12 @@ const wt = class wt extends yt {
|
|
|
2468
2468
|
}), e.log("Decorator Mounted"), !0;
|
|
2469
2469
|
}
|
|
2470
2470
|
unmount(t, e) {
|
|
2471
|
-
return t.removeEventListener("orientationchange", this.handleResizer), t.removeEventListener("resize", this.handleResizer), e.unregisterAll(
|
|
2471
|
+
return t.removeEventListener("orientationchange", this.handleResizer), t.removeEventListener("resize", this.handleResizer), e.unregisterAll(Pt.moduleName), this.resizeObserver.disconnect(), this.backgroundObserver.disconnect(), this.cleanup(), e.log("Decorator Unmounted"), !0;
|
|
2472
2472
|
}
|
|
2473
2473
|
};
|
|
2474
|
-
|
|
2475
|
-
let be =
|
|
2476
|
-
const
|
|
2474
|
+
Pt.moduleName = "decorator";
|
|
2475
|
+
let be = Pt;
|
|
2476
|
+
const pi = "readium-snapper-style", Et = class Et extends bt {
|
|
2477
2477
|
constructor() {
|
|
2478
2478
|
super(...arguments), this.protected = !1;
|
|
2479
2479
|
}
|
|
@@ -2486,34 +2486,34 @@ const di = "readium-snapper-style", _t = class _t extends yt {
|
|
|
2486
2486
|
}
|
|
2487
2487
|
mount(t, e) {
|
|
2488
2488
|
const i = t.document.createElement("style");
|
|
2489
|
-
return i.dataset.readium = "true", i.id =
|
|
2489
|
+
return i.dataset.readium = "true", i.id = pi, i.textContent = this.buildStyles(), t.document.head.appendChild(i), e.register("protect", Et.moduleName, (n, r) => {
|
|
2490
2490
|
this.protected = !0, i.textContent = this.buildStyles(), r(!0);
|
|
2491
|
-
}), e.register("unprotect",
|
|
2491
|
+
}), e.register("unprotect", Et.moduleName, (n, r) => {
|
|
2492
2492
|
this.protected = !1, i.textContent = this.buildStyles(), r(!0);
|
|
2493
2493
|
}), e.log("Snapper Mounted"), !0;
|
|
2494
2494
|
}
|
|
2495
2495
|
unmount(t, e) {
|
|
2496
|
-
return t.document.getElementById(
|
|
2496
|
+
return t.document.getElementById(pi)?.remove(), e.log("Snapper Unmounted"), !0;
|
|
2497
2497
|
}
|
|
2498
2498
|
};
|
|
2499
|
-
|
|
2500
|
-
let
|
|
2499
|
+
Et.moduleName = "snapper";
|
|
2500
|
+
let Rt = Et;
|
|
2501
2501
|
function rt(s) {
|
|
2502
2502
|
return s.document.body.dir.toLowerCase() === "rtl";
|
|
2503
2503
|
}
|
|
2504
|
-
function
|
|
2504
|
+
function Xi(s) {
|
|
2505
2505
|
return parseInt(
|
|
2506
2506
|
s.getComputedStyle(
|
|
2507
2507
|
s.document.documentElement
|
|
2508
2508
|
).getPropertyValue("column-count")
|
|
2509
2509
|
);
|
|
2510
2510
|
}
|
|
2511
|
-
function
|
|
2511
|
+
function mi(s) {
|
|
2512
2512
|
const t = getComputedStyle(s), e = parseFloat(t.paddingTop || "0"), i = parseFloat(t.paddingBottom || "0");
|
|
2513
2513
|
return s.clientHeight - e - i;
|
|
2514
2514
|
}
|
|
2515
|
-
function
|
|
2516
|
-
const t =
|
|
2515
|
+
function gi(s) {
|
|
2516
|
+
const t = Xi(s);
|
|
2517
2517
|
if (!t)
|
|
2518
2518
|
return !1;
|
|
2519
2519
|
const e = s.document.querySelectorAll("div[id^='readium-virtual-page']");
|
|
@@ -2523,11 +2523,11 @@ function pi(s) {
|
|
|
2523
2523
|
if (l > 0)
|
|
2524
2524
|
for (let h = 0; h < l; h++) {
|
|
2525
2525
|
const c = s.document.createElement("div");
|
|
2526
|
-
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 =
|
|
2526
|
+
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 = mi(s.document.documentElement) + "px"), c.innerHTML = "​", s.document.body.appendChild(c);
|
|
2527
2527
|
}
|
|
2528
2528
|
return i !== l;
|
|
2529
2529
|
}
|
|
2530
|
-
function
|
|
2530
|
+
function Yi(s) {
|
|
2531
2531
|
const t = s.document.createElement("style");
|
|
2532
2532
|
t.appendChild(s.document.createTextNode("*{}")), s.document.body.appendChild(t), s.document.body.removeChild(t);
|
|
2533
2533
|
}
|
|
@@ -2552,14 +2552,14 @@ const $n = [
|
|
|
2552
2552
|
"textarea",
|
|
2553
2553
|
"video"
|
|
2554
2554
|
];
|
|
2555
|
-
function
|
|
2556
|
-
return $n.indexOf(s.nodeName.toLowerCase()) !== -1 || s.hasAttribute("contenteditable") && s.getAttribute("contenteditable")?.toLowerCase() !== "false" ? s : s.parentElement ?
|
|
2555
|
+
function qi(s) {
|
|
2556
|
+
return $n.indexOf(s.nodeName.toLowerCase()) !== -1 || s.hasAttribute("contenteditable") && s.getAttribute("contenteditable")?.toLowerCase() !== "false" ? s : s.parentElement ? qi(s.parentElement) : null;
|
|
2557
2557
|
}
|
|
2558
|
-
function
|
|
2559
|
-
const e =
|
|
2558
|
+
function Ne(s, t) {
|
|
2559
|
+
const e = Ki(s, s.document.body, t), i = s._readium_cssSelectorGenerator.getCssSelector(e, {
|
|
2560
2560
|
selectors: ["tag", "id", "class", "nthchild", "nthoftype", "attribute"]
|
|
2561
2561
|
});
|
|
2562
|
-
return new
|
|
2562
|
+
return new F({
|
|
2563
2563
|
href: "#",
|
|
2564
2564
|
type: "application/xhtml+xml",
|
|
2565
2565
|
locations: new E({
|
|
@@ -2567,16 +2567,16 @@ function Fe(s, t) {
|
|
|
2567
2567
|
["cssSelector", i]
|
|
2568
2568
|
])
|
|
2569
2569
|
}),
|
|
2570
|
-
text: new
|
|
2570
|
+
text: new at({
|
|
2571
2571
|
highlight: e.textContent || void 0
|
|
2572
2572
|
})
|
|
2573
2573
|
});
|
|
2574
2574
|
}
|
|
2575
|
-
function
|
|
2575
|
+
function Ki(s, t, e) {
|
|
2576
2576
|
for (var i = 0; i < t.children.length; i++) {
|
|
2577
2577
|
const n = t.children[i];
|
|
2578
2578
|
if (!qn(n) && Xn(s, n, e))
|
|
2579
|
-
return Yn(s, n) ? n :
|
|
2579
|
+
return Yn(s, n) ? n : Ki(s, n, e);
|
|
2580
2580
|
}
|
|
2581
2581
|
return t;
|
|
2582
2582
|
}
|
|
@@ -2612,7 +2612,7 @@ const Kn = {
|
|
|
2612
2612
|
// Reasonable default for detecting patterns
|
|
2613
2613
|
maxConsistentScrolls: 15
|
|
2614
2614
|
// Balanced threshold for flagging
|
|
2615
|
-
},
|
|
2615
|
+
}, Zi = {
|
|
2616
2616
|
maxVelocity: 200,
|
|
2617
2617
|
// Extremely fast scrolling (pixels/ms)
|
|
2618
2618
|
minVariance: 1e-5,
|
|
@@ -2623,7 +2623,7 @@ const Kn = {
|
|
|
2623
2623
|
// Only trigger on near-perfect patterns
|
|
2624
2624
|
maxConsistentScrolls: 20
|
|
2625
2625
|
// Need many consistent scrolls
|
|
2626
|
-
},
|
|
2626
|
+
}, Ji = {
|
|
2627
2627
|
maxSelectionsPerSecond: 500,
|
|
2628
2628
|
minVariance: 50,
|
|
2629
2629
|
historySize: 20
|
|
@@ -2667,7 +2667,7 @@ class Ue {
|
|
|
2667
2667
|
this.history = [], this.consistentScrollCount = 0;
|
|
2668
2668
|
}
|
|
2669
2669
|
}
|
|
2670
|
-
const
|
|
2670
|
+
const fi = "readium-column-snapper-style", Jn = 200, U = class U extends Rt {
|
|
2671
2671
|
constructor() {
|
|
2672
2672
|
super(...arguments), this.isSnapProtectionEnabled = !1, this.patternAnalyzer = null, this.lastTurnTime = 0, 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);
|
|
2673
2673
|
}
|
|
@@ -2705,7 +2705,7 @@ const mi = "readium-column-snapper-style", Jn = 200, U = class U extends Ct {
|
|
|
2705
2705
|
}
|
|
2706
2706
|
// Snaps the current offset to the page width.
|
|
2707
2707
|
snapCurrentOffset(t = !1, e = !1) {
|
|
2708
|
-
const i = this.wnd.scrollX > 0 ? this.wnd.scrollX : this.alreadyScrollLeft, n = this.doc(), r = this.dragOffset(), o =
|
|
2708
|
+
const i = this.wnd.scrollX > 0 ? this.wnd.scrollX : this.alreadyScrollLeft, n = this.doc(), r = this.dragOffset(), o = Xi(this.wnd), a = Math.min(Math.max(0, i), this.cachedScrollWidth), l = rt(this.wnd) ? -1 : 1, h = (
|
|
2709
2709
|
// The hurdle to overcome in order to change pages
|
|
2710
2710
|
l * (this.wnd.innerWidth / 3) * (l * r > 0 ? 2 : 1)
|
|
2711
2711
|
), c = this.snapOffset(a + h), u = c > this.scrollOffset() ? "right" : "left";
|
|
@@ -2791,7 +2791,7 @@ const mi = "readium-column-snapper-style", Jn = 200, U = class U extends Ct {
|
|
|
2791
2791
|
if (this.wnd = t, this.comms = e, !super.mount(t, e)) return !1;
|
|
2792
2792
|
t.navigator.epubReadingSystem && (t.navigator.epubReadingSystem.layoutStyle = "paginated");
|
|
2793
2793
|
const i = t.document.createElement("style");
|
|
2794
|
-
i.dataset.readium = "true", i.id =
|
|
2794
|
+
i.dataset.readium = "true", i.id = fi, i.textContent = `
|
|
2795
2795
|
@keyframes readium-bounce-l-animation {
|
|
2796
2796
|
0%, 100% {transform: translate3d(0, 0, 0);}
|
|
2797
2797
|
50% {transform: translate3d(-50px, 0, 0);}
|
|
@@ -2827,14 +2827,14 @@ const mi = "readium-column-snapper-style", Jn = 200, U = class U extends Ct {
|
|
|
2827
2827
|
}
|
|
2828
2828
|
`, t.document.head.appendChild(i), this.resizeObserver = new ResizeObserver(() => {
|
|
2829
2829
|
t.requestAnimationFrame(() => {
|
|
2830
|
-
t &&
|
|
2830
|
+
t && gi(t);
|
|
2831
2831
|
}), this.onWidthChange();
|
|
2832
2832
|
}), this.resizeObserver.observe(t.document.body), this.mutationObserver = new MutationObserver((r) => {
|
|
2833
2833
|
for (const o of r)
|
|
2834
2834
|
if (o.target === this.wnd.document.documentElement) {
|
|
2835
2835
|
const a = o.oldValue, l = o.target.getAttribute("style"), h = /transform\s*:\s*([^;]+)/, c = a?.match(h), u = l?.match(h);
|
|
2836
2836
|
(!c && !u || c && !u || c && u && c[1] !== u[1]) && (t.requestAnimationFrame(() => {
|
|
2837
|
-
t &&
|
|
2837
|
+
t && gi(t);
|
|
2838
2838
|
}), this.onWidthChange());
|
|
2839
2839
|
} else
|
|
2840
2840
|
t.requestAnimationFrame(() => this.cachedScrollWidth = this.doc().scrollWidth);
|
|
@@ -2870,7 +2870,7 @@ const mi = "readium-column-snapper-style", Jn = 200, U = class U extends Ct {
|
|
|
2870
2870
|
}), e.register("go_text", U.moduleName, (r, o) => {
|
|
2871
2871
|
let a;
|
|
2872
2872
|
Array.isArray(r) && (r.length > 1 && (a = r[1]), r = r[0]);
|
|
2873
|
-
const l =
|
|
2873
|
+
const l = at.deserialize(r), h = ie(this.wnd.document, new F({
|
|
2874
2874
|
href: t.location.href,
|
|
2875
2875
|
type: "text/html",
|
|
2876
2876
|
text: l,
|
|
@@ -2921,18 +2921,18 @@ const mi = "readium-column-snapper-style", Jn = 200, U = class U extends Ct {
|
|
|
2921
2921
|
this.cachedScrollWidth = this.doc().scrollWidth, this.snapCurrentOffset(!1, !0), this.reportProgress(), o(!0);
|
|
2922
2922
|
});
|
|
2923
2923
|
}), e.register("first_visible_locator", U.moduleName, (r, o) => {
|
|
2924
|
-
const a =
|
|
2924
|
+
const a = Ne(t, !1);
|
|
2925
2925
|
this.comms.send("first_visible_locator", a.serialize()), o(!0);
|
|
2926
2926
|
}), 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", () => {
|
|
2927
2927
|
}), e.log("ColumnSnapper Mounted"), !0;
|
|
2928
2928
|
}
|
|
2929
2929
|
unmount(t, e) {
|
|
2930
|
-
return this.snappingCancelled = !0, e.unregisterAll(U.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(
|
|
2930
|
+
return this.snappingCancelled = !0, e.unregisterAll(U.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(fi)?.remove(), e.log("ColumnSnapper Unmounted"), super.unmount(t, e);
|
|
2931
2931
|
}
|
|
2932
2932
|
};
|
|
2933
2933
|
U.moduleName = "column_snapper";
|
|
2934
2934
|
let ve = U;
|
|
2935
|
-
const
|
|
2935
|
+
const yi = "readium-scroll-snapper-style", W = class W extends Rt {
|
|
2936
2936
|
constructor() {
|
|
2937
2937
|
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) => {
|
|
2938
2938
|
if (this.comms.ready && !this.isResizing) {
|
|
@@ -2978,12 +2978,12 @@ const gi = "readium-scroll-snapper-style", W = class W extends Ct {
|
|
|
2978
2978
|
});
|
|
2979
2979
|
}
|
|
2980
2980
|
enableScrollProtection() {
|
|
2981
|
-
this.patternAnalyzer || (this.patternAnalyzer = new Ue(
|
|
2981
|
+
this.patternAnalyzer || (this.patternAnalyzer = new Ue(Zi), this.isScrollProtectionEnabled = !0, this.comms?.log("Scroll protection enabled"));
|
|
2982
2982
|
}
|
|
2983
2983
|
mount(t, e) {
|
|
2984
2984
|
this.wnd = t, this.comms = e, this.initialScrollHandled = !1, this.lastScrollTop = 0, this.isResizing = !1, this.resizeDebounce && (this.wnd.clearTimeout(this.resizeDebounce), this.resizeDebounce = null), t.navigator.epubReadingSystem && (t.navigator.epubReadingSystem.layoutStyle = "scrolling");
|
|
2985
2985
|
const i = t.document.createElement("style");
|
|
2986
|
-
return i.dataset.readium = "true", i.id =
|
|
2986
|
+
return i.dataset.readium = "true", i.id = yi, i.textContent = `
|
|
2987
2987
|
* {
|
|
2988
2988
|
scrollbar-width: none; /* for Firefox */
|
|
2989
2989
|
}
|
|
@@ -2996,7 +2996,7 @@ const gi = "readium-scroll-snapper-style", W = class W extends Ct {
|
|
|
2996
2996
|
this.isResizing = !1, this.resizeDebounce = null, this.reportProgress();
|
|
2997
2997
|
}, 50);
|
|
2998
2998
|
}), this.resizeObserver.observe(t.document.body), t.addEventListener("scroll", this.handleScroll, { passive: !0 }), e.register("force_webkit_recalc", W.moduleName, () => {
|
|
2999
|
-
|
|
2999
|
+
Yi(this.wnd);
|
|
3000
3000
|
const n = this.doc().scrollTop;
|
|
3001
3001
|
n > 1 ? this.doc().scrollTop = n - 1 : this.doc().scrollTop = n + 1, this.doc().scrollTop = n;
|
|
3002
3002
|
}), e.register("go_progression", W.moduleName, (n, r) => {
|
|
@@ -3022,7 +3022,7 @@ const gi = "readium-scroll-snapper-style", W = class W extends Ct {
|
|
|
3022
3022
|
}), e.register("go_text", W.moduleName, (n, r) => {
|
|
3023
3023
|
let o;
|
|
3024
3024
|
Array.isArray(n) && (n.length > 1 && (o = n[1]), n = n[0]);
|
|
3025
|
-
const a =
|
|
3025
|
+
const a = at.deserialize(n), l = ie(this.wnd.document, new F({
|
|
3026
3026
|
href: t.location.href,
|
|
3027
3027
|
type: "text/html",
|
|
3028
3028
|
text: a,
|
|
@@ -3055,17 +3055,17 @@ const gi = "readium-scroll-snapper-style", W = class W extends Ct {
|
|
|
3055
3055
|
], W.moduleName, (n, r) => r(!1)), e.register("focus", W.moduleName, (n, r) => {
|
|
3056
3056
|
this.reportProgress(), r(!0);
|
|
3057
3057
|
}), e.register("first_visible_locator", W.moduleName, (n, r) => {
|
|
3058
|
-
const o =
|
|
3058
|
+
const o = Ne(t, !0);
|
|
3059
3059
|
this.comms.send("first_visible_locator", o.serialize()), r(!0);
|
|
3060
3060
|
}), e.log("ScrollSnapper Mounted"), !0;
|
|
3061
3061
|
}
|
|
3062
3062
|
unmount(t, e) {
|
|
3063
|
-
return e.unregisterAll(W.moduleName), this.resizeObserver.disconnect(), this.handleScroll && t.removeEventListener("scroll", this.handleScroll), t.document.getElementById(
|
|
3063
|
+
return e.unregisterAll(W.moduleName), this.resizeObserver.disconnect(), this.handleScroll && t.removeEventListener("scroll", this.handleScroll), t.document.getElementById(yi)?.remove(), this.patternAnalyzer && (this.patternAnalyzer.clear(), this.patternAnalyzer = null, this.isScrollProtectionEnabled = !1), e.log("ScrollSnapper Unmounted"), !0;
|
|
3064
3064
|
}
|
|
3065
3065
|
};
|
|
3066
3066
|
W.moduleName = "scroll_snapper";
|
|
3067
3067
|
let we = W;
|
|
3068
|
-
const H = class H extends
|
|
3068
|
+
const H = class H extends Rt {
|
|
3069
3069
|
constructor() {
|
|
3070
3070
|
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) => {
|
|
3071
3071
|
if (this.comms.ready && !this.isResizing) {
|
|
@@ -3111,7 +3111,7 @@ const H = class H extends Ct {
|
|
|
3111
3111
|
});
|
|
3112
3112
|
}
|
|
3113
3113
|
enableScrollProtection() {
|
|
3114
|
-
this.patternAnalyzer || (this.patternAnalyzer = new Ue(
|
|
3114
|
+
this.patternAnalyzer || (this.patternAnalyzer = new Ue(Zi), this.isScrollProtectionEnabled = !0, this.comms?.log("Scroll protection enabled"));
|
|
3115
3115
|
}
|
|
3116
3116
|
mount(t, e) {
|
|
3117
3117
|
return this.wnd = t, this.comms = e, this.initialScrollHandled = !1, this.lastScrollTop = 0, this.isResizing = !1, this.resizeDebounce && (this.wnd.clearTimeout(this.resizeDebounce), this.resizeDebounce = null), this.resizeObserver = new ResizeObserver(() => {
|
|
@@ -3119,7 +3119,7 @@ const H = class H extends Ct {
|
|
|
3119
3119
|
this.isResizing = !1, this.resizeDebounce = null, this.reportProgress();
|
|
3120
3120
|
}, 50);
|
|
3121
3121
|
}), this.resizeObserver.observe(t.document.body), t.addEventListener("scroll", this.handleScroll, { passive: !0 }), e.register("force_webkit_recalc", H.moduleName, () => {
|
|
3122
|
-
|
|
3122
|
+
Yi(this.wnd);
|
|
3123
3123
|
const i = this.doc().scrollTop;
|
|
3124
3124
|
i > 1 ? this.doc().scrollTop = i - 1 : this.doc().scrollTop = i + 1, this.doc().scrollTop = i;
|
|
3125
3125
|
}), e.register("go_progression", H.moduleName, (i, n) => {
|
|
@@ -3145,7 +3145,7 @@ const H = class H extends Ct {
|
|
|
3145
3145
|
}), e.register("go_text", H.moduleName, (i, n) => {
|
|
3146
3146
|
let r;
|
|
3147
3147
|
Array.isArray(i) && (i.length > 1 && (r = i[1]), i = i[0]);
|
|
3148
|
-
const o =
|
|
3148
|
+
const o = at.deserialize(i), a = ie(this.wnd.document, new F({
|
|
3149
3149
|
href: t.location.href,
|
|
3150
3150
|
type: "text/html",
|
|
3151
3151
|
text: o,
|
|
@@ -3178,7 +3178,7 @@ const H = class H extends Ct {
|
|
|
3178
3178
|
], H.moduleName, (i, n) => n(!1)), e.register("focus", H.moduleName, (i, n) => {
|
|
3179
3179
|
this.reportProgress(), n(!0);
|
|
3180
3180
|
}), e.register("first_visible_locator", H.moduleName, (i, n) => {
|
|
3181
|
-
const r =
|
|
3181
|
+
const r = Ne(t, !0);
|
|
3182
3182
|
e.send("first_visible_locator", r.serialize()), n(!0);
|
|
3183
3183
|
}), e.log("WebPubSnapper Mounted"), !0;
|
|
3184
3184
|
}
|
|
@@ -3229,7 +3229,7 @@ class Qn {
|
|
|
3229
3229
|
}
|
|
3230
3230
|
}
|
|
3231
3231
|
class tr {
|
|
3232
|
-
constructor(t =
|
|
3232
|
+
constructor(t = Ji) {
|
|
3233
3233
|
this.options = t, this.events = [], this.selectionStartTime = 0, this.lastSelectionTime = 0, this.lastSelectionPosition = 0, this.selectionPatterns = [], this.lastSelectedText = "";
|
|
3234
3234
|
}
|
|
3235
3235
|
analyze(t) {
|
|
@@ -3270,7 +3270,7 @@ class tr {
|
|
|
3270
3270
|
this.events = [], this.selectionStartTime = 0, this.lastSelectionTime = 0, this.lastSelectionPosition = 0, this.selectionPatterns = [], this.lastSelectedText = "";
|
|
3271
3271
|
}
|
|
3272
3272
|
}
|
|
3273
|
-
class
|
|
3273
|
+
class Qi {
|
|
3274
3274
|
/**
|
|
3275
3275
|
* Checks if the given keyboard event matches any of the provided key combinations
|
|
3276
3276
|
*/
|
|
@@ -3348,9 +3348,9 @@ class Zi {
|
|
|
3348
3348
|
};
|
|
3349
3349
|
}
|
|
3350
3350
|
}
|
|
3351
|
-
const
|
|
3351
|
+
const gt = class gt extends bt {
|
|
3352
3352
|
constructor() {
|
|
3353
|
-
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
|
|
3353
|
+
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 Qi(), this.keyDownHandler = null, this.preventBulkCopy = (t) => {
|
|
3354
3354
|
if (!this.isBulkCopyProtectionEnabled || !this.bulkCopyProtector)
|
|
3355
3355
|
return !0;
|
|
3356
3356
|
if (!this.bulkCopyProtector.shouldAllowCopy(t)) {
|
|
@@ -3479,7 +3479,7 @@ const pt = class pt extends yt {
|
|
|
3479
3479
|
}
|
|
3480
3480
|
addSelectionMonitoring(t) {
|
|
3481
3481
|
if (this.isSelectionMonitoringEnabled || !this.wnd) return;
|
|
3482
|
-
const e = t ||
|
|
3482
|
+
const e = t || Ji;
|
|
3483
3483
|
this.selectionAnalyzer = new tr(e), this.wnd.document.addEventListener("selectionchange", this.handleSelection), this.isSelectionMonitoringEnabled = !0;
|
|
3484
3484
|
}
|
|
3485
3485
|
removeSelectionMonitoring() {
|
|
@@ -3513,7 +3513,7 @@ const pt = class pt extends yt {
|
|
|
3513
3513
|
y: t.clientY * i,
|
|
3514
3514
|
targetFrameSrc: this.wnd.location.href,
|
|
3515
3515
|
targetElement: t.target.outerHTML,
|
|
3516
|
-
interactiveElement:
|
|
3516
|
+
interactiveElement: qi(t.target)?.outerHTML,
|
|
3517
3517
|
cssSelector: this.wnd._readium_cssSelectorGenerator.getCssSelector(t.target)
|
|
3518
3518
|
}), this.pointerMoved = !1;
|
|
3519
3519
|
}
|
|
@@ -3540,7 +3540,7 @@ const pt = class pt extends yt {
|
|
|
3540
3540
|
}
|
|
3541
3541
|
}
|
|
3542
3542
|
registerProtectionHandlers() {
|
|
3543
|
-
this.comms?.register("peripherals_protection",
|
|
3543
|
+
this.comms?.register("peripherals_protection", gt.moduleName, (t, e) => {
|
|
3544
3544
|
const i = t;
|
|
3545
3545
|
if (!this.configApplied) {
|
|
3546
3546
|
if (this.configApplied = !0, i.monitorSelection) {
|
|
@@ -3558,7 +3558,7 @@ const pt = class pt extends yt {
|
|
|
3558
3558
|
}), this.comms?.log("Copy protection enabled")), i.disableContextMenu && (this.addContextMenuPrevention(), this.comms?.log("Context menu protection enabled")), i.disableDragAndDrop && (this.addDragAndDropPrevention(), this.comms?.log("Drag and drop protection enabled"));
|
|
3559
3559
|
}
|
|
3560
3560
|
e(!0);
|
|
3561
|
-
}), this.comms?.register("keyboard_peripherals",
|
|
3561
|
+
}), this.comms?.register("keyboard_peripherals", gt.moduleName, (t, e) => {
|
|
3562
3562
|
const i = t;
|
|
3563
3563
|
i && i.length > 0 && (this.enableKeyboardPeripherals(i), this.comms?.log(`Keyboard peripherals enabled: ${i.map((n) => n.type).join(", ")}`)), e(!0);
|
|
3564
3564
|
});
|
|
@@ -3567,12 +3567,12 @@ const pt = class pt extends yt {
|
|
|
3567
3567
|
return this.wnd = t, this.comms = e, this.registerProtectionHandlers(), t.document.addEventListener("pointerdown", this.onPointerDown), t.document.addEventListener("pointerup", this.onPointerUp), t.document.addEventListener("pointermove", this.onPointerMove), t.document.addEventListener("click", this.onClicker), e.log("Peripherals Mounted"), !0;
|
|
3568
3568
|
}
|
|
3569
3569
|
unmount(t, e) {
|
|
3570
|
-
return this.removeBulkCopyProtection(), this.removeSelectionMonitoring(), this.removeContextMenuPrevention(), this.removeDragAndDropPrevention(), this.disableKeyboardPeripherals(), this.cleanupCallbacks.forEach((i) => i()), this.cleanupCallbacks = [], t.document.removeEventListener("pointerdown", this.onPointerDown), t.document.removeEventListener("pointerup", this.onPointerUp), t.document.removeEventListener("pointermove", this.onPointerMove), t.document.removeEventListener("click", this.onClicker), e.unregisterAll(
|
|
3570
|
+
return this.removeBulkCopyProtection(), this.removeSelectionMonitoring(), this.removeContextMenuPrevention(), this.removeDragAndDropPrevention(), this.disableKeyboardPeripherals(), this.cleanupCallbacks.forEach((i) => i()), this.cleanupCallbacks = [], t.document.removeEventListener("pointerdown", this.onPointerDown), t.document.removeEventListener("pointerup", this.onPointerUp), t.document.removeEventListener("pointermove", this.onPointerMove), t.document.removeEventListener("click", this.onClicker), e.unregisterAll(gt.moduleName), this.configApplied = !1, e.log("Peripherals Unmounted"), !0;
|
|
3571
3571
|
}
|
|
3572
3572
|
};
|
|
3573
|
-
|
|
3574
|
-
let Pe =
|
|
3575
|
-
const
|
|
3573
|
+
gt.moduleName = "peripherals";
|
|
3574
|
+
let Pe = gt;
|
|
3575
|
+
const Ct = class Ct extends bt {
|
|
3576
3576
|
constructor() {
|
|
3577
3577
|
super(...arguments), this.mediaPlayingCount = 0, this.allAnimations = /* @__PURE__ */ new Set();
|
|
3578
3578
|
}
|
|
@@ -3622,7 +3622,7 @@ const Pt = class Pt extends yt {
|
|
|
3622
3622
|
), Reflect.defineProperty(t.navigator, "epubReadingSystem", {
|
|
3623
3623
|
value: {
|
|
3624
3624
|
name: "readium-ts-toolkit",
|
|
3625
|
-
version: "2.4.0-beta.
|
|
3625
|
+
version: "2.4.0-beta.2",
|
|
3626
3626
|
hasFeature: (n, r = "") => {
|
|
3627
3627
|
switch (n) {
|
|
3628
3628
|
case "dom-manipulation":
|
|
@@ -3647,11 +3647,11 @@ const Pt = class Pt extends yt {
|
|
|
3647
3647
|
writable: !1
|
|
3648
3648
|
}), "getAnimations" in t.document && t.document.getAnimations().forEach((n) => {
|
|
3649
3649
|
n.cancel(), this.allAnimations.add(n);
|
|
3650
|
-
}), e.register("activate",
|
|
3650
|
+
}), e.register("activate", Ct.moduleName, (n, r) => {
|
|
3651
3651
|
this.allAnimations.forEach((o) => {
|
|
3652
3652
|
o.cancel(), o.play();
|
|
3653
3653
|
}), r(!0);
|
|
3654
|
-
}), e.register("unfocus",
|
|
3654
|
+
}), e.register("unfocus", Ct.moduleName, (n, r) => {
|
|
3655
3655
|
this.pauseAllMedia(t), this.allAnimations.forEach((o) => o.pause()), r(!0);
|
|
3656
3656
|
});
|
|
3657
3657
|
const i = t.document.querySelectorAll("audio,video");
|
|
@@ -3669,28 +3669,28 @@ const Pt = class Pt extends yt {
|
|
|
3669
3669
|
return t.removeEventListener("error", this.wndOnErr), t.removeEventListener("play", this.onMediaPlayEvent), t.removeEventListener("pause", this.onMediaPauseEvent), this.allAnimations.forEach((i) => i.cancel()), this.allAnimations.clear(), e.log("Setup Unmounted"), !0;
|
|
3670
3670
|
}
|
|
3671
3671
|
};
|
|
3672
|
-
|
|
3673
|
-
let Bt =
|
|
3674
|
-
const
|
|
3672
|
+
Ct.moduleName = "setup";
|
|
3673
|
+
let Bt = Ct;
|
|
3674
|
+
const Si = "readium-viewport", K = class K extends Bt {
|
|
3675
3675
|
onViewportWidthChanged(t) {
|
|
3676
3676
|
const e = t.target;
|
|
3677
|
-
|
|
3677
|
+
xt(e, "--RS__viewportWidth", `${e.innerWidth}px`);
|
|
3678
3678
|
}
|
|
3679
3679
|
mount(t, e) {
|
|
3680
3680
|
if (!super.mount(t, e)) return !1;
|
|
3681
3681
|
const i = t.document.createElement("meta");
|
|
3682
|
-
return i.dataset.readium = "true", i.setAttribute("name", "viewport"), i.setAttribute("id",
|
|
3682
|
+
return i.dataset.readium = "true", i.setAttribute("name", "viewport"), i.setAttribute("id", Si), i.setAttribute(
|
|
3683
3683
|
"content",
|
|
3684
3684
|
"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no"
|
|
3685
3685
|
), t.document.head.appendChild(i), t.addEventListener("orientationchange", this.onViewportWidthChanged), t.addEventListener("resize", this.onViewportWidthChanged), this.onViewportWidthChanged({
|
|
3686
3686
|
target: t
|
|
3687
3687
|
}), e.register("get_properties", K.moduleName, (n, r) => {
|
|
3688
|
-
|
|
3688
|
+
Fe(t), r(!0);
|
|
3689
3689
|
}), e.register("update_properties", K.moduleName, (n, r) => {
|
|
3690
|
-
n["--RS__viewportWidth"] = `${t.innerWidth}px`,
|
|
3690
|
+
n["--RS__viewportWidth"] = `${t.innerWidth}px`, $i(t, n), r(!0);
|
|
3691
3691
|
}), e.register("set_property", K.moduleName, (n, r) => {
|
|
3692
3692
|
const o = n;
|
|
3693
|
-
|
|
3693
|
+
xt(t, o[0], o[1]), r(!0);
|
|
3694
3694
|
}), e.register("remove_property", K.moduleName, (n, r) => {
|
|
3695
3695
|
ne(t, n), r(!0);
|
|
3696
3696
|
}), e.register("activate", K.moduleName, (n, r) => {
|
|
@@ -3698,17 +3698,17 @@ const fi = "readium-viewport", K = class K extends Bt {
|
|
|
3698
3698
|
}), e.log("ReflowableSetup Mounted"), !0;
|
|
3699
3699
|
}
|
|
3700
3700
|
unmount(t, e) {
|
|
3701
|
-
return e.unregisterAll(K.moduleName), t.document.head.querySelector(`#${
|
|
3701
|
+
return e.unregisterAll(K.moduleName), t.document.head.querySelector(`#${Si}`)?.remove(), t.removeEventListener("orientationchange", this.onViewportWidthChanged), e.log("ReflowableSetup Unmounted"), super.unmount(t, e);
|
|
3702
3702
|
}
|
|
3703
3703
|
};
|
|
3704
3704
|
K.moduleName = "reflowable_setup";
|
|
3705
3705
|
let Ee = K;
|
|
3706
|
-
const
|
|
3706
|
+
const bi = "readium-fixed-style", X = class X extends Bt {
|
|
3707
3707
|
mount(t, e) {
|
|
3708
3708
|
if (!super.mount(t, e)) return !1;
|
|
3709
3709
|
t.navigator.epubReadingSystem && (t.navigator.epubReadingSystem.layoutStyle = "paginated");
|
|
3710
3710
|
const i = t.document.createElement("style");
|
|
3711
|
-
return i.id =
|
|
3711
|
+
return i.id = bi, i.dataset.readium = "true", i.textContent = `
|
|
3712
3712
|
html, body {
|
|
3713
3713
|
text-size-adjust: none;
|
|
3714
3714
|
-ms-text-size-adjust: none;
|
|
@@ -3722,7 +3722,7 @@ const yi = "readium-fixed-style", X = class X extends Bt {
|
|
|
3722
3722
|
/*cursor: var() TODO*/
|
|
3723
3723
|
}`, t.document.head.appendChild(i), e.register("set_property", X.moduleName, (n, r) => {
|
|
3724
3724
|
const o = n;
|
|
3725
|
-
|
|
3725
|
+
xt(t, o[0], o[1]), r(!0);
|
|
3726
3726
|
}), e.register("remove_property", X.moduleName, (n, r) => {
|
|
3727
3727
|
ne(t, n), r(!0);
|
|
3728
3728
|
}), e.register("first_visible_locator", X.moduleName, (n, r) => r(!1)), e.register("unfocus", X.moduleName, (n, r) => {
|
|
@@ -3741,12 +3741,12 @@ const yi = "readium-fixed-style", X = class X extends Bt {
|
|
|
3741
3741
|
}), e.log("FixedSetup Mounted"), !0;
|
|
3742
3742
|
}
|
|
3743
3743
|
unmount(t, e) {
|
|
3744
|
-
return e.unregisterAll(X.moduleName), t.document.getElementById(
|
|
3744
|
+
return e.unregisterAll(X.moduleName), t.document.getElementById(bi)?.remove(), e.log("FixedSetup Unmounted"), super.unmount(t, e);
|
|
3745
3745
|
}
|
|
3746
3746
|
};
|
|
3747
3747
|
X.moduleName = "fixed_setup";
|
|
3748
3748
|
let Ce = X;
|
|
3749
|
-
const Z = class Z extends
|
|
3749
|
+
const Z = class Z extends bt {
|
|
3750
3750
|
wndOnErr(t) {
|
|
3751
3751
|
this.comms?.send("error", {
|
|
3752
3752
|
message: t.message,
|
|
@@ -3761,12 +3761,12 @@ const Z = class Z extends yt {
|
|
|
3761
3761
|
this.wndOnErr,
|
|
3762
3762
|
!1
|
|
3763
3763
|
), e.register("get_properties", Z.moduleName, (i, n) => {
|
|
3764
|
-
|
|
3764
|
+
Fe(t), n(!0);
|
|
3765
3765
|
}), e.register("update_properties", Z.moduleName, (i, n) => {
|
|
3766
|
-
|
|
3766
|
+
$i(t, i), n(!0);
|
|
3767
3767
|
}), e.register("set_property", Z.moduleName, (i, n) => {
|
|
3768
3768
|
const r = i;
|
|
3769
|
-
|
|
3769
|
+
xt(t, r[0], r[1]), n(!0);
|
|
3770
3770
|
}), e.register("remove_property", Z.moduleName, (i, n) => {
|
|
3771
3771
|
ne(t, i), n(!0);
|
|
3772
3772
|
}), e.register("activate", Z.moduleName, (i, n) => {
|
|
@@ -3780,7 +3780,7 @@ const Z = class Z extends yt {
|
|
|
3780
3780
|
Z.moduleName = "webpub_setup";
|
|
3781
3781
|
let xe = Z;
|
|
3782
3782
|
var it;
|
|
3783
|
-
let er = (it = class extends
|
|
3783
|
+
let er = (it = class extends bt {
|
|
3784
3784
|
constructor() {
|
|
3785
3785
|
super(...arguments), this.styleElement = null, this.beforePrintHandler = null, this.configApplied = !1;
|
|
3786
3786
|
}
|
|
@@ -3846,7 +3846,7 @@ const ir = [
|
|
|
3846
3846
|
we,
|
|
3847
3847
|
er
|
|
3848
3848
|
].map((s) => [s.moduleName, s]));
|
|
3849
|
-
class
|
|
3849
|
+
class St {
|
|
3850
3850
|
/**
|
|
3851
3851
|
* @param wnd Window instance to operate on
|
|
3852
3852
|
* @param initialModules List of initial modules to load
|
|
@@ -3953,7 +3953,7 @@ const sr = {
|
|
|
3953
3953
|
// S key (Ctrl+S)
|
|
3954
3954
|
]
|
|
3955
3955
|
};
|
|
3956
|
-
class
|
|
3956
|
+
class tn {
|
|
3957
3957
|
/**
|
|
3958
3958
|
* Merges keyboard peripherals from content protection config with user-provided peripherals
|
|
3959
3959
|
* Content protection peripherals are added first for priority, then user peripherals are added only if they don't conflict
|
|
@@ -3979,7 +3979,7 @@ class Ji {
|
|
|
3979
3979
|
return i;
|
|
3980
3980
|
}
|
|
3981
3981
|
}
|
|
3982
|
-
class
|
|
3982
|
+
class en extends tn {
|
|
3983
3983
|
/**
|
|
3984
3984
|
* Moves to the left content portion (eg. page) relative to the reading progression direction.
|
|
3985
3985
|
*/
|
|
@@ -3993,7 +3993,7 @@ class Qi extends Ji {
|
|
|
3993
3993
|
this.readingProgression === D.ltr ? this.goForward(t, e) : this.readingProgression === D.rtl && this.goBackward(t, e);
|
|
3994
3994
|
}
|
|
3995
3995
|
}
|
|
3996
|
-
class hr extends
|
|
3996
|
+
class hr extends tn {
|
|
3997
3997
|
}
|
|
3998
3998
|
class cr {
|
|
3999
3999
|
constructor(t, e, i, n) {
|
|
@@ -4046,7 +4046,7 @@ class cr {
|
|
|
4046
4046
|
}
|
|
4047
4047
|
}
|
|
4048
4048
|
const dr = 1e4;
|
|
4049
|
-
class
|
|
4049
|
+
class Lt {
|
|
4050
4050
|
constructor(t, e) {
|
|
4051
4051
|
this.registry = /* @__PURE__ */ new Map(), this._ready = !1, this.listenerBuffer = [], this.handler = this.handle.bind(this), this.wnd = t, this.origin = e;
|
|
4052
4052
|
try {
|
|
@@ -4112,7 +4112,7 @@ class xt {
|
|
|
4112
4112
|
key: t
|
|
4113
4113
|
}), this.wnd.postMessage(
|
|
4114
4114
|
{
|
|
4115
|
-
_readium:
|
|
4115
|
+
_readium: ut,
|
|
4116
4116
|
_channel: this.channelId,
|
|
4117
4117
|
id: o,
|
|
4118
4118
|
data: e,
|
|
@@ -4127,10 +4127,10 @@ class xt {
|
|
|
4127
4127
|
}
|
|
4128
4128
|
const ur = "'Iowan Old Style', Sitka, 'Sitka Text', Palatino, 'Book Antiqua', 'URW Palladio L', P052, serif", pr = {
|
|
4129
4129
|
RS__oldStyleTf: ur
|
|
4130
|
-
}, mr = 16,
|
|
4131
|
-
class
|
|
4130
|
+
}, mr = 16, vi = pr.RS__oldStyleTf;
|
|
4131
|
+
class _t {
|
|
4132
4132
|
constructor(t) {
|
|
4133
|
-
this._optimalLineLength = null, this._canvas = document.createElement("canvas"), this._optimalChars = t.optimalChars, this._minChars = t.minChars, this._maxChars = t.maxChars, this._baseFontSize = t.baseFontSize || mr, this._fontFace = t.fontFace ||
|
|
4133
|
+
this._optimalLineLength = null, this._canvas = document.createElement("canvas"), this._optimalChars = t.optimalChars, this._minChars = t.minChars, this._maxChars = t.maxChars, this._baseFontSize = t.baseFontSize || mr, this._fontFace = t.fontFace || vi, 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 = _t.approximateWordSpaces(this._optimalChars, this._sample);
|
|
4134
4134
|
}
|
|
4135
4135
|
updateMultipliers() {
|
|
4136
4136
|
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;
|
|
@@ -4139,7 +4139,7 @@ class vt {
|
|
|
4139
4139
|
// Not filtering because pretty much everything can
|
|
4140
4140
|
// trigger a recomputation anyway.
|
|
4141
4141
|
update(t) {
|
|
4142
|
-
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 ||
|
|
4142
|
+
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 || vi), 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 = _t.approximateWordSpaces(this._optimalChars, this._sample)), this.updateMultipliers(), this._optimalLineLength = this.getOptimalLineLength();
|
|
4143
4143
|
}
|
|
4144
4144
|
get baseFontSize() {
|
|
4145
4145
|
return this._baseFontSize;
|
|
@@ -4195,17 +4195,17 @@ class vt {
|
|
|
4195
4195
|
if (e.font = `${this._baseFontSize}px ${t}`, this._sample && this._sample.length >= this._optimalChars && (i = this._sample.slice(0, this._optimalChars)), Object.hasOwn(e, "letterSpacing") && Object.hasOwn(e, "wordSpacing"))
|
|
4196
4196
|
return e.letterSpacing = this._letterSpacing.toString() + "px", e.wordSpacing = this._wordSpacing.toString() + "px", e.measureText(i).width;
|
|
4197
4197
|
{
|
|
4198
|
-
const n = this._letterSpacing * (this._optimalChars - 1), r = this._wordSpacing *
|
|
4198
|
+
const n = this._letterSpacing * (this._optimalChars - 1), r = this._wordSpacing * _t.approximateWordSpaces(this._optimalChars, this._sample);
|
|
4199
4199
|
return e.measureText(i).width + n + r;
|
|
4200
4200
|
}
|
|
4201
4201
|
} else
|
|
4202
4202
|
return this.getLineLengthFallback();
|
|
4203
4203
|
}
|
|
4204
4204
|
}
|
|
4205
|
-
const
|
|
4206
|
-
class
|
|
4205
|
+
const nn = () => typeof navigator > "u" ? "" : navigator.userAgent || "", rn = () => typeof navigator > "u" ? void 0 : navigator.userAgentData || void 0;
|
|
4206
|
+
class sn {
|
|
4207
4207
|
constructor() {
|
|
4208
|
-
const t =
|
|
4208
|
+
const t = rn(), e = nn(), i = (r) => (typeof r == "string" || typeof r == "number") && r ? String(r).replace(/_/g, ".").split(".").map((o) => parseInt(o) || 0) : [], n = (r = "") => {
|
|
4209
4209
|
if (!r) return [];
|
|
4210
4210
|
const o = new RegExp("^.*" + r + "[ :\\/]?(\\d+([\\._]\\d+)*).*$");
|
|
4211
4211
|
return o.test(e) ? i(e.replace(o, "$1")) : [];
|
|
@@ -4236,16 +4236,16 @@ class nn {
|
|
|
4236
4236
|
}, []) };
|
|
4237
4237
|
}
|
|
4238
4238
|
}
|
|
4239
|
-
class gr extends
|
|
4239
|
+
class gr extends sn {
|
|
4240
4240
|
get iOSRequest() {
|
|
4241
|
-
const t =
|
|
4241
|
+
const t = rn(), e = nn();
|
|
4242
4242
|
if (this.OS.iOS && !this.OS.iPadOS)
|
|
4243
4243
|
return "mobile";
|
|
4244
4244
|
if (this.OS.iPadOS)
|
|
4245
4245
|
return /\(iPad;/.test(e) || t && /^iPad(OS)?$/.test(t.platform) ? "mobile" : "desktop";
|
|
4246
4246
|
}
|
|
4247
4247
|
}
|
|
4248
|
-
const q = new
|
|
4248
|
+
const q = new sn(), T = new gr();
|
|
4249
4249
|
class fr {
|
|
4250
4250
|
constructor(t, e = {}, i = []) {
|
|
4251
4251
|
this.hidden = !0, this.destroyed = !1, this.currModules = [], this.frame = document.createElement("iframe"), this.frame.classList.add("readium-navigator-iframe"), this.frame.style.visibility = "hidden", this.frame.style.setProperty("aria-hidden", "true"), this.frame.style.opacity = "0", this.frame.style.position = "absolute", this.frame.style.pointerEvents = "none", this.frame.style.transition = "visibility 0s, opacity 0.1s linear", this.frame.style.backgroundColor = "#FFFFFF", this.source = t, this.contentProtectionConfig = { ...e }, this.keyboardPeripheralsConfig = [...i];
|
|
@@ -4261,7 +4261,7 @@ class fr {
|
|
|
4261
4261
|
}
|
|
4262
4262
|
return;
|
|
4263
4263
|
}
|
|
4264
|
-
this.comms?.halt(), this.loader.destroy(), this.loader = new
|
|
4264
|
+
this.comms?.halt(), this.loader.destroy(), this.loader = new St(n, t), this.currModules = t, this.comms = void 0;
|
|
4265
4265
|
try {
|
|
4266
4266
|
e(n);
|
|
4267
4267
|
} catch {
|
|
@@ -4270,7 +4270,7 @@ class fr {
|
|
|
4270
4270
|
}
|
|
4271
4271
|
this.frame.onload = () => {
|
|
4272
4272
|
const n = this.frame.contentWindow;
|
|
4273
|
-
this.loader = new
|
|
4273
|
+
this.loader = new St(n, t), this.currModules = t;
|
|
4274
4274
|
try {
|
|
4275
4275
|
e(n);
|
|
4276
4276
|
} catch {
|
|
@@ -4303,7 +4303,7 @@ class fr {
|
|
|
4303
4303
|
async show(t) {
|
|
4304
4304
|
if (this.destroyed) throw Error("Trying to show frame when it doesn't exist");
|
|
4305
4305
|
if (!this.frame.parentElement) throw Error("Trying to show frame that is not attached to the DOM");
|
|
4306
|
-
return this.comms ? this.comms.resume() : this.comms = new
|
|
4306
|
+
return this.comms ? this.comms.resume() : this.comms = new Lt(this.frame.contentWindow, this.source), new Promise((e, i) => {
|
|
4307
4307
|
this.comms?.send("activate", void 0, () => {
|
|
4308
4308
|
this.comms?.send("focus", void 0, () => {
|
|
4309
4309
|
this.applyContentProtection();
|
|
@@ -4316,7 +4316,7 @@ class fr {
|
|
|
4316
4316
|
});
|
|
4317
4317
|
}
|
|
4318
4318
|
setCSSProperties(t) {
|
|
4319
|
-
this.destroyed || !this.frame.contentWindow || (this.hidden && (this.comms ? this.comms?.resume() : this.comms = new
|
|
4319
|
+
this.destroyed || !this.frame.contentWindow || (this.hidden && (this.comms ? this.comms?.resume() : this.comms = new Lt(this.frame.contentWindow, this.source)), this.comms?.send("update_properties", t), this.hidden && this.comms?.halt());
|
|
4320
4320
|
}
|
|
4321
4321
|
get iframe() {
|
|
4322
4322
|
if (this.destroyed) throw Error("Trying to use frame when it doesn't exist");
|
|
@@ -4453,10 +4453,10 @@ class yr {
|
|
|
4453
4453
|
}), t;
|
|
4454
4454
|
}
|
|
4455
4455
|
}
|
|
4456
|
-
var de,
|
|
4456
|
+
var de, wi;
|
|
4457
4457
|
function Sr() {
|
|
4458
|
-
if (
|
|
4459
|
-
|
|
4458
|
+
if (wi) return de;
|
|
4459
|
+
wi = 1;
|
|
4460
4460
|
function s(n) {
|
|
4461
4461
|
if (typeof n != "string")
|
|
4462
4462
|
throw new TypeError("Path must be a string. Received " + JSON.stringify(n));
|
|
@@ -4647,7 +4647,7 @@ const br = { description: "Attempts to filter out paragraphs that are implicitly
|
|
|
4647
4647
|
experimentalZoom: vr
|
|
4648
4648
|
}, Ie = wr;
|
|
4649
4649
|
var J = /* @__PURE__ */ ((s) => (s.start = "start", s.left = "left", s.right = "right", s.justify = "justify", s))(J || {});
|
|
4650
|
-
const
|
|
4650
|
+
const ht = {
|
|
4651
4651
|
range: [0, 100],
|
|
4652
4652
|
step: 1
|
|
4653
4653
|
}, Gt = {
|
|
@@ -4665,7 +4665,7 @@ const at = {
|
|
|
4665
4665
|
}, Yt = {
|
|
4666
4666
|
range: [1, 2],
|
|
4667
4667
|
step: 0.1
|
|
4668
|
-
},
|
|
4668
|
+
}, ct = {
|
|
4669
4669
|
range: [20, 100],
|
|
4670
4670
|
step: 1
|
|
4671
4671
|
}, qt = {
|
|
@@ -4717,7 +4717,7 @@ class re {
|
|
|
4717
4717
|
return `${t}rem`;
|
|
4718
4718
|
}
|
|
4719
4719
|
}
|
|
4720
|
-
class
|
|
4720
|
+
class on extends re {
|
|
4721
4721
|
constructor(t) {
|
|
4722
4722
|
super(), this.a11yNormalize = t.a11yNormalize ?? null, this.bodyHyphens = t.bodyHyphens ?? null, this.fontFamily = t.fontFamily ?? null, this.fontWeight = t.fontWeight ?? null, this.iOSPatch = t.iOSPatch ?? null, this.iPadOSPatch = t.iPadOSPatch ?? null, this.letterSpacing = t.letterSpacing ?? null, this.ligatures = t.ligatures ?? null, this.lineHeight = t.lineHeight ?? null, this.noRuby = t.noRuby ?? null, this.paraIndent = t.paraIndent ?? null, this.paraSpacing = t.paraSpacing ?? null, this.textAlign = t.textAlign ?? null, this.wordSpacing = t.wordSpacing ?? null, this.zoom = t.zoom ?? null;
|
|
4723
4723
|
}
|
|
@@ -4760,7 +4760,7 @@ class Pr {
|
|
|
4760
4760
|
wordSpacing: t.wordSpacing,
|
|
4761
4761
|
zoom: t.zoom
|
|
4762
4762
|
};
|
|
4763
|
-
this.userProperties = new
|
|
4763
|
+
this.userProperties = new on(e);
|
|
4764
4764
|
}
|
|
4765
4765
|
}
|
|
4766
4766
|
function Er(s, t) {
|
|
@@ -4779,7 +4779,7 @@ function se(s, t) {
|
|
|
4779
4779
|
if (s !== void 0)
|
|
4780
4780
|
return s === null ? null : t[s] !== void 0 ? s : void 0;
|
|
4781
4781
|
}
|
|
4782
|
-
function
|
|
4782
|
+
function ft(s) {
|
|
4783
4783
|
return typeof s == "boolean" || typeof s == "number" && s >= 0 ? s : s === null ? null : void 0;
|
|
4784
4784
|
}
|
|
4785
4785
|
function w(s) {
|
|
@@ -4797,11 +4797,11 @@ function M(s, t) {
|
|
|
4797
4797
|
function ue(s, t) {
|
|
4798
4798
|
return s === void 0 ? t : s;
|
|
4799
4799
|
}
|
|
4800
|
-
function
|
|
4800
|
+
function an(s) {
|
|
4801
4801
|
if (s !== void 0)
|
|
4802
4802
|
return s === null ? null : s.filter((t) => t in Ie);
|
|
4803
4803
|
}
|
|
4804
|
-
class
|
|
4804
|
+
class kt {
|
|
4805
4805
|
constructor(t = {}) {
|
|
4806
4806
|
this.fontFamily = I(t.fontFamily), this.fontWeight = M(t.fontWeight, nt.range), this.hyphens = P(t.hyphens), this.iOSPatch = P(t.iOSPatch), this.iPadOSPatch = P(t.iPadOSPatch), this.letterSpacing = w(t.letterSpacing), this.ligatures = P(t.ligatures), this.lineHeight = w(t.lineHeight), this.noRuby = P(t.noRuby), this.paragraphIndent = w(t.paragraphIndent), this.paragraphSpacing = w(t.paragraphSpacing), this.textAlign = se(t.textAlign, J), this.textNormalization = P(t.textNormalization), this.wordSpacing = w(t.wordSpacing), this.zoom = M(t.zoom, Jt.range);
|
|
4807
4807
|
}
|
|
@@ -4812,7 +4812,7 @@ class Rt {
|
|
|
4812
4812
|
static deserialize(t) {
|
|
4813
4813
|
try {
|
|
4814
4814
|
const e = JSON.parse(t);
|
|
4815
|
-
return new
|
|
4815
|
+
return new kt(e);
|
|
4816
4816
|
} catch (e) {
|
|
4817
4817
|
return console.error("Failed to deserialize preferences:", e), null;
|
|
4818
4818
|
}
|
|
@@ -4821,15 +4821,15 @@ class Rt {
|
|
|
4821
4821
|
const e = { ...this };
|
|
4822
4822
|
for (const i of Object.keys(t))
|
|
4823
4823
|
t[i] !== void 0 && (e[i] = t[i]);
|
|
4824
|
-
return new
|
|
4824
|
+
return new kt(e);
|
|
4825
4825
|
}
|
|
4826
4826
|
}
|
|
4827
4827
|
class xr {
|
|
4828
4828
|
constructor(t) {
|
|
4829
|
-
this.fontFamily = I(t.fontFamily) || null, this.fontWeight = M(t.fontWeight, nt.range) || null, this.hyphens = P(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 = w(t.letterSpacing) || null, this.ligatures = P(t.ligatures) ?? null, this.lineHeight = w(t.lineHeight) || null, this.noRuby = P(t.noRuby) ?? !1, this.paragraphIndent = w(t.paragraphIndent) ?? null, this.paragraphSpacing = w(t.paragraphSpacing) ?? null, this.textAlign = se(t.textAlign, J) || null, this.textNormalization = P(t.textNormalization) ?? !1, this.wordSpacing = w(t.wordSpacing) || null, this.zoom = M(t.zoom, Jt.range) || 1, this.experiments =
|
|
4829
|
+
this.fontFamily = I(t.fontFamily) || null, this.fontWeight = M(t.fontWeight, nt.range) || null, this.hyphens = P(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 = w(t.letterSpacing) || null, this.ligatures = P(t.ligatures) ?? null, this.lineHeight = w(t.lineHeight) || null, this.noRuby = P(t.noRuby) ?? !1, this.paragraphIndent = w(t.paragraphIndent) ?? null, this.paragraphSpacing = w(t.paragraphSpacing) ?? null, this.textAlign = se(t.textAlign, J) || null, this.textNormalization = P(t.textNormalization) ?? !1, this.wordSpacing = w(t.wordSpacing) || null, this.zoom = M(t.zoom, Jt.range) || 1, this.experiments = an(t.experiments) ?? null;
|
|
4830
4830
|
}
|
|
4831
4831
|
}
|
|
4832
|
-
class
|
|
4832
|
+
class _i {
|
|
4833
4833
|
constructor(t, e, i) {
|
|
4834
4834
|
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;
|
|
4835
4835
|
}
|
|
@@ -4879,7 +4879,7 @@ class O extends A {
|
|
|
4879
4879
|
this._value = !this._value, this._onChange(this._value);
|
|
4880
4880
|
}
|
|
4881
4881
|
}
|
|
4882
|
-
class
|
|
4882
|
+
class ln extends A {
|
|
4883
4883
|
constructor({
|
|
4884
4884
|
initialValue: t = null,
|
|
4885
4885
|
effectiveValue: e,
|
|
@@ -4960,12 +4960,12 @@ class R extends A {
|
|
|
4960
4960
|
this._value = null;
|
|
4961
4961
|
}
|
|
4962
4962
|
}
|
|
4963
|
-
class
|
|
4963
|
+
class Pi {
|
|
4964
4964
|
constructor(t, e, i) {
|
|
4965
4965
|
this.preferences = t, this.settings = e, this.metadata = i;
|
|
4966
4966
|
}
|
|
4967
4967
|
clear() {
|
|
4968
|
-
this.preferences = new
|
|
4968
|
+
this.preferences = new kt({});
|
|
4969
4969
|
}
|
|
4970
4970
|
updatePreference(t, e) {
|
|
4971
4971
|
this.preferences[t] = e;
|
|
@@ -5096,7 +5096,7 @@ class wi {
|
|
|
5096
5096
|
});
|
|
5097
5097
|
}
|
|
5098
5098
|
get textAlign() {
|
|
5099
|
-
return new
|
|
5099
|
+
return new ln({
|
|
5100
5100
|
initialValue: this.preferences.textAlign,
|
|
5101
5101
|
effectiveValue: this.settings.textAlign || J.start,
|
|
5102
5102
|
isEffective: this.isDisplayTransformable,
|
|
@@ -5141,7 +5141,7 @@ class wi {
|
|
|
5141
5141
|
});
|
|
5142
5142
|
}
|
|
5143
5143
|
}
|
|
5144
|
-
const
|
|
5144
|
+
const hn = (s) => {
|
|
5145
5145
|
if ("blob" in s && s.blob.type)
|
|
5146
5146
|
return s.blob.type;
|
|
5147
5147
|
if (s.as === "script")
|
|
@@ -5151,22 +5151,22 @@ const an = (s) => {
|
|
|
5151
5151
|
if (t.endsWith(".css")) return "text/css";
|
|
5152
5152
|
if ([".js", ".mjs", ".cjs"].some((e) => t.endsWith(e))) return "text/javascript";
|
|
5153
5153
|
}
|
|
5154
|
-
},
|
|
5154
|
+
}, cn = (s, t) => {
|
|
5155
5155
|
t.attributes && Object.entries(t.attributes).forEach(([e, i]) => {
|
|
5156
5156
|
e === "type" || e === "rel" || e === "href" || e === "src" || i != null && (typeof i == "boolean" ? i && s.setAttribute(e, "") : s.setAttribute(e, i));
|
|
5157
5157
|
});
|
|
5158
5158
|
}, Rr = (s, t, e) => {
|
|
5159
5159
|
const i = s.createElement("script");
|
|
5160
5160
|
i.dataset.readium = "true", t.id && (i.id = t.id);
|
|
5161
|
-
const n = t.type ||
|
|
5162
|
-
return n && (i.type = n),
|
|
5163
|
-
},
|
|
5161
|
+
const n = t.type || hn(t);
|
|
5162
|
+
return n && (i.type = n), cn(i, t), i.src = e, i;
|
|
5163
|
+
}, Ei = (s, t, e) => {
|
|
5164
5164
|
const i = s.createElement("link");
|
|
5165
5165
|
i.dataset.readium = "true", t.id && (i.id = t.id), t.rel && (i.rel = t.rel);
|
|
5166
|
-
const n = t.type ||
|
|
5167
|
-
return n && (i.type = n),
|
|
5166
|
+
const n = t.type || hn(t);
|
|
5167
|
+
return n && (i.type = n), cn(i, t), i.href = e, i;
|
|
5168
5168
|
};
|
|
5169
|
-
class
|
|
5169
|
+
class dn {
|
|
5170
5170
|
constructor(t) {
|
|
5171
5171
|
this.blobStore = /* @__PURE__ */ new Map(), this.createdBlobUrls = /* @__PURE__ */ new Set(), this.allowedDomains = [], this.injectableIdCounter = 0, this.allowedDomains = (t.allowedDomains || []).map((e) => {
|
|
5172
5172
|
try {
|
|
@@ -5247,14 +5247,14 @@ class hn {
|
|
|
5247
5247
|
...e.attributes,
|
|
5248
5248
|
as: e.as
|
|
5249
5249
|
}
|
|
5250
|
-
}, r =
|
|
5250
|
+
}, r = Ei(t, n, i);
|
|
5251
5251
|
t.head.appendChild(r);
|
|
5252
5252
|
}
|
|
5253
5253
|
createElement(t, e, i) {
|
|
5254
5254
|
if (e.as === "script")
|
|
5255
5255
|
return Rr(t, e, i);
|
|
5256
5256
|
if (e.as === "link")
|
|
5257
|
-
return
|
|
5257
|
+
return Ei(t, e, i);
|
|
5258
5258
|
throw new Error(`Unsupported element type: ${e.as}`);
|
|
5259
5259
|
}
|
|
5260
5260
|
async applyRule(t, e) {
|
|
@@ -5311,7 +5311,7 @@ class hn {
|
|
|
5311
5311
|
}
|
|
5312
5312
|
}
|
|
5313
5313
|
}
|
|
5314
|
-
const
|
|
5314
|
+
const yt = (s) => s.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").replace(/\n/g, "").replace(/\s+/g, " "), Ft = (s) => s.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g, "").replace(/ {2,}/g, " "), Lr = `/*!
|
|
5315
5315
|
* Readium CSS v.2.0.0
|
|
5316
5316
|
* Copyright (c) 2017–2026. Readium Foundation. All rights reserved.
|
|
5317
5317
|
* Use of this source code is governed by a BSD-style license which is detailed in the
|
|
@@ -5585,11 +5585,11 @@ const gt = (s) => s.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").repl
|
|
|
5585
5585
|
|
|
5586
5586
|
:root[style*="readium-iPadOSPatch-on"] p:not(:has(b, cite, em, i, q, s, small, span, strong)):first-line{
|
|
5587
5587
|
-webkit-text-zoom:normal;
|
|
5588
|
-
}`,
|
|
5588
|
+
}`, un = '!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})()));', kr = `// WebPub-specific setup - no execution blocking needed
|
|
5589
5589
|
window._readium_blockedEvents = [];
|
|
5590
5590
|
window._readium_blockEvents = false; // WebPub doesn't need event blocking
|
|
5591
5591
|
window._readium_eventBlocker = null;
|
|
5592
|
-
`,
|
|
5592
|
+
`, pn = `(function() {
|
|
5593
5593
|
if(window.onload) window.onload = new Proxy(window.onload, {
|
|
5594
5594
|
apply: function(target, receiver, args) {
|
|
5595
5595
|
if(!window._readium_blockEvents) {
|
|
@@ -5610,14 +5610,14 @@ function Or(s) {
|
|
|
5610
5610
|
id: "css-selector-generator",
|
|
5611
5611
|
as: "script",
|
|
5612
5612
|
target: "head",
|
|
5613
|
-
blob: new Blob([
|
|
5613
|
+
blob: new Blob([yt(un)], { type: "text/javascript" })
|
|
5614
5614
|
},
|
|
5615
5615
|
// WebPub Execution - always injected (sets up event blocking to false)
|
|
5616
5616
|
{
|
|
5617
5617
|
id: "webpub-execution",
|
|
5618
5618
|
as: "script",
|
|
5619
5619
|
target: "head",
|
|
5620
|
-
blob: new Blob([
|
|
5620
|
+
blob: new Blob([yt(kr)], { type: "text/javascript" })
|
|
5621
5621
|
}
|
|
5622
5622
|
], n = [
|
|
5623
5623
|
// Onload Proxy - conditional (has executable scripts)
|
|
@@ -5625,7 +5625,7 @@ function Or(s) {
|
|
|
5625
5625
|
id: "onload-proxy",
|
|
5626
5626
|
as: "script",
|
|
5627
5627
|
target: "head",
|
|
5628
|
-
blob: new Blob([
|
|
5628
|
+
blob: new Blob([yt(pn)], { type: "text/javascript" }),
|
|
5629
5629
|
condition: (r) => !!(r.querySelector("script") || r.querySelector("body[onload]:not(body[onload=''])"))
|
|
5630
5630
|
},
|
|
5631
5631
|
// Readium CSS WebPub - always injected
|
|
@@ -5633,7 +5633,7 @@ function Or(s) {
|
|
|
5633
5633
|
id: "readium-css-webpub",
|
|
5634
5634
|
as: "link",
|
|
5635
5635
|
target: "head",
|
|
5636
|
-
blob: new Blob([
|
|
5636
|
+
blob: new Blob([Ft(Lr)], { type: "text/css" }),
|
|
5637
5637
|
rel: "stylesheet"
|
|
5638
5638
|
}
|
|
5639
5639
|
];
|
|
@@ -5692,7 +5692,7 @@ onmessage = function(event) {
|
|
|
5692
5692
|
time: performance.now() - startTime
|
|
5693
5693
|
})
|
|
5694
5694
|
}
|
|
5695
|
-
`,
|
|
5695
|
+
`, Ve = class Ve {
|
|
5696
5696
|
constructor(t, e) {
|
|
5697
5697
|
this.callbacks = /* @__PURE__ */ new Map(), this.worker = t, this.blobUrl = e, this.worker.onmessage = (i) => {
|
|
5698
5698
|
const n = i.data, r = n.id, o = this.callbacks.get(n.id);
|
|
@@ -5717,14 +5717,14 @@ onmessage = function(event) {
|
|
|
5717
5717
|
this.worker.terminate(), URL.revokeObjectURL(this.blobUrl);
|
|
5718
5718
|
}
|
|
5719
5719
|
};
|
|
5720
|
-
|
|
5721
|
-
let ee =
|
|
5720
|
+
Ve.workerScript = Mr;
|
|
5721
|
+
let ee = Ve;
|
|
5722
5722
|
function De(s) {
|
|
5723
5723
|
return typeof window < "u" && console ? console[s] : (...t) => {
|
|
5724
5724
|
};
|
|
5725
5725
|
}
|
|
5726
|
-
const
|
|
5727
|
-
async function
|
|
5726
|
+
const Fr = De("log"), Ci = De("table"), Nr = De("clear");
|
|
5727
|
+
async function xi() {
|
|
5728
5728
|
if (typeof navigator < "u" && navigator.brave && navigator.brave.isBrave)
|
|
5729
5729
|
try {
|
|
5730
5730
|
return await Promise.race([
|
|
@@ -5785,11 +5785,11 @@ class Ir {
|
|
|
5785
5785
|
return (await this.workerConsole.table(t)).time;
|
|
5786
5786
|
} catch {
|
|
5787
5787
|
const i = performance.now();
|
|
5788
|
-
return
|
|
5788
|
+
return Ci(t), performance.now() - i;
|
|
5789
5789
|
}
|
|
5790
5790
|
else {
|
|
5791
5791
|
const e = performance.now();
|
|
5792
|
-
return
|
|
5792
|
+
return Ci(t), performance.now() - e;
|
|
5793
5793
|
}
|
|
5794
5794
|
}
|
|
5795
5795
|
/**
|
|
@@ -5801,7 +5801,7 @@ class Ir {
|
|
|
5801
5801
|
return (await this.workerConsole.log(t)).time;
|
|
5802
5802
|
{
|
|
5803
5803
|
const e = performance.now();
|
|
5804
|
-
return
|
|
5804
|
+
return Fr(t), performance.now() - e;
|
|
5805
5805
|
}
|
|
5806
5806
|
}
|
|
5807
5807
|
/**
|
|
@@ -5831,14 +5831,14 @@ class Ir {
|
|
|
5831
5831
|
if (!this.isPerformanceDetectionEnabled())
|
|
5832
5832
|
return !1;
|
|
5833
5833
|
const t = await this.calcTablePrintTime(), e = Math.max(await this.calcLogPrintTime(), await this.calcLogPrintTime());
|
|
5834
|
-
return this.maxPrintTime = Math.max(this.maxPrintTime, e), this.workerConsole ? await this.workerConsole.clear() :
|
|
5834
|
+
return this.maxPrintTime = Math.max(this.maxPrintTime, e), this.workerConsole ? await this.workerConsole.clear() : Nr(), t === 0 ? !1 : this.maxPrintTime === 0 ? !!await xi() : t > this.maxPrintTime * 10;
|
|
5835
5835
|
}
|
|
5836
5836
|
/**
|
|
5837
5837
|
* Debugger-based detection (fallback method)
|
|
5838
5838
|
* WARNING: This method impacts user experience
|
|
5839
5839
|
*/
|
|
5840
5840
|
async checkDebuggerBased() {
|
|
5841
|
-
if (!this.isDebuggerDetectionEnabled() || await
|
|
5841
|
+
if (!this.isDebuggerDetectionEnabled() || await xi())
|
|
5842
5842
|
return !1;
|
|
5843
5843
|
const t = performance.now();
|
|
5844
5844
|
try {
|
|
@@ -5966,10 +5966,10 @@ class Hr {
|
|
|
5966
5966
|
this.contextMenuHandler && (document.removeEventListener("contextmenu", this.contextMenuHandler, !0), this.contextMenuHandler = void 0);
|
|
5967
5967
|
}
|
|
5968
5968
|
}
|
|
5969
|
-
const
|
|
5970
|
-
class
|
|
5969
|
+
const st = "readium:navigator:suspiciousActivity";
|
|
5970
|
+
class We {
|
|
5971
5971
|
dispatchSuspiciousActivity(t, e) {
|
|
5972
|
-
const i = new CustomEvent(
|
|
5972
|
+
const i = new CustomEvent(st, {
|
|
5973
5973
|
detail: {
|
|
5974
5974
|
type: t,
|
|
5975
5975
|
timestamp: Date.now(),
|
|
@@ -6015,15 +6015,15 @@ class un {
|
|
|
6015
6015
|
this.automationDetector?.destroy(), this.devToolsDetector?.destroy(), this.iframeEmbeddingDetector?.destroy(), this.printProtector?.destroy(), this.contextMenuProtector?.destroy();
|
|
6016
6016
|
}
|
|
6017
6017
|
}
|
|
6018
|
-
const
|
|
6019
|
-
class
|
|
6018
|
+
const ot = "readium:navigator:keyboardPeripheral";
|
|
6019
|
+
class He {
|
|
6020
6020
|
constructor(t = {}) {
|
|
6021
|
-
this.keyManager = new
|
|
6021
|
+
this.keyManager = new Qi(), this.setupKeyboardPeripherals(t.keyboardPeripherals || []);
|
|
6022
6022
|
}
|
|
6023
6023
|
setupKeyboardPeripherals(t) {
|
|
6024
6024
|
if (t.length > 0) {
|
|
6025
6025
|
const e = (i) => {
|
|
6026
|
-
const n = new CustomEvent(
|
|
6026
|
+
const n = new CustomEvent(ot, {
|
|
6027
6027
|
detail: i
|
|
6028
6028
|
});
|
|
6029
6029
|
window.dispatchEvent(n);
|
|
@@ -6064,32 +6064,32 @@ const Br = (s) => ({
|
|
|
6064
6064
|
peripheral: s.peripheral || (() => {
|
|
6065
6065
|
})
|
|
6066
6066
|
});
|
|
6067
|
-
class Vr extends
|
|
6067
|
+
class Vr extends en {
|
|
6068
6068
|
constructor(t, e, i, n = void 0, r = { preferences: {}, defaults: {} }) {
|
|
6069
6069
|
super(), this.currentIndex = 0, this._preferencesEditor = null, this._injector = null, this._navigatorProtector = null, this._keyboardPeripheralsManager = null, this._suspiciousActivityListener = null, this._keyboardPeripheralListener = null, this.webViewport = {
|
|
6070
6070
|
readingOrder: [],
|
|
6071
6071
|
progressions: /* @__PURE__ */ new Map(),
|
|
6072
6072
|
positions: null
|
|
6073
|
-
}, this.pub = e, this.container = t, this.listeners = Br(i), this._preferences = new
|
|
6073
|
+
}, this.pub = e, this.container = t, this.listeners = Br(i), this._preferences = new kt(r.preferences), this._defaults = new xr(r.defaults), this._settings = new _i(this._preferences, this._defaults, this.hasDisplayTransformability), this._css = new Pr({
|
|
6074
6074
|
rsProperties: new _r({ experiments: this._settings.experiments || null }),
|
|
6075
|
-
userProperties: new
|
|
6075
|
+
userProperties: new on({ zoom: this._settings.zoom })
|
|
6076
6076
|
});
|
|
6077
6077
|
const o = Or(e.readingOrder.items), a = r.injectables || { rules: [], allowedDomains: [] };
|
|
6078
|
-
if (this._injector = new
|
|
6078
|
+
if (this._injector = new dn({
|
|
6079
6079
|
rules: [...o, ...a.rules],
|
|
6080
6080
|
allowedDomains: a.allowedDomains
|
|
6081
6081
|
}), this._contentProtection = r.contentProtection || {}, this._keyboardPeripherals = this.mergeKeyboardPeripherals(
|
|
6082
6082
|
this._contentProtection,
|
|
6083
6083
|
r.keyboardPeripherals || []
|
|
6084
|
-
), (this._contentProtection.disableContextMenu || this._contentProtection.checkAutomation || this._contentProtection.checkIFrameEmbedding || this._contentProtection.monitorDevTools || this._contentProtection.protectPrinting?.disable) && (this._navigatorProtector = new
|
|
6084
|
+
), (this._contentProtection.disableContextMenu || this._contentProtection.checkAutomation || this._contentProtection.checkIFrameEmbedding || this._contentProtection.monitorDevTools || this._contentProtection.protectPrinting?.disable) && (this._navigatorProtector = new We(this._contentProtection), this._suspiciousActivityListener = (l) => {
|
|
6085
6085
|
const h = l;
|
|
6086
6086
|
this.listeners.contentProtection(h.detail.type, h.detail);
|
|
6087
|
-
}, window.addEventListener(
|
|
6087
|
+
}, window.addEventListener(st, this._suspiciousActivityListener)), this._keyboardPeripherals.length > 0 && (this._keyboardPeripheralsManager = new He({
|
|
6088
6088
|
keyboardPeripherals: this._keyboardPeripherals
|
|
6089
6089
|
}), this._keyboardPeripheralListener = (l) => {
|
|
6090
6090
|
const h = l.detail;
|
|
6091
6091
|
this.listeners.peripheral(h);
|
|
6092
|
-
}, window.addEventListener(
|
|
6092
|
+
}, window.addEventListener(ot, this._keyboardPeripheralListener)), n && typeof n.copyWithLocations == "function") {
|
|
6093
6093
|
this.currentLocation = n;
|
|
6094
6094
|
const l = this.pub.readingOrder.findIndexWithHref(n.href);
|
|
6095
6095
|
l >= 0 && (this.currentIndex = l);
|
|
@@ -6112,13 +6112,13 @@ class Vr extends Qi {
|
|
|
6112
6112
|
return Object.freeze({ ...this._settings });
|
|
6113
6113
|
}
|
|
6114
6114
|
get preferencesEditor() {
|
|
6115
|
-
return this._preferencesEditor === null && (this._preferencesEditor = new
|
|
6115
|
+
return this._preferencesEditor === null && (this._preferencesEditor = new Pi(this._preferences, this.settings, this.pub.metadata)), this._preferencesEditor;
|
|
6116
6116
|
}
|
|
6117
6117
|
async submitPreferences(t) {
|
|
6118
6118
|
this._preferences = this._preferences.merging(t), await this.applyPreferences();
|
|
6119
6119
|
}
|
|
6120
6120
|
async applyPreferences() {
|
|
6121
|
-
this._settings = new
|
|
6121
|
+
this._settings = new _i(this._preferences, this._defaults, this.hasDisplayTransformability), this._preferencesEditor !== null && (this._preferencesEditor = new Pi(this._preferences, this.settings, this.pub.metadata)), await this.updateCSS(!0);
|
|
6122
6122
|
}
|
|
6123
6123
|
async updateCSS(t) {
|
|
6124
6124
|
this._css.update(this._settings), t && await this.commitCSS(this._css);
|
|
@@ -6153,9 +6153,9 @@ class Vr extends Qi {
|
|
|
6153
6153
|
this.listeners.frameLoaded(this.framePool.currentFrames[0].iframe.contentWindow), this.listeners.positionChanged(this.currentLocation);
|
|
6154
6154
|
break;
|
|
6155
6155
|
case "first_visible_locator":
|
|
6156
|
-
const i =
|
|
6156
|
+
const i = F.deserialize(e);
|
|
6157
6157
|
if (!i) break;
|
|
6158
|
-
this.currentLocation = new
|
|
6158
|
+
this.currentLocation = new F({
|
|
6159
6159
|
href: this.currentLocation.href,
|
|
6160
6160
|
type: this.currentLocation.type,
|
|
6161
6161
|
title: this.currentLocation.title,
|
|
@@ -6248,7 +6248,7 @@ class Vr extends Qi {
|
|
|
6248
6248
|
throw Error("Link for " + this.currentLocation.href + " not found!");
|
|
6249
6249
|
}
|
|
6250
6250
|
async destroy() {
|
|
6251
|
-
this._suspiciousActivityListener && window.removeEventListener(
|
|
6251
|
+
this._suspiciousActivityListener && window.removeEventListener(st, this._suspiciousActivityListener), this._keyboardPeripheralListener && window.removeEventListener(ot, this._keyboardPeripheralListener), this._navigatorProtector?.destroy(), this._keyboardPeripheralsManager?.destroy(), await this.framePool?.destroy();
|
|
6252
6252
|
}
|
|
6253
6253
|
async changeResource(t) {
|
|
6254
6254
|
if (t === 0) return !1;
|
|
@@ -6363,7 +6363,7 @@ class Vr extends Qi {
|
|
|
6363
6363
|
if (!e)
|
|
6364
6364
|
throw new Error("No current resource available");
|
|
6365
6365
|
const n = this.currentLocation && this.currentLocation.href === e.href && this.currentLocation.locations.progression ? this.currentLocation.locations.progression : 0;
|
|
6366
|
-
return this.pub.manifest.locatorFromLink(e) || new
|
|
6366
|
+
return this.pub.manifest.locatorFromLink(e) || new F({
|
|
6367
6367
|
href: e.href,
|
|
6368
6368
|
type: e.type || "text/html",
|
|
6369
6369
|
locations: new E({
|
|
@@ -6374,7 +6374,7 @@ class Vr extends Qi {
|
|
|
6374
6374
|
});
|
|
6375
6375
|
}
|
|
6376
6376
|
}
|
|
6377
|
-
const
|
|
6377
|
+
const ks = Vr, jr = (s) => {
|
|
6378
6378
|
const t = s.join(" ");
|
|
6379
6379
|
return [
|
|
6380
6380
|
// 'self' is useless because the document is loaded from a blob: URL
|
|
@@ -6476,7 +6476,7 @@ class Gr {
|
|
|
6476
6476
|
}
|
|
6477
6477
|
return;
|
|
6478
6478
|
}
|
|
6479
|
-
this.comms?.halt(), this.loader.destroy(), this.loader = new
|
|
6479
|
+
this.comms?.halt(), this.loader.destroy(), this.loader = new St(n, t), this.currModules = t, this.comms = void 0;
|
|
6480
6480
|
try {
|
|
6481
6481
|
e(n);
|
|
6482
6482
|
} catch {
|
|
@@ -6485,7 +6485,7 @@ class Gr {
|
|
|
6485
6485
|
}
|
|
6486
6486
|
this.frame.onload = () => {
|
|
6487
6487
|
const n = this.frame.contentWindow;
|
|
6488
|
-
this.loader = new
|
|
6488
|
+
this.loader = new St(n, t), this.currModules = t;
|
|
6489
6489
|
try {
|
|
6490
6490
|
e(n);
|
|
6491
6491
|
} catch {
|
|
@@ -6518,7 +6518,7 @@ class Gr {
|
|
|
6518
6518
|
async show(t) {
|
|
6519
6519
|
if (this.destroyed) throw Error("Trying to show frame when it doesn't exist");
|
|
6520
6520
|
if (!this.frame.parentElement) throw Error("Trying to show frame that is not attached to the DOM");
|
|
6521
|
-
return this.comms ? this.comms.resume() : this.comms = new
|
|
6521
|
+
return this.comms ? this.comms.resume() : this.comms = new Lt(this.frame.contentWindow, this.source), new Promise((e, i) => {
|
|
6522
6522
|
this.comms?.send("activate", void 0, () => {
|
|
6523
6523
|
this.comms?.send("focus", void 0, () => {
|
|
6524
6524
|
this.applyContentProtection();
|
|
@@ -6531,7 +6531,7 @@ class Gr {
|
|
|
6531
6531
|
});
|
|
6532
6532
|
}
|
|
6533
6533
|
setCSSProperties(t) {
|
|
6534
|
-
this.destroyed || !this.frame.contentWindow || (this.hidden && (this.comms ? this.comms?.resume() : this.comms = new
|
|
6534
|
+
this.destroyed || !this.frame.contentWindow || (this.hidden && (this.comms ? this.comms?.resume() : this.comms = new Lt(this.frame.contentWindow, this.source)), this.comms?.send("update_properties", t), this.hidden && this.comms?.halt());
|
|
6535
6535
|
}
|
|
6536
6536
|
get iframe() {
|
|
6537
6537
|
if (this.destroyed) throw Error("Trying to use frame when it doesn't exist");
|
|
@@ -6558,7 +6558,7 @@ class Gr {
|
|
|
6558
6558
|
return this.loader;
|
|
6559
6559
|
}
|
|
6560
6560
|
}
|
|
6561
|
-
const
|
|
6561
|
+
const Ri = 5, Li = 3;
|
|
6562
6562
|
class $r {
|
|
6563
6563
|
constructor(t, e, i, n, r, o) {
|
|
6564
6564
|
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 = r || {}, this.keyboardPeripheralsConfig = o || [];
|
|
@@ -6586,7 +6586,7 @@ class $r {
|
|
|
6586
6586
|
const a = new Promise(async (l, h) => {
|
|
6587
6587
|
const c = [], u = [];
|
|
6588
6588
|
this.positions.forEach((d, p) => {
|
|
6589
|
-
(p > r +
|
|
6589
|
+
(p > r + Ri || p < r - Ri) && (c.includes(d.href) || c.push(d.href)), p < r + Li && p > r - Li && (u.includes(d.href) || u.push(d.href));
|
|
6590
6590
|
}), c.forEach(async (d) => {
|
|
6591
6591
|
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 }));
|
|
6592
6592
|
}), this.currentBaseURL !== void 0 && t.baseURL !== this.currentBaseURL && (this.blobs.forEach((d) => {
|
|
@@ -6691,7 +6691,7 @@ class Xr {
|
|
|
6691
6691
|
}
|
|
6692
6692
|
return;
|
|
6693
6693
|
}
|
|
6694
|
-
this.comms?.halt(), this.loader.destroy(), this.loader = new
|
|
6694
|
+
this.comms?.halt(), this.loader.destroy(), this.loader = new St(r, t), this.currModules = t, this.comms = void 0;
|
|
6695
6695
|
try {
|
|
6696
6696
|
i(r), this.loadPromise = void 0;
|
|
6697
6697
|
} catch {
|
|
@@ -6700,7 +6700,7 @@ class Xr {
|
|
|
6700
6700
|
}
|
|
6701
6701
|
this.frame.addEventListener("load", () => {
|
|
6702
6702
|
const r = this.frame.contentWindow;
|
|
6703
|
-
this.loader = new
|
|
6703
|
+
this.loader = new St(r, t), this.currModules = t, this.peripherals.observe(this.wrapper), this.peripherals.observe(r);
|
|
6704
6704
|
try {
|
|
6705
6705
|
i(r);
|
|
6706
6706
|
} catch {
|
|
@@ -6791,7 +6791,7 @@ class Xr {
|
|
|
6791
6791
|
this.showPromise = void 0;
|
|
6792
6792
|
return;
|
|
6793
6793
|
}
|
|
6794
|
-
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
|
|
6794
|
+
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 Lt(this.frame.contentWindow, this.source), this.showPromise = new Promise((e, i) => {
|
|
6795
6795
|
this.comms.send("focus", void 0, (n) => {
|
|
6796
6796
|
this.update(this.cachedPage), this.applyContentProtection(), e();
|
|
6797
6797
|
});
|
|
@@ -6909,7 +6909,7 @@ class Zr {
|
|
|
6909
6909
|
return this._DOM;
|
|
6910
6910
|
}
|
|
6911
6911
|
}
|
|
6912
|
-
const
|
|
6912
|
+
const ki = 6, pe = 1.02, Oi = 50;
|
|
6913
6913
|
class Jr {
|
|
6914
6914
|
constructor(t, e = !1) {
|
|
6915
6915
|
this.dragState = 0, this.minimumMoved = !1, this.pan = {
|
|
@@ -7025,7 +7025,7 @@ class Jr {
|
|
|
7025
7025
|
*/
|
|
7026
7026
|
touchendHandler(t) {
|
|
7027
7027
|
if (t.stopPropagation(), !t.touches || t.touches.length === 0)
|
|
7028
|
-
this.pan.endX && !this.isScaled ? (this.pinch.touchN && (this.pan.endX = this.pan.startX), this.updateAfterDrag()) : !this.pinch.touchN && Math.abs(this.pan.overscrollX) >
|
|
7028
|
+
this.pan.endX && !this.isScaled ? (this.pinch.touchN && (this.pan.endX = this.pan.startX), this.updateAfterDrag()) : !this.pinch.touchN && Math.abs(this.pan.overscrollX) > Oi && Math.abs(this.pan.overscrollY) < Oi / 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");
|
|
7029
7029
|
else if (t.touches.length === 1) {
|
|
7030
7030
|
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");
|
|
7031
7031
|
const e = this.startTouch(t);
|
|
@@ -7048,7 +7048,7 @@ class Jr {
|
|
|
7048
7048
|
if (this.dragState === 2 && i) {
|
|
7049
7049
|
if (this.pinch.touchN++, this.pinch.touchN < 4) return;
|
|
7050
7050
|
let o = i / this.pinch.startDistance * this.scale;
|
|
7051
|
-
o >=
|
|
7051
|
+
o >= ki && (o = ki), o <= pe && (o = 1), this.scale = o, this.pinch.startDistance = i, n = !0;
|
|
7052
7052
|
}
|
|
7053
7053
|
if (this.pan.letItGo === !1 && (this.pan.letItGo = Math.abs(this.pan.startY - e.Y) < Math.abs(this.pan.startX - e.X)), this.debugger?.show && (this.debugger.DOM.touch1.style.top = `${e.Y - 10}px`, this.debugger.DOM.touch1.style.left = `${e.X - 10}px`, this.debugger.DOM.touch1.innerText = `${e.X.toFixed(2)},${e.Y.toFixed(2)}`), this.dragState > 0 && this.isScaled || this.dragState > 1) {
|
|
7054
7054
|
if (this.dragState === 1) {
|
|
@@ -7176,7 +7176,7 @@ class Qr {
|
|
|
7176
7176
|
return this.spreads.find((e) => e.includes(t)) || void 0;
|
|
7177
7177
|
}
|
|
7178
7178
|
}
|
|
7179
|
-
const
|
|
7179
|
+
const Ti = 8, Ai = 5, ts = 300, es = 15e3, is = 250, ns = 150, rs = 500;
|
|
7180
7180
|
class ss {
|
|
7181
7181
|
constructor(t, e, i, n, r, o) {
|
|
7182
7182
|
if (this.pool = /* @__PURE__ */ new Map(), this.blobs = /* @__PURE__ */ new Map(), this.inprogress = /* @__PURE__ */ new Map(), this.delayedShow = /* @__PURE__ */ new Map(), this.delayedTimeout = /* @__PURE__ */ new Map(), this.previousFrames = [], this.injector = null, this.width = 0, this.height = 0, this.transform = "", this.currentSlide = 0, this.spread = !0, this.orientationInternal = -1, this.container = t, this.positions = e, this.pub = i, this.injector = n ?? null, this.contentProtectionConfig = r || {}, this.keyboardPeripheralsConfig = o || [], this.spreadPresentation = i.metadata.otherMetadata?.spread || Le.auto, this.pub.metadata.effectiveReadingProgression !== D.rtl && this.pub.metadata.effectiveReadingProgression !== D.ltr)
|
|
@@ -7394,7 +7394,7 @@ class ss {
|
|
|
7394
7394
|
const a = new Promise(async (l, h) => {
|
|
7395
7395
|
const c = [], u = [];
|
|
7396
7396
|
this.positions.forEach((d, p) => {
|
|
7397
|
-
(p > r +
|
|
7397
|
+
(p > r + Ti || p < r - Ti) && (c.includes(d.href) || c.push(d.href)), p < r + Ai && p > r - Ai && (u.includes(d.href) || u.push(d.href));
|
|
7398
7398
|
}), c.forEach(async (d) => {
|
|
7399
7399
|
u.includes(d) || this.pool.has(d) && (this.cancelShowing(d), await this.pool.get(d)?.unload());
|
|
7400
7400
|
}), this.currentBaseURL !== void 0 && t.baseURL !== this.currentBaseURL && (this.blobs.forEach((d) => URL.revokeObjectURL(d)), this.blobs.clear()), this.currentBaseURL = t.baseURL;
|
|
@@ -7416,8 +7416,8 @@ class ss {
|
|
|
7416
7416
|
let Q = !1;
|
|
7417
7417
|
const yn = window.setTimeout(async () => {
|
|
7418
7418
|
this.delayedTimeout.set(d, 0);
|
|
7419
|
-
const Sn = this.makeSpread(this.reAlign(p)), bn = this.spreadPosition(Sn, b),
|
|
7420
|
-
await
|
|
7419
|
+
const Sn = this.makeSpread(this.reAlign(p)), bn = this.spreadPosition(Sn, b), je = this.pool.get(d);
|
|
7420
|
+
await je.load(i, this.blobs.get(d)), this.peripherals.isScaled || await je.show(bn), this.delayedShow.delete(d), Q = !0, v();
|
|
7421
7421
|
}, ts);
|
|
7422
7422
|
setTimeout(() => {
|
|
7423
7423
|
!Q && this.delayedShow.has(d) && k(`Offscreen load timeout: ${d}`);
|
|
@@ -7499,7 +7499,7 @@ class ss {
|
|
|
7499
7499
|
}
|
|
7500
7500
|
class Ot {
|
|
7501
7501
|
constructor(t = {}) {
|
|
7502
|
-
this.backgroundColor = I(t.backgroundColor), this.blendFilter = P(t.blendFilter), this.constraint = w(t.constraint), this.columnCount = w(t.columnCount), this.darkenFilter =
|
|
7502
|
+
this.backgroundColor = I(t.backgroundColor), this.blendFilter = P(t.blendFilter), this.constraint = w(t.constraint), this.columnCount = w(t.columnCount), this.darkenFilter = ft(t.darkenFilter), this.deprecatedFontSize = P(t.deprecatedFontSize), this.fontFamily = I(t.fontFamily), this.fontSize = M(t.fontSize, Gt.range), this.fontSizeNormalize = P(t.fontSizeNormalize), this.fontOpticalSizing = P(t.fontOpticalSizing), this.fontWeight = M(t.fontWeight, nt.range), this.fontWidth = M(t.fontWidth, $t.range), this.hyphens = P(t.hyphens), this.invertFilter = ft(t.invertFilter), this.invertGaijiFilter = ft(t.invertGaijiFilter), this.iOSPatch = P(t.iOSPatch), this.iPadOSPatch = P(t.iPadOSPatch), this.letterSpacing = w(t.letterSpacing), this.ligatures = P(t.ligatures), this.lineHeight = w(t.lineHeight), this.linkColor = I(t.linkColor), this.noRuby = P(t.noRuby), this.pageGutter = w(t.pageGutter), this.paragraphIndent = w(t.paragraphIndent), this.paragraphSpacing = w(t.paragraphSpacing), this.scroll = P(t.scroll), this.scrollPaddingTop = w(t.scrollPaddingTop), this.scrollPaddingBottom = w(t.scrollPaddingBottom), this.scrollPaddingLeft = w(t.scrollPaddingLeft), this.scrollPaddingRight = w(t.scrollPaddingRight), this.selectionBackgroundColor = I(t.selectionBackgroundColor), this.selectionTextColor = I(t.selectionTextColor), this.textAlign = se(t.textAlign, J), this.textColor = I(t.textColor), this.textNormalization = P(t.textNormalization), this.visitedColor = I(t.visitedColor), this.wordSpacing = w(t.wordSpacing), this.optimalLineLength = w(t.optimalLineLength), this.maximalLineLength = w(t.maximalLineLength), this.minimalLineLength = w(t.minimalLineLength);
|
|
7503
7503
|
}
|
|
7504
7504
|
static serialize(t) {
|
|
7505
7505
|
const { ...e } = t;
|
|
@@ -7522,10 +7522,10 @@ class Ot {
|
|
|
7522
7522
|
}
|
|
7523
7523
|
class os {
|
|
7524
7524
|
constructor(t) {
|
|
7525
|
-
this.backgroundColor = I(t.backgroundColor) || null, this.blendFilter = P(t.blendFilter) ?? !1, this.constraint = w(t.constraint) || 0, this.columnCount = w(t.columnCount) || null, this.darkenFilter =
|
|
7525
|
+
this.backgroundColor = I(t.backgroundColor) || null, this.blendFilter = P(t.blendFilter) ?? !1, this.constraint = w(t.constraint) || 0, this.columnCount = w(t.columnCount) || null, this.darkenFilter = ft(t.darkenFilter) ?? !1, this.deprecatedFontSize = P(t.deprecatedFontSize), (this.deprecatedFontSize === !1 || this.deprecatedFontSize === null) && (this.deprecatedFontSize = !CSS.supports("zoom", "1")), this.fontFamily = I(t.fontFamily) || null, this.fontSize = M(t.fontSize, Gt.range) || 1, this.fontSizeNormalize = P(t.fontSizeNormalize) ?? !1, this.fontOpticalSizing = P(t.fontOpticalSizing) ?? null, this.fontWeight = M(t.fontWeight, nt.range) || null, this.fontWidth = M(t.fontWidth, $t.range) || null, this.hyphens = P(t.hyphens) ?? null, this.invertFilter = ft(t.invertFilter) ?? !1, this.invertGaijiFilter = ft(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 = w(t.letterSpacing) || null, this.ligatures = P(t.ligatures) ?? null, this.lineHeight = w(t.lineHeight) || null, this.linkColor = I(t.linkColor) || null, this.noRuby = P(t.noRuby) ?? !1, this.pageGutter = ue(w(t.pageGutter), 20), this.paragraphIndent = w(t.paragraphIndent) ?? null, this.paragraphSpacing = w(t.paragraphSpacing) ?? null, this.scroll = P(t.scroll) ?? !1, this.scrollPaddingTop = w(t.scrollPaddingTop) ?? null, this.scrollPaddingBottom = w(t.scrollPaddingBottom) ?? null, this.scrollPaddingLeft = w(t.scrollPaddingLeft) ?? null, this.scrollPaddingRight = w(t.scrollPaddingRight) ?? null, this.selectionBackgroundColor = I(t.selectionBackgroundColor) || null, this.selectionTextColor = I(t.selectionTextColor) || null, this.textAlign = se(t.textAlign, J) || null, this.textColor = I(t.textColor) || null, this.textNormalization = P(t.textNormalization) ?? !1, this.visitedColor = I(t.visitedColor) || null, this.wordSpacing = w(t.wordSpacing) || null, this.optimalLineLength = w(t.optimalLineLength) || 65, this.maximalLineLength = ue(Cr(t.maximalLineLength, this.optimalLineLength), 80), this.minimalLineLength = ue(Er(t.minimalLineLength, this.optimalLineLength), 40), this.experiments = an(t.experiments) || null;
|
|
7526
7526
|
}
|
|
7527
7527
|
}
|
|
7528
|
-
const as = "#FFFFFF", ls = "#121212", hs = "#0000EE", cs = "#551A8B", ds = "#b4d8fe", us = "inherit",
|
|
7528
|
+
const as = "#FFFFFF", ls = "#121212", hs = "#0000EE", cs = "#551A8B", ds = "#b4d8fe", us = "inherit", dt = {
|
|
7529
7529
|
RS__backgroundColor: as,
|
|
7530
7530
|
RS__textColor: ls,
|
|
7531
7531
|
RS__linkColor: hs,
|
|
@@ -7533,7 +7533,7 @@ const as = "#FFFFFF", ls = "#121212", hs = "#0000EE", cs = "#551A8B", ds = "#b4d
|
|
|
7533
7533
|
RS__selectionBackgroundColor: ds,
|
|
7534
7534
|
RS__selectionTextColor: us
|
|
7535
7535
|
};
|
|
7536
|
-
class
|
|
7536
|
+
class zi {
|
|
7537
7537
|
constructor(t, e, i) {
|
|
7538
7538
|
this.preferences = t, this.settings = e, this.metadata = i, this.layout = this.metadata?.effectiveLayout || S.reflowable;
|
|
7539
7539
|
}
|
|
@@ -7546,7 +7546,7 @@ class Ti {
|
|
|
7546
7546
|
get backgroundColor() {
|
|
7547
7547
|
return new A({
|
|
7548
7548
|
initialValue: this.preferences.backgroundColor,
|
|
7549
|
-
effectiveValue: this.settings.backgroundColor ||
|
|
7549
|
+
effectiveValue: this.settings.backgroundColor || dt.RS__backgroundColor,
|
|
7550
7550
|
isEffective: this.preferences.backgroundColor !== null,
|
|
7551
7551
|
onChange: (t) => {
|
|
7552
7552
|
this.updatePreference("backgroundColor", t || null);
|
|
@@ -7591,8 +7591,8 @@ class Ti {
|
|
|
7591
7591
|
onChange: (t) => {
|
|
7592
7592
|
this.updatePreference("darkenFilter", t || null);
|
|
7593
7593
|
},
|
|
7594
|
-
supportedRange:
|
|
7595
|
-
step:
|
|
7594
|
+
supportedRange: ht.range,
|
|
7595
|
+
step: ht.step
|
|
7596
7596
|
});
|
|
7597
7597
|
}
|
|
7598
7598
|
get deprecatedFontSize() {
|
|
@@ -7689,8 +7689,8 @@ class Ti {
|
|
|
7689
7689
|
onChange: (t) => {
|
|
7690
7690
|
this.updatePreference("invertFilter", t || null);
|
|
7691
7691
|
},
|
|
7692
|
-
supportedRange:
|
|
7693
|
-
step:
|
|
7692
|
+
supportedRange: ht.range,
|
|
7693
|
+
step: ht.step
|
|
7694
7694
|
});
|
|
7695
7695
|
}
|
|
7696
7696
|
get invertGaijiFilter() {
|
|
@@ -7701,8 +7701,8 @@ class Ti {
|
|
|
7701
7701
|
onChange: (t) => {
|
|
7702
7702
|
this.updatePreference("invertGaijiFilter", t || null);
|
|
7703
7703
|
},
|
|
7704
|
-
supportedRange:
|
|
7705
|
-
step:
|
|
7704
|
+
supportedRange: ht.range,
|
|
7705
|
+
step: ht.step
|
|
7706
7706
|
});
|
|
7707
7707
|
}
|
|
7708
7708
|
get iOSPatch() {
|
|
@@ -7767,7 +7767,7 @@ class Ti {
|
|
|
7767
7767
|
get linkColor() {
|
|
7768
7768
|
return new A({
|
|
7769
7769
|
initialValue: this.preferences.linkColor,
|
|
7770
|
-
effectiveValue: this.settings.linkColor ||
|
|
7770
|
+
effectiveValue: this.settings.linkColor || dt.RS__linkColor,
|
|
7771
7771
|
isEffective: this.layout !== S.fixed && this.preferences.linkColor !== null,
|
|
7772
7772
|
onChange: (t) => {
|
|
7773
7773
|
this.updatePreference("linkColor", t || null);
|
|
@@ -7782,8 +7782,8 @@ class Ti {
|
|
|
7782
7782
|
onChange: (t) => {
|
|
7783
7783
|
this.updatePreference("maximalLineLength", t);
|
|
7784
7784
|
},
|
|
7785
|
-
supportedRange:
|
|
7786
|
-
step:
|
|
7785
|
+
supportedRange: ct.range,
|
|
7786
|
+
step: ct.step
|
|
7787
7787
|
});
|
|
7788
7788
|
}
|
|
7789
7789
|
get minimalLineLength() {
|
|
@@ -7794,8 +7794,8 @@ class Ti {
|
|
|
7794
7794
|
onChange: (t) => {
|
|
7795
7795
|
this.updatePreference("minimalLineLength", t);
|
|
7796
7796
|
},
|
|
7797
|
-
supportedRange:
|
|
7798
|
-
step:
|
|
7797
|
+
supportedRange: ct.range,
|
|
7798
|
+
step: ct.step
|
|
7799
7799
|
});
|
|
7800
7800
|
}
|
|
7801
7801
|
get noRuby() {
|
|
@@ -7816,8 +7816,8 @@ class Ti {
|
|
|
7816
7816
|
onChange: (t) => {
|
|
7817
7817
|
this.updatePreference("optimalLineLength", t);
|
|
7818
7818
|
},
|
|
7819
|
-
supportedRange:
|
|
7820
|
-
step:
|
|
7819
|
+
supportedRange: ct.range,
|
|
7820
|
+
step: ct.step
|
|
7821
7821
|
});
|
|
7822
7822
|
}
|
|
7823
7823
|
get pageGutter() {
|
|
@@ -7907,7 +7907,7 @@ class Ti {
|
|
|
7907
7907
|
get selectionBackgroundColor() {
|
|
7908
7908
|
return new A({
|
|
7909
7909
|
initialValue: this.preferences.selectionBackgroundColor,
|
|
7910
|
-
effectiveValue: this.settings.selectionBackgroundColor ||
|
|
7910
|
+
effectiveValue: this.settings.selectionBackgroundColor || dt.RS__selectionBackgroundColor,
|
|
7911
7911
|
isEffective: this.layout !== S.fixed && this.preferences.selectionBackgroundColor !== null,
|
|
7912
7912
|
onChange: (t) => {
|
|
7913
7913
|
this.updatePreference("selectionBackgroundColor", t || null);
|
|
@@ -7917,7 +7917,7 @@ class Ti {
|
|
|
7917
7917
|
get selectionTextColor() {
|
|
7918
7918
|
return new A({
|
|
7919
7919
|
initialValue: this.preferences.selectionTextColor,
|
|
7920
|
-
effectiveValue: this.settings.selectionTextColor ||
|
|
7920
|
+
effectiveValue: this.settings.selectionTextColor || dt.RS__selectionTextColor,
|
|
7921
7921
|
isEffective: this.layout !== S.fixed && this.preferences.selectionTextColor !== null,
|
|
7922
7922
|
onChange: (t) => {
|
|
7923
7923
|
this.updatePreference("selectionTextColor", t || null);
|
|
@@ -7925,7 +7925,7 @@ class Ti {
|
|
|
7925
7925
|
});
|
|
7926
7926
|
}
|
|
7927
7927
|
get textAlign() {
|
|
7928
|
-
return new
|
|
7928
|
+
return new ln({
|
|
7929
7929
|
initialValue: this.preferences.textAlign,
|
|
7930
7930
|
effectiveValue: this.settings.textAlign || J.start,
|
|
7931
7931
|
isEffective: this.layout !== S.fixed && this.preferences.textAlign !== null,
|
|
@@ -7938,7 +7938,7 @@ class Ti {
|
|
|
7938
7938
|
get textColor() {
|
|
7939
7939
|
return new A({
|
|
7940
7940
|
initialValue: this.preferences.textColor,
|
|
7941
|
-
effectiveValue: this.settings.textColor ||
|
|
7941
|
+
effectiveValue: this.settings.textColor || dt.RS__textColor,
|
|
7942
7942
|
isEffective: this.layout !== S.fixed && this.preferences.textColor !== null,
|
|
7943
7943
|
onChange: (t) => {
|
|
7944
7944
|
this.updatePreference("textColor", t || null);
|
|
@@ -7958,7 +7958,7 @@ class Ti {
|
|
|
7958
7958
|
get visitedColor() {
|
|
7959
7959
|
return new A({
|
|
7960
7960
|
initialValue: this.preferences.visitedColor,
|
|
7961
|
-
effectiveValue: this.settings.visitedColor ||
|
|
7961
|
+
effectiveValue: this.settings.visitedColor || dt.RS__visitedColor,
|
|
7962
7962
|
isEffective: this.layout !== S.fixed && this.preferences.visitedColor !== null,
|
|
7963
7963
|
onChange: (t) => {
|
|
7964
7964
|
this.updatePreference("visitedColor", t || null);
|
|
@@ -7978,12 +7978,12 @@ class Ti {
|
|
|
7978
7978
|
});
|
|
7979
7979
|
}
|
|
7980
7980
|
}
|
|
7981
|
-
class
|
|
7981
|
+
class Mi {
|
|
7982
7982
|
constructor(t, e) {
|
|
7983
7983
|
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;
|
|
7984
7984
|
}
|
|
7985
7985
|
}
|
|
7986
|
-
function
|
|
7986
|
+
function Nt(s) {
|
|
7987
7987
|
const t = getComputedStyle(s), e = parseFloat(t.paddingLeft || "0"), i = parseFloat(t.paddingRight || "0");
|
|
7988
7988
|
return s.clientWidth - e - i;
|
|
7989
7989
|
}
|
|
@@ -8009,7 +8009,7 @@ class ps extends re {
|
|
|
8009
8009
|
}
|
|
8010
8010
|
class ms {
|
|
8011
8011
|
constructor(t) {
|
|
8012
|
-
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.cachedColCount = t.userProperties.colCount, this.effectiveContainerWidth =
|
|
8012
|
+
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.cachedColCount = t.userProperties.colCount, this.effectiveContainerWidth = Nt(this.containerParent);
|
|
8013
8013
|
}
|
|
8014
8014
|
update(t) {
|
|
8015
8015
|
this.cachedColCount = t.columnCount, t.constraint !== this.constraint && (this.constraint = t.constraint), t.pageGutter !== this.rsProperties.pageGutter && (this.rsProperties.pageGutter = t.pageGutter), t.scrollPaddingBottom !== this.rsProperties.scrollPaddingBottom && (this.rsProperties.scrollPaddingBottom = t.scrollPaddingBottom), t.scrollPaddingLeft !== this.rsProperties.scrollPaddingLeft && (this.rsProperties.scrollPaddingLeft = t.scrollPaddingLeft), t.scrollPaddingRight !== this.rsProperties.scrollPaddingRight && (this.rsProperties.scrollPaddingRight = t.scrollPaddingRight), t.scrollPaddingTop !== this.rsProperties.scrollPaddingTop && (this.rsProperties.scrollPaddingTop = t.scrollPaddingTop), t.experiments !== this.rsProperties.experiments && (this.rsProperties.experiments = t.experiments), this.lineLengths.update({
|
|
@@ -8076,7 +8076,7 @@ class ms {
|
|
|
8076
8076
|
// TODO: As scroll shows, the effective line-length
|
|
8077
8077
|
// should be the same as uncompensated when scale >= 1
|
|
8078
8078
|
paginate(t, e, i) {
|
|
8079
|
-
const n = Math.round(
|
|
8079
|
+
const n = Math.round(Nt(this.containerParent) - this.constraint), r = this.getCompensatedMetrics(t, e), { zoomCompensation: o, optimal: a, minimal: l, maximal: h } = r, c = () => n >= a && h !== null ? Math.min(Math.round(h * o), n) : n;
|
|
8080
8080
|
let u = 1, m = n;
|
|
8081
8081
|
if (i === void 0)
|
|
8082
8082
|
return {
|
|
@@ -8122,7 +8122,7 @@ class ms {
|
|
|
8122
8122
|
}
|
|
8123
8123
|
// This behaves as paginate where colCount = 1
|
|
8124
8124
|
computeScrollLength(t, e) {
|
|
8125
|
-
const i = Math.round(
|
|
8125
|
+
const i = Math.round(Nt(this.containerParent) - this.constraint), n = this.getCompensatedMetrics(t && (t < 1 || e) ? t : 1, e), r = n.zoomCompensation, o = n.optimal, a = n.maximal;
|
|
8126
8126
|
let l, h = i, c = Math.round(o * r);
|
|
8127
8127
|
if (a === null)
|
|
8128
8128
|
c = i;
|
|
@@ -9385,14 +9385,14 @@ function bs(s, t) {
|
|
|
9385
9385
|
id: "css-selector-generator",
|
|
9386
9386
|
as: "script",
|
|
9387
9387
|
target: "head",
|
|
9388
|
-
blob: new Blob([
|
|
9388
|
+
blob: new Blob([yt(un)], { type: "text/javascript" })
|
|
9389
9389
|
},
|
|
9390
9390
|
// Execution Prevention - conditional (has executable scripts)
|
|
9391
9391
|
{
|
|
9392
9392
|
id: "execution-prevention",
|
|
9393
9393
|
as: "script",
|
|
9394
9394
|
target: "head",
|
|
9395
|
-
blob: new Blob([
|
|
9395
|
+
blob: new Blob([yt(Ss)], { type: "text/javascript" }),
|
|
9396
9396
|
condition: (a) => !!(a.querySelector("script") || a.querySelector("body[onload]:not(body[onload=''])"))
|
|
9397
9397
|
}
|
|
9398
9398
|
], o = [
|
|
@@ -9401,7 +9401,7 @@ function bs(s, t) {
|
|
|
9401
9401
|
id: "onload-proxy",
|
|
9402
9402
|
as: "script",
|
|
9403
9403
|
target: "head",
|
|
9404
|
-
blob: new Blob([
|
|
9404
|
+
blob: new Blob([yt(pn)], { type: "text/javascript" }),
|
|
9405
9405
|
condition: (a) => !!(a.querySelector("script") || a.querySelector("body[onload]:not(body[onload=''])"))
|
|
9406
9406
|
}
|
|
9407
9407
|
];
|
|
@@ -9409,7 +9409,7 @@ function bs(s, t) {
|
|
|
9409
9409
|
id: "readium-css-before",
|
|
9410
9410
|
as: "link",
|
|
9411
9411
|
target: "head",
|
|
9412
|
-
blob: new Blob([
|
|
9412
|
+
blob: new Blob([Ft(fs)], { type: "text/css" }),
|
|
9413
9413
|
rel: "stylesheet"
|
|
9414
9414
|
}), o.unshift(
|
|
9415
9415
|
// Readium CSS Default - only for reflowable AND no existing styles
|
|
@@ -9417,7 +9417,7 @@ function bs(s, t) {
|
|
|
9417
9417
|
id: "readium-css-default",
|
|
9418
9418
|
as: "link",
|
|
9419
9419
|
target: "head",
|
|
9420
|
-
blob: new Blob([
|
|
9420
|
+
blob: new Blob([Ft(ys)], { type: "text/css" }),
|
|
9421
9421
|
rel: "stylesheet",
|
|
9422
9422
|
condition: (a) => !(a.querySelector("link[rel='stylesheet']") || a.querySelector("style") || a.querySelector("[style]:not([style=''])"))
|
|
9423
9423
|
},
|
|
@@ -9426,7 +9426,7 @@ function bs(s, t) {
|
|
|
9426
9426
|
id: "readium-css-after",
|
|
9427
9427
|
as: "link",
|
|
9428
9428
|
target: "head",
|
|
9429
|
-
blob: new Blob([
|
|
9429
|
+
blob: new Blob([Ft(gs)], { type: "text/css" }),
|
|
9430
9430
|
rel: "stylesheet"
|
|
9431
9431
|
}
|
|
9432
9432
|
)), [
|
|
@@ -9462,16 +9462,16 @@ const vs = (s) => ({
|
|
|
9462
9462
|
peripheral: s.peripheral || (() => {
|
|
9463
9463
|
})
|
|
9464
9464
|
});
|
|
9465
|
-
class fn extends
|
|
9465
|
+
class fn extends en {
|
|
9466
9466
|
constructor(t, e, i, n = [], r = void 0, o = { preferences: {}, defaults: {} }) {
|
|
9467
9467
|
super(), this._preferencesEditor = null, this._injector = null, this._navigatorProtector = null, this._keyboardPeripheralsManager = null, this._suspiciousActivityListener = null, this._keyboardPeripheralListener = null, this.reflowViewport = {
|
|
9468
9468
|
readingOrder: [],
|
|
9469
9469
|
progressions: /* @__PURE__ */ new Map(),
|
|
9470
9470
|
positions: null
|
|
9471
|
-
}, this.pub = e, this.container = t, this.listeners = vs(i), this.currentLocation = r, n.length && (this.positions = n), this._preferences = new Ot(o.preferences), this._defaults = new os(o.defaults), this._settings = new
|
|
9471
|
+
}, this.pub = e, this.container = t, this.listeners = vs(i), this.currentLocation = r, n.length && (this.positions = n), this._preferences = new Ot(o.preferences), this._defaults = new os(o.defaults), this._settings = new Mi(this._preferences, this._defaults), this._css = new ms({
|
|
9472
9472
|
rsProperties: new ps({}),
|
|
9473
9473
|
userProperties: new gn({}),
|
|
9474
|
-
lineLengths: new
|
|
9474
|
+
lineLengths: new _t({
|
|
9475
9475
|
optimalChars: this._settings.optimalLineLength,
|
|
9476
9476
|
minChars: this._settings.minimalLineLength,
|
|
9477
9477
|
maxChars: this._settings.maximalLineLength,
|
|
@@ -9485,25 +9485,25 @@ class fn extends Qi {
|
|
|
9485
9485
|
constraint: this._settings.constraint
|
|
9486
9486
|
}), this._layout = fn.determineLayout(e, !!this._settings.scroll), this.currentProgression = e.metadata.effectiveReadingProgression;
|
|
9487
9487
|
const a = bs(e.metadata, e.readingOrder.items), l = o.injectables || { rules: [], allowedDomains: [] };
|
|
9488
|
-
this._injector = new
|
|
9488
|
+
this._injector = new dn({
|
|
9489
9489
|
rules: [...a, ...l.rules],
|
|
9490
9490
|
allowedDomains: l.allowedDomains
|
|
9491
9491
|
}), this._contentProtection = o.contentProtection || {}, this._keyboardPeripherals = this.mergeKeyboardPeripherals(
|
|
9492
9492
|
this._contentProtection,
|
|
9493
9493
|
o.keyboardPeripherals || []
|
|
9494
|
-
), (this._contentProtection.disableContextMenu || this._contentProtection.checkAutomation || this._contentProtection.checkIFrameEmbedding || this._contentProtection.monitorDevTools || this._contentProtection.protectPrinting?.disable) && (this._navigatorProtector = new
|
|
9494
|
+
), (this._contentProtection.disableContextMenu || this._contentProtection.checkAutomation || this._contentProtection.checkIFrameEmbedding || this._contentProtection.monitorDevTools || this._contentProtection.protectPrinting?.disable) && (this._navigatorProtector = new We(this._contentProtection), this._suspiciousActivityListener = (h) => {
|
|
9495
9495
|
const { type: c, ...u } = h.detail;
|
|
9496
9496
|
c === "context_menu" ? this.listeners.contextMenu(u) : this.listeners.contentProtection(c, u);
|
|
9497
|
-
}, window.addEventListener(
|
|
9497
|
+
}, window.addEventListener(st, this._suspiciousActivityListener)), this._keyboardPeripherals.length > 0 && (this._keyboardPeripheralsManager = new He({
|
|
9498
9498
|
keyboardPeripherals: this._keyboardPeripherals
|
|
9499
9499
|
}), this._keyboardPeripheralListener = (h) => {
|
|
9500
9500
|
const c = h.detail;
|
|
9501
9501
|
this.listeners.peripheral(c);
|
|
9502
|
-
}, window.addEventListener(
|
|
9502
|
+
}, window.addEventListener(ot, this._keyboardPeripheralListener)), this.resizeObserver = new ResizeObserver(() => this.ownerWindow.requestAnimationFrame(async () => await this.resizeHandler())), this.resizeObserver.observe(this.container.parentElement || document.documentElement);
|
|
9503
9503
|
}
|
|
9504
9504
|
static determineLayout(t, e) {
|
|
9505
9505
|
const i = t.metadata.effectiveLayout;
|
|
9506
|
-
return i === S.fixed || t.metadata.otherMetadata && "http://openmangaformat.org/schema/1.0#version" in t.metadata.otherMetadata || t.metadata?.conformsTo?.includes(
|
|
9506
|
+
return i === S.fixed || t.metadata.otherMetadata && "http://openmangaformat.org/schema/1.0#version" in t.metadata.otherMetadata || t.metadata?.conformsTo?.includes(Ii.DIVINA) ? S.fixed : i === S.scrolled || i === S.reflowable && e ? S.scrolled : S.reflowable;
|
|
9507
9507
|
}
|
|
9508
9508
|
async load() {
|
|
9509
9509
|
if (this.positions?.length || (this.positions = await this.pub.positionsFromManifest()), this._layout === S.fixed)
|
|
@@ -9540,14 +9540,14 @@ class fn extends Qi {
|
|
|
9540
9540
|
}
|
|
9541
9541
|
}
|
|
9542
9542
|
get preferencesEditor() {
|
|
9543
|
-
return this._preferencesEditor === null && (this._preferencesEditor = new
|
|
9543
|
+
return this._preferencesEditor === null && (this._preferencesEditor = new zi(this._preferences, this.settings, this.pub.metadata)), this._preferencesEditor;
|
|
9544
9544
|
}
|
|
9545
9545
|
async submitPreferences(t) {
|
|
9546
9546
|
this._preferences = this._preferences.merging(t), await this.applyPreferences();
|
|
9547
9547
|
}
|
|
9548
9548
|
async applyPreferences() {
|
|
9549
9549
|
const t = this._settings;
|
|
9550
|
-
this._settings = new
|
|
9550
|
+
this._settings = new Mi(this._preferences, this._defaults), this._preferencesEditor !== null && (this._preferencesEditor = new zi(this._preferences, this.settings, this.pub.metadata)), this._layout === S.fixed ? this.handleFXLPrefs(t, this._settings) : await this.updateCSS(!0);
|
|
9551
9551
|
}
|
|
9552
9552
|
// TODO: fit, etc.
|
|
9553
9553
|
handleFXLPrefs(t, e) {
|
|
@@ -9571,7 +9571,7 @@ class fn extends Qi {
|
|
|
9571
9571
|
async resizeHandler() {
|
|
9572
9572
|
const t = this.container.parentElement || document.documentElement;
|
|
9573
9573
|
if (this._layout === S.fixed)
|
|
9574
|
-
this.container.style.width = `${
|
|
9574
|
+
this.container.style.width = `${Nt(t) - this._settings.constraint}px`, this.framePool.resizeHandler();
|
|
9575
9575
|
else {
|
|
9576
9576
|
const e = this._css.userProperties.colCount, i = this._css.userProperties.lineLength;
|
|
9577
9577
|
this._css.resizeHandler(), (this._css.userProperties.view !== "scroll" && e !== this._css.userProperties.colCount || i !== this._css.userProperties.lineLength) && await this.commitCSS(this._css);
|
|
@@ -9608,9 +9608,9 @@ class fn extends Qi {
|
|
|
9608
9608
|
this.listeners.frameLoaded(this._cframes[0].iframe.contentWindow), this.listeners.positionChanged(this.currentLocation);
|
|
9609
9609
|
break;
|
|
9610
9610
|
case "first_visible_locator":
|
|
9611
|
-
const i =
|
|
9611
|
+
const i = F.deserialize(e);
|
|
9612
9612
|
if (!i) break;
|
|
9613
|
-
this.currentLocation = new
|
|
9613
|
+
this.currentLocation = new F({
|
|
9614
9614
|
href: this.currentLocation.href,
|
|
9615
9615
|
type: this.currentLocation.type,
|
|
9616
9616
|
title: this.currentLocation.title,
|
|
@@ -9721,7 +9721,7 @@ class fn extends Qi {
|
|
|
9721
9721
|
throw Error("Link for " + this.currentLocation.href + " not found!");
|
|
9722
9722
|
}
|
|
9723
9723
|
async destroy() {
|
|
9724
|
-
this._suspiciousActivityListener && window.removeEventListener(
|
|
9724
|
+
this._suspiciousActivityListener && window.removeEventListener(st, this._suspiciousActivityListener), this._keyboardPeripheralListener && window.removeEventListener(ot, this._keyboardPeripheralListener), this._navigatorProtector?.destroy(), this._keyboardPeripheralsManager?.destroy(), await this.framePool?.destroy();
|
|
9725
9725
|
}
|
|
9726
9726
|
async changeResource(t) {
|
|
9727
9727
|
if (t === 0) return !1;
|
|
@@ -10048,12 +10048,12 @@ class PreservePitchProcessor extends AudioWorkletProcessor {
|
|
|
10048
10048
|
|
|
10049
10049
|
registerProcessor('preserve-pitch-processor', PreservePitchProcessor);
|
|
10050
10050
|
`;
|
|
10051
|
-
class
|
|
10051
|
+
class Be {
|
|
10052
10052
|
constructor(t) {
|
|
10053
10053
|
this.mediaElement = null, this.source = null, this.workletNode = null, this.url = null, this.ctx = t;
|
|
10054
10054
|
}
|
|
10055
10055
|
static async createWorklet(t) {
|
|
10056
|
-
const { ctx: e, mediaElement: i, pitchFactor: n, modulePath: r } = t, o = new
|
|
10056
|
+
const { ctx: e, mediaElement: i, pitchFactor: n, modulePath: r } = t, o = new Be(e);
|
|
10057
10057
|
try {
|
|
10058
10058
|
if (r)
|
|
10059
10059
|
await e.audioWorklet.addModule(r);
|
|
@@ -10296,7 +10296,7 @@ class _s {
|
|
|
10296
10296
|
*/
|
|
10297
10297
|
setPlaybackRate(t, e) {
|
|
10298
10298
|
this.currentPlaybackRate = t, this.mediaElement.playbackRate = t, e ? "preservesPitch" in this.mediaElement ? this.mediaElement.preservesPitch = !0 : this.activateWebAudio().then(() => {
|
|
10299
|
-
this.worklet ? this.worklet.updatePitchFactor(1 / t) : (this.sourceNode && (this.sourceNode.disconnect(), this.sourceNode = null),
|
|
10299
|
+
this.worklet ? this.worklet.updatePitchFactor(1 / t) : (this.sourceNode && (this.sourceNode.disconnect(), this.sourceNode = null), Be.createWorklet({
|
|
10300
10300
|
ctx: this.getOrCreateAudioContext(),
|
|
10301
10301
|
mediaElement: this.mediaElement,
|
|
10302
10302
|
pitchFactor: 1
|
|
@@ -10356,12 +10356,12 @@ class Ps {
|
|
|
10356
10356
|
this.volume = M(t.volume, Qt.range) ?? 1, this.playbackRate = M(t.playbackRate, te.range) ?? 1, this.preservePitch = P(t.preservePitch) ?? !0, this.skipBackwardInterval = M(t.skipBackwardInterval, et.range) ?? 10, this.skipForwardInterval = M(t.skipForwardInterval, et.range) ?? 10, this.pollInterval = w(t.pollInterval) ?? 1e3, this.autoPlay = P(t.autoPlay) ?? !0, this.enableMediaSession = P(t.enableMediaSession) ?? !0;
|
|
10357
10357
|
}
|
|
10358
10358
|
}
|
|
10359
|
-
class
|
|
10359
|
+
class Fi {
|
|
10360
10360
|
constructor(t, e) {
|
|
10361
10361
|
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;
|
|
10362
10362
|
}
|
|
10363
10363
|
}
|
|
10364
|
-
class
|
|
10364
|
+
class Ni {
|
|
10365
10365
|
constructor(t, e) {
|
|
10366
10366
|
this.preferences = t, this.settings = e;
|
|
10367
10367
|
}
|
|
@@ -10461,8 +10461,35 @@ class Mi {
|
|
|
10461
10461
|
}
|
|
10462
10462
|
}
|
|
10463
10463
|
class Es {
|
|
10464
|
-
constructor(t) {
|
|
10465
|
-
this.preloadedElements = /* @__PURE__ */ new Map(), this._audioEngine = t;
|
|
10464
|
+
constructor(t, e) {
|
|
10465
|
+
this.preloadedElements = /* @__PURE__ */ new Map(), this._audioEngine = t, this._publication = e, this._supportedAudioTypes = this.detectSupportedAudioTypes();
|
|
10466
|
+
}
|
|
10467
|
+
detectSupportedAudioTypes() {
|
|
10468
|
+
const t = document.createElement("audio"), e = /* @__PURE__ */ new Set();
|
|
10469
|
+
for (const n of this._publication.readingOrder.items) {
|
|
10470
|
+
n.type && e.add(n.type);
|
|
10471
|
+
for (const r of n.alternates?.items ?? [])
|
|
10472
|
+
r.type && e.add(r.type);
|
|
10473
|
+
}
|
|
10474
|
+
const i = /* @__PURE__ */ new Map();
|
|
10475
|
+
for (const n of e) {
|
|
10476
|
+
const r = t.canPlayType(n);
|
|
10477
|
+
r !== "" && i.set(n, r);
|
|
10478
|
+
}
|
|
10479
|
+
return i;
|
|
10480
|
+
}
|
|
10481
|
+
pickPlayableHref(t) {
|
|
10482
|
+
const e = [t, ...t.alternates?.items ?? []];
|
|
10483
|
+
let i;
|
|
10484
|
+
for (const n of e) {
|
|
10485
|
+
if (!n.type) continue;
|
|
10486
|
+
const r = this._supportedAudioTypes.get(n.type);
|
|
10487
|
+
if (r) {
|
|
10488
|
+
if (r === "probably") return n.href;
|
|
10489
|
+
i || (i = { href: n.href, confidence: r });
|
|
10490
|
+
}
|
|
10491
|
+
}
|
|
10492
|
+
return i?.href ?? t.href;
|
|
10466
10493
|
}
|
|
10467
10494
|
get audioEngine() {
|
|
10468
10495
|
return this._audioEngine;
|
|
@@ -10475,9 +10502,9 @@ class Es {
|
|
|
10475
10502
|
* @param currentIndex The current track index.
|
|
10476
10503
|
* @param direction The navigation direction ('forward' or 'backward').
|
|
10477
10504
|
*/
|
|
10478
|
-
setCurrentAudio(t, e
|
|
10479
|
-
const
|
|
10480
|
-
|
|
10505
|
+
setCurrentAudio(t, e) {
|
|
10506
|
+
const i = this.pickPlayableHref(this._publication.readingOrder.items[t]), n = this.audioEngine.isWebAudioActive ? void 0 : this.get(i);
|
|
10507
|
+
n ? (this.audioEngine.setMediaElement(n), this.clear(i)) : (this.clear(i), this.audioEngine.loadAudio(i)), this.preloadAdjacent(t, e);
|
|
10481
10508
|
}
|
|
10482
10509
|
preload(t) {
|
|
10483
10510
|
if (this.preloadedElements.has(t))
|
|
@@ -10505,33 +10532,31 @@ class Es {
|
|
|
10505
10532
|
* @param publication The publication containing the reading order.
|
|
10506
10533
|
* @param currentIndex The current track index.
|
|
10507
10534
|
*/
|
|
10508
|
-
preloadNext(t
|
|
10509
|
-
const
|
|
10510
|
-
if (
|
|
10511
|
-
const
|
|
10512
|
-
|
|
10535
|
+
preloadNext(t) {
|
|
10536
|
+
const e = t + 1;
|
|
10537
|
+
if (e < this._publication.readingOrder.items.length) {
|
|
10538
|
+
const i = this._publication.readingOrder.items[e];
|
|
10539
|
+
this.preload(this.pickPlayableHref(i));
|
|
10513
10540
|
}
|
|
10514
10541
|
}
|
|
10515
10542
|
/**
|
|
10516
10543
|
* Preloads the previous track in the reading order.
|
|
10517
|
-
* @param publication The publication containing the reading order.
|
|
10518
10544
|
* @param currentIndex The current track index.
|
|
10519
10545
|
*/
|
|
10520
|
-
preloadPrevious(t
|
|
10521
|
-
const
|
|
10522
|
-
if (
|
|
10523
|
-
const
|
|
10524
|
-
|
|
10546
|
+
preloadPrevious(t) {
|
|
10547
|
+
const e = t - 1;
|
|
10548
|
+
if (e >= 0) {
|
|
10549
|
+
const i = this._publication.readingOrder.items[e];
|
|
10550
|
+
this.preload(this.pickPlayableHref(i));
|
|
10525
10551
|
}
|
|
10526
10552
|
}
|
|
10527
10553
|
/**
|
|
10528
10554
|
* Preloads adjacent tracks (previous and next) for smoother navigation.
|
|
10529
|
-
* @param publication The publication containing the reading order.
|
|
10530
10555
|
* @param currentIndex The current track index.
|
|
10531
10556
|
* @param direction The navigation direction ('forward' or 'backward').
|
|
10532
10557
|
*/
|
|
10533
|
-
preloadAdjacent(t, e
|
|
10534
|
-
|
|
10558
|
+
preloadAdjacent(t, e = "forward") {
|
|
10559
|
+
e === "forward" ? (this.preloadNext(t), this.preloadPrevious(t)) : (this.preloadPrevious(t), this.preloadNext(t));
|
|
10535
10560
|
}
|
|
10536
10561
|
/**
|
|
10537
10562
|
* Destroys the pool by stopping the engine and clearing all preloaded elements.
|
|
@@ -10540,19 +10565,90 @@ class Es {
|
|
|
10540
10565
|
this.audioEngine.stop(), this.preloadedElements.clear();
|
|
10541
10566
|
}
|
|
10542
10567
|
}
|
|
10543
|
-
class
|
|
10568
|
+
class Cs {
|
|
10569
|
+
constructor(t = {}) {
|
|
10570
|
+
this.dragstartHandler = (e) => {
|
|
10571
|
+
e.preventDefault(), e.stopPropagation(), t.onDragDetected?.(Array.from(e.dataTransfer?.types ?? []));
|
|
10572
|
+
}, this.dropHandler = (e) => {
|
|
10573
|
+
e.preventDefault(), e.stopPropagation();
|
|
10574
|
+
const i = Array.from(e.dataTransfer?.types ?? []), n = e.dataTransfer?.files.length ?? 0;
|
|
10575
|
+
t.onDropDetected?.(i, n);
|
|
10576
|
+
}, document.addEventListener("dragstart", this.dragstartHandler, !0), document.addEventListener("drop", this.dropHandler, !0), window.addEventListener("unload", () => this.destroy());
|
|
10577
|
+
}
|
|
10578
|
+
destroy() {
|
|
10579
|
+
document.removeEventListener("dragstart", this.dragstartHandler, !0), document.removeEventListener("drop", this.dropHandler, !0);
|
|
10580
|
+
}
|
|
10581
|
+
}
|
|
10582
|
+
class xs {
|
|
10583
|
+
constructor(t = {}) {
|
|
10584
|
+
this.copyHandler = (e) => {
|
|
10585
|
+
e.preventDefault(), e.stopPropagation(), t.onCopyBlocked?.();
|
|
10586
|
+
}, document.addEventListener("copy", this.copyHandler, !0), window.addEventListener("unload", () => this.destroy());
|
|
10587
|
+
}
|
|
10588
|
+
destroy() {
|
|
10589
|
+
document.removeEventListener("copy", this.copyHandler, !0);
|
|
10590
|
+
}
|
|
10591
|
+
}
|
|
10592
|
+
class Rs extends We {
|
|
10593
|
+
constructor(t = {}) {
|
|
10594
|
+
super(t), t.disableDragAndDrop && (this.dragAndDropProtector = new Cs({
|
|
10595
|
+
onDragDetected: (e) => {
|
|
10596
|
+
this.dispatchSuspiciousActivity("drag_detected", { dataTransferTypes: e, targetFrameSrc: "" });
|
|
10597
|
+
},
|
|
10598
|
+
onDropDetected: (e, i) => {
|
|
10599
|
+
this.dispatchSuspiciousActivity("drop_detected", { dataTransferTypes: e, fileCount: i, targetFrameSrc: "" });
|
|
10600
|
+
}
|
|
10601
|
+
})), t.protectCopy && (this.copyProtector = new xs({
|
|
10602
|
+
onCopyBlocked: () => {
|
|
10603
|
+
this.dispatchSuspiciousActivity("bulk_copy", { targetFrameSrc: "" });
|
|
10604
|
+
}
|
|
10605
|
+
}));
|
|
10606
|
+
}
|
|
10607
|
+
destroy() {
|
|
10608
|
+
super.destroy(), this.dragAndDropProtector?.destroy(), this.copyProtector?.destroy();
|
|
10609
|
+
}
|
|
10610
|
+
}
|
|
10611
|
+
const Ls = (s) => ({
|
|
10612
|
+
trackLoaded: s.trackLoaded ?? (() => {
|
|
10613
|
+
}),
|
|
10614
|
+
positionChanged: s.positionChanged ?? (() => {
|
|
10615
|
+
}),
|
|
10616
|
+
error: s.error ?? (() => {
|
|
10617
|
+
}),
|
|
10618
|
+
trackEnded: s.trackEnded ?? (() => {
|
|
10619
|
+
}),
|
|
10620
|
+
play: s.play ?? (() => {
|
|
10621
|
+
}),
|
|
10622
|
+
pause: s.pause ?? (() => {
|
|
10623
|
+
}),
|
|
10624
|
+
metadataLoaded: s.metadataLoaded ?? (() => {
|
|
10625
|
+
}),
|
|
10626
|
+
stalled: s.stalled ?? (() => {
|
|
10627
|
+
}),
|
|
10628
|
+
seeking: s.seeking ?? (() => {
|
|
10629
|
+
}),
|
|
10630
|
+
seekable: s.seekable ?? (() => {
|
|
10631
|
+
}),
|
|
10632
|
+
contentProtection: s.contentProtection ?? (() => {
|
|
10633
|
+
}),
|
|
10634
|
+
peripheral: s.peripheral ?? (() => {
|
|
10635
|
+
}),
|
|
10636
|
+
contextMenu: s.contextMenu ?? (() => {
|
|
10637
|
+
})
|
|
10638
|
+
});
|
|
10639
|
+
class Os extends hr {
|
|
10544
10640
|
constructor(t, e, i, n = {
|
|
10545
10641
|
preferences: {},
|
|
10546
10642
|
defaults: {}
|
|
10547
10643
|
}) {
|
|
10548
|
-
if (super(), this.positionPollInterval = null, this.navigationId = 0, this._preferencesEditor = null, this.pub = t, this._preferences = new oe(n.preferences), this._defaults = new Ps(n.defaults), this._settings = new
|
|
10644
|
+
if (super(), this.positionPollInterval = null, this.navigationId = 0, this._preferencesEditor = null, this._navigatorProtector = null, this._keyboardPeripheralsManager = null, this._suspiciousActivityListener = null, this._keyboardPeripheralListener = null, this.pub = t, this.listeners = Ls(e), this._preferences = new oe(n.preferences), this._defaults = new Ps(n.defaults), this._settings = new Fi(this._preferences, this._defaults), i)
|
|
10549
10645
|
this.currentLocation = this.ensureLocatorLocations(i);
|
|
10550
10646
|
else {
|
|
10551
|
-
const
|
|
10552
|
-
this.currentLocation = new
|
|
10553
|
-
href:
|
|
10554
|
-
type:
|
|
10555
|
-
title:
|
|
10647
|
+
const u = this.pub.readingOrder.items[0];
|
|
10648
|
+
this.currentLocation = new F({
|
|
10649
|
+
href: u.href,
|
|
10650
|
+
type: u.type || "audio/mpeg",
|
|
10651
|
+
title: u.title,
|
|
10556
10652
|
locations: new E({
|
|
10557
10653
|
position: 0,
|
|
10558
10654
|
progression: 0,
|
|
@@ -10572,7 +10668,17 @@ class xs extends hr {
|
|
|
10572
10668
|
index: o
|
|
10573
10669
|
}
|
|
10574
10670
|
});
|
|
10575
|
-
this.pool = new Es(l
|
|
10671
|
+
this.pool = new Es(l, t);
|
|
10672
|
+
const h = n.contentProtection || {}, c = this.mergeKeyboardPeripherals(
|
|
10673
|
+
h,
|
|
10674
|
+
n.keyboardPeripherals || []
|
|
10675
|
+
);
|
|
10676
|
+
(h.disableContextMenu || h.checkAutomation || h.checkIFrameEmbedding || h.monitorDevTools || h.protectPrinting?.disable || h.disableDragAndDrop || h.protectCopy) && (this._navigatorProtector = new Rs(h), this._suspiciousActivityListener = (u) => {
|
|
10677
|
+
const { type: m, ...y } = u.detail;
|
|
10678
|
+
m === "context_menu" ? this.listeners.contextMenu(y) : this.listeners.contentProtection(m, y);
|
|
10679
|
+
}, window.addEventListener(st, this._suspiciousActivityListener)), c.length > 0 && (this._keyboardPeripheralsManager = new He({ keyboardPeripherals: c }), this._keyboardPeripheralListener = (u) => {
|
|
10680
|
+
this.listeners.peripheral(u.detail);
|
|
10681
|
+
}, window.addEventListener(ot, this._keyboardPeripheralListener)), this.setupEventListeners(), this._settings.enableMediaSession && this.setupMediaSession(), this.pool.setCurrentAudio(o, "forward"), this.waitForLoadedAndSeeked(a).then(() => {
|
|
10576
10682
|
this.listeners.trackLoaded(this.pool.audioEngine.getMediaElement()), this.listeners.positionChanged(this.currentLocator);
|
|
10577
10683
|
}).catch(() => {
|
|
10578
10684
|
});
|
|
@@ -10581,20 +10687,20 @@ class xs extends hr {
|
|
|
10581
10687
|
return this._settings;
|
|
10582
10688
|
}
|
|
10583
10689
|
get preferencesEditor() {
|
|
10584
|
-
return this._preferencesEditor === null && (this._preferencesEditor = new
|
|
10690
|
+
return this._preferencesEditor === null && (this._preferencesEditor = new Ni(this._preferences, this.settings)), this._preferencesEditor;
|
|
10585
10691
|
}
|
|
10586
10692
|
async submitPreferences(t) {
|
|
10587
10693
|
this._preferences = this._preferences.merging(t), this.applyPreferences();
|
|
10588
10694
|
}
|
|
10589
10695
|
applyPreferences() {
|
|
10590
10696
|
const t = this._settings;
|
|
10591
|
-
this._settings = new
|
|
10697
|
+
this._settings = new Fi(this._preferences, this._defaults), this._preferencesEditor !== null && (this._preferencesEditor = new Ni(this._preferences, this.settings)), this.pool.audioEngine.setVolume(this._settings.volume), this.pool.audioEngine.setPlaybackRate(this._settings.playbackRate, this._settings.preservePitch), this._settings.enableMediaSession && !t.enableMediaSession ? this.setupMediaSession() : !this._settings.enableMediaSession && t.enableMediaSession && this.destroyMediaSession();
|
|
10592
10698
|
}
|
|
10593
10699
|
get publication() {
|
|
10594
10700
|
return this.pub;
|
|
10595
10701
|
}
|
|
10596
10702
|
ensureLocatorLocations(t) {
|
|
10597
|
-
return new
|
|
10703
|
+
return new F({
|
|
10598
10704
|
...t,
|
|
10599
10705
|
locations: t.locations instanceof E ? t.locations : t.locations ? new E(t.locations) : void 0
|
|
10600
10706
|
});
|
|
@@ -10627,7 +10733,7 @@ class xs extends hr {
|
|
|
10627
10733
|
const i = this.pub.readingOrder.items[t];
|
|
10628
10734
|
if (!i) throw new Error(`Invalid track index: ${t}`);
|
|
10629
10735
|
const n = this.pool.audioEngine.duration();
|
|
10630
|
-
return new
|
|
10736
|
+
return new F({
|
|
10631
10737
|
href: i.href,
|
|
10632
10738
|
type: i.type || "audio/mpeg",
|
|
10633
10739
|
title: i.title,
|
|
@@ -10735,7 +10841,7 @@ class xs extends hr {
|
|
|
10735
10841
|
return;
|
|
10736
10842
|
}
|
|
10737
10843
|
const a = ++this.navigationId, l = r >= this.currentTrackIndex() ? "forward" : "backward", h = this.isPlaying;
|
|
10738
|
-
if (this.stopPositionPolling(), this.pool.setCurrentAudio(
|
|
10844
|
+
if (this.stopPositionPolling(), this.pool.setCurrentAudio(r, l), this.currentLocation = t.copyWithLocations(t.locations), await this.waitForLoadedAndSeeked(o, a), a !== this.navigationId) return;
|
|
10739
10845
|
this.listeners.trackLoaded(this.pool.audioEngine.getMediaElement()), this.listeners.positionChanged(this.currentLocator), this._settings.enableMediaSession && this.updateMediaSessionMetadata(), h && this.play(), i(!0);
|
|
10740
10846
|
} catch (n) {
|
|
10741
10847
|
console.error("Failed to go to locator:", n), i(!1);
|
|
@@ -10818,36 +10924,36 @@ class xs extends hr {
|
|
|
10818
10924
|
"mediaSession" in navigator && (navigator.mediaSession.metadata = null, navigator.mediaSession.setActionHandler("play", null), navigator.mediaSession.setActionHandler("pause", null), navigator.mediaSession.setActionHandler("previoustrack", null), navigator.mediaSession.setActionHandler("nexttrack", null), navigator.mediaSession.setActionHandler("seekbackward", null), navigator.mediaSession.setActionHandler("seekforward", null));
|
|
10819
10925
|
}
|
|
10820
10926
|
destroy() {
|
|
10821
|
-
this.stopPositionPolling(), this.destroyMediaSession(), this.pool.destroy();
|
|
10927
|
+
this.stopPositionPolling(), this.destroyMediaSession(), this._suspiciousActivityListener && window.removeEventListener(st, this._suspiciousActivityListener), this._keyboardPeripheralListener && window.removeEventListener(ot, this._keyboardPeripheralListener), this._navigatorProtector?.destroy(), this._keyboardPeripheralsManager?.destroy(), this.pool.destroy();
|
|
10822
10928
|
}
|
|
10823
10929
|
}
|
|
10824
10930
|
export {
|
|
10825
10931
|
Ps as AudioDefaults,
|
|
10826
|
-
|
|
10932
|
+
Os as AudioNavigator,
|
|
10827
10933
|
oe as AudioPreferences,
|
|
10828
|
-
|
|
10829
|
-
|
|
10934
|
+
Ni as AudioPreferencesEditor,
|
|
10935
|
+
Fi as AudioSettings,
|
|
10830
10936
|
O as BooleanPreference,
|
|
10831
|
-
|
|
10937
|
+
ln as EnumPreference,
|
|
10832
10938
|
os as EpubDefaults,
|
|
10833
10939
|
fn as EpubNavigator,
|
|
10834
10940
|
Ot as EpubPreferences,
|
|
10835
|
-
|
|
10836
|
-
|
|
10837
|
-
|
|
10941
|
+
zi as EpubPreferencesEditor,
|
|
10942
|
+
Mi as EpubSettings,
|
|
10943
|
+
ks as ExperimentalWebPubNavigator,
|
|
10838
10944
|
Kr as FXLCoordinator,
|
|
10839
10945
|
Xr as FXLFrameManager,
|
|
10840
10946
|
ss as FXLFramePoolManager,
|
|
10841
10947
|
Jr as FXLPeripherals,
|
|
10842
10948
|
Qr as FXLSpreader,
|
|
10843
|
-
|
|
10949
|
+
Lt as FrameComms,
|
|
10844
10950
|
Gr as FrameManager,
|
|
10845
10951
|
$r as FramePoolManager,
|
|
10846
10952
|
Yr as HorizontalThird,
|
|
10847
|
-
|
|
10848
|
-
|
|
10953
|
+
dn as Injector,
|
|
10954
|
+
_t as LineLengths,
|
|
10849
10955
|
hr as MediaNavigator,
|
|
10850
|
-
|
|
10956
|
+
tn as Navigator,
|
|
10851
10957
|
Re as Orientation,
|
|
10852
10958
|
A as Preference,
|
|
10853
10959
|
re as Properties,
|
|
@@ -10858,7 +10964,7 @@ export {
|
|
|
10858
10964
|
J as TextAlignment,
|
|
10859
10965
|
gn as UserProperties,
|
|
10860
10966
|
qr as VerticalThird,
|
|
10861
|
-
|
|
10967
|
+
en as VisualNavigator,
|
|
10862
10968
|
_s as WebAudioEngine,
|
|
10863
10969
|
cr as WebPubBlobBuilder,
|
|
10864
10970
|
Pr as WebPubCSS,
|
|
@@ -10866,28 +10972,28 @@ export {
|
|
|
10866
10972
|
fr as WebPubFrameManager,
|
|
10867
10973
|
yr as WebPubFramePoolManager,
|
|
10868
10974
|
Vr as WebPubNavigator,
|
|
10869
|
-
|
|
10870
|
-
|
|
10871
|
-
|
|
10975
|
+
kt as WebPubPreferences,
|
|
10976
|
+
Pi as WebPubPreferencesEditor,
|
|
10977
|
+
_i as WebPubSettings,
|
|
10872
10978
|
_r as WebRSProperties,
|
|
10873
|
-
|
|
10979
|
+
on as WebUserProperties,
|
|
10874
10980
|
P as ensureBoolean,
|
|
10875
10981
|
se as ensureEnumValue,
|
|
10876
|
-
|
|
10877
|
-
|
|
10982
|
+
an as ensureExperiment,
|
|
10983
|
+
ft as ensureFilter,
|
|
10878
10984
|
Er as ensureLessThanOrEqual,
|
|
10879
10985
|
Cr as ensureMoreThanOrEqual,
|
|
10880
10986
|
w as ensureNonNegative,
|
|
10881
10987
|
I as ensureString,
|
|
10882
10988
|
M as ensureValueInRange,
|
|
10883
10989
|
Ie as experiments,
|
|
10884
|
-
|
|
10990
|
+
ht as filterRangeConfig,
|
|
10885
10991
|
Gt as fontSizeRangeConfig,
|
|
10886
10992
|
nt as fontWeightRangeConfig,
|
|
10887
10993
|
$t as fontWidthRangeConfig,
|
|
10888
10994
|
Xt as letterSpacingRangeConfig,
|
|
10889
10995
|
Yt as lineHeightRangeConfig,
|
|
10890
|
-
|
|
10996
|
+
ct as lineLengthRangeConfig,
|
|
10891
10997
|
qt as paragraphIndentRangeConfig,
|
|
10892
10998
|
Kt as paragraphSpacingRangeConfig,
|
|
10893
10999
|
te as playbackRateRangeConfig,
|