@readium/navigator-html-injectables 2.3.0 → 2.3.1-alpha.1
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 +343 -332
- package/dist/index.umd.cjs +9 -9
- package/package.json +8 -8
- package/src/helpers/css.ts +2 -0
- package/src/modules/snapper/ColumnSnapper.ts +22 -3
- package/types/src/helpers/css.d.ts +1 -0
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const
|
|
2
|
-
class
|
|
1
|
+
const De = Math.pow(2, 32), _t = () => Math.round(Math.random() * De).toString(36), ze = () => `${Math.round(performance.now())}-${_t()}-${_t()}`, K = 1;
|
|
2
|
+
class Me {
|
|
3
3
|
constructor(t) {
|
|
4
4
|
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);
|
|
5
5
|
}
|
|
@@ -73,7 +73,7 @@ class ze {
|
|
|
73
73
|
const n = {
|
|
74
74
|
_readium: K,
|
|
75
75
|
_channel: this.channelId,
|
|
76
|
-
id: i ??
|
|
76
|
+
id: i ?? ze(),
|
|
77
77
|
// scrict,
|
|
78
78
|
key: t,
|
|
79
79
|
data: e
|
|
@@ -126,8 +126,8 @@ const y = class y {
|
|
|
126
126
|
}
|
|
127
127
|
};
|
|
128
128
|
y.EPUB_A11Y_10_WCAG_20_A = new y("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-a"), y.EPUB_A11Y_10_WCAG_20_AA = new y("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-aa"), y.EPUB_A11Y_10_WCAG_20_AAA = new y("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-aaa"), y.EPUB_A11Y_11_WCAG_20_A = new y("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-a"), y.EPUB_A11Y_11_WCAG_20_AA = new y("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-aa"), y.EPUB_A11Y_11_WCAG_20_AAA = new y("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-aaa"), y.EPUB_A11Y_11_WCAG_21_A = new y("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-a"), y.EPUB_A11Y_11_WCAG_21_AA = new y("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-aa"), y.EPUB_A11Y_11_WCAG_21_AAA = new y("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-aaa"), y.EPUB_A11Y_11_WCAG_22_A = new y("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-a"), y.EPUB_A11Y_11_WCAG_22_AA = new y("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-aa"), y.EPUB_A11Y_11_WCAG_22_AAA = new y("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-aaa");
|
|
129
|
-
let
|
|
130
|
-
const
|
|
129
|
+
let Vt = y;
|
|
130
|
+
const v = class v {
|
|
131
131
|
constructor(t) {
|
|
132
132
|
this.value = t;
|
|
133
133
|
}
|
|
@@ -136,7 +136,7 @@ const w = class w {
|
|
|
136
136
|
*/
|
|
137
137
|
static deserialize(t) {
|
|
138
138
|
if (!(!t || typeof t != "string"))
|
|
139
|
-
return new
|
|
139
|
+
return new v(t);
|
|
140
140
|
}
|
|
141
141
|
/**
|
|
142
142
|
* Serializes an [AccessMode] to its RWPM JSON representation.
|
|
@@ -145,8 +145,8 @@ const w = class w {
|
|
|
145
145
|
return this.value;
|
|
146
146
|
}
|
|
147
147
|
};
|
|
148
|
-
|
|
149
|
-
let
|
|
148
|
+
v.AUDITORY = new v("auditory"), v.CHART_ON_VISUAL = new v("chartOnVisual"), v.CHEM_ON_VISUAL = new v("chemOnVisual"), v.COLOR_DEPENDENT = new v("colorDependent"), v.DIAGRAM_ON_VISUAL = new v("diagramOnVisual"), v.MATH_ON_VISUAL = new v("mathOnVisual"), v.MUSIC_ON_VISUAL = new v("musicOnVisual"), v.TACTILE = new v("tactile"), v.TEXT_ON_VISUAL = new v("textOnVisual"), v.TEXTUAL = new v("textual"), v.VISUAL = new v("visual");
|
|
149
|
+
let Gt = v;
|
|
150
150
|
const T = class T {
|
|
151
151
|
constructor(t) {
|
|
152
152
|
if (typeof t == "string") {
|
|
@@ -182,7 +182,7 @@ const T = class T {
|
|
|
182
182
|
}
|
|
183
183
|
};
|
|
184
184
|
T.VALID_MODES = /* @__PURE__ */ new Set(["auditory", "tactile", "textual", "visual"]), T.AUDITORY = new T("auditory"), T.TACTILE = new T("tactile"), T.TEXTUAL = new T("textual"), T.VISUAL = new T("visual");
|
|
185
|
-
let
|
|
185
|
+
let Ft = T;
|
|
186
186
|
const c = class c {
|
|
187
187
|
constructor(t) {
|
|
188
188
|
this.value = t;
|
|
@@ -202,7 +202,7 @@ const c = class c {
|
|
|
202
202
|
}
|
|
203
203
|
};
|
|
204
204
|
c.NONE = new c("none"), c.ANNOTATIONS = new c("annotations"), c.ARIA = new c("ARIA"), c.INDEX = new c("index"), c.PAGE_BREAK_MARKERS = new c("pageBreakMarkers"), c.PAGE_NAVIGATION = new c("pageNavigation"), c.PRINT_PAGE_NUMBERS = new c("printPageNumbers"), c.READING_ORDER = new c("readingOrder"), c.STRUCTURAL_NAVIGATION = new c("structuralNavigation"), c.TABLE_OF_CONTENTS = new c("tableOfContents"), c.TAGGED_PDF = new c("taggedPDF"), c.ALTERNATIVE_TEXT = new c("alternativeText"), c.AUDIO_DESCRIPTION = new c("audioDescription"), c.CAPTIONS = new c("captions"), c.CLOSED_CAPTIONS = new c("closedCaptions"), c.DESCRIBED_MATH = new c("describedMath"), c.LONG_DESCRIPTION = new c("longDescription"), c.OPEN_CAPTIONS = new c("openCaptions"), c.SIGN_LANGUAGE = new c("signLanguage"), c.TRANSCRIPT = new c("transcript"), c.DISPLAY_TRANSFORMABILITY = new c("displayTransformability"), c.SYNCHRONIZED_AUDIO_TEXT = new c("synchronizedAudioText"), c.TIMING_CONTROL = new c("timingControl"), c.UNLOCKED = new c("unlocked"), c.CHEM_ML = new c("ChemML"), c.LATEX = new c("latex"), c.LATEX_CHEMISTRY = new c("latex-chemistry"), c.MATH_ML = new c("MathML"), c.MATH_ML_CHEMISTRY = new c("MathML-chemistry"), c.TTS_MARKUP = new c("ttsMarkup"), c.HIGH_CONTRAST_AUDIO = new c("highContrastAudio"), c.HIGH_CONTRAST_DISPLAY = new c("highContrastDisplay"), c.LARGE_PRINT = new c("largePrint"), c.BRAILLE = new c("braille"), c.TACTILE_GRAPHIC = new c("tactileGraphic"), c.TACTILE_OBJECT = new c("tactileObject"), c.FULL_RUBY_ANNOTATIONS = new c("fullRubyAnnotations"), c.HORIZONTAL_WRITING = new c("horizontalWriting"), c.RUBY_ANNOTATIONS = new c("rubyAnnotations"), c.VERTICAL_WRITING = new c("verticalWriting"), c.WITH_ADDITIONAL_WORD_SEGMENTATION = new c("withAdditionalWordSegmentation"), c.WITHOUT_ADDITIONAL_WORD_SEGMENTATION = new c("withoutAdditionalWordSegmentation");
|
|
205
|
-
let
|
|
205
|
+
let $t = c;
|
|
206
206
|
const S = class S {
|
|
207
207
|
constructor(t) {
|
|
208
208
|
this.value = t;
|
|
@@ -222,7 +222,7 @@ const S = class S {
|
|
|
222
222
|
}
|
|
223
223
|
};
|
|
224
224
|
S.FLASHING = new S("flashing"), S.NO_FLASHING_HAZARD = new S("noFlashingHazard"), S.UNKNOWN_FLASHING_HAZARD = new S("unknownFlashingHazard"), S.MOTION_SIMULATION = new S("motionSimulation"), S.NO_MOTION_SIMULATION_HAZARD = new S("noMotionSimulationHazard"), S.UNKNOWN_MOTION_SIMULATION_HAZARD = new S("unknownMotionSimulationHazard"), S.SOUND = new S("sound"), S.NO_SOUND_HAZARD = new S("noSoundHazard"), S.UNKNOWN_SOUND_HAZARD = new S("unknownSoundHazard"), S.UNKNOWN = new S("unknown"), S.NONE = new S("none");
|
|
225
|
-
let
|
|
225
|
+
let Yt = S;
|
|
226
226
|
const E = class E {
|
|
227
227
|
constructor(t) {
|
|
228
228
|
this.value = t;
|
|
@@ -242,10 +242,10 @@ const E = class E {
|
|
|
242
242
|
}
|
|
243
243
|
};
|
|
244
244
|
E.NONE = new E("none"), E.DOCUMENTED = new E("documented"), E.LEGAL = new E("legal"), E.TEMPORARY = new E("temporary"), E.TECHNICAL = new E("technical"), E.EAA_DISPROPORTIONATE_BURDEN = new E("eaa-disproportionate-burden"), E.EAA_FUNDAMENTAL_ALTERATION = new E("eaa-fundamental-alteration"), E.EAA_MICROENTERPRISE = new E("eaa-microenterprise"), E.EAA_TECHNICAL_IMPOSSIBILITY = new E("eaa-technical-impossibility"), E.EAA_TEMPORARY = new E("eaa-temporary");
|
|
245
|
-
let
|
|
246
|
-
const Xt = ["en", "ar", "da", "fr", "it", "pt_PT", "sv"], Me = /* @__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"}}`), ke = {
|
|
247
|
-
publication:
|
|
248
|
-
},
|
|
245
|
+
let Xt = E;
|
|
246
|
+
const qt = ["en", "ar", "da", "fr", "it", "pt_PT", "sv"], ke = /* @__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"}}`), We = {
|
|
247
|
+
publication: ke
|
|
248
|
+
}, Kt = {
|
|
249
249
|
fr: () => import("./fr-C5HEel98.js"),
|
|
250
250
|
ar: () => import("./ar-DyHX_uy2.js"),
|
|
251
251
|
da: () => import("./da-Dct0PS3E.js"),
|
|
@@ -256,10 +256,10 @@ const Xt = ["en", "ar", "da", "fr", "it", "pt_PT", "sv"], Me = /* @__PURE__ */ J
|
|
|
256
256
|
sv: () => import("./sv-BfzAFsVN.js")
|
|
257
257
|
// 'tr': () => import('@edrlab/thorium-locales/publication-metadata/tr.json'),
|
|
258
258
|
// 'uk': () => import('@edrlab/thorium-locales/publication-metadata/uk.json')
|
|
259
|
-
},
|
|
259
|
+
}, Zt = We?.publication?.metadata?.accessibility?.["display-guide"] || {};
|
|
260
260
|
class F {
|
|
261
261
|
constructor() {
|
|
262
|
-
this.currentLocaleCode = "en", this.locale =
|
|
262
|
+
this.currentLocaleCode = "en", this.locale = Zt, this.loadedLocales = {}, this.loadedLocales.en = Zt;
|
|
263
263
|
}
|
|
264
264
|
static getInstance() {
|
|
265
265
|
return F.instance || (F.instance = new F()), F.instance;
|
|
@@ -270,14 +270,14 @@ class F {
|
|
|
270
270
|
* @returns Promise indicating if the locale was loaded successfully
|
|
271
271
|
*/
|
|
272
272
|
async loadLocale(t) {
|
|
273
|
-
if (!
|
|
273
|
+
if (!qt.includes(t))
|
|
274
274
|
return console.warn(`Locale '${t}' is not enabled`), !1;
|
|
275
275
|
if (t in this.loadedLocales)
|
|
276
276
|
return !0;
|
|
277
277
|
try {
|
|
278
|
-
if (!(t in
|
|
278
|
+
if (!(t in Kt))
|
|
279
279
|
return console.warn(`Locale file not found for: ${t}`), !1;
|
|
280
|
-
const s = (await
|
|
280
|
+
const s = (await Kt[t]()).default?.publication?.metadata?.accessibility?.["display-guide"];
|
|
281
281
|
return s ? (this.loadedLocales[t] = s, !0) : (console.warn(`No accessibility strings found in locale ${t}`), !1);
|
|
282
282
|
} catch (e) {
|
|
283
283
|
return console.warn(`Failed to load locale ${t}:`, e), !1;
|
|
@@ -311,7 +311,7 @@ class F {
|
|
|
311
311
|
* Gets a list of available locale codes
|
|
312
312
|
*/
|
|
313
313
|
getAvailableLocales() {
|
|
314
|
-
return
|
|
314
|
+
return qt;
|
|
315
315
|
}
|
|
316
316
|
getNestedValue(t, e) {
|
|
317
317
|
const i = e.split(".");
|
|
@@ -334,7 +334,7 @@ class F {
|
|
|
334
334
|
}
|
|
335
335
|
}
|
|
336
336
|
F.getInstance();
|
|
337
|
-
class
|
|
337
|
+
class It {
|
|
338
338
|
/**
|
|
339
339
|
* Creates a [Encryption].
|
|
340
340
|
*/
|
|
@@ -346,7 +346,7 @@ class Rt {
|
|
|
346
346
|
*/
|
|
347
347
|
static deserialize(t) {
|
|
348
348
|
if (t && t.algorithm)
|
|
349
|
-
return new
|
|
349
|
+
return new It({
|
|
350
350
|
algorithm: t.algorithm,
|
|
351
351
|
compression: t.compression,
|
|
352
352
|
originalLength: t.originalLength,
|
|
@@ -394,16 +394,16 @@ class R {
|
|
|
394
394
|
}
|
|
395
395
|
Object.defineProperty(R.prototype, "encryption", {
|
|
396
396
|
get: function() {
|
|
397
|
-
return
|
|
397
|
+
return It.deserialize(this.otherProperties.encrypted);
|
|
398
398
|
}
|
|
399
399
|
});
|
|
400
|
-
function
|
|
400
|
+
function Ue(r) {
|
|
401
401
|
return r && Array.isArray(r) ? r : void 0;
|
|
402
402
|
}
|
|
403
|
-
function
|
|
404
|
-
return r && typeof r == "string" ? [r] :
|
|
403
|
+
function be(r) {
|
|
404
|
+
return r && typeof r == "string" ? [r] : Ue(r);
|
|
405
405
|
}
|
|
406
|
-
function
|
|
406
|
+
function Jt(r) {
|
|
407
407
|
return typeof r == "string" ? new Date(r) : void 0;
|
|
408
408
|
}
|
|
409
409
|
function at(r) {
|
|
@@ -412,7 +412,7 @@ function at(r) {
|
|
|
412
412
|
function O(r) {
|
|
413
413
|
return at(r) !== void 0 && Math.sign(r) >= 0 ? r : void 0;
|
|
414
414
|
}
|
|
415
|
-
function
|
|
415
|
+
function Be(r) {
|
|
416
416
|
const t = new Array();
|
|
417
417
|
return r.forEach((e) => t.push(e)), t;
|
|
418
418
|
}
|
|
@@ -428,18 +428,18 @@ class l {
|
|
|
428
428
|
throw new Error("Invalid media type");
|
|
429
429
|
const o = {};
|
|
430
430
|
for (let m = 1; m < s.length; m++) {
|
|
431
|
-
const
|
|
432
|
-
if (
|
|
433
|
-
const f =
|
|
431
|
+
const w = s[m].split("=");
|
|
432
|
+
if (w.length === 2) {
|
|
433
|
+
const f = w[0].toLocaleLowerCase(), p = f === "charset" ? w[1].toUpperCase() : w[1];
|
|
434
434
|
o[f] = p;
|
|
435
435
|
}
|
|
436
436
|
}
|
|
437
437
|
const a = {}, d = Object.keys(o);
|
|
438
|
-
d.sort((m,
|
|
438
|
+
d.sort((m, w) => m.localeCompare(w)), d.forEach((m) => a[m] = o[m]);
|
|
439
439
|
let h = "";
|
|
440
440
|
for (const m in a) {
|
|
441
|
-
const
|
|
442
|
-
h += `;${m}=${
|
|
441
|
+
const w = a[m];
|
|
442
|
+
h += `;${m}=${w}`;
|
|
443
443
|
}
|
|
444
444
|
const u = `${e}/${i}${h}`, g = a.encoding;
|
|
445
445
|
this.string = u, this.type = e, this.subtype = i, this.parameters = a, this.encoding = g, this.name = t.name, this.fileExtension = t.fileExtension;
|
|
@@ -871,7 +871,7 @@ class l {
|
|
|
871
871
|
});
|
|
872
872
|
}
|
|
873
873
|
}
|
|
874
|
-
class
|
|
874
|
+
class Qt {
|
|
875
875
|
constructor(t) {
|
|
876
876
|
this.uri = t, this.parameters = this.getParameters(t);
|
|
877
877
|
}
|
|
@@ -899,7 +899,7 @@ class Jt {
|
|
|
899
899
|
return this.uri.replace(/\{(\??)([^}]+)\}/g, (...s) => s[1] ? i(s[2]) : e(s[2]));
|
|
900
900
|
}
|
|
901
901
|
}
|
|
902
|
-
class
|
|
902
|
+
class A {
|
|
903
903
|
/**
|
|
904
904
|
* Creates a [Locations].
|
|
905
905
|
*/
|
|
@@ -920,8 +920,8 @@ class C {
|
|
|
920
920
|
]);
|
|
921
921
|
return Object.entries(t).forEach(([a, d]) => {
|
|
922
922
|
o.has(a) || n.set(a, d);
|
|
923
|
-
}), new
|
|
924
|
-
fragments:
|
|
923
|
+
}), new A({
|
|
924
|
+
fragments: be(t.fragments || t.fragment),
|
|
925
925
|
progression: e !== void 0 && e >= 0 && e <= 1 ? e : void 0,
|
|
926
926
|
totalProgression: i !== void 0 && i >= 0 && i <= 1 ? i : void 0,
|
|
927
927
|
position: s !== void 0 && s > 0 ? s : void 0,
|
|
@@ -936,7 +936,7 @@ class C {
|
|
|
936
936
|
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;
|
|
937
937
|
}
|
|
938
938
|
}
|
|
939
|
-
class
|
|
939
|
+
class _ {
|
|
940
940
|
/**
|
|
941
941
|
* Creates a [Text].
|
|
942
942
|
*/
|
|
@@ -948,7 +948,7 @@ class H {
|
|
|
948
948
|
*/
|
|
949
949
|
static deserialize(t) {
|
|
950
950
|
if (t)
|
|
951
|
-
return new
|
|
951
|
+
return new _({
|
|
952
952
|
after: t.after,
|
|
953
953
|
before: t.before,
|
|
954
954
|
highlight: t.highlight
|
|
@@ -967,7 +967,7 @@ class W {
|
|
|
967
967
|
* Creates a [Locator].
|
|
968
968
|
*/
|
|
969
969
|
constructor(t) {
|
|
970
|
-
this.href = t.href, this.type = t.type, this.title = t.title, this.locations = t.locations ? t.locations : new
|
|
970
|
+
this.href = t.href, this.type = t.type, this.title = t.title, this.locations = t.locations ? t.locations : new A({}), this.text = t.text;
|
|
971
971
|
}
|
|
972
972
|
/**
|
|
973
973
|
* Parses a [Link] from its RWPM JSON representation.
|
|
@@ -978,8 +978,8 @@ class W {
|
|
|
978
978
|
href: t.href,
|
|
979
979
|
type: t.type,
|
|
980
980
|
title: t.title,
|
|
981
|
-
locations:
|
|
982
|
-
text:
|
|
981
|
+
locations: A.deserialize(t.locations),
|
|
982
|
+
text: _.deserialize(t.text)
|
|
983
983
|
});
|
|
984
984
|
}
|
|
985
985
|
/**
|
|
@@ -998,7 +998,7 @@ class W {
|
|
|
998
998
|
type: this.type,
|
|
999
999
|
title: this.title,
|
|
1000
1000
|
text: this.text,
|
|
1001
|
-
locations: new
|
|
1001
|
+
locations: new A({ ...this.locations, ...t })
|
|
1002
1002
|
});
|
|
1003
1003
|
}
|
|
1004
1004
|
}
|
|
@@ -1026,7 +1026,7 @@ class Y {
|
|
|
1026
1026
|
size: O(t.size),
|
|
1027
1027
|
duration: O(t.duration),
|
|
1028
1028
|
bitrate: O(t.bitrate),
|
|
1029
|
-
languages:
|
|
1029
|
+
languages: be(t.language),
|
|
1030
1030
|
alternates: lt.deserialize(t.alternate),
|
|
1031
1031
|
children: lt.deserialize(t.children)
|
|
1032
1032
|
});
|
|
@@ -1036,7 +1036,7 @@ class Y {
|
|
|
1036
1036
|
*/
|
|
1037
1037
|
serialize() {
|
|
1038
1038
|
const t = { href: this.href };
|
|
1039
|
-
return this.templated !== void 0 && (t.templated = this.templated), this.type !== void 0 && (t.type = this.type), this.title !== void 0 && (t.title = this.title), this.rels && (t.rel =
|
|
1039
|
+
return this.templated !== void 0 && (t.templated = this.templated), this.type !== void 0 && (t.type = this.type), this.title !== void 0 && (t.title = this.title), this.rels && (t.rel = Be(this.rels)), this.properties && (t.properties = this.properties.serialize()), this.height !== void 0 && (t.height = this.height), this.width !== void 0 && (t.width = this.width), this.size !== void 0 && (t.size = this.size), this.duration !== void 0 && (t.duration = this.duration), this.bitrate !== void 0 && (t.bitrate = this.bitrate), this.languages && (t.language = this.languages), this.alternates && (t.alternate = this.alternates.serialize()), this.children && (t.children = this.children.serialize()), t;
|
|
1040
1040
|
}
|
|
1041
1041
|
/** MediaType of the linked resource. */
|
|
1042
1042
|
get mediaType() {
|
|
@@ -1053,14 +1053,14 @@ class Y {
|
|
|
1053
1053
|
}
|
|
1054
1054
|
/** List of URI template parameter keys, if the `Link` is templated. */
|
|
1055
1055
|
get templateParameters() {
|
|
1056
|
-
return this.templated ? new
|
|
1056
|
+
return this.templated ? new Qt(this.href).parameters : /* @__PURE__ */ new Set();
|
|
1057
1057
|
}
|
|
1058
1058
|
/** Expands the `Link`'s HREF by replacing URI template variables by the given parameters.
|
|
1059
1059
|
* See RFC 6570 on URI template: https://tools.ietf.org/html/rfc6570
|
|
1060
1060
|
*/
|
|
1061
1061
|
expandTemplate(t) {
|
|
1062
1062
|
return new Y({
|
|
1063
|
-
href: new
|
|
1063
|
+
href: new Qt(this.href).expand(t),
|
|
1064
1064
|
templated: !1
|
|
1065
1065
|
});
|
|
1066
1066
|
}
|
|
@@ -1080,7 +1080,7 @@ class Y {
|
|
|
1080
1080
|
href: t.length > 0 && t[0] !== void 0 ? t[0] : this.href,
|
|
1081
1081
|
type: this.type ?? "",
|
|
1082
1082
|
title: this.title,
|
|
1083
|
-
locations: new
|
|
1083
|
+
locations: new A({
|
|
1084
1084
|
fragments: t.length > 1 && t[1] !== void 0 ? [t[1]] : []
|
|
1085
1085
|
})
|
|
1086
1086
|
});
|
|
@@ -1215,7 +1215,7 @@ class ct {
|
|
|
1215
1215
|
return this.charOffset !== void 0 && (t.charOffset = this.charOffset), t;
|
|
1216
1216
|
}
|
|
1217
1217
|
}
|
|
1218
|
-
class
|
|
1218
|
+
class Dt {
|
|
1219
1219
|
/**
|
|
1220
1220
|
* Creates a [DomRange].
|
|
1221
1221
|
*/
|
|
@@ -1229,7 +1229,7 @@ class It {
|
|
|
1229
1229
|
if (!t) return;
|
|
1230
1230
|
let e = ct.deserialize(t.start);
|
|
1231
1231
|
if (e)
|
|
1232
|
-
return new
|
|
1232
|
+
return new Dt({
|
|
1233
1233
|
start: e,
|
|
1234
1234
|
end: ct.deserialize(t.end)
|
|
1235
1235
|
});
|
|
@@ -1242,16 +1242,16 @@ class It {
|
|
|
1242
1242
|
return this.end && (t.end = this.end.serialize()), t;
|
|
1243
1243
|
}
|
|
1244
1244
|
}
|
|
1245
|
-
|
|
1245
|
+
A.prototype.getCssSelector = function() {
|
|
1246
1246
|
return this.otherLocations?.get("cssSelector");
|
|
1247
1247
|
};
|
|
1248
|
-
|
|
1248
|
+
A.prototype.getPartialCfi = function() {
|
|
1249
1249
|
return this.otherLocations?.get("partialCfi");
|
|
1250
1250
|
};
|
|
1251
|
-
|
|
1252
|
-
return
|
|
1251
|
+
A.prototype.getDomRange = function() {
|
|
1252
|
+
return Dt.deserialize(this.otherLocations?.get("domRange"));
|
|
1253
1253
|
};
|
|
1254
|
-
|
|
1254
|
+
A.prototype.fragmentParameters = function() {
|
|
1255
1255
|
return new Map(
|
|
1256
1256
|
this.fragments.map((r) => r.startsWith("#") ? r.slice(1) : r).join("&").split("&").filter((r) => !r.startsWith("#")).map((r) => r.split("=")).filter((r) => r.length === 2).map((r) => [
|
|
1257
1257
|
r[0].trim().toLowerCase(),
|
|
@@ -1259,7 +1259,7 @@ C.prototype.fragmentParameters = function() {
|
|
|
1259
1259
|
])
|
|
1260
1260
|
);
|
|
1261
1261
|
};
|
|
1262
|
-
|
|
1262
|
+
A.prototype.htmlId = function() {
|
|
1263
1263
|
if (!this.fragments.length) return;
|
|
1264
1264
|
let r = this.fragments.find((t) => t.length && !t.includes("="));
|
|
1265
1265
|
if (!r) {
|
|
@@ -1268,22 +1268,26 @@ C.prototype.htmlId = function() {
|
|
|
1268
1268
|
}
|
|
1269
1269
|
return r?.startsWith("#") ? r.slice(1) : r;
|
|
1270
1270
|
};
|
|
1271
|
-
|
|
1271
|
+
A.prototype.page = function() {
|
|
1272
1272
|
const r = parseInt(this.fragmentParameters().get("page"));
|
|
1273
1273
|
if (!isNaN(r) && r >= 0) return r;
|
|
1274
1274
|
};
|
|
1275
|
-
|
|
1275
|
+
A.prototype.time = function() {
|
|
1276
1276
|
const r = parseInt(this.fragmentParameters().get("t"));
|
|
1277
1277
|
if (!isNaN(r)) return r;
|
|
1278
1278
|
};
|
|
1279
|
-
|
|
1279
|
+
A.prototype.space = function() {
|
|
1280
1280
|
const r = this.fragmentParameters();
|
|
1281
1281
|
if (!r.has("xywh")) return;
|
|
1282
1282
|
const t = r.get("xywh").split(",").map((e) => parseInt(e));
|
|
1283
1283
|
if (t.length === 4 && !t.some(isNaN))
|
|
1284
1284
|
return t;
|
|
1285
1285
|
};
|
|
1286
|
-
|
|
1286
|
+
A.prototype.text = function() {
|
|
1287
|
+
const r = this.fragmentParameters();
|
|
1288
|
+
console.log(r);
|
|
1289
|
+
};
|
|
1290
|
+
class zt {
|
|
1287
1291
|
/** Creates a [Price]. */
|
|
1288
1292
|
constructor(t) {
|
|
1289
1293
|
this.currency = t.currency, this.value = t.value;
|
|
@@ -1298,7 +1302,7 @@ class Dt {
|
|
|
1298
1302
|
return;
|
|
1299
1303
|
let i = O(t.value);
|
|
1300
1304
|
if (i !== void 0)
|
|
1301
|
-
return new
|
|
1305
|
+
return new zt({ currency: e, value: i });
|
|
1302
1306
|
}
|
|
1303
1307
|
/**
|
|
1304
1308
|
* Serializes a [Price] to its RWPM JSON representation.
|
|
@@ -1334,7 +1338,7 @@ class J {
|
|
|
1334
1338
|
return this.children && (t.children = this.children.map((e) => e.serialize())), t;
|
|
1335
1339
|
}
|
|
1336
1340
|
}
|
|
1337
|
-
class
|
|
1341
|
+
class Mt {
|
|
1338
1342
|
/** Creates a [Price]. */
|
|
1339
1343
|
constructor(t) {
|
|
1340
1344
|
this.total = t.total, this.position = t.position;
|
|
@@ -1344,7 +1348,7 @@ class zt {
|
|
|
1344
1348
|
*/
|
|
1345
1349
|
static deserialize(t) {
|
|
1346
1350
|
if (t)
|
|
1347
|
-
return new
|
|
1351
|
+
return new Mt({
|
|
1348
1352
|
total: O(t.total),
|
|
1349
1353
|
position: O(t.position)
|
|
1350
1354
|
});
|
|
@@ -1357,7 +1361,7 @@ class zt {
|
|
|
1357
1361
|
return this.total !== void 0 && (t.total = this.total), this.position !== void 0 && (t.position = this.position), t;
|
|
1358
1362
|
}
|
|
1359
1363
|
}
|
|
1360
|
-
class
|
|
1364
|
+
class kt {
|
|
1361
1365
|
/** Creates a [Copies]. */
|
|
1362
1366
|
constructor(t) {
|
|
1363
1367
|
this.total = t.total, this.available = t.available;
|
|
@@ -1367,7 +1371,7 @@ class Mt {
|
|
|
1367
1371
|
*/
|
|
1368
1372
|
static deserialize(t) {
|
|
1369
1373
|
if (t)
|
|
1370
|
-
return new
|
|
1374
|
+
return new kt({
|
|
1371
1375
|
total: O(t.total),
|
|
1372
1376
|
available: O(t.available)
|
|
1373
1377
|
});
|
|
@@ -1380,7 +1384,7 @@ class Mt {
|
|
|
1380
1384
|
return this.total !== void 0 && (t.total = this.total), this.available !== void 0 && (t.available = this.available), t;
|
|
1381
1385
|
}
|
|
1382
1386
|
}
|
|
1383
|
-
class
|
|
1387
|
+
class Wt {
|
|
1384
1388
|
/** Creates a [Availability]. */
|
|
1385
1389
|
constructor(t) {
|
|
1386
1390
|
this.state = t.state, this.since = t.since, this.until = t.until;
|
|
@@ -1390,10 +1394,10 @@ class kt {
|
|
|
1390
1394
|
*/
|
|
1391
1395
|
static deserialize(t) {
|
|
1392
1396
|
if (t && t.state)
|
|
1393
|
-
return new
|
|
1397
|
+
return new Wt({
|
|
1394
1398
|
state: t.state,
|
|
1395
|
-
since:
|
|
1396
|
-
until:
|
|
1399
|
+
since: Jt(t.since),
|
|
1400
|
+
until: Jt(t.until)
|
|
1397
1401
|
});
|
|
1398
1402
|
}
|
|
1399
1403
|
/**
|
|
@@ -1408,7 +1412,7 @@ R.prototype.getNumberOfItems = function() {
|
|
|
1408
1412
|
return O(this.otherProperties.numberOfItems);
|
|
1409
1413
|
};
|
|
1410
1414
|
R.prototype.getPrice = function() {
|
|
1411
|
-
return
|
|
1415
|
+
return zt.deserialize(this.otherProperties.price);
|
|
1412
1416
|
};
|
|
1413
1417
|
R.prototype.getIndirectAcquisitions = function() {
|
|
1414
1418
|
const r = this.otherProperties.indirectAcquisition;
|
|
@@ -1416,45 +1420,45 @@ R.prototype.getIndirectAcquisitions = function() {
|
|
|
1416
1420
|
return r.map((t) => J.deserialize(t)).filter((t) => t !== void 0);
|
|
1417
1421
|
};
|
|
1418
1422
|
R.prototype.getHolds = function() {
|
|
1419
|
-
return
|
|
1423
|
+
return Mt.deserialize(this.otherProperties.holds);
|
|
1420
1424
|
};
|
|
1421
1425
|
R.prototype.getCopies = function() {
|
|
1422
|
-
return
|
|
1426
|
+
return kt.deserialize(this.otherProperties.copies);
|
|
1423
1427
|
};
|
|
1424
1428
|
R.prototype.getAvailability = function() {
|
|
1425
|
-
return
|
|
1429
|
+
return Wt.deserialize(this.otherProperties.availability);
|
|
1426
1430
|
};
|
|
1427
1431
|
R.prototype.getAuthenticate = function() {
|
|
1428
1432
|
return Y.deserialize(this.otherProperties.authenticate);
|
|
1429
1433
|
};
|
|
1430
|
-
const
|
|
1431
|
-
function
|
|
1432
|
-
console.warn(`${
|
|
1434
|
+
const He = "CssSelectorGenerator";
|
|
1435
|
+
function jt(r = "unknown problem", ...t) {
|
|
1436
|
+
console.warn(`${He}: ${r}`, ...t);
|
|
1433
1437
|
}
|
|
1434
|
-
function
|
|
1438
|
+
function _e(r) {
|
|
1435
1439
|
return r instanceof RegExp;
|
|
1436
1440
|
}
|
|
1437
|
-
function
|
|
1441
|
+
function Ve(r) {
|
|
1438
1442
|
return r.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".+");
|
|
1439
1443
|
}
|
|
1440
|
-
function
|
|
1444
|
+
function Ge(r) {
|
|
1441
1445
|
const t = r.map((e) => {
|
|
1442
|
-
if (
|
|
1446
|
+
if (_e(e))
|
|
1443
1447
|
return (i) => e.test(i);
|
|
1444
1448
|
if (typeof e == "function")
|
|
1445
1449
|
return (i) => {
|
|
1446
1450
|
const s = e(i);
|
|
1447
|
-
return typeof s != "boolean" ? (
|
|
1451
|
+
return typeof s != "boolean" ? (jt("pattern matcher function invalid", "Provided pattern matching function does not return boolean. It's result will be ignored.", e), !1) : s;
|
|
1448
1452
|
};
|
|
1449
1453
|
if (typeof e == "string") {
|
|
1450
|
-
const i = new RegExp("^" +
|
|
1454
|
+
const i = new RegExp("^" + Ve(e) + "$");
|
|
1451
1455
|
return (s) => i.test(s);
|
|
1452
1456
|
}
|
|
1453
|
-
return
|
|
1457
|
+
return jt("pattern matcher invalid", "Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.", e), () => !1;
|
|
1454
1458
|
});
|
|
1455
1459
|
return (e) => t.some((i) => i(e));
|
|
1456
1460
|
}
|
|
1457
|
-
|
|
1461
|
+
Ge([
|
|
1458
1462
|
"class",
|
|
1459
1463
|
"id",
|
|
1460
1464
|
// Angular attributes
|
|
@@ -1462,15 +1466,15 @@ Ve([
|
|
|
1462
1466
|
]);
|
|
1463
1467
|
class X {
|
|
1464
1468
|
}
|
|
1465
|
-
function
|
|
1469
|
+
function te(r) {
|
|
1466
1470
|
return r.split("").reverse().join("");
|
|
1467
1471
|
}
|
|
1468
|
-
function
|
|
1469
|
-
const i =
|
|
1472
|
+
function Fe(r, t, e) {
|
|
1473
|
+
const i = te(t);
|
|
1470
1474
|
return e.map((s) => {
|
|
1471
|
-
const n = Math.max(0, s.end - t.length - s.errors), o =
|
|
1475
|
+
const n = Math.max(0, s.end - t.length - s.errors), o = te(r.slice(n, s.end));
|
|
1472
1476
|
return {
|
|
1473
|
-
start:
|
|
1477
|
+
start: we(o, i, s.errors).reduce((d, h) => s.end - h.end < d ? s.end - h.end : d, s.end),
|
|
1474
1478
|
end: s.end,
|
|
1475
1479
|
errors: s.errors
|
|
1476
1480
|
};
|
|
@@ -1479,14 +1483,14 @@ function Ge(r, t, e) {
|
|
|
1479
1483
|
function ft(r) {
|
|
1480
1484
|
return (r | -r) >> 31 & 1;
|
|
1481
1485
|
}
|
|
1482
|
-
function
|
|
1486
|
+
function ee(r, t, e, i) {
|
|
1483
1487
|
let s = r.P[e], n = r.M[e];
|
|
1484
1488
|
const o = i >>> 31, a = t[e] | o, d = a | n, h = (a & s) + s ^ s | a;
|
|
1485
1489
|
let u = n | ~(h | s), g = s & h;
|
|
1486
1490
|
const m = ft(u & r.lastRowMask[e]) - ft(g & r.lastRowMask[e]);
|
|
1487
1491
|
return u <<= 1, g <<= 1, g |= o, u |= ft(i) - o, s = g | ~(d | u), n = u & d, r.P[e] = s, r.M[e] = n, m;
|
|
1488
1492
|
}
|
|
1489
|
-
function
|
|
1493
|
+
function we(r, t, e) {
|
|
1490
1494
|
if (t.length === 0)
|
|
1491
1495
|
return [];
|
|
1492
1496
|
e = Math.min(e, t.length);
|
|
@@ -1500,18 +1504,18 @@ function be(r, t, e) {
|
|
|
1500
1504
|
for (let m = 0; m < 256; m++)
|
|
1501
1505
|
h.push(a);
|
|
1502
1506
|
for (let m = 0; m < t.length; m += 1) {
|
|
1503
|
-
const
|
|
1504
|
-
if (d.has(
|
|
1507
|
+
const w = t.charCodeAt(m);
|
|
1508
|
+
if (d.has(w))
|
|
1505
1509
|
continue;
|
|
1506
1510
|
const f = new Uint32Array(n + 1);
|
|
1507
|
-
d.set(
|
|
1511
|
+
d.set(w, f), w < h.length && (h[w] = f);
|
|
1508
1512
|
for (let p = 0; p <= n; p += 1) {
|
|
1509
1513
|
f[p] = 0;
|
|
1510
1514
|
for (let b = 0; b < s; b += 1) {
|
|
1511
1515
|
const x = p * s + b;
|
|
1512
1516
|
if (x >= t.length)
|
|
1513
1517
|
continue;
|
|
1514
|
-
t.charCodeAt(x) ===
|
|
1518
|
+
t.charCodeAt(x) === w && (f[p] |= 1 << b);
|
|
1515
1519
|
}
|
|
1516
1520
|
}
|
|
1517
1521
|
}
|
|
@@ -1523,12 +1527,12 @@ function be(r, t, e) {
|
|
|
1523
1527
|
for (let m = 0; m <= u; m += 1)
|
|
1524
1528
|
o.P[m] = -1, o.M[m] = 0;
|
|
1525
1529
|
for (let m = 0; m < r.length; m += 1) {
|
|
1526
|
-
const
|
|
1530
|
+
const w = r.charCodeAt(m);
|
|
1527
1531
|
let f;
|
|
1528
|
-
|
|
1532
|
+
w < h.length ? f = h[w] : (f = d.get(w), typeof f > "u" && (f = a));
|
|
1529
1533
|
let p = 0;
|
|
1530
1534
|
for (let b = 0; b <= u; b += 1)
|
|
1531
|
-
p =
|
|
1535
|
+
p = ee(o, f, b, p), g[b] += p;
|
|
1532
1536
|
if (g[u] - p <= e && u < n && (f[u + 1] & 1 || p < 0)) {
|
|
1533
1537
|
u += 1, o.P[u] = -1, o.M[u] = 0;
|
|
1534
1538
|
let b;
|
|
@@ -1537,7 +1541,7 @@ function be(r, t, e) {
|
|
|
1537
1541
|
b = x === 0 ? s : x;
|
|
1538
1542
|
} else
|
|
1539
1543
|
b = s;
|
|
1540
|
-
g[u] = g[u - 1] + b - p +
|
|
1544
|
+
g[u] = g[u - 1] + b - p + ee(o, f, u, p);
|
|
1541
1545
|
} else
|
|
1542
1546
|
for (; u > 0 && g[u] >= e + s; )
|
|
1543
1547
|
u -= 1;
|
|
@@ -1549,9 +1553,9 @@ function be(r, t, e) {
|
|
|
1549
1553
|
}
|
|
1550
1554
|
return i;
|
|
1551
1555
|
}
|
|
1552
|
-
function
|
|
1553
|
-
const i =
|
|
1554
|
-
return
|
|
1556
|
+
function $e(r, t, e) {
|
|
1557
|
+
const i = we(r, t, e);
|
|
1558
|
+
return Fe(r, t, i);
|
|
1555
1559
|
}
|
|
1556
1560
|
function ve(r, t, e) {
|
|
1557
1561
|
let i = 0;
|
|
@@ -1562,30 +1566,30 @@ function ve(r, t, e) {
|
|
|
1562
1566
|
end: i + t.length,
|
|
1563
1567
|
errors: 0
|
|
1564
1568
|
}), i += 1);
|
|
1565
|
-
return s.length > 0 ? s :
|
|
1569
|
+
return s.length > 0 ? s : $e(r, t, e);
|
|
1566
1570
|
}
|
|
1567
|
-
function
|
|
1571
|
+
function ie(r, t) {
|
|
1568
1572
|
return t.length === 0 || r.length === 0 ? 0 : 1 - ve(r, t, t.length)[0].errors / t.length;
|
|
1569
1573
|
}
|
|
1570
|
-
function
|
|
1574
|
+
function Ye(r, t, e = {}) {
|
|
1571
1575
|
if (t.length === 0)
|
|
1572
1576
|
return null;
|
|
1573
1577
|
const i = Math.min(256, t.length / 2), s = ve(r, t, i);
|
|
1574
1578
|
if (s.length === 0)
|
|
1575
1579
|
return null;
|
|
1576
1580
|
const n = (a) => {
|
|
1577
|
-
const m = 1 - a.errors / t.length,
|
|
1581
|
+
const m = 1 - a.errors / t.length, w = e.prefix ? ie(
|
|
1578
1582
|
r.slice(
|
|
1579
1583
|
Math.max(0, a.start - e.prefix.length),
|
|
1580
1584
|
a.start
|
|
1581
1585
|
),
|
|
1582
1586
|
e.prefix
|
|
1583
|
-
) : 1, f = e.suffix ?
|
|
1587
|
+
) : 1, f = e.suffix ? ie(
|
|
1584
1588
|
r.slice(a.end, a.end + e.suffix.length),
|
|
1585
1589
|
e.suffix
|
|
1586
1590
|
) : 1;
|
|
1587
1591
|
let p = 1;
|
|
1588
|
-
return typeof e.hint == "number" && (p = 1 - Math.abs(a.start - e.hint) / r.length), (50 * m + 20 *
|
|
1592
|
+
return typeof e.hint == "number" && (p = 1 - Math.abs(a.start - e.hint) / r.length), (50 * m + 20 * w + 20 * f + 2 * p) / 92;
|
|
1589
1593
|
}, o = s.map((a) => ({
|
|
1590
1594
|
start: a.start,
|
|
1591
1595
|
end: a.end,
|
|
@@ -1603,7 +1607,7 @@ function vt(r, t, e) {
|
|
|
1603
1607
|
const o = s.length - n.length;
|
|
1604
1608
|
return e === 2 ? t - o : t + o;
|
|
1605
1609
|
}
|
|
1606
|
-
function
|
|
1610
|
+
function se(r, t) {
|
|
1607
1611
|
const e = r.commonAncestorContainer.ownerDocument.createNodeIterator(
|
|
1608
1612
|
r.commonAncestorContainer,
|
|
1609
1613
|
NodeFilter.SHOW_TEXT
|
|
@@ -1625,7 +1629,7 @@ function ie(r, t) {
|
|
|
1625
1629
|
return { node: n, offset: o };
|
|
1626
1630
|
throw new RangeError("No text nodes with non-whitespace text found in range");
|
|
1627
1631
|
}
|
|
1628
|
-
function
|
|
1632
|
+
function Xe(r) {
|
|
1629
1633
|
if (!r.toString().trim().length)
|
|
1630
1634
|
throw new RangeError("Range contains no non-whitespace text");
|
|
1631
1635
|
if (r.startContainer.nodeType !== Node.TEXT_NODE)
|
|
@@ -1651,7 +1655,7 @@ function Ye(r) {
|
|
|
1651
1655
|
if (s.start >= 0 && (t.setStart(r.startContainer, s.start), e = !0), s.end > 0 && (t.setEnd(r.endContainer, s.end), i = !0), e && i)
|
|
1652
1656
|
return t;
|
|
1653
1657
|
if (!e) {
|
|
1654
|
-
const { node: n, offset: o } =
|
|
1658
|
+
const { node: n, offset: o } = se(
|
|
1655
1659
|
t,
|
|
1656
1660
|
1
|
|
1657
1661
|
/* Forwards */
|
|
@@ -1659,7 +1663,7 @@ function Ye(r) {
|
|
|
1659
1663
|
n && o >= 0 && t.setStart(n, o);
|
|
1660
1664
|
}
|
|
1661
1665
|
if (!i) {
|
|
1662
|
-
const { node: n, offset: o } =
|
|
1666
|
+
const { node: n, offset: o } = se(
|
|
1663
1667
|
t,
|
|
1664
1668
|
2
|
|
1665
1669
|
/* Backwards */
|
|
@@ -1668,7 +1672,7 @@ function Ye(r) {
|
|
|
1668
1672
|
}
|
|
1669
1673
|
return t;
|
|
1670
1674
|
}
|
|
1671
|
-
function
|
|
1675
|
+
function Se(r) {
|
|
1672
1676
|
switch (r.nodeType) {
|
|
1673
1677
|
case Node.ELEMENT_NODE:
|
|
1674
1678
|
case Node.TEXT_NODE:
|
|
@@ -1677,13 +1681,13 @@ function we(r) {
|
|
|
1677
1681
|
return 0;
|
|
1678
1682
|
}
|
|
1679
1683
|
}
|
|
1680
|
-
function
|
|
1684
|
+
function ne(r) {
|
|
1681
1685
|
let t = r.previousSibling, e = 0;
|
|
1682
1686
|
for (; t; )
|
|
1683
|
-
e +=
|
|
1687
|
+
e += Se(t), t = t.previousSibling;
|
|
1684
1688
|
return e;
|
|
1685
1689
|
}
|
|
1686
|
-
function
|
|
1690
|
+
function Ee(r, ...t) {
|
|
1687
1691
|
let e = t.shift();
|
|
1688
1692
|
const i = r.ownerDocument.createNodeIterator(
|
|
1689
1693
|
r,
|
|
@@ -1715,7 +1719,7 @@ class z {
|
|
|
1715
1719
|
throw new Error("Parent is not an ancestor of current element");
|
|
1716
1720
|
let e = this.element, i = this.offset;
|
|
1717
1721
|
for (; e !== t; )
|
|
1718
|
-
i +=
|
|
1722
|
+
i += ne(e), e = e.parentElement;
|
|
1719
1723
|
return new z(e, i);
|
|
1720
1724
|
}
|
|
1721
1725
|
/**
|
|
@@ -1737,7 +1741,7 @@ class z {
|
|
|
1737
1741
|
*/
|
|
1738
1742
|
resolve(t = {}) {
|
|
1739
1743
|
try {
|
|
1740
|
-
return
|
|
1744
|
+
return Ee(this.element, this.offset)[0];
|
|
1741
1745
|
} catch (e) {
|
|
1742
1746
|
if (this.offset === 0 && t.direction !== void 0) {
|
|
1743
1747
|
const i = document.createTreeWalker(
|
|
@@ -1780,7 +1784,7 @@ class z {
|
|
|
1780
1784
|
throw new Error("Text node offset is out of range");
|
|
1781
1785
|
if (!t.parentElement)
|
|
1782
1786
|
throw new Error("Text node has no parent");
|
|
1783
|
-
const i =
|
|
1787
|
+
const i = ne(t) + e;
|
|
1784
1788
|
return new z(t.parentElement, i);
|
|
1785
1789
|
}
|
|
1786
1790
|
case Node.ELEMENT_NODE: {
|
|
@@ -1788,7 +1792,7 @@ class z {
|
|
|
1788
1792
|
throw new Error("Child node offset is out of range");
|
|
1789
1793
|
let i = 0;
|
|
1790
1794
|
for (let s = 0; s < e; s++)
|
|
1791
|
-
i +=
|
|
1795
|
+
i += Se(t.childNodes[s]);
|
|
1792
1796
|
return new z(t, i);
|
|
1793
1797
|
}
|
|
1794
1798
|
default:
|
|
@@ -1822,7 +1826,7 @@ class U {
|
|
|
1822
1826
|
*/
|
|
1823
1827
|
toRange() {
|
|
1824
1828
|
let t, e;
|
|
1825
|
-
this.start.element === this.end.element && this.start.offset <= this.end.offset ? [t, e] =
|
|
1829
|
+
this.start.element === this.end.element && this.start.offset <= this.end.offset ? [t, e] = Ee(
|
|
1826
1830
|
this.start.element,
|
|
1827
1831
|
this.start.offset,
|
|
1828
1832
|
this.end.offset
|
|
@@ -1861,7 +1865,7 @@ class U {
|
|
|
1861
1865
|
* whitespace
|
|
1862
1866
|
*/
|
|
1863
1867
|
static trimmedRange(t) {
|
|
1864
|
-
return
|
|
1868
|
+
return Xe(U.fromRange(t).toRange());
|
|
1865
1869
|
}
|
|
1866
1870
|
}
|
|
1867
1871
|
class ht {
|
|
@@ -1925,7 +1929,7 @@ class dt {
|
|
|
1925
1929
|
return this.toPositionAnchor(t).toRange();
|
|
1926
1930
|
}
|
|
1927
1931
|
toPositionAnchor(t = {}) {
|
|
1928
|
-
const e = this.root.textContent, i =
|
|
1932
|
+
const e = this.root.textContent, i = Ye(e, this.exact, {
|
|
1929
1933
|
...this.context,
|
|
1930
1934
|
hint: t.hint
|
|
1931
1935
|
});
|
|
@@ -1934,7 +1938,7 @@ class dt {
|
|
|
1934
1938
|
return new ht(this.root, i.start, i.end);
|
|
1935
1939
|
}
|
|
1936
1940
|
}
|
|
1937
|
-
function
|
|
1941
|
+
function qe(r) {
|
|
1938
1942
|
const t = r.tagName.toUpperCase();
|
|
1939
1943
|
return t === "IMG" || t === "VIDEO" || t === "AUDIO" || t === "IFRAME" || t === "OBJECT" || t === "EMBED" || t === "CANVAS";
|
|
1940
1944
|
}
|
|
@@ -1963,7 +1967,7 @@ function pt(r, t) {
|
|
|
1963
1967
|
}
|
|
1964
1968
|
if (s) {
|
|
1965
1969
|
const n = r.createRange();
|
|
1966
|
-
return s.childNodes.length === 0 ||
|
|
1970
|
+
return s.childNodes.length === 0 || qe(s) ? (n.selectNode(s), n) : (n.setStartBefore(s), n.setEndAfter(s), n);
|
|
1967
1971
|
}
|
|
1968
1972
|
}
|
|
1969
1973
|
} catch (e) {
|
|
@@ -1971,7 +1975,7 @@ function pt(r, t) {
|
|
|
1971
1975
|
}
|
|
1972
1976
|
return null;
|
|
1973
1977
|
}
|
|
1974
|
-
function
|
|
1978
|
+
function Ke(r, t) {
|
|
1975
1979
|
let e = r.getClientRects();
|
|
1976
1980
|
e.length || r.commonAncestorContainer.nodeType === Node.ELEMENT_NODE && (e = r.commonAncestorContainer.getClientRects());
|
|
1977
1981
|
const i = 1, s = [];
|
|
@@ -1984,10 +1988,10 @@ function qe(r, t) {
|
|
|
1984
1988
|
top: h.top,
|
|
1985
1989
|
width: h.width
|
|
1986
1990
|
});
|
|
1987
|
-
const n =
|
|
1991
|
+
const n = Ae(
|
|
1988
1992
|
s,
|
|
1989
1993
|
i
|
|
1990
|
-
), o =
|
|
1994
|
+
), o = Je(n, i), a = Ce(o), d = 4;
|
|
1991
1995
|
for (let h = a.length - 1; h >= 0; h--) {
|
|
1992
1996
|
const u = a[h];
|
|
1993
1997
|
if (!(u.width * u.height > d))
|
|
@@ -1998,16 +2002,16 @@ function qe(r, t) {
|
|
|
1998
2002
|
}
|
|
1999
2003
|
return a;
|
|
2000
2004
|
}
|
|
2001
|
-
function
|
|
2005
|
+
function Ae(r, t, e) {
|
|
2002
2006
|
for (let i = 0; i < r.length; i++)
|
|
2003
2007
|
for (let s = i + 1; s < r.length; s++) {
|
|
2004
2008
|
const n = r[i], o = r[s];
|
|
2005
2009
|
if (n === o)
|
|
2006
2010
|
continue;
|
|
2007
2011
|
const a = I(n.top, o.top, t) && I(n.bottom, o.bottom, t), d = I(n.left, o.left, t) && I(n.right, o.right, t);
|
|
2008
|
-
if (a && !d &&
|
|
2009
|
-
const g = r.filter((
|
|
2010
|
-
return g.push(m),
|
|
2012
|
+
if (a && !d && xe(n, o, t)) {
|
|
2013
|
+
const g = r.filter((w) => w !== n && w !== o), m = Ze(n, o);
|
|
2014
|
+
return g.push(m), Ae(
|
|
2011
2015
|
g,
|
|
2012
2016
|
t
|
|
2013
2017
|
);
|
|
@@ -2015,7 +2019,7 @@ function Ee(r, t, e) {
|
|
|
2015
2019
|
}
|
|
2016
2020
|
return r;
|
|
2017
2021
|
}
|
|
2018
|
-
function
|
|
2022
|
+
function Ze(r, t) {
|
|
2019
2023
|
const e = Math.min(r.left, t.left), i = Math.max(r.right, t.right), s = Math.min(r.top, t.top), n = Math.max(r.bottom, t.bottom);
|
|
2020
2024
|
return {
|
|
2021
2025
|
bottom: n,
|
|
@@ -2026,7 +2030,7 @@ function Ke(r, t) {
|
|
|
2026
2030
|
width: i - e
|
|
2027
2031
|
};
|
|
2028
2032
|
}
|
|
2029
|
-
function
|
|
2033
|
+
function Je(r, t) {
|
|
2030
2034
|
const e = new Set(r);
|
|
2031
2035
|
for (const i of r) {
|
|
2032
2036
|
if (!(i.width > 1 && i.height > 1)) {
|
|
@@ -2034,40 +2038,40 @@ function Ze(r, t) {
|
|
|
2034
2038
|
continue;
|
|
2035
2039
|
}
|
|
2036
2040
|
for (const n of r)
|
|
2037
|
-
if (i !== n && e.has(n) &&
|
|
2041
|
+
if (i !== n && e.has(n) && Qe(n, i, t)) {
|
|
2038
2042
|
e.delete(i);
|
|
2039
2043
|
break;
|
|
2040
2044
|
}
|
|
2041
2045
|
}
|
|
2042
2046
|
return Array.from(e);
|
|
2043
2047
|
}
|
|
2044
|
-
function
|
|
2048
|
+
function Qe(r, t, e) {
|
|
2045
2049
|
return nt(r, t.left, t.top, e) && nt(r, t.right, t.top, e) && nt(r, t.left, t.bottom, e) && nt(r, t.right, t.bottom, e);
|
|
2046
2050
|
}
|
|
2047
2051
|
function nt(r, t, e, i) {
|
|
2048
2052
|
return (r.left < t || I(r.left, t, i)) && (r.right > t || I(r.right, t, i)) && (r.top < e || I(r.top, e, i)) && (r.bottom > e || I(r.bottom, e, i));
|
|
2049
2053
|
}
|
|
2050
|
-
function
|
|
2054
|
+
function Ce(r) {
|
|
2051
2055
|
for (let t = 0; t < r.length; t++)
|
|
2052
2056
|
for (let e = t + 1; e < r.length; e++) {
|
|
2053
2057
|
const i = r[t], s = r[e];
|
|
2054
|
-
if (i !== s &&
|
|
2058
|
+
if (i !== s && xe(i, s, -1)) {
|
|
2055
2059
|
let n = [], o;
|
|
2056
|
-
const a =
|
|
2060
|
+
const a = re(i, s);
|
|
2057
2061
|
if (a.length === 1)
|
|
2058
2062
|
n = a, o = i;
|
|
2059
2063
|
else {
|
|
2060
|
-
const h =
|
|
2064
|
+
const h = re(s, i);
|
|
2061
2065
|
a.length < h.length ? (n = a, o = i) : (n = h, o = s);
|
|
2062
2066
|
}
|
|
2063
2067
|
const d = r.filter((h) => h !== o);
|
|
2064
|
-
return Array.prototype.push.apply(d, n),
|
|
2068
|
+
return Array.prototype.push.apply(d, n), Ce(d);
|
|
2065
2069
|
}
|
|
2066
2070
|
}
|
|
2067
2071
|
return r;
|
|
2068
2072
|
}
|
|
2069
|
-
function
|
|
2070
|
-
const e =
|
|
2073
|
+
function re(r, t) {
|
|
2074
|
+
const e = je(t, r);
|
|
2071
2075
|
if (e.height === 0 || e.width === 0)
|
|
2072
2076
|
return [r];
|
|
2073
2077
|
const i = [];
|
|
@@ -2117,7 +2121,7 @@ function ne(r, t) {
|
|
|
2117
2121
|
}
|
|
2118
2122
|
return i;
|
|
2119
2123
|
}
|
|
2120
|
-
function
|
|
2124
|
+
function je(r, t) {
|
|
2121
2125
|
const e = Math.max(r.left, t.left), i = Math.min(r.right, t.right), s = Math.max(r.top, t.top), n = Math.min(r.bottom, t.bottom);
|
|
2122
2126
|
return {
|
|
2123
2127
|
bottom: n,
|
|
@@ -2128,27 +2132,28 @@ function Qe(r, t) {
|
|
|
2128
2132
|
width: Math.max(0, i - e)
|
|
2129
2133
|
};
|
|
2130
2134
|
}
|
|
2131
|
-
function
|
|
2135
|
+
function xe(r, t, e) {
|
|
2132
2136
|
return (r.left < t.right || e >= 0 && I(r.left, t.right, e)) && (t.left < r.right || e >= 0 && I(t.left, r.right, e)) && (r.top < t.bottom || e >= 0 && I(r.top, t.bottom, e)) && (t.top < r.bottom || e >= 0 && I(t.top, r.bottom, e));
|
|
2133
2137
|
}
|
|
2134
2138
|
function I(r, t, e) {
|
|
2135
2139
|
return Math.abs(r - t) <= e;
|
|
2136
2140
|
}
|
|
2137
|
-
|
|
2141
|
+
const gt = typeof window.CSSTransformValue < "u";
|
|
2142
|
+
function Ut(r) {
|
|
2138
2143
|
const t = {}, e = r.document.documentElement.style;
|
|
2139
2144
|
for (const i in r.document.documentElement.style)
|
|
2140
2145
|
Object.hasOwn(e, i) && !Number.isNaN(Number.parseInt(i)) && (t[e[i]] = e.getPropertyValue(e[i]));
|
|
2141
2146
|
return t;
|
|
2142
2147
|
}
|
|
2143
|
-
function
|
|
2144
|
-
const e =
|
|
2148
|
+
function Te(r, t) {
|
|
2149
|
+
const e = Ut(r);
|
|
2145
2150
|
Object.keys(e).forEach((i) => {
|
|
2146
2151
|
t.hasOwnProperty(i) || mt(r, i);
|
|
2147
2152
|
}), Object.entries(t).forEach(([i, s]) => {
|
|
2148
2153
|
e[i] !== s && it(r, i, s);
|
|
2149
2154
|
});
|
|
2150
2155
|
}
|
|
2151
|
-
function
|
|
2156
|
+
function yt(r, t) {
|
|
2152
2157
|
return r.document.documentElement.style.getPropertyValue(t);
|
|
2153
2158
|
}
|
|
2154
2159
|
function it(r, t, e) {
|
|
@@ -2157,23 +2162,23 @@ function it(r, t, e) {
|
|
|
2157
2162
|
function mt(r, t) {
|
|
2158
2163
|
r.document.documentElement.style.removeProperty(t);
|
|
2159
2164
|
}
|
|
2160
|
-
let rt = null,
|
|
2161
|
-
const G = { r: 255, g: 255, b: 255, a: 1 }, V = /* @__PURE__ */ new Map(),
|
|
2165
|
+
let rt = null, bt = null, Z = 0;
|
|
2166
|
+
const G = { r: 255, g: 255, b: 255, a: 1 }, V = /* @__PURE__ */ new Map(), ti = () => {
|
|
2162
2167
|
if (!rt)
|
|
2163
2168
|
if (typeof OffscreenCanvas < "u")
|
|
2164
|
-
rt = new OffscreenCanvas(5, 5),
|
|
2169
|
+
rt = new OffscreenCanvas(5, 5), bt = rt.getContext("2d", {
|
|
2165
2170
|
willReadFrequently: !0,
|
|
2166
2171
|
desynchronized: !0
|
|
2167
2172
|
});
|
|
2168
2173
|
else {
|
|
2169
2174
|
const r = document.createElement("canvas");
|
|
2170
|
-
r.width = 5, r.height = 5, rt = r,
|
|
2175
|
+
r.width = 5, r.height = 5, rt = r, bt = r.getContext("2d", {
|
|
2171
2176
|
willReadFrequently: !0,
|
|
2172
2177
|
desynchronized: !0
|
|
2173
2178
|
});
|
|
2174
2179
|
}
|
|
2175
|
-
return
|
|
2176
|
-
},
|
|
2180
|
+
return bt;
|
|
2181
|
+
}, ei = (r) => {
|
|
2177
2182
|
if (!r) return !0;
|
|
2178
2183
|
const t = r.trim().toLowerCase();
|
|
2179
2184
|
return t.startsWith("var(") || [
|
|
@@ -2196,13 +2201,13 @@ const G = { r: 255, g: 255, b: 255, a: 1 }, V = /* @__PURE__ */ new Map(), je =
|
|
|
2196
2201
|
console.warn(
|
|
2197
2202
|
`[Decorator] Could not parse color: "${r}". ${t} Falling back to ${JSON.stringify(G)} to compute contrast. Please use a CSS color value that can be computed to RGB(A).`
|
|
2198
2203
|
);
|
|
2199
|
-
},
|
|
2204
|
+
}, St = (r, t = null) => {
|
|
2200
2205
|
const e = t ? `${r}|${t}` : r, i = V.get(e);
|
|
2201
2206
|
if (i !== void 0)
|
|
2202
2207
|
return i ?? G;
|
|
2203
|
-
if (
|
|
2208
|
+
if (ei(r))
|
|
2204
2209
|
return ot(r, "Unsupported color format or special value."), V.set(e, null), G;
|
|
2205
|
-
const s =
|
|
2210
|
+
const s = ti();
|
|
2206
2211
|
if (!s)
|
|
2207
2212
|
return ot(r, "Could not get canvas context."), V.set(e, null), G;
|
|
2208
2213
|
try {
|
|
@@ -2219,29 +2224,29 @@ const G = { r: 255, g: 255, b: 255, a: 1 }, V = /* @__PURE__ */ new Map(), je =
|
|
|
2219
2224
|
} catch (n) {
|
|
2220
2225
|
return ot(r, `Error: ${n instanceof Error ? n.message : String(n)}`), V.set(e, null), G;
|
|
2221
2226
|
}
|
|
2222
|
-
},
|
|
2227
|
+
}, wt = (r) => {
|
|
2223
2228
|
const t = r / 255;
|
|
2224
2229
|
return t <= 0.03928 ? t / 12.92 : Math.pow((t + 0.055) / 1.055, 2.4);
|
|
2225
|
-
},
|
|
2226
|
-
const t =
|
|
2230
|
+
}, oe = (r) => {
|
|
2231
|
+
const t = wt(r.r), e = wt(r.g), i = wt(r.b);
|
|
2227
2232
|
return 0.2126 * t + 0.7152 * e + 0.0722 * i;
|
|
2228
|
-
},
|
|
2229
|
-
const e = typeof r == "string" ?
|
|
2233
|
+
}, ae = (r, t) => {
|
|
2234
|
+
const e = typeof r == "string" ? St(r) : r, i = typeof t == "string" ? St(t) : t, s = oe(e), n = oe(i), o = Math.max(s, n), a = Math.min(s, n);
|
|
2230
2235
|
return (o + 0.05) / (a + 0.05);
|
|
2231
|
-
},
|
|
2232
|
-
const e =
|
|
2236
|
+
}, Et = (r, t = null) => {
|
|
2237
|
+
const e = St(r, t), i = ae(e, { r: 255, g: 255, b: 255, a: 1 }), s = ae(e, { r: 0, g: 0, b: 0, a: 1 });
|
|
2233
2238
|
return i > s;
|
|
2234
|
-
},
|
|
2235
|
-
var
|
|
2236
|
-
const
|
|
2237
|
-
class
|
|
2239
|
+
}, ii = (r, t = null) => Et(r, t) ? "white" : "black", le = "#FFFF00";
|
|
2240
|
+
var si = /* @__PURE__ */ ((r) => (r.Wrap = "wrap", r.Viewport = "viewport", r.Bounds = "bounds", r.Page = "page", r))(si || {}), ni = /* @__PURE__ */ ((r) => (r.Boxes = "boxes", r.Bounds = "bounds", r))(ni || {});
|
|
2241
|
+
const ri = () => "Highlight" in window, ce = ["IMG", "IMAGE", "AUDIO", "VIDEO", "SVG"];
|
|
2242
|
+
class oi {
|
|
2238
2243
|
/**
|
|
2239
2244
|
* Creates a DecorationGroup object
|
|
2240
2245
|
* @param id Unique HTML ID-adhering name of the group
|
|
2241
2246
|
* @param name Human-readable name of the group
|
|
2242
2247
|
*/
|
|
2243
2248
|
constructor(t, e, i, s) {
|
|
2244
|
-
this.wnd = t, this.comms = e, this.id = i, this.name = s, this.items = [], this.lastItemId = 0, this.container = void 0, this.activateable = !1, this.experimentalHighlights = !1, this.currentRender = 0,
|
|
2249
|
+
this.wnd = t, this.comms = e, this.id = i, this.name = s, this.items = [], this.lastItemId = 0, this.container = void 0, this.activateable = !1, this.experimentalHighlights = !1, this.currentRender = 0, ri() && (this.experimentalHighlights = !0, this.notTextFlag = /* @__PURE__ */ new Map());
|
|
2245
2250
|
}
|
|
2246
2251
|
get activeable() {
|
|
2247
2252
|
return this.activateable;
|
|
@@ -2260,7 +2265,7 @@ class ri {
|
|
|
2260
2265
|
return;
|
|
2261
2266
|
}
|
|
2262
2267
|
const s = i.commonAncestorContainer;
|
|
2263
|
-
s.nodeType !== Node.TEXT_NODE && this.experimentalHighlights && (
|
|
2268
|
+
s.nodeType !== Node.TEXT_NODE && this.experimentalHighlights && (ce.includes(s.nodeName.toUpperCase()) && this.notTextFlag?.set(e, !0), i.cloneContents().querySelector(ce.join(", ").toLowerCase()) && this.notTextFlag?.set(e, !0), (s.textContent?.trim() || "").length === 0 && this.notTextFlag?.set(e, !0));
|
|
2264
2269
|
const n = {
|
|
2265
2270
|
decoration: t,
|
|
2266
2271
|
id: e,
|
|
@@ -2301,10 +2306,10 @@ class ri {
|
|
|
2301
2306
|
experimentalLayout(t) {
|
|
2302
2307
|
const [e, i] = this.requireContainer(!0);
|
|
2303
2308
|
i.add(t.range);
|
|
2304
|
-
const s =
|
|
2309
|
+
const s = yt(this.wnd, "--USER__backgroundColor") || this.wnd.getComputedStyle(this.wnd.document.documentElement).getPropertyValue("background-color"), n = t.decoration?.style?.tint ?? le;
|
|
2305
2310
|
e.innerHTML = `
|
|
2306
2311
|
::highlight(${this.id}) {
|
|
2307
|
-
color: ${
|
|
2312
|
+
color: ${ii(n, s)};
|
|
2308
2313
|
background-color: ${n};
|
|
2309
2314
|
}`;
|
|
2310
2315
|
}
|
|
@@ -2342,7 +2347,7 @@ class ri {
|
|
|
2342
2347
|
data-readium="true"
|
|
2343
2348
|
class="readium-highlight"
|
|
2344
2349
|
style="${[
|
|
2345
|
-
`background-color: ${t.decoration?.style?.tint ??
|
|
2350
|
+
`background-color: ${t.decoration?.style?.tint ?? le} !important`,
|
|
2346
2351
|
//"opacity: 0.3 !important",
|
|
2347
2352
|
`mix-blend-mode: ${m ? "exclusion" : "multiply"} !important`,
|
|
2348
2353
|
"opacity: 1 !important",
|
|
@@ -2351,17 +2356,17 @@ class ri {
|
|
|
2351
2356
|
>
|
|
2352
2357
|
</div>
|
|
2353
2358
|
`.trim();
|
|
2354
|
-
const
|
|
2359
|
+
const w = g.content.firstElementChild;
|
|
2355
2360
|
if (t.decoration?.style?.layout === "bounds") {
|
|
2356
|
-
const f =
|
|
2361
|
+
const f = w.cloneNode(!0);
|
|
2357
2362
|
f.style.setProperty("pointer-events", "none"), h(f, u, u), e.append(f);
|
|
2358
2363
|
} else {
|
|
2359
|
-
let f =
|
|
2364
|
+
let f = Ke(
|
|
2360
2365
|
t.range
|
|
2361
2366
|
);
|
|
2362
2367
|
f = f.sort((p, b) => p.top < b.top ? -1 : p.top > b.top ? 1 : 0);
|
|
2363
2368
|
for (let p of f) {
|
|
2364
|
-
const b =
|
|
2369
|
+
const b = w.cloneNode(!0);
|
|
2365
2370
|
b.style.setProperty("pointer-events", "none"), h(b, p, u), e.append(b);
|
|
2366
2371
|
}
|
|
2367
2372
|
}
|
|
@@ -2389,7 +2394,7 @@ class ri {
|
|
|
2389
2394
|
return this.container || (this.container = this.wnd.document.createElement("div"), this.container.setAttribute("id", this.id), this.container.dataset.group = this.name, this.container.dataset.readium = "true", this.container.style.setProperty("pointer-events", "none"), this.container.style.display = "contents", this.wnd.document.body.append(this.container)), this.container;
|
|
2390
2395
|
}
|
|
2391
2396
|
getCurrentDarkMode() {
|
|
2392
|
-
return
|
|
2397
|
+
return yt(this.wnd, "--USER__appearance") === "readium-night-on" || Et(yt(this.wnd, "--USER__backgroundColor")) || Et(this.wnd.getComputedStyle(this.wnd.document.documentElement).getPropertyValue("background-color"));
|
|
2393
2398
|
}
|
|
2394
2399
|
/**
|
|
2395
2400
|
* Removes the group container.
|
|
@@ -2425,7 +2430,7 @@ const Q = class Q extends X {
|
|
|
2425
2430
|
mount(t, e) {
|
|
2426
2431
|
return this.wnd = t, e.register("decorate", Q.moduleName, (i, s) => {
|
|
2427
2432
|
const n = i;
|
|
2428
|
-
n.decoration && n.decoration.locator && (n.decoration.locator = W.deserialize(n.decoration.locator)), this.groups.has(n.group) || this.groups.set(n.group, new
|
|
2433
|
+
n.decoration && n.decoration.locator && (n.decoration.locator = W.deserialize(n.decoration.locator)), this.groups.has(n.group) || this.groups.set(n.group, new oi(
|
|
2429
2434
|
t,
|
|
2430
2435
|
e,
|
|
2431
2436
|
`readium-decoration-${this.lastGroupId++}`,
|
|
@@ -2467,8 +2472,8 @@ const Q = class Q extends X {
|
|
|
2467
2472
|
}
|
|
2468
2473
|
};
|
|
2469
2474
|
Q.moduleName = "decorator";
|
|
2470
|
-
let
|
|
2471
|
-
const
|
|
2475
|
+
let At = Q;
|
|
2476
|
+
const he = "readium-snapper-style", j = class j extends X {
|
|
2472
2477
|
constructor() {
|
|
2473
2478
|
super(...arguments), this.protected = !1;
|
|
2474
2479
|
}
|
|
@@ -2481,34 +2486,34 @@ const ce = "readium-snapper-style", j = class j extends X {
|
|
|
2481
2486
|
}
|
|
2482
2487
|
mount(t, e) {
|
|
2483
2488
|
const i = t.document.createElement("style");
|
|
2484
|
-
return i.dataset.readium = "true", i.id =
|
|
2489
|
+
return i.dataset.readium = "true", i.id = he, i.textContent = this.buildStyles(), t.document.head.appendChild(i), e.register("protect", j.moduleName, (s, n) => {
|
|
2485
2490
|
this.protected = !0, i.textContent = this.buildStyles(), n(!0);
|
|
2486
2491
|
}), e.register("unprotect", j.moduleName, (s, n) => {
|
|
2487
2492
|
this.protected = !1, i.textContent = this.buildStyles(), n(!0);
|
|
2488
2493
|
}), e.log("Snapper Mounted"), !0;
|
|
2489
2494
|
}
|
|
2490
2495
|
unmount(t, e) {
|
|
2491
|
-
return t.document.getElementById(
|
|
2496
|
+
return t.document.getElementById(he)?.remove(), e.log("Snapper Unmounted"), !0;
|
|
2492
2497
|
}
|
|
2493
2498
|
};
|
|
2494
2499
|
j.moduleName = "snapper";
|
|
2495
2500
|
let st = j;
|
|
2496
|
-
function
|
|
2501
|
+
function H(r) {
|
|
2497
2502
|
return r.document.body.dir.toLowerCase() === "rtl";
|
|
2498
2503
|
}
|
|
2499
|
-
function
|
|
2504
|
+
function Pe(r) {
|
|
2500
2505
|
return parseInt(
|
|
2501
2506
|
r.getComputedStyle(
|
|
2502
2507
|
r.document.documentElement
|
|
2503
2508
|
).getPropertyValue("column-count")
|
|
2504
2509
|
);
|
|
2505
2510
|
}
|
|
2506
|
-
function
|
|
2511
|
+
function de(r) {
|
|
2507
2512
|
const t = getComputedStyle(r), e = parseFloat(t.paddingTop || "0"), i = parseFloat(t.paddingBottom || "0");
|
|
2508
2513
|
return r.clientHeight - e - i;
|
|
2509
2514
|
}
|
|
2510
|
-
function
|
|
2511
|
-
const t =
|
|
2515
|
+
function ue(r) {
|
|
2516
|
+
const t = Pe(r);
|
|
2512
2517
|
if (!t)
|
|
2513
2518
|
return !1;
|
|
2514
2519
|
const e = r.document.querySelectorAll("div[id^='readium-virtual-page']");
|
|
@@ -2518,22 +2523,22 @@ function de(r) {
|
|
|
2518
2523
|
if (d > 0)
|
|
2519
2524
|
for (let h = 0; h < d; h++) {
|
|
2520
2525
|
const u = r.document.createElement("div");
|
|
2521
|
-
u.setAttribute("id", `readium-virtual-page-${h}`), u.dataset.readium = "true", CSS.supports("break-before", "column") ? u.style.breakBefore = "column" : (CSS.supports("break-inside", "avoid-column") && (u.style.breakInside = "avoid-column"), u.style.height =
|
|
2526
|
+
u.setAttribute("id", `readium-virtual-page-${h}`), u.dataset.readium = "true", CSS.supports("break-before", "column") ? u.style.breakBefore = "column" : (CSS.supports("break-inside", "avoid-column") && (u.style.breakInside = "avoid-column"), u.style.height = de(r.document.documentElement) + "px"), u.innerHTML = "​", r.document.body.appendChild(u);
|
|
2522
2527
|
}
|
|
2523
2528
|
return i !== d;
|
|
2524
2529
|
}
|
|
2525
|
-
function
|
|
2530
|
+
function Ne(r) {
|
|
2526
2531
|
const t = r.document.createElement("style");
|
|
2527
2532
|
t.appendChild(r.document.createTextNode("*{}")), r.document.body.appendChild(t), r.document.body.removeChild(t);
|
|
2528
2533
|
}
|
|
2529
|
-
function
|
|
2534
|
+
function ai(r) {
|
|
2530
2535
|
return r < 0.5 ? 2 * r * r : -1 + (4 - 2 * r) * r;
|
|
2531
2536
|
}
|
|
2532
|
-
function
|
|
2537
|
+
function C(r) {
|
|
2533
2538
|
const t = r.getSelection();
|
|
2534
2539
|
t && t.removeAllRanges();
|
|
2535
2540
|
}
|
|
2536
|
-
const
|
|
2541
|
+
const li = [
|
|
2537
2542
|
"a",
|
|
2538
2543
|
"audio",
|
|
2539
2544
|
"button",
|
|
@@ -2547,35 +2552,35 @@ const ai = [
|
|
|
2547
2552
|
"textarea",
|
|
2548
2553
|
"video"
|
|
2549
2554
|
];
|
|
2550
|
-
function
|
|
2551
|
-
return
|
|
2555
|
+
function Le(r) {
|
|
2556
|
+
return li.indexOf(r.nodeName.toLowerCase()) !== -1 || r.hasAttribute("contenteditable") && r.getAttribute("contenteditable")?.toLowerCase() !== "false" ? r : r.parentElement ? Le(r.parentElement) : null;
|
|
2552
2557
|
}
|
|
2553
|
-
function
|
|
2554
|
-
const e =
|
|
2558
|
+
function Bt(r, t) {
|
|
2559
|
+
const e = Oe(r, r.document.body, t), i = r._readium_cssSelectorGenerator.getCssSelector(e, {
|
|
2555
2560
|
selectors: ["tag", "id", "class", "nthchild", "nthoftype", "attribute"]
|
|
2556
2561
|
});
|
|
2557
2562
|
return new W({
|
|
2558
2563
|
href: "#",
|
|
2559
2564
|
type: "application/xhtml+xml",
|
|
2560
|
-
locations: new
|
|
2565
|
+
locations: new A({
|
|
2561
2566
|
otherLocations: /* @__PURE__ */ new Map([
|
|
2562
2567
|
["cssSelector", i]
|
|
2563
2568
|
])
|
|
2564
2569
|
}),
|
|
2565
|
-
text: new
|
|
2570
|
+
text: new _({
|
|
2566
2571
|
highlight: e.textContent || void 0
|
|
2567
2572
|
})
|
|
2568
2573
|
});
|
|
2569
2574
|
}
|
|
2570
|
-
function
|
|
2575
|
+
function Oe(r, t, e) {
|
|
2571
2576
|
for (var i = 0; i < t.children.length; i++) {
|
|
2572
2577
|
const s = t.children[i];
|
|
2573
|
-
if (!
|
|
2574
|
-
return
|
|
2578
|
+
if (!di(s) && ci(r, s, e))
|
|
2579
|
+
return hi(r, s) ? s : Oe(r, s, e);
|
|
2575
2580
|
}
|
|
2576
2581
|
return t;
|
|
2577
2582
|
}
|
|
2578
|
-
function
|
|
2583
|
+
function ci(r, t, e) {
|
|
2579
2584
|
if (t === document.body || t === document.documentElement)
|
|
2580
2585
|
return !0;
|
|
2581
2586
|
if (!document || !document.documentElement || !document.body)
|
|
@@ -2583,11 +2588,11 @@ function li(r, t, e) {
|
|
|
2583
2588
|
const i = t.getBoundingClientRect();
|
|
2584
2589
|
return e ? i.bottom > 0 && i.top < r.innerHeight : i.right > 0 && i.left < r.innerWidth;
|
|
2585
2590
|
}
|
|
2586
|
-
function
|
|
2591
|
+
function hi(r, t) {
|
|
2587
2592
|
const e = t.getBoundingClientRect();
|
|
2588
2593
|
return e.top >= 0 && e.left >= 0 && e.bottom <= r.innerHeight && e.right <= r.innerWidth;
|
|
2589
2594
|
}
|
|
2590
|
-
function
|
|
2595
|
+
function di(r) {
|
|
2591
2596
|
const t = getComputedStyle(r);
|
|
2592
2597
|
if (t) {
|
|
2593
2598
|
const e = t.getPropertyValue("display");
|
|
@@ -2596,7 +2601,7 @@ function hi(r) {
|
|
|
2596
2601
|
}
|
|
2597
2602
|
return !1;
|
|
2598
2603
|
}
|
|
2599
|
-
const
|
|
2604
|
+
const ui = {
|
|
2600
2605
|
maxVelocity: 200,
|
|
2601
2606
|
// Reasonable default for human-like scrolling (pixels/ms)
|
|
2602
2607
|
minVariance: 0.01,
|
|
@@ -2607,7 +2612,7 @@ const di = {
|
|
|
2607
2612
|
// Reasonable default for detecting patterns
|
|
2608
2613
|
maxConsistentScrolls: 15
|
|
2609
2614
|
// Balanced threshold for flagging
|
|
2610
|
-
},
|
|
2615
|
+
}, Re = {
|
|
2611
2616
|
maxVelocity: 200,
|
|
2612
2617
|
// Extremely fast scrolling (pixels/ms)
|
|
2613
2618
|
minVariance: 1e-5,
|
|
@@ -2618,20 +2623,20 @@ const di = {
|
|
|
2618
2623
|
// Only trigger on near-perfect patterns
|
|
2619
2624
|
maxConsistentScrolls: 20
|
|
2620
2625
|
// Need many consistent scrolls
|
|
2621
|
-
},
|
|
2626
|
+
}, Ie = {
|
|
2622
2627
|
maxSelectionsPerSecond: 500,
|
|
2623
2628
|
minVariance: 50,
|
|
2624
2629
|
historySize: 20
|
|
2625
|
-
},
|
|
2630
|
+
}, pi = {
|
|
2626
2631
|
enabled: !0,
|
|
2627
2632
|
maxSelectionPercent: 0.1,
|
|
2628
2633
|
minThreshold: 100,
|
|
2629
2634
|
absoluteMaxChars: 5e3,
|
|
2630
2635
|
historySize: 20
|
|
2631
2636
|
};
|
|
2632
|
-
class
|
|
2637
|
+
class Ht {
|
|
2633
2638
|
constructor(t = {}) {
|
|
2634
|
-
this.history = [], this.consistentScrollCount = 0, this.options = { ...
|
|
2639
|
+
this.history = [], this.consistentScrollCount = 0, this.options = { ...ui, ...t };
|
|
2635
2640
|
}
|
|
2636
2641
|
analyze(t, e, i) {
|
|
2637
2642
|
if (i <= 0) return !1;
|
|
@@ -2650,9 +2655,9 @@ class Bt {
|
|
|
2650
2655
|
return this.resetAfterDetection(), !0;
|
|
2651
2656
|
} else
|
|
2652
2657
|
this.consistentScrollCount = Math.max(0, this.consistentScrollCount - 1);
|
|
2653
|
-
let m = 0,
|
|
2658
|
+
let m = 0, w = this.history[0].direction;
|
|
2654
2659
|
for (let p = 1; p < this.history.length; p++)
|
|
2655
|
-
this.history[p].direction !==
|
|
2660
|
+
this.history[p].direction !== w && (m++, w = this.history[p].direction);
|
|
2656
2661
|
return m / this.history.length > (this.options.minDirectionChanges || 0.3) ? (this.resetAfterDetection(), !0) : !1;
|
|
2657
2662
|
}
|
|
2658
2663
|
resetAfterDetection() {
|
|
@@ -2662,7 +2667,7 @@ class Bt {
|
|
|
2662
2667
|
this.history = [], this.consistentScrollCount = 0;
|
|
2663
2668
|
}
|
|
2664
2669
|
}
|
|
2665
|
-
const
|
|
2670
|
+
const pe = "readium-column-snapper-style", mi = 200, P = class P extends st {
|
|
2666
2671
|
constructor() {
|
|
2667
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);
|
|
2668
2673
|
}
|
|
@@ -2673,7 +2678,7 @@ const ue = "readium-column-snapper-style", pi = 200, P = class P extends st {
|
|
|
2673
2678
|
return this.doc().scrollLeft > 0 ? this.doc().scrollLeft : this.alreadyScrollLeft;
|
|
2674
2679
|
}
|
|
2675
2680
|
snapOffset(t) {
|
|
2676
|
-
const e = t + (
|
|
2681
|
+
const e = t + (H(this.wnd) ? -1 : 1);
|
|
2677
2682
|
return e - e % this.wnd.innerWidth;
|
|
2678
2683
|
}
|
|
2679
2684
|
reportProgress() {
|
|
@@ -2686,7 +2691,7 @@ const ue = "readium-column-snapper-style", pi = 200, P = class P extends st {
|
|
|
2686
2691
|
shake() {
|
|
2687
2692
|
if (this.overscroll !== 0 || this.shakeTimeout !== 0) return;
|
|
2688
2693
|
const t = this.doc();
|
|
2689
|
-
t.classList.add(
|
|
2694
|
+
t.classList.add(H(this.wnd) ? "readium-bounce-l" : "readium-bounce-r");
|
|
2690
2695
|
const e = this.scrollOffset();
|
|
2691
2696
|
this.shakeTimeout = this.wnd.setTimeout(() => {
|
|
2692
2697
|
t.classList.remove("readium-bounce-l"), t.classList.remove("readium-bounce-r"), this.shakeTimeout = 0, this.doc().scrollLeft = e;
|
|
@@ -2700,22 +2705,24 @@ const ue = "readium-column-snapper-style", pi = 200, P = class P extends st {
|
|
|
2700
2705
|
}
|
|
2701
2706
|
// Snaps the current offset to the page width.
|
|
2702
2707
|
snapCurrentOffset(t = !1, e = !1) {
|
|
2703
|
-
const i = this.wnd.scrollX > 0 ? this.wnd.scrollX : this.alreadyScrollLeft, s = this.doc(), n = this.dragOffset(), o =
|
|
2708
|
+
const i = this.wnd.scrollX > 0 ? this.wnd.scrollX : this.alreadyScrollLeft, s = this.doc(), n = this.dragOffset(), o = Pe(this.wnd), a = Math.min(Math.max(0, i), this.cachedScrollWidth), d = H(this.wnd) ? -1 : 1, h = (
|
|
2704
2709
|
// The hurdle to overcome in order to change pages
|
|
2705
2710
|
d * (this.wnd.innerWidth / 3) * (d * n > 0 ? 2 : 1)
|
|
2706
2711
|
), u = this.snapOffset(a + h), g = u > this.scrollOffset() ? "right" : "left";
|
|
2707
2712
|
if (this.checkSuspiciousSnap(g, Math.abs(u - this.scrollOffset())), t && u !== this.scrollOffset()) {
|
|
2708
2713
|
this.snappingCancelled = !1;
|
|
2709
|
-
const m = (b, x,
|
|
2714
|
+
const m = (b, x, B, q) => B > q ? x : b + (x - b) * ai(B / q), w = (
|
|
2710
2715
|
/*Math.abs(startX - (this.useTransform ? currentOffset : 0)) < 10 ? 1 : */
|
|
2711
|
-
|
|
2716
|
+
mi * o
|
|
2712
2717
|
);
|
|
2713
2718
|
let f;
|
|
2714
2719
|
const p = (b) => {
|
|
2715
2720
|
if (this.snappingCancelled) return;
|
|
2716
2721
|
f || (f = b);
|
|
2717
|
-
const x = b - f,
|
|
2718
|
-
s.scrollLeft = q, this.overscroll !== 0 && (
|
|
2722
|
+
const x = b - f, B = m(this.overscroll, 0, x, w), q = m(i, u, x, w);
|
|
2723
|
+
s.scrollLeft = q, this.overscroll !== 0 && (gt ? s.attributeStyleMap.set("transform", new CSSTransformValue([
|
|
2724
|
+
new CSSTranslate(CSS.px(-B), CSS.px(0), CSS.px(0))
|
|
2725
|
+
])) : s.style.transform = `translate3d(${-B}px, 0px, 0px)`), x < w ? this.wnd.requestAnimationFrame(p) : (this.clearTouches(), s.style.removeProperty("transform"), s.scrollLeft = u, e || this.reportProgress());
|
|
2719
2726
|
};
|
|
2720
2727
|
this.wnd.requestAnimationFrame(p);
|
|
2721
2728
|
} else
|
|
@@ -2755,12 +2762,16 @@ const ue = "readium-column-snapper-style", pi = 200, P = class P extends st {
|
|
|
2755
2762
|
}
|
|
2756
2763
|
onTouchMove(t) {
|
|
2757
2764
|
if (this.touchState === 0) return;
|
|
2758
|
-
this.touchState === 1 && (this.touchState = 2,
|
|
2765
|
+
this.touchState === 1 && (this.touchState = 2, C(this.wnd)), this.endingX = t.touches[0].clientX;
|
|
2759
2766
|
const e = this.dragOffset(), i = this.alreadyScrollLeft + e;
|
|
2760
|
-
i < 0 ? (this.overscroll = i,
|
|
2767
|
+
i < 0 ? (this.overscroll = i, gt ? this.doc().attributeStyleMap.set("transform", new CSSTransformValue([
|
|
2768
|
+
new CSSTranslate(CSS.px(-i), CSS.px(0), CSS.px(0))
|
|
2769
|
+
])) : this.doc().style.transform = `translate3d(${-i}px, 0px, 0px)`) : i + this.wnd.innerWidth > this.cachedScrollWidth ? (this.overscroll = i, gt ? this.doc().attributeStyleMap.set("transform", new CSSTransformValue([
|
|
2770
|
+
new CSSTranslate(CSS.px(-i), CSS.px(0), CSS.px(0))
|
|
2771
|
+
])) : this.doc().style.transform = `translate3d(${-i}px, 0px, 0px)`) : (this.overscroll = 0, this.doc().style.removeProperty("transform"), this.doc().scrollLeft = this.alreadyScrollLeft + e);
|
|
2761
2772
|
}
|
|
2762
2773
|
enableSnapProtection() {
|
|
2763
|
-
this.patternAnalyzer || (this.patternAnalyzer = new
|
|
2774
|
+
this.patternAnalyzer || (this.patternAnalyzer = new Ht({
|
|
2764
2775
|
maxVelocity: this.wnd.innerWidth,
|
|
2765
2776
|
// page width
|
|
2766
2777
|
minVariance: 0.1,
|
|
@@ -2786,7 +2797,7 @@ const ue = "readium-column-snapper-style", pi = 200, P = class P extends st {
|
|
|
2786
2797
|
if (this.wnd = t, this.comms = e, !super.mount(t, e)) return !1;
|
|
2787
2798
|
t.navigator.epubReadingSystem && (t.navigator.epubReadingSystem.layoutStyle = "paginated");
|
|
2788
2799
|
const i = t.document.createElement("style");
|
|
2789
|
-
i.dataset.readium = "true", i.id =
|
|
2800
|
+
i.dataset.readium = "true", i.id = pe, i.textContent = `
|
|
2790
2801
|
@keyframes readium-bounce-l-animation {
|
|
2791
2802
|
0%, 100% {transform: translate3d(0, 0, 0);}
|
|
2792
2803
|
50% {transform: translate3d(-50px, 0, 0);}
|
|
@@ -2822,14 +2833,14 @@ const ue = "readium-column-snapper-style", pi = 200, P = class P extends st {
|
|
|
2822
2833
|
}
|
|
2823
2834
|
`, t.document.head.appendChild(i), this.resizeObserver = new ResizeObserver(() => {
|
|
2824
2835
|
t.requestAnimationFrame(() => {
|
|
2825
|
-
t &&
|
|
2836
|
+
t && ue(t);
|
|
2826
2837
|
}), this.onWidthChange();
|
|
2827
2838
|
}), this.resizeObserver.observe(t.document.body), this.mutationObserver = new MutationObserver((n) => {
|
|
2828
2839
|
for (const o of n)
|
|
2829
2840
|
if (o.target === this.wnd.document.documentElement) {
|
|
2830
2841
|
const a = o.oldValue, d = o.target.getAttribute("style"), h = /transform\s*:\s*([^;]+)/, u = a?.match(h), g = d?.match(h);
|
|
2831
2842
|
(!u && !g || u && !g || u && g && u[1] !== g[1]) && (t.requestAnimationFrame(() => {
|
|
2832
|
-
t &&
|
|
2843
|
+
t && ue(t);
|
|
2833
2844
|
}), this.onWidthChange());
|
|
2834
2845
|
} else
|
|
2835
2846
|
t.requestAnimationFrame(() => this.cachedScrollWidth = this.doc().scrollWidth);
|
|
@@ -2850,8 +2861,8 @@ const ue = "readium-column-snapper-style", pi = 200, P = class P extends st {
|
|
|
2850
2861
|
}
|
|
2851
2862
|
this.wnd.requestAnimationFrame(() => {
|
|
2852
2863
|
this.cachedScrollWidth = this.doc().scrollWidth;
|
|
2853
|
-
const d = this.cachedScrollWidth, h =
|
|
2854
|
-
this.doc().scrollLeft = this.snapOffset(u), this.reportProgress(),
|
|
2864
|
+
const d = this.cachedScrollWidth, h = H(t) ? -1 : 1, u = d * a * h;
|
|
2865
|
+
this.doc().scrollLeft = this.snapOffset(u), this.reportProgress(), C(this.wnd), o(!0);
|
|
2855
2866
|
});
|
|
2856
2867
|
}), e.register("go_id", P.moduleName, (n, o) => {
|
|
2857
2868
|
const a = t.document.getElementById(n);
|
|
@@ -2860,16 +2871,16 @@ const ue = "readium-column-snapper-style", pi = 200, P = class P extends st {
|
|
|
2860
2871
|
return;
|
|
2861
2872
|
}
|
|
2862
2873
|
this.wnd.requestAnimationFrame(() => {
|
|
2863
|
-
this.doc().scrollLeft = this.snapOffset(a.getBoundingClientRect().left + t.scrollX), this.reportProgress(),
|
|
2874
|
+
this.doc().scrollLeft = this.snapOffset(a.getBoundingClientRect().left + t.scrollX), this.reportProgress(), C(this.wnd), o(!0);
|
|
2864
2875
|
});
|
|
2865
2876
|
}), e.register("go_text", P.moduleName, (n, o) => {
|
|
2866
2877
|
let a;
|
|
2867
2878
|
Array.isArray(n) && (n.length > 1 && (a = n[1]), n = n[0]);
|
|
2868
|
-
const d =
|
|
2879
|
+
const d = _.deserialize(n), h = pt(this.wnd.document, new W({
|
|
2869
2880
|
href: t.location.href,
|
|
2870
2881
|
type: "text/html",
|
|
2871
2882
|
text: d,
|
|
2872
|
-
locations: a ? new
|
|
2883
|
+
locations: a ? new A({
|
|
2873
2884
|
otherLocations: /* @__PURE__ */ new Map([
|
|
2874
2885
|
["cssSelector", a]
|
|
2875
2886
|
])
|
|
@@ -2880,35 +2891,35 @@ const ue = "readium-column-snapper-style", pi = 200, P = class P extends st {
|
|
|
2880
2891
|
return;
|
|
2881
2892
|
}
|
|
2882
2893
|
this.wnd.requestAnimationFrame(() => {
|
|
2883
|
-
this.doc().scrollLeft = this.snapOffset(h.getBoundingClientRect().left + t.scrollX), this.reportProgress(),
|
|
2894
|
+
this.doc().scrollLeft = this.snapOffset(h.getBoundingClientRect().left + t.scrollX), this.reportProgress(), C(this.wnd), o(!0);
|
|
2884
2895
|
});
|
|
2885
2896
|
}), e.register("go_end", P.moduleName, (n, o) => {
|
|
2886
|
-
const a =
|
|
2897
|
+
const a = H(t) ? -1 : 1;
|
|
2887
2898
|
this.wnd.requestAnimationFrame(() => {
|
|
2888
2899
|
this.cachedScrollWidth = this.doc().scrollWidth;
|
|
2889
2900
|
const d = this.cachedScrollWidth * a;
|
|
2890
2901
|
if (this.doc().scrollLeft === d) return o(!1);
|
|
2891
|
-
this.doc().scrollLeft = this.snapOffset(d), this.reportProgress(),
|
|
2902
|
+
this.doc().scrollLeft = this.snapOffset(d), this.reportProgress(), C(this.wnd), o(!0);
|
|
2892
2903
|
});
|
|
2893
2904
|
}), e.register("go_start", P.moduleName, (n, o) => {
|
|
2894
2905
|
this.wnd.requestAnimationFrame(() => {
|
|
2895
2906
|
if (this.doc().scrollLeft === 0) return o(!1);
|
|
2896
|
-
this.doc().scrollLeft = 0, this.reportProgress(),
|
|
2907
|
+
this.doc().scrollLeft = 0, this.reportProgress(), C(this.wnd), o(!0);
|
|
2897
2908
|
});
|
|
2898
2909
|
}), e.register("go_prev", P.moduleName, (n, o) => {
|
|
2899
2910
|
this.wnd.requestAnimationFrame(() => {
|
|
2900
2911
|
this.cachedScrollWidth = this.doc().scrollWidth;
|
|
2901
|
-
const a = t.scrollX - t.innerWidth, d =
|
|
2902
|
-
h && (this.reportProgress(),
|
|
2912
|
+
const a = t.scrollX - t.innerWidth, d = H(t) ? -(this.cachedScrollWidth - t.innerWidth) : 0, h = s(Math.max(a, d));
|
|
2913
|
+
h && (this.reportProgress(), C(this.wnd), this.checkSuspiciousSnap("left", this.wnd.innerWidth)), o(h);
|
|
2903
2914
|
});
|
|
2904
2915
|
}), e.register("go_next", P.moduleName, (n, o) => {
|
|
2905
2916
|
this.wnd.requestAnimationFrame(() => {
|
|
2906
2917
|
this.cachedScrollWidth = this.doc().scrollWidth;
|
|
2907
|
-
const a = t.scrollX + t.innerWidth, d =
|
|
2908
|
-
h && (this.reportProgress(),
|
|
2918
|
+
const a = t.scrollX + t.innerWidth, d = H(t) ? 0 : this.cachedScrollWidth - t.innerWidth, h = s(Math.min(a, d));
|
|
2919
|
+
h && (this.reportProgress(), C(this.wnd), this.checkSuspiciousSnap("right", this.wnd.innerWidth)), o(h);
|
|
2909
2920
|
});
|
|
2910
2921
|
}), e.register("unfocus", P.moduleName, (n, o) => {
|
|
2911
|
-
this.snappingCancelled = !0,
|
|
2922
|
+
this.snappingCancelled = !0, C(this.wnd), o(!0);
|
|
2912
2923
|
}), e.register("shake", P.moduleName, (n, o) => {
|
|
2913
2924
|
this.shake(), o(!0);
|
|
2914
2925
|
}), e.register("focus", P.moduleName, (n, o) => {
|
|
@@ -2916,18 +2927,18 @@ const ue = "readium-column-snapper-style", pi = 200, P = class P extends st {
|
|
|
2916
2927
|
this.cachedScrollWidth = this.doc().scrollWidth, this.snapCurrentOffset(!1, !0), this.reportProgress(), o(!0);
|
|
2917
2928
|
});
|
|
2918
2929
|
}), e.register("first_visible_locator", P.moduleName, (n, o) => {
|
|
2919
|
-
const a =
|
|
2930
|
+
const a = Bt(t, !1);
|
|
2920
2931
|
this.comms.send("first_visible_locator", a.serialize()), o(!0);
|
|
2921
2932
|
}), 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", () => {
|
|
2922
2933
|
}), e.log("ColumnSnapper Mounted"), !0;
|
|
2923
2934
|
}
|
|
2924
2935
|
unmount(t, e) {
|
|
2925
|
-
return this.snappingCancelled = !0, e.unregisterAll(P.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(
|
|
2936
|
+
return this.snappingCancelled = !0, e.unregisterAll(P.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(pe)?.remove(), e.log("ColumnSnapper Unmounted"), super.unmount(t, e);
|
|
2926
2937
|
}
|
|
2927
2938
|
};
|
|
2928
2939
|
P.moduleName = "column_snapper";
|
|
2929
|
-
let
|
|
2930
|
-
const
|
|
2940
|
+
let Ct = P;
|
|
2941
|
+
const me = "readium-scroll-snapper-style", N = class N extends st {
|
|
2931
2942
|
constructor() {
|
|
2932
2943
|
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) => {
|
|
2933
2944
|
if (this.comms.ready && !this.isResizing) {
|
|
@@ -2973,12 +2984,12 @@ const pe = "readium-scroll-snapper-style", N = class N extends st {
|
|
|
2973
2984
|
});
|
|
2974
2985
|
}
|
|
2975
2986
|
enableScrollProtection() {
|
|
2976
|
-
this.patternAnalyzer || (this.patternAnalyzer = new
|
|
2987
|
+
this.patternAnalyzer || (this.patternAnalyzer = new Ht(Re), this.isScrollProtectionEnabled = !0, this.comms?.log("Scroll protection enabled"));
|
|
2977
2988
|
}
|
|
2978
2989
|
mount(t, e) {
|
|
2979
2990
|
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");
|
|
2980
2991
|
const i = t.document.createElement("style");
|
|
2981
|
-
return i.dataset.readium = "true", i.id =
|
|
2992
|
+
return i.dataset.readium = "true", i.id = me, i.textContent = `
|
|
2982
2993
|
* {
|
|
2983
2994
|
scrollbar-width: none; /* for Firefox */
|
|
2984
2995
|
}
|
|
@@ -2991,7 +3002,7 @@ const pe = "readium-scroll-snapper-style", N = class N extends st {
|
|
|
2991
3002
|
this.isResizing = !1, this.resizeDebounce = null, this.reportProgress();
|
|
2992
3003
|
}, 50);
|
|
2993
3004
|
}), this.resizeObserver.observe(t.document.body), t.addEventListener("scroll", this.handleScroll, { passive: !0 }), e.register("force_webkit_recalc", N.moduleName, () => {
|
|
2994
|
-
|
|
3005
|
+
Ne(this.wnd);
|
|
2995
3006
|
const s = this.doc().scrollTop;
|
|
2996
3007
|
s > 1 ? this.doc().scrollTop = s - 1 : this.doc().scrollTop = s + 1, this.doc().scrollTop = s;
|
|
2997
3008
|
}), e.register("go_progression", N.moduleName, (s, n) => {
|
|
@@ -3003,7 +3014,7 @@ const pe = "readium-scroll-snapper-style", N = class N extends st {
|
|
|
3003
3014
|
return;
|
|
3004
3015
|
}
|
|
3005
3016
|
this.wnd.requestAnimationFrame(() => {
|
|
3006
|
-
this.doc().scrollTop = this.doc().offsetHeight * o, this.reportProgress(),
|
|
3017
|
+
this.doc().scrollTop = this.doc().offsetHeight * o, this.reportProgress(), C(this.wnd), n(!0);
|
|
3007
3018
|
});
|
|
3008
3019
|
}), e.register("go_id", N.moduleName, (s, n) => {
|
|
3009
3020
|
const o = t.document.getElementById(s);
|
|
@@ -3012,16 +3023,16 @@ const pe = "readium-scroll-snapper-style", N = class N extends st {
|
|
|
3012
3023
|
return;
|
|
3013
3024
|
}
|
|
3014
3025
|
this.wnd.requestAnimationFrame(() => {
|
|
3015
|
-
this.doc().scrollTop = o.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(),
|
|
3026
|
+
this.doc().scrollTop = o.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), C(this.wnd), n(!0);
|
|
3016
3027
|
});
|
|
3017
3028
|
}), e.register("go_text", N.moduleName, (s, n) => {
|
|
3018
3029
|
let o;
|
|
3019
3030
|
Array.isArray(s) && (s.length > 1 && (o = s[1]), s = s[0]);
|
|
3020
|
-
const a =
|
|
3031
|
+
const a = _.deserialize(s), d = pt(this.wnd.document, new W({
|
|
3021
3032
|
href: t.location.href,
|
|
3022
3033
|
type: "text/html",
|
|
3023
3034
|
text: a,
|
|
3024
|
-
locations: o ? new
|
|
3035
|
+
locations: o ? new A({
|
|
3025
3036
|
otherLocations: /* @__PURE__ */ new Map([
|
|
3026
3037
|
["cssSelector", o]
|
|
3027
3038
|
])
|
|
@@ -3032,7 +3043,7 @@ const pe = "readium-scroll-snapper-style", N = class N extends st {
|
|
|
3032
3043
|
return;
|
|
3033
3044
|
}
|
|
3034
3045
|
this.wnd.requestAnimationFrame(() => {
|
|
3035
|
-
this.doc().scrollTop = d.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(),
|
|
3046
|
+
this.doc().scrollTop = d.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), C(this.wnd), n(!0);
|
|
3036
3047
|
});
|
|
3037
3048
|
}), e.register("go_start", N.moduleName, (s, n) => {
|
|
3038
3049
|
if (this.doc().scrollTop === 0) return n(!1);
|
|
@@ -3041,7 +3052,7 @@ const pe = "readium-scroll-snapper-style", N = class N extends st {
|
|
|
3041
3052
|
if (this.doc().scrollTop === this.doc().scrollHeight - this.doc().offsetHeight) return n(!1);
|
|
3042
3053
|
this.doc().scrollTop = this.doc().scrollHeight - this.doc().offsetHeight, this.reportProgress(), n(!0);
|
|
3043
3054
|
}), e.register("unfocus", N.moduleName, (s, n) => {
|
|
3044
|
-
|
|
3055
|
+
C(this.wnd), n(!0);
|
|
3045
3056
|
}), e.register("scroll_protection", N.moduleName, (s, n) => {
|
|
3046
3057
|
this.enableScrollProtection(), n(!0);
|
|
3047
3058
|
}), e.register([
|
|
@@ -3050,16 +3061,16 @@ const pe = "readium-scroll-snapper-style", N = class N extends st {
|
|
|
3050
3061
|
], N.moduleName, (s, n) => n(!1)), e.register("focus", N.moduleName, (s, n) => {
|
|
3051
3062
|
this.reportProgress(), n(!0);
|
|
3052
3063
|
}), e.register("first_visible_locator", N.moduleName, (s, n) => {
|
|
3053
|
-
const o =
|
|
3064
|
+
const o = Bt(t, !0);
|
|
3054
3065
|
this.comms.send("first_visible_locator", o.serialize()), n(!0);
|
|
3055
3066
|
}), e.log("ScrollSnapper Mounted"), !0;
|
|
3056
3067
|
}
|
|
3057
3068
|
unmount(t, e) {
|
|
3058
|
-
return e.unregisterAll(N.moduleName), this.resizeObserver.disconnect(), this.handleScroll && t.removeEventListener("scroll", this.handleScroll), t.document.getElementById(
|
|
3069
|
+
return e.unregisterAll(N.moduleName), this.resizeObserver.disconnect(), this.handleScroll && t.removeEventListener("scroll", this.handleScroll), t.document.getElementById(me)?.remove(), this.patternAnalyzer && (this.patternAnalyzer.clear(), this.patternAnalyzer = null, this.isScrollProtectionEnabled = !1), e.log("ScrollSnapper Unmounted"), !0;
|
|
3059
3070
|
}
|
|
3060
3071
|
};
|
|
3061
3072
|
N.moduleName = "scroll_snapper";
|
|
3062
|
-
let
|
|
3073
|
+
let xt = N;
|
|
3063
3074
|
const L = class L extends st {
|
|
3064
3075
|
constructor() {
|
|
3065
3076
|
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) => {
|
|
@@ -3106,7 +3117,7 @@ const L = class L extends st {
|
|
|
3106
3117
|
});
|
|
3107
3118
|
}
|
|
3108
3119
|
enableScrollProtection() {
|
|
3109
|
-
this.patternAnalyzer || (this.patternAnalyzer = new
|
|
3120
|
+
this.patternAnalyzer || (this.patternAnalyzer = new Ht(Re), this.isScrollProtectionEnabled = !0, this.comms?.log("Scroll protection enabled"));
|
|
3110
3121
|
}
|
|
3111
3122
|
mount(t, e) {
|
|
3112
3123
|
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(() => {
|
|
@@ -3114,7 +3125,7 @@ const L = class L extends st {
|
|
|
3114
3125
|
this.isResizing = !1, this.resizeDebounce = null, this.reportProgress();
|
|
3115
3126
|
}, 50);
|
|
3116
3127
|
}), this.resizeObserver.observe(t.document.body), t.addEventListener("scroll", this.handleScroll, { passive: !0 }), e.register("force_webkit_recalc", L.moduleName, () => {
|
|
3117
|
-
|
|
3128
|
+
Ne(this.wnd);
|
|
3118
3129
|
const i = this.doc().scrollTop;
|
|
3119
3130
|
i > 1 ? this.doc().scrollTop = i - 1 : this.doc().scrollTop = i + 1, this.doc().scrollTop = i;
|
|
3120
3131
|
}), e.register("go_progression", L.moduleName, (i, s) => {
|
|
@@ -3126,7 +3137,7 @@ const L = class L extends st {
|
|
|
3126
3137
|
return;
|
|
3127
3138
|
}
|
|
3128
3139
|
this.wnd.requestAnimationFrame(() => {
|
|
3129
|
-
this.doc().scrollTop = this.doc().offsetHeight * n, this.reportProgress(),
|
|
3140
|
+
this.doc().scrollTop = this.doc().offsetHeight * n, this.reportProgress(), C(this.wnd), s(!0);
|
|
3130
3141
|
});
|
|
3131
3142
|
}), e.register("go_id", L.moduleName, (i, s) => {
|
|
3132
3143
|
const n = t.document.getElementById(i);
|
|
@@ -3135,16 +3146,16 @@ const L = class L extends st {
|
|
|
3135
3146
|
return;
|
|
3136
3147
|
}
|
|
3137
3148
|
this.wnd.requestAnimationFrame(() => {
|
|
3138
|
-
this.doc().scrollTop = n.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(),
|
|
3149
|
+
this.doc().scrollTop = n.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), C(this.wnd), s(!0);
|
|
3139
3150
|
});
|
|
3140
3151
|
}), e.register("go_text", L.moduleName, (i, s) => {
|
|
3141
3152
|
let n;
|
|
3142
3153
|
Array.isArray(i) && (i.length > 1 && (n = i[1]), i = i[0]);
|
|
3143
|
-
const o =
|
|
3154
|
+
const o = _.deserialize(i), a = pt(this.wnd.document, new W({
|
|
3144
3155
|
href: t.location.href,
|
|
3145
3156
|
type: "text/html",
|
|
3146
3157
|
text: o,
|
|
3147
|
-
locations: n ? new
|
|
3158
|
+
locations: n ? new A({
|
|
3148
3159
|
otherLocations: /* @__PURE__ */ new Map([
|
|
3149
3160
|
["cssSelector", n]
|
|
3150
3161
|
])
|
|
@@ -3155,7 +3166,7 @@ const L = class L extends st {
|
|
|
3155
3166
|
return;
|
|
3156
3167
|
}
|
|
3157
3168
|
this.wnd.requestAnimationFrame(() => {
|
|
3158
|
-
this.doc().scrollTop = a.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(),
|
|
3169
|
+
this.doc().scrollTop = a.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), C(this.wnd), s(!0);
|
|
3159
3170
|
});
|
|
3160
3171
|
}), e.register("go_start", L.moduleName, (i, s) => {
|
|
3161
3172
|
if (this.doc().scrollTop === 0) return s(!1);
|
|
@@ -3164,7 +3175,7 @@ const L = class L extends st {
|
|
|
3164
3175
|
if (this.doc().scrollTop === this.doc().scrollHeight - this.doc().offsetHeight) return s(!1);
|
|
3165
3176
|
this.doc().scrollTop = this.doc().scrollHeight - this.doc().offsetHeight, this.reportProgress(), s(!0);
|
|
3166
3177
|
}), e.register("unfocus", L.moduleName, (i, s) => {
|
|
3167
|
-
|
|
3178
|
+
C(this.wnd), s(!0);
|
|
3168
3179
|
}), e.register("scroll_protection", L.moduleName, (i, s) => {
|
|
3169
3180
|
this.enableScrollProtection(), s(!0);
|
|
3170
3181
|
}), e.register([
|
|
@@ -3173,7 +3184,7 @@ const L = class L extends st {
|
|
|
3173
3184
|
], L.moduleName, (i, s) => s(!1)), e.register("focus", L.moduleName, (i, s) => {
|
|
3174
3185
|
this.reportProgress(), s(!0);
|
|
3175
3186
|
}), e.register("first_visible_locator", L.moduleName, (i, s) => {
|
|
3176
|
-
const n =
|
|
3187
|
+
const n = Bt(t, !0);
|
|
3177
3188
|
e.send("first_visible_locator", n.serialize()), s(!0);
|
|
3178
3189
|
}), e.log("WebPubSnapper Mounted"), !0;
|
|
3179
3190
|
}
|
|
@@ -3182,8 +3193,8 @@ const L = class L extends st {
|
|
|
3182
3193
|
}
|
|
3183
3194
|
};
|
|
3184
3195
|
L.moduleName = "webpub_snapper";
|
|
3185
|
-
let
|
|
3186
|
-
class
|
|
3196
|
+
let Tt = L;
|
|
3197
|
+
class fi {
|
|
3187
3198
|
constructor(t, e) {
|
|
3188
3199
|
this.window = t, this.copyHistory = [], this.lastSelectionLength = 0, this.lastSelectionTime = 0, this.options = e;
|
|
3189
3200
|
}
|
|
@@ -3223,8 +3234,8 @@ class mi {
|
|
|
3223
3234
|
this.lastSelectionLength = 0, this.lastSelectionTime = 0, this.copyHistory = [], this.options.enabled = !1;
|
|
3224
3235
|
}
|
|
3225
3236
|
}
|
|
3226
|
-
class
|
|
3227
|
-
constructor(t =
|
|
3237
|
+
class gi {
|
|
3238
|
+
constructor(t = Ie) {
|
|
3228
3239
|
this.options = t, this.events = [], this.selectionStartTime = 0, this.lastSelectionTime = 0, this.lastSelectionPosition = 0, this.selectionPatterns = [], this.lastSelectedText = "";
|
|
3229
3240
|
}
|
|
3230
3241
|
analyze(t) {
|
|
@@ -3265,7 +3276,7 @@ class fi {
|
|
|
3265
3276
|
this.events = [], this.selectionStartTime = 0, this.lastSelectionTime = 0, this.lastSelectionPosition = 0, this.selectionPatterns = [], this.lastSelectedText = "";
|
|
3266
3277
|
}
|
|
3267
3278
|
}
|
|
3268
|
-
class
|
|
3279
|
+
class yi {
|
|
3269
3280
|
/**
|
|
3270
3281
|
* Checks if the given keyboard event matches any of the provided key combinations
|
|
3271
3282
|
*/
|
|
@@ -3345,7 +3356,7 @@ class gi {
|
|
|
3345
3356
|
}
|
|
3346
3357
|
const $ = class $ extends X {
|
|
3347
3358
|
constructor() {
|
|
3348
|
-
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
|
|
3359
|
+
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 yi(), this.keyDownHandler = null, this.preventBulkCopy = (t) => {
|
|
3349
3360
|
if (!this.isBulkCopyProtectionEnabled || !this.bulkCopyProtector)
|
|
3350
3361
|
return !0;
|
|
3351
3362
|
if (!this.bulkCopyProtector.shouldAllowCopy(t)) {
|
|
@@ -3466,16 +3477,16 @@ const $ = class $ extends X {
|
|
|
3466
3477
|
}
|
|
3467
3478
|
addBulkCopyProtection(t = {}) {
|
|
3468
3479
|
if (this.isBulkCopyProtectionEnabled || !this.wnd) return;
|
|
3469
|
-
const e =
|
|
3470
|
-
this.bulkCopyProtector = new
|
|
3480
|
+
const e = pi, i = t ? { ...e, ...t } : e;
|
|
3481
|
+
this.bulkCopyProtector = new fi(this.wnd, i), this.wnd.document.addEventListener("copy", this.preventBulkCopy, !0), this.wnd.document.addEventListener("cut", this.preventBulkCopy, !0), this.isBulkCopyProtectionEnabled = !0;
|
|
3471
3482
|
}
|
|
3472
3483
|
removeBulkCopyProtection() {
|
|
3473
3484
|
!this.isBulkCopyProtectionEnabled || !this.wnd || (this.wnd.document.removeEventListener("copy", this.preventBulkCopy, !0), this.wnd.document.removeEventListener("cut", this.preventBulkCopy, !0), this.bulkCopyProtector?.destroy(), this.bulkCopyProtector = null, this.isBulkCopyProtectionEnabled = !1);
|
|
3474
3485
|
}
|
|
3475
3486
|
addSelectionMonitoring(t) {
|
|
3476
3487
|
if (this.isSelectionMonitoringEnabled || !this.wnd) return;
|
|
3477
|
-
const e = t ||
|
|
3478
|
-
this.selectionAnalyzer = new
|
|
3488
|
+
const e = t || Ie;
|
|
3489
|
+
this.selectionAnalyzer = new gi(e), this.wnd.document.addEventListener("selectionchange", this.handleSelection), this.isSelectionMonitoringEnabled = !0;
|
|
3479
3490
|
}
|
|
3480
3491
|
removeSelectionMonitoring() {
|
|
3481
3492
|
!this.isSelectionMonitoringEnabled || !this.wnd || (this.wnd.document.removeEventListener("selectionchange", this.handleSelection), this.selectionAnalyzer?.clear(), this.selectionAnalyzer = null, this.isSelectionMonitoringEnabled = !1);
|
|
@@ -3508,7 +3519,7 @@ const $ = class $ extends X {
|
|
|
3508
3519
|
y: t.clientY * i,
|
|
3509
3520
|
targetFrameSrc: this.wnd.location.href,
|
|
3510
3521
|
targetElement: t.target.outerHTML,
|
|
3511
|
-
interactiveElement:
|
|
3522
|
+
interactiveElement: Le(t.target)?.outerHTML,
|
|
3512
3523
|
cssSelector: this.wnd._readium_cssSelectorGenerator.getCssSelector(t.target)
|
|
3513
3524
|
}), this.pointerMoved = !1;
|
|
3514
3525
|
}
|
|
@@ -3566,7 +3577,7 @@ const $ = class $ extends X {
|
|
|
3566
3577
|
}
|
|
3567
3578
|
};
|
|
3568
3579
|
$.moduleName = "peripherals";
|
|
3569
|
-
let
|
|
3580
|
+
let Pt = $;
|
|
3570
3581
|
const tt = class tt extends X {
|
|
3571
3582
|
constructor() {
|
|
3572
3583
|
super(...arguments), this.mediaPlayingCount = 0, this.allAnimations = /* @__PURE__ */ new Set();
|
|
@@ -3617,7 +3628,7 @@ const tt = class tt extends X {
|
|
|
3617
3628
|
), Reflect.defineProperty(t.navigator, "epubReadingSystem", {
|
|
3618
3629
|
value: {
|
|
3619
3630
|
name: "readium-ts-toolkit",
|
|
3620
|
-
version: "2.3.
|
|
3631
|
+
version: "2.3.1-alpha.1",
|
|
3621
3632
|
hasFeature: (s, n = "") => {
|
|
3622
3633
|
switch (s) {
|
|
3623
3634
|
case "dom-manipulation":
|
|
@@ -3666,7 +3677,7 @@ const tt = class tt extends X {
|
|
|
3666
3677
|
};
|
|
3667
3678
|
tt.moduleName = "setup";
|
|
3668
3679
|
let ut = tt;
|
|
3669
|
-
const
|
|
3680
|
+
const fe = "readium-viewport", M = class M extends ut {
|
|
3670
3681
|
onViewportWidthChanged(t) {
|
|
3671
3682
|
const e = t.target;
|
|
3672
3683
|
it(e, "--RS__viewportWidth", `${e.innerWidth}px`);
|
|
@@ -3674,15 +3685,15 @@ const me = "readium-viewport", M = class M extends ut {
|
|
|
3674
3685
|
mount(t, e) {
|
|
3675
3686
|
if (!super.mount(t, e)) return !1;
|
|
3676
3687
|
const i = t.document.createElement("meta");
|
|
3677
|
-
return i.dataset.readium = "true", i.setAttribute("name", "viewport"), i.setAttribute("id",
|
|
3688
|
+
return i.dataset.readium = "true", i.setAttribute("name", "viewport"), i.setAttribute("id", fe), i.setAttribute(
|
|
3678
3689
|
"content",
|
|
3679
3690
|
"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no"
|
|
3680
3691
|
), t.document.head.appendChild(i), t.addEventListener("orientationchange", this.onViewportWidthChanged), t.addEventListener("resize", this.onViewportWidthChanged), this.onViewportWidthChanged({
|
|
3681
3692
|
target: t
|
|
3682
3693
|
}), e.register("get_properties", M.moduleName, (s, n) => {
|
|
3683
|
-
|
|
3694
|
+
Ut(t), n(!0);
|
|
3684
3695
|
}), e.register("update_properties", M.moduleName, (s, n) => {
|
|
3685
|
-
s["--RS__viewportWidth"] = `${t.innerWidth}px`,
|
|
3696
|
+
s["--RS__viewportWidth"] = `${t.innerWidth}px`, Te(t, s), n(!0);
|
|
3686
3697
|
}), e.register("set_property", M.moduleName, (s, n) => {
|
|
3687
3698
|
const o = s;
|
|
3688
3699
|
it(t, o[0], o[1]), n(!0);
|
|
@@ -3693,17 +3704,17 @@ const me = "readium-viewport", M = class M extends ut {
|
|
|
3693
3704
|
}), e.log("ReflowableSetup Mounted"), !0;
|
|
3694
3705
|
}
|
|
3695
3706
|
unmount(t, e) {
|
|
3696
|
-
return e.unregisterAll(M.moduleName), t.document.head.querySelector(`#${
|
|
3707
|
+
return e.unregisterAll(M.moduleName), t.document.head.querySelector(`#${fe}`)?.remove(), t.removeEventListener("orientationchange", this.onViewportWidthChanged), e.log("ReflowableSetup Unmounted"), super.unmount(t, e);
|
|
3697
3708
|
}
|
|
3698
3709
|
};
|
|
3699
3710
|
M.moduleName = "reflowable_setup";
|
|
3700
|
-
let
|
|
3701
|
-
const
|
|
3711
|
+
let Nt = M;
|
|
3712
|
+
const ge = "readium-fixed-style", D = class D extends ut {
|
|
3702
3713
|
mount(t, e) {
|
|
3703
3714
|
if (!super.mount(t, e)) return !1;
|
|
3704
3715
|
t.navigator.epubReadingSystem && (t.navigator.epubReadingSystem.layoutStyle = "paginated");
|
|
3705
3716
|
const i = t.document.createElement("style");
|
|
3706
|
-
return i.id =
|
|
3717
|
+
return i.id = ge, i.dataset.readium = "true", i.textContent = `
|
|
3707
3718
|
html, body {
|
|
3708
3719
|
text-size-adjust: none;
|
|
3709
3720
|
-ms-text-size-adjust: none;
|
|
@@ -3721,7 +3732,7 @@ const fe = "readium-fixed-style", D = class D extends ut {
|
|
|
3721
3732
|
}), e.register("remove_property", D.moduleName, (s, n) => {
|
|
3722
3733
|
mt(t, s), n(!0);
|
|
3723
3734
|
}), e.register("first_visible_locator", D.moduleName, (s, n) => n(!1)), e.register("unfocus", D.moduleName, (s, n) => {
|
|
3724
|
-
|
|
3735
|
+
C(t), n(!0);
|
|
3725
3736
|
}), e.register([
|
|
3726
3737
|
"focus",
|
|
3727
3738
|
"go_next",
|
|
@@ -3736,11 +3747,11 @@ const fe = "readium-fixed-style", D = class D extends ut {
|
|
|
3736
3747
|
}), e.log("FixedSetup Mounted"), !0;
|
|
3737
3748
|
}
|
|
3738
3749
|
unmount(t, e) {
|
|
3739
|
-
return e.unregisterAll(D.moduleName), t.document.getElementById(
|
|
3750
|
+
return e.unregisterAll(D.moduleName), t.document.getElementById(ge)?.remove(), e.log("FixedSetup Unmounted"), super.unmount(t, e);
|
|
3740
3751
|
}
|
|
3741
3752
|
};
|
|
3742
3753
|
D.moduleName = "fixed_setup";
|
|
3743
|
-
let
|
|
3754
|
+
let Lt = D;
|
|
3744
3755
|
const k = class k extends X {
|
|
3745
3756
|
wndOnErr(t) {
|
|
3746
3757
|
this.comms?.send("error", {
|
|
@@ -3756,9 +3767,9 @@ const k = class k extends X {
|
|
|
3756
3767
|
this.wndOnErr,
|
|
3757
3768
|
!1
|
|
3758
3769
|
), e.register("get_properties", k.moduleName, (i, s) => {
|
|
3759
|
-
|
|
3770
|
+
Ut(t), s(!0);
|
|
3760
3771
|
}), e.register("update_properties", k.moduleName, (i, s) => {
|
|
3761
|
-
|
|
3772
|
+
Te(t, i), s(!0);
|
|
3762
3773
|
}), e.register("set_property", k.moduleName, (i, s) => {
|
|
3763
3774
|
const n = i;
|
|
3764
3775
|
it(t, n[0], n[1]), s(!0);
|
|
@@ -3773,7 +3784,7 @@ const k = class k extends X {
|
|
|
3773
3784
|
}
|
|
3774
3785
|
};
|
|
3775
3786
|
k.moduleName = "webpub_setup";
|
|
3776
|
-
let
|
|
3787
|
+
let Ot = k;
|
|
3777
3788
|
const et = class et extends X {
|
|
3778
3789
|
constructor() {
|
|
3779
3790
|
super(...arguments), this.styleElement = null, this.beforePrintHandler = null, this.configApplied = !1;
|
|
@@ -3811,13 +3822,13 @@ const et = class et extends X {
|
|
|
3811
3822
|
}
|
|
3812
3823
|
};
|
|
3813
3824
|
et.moduleName = "print_protection";
|
|
3814
|
-
let
|
|
3815
|
-
const
|
|
3825
|
+
let Rt = et;
|
|
3826
|
+
const bi = [
|
|
3816
3827
|
"fixed_setup",
|
|
3817
3828
|
"decorator",
|
|
3818
3829
|
"peripherals",
|
|
3819
3830
|
"print_protection"
|
|
3820
|
-
],
|
|
3831
|
+
], wi = [
|
|
3821
3832
|
"reflowable_setup",
|
|
3822
3833
|
"decorator",
|
|
3823
3834
|
"peripherals",
|
|
@@ -3830,25 +3841,25 @@ const yi = [
|
|
|
3830
3841
|
"decorator",
|
|
3831
3842
|
"peripherals",
|
|
3832
3843
|
"print_protection"
|
|
3833
|
-
],
|
|
3844
|
+
], ye = new Map([
|
|
3834
3845
|
// All modules go here
|
|
3835
|
-
Nt,
|
|
3836
|
-
Pt,
|
|
3837
3846
|
Lt,
|
|
3838
|
-
|
|
3847
|
+
Nt,
|
|
3848
|
+
Ot,
|
|
3839
3849
|
Tt,
|
|
3840
|
-
|
|
3850
|
+
Pt,
|
|
3841
3851
|
At,
|
|
3842
3852
|
Ct,
|
|
3843
|
-
|
|
3853
|
+
xt,
|
|
3854
|
+
Rt
|
|
3844
3855
|
].map((r) => [r.moduleName, r]));
|
|
3845
|
-
class
|
|
3856
|
+
class Si {
|
|
3846
3857
|
/**
|
|
3847
3858
|
* @param wnd Window instance to operate on
|
|
3848
3859
|
* @param initialModules List of initial modules to load
|
|
3849
3860
|
*/
|
|
3850
3861
|
constructor(t = window, e = []) {
|
|
3851
|
-
this.loadedModules = [], this.wnd = t, this.comms = new
|
|
3862
|
+
this.loadedModules = [], this.wnd = t, this.comms = new Me(t);
|
|
3852
3863
|
const i = [...new Set(e)];
|
|
3853
3864
|
if (i.length) {
|
|
3854
3865
|
if (typeof t > "u")
|
|
@@ -3861,7 +3872,7 @@ class wi {
|
|
|
3861
3872
|
}
|
|
3862
3873
|
}
|
|
3863
3874
|
loadModule(t) {
|
|
3864
|
-
const e =
|
|
3875
|
+
const e = ye.get(t);
|
|
3865
3876
|
return e === void 0 ? (this.comms.log(`Module "${name}" does not exist in the library`), e) : new e();
|
|
3866
3877
|
}
|
|
3867
3878
|
/**
|
|
@@ -3879,7 +3890,7 @@ class wi {
|
|
|
3879
3890
|
* @returns Success
|
|
3880
3891
|
*/
|
|
3881
3892
|
removeModule(t) {
|
|
3882
|
-
const e =
|
|
3893
|
+
const e = ye.get(t);
|
|
3883
3894
|
if (e === void 0)
|
|
3884
3895
|
return this.comms.log(`Module "${t}" does not exist in the library`), !1;
|
|
3885
3896
|
const i = this.loadedModules.findIndex((s) => s instanceof e);
|
|
@@ -3892,7 +3903,7 @@ class wi {
|
|
|
3892
3903
|
this.comms.destroy(), this.loadedModules.forEach((t) => t.unmount(this.wnd, this.comms)), this.loadedModules = [];
|
|
3893
3904
|
}
|
|
3894
3905
|
}
|
|
3895
|
-
const
|
|
3906
|
+
const Ei = {
|
|
3896
3907
|
type: "developer_tools",
|
|
3897
3908
|
keyCombos: [
|
|
3898
3909
|
{ keyCode: 73, meta: !0, alt: !0 },
|
|
@@ -3916,7 +3927,7 @@ const Si = {
|
|
|
3916
3927
|
{ keyCode: 123, meta: !0, alt: !0 }
|
|
3917
3928
|
// F12+Meta+Alt
|
|
3918
3929
|
]
|
|
3919
|
-
},
|
|
3930
|
+
}, Ai = {
|
|
3920
3931
|
type: "select_all",
|
|
3921
3932
|
keyCombos: [
|
|
3922
3933
|
{ keyCode: 65, meta: !0 },
|
|
@@ -3924,7 +3935,7 @@ const Si = {
|
|
|
3924
3935
|
{ keyCode: 65, ctrl: !0 }
|
|
3925
3936
|
// A key (Ctrl+A)
|
|
3926
3937
|
]
|
|
3927
|
-
},
|
|
3938
|
+
}, Ci = {
|
|
3928
3939
|
type: "print",
|
|
3929
3940
|
keyCombos: [
|
|
3930
3941
|
{ keyCode: 80, meta: !0 },
|
|
@@ -3940,7 +3951,7 @@ const Si = {
|
|
|
3940
3951
|
{ keyCode: 80, ctrl: !0, alt: !0 }
|
|
3941
3952
|
// P key (Ctrl+Alt+P)
|
|
3942
3953
|
]
|
|
3943
|
-
},
|
|
3954
|
+
}, xi = {
|
|
3944
3955
|
type: "save",
|
|
3945
3956
|
keyCombos: [
|
|
3946
3957
|
{ keyCode: 83, meta: !0 },
|
|
@@ -3950,26 +3961,26 @@ const Si = {
|
|
|
3950
3961
|
]
|
|
3951
3962
|
};
|
|
3952
3963
|
export {
|
|
3953
|
-
|
|
3964
|
+
fi as BulkCopyProtector,
|
|
3954
3965
|
K as COMMS_VERSION,
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3966
|
+
Me as Comms,
|
|
3967
|
+
Ei as DEV_TOOLS,
|
|
3968
|
+
At as Decorator,
|
|
3969
|
+
bi as FXLModules,
|
|
3970
|
+
yi as KeyCombinationManager,
|
|
3971
|
+
ni as Layout,
|
|
3972
|
+
Si as Loader,
|
|
3962
3973
|
X as Module,
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3974
|
+
ye as ModuleLibrary,
|
|
3975
|
+
Ci as PRINT,
|
|
3976
|
+
Ht as PatternAnalyzer,
|
|
3977
|
+
Pt as Peripherals,
|
|
3978
|
+
Rt as PrintProtector,
|
|
3979
|
+
wi as ReflowableModules,
|
|
3980
|
+
xi as SAVE,
|
|
3981
|
+
Ai as SELECT_ALL,
|
|
3982
|
+
gi as SelectionAnalyzer,
|
|
3972
3983
|
vi as WebPubModules,
|
|
3973
|
-
|
|
3974
|
-
|
|
3984
|
+
si as Width,
|
|
3985
|
+
ze as mid
|
|
3975
3986
|
};
|