@readium/shared 2.2.1 → 2.2.3
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 +511 -490
- package/dist/index.umd.cjs +3 -3
- package/package.json +1 -1
- package/src/opds/Acquisition.ts +1 -1
- package/src/opds/Availability.ts +1 -1
- package/src/opds/Copies.ts +1 -1
- package/src/opds/Holds.ts +1 -1
- package/src/opds/Price.ts +1 -1
- package/src/publication/Publication.ts +0 -2
- package/src/publication/html/Locations.ts +4 -4
- package/src/publication/opds/Properties.ts +2 -2
- package/src/publication/services/timeline/Timeline.ts +9 -9
- package/src/util/index.ts +1 -0
- package/src/util/npt.ts +51 -0
- package/types/src/opds/Acquisition.d.ts +1 -1
- package/types/src/opds/Availability.d.ts +1 -1
- package/types/src/opds/Copies.d.ts +1 -1
- package/types/src/opds/Holds.d.ts +1 -1
- package/types/src/opds/Price.d.ts +1 -1
- package/types/src/publication/Publication.d.ts +0 -1
- package/types/src/publication/opds/Properties.d.ts +1 -1
- package/types/src/publication/services/timeline/Timeline.d.ts +2 -3
- package/types/src/util/index.d.ts +1 -0
- package/types/src/util/npt.d.ts +20 -0
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class
|
|
1
|
+
class ii {
|
|
2
2
|
close() {
|
|
3
3
|
}
|
|
4
4
|
links() {
|
|
@@ -8,7 +8,7 @@ class ei {
|
|
|
8
8
|
throw Error("This is an empty fetcher");
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
class
|
|
11
|
+
class rr {
|
|
12
12
|
constructor(t, e) {
|
|
13
13
|
this.client = t || window.fetch.bind(window), this.baseUrl = e;
|
|
14
14
|
}
|
|
@@ -19,12 +19,12 @@ class ir {
|
|
|
19
19
|
const e = t.toURL(this.baseUrl);
|
|
20
20
|
if (e === void 0)
|
|
21
21
|
throw Error(`Invalid HREF: ${t.href}`);
|
|
22
|
-
return new
|
|
22
|
+
return new si(this.client, t, e);
|
|
23
23
|
}
|
|
24
24
|
close() {
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
class
|
|
27
|
+
class si {
|
|
28
28
|
constructor(t, e, i) {
|
|
29
29
|
this.client = t || window.fetch.bind(window), this._link = e, this.url = i;
|
|
30
30
|
}
|
|
@@ -88,12 +88,12 @@ class ii {
|
|
|
88
88
|
);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
class
|
|
91
|
+
class nr {
|
|
92
92
|
constructor(t, e) {
|
|
93
93
|
this.start = t, this.endInclusive = e;
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
class
|
|
96
|
+
class ar {
|
|
97
97
|
readAsString() {
|
|
98
98
|
return this.read().then((t) => t === void 0 ? t : new TextDecoder().decode(t));
|
|
99
99
|
}
|
|
@@ -115,14 +115,14 @@ class V {
|
|
|
115
115
|
if (!t || typeof t != "object") return;
|
|
116
116
|
const e = t;
|
|
117
117
|
return new V({
|
|
118
|
-
conformsTo: e.conformsTo ? e.conformsTo.map((i) =>
|
|
119
|
-
certification: e.certification ?
|
|
118
|
+
conformsTo: e.conformsTo ? e.conformsTo.map((i) => xt.deserialize(i)).filter((i) => i !== void 0) : void 0,
|
|
119
|
+
certification: e.certification ? Dt.deserialize(e.certification) : void 0,
|
|
120
120
|
summary: e.summary,
|
|
121
121
|
accessMode: e.accessMode ? e.accessMode.map((i) => R.deserialize(i)).filter((i) => i !== void 0) : void 0,
|
|
122
|
-
accessModeSufficient: e.accessModeSufficient ? e.accessModeSufficient.map((i) =>
|
|
122
|
+
accessModeSufficient: e.accessModeSufficient ? e.accessModeSufficient.map((i) => Nt.deserialize(i)).filter((i) => i !== void 0) : void 0,
|
|
123
123
|
feature: e.feature ? e.feature.map((i) => v.deserialize(i)).filter((i) => i !== void 0) : void 0,
|
|
124
124
|
hazard: e.hazard ? e.hazard.map((i) => P.deserialize(i)).filter((i) => i !== void 0) : void 0,
|
|
125
|
-
exemption: e.exemption ? e.exemption.map((i) =>
|
|
125
|
+
exemption: e.exemption ? e.exemption.map((i) => Ot.deserialize(i)).filter((i) => i !== void 0) : void 0
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
128
|
/**
|
|
@@ -170,8 +170,8 @@ const b = class b {
|
|
|
170
170
|
}
|
|
171
171
|
};
|
|
172
172
|
b.EPUB_A11Y_10_WCAG_20_A = new b("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-a"), b.EPUB_A11Y_10_WCAG_20_AA = new b("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-aa"), b.EPUB_A11Y_10_WCAG_20_AAA = new b("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-aaa"), b.EPUB_A11Y_11_WCAG_20_A = new b("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-a"), b.EPUB_A11Y_11_WCAG_20_AA = new b("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-aa"), b.EPUB_A11Y_11_WCAG_20_AAA = new b("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-aaa"), b.EPUB_A11Y_11_WCAG_21_A = new b("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-a"), b.EPUB_A11Y_11_WCAG_21_AA = new b("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-aa"), b.EPUB_A11Y_11_WCAG_21_AAA = new b("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-aaa"), b.EPUB_A11Y_11_WCAG_22_A = new b("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-a"), b.EPUB_A11Y_11_WCAG_22_AA = new b("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-aa"), b.EPUB_A11Y_11_WCAG_22_AAA = new b("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-aaa");
|
|
173
|
-
let
|
|
174
|
-
class
|
|
173
|
+
let xt = b;
|
|
174
|
+
class Dt {
|
|
175
175
|
constructor(t = null, e = null, i = null) {
|
|
176
176
|
this.certifiedBy = t, this.credential = e, this.report = i;
|
|
177
177
|
}
|
|
@@ -180,7 +180,7 @@ class Pt {
|
|
|
180
180
|
*/
|
|
181
181
|
static deserialize(t) {
|
|
182
182
|
if (!(!t || typeof t != "object"))
|
|
183
|
-
return new
|
|
183
|
+
return new Dt(
|
|
184
184
|
t.certifiedBy,
|
|
185
185
|
t.credential,
|
|
186
186
|
t.report
|
|
@@ -249,7 +249,7 @@ const N = class N {
|
|
|
249
249
|
}
|
|
250
250
|
};
|
|
251
251
|
N.VALID_MODES = /* @__PURE__ */ new Set(["auditory", "tactile", "textual", "visual"]), N.AUDITORY = new N("auditory"), N.TACTILE = new N("tactile"), N.TEXTUAL = new N("textual"), N.VISUAL = new N("visual");
|
|
252
|
-
let
|
|
252
|
+
let Nt = N;
|
|
253
253
|
const h = class h {
|
|
254
254
|
constructor(t) {
|
|
255
255
|
this.value = t;
|
|
@@ -309,10 +309,10 @@ const S = class S {
|
|
|
309
309
|
}
|
|
310
310
|
};
|
|
311
311
|
S.NONE = new S("none"), S.DOCUMENTED = new S("documented"), S.LEGAL = new S("legal"), S.TEMPORARY = new S("temporary"), S.TECHNICAL = new S("technical"), S.EAA_DISPROPORTIONATE_BURDEN = new S("eaa-disproportionate-burden"), S.EAA_FUNDAMENTAL_ALTERATION = new S("eaa-fundamental-alteration"), S.EAA_MICROENTERPRISE = new S("eaa-microenterprise"), S.EAA_TECHNICAL_IMPOSSIBILITY = new S("eaa-technical-impossibility"), S.EAA_TEMPORARY = new S("eaa-temporary");
|
|
312
|
-
let
|
|
313
|
-
const ie = ["en", "ar", "da", "fr", "it", "pt_PT", "sv"], si = /* @__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"}}`), ri = {
|
|
314
|
-
publication:
|
|
315
|
-
},
|
|
312
|
+
let Ot = S;
|
|
313
|
+
const se = ["en", "ar", "da", "fr", "it", "pt_PT", "sv"], ri = /* @__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"}}`), ni = {
|
|
314
|
+
publication: ri
|
|
315
|
+
}, re = {
|
|
316
316
|
fr: () => import("./fr-C5HEel98.js"),
|
|
317
317
|
ar: () => import("./ar-DyHX_uy2.js"),
|
|
318
318
|
da: () => import("./da-Dct0PS3E.js"),
|
|
@@ -323,10 +323,10 @@ const ie = ["en", "ar", "da", "fr", "it", "pt_PT", "sv"], si = /* @__PURE__ */ J
|
|
|
323
323
|
sv: () => import("./sv-BfzAFsVN.js")
|
|
324
324
|
// 'tr': () => import('@edrlab/thorium-locales/publication-metadata/tr.json'),
|
|
325
325
|
// 'uk': () => import('@edrlab/thorium-locales/publication-metadata/uk.json')
|
|
326
|
-
},
|
|
326
|
+
}, ne = ni?.publication?.metadata?.accessibility?.["display-guide"] || {};
|
|
327
327
|
class $ {
|
|
328
328
|
constructor() {
|
|
329
|
-
this.currentLocaleCode = "en", this.locale =
|
|
329
|
+
this.currentLocaleCode = "en", this.locale = ne, this.loadedLocales = {}, this.loadedLocales.en = ne;
|
|
330
330
|
}
|
|
331
331
|
static getInstance() {
|
|
332
332
|
return $.instance || ($.instance = new $()), $.instance;
|
|
@@ -337,14 +337,14 @@ class $ {
|
|
|
337
337
|
* @returns Promise indicating if the locale was loaded successfully
|
|
338
338
|
*/
|
|
339
339
|
async loadLocale(t) {
|
|
340
|
-
if (!
|
|
340
|
+
if (!se.includes(t))
|
|
341
341
|
return console.warn(`Locale '${t}' is not enabled`), !1;
|
|
342
342
|
if (t in this.loadedLocales)
|
|
343
343
|
return !0;
|
|
344
344
|
try {
|
|
345
|
-
if (!(t in
|
|
345
|
+
if (!(t in re))
|
|
346
346
|
return console.warn(`Locale file not found for: ${t}`), !1;
|
|
347
|
-
const r = (await
|
|
347
|
+
const r = (await re[t]()).default?.publication?.metadata?.accessibility?.["display-guide"];
|
|
348
348
|
return r ? (this.loadedLocales[t] = r, !0) : (console.warn(`No accessibility strings found in locale ${t}`), !1);
|
|
349
349
|
} catch (e) {
|
|
350
350
|
return console.warn(`Failed to load locale ${t}:`, e), !1;
|
|
@@ -378,7 +378,7 @@ class $ {
|
|
|
378
378
|
* Gets a list of available locale codes
|
|
379
379
|
*/
|
|
380
380
|
getAvailableLocales() {
|
|
381
|
-
return
|
|
381
|
+
return se;
|
|
382
382
|
}
|
|
383
383
|
getNestedValue(t, e) {
|
|
384
384
|
const i = e.split(".");
|
|
@@ -401,8 +401,8 @@ class $ {
|
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
403
|
const f = $.getInstance();
|
|
404
|
-
var K = /* @__PURE__ */ ((s) => (s.reflowable = "reflowable", s.fixed = "fixed", s.scrolled = "scrolled", s))(K || {}),
|
|
405
|
-
class
|
|
404
|
+
var K = /* @__PURE__ */ ((s) => (s.reflowable = "reflowable", s.fixed = "fixed", s.scrolled = "scrolled", s))(K || {}), ai = /* @__PURE__ */ ((s) => (s.Unknown = "unknown", s.Modifiable = "modifiable", s.Unmodifiable = "unmodifiable", s))(ai || {}), oi = /* @__PURE__ */ ((s) => (s.NoMetadata = "noMetadata", s.Readable = "readable", s.NotFully = "notFully", s.Unreadable = "unreadable", s))(oi || {}), ci = /* @__PURE__ */ ((s) => (s.NoMetadata = "noMetadata", s.Synchronized = "synchronized", s.AudioOnly = "audioOnly", s.AudioComplementary = "audioComplementary", s))(ci || {});
|
|
405
|
+
class Ut {
|
|
406
406
|
constructor(t = "unknown", e = "noMetadata", i = !1, r = "noMetadata") {
|
|
407
407
|
this.id = "ways-of-reading.title", this.visualAdjustments = t, this.nonvisualReading = e, this.nonvisualReadingAltText = i, this.prerecordedAudio = r, this.shouldDisplay = !0;
|
|
408
408
|
const n = f.getString(this.id);
|
|
@@ -456,7 +456,7 @@ class Dt {
|
|
|
456
456
|
const I = d.value;
|
|
457
457
|
return Array.isArray(I) ? I.some((G) => G === R.AUDITORY.value) : I === R.AUDITORY.value;
|
|
458
458
|
}) ? "audioOnly" : a.some((d) => d.value === R.AUDITORY.value) ? "audioComplementary" : "noMetadata";
|
|
459
|
-
return new
|
|
459
|
+
return new Ut(
|
|
460
460
|
n,
|
|
461
461
|
g,
|
|
462
462
|
A,
|
|
@@ -464,7 +464,7 @@ class Dt {
|
|
|
464
464
|
);
|
|
465
465
|
}
|
|
466
466
|
}
|
|
467
|
-
class
|
|
467
|
+
class Mt {
|
|
468
468
|
constructor(t = !1, e = !1, i = !1, r = !1) {
|
|
469
469
|
this.id = "navigation.title", this.tableOfContents = t, this.index = e, this.headings = i, this.page = r, this.noMetadata = !t && !e && !i && !r;
|
|
470
470
|
const n = f.getString(this.id);
|
|
@@ -511,7 +511,7 @@ class Ut {
|
|
|
511
511
|
}
|
|
512
512
|
static fromPublication(t) {
|
|
513
513
|
const i = (t.metadata.accessibility ?? new V()).feature ?? [];
|
|
514
|
-
return new
|
|
514
|
+
return new Mt(
|
|
515
515
|
i.some((r) => r.value === v.TABLE_OF_CONTENTS.value),
|
|
516
516
|
i.some((r) => r.value === v.INDEX.value),
|
|
517
517
|
i.some((r) => r.value === v.STRUCTURAL_NAVIGATION.value),
|
|
@@ -519,8 +519,8 @@ class Ut {
|
|
|
519
519
|
);
|
|
520
520
|
}
|
|
521
521
|
}
|
|
522
|
-
var
|
|
523
|
-
class
|
|
522
|
+
var li = /* @__PURE__ */ ((s) => (s.Math = "math", s.Chemistry = "chemistry", s.Music = "music", s.Diagram = "diagram", s.Chart = "chart", s.Graph = "graph", s.Table = "table", s.Image = "image", s))(li || {});
|
|
523
|
+
class Bt {
|
|
524
524
|
constructor(t = !1, e = !1, i = !1, r = !1, n = !1, a = !1, o = !1, l = !1, p = !1) {
|
|
525
525
|
this.id = "rich-content.title", this.extendedAltTextDescriptions = t, this.mathFormula = e, this.mathFormulaAsMathML = i, this.mathFormulaAsLaTeX = r, this.chemicalFormulaAsMathML = n, this.chemicalFormulaAsLaTeX = a, this.closedCaptions = o, this.openCaptions = l, this.transcript = p, this.noMetadata = !t && !e && !i && !r && !n && !a && !o && !l && !p, this.shouldDisplay = !this.noMetadata;
|
|
526
526
|
const m = f.getString(this.id);
|
|
@@ -607,7 +607,7 @@ class Mt {
|
|
|
607
607
|
}
|
|
608
608
|
static fromPublication(t) {
|
|
609
609
|
const i = (t.metadata.accessibility ?? new V()).feature ?? [];
|
|
610
|
-
return new
|
|
610
|
+
return new Bt(
|
|
611
611
|
i.some((r) => r.value === v.LONG_DESCRIPTION.value),
|
|
612
612
|
i.some((r) => r.value === v.DESCRIBED_MATH.value),
|
|
613
613
|
i.some((r) => r.value === v.MATH_ML.value),
|
|
@@ -620,7 +620,7 @@ class Mt {
|
|
|
620
620
|
);
|
|
621
621
|
}
|
|
622
622
|
}
|
|
623
|
-
class
|
|
623
|
+
class Gt {
|
|
624
624
|
constructor(t = !1, e = !1, i = !1, r = !1, n = !1, a = !1, o = !1, l = !1, p = !1, m = !1, u = !1, g = !1, A = !1) {
|
|
625
625
|
this.id = "additional-accessibility-information.title", this.pageBreakMarkers = t, this.aria = e, this.audioDescriptions = i, this.braille = r, this.rubyAnnotations = n, this.fullRubyAnnotations = a, this.highAudioContrast = o, this.highDisplayContrast = l, this.largePrint = p, this.signLanguage = m, this.tactileGraphics = u, this.tactileObjects = g, this.textToSpeechHinting = A, this.noMetadata = !t && !e && !i && !r && !n && !a && !o && !l && !p && !m && !u && !g && !A, this.shouldDisplay = !this.noMetadata;
|
|
626
626
|
const k = f.getString(this.id);
|
|
@@ -731,7 +731,7 @@ class Bt {
|
|
|
731
731
|
}
|
|
732
732
|
static fromPublication(t) {
|
|
733
733
|
const i = (t.metadata.accessibility ?? new V()).feature ?? [];
|
|
734
|
-
return new
|
|
734
|
+
return new Gt(
|
|
735
735
|
i.some((r) => r.value === v.PAGE_BREAK_MARKERS.value || r.value === v.PRINT_PAGE_NUMBERS.value),
|
|
736
736
|
i.some((r) => r.value === v.ARIA.value),
|
|
737
737
|
i.some((r) => r.value === v.AUDIO_DESCRIPTION.value),
|
|
@@ -748,8 +748,8 @@ class Bt {
|
|
|
748
748
|
);
|
|
749
749
|
}
|
|
750
750
|
}
|
|
751
|
-
var
|
|
752
|
-
class
|
|
751
|
+
var hi = /* @__PURE__ */ ((s) => (s.yes = "yes", s.no = "no", s.unknown = "unknown", s.noMetadata = "noMetadata", s))(hi || {});
|
|
752
|
+
class Wt {
|
|
753
753
|
constructor(t = "unknown", e = "unknown", i = "unknown") {
|
|
754
754
|
this.id = "hazards.title", this.flashing = t, this.motion = e, this.sound = i;
|
|
755
755
|
const r = f.getString(this.id);
|
|
@@ -852,10 +852,10 @@ class Gt {
|
|
|
852
852
|
let n;
|
|
853
853
|
e.some((o) => o.value === P.MOTION_SIMULATION.value) ? n = "yes" : e.some((o) => o.value === P.NO_MOTION_SIMULATION_HAZARD.value) ? n = "no" : e.some((o) => o.value === P.UNKNOWN_MOTION_SIMULATION_HAZARD.value) ? n = "unknown" : n = i;
|
|
854
854
|
let a;
|
|
855
|
-
return e.some((o) => o.value === P.SOUND.value) ? a = "yes" : e.some((o) => o.value === P.NO_SOUND_HAZARD.value) ? a = "no" : e.some((o) => o.value === P.UNKNOWN_SOUND_HAZARD.value) ? a = "unknown" : a = i, new
|
|
855
|
+
return e.some((o) => o.value === P.SOUND.value) ? a = "yes" : e.some((o) => o.value === P.NO_SOUND_HAZARD.value) ? a = "no" : e.some((o) => o.value === P.UNKNOWN_SOUND_HAZARD.value) ? a = "unknown" : a = i, new Wt(r, n, a);
|
|
856
856
|
}
|
|
857
857
|
}
|
|
858
|
-
class
|
|
858
|
+
class Ht {
|
|
859
859
|
constructor(t = []) {
|
|
860
860
|
this.id = "conformance.title", this.profiles = t, this.shouldDisplay = !0;
|
|
861
861
|
const e = f.getString(this.id);
|
|
@@ -900,10 +900,10 @@ class Wt {
|
|
|
900
900
|
}
|
|
901
901
|
static fromPublication(t) {
|
|
902
902
|
const e = t.metadata.accessibility?.conformsTo ?? [];
|
|
903
|
-
return new
|
|
903
|
+
return new Ht(e);
|
|
904
904
|
}
|
|
905
905
|
}
|
|
906
|
-
class
|
|
906
|
+
class Ft {
|
|
907
907
|
constructor(t = !1) {
|
|
908
908
|
this.id = "legal-considerations.title", this.exemption = t, this.shouldDisplay = this.exemption;
|
|
909
909
|
const e = f.getString(this.id);
|
|
@@ -925,10 +925,10 @@ class Ht {
|
|
|
925
925
|
}
|
|
926
926
|
static fromPublication(t) {
|
|
927
927
|
const i = (t.metadata.accessibility?.exemption ?? []).length > 0;
|
|
928
|
-
return new
|
|
928
|
+
return new Ft(i);
|
|
929
929
|
}
|
|
930
930
|
}
|
|
931
|
-
class
|
|
931
|
+
class _t {
|
|
932
932
|
constructor(t) {
|
|
933
933
|
this.id = "accessibility-summary.title", this.shouldDisplay = !0;
|
|
934
934
|
const e = f.getString(this.id);
|
|
@@ -950,12 +950,12 @@ class Ft {
|
|
|
950
950
|
}
|
|
951
951
|
}
|
|
952
952
|
static fromPublication(t) {
|
|
953
|
-
return new
|
|
953
|
+
return new _t(t);
|
|
954
954
|
}
|
|
955
955
|
}
|
|
956
|
-
class
|
|
956
|
+
class or {
|
|
957
957
|
constructor(t) {
|
|
958
|
-
this.waysOfReading =
|
|
958
|
+
this.waysOfReading = Ut.fromPublication(t), this.navigation = Mt.fromPublication(t), this.richContent = Bt.fromPublication(t), this.additionalInformation = Gt.fromPublication(t), this.hazards = Wt.fromPublication(t), this.conformance = Ht.fromPublication(t), this.legal = Ft.fromPublication(t), this.accessibilitySummary = _t.fromPublication(t), this.fields = [
|
|
959
959
|
this.waysOfReading,
|
|
960
960
|
this.navigation,
|
|
961
961
|
this.richContent,
|
|
@@ -967,7 +967,7 @@ class nr {
|
|
|
967
967
|
];
|
|
968
968
|
}
|
|
969
969
|
}
|
|
970
|
-
class
|
|
970
|
+
class Vt {
|
|
971
971
|
/**
|
|
972
972
|
* Creates a [Encryption].
|
|
973
973
|
*/
|
|
@@ -979,7 +979,7 @@ class _t {
|
|
|
979
979
|
*/
|
|
980
980
|
static deserialize(t) {
|
|
981
981
|
if (t && t.algorithm)
|
|
982
|
-
return new
|
|
982
|
+
return new Vt({
|
|
983
983
|
algorithm: t.algorithm,
|
|
984
984
|
compression: t.compression,
|
|
985
985
|
originalLength: t.originalLength,
|
|
@@ -995,7 +995,7 @@ class _t {
|
|
|
995
995
|
return this.compression !== void 0 && (t.compression = this.compression), this.originalLength !== void 0 && (t.originalLength = this.originalLength), this.profile !== void 0 && (t.profile = this.profile), this.scheme !== void 0 && (t.scheme = this.scheme), t;
|
|
996
996
|
}
|
|
997
997
|
}
|
|
998
|
-
var
|
|
998
|
+
var Lt = /* @__PURE__ */ ((s) => (s.left = "left", s.right = "right", s.center = "center", s))(Lt || {});
|
|
999
999
|
class U {
|
|
1000
1000
|
constructor(t) {
|
|
1001
1001
|
this.otherProperties = t;
|
|
@@ -1028,10 +1028,10 @@ class U {
|
|
|
1028
1028
|
}
|
|
1029
1029
|
Object.defineProperty(U.prototype, "encryption", {
|
|
1030
1030
|
get: function() {
|
|
1031
|
-
return
|
|
1031
|
+
return Vt.deserialize(this.otherProperties.encrypted);
|
|
1032
1032
|
}
|
|
1033
1033
|
});
|
|
1034
|
-
class
|
|
1034
|
+
class Yt {
|
|
1035
1035
|
/** Creates a MediaOverlay object */
|
|
1036
1036
|
constructor(t) {
|
|
1037
1037
|
this.activeClass = t.activeClass, this.playbackActiveClass = t.playbackActiveClass;
|
|
@@ -1041,7 +1041,7 @@ class Vt {
|
|
|
1041
1041
|
*/
|
|
1042
1042
|
static deserialize(t) {
|
|
1043
1043
|
if (t)
|
|
1044
|
-
return new
|
|
1044
|
+
return new Yt({
|
|
1045
1045
|
activeClass: t.activeClass,
|
|
1046
1046
|
playbackActiveClass: t.playbackActiveClass
|
|
1047
1047
|
});
|
|
@@ -1054,11 +1054,11 @@ class Vt {
|
|
|
1054
1054
|
return this.activeClass && (t.activeClass = this.activeClass), this.playbackActiveClass && (t.playbackActiveClass = this.playbackActiveClass), t;
|
|
1055
1055
|
}
|
|
1056
1056
|
}
|
|
1057
|
-
function
|
|
1057
|
+
function ui(s) {
|
|
1058
1058
|
return s && Array.isArray(s) ? s : void 0;
|
|
1059
1059
|
}
|
|
1060
1060
|
function _(s) {
|
|
1061
|
-
return s && typeof s == "string" ? [s] :
|
|
1061
|
+
return s && typeof s == "string" ? [s] : ui(s);
|
|
1062
1062
|
}
|
|
1063
1063
|
function lt(s) {
|
|
1064
1064
|
return typeof s == "string" ? new Date(s) : void 0;
|
|
@@ -2005,8 +2005,8 @@ class Q {
|
|
|
2005
2005
|
}
|
|
2006
2006
|
}
|
|
2007
2007
|
var q = /* @__PURE__ */ ((s) => (s.EPUB = "https://readium.org/webpub-manifest/profiles/epub", s.AUDIOBOOK = "https://readium.org/webpub-manifest/profiles/audiobook", s.DIVINA = "https://readium.org/webpub-manifest/profiles/divina", s.PDF = "https://readium.org/webpub-manifest/profiles/pdf", s))(q || {}), F = /* @__PURE__ */ ((s) => (s.ltr = "ltr", s.rtl = "rtl", s))(F || {});
|
|
2008
|
-
function
|
|
2009
|
-
return s === "rtl" ?
|
|
2008
|
+
function cr(s) {
|
|
2009
|
+
return s === "rtl" ? Lt.right : Lt.left;
|
|
2010
2010
|
}
|
|
2011
2011
|
class ft {
|
|
2012
2012
|
/** Creates a [Subject]. */
|
|
@@ -2038,7 +2038,7 @@ class ft {
|
|
|
2038
2038
|
return this.sortAs !== void 0 && (t.sortAs = this.sortAs.serialize()), this.code !== void 0 && (t.code = this.code), this.scheme !== void 0 && (t.scheme = this.scheme), this.links && (t.links = this.links.serialize()), t;
|
|
2039
2039
|
}
|
|
2040
2040
|
}
|
|
2041
|
-
class
|
|
2041
|
+
class $t {
|
|
2042
2042
|
/** Creates an Array of [Subject]. */
|
|
2043
2043
|
constructor(t) {
|
|
2044
2044
|
this.items = t;
|
|
@@ -2049,7 +2049,7 @@ class Yt {
|
|
|
2049
2049
|
static deserialize(t) {
|
|
2050
2050
|
if (!t) return;
|
|
2051
2051
|
const e = Array.isArray(t) ? t : [t];
|
|
2052
|
-
return new
|
|
2052
|
+
return new $t(
|
|
2053
2053
|
e.map((i) => ft.deserialize(i)).filter((i) => i !== void 0)
|
|
2054
2054
|
);
|
|
2055
2055
|
}
|
|
@@ -2060,8 +2060,8 @@ class Yt {
|
|
|
2060
2060
|
return this.items.map((t) => t.serialize());
|
|
2061
2061
|
}
|
|
2062
2062
|
}
|
|
2063
|
-
var
|
|
2064
|
-
class
|
|
2063
|
+
var di = /* @__PURE__ */ ((s) => (s.all = "all", s.none = "none", s))(di || {});
|
|
2064
|
+
class Kt {
|
|
2065
2065
|
/** Creates a [TDM] object */
|
|
2066
2066
|
constructor(t) {
|
|
2067
2067
|
this.reservation = t.reservation, this.policy = t.policy;
|
|
@@ -2071,7 +2071,7 @@ class $t {
|
|
|
2071
2071
|
*/
|
|
2072
2072
|
static deserialize(t) {
|
|
2073
2073
|
if (t)
|
|
2074
|
-
return new
|
|
2074
|
+
return new Kt({
|
|
2075
2075
|
reservation: t.reservation,
|
|
2076
2076
|
policy: t.policy
|
|
2077
2077
|
});
|
|
@@ -2096,9 +2096,9 @@ const et = class et {
|
|
|
2096
2096
|
*/
|
|
2097
2097
|
static deserialize(t) {
|
|
2098
2098
|
if (!(t && t.title)) return;
|
|
2099
|
-
const e = B.deserialize(t.title), i = t["@type"], r = _(t.conformsTo), n = t.identifier, a = J.deserialize(t.altIdentifier), o = B.deserialize(t.subtitle), l = B.deserialize(t.sortAs), p = O.deserialize(t.artist), m = O.deserialize(t.author), u = O.deserialize(t.colorist), g = O.deserialize(t.contributor), A = O.deserialize(t.editor), k = O.deserialize(t.illustrator), d = O.deserialize(t.inker), I = O.deserialize(t.letterer), G = O.deserialize(t.narrator),
|
|
2099
|
+
const e = B.deserialize(t.title), i = t["@type"], r = _(t.conformsTo), n = t.identifier, a = J.deserialize(t.altIdentifier), o = B.deserialize(t.subtitle), l = B.deserialize(t.sortAs), p = O.deserialize(t.artist), m = O.deserialize(t.author), u = O.deserialize(t.colorist), g = O.deserialize(t.contributor), A = O.deserialize(t.editor), k = O.deserialize(t.illustrator), d = O.deserialize(t.inker), I = O.deserialize(t.letterer), G = O.deserialize(t.narrator), Ge = O.deserialize(t.penciler), We = O.deserialize(t.translator), He = _(t.language), Fe = t.description, _e = O.deserialize(t.publisher), Ve = O.deserialize(t.imprint), Ye = lt(t.published), $e = lt(t.modified), Ke = $t.deserialize(t.subject), Xe = Q.deserialize(t.belongsTo), Ze = V.deserialize(t.accessibility), Je = t.layout, qe = t.readingProgression, Qe = L(t.duration), je = L(t.numberOfPages), ti = Kt.deserialize(t.tdm);
|
|
2100
2100
|
let ot = Object.assign({}, t);
|
|
2101
|
-
return et.mappedProperties.forEach((
|
|
2101
|
+
return et.mappedProperties.forEach((ei) => delete ot[ei]), Object.keys(ot).length === 0 && (ot = void 0), new et({
|
|
2102
2102
|
title: e,
|
|
2103
2103
|
typeUri: i,
|
|
2104
2104
|
conformsTo: r,
|
|
@@ -2115,22 +2115,22 @@ const et = class et {
|
|
|
2115
2115
|
inkers: d,
|
|
2116
2116
|
letterers: I,
|
|
2117
2117
|
narrators: G,
|
|
2118
|
-
pencilers:
|
|
2119
|
-
translators:
|
|
2120
|
-
languages:
|
|
2121
|
-
description:
|
|
2122
|
-
publishers:
|
|
2123
|
-
imprints:
|
|
2124
|
-
published:
|
|
2125
|
-
modified:
|
|
2126
|
-
subjects:
|
|
2127
|
-
belongsTo:
|
|
2128
|
-
layout:
|
|
2129
|
-
readingProgression:
|
|
2130
|
-
duration:
|
|
2131
|
-
numberOfPages:
|
|
2132
|
-
accessibility:
|
|
2133
|
-
tdm:
|
|
2118
|
+
pencilers: Ge,
|
|
2119
|
+
translators: We,
|
|
2120
|
+
languages: He,
|
|
2121
|
+
description: Fe,
|
|
2122
|
+
publishers: _e,
|
|
2123
|
+
imprints: Ve,
|
|
2124
|
+
published: Ye,
|
|
2125
|
+
modified: $e,
|
|
2126
|
+
subjects: Ke,
|
|
2127
|
+
belongsTo: Xe,
|
|
2128
|
+
layout: Je,
|
|
2129
|
+
readingProgression: qe,
|
|
2130
|
+
duration: Qe,
|
|
2131
|
+
numberOfPages: je,
|
|
2132
|
+
accessibility: Ze,
|
|
2133
|
+
tdm: ti,
|
|
2134
2134
|
otherMetadata: ot
|
|
2135
2135
|
});
|
|
2136
2136
|
}
|
|
@@ -2234,18 +2234,18 @@ let pt = et;
|
|
|
2234
2234
|
pt.prototype.getMediaOverlay = function() {
|
|
2235
2235
|
const s = this.otherMetadata?.mediaOverlay;
|
|
2236
2236
|
if (s)
|
|
2237
|
-
return
|
|
2237
|
+
return Yt.deserialize(s);
|
|
2238
2238
|
};
|
|
2239
2239
|
U.prototype.getContains = function() {
|
|
2240
2240
|
return new Set(this.otherProperties.contains || []);
|
|
2241
2241
|
};
|
|
2242
|
-
class
|
|
2242
|
+
class Xt {
|
|
2243
2243
|
constructor(t) {
|
|
2244
2244
|
this.links = t.links, this.guided = t.guided;
|
|
2245
2245
|
}
|
|
2246
2246
|
static deserialize(t) {
|
|
2247
2247
|
if (t)
|
|
2248
|
-
return new
|
|
2248
|
+
return new Xt({
|
|
2249
2249
|
links: x.deserialize(t.links),
|
|
2250
2250
|
guided: X.deserializeArray(t.guided)
|
|
2251
2251
|
});
|
|
@@ -2373,16 +2373,35 @@ class X {
|
|
|
2373
2373
|
return e.length === 1 ? [isNaN(e[0]) ? void 0 : e[0], void 0] : e.length > 2 ? [void 0, void 0] : [isNaN(e[0]) ? void 0 : e[0], isNaN(e[1]) ? void 0 : e[1]];
|
|
2374
2374
|
}
|
|
2375
2375
|
}
|
|
2376
|
-
function
|
|
2376
|
+
function gt(s) {
|
|
2377
|
+
const t = s.split(",")[0].trim(), r = (t.toLowerCase().startsWith("npt:") ? t.slice(4) : t).split(":");
|
|
2378
|
+
if (r.length === 1) {
|
|
2379
|
+
const n = parseFloat(r[0]);
|
|
2380
|
+
return isNaN(n) ? void 0 : n;
|
|
2381
|
+
}
|
|
2382
|
+
if (r.length === 2) {
|
|
2383
|
+
const n = parseInt(r[0], 10), a = parseFloat(r[1]);
|
|
2384
|
+
return isNaN(n) || isNaN(a) ? void 0 : n * 60 + a;
|
|
2385
|
+
}
|
|
2386
|
+
if (r.length === 3) {
|
|
2387
|
+
const n = parseInt(r[0], 10), a = parseInt(r[1], 10), o = parseFloat(r[2]);
|
|
2388
|
+
return isNaN(n) || isNaN(a) || isNaN(o) ? void 0 : n * 3600 + a * 60 + o;
|
|
2389
|
+
}
|
|
2390
|
+
}
|
|
2391
|
+
function fi(s) {
|
|
2392
|
+
const t = gt(s);
|
|
2393
|
+
return t !== void 0 && t === 0;
|
|
2394
|
+
}
|
|
2395
|
+
function pi(s, t) {
|
|
2377
2396
|
return t.length > 1 ? t.indexOf(s.slice(-1)) > -1 : s.slice(-1) === t;
|
|
2378
2397
|
}
|
|
2379
|
-
function
|
|
2398
|
+
function mi(s, t) {
|
|
2380
2399
|
return s.slice(s.length - t.length) === t;
|
|
2381
2400
|
}
|
|
2382
|
-
const
|
|
2383
|
-
endsWith:
|
|
2384
|
-
endsWithChar:
|
|
2385
|
-
},
|
|
2401
|
+
const St = {
|
|
2402
|
+
endsWith: mi,
|
|
2403
|
+
endsWithChar: pi
|
|
2404
|
+
}, gi = [
|
|
2386
2405
|
"ie",
|
|
2387
2406
|
"eg",
|
|
2388
2407
|
"ext",
|
|
@@ -2474,16 +2493,16 @@ const yt = {
|
|
|
2474
2493
|
"Fri",
|
|
2475
2494
|
"Sat"
|
|
2476
2495
|
];
|
|
2477
|
-
function
|
|
2478
|
-
return /^[A-Z][a-z].*/.test(s) ||
|
|
2496
|
+
function pe(s) {
|
|
2497
|
+
return /^[A-Z][a-z].*/.test(s) || zt(s);
|
|
2479
2498
|
}
|
|
2480
|
-
function
|
|
2481
|
-
return
|
|
2499
|
+
function bi(s) {
|
|
2500
|
+
return pe(s) || /``|"|'/.test(s.substring(0, 2));
|
|
2482
2501
|
}
|
|
2483
|
-
function
|
|
2484
|
-
return ~
|
|
2502
|
+
function vi(s) {
|
|
2503
|
+
return ~gi.indexOf(s.replace(/\W+/g, ""));
|
|
2485
2504
|
}
|
|
2486
|
-
function
|
|
2505
|
+
function Ai(s, t) {
|
|
2487
2506
|
if (s === "a.m." || s === "p.m.") {
|
|
2488
2507
|
var e = t.replace(/\W+/g, "").slice(-3).toLowerCase();
|
|
2489
2508
|
if (e === "day")
|
|
@@ -2491,23 +2510,23 @@ function bi(s, t) {
|
|
|
2491
2510
|
}
|
|
2492
2511
|
return !1;
|
|
2493
2512
|
}
|
|
2494
|
-
function
|
|
2513
|
+
function ae(s) {
|
|
2495
2514
|
var t = s.replace(/[\(\)\[\]\{\}]/g, "").match(/(.\.)*/);
|
|
2496
2515
|
return t && t[0].length > 0;
|
|
2497
2516
|
}
|
|
2498
|
-
function
|
|
2499
|
-
return s.length <= 3 ? !0 :
|
|
2517
|
+
function oe(s) {
|
|
2518
|
+
return s.length <= 3 ? !0 : pe(s);
|
|
2500
2519
|
}
|
|
2501
|
-
function
|
|
2520
|
+
function zt(s, t) {
|
|
2502
2521
|
return t && (s = s.slice(t - 1, t + 2)), !isNaN(Number(s));
|
|
2503
2522
|
}
|
|
2504
|
-
function
|
|
2523
|
+
function wi(s) {
|
|
2505
2524
|
return s.match(/^(?:(?:\+?1\s*(?:[.-]\s*)?)?(?:\(\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\s*\)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\s*(?:[.-]\s*)?)?([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\s*(?:[.-]\s*)?([0-9]{4})(?:\s*(?:#|x\.?|ext\.?|extension)\s*(\d+))?$/);
|
|
2506
2525
|
}
|
|
2507
|
-
function
|
|
2526
|
+
function yi(s) {
|
|
2508
2527
|
return s.match(/[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/);
|
|
2509
2528
|
}
|
|
2510
|
-
function
|
|
2529
|
+
function Si(s) {
|
|
2511
2530
|
var t = 0;
|
|
2512
2531
|
if ((t = s.indexOf(".")) > -1 || (t = s.indexOf("!")) > -1 || (t = s.indexOf("?")) > -1) {
|
|
2513
2532
|
var e = s.charAt(t + 1);
|
|
@@ -2516,10 +2535,10 @@ function wi(s) {
|
|
|
2516
2535
|
}
|
|
2517
2536
|
return !1;
|
|
2518
2537
|
}
|
|
2519
|
-
function
|
|
2538
|
+
function Ei(s) {
|
|
2520
2539
|
return s === "." || s === "!" || s === "?";
|
|
2521
2540
|
}
|
|
2522
|
-
function
|
|
2541
|
+
function Ti(s, t) {
|
|
2523
2542
|
t = Object.assign(t || {}, {
|
|
2524
2543
|
newlineBoundary: t && t.newlineBoundary || !0
|
|
2525
2544
|
});
|
|
@@ -2533,22 +2552,22 @@ function Si(s, t) {
|
|
|
2533
2552
|
return !e.test(k.value);
|
|
2534
2553
|
});
|
|
2535
2554
|
if (i === `
|
|
2536
|
-
` && t.newlineBoundary ||
|
|
2555
|
+
` && t.newlineBoundary || Ei(i) || St.endsWithChar(i, "?!"))
|
|
2537
2556
|
return m;
|
|
2538
|
-
if (
|
|
2557
|
+
if (St.endsWithChar(i, ".")) {
|
|
2539
2558
|
if (g) {
|
|
2540
|
-
if (i.length === 2 && isNaN(i.charAt(0)) && i.match(/[a-zA-Z]/) ||
|
|
2559
|
+
if (i.length === 2 && isNaN(i.charAt(0)) && i.match(/[a-zA-Z]/) || vi(i))
|
|
2541
2560
|
return u;
|
|
2542
|
-
if (
|
|
2543
|
-
if (
|
|
2561
|
+
if (bi(g.value)) {
|
|
2562
|
+
if (Ai(i, g.value) || zt(g.value) && oe(i))
|
|
2544
2563
|
return u;
|
|
2545
|
-
} else if (
|
|
2564
|
+
} else if (St.endsWith(i, "..") || ae(i) || oe(i))
|
|
2546
2565
|
return u;
|
|
2547
2566
|
}
|
|
2548
2567
|
return m;
|
|
2549
2568
|
}
|
|
2550
2569
|
let A;
|
|
2551
|
-
return (A = i.indexOf(".")) > -1 && (
|
|
2570
|
+
return (A = i.indexOf(".")) > -1 && (zt(i, A) || ae(i) || yi(i) || wi(i)) ? u : (p = Si(i)) ? [
|
|
2552
2571
|
p[0] + p[1],
|
|
2553
2572
|
null,
|
|
2554
2573
|
p[2]
|
|
@@ -2560,13 +2579,13 @@ function Si(s, t) {
|
|
|
2560
2579
|
})
|
|
2561
2580
|
);
|
|
2562
2581
|
}
|
|
2563
|
-
const
|
|
2564
|
-
function
|
|
2582
|
+
const Ii = (s, ...t) => (...e) => s(...t, ...e);
|
|
2583
|
+
function xi(s) {
|
|
2565
2584
|
return {
|
|
2566
|
-
sentences:
|
|
2585
|
+
sentences: Ii(Ti, s)
|
|
2567
2586
|
};
|
|
2568
2587
|
}
|
|
2569
|
-
function
|
|
2588
|
+
function Ni(s, t) {
|
|
2570
2589
|
return t ? s.reduce(function(e, i) {
|
|
2571
2590
|
var r = [
|
|
2572
2591
|
i.index,
|
|
@@ -2576,11 +2595,11 @@ function Ii(s, t) {
|
|
|
2576
2595
|
return [e, r].join(":");
|
|
2577
2596
|
}, t) : null;
|
|
2578
2597
|
}
|
|
2579
|
-
function
|
|
2598
|
+
function Oi(s) {
|
|
2580
2599
|
const { index: t, offset: e, value: i, ...r } = s;
|
|
2581
2600
|
return r;
|
|
2582
2601
|
}
|
|
2583
|
-
function
|
|
2602
|
+
function Li(s, t) {
|
|
2584
2603
|
var e = 0;
|
|
2585
2604
|
return Array.isArray(t) || (t = [t]), t.map(function(i) {
|
|
2586
2605
|
return i === null ? null : (typeof i == "string" && (i = {
|
|
@@ -2590,7 +2609,7 @@ function Ni(s, t) {
|
|
|
2590
2609
|
}), typeof i == "object" && (i.index = i.index || 0, e = e + i.index + i.offset, i.index = s.index + i.index, i.offset = i.offset || i.value.length), i);
|
|
2591
2610
|
});
|
|
2592
2611
|
}
|
|
2593
|
-
function
|
|
2612
|
+
function zi(s, t) {
|
|
2594
2613
|
if (s.length == 0) return null;
|
|
2595
2614
|
var e = "", i = 0, r = s[0]?.index;
|
|
2596
2615
|
return s.forEach(function(n, a) {
|
|
@@ -2608,13 +2627,13 @@ function Oi(s, t) {
|
|
|
2608
2627
|
};
|
|
2609
2628
|
}
|
|
2610
2629
|
const j = {
|
|
2611
|
-
tokensId:
|
|
2612
|
-
normalize:
|
|
2613
|
-
properties:
|
|
2614
|
-
merge:
|
|
2630
|
+
tokensId: Ni,
|
|
2631
|
+
normalize: Li,
|
|
2632
|
+
properties: Oi,
|
|
2633
|
+
merge: zi
|
|
2615
2634
|
};
|
|
2616
|
-
var
|
|
2617
|
-
"([^" +
|
|
2635
|
+
var Ci = ' \r\n !"#$%&()*+,-.\\/:;<=>?@[\\]^_`{|}~', Ri = new RegExp(
|
|
2636
|
+
"([^" + Ci + "]+)"
|
|
2618
2637
|
);
|
|
2619
2638
|
function z(s) {
|
|
2620
2639
|
if (!(this instanceof z)) return new z(s);
|
|
@@ -2755,14 +2774,14 @@ z.prototype.sections = function() {
|
|
|
2755
2774
|
return this.re(/([^\n\.,;!?]+)/i, { split: !1 });
|
|
2756
2775
|
};
|
|
2757
2776
|
z.prototype.words = function() {
|
|
2758
|
-
return this.re(
|
|
2777
|
+
return this.re(Ri);
|
|
2759
2778
|
};
|
|
2760
2779
|
z.prototype.characters = function() {
|
|
2761
2780
|
return this.re(/[^\s]/);
|
|
2762
2781
|
};
|
|
2763
|
-
var
|
|
2764
|
-
const
|
|
2765
|
-
class
|
|
2782
|
+
var ki = /* @__PURE__ */ ((s) => (s.Word = "word", s.Sentence = "sentence", s.Paragraph = "paragraph", s))(ki || {});
|
|
2783
|
+
const Pi = (s, t) => "Segmenter" in Intl ? new Di(s, t) : new Ui(s, t);
|
|
2784
|
+
class Di {
|
|
2766
2785
|
constructor(t, e) {
|
|
2767
2786
|
if (this.unit = e, t = t ?? navigator?.language, !("Segmenter" in Intl)) throw new Error("Intl.Segmenter is not supported in this environment");
|
|
2768
2787
|
if (e === "paragraph") throw new Error("IntlTextTokenizer does not handle TextUnit.Paragraph");
|
|
@@ -2774,13 +2793,13 @@ class ki {
|
|
|
2774
2793
|
const e = this.segmenter.segment(t), i = [];
|
|
2775
2794
|
for (let r of e) {
|
|
2776
2795
|
if (this.unit === "word" && r.isWordLike === !1) continue;
|
|
2777
|
-
const n =
|
|
2796
|
+
const n = me(r.segment);
|
|
2778
2797
|
n !== null && i.push([r.index, r.index + n.length]);
|
|
2779
2798
|
}
|
|
2780
2799
|
return i;
|
|
2781
2800
|
}
|
|
2782
2801
|
}
|
|
2783
|
-
class
|
|
2802
|
+
class Ui {
|
|
2784
2803
|
constructor(t, e) {
|
|
2785
2804
|
if (this.unit = e, t = t ?? navigator?.language, this.isEnglish = t.toLowerCase().split("-")[0] === "en", e === "paragraph") throw new Error("NaiveTextTokenizer does not handle TextUnit.Paragraph");
|
|
2786
2805
|
this.tokenizer = new z();
|
|
@@ -2792,7 +2811,7 @@ class Pi {
|
|
|
2792
2811
|
e = this.tokenizer.words()(t);
|
|
2793
2812
|
break;
|
|
2794
2813
|
case "sentence":
|
|
2795
|
-
this.isEnglish ? e =
|
|
2814
|
+
this.isEnglish ? e = xi(this.tokenizer).sentences()(t) : e = this.tokenizer.sections()(t);
|
|
2796
2815
|
break;
|
|
2797
2816
|
default:
|
|
2798
2817
|
e = [];
|
|
@@ -2801,14 +2820,14 @@ class Pi {
|
|
|
2801
2820
|
const i = [];
|
|
2802
2821
|
return e.forEach((r) => {
|
|
2803
2822
|
if (r.value.length === 0) return;
|
|
2804
|
-
const n =
|
|
2823
|
+
const n = me(r.value);
|
|
2805
2824
|
n !== null && i.push([r.index, r.index + n.length]);
|
|
2806
2825
|
}), i;
|
|
2807
2826
|
}
|
|
2808
2827
|
}
|
|
2809
|
-
const
|
|
2828
|
+
const Mi = new RegExp("[\\p{L}\\p{N}]+", "u"), me = (s) => {
|
|
2810
2829
|
const t = s.trimEnd();
|
|
2811
|
-
return t.length === 0 || t.match(
|
|
2830
|
+
return t.length === 0 || t.match(Mi) === null ? null : t;
|
|
2812
2831
|
};
|
|
2813
2832
|
class C {
|
|
2814
2833
|
constructor(t, e) {
|
|
@@ -2951,15 +2970,14 @@ class C {
|
|
|
2951
2970
|
}
|
|
2952
2971
|
/**
|
|
2953
2972
|
* A TOC href points to the start of its resource when it has no fragment,
|
|
2954
|
-
* or when the fragment contains a parsable `t=` value of 0 (audio:
|
|
2955
|
-
* beginning of the file).
|
|
2956
|
-
* or `foo=bar&t=0`.
|
|
2973
|
+
* or when the fragment contains a parsable NPT `t=` value of 0 (audio:
|
|
2974
|
+
* explicit beginning of the file).
|
|
2957
2975
|
*/
|
|
2958
2976
|
static isStartOfResource(t) {
|
|
2959
2977
|
const e = t.split("#")[1];
|
|
2960
2978
|
if (!e) return !0;
|
|
2961
|
-
const i = e.match(/(?:^|&)t=(
|
|
2962
|
-
return i !== null &&
|
|
2979
|
+
const i = e.match(/(?:^|&)t=([^&]+)/);
|
|
2980
|
+
return i !== null && fi(i[1]);
|
|
2963
2981
|
}
|
|
2964
2982
|
// -------------------------------------------------------------------------
|
|
2965
2983
|
// Shared utilities
|
|
@@ -2984,8 +3002,8 @@ class C {
|
|
|
2984
3002
|
const r = i.indexOf("#"), n = r >= 0 ? i.slice(0, r) : i, a = r >= 0 ? i.slice(r + 1) : void 0;
|
|
2985
3003
|
if ((n || this.bareHrefFromItem(t)) !== e) continue;
|
|
2986
3004
|
if (!a) return;
|
|
2987
|
-
const l = a.match(/(?:^|&)t=(
|
|
2988
|
-
return l ?
|
|
3005
|
+
const l = a.match(/(?:^|&)t=([^&]+)/);
|
|
3006
|
+
return l ? gt(l[1]) : void 0;
|
|
2989
3007
|
}
|
|
2990
3008
|
}
|
|
2991
3009
|
bareHrefFromItem(t) {
|
|
@@ -2996,8 +3014,8 @@ class C {
|
|
|
2996
3014
|
if (!e) return;
|
|
2997
3015
|
const i = e.split("#")[1];
|
|
2998
3016
|
if (!i) return;
|
|
2999
|
-
const r = i.match(/(?:^|&)t=(
|
|
3000
|
-
return r ?
|
|
3017
|
+
const r = i.match(/(?:^|&)t=([^&]+)/);
|
|
3018
|
+
return r ? gt(r[1]) : void 0;
|
|
3001
3019
|
}
|
|
3002
3020
|
ancestorPath(t, e) {
|
|
3003
3021
|
for (const i of t) {
|
|
@@ -3015,7 +3033,7 @@ class C {
|
|
|
3015
3033
|
}
|
|
3016
3034
|
class Y {
|
|
3017
3035
|
constructor(t) {
|
|
3018
|
-
this.fetcher = new
|
|
3036
|
+
this.fetcher = new ii(), t.fetcher && (this.fetcher = t.fetcher), this.manifest = t.manifest, this.context = t.manifest.context, this.metadata = t.manifest.metadata, this.links = t.manifest.links, this.readingOrder = t.manifest.readingOrder, this.resources = t.manifest.resources, this.toc = t.manifest.toc, this.subcollections = t.manifest.subcollections;
|
|
3019
3037
|
}
|
|
3020
3038
|
/**
|
|
3021
3039
|
* Returns the publication's timeline, built from its reading order and table of contents.
|
|
@@ -3104,7 +3122,7 @@ class Y {
|
|
|
3104
3122
|
const n = await this.get(new M({
|
|
3105
3123
|
href: r
|
|
3106
3124
|
})).readAsJSON();
|
|
3107
|
-
return
|
|
3125
|
+
return Xt.deserialize(n);
|
|
3108
3126
|
}
|
|
3109
3127
|
/**
|
|
3110
3128
|
* Returns the resource targeted by the given non-templated [link].
|
|
@@ -3131,7 +3149,7 @@ Y.prototype.getListOfTables = function() {
|
|
|
3131
3149
|
Y.prototype.getListOfVideoClips = function() {
|
|
3132
3150
|
return this.linksWithRole("lov");
|
|
3133
3151
|
};
|
|
3134
|
-
class
|
|
3152
|
+
class bt {
|
|
3135
3153
|
/**
|
|
3136
3154
|
* Creates a [DomRange].
|
|
3137
3155
|
*/
|
|
@@ -3146,7 +3164,7 @@ class gt {
|
|
|
3146
3164
|
let e = L(t.textNodeIndex);
|
|
3147
3165
|
if (e === void 0) return;
|
|
3148
3166
|
let i = L(t.charOffset);
|
|
3149
|
-
return i === void 0 && (i = L(t.offset)), new
|
|
3167
|
+
return i === void 0 && (i = L(t.offset)), new bt({
|
|
3150
3168
|
cssSelector: t.cssSelector,
|
|
3151
3169
|
textNodeIndex: e,
|
|
3152
3170
|
charOffset: i
|
|
@@ -3163,7 +3181,7 @@ class gt {
|
|
|
3163
3181
|
return this.charOffset !== void 0 && (t.charOffset = this.charOffset), t;
|
|
3164
3182
|
}
|
|
3165
3183
|
}
|
|
3166
|
-
class
|
|
3184
|
+
class Zt {
|
|
3167
3185
|
/**
|
|
3168
3186
|
* Creates a [DomRange].
|
|
3169
3187
|
*/
|
|
@@ -3175,11 +3193,11 @@ class Xt {
|
|
|
3175
3193
|
*/
|
|
3176
3194
|
static deserialize(t) {
|
|
3177
3195
|
if (!t) return;
|
|
3178
|
-
let e =
|
|
3196
|
+
let e = bt.deserialize(t.start);
|
|
3179
3197
|
if (e)
|
|
3180
|
-
return new
|
|
3198
|
+
return new Zt({
|
|
3181
3199
|
start: e,
|
|
3182
|
-
end:
|
|
3200
|
+
end: bt.deserialize(t.end)
|
|
3183
3201
|
});
|
|
3184
3202
|
}
|
|
3185
3203
|
/**
|
|
@@ -3197,7 +3215,7 @@ T.prototype.getPartialCfi = function() {
|
|
|
3197
3215
|
return this.otherLocations?.get("partialCfi");
|
|
3198
3216
|
};
|
|
3199
3217
|
T.prototype.getDomRange = function() {
|
|
3200
|
-
return
|
|
3218
|
+
return Zt.deserialize(this.otherLocations?.get("domRange"));
|
|
3201
3219
|
};
|
|
3202
3220
|
T.prototype.fragmentParameters = function() {
|
|
3203
3221
|
return new Map(
|
|
@@ -3221,8 +3239,9 @@ T.prototype.page = function() {
|
|
|
3221
3239
|
if (!isNaN(s) && s >= 0) return s;
|
|
3222
3240
|
};
|
|
3223
3241
|
T.prototype.time = function() {
|
|
3224
|
-
const s =
|
|
3225
|
-
if (
|
|
3242
|
+
const s = this.fragmentParameters().get("t");
|
|
3243
|
+
if (s)
|
|
3244
|
+
return gt(s);
|
|
3226
3245
|
};
|
|
3227
3246
|
T.prototype.space = function() {
|
|
3228
3247
|
const s = this.fragmentParameters();
|
|
@@ -3231,7 +3250,7 @@ T.prototype.space = function() {
|
|
|
3231
3250
|
if (t.length === 4 && !t.some(isNaN))
|
|
3232
3251
|
return t;
|
|
3233
3252
|
};
|
|
3234
|
-
class
|
|
3253
|
+
class Jt {
|
|
3235
3254
|
/** Creates a [Price]. */
|
|
3236
3255
|
constructor(t) {
|
|
3237
3256
|
this.currency = t.currency, this.value = t.value;
|
|
@@ -3246,7 +3265,7 @@ class Zt {
|
|
|
3246
3265
|
return;
|
|
3247
3266
|
let i = L(t.value);
|
|
3248
3267
|
if (i !== void 0)
|
|
3249
|
-
return new
|
|
3268
|
+
return new Jt({ currency: e, value: i });
|
|
3250
3269
|
}
|
|
3251
3270
|
/**
|
|
3252
3271
|
* Serializes a [Price] to its RWPM JSON representation.
|
|
@@ -3282,7 +3301,7 @@ class tt {
|
|
|
3282
3301
|
return this.children && (t.children = this.children.map((e) => e.serialize())), t;
|
|
3283
3302
|
}
|
|
3284
3303
|
}
|
|
3285
|
-
class
|
|
3304
|
+
class qt {
|
|
3286
3305
|
/** Creates a [Price]. */
|
|
3287
3306
|
constructor(t) {
|
|
3288
3307
|
this.total = t.total, this.position = t.position;
|
|
@@ -3292,7 +3311,7 @@ class Jt {
|
|
|
3292
3311
|
*/
|
|
3293
3312
|
static deserialize(t) {
|
|
3294
3313
|
if (t)
|
|
3295
|
-
return new
|
|
3314
|
+
return new qt({
|
|
3296
3315
|
total: L(t.total),
|
|
3297
3316
|
position: L(t.position)
|
|
3298
3317
|
});
|
|
@@ -3305,7 +3324,7 @@ class Jt {
|
|
|
3305
3324
|
return this.total !== void 0 && (t.total = this.total), this.position !== void 0 && (t.position = this.position), t;
|
|
3306
3325
|
}
|
|
3307
3326
|
}
|
|
3308
|
-
class
|
|
3327
|
+
class Qt {
|
|
3309
3328
|
/** Creates a [Copies]. */
|
|
3310
3329
|
constructor(t) {
|
|
3311
3330
|
this.total = t.total, this.available = t.available;
|
|
@@ -3315,7 +3334,7 @@ class qt {
|
|
|
3315
3334
|
*/
|
|
3316
3335
|
static deserialize(t) {
|
|
3317
3336
|
if (t)
|
|
3318
|
-
return new
|
|
3337
|
+
return new Qt({
|
|
3319
3338
|
total: L(t.total),
|
|
3320
3339
|
available: L(t.available)
|
|
3321
3340
|
});
|
|
@@ -3328,8 +3347,8 @@ class qt {
|
|
|
3328
3347
|
return this.total !== void 0 && (t.total = this.total), this.available !== void 0 && (t.available = this.available), t;
|
|
3329
3348
|
}
|
|
3330
3349
|
}
|
|
3331
|
-
var
|
|
3332
|
-
class
|
|
3350
|
+
var Bi = /* @__PURE__ */ ((s) => (s.available = "available", s.reserved = "reserved", s.ready = "ready", s))(Bi || {});
|
|
3351
|
+
class jt {
|
|
3333
3352
|
/** Creates a [Availability]. */
|
|
3334
3353
|
constructor(t) {
|
|
3335
3354
|
this.state = t.state, this.since = t.since, this.until = t.until;
|
|
@@ -3339,7 +3358,7 @@ class Qt {
|
|
|
3339
3358
|
*/
|
|
3340
3359
|
static deserialize(t) {
|
|
3341
3360
|
if (t && t.state)
|
|
3342
|
-
return new
|
|
3361
|
+
return new jt({
|
|
3343
3362
|
state: t.state,
|
|
3344
3363
|
since: lt(t.since),
|
|
3345
3364
|
until: lt(t.until)
|
|
@@ -3357,7 +3376,7 @@ U.prototype.getNumberOfItems = function() {
|
|
|
3357
3376
|
return L(this.otherProperties.numberOfItems);
|
|
3358
3377
|
};
|
|
3359
3378
|
U.prototype.getPrice = function() {
|
|
3360
|
-
return
|
|
3379
|
+
return Jt.deserialize(this.otherProperties.price);
|
|
3361
3380
|
};
|
|
3362
3381
|
U.prototype.getIndirectAcquisitions = function() {
|
|
3363
3382
|
const s = this.otherProperties.indirectAcquisition;
|
|
@@ -3365,13 +3384,13 @@ U.prototype.getIndirectAcquisitions = function() {
|
|
|
3365
3384
|
return s.map((t) => tt.deserialize(t)).filter((t) => t !== void 0);
|
|
3366
3385
|
};
|
|
3367
3386
|
U.prototype.getHolds = function() {
|
|
3368
|
-
return
|
|
3387
|
+
return qt.deserialize(this.otherProperties.holds);
|
|
3369
3388
|
};
|
|
3370
3389
|
U.prototype.getCopies = function() {
|
|
3371
|
-
return
|
|
3390
|
+
return Qt.deserialize(this.otherProperties.copies);
|
|
3372
3391
|
};
|
|
3373
3392
|
U.prototype.getAvailability = function() {
|
|
3374
|
-
return
|
|
3393
|
+
return jt.deserialize(this.otherProperties.availability);
|
|
3375
3394
|
};
|
|
3376
3395
|
U.prototype.getAuthenticate = function() {
|
|
3377
3396
|
return M.deserialize(this.otherProperties.authenticate);
|
|
@@ -3379,7 +3398,7 @@ U.prototype.getAuthenticate = function() {
|
|
|
3379
3398
|
Y.prototype.getImages = function() {
|
|
3380
3399
|
return this.linksWithRole("images");
|
|
3381
3400
|
};
|
|
3382
|
-
class
|
|
3401
|
+
class lr {
|
|
3383
3402
|
/**
|
|
3384
3403
|
* Extracts the full raw text, or returns null if no text content can be found.
|
|
3385
3404
|
* @param separator Separator to use between individual elements. Defaults to newline.
|
|
@@ -3398,13 +3417,13 @@ class or {
|
|
|
3398
3417
|
return t;
|
|
3399
3418
|
}
|
|
3400
3419
|
}
|
|
3401
|
-
class
|
|
3420
|
+
class ce {
|
|
3402
3421
|
constructor(t, e) {
|
|
3403
3422
|
this.key = t, this.value = e;
|
|
3404
3423
|
}
|
|
3405
3424
|
}
|
|
3406
|
-
var
|
|
3407
|
-
class
|
|
3425
|
+
var Ct = /* @__PURE__ */ ((s) => (s.ACCESSIBILITY_LABEL = "accessibilityLabel", s.LANGUAGE = "language", s))(Ct || {});
|
|
3426
|
+
class ge {
|
|
3408
3427
|
constructor(t = []) {
|
|
3409
3428
|
this._attributes = t;
|
|
3410
3429
|
}
|
|
@@ -3433,12 +3452,12 @@ class me {
|
|
|
3433
3452
|
return this._attributes.filter((e) => e.key === t).map((e) => e.value);
|
|
3434
3453
|
}
|
|
3435
3454
|
}
|
|
3436
|
-
class
|
|
3455
|
+
class be extends ge {
|
|
3437
3456
|
constructor(t, e = []) {
|
|
3438
3457
|
super(e), this.locator = t;
|
|
3439
3458
|
}
|
|
3440
3459
|
}
|
|
3441
|
-
class
|
|
3460
|
+
class yt extends be {
|
|
3442
3461
|
/**
|
|
3443
3462
|
* Human-readable text representation for this element.
|
|
3444
3463
|
*/
|
|
@@ -3446,17 +3465,17 @@ class wt extends ge {
|
|
|
3446
3465
|
return this.accessibilityLabel;
|
|
3447
3466
|
}
|
|
3448
3467
|
}
|
|
3449
|
-
class
|
|
3468
|
+
class Gi extends yt {
|
|
3450
3469
|
constructor(t, e, i = []) {
|
|
3451
3470
|
super(t, i), this.embeddedLink = e;
|
|
3452
3471
|
}
|
|
3453
3472
|
}
|
|
3454
|
-
class
|
|
3473
|
+
class Wi extends yt {
|
|
3455
3474
|
constructor(t, e, i = []) {
|
|
3456
3475
|
super(t, i), this.embeddedLink = e;
|
|
3457
3476
|
}
|
|
3458
3477
|
}
|
|
3459
|
-
class
|
|
3478
|
+
class Hi extends yt {
|
|
3460
3479
|
constructor(t, e, i, r = []) {
|
|
3461
3480
|
super(t, r), this.embeddedLink = e, this.caption = i;
|
|
3462
3481
|
}
|
|
@@ -3464,12 +3483,12 @@ class Gi extends wt {
|
|
|
3464
3483
|
return (this.caption?.length || 0) > 0 ? this.caption : super.text;
|
|
3465
3484
|
}
|
|
3466
3485
|
}
|
|
3467
|
-
class
|
|
3486
|
+
class ve extends ge {
|
|
3468
3487
|
constructor(t, e, i = []) {
|
|
3469
3488
|
super(i), this.locator = t, this.text = e;
|
|
3470
3489
|
}
|
|
3471
3490
|
}
|
|
3472
|
-
class
|
|
3491
|
+
class Rt extends yt {
|
|
3473
3492
|
constructor(t, e, i, r = []) {
|
|
3474
3493
|
super(t, r), this.role = e, this.segments = i;
|
|
3475
3494
|
}
|
|
@@ -3477,7 +3496,7 @@ class Ct extends wt {
|
|
|
3477
3496
|
return this.segments.map((t) => t.text).join("");
|
|
3478
3497
|
}
|
|
3479
3498
|
}
|
|
3480
|
-
class
|
|
3499
|
+
class Fi {
|
|
3481
3500
|
constructor(t) {
|
|
3482
3501
|
this.level = t;
|
|
3483
3502
|
}
|
|
@@ -3485,17 +3504,17 @@ class Wi {
|
|
|
3485
3504
|
return `heading-${this.level}`;
|
|
3486
3505
|
}
|
|
3487
3506
|
}
|
|
3488
|
-
const
|
|
3507
|
+
const _i = {
|
|
3489
3508
|
role: "body"
|
|
3490
|
-
},
|
|
3509
|
+
}, Vi = {
|
|
3491
3510
|
role: "footnote"
|
|
3492
3511
|
};
|
|
3493
|
-
class
|
|
3512
|
+
class Yi {
|
|
3494
3513
|
constructor(t, e) {
|
|
3495
3514
|
this.referenceUrl = t, this.referenceTitle = e, this.role = "quote";
|
|
3496
3515
|
}
|
|
3497
3516
|
}
|
|
3498
|
-
class
|
|
3517
|
+
class hr {
|
|
3499
3518
|
/**
|
|
3500
3519
|
*
|
|
3501
3520
|
* @param defaultLanguage The default assumed language
|
|
@@ -3503,12 +3522,12 @@ class cr {
|
|
|
3503
3522
|
* @param contextSnippetLength Length of `before` and `after` snippets in the produced [Locator]s.
|
|
3504
3523
|
* @param textTokenizerFactory Factory to create a [TextTokenizer] from, using the specified language and unit.
|
|
3505
3524
|
*/
|
|
3506
|
-
constructor(t, e, i = 50, r = (n) =>
|
|
3525
|
+
constructor(t, e, i = 50, r = (n) => Pi(n, e)) {
|
|
3507
3526
|
this.defaultLanguage = t, this.contextSnippetLength = i, this.textTokenizerFactory = r;
|
|
3508
3527
|
}
|
|
3509
3528
|
tokenize(t) {
|
|
3510
|
-
return t instanceof
|
|
3511
|
-
new
|
|
3529
|
+
return t instanceof Rt ? [
|
|
3530
|
+
new Rt(
|
|
3512
3531
|
t.locator,
|
|
3513
3532
|
t.role,
|
|
3514
3533
|
t.segments.map((e) => this.tokenizeSegment(e)).flat()
|
|
@@ -3516,7 +3535,7 @@ class cr {
|
|
|
3516
3535
|
] : [t];
|
|
3517
3536
|
}
|
|
3518
3537
|
tokenizeSegment(t) {
|
|
3519
|
-
return this.textTokenizerFactory(t.language ?? this.defaultLanguage).tokenize(t.text).map((e) => new
|
|
3538
|
+
return this.textTokenizerFactory(t.language ?? this.defaultLanguage).tokenize(t.text).map((e) => new ve(
|
|
3520
3539
|
new D({
|
|
3521
3540
|
href: t.locator.href,
|
|
3522
3541
|
type: t.locator.type,
|
|
@@ -3542,7 +3561,7 @@ class it extends Error {
|
|
|
3542
3561
|
super(t);
|
|
3543
3562
|
}
|
|
3544
3563
|
}
|
|
3545
|
-
class
|
|
3564
|
+
class te {
|
|
3546
3565
|
/**
|
|
3547
3566
|
* Advances to the next item and returns it, or null if we reached the end.
|
|
3548
3567
|
*/
|
|
@@ -3556,7 +3575,7 @@ class jt {
|
|
|
3556
3575
|
return await this.hasPrevious() ? this.previous() : null;
|
|
3557
3576
|
}
|
|
3558
3577
|
}
|
|
3559
|
-
class
|
|
3578
|
+
class $i {
|
|
3560
3579
|
constructor(t, e) {
|
|
3561
3580
|
this.index = t, this.iterator = e;
|
|
3562
3581
|
}
|
|
@@ -3564,12 +3583,12 @@ class Vi {
|
|
|
3564
3583
|
return t === 1 ? this.iterator.nextOrNull() : this.iterator.previousOrNull();
|
|
3565
3584
|
}
|
|
3566
3585
|
}
|
|
3567
|
-
let
|
|
3586
|
+
let Ki = class {
|
|
3568
3587
|
constructor(t, e) {
|
|
3569
3588
|
this.element = t, this.direction = e;
|
|
3570
3589
|
}
|
|
3571
3590
|
};
|
|
3572
|
-
class
|
|
3591
|
+
class dr extends te {
|
|
3573
3592
|
constructor(t, e, i) {
|
|
3574
3593
|
super(), this.publication = t, this.startLocator = e, this.resourceContentIteratorFactories = i, this._currentIterator = null, this.currentElement = null;
|
|
3575
3594
|
}
|
|
@@ -3601,7 +3620,7 @@ class hr extends jt {
|
|
|
3601
3620
|
const r = this.nextIteratorIn(t, e.index);
|
|
3602
3621
|
return r ? (this._currentIterator = r, this.nextIn(t)) : null;
|
|
3603
3622
|
}
|
|
3604
|
-
return new
|
|
3623
|
+
return new Ki(i, t);
|
|
3605
3624
|
}
|
|
3606
3625
|
/**
|
|
3607
3626
|
* Returns the [Iterator] for the current [Resource] in the reading order.
|
|
@@ -3637,12 +3656,12 @@ class hr extends jt {
|
|
|
3637
3656
|
const n = this.publication.get(i);
|
|
3638
3657
|
for (const a of this.resourceContentIteratorFactories) {
|
|
3639
3658
|
const o = a(n, r);
|
|
3640
|
-
if (o) return new
|
|
3659
|
+
if (o) return new $i(t, o);
|
|
3641
3660
|
}
|
|
3642
3661
|
return null;
|
|
3643
3662
|
}
|
|
3644
3663
|
}
|
|
3645
|
-
class
|
|
3664
|
+
class Et extends be {
|
|
3646
3665
|
constructor(t, e, i = []) {
|
|
3647
3666
|
super(t, i), this.element = e;
|
|
3648
3667
|
}
|
|
@@ -3650,24 +3669,24 @@ class St extends ge {
|
|
|
3650
3669
|
return this.element.text;
|
|
3651
3670
|
}
|
|
3652
3671
|
}
|
|
3653
|
-
class
|
|
3672
|
+
class le {
|
|
3654
3673
|
constructor(t, e) {
|
|
3655
3674
|
this.element = t, this.direction = e;
|
|
3656
3675
|
}
|
|
3657
3676
|
}
|
|
3658
|
-
class
|
|
3677
|
+
class fr extends te {
|
|
3659
3678
|
constructor(t, e) {
|
|
3660
3679
|
super(), this.pageContent = t, this.startLocator = e, this.pageContentFiltered = [], this.currentElement = null, this.currentProgression = 0, this.currentElementIndex = 0;
|
|
3661
3680
|
const i = this.pageContent.filter(
|
|
3662
3681
|
(r) => r?.str !== " " && r?.str !== ""
|
|
3663
3682
|
);
|
|
3664
|
-
if (this.pageContentFiltered = i.map((r) => new
|
|
3683
|
+
if (this.pageContentFiltered = i.map((r) => new Et(r.locator, {
|
|
3665
3684
|
index: i.indexOf(r),
|
|
3666
3685
|
text: r.str,
|
|
3667
3686
|
readingDirection: r.dir
|
|
3668
3687
|
})), this.startLocator && (this.currentProgression = this.startLocator?.locations?.progression || 0, this.updateElementIndex()), this.pageContentFiltered.length > 0) {
|
|
3669
3688
|
const r = this.currentElementIndex;
|
|
3670
|
-
(r || r === 0) && (this.currentElement = new
|
|
3689
|
+
(r || r === 0) && (this.currentElement = new le(
|
|
3671
3690
|
this.pageContentFiltered[r],
|
|
3672
3691
|
1
|
|
3673
3692
|
/* Forward */
|
|
@@ -3693,7 +3712,7 @@ class ur extends jt {
|
|
|
3693
3712
|
const t = this.currentElementIndex - 1;
|
|
3694
3713
|
this.currentProgression = t / this.pageContentFiltered.length * 100, this.currentElementIndex = t;
|
|
3695
3714
|
}
|
|
3696
|
-
return this.currentElement ? this.currentElement.element : new
|
|
3715
|
+
return this.currentElement ? this.currentElement.element : new Et(new D({ href: "", type: "" }), { index: -1, text: "" });
|
|
3697
3716
|
}
|
|
3698
3717
|
async hasNext() {
|
|
3699
3718
|
return this.currentElement?.direction, this.nextIn(
|
|
@@ -3711,13 +3730,13 @@ class ur extends jt {
|
|
|
3711
3730
|
const e = t + 1;
|
|
3712
3731
|
this.currentProgression = e / this.pageContentFiltered.length * 100, this.currentElementIndex = e;
|
|
3713
3732
|
}
|
|
3714
|
-
return this.currentElement ? this.currentElement.element : new
|
|
3733
|
+
return this.currentElement ? this.currentElement.element : new Et(new D({ href: "", type: "" }), { index: -1, text: "" });
|
|
3715
3734
|
}
|
|
3716
3735
|
nextIn(t) {
|
|
3717
3736
|
const e = this.currentElementIndex;
|
|
3718
3737
|
if (e === null || e === this.pageContentFiltered.length - 1 && t === 1 || e === 0 && t === -1) return null;
|
|
3719
3738
|
const i = this.pageContentFiltered[e + t];
|
|
3720
|
-
return i ? new
|
|
3739
|
+
return i ? new le(i, t) : null;
|
|
3721
3740
|
}
|
|
3722
3741
|
/**
|
|
3723
3742
|
* Updates the current [PDFReadableElement] position in the pageContentFiltered array
|
|
@@ -3727,7 +3746,7 @@ class ur extends jt {
|
|
|
3727
3746
|
return this.currentProgression === 0 ? 0 : this.currentProgression < 0 || this.currentProgression >= 100 ? null : Math.floor(this.currentProgression * this.pageContentFiltered.length / 100);
|
|
3728
3747
|
}
|
|
3729
3748
|
}
|
|
3730
|
-
const
|
|
3749
|
+
const Xi = [
|
|
3731
3750
|
"OBJECT",
|
|
3732
3751
|
"BASE",
|
|
3733
3752
|
"FONT",
|
|
@@ -3795,10 +3814,10 @@ const $i = [
|
|
|
3795
3814
|
"NOBR",
|
|
3796
3815
|
"RB"
|
|
3797
3816
|
];
|
|
3798
|
-
function
|
|
3799
|
-
return
|
|
3817
|
+
function he(s) {
|
|
3818
|
+
return Xi.includes(s.nodeName.toUpperCase());
|
|
3800
3819
|
}
|
|
3801
|
-
function
|
|
3820
|
+
function Tt(s, t) {
|
|
3802
3821
|
const e = s.getAttribute("src");
|
|
3803
3822
|
if (!e?.length) return null;
|
|
3804
3823
|
try {
|
|
@@ -3807,15 +3826,15 @@ function Et(s, t) {
|
|
|
3807
3826
|
return e;
|
|
3808
3827
|
}
|
|
3809
3828
|
}
|
|
3810
|
-
const st = "[\\s\\u0085\\u00A0\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]",
|
|
3829
|
+
const st = "[\\s\\u0085\\u00A0\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]", Zi = new RegExp(`^${st}+$`, "g"), Ji = new RegExp(`^${st}+|${st}+$/g`, "g"), Ae = new RegExp(`^${st}+`, "g"), we = new RegExp(`${st}+$`, "g"), ct = (s) => (
|
|
3811
3830
|
// Normal spaces, \t, \n, \v, \f, \r, U+0085, U+00A0, U+2000 to U+200A, U+2028, U+2029, U+202F, U+205F, U+3000
|
|
3812
|
-
s?.length ?
|
|
3813
|
-
),
|
|
3814
|
-
before: t + (
|
|
3815
|
-
highlight:
|
|
3816
|
-
after:
|
|
3831
|
+
s?.length ? Zi.test(s) : !0
|
|
3832
|
+
), ye = (s) => s.replace(Ji, ""), qi = (s) => s.replace(Ae, ""), Qi = (s) => s.replace(we, ""), ue = (s, t = "") => new nt({
|
|
3833
|
+
before: t + (Ae.exec(s)?.[0] ?? ""),
|
|
3834
|
+
highlight: ye(s),
|
|
3835
|
+
after: we.exec(s)?.[0] ?? ""
|
|
3817
3836
|
});
|
|
3818
|
-
function
|
|
3837
|
+
function ji(s) {
|
|
3819
3838
|
for (; s; ) {
|
|
3820
3839
|
let t = s.getAttribute("lang") || s.getAttributeNS("http://www.w3.org/1999/xhtml", "lang") || s.getAttributeNS("http://www.w3.org/XML/1998/namespace", "lang");
|
|
3821
3840
|
if (t) return t;
|
|
@@ -3823,7 +3842,7 @@ function qi(s) {
|
|
|
3823
3842
|
}
|
|
3824
3843
|
return null;
|
|
3825
3844
|
}
|
|
3826
|
-
function
|
|
3845
|
+
function ts(s, t) {
|
|
3827
3846
|
const e = s.length > 0 && s[s.length - 1] === " ";
|
|
3828
3847
|
let i = !1, r = !1;
|
|
3829
3848
|
for (let n = 0; n < t.length; n++)
|
|
@@ -3837,10 +3856,10 @@ function Qi(s, t) {
|
|
|
3837
3856
|
}
|
|
3838
3857
|
return s;
|
|
3839
3858
|
}
|
|
3840
|
-
function
|
|
3859
|
+
function Se(s) {
|
|
3841
3860
|
return typeof s == "object" && s !== null && s.nodeType === Node.ELEMENT_NODE;
|
|
3842
3861
|
}
|
|
3843
|
-
const
|
|
3862
|
+
const vt = {
|
|
3844
3863
|
NONE: "",
|
|
3845
3864
|
DESCENDANT: " ",
|
|
3846
3865
|
CHILD: " > "
|
|
@@ -3852,14 +3871,14 @@ const bt = {
|
|
|
3852
3871
|
nthchild: "nthchild",
|
|
3853
3872
|
nthoftype: "nthoftype"
|
|
3854
3873
|
};
|
|
3855
|
-
function
|
|
3874
|
+
function es(s, t) {
|
|
3856
3875
|
return Object.values(s).includes(t);
|
|
3857
3876
|
}
|
|
3858
|
-
const
|
|
3859
|
-
function
|
|
3860
|
-
console.warn(`${
|
|
3877
|
+
const is = "CssSelectorGenerator";
|
|
3878
|
+
function At(s = "unknown problem", ...t) {
|
|
3879
|
+
console.warn(`${is}: ${s}`, ...t);
|
|
3861
3880
|
}
|
|
3862
|
-
const
|
|
3881
|
+
const ss = {
|
|
3863
3882
|
selectors: [
|
|
3864
3883
|
E.id,
|
|
3865
3884
|
E.class,
|
|
@@ -3877,165 +3896,165 @@ const es = {
|
|
|
3877
3896
|
maxCandidates: Number.POSITIVE_INFINITY,
|
|
3878
3897
|
useScope: !1
|
|
3879
3898
|
};
|
|
3880
|
-
function
|
|
3881
|
-
return Array.isArray(s) ? s.filter((t) =>
|
|
3899
|
+
function rs(s) {
|
|
3900
|
+
return Array.isArray(s) ? s.filter((t) => es(E, t)) : [];
|
|
3882
3901
|
}
|
|
3883
|
-
function
|
|
3902
|
+
function Ee(s) {
|
|
3884
3903
|
return s instanceof RegExp;
|
|
3885
3904
|
}
|
|
3886
|
-
function
|
|
3887
|
-
return ["string", "function"].includes(typeof s) ||
|
|
3905
|
+
function ns(s) {
|
|
3906
|
+
return ["string", "function"].includes(typeof s) || Ee(s);
|
|
3888
3907
|
}
|
|
3889
|
-
function
|
|
3890
|
-
return Array.isArray(s) ? s.filter(
|
|
3908
|
+
function de(s) {
|
|
3909
|
+
return Array.isArray(s) ? s.filter(ns) : [];
|
|
3891
3910
|
}
|
|
3892
|
-
function
|
|
3911
|
+
function as(s) {
|
|
3893
3912
|
return s instanceof Node;
|
|
3894
3913
|
}
|
|
3895
|
-
function
|
|
3914
|
+
function fe(s) {
|
|
3896
3915
|
const t = [
|
|
3897
3916
|
Node.DOCUMENT_NODE,
|
|
3898
3917
|
Node.DOCUMENT_FRAGMENT_NODE,
|
|
3899
3918
|
// this includes Shadow DOM root
|
|
3900
3919
|
Node.ELEMENT_NODE
|
|
3901
3920
|
];
|
|
3902
|
-
return
|
|
3921
|
+
return as(s) && t.includes(s.nodeType);
|
|
3903
3922
|
}
|
|
3904
|
-
function
|
|
3905
|
-
if (
|
|
3906
|
-
return s.contains(t) ||
|
|
3923
|
+
function Te(s, t) {
|
|
3924
|
+
if (fe(s))
|
|
3925
|
+
return s.contains(t) || At("element root mismatch", "Provided root does not contain the element. This will most likely result in producing a fallback selector using element's real root node. If you plan to use the selector using provided root (e.g. `root.querySelector`), it will not work as intended."), s;
|
|
3907
3926
|
const e = t.getRootNode({ composed: !1 });
|
|
3908
|
-
return
|
|
3927
|
+
return fe(e) ? (e !== document && At("shadow root inferred", "You did not provide a root and the element is a child of Shadow DOM. This will produce a selector using ShadowRoot as a root. If you plan to use the selector using document as a root (e.g. `document.querySelector`), it will not work as intended."), e) : ie(t);
|
|
3909
3928
|
}
|
|
3910
|
-
function
|
|
3929
|
+
function It(s) {
|
|
3911
3930
|
return typeof s == "number" ? s : Number.POSITIVE_INFINITY;
|
|
3912
3931
|
}
|
|
3913
|
-
function
|
|
3914
|
-
const e = Object.assign(Object.assign({},
|
|
3932
|
+
function os(s, t = {}) {
|
|
3933
|
+
const e = Object.assign(Object.assign({}, ss), t);
|
|
3915
3934
|
return {
|
|
3916
|
-
selectors:
|
|
3917
|
-
whitelist:
|
|
3918
|
-
blacklist:
|
|
3919
|
-
root:
|
|
3935
|
+
selectors: rs(e.selectors),
|
|
3936
|
+
whitelist: de(e.whitelist),
|
|
3937
|
+
blacklist: de(e.blacklist),
|
|
3938
|
+
root: Te(e.root, s),
|
|
3920
3939
|
combineWithinSelector: !!e.combineWithinSelector,
|
|
3921
3940
|
combineBetweenSelectors: !!e.combineBetweenSelectors,
|
|
3922
3941
|
includeTag: !!e.includeTag,
|
|
3923
|
-
maxCombinations:
|
|
3924
|
-
maxCandidates:
|
|
3942
|
+
maxCombinations: It(e.maxCombinations),
|
|
3943
|
+
maxCandidates: It(e.maxCandidates),
|
|
3925
3944
|
useScope: !!e.useScope,
|
|
3926
|
-
maxResults:
|
|
3945
|
+
maxResults: It(e.maxResults)
|
|
3927
3946
|
};
|
|
3928
3947
|
}
|
|
3929
3948
|
function at(s = []) {
|
|
3930
3949
|
const [t = [], ...e] = s;
|
|
3931
3950
|
return e.length === 0 ? t : e.reduce((i, r) => i.filter((n) => r.includes(n)), t);
|
|
3932
3951
|
}
|
|
3933
|
-
function
|
|
3952
|
+
function cs(s) {
|
|
3934
3953
|
return [].concat(...s);
|
|
3935
3954
|
}
|
|
3936
|
-
function
|
|
3955
|
+
function ls(s) {
|
|
3937
3956
|
return s.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".+");
|
|
3938
3957
|
}
|
|
3939
|
-
function
|
|
3958
|
+
function kt(s) {
|
|
3940
3959
|
const t = s.map((e) => {
|
|
3941
|
-
if (
|
|
3960
|
+
if (Ee(e))
|
|
3942
3961
|
return (i) => e.test(i);
|
|
3943
3962
|
if (typeof e == "function")
|
|
3944
3963
|
return (i) => {
|
|
3945
3964
|
const r = e(i);
|
|
3946
|
-
return typeof r != "boolean" ? (
|
|
3965
|
+
return typeof r != "boolean" ? (At("pattern matcher function invalid", "Provided pattern matching function does not return boolean. It's result will be ignored.", e), !1) : r;
|
|
3947
3966
|
};
|
|
3948
3967
|
if (typeof e == "string") {
|
|
3949
|
-
const i = new RegExp("^" +
|
|
3968
|
+
const i = new RegExp("^" + ls(e) + "$");
|
|
3950
3969
|
return (r) => i.test(r);
|
|
3951
3970
|
}
|
|
3952
|
-
return
|
|
3971
|
+
return At("pattern matcher invalid", "Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.", e), () => !1;
|
|
3953
3972
|
});
|
|
3954
3973
|
return (e) => t.some((i) => i(e));
|
|
3955
3974
|
}
|
|
3956
|
-
function
|
|
3957
|
-
const i = Array.from(
|
|
3975
|
+
function ee(s, t, e) {
|
|
3976
|
+
const i = Array.from(Te(e, s[0]).querySelectorAll(t));
|
|
3958
3977
|
return i.length === s.length && s.every((r) => i.includes(r));
|
|
3959
3978
|
}
|
|
3960
|
-
function
|
|
3961
|
-
t = t ??
|
|
3979
|
+
function Ie(s, t) {
|
|
3980
|
+
t = t ?? ie(s);
|
|
3962
3981
|
const e = [];
|
|
3963
3982
|
let i = s;
|
|
3964
|
-
for (;
|
|
3983
|
+
for (; Se(i) && i !== t; )
|
|
3965
3984
|
e.push(i), i = i.parentElement;
|
|
3966
3985
|
return e;
|
|
3967
3986
|
}
|
|
3968
|
-
function
|
|
3969
|
-
return at(s.map((e) =>
|
|
3987
|
+
function hs(s, t) {
|
|
3988
|
+
return at(s.map((e) => Ie(e, t)));
|
|
3970
3989
|
}
|
|
3971
|
-
function
|
|
3990
|
+
function ie(s) {
|
|
3972
3991
|
return s.ownerDocument.querySelector(":root");
|
|
3973
3992
|
}
|
|
3974
|
-
const
|
|
3993
|
+
const xe = ", ", us = new RegExp([
|
|
3975
3994
|
"^$",
|
|
3976
3995
|
// empty or not set
|
|
3977
3996
|
"\\s"
|
|
3978
3997
|
// contains whitespace
|
|
3979
|
-
].join("|")),
|
|
3998
|
+
].join("|")), ds = new RegExp([
|
|
3980
3999
|
"^$"
|
|
3981
4000
|
// empty or not set
|
|
3982
|
-
].join("|")),
|
|
4001
|
+
].join("|")), Ne = [
|
|
3983
4002
|
E.nthoftype,
|
|
3984
4003
|
E.tag,
|
|
3985
4004
|
E.id,
|
|
3986
4005
|
E.class,
|
|
3987
4006
|
E.attribute,
|
|
3988
4007
|
E.nthchild
|
|
3989
|
-
],
|
|
4008
|
+
], fs = kt([
|
|
3990
4009
|
"class",
|
|
3991
4010
|
"id",
|
|
3992
4011
|
// Angular attributes
|
|
3993
4012
|
"ng-*"
|
|
3994
4013
|
]);
|
|
3995
|
-
function
|
|
4014
|
+
function ps({ name: s }) {
|
|
3996
4015
|
return `[${s}]`;
|
|
3997
4016
|
}
|
|
3998
|
-
function
|
|
4017
|
+
function ms({ name: s, value: t }) {
|
|
3999
4018
|
return `[${s}='${t}']`;
|
|
4000
4019
|
}
|
|
4001
|
-
function
|
|
4020
|
+
function gs({ nodeName: s, nodeValue: t }, e) {
|
|
4002
4021
|
const i = e.tagName.toLowerCase();
|
|
4003
|
-
return ["input", "option"].includes(i) && s === "value" || s === "src" && t?.startsWith("data:") ? !1 : !
|
|
4022
|
+
return ["input", "option"].includes(i) && s === "value" || s === "src" && t?.startsWith("data:") ? !1 : !fs(s);
|
|
4004
4023
|
}
|
|
4005
|
-
function
|
|
4024
|
+
function bs({ nodeName: s, nodeValue: t }) {
|
|
4006
4025
|
return {
|
|
4007
4026
|
name: rt(s),
|
|
4008
4027
|
value: rt(t ?? void 0)
|
|
4009
4028
|
};
|
|
4010
4029
|
}
|
|
4011
|
-
function
|
|
4012
|
-
const t = Array.from(s.attributes).filter((e) =>
|
|
4030
|
+
function Oe(s) {
|
|
4031
|
+
const t = Array.from(s.attributes).filter((e) => gs(e, s)).map(bs);
|
|
4013
4032
|
return [
|
|
4014
|
-
...t.map(
|
|
4015
|
-
...t.map(
|
|
4033
|
+
...t.map(ps),
|
|
4034
|
+
...t.map(ms)
|
|
4016
4035
|
];
|
|
4017
4036
|
}
|
|
4018
|
-
function
|
|
4019
|
-
const t = s.map(
|
|
4037
|
+
function vs(s) {
|
|
4038
|
+
const t = s.map(Oe);
|
|
4020
4039
|
return at(t);
|
|
4021
4040
|
}
|
|
4022
|
-
function
|
|
4041
|
+
function Le(s) {
|
|
4023
4042
|
var t;
|
|
4024
|
-
return ((t = s.getAttribute("class")) !== null && t !== void 0 ? t : "").trim().split(/\s+/).filter((e) => !
|
|
4043
|
+
return ((t = s.getAttribute("class")) !== null && t !== void 0 ? t : "").trim().split(/\s+/).filter((e) => !ds.test(e)).map((e) => `.${rt(e)}`);
|
|
4025
4044
|
}
|
|
4026
|
-
function
|
|
4027
|
-
const t = s.map(
|
|
4045
|
+
function As(s) {
|
|
4046
|
+
const t = s.map(Le);
|
|
4028
4047
|
return at(t);
|
|
4029
4048
|
}
|
|
4030
|
-
function
|
|
4049
|
+
function ze(s) {
|
|
4031
4050
|
var t;
|
|
4032
4051
|
const e = (t = s.getAttribute("id")) !== null && t !== void 0 ? t : "", i = `#${rt(e)}`, r = s.getRootNode({ composed: !1 });
|
|
4033
|
-
return !
|
|
4052
|
+
return !us.test(e) && ee([s], i, r) ? [i] : [];
|
|
4034
4053
|
}
|
|
4035
|
-
function
|
|
4036
|
-
return s.length === 0 || s.length > 1 ? [] :
|
|
4054
|
+
function ws(s) {
|
|
4055
|
+
return s.length === 0 || s.length > 1 ? [] : ze(s[0]);
|
|
4037
4056
|
}
|
|
4038
|
-
function
|
|
4057
|
+
function Ce(s) {
|
|
4039
4058
|
var t;
|
|
4040
4059
|
const e = (t = s.parentElement) === null || t === void 0 ? void 0 : t.children;
|
|
4041
4060
|
if (e) {
|
|
@@ -4045,22 +4064,22 @@ function ze(s) {
|
|
|
4045
4064
|
}
|
|
4046
4065
|
return [];
|
|
4047
4066
|
}
|
|
4048
|
-
function
|
|
4049
|
-
return at(s.map(
|
|
4067
|
+
function ys(s) {
|
|
4068
|
+
return at(s.map(Ce));
|
|
4050
4069
|
}
|
|
4051
|
-
function
|
|
4070
|
+
function Re(s) {
|
|
4052
4071
|
return [
|
|
4053
4072
|
rt(s.tagName.toLowerCase())
|
|
4054
4073
|
];
|
|
4055
4074
|
}
|
|
4056
|
-
function
|
|
4075
|
+
function ke(s) {
|
|
4057
4076
|
const t = [
|
|
4058
|
-
...new Set(
|
|
4077
|
+
...new Set(cs(s.map(Re)))
|
|
4059
4078
|
];
|
|
4060
4079
|
return t.length === 0 || t.length > 1 ? [] : [t[0]];
|
|
4061
4080
|
}
|
|
4062
|
-
function
|
|
4063
|
-
const t =
|
|
4081
|
+
function Pe(s) {
|
|
4082
|
+
const t = ke([s])[0], e = s.parentElement;
|
|
4064
4083
|
if (e) {
|
|
4065
4084
|
const r = Array.from(e.children).filter((n) => n.tagName.toLowerCase() === t).indexOf(s);
|
|
4066
4085
|
if (r > -1)
|
|
@@ -4070,18 +4089,18 @@ function ke(s) {
|
|
|
4070
4089
|
}
|
|
4071
4090
|
return [];
|
|
4072
4091
|
}
|
|
4073
|
-
function
|
|
4074
|
-
return at(s.map(
|
|
4092
|
+
function Ss(s) {
|
|
4093
|
+
return at(s.map(Pe));
|
|
4075
4094
|
}
|
|
4076
|
-
function*
|
|
4077
|
-
let e = 0, i =
|
|
4095
|
+
function* De(s = [], { maxResults: t = Number.POSITIVE_INFINITY } = {}) {
|
|
4096
|
+
let e = 0, i = Pt(1);
|
|
4078
4097
|
for (; i.length <= s.length && e < t; )
|
|
4079
|
-
e += 1, yield i.map((n) => s[n]), i =
|
|
4098
|
+
e += 1, yield i.map((n) => s[n]), i = Ts(i, s.length - 1);
|
|
4080
4099
|
}
|
|
4081
|
-
function
|
|
4082
|
-
return Array.from(
|
|
4100
|
+
function Es(s = [], { maxResults: t = Number.POSITIVE_INFINITY } = {}) {
|
|
4101
|
+
return Array.from(De(s, { maxResults: t }));
|
|
4083
4102
|
}
|
|
4084
|
-
function
|
|
4103
|
+
function Ts(s = [], t = 0) {
|
|
4085
4104
|
const e = s.length;
|
|
4086
4105
|
if (e === 0)
|
|
4087
4106
|
return [];
|
|
@@ -4090,15 +4109,15 @@ function Ss(s = [], t = 0) {
|
|
|
4090
4109
|
for (let r = e - 1; r >= 0; r--)
|
|
4091
4110
|
if (i[r] > t) {
|
|
4092
4111
|
if (r === 0)
|
|
4093
|
-
return
|
|
4112
|
+
return Pt(e + 1);
|
|
4094
4113
|
i[r - 1]++, i[r] = i[r - 1] + 1;
|
|
4095
4114
|
}
|
|
4096
|
-
return i[e - 1] > t ?
|
|
4115
|
+
return i[e - 1] > t ? Pt(e + 1) : i;
|
|
4097
4116
|
}
|
|
4098
|
-
function
|
|
4117
|
+
function Pt(s = 1) {
|
|
4099
4118
|
return Array.from(Array(s).keys());
|
|
4100
4119
|
}
|
|
4101
|
-
function*
|
|
4120
|
+
function* Is(s = {}) {
|
|
4102
4121
|
const t = Object.entries(s);
|
|
4103
4122
|
if (t.length === 0)
|
|
4104
4123
|
return;
|
|
@@ -4122,126 +4141,126 @@ function* Es(s = {}) {
|
|
|
4122
4141
|
});
|
|
4123
4142
|
}
|
|
4124
4143
|
}
|
|
4125
|
-
const
|
|
4144
|
+
const xs = "3a".toUpperCase(), Ns = /[ !"#$%&'()\[\]{|}<>*+,./;=?@^`~\\]/;
|
|
4126
4145
|
function rt(s = "") {
|
|
4127
|
-
return CSS ? CSS.escape(s) :
|
|
4128
|
-
}
|
|
4129
|
-
function
|
|
4130
|
-
return s.split("").map((t) => t === ":" ? `\\${
|
|
4131
|
-
}
|
|
4132
|
-
const
|
|
4146
|
+
return CSS ? CSS.escape(s) : Os(s);
|
|
4147
|
+
}
|
|
4148
|
+
function Os(s = "") {
|
|
4149
|
+
return s.split("").map((t) => t === ":" ? `\\${xs} ` : Ns.test(t) ? `\\${t}` : escape(t).replace(/%/g, "\\")).join("");
|
|
4150
|
+
}
|
|
4151
|
+
const Ls = {
|
|
4152
|
+
tag: ke,
|
|
4153
|
+
id: ws,
|
|
4154
|
+
class: As,
|
|
4155
|
+
attribute: vs,
|
|
4156
|
+
nthchild: ys,
|
|
4157
|
+
nthoftype: Ss
|
|
4158
|
+
}, zs = {
|
|
4133
4159
|
tag: Re,
|
|
4134
|
-
id:
|
|
4135
|
-
class:
|
|
4136
|
-
attribute:
|
|
4137
|
-
nthchild:
|
|
4138
|
-
nthoftype:
|
|
4139
|
-
}, Os = {
|
|
4140
|
-
tag: Ce,
|
|
4141
|
-
id: Le,
|
|
4142
|
-
class: Oe,
|
|
4143
|
-
attribute: Ne,
|
|
4144
|
-
nthchild: ze,
|
|
4145
|
-
nthoftype: ke
|
|
4160
|
+
id: ze,
|
|
4161
|
+
class: Le,
|
|
4162
|
+
attribute: Oe,
|
|
4163
|
+
nthchild: Ce,
|
|
4164
|
+
nthoftype: Pe
|
|
4146
4165
|
};
|
|
4147
|
-
function
|
|
4148
|
-
return
|
|
4166
|
+
function Cs(s, t) {
|
|
4167
|
+
return zs[t](s);
|
|
4149
4168
|
}
|
|
4150
|
-
function
|
|
4151
|
-
const e =
|
|
4169
|
+
function Rs(s, t) {
|
|
4170
|
+
const e = Ls[t];
|
|
4152
4171
|
return e(s);
|
|
4153
4172
|
}
|
|
4154
|
-
function
|
|
4173
|
+
function ks(s = [], t, e) {
|
|
4155
4174
|
return s.filter((i) => e(i) || !t(i));
|
|
4156
4175
|
}
|
|
4157
|
-
function
|
|
4176
|
+
function Ps(s = [], t) {
|
|
4158
4177
|
return s.sort((e, i) => {
|
|
4159
4178
|
const r = t(e), n = t(i);
|
|
4160
4179
|
return r && !n ? -1 : !r && n ? 1 : 0;
|
|
4161
4180
|
});
|
|
4162
4181
|
}
|
|
4163
|
-
function*
|
|
4164
|
-
const e = /* @__PURE__ */ new Set(), i =
|
|
4165
|
-
for (const r of
|
|
4182
|
+
function* Ds(s, t) {
|
|
4183
|
+
const e = /* @__PURE__ */ new Set(), i = Us(s, t);
|
|
4184
|
+
for (const r of Ws(i, t))
|
|
4166
4185
|
e.has(r) || (e.add(r), yield r);
|
|
4167
4186
|
}
|
|
4168
|
-
function
|
|
4169
|
-
const { blacklist: e, whitelist: i, combineWithinSelector: r, maxCombinations: n } = t, a =
|
|
4170
|
-
const u =
|
|
4171
|
-
return p[m] = r ? Array.from(
|
|
4187
|
+
function Us(s, t) {
|
|
4188
|
+
const { blacklist: e, whitelist: i, combineWithinSelector: r, maxCombinations: n } = t, a = kt(e), o = kt(i), l = (p, m) => {
|
|
4189
|
+
const u = Rs(s, m), g = ks(u, a, o), A = Ps(g, o);
|
|
4190
|
+
return p[m] = r ? Array.from(De(A, { maxResults: n })) : A.map((k) => [k]), p;
|
|
4172
4191
|
};
|
|
4173
|
-
return
|
|
4192
|
+
return Ms(t).reduce(l, {});
|
|
4174
4193
|
}
|
|
4175
|
-
function
|
|
4194
|
+
function Ms(s) {
|
|
4176
4195
|
const { selectors: t, includeTag: e } = s, i = [...t];
|
|
4177
4196
|
return e && !i.includes("tag") && i.push("tag"), i;
|
|
4178
4197
|
}
|
|
4179
|
-
function
|
|
4198
|
+
function Bs(s) {
|
|
4180
4199
|
return s.includes(E.tag) || s.includes(E.nthoftype) ? [...s] : [...s, E.tag];
|
|
4181
4200
|
}
|
|
4182
|
-
function
|
|
4183
|
-
const { selectors: t, combineBetweenSelectors: e, includeTag: i, maxCandidates: r } = s, n = e ?
|
|
4184
|
-
return i ? n.map(
|
|
4201
|
+
function Gs(s) {
|
|
4202
|
+
const { selectors: t, combineBetweenSelectors: e, includeTag: i, maxCandidates: r } = s, n = e ? Es(t, { maxResults: r }) : t.map((a) => [a]);
|
|
4203
|
+
return i ? n.map(Bs) : n;
|
|
4185
4204
|
}
|
|
4186
|
-
function*
|
|
4187
|
-
for (const e of
|
|
4188
|
-
yield*
|
|
4205
|
+
function* Ws(s, t) {
|
|
4206
|
+
for (const e of Gs(t))
|
|
4207
|
+
yield* Hs(e, s);
|
|
4189
4208
|
}
|
|
4190
|
-
function*
|
|
4209
|
+
function* Hs(s, t) {
|
|
4191
4210
|
const e = {};
|
|
4192
4211
|
for (const i of s) {
|
|
4193
4212
|
const r = t[i];
|
|
4194
4213
|
r && r.length > 0 && (e[i] = r);
|
|
4195
4214
|
}
|
|
4196
|
-
for (const i of
|
|
4197
|
-
yield
|
|
4215
|
+
for (const i of Is(e))
|
|
4216
|
+
yield _s(i);
|
|
4198
4217
|
}
|
|
4199
|
-
function
|
|
4218
|
+
function Fs(s, t) {
|
|
4200
4219
|
return t[s] ? t[s].join("") : "";
|
|
4201
4220
|
}
|
|
4202
|
-
function
|
|
4203
|
-
const t = [...
|
|
4204
|
-
return s[E.tag] && s[E.nthoftype] && t.splice(t.indexOf(E.tag), 1), t.map((e) =>
|
|
4221
|
+
function _s(s = {}) {
|
|
4222
|
+
const t = [...Ne];
|
|
4223
|
+
return s[E.tag] && s[E.nthoftype] && t.splice(t.indexOf(E.tag), 1), t.map((e) => Fs(e, s)).join("");
|
|
4205
4224
|
}
|
|
4206
|
-
function
|
|
4225
|
+
function Vs(s, t) {
|
|
4207
4226
|
return [
|
|
4208
|
-
...s.map((e) => t +
|
|
4209
|
-
...s.map((e) => t +
|
|
4227
|
+
...s.map((e) => t + vt.DESCENDANT + e),
|
|
4228
|
+
...s.map((e) => t + vt.CHILD + e)
|
|
4210
4229
|
];
|
|
4211
4230
|
}
|
|
4212
|
-
function*
|
|
4231
|
+
function* Ys(s, t) {
|
|
4213
4232
|
if (t === "")
|
|
4214
4233
|
yield* s;
|
|
4215
4234
|
else
|
|
4216
4235
|
for (const e of s)
|
|
4217
|
-
yield*
|
|
4236
|
+
yield* Vs([e], t);
|
|
4218
4237
|
}
|
|
4219
|
-
function*
|
|
4220
|
-
const r =
|
|
4221
|
-
for (const n of
|
|
4222
|
-
|
|
4238
|
+
function* $s(s, t, e = "", i) {
|
|
4239
|
+
const r = Ds(s, i);
|
|
4240
|
+
for (const n of Ys(r, e))
|
|
4241
|
+
ee(s, n, t) && (yield n);
|
|
4223
4242
|
}
|
|
4224
|
-
function*
|
|
4243
|
+
function* Ks(s, t, e = "", i) {
|
|
4225
4244
|
if (s.length === 0)
|
|
4226
4245
|
return null;
|
|
4227
4246
|
const r = [
|
|
4228
4247
|
s.length > 1 ? s : [],
|
|
4229
|
-
...
|
|
4248
|
+
...hs(s, t).map((n) => [n])
|
|
4230
4249
|
];
|
|
4231
4250
|
for (const n of r)
|
|
4232
|
-
for (const a of
|
|
4251
|
+
for (const a of $s(n, t, e, i))
|
|
4233
4252
|
yield {
|
|
4234
4253
|
foundElements: n,
|
|
4235
4254
|
selector: a
|
|
4236
4255
|
};
|
|
4237
4256
|
}
|
|
4238
|
-
function*
|
|
4257
|
+
function* Xs({ elements: s, root: t, rootSelector: e = "", options: i }) {
|
|
4239
4258
|
let r = t, n = e, a = !0;
|
|
4240
4259
|
for (; a; ) {
|
|
4241
4260
|
let o = !1;
|
|
4242
|
-
for (const l of
|
|
4261
|
+
for (const l of Ks(s, r, n, i)) {
|
|
4243
4262
|
const { foundElements: p, selector: m } = l;
|
|
4244
|
-
if (o = !0,
|
|
4263
|
+
if (o = !0, ee(s, m, t))
|
|
4245
4264
|
yield m;
|
|
4246
4265
|
else {
|
|
4247
4266
|
r = p[0], n = m;
|
|
@@ -4251,29 +4270,29 @@ function* $s({ elements: s, root: t, rootSelector: e = "", options: i }) {
|
|
|
4251
4270
|
o || (a = !1);
|
|
4252
4271
|
}
|
|
4253
4272
|
}
|
|
4254
|
-
function
|
|
4273
|
+
function Zs(s) {
|
|
4255
4274
|
(s instanceof NodeList || s instanceof HTMLCollection) && (s = Array.from(s));
|
|
4256
|
-
const t = (Array.isArray(s) ? s : [s]).filter(
|
|
4275
|
+
const t = (Array.isArray(s) ? s : [s]).filter(Se);
|
|
4257
4276
|
return [...new Set(t)];
|
|
4258
4277
|
}
|
|
4259
|
-
function
|
|
4278
|
+
function Js(s) {
|
|
4260
4279
|
return {
|
|
4261
4280
|
value: s,
|
|
4262
4281
|
include: !1
|
|
4263
4282
|
};
|
|
4264
4283
|
}
|
|
4265
|
-
function
|
|
4284
|
+
function qs(s, t, e = vt.NONE) {
|
|
4266
4285
|
const i = {};
|
|
4267
4286
|
return t.forEach((r) => {
|
|
4268
|
-
Reflect.set(i, r,
|
|
4287
|
+
Reflect.set(i, r, Cs(s, r).map(Js));
|
|
4269
4288
|
}), {
|
|
4270
4289
|
element: s,
|
|
4271
4290
|
operator: e,
|
|
4272
4291
|
selectors: i
|
|
4273
4292
|
};
|
|
4274
4293
|
}
|
|
4275
|
-
function
|
|
4276
|
-
let e = [...
|
|
4294
|
+
function Qs({ selectors: s, operator: t }) {
|
|
4295
|
+
let e = [...Ne];
|
|
4277
4296
|
s[E.tag] && s[E.nthoftype] && (e = e.filter((r) => r !== E.tag));
|
|
4278
4297
|
let i = "";
|
|
4279
4298
|
return e.forEach((r) => {
|
|
@@ -4283,31 +4302,31 @@ function Js({ selectors: s, operator: t }) {
|
|
|
4283
4302
|
});
|
|
4284
4303
|
}), t + i;
|
|
4285
4304
|
}
|
|
4286
|
-
function
|
|
4287
|
-
const i =
|
|
4305
|
+
function js(s, t) {
|
|
4306
|
+
const i = Ie(s, t).reverse().map((r) => {
|
|
4288
4307
|
var n;
|
|
4289
|
-
const a =
|
|
4308
|
+
const a = qs(r, [E.nthchild], vt.CHILD);
|
|
4290
4309
|
return ((n = a.selectors.nthchild) !== null && n !== void 0 ? n : []).forEach((o) => {
|
|
4291
4310
|
o.include = !0;
|
|
4292
4311
|
}), a;
|
|
4293
4312
|
});
|
|
4294
4313
|
return [
|
|
4295
4314
|
t ? ":scope" : ":root",
|
|
4296
|
-
...i.map(
|
|
4315
|
+
...i.map(Qs)
|
|
4297
4316
|
].join("");
|
|
4298
4317
|
}
|
|
4299
|
-
function
|
|
4300
|
-
return s.map((e) =>
|
|
4318
|
+
function tr(s, t) {
|
|
4319
|
+
return s.map((e) => js(e, t)).join(xe);
|
|
4301
4320
|
}
|
|
4302
|
-
function
|
|
4321
|
+
function Ue(s, t = {}) {
|
|
4303
4322
|
const e = Object.assign(Object.assign({}, t), { maxResults: 1 });
|
|
4304
|
-
return
|
|
4323
|
+
return er(s, e).next().value;
|
|
4305
4324
|
}
|
|
4306
|
-
function*
|
|
4325
|
+
function* er(s, t = {}) {
|
|
4307
4326
|
var e;
|
|
4308
|
-
const i =
|
|
4327
|
+
const i = Zs(s), r = os(i[0], t), n = (e = r.root) !== null && e !== void 0 ? e : ie(i[0]);
|
|
4309
4328
|
let a = 0;
|
|
4310
|
-
for (const o of
|
|
4329
|
+
for (const o of Xs({
|
|
4311
4330
|
elements: i,
|
|
4312
4331
|
options: r,
|
|
4313
4332
|
root: n,
|
|
@@ -4315,9 +4334,9 @@ function* js(s, t = {}) {
|
|
|
4315
4334
|
}))
|
|
4316
4335
|
if (yield o, a++, a >= r.maxResults)
|
|
4317
4336
|
return;
|
|
4318
|
-
i.length > 1 && (yield i.map((o) =>
|
|
4337
|
+
i.length > 1 && (yield i.map((o) => Ue(o, r)).join(xe), a++, a >= r.maxResults) || (yield tr(i, r.useScope ? n : void 0));
|
|
4319
4338
|
}
|
|
4320
|
-
class
|
|
4339
|
+
class pr extends te {
|
|
4321
4340
|
constructor(t, e, i = 50) {
|
|
4322
4341
|
super(), this.resource = t, this.locator = e, this.beforeMaxLength = i, this.currentElement = null, this.currentIndex = null, this.parsedElementRecipes = null, this.parser = null;
|
|
4323
4342
|
}
|
|
@@ -4352,15 +4371,15 @@ class dr extends jt {
|
|
|
4352
4371
|
}
|
|
4353
4372
|
async parseElements() {
|
|
4354
4373
|
const t = await this.resource.readAsString(), e = new DOMParser().parseFromString(t, this.locator.type);
|
|
4355
|
-
return this.parser = new
|
|
4374
|
+
return this.parser = new sr(
|
|
4356
4375
|
e,
|
|
4357
4376
|
this.locator,
|
|
4358
4377
|
this.locator.locations.getCssSelector() ? e.querySelector(this.locator.locations.getCssSelector()) : null,
|
|
4359
4378
|
this.beforeMaxLength
|
|
4360
|
-
),
|
|
4379
|
+
), ir(this.parser, e.body), this.parser.result();
|
|
4361
4380
|
}
|
|
4362
4381
|
}
|
|
4363
|
-
function
|
|
4382
|
+
function ir(s, t) {
|
|
4364
4383
|
let e = t, i = 0;
|
|
4365
4384
|
for (; e != null; )
|
|
4366
4385
|
if (s.head(e, i), e.firstChild != null)
|
|
@@ -4373,7 +4392,7 @@ function tr(s, t) {
|
|
|
4373
4392
|
e = e?.nextSibling || null;
|
|
4374
4393
|
}
|
|
4375
4394
|
}
|
|
4376
|
-
class
|
|
4395
|
+
class sr {
|
|
4377
4396
|
constructor(t, e, i, r) {
|
|
4378
4397
|
this.doc = t, this.baseLocator = e, this.startElement = i, this.beforeMaxLength = r, this.elementRecipes = [], this.startIndex = 0, this.segmentRecipesAcc = [], this.textAcc = "", this.wholeRawTextAcc = null, this.elementRawTextAcc = "", this.rawTextAcc = "", this.currentLanguage = null, this.breadcrumbs = [], this.recipeCssSelectorCache = /* @__PURE__ */ new WeakMap();
|
|
4379
4398
|
}
|
|
@@ -4387,7 +4406,7 @@ class er {
|
|
|
4387
4406
|
const e = t.recipe.cssSelectorNode ? this.cssSelector(t.recipe.cssSelectorNode) : null;
|
|
4388
4407
|
if (t.type === 1) {
|
|
4389
4408
|
const i = t.recipe;
|
|
4390
|
-
return new
|
|
4409
|
+
return new Hi(
|
|
4391
4410
|
new D({
|
|
4392
4411
|
href: this.baseLocator.href,
|
|
4393
4412
|
type: this.baseLocator.type,
|
|
@@ -4415,22 +4434,22 @@ class er {
|
|
|
4415
4434
|
])
|
|
4416
4435
|
} : {})
|
|
4417
4436
|
}), r = t.recipe;
|
|
4418
|
-
return t.type === 3 ? new
|
|
4437
|
+
return t.type === 3 ? new Wi(
|
|
4419
4438
|
i,
|
|
4420
4439
|
r.link
|
|
4421
|
-
) : new
|
|
4440
|
+
) : new Gi(
|
|
4422
4441
|
i,
|
|
4423
4442
|
r.link
|
|
4424
4443
|
);
|
|
4425
4444
|
} else if (t.type === 0) {
|
|
4426
4445
|
const i = t.recipe, r = i.segments.map((n) => {
|
|
4427
4446
|
const a = n.cssSelectorNode ? this.cssSelector(n.cssSelectorNode) : null;
|
|
4428
|
-
return new
|
|
4447
|
+
return new ve(
|
|
4429
4448
|
new D({
|
|
4430
4449
|
href: this.baseLocator.href,
|
|
4431
4450
|
type: this.baseLocator.type,
|
|
4432
4451
|
title: this.baseLocator.title,
|
|
4433
|
-
text:
|
|
4452
|
+
text: ue(n.text, this.wholeRawTextAcc?.substring(n.beforeRange[0], n.beforeRange[1])),
|
|
4434
4453
|
locations: new T(a ? {
|
|
4435
4454
|
otherLocations: /* @__PURE__ */ new Map([
|
|
4436
4455
|
["cssSelector", a]
|
|
@@ -4441,12 +4460,12 @@ class er {
|
|
|
4441
4460
|
n.attributes
|
|
4442
4461
|
);
|
|
4443
4462
|
});
|
|
4444
|
-
return new
|
|
4463
|
+
return new Rt(
|
|
4445
4464
|
new D({
|
|
4446
4465
|
href: this.baseLocator.href,
|
|
4447
4466
|
type: this.baseLocator.type,
|
|
4448
4467
|
title: this.baseLocator.title,
|
|
4449
|
-
text:
|
|
4468
|
+
text: ue(i.text, r.length && r[0].locator.text?.before || ""),
|
|
4450
4469
|
locations: new T(e ? {
|
|
4451
4470
|
otherLocations: /* @__PURE__ */ new Map([
|
|
4452
4471
|
["cssSelector", e]
|
|
@@ -4471,7 +4490,7 @@ class er {
|
|
|
4471
4490
|
}
|
|
4472
4491
|
n = n.parentElement;
|
|
4473
4492
|
}
|
|
4474
|
-
const a =
|
|
4493
|
+
const a = Ue(e, {
|
|
4475
4494
|
root: this.doc
|
|
4476
4495
|
});
|
|
4477
4496
|
return r.forEach((o, l) => o.forEach((p) => l.attributes.setNamedItem(p))), this.recipeCssSelectorCache.set(e, a), a;
|
|
@@ -4479,14 +4498,14 @@ class er {
|
|
|
4479
4498
|
// Implements NodeTraversor
|
|
4480
4499
|
head(t, e) {
|
|
4481
4500
|
if (t.nodeType == Node.ELEMENT_NODE) {
|
|
4482
|
-
const i = !
|
|
4501
|
+
const i = !he(t);
|
|
4483
4502
|
i && (this.flushText(), this.breadcrumbs.push(t));
|
|
4484
4503
|
const r = t.nodeName.toUpperCase();
|
|
4485
4504
|
if (r === "BR")
|
|
4486
4505
|
this.flushText();
|
|
4487
4506
|
else if (r === "IMG" || r === "AUDIO" || r === "VIDEO")
|
|
4488
4507
|
if (this.flushText(), r === "IMG") {
|
|
4489
|
-
const n = t, a =
|
|
4508
|
+
const n = t, a = Tt(n, this.baseLocator.href);
|
|
4490
4509
|
let o = n.getAttribute("alt");
|
|
4491
4510
|
o?.length || (o = n.getAttribute("title")), a != null && this.elementRecipes.push({
|
|
4492
4511
|
type: 1,
|
|
@@ -4495,14 +4514,14 @@ class er {
|
|
|
4495
4514
|
caption: void 0,
|
|
4496
4515
|
// FIXME: Get the caption from figcaption
|
|
4497
4516
|
cssSelectorNode: t,
|
|
4498
|
-
attributes: o?.length ? [new
|
|
4499
|
-
|
|
4517
|
+
attributes: o?.length ? [new ce(
|
|
4518
|
+
Ct.ACCESSIBILITY_LABEL,
|
|
4500
4519
|
o
|
|
4501
4520
|
)] : []
|
|
4502
4521
|
}
|
|
4503
4522
|
});
|
|
4504
4523
|
} else {
|
|
4505
|
-
const n = t, a =
|
|
4524
|
+
const n = t, a = Tt(n, this.baseLocator.href);
|
|
4506
4525
|
let o;
|
|
4507
4526
|
if (a != null)
|
|
4508
4527
|
o = new M({
|
|
@@ -4510,7 +4529,7 @@ class er {
|
|
|
4510
4529
|
});
|
|
4511
4530
|
else {
|
|
4512
4531
|
const l = [...n.getElementsByTagName("source")].map((p) => {
|
|
4513
|
-
const m =
|
|
4532
|
+
const m = Tt(p, this.baseLocator.href);
|
|
4514
4533
|
return m ? new M({
|
|
4515
4534
|
href: m,
|
|
4516
4535
|
type: p.getAttribute("type") || void 0
|
|
@@ -4542,23 +4561,23 @@ class er {
|
|
|
4542
4561
|
// Implements NodeTraversor
|
|
4543
4562
|
tail(t, e) {
|
|
4544
4563
|
if (t.nodeType === Node.TEXT_NODE && !ct(t.textContent)) {
|
|
4545
|
-
const i =
|
|
4546
|
-
this.currentLanguage !== i && (this.flushSegment(), this.currentLanguage = i), this.rawTextAcc += t.textContent, this.textAcc =
|
|
4547
|
-
} else if (t.nodeType === Node.ELEMENT_NODE && !
|
|
4564
|
+
const i = ji(t.parentElement);
|
|
4565
|
+
this.currentLanguage !== i && (this.flushSegment(), this.currentLanguage = i), this.rawTextAcc += t.textContent, this.textAcc = ts(this.textAcc, t.textContent);
|
|
4566
|
+
} else if (t.nodeType === Node.ELEMENT_NODE && !he(t)) {
|
|
4548
4567
|
if (!this.breadcrumbs.length || this.breadcrumbs.at(-1) !== t) throw new Error("HTMLContentIterator: breadcrumbs mismatch");
|
|
4549
4568
|
this.flushText(), this.breadcrumbs.pop();
|
|
4550
4569
|
}
|
|
4551
4570
|
}
|
|
4552
4571
|
flushText() {
|
|
4553
4572
|
if (this.flushSegment(), this.startIndex === 0 && this.startElement && this.breadcrumbs.length && this.breadcrumbs.at(-1) === this.startElement && (this.startIndex = this.elementRecipes.length), !this.segmentRecipesAcc.length) return;
|
|
4554
|
-
this.segmentRecipesAcc[this.segmentRecipesAcc.length - 1].text =
|
|
4573
|
+
this.segmentRecipesAcc[this.segmentRecipesAcc.length - 1].text = Qi(
|
|
4555
4574
|
this.segmentRecipesAcc[this.segmentRecipesAcc.length - 1].text
|
|
4556
4575
|
);
|
|
4557
|
-
let t =
|
|
4576
|
+
let t = _i;
|
|
4558
4577
|
if (this.breadcrumbs.length > 0) {
|
|
4559
4578
|
const e = this.breadcrumbs.at(-1);
|
|
4560
4579
|
if (e.getAttributeNS("http://www.idpf.org/2007/ops", "type") === "footnote")
|
|
4561
|
-
t =
|
|
4580
|
+
t = Vi;
|
|
4562
4581
|
else
|
|
4563
4582
|
switch (e.nodeName.toUpperCase()) {
|
|
4564
4583
|
case "H1":
|
|
@@ -4567,11 +4586,11 @@ class er {
|
|
|
4567
4586
|
case "H4":
|
|
4568
4587
|
case "H5":
|
|
4569
4588
|
case "H6":
|
|
4570
|
-
t = new
|
|
4589
|
+
t = new Fi(parseInt(e.nodeName[1]));
|
|
4571
4590
|
break;
|
|
4572
4591
|
case "BLOCKQUOTE":
|
|
4573
4592
|
case "Q":
|
|
4574
|
-
t = new
|
|
4593
|
+
t = new Yi(
|
|
4575
4594
|
e.getAttribute("cite")?.length ? new URL(e.getAttribute("cite")) : void 0,
|
|
4576
4595
|
e.getAttribute("title") || void 0
|
|
4577
4596
|
);
|
|
@@ -4590,17 +4609,17 @@ class er {
|
|
|
4590
4609
|
}
|
|
4591
4610
|
flushSegment() {
|
|
4592
4611
|
let t = this.textAcc;
|
|
4593
|
-
const e =
|
|
4612
|
+
const e = ye(t);
|
|
4594
4613
|
if (!ct(e)) {
|
|
4595
4614
|
if (!this.segmentRecipesAcc.length) {
|
|
4596
|
-
t =
|
|
4615
|
+
t = qi(t);
|
|
4597
4616
|
const i = t.length && ct(t[t.length - 1]) ? t[t.length - 1] : "";
|
|
4598
4617
|
t = e + i;
|
|
4599
4618
|
}
|
|
4600
4619
|
this.segmentRecipesAcc.push({
|
|
4601
4620
|
text: t,
|
|
4602
|
-
attributes: this.currentLanguage ? [new
|
|
4603
|
-
|
|
4621
|
+
attributes: this.currentLanguage ? [new ce(
|
|
4622
|
+
Ct.LANGUAGE,
|
|
4604
4623
|
this.currentLanguage
|
|
4605
4624
|
)] : [],
|
|
4606
4625
|
beforeRange: this.wholeRawTextAcc ? [this.wholeRawTextAcc.length - this.beforeMaxLength, this.wholeRawTextAcc.length] : [0, 0],
|
|
@@ -4610,7 +4629,7 @@ class er {
|
|
|
4610
4629
|
this.rawTextAcc.length && (this.wholeRawTextAcc = (this.wholeRawTextAcc || "") + this.rawTextAcc, this.elementRawTextAcc += this.rawTextAcc), this.rawTextAcc = "", this.textAcc = "";
|
|
4611
4630
|
}
|
|
4612
4631
|
}
|
|
4613
|
-
class
|
|
4632
|
+
class wt {
|
|
4614
4633
|
/**
|
|
4615
4634
|
* Creates a [LocatorMetadata].
|
|
4616
4635
|
*/
|
|
@@ -4625,7 +4644,7 @@ class At {
|
|
|
4625
4644
|
const e = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set(["title", "numberOfItems"]);
|
|
4626
4645
|
return Object.entries(t).forEach(([r, n]) => {
|
|
4627
4646
|
i.has(r) || e.set(r, n);
|
|
4628
|
-
}), new
|
|
4647
|
+
}), new wt({
|
|
4629
4648
|
title: B.deserialize(t.title),
|
|
4630
4649
|
numberOfItems: Z(t.numberOfItems),
|
|
4631
4650
|
otherMetadata: e.size === 0 ? void 0 : e
|
|
@@ -4639,12 +4658,12 @@ class At {
|
|
|
4639
4658
|
return this.title && (t.title = this.title.serialize()), this.numberOfItems !== void 0 && (t.numberOfItems = this.numberOfItems), this.otherMetadata && this.otherMetadata.forEach((e, i) => t[i] = e), t;
|
|
4640
4659
|
}
|
|
4641
4660
|
}
|
|
4642
|
-
class
|
|
4661
|
+
class Me {
|
|
4643
4662
|
/**
|
|
4644
4663
|
* Creates a [LocatorCollection].
|
|
4645
4664
|
*/
|
|
4646
4665
|
constructor(t) {
|
|
4647
|
-
this.metadata = t.metadata ?? new
|
|
4666
|
+
this.metadata = t.metadata ?? new wt({}), this.links = t.links ?? new x([]), this.locators = t.locators ?? [];
|
|
4648
4667
|
}
|
|
4649
4668
|
/**
|
|
4650
4669
|
* Parses a [LocatorCollection] from its RWPM JSON representation.
|
|
@@ -4652,8 +4671,8 @@ class Ue {
|
|
|
4652
4671
|
static deserialize(t) {
|
|
4653
4672
|
if (!t) return;
|
|
4654
4673
|
let e, i = t.locators;
|
|
4655
|
-
return i && Array.isArray(i) && (e = i.map((r) => D.deserialize(r)).filter((r) => r !== void 0)), new
|
|
4656
|
-
metadata:
|
|
4674
|
+
return i && Array.isArray(i) && (e = i.map((r) => D.deserialize(r)).filter((r) => r !== void 0)), new Me({
|
|
4675
|
+
metadata: wt.deserialize(t.metadata),
|
|
4657
4676
|
links: x.deserialize(t.links),
|
|
4658
4677
|
locators: e
|
|
4659
4678
|
});
|
|
@@ -4737,7 +4756,7 @@ class H {
|
|
|
4737
4756
|
);
|
|
4738
4757
|
}
|
|
4739
4758
|
}
|
|
4740
|
-
class
|
|
4759
|
+
class Be {
|
|
4741
4760
|
constructor(t) {
|
|
4742
4761
|
this.context = t.context, this.metadata = t.metadata, this.links = t.links, this.readingOrder = t.readingOrder, this.resources = t.resources, this.toc = t.toc, this.subcollections = t.subcollections;
|
|
4743
4762
|
}
|
|
@@ -4758,7 +4777,7 @@ class Me {
|
|
|
4758
4777
|
const n = /* @__PURE__ */ new Set(["@context", "metadata", "links", "readingOrder", "spine", "resources", "toc"]), a = {};
|
|
4759
4778
|
return Object.keys(t).forEach((o) => {
|
|
4760
4779
|
n.has(o) || (a[o] = t[o]);
|
|
4761
|
-
}), new
|
|
4780
|
+
}), new Be({
|
|
4762
4781
|
context: _(t["@context"]),
|
|
4763
4782
|
metadata: e,
|
|
4764
4783
|
links: i,
|
|
@@ -4868,105 +4887,107 @@ class Me {
|
|
|
4868
4887
|
export {
|
|
4869
4888
|
R as AccessMode,
|
|
4870
4889
|
V as Accessibility,
|
|
4871
|
-
|
|
4872
|
-
|
|
4873
|
-
|
|
4890
|
+
or as AccessibilityMetadataDisplayGuide,
|
|
4891
|
+
xt as AccessibilityProfile,
|
|
4892
|
+
_t as AccessibilitySummary,
|
|
4874
4893
|
tt as Acquisition,
|
|
4875
|
-
|
|
4894
|
+
Gt as AdditionalInformation,
|
|
4876
4895
|
J as AltIdentifier,
|
|
4877
|
-
|
|
4878
|
-
|
|
4879
|
-
|
|
4880
|
-
|
|
4881
|
-
|
|
4882
|
-
|
|
4896
|
+
ce as Attribute,
|
|
4897
|
+
Ct as AttributeKeys,
|
|
4898
|
+
ge as AttributesHolder,
|
|
4899
|
+
Gi as AudioElement,
|
|
4900
|
+
jt as Availability,
|
|
4901
|
+
Bi as AvailabilityStatus,
|
|
4883
4902
|
Q as BelongsTo,
|
|
4884
|
-
|
|
4885
|
-
|
|
4886
|
-
|
|
4887
|
-
|
|
4888
|
-
|
|
4903
|
+
_i as Body,
|
|
4904
|
+
Dt as Certification,
|
|
4905
|
+
Ht as Conformance,
|
|
4906
|
+
lr as Content,
|
|
4907
|
+
be as ContentElement,
|
|
4889
4908
|
dt as Contributor,
|
|
4890
4909
|
O as Contributors,
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4910
|
+
Qt as Copies,
|
|
4911
|
+
Pi as DefaultTextContentTokenizer,
|
|
4912
|
+
Zt as DomRange,
|
|
4913
|
+
bt as DomRangePoint,
|
|
4914
|
+
ii as EmptyFetcher,
|
|
4915
|
+
Vt as Encryption,
|
|
4916
|
+
Ot as Exemption,
|
|
4898
4917
|
v as Feature,
|
|
4899
|
-
|
|
4900
|
-
|
|
4918
|
+
Vi as Footnote,
|
|
4919
|
+
Xt as GuidedNavigationDocument,
|
|
4901
4920
|
X as GuidedNavigationObject,
|
|
4902
4921
|
mt as GuidedNavigationText,
|
|
4903
|
-
|
|
4922
|
+
pr as HTMLResourceContentIterator,
|
|
4904
4923
|
P as Hazard,
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4924
|
+
hi as HazardType,
|
|
4925
|
+
Wt as Hazards,
|
|
4926
|
+
Fi as Heading,
|
|
4927
|
+
qt as Holds,
|
|
4928
|
+
rr as HttpFetcher,
|
|
4929
|
+
si as HttpResource,
|
|
4911
4930
|
it as IllegalStateError,
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4931
|
+
Hi as ImageElement,
|
|
4932
|
+
Di as IntlTextTokenizer,
|
|
4933
|
+
te as Iterator,
|
|
4915
4934
|
K as Layout,
|
|
4916
|
-
|
|
4935
|
+
Ft as Legal,
|
|
4917
4936
|
M as Link,
|
|
4918
4937
|
x as Links,
|
|
4919
4938
|
f as Localization,
|
|
4920
4939
|
B as LocalizedString,
|
|
4921
4940
|
D as Locator,
|
|
4922
|
-
|
|
4923
|
-
|
|
4941
|
+
Me as LocatorCollection,
|
|
4942
|
+
wt as LocatorCollectionMetadata,
|
|
4924
4943
|
T as LocatorLocations,
|
|
4925
4944
|
nt as LocatorText,
|
|
4926
|
-
|
|
4927
|
-
|
|
4945
|
+
Be as Manifest,
|
|
4946
|
+
Yt as MediaOverlay,
|
|
4928
4947
|
c as MediaType,
|
|
4929
4948
|
pt as Metadata,
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
4949
|
+
Ui as NaiveTextTokenizer,
|
|
4950
|
+
Mt as Navigation,
|
|
4951
|
+
oi as NonvisualReading,
|
|
4952
|
+
nr as NumberRange,
|
|
4953
|
+
Et as PDFContentElement,
|
|
4954
|
+
Lt as Page,
|
|
4955
|
+
fr as PageContentIteratorPDF,
|
|
4956
|
+
ci as PrerecordedAudio,
|
|
4957
|
+
Jt as Price,
|
|
4958
|
+
Nt as PrimaryAccessMode,
|
|
4940
4959
|
q as Profile,
|
|
4941
4960
|
U as Properties,
|
|
4942
4961
|
Y as Publication,
|
|
4943
4962
|
H as PublicationCollection,
|
|
4944
|
-
|
|
4963
|
+
dr as PublicationContentIterator,
|
|
4945
4964
|
F as ReadingProgression,
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
4965
|
+
ar as Resource,
|
|
4966
|
+
Bt as RichContent,
|
|
4967
|
+
li as RichContentType,
|
|
4949
4968
|
ft as Subject,
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4969
|
+
$t as Subjects,
|
|
4970
|
+
Kt as TDM,
|
|
4971
|
+
di as TDMReservation,
|
|
4972
|
+
hr as TextContentTokenizer,
|
|
4973
|
+
Rt as TextElement,
|
|
4974
|
+
Yi as TextQuote,
|
|
4975
|
+
ve as TextSegment,
|
|
4976
|
+
ki as TextUnit,
|
|
4977
|
+
yt as TextualElement,
|
|
4959
4978
|
C as Timeline,
|
|
4960
4979
|
ut as URITemplate,
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
|
|
4980
|
+
Wi as VideoElement,
|
|
4981
|
+
ai as VisualAdjustments,
|
|
4982
|
+
Ut as WaysOfReading,
|
|
4983
|
+
ui as arrayfromJSON,
|
|
4965
4984
|
_ as arrayfromJSONorString,
|
|
4966
4985
|
lt as datefromJSON,
|
|
4967
|
-
|
|
4986
|
+
fi as isNptStartOfResource,
|
|
4987
|
+
cr as leadingPage,
|
|
4968
4988
|
Z as numberfromJSON,
|
|
4989
|
+
gt as parseNptTime,
|
|
4969
4990
|
L as positiveNumberfromJSON,
|
|
4970
4991
|
ht as setToArray,
|
|
4971
|
-
|
|
4992
|
+
me as speakableToken
|
|
4972
4993
|
};
|