@readium/navigator 2.5.2-beta.5 → 2.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ReadiumCSS-after-DBPN8It0.js → ReadiumCSS-after-BYNAMW5u.js} +4 -4
- package/dist/{ReadiumCSS-after-CVNJvQab.js → ReadiumCSS-after-C8SjJ_Rf.js} +4 -4
- package/dist/{ReadiumCSS-after-CPAYSG9F.js → ReadiumCSS-after-Dzd22Ssm.js} +6 -7
- package/dist/{ReadiumCSS-after-Cpw6SSeZ.js → ReadiumCSS-after-b-ykC0_O.js} +11 -12
- package/dist/ReadiumCSS-before-6kD9Qj82.js +529 -0
- package/dist/ReadiumCSS-before-CvMFpmud.js +529 -0
- package/dist/ReadiumCSS-before-crwPhKrV.js +529 -0
- package/dist/ReadiumCSS-before-usMdEglk.js +530 -0
- package/dist/{ReadiumCSS-default-BMLfH2r9.js → ReadiumCSS-default-BVp3Ygi2.js} +1 -1
- package/dist/{ReadiumCSS-default-C_BHdXWz.js → ReadiumCSS-default-CL_hP__L.js} +1 -1
- package/dist/{ReadiumCSS-default-BTgk8NbH.js → ReadiumCSS-default-nJgSC4Z_.js} +1 -1
- package/dist/{ReadiumCSS-default-C7kHIm6s.js → ReadiumCSS-default-vv7hNCaM.js} +1 -1
- package/dist/index.js +483 -448
- package/dist/index.umd.cjs +702 -289
- package/package.json +2 -2
- package/src/epub/preferences/EpubPreferencesEditor.ts +6 -6
- package/src/helpers/lineLength.ts +1 -1
- package/src/preferences/Types.ts +21 -1
- package/types/src/preferences/Types.d.ts +15 -0
- package/dist/ReadiumCSS-before-CA1r4W7i.js +0 -425
- package/dist/ReadiumCSS-before-D5x0zuZP.js +0 -425
- package/dist/ReadiumCSS-before-DXNoxSjL.js +0 -426
- package/dist/ReadiumCSS-before-DtkzLMzT.js +0 -425
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const v = class v {
|
|
2
2
|
constructor(t) {
|
|
3
3
|
this.uri = t;
|
|
4
4
|
}
|
|
@@ -7,7 +7,7 @@ const S = class S {
|
|
|
7
7
|
*/
|
|
8
8
|
static deserialize(t) {
|
|
9
9
|
if (!(!t || typeof t != "string"))
|
|
10
|
-
return new
|
|
10
|
+
return new v(t);
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* Serializes an [AccessibilityProfile] to its RWPM JSON representation.
|
|
@@ -19,24 +19,24 @@ const S = class S {
|
|
|
19
19
|
* Returns true if the profile is a WCAG Level A profile.
|
|
20
20
|
*/
|
|
21
21
|
get isWCAGLevelA() {
|
|
22
|
-
return this ===
|
|
22
|
+
return this === v.EPUB_A11Y_10_WCAG_20_A || this === v.EPUB_A11Y_11_WCAG_20_A || this === v.EPUB_A11Y_11_WCAG_21_A || this === v.EPUB_A11Y_11_WCAG_22_A;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* Returns true if the profile is a WCAG Level AA profile.
|
|
26
26
|
*/
|
|
27
27
|
get isWCAGLevelAA() {
|
|
28
|
-
return this ===
|
|
28
|
+
return this === v.EPUB_A11Y_10_WCAG_20_AA || this === v.EPUB_A11Y_11_WCAG_20_AA || this === v.EPUB_A11Y_11_WCAG_21_AA || this === v.EPUB_A11Y_11_WCAG_22_AA;
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
31
|
* Returns true if the profile is a WCAG Level AAA profile.
|
|
32
32
|
*/
|
|
33
33
|
get isWCAGLevelAAA() {
|
|
34
|
-
return this ===
|
|
34
|
+
return this === v.EPUB_A11Y_10_WCAG_20_AAA || this === v.EPUB_A11Y_11_WCAG_20_AAA || this === v.EPUB_A11Y_11_WCAG_21_AAA || this === v.EPUB_A11Y_11_WCAG_22_AAA;
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
|
|
38
|
-
let Qe =
|
|
39
|
-
const
|
|
37
|
+
v.EPUB_A11Y_10_WCAG_20_A = new v("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-a"), v.EPUB_A11Y_10_WCAG_20_AA = new v("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-aa"), v.EPUB_A11Y_10_WCAG_20_AAA = new v("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-aaa"), v.EPUB_A11Y_11_WCAG_20_A = new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-a"), v.EPUB_A11Y_11_WCAG_20_AA = new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-aa"), v.EPUB_A11Y_11_WCAG_20_AAA = new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-aaa"), v.EPUB_A11Y_11_WCAG_21_A = new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-a"), v.EPUB_A11Y_11_WCAG_21_AA = new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-aa"), v.EPUB_A11Y_11_WCAG_21_AAA = new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-aaa"), v.EPUB_A11Y_11_WCAG_22_A = new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-a"), v.EPUB_A11Y_11_WCAG_22_AA = new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-aa"), v.EPUB_A11Y_11_WCAG_22_AAA = new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-aaa");
|
|
38
|
+
let Qe = v;
|
|
39
|
+
const _ = class _ {
|
|
40
40
|
constructor(t) {
|
|
41
41
|
this.value = t;
|
|
42
42
|
}
|
|
@@ -45,7 +45,7 @@ const C = class C {
|
|
|
45
45
|
*/
|
|
46
46
|
static deserialize(t) {
|
|
47
47
|
if (!(!t || typeof t != "string"))
|
|
48
|
-
return new
|
|
48
|
+
return new _(t);
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
51
|
* Serializes an [AccessMode] to its RWPM JSON representation.
|
|
@@ -54,17 +54,17 @@ const C = class C {
|
|
|
54
54
|
return this.value;
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
|
-
|
|
58
|
-
let ti =
|
|
59
|
-
const
|
|
57
|
+
_.AUDITORY = new _("auditory"), _.CHART_ON_VISUAL = new _("chartOnVisual"), _.CHEM_ON_VISUAL = new _("chemOnVisual"), _.COLOR_DEPENDENT = new _("colorDependent"), _.DIAGRAM_ON_VISUAL = new _("diagramOnVisual"), _.MATH_ON_VISUAL = new _("mathOnVisual"), _.MUSIC_ON_VISUAL = new _("musicOnVisual"), _.TACTILE = new _("tactile"), _.TEXT_ON_VISUAL = new _("textOnVisual"), _.TEXTUAL = new _("textual"), _.VISUAL = new _("visual");
|
|
58
|
+
let ti = _;
|
|
59
|
+
const z = class z {
|
|
60
60
|
constructor(t) {
|
|
61
61
|
if (typeof t == "string") {
|
|
62
|
-
if (!
|
|
62
|
+
if (!z.VALID_MODES.has(t.toLowerCase()))
|
|
63
63
|
return;
|
|
64
64
|
this.value = t.toLowerCase();
|
|
65
65
|
} else {
|
|
66
66
|
const e = t.filter(
|
|
67
|
-
(i) =>
|
|
67
|
+
(i) => z.VALID_MODES.has(i.toLowerCase())
|
|
68
68
|
);
|
|
69
69
|
if (e.length === 0)
|
|
70
70
|
return;
|
|
@@ -77,11 +77,11 @@ const D = class D {
|
|
|
77
77
|
static deserialize(t) {
|
|
78
78
|
if (!t) return;
|
|
79
79
|
if (typeof t == "string")
|
|
80
|
-
return new
|
|
80
|
+
return new z(t);
|
|
81
81
|
if (!Array.isArray(t)) return;
|
|
82
|
-
const e = t.filter((i) => i ?
|
|
82
|
+
const e = t.filter((i) => i ? z.VALID_MODES.has(i.toLowerCase()) : !1);
|
|
83
83
|
if (e.length !== 0)
|
|
84
|
-
return new
|
|
84
|
+
return new z(e);
|
|
85
85
|
}
|
|
86
86
|
/**
|
|
87
87
|
* Serializes a [PrimaryAccessMode] to its RWPM JSON representation.
|
|
@@ -90,8 +90,8 @@ const D = class D {
|
|
|
90
90
|
return this.value;
|
|
91
91
|
}
|
|
92
92
|
};
|
|
93
|
-
|
|
94
|
-
let ei =
|
|
93
|
+
z.VALID_MODES = /* @__PURE__ */ new Set(["auditory", "tactile", "textual", "visual"]), z.AUDITORY = new z("auditory"), z.TACTILE = new z("tactile"), z.TEXTUAL = new z("textual"), z.VISUAL = new z("visual");
|
|
94
|
+
let ei = z;
|
|
95
95
|
const y = class y {
|
|
96
96
|
constructor(t) {
|
|
97
97
|
this.value = t;
|
|
@@ -111,7 +111,7 @@ const y = class y {
|
|
|
111
111
|
}
|
|
112
112
|
};
|
|
113
113
|
y.NONE = new y("none"), y.ANNOTATIONS = new y("annotations"), y.ARIA = new y("ARIA"), y.INDEX = new y("index"), y.PAGE_BREAK_MARKERS = new y("pageBreakMarkers"), y.PAGE_NAVIGATION = new y("pageNavigation"), y.PRINT_PAGE_NUMBERS = new y("printPageNumbers"), y.READING_ORDER = new y("readingOrder"), y.STRUCTURAL_NAVIGATION = new y("structuralNavigation"), y.TABLE_OF_CONTENTS = new y("tableOfContents"), y.TAGGED_PDF = new y("taggedPDF"), y.ALTERNATIVE_TEXT = new y("alternativeText"), y.AUDIO_DESCRIPTION = new y("audioDescription"), y.CAPTIONS = new y("captions"), y.CLOSED_CAPTIONS = new y("closedCaptions"), y.DESCRIBED_MATH = new y("describedMath"), y.LONG_DESCRIPTION = new y("longDescription"), y.OPEN_CAPTIONS = new y("openCaptions"), y.SIGN_LANGUAGE = new y("signLanguage"), y.TRANSCRIPT = new y("transcript"), y.DISPLAY_TRANSFORMABILITY = new y("displayTransformability"), y.SYNCHRONIZED_AUDIO_TEXT = new y("synchronizedAudioText"), y.TIMING_CONTROL = new y("timingControl"), y.UNLOCKED = new y("unlocked"), y.CHEM_ML = new y("ChemML"), y.LATEX = new y("latex"), y.LATEX_CHEMISTRY = new y("latex-chemistry"), y.MATH_ML = new y("MathML"), y.MATH_ML_CHEMISTRY = new y("MathML-chemistry"), y.TTS_MARKUP = new y("ttsMarkup"), y.HIGH_CONTRAST_AUDIO = new y("highContrastAudio"), y.HIGH_CONTRAST_DISPLAY = new y("highContrastDisplay"), y.LARGE_PRINT = new y("largePrint"), y.BRAILLE = new y("braille"), y.TACTILE_GRAPHIC = new y("tactileGraphic"), y.TACTILE_OBJECT = new y("tactileObject"), y.FULL_RUBY_ANNOTATIONS = new y("fullRubyAnnotations"), y.HORIZONTAL_WRITING = new y("horizontalWriting"), y.RUBY_ANNOTATIONS = new y("rubyAnnotations"), y.VERTICAL_WRITING = new y("verticalWriting"), y.WITH_ADDITIONAL_WORD_SEGMENTATION = new y("withAdditionalWordSegmentation"), y.WITHOUT_ADDITIONAL_WORD_SEGMENTATION = new y("withoutAdditionalWordSegmentation");
|
|
114
|
-
let
|
|
114
|
+
let Ht = y;
|
|
115
115
|
const L = class L {
|
|
116
116
|
constructor(t) {
|
|
117
117
|
this.value = t;
|
|
@@ -244,7 +244,7 @@ class gt {
|
|
|
244
244
|
}
|
|
245
245
|
gt.getInstance();
|
|
246
246
|
var b = /* @__PURE__ */ ((r) => (r.reflowable = "reflowable", r.fixed = "fixed", r.scrolled = "scrolled", r))(b || {});
|
|
247
|
-
class
|
|
247
|
+
class Fe {
|
|
248
248
|
/**
|
|
249
249
|
* Creates a [Encryption].
|
|
250
250
|
*/
|
|
@@ -256,7 +256,7 @@ class ze {
|
|
|
256
256
|
*/
|
|
257
257
|
static deserialize(t) {
|
|
258
258
|
if (t && t.algorithm)
|
|
259
|
-
return new
|
|
259
|
+
return new Fe({
|
|
260
260
|
algorithm: t.algorithm,
|
|
261
261
|
compression: t.compression,
|
|
262
262
|
originalLength: t.originalLength,
|
|
@@ -272,8 +272,8 @@ class ze {
|
|
|
272
272
|
return this.compression !== void 0 && (t.compression = this.compression), this.originalLength !== void 0 && (t.originalLength = this.originalLength), this.profile !== void 0 && (t.profile = this.profile), this.scheme !== void 0 && (t.scheme = this.scheme), t;
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
|
-
var
|
|
276
|
-
let
|
|
275
|
+
var G = /* @__PURE__ */ ((r) => (r.left = "left", r.right = "right", r.center = "center", r))(G || {});
|
|
276
|
+
let X = class be {
|
|
277
277
|
constructor(t) {
|
|
278
278
|
this.otherProperties = t;
|
|
279
279
|
}
|
|
@@ -303,9 +303,9 @@ let G = class be {
|
|
|
303
303
|
return new be(e);
|
|
304
304
|
}
|
|
305
305
|
};
|
|
306
|
-
Object.defineProperty(
|
|
306
|
+
Object.defineProperty(X.prototype, "encryption", {
|
|
307
307
|
get: function() {
|
|
308
|
-
return
|
|
308
|
+
return Fe.deserialize(this.otherProperties.encrypted);
|
|
309
309
|
}
|
|
310
310
|
});
|
|
311
311
|
function Rn(r) {
|
|
@@ -814,7 +814,7 @@ class li {
|
|
|
814
814
|
return this.uri.replace(/\{(\??)([^}]+)\}/g, (...n) => n[1] ? i(n[2]) : e(n[2]));
|
|
815
815
|
}
|
|
816
816
|
}
|
|
817
|
-
class
|
|
817
|
+
class C {
|
|
818
818
|
/**
|
|
819
819
|
* Creates a [Locations].
|
|
820
820
|
*/
|
|
@@ -835,7 +835,7 @@ class _ {
|
|
|
835
835
|
]);
|
|
836
836
|
return Object.entries(t).forEach(([a, l]) => {
|
|
837
837
|
o.has(a) || s.set(a, l);
|
|
838
|
-
}), new
|
|
838
|
+
}), new C({
|
|
839
839
|
fragments: Yi(t.fragments || t.fragment),
|
|
840
840
|
progression: e !== void 0 && e >= 0 && e <= 1 ? e : void 0,
|
|
841
841
|
totalProgression: i !== void 0 && i >= 0 && i <= 1 ? i : void 0,
|
|
@@ -882,7 +882,7 @@ class I {
|
|
|
882
882
|
* Creates a [Locator].
|
|
883
883
|
*/
|
|
884
884
|
constructor(t) {
|
|
885
|
-
this.href = t.href, this.type = t.type, this.title = t.title, this.locations = t.locations ? t.locations : new
|
|
885
|
+
this.href = t.href, this.type = t.type, this.title = t.title, this.locations = t.locations ? t.locations : new C({}), this.text = t.text;
|
|
886
886
|
}
|
|
887
887
|
/**
|
|
888
888
|
* Parses a [Link] from its RWPM JSON representation.
|
|
@@ -893,7 +893,7 @@ class I {
|
|
|
893
893
|
href: t.href,
|
|
894
894
|
type: t.type,
|
|
895
895
|
title: t.title,
|
|
896
|
-
locations:
|
|
896
|
+
locations: C.deserialize(t.locations),
|
|
897
897
|
text: rt.deserialize(t.text)
|
|
898
898
|
});
|
|
899
899
|
}
|
|
@@ -913,7 +913,7 @@ class I {
|
|
|
913
913
|
type: this.type,
|
|
914
914
|
title: this.title,
|
|
915
915
|
text: this.text,
|
|
916
|
-
locations: new
|
|
916
|
+
locations: new C({ ...this.locations, ...t })
|
|
917
917
|
});
|
|
918
918
|
}
|
|
919
919
|
}
|
|
@@ -935,15 +935,15 @@ class $ {
|
|
|
935
935
|
type: t.type,
|
|
936
936
|
title: t.title,
|
|
937
937
|
rels: t.rel ? Array.isArray(t.rel) ? new Set(t.rel) : /* @__PURE__ */ new Set([t.rel]) : void 0,
|
|
938
|
-
properties:
|
|
938
|
+
properties: X.deserialize(t.properties),
|
|
939
939
|
height: V(t.height),
|
|
940
940
|
width: V(t.width),
|
|
941
941
|
size: V(t.size),
|
|
942
942
|
duration: V(t.duration),
|
|
943
943
|
bitrate: V(t.bitrate),
|
|
944
944
|
languages: Yi(t.language),
|
|
945
|
-
alternates:
|
|
946
|
-
children:
|
|
945
|
+
alternates: Bt.deserialize(t.alternate),
|
|
946
|
+
children: Bt.deserialize(t.children)
|
|
947
947
|
});
|
|
948
948
|
}
|
|
949
949
|
/**
|
|
@@ -984,7 +984,7 @@ class $ {
|
|
|
984
984
|
*/
|
|
985
985
|
addProperties(t) {
|
|
986
986
|
const e = $.deserialize(this.serialize());
|
|
987
|
-
return e.properties = e.properties ? e.properties?.add(t) : new
|
|
987
|
+
return e.properties = e.properties ? e.properties?.add(t) : new X(t), e;
|
|
988
988
|
}
|
|
989
989
|
/**
|
|
990
990
|
* Creates a [Locator] from a reading order [Link].
|
|
@@ -995,13 +995,13 @@ class $ {
|
|
|
995
995
|
href: t.length > 0 && t[0] !== void 0 ? t[0] : this.href,
|
|
996
996
|
type: this.type ?? "",
|
|
997
997
|
title: this.title,
|
|
998
|
-
locations: new
|
|
998
|
+
locations: new C({
|
|
999
999
|
fragments: t.length > 1 && t[1] !== void 0 ? [t[1]] : []
|
|
1000
1000
|
})
|
|
1001
1001
|
});
|
|
1002
1002
|
}
|
|
1003
1003
|
}
|
|
1004
|
-
class
|
|
1004
|
+
class Bt {
|
|
1005
1005
|
/**
|
|
1006
1006
|
* Creates a [Links].
|
|
1007
1007
|
*/
|
|
@@ -1013,7 +1013,7 @@ class Ht {
|
|
|
1013
1013
|
*/
|
|
1014
1014
|
static deserialize(t) {
|
|
1015
1015
|
if (t && Array.isArray(t))
|
|
1016
|
-
return new
|
|
1016
|
+
return new Bt(
|
|
1017
1017
|
t.map((e) => $.deserialize(e)).filter((e) => e !== void 0)
|
|
1018
1018
|
);
|
|
1019
1019
|
}
|
|
@@ -1095,8 +1095,8 @@ class Ht {
|
|
|
1095
1095
|
return this.items.filter((t) => t.type);
|
|
1096
1096
|
}
|
|
1097
1097
|
}
|
|
1098
|
-
var qi = /* @__PURE__ */ ((r) => (r.EPUB = "https://readium.org/webpub-manifest/profiles/epub", r.AUDIOBOOK = "https://readium.org/webpub-manifest/profiles/audiobook", r.DIVINA = "https://readium.org/webpub-manifest/profiles/divina", r.PDF = "https://readium.org/webpub-manifest/profiles/pdf", r))(qi || {}),
|
|
1099
|
-
|
|
1098
|
+
var qi = /* @__PURE__ */ ((r) => (r.EPUB = "https://readium.org/webpub-manifest/profiles/epub", r.AUDIOBOOK = "https://readium.org/webpub-manifest/profiles/audiobook", r.DIVINA = "https://readium.org/webpub-manifest/profiles/divina", r.PDF = "https://readium.org/webpub-manifest/profiles/pdf", r))(qi || {}), M = /* @__PURE__ */ ((r) => (r.ltr = "ltr", r.rtl = "rtl", r))(M || {});
|
|
1099
|
+
X.prototype.getContains = function() {
|
|
1100
1100
|
return new Set(this.otherProperties.contains || []);
|
|
1101
1101
|
};
|
|
1102
1102
|
class Vt {
|
|
@@ -1158,16 +1158,16 @@ class Ie {
|
|
|
1158
1158
|
return this.end && (t.end = this.end.serialize()), t;
|
|
1159
1159
|
}
|
|
1160
1160
|
}
|
|
1161
|
-
|
|
1161
|
+
C.prototype.getCssSelector = function() {
|
|
1162
1162
|
return this.otherLocations?.get("cssSelector");
|
|
1163
1163
|
};
|
|
1164
|
-
|
|
1164
|
+
C.prototype.getPartialCfi = function() {
|
|
1165
1165
|
return this.otherLocations?.get("partialCfi");
|
|
1166
1166
|
};
|
|
1167
|
-
|
|
1167
|
+
C.prototype.getDomRange = function() {
|
|
1168
1168
|
return Ie.deserialize(this.otherLocations?.get("domRange"));
|
|
1169
1169
|
};
|
|
1170
|
-
|
|
1170
|
+
C.prototype.fragmentParameters = function() {
|
|
1171
1171
|
return new Map(
|
|
1172
1172
|
this.fragments.map((r) => r.startsWith("#") ? r.slice(1) : r).join("&").split("&").filter((r) => !r.startsWith("#")).map((r) => r.split("=")).filter((r) => r.length === 2).map((r) => [
|
|
1173
1173
|
r[0].trim().toLowerCase(),
|
|
@@ -1175,7 +1175,7 @@ _.prototype.fragmentParameters = function() {
|
|
|
1175
1175
|
])
|
|
1176
1176
|
);
|
|
1177
1177
|
};
|
|
1178
|
-
|
|
1178
|
+
C.prototype.htmlId = function() {
|
|
1179
1179
|
if (!this.fragments.length) return;
|
|
1180
1180
|
let r = this.fragments.find((t) => t.length && !t.includes("="));
|
|
1181
1181
|
if (!r) {
|
|
@@ -1184,22 +1184,22 @@ _.prototype.htmlId = function() {
|
|
|
1184
1184
|
}
|
|
1185
1185
|
return r?.startsWith("#") ? r.slice(1) : r;
|
|
1186
1186
|
};
|
|
1187
|
-
|
|
1187
|
+
C.prototype.page = function() {
|
|
1188
1188
|
const r = parseInt(this.fragmentParameters().get("page"));
|
|
1189
1189
|
if (!isNaN(r) && r >= 0) return r;
|
|
1190
1190
|
};
|
|
1191
|
-
|
|
1191
|
+
C.prototype.time = function() {
|
|
1192
1192
|
const r = parseInt(this.fragmentParameters().get("t"));
|
|
1193
1193
|
if (!isNaN(r)) return r;
|
|
1194
1194
|
};
|
|
1195
|
-
|
|
1195
|
+
C.prototype.space = function() {
|
|
1196
1196
|
const r = this.fragmentParameters();
|
|
1197
1197
|
if (!r.has("xywh")) return;
|
|
1198
1198
|
const t = r.get("xywh").split(",").map((e) => parseInt(e));
|
|
1199
1199
|
if (t.length === 4 && !t.some(isNaN))
|
|
1200
1200
|
return t;
|
|
1201
1201
|
};
|
|
1202
|
-
class
|
|
1202
|
+
class ze {
|
|
1203
1203
|
/** Creates a [Price]. */
|
|
1204
1204
|
constructor(t) {
|
|
1205
1205
|
this.currency = t.currency, this.value = t.value;
|
|
@@ -1214,7 +1214,7 @@ class De {
|
|
|
1214
1214
|
return;
|
|
1215
1215
|
let i = V(t.value);
|
|
1216
1216
|
if (i !== void 0)
|
|
1217
|
-
return new
|
|
1217
|
+
return new ze({ currency: e, value: i });
|
|
1218
1218
|
}
|
|
1219
1219
|
/**
|
|
1220
1220
|
* Serializes a [Price] to its RWPM JSON representation.
|
|
@@ -1250,7 +1250,7 @@ class xt {
|
|
|
1250
1250
|
return this.children && (t.children = this.children.map((e) => e.serialize())), t;
|
|
1251
1251
|
}
|
|
1252
1252
|
}
|
|
1253
|
-
class
|
|
1253
|
+
class De {
|
|
1254
1254
|
/** Creates a [Price]. */
|
|
1255
1255
|
constructor(t) {
|
|
1256
1256
|
this.total = t.total, this.position = t.position;
|
|
@@ -1260,7 +1260,7 @@ class Fe {
|
|
|
1260
1260
|
*/
|
|
1261
1261
|
static deserialize(t) {
|
|
1262
1262
|
if (t)
|
|
1263
|
-
return new
|
|
1263
|
+
return new De({
|
|
1264
1264
|
total: V(t.total),
|
|
1265
1265
|
position: V(t.position)
|
|
1266
1266
|
});
|
|
@@ -1320,42 +1320,42 @@ class Ue {
|
|
|
1320
1320
|
return this.since !== void 0 && (t.since = this.since.toISOString()), this.until !== void 0 && (t.until = this.until.toISOString()), t;
|
|
1321
1321
|
}
|
|
1322
1322
|
}
|
|
1323
|
-
|
|
1323
|
+
X.prototype.getNumberOfItems = function() {
|
|
1324
1324
|
return V(this.otherProperties.numberOfItems);
|
|
1325
1325
|
};
|
|
1326
|
-
|
|
1327
|
-
return
|
|
1326
|
+
X.prototype.getPrice = function() {
|
|
1327
|
+
return ze.deserialize(this.otherProperties.price);
|
|
1328
1328
|
};
|
|
1329
|
-
|
|
1329
|
+
X.prototype.getIndirectAcquisitions = function() {
|
|
1330
1330
|
const r = this.otherProperties.indirectAcquisition;
|
|
1331
1331
|
if (r && Array.isArray(r))
|
|
1332
1332
|
return r.map((t) => xt.deserialize(t)).filter((t) => t !== void 0);
|
|
1333
1333
|
};
|
|
1334
|
-
|
|
1335
|
-
return
|
|
1334
|
+
X.prototype.getHolds = function() {
|
|
1335
|
+
return De.deserialize(this.otherProperties.holds);
|
|
1336
1336
|
};
|
|
1337
|
-
|
|
1337
|
+
X.prototype.getCopies = function() {
|
|
1338
1338
|
return We.deserialize(this.otherProperties.copies);
|
|
1339
1339
|
};
|
|
1340
|
-
|
|
1340
|
+
X.prototype.getAvailability = function() {
|
|
1341
1341
|
return Ue.deserialize(this.otherProperties.availability);
|
|
1342
1342
|
};
|
|
1343
|
-
|
|
1343
|
+
X.prototype.getAuthenticate = function() {
|
|
1344
1344
|
return $.deserialize(this.otherProperties.authenticate);
|
|
1345
1345
|
};
|
|
1346
1346
|
const Tn = "CssSelectorGenerator";
|
|
1347
1347
|
function hi(r = "unknown problem", ...t) {
|
|
1348
1348
|
console.warn(`${Tn}: ${r}`, ...t);
|
|
1349
1349
|
}
|
|
1350
|
-
function
|
|
1350
|
+
function Nn(r) {
|
|
1351
1351
|
return r instanceof RegExp;
|
|
1352
1352
|
}
|
|
1353
|
-
function
|
|
1353
|
+
function Mn(r) {
|
|
1354
1354
|
return r.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".+");
|
|
1355
1355
|
}
|
|
1356
|
-
function
|
|
1356
|
+
function Fn(r) {
|
|
1357
1357
|
const t = r.map((e) => {
|
|
1358
|
-
if (
|
|
1358
|
+
if (Nn(e))
|
|
1359
1359
|
return (i) => e.test(i);
|
|
1360
1360
|
if (typeof e == "function")
|
|
1361
1361
|
return (i) => {
|
|
@@ -1363,21 +1363,21 @@ function zn(r) {
|
|
|
1363
1363
|
return typeof n != "boolean" ? (hi("pattern matcher function invalid", "Provided pattern matching function does not return boolean. It's result will be ignored.", e), !1) : n;
|
|
1364
1364
|
};
|
|
1365
1365
|
if (typeof e == "string") {
|
|
1366
|
-
const i = new RegExp("^" +
|
|
1366
|
+
const i = new RegExp("^" + Mn(e) + "$");
|
|
1367
1367
|
return (n) => i.test(n);
|
|
1368
1368
|
}
|
|
1369
1369
|
return hi("pattern matcher invalid", "Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.", e), () => !1;
|
|
1370
1370
|
});
|
|
1371
1371
|
return (e) => t.some((i) => i(e));
|
|
1372
1372
|
}
|
|
1373
|
-
|
|
1373
|
+
Fn([
|
|
1374
1374
|
"class",
|
|
1375
1375
|
"id",
|
|
1376
1376
|
// Angular attributes
|
|
1377
1377
|
"ng-*"
|
|
1378
1378
|
]);
|
|
1379
1379
|
const In = Math.pow(2, 32), ci = () => Math.round(Math.random() * In).toString(36), we = () => `${Math.round(performance.now())}-${ci()}-${ci()}`, ft = 1;
|
|
1380
|
-
class
|
|
1380
|
+
class zn {
|
|
1381
1381
|
constructor(t) {
|
|
1382
1382
|
this.destination = null, this.registrar = /* @__PURE__ */ new Map(), this.origin = "", this.channelId = "", this.receiver = this.receive.bind(this), this.preLog = [], this.wnd = t, t.addEventListener("message", this.receiver);
|
|
1383
1383
|
}
|
|
@@ -1472,7 +1472,7 @@ class Et {
|
|
|
1472
1472
|
function di(r) {
|
|
1473
1473
|
return r.split("").reverse().join("");
|
|
1474
1474
|
}
|
|
1475
|
-
function
|
|
1475
|
+
function Dn(r, t, e) {
|
|
1476
1476
|
const i = di(t);
|
|
1477
1477
|
return e.map((n) => {
|
|
1478
1478
|
const s = Math.max(0, n.end - t.length - n.errors), o = di(r.slice(s, n.end));
|
|
@@ -1558,7 +1558,7 @@ function Ki(r, t, e) {
|
|
|
1558
1558
|
}
|
|
1559
1559
|
function Wn(r, t, e) {
|
|
1560
1560
|
const i = Ki(r, t, e);
|
|
1561
|
-
return
|
|
1561
|
+
return Dn(r, t, i);
|
|
1562
1562
|
}
|
|
1563
1563
|
function Ji(r, t, e) {
|
|
1564
1564
|
let i = 0;
|
|
@@ -1600,7 +1600,7 @@ function Un(r, t, e = {}) {
|
|
|
1600
1600
|
}));
|
|
1601
1601
|
return o.sort((a, l) => l.score - a.score), o[0];
|
|
1602
1602
|
}
|
|
1603
|
-
function
|
|
1603
|
+
function Se(r, t, e) {
|
|
1604
1604
|
const i = e === 1 ? t : t - 1;
|
|
1605
1605
|
if (r.charAt(i).trim() !== "")
|
|
1606
1606
|
return t;
|
|
@@ -1623,7 +1623,7 @@ function fi(r, t) {
|
|
|
1623
1623
|
const a = () => {
|
|
1624
1624
|
if (s = t === 1 ? e.nextNode() : e.previousNode(), s) {
|
|
1625
1625
|
const l = s.textContent, h = t === 1 ? 0 : l.length;
|
|
1626
|
-
o =
|
|
1626
|
+
o = Se(l, h, t);
|
|
1627
1627
|
}
|
|
1628
1628
|
};
|
|
1629
1629
|
for (; s && o === -1 && s !== n; )
|
|
@@ -1632,7 +1632,7 @@ function fi(r, t) {
|
|
|
1632
1632
|
return { node: s, offset: o };
|
|
1633
1633
|
throw new RangeError("No text nodes with non-whitespace text found in range");
|
|
1634
1634
|
}
|
|
1635
|
-
function
|
|
1635
|
+
function Hn(r) {
|
|
1636
1636
|
if (!r.toString().trim().length)
|
|
1637
1637
|
throw new RangeError("Range contains no non-whitespace text");
|
|
1638
1638
|
if (r.startContainer.nodeType !== Node.TEXT_NODE)
|
|
@@ -1642,13 +1642,13 @@ function Bn(r) {
|
|
|
1642
1642
|
const t = r.cloneRange();
|
|
1643
1643
|
let e = !1, i = !1;
|
|
1644
1644
|
const n = {
|
|
1645
|
-
start:
|
|
1645
|
+
start: Se(
|
|
1646
1646
|
r.startContainer.textContent,
|
|
1647
1647
|
r.startOffset,
|
|
1648
1648
|
1
|
|
1649
1649
|
/* Forwards */
|
|
1650
1650
|
),
|
|
1651
|
-
end:
|
|
1651
|
+
end: Se(
|
|
1652
1652
|
r.endContainer.textContent,
|
|
1653
1653
|
r.endOffset,
|
|
1654
1654
|
2
|
|
@@ -1868,7 +1868,7 @@ class et {
|
|
|
1868
1868
|
* whitespace
|
|
1869
1869
|
*/
|
|
1870
1870
|
static trimmedRange(t) {
|
|
1871
|
-
return
|
|
1871
|
+
return Hn(et.fromRange(t).toRange());
|
|
1872
1872
|
}
|
|
1873
1873
|
}
|
|
1874
1874
|
class jt {
|
|
@@ -1941,7 +1941,7 @@ class $t {
|
|
|
1941
1941
|
return new jt(this.root, i.start, i.end);
|
|
1942
1942
|
}
|
|
1943
1943
|
}
|
|
1944
|
-
function
|
|
1944
|
+
function Bn(r) {
|
|
1945
1945
|
const t = r.tagName.toUpperCase();
|
|
1946
1946
|
return t === "IMG" || t === "VIDEO" || t === "AUDIO" || t === "IFRAME" || t === "OBJECT" || t === "EMBED" || t === "CANVAS";
|
|
1947
1947
|
}
|
|
@@ -1970,7 +1970,7 @@ function It(r, t) {
|
|
|
1970
1970
|
}
|
|
1971
1971
|
if (n) {
|
|
1972
1972
|
const s = r.createRange();
|
|
1973
|
-
return n.childNodes.length === 0 ||
|
|
1973
|
+
return n.childNodes.length === 0 || Bn(n) ? (s.selectNode(n), s) : (s.setStartBefore(n), s.setEndAfter(n), s);
|
|
1974
1974
|
}
|
|
1975
1975
|
}
|
|
1976
1976
|
} catch (e) {
|
|
@@ -2041,17 +2041,17 @@ function $n(r, t) {
|
|
|
2041
2041
|
continue;
|
|
2042
2042
|
}
|
|
2043
2043
|
for (const s of r)
|
|
2044
|
-
if (i !== s && e.has(s) &&
|
|
2044
|
+
if (i !== s && e.has(s) && Gn(s, i, t)) {
|
|
2045
2045
|
e.delete(i);
|
|
2046
2046
|
break;
|
|
2047
2047
|
}
|
|
2048
2048
|
}
|
|
2049
2049
|
return Array.from(e);
|
|
2050
2050
|
}
|
|
2051
|
-
function
|
|
2052
|
-
return
|
|
2051
|
+
function Gn(r, t, e) {
|
|
2052
|
+
return zt(r, t.left, t.top, e) && zt(r, t.right, t.top, e) && zt(r, t.left, t.bottom, e) && zt(r, t.right, t.bottom, e);
|
|
2053
2053
|
}
|
|
2054
|
-
function
|
|
2054
|
+
function zt(r, t, e, i) {
|
|
2055
2055
|
return (r.left < t || j(r.left, t, i)) && (r.right > t || j(r.right, t, i)) && (r.top < e || j(r.top, e, i)) && (r.bottom > e || j(r.bottom, e, i));
|
|
2056
2056
|
}
|
|
2057
2057
|
function en(r) {
|
|
@@ -2074,7 +2074,7 @@ function en(r) {
|
|
|
2074
2074
|
return r;
|
|
2075
2075
|
}
|
|
2076
2076
|
function gi(r, t) {
|
|
2077
|
-
const e =
|
|
2077
|
+
const e = Xn(t, r);
|
|
2078
2078
|
if (e.height === 0 || e.width === 0)
|
|
2079
2079
|
return [r];
|
|
2080
2080
|
const i = [];
|
|
@@ -2124,7 +2124,7 @@ function gi(r, t) {
|
|
|
2124
2124
|
}
|
|
2125
2125
|
return i;
|
|
2126
2126
|
}
|
|
2127
|
-
function
|
|
2127
|
+
function Xn(r, t) {
|
|
2128
2128
|
const e = Math.max(r.left, t.left), i = Math.min(r.right, t.right), n = Math.max(r.top, t.top), s = Math.min(r.bottom, t.bottom);
|
|
2129
2129
|
return {
|
|
2130
2130
|
bottom: s,
|
|
@@ -2141,14 +2141,14 @@ function nn(r, t, e) {
|
|
|
2141
2141
|
function j(r, t, e) {
|
|
2142
2142
|
return Math.abs(r - t) <= e;
|
|
2143
2143
|
}
|
|
2144
|
-
function
|
|
2144
|
+
function He(r) {
|
|
2145
2145
|
const t = {}, e = r.document.documentElement.style;
|
|
2146
2146
|
for (const i in r.document.documentElement.style)
|
|
2147
2147
|
Object.hasOwn(e, i) && !Number.isNaN(Number.parseInt(i)) && (t[e[i]] = e.getPropertyValue(e[i]));
|
|
2148
2148
|
return t;
|
|
2149
2149
|
}
|
|
2150
2150
|
function sn(r, t) {
|
|
2151
|
-
const e =
|
|
2151
|
+
const e = He(r);
|
|
2152
2152
|
Object.keys(e).forEach((i) => {
|
|
2153
2153
|
t.hasOwnProperty(i) || re(r, i);
|
|
2154
2154
|
}), Object.entries(t).forEach(([i, n]) => {
|
|
@@ -2164,17 +2164,17 @@ function Tt(r, t, e) {
|
|
|
2164
2164
|
function re(r, t) {
|
|
2165
2165
|
r.document.documentElement.style.removeProperty(t);
|
|
2166
2166
|
}
|
|
2167
|
-
let
|
|
2167
|
+
let Dt = null, pe = null, Ct = 0;
|
|
2168
2168
|
const mt = { r: 255, g: 255, b: 255, a: 1 }, ct = /* @__PURE__ */ new Map(), Yn = () => {
|
|
2169
|
-
if (!
|
|
2169
|
+
if (!Dt)
|
|
2170
2170
|
if (typeof OffscreenCanvas < "u")
|
|
2171
|
-
|
|
2171
|
+
Dt = new OffscreenCanvas(5, 5), pe = Dt.getContext("2d", {
|
|
2172
2172
|
willReadFrequently: !0,
|
|
2173
2173
|
desynchronized: !0
|
|
2174
2174
|
});
|
|
2175
2175
|
else {
|
|
2176
2176
|
const r = document.createElement("canvas");
|
|
2177
|
-
r.width = 5, r.height = 5,
|
|
2177
|
+
r.width = 5, r.height = 5, Dt = r, pe = r.getContext("2d", {
|
|
2178
2178
|
willReadFrequently: !0,
|
|
2179
2179
|
desynchronized: !0
|
|
2180
2180
|
});
|
|
@@ -2203,7 +2203,7 @@ const mt = { r: 255, g: 255, b: 255, a: 1 }, ct = /* @__PURE__ */ new Map(), Yn
|
|
|
2203
2203
|
console.warn(
|
|
2204
2204
|
`[Decorator] Could not parse color: "${r}". ${t} Falling back to ${JSON.stringify(mt)} to compute contrast. Please use a CSS color value that can be computed to RGB(A).`
|
|
2205
2205
|
);
|
|
2206
|
-
},
|
|
2206
|
+
}, ve = (r, t = null) => {
|
|
2207
2207
|
const e = t ? `${r}|${t}` : r, i = ct.get(e);
|
|
2208
2208
|
if (i !== void 0)
|
|
2209
2209
|
return i ?? mt;
|
|
@@ -2213,11 +2213,11 @@ const mt = { r: 255, g: 255, b: 255, a: 1 }, ct = /* @__PURE__ */ new Map(), Yn
|
|
|
2213
2213
|
if (!n)
|
|
2214
2214
|
return Wt(r, "Could not get canvas context."), ct.set(e, null), mt;
|
|
2215
2215
|
try {
|
|
2216
|
-
|
|
2217
|
-
const s =
|
|
2216
|
+
Ct === 0 && n.clearRect(0, 0, 5, 5);
|
|
2217
|
+
const s = Ct % 5, o = Math.floor(Ct / 5);
|
|
2218
2218
|
n.clearRect(s, o, 1, 1), t && (n.fillStyle = t, n.fillRect(s, o, 1, 1)), n.fillStyle = r, n.fillRect(s, o, 1, 1);
|
|
2219
2219
|
const a = n.getImageData(s, o, 1, 1);
|
|
2220
|
-
|
|
2220
|
+
Ct = (Ct + 1) % 25;
|
|
2221
2221
|
const [l, h, c, u] = a.data;
|
|
2222
2222
|
if (u === 0)
|
|
2223
2223
|
return Wt(r, "Fully transparent color."), ct.set(e, null), mt;
|
|
@@ -2233,12 +2233,12 @@ const mt = { r: 255, g: 255, b: 255, a: 1 }, ct = /* @__PURE__ */ new Map(), Yn
|
|
|
2233
2233
|
const t = fe(r.r), e = fe(r.g), i = fe(r.b);
|
|
2234
2234
|
return 0.2126 * t + 0.7152 * e + 0.0722 * i;
|
|
2235
2235
|
}, bi = (r, t) => {
|
|
2236
|
-
const e = typeof r == "string" ?
|
|
2236
|
+
const e = typeof r == "string" ? ve(r) : r, i = typeof t == "string" ? ve(t) : t, n = yi(e), s = yi(i), o = Math.max(n, s), a = Math.min(n, s);
|
|
2237
2237
|
return (o + 0.05) / (a + 0.05);
|
|
2238
2238
|
}, Pe = (r, t = null) => {
|
|
2239
|
-
const e =
|
|
2239
|
+
const e = ve(r, t), i = bi(e, { r: 255, g: 255, b: 255, a: 1 }), n = bi(e, { r: 0, g: 0, b: 0, a: 1 });
|
|
2240
2240
|
return i > n;
|
|
2241
|
-
}, Kn = (r, t = null) => Pe(r, t) ? "white" : "black", wi = "#FFFF00", Jn = () => "Highlight" in window,
|
|
2241
|
+
}, Kn = (r, t = null) => Pe(r, t) ? "white" : "black", wi = "#FFFF00", Jn = () => "Highlight" in window, Si = ["IMG", "IMAGE", "AUDIO", "VIDEO", "SVG"];
|
|
2242
2242
|
class Zn {
|
|
2243
2243
|
/**
|
|
2244
2244
|
* Creates a DecorationGroup object
|
|
@@ -2265,7 +2265,7 @@ class Zn {
|
|
|
2265
2265
|
return;
|
|
2266
2266
|
}
|
|
2267
2267
|
const n = i.commonAncestorContainer;
|
|
2268
|
-
n.nodeType !== Node.TEXT_NODE && this.experimentalHighlights && (
|
|
2268
|
+
n.nodeType !== Node.TEXT_NODE && this.experimentalHighlights && (Si.includes(n.nodeName.toUpperCase()) && this.notTextFlag?.set(e, !0), i.cloneContents().querySelector(Si.join(", ").toLowerCase()) && this.notTextFlag?.set(e, !0), (n.textContent?.trim() || "").length === 0 && this.notTextFlag?.set(e, !0));
|
|
2269
2269
|
const s = {
|
|
2270
2270
|
decoration: t,
|
|
2271
2271
|
id: e,
|
|
@@ -2473,7 +2473,7 @@ const Ot = class Ot extends Et {
|
|
|
2473
2473
|
};
|
|
2474
2474
|
Ot.moduleName = "decorator";
|
|
2475
2475
|
let Ee = Ot;
|
|
2476
|
-
const
|
|
2476
|
+
const vi = "readium-snapper-style", Rt = class Rt extends Et {
|
|
2477
2477
|
constructor() {
|
|
2478
2478
|
super(...arguments), this.protected = !1;
|
|
2479
2479
|
}
|
|
@@ -2486,18 +2486,18 @@ const Si = "readium-snapper-style", Rt = class Rt extends Et {
|
|
|
2486
2486
|
}
|
|
2487
2487
|
mount(t, e) {
|
|
2488
2488
|
const i = t.document.createElement("style");
|
|
2489
|
-
return i.dataset.readium = "true", i.id =
|
|
2489
|
+
return i.dataset.readium = "true", i.id = vi, i.textContent = this.buildStyles(), t.document.head.appendChild(i), e.register("protect", Rt.moduleName, (n, s) => {
|
|
2490
2490
|
this.protected = !0, i.textContent = this.buildStyles(), s(!0);
|
|
2491
2491
|
}), e.register("unprotect", Rt.moduleName, (n, s) => {
|
|
2492
2492
|
this.protected = !1, i.textContent = this.buildStyles(), s(!0);
|
|
2493
2493
|
}), e.log("Snapper Mounted"), !0;
|
|
2494
2494
|
}
|
|
2495
2495
|
unmount(t, e) {
|
|
2496
|
-
return t.document.getElementById(
|
|
2496
|
+
return t.document.getElementById(vi)?.remove(), e.log("Snapper Unmounted"), !0;
|
|
2497
2497
|
}
|
|
2498
2498
|
};
|
|
2499
2499
|
Rt.moduleName = "snapper";
|
|
2500
|
-
let
|
|
2500
|
+
let vt = Rt;
|
|
2501
2501
|
function Qn(r) {
|
|
2502
2502
|
return (r.document.documentElement.dir || r.document.body.dir).toLowerCase() === "rtl";
|
|
2503
2503
|
}
|
|
@@ -2530,7 +2530,7 @@ function Ei(r) {
|
|
|
2530
2530
|
}
|
|
2531
2531
|
return i !== l;
|
|
2532
2532
|
}
|
|
2533
|
-
function
|
|
2533
|
+
function Be(r) {
|
|
2534
2534
|
const t = r.document.createElement("style");
|
|
2535
2535
|
t.appendChild(r.document.createTextNode("*{}")), r.document.body.appendChild(t), r.document.body.removeChild(t);
|
|
2536
2536
|
}
|
|
@@ -2572,7 +2572,7 @@ function oe(r, t) {
|
|
|
2572
2572
|
return new I({
|
|
2573
2573
|
href: "#",
|
|
2574
2574
|
type: "application/xhtml+xml",
|
|
2575
|
-
locations: new
|
|
2575
|
+
locations: new C({
|
|
2576
2576
|
otherLocations: /* @__PURE__ */ new Map([
|
|
2577
2577
|
["cssSelector", i]
|
|
2578
2578
|
])
|
|
@@ -2677,7 +2677,7 @@ class ae {
|
|
|
2677
2677
|
this.history = [], this.consistentScrollCount = 0;
|
|
2678
2678
|
}
|
|
2679
2679
|
}
|
|
2680
|
-
const
|
|
2680
|
+
const Ci = "readium-column-snapper-style", cs = 200, D = class D extends vt {
|
|
2681
2681
|
constructor() {
|
|
2682
2682
|
super(...arguments), this.isSnapProtectionEnabled = !1, this.patternAnalyzer = null, this.lastTurnTime = 0, this.rtl = !1, this.shakeTimeout = 0, this.snappingCancelled = !1, this.alreadyScrollLeft = 0, this.overscroll = 0, this.cachedScrollWidth = 0, this.touchState = 0, this.startingX = void 0, this.endingX = void 0, this.onTouchStarter = this.onTouchStart.bind(this), this.onTouchEnder = this.onTouchEnd.bind(this), this.onWidthChanger = this.onWidthChange.bind(this), this.onTouchMover = this.onTouchMove.bind(this);
|
|
2683
2683
|
}
|
|
@@ -2813,7 +2813,7 @@ const _i = "readium-column-snapper-style", cs = 200, F = class F extends St {
|
|
|
2813
2813
|
if (this.wnd = t, this.comms = e, this.rtl = Qn(t), !super.mount(t, e)) return !1;
|
|
2814
2814
|
t.navigator.epubReadingSystem && (t.navigator.epubReadingSystem.layoutStyle = "paginated");
|
|
2815
2815
|
const i = t.document.createElement("style");
|
|
2816
|
-
i.dataset.readium = "true", i.id =
|
|
2816
|
+
i.dataset.readium = "true", i.id = Ci, i.textContent = `
|
|
2817
2817
|
@keyframes readium-bounce-l-animation {
|
|
2818
2818
|
0%, 100% {transform: translate3d(0, 0, 0);}
|
|
2819
2819
|
50% {transform: translate3d(-50px, 0, 0);}
|
|
@@ -2860,7 +2860,7 @@ const _i = "readium-column-snapper-style", cs = 200, F = class F extends St {
|
|
|
2860
2860
|
}), this.onWidthChange());
|
|
2861
2861
|
} else
|
|
2862
2862
|
t.requestAnimationFrame(() => this.cachedScrollWidth = this.doc().scrollWidth);
|
|
2863
|
-
}), t.frameElement && this.mutationObserver.observe(t.frameElement, { attributes: !0, attributeFilter: ["style"] }), this.mutationObserver.observe(t.document, { attributes: !0, attributeFilter: ["style"] }), this.mutationObserver.observe(t.document.documentElement, { attributes: !0, attributeFilter: ["style"] }), e.register("scroll_protection",
|
|
2863
|
+
}), t.frameElement && this.mutationObserver.observe(t.frameElement, { attributes: !0, attributeFilter: ["style"] }), this.mutationObserver.observe(t.document, { attributes: !0, attributeFilter: ["style"] }), this.mutationObserver.observe(t.document.documentElement, { attributes: !0, attributeFilter: ["style"] }), e.register("scroll_protection", D.moduleName, (o, a) => {
|
|
2864
2864
|
this.enableSnapProtection(), a(!0);
|
|
2865
2865
|
});
|
|
2866
2866
|
const n = (o) => {
|
|
@@ -2870,7 +2870,7 @@ const _i = "readium-column-snapper-style", cs = 200, F = class F extends St {
|
|
|
2870
2870
|
const a = this.doc().scrollLeft, l = this.snapNormOffset(Math.max(0, Math.min(this.cachedScrollWidth - t.innerWidth, o)));
|
|
2871
2871
|
return this.doc().scrollLeft = -l, a !== this.doc().scrollLeft;
|
|
2872
2872
|
};
|
|
2873
|
-
return t.addEventListener("orientationchange", this.onWidthChanger), t.addEventListener("resize", this.onWidthChanger), t.requestAnimationFrame(() => this.cachedScrollWidth = this.doc().scrollWidth), e.register("go_progression",
|
|
2873
|
+
return t.addEventListener("orientationchange", this.onWidthChanger), t.addEventListener("resize", this.onWidthChanger), t.requestAnimationFrame(() => this.cachedScrollWidth = this.doc().scrollWidth), e.register("go_progression", D.moduleName, (o, a) => {
|
|
2874
2874
|
const l = o;
|
|
2875
2875
|
if (l < 0 || l > 1) {
|
|
2876
2876
|
e.send("error", {
|
|
@@ -2883,7 +2883,7 @@ const _i = "readium-column-snapper-style", cs = 200, F = class F extends St {
|
|
|
2883
2883
|
const c = (this.cachedScrollWidth - t.innerWidth) * l;
|
|
2884
2884
|
this.rtl ? this.doc().scrollLeft = -this.snapNormOffset(c) : this.doc().scrollLeft = this.snapOffset(c), this.reportProgress(), O(this.wnd), a(!0);
|
|
2885
2885
|
});
|
|
2886
|
-
}), e.register("go_id",
|
|
2886
|
+
}), e.register("go_id", D.moduleName, (o, a) => {
|
|
2887
2887
|
const l = t.document.getElementById(o);
|
|
2888
2888
|
if (!l) {
|
|
2889
2889
|
a(!1);
|
|
@@ -2892,14 +2892,14 @@ const _i = "readium-column-snapper-style", cs = 200, F = class F extends St {
|
|
|
2892
2892
|
this.wnd.requestAnimationFrame(() => {
|
|
2893
2893
|
this.rtl ? this.doc().scrollLeft = -this.snapNormOffset(l.getBoundingClientRect().left + t.scrollX) : this.doc().scrollLeft = this.snapOffset(l.getBoundingClientRect().left + t.scrollX), this.reportProgress(), O(this.wnd), a(!0);
|
|
2894
2894
|
});
|
|
2895
|
-
}), e.register("go_text",
|
|
2895
|
+
}), e.register("go_text", D.moduleName, (o, a) => {
|
|
2896
2896
|
let l;
|
|
2897
2897
|
Array.isArray(o) && (o.length > 1 && (l = o[1]), o = o[0]);
|
|
2898
2898
|
const h = rt.deserialize(o), c = It(this.wnd.document, new I({
|
|
2899
2899
|
href: t.location.href,
|
|
2900
2900
|
type: "text/html",
|
|
2901
2901
|
text: h,
|
|
2902
|
-
locations: l ? new
|
|
2902
|
+
locations: l ? new C({
|
|
2903
2903
|
otherLocations: /* @__PURE__ */ new Map([
|
|
2904
2904
|
["cssSelector", l]
|
|
2905
2905
|
])
|
|
@@ -2912,51 +2912,51 @@ const _i = "readium-column-snapper-style", cs = 200, F = class F extends St {
|
|
|
2912
2912
|
this.wnd.requestAnimationFrame(() => {
|
|
2913
2913
|
this.rtl ? this.doc().scrollLeft = -this.snapNormOffset(c.getBoundingClientRect().left + t.scrollX) : this.doc().scrollLeft = this.snapOffset(c.getBoundingClientRect().left + t.scrollX), this.reportProgress(), O(this.wnd), a(!0);
|
|
2914
2914
|
});
|
|
2915
|
-
}), e.register("go_end",
|
|
2915
|
+
}), e.register("go_end", D.moduleName, (o, a) => {
|
|
2916
2916
|
this.wnd.requestAnimationFrame(() => {
|
|
2917
2917
|
this.cachedScrollWidth = this.doc().scrollWidth;
|
|
2918
2918
|
let l;
|
|
2919
2919
|
if (this.rtl ? l = -this.snapNormOffset(this.cachedScrollWidth - t.innerWidth) : l = this.snapOffset(this.cachedScrollWidth), this.doc().scrollLeft === l) return a(!1);
|
|
2920
2920
|
this.doc().scrollLeft = l, this.reportProgress(), O(this.wnd), a(!0);
|
|
2921
2921
|
});
|
|
2922
|
-
}), e.register("go_start",
|
|
2922
|
+
}), e.register("go_start", D.moduleName, (o, a) => {
|
|
2923
2923
|
this.wnd.requestAnimationFrame(() => {
|
|
2924
2924
|
if (this.doc().scrollLeft === 0) return a(!1);
|
|
2925
2925
|
this.doc().scrollLeft = 0, this.reportProgress(), O(this.wnd), a(!0);
|
|
2926
2926
|
});
|
|
2927
|
-
}), e.register("go_prev",
|
|
2927
|
+
}), e.register("go_prev", D.moduleName, (o, a) => {
|
|
2928
2928
|
this.wnd.requestAnimationFrame(() => {
|
|
2929
2929
|
this.cachedScrollWidth = this.doc().scrollWidth;
|
|
2930
2930
|
let l;
|
|
2931
2931
|
this.rtl ? l = s(this.normScroll() - t.innerWidth) : l = n(t.scrollX - t.innerWidth), this.reportProgress(), l && (O(this.wnd), this.checkSuspiciousSnap("left", this.wnd.innerWidth)), a(l);
|
|
2932
2932
|
});
|
|
2933
|
-
}), e.register("go_next",
|
|
2933
|
+
}), e.register("go_next", D.moduleName, (o, a) => {
|
|
2934
2934
|
this.wnd.requestAnimationFrame(() => {
|
|
2935
2935
|
this.cachedScrollWidth = this.doc().scrollWidth;
|
|
2936
2936
|
let l;
|
|
2937
2937
|
this.rtl ? l = s(this.normScroll() + t.innerWidth) : l = n(t.scrollX + t.innerWidth), this.reportProgress(), l && (O(this.wnd), this.checkSuspiciousSnap("right", this.wnd.innerWidth)), a(l);
|
|
2938
2938
|
});
|
|
2939
|
-
}), e.register("unfocus",
|
|
2939
|
+
}), e.register("unfocus", D.moduleName, (o, a) => {
|
|
2940
2940
|
this.snappingCancelled = !0, O(this.wnd), a(!0);
|
|
2941
|
-
}), e.register("shake",
|
|
2941
|
+
}), e.register("shake", D.moduleName, (o, a) => {
|
|
2942
2942
|
this.shake(), a(!0);
|
|
2943
|
-
}), e.register("focus",
|
|
2943
|
+
}), e.register("focus", D.moduleName, (o, a) => {
|
|
2944
2944
|
this.wnd.requestAnimationFrame(() => {
|
|
2945
2945
|
this.cachedScrollWidth = this.doc().scrollWidth, this.snapCurrentOffset(!1, !0), this.reportProgress(), a(!0);
|
|
2946
2946
|
});
|
|
2947
|
-
}), e.register("first_visible_locator",
|
|
2947
|
+
}), e.register("first_visible_locator", D.moduleName, (o, a) => {
|
|
2948
2948
|
const l = oe(t, !1);
|
|
2949
2949
|
this.comms.send("first_visible_locator", l.serialize()), a(!0);
|
|
2950
2950
|
}), t.addEventListener("touchstart", this.onTouchStarter, { passive: !0 }), t.addEventListener("touchend", this.onTouchEnder, { passive: !0 }), t.addEventListener("touchmove", this.onTouchMover, { passive: !0 }), t.document.addEventListener("touchstart", () => {
|
|
2951
2951
|
}), e.log("ColumnSnapper Mounted"), !0;
|
|
2952
2952
|
}
|
|
2953
2953
|
unmount(t, e) {
|
|
2954
|
-
return this.snappingCancelled = !0, e.unregisterAll(
|
|
2954
|
+
return this.snappingCancelled = !0, e.unregisterAll(D.moduleName), this.resizeObserver.disconnect(), this.mutationObserver.disconnect(), this.patternAnalyzer && (this.patternAnalyzer.clear(), this.patternAnalyzer = null, this.isSnapProtectionEnabled = !1), t.removeEventListener("touchstart", this.onTouchStarter), t.removeEventListener("touchend", this.onTouchEnder), t.removeEventListener("touchmove", this.onTouchMover), t.removeEventListener("orientationchange", this.onWidthChanger), t.removeEventListener("resize", this.onWidthChanger), t.document.getElementById(Ci)?.remove(), e.log("ColumnSnapper Unmounted"), super.unmount(t, e);
|
|
2955
2955
|
}
|
|
2956
2956
|
};
|
|
2957
|
-
|
|
2958
|
-
let
|
|
2959
|
-
const
|
|
2957
|
+
D.moduleName = "column_snapper";
|
|
2958
|
+
let Ce = D;
|
|
2959
|
+
const _i = "readium-scroll-snapper-style", U = class U extends vt {
|
|
2960
2960
|
constructor() {
|
|
2961
2961
|
super(...arguments), this.patternAnalyzer = null, this.lastScrollTime = 0, this.isScrollProtectionEnabled = !1, this.initialScrollHandled = !1, this.isScrolling = !1, this.lastScrollTop = 0, this.isResizing = !1, this.resizeDebounce = null, this.handleScroll = (t) => {
|
|
2962
2962
|
if (this.comms.ready && !this.isResizing) {
|
|
@@ -3007,7 +3007,7 @@ const Ci = "readium-scroll-snapper-style", U = class U extends St {
|
|
|
3007
3007
|
mount(t, e) {
|
|
3008
3008
|
this.wnd = t, this.comms = e, this.initialScrollHandled = !1, this.lastScrollTop = 0, this.isResizing = !1, this.resizeDebounce && (this.wnd.clearTimeout(this.resizeDebounce), this.resizeDebounce = null), t.navigator.epubReadingSystem && (t.navigator.epubReadingSystem.layoutStyle = "scrolling");
|
|
3009
3009
|
const i = t.document.createElement("style");
|
|
3010
|
-
return i.dataset.readium = "true", i.id =
|
|
3010
|
+
return i.dataset.readium = "true", i.id = _i, i.textContent = `
|
|
3011
3011
|
* {
|
|
3012
3012
|
scrollbar-width: none; /* for Firefox */
|
|
3013
3013
|
}
|
|
@@ -3020,7 +3020,7 @@ const Ci = "readium-scroll-snapper-style", U = class U extends St {
|
|
|
3020
3020
|
this.isResizing = !1, this.resizeDebounce = null, this.reportProgress();
|
|
3021
3021
|
}, 50);
|
|
3022
3022
|
}), this.resizeObserver.observe(t.document.body), t.addEventListener("scroll", this.handleScroll, { passive: !0 }), e.register("force_webkit_recalc", U.moduleName, () => {
|
|
3023
|
-
|
|
3023
|
+
Be(this.wnd);
|
|
3024
3024
|
const n = this.doc().scrollTop;
|
|
3025
3025
|
n > 1 ? this.doc().scrollTop = n - 1 : this.doc().scrollTop = n + 1, this.doc().scrollTop = n;
|
|
3026
3026
|
}), e.register("go_progression", U.moduleName, (n, s) => {
|
|
@@ -3050,7 +3050,7 @@ const Ci = "readium-scroll-snapper-style", U = class U extends St {
|
|
|
3050
3050
|
href: t.location.href,
|
|
3051
3051
|
type: "text/html",
|
|
3052
3052
|
text: a,
|
|
3053
|
-
locations: o ? new
|
|
3053
|
+
locations: o ? new C({
|
|
3054
3054
|
otherLocations: /* @__PURE__ */ new Map([
|
|
3055
3055
|
["cssSelector", o]
|
|
3056
3056
|
])
|
|
@@ -3084,12 +3084,12 @@ const Ci = "readium-scroll-snapper-style", U = class U extends St {
|
|
|
3084
3084
|
}), e.log("ScrollSnapper Mounted"), !0;
|
|
3085
3085
|
}
|
|
3086
3086
|
unmount(t, e) {
|
|
3087
|
-
return e.unregisterAll(U.moduleName), this.resizeObserver.disconnect(), this.handleScroll && t.removeEventListener("scroll", this.handleScroll), t.document.getElementById(
|
|
3087
|
+
return e.unregisterAll(U.moduleName), this.resizeObserver.disconnect(), this.handleScroll && t.removeEventListener("scroll", this.handleScroll), t.document.getElementById(_i)?.remove(), this.patternAnalyzer && (this.patternAnalyzer.clear(), this.patternAnalyzer = null, this.isScrollProtectionEnabled = !1), e.log("ScrollSnapper Unmounted"), !0;
|
|
3088
3088
|
}
|
|
3089
3089
|
};
|
|
3090
3090
|
U.moduleName = "scroll_snapper";
|
|
3091
|
-
let
|
|
3092
|
-
const
|
|
3091
|
+
let _e = U;
|
|
3092
|
+
const H = class H extends vt {
|
|
3093
3093
|
constructor() {
|
|
3094
3094
|
super(...arguments), this.patternAnalyzer = null, this.lastScrollTime = 0, this.isScrollProtectionEnabled = !1, this.initialScrollHandled = !1, this.isScrolling = !1, this.lastScrollTop = 0, this.isResizing = !1, this.resizeDebounce = null, this.handleScroll = (t) => {
|
|
3095
3095
|
if (this.comms.ready && !this.isResizing) {
|
|
@@ -3142,11 +3142,11 @@ const B = class B extends St {
|
|
|
3142
3142
|
this.resizeDebounce && this.wnd.clearTimeout(this.resizeDebounce), this.isResizing = !0, this.resizeDebounce = this.wnd.setTimeout(() => {
|
|
3143
3143
|
this.isResizing = !1, this.resizeDebounce = null, this.reportProgress();
|
|
3144
3144
|
}, 50);
|
|
3145
|
-
}), this.resizeObserver.observe(t.document.body), t.addEventListener("scroll", this.handleScroll, { passive: !0 }), e.register("force_webkit_recalc",
|
|
3146
|
-
|
|
3145
|
+
}), this.resizeObserver.observe(t.document.body), t.addEventListener("scroll", this.handleScroll, { passive: !0 }), e.register("force_webkit_recalc", H.moduleName, () => {
|
|
3146
|
+
Be(this.wnd);
|
|
3147
3147
|
const i = this.doc().scrollTop;
|
|
3148
3148
|
i > 1 ? this.doc().scrollTop = i - 1 : this.doc().scrollTop = i + 1, this.doc().scrollTop = i;
|
|
3149
|
-
}), e.register("go_progression",
|
|
3149
|
+
}), e.register("go_progression", H.moduleName, (i, n) => {
|
|
3150
3150
|
const s = i;
|
|
3151
3151
|
if (s < 0 || s > 1) {
|
|
3152
3152
|
e.send("error", {
|
|
@@ -3157,7 +3157,7 @@ const B = class B extends St {
|
|
|
3157
3157
|
this.wnd.requestAnimationFrame(() => {
|
|
3158
3158
|
this.doc().scrollTop = this.doc().offsetHeight * s, this.reportProgress(), O(this.wnd), n(!0);
|
|
3159
3159
|
});
|
|
3160
|
-
}), e.register("go_id",
|
|
3160
|
+
}), e.register("go_id", H.moduleName, (i, n) => {
|
|
3161
3161
|
const s = t.document.getElementById(i);
|
|
3162
3162
|
if (!s) {
|
|
3163
3163
|
n(!1);
|
|
@@ -3166,14 +3166,14 @@ const B = class B extends St {
|
|
|
3166
3166
|
this.wnd.requestAnimationFrame(() => {
|
|
3167
3167
|
this.doc().scrollTop = s.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), O(this.wnd), n(!0);
|
|
3168
3168
|
});
|
|
3169
|
-
}), e.register("go_text",
|
|
3169
|
+
}), e.register("go_text", H.moduleName, (i, n) => {
|
|
3170
3170
|
let s;
|
|
3171
3171
|
Array.isArray(i) && (i.length > 1 && (s = i[1]), i = i[0]);
|
|
3172
3172
|
const o = rt.deserialize(i), a = It(this.wnd.document, new I({
|
|
3173
3173
|
href: t.location.href,
|
|
3174
3174
|
type: "text/html",
|
|
3175
3175
|
text: o,
|
|
3176
|
-
locations: s ? new
|
|
3176
|
+
locations: s ? new C({
|
|
3177
3177
|
otherLocations: /* @__PURE__ */ new Map([
|
|
3178
3178
|
["cssSelector", s]
|
|
3179
3179
|
])
|
|
@@ -3186,32 +3186,32 @@ const B = class B extends St {
|
|
|
3186
3186
|
this.wnd.requestAnimationFrame(() => {
|
|
3187
3187
|
this.doc().scrollTop = a.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), O(this.wnd), n(!0);
|
|
3188
3188
|
});
|
|
3189
|
-
}), e.register("go_start",
|
|
3189
|
+
}), e.register("go_start", H.moduleName, (i, n) => {
|
|
3190
3190
|
if (this.doc().scrollTop === 0) return n(!1);
|
|
3191
3191
|
this.doc().scrollTop = 0, this.reportProgress(), n(!0);
|
|
3192
|
-
}), e.register("go_end",
|
|
3192
|
+
}), e.register("go_end", H.moduleName, (i, n) => {
|
|
3193
3193
|
if (this.doc().scrollTop === this.doc().scrollHeight - this.doc().offsetHeight) return n(!1);
|
|
3194
3194
|
this.doc().scrollTop = this.doc().scrollHeight - this.doc().offsetHeight, this.reportProgress(), n(!0);
|
|
3195
|
-
}), e.register("unfocus",
|
|
3195
|
+
}), e.register("unfocus", H.moduleName, (i, n) => {
|
|
3196
3196
|
O(this.wnd), n(!0);
|
|
3197
|
-
}), e.register("scroll_protection",
|
|
3197
|
+
}), e.register("scroll_protection", H.moduleName, (i, n) => {
|
|
3198
3198
|
this.enableScrollProtection(), n(!0);
|
|
3199
3199
|
}), e.register([
|
|
3200
3200
|
"go_next",
|
|
3201
3201
|
"go_prev"
|
|
3202
|
-
],
|
|
3202
|
+
], H.moduleName, (i, n) => n(!1)), e.register("focus", H.moduleName, (i, n) => {
|
|
3203
3203
|
this.reportProgress(), n(!0);
|
|
3204
|
-
}), e.register("first_visible_locator",
|
|
3204
|
+
}), e.register("first_visible_locator", H.moduleName, (i, n) => {
|
|
3205
3205
|
const s = oe(t, !0);
|
|
3206
3206
|
e.send("first_visible_locator", s.serialize()), n(!0);
|
|
3207
3207
|
}), e.log("WebPubSnapper Mounted"), !0;
|
|
3208
3208
|
}
|
|
3209
3209
|
unmount(t, e) {
|
|
3210
|
-
return e.unregisterAll(
|
|
3210
|
+
return e.unregisterAll(H.moduleName), this.resizeObserver.disconnect(), this.handleScroll && t.removeEventListener("scroll", this.handleScroll), this.patternAnalyzer && (this.patternAnalyzer.clear(), this.patternAnalyzer = null, this.isScrollProtectionEnabled = !1), e.log("WebPubSnapper Unmounted"), !0;
|
|
3211
3211
|
}
|
|
3212
3212
|
};
|
|
3213
|
-
|
|
3214
|
-
let Le =
|
|
3213
|
+
H.moduleName = "webpub_snapper";
|
|
3214
|
+
let Le = H;
|
|
3215
3215
|
class ds {
|
|
3216
3216
|
constructor(t, e) {
|
|
3217
3217
|
this.window = t, this.copyHistory = [], this.lastSelectionLength = 0, this.lastSelectionTime = 0, this.options = e;
|
|
@@ -3660,7 +3660,7 @@ const At = class At extends Et {
|
|
|
3660
3660
|
), Reflect.defineProperty(t.navigator, "epubReadingSystem", {
|
|
3661
3661
|
value: {
|
|
3662
3662
|
name: "readium-ts-toolkit",
|
|
3663
|
-
version: "2.5.2
|
|
3663
|
+
version: "2.5.2",
|
|
3664
3664
|
hasFeature: (n, s = "") => {
|
|
3665
3665
|
switch (n) {
|
|
3666
3666
|
case "dom-manipulation":
|
|
@@ -3708,8 +3708,8 @@ const At = class At extends Et {
|
|
|
3708
3708
|
}
|
|
3709
3709
|
};
|
|
3710
3710
|
At.moduleName = "setup";
|
|
3711
|
-
let
|
|
3712
|
-
const Li = "readium-viewport", Z = class Z extends
|
|
3711
|
+
let Gt = At;
|
|
3712
|
+
const Li = "readium-viewport", Z = class Z extends Gt {
|
|
3713
3713
|
onViewportWidthChanged(t) {
|
|
3714
3714
|
const e = t.target;
|
|
3715
3715
|
Tt(e, "--RS__viewportWidth", `${e.innerWidth}px`);
|
|
@@ -3723,7 +3723,7 @@ const Li = "readium-viewport", Z = class Z extends Xt {
|
|
|
3723
3723
|
), t.document.head.appendChild(i), t.addEventListener("orientationchange", this.onViewportWidthChanged), t.addEventListener("resize", this.onViewportWidthChanged), this.onViewportWidthChanged({
|
|
3724
3724
|
target: t
|
|
3725
3725
|
}), e.register("get_properties", Z.moduleName, (n, s) => {
|
|
3726
|
-
|
|
3726
|
+
He(t), s(!0);
|
|
3727
3727
|
}), e.register("update_properties", Z.moduleName, (n, s) => {
|
|
3728
3728
|
n["--RS__viewportWidth"] = `${t.innerWidth}px`, sn(t, n), s(!0);
|
|
3729
3729
|
}), e.register("set_property", Z.moduleName, (n, s) => {
|
|
@@ -3741,7 +3741,7 @@ const Li = "readium-viewport", Z = class Z extends Xt {
|
|
|
3741
3741
|
};
|
|
3742
3742
|
Z.moduleName = "reflowable_setup";
|
|
3743
3743
|
let ke = Z;
|
|
3744
|
-
const xi = "readium-fixed-style", q = class q extends
|
|
3744
|
+
const xi = "readium-fixed-style", q = class q extends Gt {
|
|
3745
3745
|
mount(t, e) {
|
|
3746
3746
|
if (!super.mount(t, e)) return !1;
|
|
3747
3747
|
t.navigator.epubReadingSystem && (t.navigator.epubReadingSystem.layoutStyle = "paginated");
|
|
@@ -3799,7 +3799,7 @@ const Q = class Q extends Et {
|
|
|
3799
3799
|
this.wndOnErr,
|
|
3800
3800
|
!1
|
|
3801
3801
|
), e.register("get_properties", Q.moduleName, (i, n) => {
|
|
3802
|
-
|
|
3802
|
+
He(t), n(!0);
|
|
3803
3803
|
}), e.register("update_properties", Q.moduleName, (i, n) => {
|
|
3804
3804
|
sn(t, i), n(!0);
|
|
3805
3805
|
}), e.register("set_property", Q.moduleName, (i, n) => {
|
|
@@ -3854,7 +3854,7 @@ let ps = (nt = class extends Et {
|
|
|
3854
3854
|
return this.beforePrintHandler && (t.removeEventListener("beforeprint", this.beforePrintHandler), this.beforePrintHandler = null), this.styleElement?.parentNode && (this.styleElement.parentNode.removeChild(this.styleElement), this.styleElement = null), this.comms?.unregisterAll(nt.moduleName), this.configApplied = !1, !0;
|
|
3855
3855
|
}
|
|
3856
3856
|
}, nt.moduleName = "print_protection", nt);
|
|
3857
|
-
const ki = "readium-cjk-vertical-snapper-style",
|
|
3857
|
+
const ki = "readium-cjk-vertical-snapper-style", B = class B extends vt {
|
|
3858
3858
|
constructor() {
|
|
3859
3859
|
super(...arguments), this.patternAnalyzer = null, this.lastScrollTime = 0, this.isScrollProtectionEnabled = !1, this.initialScrollHandled = !1, this.isScrolling = !1, this.lastScrollLeft = 0, this.isResizing = !1, this.resizeDebounce = null, this.verticalLR = !1, this.handleScroll = (t) => {
|
|
3860
3860
|
if (this.comms.ready && !this.isResizing) {
|
|
@@ -3926,11 +3926,11 @@ const ki = "readium-cjk-vertical-snapper-style", H = class H extends St {
|
|
|
3926
3926
|
this.resizeDebounce && this.wnd.clearTimeout(this.resizeDebounce), this.isResizing = !0, this.resizeDebounce = this.wnd.setTimeout(() => {
|
|
3927
3927
|
this.isResizing = !1, this.resizeDebounce = null, this.reportProgress();
|
|
3928
3928
|
}, 50);
|
|
3929
|
-
}), this.resizeObserver.observe(t.document.body), t.addEventListener("scroll", this.handleScroll, { passive: !0 }), e.register("force_webkit_recalc",
|
|
3930
|
-
|
|
3929
|
+
}), this.resizeObserver.observe(t.document.body), t.addEventListener("scroll", this.handleScroll, { passive: !0 }), e.register("force_webkit_recalc", B.moduleName, () => {
|
|
3930
|
+
Be(this.wnd);
|
|
3931
3931
|
const n = this.doc().scrollLeft;
|
|
3932
3932
|
this.verticalLR ? this.doc().scrollLeft = n > 1 ? n - 1 : n + 1 : this.doc().scrollLeft = n < -1 ? n + 1 : n - 1, this.doc().scrollLeft = n;
|
|
3933
|
-
}), e.register("go_progression",
|
|
3933
|
+
}), e.register("go_progression", B.moduleName, (n, s) => {
|
|
3934
3934
|
const o = n;
|
|
3935
3935
|
if (o < 0 || o > 1) {
|
|
3936
3936
|
e.send("error", {
|
|
@@ -3942,7 +3942,7 @@ const ki = "readium-cjk-vertical-snapper-style", H = class H extends St {
|
|
|
3942
3942
|
const a = this.scrollable() * o;
|
|
3943
3943
|
this.doc().scrollLeft = this.verticalLR ? a : -a, this.reportProgress(), O(this.wnd), s(!0);
|
|
3944
3944
|
});
|
|
3945
|
-
}), e.register("go_id",
|
|
3945
|
+
}), e.register("go_id", B.moduleName, (n, s) => {
|
|
3946
3946
|
const o = t.document.getElementById(n);
|
|
3947
3947
|
if (!o) {
|
|
3948
3948
|
s(!1);
|
|
@@ -3951,14 +3951,14 @@ const ki = "readium-cjk-vertical-snapper-style", H = class H extends St {
|
|
|
3951
3951
|
this.wnd.requestAnimationFrame(() => {
|
|
3952
3952
|
this.doc().scrollLeft += o.getBoundingClientRect().left - t.innerWidth / 2, this.reportProgress(), O(this.wnd), s(!0);
|
|
3953
3953
|
});
|
|
3954
|
-
}), e.register("go_text",
|
|
3954
|
+
}), e.register("go_text", B.moduleName, (n, s) => {
|
|
3955
3955
|
let o;
|
|
3956
3956
|
Array.isArray(n) && (n.length > 1 && (o = n[1]), n = n[0]);
|
|
3957
3957
|
const a = rt.deserialize(n), l = It(this.wnd.document, new I({
|
|
3958
3958
|
href: t.location.href,
|
|
3959
3959
|
type: "text/html",
|
|
3960
3960
|
text: a,
|
|
3961
|
-
locations: o ? new
|
|
3961
|
+
locations: o ? new C({
|
|
3962
3962
|
otherLocations: /* @__PURE__ */ new Map([["cssSelector", o]])
|
|
3963
3963
|
}) : void 0
|
|
3964
3964
|
}));
|
|
@@ -3969,32 +3969,32 @@ const ki = "readium-cjk-vertical-snapper-style", H = class H extends St {
|
|
|
3969
3969
|
this.wnd.requestAnimationFrame(() => {
|
|
3970
3970
|
this.doc().scrollLeft += l.getBoundingClientRect().left - t.innerWidth / 2, this.reportProgress(), O(this.wnd), s(!0);
|
|
3971
3971
|
});
|
|
3972
|
-
}), e.register("go_start",
|
|
3972
|
+
}), e.register("go_start", B.moduleName, (n, s) => {
|
|
3973
3973
|
if (this.doc().scrollLeft === 0) return s(!1);
|
|
3974
3974
|
this.doc().scrollLeft = 0, this.reportProgress(), s(!0);
|
|
3975
|
-
}), e.register("go_end",
|
|
3975
|
+
}), e.register("go_end", B.moduleName, (n, s) => {
|
|
3976
3976
|
if (Math.abs(this.doc().scrollLeft) === this.scrollable()) return s(!1);
|
|
3977
3977
|
this.doc().scrollLeft = this.verticalLR ? this.scrollable() : -this.scrollable(), this.reportProgress(), s(!0);
|
|
3978
3978
|
}), e.register([
|
|
3979
3979
|
"go_next",
|
|
3980
3980
|
"go_prev"
|
|
3981
|
-
],
|
|
3981
|
+
], B.moduleName, (n, s) => s(!1)), e.register("unfocus", B.moduleName, (n, s) => {
|
|
3982
3982
|
O(this.wnd), s(!0);
|
|
3983
|
-
}), e.register("scroll_protection",
|
|
3983
|
+
}), e.register("scroll_protection", B.moduleName, (n, s) => {
|
|
3984
3984
|
this.enableScrollProtection(), s(!0);
|
|
3985
|
-
}), e.register("focus",
|
|
3985
|
+
}), e.register("focus", B.moduleName, (n, s) => {
|
|
3986
3986
|
this.reportProgress(), s(!0);
|
|
3987
|
-
}), e.register("first_visible_locator",
|
|
3987
|
+
}), e.register("first_visible_locator", B.moduleName, (n, s) => {
|
|
3988
3988
|
const o = oe(t, !0);
|
|
3989
3989
|
this.comms.send("first_visible_locator", o.serialize()), s(!0);
|
|
3990
3990
|
}), e.log("CJKVerticalSnapper Mounted"), !0;
|
|
3991
3991
|
}
|
|
3992
3992
|
unmount(t, e) {
|
|
3993
|
-
return e.unregisterAll(
|
|
3993
|
+
return e.unregisterAll(B.moduleName), this.resizeObserver.disconnect(), this.handleScroll && t.removeEventListener("scroll", this.handleScroll), t.document.getElementById(ki)?.remove(), this.patternAnalyzer && (this.patternAnalyzer.clear(), this.patternAnalyzer = null, this.isScrollProtectionEnabled = !1), e.log("CJKVerticalSnapper Unmounted"), !0;
|
|
3994
3994
|
}
|
|
3995
3995
|
};
|
|
3996
|
-
|
|
3997
|
-
let Ae =
|
|
3996
|
+
B.moduleName = "cjk_vertical_snapper";
|
|
3997
|
+
let Ae = B;
|
|
3998
3998
|
const fs = [
|
|
3999
3999
|
"fixed_setup",
|
|
4000
4000
|
"decorator",
|
|
@@ -4022,8 +4022,8 @@ const fs = [
|
|
|
4022
4022
|
Le,
|
|
4023
4023
|
xe,
|
|
4024
4024
|
Ee,
|
|
4025
|
-
_e,
|
|
4026
4025
|
Ce,
|
|
4026
|
+
_e,
|
|
4027
4027
|
Ae,
|
|
4028
4028
|
ps
|
|
4029
4029
|
].map((r) => [r.moduleName, r]));
|
|
@@ -4033,7 +4033,7 @@ class Pt {
|
|
|
4033
4033
|
* @param initialModules List of initial modules to load
|
|
4034
4034
|
*/
|
|
4035
4035
|
constructor(t = window, e = []) {
|
|
4036
|
-
this.loadedModules = [], this.wnd = t, this.comms = new
|
|
4036
|
+
this.loadedModules = [], this.wnd = t, this.comms = new zn(t);
|
|
4037
4037
|
const i = [...new Set(e)];
|
|
4038
4038
|
if (i.length) {
|
|
4039
4039
|
if (typeof t > "u")
|
|
@@ -4135,7 +4135,7 @@ const ys = {
|
|
|
4135
4135
|
{ keyCode: 80, ctrl: !0, alt: !0 }
|
|
4136
4136
|
// Ctrl+Alt+P
|
|
4137
4137
|
]
|
|
4138
|
-
},
|
|
4138
|
+
}, Ss = {
|
|
4139
4139
|
type: "save",
|
|
4140
4140
|
keyCombos: [
|
|
4141
4141
|
{ keyCode: 83, meta: !0 },
|
|
@@ -4153,7 +4153,7 @@ class cn {
|
|
|
4153
4153
|
const i = [], n = e.filter(
|
|
4154
4154
|
(s) => !["developer_tools", "select_all", "print", "save"].includes(s.type)
|
|
4155
4155
|
);
|
|
4156
|
-
t.disableSelectAll && i.push(bs), t.disableSave && i.push(
|
|
4156
|
+
t.disableSelectAll && i.push(bs), t.disableSave && i.push(Ss), t.monitorDevTools && i.push(ys), t.protectPrinting?.disable && i.push(ws);
|
|
4157
4157
|
for (const s of n) {
|
|
4158
4158
|
const o = s.keyCombos.filter(
|
|
4159
4159
|
(a) => !i.some(
|
|
@@ -4175,16 +4175,16 @@ class dn extends cn {
|
|
|
4175
4175
|
* Moves to the left content portion (eg. page) relative to the reading progression direction.
|
|
4176
4176
|
*/
|
|
4177
4177
|
goLeft(t = !1, e) {
|
|
4178
|
-
this.readingProgression ===
|
|
4178
|
+
this.readingProgression === M.ltr ? this.goBackward(t, e) : this.readingProgression === M.rtl && this.goForward(t, e);
|
|
4179
4179
|
}
|
|
4180
4180
|
/**
|
|
4181
4181
|
* Moves to the right content portion (eg. page) relative to the reading progression direction.
|
|
4182
4182
|
*/
|
|
4183
4183
|
goRight(t = !1, e) {
|
|
4184
|
-
this.readingProgression ===
|
|
4184
|
+
this.readingProgression === M.ltr ? this.goForward(t, e) : this.readingProgression === M.rtl && this.goBackward(t, e);
|
|
4185
4185
|
}
|
|
4186
4186
|
}
|
|
4187
|
-
class
|
|
4187
|
+
class vs extends cn {
|
|
4188
4188
|
}
|
|
4189
4189
|
class Ps {
|
|
4190
4190
|
constructor(t, e, i, n) {
|
|
@@ -4237,7 +4237,7 @@ class Ps {
|
|
|
4237
4237
|
}
|
|
4238
4238
|
}
|
|
4239
4239
|
const Es = 1e4;
|
|
4240
|
-
class
|
|
4240
|
+
class Nt {
|
|
4241
4241
|
constructor(t, e) {
|
|
4242
4242
|
this.registry = /* @__PURE__ */ new Map(), this._ready = !1, this.listenerBuffer = [], this.handler = this.handle.bind(this), this.wnd = t, this.origin = e;
|
|
4243
4243
|
try {
|
|
@@ -4316,9 +4316,9 @@ class Mt {
|
|
|
4316
4316
|
), o;
|
|
4317
4317
|
}
|
|
4318
4318
|
}
|
|
4319
|
-
const
|
|
4320
|
-
|
|
4321
|
-
}, Ls = 16, Oi =
|
|
4319
|
+
const Cs = "'Iowan Old Style', Sitka, 'Sitka Text', Palatino, 'Book Antiqua', 'URW Palladio L', P052, serif", _s = {
|
|
4320
|
+
oldStyleTf: Cs
|
|
4321
|
+
}, Ls = 16, Oi = _s.oldStyleTf;
|
|
4322
4322
|
class kt {
|
|
4323
4323
|
constructor(t) {
|
|
4324
4324
|
this._optimalLineLength = null, this._canvas = document.createElement("canvas"), this._optimalChars = t.optimalChars, this._minChars = t.minChars, this._maxChars = t.maxChars, this._baseFontSize = t.baseFontSize || Ls, this._fontFace = t.fontFace || Oi, this._sample = t.sample || null, this._padding = t.padding ?? 0, this._letterSpacing = t.letterSpacing ? Math.round(t.letterSpacing * this._baseFontSize) : 0, this._wordSpacing = t.wordSpacing ? Math.round(t.wordSpacing * this._baseFontSize) : 0, this._isCJK = t.isCJK || !1, this._getRelative = t.getRelative || !1, this._minDivider = this._minChars && this._minChars < this._optimalChars ? this._optimalChars / this._minChars : this._minChars === null ? null : 1, this._maxMultiplier = this._maxChars && this._maxChars > this._optimalChars ? this._maxChars / this._optimalChars : this._maxChars === null ? null : 1, this._approximatedWordSpaces = kt.approximateWordSpaces(this._optimalChars, this._sample);
|
|
@@ -4441,7 +4441,7 @@ function bt(r) {
|
|
|
4441
4441
|
const t = r.languages?.[0]?.toLowerCase(), e = r.readingProgression;
|
|
4442
4442
|
if (t) {
|
|
4443
4443
|
if (t.startsWith("zh") || t.startsWith("ja") || t.startsWith("ko"))
|
|
4444
|
-
return e ===
|
|
4444
|
+
return e === M.rtl ? "cjk-vertical" : "cjk-horizontal";
|
|
4445
4445
|
if (t.startsWith("mn-mong")) return "mongolian-vertical";
|
|
4446
4446
|
if (t.startsWith("ar") || t.startsWith("fa") || t.startsWith("he")) return "rtl";
|
|
4447
4447
|
}
|
|
@@ -4536,7 +4536,7 @@ class ks {
|
|
|
4536
4536
|
async show(t) {
|
|
4537
4537
|
if (this.destroyed) throw Error("Trying to show frame when it doesn't exist");
|
|
4538
4538
|
if (!this.frame.parentElement) throw Error("Trying to show frame that is not attached to the DOM");
|
|
4539
|
-
return this.comms ? this.comms.resume() : this.comms = new
|
|
4539
|
+
return this.comms ? this.comms.resume() : this.comms = new Nt(this.frame.contentWindow, this.source), new Promise((e, i) => {
|
|
4540
4540
|
this.comms?.send("activate", void 0, () => {
|
|
4541
4541
|
this.comms?.send("focus", void 0, () => {
|
|
4542
4542
|
this.applyContentProtection();
|
|
@@ -4549,7 +4549,7 @@ class ks {
|
|
|
4549
4549
|
});
|
|
4550
4550
|
}
|
|
4551
4551
|
setCSSProperties(t) {
|
|
4552
|
-
this.destroyed || !this.frame.contentWindow || (this.hidden && (this.comms ? this.comms?.resume() : this.comms = new
|
|
4552
|
+
this.destroyed || !this.frame.contentWindow || (this.hidden && (this.comms ? this.comms?.resume() : this.comms = new Nt(this.frame.contentWindow, this.source)), this.comms?.send("update_properties", t), this.hidden && this.comms?.halt());
|
|
4553
4553
|
}
|
|
4554
4554
|
get iframe() {
|
|
4555
4555
|
if (this.destroyed) throw Error("Trying to use frame when it doesn't exist");
|
|
@@ -4874,11 +4874,45 @@ function Rs() {
|
|
|
4874
4874
|
};
|
|
4875
4875
|
return i.posix = i, me = i, me;
|
|
4876
4876
|
}
|
|
4877
|
-
var
|
|
4878
|
-
const As = { description: "Attempts to filter out paragraphs that are implicitly headings or part of headers", scope: "RS", value: "readium-experimentalHeaderFiltering-on" }, Ts = { description: "
|
|
4877
|
+
var Xt = Rs();
|
|
4878
|
+
const As = { description: "Attempts to filter out paragraphs that are implicitly headings or part of headers", scope: "RS", value: "readium-experimentalHeaderFiltering-on" }, Ts = { description: "Attempts to filter out elements that are sized using viewport units and should not be scaled directly e.g. tables, images, iframes, etc.", scope: "RS", value: "readium-experimentalZoom-on" }, Ns = {
|
|
4879
4879
|
experimentalHeaderFiltering: As,
|
|
4880
4880
|
experimentalZoom: Ts
|
|
4881
|
-
},
|
|
4881
|
+
}, Ms = { disabled: ["bodyHyphens", "a11yNormalize", "letterSpacing"], added: [] }, Fs = {
|
|
4882
|
+
default: { disabled: [], added: [] },
|
|
4883
|
+
rtl: Ms,
|
|
4884
|
+
"cjk-horizontal": { disabled: ["textAlign", "bodyHyphens", "a11yNormalize", "ligatures", "paraIndent", "wordSpacing"], added: ["noRuby"] },
|
|
4885
|
+
"cjk-vertical": { disabled: ["colCount", "textAlign", "bodyHyphens", "a11yNormalize", "ligatures", "paraIndent", "wordSpacing"], added: ["noRuby"] }
|
|
4886
|
+
}, Is = { baseFontFamily: "Kefa, Nyala, Roboto, Noto, 'Noto Sans Ethiopic', serif", lineHeightCompensation: 1.167 }, zs = { baseFontFamily: "'Geeza Pro', 'Arabic Typesetting', Roboto, Noto, 'Noto Naskh Arabic', 'Times New Roman', serif" }, Ds = { baseFontFamily: "'Kohinoor Bangla', 'Bangla Sangam MN', Vrinda, Roboto, Noto, 'Noto Sans Bengali', sans-serif", lineHeightCompensation: 1.067 }, Ws = { baseFontFamily: "Kailasa, 'Microsoft Himalaya', Roboto, Noto, 'Noto Sans Tibetan', sans-serif" }, Us = { baseFontFamily: "'Plantagenet Cherokee', Roboto, Noto, 'Noto Sans Cherokee'", lineHeightCompensation: 1.167 }, Hs = { baseFontFamily: "'Geeza Pro', 'Arabic Typesetting', Roboto, Noto, 'Noto Naskh Arabic', 'Times New Roman', serif" }, Bs = { baseFontFamily: "'Gujarati Sangam MN', 'Nirmala UI', Shruti, Roboto, Noto, 'Noto Sans Gujarati', sans-serif", lineHeightCompensation: 1.167 }, Vs = { baseFontFamily: "'New Peninim MT', 'Arial Hebrew', Gisha, 'Times New Roman', Roboto, Noto, 'Noto Sans Hebrew', sans-serif", lineHeightCompensation: 1.1 }, js = { baseFontFamily: "'Kohinoor Devanagari', 'Devanagari Sangam MN', Kokila, 'Nirmala UI', Roboto, Noto, 'Noto Sans Devanagari', sans-serif", lineHeightCompensation: 1.1 }, $s = { baseFontFamily: "Mshtakan, Sylfaen, Roboto, Noto, 'Noto Serif Armenian', serif" }, Gs = { baseFontFamily: "'Euphemia UCAS', Euphemia, Roboto, Noto, 'Noto Sans Canadian Aboriginal', sans-serif" }, Xs = { baseFontFamily: "YuGothic, 'Hiragino Maru Gothic ProN', 'Hiragino Sans', 'Yu Gothic UI', 'Meiryo UI', 'MS Gothic', Roboto, Noto, 'Noto Sans CJK JP', sans-serif", lineHeightCompensation: 1.167 }, Ys = { baseFontFamily: "'Khmer Sangam MN', 'Leelawadee UI', 'Khmer UI', Roboto, Noto, 'Noto Sans Khmer', sans-serif", lineHeightCompensation: 1.067 }, qs = { baseFontFamily: "'Kannada Sangam MN', 'Nirmala UI', Tunga, Roboto, Noto, 'Noto Sans Kannada', sans-serif", lineHeightCompensation: 1.1 }, Ks = { baseFontFamily: "'Nanum Gothic', 'Apple SD Gothic Neo', 'Malgun Gothic', Roboto, Noto, 'Noto Sans CJK KR', sans-serif", lineHeightCompensation: 1.167 }, Js = { baseFontFamily: "'Lao Sangam MN', 'Leelawadee UI', 'Lao UI', Roboto, Noto, 'Noto Sans Lao', sans-serif" }, Zs = { baseFontFamily: "'Malayalam Sangam MN', 'Nirmala UI', Kartika, Roboto, Noto, 'Noto Sans Malayalam', sans-serif", lineHeightCompensation: 1.067 }, Qs = { baseFontFamily: "'Oriya Sangam MN', 'Nirmala UI', Kalinga, Roboto, Noto, 'Noto Sans Oriya', sans-serif", lineHeightCompensation: 1.167 }, tr = { baseFontFamily: "'Gurmukhi MN', 'Nirmala UI', Kartika, Roboto, Noto, 'Noto Sans Gurmukhi', sans-serif", lineHeightCompensation: 1.1 }, er = { baseFontFamily: "'Sinhala Sangam MN', 'Nirmala UI', 'Iskoola Pota', Roboto, Noto, 'Noto Sans Sinhala', sans-serif", lineHeightCompensation: 1.167 }, ir = { baseFontFamily: "'Tamil Sangam MN', 'Nirmala UI', Latha, Roboto, Noto, 'Noto Sans Tamil', sans-serif", lineHeightCompensation: 1.067 }, nr = { baseFontFamily: "'Kohinoor Telugu', 'Telugu Sangam MN', 'Nirmala UI', Gautami, Roboto, Noto, 'Noto Sans Telugu', sans-serif" }, sr = { baseFontFamily: "Thonburi, 'Leelawadee UI', 'Cordia New', Roboto, Noto, 'Noto Sans Thai', sans-serif", lineHeightCompensation: 1.067 }, rr = { baseFontFamily: "'方体', 'PingFang SC', '黑体', 'Heiti SC', 'Microsoft JhengHei UI', 'Microsoft JhengHei', Roboto, Noto, 'Noto Sans CJK SC', sans-serif", lineHeightCompensation: 1.167 }, or = {
|
|
4887
|
+
default: { baseFontFamily: "var(--RS__oldStyleTf)", lineHeightCompensation: 1 },
|
|
4888
|
+
am: Is,
|
|
4889
|
+
ar: zs,
|
|
4890
|
+
bn: Ds,
|
|
4891
|
+
bo: Ws,
|
|
4892
|
+
chr: Us,
|
|
4893
|
+
fa: Hs,
|
|
4894
|
+
gu: Bs,
|
|
4895
|
+
he: Vs,
|
|
4896
|
+
hi: js,
|
|
4897
|
+
hy: $s,
|
|
4898
|
+
iu: Gs,
|
|
4899
|
+
ja: Xs,
|
|
4900
|
+
km: Ys,
|
|
4901
|
+
kn: qs,
|
|
4902
|
+
ko: Ks,
|
|
4903
|
+
lo: Js,
|
|
4904
|
+
ml: Zs,
|
|
4905
|
+
or: Qs,
|
|
4906
|
+
pa: tr,
|
|
4907
|
+
si: er,
|
|
4908
|
+
ta: ir,
|
|
4909
|
+
te: nr,
|
|
4910
|
+
th: sr,
|
|
4911
|
+
zh: rr,
|
|
4912
|
+
"zh-Hant": { baseFontFamily: "'方體', 'PingFang TC', '黑體', 'Heiti TC', 'Microsoft JhengHei UI', 'Microsoft JhengHei', Roboto, Noto, 'Noto Sans CJK TC', sans-serif", lineHeightCompensation: 1.167 },
|
|
4913
|
+
"zh-TW": { baseFontFamily: "'方體', 'PingFang TC', '黑體', 'Heiti TC', 'Microsoft JhengHei UI', 'Microsoft JhengHei', Roboto, Noto, 'Noto Sans CJK TC', sans-serif", lineHeightCompensation: 1.167 },
|
|
4914
|
+
"zh-HK": { baseFontFamily: "'方體', 'PingFang HK', '方體', 'PingFang TC', '黑體', 'Heiti TC', 'Microsoft JhengHei UI', 'Microsoft JhengHei', Roboto, Noto, 'Noto Sans CJK TC', sans-serif", lineHeightCompensation: 1.167 }
|
|
4915
|
+
}, Ge = Ns, uo = Fs, po = or;
|
|
4882
4916
|
var tt = /* @__PURE__ */ ((r) => (r.start = "start", r.left = "left", r.right = "right", r.justify = "justify", r))(tt || {});
|
|
4883
4917
|
const dt = {
|
|
4884
4918
|
range: [0, 100],
|
|
@@ -4896,7 +4930,7 @@ const dt = {
|
|
|
4896
4930
|
range: [0, 1],
|
|
4897
4931
|
step: 0.125
|
|
4898
4932
|
}, Jt = {
|
|
4899
|
-
range: [1, 2],
|
|
4933
|
+
range: [1, 2.5],
|
|
4900
4934
|
step: 0.1
|
|
4901
4935
|
}, ut = {
|
|
4902
4936
|
range: [20, 100],
|
|
@@ -4959,18 +4993,18 @@ class mn extends le {
|
|
|
4959
4993
|
return this.a11yNormalize && (t["--USER__a11yNormalize"] = this.toFlag("a11y")), this.bodyHyphens && (t["--USER__bodyHyphens"] = this.bodyHyphens), this.fontFamily && (t["--USER__fontFamily"] = this.fontFamily), this.fontWeight != null && (t["--USER__fontWeight"] = this.toUnitless(this.fontWeight)), this.iOSPatch && (t["--USER__iOSPatch"] = this.toFlag("iOSPatch")), this.iPadOSPatch && (t["--USER__iPadOSPatch"] = this.toFlag("iPadOSPatch")), this.letterSpacing != null && (t["--USER__letterSpacing"] = this.toRem(this.letterSpacing)), this.ligatures && (t["--USER__ligatures"] = this.ligatures), this.lineHeight != null && (t["--USER__lineHeight"] = this.toUnitless(this.lineHeight)), this.noRuby && (t["--USER__noRuby"] = this.toFlag("noRuby")), this.paraIndent != null && (t["--USER__paraIndent"] = this.toRem(this.paraIndent)), this.paraSpacing != null && (t["--USER__paraSpacing"] = this.toRem(this.paraSpacing)), this.textAlign && (t["--USER__textAlign"] = this.textAlign), this.wordSpacing != null && (t["--USER__wordSpacing"] = this.toRem(this.wordSpacing)), this.zoom !== null && (t["--USER__zoom"] = this.toPercentage(this.zoom, !0)), t;
|
|
4960
4994
|
}
|
|
4961
4995
|
}
|
|
4962
|
-
class
|
|
4996
|
+
class ar extends le {
|
|
4963
4997
|
constructor(t) {
|
|
4964
4998
|
super(), this.experiments = t.experiments ?? null;
|
|
4965
4999
|
}
|
|
4966
5000
|
toCSSProperties() {
|
|
4967
5001
|
const t = {};
|
|
4968
5002
|
return this.experiments && this.experiments.forEach((e) => {
|
|
4969
|
-
t["--RS__" + e] =
|
|
5003
|
+
t["--RS__" + e] = Ge[e].value;
|
|
4970
5004
|
}), t;
|
|
4971
5005
|
}
|
|
4972
5006
|
}
|
|
4973
|
-
class
|
|
5007
|
+
class lr {
|
|
4974
5008
|
constructor(t) {
|
|
4975
5009
|
this.rsProperties = t.rsProperties, this.userProperties = t.userProperties;
|
|
4976
5010
|
}
|
|
@@ -4996,10 +5030,10 @@ class zs {
|
|
|
4996
5030
|
this.userProperties = new mn(e);
|
|
4997
5031
|
}
|
|
4998
5032
|
}
|
|
4999
|
-
function
|
|
5033
|
+
function hr(r, t) {
|
|
5000
5034
|
return r == null || t == null || r <= t ? r : void 0;
|
|
5001
5035
|
}
|
|
5002
|
-
function
|
|
5036
|
+
function cr(r, t) {
|
|
5003
5037
|
return r == null || t == null || r >= t ? r : void 0;
|
|
5004
5038
|
}
|
|
5005
5039
|
function W(r) {
|
|
@@ -5015,11 +5049,11 @@ function he(r, t) {
|
|
|
5015
5049
|
function wt(r) {
|
|
5016
5050
|
return typeof r == "boolean" || typeof r == "number" && r >= 0 ? r : r === null ? null : void 0;
|
|
5017
5051
|
}
|
|
5018
|
-
function
|
|
5052
|
+
function S(r) {
|
|
5019
5053
|
if (r !== void 0)
|
|
5020
5054
|
return r === null ? null : r < 0 ? void 0 : r;
|
|
5021
5055
|
}
|
|
5022
|
-
function
|
|
5056
|
+
function F(r, t) {
|
|
5023
5057
|
if (r === void 0)
|
|
5024
5058
|
return;
|
|
5025
5059
|
if (r === null)
|
|
@@ -5032,11 +5066,11 @@ function ge(r, t) {
|
|
|
5032
5066
|
}
|
|
5033
5067
|
function gn(r) {
|
|
5034
5068
|
if (r !== void 0)
|
|
5035
|
-
return r === null ? null : r.filter((t) => t in
|
|
5069
|
+
return r === null ? null : r.filter((t) => t in Ge);
|
|
5036
5070
|
}
|
|
5037
|
-
class
|
|
5071
|
+
class Mt {
|
|
5038
5072
|
constructor(t = {}) {
|
|
5039
|
-
this.fontFamily = W(t.fontFamily), this.fontWeight =
|
|
5073
|
+
this.fontFamily = W(t.fontFamily), this.fontWeight = F(t.fontWeight, st.range), this.hyphens = E(t.hyphens), this.iOSPatch = E(t.iOSPatch), this.iPadOSPatch = E(t.iPadOSPatch), this.letterSpacing = S(t.letterSpacing), this.ligatures = E(t.ligatures), this.lineHeight = S(t.lineHeight), this.noRuby = E(t.noRuby), this.paragraphIndent = S(t.paragraphIndent), this.paragraphSpacing = S(t.paragraphSpacing), this.textAlign = he(t.textAlign, tt), this.textNormalization = E(t.textNormalization), this.wordSpacing = S(t.wordSpacing), this.zoom = F(t.zoom, ee.range);
|
|
5040
5074
|
}
|
|
5041
5075
|
static serialize(t) {
|
|
5042
5076
|
const { ...e } = t;
|
|
@@ -5045,7 +5079,7 @@ class Nt {
|
|
|
5045
5079
|
static deserialize(t) {
|
|
5046
5080
|
try {
|
|
5047
5081
|
const e = JSON.parse(t);
|
|
5048
|
-
return new
|
|
5082
|
+
return new Mt(e);
|
|
5049
5083
|
} catch (e) {
|
|
5050
5084
|
return console.error("Failed to deserialize preferences:", e), null;
|
|
5051
5085
|
}
|
|
@@ -5054,12 +5088,12 @@ class Nt {
|
|
|
5054
5088
|
const e = { ...this };
|
|
5055
5089
|
for (const i of Object.keys(t))
|
|
5056
5090
|
t[i] !== void 0 && (e[i] = t[i]);
|
|
5057
|
-
return new
|
|
5091
|
+
return new Mt(e);
|
|
5058
5092
|
}
|
|
5059
5093
|
}
|
|
5060
|
-
class
|
|
5094
|
+
class dr {
|
|
5061
5095
|
constructor(t) {
|
|
5062
|
-
this.fontFamily = W(t.fontFamily) || null, this.fontWeight =
|
|
5096
|
+
this.fontFamily = W(t.fontFamily) || null, this.fontWeight = F(t.fontWeight, st.range) || null, this.hyphens = E(t.hyphens) ?? null, this.iOSPatch = t.iOSPatch === !1 ? !1 : (T.OS.iOS || T.OS.iPadOS) && T.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : T.OS.iPadOS && T.iOSRequest === "desktop", this.letterSpacing = S(t.letterSpacing) || null, this.ligatures = E(t.ligatures) ?? null, this.lineHeight = S(t.lineHeight) || null, this.noRuby = E(t.noRuby) ?? !1, this.paragraphIndent = S(t.paragraphIndent) ?? null, this.paragraphSpacing = S(t.paragraphSpacing) ?? null, this.textAlign = he(t.textAlign, tt) || null, this.textNormalization = E(t.textNormalization) ?? !1, this.wordSpacing = S(t.wordSpacing) || null, this.zoom = F(t.zoom, ee.range) || 1, this.experiments = gn(t.experiments) ?? null;
|
|
5063
5097
|
}
|
|
5064
5098
|
}
|
|
5065
5099
|
class Ai {
|
|
@@ -5067,7 +5101,7 @@ class Ai {
|
|
|
5067
5101
|
this.fontFamily = null, this.fontWeight = null, this.hyphens = null, this.iOSPatch = null, this.iPadOSPatch = null, this.letterSpacing = null, this.ligatures = null, this.lineHeight = null, this.noRuby = null, this.paragraphIndent = null, this.paragraphSpacing = null, this.textAlign = null, this.textNormalization = null, this.wordSpacing = null, i && (this.fontFamily = t.fontFamily || e.fontFamily || null, this.fontWeight = t.fontWeight !== void 0 ? t.fontWeight : e.fontWeight !== void 0 ? e.fontWeight : null, this.hyphens = typeof t.hyphens == "boolean" ? t.hyphens : e.hyphens ?? null, this.iOSPatch = t.iOSPatch === !1 ? !1 : t.iOSPatch === !0 ? (T.OS.iOS || T.OS.iPadOS) && T.iOSRequest === "mobile" : e.iOSPatch, this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : t.iPadOSPatch === !0 ? T.OS.iPadOS && T.iOSRequest === "desktop" : e.iPadOSPatch, this.letterSpacing = t.letterSpacing !== void 0 ? t.letterSpacing : e.letterSpacing !== void 0 ? e.letterSpacing : null, this.ligatures = typeof t.ligatures == "boolean" ? t.ligatures : e.ligatures ?? null, this.lineHeight = t.lineHeight !== void 0 ? t.lineHeight : e.lineHeight !== void 0 ? e.lineHeight : null, this.noRuby = typeof t.noRuby == "boolean" ? t.noRuby : e.noRuby ?? null, this.paragraphIndent = t.paragraphIndent !== void 0 ? t.paragraphIndent : e.paragraphIndent !== void 0 ? e.paragraphIndent : null, this.paragraphSpacing = t.paragraphSpacing !== void 0 ? t.paragraphSpacing : e.paragraphSpacing !== void 0 ? e.paragraphSpacing : null, this.textAlign = t.textAlign || e.textAlign || null, this.textNormalization = typeof t.textNormalization == "boolean" ? t.textNormalization : e.textNormalization ?? null, this.wordSpacing = t.wordSpacing !== void 0 ? t.wordSpacing : e.wordSpacing !== void 0 ? e.wordSpacing : null), this.zoom = t.zoom !== void 0 ? t.zoom : e.zoom !== void 0 ? e.zoom : null, this.experiments = e.experiments || null;
|
|
5068
5102
|
}
|
|
5069
5103
|
}
|
|
5070
|
-
class
|
|
5104
|
+
class N {
|
|
5071
5105
|
constructor({
|
|
5072
5106
|
initialValue: t = null,
|
|
5073
5107
|
effectiveValue: e,
|
|
@@ -5092,7 +5126,7 @@ class M {
|
|
|
5092
5126
|
this._value = null;
|
|
5093
5127
|
}
|
|
5094
5128
|
}
|
|
5095
|
-
class A extends
|
|
5129
|
+
class A extends N {
|
|
5096
5130
|
set value(t) {
|
|
5097
5131
|
this._value = t, this._onChange(this._value);
|
|
5098
5132
|
}
|
|
@@ -5112,7 +5146,7 @@ class A extends M {
|
|
|
5112
5146
|
this._value = !this._value, this._onChange(this._value);
|
|
5113
5147
|
}
|
|
5114
5148
|
}
|
|
5115
|
-
class yn extends
|
|
5149
|
+
class yn extends N {
|
|
5116
5150
|
constructor({
|
|
5117
5151
|
initialValue: t = null,
|
|
5118
5152
|
effectiveValue: e,
|
|
@@ -5143,7 +5177,7 @@ class yn extends M {
|
|
|
5143
5177
|
this._value = null;
|
|
5144
5178
|
}
|
|
5145
5179
|
}
|
|
5146
|
-
class x extends
|
|
5180
|
+
class x extends N {
|
|
5147
5181
|
constructor({
|
|
5148
5182
|
initialValue: t = null,
|
|
5149
5183
|
effectiveValue: e,
|
|
@@ -5198,18 +5232,18 @@ class Ti {
|
|
|
5198
5232
|
this.preferences = t, this.settings = e, this.metadata = i;
|
|
5199
5233
|
}
|
|
5200
5234
|
clear() {
|
|
5201
|
-
this.preferences = new
|
|
5235
|
+
this.preferences = new Mt({});
|
|
5202
5236
|
}
|
|
5203
5237
|
updatePreference(t, e) {
|
|
5204
5238
|
this.preferences[t] = e;
|
|
5205
5239
|
}
|
|
5206
5240
|
get isDisplayTransformable() {
|
|
5207
5241
|
return this.metadata?.accessibility?.feature?.some(
|
|
5208
|
-
(t) => t.value ===
|
|
5242
|
+
(t) => t.value === Ht.DISPLAY_TRANSFORMABILITY.value
|
|
5209
5243
|
) ?? !1;
|
|
5210
5244
|
}
|
|
5211
5245
|
get fontFamily() {
|
|
5212
|
-
return new
|
|
5246
|
+
return new N({
|
|
5213
5247
|
initialValue: this.preferences.fontFamily,
|
|
5214
5248
|
effectiveValue: this.settings.fontFamily || null,
|
|
5215
5249
|
isEffective: this.isDisplayTransformable,
|
|
@@ -5388,18 +5422,18 @@ const bn = (r) => {
|
|
|
5388
5422
|
t.attributes && Object.entries(t.attributes).forEach(([e, i]) => {
|
|
5389
5423
|
e === "type" || e === "rel" || e === "href" || e === "src" || i != null && (typeof i == "boolean" ? i && r.setAttribute(e, "") : r.setAttribute(e, i));
|
|
5390
5424
|
});
|
|
5391
|
-
},
|
|
5425
|
+
}, ur = (r, t, e) => {
|
|
5392
5426
|
const i = r.createElement("script");
|
|
5393
5427
|
i.dataset.readium = "true", t.id && (i.id = t.id);
|
|
5394
5428
|
const n = t.type || bn(t);
|
|
5395
5429
|
return n && (i.type = n), wn(i, t), i.src = e, i;
|
|
5396
|
-
},
|
|
5430
|
+
}, Ni = (r, t, e) => {
|
|
5397
5431
|
const i = r.createElement("link");
|
|
5398
5432
|
i.dataset.readium = "true", t.id && (i.id = t.id), t.rel && (i.rel = t.rel);
|
|
5399
5433
|
const n = t.type || bn(t);
|
|
5400
5434
|
return n && (i.type = n), wn(i, t), i.href = e, i;
|
|
5401
5435
|
};
|
|
5402
|
-
class
|
|
5436
|
+
class Sn {
|
|
5403
5437
|
constructor(t) {
|
|
5404
5438
|
this.blobStore = /* @__PURE__ */ new Map(), this.createdBlobUrls = /* @__PURE__ */ new Set(), this.allowedDomains = [], this.injectableIdCounter = 0, this.allowedDomains = (t.allowedDomains || []).map((e) => {
|
|
5405
5439
|
try {
|
|
@@ -5480,14 +5514,14 @@ class vn {
|
|
|
5480
5514
|
...e.attributes,
|
|
5481
5515
|
as: e.as
|
|
5482
5516
|
}
|
|
5483
|
-
}, s =
|
|
5517
|
+
}, s = Ni(t, n, i);
|
|
5484
5518
|
t.head.appendChild(s);
|
|
5485
5519
|
}
|
|
5486
5520
|
createElement(t, e, i) {
|
|
5487
5521
|
if (e.as === "script")
|
|
5488
|
-
return
|
|
5522
|
+
return ur(t, e, i);
|
|
5489
5523
|
if (e.as === "link")
|
|
5490
|
-
return
|
|
5524
|
+
return Ni(t, e, i);
|
|
5491
5525
|
throw new Error(`Unsupported element type: ${e.as}`);
|
|
5492
5526
|
}
|
|
5493
5527
|
async applyRule(t, e) {
|
|
@@ -5544,8 +5578,8 @@ class vn {
|
|
|
5544
5578
|
}
|
|
5545
5579
|
}
|
|
5546
5580
|
}
|
|
5547
|
-
const
|
|
5548
|
-
* Readium CSS v.2.0.
|
|
5581
|
+
const St = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").replace(/\n/g, "").replace(/\s+/g, " "), _t = (r) => r.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g, "").replace(/ {2,}/g, " "), pr = `/*!
|
|
5582
|
+
* Readium CSS v.2.0.4
|
|
5549
5583
|
* Copyright (c) 2017–2026. Readium Foundation. All rights reserved.
|
|
5550
5584
|
* Use of this source code is governed by a BSD-style license which is detailed in the
|
|
5551
5585
|
* LICENSE file present in the project repository where this source code is maintained.
|
|
@@ -5594,11 +5628,11 @@ const vt = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").repl
|
|
|
5594
5628
|
:root[style*="--USER__bodyHyphens"] li,
|
|
5595
5629
|
:root[style*="--USER__bodyHyphens"] div,
|
|
5596
5630
|
:root[style*="--USER__bodyHyphens"] dd{
|
|
5597
|
-
-webkit-hyphens:
|
|
5598
|
-
-moz-hyphens:
|
|
5599
|
-
-ms-hyphens:
|
|
5600
|
-
-epub-hyphens:
|
|
5601
|
-
hyphens:
|
|
5631
|
+
-webkit-hyphens:var(--USER__bodyHyphens) !important;
|
|
5632
|
+
-moz-hyphens:var(--USER__bodyHyphens) !important;
|
|
5633
|
+
-ms-hyphens:var(--USER__bodyHyphens) !important;
|
|
5634
|
+
-epub-hyphens:var(--USER__bodyHyphens) !important;
|
|
5635
|
+
hyphens:var(--USER__bodyHyphens) !important;
|
|
5602
5636
|
}
|
|
5603
5637
|
|
|
5604
5638
|
:root[style*="--USER__fontFamily"]{
|
|
@@ -5678,7 +5712,7 @@ const vt = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").repl
|
|
|
5678
5712
|
:root[style*="--USER__lineHeight"] p,
|
|
5679
5713
|
:root[style*="--USER__lineHeight"] li,
|
|
5680
5714
|
:root[style*="--USER__lineHeight"] div{
|
|
5681
|
-
line-height:
|
|
5715
|
+
line-height:var(--USER__lineHeight) !important;
|
|
5682
5716
|
}
|
|
5683
5717
|
|
|
5684
5718
|
:root[style*="--USER__paraSpacing"] p{
|
|
@@ -5698,8 +5732,7 @@ const vt = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").repl
|
|
|
5698
5732
|
text-indent:var(--USER__paraIndent) !important;
|
|
5699
5733
|
}
|
|
5700
5734
|
|
|
5701
|
-
:root[style*="--USER__paraIndent"] p
|
|
5702
|
-
:root[style*="--USER__paraIndent"] p:first-letter{
|
|
5735
|
+
:root[style*="--USER__paraIndent"] p *{
|
|
5703
5736
|
text-indent:0 !important;
|
|
5704
5737
|
}
|
|
5705
5738
|
|
|
@@ -5714,7 +5747,7 @@ const vt = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").repl
|
|
|
5714
5747
|
:root[style*="--USER__wordSpacing"] div,
|
|
5715
5748
|
:root[style*="--USER__wordSpacing"] dt,
|
|
5716
5749
|
:root[style*="--USER__wordSpacing"] dd{
|
|
5717
|
-
word-spacing:var(--USER__wordSpacing);
|
|
5750
|
+
word-spacing:var(--USER__wordSpacing) !important;
|
|
5718
5751
|
}
|
|
5719
5752
|
|
|
5720
5753
|
:root[style*="--USER__letterSpacing"] h1,
|
|
@@ -5728,8 +5761,8 @@ const vt = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").repl
|
|
|
5728
5761
|
:root[style*="--USER__letterSpacing"] div,
|
|
5729
5762
|
:root[style*="--USER__letterSpacing"] dt,
|
|
5730
5763
|
:root[style*="--USER__letterSpacing"] dd{
|
|
5731
|
-
letter-spacing:var(--USER__letterSpacing);
|
|
5732
|
-
font-variant:none;
|
|
5764
|
+
letter-spacing:var(--USER__letterSpacing) !important;
|
|
5765
|
+
font-variant:none !important;
|
|
5733
5766
|
}
|
|
5734
5767
|
|
|
5735
5768
|
:root[style*="--USER__fontWeight"] body{
|
|
@@ -5818,7 +5851,7 @@ const vt = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").repl
|
|
|
5818
5851
|
|
|
5819
5852
|
:root[style*="readium-iPadOSPatch-on"] p:not(:has(b, cite, em, i, q, s, small, span, strong)):first-line{
|
|
5820
5853
|
-webkit-text-zoom:normal;
|
|
5821
|
-
}`,
|
|
5854
|
+
}`, vn = '!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports._readium_cssSelectorGenerator=e():t._readium_cssSelectorGenerator=e()}(self,(()=>(()=>{"use strict";var t={d:(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return"object"==typeof t&&null!==t&&t.nodeType===Node.ELEMENT_NODE}t.r(e),t.d(e,{_readium_cssSelectorGenerator:()=>Z,default:()=>tt,getCssSelector:()=>X});const o={NONE:"",DESCENDANT:" ",CHILD:" > "},r={id:"id",class:"class",tag:"tag",attribute:"attribute",nthchild:"nthchild",nthoftype:"nthoftype"},i="_readium_cssSelectorGenerator";function c(t="unknown problem",...e){console.warn(`${i}: ${t}`,...e)}const s={selectors:[r.id,r.class,r.tag,r.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY,useScope:!1};function u(t){return t instanceof RegExp}function l(t){return["string","function"].includes(typeof t)||u(t)}function a(t){return Array.isArray(t)?t.filter(l):[]}function f(t){const e=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(t){return t instanceof Node}(t)&&e.includes(t.nodeType)}function d(t,e){if(f(t))return t.contains(e)||c("element root mismatch","Provided root does not contain the element. This will most likely result in producing a fallback selector using element\'s real root node. If you plan to use the selector using provided root (e.g. `root.querySelector`), it will not work as intended."),t;const n=e.getRootNode({composed:!1});return f(n)?(n!==document&&c("shadow root inferred","You did not provide a root and the element is a child of Shadow DOM. This will produce a selector using ShadowRoot as a root. If you plan to use the selector using document as a root (e.g. `document.querySelector`), it will not work as intended."),n):S(e)}function m(t){return"number"==typeof t?t:Number.POSITIVE_INFINITY}function p(t=[]){const[e=[],...n]=t;return 0===n.length?e:n.reduce(((t,e)=>t.filter((t=>e.includes(t)))),e)}function g(t){const e=t.map((t=>{if(u(t))return e=>t.test(e);if("function"==typeof t)return e=>{const n=t(e);return"boolean"!=typeof n?(c("pattern matcher function invalid","Provided pattern matching function does not return boolean. It\'s result will be ignored.",t),!1):n};if("string"==typeof t){const e=new RegExp("^"+t.replace(/[|\\\\{}()[\\]^$+?.]/g,"\\\\$&").replace(/\\*/g,".+")+"$");return t=>e.test(t)}return c("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",t),()=>!1}));return t=>e.some((e=>e(t)))}function h(t,e,n){const o=Array.from(d(n,t[0]).querySelectorAll(e));return o.length===t.length&&t.every((t=>o.includes(t)))}function y(t,e){e=null!=e?e:S(t);const o=[];let r=t;for(;n(r)&&r!==e;)o.push(r),r=r.parentElement;return o}function b(t,e){return p(t.map((t=>y(t,e))))}function S(t){return t.ownerDocument.querySelector(":root")}const N=", ",v=new RegExp(["^$","\\\\s"].join("|")),E=new RegExp(["^$"].join("|")),x=[r.nthoftype,r.tag,r.id,r.class,r.attribute,r.nthchild],w=g(["class","id","ng-*"]);function I({name:t}){return`[${t}]`}function T({name:t,value:e}){return`[${t}=\'${e}\']`}function O({nodeName:t,nodeValue:e}){return{name:F(t),value:F(null!=e?e:void 0)}}function C(t){const e=Array.from(t.attributes).filter((e=>function({nodeName:t,nodeValue:e},n){const o=n.tagName.toLowerCase();return!(["input","option"].includes(o)&&"value"===t||"src"===t&&(null==e?void 0:e.startsWith("data:"))||w(t))}(e,t))).map(O);return[...e.map(I),...e.map(T)]}function j(t){var e;return(null!==(e=t.getAttribute("class"))&&void 0!==e?e:"").trim().split(/\\s+/).filter((t=>!E.test(t))).map((t=>`.${F(t)}`))}function A(t){var e;const n=null!==(e=t.getAttribute("id"))&&void 0!==e?e:"",o=`#${F(n)}`,r=t.getRootNode({composed:!1});return!v.test(n)&&h([t],o,r)?[o]:[]}function R(t){var e;const n=null===(e=t.parentElement)||void 0===e?void 0:e.children;if(n)for(let e=0;e<n.length;e++)if(n[e]===t)return[`:nth-child(${String(e+1)})`];return[]}function $(t){return[F(t.tagName.toLowerCase())]}function D(t){const e=[...new Set((n=t.map($),[].concat(...n)))];var n;return 0===e.length||e.length>1?[]:[e[0]]}function k(t){const e=D([t])[0],n=t.parentElement;if(n){const o=Array.from(n.children).filter((t=>t.tagName.toLowerCase()===e)),r=o.indexOf(t);if(r>-1)return[`${e}:nth-of-type(${String(r+1)})`]}return[]}function*P(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){let n=0,o=L(1);for(;o.length<=t.length&&n<e;){n+=1;const e=o.map((e=>t[e]));yield e,o=_(o,t.length-1)}}function _(t=[],e=0){const n=t.length;if(0===n)return[];const o=[...t];o[n-1]+=1;for(let t=n-1;t>=0;t--)if(o[t]>e){if(0===t)return L(n+1);o[t-1]++,o[t]=o[t-1]+1}return o[n-1]>e?L(n+1):o}function L(t=1){return Array.from(Array(t).keys())}const M=":".charCodeAt(0).toString(16).toUpperCase(),V=/[ !"#$%&\'()\\[\\]{|}<>*+,./;=?@^`~\\\\]/;function F(t=""){return CSS?CSS.escape(t):function(t=""){return t.split("").map((t=>":"===t?`\\\\${M} `:V.test(t)?`\\\\${t}`:escape(t).replace(/%/g,"\\\\"))).join("")}(t)}const Y={tag:D,id:function(t){return 0===t.length||t.length>1?[]:A(t[0])},class:function(t){return p(t.map(j))},attribute:function(t){return p(t.map(C))},nthchild:function(t){return p(t.map(R))},nthoftype:function(t){return p(t.map(k))}},G={tag:$,id:A,class:j,attribute:C,nthchild:R,nthoftype:k};function W(t){return t.includes(r.tag)||t.includes(r.nthoftype)?[...t]:[...t,r.tag]}function*q(t,e){const n={};for(const o of t){const t=e[o];t&&t.length>0&&(n[o]=t)}for(const t of function*(t={}){const e=Object.entries(t);if(0===e.length)return;const n=[{index:e.length-1,partial:{}}];for(;n.length>0;){const t=n.pop();if(!t)break;const{index:o,partial:r}=t;if(o<0){yield r;continue}const[i,c]=e[o];for(let t=c.length-1;t>=0;t--)n.push({index:o-1,partial:Object.assign(Object.assign({},r),{[i]:c[t]})})}}(n))yield B(t)}function B(t={}){const e=[...x];return t[r.tag]&&t[r.nthoftype]&&e.splice(e.indexOf(r.tag),1),e.map((e=>{return(o=t)[n=e]?o[n].join(""):"";var n,o})).join("")}function H(t,e){return[...t.map((t=>e+o.DESCENDANT+t)),...t.map((t=>e+o.CHILD+t))]}function*U(t,e,n="",o){const r=function*(t,e){const n=new Set,o=function(t,e){const{blacklist:n,whitelist:o,combineWithinSelector:r,maxCombinations:i}=e,c=g(n),s=g(o);return function(t){const{selectors:e,includeTag:n}=t,o=[...e];return n&&!o.includes("tag")&&o.push("tag"),o}(e).reduce(((e,n)=>{const o=function(t,e){return(0,Y[e])(t)}(t,n),u=function(t=[],e,n){return t.filter((t=>n(t)||!e(t)))}(o,c,s),l=function(t=[],e){return t.sort(((t,n)=>{const o=e(t),r=e(n);return o&&!r?-1:!o&&r?1:0}))}(u,s);return e[n]=r?Array.from(P(l,{maxResults:i})):l.map((t=>[t])),e}),{})}(t,e);for(const t of function*(t,e){for(const n of function(t){const{selectors:e,combineBetweenSelectors:n,includeTag:o,maxCandidates:r}=t,i=n?function(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){return Array.from(P(t,{maxResults:e}))}(e,{maxResults:r}):e.map((t=>[t]));return o?i.map(W):i}(e))yield*q(n,t)}(o,e))n.has(t)||(n.add(t),yield t)}(t,o);for(const o of function*(t,e){if(""===e)yield*t;else for(const n of t)yield*H([n],e)}(r,n))h(t,o,e)&&(yield o)}function*z(t,e,n="",o){if(0===t.length)return null;const r=[t.length>1?t:[],...b(t,e).map((t=>[t]))];for(const t of r)for(const r of U(t,e,n,o))yield{foundElements:t,selector:r}}function J(t){return{value:t,include:!1}}function K({selectors:t,operator:e}){let n=[...x];t[r.tag]&&t[r.nthoftype]&&(n=n.filter((t=>t!==r.tag)));let o="";return n.forEach((e=>{var n;(null!==(n=t[e])&&void 0!==n?n:[]).forEach((({value:t,include:e})=>{e&&(o+=t)}))})),e+o}function Q(t,e){return t.map((t=>function(t,e){return[e?":scope":":root",...y(t,e).reverse().map((t=>{var e;const n=function(t,e,n=o.NONE){const r={};return e.forEach((e=>{Reflect.set(r,e,function(t,e){return G[e](t)}(t,e).map(J))})),{element:t,operator:n,selectors:r}}(t,[r.nthchild],o.CHILD);return(null!==(e=n.selectors.nthchild)&&void 0!==e?e:[]).forEach((t=>{t.include=!0})),n})).map(K)].join("")}(t,e))).join(N)}function X(t,e={}){return Z(t,Object.assign(Object.assign({},e),{maxResults:1})).next().value}function*Z(t,e={}){var o;const i=function(t){(t instanceof NodeList||t instanceof HTMLCollection)&&(t=Array.from(t));const e=(Array.isArray(t)?t:[t]).filter(n);return[...new Set(e)]}(t),c=function(t,e={}){const n=Object.assign(Object.assign({},s),e);return{selectors:(o=n.selectors,Array.isArray(o)?o.filter((t=>{return e=r,n=t,Object.values(e).includes(n);var e,n})):[]),whitelist:a(n.whitelist),blacklist:a(n.blacklist),root:d(n.root,t),combineWithinSelector:!!n.combineWithinSelector,combineBetweenSelectors:!!n.combineBetweenSelectors,includeTag:!!n.includeTag,maxCombinations:m(n.maxCombinations),maxCandidates:m(n.maxCandidates),useScope:!!n.useScope,maxResults:m(n.maxResults)};var o}(i[0],e),u=null!==(o=c.root)&&void 0!==o?o:S(i[0]);let l=0;for(const t of function*({elements:t,root:e,rootSelector:n="",options:o}){let r=e,i=n,c=!0;for(;c;){let n=!1;for(const c of z(t,r,i,o)){const{foundElements:o,selector:s}=c;if(n=!0,!h(t,s,e)){r=o[0],i=s;break}yield s}n||(c=!1)}}({elements:i,options:c,root:u,rootSelector:""}))if(yield t,l++,l>=c.maxResults)return;i.length>1&&(yield i.map((t=>X(t,c))).join(N),l++,l>=c.maxResults)||(yield Q(i,c.useScope?u:void 0))}const tt=X;return e})()));', fr = `// WebPub-specific setup - no execution blocking needed
|
|
5822
5855
|
window._readium_blockedEvents = [];
|
|
5823
5856
|
window._readium_blockEvents = false; // WebPub doesn't need event blocking
|
|
5824
5857
|
window._readium_eventBlocker = null;
|
|
@@ -5836,21 +5869,21 @@ window._readium_eventBlocker = null;
|
|
|
5836
5869
|
});
|
|
5837
5870
|
})();
|
|
5838
5871
|
`;
|
|
5839
|
-
function
|
|
5872
|
+
function mr(r) {
|
|
5840
5873
|
const t = r.filter((s) => s.mediaType.isHTML).map((s) => s.href), e = t.length > 0 ? t : [/\.html$/, /\.xhtml$/, /\/$/], i = [
|
|
5841
5874
|
// CSS Selector Generator - always injected
|
|
5842
5875
|
{
|
|
5843
5876
|
id: "css-selector-generator",
|
|
5844
5877
|
as: "script",
|
|
5845
5878
|
target: "head",
|
|
5846
|
-
blob: new Blob([
|
|
5879
|
+
blob: new Blob([St(vn)], { type: "text/javascript" })
|
|
5847
5880
|
},
|
|
5848
5881
|
// WebPub Execution - always injected (sets up event blocking to false)
|
|
5849
5882
|
{
|
|
5850
5883
|
id: "webpub-execution",
|
|
5851
5884
|
as: "script",
|
|
5852
5885
|
target: "head",
|
|
5853
|
-
blob: new Blob([
|
|
5886
|
+
blob: new Blob([St(fr)], { type: "text/javascript" })
|
|
5854
5887
|
}
|
|
5855
5888
|
], n = [
|
|
5856
5889
|
// Onload Proxy - conditional (has executable scripts)
|
|
@@ -5858,7 +5891,7 @@ function Hs(r) {
|
|
|
5858
5891
|
id: "onload-proxy",
|
|
5859
5892
|
as: "script",
|
|
5860
5893
|
target: "head",
|
|
5861
|
-
blob: new Blob([
|
|
5894
|
+
blob: new Blob([St(Pn)], { type: "text/javascript" }),
|
|
5862
5895
|
condition: (s) => !!(s.querySelector("script") || s.querySelector("body[onload]:not(body[onload=''])"))
|
|
5863
5896
|
},
|
|
5864
5897
|
// Readium CSS WebPub - always injected
|
|
@@ -5866,7 +5899,7 @@ function Hs(r) {
|
|
|
5866
5899
|
id: "readium-css-webpub",
|
|
5867
5900
|
as: "link",
|
|
5868
5901
|
target: "head",
|
|
5869
|
-
blob: new Blob([
|
|
5902
|
+
blob: new Blob([_t(pr)], { type: "text/css" }),
|
|
5870
5903
|
rel: "stylesheet"
|
|
5871
5904
|
}
|
|
5872
5905
|
];
|
|
@@ -5878,7 +5911,7 @@ function Hs(r) {
|
|
|
5878
5911
|
}
|
|
5879
5912
|
];
|
|
5880
5913
|
}
|
|
5881
|
-
class
|
|
5914
|
+
class gr {
|
|
5882
5915
|
constructor(t) {
|
|
5883
5916
|
if (this.detectedTools = /* @__PURE__ */ new Set(), !t.onDetected)
|
|
5884
5917
|
throw new Error("onDetected callback is required");
|
|
@@ -5910,11 +5943,11 @@ class Vs {
|
|
|
5910
5943
|
this.observer?.disconnect(), this.observer = void 0, this.detectedTools.clear();
|
|
5911
5944
|
}
|
|
5912
5945
|
}
|
|
5913
|
-
let
|
|
5914
|
-
function
|
|
5915
|
-
return ++
|
|
5946
|
+
let yr = 0;
|
|
5947
|
+
function br() {
|
|
5948
|
+
return ++yr;
|
|
5916
5949
|
}
|
|
5917
|
-
const
|
|
5950
|
+
const wr = `
|
|
5918
5951
|
onmessage = function(event) {
|
|
5919
5952
|
var action = event.data;
|
|
5920
5953
|
var startTime = performance.now()
|
|
@@ -5935,7 +5968,7 @@ onmessage = function(event) {
|
|
|
5935
5968
|
}, this.log = (...i) => this.send("log", ...i), this.table = (...i) => this.send("table", ...i), this.clear = (...i) => this.send("clear", ...i);
|
|
5936
5969
|
}
|
|
5937
5970
|
async send(t, ...e) {
|
|
5938
|
-
const i =
|
|
5971
|
+
const i = br();
|
|
5939
5972
|
return new Promise((n, s) => {
|
|
5940
5973
|
this.callbacks.set(i, n), this.worker.postMessage({
|
|
5941
5974
|
id: i,
|
|
@@ -5950,14 +5983,14 @@ onmessage = function(event) {
|
|
|
5950
5983
|
this.worker.terminate(), URL.revokeObjectURL(this.blobUrl);
|
|
5951
5984
|
}
|
|
5952
5985
|
};
|
|
5953
|
-
Je.workerScript =
|
|
5986
|
+
Je.workerScript = wr;
|
|
5954
5987
|
let se = Je;
|
|
5955
|
-
function
|
|
5988
|
+
function Xe(r) {
|
|
5956
5989
|
return typeof window < "u" && console ? console[r] : (...t) => {
|
|
5957
5990
|
};
|
|
5958
5991
|
}
|
|
5959
|
-
const
|
|
5960
|
-
async function
|
|
5992
|
+
const Sr = Xe("log"), Mi = Xe("table"), vr = Xe("clear");
|
|
5993
|
+
async function Fi() {
|
|
5961
5994
|
if (typeof navigator < "u" && navigator.brave && navigator.brave.isBrave)
|
|
5962
5995
|
try {
|
|
5963
5996
|
return await Promise.race([
|
|
@@ -5969,10 +6002,10 @@ async function zi() {
|
|
|
5969
6002
|
}
|
|
5970
6003
|
return !1;
|
|
5971
6004
|
}
|
|
5972
|
-
function
|
|
6005
|
+
function Pr(r) {
|
|
5973
6006
|
return r.excludes.some((t) => t()) ? !1 : r.includes.some((t) => t());
|
|
5974
6007
|
}
|
|
5975
|
-
class
|
|
6008
|
+
class Er {
|
|
5976
6009
|
constructor(t = {}) {
|
|
5977
6010
|
if (this.isOpen = !1, this.checkCount = 0, this.maxChecks = 10, this.maxPrintTime = 0, this.largeObjectArray = null, this.options = {
|
|
5978
6011
|
onDetected: t.onDetected || (() => {
|
|
@@ -6018,11 +6051,11 @@ class Ks {
|
|
|
6018
6051
|
return (await this.workerConsole.table(t)).time;
|
|
6019
6052
|
} catch {
|
|
6020
6053
|
const i = performance.now();
|
|
6021
|
-
return
|
|
6054
|
+
return Mi(t), performance.now() - i;
|
|
6022
6055
|
}
|
|
6023
6056
|
else {
|
|
6024
6057
|
const e = performance.now();
|
|
6025
|
-
return
|
|
6058
|
+
return Mi(t), performance.now() - e;
|
|
6026
6059
|
}
|
|
6027
6060
|
}
|
|
6028
6061
|
/**
|
|
@@ -6034,14 +6067,14 @@ class Ks {
|
|
|
6034
6067
|
return (await this.workerConsole.log(t)).time;
|
|
6035
6068
|
{
|
|
6036
6069
|
const e = performance.now();
|
|
6037
|
-
return
|
|
6070
|
+
return Sr(t), performance.now() - e;
|
|
6038
6071
|
}
|
|
6039
6072
|
}
|
|
6040
6073
|
/**
|
|
6041
6074
|
* Check if performance-based detection is enabled for current browser
|
|
6042
6075
|
*/
|
|
6043
6076
|
isPerformanceDetectionEnabled() {
|
|
6044
|
-
return
|
|
6077
|
+
return Pr({
|
|
6045
6078
|
includes: [
|
|
6046
6079
|
() => !!J.UA.Chrome,
|
|
6047
6080
|
() => !!J.UA.Chromium,
|
|
@@ -6064,14 +6097,14 @@ class Ks {
|
|
|
6064
6097
|
if (!this.isPerformanceDetectionEnabled())
|
|
6065
6098
|
return !1;
|
|
6066
6099
|
const t = await this.calcTablePrintTime(), e = Math.max(await this.calcLogPrintTime(), await this.calcLogPrintTime());
|
|
6067
|
-
return this.maxPrintTime = Math.max(this.maxPrintTime, e), this.workerConsole ? await this.workerConsole.clear() :
|
|
6100
|
+
return this.maxPrintTime = Math.max(this.maxPrintTime, e), this.workerConsole ? await this.workerConsole.clear() : vr(), t === 0 ? !1 : this.maxPrintTime === 0 ? !!await Fi() : t > this.maxPrintTime * 10;
|
|
6068
6101
|
}
|
|
6069
6102
|
/**
|
|
6070
6103
|
* Debugger-based detection (fallback method)
|
|
6071
6104
|
* WARNING: This method impacts user experience
|
|
6072
6105
|
*/
|
|
6073
6106
|
async checkDebuggerBased() {
|
|
6074
|
-
if (!this.isDebuggerDetectionEnabled() || await
|
|
6107
|
+
if (!this.isDebuggerDetectionEnabled() || await Fi())
|
|
6075
6108
|
return !1;
|
|
6076
6109
|
const t = performance.now();
|
|
6077
6110
|
try {
|
|
@@ -6119,7 +6152,7 @@ class Ks {
|
|
|
6119
6152
|
this.intervalId && (clearInterval(this.intervalId), this.intervalId = void 0), this.workerConsole && (this.workerConsole.destroy(), this.workerConsole = void 0), this.isOpen = !1, this.checkCount = 0;
|
|
6120
6153
|
}
|
|
6121
6154
|
}
|
|
6122
|
-
class
|
|
6155
|
+
class Cr {
|
|
6123
6156
|
constructor(t) {
|
|
6124
6157
|
if (this.detected = !1, !t.onDetected)
|
|
6125
6158
|
throw new Error("onDetected callback is required");
|
|
@@ -6154,7 +6187,7 @@ class Js {
|
|
|
6154
6187
|
this.observer?.disconnect(), this.observer = void 0, this.detected = !1;
|
|
6155
6188
|
}
|
|
6156
6189
|
}
|
|
6157
|
-
class
|
|
6190
|
+
class _r {
|
|
6158
6191
|
constructor(t = {}) {
|
|
6159
6192
|
this.styleElement = null, this.beforePrintHandler = null, this.onPrintAttempt = t.onPrintAttempt, t.disable && this.setupPrintProtection(t.watermark);
|
|
6160
6193
|
}
|
|
@@ -6180,7 +6213,7 @@ class Zs {
|
|
|
6180
6213
|
this.beforePrintHandler && (window.removeEventListener("beforeprint", this.beforePrintHandler), this.beforePrintHandler = null), this.styleElement?.parentNode && (this.styleElement.parentNode.removeChild(this.styleElement), this.styleElement = null);
|
|
6181
6214
|
}
|
|
6182
6215
|
}
|
|
6183
|
-
class
|
|
6216
|
+
class Lr {
|
|
6184
6217
|
constructor(t = {}) {
|
|
6185
6218
|
this.onContextMenuBlocked = t.onContextMenuBlocked, this.contextMenuHandler = this.handleContextMenu.bind(this), document.addEventListener("contextmenu", this.contextMenuHandler, !0), window.addEventListener("unload", () => this.destroy());
|
|
6186
6219
|
}
|
|
@@ -6212,7 +6245,7 @@ class Ye {
|
|
|
6212
6245
|
window.dispatchEvent(i);
|
|
6213
6246
|
}
|
|
6214
6247
|
constructor(t = {}) {
|
|
6215
|
-
t.monitorDevTools && (this.devToolsDetector = new
|
|
6248
|
+
t.monitorDevTools && (this.devToolsDetector = new Er({
|
|
6216
6249
|
onDetected: () => {
|
|
6217
6250
|
this.dispatchSuspiciousActivity("developer_tools", {
|
|
6218
6251
|
targetFrameSrc: "",
|
|
@@ -6225,20 +6258,20 @@ class Ye {
|
|
|
6225
6258
|
metaKey: !1
|
|
6226
6259
|
});
|
|
6227
6260
|
}
|
|
6228
|
-
})), t.checkAutomation && (this.automationDetector = new
|
|
6261
|
+
})), t.checkAutomation && (this.automationDetector = new gr({
|
|
6229
6262
|
onDetected: (e) => {
|
|
6230
6263
|
this.dispatchSuspiciousActivity("automation_detected", { tool: e });
|
|
6231
6264
|
}
|
|
6232
|
-
})), t.checkIFrameEmbedding && (this.iframeEmbeddingDetector = new
|
|
6265
|
+
})), t.checkIFrameEmbedding && (this.iframeEmbeddingDetector = new Cr({
|
|
6233
6266
|
onDetected: (e) => {
|
|
6234
6267
|
this.dispatchSuspiciousActivity("iframe_embedding_detected", { isCrossOrigin: e });
|
|
6235
6268
|
}
|
|
6236
|
-
})), t.protectPrinting?.disable && (this.printProtector = new
|
|
6269
|
+
})), t.protectPrinting?.disable && (this.printProtector = new _r({
|
|
6237
6270
|
...t.protectPrinting,
|
|
6238
6271
|
onPrintAttempt: () => {
|
|
6239
6272
|
this.dispatchSuspiciousActivity("print", {});
|
|
6240
6273
|
}
|
|
6241
|
-
})), t.disableContextMenu && (this.contextMenuProtector = new
|
|
6274
|
+
})), t.disableContextMenu && (this.contextMenuProtector = new Lr({
|
|
6242
6275
|
onContextMenuBlocked: (e) => {
|
|
6243
6276
|
this.dispatchSuspiciousActivity("context_menu", e);
|
|
6244
6277
|
}
|
|
@@ -6274,7 +6307,7 @@ class qe {
|
|
|
6274
6307
|
this.keydownHandler && (document.removeEventListener("keydown", this.keydownHandler, !0), this.keydownHandler = void 0);
|
|
6275
6308
|
}
|
|
6276
6309
|
}
|
|
6277
|
-
const
|
|
6310
|
+
const xr = (r) => ({
|
|
6278
6311
|
frameLoaded: r.frameLoaded || (() => {
|
|
6279
6312
|
}),
|
|
6280
6313
|
positionChanged: r.positionChanged || (() => {
|
|
@@ -6297,18 +6330,18 @@ const tr = (r) => ({
|
|
|
6297
6330
|
peripheral: r.peripheral || (() => {
|
|
6298
6331
|
})
|
|
6299
6332
|
});
|
|
6300
|
-
class
|
|
6333
|
+
class kr extends dn {
|
|
6301
6334
|
constructor(t, e, i, n = void 0, s = { preferences: {}, defaults: {} }) {
|
|
6302
6335
|
super(), this.currentIndex = 0, this._preferencesEditor = null, this._injector = null, this._navigatorProtector = null, this._keyboardPeripheralsManager = null, this._suspiciousActivityListener = null, this._keyboardPeripheralListener = null, this.webViewport = {
|
|
6303
6336
|
readingOrder: [],
|
|
6304
6337
|
progressions: /* @__PURE__ */ new Map(),
|
|
6305
6338
|
positions: null
|
|
6306
|
-
}, this.pub = e, this.container = t, this.listeners =
|
|
6307
|
-
rsProperties: new
|
|
6339
|
+
}, this.pub = e, this.container = t, this.listeners = xr(i), this._preferences = new Mt(s.preferences), this._defaults = new dr(s.defaults), this._settings = new Ai(this._preferences, this._defaults, this.hasDisplayTransformability), this._css = new lr({
|
|
6340
|
+
rsProperties: new ar({ experiments: this._settings.experiments || null }),
|
|
6308
6341
|
userProperties: new mn({ zoom: this._settings.zoom })
|
|
6309
6342
|
});
|
|
6310
|
-
const o =
|
|
6311
|
-
if (this._injector = new
|
|
6343
|
+
const o = mr(e.readingOrder.items), a = s.injectables || { rules: [], allowedDomains: [] };
|
|
6344
|
+
if (this._injector = new Sn({
|
|
6312
6345
|
rules: [...o, ...a.rules],
|
|
6313
6346
|
allowedDomains: a.allowedDomains
|
|
6314
6347
|
}), this._contentProtection = s.contentProtection || {}, this._keyboardPeripherals = this.mergeKeyboardPeripherals(
|
|
@@ -6377,7 +6410,7 @@ class er extends dn {
|
|
|
6377
6410
|
}
|
|
6378
6411
|
get hasDisplayTransformability() {
|
|
6379
6412
|
return this.pub.metadata?.accessibility?.feature?.some(
|
|
6380
|
-
(t) => t.value ===
|
|
6413
|
+
(t) => t.value === Ht.DISPLAY_TRANSFORMABILITY.value
|
|
6381
6414
|
) ?? !1;
|
|
6382
6415
|
}
|
|
6383
6416
|
eventListener(t, e) {
|
|
@@ -6427,7 +6460,7 @@ class er extends dn {
|
|
|
6427
6460
|
const p = new URL(this.currentLocation.href);
|
|
6428
6461
|
c = new URL(h, p).href;
|
|
6429
6462
|
} else
|
|
6430
|
-
c =
|
|
6463
|
+
c = Xt.join(Xt.dirname(this.currentLocation.href), h);
|
|
6431
6464
|
const u = this.pub.readingOrder.findWithHref(c);
|
|
6432
6465
|
u ? this.goLink(u, !1, () => {
|
|
6433
6466
|
}) : (console.warn(`Internal link not found in readingOrder: ${c}`), this.listeners.handleLocator(new $({
|
|
@@ -6604,7 +6637,7 @@ class er extends dn {
|
|
|
6604
6637
|
return this.pub.manifest.locatorFromLink(e) || new I({
|
|
6605
6638
|
href: e.href,
|
|
6606
6639
|
type: e.type || "text/html",
|
|
6607
|
-
locations: new
|
|
6640
|
+
locations: new C({
|
|
6608
6641
|
fragments: [],
|
|
6609
6642
|
progression: n,
|
|
6610
6643
|
position: this.currentIndex + 1
|
|
@@ -6612,7 +6645,7 @@ class er extends dn {
|
|
|
6612
6645
|
});
|
|
6613
6646
|
}
|
|
6614
6647
|
}
|
|
6615
|
-
const
|
|
6648
|
+
const fo = kr, Or = (r) => {
|
|
6616
6649
|
const t = r.join(" ");
|
|
6617
6650
|
return [
|
|
6618
6651
|
// 'self' is useless because the document is loaded from a blob: URL
|
|
@@ -6686,12 +6719,12 @@ class En {
|
|
|
6686
6719
|
g && !p ? (t.documentElement.lang = g, t.documentElement.setAttribute("xml:lang", g), t.body.removeAttribute("xml:lang"), t.body.removeAttribute("lang")) : p || (t.documentElement.lang = u, t.documentElement.setAttribute("xml:lang", u));
|
|
6687
6720
|
} else n === m.HTML && !t.documentElement.lang && (t.documentElement.lang = u);
|
|
6688
6721
|
}
|
|
6689
|
-
if (bt(this.pub.metadata) === "rtl" && !t.documentElement.dir && !t.body.dir && (t.documentElement.dir =
|
|
6722
|
+
if (bt(this.pub.metadata) === "rtl" && !t.documentElement.dir && !t.body.dir && (t.documentElement.dir = M.rtl), i !== void 0) {
|
|
6690
6723
|
const u = t.createElement("base");
|
|
6691
6724
|
u.href = i, u.dataset.readium = "true", t.head.firstChild.before(u);
|
|
6692
6725
|
}
|
|
6693
6726
|
const c = t.createElement("meta");
|
|
6694
|
-
return c.httpEquiv = "Content-Security-Policy", c.content =
|
|
6727
|
+
return c.httpEquiv = "Content-Security-Policy", c.content = Or(l), c.dataset.readium = "true", t.head.firstChild.before(c), URL.createObjectURL(
|
|
6695
6728
|
new Blob([new XMLSerializer().serializeToString(t)], {
|
|
6696
6729
|
type: n.isHTML ? n.string : "application/xhtml+xml"
|
|
6697
6730
|
// Fallback to XHTML
|
|
@@ -6699,7 +6732,7 @@ class En {
|
|
|
6699
6732
|
);
|
|
6700
6733
|
}
|
|
6701
6734
|
}
|
|
6702
|
-
class
|
|
6735
|
+
class Cn {
|
|
6703
6736
|
constructor(t, e = {}, i = []) {
|
|
6704
6737
|
this.hidden = !0, this.destroyed = !1, this.currModules = [], this.frame = document.createElement("iframe"), this.frame.sandbox.value = "allow-same-origin allow-scripts", this.frame.classList.add("readium-navigator-iframe"), this.frame.style.visibility = "hidden", this.frame.style.setProperty("aria-hidden", "true"), this.frame.style.opacity = "0", this.frame.style.position = "absolute", this.frame.style.pointerEvents = "none", this.frame.style.transition = "visibility 0s, opacity 0.1s linear", this.source = t, this.contentProtectionConfig = { ...e }, this.keyboardPeripheralsConfig = [...i];
|
|
6705
6738
|
}
|
|
@@ -6761,7 +6794,7 @@ class _n {
|
|
|
6761
6794
|
async show(t) {
|
|
6762
6795
|
if (this.destroyed) throw Error("Trying to show frame when it doesn't exist");
|
|
6763
6796
|
if (!this.frame.parentElement) throw Error("Trying to show frame that is not attached to the DOM");
|
|
6764
|
-
return this.comms ? this.comms.resume() : this.comms = new
|
|
6797
|
+
return this.comms ? this.comms.resume() : this.comms = new Nt(this.frame.contentWindow, this.source), new Promise((e, i) => {
|
|
6765
6798
|
this.comms?.send("activate", void 0, () => {
|
|
6766
6799
|
this.comms?.send("focus", void 0, () => {
|
|
6767
6800
|
this.applyContentProtection();
|
|
@@ -6774,7 +6807,7 @@ class _n {
|
|
|
6774
6807
|
});
|
|
6775
6808
|
}
|
|
6776
6809
|
setCSSProperties(t) {
|
|
6777
|
-
this.destroyed || !this.frame.contentWindow || (this.hidden && (this.comms ? this.comms?.resume() : this.comms = new
|
|
6810
|
+
this.destroyed || !this.frame.contentWindow || (this.hidden && (this.comms ? this.comms?.resume() : this.comms = new Nt(this.frame.contentWindow, this.source)), this.comms?.send("update_properties", t), this.hidden && this.comms?.halt());
|
|
6778
6811
|
}
|
|
6779
6812
|
get iframe() {
|
|
6780
6813
|
if (this.destroyed) throw Error("Trying to use frame when it doesn't exist");
|
|
@@ -6804,8 +6837,8 @@ class _n {
|
|
|
6804
6837
|
return this.loader;
|
|
6805
6838
|
}
|
|
6806
6839
|
}
|
|
6807
|
-
const Ii = 5,
|
|
6808
|
-
class
|
|
6840
|
+
const Ii = 5, zi = 3;
|
|
6841
|
+
class Rr {
|
|
6809
6842
|
constructor(t, e, i, n, s, o) {
|
|
6810
6843
|
this.pool = /* @__PURE__ */ new Map(), this.blobs = /* @__PURE__ */ new Map(), this.inprogress = /* @__PURE__ */ new Map(), this.pendingUpdates = /* @__PURE__ */ new Map(), this.injector = null, this.container = t, this.positions = e, this.currentCssProperties = i, this.injector = n ?? null, this.contentProtectionConfig = s || {}, this.keyboardPeripheralsConfig = o || [];
|
|
6811
6844
|
}
|
|
@@ -6832,7 +6865,7 @@ class nr {
|
|
|
6832
6865
|
const a = new Promise(async (l, h) => {
|
|
6833
6866
|
const c = [], u = [];
|
|
6834
6867
|
this.positions.forEach((d, f) => {
|
|
6835
|
-
(f > s + Ii || f < s - Ii) && (c.includes(d.href) || c.push(d.href)), f < s +
|
|
6868
|
+
(f > s + Ii || f < s - Ii) && (c.includes(d.href) || c.push(d.href)), f < s + zi && f > s - zi && (u.includes(d.href) || u.push(d.href));
|
|
6836
6869
|
}), c.forEach(async (d) => {
|
|
6837
6870
|
u.includes(d) || this.pool.has(d) && (await this.pool.get(d)?.destroy(), this.pool.delete(d), this.pendingUpdates.has(d) && this.pendingUpdates.set(d, { inPool: !1 }));
|
|
6838
6871
|
}), this.currentBaseURL !== void 0 && t.baseURL !== this.currentBaseURL && (this.blobs.forEach((d) => {
|
|
@@ -6868,7 +6901,7 @@ class nr {
|
|
|
6868
6901
|
).build();
|
|
6869
6902
|
this.blobs.set(d, R);
|
|
6870
6903
|
}
|
|
6871
|
-
const w = new
|
|
6904
|
+
const w = new Cn(this.blobs.get(d), this.contentProtectionConfig, this.keyboardPeripheralsConfig);
|
|
6872
6905
|
d !== o && await w.hide(), this.container.appendChild(w.iframe), await w.load(i), this.pool.set(d, w);
|
|
6873
6906
|
};
|
|
6874
6907
|
try {
|
|
@@ -6922,9 +6955,9 @@ class nr {
|
|
|
6922
6955
|
}), t;
|
|
6923
6956
|
}
|
|
6924
6957
|
}
|
|
6925
|
-
class
|
|
6958
|
+
class Ar {
|
|
6926
6959
|
constructor(t, e, i, n = {}, s = []) {
|
|
6927
|
-
this.currModules = [], this.cachedPage = void 0, this.peripherals = t, this.debugHref = i, this.contentProtectionConfig = { ...n }, this.keyboardPeripheralsConfig = [...s], this.frame = document.createElement("iframe"), this.frame.sandbox.value = "allow-same-origin allow-scripts", this.frame.classList.add("readium-navigator-iframe"), this.frame.classList.add("blank"), this.frame.scrolling = "no", this.frame.style.visibility = "hidden", this.frame.style.setProperty("aria-hidden", "true"), this.frame.style.display = "none", this.frame.style.position = "absolute", this.frame.style.pointerEvents = "none", this.frame.style.transformOrigin = "0 0", this.frame.style.transform = "scale(1)", this.frame.style.background = "#fff", this.frame.style.touchAction = "none", this.frame.dataset.originalHref = i, this.source = "about:blank", this.wrapper = document.createElement("div"), this.wrapper.style.position = "relative", this.wrapper.style.float = this.wrapper.style.cssFloat = e ===
|
|
6960
|
+
this.currModules = [], this.cachedPage = void 0, this.peripherals = t, this.debugHref = i, this.contentProtectionConfig = { ...n }, this.keyboardPeripheralsConfig = [...s], this.frame = document.createElement("iframe"), this.frame.sandbox.value = "allow-same-origin allow-scripts", this.frame.classList.add("readium-navigator-iframe"), this.frame.classList.add("blank"), this.frame.scrolling = "no", this.frame.style.visibility = "hidden", this.frame.style.setProperty("aria-hidden", "true"), this.frame.style.display = "none", this.frame.style.position = "absolute", this.frame.style.pointerEvents = "none", this.frame.style.transformOrigin = "0 0", this.frame.style.transform = "scale(1)", this.frame.style.background = "#fff", this.frame.style.touchAction = "none", this.frame.dataset.originalHref = i, this.source = "about:blank", this.wrapper = document.createElement("div"), this.wrapper.style.position = "relative", this.wrapper.style.float = this.wrapper.style.cssFloat = e === M.rtl ? "right" : "left", this.wrapper.appendChild(this.frame);
|
|
6928
6961
|
}
|
|
6929
6962
|
async load(t, e) {
|
|
6930
6963
|
return this.source === e && this.loadPromise && [...this.currModules].sort().join("|") === [...t].sort().join("|") ? this.loadPromise : (this.loaded && this.source !== e && this.window.stop(), this.source = e, this.loadPromise = new Promise((i, n) => {
|
|
@@ -6984,10 +7017,10 @@ class sr {
|
|
|
6984
7017
|
const i = Math.min(this.wrapper.clientWidth / e.width, this.wrapper.clientHeight / e.height);
|
|
6985
7018
|
this.frame.style.transform = `scale(${i})`;
|
|
6986
7019
|
const n = this.frame.getBoundingClientRect(), s = this.wrapper.clientHeight - n.height;
|
|
6987
|
-
if (this.frame.style.top = `${s / 2}px`, t ===
|
|
7020
|
+
if (this.frame.style.top = `${s / 2}px`, t === G.left) {
|
|
6988
7021
|
const o = this.wrapper.clientWidth - n.width;
|
|
6989
7022
|
this.frame.style.left = `${o}px`;
|
|
6990
|
-
} else if (t ===
|
|
7023
|
+
} else if (t === G.center) {
|
|
6991
7024
|
const o = this.wrapper.clientWidth - n.width;
|
|
6992
7025
|
this.frame.style.left = `${o / 2}px`;
|
|
6993
7026
|
} else
|
|
@@ -7042,7 +7075,7 @@ class sr {
|
|
|
7042
7075
|
this.showPromise = void 0;
|
|
7043
7076
|
return;
|
|
7044
7077
|
}
|
|
7045
|
-
return this.showPromise ? (this.cachedPage !== t && (this.update(t), this.cachedPage = t), this.showPromise) : (this.cachedPage = t, this.comms ? this.comms.resume() : this.comms = new
|
|
7078
|
+
return this.showPromise ? (this.cachedPage !== t && (this.update(t), this.cachedPage = t), this.showPromise) : (this.cachedPage = t, this.comms ? this.comms.resume() : this.comms = new Nt(this.frame.contentWindow, this.source), this.showPromise = new Promise((e, i) => {
|
|
7046
7079
|
this.comms.send("focus", void 0, (n) => {
|
|
7047
7080
|
this.update(this.cachedPage), this.applyContentProtection(), e();
|
|
7048
7081
|
});
|
|
@@ -7093,8 +7126,8 @@ class sr {
|
|
|
7093
7126
|
return this.loader;
|
|
7094
7127
|
}
|
|
7095
7128
|
}
|
|
7096
|
-
var
|
|
7097
|
-
class
|
|
7129
|
+
var Tr = /* @__PURE__ */ ((r) => (r[r.Left = 0] = "Left", r[r.Center = 1] = "Center", r[r.Right = 2] = "Right", r))(Tr || {}), Nr = /* @__PURE__ */ ((r) => (r[r.Top = 0] = "Top", r[r.Middle = 1] = "Middle", r[r.Bottom = 2] = "Bottom", r))(Nr || {});
|
|
7130
|
+
class Mr {
|
|
7098
7131
|
constructor() {
|
|
7099
7132
|
this.outerWidth = 0, this.outerHeight = 0, this.HTML = document.documentElement, this.Head = document.head, this.Body = document.body;
|
|
7100
7133
|
}
|
|
@@ -7142,7 +7175,7 @@ class ar {
|
|
|
7142
7175
|
};
|
|
7143
7176
|
}
|
|
7144
7177
|
}
|
|
7145
|
-
class
|
|
7178
|
+
class Fr {
|
|
7146
7179
|
constructor() {
|
|
7147
7180
|
this._DOM = {
|
|
7148
7181
|
show: !1,
|
|
@@ -7160,8 +7193,8 @@ class lr {
|
|
|
7160
7193
|
return this._DOM;
|
|
7161
7194
|
}
|
|
7162
7195
|
}
|
|
7163
|
-
const
|
|
7164
|
-
class
|
|
7196
|
+
const Di = 6, ye = 1.02, Wi = 50;
|
|
7197
|
+
class Ir {
|
|
7165
7198
|
constructor(t, e = !1) {
|
|
7166
7199
|
this.dragState = 0, this.minimumMoved = !1, this.pan = {
|
|
7167
7200
|
startX: 0,
|
|
@@ -7180,7 +7213,7 @@ class hr {
|
|
|
7180
7213
|
target: { X: 0, Y: 0 },
|
|
7181
7214
|
touchN: 0,
|
|
7182
7215
|
startTranslate: { X: 0, Y: 0 }
|
|
7183
|
-
}, this._scale = 1, this.scaleDebouncer = 0, this.frameBounds = null, this.debugger = null, this.btouchstartHandler = this.touchstartHandler.bind(this), this.btouchendHandler = this.touchendHandler.bind(this), this.btouchmoveHandler = this.touchmoveHandler.bind(this), this.bdblclickHandler = this.dblclickHandler.bind(this), this.bmousedownHandler = this.mousedownHandler.bind(this), this.bmouseupHandler = this.mouseupHandler.bind(this), this.bmousemoveHandler = this.mousemoveHandler.bind(this), this.moveFrame = 0, this.manager = t, this.coordinator = new
|
|
7216
|
+
}, this._scale = 1, this.scaleDebouncer = 0, this.frameBounds = null, this.debugger = null, this.btouchstartHandler = this.touchstartHandler.bind(this), this.btouchendHandler = this.touchendHandler.bind(this), this.btouchmoveHandler = this.touchmoveHandler.bind(this), this.bdblclickHandler = this.dblclickHandler.bind(this), this.bmousedownHandler = this.mousedownHandler.bind(this), this.bmouseupHandler = this.mouseupHandler.bind(this), this.bmousemoveHandler = this.mousemoveHandler.bind(this), this.moveFrame = 0, this.manager = t, this.coordinator = new Mr(), this.attachEvents(), e && (this.debugger = new Fr());
|
|
7184
7217
|
}
|
|
7185
7218
|
get scale() {
|
|
7186
7219
|
return this._scale;
|
|
@@ -7299,7 +7332,7 @@ class hr {
|
|
|
7299
7332
|
if (this.dragState === 2 && i) {
|
|
7300
7333
|
if (this.pinch.touchN++, this.pinch.touchN < 4) return;
|
|
7301
7334
|
let o = i / this.pinch.startDistance * this.scale;
|
|
7302
|
-
o >=
|
|
7335
|
+
o >= Di && (o = Di), o <= ye && (o = 1), this.scale = o, this.pinch.startDistance = i, n = !0;
|
|
7303
7336
|
}
|
|
7304
7337
|
if (this.pan.letItGo === !1 && (this.pan.letItGo = Math.abs(this.pan.startY - e.Y) < Math.abs(this.pan.startX - e.X)), this.debugger?.show && (this.debugger.DOM.touch1.style.top = `${e.Y - 10}px`, this.debugger.DOM.touch1.style.left = `${e.X - 10}px`, this.debugger.DOM.touch1.innerText = `${e.X.toFixed(2)},${e.Y.toFixed(2)}`), this.dragState > 0 && this.isScaled || this.dragState > 1) {
|
|
7305
7338
|
if (this.dragState === 1) {
|
|
@@ -7381,8 +7414,8 @@ Overscroll: ${this.pan.overscrollX.toFixed(2)},${this.pan.overscrollY.toFixed(2)
|
|
|
7381
7414
|
t > 0 && e > this.manager.threshold && this.manager.slength > this.manager.perPage ? this.manager.listener("no_less", void 0) : t < 0 && e > this.manager.threshold && this.manager.slength > this.manager.perPage && this.manager.listener("no_more", void 0), this.manager.slideToCurrent(!0, !0);
|
|
7382
7415
|
}
|
|
7383
7416
|
}
|
|
7384
|
-
var
|
|
7385
|
-
class
|
|
7417
|
+
var Ne = /* @__PURE__ */ ((r) => (r.auto = "auto", r.landscape = "landscape", r.portrait = "portrait", r))(Ne || {}), Me = /* @__PURE__ */ ((r) => (r.auto = "auto", r.both = "both", r.none = "none", r.landscape = "landscape", r))(Me || {});
|
|
7418
|
+
class zr {
|
|
7386
7419
|
// TODO getter
|
|
7387
7420
|
constructor(t) {
|
|
7388
7421
|
this.shift = !0, this.spreads = [], this.nLandscape = 0, this.index(t), this.testShift(t), console.log(`Indexed ${this.spreads.length} spreads for ${t.readingOrder.items.length} items`);
|
|
@@ -7400,7 +7433,7 @@ class cr {
|
|
|
7400
7433
|
"center"
|
|
7401
7434
|
) : (
|
|
7402
7435
|
// Center it
|
|
7403
|
-
((this.shift ? 0 : 1) + n - this.nLandscape) % 2 ? t.metadata.readingProgression ===
|
|
7436
|
+
((this.shift ? 0 : 1) + n - this.nLandscape) % 2 ? t.metadata.readingProgression === M.rtl ? "right" : "left" : t.metadata.readingProgression === M.rtl ? "left" : "right"
|
|
7404
7437
|
)
|
|
7405
7438
|
})), (s || i.properties?.otherProperties.addBlank) && this.nLandscape++;
|
|
7406
7439
|
}), e && (this.spreads = []), this.buildSpreads(t.readingOrder);
|
|
@@ -7411,13 +7444,13 @@ class cr {
|
|
|
7411
7444
|
if (i.length > 1)
|
|
7412
7445
|
return;
|
|
7413
7446
|
const s = i[0], o = s.properties?.otherProperties.orientation;
|
|
7414
|
-
n === 0 && (o === "landscape" || o !== "portrait" && ((s.width || 0) > (s.height || 0) || s.properties?.otherProperties.spread === "both")) && (this.shift = !1), e && s.properties?.page ===
|
|
7447
|
+
n === 0 && (o === "landscape" || o !== "portrait" && ((s.width || 0) > (s.height || 0) || s.properties?.otherProperties.spread === "both")) && (this.shift = !1), e && s.properties?.page === G.center && this.spreads[n - 1][0].addProperties({ addBlank: !0 }), o === "portrait" && s.properties?.page !== "center" && s.properties?.otherProperties.number > 1 ? e = !0 : e = !1;
|
|
7415
7448
|
}), this.shift || this.index(t, !0);
|
|
7416
7449
|
}
|
|
7417
7450
|
buildSpreads(t) {
|
|
7418
7451
|
let e = [];
|
|
7419
7452
|
t.items.forEach((i, n) => {
|
|
7420
|
-
!n && this.shift ? this.spreads.push([i]) : i.properties?.page ===
|
|
7453
|
+
!n && this.shift ? this.spreads.push([i]) : i.properties?.page === G.center ? (e.length > 0 && this.spreads.push(e), this.spreads.push([i]), e = []) : e.length >= 2 ? (this.spreads.push(e), e = [i]) : e.push(i);
|
|
7421
7454
|
}), e.length > 0 && this.spreads.push(e);
|
|
7422
7455
|
}
|
|
7423
7456
|
currentSpread(t, e) {
|
|
@@ -7427,14 +7460,14 @@ class cr {
|
|
|
7427
7460
|
return this.spreads.find((e) => e.includes(t)) || void 0;
|
|
7428
7461
|
}
|
|
7429
7462
|
}
|
|
7430
|
-
const Ui = 8,
|
|
7431
|
-
class
|
|
7463
|
+
const Ui = 8, Hi = 5, Dr = 300, Wr = 15e3, Ur = 250, Hr = 150, Br = 500;
|
|
7464
|
+
class Vr {
|
|
7432
7465
|
constructor(t, e, i, n, s, o) {
|
|
7433
|
-
if (this.pool = /* @__PURE__ */ new Map(), this.blobs = /* @__PURE__ */ new Map(), this.inprogress = /* @__PURE__ */ new Map(), this.delayedShow = /* @__PURE__ */ new Map(), this.delayedTimeout = /* @__PURE__ */ new Map(), this.previousFrames = [], this.injector = null, this.width = 0, this.height = 0, this.transform = "", this.currentSlide = 0, this.spread = !0, this.orientationInternal = -1, this.container = t, this.positions = e, this.pub = i, this.injector = n ?? null, this.contentProtectionConfig = s || {}, this.keyboardPeripheralsConfig = o || [], this.spreadPresentation = i.metadata.otherMetadata?.spread ||
|
|
7466
|
+
if (this.pool = /* @__PURE__ */ new Map(), this.blobs = /* @__PURE__ */ new Map(), this.inprogress = /* @__PURE__ */ new Map(), this.delayedShow = /* @__PURE__ */ new Map(), this.delayedTimeout = /* @__PURE__ */ new Map(), this.previousFrames = [], this.injector = null, this.width = 0, this.height = 0, this.transform = "", this.currentSlide = 0, this.spread = !0, this.orientationInternal = -1, this.container = t, this.positions = e, this.pub = i, this.injector = n ?? null, this.contentProtectionConfig = s || {}, this.keyboardPeripheralsConfig = o || [], this.spreadPresentation = i.metadata.otherMetadata?.spread || Me.auto, this.pub.metadata.effectiveReadingProgression !== M.rtl && this.pub.metadata.effectiveReadingProgression !== M.ltr)
|
|
7434
7467
|
throw Error("Unsupported reading progression for EPUB");
|
|
7435
|
-
this.spreader = new
|
|
7436
|
-
const l = new
|
|
7437
|
-
this.spineElement.appendChild(l.element), this.pool.set(a.href, l), l.width = 100 / this.length * (a.properties?.otherProperties.orientation ===
|
|
7468
|
+
this.spreader = new zr(this.pub), this.containerHeightCached = t.clientHeight, this.bookElement = document.createElement("div"), this.bookElement.ariaLabel = "Book", this.bookElement.tabIndex = -1, this.updateBookStyle(!0), this.spineElement = document.createElement("div"), this.spineElement.ariaLabel = "Spine", this.bookElement.appendChild(this.spineElement), this.container.appendChild(this.bookElement), this.updateSpineStyle(!0), this.peripherals = new Ir(this), this.pub.readingOrder.items.forEach((a) => {
|
|
7469
|
+
const l = new Ar(this.peripherals, this.pub.metadata.effectiveReadingProgression, a.href, this.contentProtectionConfig, this.keyboardPeripheralsConfig);
|
|
7470
|
+
this.spineElement.appendChild(l.element), this.pool.set(a.href, l), l.width = 100 / this.length * (a.properties?.otherProperties.orientation === Ne.landscape || a.properties?.otherProperties.addBlank ? this.perPage : 1), l.height = this.height;
|
|
7438
7471
|
});
|
|
7439
7472
|
}
|
|
7440
7473
|
set listener(t) {
|
|
@@ -7454,11 +7487,11 @@ class gr {
|
|
|
7454
7487
|
this.pool.forEach((i, n) => {
|
|
7455
7488
|
let s = this.pub.readingOrder.items.findIndex((l) => l.href === n);
|
|
7456
7489
|
const o = this.pub.readingOrder.items[s];
|
|
7457
|
-
if (i.width = 100 / this.length * (o.properties?.otherProperties.orientation ===
|
|
7490
|
+
if (i.width = 100 / this.length * (o.properties?.otherProperties.orientation === Ne.landscape || o.properties?.otherProperties.addBlank ? this.perPage : 1), i.height = this.height, !i.loaded) return;
|
|
7458
7491
|
const a = this.spreader.findByLink(o);
|
|
7459
7492
|
i.update(this.spreadPosition(a, o));
|
|
7460
7493
|
});
|
|
7461
|
-
},
|
|
7494
|
+
}, Ur);
|
|
7462
7495
|
}
|
|
7463
7496
|
/**
|
|
7464
7497
|
* It is important that these values be cached to avoid spamming them on redraws, they are expensive.
|
|
@@ -7467,7 +7500,7 @@ class gr {
|
|
|
7467
7500
|
this.width = this.bookElement.clientWidth, this.height = this.bookElement.clientHeight;
|
|
7468
7501
|
}
|
|
7469
7502
|
get rtl() {
|
|
7470
|
-
return this.pub.metadata.effectiveReadingProgression ===
|
|
7503
|
+
return this.pub.metadata.effectiveReadingProgression === M.rtl;
|
|
7471
7504
|
}
|
|
7472
7505
|
get single() {
|
|
7473
7506
|
return !this.spread || this.portrait;
|
|
@@ -7479,13 +7512,13 @@ class gr {
|
|
|
7479
7512
|
return 50;
|
|
7480
7513
|
}
|
|
7481
7514
|
get portrait() {
|
|
7482
|
-
return this.spreadPresentation ===
|
|
7515
|
+
return this.spreadPresentation === Me.none ? !0 : (this.orientationInternal === -1 && (this.orientationInternal = this.containerHeightCached > this.container.clientWidth ? 1 : 0), this.orientationInternal === 1);
|
|
7483
7516
|
}
|
|
7484
7517
|
updateSpineStyle(t, e = !0) {
|
|
7485
7518
|
let i = "0";
|
|
7486
7519
|
this.updateDimensions(), this.perPage > 1 && (i = `${this.width / 2}px`);
|
|
7487
7520
|
const n = {
|
|
7488
|
-
transition: t ? `all ${e ?
|
|
7521
|
+
transition: t ? `all ${e ? Hr : Br}ms ease-out` : "all 0ms ease-out",
|
|
7489
7522
|
marginRight: this.rtl ? i : "0",
|
|
7490
7523
|
marginLeft: this.rtl ? "0" : i,
|
|
7491
7524
|
width: `${this.width / this.perPage * this.length}px`,
|
|
@@ -7620,7 +7653,7 @@ class gr {
|
|
|
7620
7653
|
return t % 2 && !this.single && t++, t;
|
|
7621
7654
|
}
|
|
7622
7655
|
spreadPosition(t, e) {
|
|
7623
|
-
return this.perPage < 2 || t.length < 2 ?
|
|
7656
|
+
return this.perPage < 2 || t.length < 2 ? G.center : e.href === t[0].href ? this.rtl ? G.right : G.left : this.rtl ? G.left : G.right;
|
|
7624
7657
|
}
|
|
7625
7658
|
async waitForItem(t) {
|
|
7626
7659
|
if (this.inprogress.has(t) && await this.inprogress.get(t), this.delayedShow.has(t)) {
|
|
@@ -7645,7 +7678,7 @@ class gr {
|
|
|
7645
7678
|
const a = new Promise(async (l, h) => {
|
|
7646
7679
|
const c = [], u = [];
|
|
7647
7680
|
this.positions.forEach((d, f) => {
|
|
7648
|
-
(f > s + Ui || f < s - Ui) && (c.includes(d.href) || c.push(d.href)), f < s +
|
|
7681
|
+
(f > s + Ui || f < s - Ui) && (c.includes(d.href) || c.push(d.href)), f < s + Hi && f > s - Hi && (u.includes(d.href) || u.push(d.href));
|
|
7649
7682
|
}), c.forEach(async (d) => {
|
|
7650
7683
|
u.includes(d) || this.pool.has(d) && (this.cancelShowing(d), await this.pool.get(d)?.unload());
|
|
7651
7684
|
}), this.currentBaseURL !== void 0 && t.baseURL !== this.currentBaseURL && (this.blobs.forEach((d) => URL.revokeObjectURL(d)), this.blobs.clear()), this.currentBaseURL = t.baseURL;
|
|
@@ -7669,10 +7702,10 @@ class gr {
|
|
|
7669
7702
|
this.delayedTimeout.set(d, 0);
|
|
7670
7703
|
const ht = this.makeSpread(this.reAlign(f)), xn = this.spreadPosition(ht, w), Ze = this.pool.get(d);
|
|
7671
7704
|
await Ze.load(i, this.blobs.get(d)), this.peripherals.isScaled || await Ze.show(xn), this.delayedShow.delete(d), Y = !0, P();
|
|
7672
|
-
},
|
|
7705
|
+
}, Dr);
|
|
7673
7706
|
setTimeout(() => {
|
|
7674
7707
|
!Y && this.delayedShow.has(d) && R(`Offscreen load timeout: ${d}`);
|
|
7675
|
-
},
|
|
7708
|
+
}, Wr), this.delayedTimeout.set(d, lt);
|
|
7676
7709
|
}));
|
|
7677
7710
|
}
|
|
7678
7711
|
};
|
|
@@ -7748,9 +7781,9 @@ class gr {
|
|
|
7748
7781
|
this.currentFrames?.forEach((t) => t?.deselect());
|
|
7749
7782
|
}
|
|
7750
7783
|
}
|
|
7751
|
-
class
|
|
7784
|
+
class Ft {
|
|
7752
7785
|
constructor(t = {}) {
|
|
7753
|
-
this.backgroundColor = W(t.backgroundColor), this.blendFilter = E(t.blendFilter), this.constraint =
|
|
7786
|
+
this.backgroundColor = W(t.backgroundColor), this.blendFilter = E(t.blendFilter), this.constraint = S(t.constraint), this.columnCount = S(t.columnCount), this.darkenFilter = wt(t.darkenFilter), this.deprecatedFontSize = E(t.deprecatedFontSize), this.fontFamily = W(t.fontFamily), this.fontSize = F(t.fontSize, Yt.range), this.fontSizeNormalize = E(t.fontSizeNormalize), this.fontOpticalSizing = E(t.fontOpticalSizing), this.fontWeight = F(t.fontWeight, st.range), this.fontWidth = F(t.fontWidth, qt.range), this.hyphens = E(t.hyphens), this.invertFilter = wt(t.invertFilter), this.invertGaijiFilter = wt(t.invertGaijiFilter), this.iOSPatch = E(t.iOSPatch), this.iPadOSPatch = E(t.iPadOSPatch), this.letterSpacing = S(t.letterSpacing), this.ligatures = E(t.ligatures), this.lineHeight = S(t.lineHeight), this.linkColor = W(t.linkColor), this.noRuby = E(t.noRuby), this.pageGutter = S(t.pageGutter), this.paragraphIndent = S(t.paragraphIndent), this.paragraphSpacing = S(t.paragraphSpacing), this.scroll = E(t.scroll), this.scrollPaddingTop = S(t.scrollPaddingTop), this.scrollPaddingBottom = S(t.scrollPaddingBottom), this.scrollPaddingLeft = S(t.scrollPaddingLeft), this.scrollPaddingRight = S(t.scrollPaddingRight), this.selectionBackgroundColor = W(t.selectionBackgroundColor), this.selectionTextColor = W(t.selectionTextColor), this.textAlign = he(t.textAlign, tt), this.textColor = W(t.textColor), this.textNormalization = E(t.textNormalization), this.visitedColor = W(t.visitedColor), this.wordSpacing = S(t.wordSpacing), this.optimalLineLength = S(t.optimalLineLength), this.maximalLineLength = S(t.maximalLineLength), this.minimalLineLength = S(t.minimalLineLength);
|
|
7754
7787
|
}
|
|
7755
7788
|
static serialize(t) {
|
|
7756
7789
|
const { ...e } = t;
|
|
@@ -7759,7 +7792,7 @@ class zt {
|
|
|
7759
7792
|
static deserialize(t) {
|
|
7760
7793
|
try {
|
|
7761
7794
|
const e = JSON.parse(t);
|
|
7762
|
-
return new
|
|
7795
|
+
return new Ft(e);
|
|
7763
7796
|
} catch (e) {
|
|
7764
7797
|
return console.error("Failed to deserialize preferences:", e), null;
|
|
7765
7798
|
}
|
|
@@ -7768,36 +7801,36 @@ class zt {
|
|
|
7768
7801
|
const e = { ...this };
|
|
7769
7802
|
for (const i of Object.keys(t))
|
|
7770
7803
|
t[i] !== void 0 && (i !== "maximalLineLength" || t[i] === null || t[i] >= (t.optimalLineLength ?? e.optimalLineLength ?? 65)) && (i !== "minimalLineLength" || t[i] === null || t[i] <= (t.optimalLineLength ?? e.optimalLineLength ?? 65)) && (e[i] = t[i]);
|
|
7771
|
-
return new
|
|
7804
|
+
return new Ft(e);
|
|
7772
7805
|
}
|
|
7773
7806
|
}
|
|
7774
|
-
class
|
|
7807
|
+
class jr {
|
|
7775
7808
|
constructor(t) {
|
|
7776
|
-
this.backgroundColor = W(t.backgroundColor) || null, this.blendFilter = E(t.blendFilter) ?? !1, this.constraint =
|
|
7809
|
+
this.backgroundColor = W(t.backgroundColor) || null, this.blendFilter = E(t.blendFilter) ?? !1, this.constraint = S(t.constraint) || 0, this.columnCount = S(t.columnCount) || null, this.darkenFilter = wt(t.darkenFilter) ?? !1, this.deprecatedFontSize = E(t.deprecatedFontSize), (this.deprecatedFontSize === !1 || this.deprecatedFontSize === null) && (this.deprecatedFontSize = !CSS.supports("zoom", "1")), this.fontFamily = W(t.fontFamily) || null, this.fontSize = F(t.fontSize, Yt.range) || 1, this.fontSizeNormalize = E(t.fontSizeNormalize) ?? !1, this.fontOpticalSizing = E(t.fontOpticalSizing) ?? null, this.fontWeight = F(t.fontWeight, st.range) || null, this.fontWidth = F(t.fontWidth, qt.range) || null, this.hyphens = E(t.hyphens) ?? null, this.invertFilter = wt(t.invertFilter) ?? !1, this.invertGaijiFilter = wt(t.invertGaijiFilter) ?? !1, this.iOSPatch = t.iOSPatch === !1 ? !1 : (T.OS.iOS || T.OS.iPadOS) && T.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : T.OS.iPadOS && T.iOSRequest === "desktop", this.letterSpacing = S(t.letterSpacing) || null, this.ligatures = E(t.ligatures) ?? null, this.lineHeight = S(t.lineHeight) || null, this.linkColor = W(t.linkColor) || null, this.noRuby = E(t.noRuby) ?? !1, this.pageGutter = ge(S(t.pageGutter), 20), this.paragraphIndent = S(t.paragraphIndent) ?? null, this.paragraphSpacing = S(t.paragraphSpacing) ?? null, this.scroll = E(t.scroll) ?? !1, this.scrollPaddingTop = S(t.scrollPaddingTop) ?? null, this.scrollPaddingBottom = S(t.scrollPaddingBottom) ?? null, this.scrollPaddingLeft = S(t.scrollPaddingLeft) ?? null, this.scrollPaddingRight = S(t.scrollPaddingRight) ?? null, this.selectionBackgroundColor = W(t.selectionBackgroundColor) || null, this.selectionTextColor = W(t.selectionTextColor) || null, this.textAlign = he(t.textAlign, tt) || null, this.textColor = W(t.textColor) || null, this.textNormalization = E(t.textNormalization) ?? !1, this.visitedColor = W(t.visitedColor) || null, this.wordSpacing = S(t.wordSpacing) || null, this.optimalLineLength = S(t.optimalLineLength) || 65, this.maximalLineLength = ge(cr(t.maximalLineLength, this.optimalLineLength), 80), this.minimalLineLength = ge(hr(t.minimalLineLength, this.optimalLineLength), 40), this.experiments = gn(t.experiments) || null;
|
|
7777
7810
|
}
|
|
7778
7811
|
}
|
|
7779
|
-
const
|
|
7780
|
-
|
|
7781
|
-
|
|
7782
|
-
|
|
7783
|
-
|
|
7784
|
-
|
|
7785
|
-
|
|
7812
|
+
const $r = "#FFFFFF", Gr = "#121212", Xr = "#0000EE", Yr = "#551A8B", qr = "#b4d8fe", Kr = "inherit", pt = {
|
|
7813
|
+
backgroundColor: $r,
|
|
7814
|
+
textColor: Gr,
|
|
7815
|
+
linkColor: Xr,
|
|
7816
|
+
visitedColor: Yr,
|
|
7817
|
+
selectionBackgroundColor: qr,
|
|
7818
|
+
selectionTextColor: Kr
|
|
7786
7819
|
};
|
|
7787
|
-
class
|
|
7820
|
+
class Bi {
|
|
7788
7821
|
constructor(t, e, i) {
|
|
7789
7822
|
this.preferences = t, this.settings = e, this.metadata = i, this.layout = this.metadata?.effectiveLayout || b.reflowable;
|
|
7790
7823
|
}
|
|
7791
7824
|
clear() {
|
|
7792
|
-
this.preferences = new
|
|
7825
|
+
this.preferences = new Ft({ optimalLineLength: 65 });
|
|
7793
7826
|
}
|
|
7794
7827
|
updatePreference(t, e) {
|
|
7795
7828
|
this.preferences[t] = e;
|
|
7796
7829
|
}
|
|
7797
7830
|
get backgroundColor() {
|
|
7798
|
-
return new
|
|
7831
|
+
return new N({
|
|
7799
7832
|
initialValue: this.preferences.backgroundColor,
|
|
7800
|
-
effectiveValue: this.settings.backgroundColor || pt.
|
|
7833
|
+
effectiveValue: this.settings.backgroundColor || pt.backgroundColor,
|
|
7801
7834
|
isEffective: this.preferences.backgroundColor !== null,
|
|
7802
7835
|
onChange: (t) => {
|
|
7803
7836
|
this.updatePreference("backgroundColor", t ?? null);
|
|
@@ -7815,7 +7848,7 @@ class Hi {
|
|
|
7815
7848
|
});
|
|
7816
7849
|
}
|
|
7817
7850
|
get columnCount() {
|
|
7818
|
-
return new
|
|
7851
|
+
return new N({
|
|
7819
7852
|
initialValue: this.preferences.columnCount,
|
|
7820
7853
|
effectiveValue: this.settings.columnCount || null,
|
|
7821
7854
|
isEffective: this.layout !== b.fixed && !this.settings.scroll,
|
|
@@ -7825,7 +7858,7 @@ class Hi {
|
|
|
7825
7858
|
});
|
|
7826
7859
|
}
|
|
7827
7860
|
get constraint() {
|
|
7828
|
-
return new
|
|
7861
|
+
return new N({
|
|
7829
7862
|
initialValue: this.preferences.constraint,
|
|
7830
7863
|
effectiveValue: this.preferences.constraint || 0,
|
|
7831
7864
|
isEffective: !0,
|
|
@@ -7857,7 +7890,7 @@ class Hi {
|
|
|
7857
7890
|
});
|
|
7858
7891
|
}
|
|
7859
7892
|
get fontFamily() {
|
|
7860
|
-
return new
|
|
7893
|
+
return new N({
|
|
7861
7894
|
initialValue: this.preferences.fontFamily,
|
|
7862
7895
|
effectiveValue: this.settings.fontFamily || null,
|
|
7863
7896
|
isEffective: this.layout !== b.fixed,
|
|
@@ -7926,7 +7959,7 @@ class Hi {
|
|
|
7926
7959
|
return new A({
|
|
7927
7960
|
initialValue: this.preferences.hyphens,
|
|
7928
7961
|
effectiveValue: this.settings.hyphens || !1,
|
|
7929
|
-
isEffective: this.layout !== b.fixed && this.metadata?.effectiveReadingProgression ===
|
|
7962
|
+
isEffective: this.layout !== b.fixed && this.metadata?.effectiveReadingProgression === M.ltr && this.preferences.hyphens !== null,
|
|
7930
7963
|
onChange: (t) => {
|
|
7931
7964
|
this.updatePreference("hyphens", t ?? null);
|
|
7932
7965
|
}
|
|
@@ -8016,9 +8049,9 @@ class Hi {
|
|
|
8016
8049
|
});
|
|
8017
8050
|
}
|
|
8018
8051
|
get linkColor() {
|
|
8019
|
-
return new
|
|
8052
|
+
return new N({
|
|
8020
8053
|
initialValue: this.preferences.linkColor,
|
|
8021
|
-
effectiveValue: this.settings.linkColor || pt.
|
|
8054
|
+
effectiveValue: this.settings.linkColor || pt.linkColor,
|
|
8022
8055
|
isEffective: this.layout !== b.fixed && this.preferences.linkColor !== null,
|
|
8023
8056
|
onChange: (t) => {
|
|
8024
8057
|
this.updatePreference("linkColor", t ?? null);
|
|
@@ -8072,7 +8105,7 @@ class Hi {
|
|
|
8072
8105
|
});
|
|
8073
8106
|
}
|
|
8074
8107
|
get pageGutter() {
|
|
8075
|
-
return new
|
|
8108
|
+
return new N({
|
|
8076
8109
|
initialValue: this.preferences.pageGutter,
|
|
8077
8110
|
effectiveValue: this.settings.pageGutter,
|
|
8078
8111
|
isEffective: this.layout !== b.fixed && !this.settings.scroll,
|
|
@@ -8116,7 +8149,7 @@ class Hi {
|
|
|
8116
8149
|
});
|
|
8117
8150
|
}
|
|
8118
8151
|
get scrollPaddingTop() {
|
|
8119
|
-
return new
|
|
8152
|
+
return new N({
|
|
8120
8153
|
initialValue: this.preferences.scrollPaddingTop,
|
|
8121
8154
|
effectiveValue: this.settings.scrollPaddingTop || 0,
|
|
8122
8155
|
isEffective: this.layout !== b.fixed && !!this.settings.scroll && this.preferences.scrollPaddingTop !== null,
|
|
@@ -8126,7 +8159,7 @@ class Hi {
|
|
|
8126
8159
|
});
|
|
8127
8160
|
}
|
|
8128
8161
|
get scrollPaddingBottom() {
|
|
8129
|
-
return new
|
|
8162
|
+
return new N({
|
|
8130
8163
|
initialValue: this.preferences.scrollPaddingBottom,
|
|
8131
8164
|
effectiveValue: this.settings.scrollPaddingBottom || 0,
|
|
8132
8165
|
isEffective: this.layout !== b.fixed && !!this.settings.scroll && this.preferences.scrollPaddingBottom !== null,
|
|
@@ -8136,7 +8169,7 @@ class Hi {
|
|
|
8136
8169
|
});
|
|
8137
8170
|
}
|
|
8138
8171
|
get scrollPaddingLeft() {
|
|
8139
|
-
return new
|
|
8172
|
+
return new N({
|
|
8140
8173
|
initialValue: this.preferences.scrollPaddingLeft,
|
|
8141
8174
|
effectiveValue: this.settings.scrollPaddingLeft || 0,
|
|
8142
8175
|
isEffective: this.layout !== b.fixed && !!this.settings.scroll && this.preferences.scrollPaddingLeft !== null,
|
|
@@ -8146,7 +8179,7 @@ class Hi {
|
|
|
8146
8179
|
});
|
|
8147
8180
|
}
|
|
8148
8181
|
get scrollPaddingRight() {
|
|
8149
|
-
return new
|
|
8182
|
+
return new N({
|
|
8150
8183
|
initialValue: this.preferences.scrollPaddingRight,
|
|
8151
8184
|
effectiveValue: this.settings.scrollPaddingRight || 0,
|
|
8152
8185
|
isEffective: this.layout !== b.fixed && !!this.settings.scroll && this.preferences.scrollPaddingRight !== null,
|
|
@@ -8156,9 +8189,9 @@ class Hi {
|
|
|
8156
8189
|
});
|
|
8157
8190
|
}
|
|
8158
8191
|
get selectionBackgroundColor() {
|
|
8159
|
-
return new
|
|
8192
|
+
return new N({
|
|
8160
8193
|
initialValue: this.preferences.selectionBackgroundColor,
|
|
8161
|
-
effectiveValue: this.settings.selectionBackgroundColor || pt.
|
|
8194
|
+
effectiveValue: this.settings.selectionBackgroundColor || pt.selectionBackgroundColor,
|
|
8162
8195
|
isEffective: this.layout !== b.fixed && this.preferences.selectionBackgroundColor !== null,
|
|
8163
8196
|
onChange: (t) => {
|
|
8164
8197
|
this.updatePreference("selectionBackgroundColor", t ?? null);
|
|
@@ -8166,9 +8199,9 @@ class Hi {
|
|
|
8166
8199
|
});
|
|
8167
8200
|
}
|
|
8168
8201
|
get selectionTextColor() {
|
|
8169
|
-
return new
|
|
8202
|
+
return new N({
|
|
8170
8203
|
initialValue: this.preferences.selectionTextColor,
|
|
8171
|
-
effectiveValue: this.settings.selectionTextColor || pt.
|
|
8204
|
+
effectiveValue: this.settings.selectionTextColor || pt.selectionTextColor,
|
|
8172
8205
|
isEffective: this.layout !== b.fixed && this.preferences.selectionTextColor !== null,
|
|
8173
8206
|
onChange: (t) => {
|
|
8174
8207
|
this.updatePreference("selectionTextColor", t ?? null);
|
|
@@ -8187,9 +8220,9 @@ class Hi {
|
|
|
8187
8220
|
});
|
|
8188
8221
|
}
|
|
8189
8222
|
get textColor() {
|
|
8190
|
-
return new
|
|
8223
|
+
return new N({
|
|
8191
8224
|
initialValue: this.preferences.textColor,
|
|
8192
|
-
effectiveValue: this.settings.textColor || pt.
|
|
8225
|
+
effectiveValue: this.settings.textColor || pt.textColor,
|
|
8193
8226
|
isEffective: this.layout !== b.fixed && this.preferences.textColor !== null,
|
|
8194
8227
|
onChange: (t) => {
|
|
8195
8228
|
this.updatePreference("textColor", t ?? null);
|
|
@@ -8207,9 +8240,9 @@ class Hi {
|
|
|
8207
8240
|
});
|
|
8208
8241
|
}
|
|
8209
8242
|
get visitedColor() {
|
|
8210
|
-
return new
|
|
8243
|
+
return new N({
|
|
8211
8244
|
initialValue: this.preferences.visitedColor,
|
|
8212
|
-
effectiveValue: this.settings.visitedColor || pt.
|
|
8245
|
+
effectiveValue: this.settings.visitedColor || pt.visitedColor,
|
|
8213
8246
|
isEffective: this.layout !== b.fixed && this.preferences.visitedColor !== null,
|
|
8214
8247
|
onChange: (t) => {
|
|
8215
8248
|
this.updatePreference("visitedColor", t ?? null);
|
|
@@ -8238,11 +8271,11 @@ function Lt(r) {
|
|
|
8238
8271
|
const t = getComputedStyle(r), e = parseFloat(t.paddingLeft || "0"), i = parseFloat(t.paddingRight || "0");
|
|
8239
8272
|
return r.clientWidth - e - i;
|
|
8240
8273
|
}
|
|
8241
|
-
function
|
|
8274
|
+
function Jr(r) {
|
|
8242
8275
|
const t = getComputedStyle(r), e = parseFloat(t.paddingTop || "0"), i = parseFloat(t.paddingBottom || "0");
|
|
8243
8276
|
return r.clientHeight - e - i;
|
|
8244
8277
|
}
|
|
8245
|
-
class
|
|
8278
|
+
class _n extends le {
|
|
8246
8279
|
constructor(t) {
|
|
8247
8280
|
super(), this.a11yNormalize = t.a11yNormalize ?? null, this.backgroundColor = t.backgroundColor ?? null, this.blendFilter = t.blendFilter ?? null, this.bodyHyphens = t.bodyHyphens ?? null, this.colCount = t.colCount ?? null, this.darkenFilter = t.darkenFilter ?? null, this.deprecatedFontSize = t.deprecatedFontSize ?? null, this.fontFamily = t.fontFamily ?? null, this.fontOpticalSizing = t.fontOpticalSizing ?? null, this.fontSize = t.fontSize ?? null, this.fontSizeNormalize = t.fontSizeNormalize ?? null, this.fontWeight = t.fontWeight ?? null, this.fontWidth = t.fontWidth ?? null, this.invertFilter = t.invertFilter ?? null, this.invertGaijiFilter = t.invertGaijiFilter ?? null, this.iOSPatch = t.iOSPatch ?? null, this.iPadOSPatch = t.iPadOSPatch ?? null, this.letterSpacing = t.letterSpacing ?? null, this.ligatures = t.ligatures ?? null, this.lineHeight = t.lineHeight ?? null, this.lineLength = t.lineLength ?? null, this.linkColor = t.linkColor ?? null, this.noRuby = t.noRuby ?? null, this.paraIndent = t.paraIndent ?? null, this.paraSpacing = t.paraSpacing ?? null, this.selectionBackgroundColor = t.selectionBackgroundColor ?? null, this.selectionTextColor = t.selectionTextColor ?? null, this.textAlign = t.textAlign ?? null, this.textColor = t.textColor ?? null, this.view = t.view ?? null, this.visitedColor = t.visitedColor ?? null, this.wordSpacing = t.wordSpacing ?? null;
|
|
8248
8281
|
}
|
|
@@ -8251,18 +8284,18 @@ class Cn extends le {
|
|
|
8251
8284
|
return this.a11yNormalize && (t["--USER__a11yNormalize"] = this.toFlag("a11y")), this.backgroundColor && (t["--USER__backgroundColor"] = this.backgroundColor), this.blendFilter && (t["--USER__blendFilter"] = this.toFlag("blend")), this.bodyHyphens && (t["--USER__bodyHyphens"] = this.bodyHyphens), this.colCount && (t["--USER__colCount"] = this.toUnitless(this.colCount)), this.darkenFilter === !0 ? t["--USER__darkenFilter"] = this.toFlag("darken") : typeof this.darkenFilter == "number" && (t["--USER__darkenFilter"] = this.toPercentage(this.darkenFilter)), this.deprecatedFontSize && (t["--USER__fontSizeImplementation"] = this.toFlag("deprecatedFontSize")), this.fontFamily && (t["--USER__fontFamily"] = this.fontFamily), this.fontOpticalSizing != null && (t["--USER__fontOpticalSizing"] = this.fontOpticalSizing), this.fontSize != null && (t["--USER__fontSize"] = this.toPercentage(this.fontSize, !0)), this.fontSizeNormalize && (t["--USER__fontSizeNormalize"] = this.toFlag("normalize")), this.fontWeight != null && (t["--USER__fontWeight"] = this.toUnitless(this.fontWeight)), this.fontWidth != null && (t["--USER__fontWidth"] = typeof this.fontWidth == "string" ? this.fontWidth : this.toUnitless(this.fontWidth)), this.invertFilter === !0 ? t["--USER__invertFilter"] = this.toFlag("invert") : typeof this.invertFilter == "number" && (t["--USER__invertFilter"] = this.toPercentage(this.invertFilter)), this.invertGaijiFilter === !0 ? t["--USER__invertGaiji"] = this.toFlag("invertGaiji") : typeof this.invertGaijiFilter == "number" && (t["--USER__invertGaiji"] = this.toPercentage(this.invertGaijiFilter)), this.iOSPatch && (t["--USER__iOSPatch"] = this.toFlag("iOSPatch")), this.iPadOSPatch && (t["--USER__iPadOSPatch"] = this.toFlag("iPadOSPatch")), this.letterSpacing != null && (t["--USER__letterSpacing"] = this.toRem(this.letterSpacing)), this.ligatures && (t["--USER__ligatures"] = this.ligatures), this.lineHeight != null && (t["--USER__lineHeight"] = this.toUnitless(this.lineHeight)), this.lineLength != null && (t["--USER__lineLength"] = this.toPx(this.lineLength)), this.linkColor && (t["--USER__linkColor"] = this.linkColor), this.noRuby && (t["--USER__noRuby"] = this.toFlag("noRuby")), this.paraIndent != null && (t["--USER__paraIndent"] = this.toRem(this.paraIndent)), this.paraSpacing != null && (t["--USER__paraSpacing"] = this.toRem(this.paraSpacing)), this.selectionBackgroundColor && (t["--USER__selectionBackgroundColor"] = this.selectionBackgroundColor), this.selectionTextColor && (t["--USER__selectionTextColor"] = this.selectionTextColor), this.textAlign && (t["--USER__textAlign"] = this.textAlign), this.textColor && (t["--USER__textColor"] = this.textColor), this.view && (t["--USER__view"] = this.toFlag(this.view)), this.visitedColor && (t["--USER__visitedColor"] = this.visitedColor), this.wordSpacing != null && (t["--USER__wordSpacing"] = this.toRem(this.wordSpacing)), t;
|
|
8252
8285
|
}
|
|
8253
8286
|
}
|
|
8254
|
-
class
|
|
8287
|
+
class Zr extends le {
|
|
8255
8288
|
constructor(t) {
|
|
8256
8289
|
super(), this.backgroundColor = t.backgroundColor ?? null, this.baseFontFamily = t.baseFontFamily ?? null, this.baseFontSize = t.baseFontSize ?? null, this.baseLineHeight = t.baseLineHeight ?? null, this.boxSizingMedia = t.boxSizingMedia ?? null, this.boxSizingTable = t.boxSizingTable ?? null, this.colWidth = t.colWidth ?? null, this.colCount = t.colCount ?? null, this.colGap = t.colGap ?? null, this.codeFontFamily = t.codeFontFamily ?? null, this.compFontFamily = t.compFontFamily ?? null, this.defaultLineLength = t.defaultLineLength ?? null, this.flowSpacing = t.flowSpacing ?? null, this.humanistTf = t.humanistTf ?? null, this.linkColor = t.linkColor ?? null, this.maxMediaWidth = t.maxMediaWidth ?? null, this.maxMediaHeight = t.maxMediaHeight ?? null, this.modernTf = t.modernTf ?? null, this.monospaceTf = t.monospaceTf ?? null, this.noOverflow = t.noOverflow ?? null, this.noVerticalPagination = t.noVerticalPagination ?? null, this.oldStyleTf = t.oldStyleTf ?? null, this.pageGutter = t.pageGutter ?? null, this.paraIndent = t.paraIndent ?? null, this.paraSpacing = t.paraSpacing ?? null, this.primaryColor = t.primaryColor ?? null, this.scrollPaddingBottom = t.scrollPaddingBottom ?? null, this.scrollPaddingLeft = t.scrollPaddingLeft ?? null, this.scrollPaddingRight = t.scrollPaddingRight ?? null, this.scrollPaddingTop = t.scrollPaddingTop ?? null, this.sansSerifJa = t.sansSerifJa ?? null, this.sansSerifJaV = t.sansSerifJaV ?? null, this.sansTf = t.sansTf ?? null, this.secondaryColor = t.secondaryColor ?? null, this.selectionBackgroundColor = t.selectionBackgroundColor ?? null, this.selectionTextColor = t.selectionTextColor ?? null, this.serifJa = t.serifJa ?? null, this.serifJaV = t.serifJaV ?? null, this.textColor = t.textColor ?? null, this.typeScale = t.typeScale ?? null, this.visitedColor = t.visitedColor ?? null, this.experiments = t.experiments ?? null;
|
|
8257
8290
|
}
|
|
8258
8291
|
toCSSProperties() {
|
|
8259
8292
|
const t = {};
|
|
8260
8293
|
return this.backgroundColor && (t["--RS__backgroundColor"] = this.backgroundColor), this.baseFontFamily && (t["--RS__baseFontFamily"] = this.baseFontFamily), this.baseFontSize != null && (t["--RS__baseFontSize"] = this.toRem(this.baseFontSize)), this.baseLineHeight != null && (t["--RS__baseLineHeight"] = this.toUnitless(this.baseLineHeight)), this.boxSizingMedia && (t["--RS__boxSizingMedia"] = this.boxSizingMedia), this.boxSizingTable && (t["--RS__boxSizingTable"] = this.boxSizingTable), this.colWidth != null && (t["--RS__colWidth"] = this.colWidth), this.colCount != null && (t["--RS__colCount"] = this.toUnitless(this.colCount)), this.colGap != null && (t["--RS__colGap"] = this.toPx(this.colGap)), this.codeFontFamily && (t["--RS__codeFontFamily"] = this.codeFontFamily), this.compFontFamily && (t["--RS__compFontFamily"] = this.compFontFamily), this.defaultLineLength != null && (t["--RS__defaultLineLength"] = this.toPx(this.defaultLineLength)), this.flowSpacing != null && (t["--RS__flowSpacing"] = this.toRem(this.flowSpacing)), this.humanistTf && (t["--RS__humanistTf"] = this.humanistTf), this.linkColor && (t["--RS__linkColor"] = this.linkColor), this.maxMediaWidth && (t["--RS__maxMediaWidth"] = this.toVw(this.maxMediaWidth)), this.maxMediaHeight && (t["--RS__maxMediaHeight"] = this.toVh(this.maxMediaHeight)), this.modernTf && (t["--RS__modernTf"] = this.modernTf), this.monospaceTf && (t["--RS__monospaceTf"] = this.monospaceTf), this.noOverflow && (t["--RS__disableOverflow"] = this.toFlag("noOverflow")), this.noVerticalPagination && (t["--RS__disablePagination"] = this.toFlag("noVerticalPagination")), this.oldStyleTf && (t["--RS__oldStyleTf"] = this.oldStyleTf), this.pageGutter != null && (t["--RS__pageGutter"] = this.toPx(this.pageGutter)), this.paraIndent != null && (t["--RS__paraIndent"] = this.toRem(this.paraIndent)), this.paraSpacing != null && (t["--RS__paraSpacing"] = this.toRem(this.paraSpacing)), this.primaryColor && (t["--RS__primaryColor"] = this.primaryColor), this.sansSerifJa && (t["--RS__sans-serif-ja"] = this.sansSerifJa), this.sansSerifJaV && (t["--RS__sans-serif-ja-v"] = this.sansSerifJaV), this.sansTf && (t["--RS__sansTf"] = this.sansTf), this.scrollPaddingBottom != null && (t["--RS__scrollPaddingBottom"] = this.toPx(this.scrollPaddingBottom)), this.scrollPaddingLeft != null && (t["--RS__scrollPaddingLeft"] = this.toPx(this.scrollPaddingLeft)), this.scrollPaddingRight != null && (t["--RS__scrollPaddingRight"] = this.toPx(this.scrollPaddingRight)), this.scrollPaddingTop != null && (t["--RS__scrollPaddingTop"] = this.toPx(this.scrollPaddingTop)), this.secondaryColor && (t["--RS__secondaryColor"] = this.secondaryColor), this.selectionBackgroundColor && (t["--RS__selectionBackgroundColor"] = this.selectionBackgroundColor), this.selectionTextColor && (t["--RS__selectionTextColor"] = this.selectionTextColor), this.serifJa && (t["--RS__serif-ja"] = this.serifJa), this.serifJaV && (t["--RS__serif-ja-v"] = this.serifJaV), this.textColor && (t["--RS__textColor"] = this.textColor), this.typeScale && (t["--RS__typeScale"] = this.toUnitless(this.typeScale)), this.visitedColor && (t["--RS__visitedColor"] = this.visitedColor), this.experiments && this.experiments.forEach((e) => {
|
|
8261
|
-
t["--RS__" + e] =
|
|
8294
|
+
t["--RS__" + e] = Ge[e].value;
|
|
8262
8295
|
}), t;
|
|
8263
8296
|
}
|
|
8264
8297
|
}
|
|
8265
|
-
class
|
|
8298
|
+
class Qr {
|
|
8266
8299
|
constructor(t) {
|
|
8267
8300
|
this.rsProperties = t.rsProperties, this.userProperties = t.userProperties, this.lineLengths = t.lineLengths, this.container = t.container, this.containerParent = t.container.parentElement || document.documentElement, this.constraint = t.constraint, this.isCJKVertical = t.isCJKVertical ?? !1, this.cachedColCount = t.userProperties.colCount, this.effectiveContainerWidth = Lt(this.containerParent);
|
|
8268
8301
|
}
|
|
@@ -8312,7 +8345,7 @@ class Lr {
|
|
|
8312
8345
|
visitedColor: t.visitedColor,
|
|
8313
8346
|
wordSpacing: t.wordSpacing
|
|
8314
8347
|
};
|
|
8315
|
-
this.userProperties = new
|
|
8348
|
+
this.userProperties = new _n(i);
|
|
8316
8349
|
}
|
|
8317
8350
|
updateLayout(t, e, i, n) {
|
|
8318
8351
|
return this.isCJKVertical ? this.computeCJKVerticalLength(t, e) : i ?? this.userProperties.view === "scroll" ? this.computeScrollLength(t, e) : this.paginate(t, e, n);
|
|
@@ -8376,7 +8409,7 @@ class Lr {
|
|
|
8376
8409
|
};
|
|
8377
8410
|
}
|
|
8378
8411
|
computeCJKVerticalLength(t, e) {
|
|
8379
|
-
const i = Math.round(Lt(this.containerParent) - this.constraint), n = Math.round(
|
|
8412
|
+
const i = Math.round(Lt(this.containerParent) - this.constraint), n = Math.round(Jr(this.containerParent)), s = this.getCompensatedMetrics(t, e), o = s.maximal !== null ? Math.min(Math.round(s.maximal * s.zoomCompensation), n) : n;
|
|
8380
8413
|
return { colCount: void 0, effectiveContainerWidth: i, effectiveLineLength: o };
|
|
8381
8414
|
}
|
|
8382
8415
|
// This behaves as paginate where colCount = 1
|
|
@@ -8403,7 +8436,7 @@ class Lr {
|
|
|
8403
8436
|
this.userProperties.colCount = t.colCount, this.userProperties.lineLength = t.effectiveLineLength, this.effectiveContainerWidth = t.effectiveContainerWidth, this.container.style.width = `${this.effectiveContainerWidth}px`;
|
|
8404
8437
|
}
|
|
8405
8438
|
}
|
|
8406
|
-
const
|
|
8439
|
+
const to = `// Note: we aren't blocking some of the events right now to try and be as nonintrusive as possible.
|
|
8407
8440
|
// For a more comprehensive implementation, see https://github.com/hackademix/noscript/blob/3a83c0e4a506f175e38b0342dad50cdca3eae836/src/content/syncFetchPolicy.js#L142
|
|
8408
8441
|
// The snippet of code at the beginning of this source is an attempt at defence against JS using persistent storage
|
|
8409
8442
|
(function() {
|
|
@@ -8469,21 +8502,21 @@ const xr = `// Note: we aren't blocking some of the events right now to try and
|
|
|
8469
8502
|
window.addEventListener("load", window._readium_eventBlocker, true);
|
|
8470
8503
|
})();
|
|
8471
8504
|
`;
|
|
8472
|
-
async function
|
|
8505
|
+
async function eo(r, t) {
|
|
8473
8506
|
const e = r.effectiveLayout === b.fixed, i = t.filter((a) => a.mediaType.isHTML).map((a) => a.href), n = i.length > 0 ? i : [/\.xhtml$/, /\.html$/], s = [
|
|
8474
8507
|
// CSS Selector Generator - always injected
|
|
8475
8508
|
{
|
|
8476
8509
|
id: "css-selector-generator",
|
|
8477
8510
|
as: "script",
|
|
8478
8511
|
target: "head",
|
|
8479
|
-
blob: new Blob([
|
|
8512
|
+
blob: new Blob([St(vn)], { type: "text/javascript" })
|
|
8480
8513
|
},
|
|
8481
8514
|
// Execution Prevention - conditional (has executable scripts)
|
|
8482
8515
|
{
|
|
8483
8516
|
id: "execution-prevention",
|
|
8484
8517
|
as: "script",
|
|
8485
8518
|
target: "head",
|
|
8486
|
-
blob: new Blob([
|
|
8519
|
+
blob: new Blob([St(to)], { type: "text/javascript" }),
|
|
8487
8520
|
condition: (a) => !!(a.querySelector("script") || a.querySelector("body[onload]:not(body[onload=''])"))
|
|
8488
8521
|
}
|
|
8489
8522
|
], o = [
|
|
@@ -8492,7 +8525,7 @@ async function kr(r, t) {
|
|
|
8492
8525
|
id: "onload-proxy",
|
|
8493
8526
|
as: "script",
|
|
8494
8527
|
target: "head",
|
|
8495
|
-
blob: new Blob([
|
|
8528
|
+
blob: new Blob([St(Pn)], { type: "text/javascript" }),
|
|
8496
8529
|
condition: (a) => !!(a.querySelector("script") || a.querySelector("body[onload]:not(body[onload=''])"))
|
|
8497
8530
|
}
|
|
8498
8531
|
];
|
|
@@ -8502,18 +8535,18 @@ async function kr(r, t) {
|
|
|
8502
8535
|
switch (a) {
|
|
8503
8536
|
case "rtl": {
|
|
8504
8537
|
const [u, p, g] = await Promise.all([
|
|
8505
|
-
import("./ReadiumCSS-before-
|
|
8506
|
-
import("./ReadiumCSS-default-
|
|
8507
|
-
import("./ReadiumCSS-after-
|
|
8538
|
+
import("./ReadiumCSS-before-CvMFpmud.js"),
|
|
8539
|
+
import("./ReadiumCSS-default-CL_hP__L.js"),
|
|
8540
|
+
import("./ReadiumCSS-after-Dzd22Ssm.js")
|
|
8508
8541
|
]);
|
|
8509
8542
|
l = u.default, h = p.default, c = g.default;
|
|
8510
8543
|
break;
|
|
8511
8544
|
}
|
|
8512
8545
|
case "cjk-horizontal": {
|
|
8513
8546
|
const [u, p, g] = await Promise.all([
|
|
8514
|
-
import("./ReadiumCSS-before-
|
|
8515
|
-
import("./ReadiumCSS-default-
|
|
8516
|
-
import("./ReadiumCSS-after-
|
|
8547
|
+
import("./ReadiumCSS-before-6kD9Qj82.js"),
|
|
8548
|
+
import("./ReadiumCSS-default-nJgSC4Z_.js"),
|
|
8549
|
+
import("./ReadiumCSS-after-C8SjJ_Rf.js")
|
|
8517
8550
|
]);
|
|
8518
8551
|
l = u.default, h = p.default, c = g.default;
|
|
8519
8552
|
break;
|
|
@@ -8524,18 +8557,18 @@ async function kr(r, t) {
|
|
|
8524
8557
|
// same stylesheet set per the Readium CSS spec.
|
|
8525
8558
|
case "mongolian-vertical": {
|
|
8526
8559
|
const [u, p, g] = await Promise.all([
|
|
8527
|
-
import("./ReadiumCSS-before-
|
|
8528
|
-
import("./ReadiumCSS-default-
|
|
8529
|
-
import("./ReadiumCSS-after-
|
|
8560
|
+
import("./ReadiumCSS-before-usMdEglk.js"),
|
|
8561
|
+
import("./ReadiumCSS-default-BVp3Ygi2.js"),
|
|
8562
|
+
import("./ReadiumCSS-after-BYNAMW5u.js")
|
|
8530
8563
|
]);
|
|
8531
8564
|
l = u.default, h = p.default, c = g.default;
|
|
8532
8565
|
break;
|
|
8533
8566
|
}
|
|
8534
8567
|
default: {
|
|
8535
8568
|
const [u, p, g] = await Promise.all([
|
|
8536
|
-
import("./ReadiumCSS-before-
|
|
8537
|
-
import("./ReadiumCSS-default-
|
|
8538
|
-
import("./ReadiumCSS-after-
|
|
8569
|
+
import("./ReadiumCSS-before-crwPhKrV.js"),
|
|
8570
|
+
import("./ReadiumCSS-default-vv7hNCaM.js"),
|
|
8571
|
+
import("./ReadiumCSS-after-b-ykC0_O.js")
|
|
8539
8572
|
]);
|
|
8540
8573
|
l = u.default, h = p.default, c = g.default;
|
|
8541
8574
|
break;
|
|
@@ -8545,7 +8578,7 @@ async function kr(r, t) {
|
|
|
8545
8578
|
id: "readium-css-before",
|
|
8546
8579
|
as: "link",
|
|
8547
8580
|
target: "head",
|
|
8548
|
-
blob: new Blob([
|
|
8581
|
+
blob: new Blob([_t(l)], { type: "text/css" }),
|
|
8549
8582
|
rel: "stylesheet"
|
|
8550
8583
|
}), o.unshift(
|
|
8551
8584
|
// Readium CSS Default - only for reflowable AND no existing styles
|
|
@@ -8553,7 +8586,7 @@ async function kr(r, t) {
|
|
|
8553
8586
|
id: "readium-css-default",
|
|
8554
8587
|
as: "link",
|
|
8555
8588
|
target: "head",
|
|
8556
|
-
blob: new Blob([
|
|
8589
|
+
blob: new Blob([_t(h)], { type: "text/css" }),
|
|
8557
8590
|
rel: "stylesheet",
|
|
8558
8591
|
condition: (u) => !(u.querySelector("link[rel='stylesheet']") || u.querySelector("style") || u.querySelector("[style]:not([style=''])"))
|
|
8559
8592
|
},
|
|
@@ -8562,7 +8595,7 @@ async function kr(r, t) {
|
|
|
8562
8595
|
id: "readium-css-after",
|
|
8563
8596
|
as: "link",
|
|
8564
8597
|
target: "head",
|
|
8565
|
-
blob: new Blob([
|
|
8598
|
+
blob: new Blob([_t(c)], { type: "text/css" }),
|
|
8566
8599
|
rel: "stylesheet"
|
|
8567
8600
|
}
|
|
8568
8601
|
), (a === "cjk-horizontal" || a === "cjk-vertical") && (r.description === "ebpaj-guide-1.0" || r.otherMetadata?.["ebpaj:guide-version"] !== void 0)) {
|
|
@@ -8571,7 +8604,7 @@ async function kr(r, t) {
|
|
|
8571
8604
|
id: "readium-css-ebpaj",
|
|
8572
8605
|
as: "link",
|
|
8573
8606
|
target: "head",
|
|
8574
|
-
blob: new Blob([
|
|
8607
|
+
blob: new Blob([_t(p)], { type: "text/css" }),
|
|
8575
8608
|
rel: "stylesheet"
|
|
8576
8609
|
});
|
|
8577
8610
|
}
|
|
@@ -8584,7 +8617,7 @@ async function kr(r, t) {
|
|
|
8584
8617
|
}
|
|
8585
8618
|
];
|
|
8586
8619
|
}
|
|
8587
|
-
const
|
|
8620
|
+
const io = (r) => ({
|
|
8588
8621
|
frameLoaded: r.frameLoaded || (() => {
|
|
8589
8622
|
}),
|
|
8590
8623
|
positionChanged: r.positionChanged || (() => {
|
|
@@ -8615,11 +8648,11 @@ class Ln extends dn {
|
|
|
8615
8648
|
readingOrder: [],
|
|
8616
8649
|
progressions: /* @__PURE__ */ new Map(),
|
|
8617
8650
|
positions: null
|
|
8618
|
-
}, this.pub = e, this.container = t, this.listeners =
|
|
8651
|
+
}, this.pub = e, this.container = t, this.listeners = io(i), this.currentLocation = s, n.length && (this.positions = n), this._preferences = new Ft(o.preferences), this._defaults = new jr(o.defaults), this._settings = new Vi(this._preferences, this._defaults);
|
|
8619
8652
|
const a = bt(e.metadata), l = a === "cjk-horizontal", h = a === "cjk-vertical", u = h || a === "mongolian-vertical", p = l || h;
|
|
8620
|
-
this._css = new
|
|
8621
|
-
rsProperties: new
|
|
8622
|
-
userProperties: new
|
|
8653
|
+
this._css = new Qr({
|
|
8654
|
+
rsProperties: new Zr({ noVerticalPagination: u || void 0 }),
|
|
8655
|
+
userProperties: new _n({}),
|
|
8623
8656
|
lineLengths: new kt({
|
|
8624
8657
|
optimalChars: this._settings.optimalLineLength,
|
|
8625
8658
|
minChars: this._settings.minimalLineLength,
|
|
@@ -8634,7 +8667,7 @@ class Ln extends dn {
|
|
|
8634
8667
|
container: t,
|
|
8635
8668
|
constraint: this._settings.constraint,
|
|
8636
8669
|
isCJKVertical: u
|
|
8637
|
-
}), this._layout = Ln.determineLayout(e, !!this._settings.scroll), this.currentProgression = e.metadata.effectiveReadingProgression, this._injectablesConfig = o.injectables || { rules: [], allowedDomains: [] }, this._readiumRulesPromise =
|
|
8670
|
+
}), this._layout = Ln.determineLayout(e, !!this._settings.scroll), this.currentProgression = e.metadata.effectiveReadingProgression, this._injectablesConfig = o.injectables || { rules: [], allowedDomains: [] }, this._readiumRulesPromise = eo(e.metadata, e.readingOrder.items), this._contentProtection = o.contentProtection || {}, this._keyboardPeripherals = this.mergeKeyboardPeripherals(
|
|
8638
8671
|
this._contentProtection,
|
|
8639
8672
|
o.keyboardPeripherals || []
|
|
8640
8673
|
), (this._contentProtection.disableContextMenu || this._contentProtection.checkAutomation || this._contentProtection.checkIFrameEmbedding || this._contentProtection.monitorDevTools || this._contentProtection.protectPrinting?.disable) && (this._navigatorProtector = new Ye(this._contentProtection), this._suspiciousActivityListener = (g) => {
|
|
@@ -8659,13 +8692,13 @@ class Ln extends dn {
|
|
|
8659
8692
|
async load() {
|
|
8660
8693
|
if (this.positions?.length || (this.positions = await this.pub.positionsFromManifest()), !this._injector) {
|
|
8661
8694
|
const t = await this._readiumRulesPromise;
|
|
8662
|
-
this._injector = new
|
|
8695
|
+
this._injector = new Sn({
|
|
8663
8696
|
rules: [...t, ...this._injectablesConfig.rules],
|
|
8664
8697
|
allowedDomains: this._injectablesConfig.allowedDomains
|
|
8665
8698
|
});
|
|
8666
8699
|
}
|
|
8667
8700
|
if (this._layout === b.fixed)
|
|
8668
|
-
this.framePool = new
|
|
8701
|
+
this.framePool = new Vr(
|
|
8669
8702
|
this.container,
|
|
8670
8703
|
this.positions,
|
|
8671
8704
|
this.pub,
|
|
@@ -8678,7 +8711,7 @@ class Ln extends dn {
|
|
|
8678
8711
|
else {
|
|
8679
8712
|
await this.updateCSS(!1);
|
|
8680
8713
|
const t = this.compileCSSProperties(this._css);
|
|
8681
|
-
this.framePool = new
|
|
8714
|
+
this.framePool = new Rr(
|
|
8682
8715
|
this.container,
|
|
8683
8716
|
this.positions,
|
|
8684
8717
|
t,
|
|
@@ -8698,14 +8731,14 @@ class Ln extends dn {
|
|
|
8698
8731
|
}
|
|
8699
8732
|
}
|
|
8700
8733
|
get preferencesEditor() {
|
|
8701
|
-
return this._preferencesEditor === null && (this._preferencesEditor = new
|
|
8734
|
+
return this._preferencesEditor === null && (this._preferencesEditor = new Bi(this._preferences, this.settings, this.pub.metadata)), this._preferencesEditor;
|
|
8702
8735
|
}
|
|
8703
8736
|
async submitPreferences(t) {
|
|
8704
8737
|
this._preferences = this._preferences.merging(t), await this.applyPreferences();
|
|
8705
8738
|
}
|
|
8706
8739
|
async applyPreferences() {
|
|
8707
8740
|
const t = this._settings;
|
|
8708
|
-
this._settings = new Vi(this._preferences, this._defaults), this._preferencesEditor !== null && (this._preferencesEditor = new
|
|
8741
|
+
this._settings = new Vi(this._preferences, this._defaults), this._preferencesEditor !== null && (this._preferencesEditor = new Bi(this._preferences, this.settings, this.pub.metadata)), this._layout === b.fixed ? this.handleFXLPrefs(t, this._settings) : await this.updateCSS(!0);
|
|
8709
8742
|
}
|
|
8710
8743
|
// TODO: fit, etc.
|
|
8711
8744
|
handleFXLPrefs(t, e) {
|
|
@@ -8748,7 +8781,7 @@ class Ln extends dn {
|
|
|
8748
8781
|
* TODO remove when settings management is incorporated
|
|
8749
8782
|
*/
|
|
8750
8783
|
get _cframes() {
|
|
8751
|
-
return (this.framePool?.currentFrames ?? []).filter((t) => !(t instanceof
|
|
8784
|
+
return (this.framePool?.currentFrames ?? []).filter((t) => !(t instanceof Cn && t.isDestroyed));
|
|
8752
8785
|
}
|
|
8753
8786
|
/**
|
|
8754
8787
|
* Exposed to the public to compensate for lack of implemented readium conveniences
|
|
@@ -8803,7 +8836,7 @@ class Ln extends dn {
|
|
|
8803
8836
|
else
|
|
8804
8837
|
try {
|
|
8805
8838
|
this.goLink(new $({
|
|
8806
|
-
href:
|
|
8839
|
+
href: Xt.join(Xt.dirname(this.currentLocation.href), h)
|
|
8807
8840
|
}), !1, () => {
|
|
8808
8841
|
});
|
|
8809
8842
|
} catch (c) {
|
|
@@ -8813,9 +8846,9 @@ class Ln extends dn {
|
|
|
8813
8846
|
}
|
|
8814
8847
|
} else console.log("Clicked on", l);
|
|
8815
8848
|
} else {
|
|
8816
|
-
if (this._layout === b.fixed && this.framePool.doNotDisturb && (n.doNotDisturb = !0), this._layout === b.fixed && (this.currentProgression ===
|
|
8849
|
+
if (this._layout === b.fixed && this.framePool.doNotDisturb && (n.doNotDisturb = !0), this._layout === b.fixed && (this.currentProgression === M.rtl || this.currentProgression === M.ltr) && this.framePool.currentFrames.length > 1) {
|
|
8817
8850
|
const c = this.framePool.currentFrames;
|
|
8818
|
-
n.targetFrameSrc === c[this.currentProgression ===
|
|
8851
|
+
n.targetFrameSrc === c[this.currentProgression === M.rtl ? 0 : 1]?.source && (n.x += (c[this.currentProgression === M.rtl ? 1 : 0]?.iframe.contentWindow?.innerWidth ?? 0) * window.devicePixelRatio);
|
|
8819
8852
|
}
|
|
8820
8853
|
if (t === "click" ? this.listeners.click(n) : this.listeners.tap(n)) break;
|
|
8821
8854
|
const h = (this._cframes.length === 2 ? this._cframes[0].window.innerWidth + this._cframes[1].window.innerWidth : this._cframes[0].window.innerWidth) * window.devicePixelRatio / 4;
|
|
@@ -9068,7 +9101,7 @@ class Ln extends dn {
|
|
|
9068
9101
|
return this.go(t.locator, e, i);
|
|
9069
9102
|
}
|
|
9070
9103
|
}
|
|
9071
|
-
const
|
|
9104
|
+
const no = `// PreservePitchProcessor.js
|
|
9072
9105
|
// AudioWorklet processor for pitch preservation via pitch shifting.
|
|
9073
9106
|
//
|
|
9074
9107
|
// Architecture:
|
|
@@ -9293,7 +9326,7 @@ class Ke {
|
|
|
9293
9326
|
if (n)
|
|
9294
9327
|
await e.audioWorklet.addModule(n);
|
|
9295
9328
|
else {
|
|
9296
|
-
const o = new Blob([
|
|
9329
|
+
const o = new Blob([no], { type: "text/javascript" });
|
|
9297
9330
|
s.url = URL.createObjectURL(o), await e.audioWorklet.addModule(s.url);
|
|
9298
9331
|
}
|
|
9299
9332
|
} catch (o) {
|
|
@@ -9313,7 +9346,7 @@ class Ke {
|
|
|
9313
9346
|
this.workletNode && (this.workletNode.disconnect(), this.workletNode = null), this.url && (URL.revokeObjectURL(this.url), this.url = null);
|
|
9314
9347
|
}
|
|
9315
9348
|
}
|
|
9316
|
-
class
|
|
9349
|
+
class so {
|
|
9317
9350
|
constructor(t) {
|
|
9318
9351
|
this.audioContext = null, this.sourceNode = null, this.gainNode = null, this.listeners = {}, this.isMutedValue = !1, this.isPlayingValue = !1, this.isPausedValue = !1, this.isLoadingValue = !1, this.isLoadedValue = !1, this.isEndedValue = !1, this.isStoppedValue = !1, this.worklet = null, this.webAudioActive = !1, this.boundOnCanPlayThrough = this.onCanPlayThrough.bind(this), this.boundOnTimeUpdate = this.onTimeUpdate.bind(this), this.boundOnError = this.onError.bind(this), this.boundOnEnded = this.onEnded.bind(this), this.boundOnStalled = this.onStalled.bind(this), this.boundOnEmptied = this.onEmptied.bind(this), this.boundOnSuspend = this.onSuspend.bind(this), this.boundOnWaiting = this.onWaiting.bind(this), this.boundOnLoadedMetadata = this.onLoadedMetadata.bind(this), this.boundOnSeeking = this.onSeeking.bind(this), this.boundOnSeeked = this.onSeeked.bind(this), this.boundOnPlay = this.onPlay.bind(this), this.boundOnPlaying = this.onPlaying.bind(this), this.boundOnPause = this.onPause.bind(this), this.boundOnProgress = this.onProgress.bind(this), this.playback = t.playback, this.mediaElement = document.createElement("audio"), this.mediaElement.addEventListener("canplaythrough", this.boundOnCanPlayThrough), this.mediaElement.addEventListener("timeupdate", this.boundOnTimeUpdate), this.mediaElement.addEventListener("error", this.boundOnError), this.mediaElement.addEventListener("ended", this.boundOnEnded), this.mediaElement.addEventListener("stalled", this.boundOnStalled), this.mediaElement.addEventListener("emptied", this.boundOnEmptied), this.mediaElement.addEventListener("suspend", this.boundOnSuspend), this.mediaElement.addEventListener("waiting", this.boundOnWaiting), this.mediaElement.addEventListener("loadedmetadata", this.boundOnLoadedMetadata), this.mediaElement.addEventListener("seeking", this.boundOnSeeking), this.mediaElement.addEventListener("seeked", this.boundOnSeeked), this.mediaElement.addEventListener("play", this.boundOnPlay), this.mediaElement.addEventListener("playing", this.boundOnPlaying), this.mediaElement.addEventListener("pause", this.boundOnPause), this.mediaElement.addEventListener("progress", this.boundOnProgress), this.mediaElement.currentTime = this.playback.state.currentTime;
|
|
9319
9352
|
}
|
|
@@ -9581,7 +9614,7 @@ class Ar {
|
|
|
9581
9614
|
}
|
|
9582
9615
|
class ce {
|
|
9583
9616
|
constructor(t = {}) {
|
|
9584
|
-
this.volume =
|
|
9617
|
+
this.volume = F(t.volume, ie.range), this.playbackRate = F(t.playbackRate, ne.range), this.preservePitch = E(t.preservePitch), this.skipBackwardInterval = F(t.skipBackwardInterval, it.range), this.skipForwardInterval = F(t.skipForwardInterval, it.range), this.pollInterval = S(t.pollInterval), this.autoPlay = E(t.autoPlay), this.enableMediaSession = E(t.enableMediaSession);
|
|
9585
9618
|
}
|
|
9586
9619
|
merging(t) {
|
|
9587
9620
|
const e = { ...this };
|
|
@@ -9590,9 +9623,9 @@ class ce {
|
|
|
9590
9623
|
return new ce(e);
|
|
9591
9624
|
}
|
|
9592
9625
|
}
|
|
9593
|
-
class
|
|
9626
|
+
class ro {
|
|
9594
9627
|
constructor(t = {}) {
|
|
9595
|
-
this.volume =
|
|
9628
|
+
this.volume = F(t.volume, ie.range) ?? 1, this.playbackRate = F(t.playbackRate, ne.range) ?? 1, this.preservePitch = E(t.preservePitch) ?? !0, this.skipBackwardInterval = F(t.skipBackwardInterval, it.range) ?? 10, this.skipForwardInterval = F(t.skipForwardInterval, it.range) ?? 10, this.pollInterval = S(t.pollInterval) ?? 1e3, this.autoPlay = E(t.autoPlay) ?? !0, this.enableMediaSession = E(t.enableMediaSession) ?? !0;
|
|
9596
9629
|
}
|
|
9597
9630
|
}
|
|
9598
9631
|
class ji {
|
|
@@ -9669,7 +9702,7 @@ class $i {
|
|
|
9669
9702
|
});
|
|
9670
9703
|
}
|
|
9671
9704
|
get pollInterval() {
|
|
9672
|
-
return new
|
|
9705
|
+
return new N({
|
|
9673
9706
|
initialValue: this.preferences.pollInterval,
|
|
9674
9707
|
effectiveValue: this.settings.pollInterval,
|
|
9675
9708
|
isEffective: this.preferences.pollInterval !== null,
|
|
@@ -9699,8 +9732,8 @@ class $i {
|
|
|
9699
9732
|
});
|
|
9700
9733
|
}
|
|
9701
9734
|
}
|
|
9702
|
-
const
|
|
9703
|
-
class
|
|
9735
|
+
const Gi = 1, Xi = 1;
|
|
9736
|
+
class oo {
|
|
9704
9737
|
constructor(t, e, i = {}) {
|
|
9705
9738
|
this.pool = /* @__PURE__ */ new Map(), this._audioEngine = t, this._publication = e, this._supportedAudioTypes = this.detectSupportedAudioTypes(), i.disableRemotePlayback && (this._audioEngine.getMediaElement().disableRemotePlayback = !0);
|
|
9706
9739
|
}
|
|
@@ -9752,7 +9785,7 @@ class Mr {
|
|
|
9752
9785
|
for (let n = 0; n < e.length; n++) {
|
|
9753
9786
|
if (n === t) continue;
|
|
9754
9787
|
const s = this.pickPlayableHref(e[n]);
|
|
9755
|
-
n >= t -
|
|
9788
|
+
n >= t - Xi && n <= t + Xi ? (this.ensure(s), i.add(s)) : n >= t - Gi && n <= t + Gi && this.pool.has(s) && i.add(s);
|
|
9756
9789
|
}
|
|
9757
9790
|
for (const [n, s] of this.pool)
|
|
9758
9791
|
i.has(n) || (s.removeAttribute("src"), s.load(), this.pool.delete(n));
|
|
@@ -9777,7 +9810,7 @@ class Mr {
|
|
|
9777
9810
|
this.pool.clear();
|
|
9778
9811
|
}
|
|
9779
9812
|
}
|
|
9780
|
-
class
|
|
9813
|
+
class ao {
|
|
9781
9814
|
constructor(t = {}) {
|
|
9782
9815
|
this.dragstartHandler = (e) => {
|
|
9783
9816
|
e.preventDefault(), e.stopPropagation(), t.onDragDetected?.(Array.from(e.dataTransfer?.types ?? []));
|
|
@@ -9793,7 +9826,7 @@ class Nr {
|
|
|
9793
9826
|
document.removeEventListener("dragstart", this.dragstartHandler, !0), document.removeEventListener("dragover", this.dragoverHandler, !0), document.removeEventListener("drop", this.dropHandler, !0), window.removeEventListener("unload", this.unloadHandler);
|
|
9794
9827
|
}
|
|
9795
9828
|
}
|
|
9796
|
-
class
|
|
9829
|
+
class lo {
|
|
9797
9830
|
constructor(t = {}) {
|
|
9798
9831
|
this.copyHandler = (e) => {
|
|
9799
9832
|
e.preventDefault(), e.stopPropagation(), t.onCopyBlocked?.();
|
|
@@ -9803,16 +9836,16 @@ class zr {
|
|
|
9803
9836
|
document.removeEventListener("copy", this.copyHandler, !0), window.removeEventListener("unload", this.unloadHandler);
|
|
9804
9837
|
}
|
|
9805
9838
|
}
|
|
9806
|
-
class
|
|
9839
|
+
class ho extends Ye {
|
|
9807
9840
|
constructor(t = {}) {
|
|
9808
|
-
super(t), t.disableDragAndDrop && (this.dragAndDropProtector = new
|
|
9841
|
+
super(t), t.disableDragAndDrop && (this.dragAndDropProtector = new ao({
|
|
9809
9842
|
onDragDetected: (e) => {
|
|
9810
9843
|
this.dispatchSuspiciousActivity("drag_detected", { dataTransferTypes: e, targetFrameSrc: "" });
|
|
9811
9844
|
},
|
|
9812
9845
|
onDropDetected: (e, i) => {
|
|
9813
9846
|
this.dispatchSuspiciousActivity("drop_detected", { dataTransferTypes: e, fileCount: i, targetFrameSrc: "" });
|
|
9814
9847
|
}
|
|
9815
|
-
})), t.protectCopy && (this.copyProtector = new
|
|
9848
|
+
})), t.protectCopy && (this.copyProtector = new lo({
|
|
9816
9849
|
onCopyBlocked: () => {
|
|
9817
9850
|
this.dispatchSuspiciousActivity("bulk_copy", { targetFrameSrc: "" });
|
|
9818
9851
|
}
|
|
@@ -9822,7 +9855,7 @@ class Ir extends Ye {
|
|
|
9822
9855
|
super.destroy(), this.dragAndDropProtector?.destroy(), this.copyProtector?.destroy();
|
|
9823
9856
|
}
|
|
9824
9857
|
}
|
|
9825
|
-
const
|
|
9858
|
+
const co = (r) => ({
|
|
9826
9859
|
trackLoaded: r.trackLoaded ?? (() => {
|
|
9827
9860
|
}),
|
|
9828
9861
|
positionChanged: r.positionChanged ?? (() => {
|
|
@@ -9854,12 +9887,12 @@ const Dr = (r) => ({
|
|
|
9854
9887
|
remotePlaybackStateChanged: r.remotePlaybackStateChanged ?? (() => {
|
|
9855
9888
|
})
|
|
9856
9889
|
});
|
|
9857
|
-
class
|
|
9890
|
+
class mo extends vs {
|
|
9858
9891
|
constructor(t, e, i, n = {
|
|
9859
9892
|
preferences: {},
|
|
9860
9893
|
defaults: {}
|
|
9861
9894
|
}) {
|
|
9862
|
-
if (super(), this.positionPollInterval = null, this.navigationId = 0, this._playIntent = !1, this._preferencesEditor = null, this._mediaSessionEnabled = !1, this._navigatorProtector = null, this._keyboardPeripheralsManager = null, this._suspiciousActivityListener = null, this._keyboardPeripheralListener = null, this._isNavigating = !1, this._isStalled = !1, this._stalledWatchdog = null, this._stalledCheckTime = 0, this.pub = t, this.listeners =
|
|
9895
|
+
if (super(), this.positionPollInterval = null, this.navigationId = 0, this._playIntent = !1, this._preferencesEditor = null, this._mediaSessionEnabled = !1, this._navigatorProtector = null, this._keyboardPeripheralsManager = null, this._suspiciousActivityListener = null, this._keyboardPeripheralListener = null, this._isNavigating = !1, this._isStalled = !1, this._stalledWatchdog = null, this._stalledCheckTime = 0, this.pub = t, this.listeners = co(e), this._preferences = new ce(n.preferences), this._defaults = new ro(n.defaults), this._settings = new ji(this._preferences, this._defaults), t.readingOrder.items.length === 0)
|
|
9863
9896
|
throw new Error("AudioNavigator: publication has an empty reading order");
|
|
9864
9897
|
if (i)
|
|
9865
9898
|
this.currentLocation = this.ensureLocatorLocations(i);
|
|
@@ -9869,7 +9902,7 @@ class Wr extends Ss {
|
|
|
9869
9902
|
href: u.href,
|
|
9870
9903
|
type: u.type || "audio/mpeg",
|
|
9871
9904
|
title: u.title,
|
|
9872
|
-
locations: new
|
|
9905
|
+
locations: new C({
|
|
9873
9906
|
position: 1,
|
|
9874
9907
|
progression: 0,
|
|
9875
9908
|
totalProgression: 0,
|
|
@@ -9880,7 +9913,7 @@ class Wr extends Ss {
|
|
|
9880
9913
|
const s = this.currentLocation.href.split("#")[0], o = this.hrefToTrackIndex(s);
|
|
9881
9914
|
if (o === -1)
|
|
9882
9915
|
throw new Error(`AudioNavigator: initial href "${s}" not found in reading order`);
|
|
9883
|
-
const a = this.currentLocation.locations?.time() || 0, l = new
|
|
9916
|
+
const a = this.currentLocation.locations?.time() || 0, l = new so({
|
|
9884
9917
|
playback: {
|
|
9885
9918
|
state: {
|
|
9886
9919
|
currentTime: a,
|
|
@@ -9890,14 +9923,14 @@ class Wr extends Ss {
|
|
|
9890
9923
|
index: o
|
|
9891
9924
|
}
|
|
9892
9925
|
});
|
|
9893
|
-
this.pool = new
|
|
9926
|
+
this.pool = new oo(l, t, n.contentProtection);
|
|
9894
9927
|
const h = n.contentProtection || {};
|
|
9895
9928
|
this._contentProtection = h;
|
|
9896
9929
|
const c = this.mergeKeyboardPeripherals(
|
|
9897
9930
|
h,
|
|
9898
9931
|
n.keyboardPeripherals || []
|
|
9899
9932
|
);
|
|
9900
|
-
(h.disableContextMenu || h.checkAutomation || h.checkIFrameEmbedding || h.monitorDevTools || h.protectPrinting?.disable || h.disableDragAndDrop || h.protectCopy) && (this._navigatorProtector = new
|
|
9933
|
+
(h.disableContextMenu || h.checkAutomation || h.checkIFrameEmbedding || h.monitorDevTools || h.protectPrinting?.disable || h.disableDragAndDrop || h.protectCopy) && (this._navigatorProtector = new ho(h), this._suspiciousActivityListener = (u) => {
|
|
9901
9934
|
const { type: p, ...g } = u.detail;
|
|
9902
9935
|
p === "context_menu" ? this.listeners.contextMenu(g) : this.listeners.contentProtection(p, g);
|
|
9903
9936
|
}, window.addEventListener(ot, this._suspiciousActivityListener)), c.length > 0 && (this._keyboardPeripheralsManager = new qe({ keyboardPeripherals: c }), this._keyboardPeripheralListener = (u) => {
|
|
@@ -9933,7 +9966,7 @@ class Wr extends Ss {
|
|
|
9933
9966
|
ensureLocatorLocations(t) {
|
|
9934
9967
|
return new I({
|
|
9935
9968
|
...t,
|
|
9936
|
-
locations: t.locations instanceof
|
|
9969
|
+
locations: t.locations instanceof C ? t.locations : t.locations ? new C(t.locations) : void 0
|
|
9937
9970
|
});
|
|
9938
9971
|
}
|
|
9939
9972
|
/** Resolves a bare href (no fragment) to its index in the reading order. Returns -1 if not found. */
|
|
@@ -9968,7 +10001,7 @@ class Wr extends Ss {
|
|
|
9968
10001
|
href: i.href,
|
|
9969
10002
|
type: i.type || "audio/mpeg",
|
|
9970
10003
|
title: i.title,
|
|
9971
|
-
locations: new
|
|
10004
|
+
locations: new C({
|
|
9972
10005
|
progression: n > 0 ? e / n : 0,
|
|
9973
10006
|
position: t + 1,
|
|
9974
10007
|
fragments: [`t=${e}`]
|
|
@@ -10012,7 +10045,7 @@ class Wr extends Ss {
|
|
|
10012
10045
|
this.pool.audioEngine.on("error", (t) => {
|
|
10013
10046
|
this.listeners.error(t, this.currentLocator);
|
|
10014
10047
|
}), this.pool.audioEngine.on("ended", async () => {
|
|
10015
|
-
this.stopPositionPolling(), this.currentLocation = this.currentLocation.copyWithLocations(new
|
|
10048
|
+
this.stopPositionPolling(), this.currentLocation = this.currentLocation.copyWithLocations(new C({
|
|
10016
10049
|
position: this.currentTrackIndex() + 1,
|
|
10017
10050
|
progression: 1,
|
|
10018
10051
|
fragments: [`t=${this.duration}`]
|
|
@@ -10027,7 +10060,7 @@ class Wr extends Ss {
|
|
|
10027
10060
|
if (this._isNavigating) return;
|
|
10028
10061
|
this.listeners.seeking(!1);
|
|
10029
10062
|
const t = this.currentTime, e = this.duration, i = e > 0 ? t / e : 0;
|
|
10030
|
-
this.currentLocation = this.currentLocation.copyWithLocations(new
|
|
10063
|
+
this.currentLocation = this.currentLocation.copyWithLocations(new C({
|
|
10031
10064
|
position: this.currentTrackIndex() + 1,
|
|
10032
10065
|
progression: i,
|
|
10033
10066
|
fragments: [`t=${t}`]
|
|
@@ -10086,7 +10119,7 @@ class Wr extends Ss {
|
|
|
10086
10119
|
startPositionPolling() {
|
|
10087
10120
|
this.stopPositionPolling(), this.positionPollInterval = setInterval(() => {
|
|
10088
10121
|
const t = this.currentTime, e = this.duration, i = e > 0 ? t / e : 0;
|
|
10089
|
-
this.currentLocation = this.currentLocation.copyWithLocations(new
|
|
10122
|
+
this.currentLocation = this.currentLocation.copyWithLocations(new C({
|
|
10090
10123
|
position: this.currentTrackIndex() + 1,
|
|
10091
10124
|
progression: i,
|
|
10092
10125
|
fragments: [`t=${t}`]
|
|
@@ -10214,70 +10247,71 @@ class Wr extends Ss {
|
|
|
10214
10247
|
}
|
|
10215
10248
|
}
|
|
10216
10249
|
export {
|
|
10217
|
-
|
|
10218
|
-
|
|
10250
|
+
ro as AudioDefaults,
|
|
10251
|
+
mo as AudioNavigator,
|
|
10219
10252
|
ce as AudioPreferences,
|
|
10220
10253
|
$i as AudioPreferencesEditor,
|
|
10221
10254
|
ji as AudioSettings,
|
|
10222
10255
|
A as BooleanPreference,
|
|
10223
10256
|
yn as EnumPreference,
|
|
10224
|
-
|
|
10257
|
+
jr as EpubDefaults,
|
|
10225
10258
|
Ln as EpubNavigator,
|
|
10226
|
-
|
|
10227
|
-
|
|
10259
|
+
Ft as EpubPreferences,
|
|
10260
|
+
Bi as EpubPreferencesEditor,
|
|
10228
10261
|
Vi as EpubSettings,
|
|
10229
|
-
|
|
10230
|
-
|
|
10231
|
-
|
|
10232
|
-
|
|
10233
|
-
|
|
10234
|
-
|
|
10235
|
-
|
|
10236
|
-
|
|
10237
|
-
|
|
10238
|
-
|
|
10239
|
-
|
|
10262
|
+
fo as ExperimentalWebPubNavigator,
|
|
10263
|
+
Mr as FXLCoordinator,
|
|
10264
|
+
Ar as FXLFrameManager,
|
|
10265
|
+
Vr as FXLFramePoolManager,
|
|
10266
|
+
Ir as FXLPeripherals,
|
|
10267
|
+
zr as FXLSpreader,
|
|
10268
|
+
Nt as FrameComms,
|
|
10269
|
+
Cn as FrameManager,
|
|
10270
|
+
Rr as FramePoolManager,
|
|
10271
|
+
Tr as HorizontalThird,
|
|
10272
|
+
Sn as Injector,
|
|
10240
10273
|
kt as LineLengths,
|
|
10241
|
-
|
|
10274
|
+
vs as MediaNavigator,
|
|
10242
10275
|
cn as Navigator,
|
|
10243
|
-
|
|
10244
|
-
|
|
10276
|
+
Ne as Orientation,
|
|
10277
|
+
N as Preference,
|
|
10245
10278
|
le as Properties,
|
|
10246
|
-
|
|
10279
|
+
Zr as RSProperties,
|
|
10247
10280
|
x as RangePreference,
|
|
10248
|
-
|
|
10249
|
-
|
|
10281
|
+
Qr as ReadiumCSS,
|
|
10282
|
+
Me as Spread,
|
|
10250
10283
|
tt as TextAlignment,
|
|
10251
|
-
|
|
10252
|
-
|
|
10284
|
+
_n as UserProperties,
|
|
10285
|
+
Nr as VerticalThird,
|
|
10253
10286
|
dn as VisualNavigator,
|
|
10254
|
-
|
|
10287
|
+
so as WebAudioEngine,
|
|
10255
10288
|
Ps as WebPubBlobBuilder,
|
|
10256
|
-
|
|
10257
|
-
|
|
10289
|
+
lr as WebPubCSS,
|
|
10290
|
+
dr as WebPubDefaults,
|
|
10258
10291
|
ks as WebPubFrameManager,
|
|
10259
10292
|
Os as WebPubFramePoolManager,
|
|
10260
|
-
|
|
10261
|
-
|
|
10293
|
+
kr as WebPubNavigator,
|
|
10294
|
+
Mt as WebPubPreferences,
|
|
10262
10295
|
Ti as WebPubPreferencesEditor,
|
|
10263
10296
|
Ai as WebPubSettings,
|
|
10264
|
-
|
|
10297
|
+
ar as WebRSProperties,
|
|
10265
10298
|
mn as WebUserProperties,
|
|
10266
10299
|
E as ensureBoolean,
|
|
10267
10300
|
he as ensureEnumValue,
|
|
10268
10301
|
gn as ensureExperiment,
|
|
10269
10302
|
wt as ensureFilter,
|
|
10270
|
-
|
|
10271
|
-
|
|
10272
|
-
|
|
10303
|
+
hr as ensureLessThanOrEqual,
|
|
10304
|
+
cr as ensureMoreThanOrEqual,
|
|
10305
|
+
S as ensureNonNegative,
|
|
10273
10306
|
W as ensureString,
|
|
10274
|
-
|
|
10275
|
-
|
|
10307
|
+
F as ensureValueInRange,
|
|
10308
|
+
Ge as experiments,
|
|
10276
10309
|
dt as filterRangeConfig,
|
|
10277
10310
|
Yt as fontSizeRangeConfig,
|
|
10278
10311
|
st as fontWeightRangeConfig,
|
|
10279
10312
|
qt as fontWidthRangeConfig,
|
|
10280
10313
|
bt as getScriptMode,
|
|
10314
|
+
po as i18n,
|
|
10281
10315
|
Kt as letterSpacingRangeConfig,
|
|
10282
10316
|
Jt as lineHeightRangeConfig,
|
|
10283
10317
|
ut as lineLengthRangeConfig,
|
|
@@ -10286,6 +10320,7 @@ export {
|
|
|
10286
10320
|
ne as playbackRateRangeConfig,
|
|
10287
10321
|
J as sML,
|
|
10288
10322
|
T as sMLWithRequest,
|
|
10323
|
+
uo as settings,
|
|
10289
10324
|
it as skipIntervalRangeConfig,
|
|
10290
10325
|
ie as volumeRangeConfig,
|
|
10291
10326
|
ge as withFallback,
|