@readium/navigator 1.3.2 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1432 -1384
- package/dist/index.umd.cjs +22 -22
- package/package.json +1 -1
- package/src/epub/frame/index.ts +1 -0
- package/src/epub/fxl/FXLCoordinator.ts +1 -1
- package/src/helpers/sML.ts +3 -2
- package/types/src/epub/frame/index.d.ts +1 -0
- package/types/src/helpers/sML.d.ts +3 -3
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class
|
|
1
|
+
let Ce = class bt {
|
|
2
2
|
/**
|
|
3
3
|
* Creates a [Encryption].
|
|
4
4
|
*/
|
|
@@ -10,7 +10,7 @@ class LA {
|
|
|
10
10
|
*/
|
|
11
11
|
static deserialize(A) {
|
|
12
12
|
if (A && A.algorithm)
|
|
13
|
-
return new
|
|
13
|
+
return new bt({
|
|
14
14
|
algorithm: A.algorithm,
|
|
15
15
|
compression: A.compression,
|
|
16
16
|
originalLength: A.originalLength,
|
|
@@ -25,8 +25,8 @@ class LA {
|
|
|
25
25
|
const A = { algorithm: this.algorithm };
|
|
26
26
|
return this.compression !== void 0 && (A.compression = this.compression), this.originalLength !== void 0 && (A.originalLength = this.originalLength), this.profile !== void 0 && (A.profile = this.profile), this.scheme !== void 0 && (A.scheme = this.scheme), A;
|
|
27
27
|
}
|
|
28
|
-
}
|
|
29
|
-
class
|
|
28
|
+
};
|
|
29
|
+
class U {
|
|
30
30
|
constructor(A) {
|
|
31
31
|
this.otherProperties = A;
|
|
32
32
|
}
|
|
@@ -35,7 +35,7 @@ class F {
|
|
|
35
35
|
*/
|
|
36
36
|
static deserialize(A) {
|
|
37
37
|
if (A)
|
|
38
|
-
return new
|
|
38
|
+
return new U(A);
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
41
|
* Serializes a [Properties] to its RWPM JSON representation.
|
|
@@ -50,19 +50,19 @@ class F {
|
|
|
50
50
|
const t = Object.assign({}, this.otherProperties);
|
|
51
51
|
for (const e in A)
|
|
52
52
|
t[e] = A[e];
|
|
53
|
-
return new
|
|
53
|
+
return new U(t);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
Object.defineProperty(
|
|
56
|
+
Object.defineProperty(U.prototype, "encryption", {
|
|
57
57
|
get: function() {
|
|
58
|
-
return
|
|
58
|
+
return Ce.deserialize(this.otherProperties.encrypted);
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
|
-
var Y = /* @__PURE__ */ ((i) => (i.fixed = "fixed", i.reflowable = "reflowable", i))(Y || {}),
|
|
62
|
-
|
|
61
|
+
var Y = /* @__PURE__ */ ((i) => (i.fixed = "fixed", i.reflowable = "reflowable", i))(Y || {}), q = /* @__PURE__ */ ((i) => (i.auto = "auto", i.landscape = "landscape", i.portrait = "portrait", i))(q || {}), D = /* @__PURE__ */ ((i) => (i.left = "left", i.right = "right", i.center = "center", i))(D || {}), wA = /* @__PURE__ */ ((i) => (i.auto = "auto", i.both = "both", i.none = "none", i.landscape = "landscape", i))(wA || {});
|
|
62
|
+
U.prototype.getContains = function() {
|
|
63
63
|
return new Set(this.otherProperties.contains || []);
|
|
64
64
|
};
|
|
65
|
-
|
|
65
|
+
U.prototype.getLayout = function() {
|
|
66
66
|
return this.otherProperties.layout;
|
|
67
67
|
};
|
|
68
68
|
class d {
|
|
@@ -520,7 +520,7 @@ class d {
|
|
|
520
520
|
});
|
|
521
521
|
}
|
|
522
522
|
}
|
|
523
|
-
class
|
|
523
|
+
class rt {
|
|
524
524
|
constructor(A) {
|
|
525
525
|
this.uri = A, this.parameters = this.getParameters(A);
|
|
526
526
|
}
|
|
@@ -548,22 +548,22 @@ class nt {
|
|
|
548
548
|
return this.uri.replace(/\{(\??)([^}]+)\}/g, (...n) => n[1] ? e(n[2]) : t(n[2]));
|
|
549
549
|
}
|
|
550
550
|
}
|
|
551
|
-
function
|
|
551
|
+
function ze(i) {
|
|
552
552
|
return i && i instanceof Array ? i : void 0;
|
|
553
553
|
}
|
|
554
|
-
function
|
|
555
|
-
return i && typeof i == "string" ? [i] :
|
|
554
|
+
function Jt(i) {
|
|
555
|
+
return i && typeof i == "string" ? [i] : ze(i);
|
|
556
556
|
}
|
|
557
|
-
function
|
|
557
|
+
function st(i) {
|
|
558
558
|
return typeof i == "string" ? new Date(i) : void 0;
|
|
559
559
|
}
|
|
560
|
-
function
|
|
560
|
+
function IA(i) {
|
|
561
561
|
return isNaN(i) ? void 0 : i;
|
|
562
562
|
}
|
|
563
563
|
function T(i) {
|
|
564
|
-
return
|
|
564
|
+
return IA(i) !== void 0 && Math.sign(i) >= 0 ? i : void 0;
|
|
565
565
|
}
|
|
566
|
-
function
|
|
566
|
+
function Ne(i) {
|
|
567
567
|
const A = new Array();
|
|
568
568
|
return i.forEach((t) => A.push(t)), A;
|
|
569
569
|
}
|
|
@@ -580,7 +580,7 @@ class z {
|
|
|
580
580
|
static deserialize(A) {
|
|
581
581
|
if (!A)
|
|
582
582
|
return;
|
|
583
|
-
const t =
|
|
583
|
+
const t = IA(A.progression), e = IA(A.totalProgression), n = IA(A.position), r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set([
|
|
584
584
|
"fragment",
|
|
585
585
|
"fragments",
|
|
586
586
|
"progression",
|
|
@@ -590,7 +590,7 @@ class z {
|
|
|
590
590
|
return Object.entries(A).forEach(([o, a]) => {
|
|
591
591
|
s.has(o) || r.set(o, a);
|
|
592
592
|
}), new z({
|
|
593
|
-
fragments:
|
|
593
|
+
fragments: Jt(A.fragments || A.fragment),
|
|
594
594
|
progression: t !== void 0 && t >= 0 && t <= 1 ? t : void 0,
|
|
595
595
|
totalProgression: e !== void 0 && e >= 0 && e <= 1 ? e : void 0,
|
|
596
596
|
position: n !== void 0 && n > 0 ? n : void 0,
|
|
@@ -605,7 +605,7 @@ class z {
|
|
|
605
605
|
return this.fragments && (A.fragments = this.fragments), this.progression !== void 0 && (A.progression = this.progression), this.totalProgression !== void 0 && (A.totalProgression = this.totalProgression), this.position !== void 0 && (A.position = this.position), this.otherLocations && this.otherLocations.forEach((t, e) => A[e] = t), A;
|
|
606
606
|
}
|
|
607
607
|
}
|
|
608
|
-
class
|
|
608
|
+
class ZA {
|
|
609
609
|
/**
|
|
610
610
|
* Creates a [Text].
|
|
611
611
|
*/
|
|
@@ -617,7 +617,7 @@ class OA {
|
|
|
617
617
|
*/
|
|
618
618
|
static deserialize(A) {
|
|
619
619
|
if (A)
|
|
620
|
-
return new
|
|
620
|
+
return new ZA({
|
|
621
621
|
after: A.after,
|
|
622
622
|
before: A.before,
|
|
623
623
|
highlight: A.highlight
|
|
@@ -631,7 +631,7 @@ class OA {
|
|
|
631
631
|
return this.after !== void 0 && (A.after = this.after), this.before !== void 0 && (A.before = this.before), this.highlight !== void 0 && (A.highlight = this.highlight), A;
|
|
632
632
|
}
|
|
633
633
|
}
|
|
634
|
-
class
|
|
634
|
+
let GA = class vA {
|
|
635
635
|
/**
|
|
636
636
|
* Creates a [Locator].
|
|
637
637
|
*/
|
|
@@ -643,12 +643,12 @@ class nA {
|
|
|
643
643
|
*/
|
|
644
644
|
static deserialize(A) {
|
|
645
645
|
if (A && A.href && A.type)
|
|
646
|
-
return new
|
|
646
|
+
return new vA({
|
|
647
647
|
href: A.href,
|
|
648
648
|
type: A.type,
|
|
649
649
|
title: A.title,
|
|
650
650
|
locations: z.deserialize(A.locations),
|
|
651
|
-
text:
|
|
651
|
+
text: ZA.deserialize(A.text)
|
|
652
652
|
});
|
|
653
653
|
}
|
|
654
654
|
/**
|
|
@@ -662,7 +662,7 @@ class nA {
|
|
|
662
662
|
* Shortcut to get a copy of the [Locator] with different [Locations] sub-properties.
|
|
663
663
|
*/
|
|
664
664
|
copyWithLocations(A) {
|
|
665
|
-
return new
|
|
665
|
+
return new vA({
|
|
666
666
|
href: this.href,
|
|
667
667
|
type: this.type,
|
|
668
668
|
title: this.title,
|
|
@@ -670,8 +670,8 @@ class nA {
|
|
|
670
670
|
locations: new z({ ...this.locations, ...A })
|
|
671
671
|
});
|
|
672
672
|
}
|
|
673
|
-
}
|
|
674
|
-
|
|
673
|
+
};
|
|
674
|
+
class b {
|
|
675
675
|
/**
|
|
676
676
|
* Creates a [Link].
|
|
677
677
|
*/
|
|
@@ -683,20 +683,20 @@ let oA = class IA {
|
|
|
683
683
|
*/
|
|
684
684
|
static deserialize(A) {
|
|
685
685
|
if (A && A.href && typeof A.href == "string")
|
|
686
|
-
return new
|
|
686
|
+
return new b({
|
|
687
687
|
href: A.href,
|
|
688
688
|
templated: A.templated,
|
|
689
689
|
type: A.type,
|
|
690
690
|
title: A.title,
|
|
691
691
|
rels: A.rel ? A.rel instanceof Array ? new Set(A.rel) : /* @__PURE__ */ new Set([A.rel]) : void 0,
|
|
692
|
-
properties:
|
|
692
|
+
properties: U.deserialize(A.properties),
|
|
693
693
|
height: T(A.height),
|
|
694
694
|
width: T(A.width),
|
|
695
695
|
duration: T(A.duration),
|
|
696
696
|
bitrate: T(A.bitrate),
|
|
697
|
-
languages:
|
|
698
|
-
alternates:
|
|
699
|
-
children:
|
|
697
|
+
languages: Jt(A.language),
|
|
698
|
+
alternates: FA.deserialize(A.alternate),
|
|
699
|
+
children: FA.deserialize(A.children)
|
|
700
700
|
});
|
|
701
701
|
}
|
|
702
702
|
/**
|
|
@@ -704,7 +704,7 @@ let oA = class IA {
|
|
|
704
704
|
*/
|
|
705
705
|
serialize() {
|
|
706
706
|
const A = { href: this.href };
|
|
707
|
-
return this.templated !== void 0 && (A.templated = this.templated), this.type !== void 0 && (A.type = this.type), this.title !== void 0 && (A.title = this.title), this.rels && (A.rel =
|
|
707
|
+
return this.templated !== void 0 && (A.templated = this.templated), this.type !== void 0 && (A.type = this.type), this.title !== void 0 && (A.title = this.title), this.rels && (A.rel = Ne(this.rels)), this.properties && (A.properties = this.properties.serialize()), this.height !== void 0 && (A.height = this.height), this.width !== void 0 && (A.width = this.width), this.duration !== void 0 && (A.duration = this.duration), this.bitrate !== void 0 && (A.bitrate = this.bitrate), this.languages && (A.language = this.languages), this.alternates && (A.alternate = this.alternates.serialize()), this.children && (A.children = this.children.serialize()), A;
|
|
708
708
|
}
|
|
709
709
|
/** MediaType of the linked resource. */
|
|
710
710
|
get mediaType() {
|
|
@@ -722,14 +722,14 @@ let oA = class IA {
|
|
|
722
722
|
}
|
|
723
723
|
/** List of URI template parameter keys, if the `Link` is templated. */
|
|
724
724
|
get templateParameters() {
|
|
725
|
-
return this.templated ? new
|
|
725
|
+
return this.templated ? new rt(this.href).parameters : /* @__PURE__ */ new Set();
|
|
726
726
|
}
|
|
727
727
|
/** Expands the `Link`'s HREF by replacing URI template variables by the given parameters.
|
|
728
728
|
* See RFC 6570 on URI template: https://tools.ietf.org/html/rfc6570
|
|
729
729
|
*/
|
|
730
730
|
expandTemplate(A) {
|
|
731
|
-
return new
|
|
732
|
-
href: new
|
|
731
|
+
return new b({
|
|
732
|
+
href: new rt(this.href).expand(A),
|
|
733
733
|
templated: !1
|
|
734
734
|
});
|
|
735
735
|
}
|
|
@@ -738,15 +738,15 @@ let oA = class IA {
|
|
|
738
738
|
*/
|
|
739
739
|
addProperties(A) {
|
|
740
740
|
var t;
|
|
741
|
-
const e =
|
|
742
|
-
return e.properties = e.properties ? (t = e.properties) == null ? void 0 : t.add(A) : new
|
|
741
|
+
const e = b.deserialize(this.serialize());
|
|
742
|
+
return e.properties = e.properties ? (t = e.properties) == null ? void 0 : t.add(A) : new U(A), e;
|
|
743
743
|
}
|
|
744
744
|
/**
|
|
745
745
|
* Creates a [Locator] from a reading order [Link].
|
|
746
746
|
*/
|
|
747
747
|
get locator() {
|
|
748
748
|
let A = this.href.split("#");
|
|
749
|
-
return new
|
|
749
|
+
return new GA({
|
|
750
750
|
href: A.length > 0 && A[0] !== void 0 ? A[0] : this.href,
|
|
751
751
|
type: this.type ?? "",
|
|
752
752
|
title: this.title,
|
|
@@ -755,7 +755,8 @@ let oA = class IA {
|
|
|
755
755
|
})
|
|
756
756
|
});
|
|
757
757
|
}
|
|
758
|
-
}
|
|
758
|
+
}
|
|
759
|
+
class FA {
|
|
759
760
|
/**
|
|
760
761
|
* Creates a [Links].
|
|
761
762
|
*/
|
|
@@ -767,8 +768,8 @@ let oA = class IA {
|
|
|
767
768
|
*/
|
|
768
769
|
static deserialize(A) {
|
|
769
770
|
if (A && A instanceof Array)
|
|
770
|
-
return new
|
|
771
|
-
A.map((t) =>
|
|
771
|
+
return new FA(
|
|
772
|
+
A.map((t) => b.deserialize(t)).filter((t) => t !== void 0)
|
|
772
773
|
);
|
|
773
774
|
}
|
|
774
775
|
/**
|
|
@@ -848,7 +849,8 @@ let oA = class IA {
|
|
|
848
849
|
filterLinksHasType() {
|
|
849
850
|
return this.items.filter((A) => A.type);
|
|
850
851
|
}
|
|
851
|
-
}
|
|
852
|
+
}
|
|
853
|
+
let ot = class Pt {
|
|
852
854
|
/**
|
|
853
855
|
* Creates a [DomRange].
|
|
854
856
|
*/
|
|
@@ -865,7 +867,7 @@ let oA = class IA {
|
|
|
865
867
|
if (t === void 0)
|
|
866
868
|
return;
|
|
867
869
|
let e = T(A.charOffset);
|
|
868
|
-
return e === void 0 && (e = T(A.offset)), new
|
|
870
|
+
return e === void 0 && (e = T(A.offset)), new Pt({
|
|
869
871
|
cssSelector: A.cssSelector,
|
|
870
872
|
textNodeIndex: t,
|
|
871
873
|
charOffset: e
|
|
@@ -881,7 +883,7 @@ let oA = class IA {
|
|
|
881
883
|
};
|
|
882
884
|
return this.charOffset !== void 0 && (A.charOffset = this.charOffset), A;
|
|
883
885
|
}
|
|
884
|
-
},
|
|
886
|
+
}, Te = class kt {
|
|
885
887
|
/**
|
|
886
888
|
* Creates a [DomRange].
|
|
887
889
|
*/
|
|
@@ -896,7 +898,7 @@ let oA = class IA {
|
|
|
896
898
|
return;
|
|
897
899
|
let t = ot.deserialize(A.start);
|
|
898
900
|
if (t)
|
|
899
|
-
return new
|
|
901
|
+
return new kt({
|
|
900
902
|
start: t,
|
|
901
903
|
end: ot.deserialize(A.end)
|
|
902
904
|
});
|
|
@@ -919,7 +921,7 @@ z.prototype.getPartialCfi = function() {
|
|
|
919
921
|
};
|
|
920
922
|
z.prototype.getDomRange = function() {
|
|
921
923
|
var i;
|
|
922
|
-
return
|
|
924
|
+
return Te.deserialize((i = this.otherLocations) == null ? void 0 : i.get("domRange"));
|
|
923
925
|
};
|
|
924
926
|
z.prototype.fragmentParameters = function() {
|
|
925
927
|
return new Map(
|
|
@@ -957,7 +959,7 @@ z.prototype.space = function() {
|
|
|
957
959
|
if (A.length === 4 && !A.some(isNaN))
|
|
958
960
|
return A;
|
|
959
961
|
};
|
|
960
|
-
class
|
|
962
|
+
let xe = class Wt {
|
|
961
963
|
/** Creates a [Price]. */
|
|
962
964
|
constructor(A) {
|
|
963
965
|
this.currency = A.currency, this.value = A.value;
|
|
@@ -973,7 +975,7 @@ class XA {
|
|
|
973
975
|
return;
|
|
974
976
|
let e = T(A.value);
|
|
975
977
|
if (e !== void 0)
|
|
976
|
-
return new
|
|
978
|
+
return new Wt({ currency: t, value: e });
|
|
977
979
|
}
|
|
978
980
|
/**
|
|
979
981
|
* Serializes a [Price] to its RWPM JSON representation.
|
|
@@ -981,8 +983,8 @@ class XA {
|
|
|
981
983
|
serialize() {
|
|
982
984
|
return { currency: this.currency, value: this.value };
|
|
983
985
|
}
|
|
984
|
-
}
|
|
985
|
-
class
|
|
986
|
+
};
|
|
987
|
+
class hA {
|
|
986
988
|
/** Creates a [Acquisition]. */
|
|
987
989
|
constructor(A) {
|
|
988
990
|
this.type = A.type, this.children = A.children;
|
|
@@ -992,14 +994,14 @@ class aA {
|
|
|
992
994
|
*/
|
|
993
995
|
static deserialize(A) {
|
|
994
996
|
if (A && A.type)
|
|
995
|
-
return new
|
|
997
|
+
return new hA({
|
|
996
998
|
type: A.type,
|
|
997
|
-
children:
|
|
999
|
+
children: hA.deserializeArray(A.children)
|
|
998
1000
|
});
|
|
999
1001
|
}
|
|
1000
1002
|
static deserializeArray(A) {
|
|
1001
1003
|
if (A instanceof Array)
|
|
1002
|
-
return A.map((t) =>
|
|
1004
|
+
return A.map((t) => hA.deserialize(t)).filter((t) => t !== void 0);
|
|
1003
1005
|
}
|
|
1004
1006
|
/**
|
|
1005
1007
|
* Serializes a [Acquisition] to its RWPM JSON representation.
|
|
@@ -1009,7 +1011,7 @@ class aA {
|
|
|
1009
1011
|
return this.children && (A.children = this.children.map((t) => t.serialize())), A;
|
|
1010
1012
|
}
|
|
1011
1013
|
}
|
|
1012
|
-
let
|
|
1014
|
+
let je = class Lt {
|
|
1013
1015
|
/** Creates a [Price]. */
|
|
1014
1016
|
constructor(A) {
|
|
1015
1017
|
this.total = A.total, this.position = A.position;
|
|
@@ -1019,7 +1021,7 @@ let ze = class kt {
|
|
|
1019
1021
|
*/
|
|
1020
1022
|
static deserialize(A) {
|
|
1021
1023
|
if (A)
|
|
1022
|
-
return new
|
|
1024
|
+
return new Lt({
|
|
1023
1025
|
total: T(A.total),
|
|
1024
1026
|
position: T(A.position)
|
|
1025
1027
|
});
|
|
@@ -1031,7 +1033,7 @@ let ze = class kt {
|
|
|
1031
1033
|
const A = {};
|
|
1032
1034
|
return this.total !== void 0 && (A.total = this.total), this.position !== void 0 && (A.position = this.position), A;
|
|
1033
1035
|
}
|
|
1034
|
-
},
|
|
1036
|
+
}, Se = class Ot {
|
|
1035
1037
|
/** Creates a [Copies]. */
|
|
1036
1038
|
constructor(A) {
|
|
1037
1039
|
this.total = A.total, this.available = A.available;
|
|
@@ -1041,7 +1043,7 @@ let ze = class kt {
|
|
|
1041
1043
|
*/
|
|
1042
1044
|
static deserialize(A) {
|
|
1043
1045
|
if (A)
|
|
1044
|
-
return new
|
|
1046
|
+
return new Ot({
|
|
1045
1047
|
total: T(A.total),
|
|
1046
1048
|
available: T(A.available)
|
|
1047
1049
|
});
|
|
@@ -1053,7 +1055,7 @@ let ze = class kt {
|
|
|
1053
1055
|
const A = {};
|
|
1054
1056
|
return this.total !== void 0 && (A.total = this.total), this.available !== void 0 && (A.available = this.available), A;
|
|
1055
1057
|
}
|
|
1056
|
-
},
|
|
1058
|
+
}, Ve = class Xt {
|
|
1057
1059
|
/** Creates a [Availability]. */
|
|
1058
1060
|
constructor(A) {
|
|
1059
1061
|
this.state = A.state, this.since = A.since, this.until = A.until;
|
|
@@ -1063,10 +1065,10 @@ let ze = class kt {
|
|
|
1063
1065
|
*/
|
|
1064
1066
|
static deserialize(A) {
|
|
1065
1067
|
if (A && A.state)
|
|
1066
|
-
return new
|
|
1068
|
+
return new Xt({
|
|
1067
1069
|
state: A.state,
|
|
1068
|
-
since:
|
|
1069
|
-
until:
|
|
1070
|
+
since: st(A.since),
|
|
1071
|
+
until: st(A.until)
|
|
1070
1072
|
});
|
|
1071
1073
|
}
|
|
1072
1074
|
/**
|
|
@@ -1077,82 +1079,127 @@ let ze = class kt {
|
|
|
1077
1079
|
return this.since !== void 0 && (A.since = this.since.toISOString()), this.until !== void 0 && (A.until = this.until.toISOString()), A;
|
|
1078
1080
|
}
|
|
1079
1081
|
};
|
|
1080
|
-
|
|
1082
|
+
U.prototype.getNumberOfItems = function() {
|
|
1081
1083
|
return T(this.otherProperties.numberOfItems);
|
|
1082
1084
|
};
|
|
1083
|
-
|
|
1084
|
-
return
|
|
1085
|
+
U.prototype.getPrice = function() {
|
|
1086
|
+
return xe.deserialize(this.otherProperties.price);
|
|
1085
1087
|
};
|
|
1086
|
-
|
|
1088
|
+
U.prototype.getIndirectAcquisitions = function() {
|
|
1087
1089
|
const i = this.otherProperties.indirectAcquisition;
|
|
1088
1090
|
if (i && i instanceof Array)
|
|
1089
|
-
return i.map((A) =>
|
|
1091
|
+
return i.map((A) => hA.deserialize(A)).filter((A) => A !== void 0);
|
|
1090
1092
|
};
|
|
1091
|
-
|
|
1092
|
-
return
|
|
1093
|
+
U.prototype.getHolds = function() {
|
|
1094
|
+
return je.deserialize(this.otherProperties.holds);
|
|
1093
1095
|
};
|
|
1094
|
-
|
|
1095
|
-
return
|
|
1096
|
+
U.prototype.getCopies = function() {
|
|
1097
|
+
return Se.deserialize(this.otherProperties.copies);
|
|
1096
1098
|
};
|
|
1097
|
-
|
|
1098
|
-
return
|
|
1099
|
+
U.prototype.getAvailability = function() {
|
|
1100
|
+
return Ve.deserialize(this.otherProperties.availability);
|
|
1099
1101
|
};
|
|
1100
|
-
|
|
1101
|
-
return
|
|
1102
|
+
U.prototype.getAuthenticate = function() {
|
|
1103
|
+
return b.deserialize(this.otherProperties.authenticate);
|
|
1102
1104
|
};
|
|
1103
|
-
var
|
|
1104
|
-
|
|
1105
|
+
var F = /* @__PURE__ */ ((i) => (i.auto = "auto", i.btt = "btt", i.ltr = "ltr", i.rtl = "rtl", i.ttb = "ttb", i))(F || {});
|
|
1106
|
+
U.prototype.getClipped = function() {
|
|
1105
1107
|
return this.otherProperties.clipped;
|
|
1106
1108
|
};
|
|
1107
|
-
|
|
1109
|
+
U.prototype.getFit = function() {
|
|
1108
1110
|
return this.otherProperties.fit;
|
|
1109
1111
|
};
|
|
1110
|
-
|
|
1112
|
+
U.prototype.getOrientation = function() {
|
|
1111
1113
|
return this.otherProperties.orientation;
|
|
1112
1114
|
};
|
|
1113
|
-
|
|
1115
|
+
U.prototype.getOverflow = function() {
|
|
1114
1116
|
return this.otherProperties.overflow;
|
|
1115
1117
|
};
|
|
1116
|
-
|
|
1118
|
+
U.prototype.getPage = function() {
|
|
1117
1119
|
return this.otherProperties.page || void 0;
|
|
1118
1120
|
};
|
|
1119
|
-
|
|
1121
|
+
U.prototype.getSpread = function() {
|
|
1120
1122
|
return this.otherProperties.spread || void 0;
|
|
1121
1123
|
};
|
|
1122
|
-
|
|
1124
|
+
var P;
|
|
1125
|
+
(function(i) {
|
|
1126
|
+
i.NONE = "none", i.DESCENDANT = "descendant", i.CHILD = "child";
|
|
1127
|
+
})(P || (P = {}));
|
|
1128
|
+
var j;
|
|
1129
|
+
(function(i) {
|
|
1130
|
+
i.id = "id", i.class = "class", i.tag = "tag", i.attribute = "attribute", i.nthchild = "nthchild", i.nthoftype = "nthoftype";
|
|
1131
|
+
})(j || (j = {}));
|
|
1132
|
+
const De = "CssSelectorGenerator";
|
|
1133
|
+
function at(i = "unknown problem", ...A) {
|
|
1134
|
+
console.warn(`${De}: ${i}`, ...A);
|
|
1135
|
+
}
|
|
1136
|
+
j.id, j.class, j.tag, j.attribute, Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY;
|
|
1137
|
+
function He(i) {
|
|
1138
|
+
return i instanceof RegExp;
|
|
1139
|
+
}
|
|
1140
|
+
function Ge(i) {
|
|
1141
|
+
return i.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".+");
|
|
1142
|
+
}
|
|
1143
|
+
function ve(i) {
|
|
1144
|
+
const A = i.map((t) => {
|
|
1145
|
+
if (He(t))
|
|
1146
|
+
return (e) => t.test(e);
|
|
1147
|
+
if (typeof t == "function")
|
|
1148
|
+
return (e) => {
|
|
1149
|
+
const n = t(e);
|
|
1150
|
+
return typeof n != "boolean" ? (at("pattern matcher function invalid", "Provided pattern matching function does not return boolean. It's result will be ignored.", t), !1) : n;
|
|
1151
|
+
};
|
|
1152
|
+
if (typeof t == "string") {
|
|
1153
|
+
const e = new RegExp("^" + Ge(t) + "$");
|
|
1154
|
+
return (n) => e.test(n);
|
|
1155
|
+
}
|
|
1156
|
+
return at("pattern matcher invalid", "Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.", t), () => !1;
|
|
1157
|
+
});
|
|
1158
|
+
return (t) => A.some((e) => e(t));
|
|
1123
1159
|
}
|
|
1124
|
-
|
|
1160
|
+
const be = "", Je = " > ", Pe = " ";
|
|
1161
|
+
P.NONE + "", P.NONE, P.DESCENDANT + "", P.DESCENDANT, P.CHILD + "", P.CHILD;
|
|
1162
|
+
j.nthoftype, j.tag, j.id, j.class, j.attribute, j.nthchild;
|
|
1163
|
+
ve([
|
|
1164
|
+
"class",
|
|
1165
|
+
"id",
|
|
1166
|
+
// Angular attributes
|
|
1167
|
+
"ng-*"
|
|
1168
|
+
]);
|
|
1169
|
+
class ke {
|
|
1170
|
+
}
|
|
1171
|
+
class We extends ke {
|
|
1125
1172
|
/**
|
|
1126
1173
|
* Moves to the left content portion (eg. page) relative to the reading progression direction.
|
|
1127
1174
|
*/
|
|
1128
1175
|
goLeft(A = !1, t) {
|
|
1129
|
-
this.readingProgression ===
|
|
1176
|
+
this.readingProgression === F.ltr || this.readingProgression === F.ttb || this.readingProgression === F.auto ? this.goBackward(A, t) : (this.readingProgression === F.rtl || this.readingProgression === F.btt) && this.goForward(A, t);
|
|
1130
1177
|
}
|
|
1131
1178
|
/**
|
|
1132
1179
|
* Moves to the right content portion (eg. page) relative to the reading progression direction.
|
|
1133
1180
|
*/
|
|
1134
1181
|
goRight(A = !1, t) {
|
|
1135
|
-
this.readingProgression ===
|
|
1182
|
+
this.readingProgression === F.ltr || this.readingProgression === F.ttb || this.readingProgression === F.auto ? this.goForward(A, t) : (this.readingProgression === F.rtl || this.readingProgression === F.btt) && this.goBackward(A, t);
|
|
1136
1183
|
}
|
|
1137
1184
|
}
|
|
1138
|
-
const Se = `@namespace url(http://www.w3.org/1999/xhtml);@namespace epub url(http://www.idpf.org/2007/ops);@namespace m url(http://www.w3.org/1998/Math/MathML/);@namespace svg url(http://www.w3.org/2000/svg);:root{--RS__colWidth:45em;--RS__colCount:1;--RS__colGap:0;--RS__maxLineLength:40rem;--RS__pageGutter:20px;--RS__viewportWidth:100%}@page{margin:0!important}:root{position:relative;-webkit-column-width:var(--RS__colWidth);-moz-column-width:var(--RS__colWidth);column-width:var(--RS__colWidth);-webkit-column-count:var(--RS__colCount);-moz-column-count:var(--RS__colCount);column-count:var(--RS__colCount);-webkit-column-gap:var(--RS__colGap);-moz-column-gap:var(--RS__colGap);column-gap:var(--RS__colGap);-moz-column-fill:auto;column-fill:auto;width:var(--RS__viewportWidth);height:100vh;max-width:var(--RS__viewportWidth);max-height:100vh;min-width:var(--RS__viewportWidth);min-height:100vh;padding:0!important;margin:0!important;font-size:100%!important;-webkit-text-size-adjust:100%;box-sizing:border-box;-webkit-perspective:1;-webkit-touch-callout:none}body{width:100%;max-width:var(--RS__maxLineLength)!important;padding:0 var(--RS__pageGutter)!important;margin:0 auto!important;box-sizing:border-box}@media screen and (min-width: 35em){:root{--RS__pageGutter:30px}}@media screen and (min-width: 45em){:root{--RS__pageGutter:40px}}@media screen and (min-width: 75em){:root{--RS__pageGutter:50px}}@media screen and (min-width: 60em),screen and (min-device-width: 36em) and (max-device-width: 47em) and (orientation: landscape){:root{--RS__colWidth:20em;--RS__colCount:2;--RS__maxLineLength:39.99rem}}:root[style*=readium-scroll-on]{-webkit-columns:auto auto!important;-moz-columns:auto auto!important;columns:auto auto!important;width:auto!important;height:auto!important;max-width:none!important;max-height:none!important;min-width:0!important;min-height:0!important}:root[style*=readium-scroll-on] body{--RS__maxLineLength:40rem !important}:root[style*=readium-night-on]{--RS__backgroundColor:#000000;--RS__textColor:#FEFEFE;--RS__linkColor:#63caff;--RS__visitedColor:#0099E5;--RS__selectionBackgroundColor:#b4d8fe;--RS__selectionTextColor:inherit}:root[style*=readium-night-on] *:not(a){color:inherit!important;background-color:transparent!important;border-color:currentcolor!important}:root[style*=readium-night-on] svg text{fill:currentcolor!important;stroke:none!important}:root[style*=readium-night-on] a:link,:root[style*=readium-night-on] a:link *{color:var(--RS__linkColor)!important}:root[style*=readium-night-on] a:visited,:root[style*=readium-night-on] a:visited *{color:var(--RS__visitedColor)!important}:root[style*=readium-night-on] img[class*=gaiji],:root[style*=readium-night-on] *[epub\\:type~=titlepage] img:only-child,:root[style*=readium-night-on] *[epub|type~=titlepage] img:only-child{-webkit-filter:invert(100%);filter:invert(100%)}:root[style*=readium-night-on][style*=readium-darken-on] img{-webkit-filter:brightness(80%);filter:brightness(80%)}:root[style*=readium-night-on][style*=readium-invert-on] img{-webkit-filter:invert(100%);filter:invert(100%)}:root[style*=readium-night-on][style*=readium-darken-on][style*=readium-invert-on] img{-webkit-filter:brightness(80%) invert(100%);filter:brightness(80%) invert(100%)}:root[style*=readium-sepia-on]{--RS__backgroundColor:#faf4e8;--RS__textColor:#121212;--RS__linkColor:#0000EE;--RS__visitedColor:#551A8B;--RS__selectionBackgroundColor:#b4d8fe;--RS__selectionTextColor:inherit;--RS__maxLineLength:40.01rem}:root[style*=readium-sepia-on] *:not(a){color:inherit!important;background-color:transparent!important}:root[style*=readium-sepia-on] a:link,:root[style*=readium-sepia-on] a:link *{color:var(--RS__linkColor)}:root[style*=readium-sepia-on] a:visited,:root[style*=readium-sepia-on] a:visited *{color:var(--RS__visitedColor)}:root[style*=readium-sepia-on] svg,:root[style*=readium-sepia-on] img{background-color:transparent!important;mix-blend-mode:multiply}@media screen and (-ms-high-contrast: active){:root{color:windowText!important;background-color:window!important}:root :not(#\\#):not(#\\#):not(#\\#),:root :not(#\\#):not(#\\#):not(#\\#) :not(#\\#):not(#\\#):not(#\\#) :root :not(#\\#):not(#\\#):not(#\\#) :not(#\\#):not(#\\#):not(#\\#) :not(#\\#):not(#\\#):not(#\\#){color:inherit!important;background-color:inherit!important}.readiumCSS-mo-active-default{color:highlightText!important;background-color:highlight!important}}@media screen and (-ms-high-contrast: white-on-black){:root[style*=readium-night-on] img[class*=gaiji],:root[style*=readium-night-on] *[epub\\:type~=titlepage] img:only-child,:root[style*=readium-night-on] *[epub|type~=titlepage] img:only-child{-webkit-filter:none!important;filter:none!important}:root[style*=readium-night-on][style*=readium-invert-on] img{-webkit-filter:none!important;filter:none!important}:root[style*=readium-night-on][style*=readium-darken-on][style*=readium-invert-on] img{-webkit-filter:brightness(80%);filter:brightness(80%)}}@media screen and (inverted-colors){:root[style*=readium-night-on] img[class*=gaiji],:root[style*=readium-night-on] *[epub\\:type~=titlepage] img:only-child,:root[style*=readium-night-on] *[epub|type~=titlepage] img:only-child{-webkit-filter:none!important;filter:none!important}:root[style*=readium-night-on][style*=readium-invert-on] img{-webkit-filter:none!important;filter:none!important}:root[style*=readium-night-on][style*=readium-darken-on][style*=readium-invert-on] img{-webkit-filter:brightness(80%);filter:brightness(80%)}}@media screen and (min-width: 60em),screen and (min-device-width: 36em) and (max-device-width: 47em) and (orientation: landscape){:root[style*="--USER__colCount: 1"],:root[style*="--USER__colCount:1"],:root[style*="--USER__colCount: 2"],:root[style*="--USER__colCount:2"]{-webkit-column-count:var(--USER__colCount);-moz-column-count:var(--USER__colCount);column-count:var(--USER__colCount)}:root[style*="--USER__colCount: 1"],:root[style*="--USER__colCount:1"]{--RS__maxLineLength:40rem !important;--RS__colWidth:100vw}:root[style*="--USER__colCount: 2"],:root[style*="--USER__colCount:2"]{--RS__colWidth:auto}}:root[style*=--USER__pageMargins] body{padding:0 calc(var(--RS__pageGutter) * var(--USER__pageMargins))!important}:root[style*=--USER__backgroundColor]{background-color:var(--USER__backgroundColor)!important}:root[style*=--USER__backgroundColor] *{background-color:transparent!important}:root[style*=--USER__textColor]{color:var(--USER__textColor)!important}:root[style*=--USER__textColor] *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(pre){color:inherit!important}:root[style*=readium-advanced-on][style*=--USER__textAlign]{text-align:var(--USER__textAlign)}:root[style*=readium-advanced-on][style*=--USER__textAlign] body,:root[style*=readium-advanced-on][style*=--USER__textAlign] *:not(blockquote):not(figcaption) p,:root[style*=readium-advanced-on][style*=--USER__textAlign] li{text-align:var(--USER__textAlign)!important;-moz-text-align-last:auto!important;-epub-text-align-last:auto!important;text-align-last:auto!important}:root[style*=readium-advanced-on][style*="--USER__textAlign: justify"] body,:root[style*=readium-advanced-on][style*="--USER__textAlign:justify"] body{-webkit-hyphens:auto;-moz-hyphens:auto;-ms-hyphens:auto;-epub-hyphens:auto;hyphens:auto}:root[style*=readium-advanced-on][style*="--USER__textAlign: left"] body,:root[style*=readium-advanced-on][style*="--USER__textAlign:left"] body,:root[style*=readium-advanced-on][style*="--USER__textAlign: right"] body,:root[style*=readium-advanced-on][style*="--USER__textAlign:right"] body{-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;-epub-hyphens:none;hyphens:none}:root[style*=readium-advanced-on][style*=--USER__bodyHyphens]{-webkit-hyphens:var(--USER__bodyHyphens)!important;-moz-hyphens:var(--USER__bodyHyphens)!important;-ms-hyphens:var(--USER__bodyHyphens)!important;-epub-hyphens:var(--USER__bodyHyphens)!important;hyphens:var(--USER__bodyHyphens)!important}:root[style*=readium-advanced-on][style*=--USER__bodyHyphens] body,:root[style*=readium-advanced-on][style*=--USER__bodyHyphens] p,:root[style*=readium-advanced-on][style*=--USER__bodyHyphens] li,:root[style*=readium-advanced-on][style*=--USER__bodyHyphens] div,:root[style*=readium-advanced-on][style*=--USER__bodyHyphens] dd{-webkit-hyphens:inherit;-moz-hyphens:inherit;-ms-hyphens:inherit;-epub-hyphens:inherit;hyphens:inherit}:root[style*=readium-font-on][style*=--USER__fontFamily]{font-family:var(--USER__fontFamily)!important}:root[style*=readium-font-on][style*=--USER__fontFamily] body,:root[style*=readium-font-on][style*=--USER__fontFamily] p,:root[style*=readium-font-on][style*=--USER__fontFamily] li,:root[style*=readium-font-on][style*=--USER__fontFamily] div,:root[style*=readium-font-on][style*=--USER__fontFamily] dt,:root[style*=readium-font-on][style*=--USER__fontFamily] dd{font-family:inherit!important}:root[style*=readium-font-on][style*=--USER__fontFamily] i:not([lang]),:root[style*=readium-font-on][style*=--USER__fontFamily] i:not([xml\\:lang]),:root[style*=readium-font-on][style*=--USER__fontFamily] em:not([lang]),:root[style*=readium-font-on][style*=--USER__fontFamily] em:not([xml\\:lang]),:root[style*=readium-font-on][style*=--USER__fontFamily] cite:not([lang]),:root[style*=readium-font-on][style*=--USER__fontFamily] cite:not([xml\\:lang]),:root[style*=readium-font-on][style*=--USER__fontFamily] b:not([lang]),:root[style*=readium-font-on][style*=--USER__fontFamily] b:not([xml\\:lang]),:root[style*=readium-font-on][style*=--USER__fontFamily] strong:not([lang]),:root[style*=readium-font-on][style*=--USER__fontFamily] strong:not([xml\\:lang]),:root[style*=readium-font-on][style*=--USER__fontFamily] span:not([lang]),:root[style*=readium-font-on][style*=--USER__fontFamily] span:not([xml\\:lang]){font-family:inherit!important}:root[style*=readium-font-on][style*=AccessibleDfA]{font-family:AccessibleDfA,Verdana,Tahoma,Trebuchet MS,sans-serif!important;--RS__lineHeightCompensation:1.167}:root[style*=readium-font-on][style*="IA Writer Duospace"]{font-family:IA Writer Duospace,Menlo,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier,monospace!important;--RS__lineHeightCompensation:1.167}:root[style*=readium-font-on][style*=readium-a11y-on]{font-family:var(--USER__fontFamily)!important;--RS__lineHeightCompensation:1.167}:root[style*=readium-font-on][style*=AccessibleDfA],:root[style*=readium-font-on][style*="IA Writer Duospace"],:root[style*=readium-font-on][style*=readium-a11y-on]{font-style:normal!important;font-weight:400!important}:root[style*=readium-font-on][style*=AccessibleDfA] *:not(code):not(var):not(kbd):not(samp),:root[style*=readium-font-on][style*="IA Writer Duospace"] *:not(code):not(var):not(kbd):not(samp),:root[style*=readium-font-on][style*=readium-a11y-on] *:not(code):not(var):not(kbd):not(samp){font-family:inherit!important;font-style:inherit!important;font-weight:inherit!important}:root[style*=readium-font-on][style*=AccessibleDfA] *,:root[style*=readium-font-on][style*="IA Writer Duospace"] *,:root[style*=readium-font-on][style*=readium-a11y-on] *{text-decoration:none!important;font-variant-caps:normal!important;font-variant-numeric:normal!important;font-variant-position:normal!important}:root[style*=readium-font-on][style*=AccessibleDfA] sup,:root[style*=readium-font-on][style*="IA Writer Duospace"] sup,:root[style*=readium-font-on][style*=readium-a11y-on] sup,:root[style*=readium-font-on][style*=AccessibleDfA] sub,:root[style*=readium-font-on][style*="IA Writer Duospace"] sub,:root[style*=readium-font-on][style*=readium-a11y-on] sub{font-size:1rem!important;vertical-align:baseline!important}:root[style*=--USER__fontSize]{font-size:var(--USER__fontSize)!important}:root[style*=readium-advanced-on][style*=--USER__lineHeight]{line-height:var(--USER__lineHeight)!important}:root[style*=readium-advanced-on][style*=--USER__lineHeight] body,:root[style*=readium-advanced-on][style*=--USER__lineHeight] p,:root[style*=readium-advanced-on][style*=--USER__lineHeight] li,:root[style*=readium-advanced-on][style*=--USER__lineHeight] div{line-height:inherit}:root[style*=readium-advanced-on][style*=--USER__paraSpacing] p{margin-top:var(--USER__paraSpacing)!important;margin-bottom:var(--USER__paraSpacing)!important}:root[style*=readium-advanced-on][style*=--USER__paraIndent] p{text-indent:var(--USER__paraIndent)!important}:root[style*=readium-advanced-on][style*=--USER__paraIndent] p *,:root[style*=readium-advanced-on][style*=--USER__paraIndent] p:first-letter{text-indent:0!important}:root[style*=readium-advanced-on][style*=--USER__wordSpacing] h1,:root[style*=readium-advanced-on][style*=--USER__wordSpacing] h2,:root[style*=readium-advanced-on][style*=--USER__wordSpacing] h3,:root[style*=readium-advanced-on][style*=--USER__wordSpacing] h4,:root[style*=readium-advanced-on][style*=--USER__wordSpacing] h5,:root[style*=readium-advanced-on][style*=--USER__wordSpacing] h6,:root[style*=readium-advanced-on][style*=--USER__wordSpacing] p,:root[style*=readium-advanced-on][style*=--USER__wordSpacing] li,:root[style*=readium-advanced-on][style*=--USER__wordSpacing] div{word-spacing:var(--USER__wordSpacing)}:root[style*=readium-advanced-on][style*=--USER__letterSpacing] h1,:root[style*=readium-advanced-on][style*=--USER__letterSpacing] h2,:root[style*=readium-advanced-on][style*=--USER__letterSpacing] h3,:root[style*=readium-advanced-on][style*=--USER__letterSpacing] h4,:root[style*=readium-advanced-on][style*=--USER__letterSpacing] h5,:root[style*=readium-advanced-on][style*=--USER__letterSpacing] h6,:root[style*=readium-advanced-on][style*=--USER__letterSpacing] p,:root[style*=readium-advanced-on][style*=--USER__letterSpacing] li,:root[style*=readium-advanced-on][style*=--USER__letterSpacing] div{letter-spacing:var(--USER__letterSpacing);font-variant:none}:root[style*=readium-advanced-on]{--USER__typeScale:1.2}:root[style*=readium-advanced-on] p,:root[style*=readium-advanced-on] li,:root[style*=readium-advanced-on] div,:root[style*=readium-advanced-on] pre,:root[style*=readium-advanced-on] dd{font-size:1rem!important}:root[style*=readium-advanced-on] h1{font-size:1.75rem!important;font-size:calc(((1rem * var(--USER__typeScale)) * var(--USER__typeScale)) * var(--USER__typeScale))!important}:root[style*=readium-advanced-on] h2{font-size:1.5rem!important;font-size:calc((1rem * var(--USER__typeScale)) * var(--USER__typeScale))!important}:root[style*=readium-advanced-on] h3{font-size:1.25rem!important;font-size:calc(1rem * var(--USER__typeScale))!important}:root[style*=readium-advanced-on] h4,:root[style*=readium-advanced-on] h5,:root[style*=readium-advanced-on] h6{font-size:1rem!important}:root[style*=readium-advanced-on] small{font-size:smaller!important}:root[style*=readium-advanced-on] sub,:root[style*=readium-advanced-on] sup{font-size:67.5%!important}:root[style*=readium-advanced-on][style*=--USER__typeScale] h1{font-size:calc(((1rem * var(--USER__typeScale)) * var(--USER__typeScale)) * var(--USER__typeScale))!important}:root[style*=readium-advanced-on][style*=--USER__typeScale] h2{font-size:calc((1rem * var(--USER__typeScale)) * var(--USER__typeScale))!important}:root[style*=readium-advanced-on][style*=--USER__typeScale] h3{font-size:calc(1rem * var(--USER__typeScale))!important}
|
|
1139
|
-
`, Ve = `@namespace url(http://www.w3.org/1999/xhtml);@namespace epub url(http://www.idpf.org/2007/ops);@namespace m url(http://www.w3.org/1998/Math/MathML/);@namespace svg url(http://www.w3.org/2000/svg);@-ms-viewport{width:device-width}@viewport{width:device-width;zoom:1}:root{--RS__oldStyleTf:"Iowan Old Style", "Sitka Text", palatino, "Book Antiqua", serif;--RS__modernTf:athelas, constantia, georgia, serif;--RS__sansTf:-apple-system, system-ui, blinkmacsystemfont, "Segoe UI", roboto, "Helvetica Neue", arial, sans-serif;--RS__humanistTf:seravek, calibri, roboto, arial, sans-serif;--RS__monospaceTf:"Andale Mono", consolas, monospace;--RS__baseFontFamily:var(--RS__oldStyleTf);--RS__lineHeightCompensation:1;--RS__baseLineHeight:calc((1em + (2ex - 1ch) - ((1rem - 16px) * .1667)) * var(--RS__lineHeightCompensation))}html{font-family:var(--RS__baseFontFamily);line-height:1.6;line-height:var(--RS__baseLineHeight);text-rendering:optimizelegibility}h1,h2,h3{line-height:normal}:lang(ja),:lang(zh),:lang(ko){word-wrap:break-word;-webkit-line-break:strict;-epub-line-break:strict;line-break:strict}math{font-family:"Latin Modern Math","STIX Two Math","XITS Math","STIX Math","Libertinus Math","TeX Gyre Termes Math","TeX Gyre Bonum Math",TeX Gyre Schola,"DejaVu Math TeX Gyre","TeX Gyre Pagella Math","Asana Math","Cambria Math","Lucida Bright Math","Minion Math",STIXGeneral,STIXSizeOneSym,Symbol,Times New Roman,serif}:lang(am){--RS__baseFontFamily:kefa, nyala, roboto, noto, "Noto Sans Ethiopic", serif;--RS__lineHeightCompensation:1.167}:lang(ar){--RS__baseFontFamily:"Geeza Pro", "Arabic Typesetting", roboto, noto, "Noto Naskh Arabic", "Times New Roman", serif}:lang(bn){--RS__baseFontFamily:"Kohinoor Bangla", "Bangla Sangam MN", vrinda, roboto, noto, "Noto Sans Bengali", sans-serif;--RS__lineHeightCompensation:1.067}:lang(bo){--RS__baseFontFamily:kailasa, "Microsoft Himalaya", roboto, noto, "Noto Sans Tibetan", sans-serif}:lang(chr){--RS__baseFontFamily:"Plantagenet Cherokee", roboto, noto, "Noto Sans Cherokee";--RS__lineHeightCompensation:1.167}:lang(fa){--RS__baseFontFamily:"Geeza Pro", "Arabic Typesetting", roboto, noto, "Noto Naskh Arabic", "Times New Roman", serif}:lang(gu){--RS__baseFontFamily:"Gujarati Sangam MN", "Nirmala UI", shruti, roboto, noto, "Noto Sans Gujarati", sans-serif;--RS__lineHeightCompensation:1.167}:lang(he){--RS__baseFontFamily:"New Peninim MT", "Arial Hebrew", gisha, "Times New Roman", roboto, noto, "Noto Sans Hebrew" sans-serif;--RS__lineHeightCompensation:1.1}:lang(hi){--RS__baseFontFamily:"Kohinoor Devanagari", "Devanagari Sangam MN", kokila, "Nirmala UI", roboto, noto, "Noto Sans Devanagari", sans-serif;--RS__lineHeightCompensation:1.1}:lang(hy){--RS__baseFontFamily:mshtakan, sylfaen, roboto, noto, "Noto Serif Armenian", serif}:lang(iu){--RS__baseFontFamily:"Euphemia UCAS", euphemia, roboto, noto, "Noto Sans Canadian Aboriginal", sans-serif}:lang(ja){--RS__baseFontFamily:yugothic, "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Meiryo UI", "MS Gothic", roboto, noto, "Noto Sans CJK JP", sans-serif;--RS__lineHeightCompensation:1.167;--RS__serif-ja:"Hiragino Mincho ProN", "Hiragino Mincho Pro", "YuMincho", "BIZ UDPMincho", "Yu Mincho", "MS P明朝", "MS PMincho", serif;--RS__sans-serif-ja:"Hiragino Sans", "Hiragino Kaku Gothic ProN", "Hiragino Kaku Gothic Pro", "ヒラギノ角ゴ W3", "YuGothic", "Yu Gothic Medium", "BIZ UDPGothic", "Yu Gothic", "MS Pゴシック", "MS PGothic", sans-serif;--RS__serif-ja-v:"Hiragino Mincho ProN", "Hiragino Mincho Pro", "YuMincho", "BIZ UDMincho", "Yu Mincho", "MS明朝", "MS Mincho", serif;--RS__sans-serif-ja-v:"Hiragino Sans", "Hiragino Kaku Gothic ProN", "Hiragino Kaku Gothic Pro", "ヒラギノ角ゴ W3", "YuGothic", "Yu Gothic Medium", "BIZ UDGothic", "Yu Gothic", "MSゴシック", "MS Gothic", sans-serif}:lang(km){--RS__baseFontFamily:"Khmer Sangam MN", "Leelawadee UI", "Khmer UI", roboto, noto, "Noto Sans Khmer", sans-serif;--RS__lineHeightCompensation:1.067}:lang(kn){--RS__baseFontFamily:"Kannada Sangam MN", "Nirmala UI", tunga, roboto, noto, "Noto Sans Kannada", sans-serif;--RS__lineHeightCompensation:1.1}:lang(ko){--RS__baseFontFamily:"Nanum Gothic", "Apple SD Gothic Neo", "Malgun Gothic", roboto, noto, "Noto Sans CJK KR", sans-serif;--RS__lineHeightCompensation:1.167}:lang(lo){--RS__baseFontFamily:"Lao Sangam MN", "Leelawadee UI", "Lao UI", roboto, noto, "Noto Sans Lao", sans-serif}:lang(ml){--RS__baseFontFamily:"Malayalam Sangam MN", "Nirmala UI", kartika, roboto, noto, "Noto Sans Malayalam", sans-serif;--RS__lineHeightCompensation:1.067}:lang(or){--RS__baseFontFamily:"Oriya Sangam MN", "Nirmala UI", kalinga, roboto, noto, "Noto Sans Oriya", sans-serif;--RS__lineHeightCompensation:1.167}:lang(pa){--RS__baseFontFamily:"Gurmukhi MN", "Nirmala UI", kartika, roboto, noto, "Noto Sans Gurmukhi", sans-serif;--RS__lineHeightCompensation:1.1}:lang(si){--RS__baseFontFamily:"Sinhala Sangam MN", "Nirmala UI", "Iskoola Pota", roboto, noto, "Noto Sans Sinhala", sans-serif;--RS__lineHeightCompensation:1.167}:lang(ta){--RS__baseFontFamily:"Tamil Sangam MN", "Nirmala UI", latha, roboto, noto, "Noto Sans Tamil", sans-serif;--RS__lineHeightCompensation:1.067}:lang(te){--RS__baseFontFamily:"Kohinoor Telugu", "Telugu Sangam MN", "Nirmala UI", gautami, roboto, noto, "Noto Sans Telugu", sans-serif}:lang(th){--RS__baseFontFamily:"Thonburi", "Leelawadee UI", "Cordia New", roboto, noto, "Noto Sans Thai", sans-serif;--RS__lineHeightCompensation:1.067}:lang(zh){--RS__baseFontFamily:"方体", "PingFang SC", "黑体", "Heiti SC", "Microsoft JhengHei UI", "Microsoft JhengHei", roboto, noto, "Noto Sans CJK SC", sans-serif;--RS__lineHeightCompensation:1.167}:lang(zh-Hant),:lang(zh-TW){--RS__baseFontFamily:"方體", "PingFang TC", "黑體", "Heiti TC", "Microsoft JhengHei UI", "Microsoft JhengHei", roboto, noto, "Noto Sans CJK TC", sans-serif;--RS__lineHeightCompensation:1.167}:lang(zh-HK){--RS__baseFontFamily:"方體", "PingFang HK", "方體", "PingFang TC", "黑體", "Heiti TC", "Microsoft JhengHei UI", "Microsoft JhengHei", roboto, noto, "Noto Sans CJK TC", sans-serif;--RS__lineHeightCompensation:1.167}:root{--RS__backgroundColor:#FFFFFF;--RS__textColor:#121212;--RS__selectionBackgroundColor:#b4d8fe;--RS__selectionTextColor:inherit}:root{color:var(--RS__textColor)!important;background-color:var(--RS__backgroundColor)!important}::-moz-selection{color:var(--RS__selectionTextColor);background-color:var(--RS__selectionBackgroundColor)}::selection{color:var(--RS__selectionTextColor);background-color:var(--RS__selectionBackgroundColor)}@font-face{font-family:AccessibleDfA;font-style:normal;font-weight:400;src:local("AccessibleDfA"),url(./assets/AccessibleDfA-Regular.woff2) format("woff2"),url(./assets/AccessibleDfA-Regular.woff) format("woff")}@font-face{font-family:AccessibleDfA;font-style:normal;font-weight:700;src:local("AccessibleDfA"),url(./assets/AccessibleDfA-Bold.woff2) format("woff2")}@font-face{font-family:AccessibleDfA;font-style:italic;font-weight:400;src:local("AccessibleDfA"),url(./assets/AccessibleDfA-Italic.woff2) format("woff2")}@font-face{font-family:IA Writer Duospace;font-style:normal;font-weight:400;src:local("iAWriterDuospace-Regular"),url(./assets/iAWriterDuospace-Regular.ttf) format("truetype")}body{widows:2;orphans:2}figcaption,th,td{widows:1;orphans:1}h2,h3,h4,h5,h6,dt,hr,caption{-webkit-column-break-after:avoid;page-break-after:avoid;break-after:avoid}h1,h2,h3,h4,h5,h6,dt,figure,tr{-webkit-column-break-inside:avoid;page-break-inside:avoid;break-inside:avoid}body{-webkit-hyphenate-character:"-";-moz-hyphenate-character:"-";-ms-hyphenate-character:"-";hyphenate-character:"-";-webkit-hyphenate-limit-lines:3;-ms-hyphenate-limit-lines:3;hyphenate-limit-lines:3}h1,h2,h3,h4,h5,h6,dt,figcaption,pre,caption,address,center,code,var{-ms-hyphens:none;-moz-hyphens:none;-webkit-hyphens:none;-epub-hyphens:none;hyphens:none}body{font-variant-numeric:oldstyle-nums proportional-nums}:lang(ja) body,:lang(zh) body,:lang(ko) body{font-variant-numeric:lining-nums proportional-nums}h1,h2,h3,h4,h5,h6,dt{font-variant-numeric:lining-nums proportional-nums}table{font-variant-numeric:lining-nums tabular-nums}code,var{font-variant-ligatures:none;font-variant-numeric:lining-nums tabular-nums slashed-zero}rt{font-variant-east-asian:ruby}:lang(ar){font-variant-ligatures:common-ligatures}:lang(ko){font-kerning:normal}hr{color:inherit;border-color:currentcolor}table,th,td{border-color:currentcolor}figure,blockquote{margin:1em 5%}ul,ol{padding-left:5%}dd{margin-left:5%}pre{white-space:pre-wrap;-ms-tab-size:2;-moz-tab-size:2;-webkit-tab-size:2;tab-size:2}abbr[title],acronym[title]{text-decoration:dotted underline}nobr wbr{white-space:normal}ruby>rt,ruby>rp{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}*:lang(ja):not(:lang(ja-Latn)):not(:lang(ja-Cyrl)),*:lang(zh):not(:lang(zh-Latn)):not(:lang(zh-Cyrl)),*:lang(ko):not(:lang(ko-Latn)):not(:lang(ko-Cyrl)),:lang(ja):not(:lang(ja-Latn)):not(:lang(ja-Cyrl)) cite,:lang(ja):not(:lang(ja-Latn)):not(:lang(ja-Cyrl)) dfn,:lang(ja):not(:lang(ja-Latn)):not(:lang(ja-Cyrl)) em,:lang(ja):not(:lang(ja-Latn)):not(:lang(ja-Cyrl)) i,:lang(zh):not(:lang(zh-Latn)):not(:lang(zh-Cyrl)) cite,:lang(zh):not(:lang(zh-Latn)):not(:lang(zh-Cyrl)) dfn,:lang(zh):not(:lang(zh-Latn)):not(:lang(zh-Cyrl)) em,:lang(zh):not(:lang(zh-Latn)):not(:lang(zh-Cyrl)) i,:lang(ko):not(:lang(ko-Latn)):not(:lang(ko-Cyrl)) cite,:lang(ko):not(:lang(ko-Latn)):not(:lang(ko-Cyrl)) dfn,:lang(ko):not(:lang(ko-Latn)):not(:lang(ko-Cyrl)) em,:lang(ko):not(:lang(ko-Latn)):not(:lang(ko-Cyrl)) i{font-style:normal}:lang(ja) a,:lang(zh) a,:lang(ko) a{text-decoration:none}:root{--RS__maxMediaWidth:100%;--RS__maxMediaHeight:95vh;--RS__boxSizingMedia:border-box;--RS__boxSizingTable:border-box}html{-webkit-line-box-contain:block glyphs replaced}:lang(ja){-webkit-line-box-contain:block inline replaced}a,h1,h2,h3,h4,h5,h6{word-wrap:break-word}div{max-width:var(--RS__maxMediaWidth)}img,svg,video{object-fit:contain;width:auto;height:auto;max-width:var(--RS__maxMediaWidth);max-height:var(--RS__maxMediaHeight)!important;box-sizing:var(--RS__boxSizingMedia);-webkit-column-break-inside:avoid;page-break-inside:avoid;break-inside:avoid}audio{max-width:100%;-webkit-column-break-inside:avoid;page-break-inside:avoid;break-inside:avoid}table{max-width:var(--RS__maxMediaWidth);box-sizing:var(--RS__boxSizingTable)}
|
|
1140
|
-
`,
|
|
1141
|
-
`,
|
|
1185
|
+
const Le = `@namespace url(http://www.w3.org/1999/xhtml);@namespace epub url(http://www.idpf.org/2007/ops);@namespace m url(http://www.w3.org/1998/Math/MathML/);@namespace svg url(http://www.w3.org/2000/svg);:root{--RS__colWidth:45em;--RS__colCount:1;--RS__colGap:0;--RS__maxLineLength:40rem;--RS__pageGutter:20px;--RS__viewportWidth:100%}@page{margin:0!important}:root{position:relative;-webkit-column-width:var(--RS__colWidth);-moz-column-width:var(--RS__colWidth);column-width:var(--RS__colWidth);-webkit-column-count:var(--RS__colCount);-moz-column-count:var(--RS__colCount);column-count:var(--RS__colCount);-webkit-column-gap:var(--RS__colGap);-moz-column-gap:var(--RS__colGap);column-gap:var(--RS__colGap);-moz-column-fill:auto;column-fill:auto;width:var(--RS__viewportWidth);height:100vh;max-width:var(--RS__viewportWidth);max-height:100vh;min-width:var(--RS__viewportWidth);min-height:100vh;padding:0!important;margin:0!important;font-size:100%!important;-webkit-text-size-adjust:100%;box-sizing:border-box;-webkit-perspective:1;-webkit-touch-callout:none}body{width:100%;max-width:var(--RS__maxLineLength)!important;padding:0 var(--RS__pageGutter)!important;margin:0 auto!important;box-sizing:border-box}@media screen and (min-width: 35em){:root{--RS__pageGutter:30px}}@media screen and (min-width: 45em){:root{--RS__pageGutter:40px}}@media screen and (min-width: 75em){:root{--RS__pageGutter:50px}}@media screen and (min-width: 60em),screen and (min-device-width: 36em) and (max-device-width: 47em) and (orientation: landscape){:root{--RS__colWidth:20em;--RS__colCount:2;--RS__maxLineLength:39.99rem}}:root[style*=readium-scroll-on]{-webkit-columns:auto auto!important;-moz-columns:auto auto!important;columns:auto auto!important;width:auto!important;height:auto!important;max-width:none!important;max-height:none!important;min-width:0!important;min-height:0!important}:root[style*=readium-scroll-on] body{--RS__maxLineLength:40rem !important}:root[style*=readium-night-on]{--RS__backgroundColor:#000000;--RS__textColor:#FEFEFE;--RS__linkColor:#63caff;--RS__visitedColor:#0099E5;--RS__selectionBackgroundColor:#b4d8fe;--RS__selectionTextColor:inherit}:root[style*=readium-night-on] *:not(a){color:inherit!important;background-color:transparent!important;border-color:currentcolor!important}:root[style*=readium-night-on] svg text{fill:currentcolor!important;stroke:none!important}:root[style*=readium-night-on] a:link,:root[style*=readium-night-on] a:link *{color:var(--RS__linkColor)!important}:root[style*=readium-night-on] a:visited,:root[style*=readium-night-on] a:visited *{color:var(--RS__visitedColor)!important}:root[style*=readium-night-on] img[class*=gaiji],:root[style*=readium-night-on] *[epub\\:type~=titlepage] img:only-child,:root[style*=readium-night-on] *[epub|type~=titlepage] img:only-child{-webkit-filter:invert(100%);filter:invert(100%)}:root[style*=readium-night-on][style*=readium-darken-on] img{-webkit-filter:brightness(80%);filter:brightness(80%)}:root[style*=readium-night-on][style*=readium-invert-on] img{-webkit-filter:invert(100%);filter:invert(100%)}:root[style*=readium-night-on][style*=readium-darken-on][style*=readium-invert-on] img{-webkit-filter:brightness(80%) invert(100%);filter:brightness(80%) invert(100%)}:root[style*=readium-sepia-on]{--RS__backgroundColor:#faf4e8;--RS__textColor:#121212;--RS__linkColor:#0000EE;--RS__visitedColor:#551A8B;--RS__selectionBackgroundColor:#b4d8fe;--RS__selectionTextColor:inherit;--RS__maxLineLength:40.01rem}:root[style*=readium-sepia-on] *:not(a){color:inherit!important;background-color:transparent!important}:root[style*=readium-sepia-on] a:link,:root[style*=readium-sepia-on] a:link *{color:var(--RS__linkColor)}:root[style*=readium-sepia-on] a:visited,:root[style*=readium-sepia-on] a:visited *{color:var(--RS__visitedColor)}:root[style*=readium-sepia-on] svg,:root[style*=readium-sepia-on] img{background-color:transparent!important;mix-blend-mode:multiply}@media screen and (-ms-high-contrast: active){:root{color:windowText!important;background-color:window!important}:root :not(#\\#):not(#\\#):not(#\\#),:root :not(#\\#):not(#\\#):not(#\\#) :not(#\\#):not(#\\#):not(#\\#) :root :not(#\\#):not(#\\#):not(#\\#) :not(#\\#):not(#\\#):not(#\\#) :not(#\\#):not(#\\#):not(#\\#){color:inherit!important;background-color:inherit!important}.readiumCSS-mo-active-default{color:highlightText!important;background-color:highlight!important}}@media screen and (-ms-high-contrast: white-on-black){:root[style*=readium-night-on] img[class*=gaiji],:root[style*=readium-night-on] *[epub\\:type~=titlepage] img:only-child,:root[style*=readium-night-on] *[epub|type~=titlepage] img:only-child{-webkit-filter:none!important;filter:none!important}:root[style*=readium-night-on][style*=readium-invert-on] img{-webkit-filter:none!important;filter:none!important}:root[style*=readium-night-on][style*=readium-darken-on][style*=readium-invert-on] img{-webkit-filter:brightness(80%);filter:brightness(80%)}}@media screen and (inverted-colors){:root[style*=readium-night-on] img[class*=gaiji],:root[style*=readium-night-on] *[epub\\:type~=titlepage] img:only-child,:root[style*=readium-night-on] *[epub|type~=titlepage] img:only-child{-webkit-filter:none!important;filter:none!important}:root[style*=readium-night-on][style*=readium-invert-on] img{-webkit-filter:none!important;filter:none!important}:root[style*=readium-night-on][style*=readium-darken-on][style*=readium-invert-on] img{-webkit-filter:brightness(80%);filter:brightness(80%)}}@media screen and (min-width: 60em),screen and (min-device-width: 36em) and (max-device-width: 47em) and (orientation: landscape){:root[style*="--USER__colCount: 1"],:root[style*="--USER__colCount:1"],:root[style*="--USER__colCount: 2"],:root[style*="--USER__colCount:2"]{-webkit-column-count:var(--USER__colCount);-moz-column-count:var(--USER__colCount);column-count:var(--USER__colCount)}:root[style*="--USER__colCount: 1"],:root[style*="--USER__colCount:1"]{--RS__maxLineLength:40rem !important;--RS__colWidth:100vw}:root[style*="--USER__colCount: 2"],:root[style*="--USER__colCount:2"]{--RS__colWidth:auto}}:root[style*=--USER__pageMargins] body{padding:0 calc(var(--RS__pageGutter) * var(--USER__pageMargins))!important}:root[style*=--USER__backgroundColor]{background-color:var(--USER__backgroundColor)!important}:root[style*=--USER__backgroundColor] *{background-color:transparent!important}:root[style*=--USER__textColor]{color:var(--USER__textColor)!important}:root[style*=--USER__textColor] *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(pre){color:inherit!important}:root[style*=readium-advanced-on][style*=--USER__textAlign]{text-align:var(--USER__textAlign)}:root[style*=readium-advanced-on][style*=--USER__textAlign] body,:root[style*=readium-advanced-on][style*=--USER__textAlign] *:not(blockquote):not(figcaption) p,:root[style*=readium-advanced-on][style*=--USER__textAlign] li{text-align:var(--USER__textAlign)!important;-moz-text-align-last:auto!important;-epub-text-align-last:auto!important;text-align-last:auto!important}:root[style*=readium-advanced-on][style*="--USER__textAlign: justify"] body,:root[style*=readium-advanced-on][style*="--USER__textAlign:justify"] body{-webkit-hyphens:auto;-moz-hyphens:auto;-ms-hyphens:auto;-epub-hyphens:auto;hyphens:auto}:root[style*=readium-advanced-on][style*="--USER__textAlign: left"] body,:root[style*=readium-advanced-on][style*="--USER__textAlign:left"] body,:root[style*=readium-advanced-on][style*="--USER__textAlign: right"] body,:root[style*=readium-advanced-on][style*="--USER__textAlign:right"] body{-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;-epub-hyphens:none;hyphens:none}:root[style*=readium-advanced-on][style*=--USER__bodyHyphens]{-webkit-hyphens:var(--USER__bodyHyphens)!important;-moz-hyphens:var(--USER__bodyHyphens)!important;-ms-hyphens:var(--USER__bodyHyphens)!important;-epub-hyphens:var(--USER__bodyHyphens)!important;hyphens:var(--USER__bodyHyphens)!important}:root[style*=readium-advanced-on][style*=--USER__bodyHyphens] body,:root[style*=readium-advanced-on][style*=--USER__bodyHyphens] p,:root[style*=readium-advanced-on][style*=--USER__bodyHyphens] li,:root[style*=readium-advanced-on][style*=--USER__bodyHyphens] div,:root[style*=readium-advanced-on][style*=--USER__bodyHyphens] dd{-webkit-hyphens:inherit;-moz-hyphens:inherit;-ms-hyphens:inherit;-epub-hyphens:inherit;hyphens:inherit}:root[style*=readium-font-on][style*=--USER__fontFamily]{font-family:var(--USER__fontFamily)!important}:root[style*=readium-font-on][style*=--USER__fontFamily] body,:root[style*=readium-font-on][style*=--USER__fontFamily] p,:root[style*=readium-font-on][style*=--USER__fontFamily] li,:root[style*=readium-font-on][style*=--USER__fontFamily] div,:root[style*=readium-font-on][style*=--USER__fontFamily] dt,:root[style*=readium-font-on][style*=--USER__fontFamily] dd{font-family:inherit!important}:root[style*=readium-font-on][style*=--USER__fontFamily] i:not([lang]),:root[style*=readium-font-on][style*=--USER__fontFamily] i:not([xml\\:lang]),:root[style*=readium-font-on][style*=--USER__fontFamily] em:not([lang]),:root[style*=readium-font-on][style*=--USER__fontFamily] em:not([xml\\:lang]),:root[style*=readium-font-on][style*=--USER__fontFamily] cite:not([lang]),:root[style*=readium-font-on][style*=--USER__fontFamily] cite:not([xml\\:lang]),:root[style*=readium-font-on][style*=--USER__fontFamily] b:not([lang]),:root[style*=readium-font-on][style*=--USER__fontFamily] b:not([xml\\:lang]),:root[style*=readium-font-on][style*=--USER__fontFamily] strong:not([lang]),:root[style*=readium-font-on][style*=--USER__fontFamily] strong:not([xml\\:lang]),:root[style*=readium-font-on][style*=--USER__fontFamily] span:not([lang]),:root[style*=readium-font-on][style*=--USER__fontFamily] span:not([xml\\:lang]){font-family:inherit!important}:root[style*=readium-font-on][style*=AccessibleDfA]{font-family:AccessibleDfA,Verdana,Tahoma,Trebuchet MS,sans-serif!important;--RS__lineHeightCompensation:1.167}:root[style*=readium-font-on][style*="IA Writer Duospace"]{font-family:IA Writer Duospace,Menlo,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier,monospace!important;--RS__lineHeightCompensation:1.167}:root[style*=readium-font-on][style*=readium-a11y-on]{font-family:var(--USER__fontFamily)!important;--RS__lineHeightCompensation:1.167}:root[style*=readium-font-on][style*=AccessibleDfA],:root[style*=readium-font-on][style*="IA Writer Duospace"],:root[style*=readium-font-on][style*=readium-a11y-on]{font-style:normal!important;font-weight:400!important}:root[style*=readium-font-on][style*=AccessibleDfA] *:not(code):not(var):not(kbd):not(samp),:root[style*=readium-font-on][style*="IA Writer Duospace"] *:not(code):not(var):not(kbd):not(samp),:root[style*=readium-font-on][style*=readium-a11y-on] *:not(code):not(var):not(kbd):not(samp){font-family:inherit!important;font-style:inherit!important;font-weight:inherit!important}:root[style*=readium-font-on][style*=AccessibleDfA] *,:root[style*=readium-font-on][style*="IA Writer Duospace"] *,:root[style*=readium-font-on][style*=readium-a11y-on] *{text-decoration:none!important;font-variant-caps:normal!important;font-variant-numeric:normal!important;font-variant-position:normal!important}:root[style*=readium-font-on][style*=AccessibleDfA] sup,:root[style*=readium-font-on][style*="IA Writer Duospace"] sup,:root[style*=readium-font-on][style*=readium-a11y-on] sup,:root[style*=readium-font-on][style*=AccessibleDfA] sub,:root[style*=readium-font-on][style*="IA Writer Duospace"] sub,:root[style*=readium-font-on][style*=readium-a11y-on] sub{font-size:1rem!important;vertical-align:baseline!important}:root[style*=--USER__fontSize]{font-size:var(--USER__fontSize)!important}:root[style*=readium-advanced-on][style*=--USER__lineHeight]{line-height:var(--USER__lineHeight)!important}:root[style*=readium-advanced-on][style*=--USER__lineHeight] body,:root[style*=readium-advanced-on][style*=--USER__lineHeight] p,:root[style*=readium-advanced-on][style*=--USER__lineHeight] li,:root[style*=readium-advanced-on][style*=--USER__lineHeight] div{line-height:inherit}:root[style*=readium-advanced-on][style*=--USER__paraSpacing] p{margin-top:var(--USER__paraSpacing)!important;margin-bottom:var(--USER__paraSpacing)!important}:root[style*=readium-advanced-on][style*=--USER__paraIndent] p{text-indent:var(--USER__paraIndent)!important}:root[style*=readium-advanced-on][style*=--USER__paraIndent] p *,:root[style*=readium-advanced-on][style*=--USER__paraIndent] p:first-letter{text-indent:0!important}:root[style*=readium-advanced-on][style*=--USER__wordSpacing] h1,:root[style*=readium-advanced-on][style*=--USER__wordSpacing] h2,:root[style*=readium-advanced-on][style*=--USER__wordSpacing] h3,:root[style*=readium-advanced-on][style*=--USER__wordSpacing] h4,:root[style*=readium-advanced-on][style*=--USER__wordSpacing] h5,:root[style*=readium-advanced-on][style*=--USER__wordSpacing] h6,:root[style*=readium-advanced-on][style*=--USER__wordSpacing] p,:root[style*=readium-advanced-on][style*=--USER__wordSpacing] li,:root[style*=readium-advanced-on][style*=--USER__wordSpacing] div{word-spacing:var(--USER__wordSpacing)}:root[style*=readium-advanced-on][style*=--USER__letterSpacing] h1,:root[style*=readium-advanced-on][style*=--USER__letterSpacing] h2,:root[style*=readium-advanced-on][style*=--USER__letterSpacing] h3,:root[style*=readium-advanced-on][style*=--USER__letterSpacing] h4,:root[style*=readium-advanced-on][style*=--USER__letterSpacing] h5,:root[style*=readium-advanced-on][style*=--USER__letterSpacing] h6,:root[style*=readium-advanced-on][style*=--USER__letterSpacing] p,:root[style*=readium-advanced-on][style*=--USER__letterSpacing] li,:root[style*=readium-advanced-on][style*=--USER__letterSpacing] div{letter-spacing:var(--USER__letterSpacing);font-variant:none}:root[style*=readium-advanced-on]{--USER__typeScale:1.2}:root[style*=readium-advanced-on] p,:root[style*=readium-advanced-on] li,:root[style*=readium-advanced-on] div,:root[style*=readium-advanced-on] pre,:root[style*=readium-advanced-on] dd{font-size:1rem!important}:root[style*=readium-advanced-on] h1{font-size:1.75rem!important;font-size:calc(((1rem * var(--USER__typeScale)) * var(--USER__typeScale)) * var(--USER__typeScale))!important}:root[style*=readium-advanced-on] h2{font-size:1.5rem!important;font-size:calc((1rem * var(--USER__typeScale)) * var(--USER__typeScale))!important}:root[style*=readium-advanced-on] h3{font-size:1.25rem!important;font-size:calc(1rem * var(--USER__typeScale))!important}:root[style*=readium-advanced-on] h4,:root[style*=readium-advanced-on] h5,:root[style*=readium-advanced-on] h6{font-size:1rem!important}:root[style*=readium-advanced-on] small{font-size:smaller!important}:root[style*=readium-advanced-on] sub,:root[style*=readium-advanced-on] sup{font-size:67.5%!important}:root[style*=readium-advanced-on][style*=--USER__typeScale] h1{font-size:calc(((1rem * var(--USER__typeScale)) * var(--USER__typeScale)) * var(--USER__typeScale))!important}:root[style*=readium-advanced-on][style*=--USER__typeScale] h2{font-size:calc((1rem * var(--USER__typeScale)) * var(--USER__typeScale))!important}:root[style*=readium-advanced-on][style*=--USER__typeScale] h3{font-size:calc(1rem * var(--USER__typeScale))!important}
|
|
1186
|
+
`, Oe = `@namespace url(http://www.w3.org/1999/xhtml);@namespace epub url(http://www.idpf.org/2007/ops);@namespace m url(http://www.w3.org/1998/Math/MathML/);@namespace svg url(http://www.w3.org/2000/svg);@-ms-viewport{width:device-width}@viewport{width:device-width;zoom:1}:root{--RS__oldStyleTf:"Iowan Old Style", "Sitka Text", palatino, "Book Antiqua", serif;--RS__modernTf:athelas, constantia, georgia, serif;--RS__sansTf:-apple-system, system-ui, blinkmacsystemfont, "Segoe UI", roboto, "Helvetica Neue", arial, sans-serif;--RS__humanistTf:seravek, calibri, roboto, arial, sans-serif;--RS__monospaceTf:"Andale Mono", consolas, monospace;--RS__baseFontFamily:var(--RS__oldStyleTf);--RS__lineHeightCompensation:1;--RS__baseLineHeight:calc((1em + (2ex - 1ch) - ((1rem - 16px) * .1667)) * var(--RS__lineHeightCompensation))}html{font-family:var(--RS__baseFontFamily);line-height:1.6;line-height:var(--RS__baseLineHeight);text-rendering:optimizelegibility}h1,h2,h3{line-height:normal}:lang(ja),:lang(zh),:lang(ko){word-wrap:break-word;-webkit-line-break:strict;-epub-line-break:strict;line-break:strict}math{font-family:"Latin Modern Math","STIX Two Math","XITS Math","STIX Math","Libertinus Math","TeX Gyre Termes Math","TeX Gyre Bonum Math",TeX Gyre Schola,"DejaVu Math TeX Gyre","TeX Gyre Pagella Math","Asana Math","Cambria Math","Lucida Bright Math","Minion Math",STIXGeneral,STIXSizeOneSym,Symbol,Times New Roman,serif}:lang(am){--RS__baseFontFamily:kefa, nyala, roboto, noto, "Noto Sans Ethiopic", serif;--RS__lineHeightCompensation:1.167}:lang(ar){--RS__baseFontFamily:"Geeza Pro", "Arabic Typesetting", roboto, noto, "Noto Naskh Arabic", "Times New Roman", serif}:lang(bn){--RS__baseFontFamily:"Kohinoor Bangla", "Bangla Sangam MN", vrinda, roboto, noto, "Noto Sans Bengali", sans-serif;--RS__lineHeightCompensation:1.067}:lang(bo){--RS__baseFontFamily:kailasa, "Microsoft Himalaya", roboto, noto, "Noto Sans Tibetan", sans-serif}:lang(chr){--RS__baseFontFamily:"Plantagenet Cherokee", roboto, noto, "Noto Sans Cherokee";--RS__lineHeightCompensation:1.167}:lang(fa){--RS__baseFontFamily:"Geeza Pro", "Arabic Typesetting", roboto, noto, "Noto Naskh Arabic", "Times New Roman", serif}:lang(gu){--RS__baseFontFamily:"Gujarati Sangam MN", "Nirmala UI", shruti, roboto, noto, "Noto Sans Gujarati", sans-serif;--RS__lineHeightCompensation:1.167}:lang(he){--RS__baseFontFamily:"New Peninim MT", "Arial Hebrew", gisha, "Times New Roman", roboto, noto, "Noto Sans Hebrew" sans-serif;--RS__lineHeightCompensation:1.1}:lang(hi){--RS__baseFontFamily:"Kohinoor Devanagari", "Devanagari Sangam MN", kokila, "Nirmala UI", roboto, noto, "Noto Sans Devanagari", sans-serif;--RS__lineHeightCompensation:1.1}:lang(hy){--RS__baseFontFamily:mshtakan, sylfaen, roboto, noto, "Noto Serif Armenian", serif}:lang(iu){--RS__baseFontFamily:"Euphemia UCAS", euphemia, roboto, noto, "Noto Sans Canadian Aboriginal", sans-serif}:lang(ja){--RS__baseFontFamily:yugothic, "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Meiryo UI", "MS Gothic", roboto, noto, "Noto Sans CJK JP", sans-serif;--RS__lineHeightCompensation:1.167;--RS__serif-ja:"Hiragino Mincho ProN", "Hiragino Mincho Pro", "YuMincho", "BIZ UDPMincho", "Yu Mincho", "MS P明朝", "MS PMincho", serif;--RS__sans-serif-ja:"Hiragino Sans", "Hiragino Kaku Gothic ProN", "Hiragino Kaku Gothic Pro", "ヒラギノ角ゴ W3", "YuGothic", "Yu Gothic Medium", "BIZ UDPGothic", "Yu Gothic", "MS Pゴシック", "MS PGothic", sans-serif;--RS__serif-ja-v:"Hiragino Mincho ProN", "Hiragino Mincho Pro", "YuMincho", "BIZ UDMincho", "Yu Mincho", "MS明朝", "MS Mincho", serif;--RS__sans-serif-ja-v:"Hiragino Sans", "Hiragino Kaku Gothic ProN", "Hiragino Kaku Gothic Pro", "ヒラギノ角ゴ W3", "YuGothic", "Yu Gothic Medium", "BIZ UDGothic", "Yu Gothic", "MSゴシック", "MS Gothic", sans-serif}:lang(km){--RS__baseFontFamily:"Khmer Sangam MN", "Leelawadee UI", "Khmer UI", roboto, noto, "Noto Sans Khmer", sans-serif;--RS__lineHeightCompensation:1.067}:lang(kn){--RS__baseFontFamily:"Kannada Sangam MN", "Nirmala UI", tunga, roboto, noto, "Noto Sans Kannada", sans-serif;--RS__lineHeightCompensation:1.1}:lang(ko){--RS__baseFontFamily:"Nanum Gothic", "Apple SD Gothic Neo", "Malgun Gothic", roboto, noto, "Noto Sans CJK KR", sans-serif;--RS__lineHeightCompensation:1.167}:lang(lo){--RS__baseFontFamily:"Lao Sangam MN", "Leelawadee UI", "Lao UI", roboto, noto, "Noto Sans Lao", sans-serif}:lang(ml){--RS__baseFontFamily:"Malayalam Sangam MN", "Nirmala UI", kartika, roboto, noto, "Noto Sans Malayalam", sans-serif;--RS__lineHeightCompensation:1.067}:lang(or){--RS__baseFontFamily:"Oriya Sangam MN", "Nirmala UI", kalinga, roboto, noto, "Noto Sans Oriya", sans-serif;--RS__lineHeightCompensation:1.167}:lang(pa){--RS__baseFontFamily:"Gurmukhi MN", "Nirmala UI", kartika, roboto, noto, "Noto Sans Gurmukhi", sans-serif;--RS__lineHeightCompensation:1.1}:lang(si){--RS__baseFontFamily:"Sinhala Sangam MN", "Nirmala UI", "Iskoola Pota", roboto, noto, "Noto Sans Sinhala", sans-serif;--RS__lineHeightCompensation:1.167}:lang(ta){--RS__baseFontFamily:"Tamil Sangam MN", "Nirmala UI", latha, roboto, noto, "Noto Sans Tamil", sans-serif;--RS__lineHeightCompensation:1.067}:lang(te){--RS__baseFontFamily:"Kohinoor Telugu", "Telugu Sangam MN", "Nirmala UI", gautami, roboto, noto, "Noto Sans Telugu", sans-serif}:lang(th){--RS__baseFontFamily:"Thonburi", "Leelawadee UI", "Cordia New", roboto, noto, "Noto Sans Thai", sans-serif;--RS__lineHeightCompensation:1.067}:lang(zh){--RS__baseFontFamily:"方体", "PingFang SC", "黑体", "Heiti SC", "Microsoft JhengHei UI", "Microsoft JhengHei", roboto, noto, "Noto Sans CJK SC", sans-serif;--RS__lineHeightCompensation:1.167}:lang(zh-Hant),:lang(zh-TW){--RS__baseFontFamily:"方體", "PingFang TC", "黑體", "Heiti TC", "Microsoft JhengHei UI", "Microsoft JhengHei", roboto, noto, "Noto Sans CJK TC", sans-serif;--RS__lineHeightCompensation:1.167}:lang(zh-HK){--RS__baseFontFamily:"方體", "PingFang HK", "方體", "PingFang TC", "黑體", "Heiti TC", "Microsoft JhengHei UI", "Microsoft JhengHei", roboto, noto, "Noto Sans CJK TC", sans-serif;--RS__lineHeightCompensation:1.167}:root{--RS__backgroundColor:#FFFFFF;--RS__textColor:#121212;--RS__selectionBackgroundColor:#b4d8fe;--RS__selectionTextColor:inherit}:root{color:var(--RS__textColor)!important;background-color:var(--RS__backgroundColor)!important}::-moz-selection{color:var(--RS__selectionTextColor);background-color:var(--RS__selectionBackgroundColor)}::selection{color:var(--RS__selectionTextColor);background-color:var(--RS__selectionBackgroundColor)}@font-face{font-family:AccessibleDfA;font-style:normal;font-weight:400;src:local("AccessibleDfA"),url(./assets/AccessibleDfA-Regular.woff2) format("woff2"),url(./assets/AccessibleDfA-Regular.woff) format("woff")}@font-face{font-family:AccessibleDfA;font-style:normal;font-weight:700;src:local("AccessibleDfA"),url(./assets/AccessibleDfA-Bold.woff2) format("woff2")}@font-face{font-family:AccessibleDfA;font-style:italic;font-weight:400;src:local("AccessibleDfA"),url(./assets/AccessibleDfA-Italic.woff2) format("woff2")}@font-face{font-family:IA Writer Duospace;font-style:normal;font-weight:400;src:local("iAWriterDuospace-Regular"),url(./assets/iAWriterDuospace-Regular.ttf) format("truetype")}body{widows:2;orphans:2}figcaption,th,td{widows:1;orphans:1}h2,h3,h4,h5,h6,dt,hr,caption{-webkit-column-break-after:avoid;page-break-after:avoid;break-after:avoid}h1,h2,h3,h4,h5,h6,dt,figure,tr{-webkit-column-break-inside:avoid;page-break-inside:avoid;break-inside:avoid}body{-webkit-hyphenate-character:"-";-moz-hyphenate-character:"-";-ms-hyphenate-character:"-";hyphenate-character:"-";-webkit-hyphenate-limit-lines:3;-ms-hyphenate-limit-lines:3;hyphenate-limit-lines:3}h1,h2,h3,h4,h5,h6,dt,figcaption,pre,caption,address,center,code,var{-ms-hyphens:none;-moz-hyphens:none;-webkit-hyphens:none;-epub-hyphens:none;hyphens:none}body{font-variant-numeric:oldstyle-nums proportional-nums}:lang(ja) body,:lang(zh) body,:lang(ko) body{font-variant-numeric:lining-nums proportional-nums}h1,h2,h3,h4,h5,h6,dt{font-variant-numeric:lining-nums proportional-nums}table{font-variant-numeric:lining-nums tabular-nums}code,var{font-variant-ligatures:none;font-variant-numeric:lining-nums tabular-nums slashed-zero}rt{font-variant-east-asian:ruby}:lang(ar){font-variant-ligatures:common-ligatures}:lang(ko){font-kerning:normal}hr{color:inherit;border-color:currentcolor}table,th,td{border-color:currentcolor}figure,blockquote{margin:1em 5%}ul,ol{padding-left:5%}dd{margin-left:5%}pre{white-space:pre-wrap;-ms-tab-size:2;-moz-tab-size:2;-webkit-tab-size:2;tab-size:2}abbr[title],acronym[title]{text-decoration:dotted underline}nobr wbr{white-space:normal}ruby>rt,ruby>rp{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}*:lang(ja):not(:lang(ja-Latn)):not(:lang(ja-Cyrl)),*:lang(zh):not(:lang(zh-Latn)):not(:lang(zh-Cyrl)),*:lang(ko):not(:lang(ko-Latn)):not(:lang(ko-Cyrl)),:lang(ja):not(:lang(ja-Latn)):not(:lang(ja-Cyrl)) cite,:lang(ja):not(:lang(ja-Latn)):not(:lang(ja-Cyrl)) dfn,:lang(ja):not(:lang(ja-Latn)):not(:lang(ja-Cyrl)) em,:lang(ja):not(:lang(ja-Latn)):not(:lang(ja-Cyrl)) i,:lang(zh):not(:lang(zh-Latn)):not(:lang(zh-Cyrl)) cite,:lang(zh):not(:lang(zh-Latn)):not(:lang(zh-Cyrl)) dfn,:lang(zh):not(:lang(zh-Latn)):not(:lang(zh-Cyrl)) em,:lang(zh):not(:lang(zh-Latn)):not(:lang(zh-Cyrl)) i,:lang(ko):not(:lang(ko-Latn)):not(:lang(ko-Cyrl)) cite,:lang(ko):not(:lang(ko-Latn)):not(:lang(ko-Cyrl)) dfn,:lang(ko):not(:lang(ko-Latn)):not(:lang(ko-Cyrl)) em,:lang(ko):not(:lang(ko-Latn)):not(:lang(ko-Cyrl)) i{font-style:normal}:lang(ja) a,:lang(zh) a,:lang(ko) a{text-decoration:none}:root{--RS__maxMediaWidth:100%;--RS__maxMediaHeight:95vh;--RS__boxSizingMedia:border-box;--RS__boxSizingTable:border-box}html{-webkit-line-box-contain:block glyphs replaced}:lang(ja){-webkit-line-box-contain:block inline replaced}a,h1,h2,h3,h4,h5,h6{word-wrap:break-word}div{max-width:var(--RS__maxMediaWidth)}img,svg,video{object-fit:contain;width:auto;height:auto;max-width:var(--RS__maxMediaWidth);max-height:var(--RS__maxMediaHeight)!important;box-sizing:var(--RS__boxSizingMedia);-webkit-column-break-inside:avoid;page-break-inside:avoid;break-inside:avoid}audio{max-width:100%;-webkit-column-break-inside:avoid;page-break-inside:avoid;break-inside:avoid}table{max-width:var(--RS__maxMediaWidth);box-sizing:var(--RS__boxSizingTable)}
|
|
1187
|
+
`, Xe = `@namespace url(http://www.w3.org/1999/xhtml);@namespace epub url(http://www.idpf.org/2007/ops);@namespace m url(http://www.w3.org/1998/Math/MathML/);@namespace svg url(http://www.w3.org/2000/svg);:root{--RS__compFontFamily:var(--RS__baseFontFamily);--RS__codeFontFamily:var(--RS__monospaceTf);--RS__typeScale:1.125;--RS__baseFontSize:100%;--RS__flowSpacing:1.5rem;--RS__paraSpacing:0;--RS__paraIndent:1em;--RS__linkColor:#0000EE;--RS__visitedColor:#551A8B;--RS__primaryColor:;--RS__secondaryColor:}body{font-size:var(--RS__baseFontSize)}h1,h2,h3,h4,h5,h6{font-family:var(--RS__compFontFamily)}blockquote,figure,p,pre,aside,footer,form,hr{margin-top:var(--RS__flowSpacing);margin-bottom:var(--RS__flowSpacing)}p{margin-top:var(--RS__paraSpacing);margin-bottom:var(--RS__paraSpacing);text-indent:var(--RS__paraIndent)}h1+p,h2+p,h3+p,h4+p,h5+p,h6+p,hr+p{text-indent:0}pre{font-family:var(--RS__codeFontFamily)}code,kbd,samp,tt{font-family:var(--RS__codeFontFamily)}sub,sup{position:relative;font-size:67.5%;line-height:1}sub{bottom:-.2ex}sup{bottom:0}:link{color:var(--RS__linkColor)}:visited{color:var(--RS__visitedColor)}h1{margin-top:calc(var(--RS__flowSpacing) * 2);margin-bottom:calc(var(--RS__flowSpacing) * 2);font-size:calc(((1em * var(--RS__typeScale)) * var(--RS__typeScale)) * var(--RS__typeScale))}h2{margin-top:calc(var(--RS__flowSpacing) * 2);margin-bottom:var(--RS__flowSpacing);font-size:calc((1em * var(--RS__typeScale)) * var(--RS__typeScale))}h3{margin-top:var(--RS__flowSpacing);margin-bottom:var(--RS__flowSpacing);font-size:calc(1em * var(--RS__typeScale))}h4{margin-top:var(--RS__flowSpacing);margin-bottom:var(--RS__flowSpacing);font-size:1em}h5{margin-top:var(--RS__flowSpacing);margin-bottom:var(--RS__flowSpacing);font-size:1em;font-variant:small-caps}h6{margin-top:var(--RS__flowSpacing);margin-bottom:0;font-size:1em;text-transform:lowercase;font-variant:small-caps}dl,ol,ul{margin-top:var(--RS__flowSpacing);margin-bottom:var(--RS__flowSpacing)}table{margin:var(--RS__flowSpacing) 0;border:1px solid currentcolor;border-collapse:collapse;empty-cells:show}thead,tbody,tfoot,table>tr{vertical-align:top}th{text-align:left}th,td{padding:4px;border:1px solid currentcolor}
|
|
1188
|
+
`, W = (i, A) => URL.createObjectURL(new Blob([i], { type: A })), Zt = (i) => i.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").replace(/\n/g, "").replace(/\s+/g, " "), NA = (i) => i.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g, "").replace(/ {2,}/g, " ").replace(/url\((?!(https?:)?\/\/)("?)\/([^\)]+)/g, `url($2${window.location.origin}/$3`), KA = (i, A) => {
|
|
1142
1189
|
const t = i.createElement("script");
|
|
1143
|
-
return t.dataset.readium = "true", t.src = A.startsWith("blob:") ? A :
|
|
1144
|
-
},
|
|
1190
|
+
return t.dataset.readium = "true", t.src = A.startsWith("blob:") ? A : W(A, "text/javascript"), t;
|
|
1191
|
+
}, TA = (i, A) => {
|
|
1145
1192
|
const t = i.createElement("link");
|
|
1146
|
-
return t.dataset.readium = "true", t.rel = "stylesheet", t.type = "text/css", t.href = A.startsWith("blob:") ? A :
|
|
1147
|
-
},
|
|
1148
|
-
if (
|
|
1149
|
-
return
|
|
1193
|
+
return t.dataset.readium = "true", t.rel = "stylesheet", t.type = "text/css", t.href = A.startsWith("blob:") ? A : W(A, "text/css"), t;
|
|
1194
|
+
}, xA = /* @__PURE__ */ new Map(), iA = (i, A) => {
|
|
1195
|
+
if (xA.has(i))
|
|
1196
|
+
return xA.get(i);
|
|
1150
1197
|
const t = A();
|
|
1151
|
-
return
|
|
1152
|
-
},
|
|
1198
|
+
return xA.set(i, t), t;
|
|
1199
|
+
}, Ze = (i) => KA(i, iA("css-selector-generator", () => W(
|
|
1153
1200
|
'!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,e,n={d:(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[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})}},o={};function r(t){return t&&t instanceof Element}function i(t="unknown problem",...e){console.warn(`CssSelectorGenerator: ${t}`,...e)}n.r(o),n.d(o,{default:()=>z,getCssSelector:()=>U}),function(t){t.NONE="none",t.DESCENDANT="descendant",t.CHILD="child"}(t||(t={})),function(t){t.id="id",t.class="class",t.tag="tag",t.attribute="attribute",t.nthchild="nthchild",t.nthoftype="nthoftype"}(e||(e={}));const c={selectors:[e.id,e.class,e.tag,e.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY};function u(t){return t instanceof RegExp}function s(t){return["string","function"].includes(typeof t)||u(t)}function l(t){return Array.isArray(t)?t.filter(s):[]}function a(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 f(t,e){if(a(t))return t.contains(e)||i("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 nto work as intended."),t;const n=e.getRootNode({composed:!1});return a(n)?(n!==document&&i("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):e.ownerDocument.querySelector(":root")}function d(t){return"number"==typeof t?t:Number.POSITIVE_INFINITY}function m(t=[]){const[e=[],...n]=t;return 0===n.length?e:n.reduce(((t,e)=>t.filter((t=>e.includes(t)))),e)}function p(t){return[].concat(...t)}function h(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?(i("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 i("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 g(t,e,n){const o=Array.from(f(n,t[0]).querySelectorAll(e));return o.length===t.length&&t.every((t=>o.includes(t)))}function y(t,e){e=null!=e?e:function(t){return t.ownerDocument.querySelector(":root")}(t);const n=[];let o=t;for(;r(o)&&o!==e;)n.push(o),o=o.parentElement;return n}function b(t,e){return m(t.map((t=>y(t,e))))}const N={[t.NONE]:{type:t.NONE,value:""},[t.DESCENDANT]:{type:t.DESCENDANT,value:" > "},[t.CHILD]:{type:t.CHILD,value:" "}},S=new RegExp(["^$","\\\\s"].join("|")),E=new RegExp(["^$"].join("|")),w=[e.nthoftype,e.tag,e.id,e.class,e.attribute,e.nthchild],v=h(["class","id","ng-*"]);function C({nodeName:t}){return`[${t}]`}function O({nodeName:t,nodeValue:e}){return`[${t}=\'${L(e)}\']`}function T(t){const e=Array.from(t.attributes).filter((e=>function({nodeName:t},e){const n=e.tagName.toLowerCase();return!(["input","option"].includes(n)&&"value"===t||v(t))}(e,t)));return[...e.map(C),...e.map(O)]}function I(t){return(t.getAttribute("class")||"").trim().split(/\\s+/).filter((t=>!E.test(t))).map((t=>`.${L(t)}`))}function x(t){const e=t.getAttribute("id")||"",n=`#${L(e)}`,o=t.getRootNode({composed:!1});return!S.test(e)&&g([t],n,o)?[n]:[]}function j(t){const e=t.parentNode;if(e){const n=Array.from(e.childNodes).filter(r).indexOf(t);if(n>-1)return[`:nth-child(${n+1})`]}return[]}function A(t){return[L(t.tagName.toLowerCase())]}function D(t){const e=[...new Set(p(t.map(A)))];return 0===e.length||e.length>1?[]:[e[0]]}function $(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(${r+1})`]}return[]}function R(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){const n=[];let o=0,r=k(1);for(;r.length<=t.length&&o<e;)o+=1,n.push(r.map((e=>t[e]))),r=P(r,t.length-1);return n}function P(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 k(n+1);o[t-1]++,o[t]=o[t-1]+1}return o[n-1]>e?k(n+1):o}function k(t=1){return Array.from(Array(t).keys())}const _=":".charCodeAt(0).toString(16).toUpperCase(),M=/[ !"#$%&\'()\\[\\]{|}<>*+,./;=?@^`~\\\\]/;function L(t=""){var e,n;return null!==(n=null===(e=null===CSS||void 0===CSS?void 0:CSS.escape)||void 0===e?void 0:e.call(CSS,t))&&void 0!==n?n:function(t=""){return t.split("").map((t=>":"===t?`\\\\${_} `:M.test(t)?`\\\\${t}`:escape(t).replace(/%/g,"\\\\"))).join("")}(t)}const q={tag:D,id:function(t){return 0===t.length||t.length>1?[]:x(t[0])},class:function(t){return m(t.map(I))},attribute:function(t){return m(t.map(T))},nthchild:function(t){return m(t.map(j))},nthoftype:function(t){return m(t.map($))}},F={tag:A,id:x,class:I,attribute:T,nthchild:j,nthoftype:$};function V(t){return t.includes(e.tag)||t.includes(e.nthoftype)?[...t]:[...t,e.tag]}function Y(t={}){const n=[...w];return t[e.tag]&&t[e.nthoftype]&&n.splice(n.indexOf(e.tag),1),n.map((e=>{return(o=t)[n=e]?o[n].join(""):"";var n,o})).join("")}function B(t,e,n="",o){const r=function(t,e){return""===e?t:function(t,e){return[...t.map((t=>e+" "+t)),...t.map((t=>e+" > "+t))]}(t,e)}(function(t,e,n){const o=function(t,e){const{blacklist:n,whitelist:o,combineWithinSelector:r,maxCombinations:i}=e,c=h(n),u=h(o);return function(t){const{selectors:e,includeTag:n}=t,o=[].concat(e);return n&&!o.includes("tag")&&o.push("tag"),o}(e).reduce(((e,n)=>{const o=function(t,e){var n;return(null!==(n=q[e])&&void 0!==n?n:()=>[])(t)}(t,n),s=function(t=[],e,n){return t.filter((t=>n(t)||!e(t)))}(o,c,u),l=function(t=[],e){return t.sort(((t,n)=>{const o=e(t),r=e(n);return o&&!r?-1:!o&&r?1:0}))}(s,u);return e[n]=r?R(l,{maxResults:i}):l.map((t=>[t])),e}),{})}(t,n),r=function(t,e){return function(t){const{selectors:e,combineBetweenSelectors:n,includeTag:o,maxCandidates:r}=t,i=n?R(e,{maxResults:r}):e.map((t=>[t]));return o?i.map(V):i}(e).map((e=>function(t,e){const n={};return t.forEach((t=>{const o=e[t];o.length>0&&(n[t]=o)})),function(t={}){let e=[];return Object.entries(t).forEach((([t,n])=>{e=n.flatMap((n=>0===e.length?[{[t]:n}]:e.map((e=>Object.assign(Object.assign({},e),{[t]:n})))))})),e}(n).map(Y)}(e,t))).filter((t=>t.length>0))}(o,n),i=p(r);return[...new Set(i)]}(t,o.root,o),n);for(const e of r)if(g(t,e,o.root))return e;return null}function G(t){return{value:t,include:!1}}function W({selectors:t,operator:n}){let o=[...w];t[e.tag]&&t[e.nthoftype]&&(o=o.filter((t=>t!==e.tag)));let r="";return o.forEach((e=>{(t[e]||[]).forEach((({value:t,include:e})=>{e&&(r+=t)}))})),n.value+r}function H(n){return[":root",...y(n).reverse().map((n=>{const o=function(e,n,o=t.NONE){const r={};return n.forEach((t=>{Reflect.set(r,t,function(t,e){return F[e](t)}(e,t).map(G))})),{element:e,operator:N[o],selectors:r}}(n,[e.nthchild],t.DESCENDANT);return o.selectors.nthchild.forEach((t=>{t.include=!0})),o})).map(W)].join("")}function U(t,n={}){const o=function(t){const e=(Array.isArray(t)?t:[t]).filter(r);return[...new Set(e)]}(t),i=function(t,n={}){const o=Object.assign(Object.assign({},c),n);return{selectors:(r=o.selectors,Array.isArray(r)?r.filter((t=>{return n=e,o=t,Object.values(n).includes(o);var n,o})):[]),whitelist:l(o.whitelist),blacklist:l(o.blacklist),root:f(o.root,t),combineWithinSelector:!!o.combineWithinSelector,combineBetweenSelectors:!!o.combineBetweenSelectors,includeTag:!!o.includeTag,maxCombinations:d(o.maxCombinations),maxCandidates:d(o.maxCandidates)};var r}(o[0],n);let u="",s=i.root;function a(){return function(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){const e=B(t,0,n,o);if(e)return{foundElements:t,selector:e}}return null}(o,s,u,i)}let m=a();for(;m;){const{foundElements:t,selector:e}=m;if(g(o,e,i.root))return e;s=t[0],u=e,m=a()}return o.length>1?o.map((t=>U(t,i))).join(", "):function(t){return t.map(H).join(", ")}(o)}const z=U;return o})()));',
|
|
1154
1201
|
"text/javascript"
|
|
1155
|
-
))),
|
|
1202
|
+
))), Ke = (i) => KA(i, iA("JS-Before", () => W(Zt(
|
|
1156
1203
|
`
|
|
1157
1204
|
window._readium_blockedEvents = [];
|
|
1158
1205
|
window._readium_blockEvents = true;
|
|
@@ -1166,7 +1213,7 @@ const Se = `@namespace url(http://www.w3.org/1999/xhtml);@namespace epub url(htt
|
|
|
1166
1213
|
};
|
|
1167
1214
|
window.addEventListener("DOMContentLoaded", window._readium_eventBlocker, true);
|
|
1168
1215
|
window.addEventListener("load", window._readium_eventBlocker, true);`
|
|
1169
|
-
), "text/javascript"))),
|
|
1216
|
+
), "text/javascript"))), qe = (i) => KA(i, iA("JS-After", () => W(Zt(
|
|
1170
1217
|
`
|
|
1171
1218
|
if(window.onload) window.onload = new Proxy(window.onload, {
|
|
1172
1219
|
apply: function(target, receiver, args) {
|
|
@@ -1180,7 +1227,7 @@ const Se = `@namespace url(http://www.w3.org/1999/xhtml);@namespace epub url(htt
|
|
|
1180
1227
|
}
|
|
1181
1228
|
});`
|
|
1182
1229
|
), "text/javascript")));
|
|
1183
|
-
class
|
|
1230
|
+
class Kt {
|
|
1184
1231
|
constructor(A, t, e) {
|
|
1185
1232
|
this.pub = A, this.item = e, this.burl = e.toURL(t) || "";
|
|
1186
1233
|
}
|
|
@@ -1223,10 +1270,10 @@ class Xt {
|
|
|
1223
1270
|
if (!A)
|
|
1224
1271
|
return "";
|
|
1225
1272
|
if (!n) {
|
|
1226
|
-
const s =
|
|
1273
|
+
const s = TA(A, iA("ReadiumCSS-before", () => W(NA(Oe), "text/css")));
|
|
1227
1274
|
A.head.firstChild ? A.head.firstChild.before(s) : A.head.appendChild(s);
|
|
1228
1275
|
const o = A.createElement("style");
|
|
1229
|
-
o.dataset.readium = "true", o.innerHTML = "audio[controls] { width: revert; height: revert; }", s.after(o), this.hasStyle(A) || s.after(
|
|
1276
|
+
o.dataset.readium = "true", o.innerHTML = "audio[controls] { width: revert; height: revert; }", s.after(o), this.hasStyle(A) || s.after(TA(A, iA("ReadiumCSS-default", () => W(NA(Xe), "text/css")))), A.head.appendChild(TA(A, iA("ReadiumCSS-after", () => W(NA(Le), "text/css"))));
|
|
1230
1277
|
}
|
|
1231
1278
|
if (A.body.querySelectorAll("img").forEach((s) => {
|
|
1232
1279
|
s.setAttribute("fetchpriority", "high");
|
|
@@ -1235,7 +1282,7 @@ class Xt {
|
|
|
1235
1282
|
s.href = t, s.dataset.readium = "true", A.head.firstChild.before(s);
|
|
1236
1283
|
}
|
|
1237
1284
|
const r = this.hasExecutable(A);
|
|
1238
|
-
return r && A.head.firstChild.before(
|
|
1285
|
+
return r && A.head.firstChild.before(Ke(A)), A.head.firstChild.before(Ze(A)), r && A.head.appendChild(qe(A)), URL.createObjectURL(
|
|
1239
1286
|
new Blob([new XMLSerializer().serializeToString(A)], {
|
|
1240
1287
|
type: e.isHTML ? e.string : "application/xhtml+xml"
|
|
1241
1288
|
// Fallback to XHTML
|
|
@@ -1243,8 +1290,8 @@ class Xt {
|
|
|
1243
1290
|
);
|
|
1244
1291
|
}
|
|
1245
1292
|
}
|
|
1246
|
-
const
|
|
1247
|
-
class
|
|
1293
|
+
const _e = Math.pow(2, 32), ht = () => Math.round(Math.random() * _e).toString(36), bA = () => `${Math.round(performance.now())}-${ht()}-${ht()}`, eA = 1;
|
|
1294
|
+
class $e {
|
|
1248
1295
|
constructor(A) {
|
|
1249
1296
|
this.destination = null, this.registrar = /* @__PURE__ */ new Map(), this.origin = "", this.channelId = "", this.receiver = this.receive.bind(this), this.preLog = [], this.wnd = A, A.addEventListener("message", this.receiver);
|
|
1250
1297
|
}
|
|
@@ -1257,8 +1304,8 @@ class Je {
|
|
|
1257
1304
|
if (!(!("_readium" in t) || !t._readium || t._readium <= 0)) {
|
|
1258
1305
|
if (t.key === "_ping") {
|
|
1259
1306
|
if (!this.destination) {
|
|
1260
|
-
if (this.destination = A.source, this.origin = A.origin, this.channelId = t._channel, t._readium !==
|
|
1261
|
-
t._readium >
|
|
1307
|
+
if (this.destination = A.source, this.origin = A.origin, this.channelId = t._channel, t._readium !== eA) {
|
|
1308
|
+
t._readium > eA ? this.send("error", `received comms version ${t._readium} higher than ${eA}`) : this.send("error", `received comms version ${t._readium} lower than ${eA}`), this.destination = null, this.origin = "", this.channelId = "";
|
|
1262
1309
|
return;
|
|
1263
1310
|
}
|
|
1264
1311
|
this.send("_pong", void 0), this.preLog.forEach((e) => this.send("log", e)), this.preLog = [];
|
|
@@ -1321,9 +1368,9 @@ class Je {
|
|
|
1321
1368
|
if (!this.destination)
|
|
1322
1369
|
throw Error("Attempted to send comms message before destination has been initialized");
|
|
1323
1370
|
const r = {
|
|
1324
|
-
_readium:
|
|
1371
|
+
_readium: eA,
|
|
1325
1372
|
_channel: this.channelId,
|
|
1326
|
-
id: e ??
|
|
1373
|
+
id: e ?? bA(),
|
|
1327
1374
|
// scrict,
|
|
1328
1375
|
key: A,
|
|
1329
1376
|
data: t
|
|
@@ -1340,340 +1387,6 @@ class Je {
|
|
|
1340
1387
|
}
|
|
1341
1388
|
}
|
|
1342
1389
|
}
|
|
1343
|
-
class CA {
|
|
1344
|
-
}
|
|
1345
|
-
var Z = [], Pe = function() {
|
|
1346
|
-
return Z.some(function(i) {
|
|
1347
|
-
return i.activeTargets.length > 0;
|
|
1348
|
-
});
|
|
1349
|
-
}, ke = function() {
|
|
1350
|
-
return Z.some(function(i) {
|
|
1351
|
-
return i.skippedTargets.length > 0;
|
|
1352
|
-
});
|
|
1353
|
-
}, ht = "ResizeObserver loop completed with undelivered notifications.", We = function() {
|
|
1354
|
-
var i;
|
|
1355
|
-
typeof ErrorEvent == "function" ? i = new ErrorEvent("error", {
|
|
1356
|
-
message: ht
|
|
1357
|
-
}) : (i = document.createEvent("Event"), i.initEvent("error", !1, !1), i.message = ht), window.dispatchEvent(i);
|
|
1358
|
-
}, lA;
|
|
1359
|
-
(function(i) {
|
|
1360
|
-
i.BORDER_BOX = "border-box", i.CONTENT_BOX = "content-box", i.DEVICE_PIXEL_CONTENT_BOX = "device-pixel-content-box";
|
|
1361
|
-
})(lA || (lA = {}));
|
|
1362
|
-
var K = function(i) {
|
|
1363
|
-
return Object.freeze(i);
|
|
1364
|
-
}, Le = function() {
|
|
1365
|
-
function i(A, t) {
|
|
1366
|
-
this.inlineSize = A, this.blockSize = t, K(this);
|
|
1367
|
-
}
|
|
1368
|
-
return i;
|
|
1369
|
-
}(), Zt = function() {
|
|
1370
|
-
function i(A, t, e, n) {
|
|
1371
|
-
return this.x = A, this.y = t, this.width = e, this.height = n, this.top = this.y, this.left = this.x, this.bottom = this.top + this.height, this.right = this.left + this.width, K(this);
|
|
1372
|
-
}
|
|
1373
|
-
return i.prototype.toJSON = function() {
|
|
1374
|
-
var A = this, t = A.x, e = A.y, n = A.top, r = A.right, s = A.bottom, o = A.left, a = A.width, h = A.height;
|
|
1375
|
-
return { x: t, y: e, top: n, right: r, bottom: s, left: o, width: a, height: h };
|
|
1376
|
-
}, i.fromRect = function(A) {
|
|
1377
|
-
return new i(A.x, A.y, A.width, A.height);
|
|
1378
|
-
}, i;
|
|
1379
|
-
}(), KA = function(i) {
|
|
1380
|
-
return i instanceof SVGElement && "getBBox" in i;
|
|
1381
|
-
}, Kt = function(i) {
|
|
1382
|
-
if (KA(i)) {
|
|
1383
|
-
var A = i.getBBox(), t = A.width, e = A.height;
|
|
1384
|
-
return !t && !e;
|
|
1385
|
-
}
|
|
1386
|
-
var n = i, r = n.offsetWidth, s = n.offsetHeight;
|
|
1387
|
-
return !(r || s || i.getClientRects().length);
|
|
1388
|
-
}, ct = function(i) {
|
|
1389
|
-
var A;
|
|
1390
|
-
if (i instanceof Element)
|
|
1391
|
-
return !0;
|
|
1392
|
-
var t = (A = i == null ? void 0 : i.ownerDocument) === null || A === void 0 ? void 0 : A.defaultView;
|
|
1393
|
-
return !!(t && i instanceof t.Element);
|
|
1394
|
-
}, Oe = function(i) {
|
|
1395
|
-
switch (i.tagName) {
|
|
1396
|
-
case "INPUT":
|
|
1397
|
-
if (i.type !== "image")
|
|
1398
|
-
break;
|
|
1399
|
-
case "VIDEO":
|
|
1400
|
-
case "AUDIO":
|
|
1401
|
-
case "EMBED":
|
|
1402
|
-
case "OBJECT":
|
|
1403
|
-
case "CANVAS":
|
|
1404
|
-
case "IFRAME":
|
|
1405
|
-
case "IMG":
|
|
1406
|
-
return !0;
|
|
1407
|
-
}
|
|
1408
|
-
return !1;
|
|
1409
|
-
}, hA = typeof window < "u" ? window : {}, MA = /* @__PURE__ */ new WeakMap(), lt = /auto|scroll/, Xe = /^tb|vertical/, Ze = /msie|trident/i.test(hA.navigator && hA.navigator.userAgent), D = function(i) {
|
|
1410
|
-
return parseFloat(i || "0");
|
|
1411
|
-
}, tA = function(i, A, t) {
|
|
1412
|
-
return i === void 0 && (i = 0), A === void 0 && (A = 0), t === void 0 && (t = !1), new Le((t ? A : i) || 0, (t ? i : A) || 0);
|
|
1413
|
-
}, gt = K({
|
|
1414
|
-
devicePixelContentBoxSize: tA(),
|
|
1415
|
-
borderBoxSize: tA(),
|
|
1416
|
-
contentBoxSize: tA(),
|
|
1417
|
-
contentRect: new Zt(0, 0, 0, 0)
|
|
1418
|
-
}), qt = function(i, A) {
|
|
1419
|
-
if (A === void 0 && (A = !1), MA.has(i) && !A)
|
|
1420
|
-
return MA.get(i);
|
|
1421
|
-
if (Kt(i))
|
|
1422
|
-
return MA.set(i, gt), gt;
|
|
1423
|
-
var t = getComputedStyle(i), e = KA(i) && i.ownerSVGElement && i.getBBox(), n = !Ze && t.boxSizing === "border-box", r = Xe.test(t.writingMode || ""), s = !e && lt.test(t.overflowY || ""), o = !e && lt.test(t.overflowX || ""), a = e ? 0 : D(t.paddingTop), h = e ? 0 : D(t.paddingRight), c = e ? 0 : D(t.paddingBottom), l = e ? 0 : D(t.paddingLeft), g = e ? 0 : D(t.borderTopWidth), u = e ? 0 : D(t.borderRightWidth), m = e ? 0 : D(t.borderBottomWidth), B = e ? 0 : D(t.borderLeftWidth), I = l + h, E = a + c, p = B + u, f = g + m, w = o ? i.offsetHeight - f - i.clientHeight : 0, R = s ? i.offsetWidth - p - i.clientWidth : 0, q = n ? I + p : 0, k = n ? E + f : 0, W = e ? e.width : D(t.width) - q - R, L = e ? e.height : D(t.height) - k - w, gA = W + I + R + p, dA = L + E + w + f, _ = K({
|
|
1424
|
-
devicePixelContentBoxSize: tA(Math.round(W * devicePixelRatio), Math.round(L * devicePixelRatio), r),
|
|
1425
|
-
borderBoxSize: tA(gA, dA, r),
|
|
1426
|
-
contentBoxSize: tA(W, L, r),
|
|
1427
|
-
contentRect: new Zt(l, a, W, L)
|
|
1428
|
-
});
|
|
1429
|
-
return MA.set(i, _), _;
|
|
1430
|
-
}, _t = function(i, A, t) {
|
|
1431
|
-
var e = qt(i, t), n = e.borderBoxSize, r = e.contentBoxSize, s = e.devicePixelContentBoxSize;
|
|
1432
|
-
switch (A) {
|
|
1433
|
-
case lA.DEVICE_PIXEL_CONTENT_BOX:
|
|
1434
|
-
return s;
|
|
1435
|
-
case lA.BORDER_BOX:
|
|
1436
|
-
return n;
|
|
1437
|
-
default:
|
|
1438
|
-
return r;
|
|
1439
|
-
}
|
|
1440
|
-
}, Ke = function() {
|
|
1441
|
-
function i(A) {
|
|
1442
|
-
var t = qt(A);
|
|
1443
|
-
this.target = A, this.contentRect = t.contentRect, this.borderBoxSize = K([t.borderBoxSize]), this.contentBoxSize = K([t.contentBoxSize]), this.devicePixelContentBoxSize = K([t.devicePixelContentBoxSize]);
|
|
1444
|
-
}
|
|
1445
|
-
return i;
|
|
1446
|
-
}(), $t = function(i) {
|
|
1447
|
-
if (Kt(i))
|
|
1448
|
-
return 1 / 0;
|
|
1449
|
-
for (var A = 0, t = i.parentNode; t; )
|
|
1450
|
-
A += 1, t = t.parentNode;
|
|
1451
|
-
return A;
|
|
1452
|
-
}, qe = function() {
|
|
1453
|
-
var i = 1 / 0, A = [];
|
|
1454
|
-
Z.forEach(function(r) {
|
|
1455
|
-
if (r.activeTargets.length !== 0) {
|
|
1456
|
-
var s = [];
|
|
1457
|
-
r.activeTargets.forEach(function(o) {
|
|
1458
|
-
var a = new Ke(o.target), h = $t(o.target);
|
|
1459
|
-
s.push(a), o.lastReportedSize = _t(o.target, o.observedBox), h < i && (i = h);
|
|
1460
|
-
}), A.push(function() {
|
|
1461
|
-
r.callback.call(r.observer, s, r.observer);
|
|
1462
|
-
}), r.activeTargets.splice(0, r.activeTargets.length);
|
|
1463
|
-
}
|
|
1464
|
-
});
|
|
1465
|
-
for (var t = 0, e = A; t < e.length; t++) {
|
|
1466
|
-
var n = e[t];
|
|
1467
|
-
n();
|
|
1468
|
-
}
|
|
1469
|
-
return i;
|
|
1470
|
-
}, dt = function(i) {
|
|
1471
|
-
Z.forEach(function(A) {
|
|
1472
|
-
A.activeTargets.splice(0, A.activeTargets.length), A.skippedTargets.splice(0, A.skippedTargets.length), A.observationTargets.forEach(function(t) {
|
|
1473
|
-
t.isActive() && ($t(t.target) > i ? A.activeTargets.push(t) : A.skippedTargets.push(t));
|
|
1474
|
-
});
|
|
1475
|
-
});
|
|
1476
|
-
}, _e = function() {
|
|
1477
|
-
var i = 0;
|
|
1478
|
-
for (dt(i); Pe(); )
|
|
1479
|
-
i = qe(), dt(i);
|
|
1480
|
-
return ke() && We(), i > 0;
|
|
1481
|
-
}, xA, Ae = [], $e = function() {
|
|
1482
|
-
return Ae.splice(0).forEach(function(i) {
|
|
1483
|
-
return i();
|
|
1484
|
-
});
|
|
1485
|
-
}, Ai = function(i) {
|
|
1486
|
-
if (!xA) {
|
|
1487
|
-
var A = 0, t = document.createTextNode(""), e = { characterData: !0 };
|
|
1488
|
-
new MutationObserver(function() {
|
|
1489
|
-
return $e();
|
|
1490
|
-
}).observe(t, e), xA = function() {
|
|
1491
|
-
t.textContent = "".concat(A ? A-- : A++);
|
|
1492
|
-
};
|
|
1493
|
-
}
|
|
1494
|
-
Ae.push(i), xA();
|
|
1495
|
-
}, ti = function(i) {
|
|
1496
|
-
Ai(function() {
|
|
1497
|
-
requestAnimationFrame(i);
|
|
1498
|
-
});
|
|
1499
|
-
}, fA = 0, ei = function() {
|
|
1500
|
-
return !!fA;
|
|
1501
|
-
}, ii = 250, ni = { attributes: !0, characterData: !0, childList: !0, subtree: !0 }, Mt = [
|
|
1502
|
-
"resize",
|
|
1503
|
-
"load",
|
|
1504
|
-
"transitionend",
|
|
1505
|
-
"animationend",
|
|
1506
|
-
"animationstart",
|
|
1507
|
-
"animationiteration",
|
|
1508
|
-
"keyup",
|
|
1509
|
-
"keydown",
|
|
1510
|
-
"mouseup",
|
|
1511
|
-
"mousedown",
|
|
1512
|
-
"mouseover",
|
|
1513
|
-
"mouseout",
|
|
1514
|
-
"blur",
|
|
1515
|
-
"focus"
|
|
1516
|
-
], ut = function(i) {
|
|
1517
|
-
return i === void 0 && (i = 0), Date.now() + i;
|
|
1518
|
-
}, jA = !1, ri = function() {
|
|
1519
|
-
function i() {
|
|
1520
|
-
var A = this;
|
|
1521
|
-
this.stopped = !0, this.listener = function() {
|
|
1522
|
-
return A.schedule();
|
|
1523
|
-
};
|
|
1524
|
-
}
|
|
1525
|
-
return i.prototype.run = function(A) {
|
|
1526
|
-
var t = this;
|
|
1527
|
-
if (A === void 0 && (A = ii), !jA) {
|
|
1528
|
-
jA = !0;
|
|
1529
|
-
var e = ut(A);
|
|
1530
|
-
ti(function() {
|
|
1531
|
-
var n = !1;
|
|
1532
|
-
try {
|
|
1533
|
-
n = _e();
|
|
1534
|
-
} finally {
|
|
1535
|
-
if (jA = !1, A = e - ut(), !ei())
|
|
1536
|
-
return;
|
|
1537
|
-
n ? t.run(1e3) : A > 0 ? t.run(A) : t.start();
|
|
1538
|
-
}
|
|
1539
|
-
});
|
|
1540
|
-
}
|
|
1541
|
-
}, i.prototype.schedule = function() {
|
|
1542
|
-
this.stop(), this.run();
|
|
1543
|
-
}, i.prototype.observe = function() {
|
|
1544
|
-
var A = this, t = function() {
|
|
1545
|
-
return A.observer && A.observer.observe(document.body, ni);
|
|
1546
|
-
};
|
|
1547
|
-
document.body ? t() : hA.addEventListener("DOMContentLoaded", t);
|
|
1548
|
-
}, i.prototype.start = function() {
|
|
1549
|
-
var A = this;
|
|
1550
|
-
this.stopped && (this.stopped = !1, this.observer = new MutationObserver(this.listener), this.observe(), Mt.forEach(function(t) {
|
|
1551
|
-
return hA.addEventListener(t, A.listener, !0);
|
|
1552
|
-
}));
|
|
1553
|
-
}, i.prototype.stop = function() {
|
|
1554
|
-
var A = this;
|
|
1555
|
-
this.stopped || (this.observer && this.observer.disconnect(), Mt.forEach(function(t) {
|
|
1556
|
-
return hA.removeEventListener(t, A.listener, !0);
|
|
1557
|
-
}), this.stopped = !0);
|
|
1558
|
-
}, i;
|
|
1559
|
-
}(), GA = new ri(), mt = function(i) {
|
|
1560
|
-
!fA && i > 0 && GA.start(), fA += i, !fA && GA.stop();
|
|
1561
|
-
}, si = function(i) {
|
|
1562
|
-
return !KA(i) && !Oe(i) && getComputedStyle(i).display === "inline";
|
|
1563
|
-
}, oi = function() {
|
|
1564
|
-
function i(A, t) {
|
|
1565
|
-
this.target = A, this.observedBox = t || lA.CONTENT_BOX, this.lastReportedSize = {
|
|
1566
|
-
inlineSize: 0,
|
|
1567
|
-
blockSize: 0
|
|
1568
|
-
};
|
|
1569
|
-
}
|
|
1570
|
-
return i.prototype.isActive = function() {
|
|
1571
|
-
var A = _t(this.target, this.observedBox, !0);
|
|
1572
|
-
return si(this.target) && (this.lastReportedSize = A), this.lastReportedSize.inlineSize !== A.inlineSize || this.lastReportedSize.blockSize !== A.blockSize;
|
|
1573
|
-
}, i;
|
|
1574
|
-
}(), ai = function() {
|
|
1575
|
-
function i(A, t) {
|
|
1576
|
-
this.activeTargets = [], this.skippedTargets = [], this.observationTargets = [], this.observer = A, this.callback = t;
|
|
1577
|
-
}
|
|
1578
|
-
return i;
|
|
1579
|
-
}(), uA = /* @__PURE__ */ new WeakMap(), Bt = function(i, A) {
|
|
1580
|
-
for (var t = 0; t < i.length; t += 1)
|
|
1581
|
-
if (i[t].target === A)
|
|
1582
|
-
return t;
|
|
1583
|
-
return -1;
|
|
1584
|
-
}, mA = function() {
|
|
1585
|
-
function i() {
|
|
1586
|
-
}
|
|
1587
|
-
return i.connect = function(A, t) {
|
|
1588
|
-
var e = new ai(A, t);
|
|
1589
|
-
uA.set(A, e);
|
|
1590
|
-
}, i.observe = function(A, t, e) {
|
|
1591
|
-
var n = uA.get(A), r = n.observationTargets.length === 0;
|
|
1592
|
-
Bt(n.observationTargets, t) < 0 && (r && Z.push(n), n.observationTargets.push(new oi(t, e && e.box)), mt(1), GA.schedule());
|
|
1593
|
-
}, i.unobserve = function(A, t) {
|
|
1594
|
-
var e = uA.get(A), n = Bt(e.observationTargets, t), r = e.observationTargets.length === 1;
|
|
1595
|
-
n >= 0 && (r && Z.splice(Z.indexOf(e), 1), e.observationTargets.splice(n, 1), mt(-1));
|
|
1596
|
-
}, i.disconnect = function(A) {
|
|
1597
|
-
var t = this, e = uA.get(A);
|
|
1598
|
-
e.observationTargets.slice().forEach(function(n) {
|
|
1599
|
-
return t.unobserve(A, n.target);
|
|
1600
|
-
}), e.activeTargets.splice(0, e.activeTargets.length);
|
|
1601
|
-
}, i;
|
|
1602
|
-
}(), te = function() {
|
|
1603
|
-
function i(A) {
|
|
1604
|
-
if (arguments.length === 0)
|
|
1605
|
-
throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");
|
|
1606
|
-
if (typeof A != "function")
|
|
1607
|
-
throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");
|
|
1608
|
-
mA.connect(this, A);
|
|
1609
|
-
}
|
|
1610
|
-
return i.prototype.observe = function(A, t) {
|
|
1611
|
-
if (arguments.length === 0)
|
|
1612
|
-
throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");
|
|
1613
|
-
if (!ct(A))
|
|
1614
|
-
throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");
|
|
1615
|
-
mA.observe(this, A, t);
|
|
1616
|
-
}, i.prototype.unobserve = function(A) {
|
|
1617
|
-
if (arguments.length === 0)
|
|
1618
|
-
throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");
|
|
1619
|
-
if (!ct(A))
|
|
1620
|
-
throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");
|
|
1621
|
-
mA.unobserve(this, A);
|
|
1622
|
-
}, i.prototype.disconnect = function() {
|
|
1623
|
-
mA.disconnect(this);
|
|
1624
|
-
}, i.toString = function() {
|
|
1625
|
-
return "function ResizeObserver () { [polyfill code] }";
|
|
1626
|
-
}, i;
|
|
1627
|
-
}();
|
|
1628
|
-
const Et = "readium-snapper-style", ee = class vA extends CA {
|
|
1629
|
-
constructor() {
|
|
1630
|
-
super(...arguments), this.protected = !1;
|
|
1631
|
-
}
|
|
1632
|
-
buildStyles() {
|
|
1633
|
-
return `
|
|
1634
|
-
html, body {
|
|
1635
|
-
touch-action: manipulation;
|
|
1636
|
-
user-select: ${this.protected ? "none" : "auto"};
|
|
1637
|
-
}`;
|
|
1638
|
-
}
|
|
1639
|
-
mount(A, t) {
|
|
1640
|
-
const e = A.document.createElement("style");
|
|
1641
|
-
return e.dataset.readium = "true", e.id = Et, e.textContent = this.buildStyles(), A.document.head.appendChild(e), t.register("protect", vA.moduleName, (n, r) => {
|
|
1642
|
-
this.protected = !0, e.textContent = this.buildStyles(), r(!0);
|
|
1643
|
-
}), t.register("unprotect", vA.moduleName, (n, r) => {
|
|
1644
|
-
this.protected = !1, e.textContent = this.buildStyles(), r(!0);
|
|
1645
|
-
}), t.log("Snapper Mounted"), !0;
|
|
1646
|
-
}
|
|
1647
|
-
unmount(A, t) {
|
|
1648
|
-
var e;
|
|
1649
|
-
return (e = A.document.getElementById(Et)) == null || e.remove(), t.log("Snapper Unmounted"), !0;
|
|
1650
|
-
}
|
|
1651
|
-
};
|
|
1652
|
-
ee.moduleName = "snapper";
|
|
1653
|
-
let ie = ee;
|
|
1654
|
-
function O(i) {
|
|
1655
|
-
return i.document.body.dir.toLowerCase() === "rtl";
|
|
1656
|
-
}
|
|
1657
|
-
function ne(i) {
|
|
1658
|
-
return parseInt(
|
|
1659
|
-
i.getComputedStyle(
|
|
1660
|
-
i.document.documentElement
|
|
1661
|
-
).getPropertyValue("column-count")
|
|
1662
|
-
);
|
|
1663
|
-
}
|
|
1664
|
-
function hi(i) {
|
|
1665
|
-
const A = "readium-virtual-page";
|
|
1666
|
-
let t = i.document.getElementById(A);
|
|
1667
|
-
if (ne(i) !== 2)
|
|
1668
|
-
t && t.remove();
|
|
1669
|
-
else {
|
|
1670
|
-
const e = i.document.scrollingElement.scrollWidth / i.innerWidth;
|
|
1671
|
-
Math.round(e * 2) / 2 % 1 > 0.1 && (t ? t.remove() : (t = i.document.createElement("div"), t.setAttribute("id", A), t.dataset.readium = "true", t.style.breakBefore = "column", t.innerHTML = "​", i.document.body.appendChild(t)));
|
|
1672
|
-
}
|
|
1673
|
-
}
|
|
1674
|
-
function ci(i) {
|
|
1675
|
-
return i < 0.5 ? 2 * i * i : -1 + (4 - 2 * i) * i;
|
|
1676
|
-
}
|
|
1677
1390
|
class qA {
|
|
1678
1391
|
/**
|
|
1679
1392
|
* Creates a [Encryption].
|
|
@@ -1702,7 +1415,7 @@ class qA {
|
|
|
1702
1415
|
return this.compression !== void 0 && (A.compression = this.compression), this.originalLength !== void 0 && (A.originalLength = this.originalLength), this.profile !== void 0 && (A.profile = this.profile), this.scheme !== void 0 && (A.scheme = this.scheme), A;
|
|
1703
1416
|
}
|
|
1704
1417
|
}
|
|
1705
|
-
class
|
|
1418
|
+
class y {
|
|
1706
1419
|
constructor(A) {
|
|
1707
1420
|
this.otherProperties = A;
|
|
1708
1421
|
}
|
|
@@ -1711,7 +1424,7 @@ class Q {
|
|
|
1711
1424
|
*/
|
|
1712
1425
|
static deserialize(A) {
|
|
1713
1426
|
if (A)
|
|
1714
|
-
return new
|
|
1427
|
+
return new y(A);
|
|
1715
1428
|
}
|
|
1716
1429
|
/**
|
|
1717
1430
|
* Serializes a [Properties] to its RWPM JSON representation.
|
|
@@ -1726,18 +1439,18 @@ class Q {
|
|
|
1726
1439
|
const t = Object.assign({}, this.otherProperties);
|
|
1727
1440
|
for (const e in A)
|
|
1728
1441
|
t[e] = A[e];
|
|
1729
|
-
return new
|
|
1442
|
+
return new y(t);
|
|
1730
1443
|
}
|
|
1731
1444
|
}
|
|
1732
|
-
Object.defineProperty(
|
|
1445
|
+
Object.defineProperty(y.prototype, "encryption", {
|
|
1733
1446
|
get: function() {
|
|
1734
1447
|
return qA.deserialize(this.otherProperties.encrypted);
|
|
1735
1448
|
}
|
|
1736
1449
|
});
|
|
1737
|
-
|
|
1450
|
+
y.prototype.getContains = function() {
|
|
1738
1451
|
return new Set(this.otherProperties.contains || []);
|
|
1739
1452
|
};
|
|
1740
|
-
|
|
1453
|
+
y.prototype.getLayout = function() {
|
|
1741
1454
|
return this.otherProperties.layout;
|
|
1742
1455
|
};
|
|
1743
1456
|
class M {
|
|
@@ -2195,7 +1908,7 @@ class M {
|
|
|
2195
1908
|
});
|
|
2196
1909
|
}
|
|
2197
1910
|
}
|
|
2198
|
-
class
|
|
1911
|
+
class ct {
|
|
2199
1912
|
constructor(A) {
|
|
2200
1913
|
this.uri = A, this.parameters = this.getParameters(A);
|
|
2201
1914
|
}
|
|
@@ -2223,26 +1936,26 @@ class It {
|
|
|
2223
1936
|
return this.uri.replace(/\{(\??)([^}]+)\}/g, (...n) => n[1] ? e(n[2]) : t(n[2]));
|
|
2224
1937
|
}
|
|
2225
1938
|
}
|
|
2226
|
-
function
|
|
1939
|
+
function Ai(i) {
|
|
2227
1940
|
return i && i instanceof Array ? i : void 0;
|
|
2228
1941
|
}
|
|
2229
|
-
function
|
|
2230
|
-
return i && typeof i == "string" ? [i] :
|
|
1942
|
+
function qt(i) {
|
|
1943
|
+
return i && typeof i == "string" ? [i] : Ai(i);
|
|
2231
1944
|
}
|
|
2232
|
-
function
|
|
1945
|
+
function lt(i) {
|
|
2233
1946
|
return typeof i == "string" ? new Date(i) : void 0;
|
|
2234
1947
|
}
|
|
2235
|
-
function
|
|
1948
|
+
function fA(i) {
|
|
2236
1949
|
return isNaN(i) ? void 0 : i;
|
|
2237
1950
|
}
|
|
2238
1951
|
function x(i) {
|
|
2239
|
-
return
|
|
1952
|
+
return fA(i) !== void 0 && Math.sign(i) >= 0 ? i : void 0;
|
|
2240
1953
|
}
|
|
2241
|
-
function
|
|
1954
|
+
function ti(i) {
|
|
2242
1955
|
const A = new Array();
|
|
2243
1956
|
return i.forEach((t) => A.push(t)), A;
|
|
2244
1957
|
}
|
|
2245
|
-
class
|
|
1958
|
+
class Q {
|
|
2246
1959
|
/**
|
|
2247
1960
|
* Creates a [Locations].
|
|
2248
1961
|
*/
|
|
@@ -2255,7 +1968,7 @@ class y {
|
|
|
2255
1968
|
static deserialize(A) {
|
|
2256
1969
|
if (!A)
|
|
2257
1970
|
return;
|
|
2258
|
-
const t =
|
|
1971
|
+
const t = fA(A.progression), e = fA(A.totalProgression), n = fA(A.position), r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set([
|
|
2259
1972
|
"fragment",
|
|
2260
1973
|
"fragments",
|
|
2261
1974
|
"progression",
|
|
@@ -2264,8 +1977,8 @@ class y {
|
|
|
2264
1977
|
]);
|
|
2265
1978
|
return Object.entries(A).forEach(([o, a]) => {
|
|
2266
1979
|
s.has(o) || r.set(o, a);
|
|
2267
|
-
}), new
|
|
2268
|
-
fragments:
|
|
1980
|
+
}), new Q({
|
|
1981
|
+
fragments: qt(A.fragments || A.fragment),
|
|
2269
1982
|
progression: t !== void 0 && t >= 0 && t <= 1 ? t : void 0,
|
|
2270
1983
|
totalProgression: e !== void 0 && e >= 0 && e <= 1 ? e : void 0,
|
|
2271
1984
|
position: n !== void 0 && n > 0 ? n : void 0,
|
|
@@ -2280,7 +1993,7 @@ class y {
|
|
|
2280
1993
|
return this.fragments && (A.fragments = this.fragments), this.progression !== void 0 && (A.progression = this.progression), this.totalProgression !== void 0 && (A.totalProgression = this.totalProgression), this.position !== void 0 && (A.position = this.position), this.otherLocations && this.otherLocations.forEach((t, e) => A[e] = t), A;
|
|
2281
1994
|
}
|
|
2282
1995
|
}
|
|
2283
|
-
class
|
|
1996
|
+
class oA {
|
|
2284
1997
|
/**
|
|
2285
1998
|
* Creates a [Text].
|
|
2286
1999
|
*/
|
|
@@ -2292,7 +2005,7 @@ class rA {
|
|
|
2292
2005
|
*/
|
|
2293
2006
|
static deserialize(A) {
|
|
2294
2007
|
if (A)
|
|
2295
|
-
return new
|
|
2008
|
+
return new oA({
|
|
2296
2009
|
after: A.after,
|
|
2297
2010
|
before: A.before,
|
|
2298
2011
|
highlight: A.highlight
|
|
@@ -2306,24 +2019,24 @@ class rA {
|
|
|
2306
2019
|
return this.after !== void 0 && (A.after = this.after), this.before !== void 0 && (A.before = this.before), this.highlight !== void 0 && (A.highlight = this.highlight), A;
|
|
2307
2020
|
}
|
|
2308
2021
|
}
|
|
2309
|
-
class
|
|
2022
|
+
class L {
|
|
2310
2023
|
/**
|
|
2311
2024
|
* Creates a [Locator].
|
|
2312
2025
|
*/
|
|
2313
2026
|
constructor(A) {
|
|
2314
|
-
this.href = A.href, this.type = A.type, this.title = A.title, this.locations = A.locations ? A.locations : new
|
|
2027
|
+
this.href = A.href, this.type = A.type, this.title = A.title, this.locations = A.locations ? A.locations : new Q({}), this.text = A.text;
|
|
2315
2028
|
}
|
|
2316
2029
|
/**
|
|
2317
2030
|
* Parses a [Link] from its RWPM JSON representation.
|
|
2318
2031
|
*/
|
|
2319
2032
|
static deserialize(A) {
|
|
2320
2033
|
if (A && A.href && A.type)
|
|
2321
|
-
return new
|
|
2034
|
+
return new L({
|
|
2322
2035
|
href: A.href,
|
|
2323
2036
|
type: A.type,
|
|
2324
2037
|
title: A.title,
|
|
2325
|
-
locations:
|
|
2326
|
-
text:
|
|
2038
|
+
locations: Q.deserialize(A.locations),
|
|
2039
|
+
text: oA.deserialize(A.text)
|
|
2327
2040
|
});
|
|
2328
2041
|
}
|
|
2329
2042
|
/**
|
|
@@ -2337,16 +2050,16 @@ class P {
|
|
|
2337
2050
|
* Shortcut to get a copy of the [Locator] with different [Locations] sub-properties.
|
|
2338
2051
|
*/
|
|
2339
2052
|
copyWithLocations(A) {
|
|
2340
|
-
return new
|
|
2053
|
+
return new L({
|
|
2341
2054
|
href: this.href,
|
|
2342
2055
|
type: this.type,
|
|
2343
2056
|
title: this.title,
|
|
2344
2057
|
text: this.text,
|
|
2345
|
-
locations: new
|
|
2058
|
+
locations: new Q({ ...this.locations, ...A })
|
|
2346
2059
|
});
|
|
2347
2060
|
}
|
|
2348
2061
|
}
|
|
2349
|
-
class
|
|
2062
|
+
class nA {
|
|
2350
2063
|
/**
|
|
2351
2064
|
* Creates a [Link].
|
|
2352
2065
|
*/
|
|
@@ -2358,18 +2071,18 @@ class eA {
|
|
|
2358
2071
|
*/
|
|
2359
2072
|
static deserialize(A) {
|
|
2360
2073
|
if (A && A.href && typeof A.href == "string")
|
|
2361
|
-
return new
|
|
2074
|
+
return new nA({
|
|
2362
2075
|
href: A.href,
|
|
2363
2076
|
templated: A.templated,
|
|
2364
2077
|
type: A.type,
|
|
2365
2078
|
title: A.title,
|
|
2366
2079
|
rels: A.rel ? A.rel instanceof Array ? new Set(A.rel) : /* @__PURE__ */ new Set([A.rel]) : void 0,
|
|
2367
|
-
properties:
|
|
2080
|
+
properties: y.deserialize(A.properties),
|
|
2368
2081
|
height: x(A.height),
|
|
2369
2082
|
width: x(A.width),
|
|
2370
2083
|
duration: x(A.duration),
|
|
2371
2084
|
bitrate: x(A.bitrate),
|
|
2372
|
-
languages:
|
|
2085
|
+
languages: qt(A.language),
|
|
2373
2086
|
alternates: UA.deserialize(A.alternate),
|
|
2374
2087
|
children: UA.deserialize(A.children)
|
|
2375
2088
|
});
|
|
@@ -2379,7 +2092,7 @@ class eA {
|
|
|
2379
2092
|
*/
|
|
2380
2093
|
serialize() {
|
|
2381
2094
|
const A = { href: this.href };
|
|
2382
|
-
return this.templated !== void 0 && (A.templated = this.templated), this.type !== void 0 && (A.type = this.type), this.title !== void 0 && (A.title = this.title), this.rels && (A.rel =
|
|
2095
|
+
return this.templated !== void 0 && (A.templated = this.templated), this.type !== void 0 && (A.type = this.type), this.title !== void 0 && (A.title = this.title), this.rels && (A.rel = ti(this.rels)), this.properties && (A.properties = this.properties.serialize()), this.height !== void 0 && (A.height = this.height), this.width !== void 0 && (A.width = this.width), this.duration !== void 0 && (A.duration = this.duration), this.bitrate !== void 0 && (A.bitrate = this.bitrate), this.languages && (A.language = this.languages), this.alternates && (A.alternate = this.alternates.serialize()), this.children && (A.children = this.children.serialize()), A;
|
|
2383
2096
|
}
|
|
2384
2097
|
/** MediaType of the linked resource. */
|
|
2385
2098
|
get mediaType() {
|
|
@@ -2397,14 +2110,14 @@ class eA {
|
|
|
2397
2110
|
}
|
|
2398
2111
|
/** List of URI template parameter keys, if the `Link` is templated. */
|
|
2399
2112
|
get templateParameters() {
|
|
2400
|
-
return this.templated ? new
|
|
2113
|
+
return this.templated ? new ct(this.href).parameters : /* @__PURE__ */ new Set();
|
|
2401
2114
|
}
|
|
2402
2115
|
/** Expands the `Link`'s HREF by replacing URI template variables by the given parameters.
|
|
2403
2116
|
* See RFC 6570 on URI template: https://tools.ietf.org/html/rfc6570
|
|
2404
2117
|
*/
|
|
2405
2118
|
expandTemplate(A) {
|
|
2406
|
-
return new
|
|
2407
|
-
href: new
|
|
2119
|
+
return new nA({
|
|
2120
|
+
href: new ct(this.href).expand(A),
|
|
2408
2121
|
templated: !1
|
|
2409
2122
|
});
|
|
2410
2123
|
}
|
|
@@ -2413,19 +2126,19 @@ class eA {
|
|
|
2413
2126
|
*/
|
|
2414
2127
|
addProperties(A) {
|
|
2415
2128
|
var t;
|
|
2416
|
-
const e =
|
|
2417
|
-
return e.properties = e.properties ? (t = e.properties) == null ? void 0 : t.add(A) : new
|
|
2129
|
+
const e = nA.deserialize(this.serialize());
|
|
2130
|
+
return e.properties = e.properties ? (t = e.properties) == null ? void 0 : t.add(A) : new y(A), e;
|
|
2418
2131
|
}
|
|
2419
2132
|
/**
|
|
2420
2133
|
* Creates a [Locator] from a reading order [Link].
|
|
2421
2134
|
*/
|
|
2422
2135
|
get locator() {
|
|
2423
2136
|
let A = this.href.split("#");
|
|
2424
|
-
return new
|
|
2137
|
+
return new L({
|
|
2425
2138
|
href: A.length > 0 && A[0] !== void 0 ? A[0] : this.href,
|
|
2426
2139
|
type: this.type ?? "",
|
|
2427
2140
|
title: this.title,
|
|
2428
|
-
locations: new
|
|
2141
|
+
locations: new Q({
|
|
2429
2142
|
fragments: A.length > 1 && A[1] !== void 0 ? [A[1]] : []
|
|
2430
2143
|
})
|
|
2431
2144
|
});
|
|
@@ -2444,7 +2157,7 @@ class UA {
|
|
|
2444
2157
|
static deserialize(A) {
|
|
2445
2158
|
if (A && A instanceof Array)
|
|
2446
2159
|
return new UA(
|
|
2447
|
-
A.map((t) =>
|
|
2160
|
+
A.map((t) => nA.deserialize(t)).filter((t) => t !== void 0)
|
|
2448
2161
|
);
|
|
2449
2162
|
}
|
|
2450
2163
|
/**
|
|
@@ -2525,7 +2238,7 @@ class UA {
|
|
|
2525
2238
|
return this.items.filter((A) => A.type);
|
|
2526
2239
|
}
|
|
2527
2240
|
}
|
|
2528
|
-
class
|
|
2241
|
+
class yA {
|
|
2529
2242
|
/**
|
|
2530
2243
|
* Creates a [DomRange].
|
|
2531
2244
|
*/
|
|
@@ -2542,7 +2255,7 @@ class FA {
|
|
|
2542
2255
|
if (t === void 0)
|
|
2543
2256
|
return;
|
|
2544
2257
|
let e = x(A.charOffset);
|
|
2545
|
-
return e === void 0 && (e = x(A.offset)), new
|
|
2258
|
+
return e === void 0 && (e = x(A.offset)), new yA({
|
|
2546
2259
|
cssSelector: A.cssSelector,
|
|
2547
2260
|
textNodeIndex: t,
|
|
2548
2261
|
charOffset: e
|
|
@@ -2572,11 +2285,11 @@ class _A {
|
|
|
2572
2285
|
static deserialize(A) {
|
|
2573
2286
|
if (!A)
|
|
2574
2287
|
return;
|
|
2575
|
-
let t =
|
|
2288
|
+
let t = yA.deserialize(A.start);
|
|
2576
2289
|
if (t)
|
|
2577
2290
|
return new _A({
|
|
2578
2291
|
start: t,
|
|
2579
|
-
end:
|
|
2292
|
+
end: yA.deserialize(A.end)
|
|
2580
2293
|
});
|
|
2581
2294
|
}
|
|
2582
2295
|
/**
|
|
@@ -2587,19 +2300,19 @@ class _A {
|
|
|
2587
2300
|
return this.end && (A.end = this.end.serialize()), A;
|
|
2588
2301
|
}
|
|
2589
2302
|
}
|
|
2590
|
-
|
|
2303
|
+
Q.prototype.getCssSelector = function() {
|
|
2591
2304
|
var i;
|
|
2592
2305
|
return (i = this.otherLocations) == null ? void 0 : i.get("cssSelector");
|
|
2593
2306
|
};
|
|
2594
|
-
|
|
2307
|
+
Q.prototype.getPartialCfi = function() {
|
|
2595
2308
|
var i;
|
|
2596
2309
|
return (i = this.otherLocations) == null ? void 0 : i.get("partialCfi");
|
|
2597
2310
|
};
|
|
2598
|
-
|
|
2311
|
+
Q.prototype.getDomRange = function() {
|
|
2599
2312
|
var i;
|
|
2600
2313
|
return _A.deserialize((i = this.otherLocations) == null ? void 0 : i.get("domRange"));
|
|
2601
2314
|
};
|
|
2602
|
-
|
|
2315
|
+
Q.prototype.fragmentParameters = function() {
|
|
2603
2316
|
return new Map(
|
|
2604
2317
|
this.fragments.map((i) => i.startsWith("#") ? i.slice(1) : i).join("&").split("&").filter((i) => !i.startsWith("#")).map((i) => i.split("=")).filter((i) => i.length === 2).map((i) => [
|
|
2605
2318
|
i[0].trim().toLowerCase(),
|
|
@@ -2607,7 +2320,7 @@ y.prototype.fragmentParameters = function() {
|
|
|
2607
2320
|
])
|
|
2608
2321
|
);
|
|
2609
2322
|
};
|
|
2610
|
-
|
|
2323
|
+
Q.prototype.htmlId = function() {
|
|
2611
2324
|
if (!this.fragments.length)
|
|
2612
2325
|
return;
|
|
2613
2326
|
let i = this.fragments.find((A) => A.length && !A.includes("="));
|
|
@@ -2617,17 +2330,17 @@ y.prototype.htmlId = function() {
|
|
|
2617
2330
|
}
|
|
2618
2331
|
return i != null && i.startsWith("#") ? i.slice(1) : i;
|
|
2619
2332
|
};
|
|
2620
|
-
|
|
2333
|
+
Q.prototype.page = function() {
|
|
2621
2334
|
const i = parseInt(this.fragmentParameters().get("page"));
|
|
2622
2335
|
if (!isNaN(i) && i >= 0)
|
|
2623
2336
|
return i;
|
|
2624
2337
|
};
|
|
2625
|
-
|
|
2338
|
+
Q.prototype.time = function() {
|
|
2626
2339
|
const i = parseInt(this.fragmentParameters().get("t"));
|
|
2627
2340
|
if (!isNaN(i))
|
|
2628
2341
|
return i;
|
|
2629
2342
|
};
|
|
2630
|
-
|
|
2343
|
+
Q.prototype.space = function() {
|
|
2631
2344
|
const i = this.fragmentParameters();
|
|
2632
2345
|
if (!i.has("xywh"))
|
|
2633
2346
|
return;
|
|
@@ -2745,8 +2458,8 @@ class et {
|
|
|
2745
2458
|
if (A && A.state)
|
|
2746
2459
|
return new et({
|
|
2747
2460
|
state: A.state,
|
|
2748
|
-
since:
|
|
2749
|
-
until:
|
|
2461
|
+
since: lt(A.since),
|
|
2462
|
+
until: lt(A.until)
|
|
2750
2463
|
});
|
|
2751
2464
|
}
|
|
2752
2465
|
/**
|
|
@@ -2757,72 +2470,74 @@ class et {
|
|
|
2757
2470
|
return this.since !== void 0 && (A.since = this.since.toISOString()), this.until !== void 0 && (A.until = this.until.toISOString()), A;
|
|
2758
2471
|
}
|
|
2759
2472
|
}
|
|
2760
|
-
|
|
2473
|
+
y.prototype.getNumberOfItems = function() {
|
|
2761
2474
|
return x(this.otherProperties.numberOfItems);
|
|
2762
2475
|
};
|
|
2763
|
-
|
|
2476
|
+
y.prototype.getPrice = function() {
|
|
2764
2477
|
return $A.deserialize(this.otherProperties.price);
|
|
2765
2478
|
};
|
|
2766
|
-
|
|
2479
|
+
y.prototype.getIndirectAcquisitions = function() {
|
|
2767
2480
|
const i = this.otherProperties.indirectAcquisition;
|
|
2768
2481
|
if (i && i instanceof Array)
|
|
2769
2482
|
return i.map((A) => cA.deserialize(A)).filter((A) => A !== void 0);
|
|
2770
2483
|
};
|
|
2771
|
-
|
|
2484
|
+
y.prototype.getHolds = function() {
|
|
2772
2485
|
return At.deserialize(this.otherProperties.holds);
|
|
2773
2486
|
};
|
|
2774
|
-
|
|
2487
|
+
y.prototype.getCopies = function() {
|
|
2775
2488
|
return tt.deserialize(this.otherProperties.copies);
|
|
2776
2489
|
};
|
|
2777
|
-
|
|
2490
|
+
y.prototype.getAvailability = function() {
|
|
2778
2491
|
return et.deserialize(this.otherProperties.availability);
|
|
2779
2492
|
};
|
|
2780
|
-
|
|
2781
|
-
return
|
|
2493
|
+
y.prototype.getAuthenticate = function() {
|
|
2494
|
+
return nA.deserialize(this.otherProperties.authenticate);
|
|
2782
2495
|
};
|
|
2783
|
-
|
|
2496
|
+
y.prototype.getClipped = function() {
|
|
2784
2497
|
return this.otherProperties.clipped;
|
|
2785
2498
|
};
|
|
2786
|
-
|
|
2499
|
+
y.prototype.getFit = function() {
|
|
2787
2500
|
return this.otherProperties.fit;
|
|
2788
2501
|
};
|
|
2789
|
-
|
|
2502
|
+
y.prototype.getOrientation = function() {
|
|
2790
2503
|
return this.otherProperties.orientation;
|
|
2791
2504
|
};
|
|
2792
|
-
|
|
2505
|
+
y.prototype.getOverflow = function() {
|
|
2793
2506
|
return this.otherProperties.overflow;
|
|
2794
2507
|
};
|
|
2795
|
-
|
|
2508
|
+
y.prototype.getPage = function() {
|
|
2796
2509
|
return this.otherProperties.page || void 0;
|
|
2797
2510
|
};
|
|
2798
|
-
|
|
2511
|
+
y.prototype.getSpread = function() {
|
|
2799
2512
|
return this.otherProperties.spread || void 0;
|
|
2800
2513
|
};
|
|
2801
|
-
|
|
2514
|
+
class zA {
|
|
2515
|
+
}
|
|
2516
|
+
function gt(i) {
|
|
2802
2517
|
return i.split("").reverse().join("");
|
|
2803
2518
|
}
|
|
2804
|
-
function
|
|
2805
|
-
const e =
|
|
2519
|
+
function ei(i, A, t) {
|
|
2520
|
+
const e = gt(A);
|
|
2806
2521
|
return t.map((n) => {
|
|
2807
|
-
const r = Math.max(0, n.end - A.length - n.errors), s =
|
|
2522
|
+
const r = Math.max(0, n.end - A.length - n.errors), s = gt(i.slice(r, n.end));
|
|
2808
2523
|
return {
|
|
2809
|
-
start:
|
|
2524
|
+
start: _t(s, e, n.errors).reduce((o, a) => n.end - a.end < o ? n.end - a.end : o, n.end),
|
|
2810
2525
|
end: n.end,
|
|
2811
2526
|
errors: n.errors
|
|
2812
2527
|
};
|
|
2813
2528
|
});
|
|
2814
2529
|
}
|
|
2815
|
-
function
|
|
2530
|
+
function jA(i) {
|
|
2816
2531
|
return (i | -i) >> 31 & 1;
|
|
2817
2532
|
}
|
|
2818
|
-
function
|
|
2533
|
+
function dt(i, A, t, e) {
|
|
2819
2534
|
let n = i.P[t], r = i.M[t];
|
|
2820
2535
|
const s = e >>> 31, o = A[t] | s, a = o | r, h = (o & n) + n ^ n | o;
|
|
2821
2536
|
let c = r | ~(h | n), l = n & h;
|
|
2822
|
-
const g =
|
|
2823
|
-
return c <<= 1, l <<= 1, l |= s, c |=
|
|
2537
|
+
const g = jA(c & i.lastRowMask[t]) - jA(l & i.lastRowMask[t]);
|
|
2538
|
+
return c <<= 1, l <<= 1, l |= s, c |= jA(e) - s, n = l | ~(a | c), r = c & a, i.P[t] = n, i.M[t] = r, g;
|
|
2824
2539
|
}
|
|
2825
|
-
function
|
|
2540
|
+
function _t(i, A, t) {
|
|
2826
2541
|
if (A.length === 0)
|
|
2827
2542
|
return [];
|
|
2828
2543
|
t = Math.min(t, A.length);
|
|
@@ -2862,7 +2577,7 @@ function se(i, A, t) {
|
|
|
2862
2577
|
u < h.length ? m = h[u] : (m = a.get(u), typeof m > "u" && (m = o));
|
|
2863
2578
|
let B = 0;
|
|
2864
2579
|
for (let I = 0; I <= c; I += 1)
|
|
2865
|
-
B =
|
|
2580
|
+
B = dt(s, m, I, B), l[I] += B;
|
|
2866
2581
|
if (l[c] - B <= t && c < r && (m[c + 1] & 1 || B < 0)) {
|
|
2867
2582
|
c += 1, s.P[c] = -1, s.M[c] = 0;
|
|
2868
2583
|
let I;
|
|
@@ -2871,7 +2586,7 @@ function se(i, A, t) {
|
|
|
2871
2586
|
I = E === 0 ? n : E;
|
|
2872
2587
|
} else
|
|
2873
2588
|
I = n;
|
|
2874
|
-
l[c] = l[c - 1] + I - B +
|
|
2589
|
+
l[c] = l[c - 1] + I - B + dt(s, m, c, B);
|
|
2875
2590
|
} else
|
|
2876
2591
|
for (; c > 0 && l[c] >= t + n; )
|
|
2877
2592
|
c -= 1;
|
|
@@ -2883,11 +2598,11 @@ function se(i, A, t) {
|
|
|
2883
2598
|
}
|
|
2884
2599
|
return e;
|
|
2885
2600
|
}
|
|
2886
|
-
function
|
|
2887
|
-
const e =
|
|
2888
|
-
return
|
|
2601
|
+
function ii(i, A, t) {
|
|
2602
|
+
const e = _t(i, A, t);
|
|
2603
|
+
return ei(i, A, e);
|
|
2889
2604
|
}
|
|
2890
|
-
function
|
|
2605
|
+
function $t(i, A, t) {
|
|
2891
2606
|
let e = 0;
|
|
2892
2607
|
const n = [];
|
|
2893
2608
|
for (; e !== -1; )
|
|
@@ -2896,25 +2611,25 @@ function oe(i, A, t) {
|
|
|
2896
2611
|
end: e + A.length,
|
|
2897
2612
|
errors: 0
|
|
2898
2613
|
}), e += 1);
|
|
2899
|
-
return n.length > 0 ? n :
|
|
2614
|
+
return n.length > 0 ? n : ii(i, A, t);
|
|
2900
2615
|
}
|
|
2901
|
-
function
|
|
2902
|
-
return A.length === 0 || i.length === 0 ? 0 : 1 -
|
|
2616
|
+
function Mt(i, A) {
|
|
2617
|
+
return A.length === 0 || i.length === 0 ? 0 : 1 - $t(i, A, A.length)[0].errors / A.length;
|
|
2903
2618
|
}
|
|
2904
|
-
function
|
|
2619
|
+
function ni(i, A, t = {}) {
|
|
2905
2620
|
if (A.length === 0)
|
|
2906
2621
|
return null;
|
|
2907
|
-
const e = Math.min(256, A.length / 2), n =
|
|
2622
|
+
const e = Math.min(256, A.length / 2), n = $t(i, A, e);
|
|
2908
2623
|
if (n.length === 0)
|
|
2909
2624
|
return null;
|
|
2910
2625
|
const r = (o) => {
|
|
2911
|
-
const a = 1 - o.errors / A.length, h = t.prefix ?
|
|
2626
|
+
const a = 1 - o.errors / A.length, h = t.prefix ? Mt(
|
|
2912
2627
|
i.slice(
|
|
2913
2628
|
Math.max(0, o.start - t.prefix.length),
|
|
2914
2629
|
o.start
|
|
2915
2630
|
),
|
|
2916
2631
|
t.prefix
|
|
2917
|
-
) : 1, c = t.suffix ?
|
|
2632
|
+
) : 1, c = t.suffix ? Mt(
|
|
2918
2633
|
i.slice(o.end, o.end + t.suffix.length),
|
|
2919
2634
|
t.suffix
|
|
2920
2635
|
) : 1;
|
|
@@ -2929,7 +2644,7 @@ function ui(i, A, t = {}) {
|
|
|
2929
2644
|
}));
|
|
2930
2645
|
return s.sort((o, a) => a.score - o.score), s[0];
|
|
2931
2646
|
}
|
|
2932
|
-
function
|
|
2647
|
+
function JA(i, A, t) {
|
|
2933
2648
|
const e = t === 1 ? A : A - 1;
|
|
2934
2649
|
if (i.charAt(e).trim() !== "")
|
|
2935
2650
|
return A;
|
|
@@ -2939,7 +2654,7 @@ function bA(i, A, t) {
|
|
|
2939
2654
|
const s = n.length - r.length;
|
|
2940
2655
|
return t === 2 ? A - s : A + s;
|
|
2941
2656
|
}
|
|
2942
|
-
function
|
|
2657
|
+
function ut(i, A) {
|
|
2943
2658
|
const t = i.commonAncestorContainer.ownerDocument.createNodeIterator(
|
|
2944
2659
|
i.commonAncestorContainer,
|
|
2945
2660
|
NodeFilter.SHOW_TEXT
|
|
@@ -2952,7 +2667,7 @@ function Ft(i, A) {
|
|
|
2952
2667
|
const o = () => {
|
|
2953
2668
|
if (r = A === 1 ? t.nextNode() : t.previousNode(), r) {
|
|
2954
2669
|
const a = r.textContent, h = A === 1 ? 0 : a.length;
|
|
2955
|
-
s =
|
|
2670
|
+
s = JA(a, h, A);
|
|
2956
2671
|
}
|
|
2957
2672
|
};
|
|
2958
2673
|
for (; r && s === -1 && r !== n; )
|
|
@@ -2961,7 +2676,7 @@ function Ft(i, A) {
|
|
|
2961
2676
|
return { node: r, offset: s };
|
|
2962
2677
|
throw new RangeError("No text nodes with non-whitespace text found in range");
|
|
2963
2678
|
}
|
|
2964
|
-
function
|
|
2679
|
+
function ri(i) {
|
|
2965
2680
|
if (!i.toString().trim().length)
|
|
2966
2681
|
throw new RangeError("Range contains no non-whitespace text");
|
|
2967
2682
|
if (i.startContainer.nodeType !== Node.TEXT_NODE)
|
|
@@ -2971,13 +2686,13 @@ function mi(i) {
|
|
|
2971
2686
|
const A = i.cloneRange();
|
|
2972
2687
|
let t = !1, e = !1;
|
|
2973
2688
|
const n = {
|
|
2974
|
-
start:
|
|
2689
|
+
start: JA(
|
|
2975
2690
|
i.startContainer.textContent,
|
|
2976
2691
|
i.startOffset,
|
|
2977
2692
|
1
|
|
2978
2693
|
/* Forwards */
|
|
2979
2694
|
),
|
|
2980
|
-
end:
|
|
2695
|
+
end: JA(
|
|
2981
2696
|
i.endContainer.textContent,
|
|
2982
2697
|
i.endOffset,
|
|
2983
2698
|
2
|
|
@@ -2987,7 +2702,7 @@ function mi(i) {
|
|
|
2987
2702
|
if (n.start >= 0 && (A.setStart(i.startContainer, n.start), t = !0), n.end > 0 && (A.setEnd(i.endContainer, n.end), e = !0), t && e)
|
|
2988
2703
|
return A;
|
|
2989
2704
|
if (!t) {
|
|
2990
|
-
const { node: r, offset: s } =
|
|
2705
|
+
const { node: r, offset: s } = ut(
|
|
2991
2706
|
A,
|
|
2992
2707
|
1
|
|
2993
2708
|
/* Forwards */
|
|
@@ -2995,7 +2710,7 @@ function mi(i) {
|
|
|
2995
2710
|
r && s >= 0 && A.setStart(r, s);
|
|
2996
2711
|
}
|
|
2997
2712
|
if (!e) {
|
|
2998
|
-
const { node: r, offset: s } =
|
|
2713
|
+
const { node: r, offset: s } = ut(
|
|
2999
2714
|
A,
|
|
3000
2715
|
2
|
|
3001
2716
|
/* Backwards */
|
|
@@ -3004,7 +2719,7 @@ function mi(i) {
|
|
|
3004
2719
|
}
|
|
3005
2720
|
return A;
|
|
3006
2721
|
}
|
|
3007
|
-
function
|
|
2722
|
+
function Ae(i) {
|
|
3008
2723
|
var A;
|
|
3009
2724
|
switch (i.nodeType) {
|
|
3010
2725
|
case Node.ELEMENT_NODE:
|
|
@@ -3014,13 +2729,13 @@ function ae(i) {
|
|
|
3014
2729
|
return 0;
|
|
3015
2730
|
}
|
|
3016
2731
|
}
|
|
3017
|
-
function
|
|
2732
|
+
function mt(i) {
|
|
3018
2733
|
let A = i.previousSibling, t = 0;
|
|
3019
2734
|
for (; A; )
|
|
3020
|
-
t +=
|
|
2735
|
+
t += Ae(A), A = A.previousSibling;
|
|
3021
2736
|
return t;
|
|
3022
2737
|
}
|
|
3023
|
-
function
|
|
2738
|
+
function te(i, ...A) {
|
|
3024
2739
|
let t = A.shift();
|
|
3025
2740
|
const e = i.ownerDocument.createNodeIterator(
|
|
3026
2741
|
i,
|
|
@@ -3035,7 +2750,7 @@ function he(i, ...A) {
|
|
|
3035
2750
|
throw new RangeError("Offset exceeds text length");
|
|
3036
2751
|
return n;
|
|
3037
2752
|
}
|
|
3038
|
-
class
|
|
2753
|
+
class v {
|
|
3039
2754
|
constructor(A, t) {
|
|
3040
2755
|
if (t < 0)
|
|
3041
2756
|
throw new Error("Offset is invalid");
|
|
@@ -3052,8 +2767,8 @@ class G {
|
|
|
3052
2767
|
throw new Error("Parent is not an ancestor of current element");
|
|
3053
2768
|
let t = this.element, e = this.offset;
|
|
3054
2769
|
for (; t !== A; )
|
|
3055
|
-
e +=
|
|
3056
|
-
return new
|
|
2770
|
+
e += mt(t), t = t.parentElement;
|
|
2771
|
+
return new v(t, e);
|
|
3057
2772
|
}
|
|
3058
2773
|
/**
|
|
3059
2774
|
* Resolve the position to a specific text node and offset within that node.
|
|
@@ -3074,7 +2789,7 @@ class G {
|
|
|
3074
2789
|
*/
|
|
3075
2790
|
resolve(A = {}) {
|
|
3076
2791
|
try {
|
|
3077
|
-
return
|
|
2792
|
+
return te(this.element, this.offset)[0];
|
|
3078
2793
|
} catch (t) {
|
|
3079
2794
|
if (this.offset === 0 && A.direction !== void 0) {
|
|
3080
2795
|
const e = document.createTreeWalker(
|
|
@@ -3097,9 +2812,9 @@ class G {
|
|
|
3097
2812
|
static fromCharOffset(A, t) {
|
|
3098
2813
|
switch (A.nodeType) {
|
|
3099
2814
|
case Node.TEXT_NODE:
|
|
3100
|
-
return
|
|
2815
|
+
return v.fromPoint(A, t);
|
|
3101
2816
|
case Node.ELEMENT_NODE:
|
|
3102
|
-
return new
|
|
2817
|
+
return new v(A, t);
|
|
3103
2818
|
default:
|
|
3104
2819
|
throw new Error("Node is not an element or text node");
|
|
3105
2820
|
}
|
|
@@ -3117,23 +2832,23 @@ class G {
|
|
|
3117
2832
|
throw new Error("Text node offset is out of range");
|
|
3118
2833
|
if (!A.parentElement)
|
|
3119
2834
|
throw new Error("Text node has no parent");
|
|
3120
|
-
const e =
|
|
3121
|
-
return new
|
|
2835
|
+
const e = mt(A) + t;
|
|
2836
|
+
return new v(A.parentElement, e);
|
|
3122
2837
|
}
|
|
3123
2838
|
case Node.ELEMENT_NODE: {
|
|
3124
2839
|
if (t < 0 || t > A.childNodes.length)
|
|
3125
2840
|
throw new Error("Child node offset is out of range");
|
|
3126
2841
|
let e = 0;
|
|
3127
2842
|
for (let n = 0; n < t; n++)
|
|
3128
|
-
e +=
|
|
3129
|
-
return new
|
|
2843
|
+
e += Ae(A.childNodes[n]);
|
|
2844
|
+
return new v(A, e);
|
|
3130
2845
|
}
|
|
3131
2846
|
default:
|
|
3132
2847
|
throw new Error("Point is not in an element or text node");
|
|
3133
2848
|
}
|
|
3134
2849
|
}
|
|
3135
2850
|
}
|
|
3136
|
-
class
|
|
2851
|
+
class k {
|
|
3137
2852
|
constructor(A, t) {
|
|
3138
2853
|
this.start = A, this.end = t;
|
|
3139
2854
|
}
|
|
@@ -3143,7 +2858,7 @@ class b {
|
|
|
3143
2858
|
* `end.element`.
|
|
3144
2859
|
*/
|
|
3145
2860
|
relativeTo(A) {
|
|
3146
|
-
return new
|
|
2861
|
+
return new k(
|
|
3147
2862
|
this.start.relativeTo(A),
|
|
3148
2863
|
this.end.relativeTo(A)
|
|
3149
2864
|
);
|
|
@@ -3159,7 +2874,7 @@ class b {
|
|
|
3159
2874
|
*/
|
|
3160
2875
|
toRange() {
|
|
3161
2876
|
let A, t;
|
|
3162
|
-
this.start.element === this.end.element && this.start.offset <= this.end.offset ? [A, t] =
|
|
2877
|
+
this.start.element === this.end.element && this.start.offset <= this.end.offset ? [A, t] = te(
|
|
3163
2878
|
this.start.element,
|
|
3164
2879
|
this.start.offset,
|
|
3165
2880
|
this.end.offset
|
|
@@ -3177,20 +2892,20 @@ class b {
|
|
|
3177
2892
|
* Create a TextRange from a (DOM) Range
|
|
3178
2893
|
*/
|
|
3179
2894
|
static fromRange(A) {
|
|
3180
|
-
const t =
|
|
2895
|
+
const t = v.fromPoint(
|
|
3181
2896
|
A.startContainer,
|
|
3182
2897
|
A.startOffset
|
|
3183
|
-
), e =
|
|
3184
|
-
return new
|
|
2898
|
+
), e = v.fromPoint(A.endContainer, A.endOffset);
|
|
2899
|
+
return new k(t, e);
|
|
3185
2900
|
}
|
|
3186
2901
|
/**
|
|
3187
2902
|
* Create a TextRange representing the `start`th to `end`th characters in
|
|
3188
2903
|
* `root`
|
|
3189
2904
|
*/
|
|
3190
2905
|
static fromOffsets(A, t, e) {
|
|
3191
|
-
return new
|
|
3192
|
-
new
|
|
3193
|
-
new
|
|
2906
|
+
return new k(
|
|
2907
|
+
new v(A, t),
|
|
2908
|
+
new v(A, e)
|
|
3194
2909
|
);
|
|
3195
2910
|
}
|
|
3196
2911
|
/**
|
|
@@ -3198,7 +2913,7 @@ class b {
|
|
|
3198
2913
|
* whitespace
|
|
3199
2914
|
*/
|
|
3200
2915
|
static trimmedRange(A) {
|
|
3201
|
-
return
|
|
2916
|
+
return ri(k.fromRange(A).toRange());
|
|
3202
2917
|
}
|
|
3203
2918
|
}
|
|
3204
2919
|
class QA {
|
|
@@ -3206,7 +2921,7 @@ class QA {
|
|
|
3206
2921
|
this.root = A, this.start = t, this.end = e;
|
|
3207
2922
|
}
|
|
3208
2923
|
static fromRange(A, t) {
|
|
3209
|
-
const e =
|
|
2924
|
+
const e = k.fromRange(t).relativeTo(A);
|
|
3210
2925
|
return new QA(
|
|
3211
2926
|
A,
|
|
3212
2927
|
e.start.offset,
|
|
@@ -3224,10 +2939,10 @@ class QA {
|
|
|
3224
2939
|
};
|
|
3225
2940
|
}
|
|
3226
2941
|
toRange() {
|
|
3227
|
-
return
|
|
2942
|
+
return k.fromOffsets(this.root, this.start, this.end).toRange();
|
|
3228
2943
|
}
|
|
3229
2944
|
}
|
|
3230
|
-
class
|
|
2945
|
+
class RA {
|
|
3231
2946
|
/**
|
|
3232
2947
|
* @param root - A root element from which to anchor.
|
|
3233
2948
|
*/
|
|
@@ -3240,15 +2955,15 @@ class yA {
|
|
|
3240
2955
|
* Will throw if `range` does not contain any text nodes.
|
|
3241
2956
|
*/
|
|
3242
2957
|
static fromRange(A, t) {
|
|
3243
|
-
const e = A.textContent, n =
|
|
3244
|
-
return new
|
|
2958
|
+
const e = A.textContent, n = k.fromRange(t).relativeTo(A), r = n.start.offset, s = n.end.offset, o = 32;
|
|
2959
|
+
return new RA(A, e.slice(r, s), {
|
|
3245
2960
|
prefix: e.slice(Math.max(0, r - o), r),
|
|
3246
2961
|
suffix: e.slice(s, Math.min(e.length, s + o))
|
|
3247
2962
|
});
|
|
3248
2963
|
}
|
|
3249
2964
|
static fromSelector(A, t) {
|
|
3250
2965
|
const { prefix: e, suffix: n } = t;
|
|
3251
|
-
return new
|
|
2966
|
+
return new RA(A, t.exact, { prefix: e, suffix: n });
|
|
3252
2967
|
}
|
|
3253
2968
|
toSelector() {
|
|
3254
2969
|
return {
|
|
@@ -3262,7 +2977,7 @@ class yA {
|
|
|
3262
2977
|
return this.toPositionAnchor(A).toRange();
|
|
3263
2978
|
}
|
|
3264
2979
|
toPositionAnchor(A = {}) {
|
|
3265
|
-
const t = this.root.textContent, e =
|
|
2980
|
+
const t = this.root.textContent, e = ni(t, this.exact, {
|
|
3266
2981
|
...this.context,
|
|
3267
2982
|
hint: A.hint
|
|
3268
2983
|
});
|
|
@@ -3271,7 +2986,7 @@ class yA {
|
|
|
3271
2986
|
return new QA(this.root, e.start, e.end);
|
|
3272
2987
|
}
|
|
3273
2988
|
}
|
|
3274
|
-
function
|
|
2989
|
+
function si(i) {
|
|
3275
2990
|
const A = i.tagName.toUpperCase();
|
|
3276
2991
|
return A === "IMG" || A === "VIDEO" || A === "AUDIO" || A === "IFRAME" || A === "OBJECT" || A === "EMBED" || A === "CANVAS";
|
|
3277
2992
|
}
|
|
@@ -3281,7 +2996,7 @@ function it(i, A) {
|
|
|
3281
2996
|
if (e && e.highlight) {
|
|
3282
2997
|
let n;
|
|
3283
2998
|
t && t.getCssSelector() && (n = i.querySelector(t.getCssSelector())), n || (n = i.body);
|
|
3284
|
-
const r = new
|
|
2999
|
+
const r = new RA(n, e.highlight, {
|
|
3285
3000
|
prefix: e.before,
|
|
3286
3001
|
suffix: e.after
|
|
3287
3002
|
});
|
|
@@ -3300,7 +3015,7 @@ function it(i, A) {
|
|
|
3300
3015
|
}
|
|
3301
3016
|
if (n) {
|
|
3302
3017
|
const r = i.createRange();
|
|
3303
|
-
return n.childNodes.length === 0 ||
|
|
3018
|
+
return n.childNodes.length === 0 || si(n) ? (r.selectNode(n), r) : (r.setStartBefore(n), r.setEndAfter(n), r);
|
|
3304
3019
|
}
|
|
3305
3020
|
}
|
|
3306
3021
|
} catch (t) {
|
|
@@ -3308,11 +3023,738 @@ function it(i, A) {
|
|
|
3308
3023
|
}
|
|
3309
3024
|
return null;
|
|
3310
3025
|
}
|
|
3311
|
-
function
|
|
3312
|
-
|
|
3313
|
-
|
|
3026
|
+
function oi(i, A) {
|
|
3027
|
+
let t = i.getClientRects();
|
|
3028
|
+
t.length || i.commonAncestorContainer.nodeType === Node.ELEMENT_NODE && (t = i.commonAncestorContainer.getClientRects());
|
|
3029
|
+
const e = 1, n = [];
|
|
3030
|
+
for (const h of t)
|
|
3031
|
+
n.push({
|
|
3032
|
+
bottom: h.bottom,
|
|
3033
|
+
height: h.height,
|
|
3034
|
+
left: h.left,
|
|
3035
|
+
right: h.right,
|
|
3036
|
+
top: h.top,
|
|
3037
|
+
width: h.width
|
|
3038
|
+
});
|
|
3039
|
+
const r = ee(
|
|
3040
|
+
n,
|
|
3041
|
+
e,
|
|
3042
|
+
A
|
|
3043
|
+
), s = hi(r, e), o = ie(s), a = 2 * 2;
|
|
3044
|
+
for (let h = o.length - 1; h >= 0; h--) {
|
|
3045
|
+
const c = o[h];
|
|
3046
|
+
if (!(c.width * c.height > a))
|
|
3047
|
+
if (o.length > 1)
|
|
3048
|
+
o.splice(h, 1);
|
|
3049
|
+
else
|
|
3050
|
+
break;
|
|
3051
|
+
}
|
|
3052
|
+
return o;
|
|
3053
|
+
}
|
|
3054
|
+
function ee(i, A, t) {
|
|
3055
|
+
for (let e = 0; e < i.length; e++)
|
|
3056
|
+
for (let n = e + 1; n < i.length; n++) {
|
|
3057
|
+
const r = i[e], s = i[n];
|
|
3058
|
+
if (r === s)
|
|
3059
|
+
continue;
|
|
3060
|
+
const o = S(r.top, s.top, A) && S(r.bottom, s.bottom, A), a = S(r.left, s.left, A) && S(r.right, s.right, A);
|
|
3061
|
+
if ((a && !t || o && !a) && ne(r, s, A)) {
|
|
3062
|
+
const h = i.filter((l) => l !== r && l !== s), c = ai(r, s);
|
|
3063
|
+
return h.push(c), ee(
|
|
3064
|
+
h,
|
|
3065
|
+
A,
|
|
3066
|
+
t
|
|
3067
|
+
);
|
|
3068
|
+
}
|
|
3069
|
+
}
|
|
3070
|
+
return i;
|
|
3071
|
+
}
|
|
3072
|
+
function ai(i, A) {
|
|
3073
|
+
const t = Math.min(i.left, A.left), e = Math.max(i.right, A.right), n = Math.min(i.top, A.top), r = Math.max(i.bottom, A.bottom);
|
|
3074
|
+
return {
|
|
3075
|
+
bottom: r,
|
|
3076
|
+
height: r - n,
|
|
3077
|
+
left: t,
|
|
3078
|
+
right: e,
|
|
3079
|
+
top: n,
|
|
3080
|
+
width: e - t
|
|
3081
|
+
};
|
|
3082
|
+
}
|
|
3083
|
+
function hi(i, A) {
|
|
3084
|
+
const t = new Set(i);
|
|
3085
|
+
for (const e of i) {
|
|
3086
|
+
if (!(e.width > 1 && e.height > 1)) {
|
|
3087
|
+
t.delete(e);
|
|
3088
|
+
continue;
|
|
3089
|
+
}
|
|
3090
|
+
for (const n of i)
|
|
3091
|
+
if (e !== n && t.has(n) && ci(n, e, A)) {
|
|
3092
|
+
t.delete(e);
|
|
3093
|
+
break;
|
|
3094
|
+
}
|
|
3095
|
+
}
|
|
3096
|
+
return Array.from(t);
|
|
3097
|
+
}
|
|
3098
|
+
function ci(i, A, t) {
|
|
3099
|
+
return uA(i, A.left, A.top, t) && uA(i, A.right, A.top, t) && uA(i, A.left, A.bottom, t) && uA(i, A.right, A.bottom, t);
|
|
3100
|
+
}
|
|
3101
|
+
function uA(i, A, t, e) {
|
|
3102
|
+
return (i.left < A || S(i.left, A, e)) && (i.right > A || S(i.right, A, e)) && (i.top < t || S(i.top, t, e)) && (i.bottom > t || S(i.bottom, t, e));
|
|
3103
|
+
}
|
|
3104
|
+
function ie(i) {
|
|
3105
|
+
for (let A = 0; A < i.length; A++)
|
|
3106
|
+
for (let t = A + 1; t < i.length; t++) {
|
|
3107
|
+
const e = i[A], n = i[t];
|
|
3108
|
+
if (e !== n && ne(e, n, -1)) {
|
|
3109
|
+
let r = [], s;
|
|
3110
|
+
const o = Bt(e, n);
|
|
3111
|
+
if (o.length === 1)
|
|
3112
|
+
r = o, s = e;
|
|
3113
|
+
else {
|
|
3114
|
+
const h = Bt(n, e);
|
|
3115
|
+
o.length < h.length ? (r = o, s = e) : (r = h, s = n);
|
|
3116
|
+
}
|
|
3117
|
+
const a = i.filter((h) => h !== s);
|
|
3118
|
+
return Array.prototype.push.apply(a, r), ie(a);
|
|
3119
|
+
}
|
|
3120
|
+
}
|
|
3121
|
+
return i;
|
|
3122
|
+
}
|
|
3123
|
+
function Bt(i, A) {
|
|
3124
|
+
const t = li(A, i);
|
|
3125
|
+
if (t.height === 0 || t.width === 0)
|
|
3126
|
+
return [i];
|
|
3127
|
+
const e = [];
|
|
3128
|
+
{
|
|
3129
|
+
const n = {
|
|
3130
|
+
bottom: i.bottom,
|
|
3131
|
+
height: 0,
|
|
3132
|
+
left: i.left,
|
|
3133
|
+
right: t.left,
|
|
3134
|
+
top: i.top,
|
|
3135
|
+
width: 0
|
|
3136
|
+
};
|
|
3137
|
+
n.width = n.right - n.left, n.height = n.bottom - n.top, n.height !== 0 && n.width !== 0 && e.push(n);
|
|
3138
|
+
}
|
|
3139
|
+
{
|
|
3140
|
+
const n = {
|
|
3141
|
+
bottom: t.top,
|
|
3142
|
+
height: 0,
|
|
3143
|
+
left: t.left,
|
|
3144
|
+
right: t.right,
|
|
3145
|
+
top: i.top,
|
|
3146
|
+
width: 0
|
|
3147
|
+
};
|
|
3148
|
+
n.width = n.right - n.left, n.height = n.bottom - n.top, n.height !== 0 && n.width !== 0 && e.push(n);
|
|
3149
|
+
}
|
|
3150
|
+
{
|
|
3151
|
+
const n = {
|
|
3152
|
+
bottom: i.bottom,
|
|
3153
|
+
height: 0,
|
|
3154
|
+
left: t.left,
|
|
3155
|
+
right: t.right,
|
|
3156
|
+
top: t.bottom,
|
|
3157
|
+
width: 0
|
|
3158
|
+
};
|
|
3159
|
+
n.width = n.right - n.left, n.height = n.bottom - n.top, n.height !== 0 && n.width !== 0 && e.push(n);
|
|
3160
|
+
}
|
|
3161
|
+
{
|
|
3162
|
+
const n = {
|
|
3163
|
+
bottom: i.bottom,
|
|
3164
|
+
height: 0,
|
|
3165
|
+
left: t.right,
|
|
3166
|
+
right: i.right,
|
|
3167
|
+
top: i.top,
|
|
3168
|
+
width: 0
|
|
3169
|
+
};
|
|
3170
|
+
n.width = n.right - n.left, n.height = n.bottom - n.top, n.height !== 0 && n.width !== 0 && e.push(n);
|
|
3171
|
+
}
|
|
3172
|
+
return e;
|
|
3173
|
+
}
|
|
3174
|
+
function li(i, A) {
|
|
3175
|
+
const t = Math.max(i.left, A.left), e = Math.min(i.right, A.right), n = Math.max(i.top, A.top), r = Math.min(i.bottom, A.bottom);
|
|
3176
|
+
return {
|
|
3177
|
+
bottom: r,
|
|
3178
|
+
height: Math.max(0, r - n),
|
|
3179
|
+
left: t,
|
|
3180
|
+
right: e,
|
|
3181
|
+
top: n,
|
|
3182
|
+
width: Math.max(0, e - t)
|
|
3183
|
+
};
|
|
3184
|
+
}
|
|
3185
|
+
function ne(i, A, t) {
|
|
3186
|
+
return (i.left < A.right || t >= 0 && S(i.left, A.right, t)) && (A.left < i.right || t >= 0 && S(A.left, i.right, t)) && (i.top < A.bottom || t >= 0 && S(i.top, A.bottom, t)) && (A.top < i.bottom || t >= 0 && S(A.top, i.bottom, t));
|
|
3187
|
+
}
|
|
3188
|
+
function S(i, A, t) {
|
|
3189
|
+
return Math.abs(i - A) <= t;
|
|
3190
|
+
}
|
|
3191
|
+
var _ = [], gi = function() {
|
|
3192
|
+
return _.some(function(i) {
|
|
3193
|
+
return i.activeTargets.length > 0;
|
|
3194
|
+
});
|
|
3195
|
+
}, di = function() {
|
|
3196
|
+
return _.some(function(i) {
|
|
3197
|
+
return i.skippedTargets.length > 0;
|
|
3198
|
+
});
|
|
3199
|
+
}, Et = "ResizeObserver loop completed with undelivered notifications.", Mi = function() {
|
|
3200
|
+
var i;
|
|
3201
|
+
typeof ErrorEvent == "function" ? i = new ErrorEvent("error", {
|
|
3202
|
+
message: Et
|
|
3203
|
+
}) : (i = document.createEvent("Event"), i.initEvent("error", !1, !1), i.message = Et), window.dispatchEvent(i);
|
|
3204
|
+
}, gA;
|
|
3205
|
+
(function(i) {
|
|
3206
|
+
i.BORDER_BOX = "border-box", i.CONTENT_BOX = "content-box", i.DEVICE_PIXEL_CONTENT_BOX = "device-pixel-content-box";
|
|
3207
|
+
})(gA || (gA = {}));
|
|
3208
|
+
var $ = function(i) {
|
|
3209
|
+
return Object.freeze(i);
|
|
3210
|
+
}, ui = function() {
|
|
3211
|
+
function i(A, t) {
|
|
3212
|
+
this.inlineSize = A, this.blockSize = t, $(this);
|
|
3213
|
+
}
|
|
3214
|
+
return i;
|
|
3215
|
+
}(), re = function() {
|
|
3216
|
+
function i(A, t, e, n) {
|
|
3217
|
+
return this.x = A, this.y = t, this.width = e, this.height = n, this.top = this.y, this.left = this.x, this.bottom = this.top + this.height, this.right = this.left + this.width, $(this);
|
|
3218
|
+
}
|
|
3219
|
+
return i.prototype.toJSON = function() {
|
|
3220
|
+
var A = this, t = A.x, e = A.y, n = A.top, r = A.right, s = A.bottom, o = A.left, a = A.width, h = A.height;
|
|
3221
|
+
return { x: t, y: e, top: n, right: r, bottom: s, left: o, width: a, height: h };
|
|
3222
|
+
}, i.fromRect = function(A) {
|
|
3223
|
+
return new i(A.x, A.y, A.width, A.height);
|
|
3224
|
+
}, i;
|
|
3225
|
+
}(), nt = function(i) {
|
|
3226
|
+
return i instanceof SVGElement && "getBBox" in i;
|
|
3227
|
+
}, se = function(i) {
|
|
3228
|
+
if (nt(i)) {
|
|
3229
|
+
var A = i.getBBox(), t = A.width, e = A.height;
|
|
3230
|
+
return !t && !e;
|
|
3231
|
+
}
|
|
3232
|
+
var n = i, r = n.offsetWidth, s = n.offsetHeight;
|
|
3233
|
+
return !(r || s || i.getClientRects().length);
|
|
3234
|
+
}, It = function(i) {
|
|
3235
|
+
var A;
|
|
3236
|
+
if (i instanceof Element)
|
|
3237
|
+
return !0;
|
|
3238
|
+
var t = (A = i == null ? void 0 : i.ownerDocument) === null || A === void 0 ? void 0 : A.defaultView;
|
|
3239
|
+
return !!(t && i instanceof t.Element);
|
|
3240
|
+
}, mi = function(i) {
|
|
3241
|
+
switch (i.tagName) {
|
|
3242
|
+
case "INPUT":
|
|
3243
|
+
if (i.type !== "image")
|
|
3244
|
+
break;
|
|
3245
|
+
case "VIDEO":
|
|
3246
|
+
case "AUDIO":
|
|
3247
|
+
case "EMBED":
|
|
3248
|
+
case "OBJECT":
|
|
3249
|
+
case "CANVAS":
|
|
3250
|
+
case "IFRAME":
|
|
3251
|
+
case "IMG":
|
|
3252
|
+
return !0;
|
|
3253
|
+
}
|
|
3254
|
+
return !1;
|
|
3255
|
+
}, lA = typeof window < "u" ? window : {}, mA = /* @__PURE__ */ new WeakMap(), ft = /auto|scroll/, Bi = /^tb|vertical/, Ei = /msie|trident/i.test(lA.navigator && lA.navigator.userAgent), H = function(i) {
|
|
3256
|
+
return parseFloat(i || "0");
|
|
3257
|
+
}, rA = function(i, A, t) {
|
|
3258
|
+
return i === void 0 && (i = 0), A === void 0 && (A = 0), t === void 0 && (t = !1), new ui((t ? A : i) || 0, (t ? i : A) || 0);
|
|
3259
|
+
}, pt = $({
|
|
3260
|
+
devicePixelContentBoxSize: rA(),
|
|
3261
|
+
borderBoxSize: rA(),
|
|
3262
|
+
contentBoxSize: rA(),
|
|
3263
|
+
contentRect: new re(0, 0, 0, 0)
|
|
3264
|
+
}), oe = function(i, A) {
|
|
3265
|
+
if (A === void 0 && (A = !1), mA.has(i) && !A)
|
|
3266
|
+
return mA.get(i);
|
|
3267
|
+
if (se(i))
|
|
3268
|
+
return mA.set(i, pt), pt;
|
|
3269
|
+
var t = getComputedStyle(i), e = nt(i) && i.ownerSVGElement && i.getBBox(), n = !Ei && t.boxSizing === "border-box", r = Bi.test(t.writingMode || ""), s = !e && ft.test(t.overflowY || ""), o = !e && ft.test(t.overflowX || ""), a = e ? 0 : H(t.paddingTop), h = e ? 0 : H(t.paddingRight), c = e ? 0 : H(t.paddingBottom), l = e ? 0 : H(t.paddingLeft), g = e ? 0 : H(t.borderTopWidth), u = e ? 0 : H(t.borderRightWidth), m = e ? 0 : H(t.borderBottomWidth), B = e ? 0 : H(t.borderLeftWidth), I = l + h, E = a + c, p = B + u, f = g + m, w = o ? i.offsetHeight - f - i.clientHeight : 0, R = s ? i.offsetWidth - p - i.clientWidth : 0, AA = n ? I + p : 0, O = n ? E + f : 0, X = e ? e.width : H(t.width) - AA - R, Z = e ? e.height : H(t.height) - O - w, dA = X + I + R + p, MA = Z + E + w + f, tA = $({
|
|
3270
|
+
devicePixelContentBoxSize: rA(Math.round(X * devicePixelRatio), Math.round(Z * devicePixelRatio), r),
|
|
3271
|
+
borderBoxSize: rA(dA, MA, r),
|
|
3272
|
+
contentBoxSize: rA(X, Z, r),
|
|
3273
|
+
contentRect: new re(l, a, X, Z)
|
|
3274
|
+
});
|
|
3275
|
+
return mA.set(i, tA), tA;
|
|
3276
|
+
}, ae = function(i, A, t) {
|
|
3277
|
+
var e = oe(i, t), n = e.borderBoxSize, r = e.contentBoxSize, s = e.devicePixelContentBoxSize;
|
|
3278
|
+
switch (A) {
|
|
3279
|
+
case gA.DEVICE_PIXEL_CONTENT_BOX:
|
|
3280
|
+
return s;
|
|
3281
|
+
case gA.BORDER_BOX:
|
|
3282
|
+
return n;
|
|
3283
|
+
default:
|
|
3284
|
+
return r;
|
|
3285
|
+
}
|
|
3286
|
+
}, Ii = function() {
|
|
3287
|
+
function i(A) {
|
|
3288
|
+
var t = oe(A);
|
|
3289
|
+
this.target = A, this.contentRect = t.contentRect, this.borderBoxSize = $([t.borderBoxSize]), this.contentBoxSize = $([t.contentBoxSize]), this.devicePixelContentBoxSize = $([t.devicePixelContentBoxSize]);
|
|
3290
|
+
}
|
|
3291
|
+
return i;
|
|
3292
|
+
}(), he = function(i) {
|
|
3293
|
+
if (se(i))
|
|
3294
|
+
return 1 / 0;
|
|
3295
|
+
for (var A = 0, t = i.parentNode; t; )
|
|
3296
|
+
A += 1, t = t.parentNode;
|
|
3297
|
+
return A;
|
|
3298
|
+
}, fi = function() {
|
|
3299
|
+
var i = 1 / 0, A = [];
|
|
3300
|
+
_.forEach(function(r) {
|
|
3301
|
+
if (r.activeTargets.length !== 0) {
|
|
3302
|
+
var s = [];
|
|
3303
|
+
r.activeTargets.forEach(function(o) {
|
|
3304
|
+
var a = new Ii(o.target), h = he(o.target);
|
|
3305
|
+
s.push(a), o.lastReportedSize = ae(o.target, o.observedBox), h < i && (i = h);
|
|
3306
|
+
}), A.push(function() {
|
|
3307
|
+
r.callback.call(r.observer, s, r.observer);
|
|
3308
|
+
}), r.activeTargets.splice(0, r.activeTargets.length);
|
|
3309
|
+
}
|
|
3310
|
+
});
|
|
3311
|
+
for (var t = 0, e = A; t < e.length; t++) {
|
|
3312
|
+
var n = e[t];
|
|
3313
|
+
n();
|
|
3314
|
+
}
|
|
3315
|
+
return i;
|
|
3316
|
+
}, wt = function(i) {
|
|
3317
|
+
_.forEach(function(A) {
|
|
3318
|
+
A.activeTargets.splice(0, A.activeTargets.length), A.skippedTargets.splice(0, A.skippedTargets.length), A.observationTargets.forEach(function(t) {
|
|
3319
|
+
t.isActive() && (he(t.target) > i ? A.activeTargets.push(t) : A.skippedTargets.push(t));
|
|
3320
|
+
});
|
|
3321
|
+
});
|
|
3322
|
+
}, pi = function() {
|
|
3323
|
+
var i = 0;
|
|
3324
|
+
for (wt(i); gi(); )
|
|
3325
|
+
i = fi(), wt(i);
|
|
3326
|
+
return di() && Mi(), i > 0;
|
|
3327
|
+
}, SA, ce = [], wi = function() {
|
|
3328
|
+
return ce.splice(0).forEach(function(i) {
|
|
3329
|
+
return i();
|
|
3330
|
+
});
|
|
3331
|
+
}, Fi = function(i) {
|
|
3332
|
+
if (!SA) {
|
|
3333
|
+
var A = 0, t = document.createTextNode(""), e = { characterData: !0 };
|
|
3334
|
+
new MutationObserver(function() {
|
|
3335
|
+
return wi();
|
|
3336
|
+
}).observe(t, e), SA = function() {
|
|
3337
|
+
t.textContent = "".concat(A ? A-- : A++);
|
|
3338
|
+
};
|
|
3339
|
+
}
|
|
3340
|
+
ce.push(i), SA();
|
|
3341
|
+
}, Ui = function(i) {
|
|
3342
|
+
Fi(function() {
|
|
3343
|
+
requestAnimationFrame(i);
|
|
3344
|
+
});
|
|
3345
|
+
}, pA = 0, yi = function() {
|
|
3346
|
+
return !!pA;
|
|
3347
|
+
}, Qi = 250, Ri = { attributes: !0, characterData: !0, childList: !0, subtree: !0 }, Ft = [
|
|
3348
|
+
"resize",
|
|
3349
|
+
"load",
|
|
3350
|
+
"transitionend",
|
|
3351
|
+
"animationend",
|
|
3352
|
+
"animationstart",
|
|
3353
|
+
"animationiteration",
|
|
3354
|
+
"keyup",
|
|
3355
|
+
"keydown",
|
|
3356
|
+
"mouseup",
|
|
3357
|
+
"mousedown",
|
|
3358
|
+
"mouseover",
|
|
3359
|
+
"mouseout",
|
|
3360
|
+
"blur",
|
|
3361
|
+
"focus"
|
|
3362
|
+
], Ut = function(i) {
|
|
3363
|
+
return i === void 0 && (i = 0), Date.now() + i;
|
|
3364
|
+
}, VA = !1, Yi = function() {
|
|
3365
|
+
function i() {
|
|
3366
|
+
var A = this;
|
|
3367
|
+
this.stopped = !0, this.listener = function() {
|
|
3368
|
+
return A.schedule();
|
|
3369
|
+
};
|
|
3370
|
+
}
|
|
3371
|
+
return i.prototype.run = function(A) {
|
|
3372
|
+
var t = this;
|
|
3373
|
+
if (A === void 0 && (A = Qi), !VA) {
|
|
3374
|
+
VA = !0;
|
|
3375
|
+
var e = Ut(A);
|
|
3376
|
+
Ui(function() {
|
|
3377
|
+
var n = !1;
|
|
3378
|
+
try {
|
|
3379
|
+
n = pi();
|
|
3380
|
+
} finally {
|
|
3381
|
+
if (VA = !1, A = e - Ut(), !yi())
|
|
3382
|
+
return;
|
|
3383
|
+
n ? t.run(1e3) : A > 0 ? t.run(A) : t.start();
|
|
3384
|
+
}
|
|
3385
|
+
});
|
|
3386
|
+
}
|
|
3387
|
+
}, i.prototype.schedule = function() {
|
|
3388
|
+
this.stop(), this.run();
|
|
3389
|
+
}, i.prototype.observe = function() {
|
|
3390
|
+
var A = this, t = function() {
|
|
3391
|
+
return A.observer && A.observer.observe(document.body, Ri);
|
|
3392
|
+
};
|
|
3393
|
+
document.body ? t() : lA.addEventListener("DOMContentLoaded", t);
|
|
3394
|
+
}, i.prototype.start = function() {
|
|
3395
|
+
var A = this;
|
|
3396
|
+
this.stopped && (this.stopped = !1, this.observer = new MutationObserver(this.listener), this.observe(), Ft.forEach(function(t) {
|
|
3397
|
+
return lA.addEventListener(t, A.listener, !0);
|
|
3398
|
+
}));
|
|
3399
|
+
}, i.prototype.stop = function() {
|
|
3400
|
+
var A = this;
|
|
3401
|
+
this.stopped || (this.observer && this.observer.disconnect(), Ft.forEach(function(t) {
|
|
3402
|
+
return lA.removeEventListener(t, A.listener, !0);
|
|
3403
|
+
}), this.stopped = !0);
|
|
3404
|
+
}, i;
|
|
3405
|
+
}(), PA = new Yi(), yt = function(i) {
|
|
3406
|
+
!pA && i > 0 && PA.start(), pA += i, !pA && PA.stop();
|
|
3407
|
+
}, Ci = function(i) {
|
|
3408
|
+
return !nt(i) && !mi(i) && getComputedStyle(i).display === "inline";
|
|
3409
|
+
}, zi = function() {
|
|
3410
|
+
function i(A, t) {
|
|
3411
|
+
this.target = A, this.observedBox = t || gA.CONTENT_BOX, this.lastReportedSize = {
|
|
3412
|
+
inlineSize: 0,
|
|
3413
|
+
blockSize: 0
|
|
3414
|
+
};
|
|
3415
|
+
}
|
|
3416
|
+
return i.prototype.isActive = function() {
|
|
3417
|
+
var A = ae(this.target, this.observedBox, !0);
|
|
3418
|
+
return Ci(this.target) && (this.lastReportedSize = A), this.lastReportedSize.inlineSize !== A.inlineSize || this.lastReportedSize.blockSize !== A.blockSize;
|
|
3419
|
+
}, i;
|
|
3420
|
+
}(), Ni = function() {
|
|
3421
|
+
function i(A, t) {
|
|
3422
|
+
this.activeTargets = [], this.skippedTargets = [], this.observationTargets = [], this.observer = A, this.callback = t;
|
|
3423
|
+
}
|
|
3424
|
+
return i;
|
|
3425
|
+
}(), BA = /* @__PURE__ */ new WeakMap(), Qt = function(i, A) {
|
|
3426
|
+
for (var t = 0; t < i.length; t += 1)
|
|
3427
|
+
if (i[t].target === A)
|
|
3428
|
+
return t;
|
|
3429
|
+
return -1;
|
|
3430
|
+
}, EA = function() {
|
|
3431
|
+
function i() {
|
|
3432
|
+
}
|
|
3433
|
+
return i.connect = function(A, t) {
|
|
3434
|
+
var e = new Ni(A, t);
|
|
3435
|
+
BA.set(A, e);
|
|
3436
|
+
}, i.observe = function(A, t, e) {
|
|
3437
|
+
var n = BA.get(A), r = n.observationTargets.length === 0;
|
|
3438
|
+
Qt(n.observationTargets, t) < 0 && (r && _.push(n), n.observationTargets.push(new zi(t, e && e.box)), yt(1), PA.schedule());
|
|
3439
|
+
}, i.unobserve = function(A, t) {
|
|
3440
|
+
var e = BA.get(A), n = Qt(e.observationTargets, t), r = e.observationTargets.length === 1;
|
|
3441
|
+
n >= 0 && (r && _.splice(_.indexOf(e), 1), e.observationTargets.splice(n, 1), yt(-1));
|
|
3442
|
+
}, i.disconnect = function(A) {
|
|
3443
|
+
var t = this, e = BA.get(A);
|
|
3444
|
+
e.observationTargets.slice().forEach(function(n) {
|
|
3445
|
+
return t.unobserve(A, n.target);
|
|
3446
|
+
}), e.activeTargets.splice(0, e.activeTargets.length);
|
|
3447
|
+
}, i;
|
|
3448
|
+
}(), le = function() {
|
|
3449
|
+
function i(A) {
|
|
3450
|
+
if (arguments.length === 0)
|
|
3451
|
+
throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");
|
|
3452
|
+
if (typeof A != "function")
|
|
3453
|
+
throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");
|
|
3454
|
+
EA.connect(this, A);
|
|
3455
|
+
}
|
|
3456
|
+
return i.prototype.observe = function(A, t) {
|
|
3457
|
+
if (arguments.length === 0)
|
|
3458
|
+
throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");
|
|
3459
|
+
if (!It(A))
|
|
3460
|
+
throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");
|
|
3461
|
+
EA.observe(this, A, t);
|
|
3462
|
+
}, i.prototype.unobserve = function(A) {
|
|
3463
|
+
if (arguments.length === 0)
|
|
3464
|
+
throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");
|
|
3465
|
+
if (!It(A))
|
|
3466
|
+
throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");
|
|
3467
|
+
EA.unobserve(this, A);
|
|
3468
|
+
}, i.prototype.disconnect = function() {
|
|
3469
|
+
EA.disconnect(this);
|
|
3470
|
+
}, i.toString = function() {
|
|
3471
|
+
return "function ResizeObserver () { [polyfill code] }";
|
|
3472
|
+
}, i;
|
|
3473
|
+
}();
|
|
3474
|
+
function Ti(i, A) {
|
|
3475
|
+
return i.document.documentElement.style.getPropertyValue(A);
|
|
3476
|
+
}
|
|
3477
|
+
function kA(i, A, t) {
|
|
3478
|
+
i.document.documentElement.style.setProperty(A, t);
|
|
3479
|
+
}
|
|
3480
|
+
function ge(i, A) {
|
|
3481
|
+
i.document.documentElement.style.removeProperty(A);
|
|
3482
|
+
}
|
|
3483
|
+
const xi = window.ResizeObserver || le, ji = "Highlight" in window, Rt = ["IMG", "IMAGE", "AUDIO", "VIDEO", "SVG"];
|
|
3484
|
+
class Si {
|
|
3485
|
+
/**
|
|
3486
|
+
* Creates a DecorationGroup object
|
|
3487
|
+
* @param id Unique HTML ID-adhering name of the group
|
|
3488
|
+
* @param name Human-readable name of the group
|
|
3489
|
+
*/
|
|
3490
|
+
constructor(A, t, e, n) {
|
|
3491
|
+
this.wnd = A, this.comms = t, this.id = e, this.name = n, this.items = [], this.lastItemId = 0, this.container = void 0, this.activateable = !1, this.experimentalHighlights = !1, this.currentRender = 0, ji && (this.experimentalHighlights = !0, this.notTextFlag = /* @__PURE__ */ new Map());
|
|
3492
|
+
}
|
|
3493
|
+
get activeable() {
|
|
3494
|
+
return this.activateable;
|
|
3495
|
+
}
|
|
3496
|
+
set activeable(A) {
|
|
3497
|
+
this.activateable = A;
|
|
3498
|
+
}
|
|
3499
|
+
/**
|
|
3500
|
+
* Adds a new decoration to the group.
|
|
3501
|
+
* @param decoration Decoration to add
|
|
3502
|
+
*/
|
|
3503
|
+
add(A) {
|
|
3504
|
+
var t, e, n, r;
|
|
3505
|
+
const s = `${this.id}-${this.lastItemId++}`, o = it(this.wnd.document, A.locator);
|
|
3506
|
+
if (!o) {
|
|
3507
|
+
this.comms.log("Can't locate DOM range for decoration", A);
|
|
3508
|
+
return;
|
|
3509
|
+
}
|
|
3510
|
+
const a = o.commonAncestorContainer;
|
|
3511
|
+
a.nodeType !== Node.TEXT_NODE && this.experimentalHighlights && (Rt.includes(a.nodeName.toUpperCase()) && ((t = this.notTextFlag) == null || t.set(s, !0)), a.querySelector(Rt.join(", ").toLowerCase()) && ((e = this.notTextFlag) == null || e.set(s, !0)), (((n = a.textContent) == null ? void 0 : n.trim()) || "").length === 0 && ((r = this.notTextFlag) == null || r.set(s, !0)));
|
|
3512
|
+
const h = {
|
|
3513
|
+
decoration: A,
|
|
3514
|
+
id: s,
|
|
3515
|
+
range: o
|
|
3516
|
+
};
|
|
3517
|
+
this.items.push(h), this.layout(h), this.renderLayout([h]);
|
|
3518
|
+
}
|
|
3519
|
+
/**
|
|
3520
|
+
* Removes the decoration with given ID from the group.
|
|
3521
|
+
* @param identifier ID of item to remove
|
|
3522
|
+
*/
|
|
3523
|
+
remove(A) {
|
|
3524
|
+
var t, e;
|
|
3525
|
+
const n = this.items.findIndex((s) => s.decoration.id === A);
|
|
3526
|
+
if (n < 0)
|
|
3527
|
+
return;
|
|
3528
|
+
const r = this.items[n];
|
|
3529
|
+
if (this.items.splice(n, 1), r.clickableElements = void 0, r.container && (r.container.remove(), r.container = void 0), this.experimentalHighlights && !((t = this.notTextFlag) != null && t.has(r.id))) {
|
|
3530
|
+
const s = this.wnd.CSS.highlights.get(this.id);
|
|
3531
|
+
s == null || s.delete(r.range);
|
|
3532
|
+
}
|
|
3533
|
+
(e = this.notTextFlag) == null || e.delete(r.id);
|
|
3534
|
+
}
|
|
3535
|
+
/**
|
|
3536
|
+
* Notifies that the given decoration was modified and needs to be updated.
|
|
3537
|
+
* @param decoration Decoration to update
|
|
3538
|
+
*/
|
|
3539
|
+
update(A) {
|
|
3540
|
+
this.remove(A.id), this.add(A);
|
|
3541
|
+
}
|
|
3542
|
+
/**
|
|
3543
|
+
* Removes all decorations from this group.
|
|
3544
|
+
*/
|
|
3545
|
+
clear() {
|
|
3546
|
+
var A;
|
|
3547
|
+
this.clearContainer(), this.items.length = 0, (A = this.notTextFlag) == null || A.clear();
|
|
3548
|
+
}
|
|
3549
|
+
/**
|
|
3550
|
+
* Recreates the decoration elements.
|
|
3551
|
+
* To be called after reflowing the resource, for example.
|
|
3552
|
+
*/
|
|
3553
|
+
requestLayout() {
|
|
3554
|
+
this.wnd.cancelAnimationFrame(this.currentRender), this.clearContainer(), this.items.forEach((A) => this.layout(A)), this.renderLayout(this.items);
|
|
3555
|
+
}
|
|
3556
|
+
experimentalLayout(A) {
|
|
3557
|
+
var t, e;
|
|
3558
|
+
const [n, r] = this.requireContainer(!0);
|
|
3559
|
+
r.add(A.range), n.innerHTML = `
|
|
3560
|
+
::highlight(${this.id}) {
|
|
3561
|
+
color: black;
|
|
3562
|
+
background-color: ${((e = (t = A.decoration) == null ? void 0 : t.style) == null ? void 0 : e.tint) ?? "yellow"};
|
|
3563
|
+
}`;
|
|
3564
|
+
}
|
|
3565
|
+
/**
|
|
3566
|
+
* Layouts a single DecorationItem.
|
|
3567
|
+
* @param item
|
|
3568
|
+
*/
|
|
3569
|
+
layout(A) {
|
|
3570
|
+
var t, e, n, r, s;
|
|
3571
|
+
if (this.experimentalHighlights && !((t = this.notTextFlag) != null && t.has(A.id)))
|
|
3572
|
+
return this.experimentalLayout(A);
|
|
3573
|
+
const o = this.wnd.document.createElement("div");
|
|
3574
|
+
o.setAttribute("id", A.id), o.style.setProperty("pointer-events", "none");
|
|
3575
|
+
const a = this.wnd.innerWidth, h = parseInt(
|
|
3576
|
+
getComputedStyle(this.wnd.document.documentElement).getPropertyValue(
|
|
3577
|
+
"column-count"
|
|
3578
|
+
)
|
|
3579
|
+
), c = a / (h || 1), l = this.wnd.document.scrollingElement, g = l.scrollLeft, u = l.scrollTop, m = (f, w, R) => {
|
|
3580
|
+
var AA, O, X, Z, dA, MA;
|
|
3581
|
+
if (f.style.position = "absolute", ((O = (AA = A.decoration) == null ? void 0 : AA.style) == null ? void 0 : O.width) === "viewport") {
|
|
3582
|
+
f.style.width = `${a}px`, f.style.height = `${w.height}px`;
|
|
3583
|
+
let tA = Math.floor(w.left / a) * a;
|
|
3584
|
+
f.style.left = `${tA + g}px`, f.style.top = `${w.top + u}px`;
|
|
3585
|
+
} else if (((Z = (X = A.decoration) == null ? void 0 : X.style) == null ? void 0 : Z.width) === "bounds")
|
|
3586
|
+
f.style.width = `${R.width}px`, f.style.height = `${w.height}px`, f.style.left = `${R.left + g}px`, f.style.top = `${w.top + u}px`;
|
|
3587
|
+
else if (((MA = (dA = A.decoration) == null ? void 0 : dA.style) == null ? void 0 : MA.width) === "page") {
|
|
3588
|
+
f.style.width = `${c}px`, f.style.height = `${w.height}px`;
|
|
3589
|
+
let tA = Math.floor(w.left / c) * c;
|
|
3590
|
+
f.style.left = `${tA + g}px`, f.style.top = `${w.top + u}px`;
|
|
3591
|
+
} else
|
|
3592
|
+
f.style.width = `${w.width}px`, f.style.height = `${w.height}px`, f.style.left = `${w.left + g}px`, f.style.top = `${w.top + u}px`;
|
|
3593
|
+
}, B = A.range.getBoundingClientRect();
|
|
3594
|
+
let I = this.wnd.document.createElement("template");
|
|
3595
|
+
const E = Ti(this.wnd, "--USER__appearance") === "readium-night-on";
|
|
3596
|
+
I.innerHTML = `
|
|
3597
|
+
<div
|
|
3598
|
+
class="r2-highlight-0"
|
|
3599
|
+
style="${[
|
|
3600
|
+
`background-color: ${((n = (e = A.decoration) == null ? void 0 : e.style) == null ? void 0 : n.tint) ?? "yellow"} !important`,
|
|
3601
|
+
//"opacity: 0.3 !important",
|
|
3602
|
+
`mix-blend-mode: ${E ? "exclusion" : "multiply"} !important`,
|
|
3603
|
+
"opacity: 1 !important",
|
|
3604
|
+
"box-sizing: border-box !important"
|
|
3605
|
+
].join("; ")}"
|
|
3606
|
+
>
|
|
3607
|
+
</div>
|
|
3608
|
+
`.trim();
|
|
3609
|
+
const p = I.content.firstElementChild;
|
|
3610
|
+
if (((s = (r = A.decoration) == null ? void 0 : r.style) == null ? void 0 : s.layout) === "bounds") {
|
|
3611
|
+
const f = p.cloneNode(!0);
|
|
3612
|
+
f.style.setProperty("pointer-events", "none"), m(f, B, B), o.append(f);
|
|
3613
|
+
} else {
|
|
3614
|
+
let f = oi(
|
|
3615
|
+
A.range,
|
|
3616
|
+
!0
|
|
3617
|
+
// doNotMergeHorizontallyAlignedRects
|
|
3618
|
+
);
|
|
3619
|
+
f = f.sort((w, R) => w.top < R.top ? -1 : w.top > R.top ? 1 : 0);
|
|
3620
|
+
for (let w of f) {
|
|
3621
|
+
const R = p.cloneNode(!0);
|
|
3622
|
+
R.style.setProperty("pointer-events", "none"), m(R, w, B), o.append(R);
|
|
3623
|
+
}
|
|
3624
|
+
}
|
|
3625
|
+
A.container = o, A.clickableElements = Array.from(
|
|
3626
|
+
o.querySelectorAll("[data-activable='1']")
|
|
3627
|
+
), A.clickableElements.length || (A.clickableElements = Array.from(o.children));
|
|
3628
|
+
}
|
|
3629
|
+
renderLayout(A) {
|
|
3630
|
+
this.wnd.cancelAnimationFrame(this.currentRender), this.currentRender = this.wnd.requestAnimationFrame(() => {
|
|
3631
|
+
A = A.filter((t) => {
|
|
3632
|
+
var e;
|
|
3633
|
+
return !this.experimentalHighlights || !!((e = this.notTextFlag) != null && e.has(t.id));
|
|
3634
|
+
}), !(!A || A.length === 0) && this.requireContainer().append(...A.map((t) => t.container).filter((t) => !!t));
|
|
3635
|
+
});
|
|
3636
|
+
}
|
|
3637
|
+
/**
|
|
3638
|
+
* Returns the group container element, after making sure it exists.
|
|
3639
|
+
* @returns Group's container
|
|
3640
|
+
*/
|
|
3641
|
+
requireContainer(A = !1) {
|
|
3642
|
+
if (A) {
|
|
3643
|
+
let t;
|
|
3644
|
+
this.wnd.document.getElementById(`${this.id}-style`) ? t = this.wnd.document.getElementById(`${this.id}-style`) : (t = this.wnd.document.createElement("style"), t.dataset.readium = "true", t.id = `${this.id}-style`, this.wnd.document.head.appendChild(t));
|
|
3645
|
+
let e;
|
|
3646
|
+
return this.wnd.CSS.highlights.has(this.id) ? e = this.wnd.CSS.highlights.get(this.id) : (e = new this.wnd.Highlight(), this.wnd.CSS.highlights.set(this.id, e)), [t, e];
|
|
3647
|
+
}
|
|
3648
|
+
return this.container || (this.container = this.wnd.document.createElement("div"), this.container.setAttribute("id", this.id), this.container.dataset.group = this.name, this.container.dataset.readium = "true", this.container.style.setProperty("pointer-events", "none"), this.container.style.display = "contents", this.wnd.document.body.append(this.container)), this.container;
|
|
3649
|
+
}
|
|
3650
|
+
/**
|
|
3651
|
+
* Removes the group container.
|
|
3652
|
+
*/
|
|
3653
|
+
clearContainer() {
|
|
3654
|
+
this.experimentalHighlights && this.wnd.CSS.highlights.delete(this.id), this.container && (this.container.remove(), this.container = void 0);
|
|
3655
|
+
}
|
|
3656
|
+
}
|
|
3657
|
+
const de = class WA extends zA {
|
|
3658
|
+
constructor() {
|
|
3659
|
+
super(...arguments), this.resizeFrame = 0, this.lastGroupId = 0, this.groups = /* @__PURE__ */ new Map(), this.handleResizer = this.handleResize.bind(this);
|
|
3660
|
+
}
|
|
3661
|
+
cleanup() {
|
|
3662
|
+
this.groups.forEach((A) => A.clear()), this.groups.clear();
|
|
3663
|
+
}
|
|
3664
|
+
handleResize() {
|
|
3665
|
+
this.wnd.clearTimeout(this.resizeFrame), this.resizeFrame = this.wnd.setTimeout(() => {
|
|
3666
|
+
this.groups.forEach((A) => {
|
|
3667
|
+
A.experimentalHighlights || A.requestLayout();
|
|
3668
|
+
});
|
|
3669
|
+
}, 50);
|
|
3670
|
+
}
|
|
3671
|
+
mount(A, t) {
|
|
3672
|
+
return this.wnd = A, t.register("decorate", WA.moduleName, (e, n) => {
|
|
3673
|
+
const r = e;
|
|
3674
|
+
r.decoration && r.decoration.locator && (r.decoration.locator = L.deserialize(r.decoration.locator)), this.groups.has(r.group) || this.groups.set(r.group, new Si(
|
|
3675
|
+
A,
|
|
3676
|
+
t,
|
|
3677
|
+
`readium-decoration-${this.lastGroupId++}`,
|
|
3678
|
+
r.group
|
|
3679
|
+
));
|
|
3680
|
+
const s = this.groups.get(r.group);
|
|
3681
|
+
switch (r.action) {
|
|
3682
|
+
case "add":
|
|
3683
|
+
s == null || s.add(r.decoration);
|
|
3684
|
+
break;
|
|
3685
|
+
case "remove":
|
|
3686
|
+
s == null || s.remove(r.decoration.id);
|
|
3687
|
+
break;
|
|
3688
|
+
case "clear":
|
|
3689
|
+
s == null || s.clear();
|
|
3690
|
+
break;
|
|
3691
|
+
case "update":
|
|
3692
|
+
s == null || s.update(r.decoration);
|
|
3693
|
+
break;
|
|
3694
|
+
}
|
|
3695
|
+
n(!0);
|
|
3696
|
+
}), this.resizeObserver = new xi(() => A.requestAnimationFrame(() => this.handleResize())), this.resizeObserver.observe(A.document.body), A.addEventListener("orientationchange", this.handleResizer), A.addEventListener("resize", this.handleResizer), t.log("Decorator Mounted"), !0;
|
|
3697
|
+
}
|
|
3698
|
+
unmount(A, t) {
|
|
3699
|
+
return A.removeEventListener("orientationchange", this.handleResizer), A.removeEventListener("resize", this.handleResizer), t.unregisterAll(WA.moduleName), this.resizeObserver.disconnect(), this.cleanup(), t.log("Decorator Unmounted"), !0;
|
|
3700
|
+
}
|
|
3701
|
+
};
|
|
3702
|
+
de.moduleName = "decorator";
|
|
3703
|
+
let Vi = de;
|
|
3704
|
+
const Yt = "readium-snapper-style", Me = class LA extends zA {
|
|
3705
|
+
constructor() {
|
|
3706
|
+
super(...arguments), this.protected = !1;
|
|
3707
|
+
}
|
|
3708
|
+
buildStyles() {
|
|
3709
|
+
return `
|
|
3710
|
+
html, body {
|
|
3711
|
+
touch-action: manipulation;
|
|
3712
|
+
user-select: ${this.protected ? "none" : "auto"};
|
|
3713
|
+
}`;
|
|
3714
|
+
}
|
|
3715
|
+
mount(A, t) {
|
|
3716
|
+
const e = A.document.createElement("style");
|
|
3717
|
+
return e.dataset.readium = "true", e.id = Yt, e.textContent = this.buildStyles(), A.document.head.appendChild(e), t.register("protect", LA.moduleName, (n, r) => {
|
|
3718
|
+
this.protected = !0, e.textContent = this.buildStyles(), r(!0);
|
|
3719
|
+
}), t.register("unprotect", LA.moduleName, (n, r) => {
|
|
3720
|
+
this.protected = !1, e.textContent = this.buildStyles(), r(!0);
|
|
3721
|
+
}), t.log("Snapper Mounted"), !0;
|
|
3722
|
+
}
|
|
3723
|
+
unmount(A, t) {
|
|
3724
|
+
var e;
|
|
3725
|
+
return (e = A.document.getElementById(Yt)) == null || e.remove(), t.log("Snapper Unmounted"), !0;
|
|
3726
|
+
}
|
|
3727
|
+
};
|
|
3728
|
+
Me.moduleName = "snapper";
|
|
3729
|
+
let ue = Me;
|
|
3730
|
+
function K(i) {
|
|
3731
|
+
return i.document.body.dir.toLowerCase() === "rtl";
|
|
3732
|
+
}
|
|
3733
|
+
function me(i) {
|
|
3734
|
+
return parseInt(
|
|
3735
|
+
i.getComputedStyle(
|
|
3736
|
+
i.document.documentElement
|
|
3737
|
+
).getPropertyValue("column-count")
|
|
3738
|
+
);
|
|
3739
|
+
}
|
|
3740
|
+
function Di(i) {
|
|
3741
|
+
const A = "readium-virtual-page";
|
|
3742
|
+
let t = i.document.getElementById(A);
|
|
3743
|
+
if (me(i) !== 2)
|
|
3744
|
+
t && t.remove();
|
|
3745
|
+
else {
|
|
3746
|
+
const e = i.document.scrollingElement.scrollWidth / i.innerWidth;
|
|
3747
|
+
Math.round(e * 2) / 2 % 1 > 0.1 && (t ? t.remove() : (t = i.document.createElement("div"), t.setAttribute("id", A), t.dataset.readium = "true", t.style.breakBefore = "column", t.innerHTML = "​", i.document.body.appendChild(t)));
|
|
3748
|
+
}
|
|
3749
|
+
}
|
|
3750
|
+
function Hi(i) {
|
|
3751
|
+
return i < 0.5 ? 2 * i * i : -1 + (4 - 2 * i) * i;
|
|
3752
|
+
}
|
|
3753
|
+
function C(i) {
|
|
3754
|
+
const A = i.getSelection();
|
|
3755
|
+
A && A.removeAllRanges();
|
|
3314
3756
|
}
|
|
3315
|
-
const
|
|
3757
|
+
const Gi = [
|
|
3316
3758
|
"a",
|
|
3317
3759
|
"audio",
|
|
3318
3760
|
"button",
|
|
@@ -3326,34 +3768,34 @@ const Ei = [
|
|
|
3326
3768
|
"textarea",
|
|
3327
3769
|
"video"
|
|
3328
3770
|
];
|
|
3329
|
-
function
|
|
3771
|
+
function Be(i) {
|
|
3330
3772
|
var A;
|
|
3331
|
-
return
|
|
3773
|
+
return Gi.indexOf(i.nodeName.toLowerCase()) !== -1 || i.hasAttribute("contenteditable") && ((A = i.getAttribute("contenteditable")) == null ? void 0 : A.toLowerCase()) !== "false" ? i : i.parentElement ? Be(i.parentElement) : null;
|
|
3332
3774
|
}
|
|
3333
|
-
function
|
|
3334
|
-
const t =
|
|
3335
|
-
return new
|
|
3775
|
+
function Ee(i, A) {
|
|
3776
|
+
const t = Ie(i, i.document.body, A);
|
|
3777
|
+
return new L({
|
|
3336
3778
|
href: "#",
|
|
3337
3779
|
type: "application/xhtml+xml",
|
|
3338
|
-
locations: new
|
|
3780
|
+
locations: new Q({
|
|
3339
3781
|
otherLocations: /* @__PURE__ */ new Map([
|
|
3340
3782
|
["cssSelector", i._readium_cssSelectorGenerator.getCssSelector(t)]
|
|
3341
3783
|
])
|
|
3342
3784
|
}),
|
|
3343
|
-
text: new
|
|
3785
|
+
text: new oA({
|
|
3344
3786
|
highlight: t.textContent || void 0
|
|
3345
3787
|
})
|
|
3346
3788
|
});
|
|
3347
3789
|
}
|
|
3348
|
-
function
|
|
3790
|
+
function Ie(i, A, t) {
|
|
3349
3791
|
for (var e = 0; e < A.children.length; e++) {
|
|
3350
3792
|
const n = A.children[e];
|
|
3351
|
-
if (!
|
|
3352
|
-
return
|
|
3793
|
+
if (!bi(n) && vi(i, n, t))
|
|
3794
|
+
return Ie(i, n, t);
|
|
3353
3795
|
}
|
|
3354
3796
|
return A;
|
|
3355
3797
|
}
|
|
3356
|
-
function
|
|
3798
|
+
function vi(i, A, t) {
|
|
3357
3799
|
if (A === document.body || A === document.documentElement)
|
|
3358
3800
|
return !0;
|
|
3359
3801
|
if (!document || !document.documentElement || !document.body)
|
|
@@ -3361,11 +3803,11 @@ function Ii(i, A, t) {
|
|
|
3361
3803
|
const e = A.getBoundingClientRect();
|
|
3362
3804
|
return t ? e.bottom > 0 && e.top < i.innerHeight : e.right > 0 && e.left < i.innerWidth;
|
|
3363
3805
|
}
|
|
3364
|
-
function
|
|
3806
|
+
function bi(i) {
|
|
3365
3807
|
const A = getComputedStyle(i);
|
|
3366
3808
|
return !!(A && (A.getPropertyValue("display") != "block" || A.getPropertyValue("opacity") === "0"));
|
|
3367
3809
|
}
|
|
3368
|
-
const
|
|
3810
|
+
const Ct = "readium-column-snapper-style", Ji = 200, fe = class N extends ue {
|
|
3369
3811
|
constructor() {
|
|
3370
3812
|
super(...arguments), 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);
|
|
3371
3813
|
}
|
|
@@ -3376,7 +3818,7 @@ const yt = "readium-column-snapper-style", pi = 200, de = class N extends ie {
|
|
|
3376
3818
|
return this.doc().scrollLeft > 0 ? this.doc().scrollLeft : this.alreadyScrollLeft;
|
|
3377
3819
|
}
|
|
3378
3820
|
snapOffset(A) {
|
|
3379
|
-
const t = A + (
|
|
3821
|
+
const t = A + (K(this.wnd) ? -1 : 1);
|
|
3380
3822
|
return t - t % this.wnd.innerWidth;
|
|
3381
3823
|
}
|
|
3382
3824
|
reportProgress() {
|
|
@@ -3386,7 +3828,7 @@ const yt = "readium-column-snapper-style", pi = 200, de = class N extends ie {
|
|
|
3386
3828
|
if (this.overscroll !== 0 || this.shakeTimeout !== 0)
|
|
3387
3829
|
return;
|
|
3388
3830
|
const A = this.doc();
|
|
3389
|
-
A.classList.add(
|
|
3831
|
+
A.classList.add(K(this.wnd) ? "readium-bounce-l" : "readium-bounce-r");
|
|
3390
3832
|
const t = this.scrollOffset();
|
|
3391
3833
|
this.shakeTimeout = this.wnd.setTimeout(() => {
|
|
3392
3834
|
A.classList.remove("readium-bounce-l"), A.classList.remove("readium-bounce-r"), this.shakeTimeout = 0, this.doc().scrollLeft = t;
|
|
@@ -3401,15 +3843,15 @@ const yt = "readium-column-snapper-style", pi = 200, de = class N extends ie {
|
|
|
3401
3843
|
}
|
|
3402
3844
|
// Snaps the current offset to the page width.
|
|
3403
3845
|
snapCurrentOffset(A = !1, t = !1) {
|
|
3404
|
-
const e = this.wnd.scrollX > 0 ? this.wnd.scrollX : this.alreadyScrollLeft, n = this.doc(), r = this.dragOffset(), s =
|
|
3846
|
+
const e = this.wnd.scrollX > 0 ? this.wnd.scrollX : this.alreadyScrollLeft, n = this.doc(), r = this.dragOffset(), s = me(this.wnd), o = Math.min(Math.max(0, e), this.cachedScrollWidth), a = K(this.wnd) ? -1 : 1, h = (
|
|
3405
3847
|
// The hurdle to overcome in order to change pages
|
|
3406
3848
|
a * (this.wnd.innerWidth / 3) * (a * r > 0 ? 2 : 1)
|
|
3407
3849
|
), c = this.snapOffset(o + h);
|
|
3408
3850
|
if (A && c !== this.scrollOffset()) {
|
|
3409
3851
|
this.snappingCancelled = !1;
|
|
3410
|
-
const l = (B, I, E, p) => E > p ? I : B + (I - B) *
|
|
3852
|
+
const l = (B, I, E, p) => E > p ? I : B + (I - B) * Hi(E / p), g = (
|
|
3411
3853
|
/*Math.abs(startX - (this.useTransform ? currentOffset : 0)) < 10 ? 1 : */
|
|
3412
|
-
|
|
3854
|
+
Ji * s
|
|
3413
3855
|
);
|
|
3414
3856
|
let u;
|
|
3415
3857
|
const m = (B) => {
|
|
@@ -3467,7 +3909,7 @@ const yt = "readium-column-snapper-style", pi = 200, de = class N extends ie {
|
|
|
3467
3909
|
return !1;
|
|
3468
3910
|
A.navigator.epubReadingSystem.layoutStyle = "paginated";
|
|
3469
3911
|
const e = A.document.createElement("style");
|
|
3470
|
-
e.dataset.readium = "true", e.id =
|
|
3912
|
+
e.dataset.readium = "true", e.id = Ct, e.textContent = `
|
|
3471
3913
|
@keyframes readium-bounce-l-animation {
|
|
3472
3914
|
0%, 100% {transform: translate3d(0, 0, 0);}
|
|
3473
3915
|
50% {transform: translate3d(-50px, 0, 0);}
|
|
@@ -3502,9 +3944,9 @@ const yt = "readium-column-snapper-style", pi = 200, de = class N extends ie {
|
|
|
3502
3944
|
display: none; /* for Chrome, Safari, and Opera */
|
|
3503
3945
|
}
|
|
3504
3946
|
`, A.document.head.appendChild(e);
|
|
3505
|
-
const n = A.ResizeObserver ||
|
|
3947
|
+
const n = A.ResizeObserver || le;
|
|
3506
3948
|
this.resizeObserver = new n(() => A.requestAnimationFrame(() => {
|
|
3507
|
-
A &&
|
|
3949
|
+
A && Di(A);
|
|
3508
3950
|
})), this.resizeObserver.observe(A.document.body), this.mutationObserver = new MutationObserver(() => {
|
|
3509
3951
|
this.wnd.requestAnimationFrame(() => this.cachedScrollWidth = this.doc().scrollWidth);
|
|
3510
3952
|
}), A.frameElement && this.mutationObserver.observe(A.frameElement, { attributes: !0, attributeFilter: ["style"] }), this.mutationObserver.observe(A.document, { attributes: !0, attributeFilter: ["style"] });
|
|
@@ -3522,7 +3964,7 @@ const yt = "readium-column-snapper-style", pi = 200, de = class N extends ie {
|
|
|
3522
3964
|
}
|
|
3523
3965
|
this.wnd.requestAnimationFrame(() => {
|
|
3524
3966
|
this.cachedScrollWidth = this.doc().scrollWidth;
|
|
3525
|
-
const h = this.cachedScrollWidth, c =
|
|
3967
|
+
const h = this.cachedScrollWidth, c = K(A) ? -1 : 1, l = h * a * c;
|
|
3526
3968
|
this.doc().scrollLeft = this.snapOffset(l), this.reportProgress(), C(this.wnd), o(!0);
|
|
3527
3969
|
});
|
|
3528
3970
|
}), t.register("go_id", N.moduleName, (s, o) => {
|
|
@@ -3537,11 +3979,11 @@ const yt = "readium-column-snapper-style", pi = 200, de = class N extends ie {
|
|
|
3537
3979
|
}), t.register("go_text", N.moduleName, (s, o) => {
|
|
3538
3980
|
let a;
|
|
3539
3981
|
Array.isArray(s) && (s.length > 1 && (a = s[1]), s = s[0]);
|
|
3540
|
-
const h =
|
|
3982
|
+
const h = oA.deserialize(s), c = it(this.wnd.document, new L({
|
|
3541
3983
|
href: A.location.href,
|
|
3542
3984
|
type: "text/html",
|
|
3543
3985
|
text: h,
|
|
3544
|
-
locations: a ? new
|
|
3986
|
+
locations: a ? new Q({
|
|
3545
3987
|
otherLocations: /* @__PURE__ */ new Map([
|
|
3546
3988
|
["cssSelector", a]
|
|
3547
3989
|
])
|
|
@@ -3555,7 +3997,7 @@ const yt = "readium-column-snapper-style", pi = 200, de = class N extends ie {
|
|
|
3555
3997
|
this.doc().scrollLeft = this.snapOffset(c.getBoundingClientRect().left + A.scrollX), this.reportProgress(), C(this.wnd), o(!0);
|
|
3556
3998
|
});
|
|
3557
3999
|
}), t.register("go_end", N.moduleName, (s, o) => {
|
|
3558
|
-
const a =
|
|
4000
|
+
const a = K(A) ? -1 : 1;
|
|
3559
4001
|
this.wnd.requestAnimationFrame(() => {
|
|
3560
4002
|
this.cachedScrollWidth = this.doc().scrollWidth;
|
|
3561
4003
|
const h = this.cachedScrollWidth * a;
|
|
@@ -3571,12 +4013,12 @@ const yt = "readium-column-snapper-style", pi = 200, de = class N extends ie {
|
|
|
3571
4013
|
});
|
|
3572
4014
|
}), t.register("go_prev", N.moduleName, (s, o) => {
|
|
3573
4015
|
this.wnd.requestAnimationFrame(() => {
|
|
3574
|
-
const a = A.scrollX - A.innerWidth, h =
|
|
4016
|
+
const a = A.scrollX - A.innerWidth, h = K(A) ? -(this.cachedScrollWidth - A.innerWidth) : 0, c = r(Math.max(a, h));
|
|
3575
4017
|
c && (this.reportProgress(), C(this.wnd)), o(c);
|
|
3576
4018
|
});
|
|
3577
4019
|
}), t.register("go_next", N.moduleName, (s, o) => {
|
|
3578
4020
|
this.wnd.requestAnimationFrame(() => {
|
|
3579
|
-
const a = A.scrollX + A.innerWidth, h =
|
|
4021
|
+
const a = A.scrollX + A.innerWidth, h = K(A) ? 0 : this.cachedScrollWidth - A.innerWidth, c = r(Math.min(a, h));
|
|
3580
4022
|
c && (this.reportProgress(), C(this.wnd)), o(c);
|
|
3581
4023
|
});
|
|
3582
4024
|
}), t.register("unfocus", N.moduleName, (s, o) => {
|
|
@@ -3588,44 +4030,44 @@ const yt = "readium-column-snapper-style", pi = 200, de = class N extends ie {
|
|
|
3588
4030
|
this.cachedScrollWidth = this.doc().scrollWidth, this.snapCurrentOffset(!1, !0), this.reportProgress(), o(!0);
|
|
3589
4031
|
});
|
|
3590
4032
|
}), t.register("first_visible_locator", N.moduleName, (s, o) => {
|
|
3591
|
-
const a =
|
|
4033
|
+
const a = Ee(A, !1);
|
|
3592
4034
|
this.comms.send("first_visible_locator", a.serialize()), o(!0);
|
|
3593
4035
|
}), A.addEventListener("touchstart", this.onTouchStarter, { passive: !0 }), A.addEventListener("touchend", this.onTouchEnder, { passive: !0 }), A.addEventListener("touchmove", this.onTouchMover, { passive: !0 }), A.document.addEventListener("touchstart", () => {
|
|
3594
4036
|
}), t.log("ColumnSnapper Mounted"), !0;
|
|
3595
4037
|
}
|
|
3596
4038
|
unmount(A, t) {
|
|
3597
4039
|
var e;
|
|
3598
|
-
return this.snappingCancelled = !0, t.unregisterAll(N.moduleName), this.resizeObserver.disconnect(), this.mutationObserver.disconnect(), A.removeEventListener("touchstart", this.onTouchStarter), A.removeEventListener("touchend", this.onTouchEnder), A.removeEventListener("touchmove", this.onTouchMover), A.removeEventListener("orientationchange", this.onWidthChanger), A.removeEventListener("resize", this.onWidthChanger), (e = A.document.getElementById(
|
|
4040
|
+
return this.snappingCancelled = !0, t.unregisterAll(N.moduleName), this.resizeObserver.disconnect(), this.mutationObserver.disconnect(), A.removeEventListener("touchstart", this.onTouchStarter), A.removeEventListener("touchend", this.onTouchEnder), A.removeEventListener("touchmove", this.onTouchMover), A.removeEventListener("orientationchange", this.onWidthChanger), A.removeEventListener("resize", this.onWidthChanger), (e = A.document.getElementById(Ct)) == null || e.remove(), t.log("ColumnSnapper Unmounted"), super.unmount(A, t);
|
|
3599
4041
|
}
|
|
3600
4042
|
};
|
|
3601
|
-
|
|
3602
|
-
let
|
|
3603
|
-
const
|
|
4043
|
+
fe.moduleName = "column_snapper";
|
|
4044
|
+
let Pi = fe;
|
|
4045
|
+
const YA = {
|
|
3604
4046
|
top: "js-iframe-reader-top-anchor",
|
|
3605
4047
|
bottom: "js-iframe-reader-bottom-anchor"
|
|
3606
4048
|
};
|
|
3607
|
-
class
|
|
4049
|
+
class ki extends HTMLElement {
|
|
3608
4050
|
connectedCallback() {
|
|
3609
4051
|
this.setAttribute("aria-hidden", "true"), this.style.setProperty("display", "block", "important"), this.style.setProperty("padding", "0", "important"), this.style.setProperty("margin", "0", "important"), this.style.setProperty("visibility", "hidden", "important");
|
|
3610
4052
|
}
|
|
3611
4053
|
}
|
|
3612
|
-
function
|
|
4054
|
+
function Wi(i) {
|
|
3613
4055
|
const A = i.getElementsByTagName("body")[0], t = document.createElement("anchor-observer"), e = document.createElement("anchor-observer");
|
|
3614
|
-
t.dataset.readium = "true", e.dataset.readium = "true", t == null || t.setAttribute("id",
|
|
4056
|
+
t.dataset.readium = "true", e.dataset.readium = "true", t == null || t.setAttribute("id", YA.top), t == null || t.style.setProperty("height", "115px", "important"), e == null || e.setAttribute("id", YA.bottom), e == null || e.style.setProperty("height", "80px", "important"), A == null || A.insertBefore(t, A.firstChild), A == null || A.appendChild(e);
|
|
3615
4057
|
}
|
|
3616
|
-
function
|
|
4058
|
+
function Li(i) {
|
|
3617
4059
|
var A, t;
|
|
3618
|
-
const e = i.getElementsByTagName("body")[0], n = e == null ? void 0 : e.querySelector(`#${
|
|
4060
|
+
const e = i.getElementsByTagName("body")[0], n = e == null ? void 0 : e.querySelector(`#${YA.top}`), r = e == null ? void 0 : e.querySelector(`#${YA.bottom}`);
|
|
3619
4061
|
n && ((A = n.parentElement) == null || A.removeChild(n)), r && ((t = r.parentElement) == null || t.removeChild(r));
|
|
3620
4062
|
}
|
|
3621
|
-
const
|
|
4063
|
+
const zt = "readium-scroll-snapper-style", pe = class V extends ue {
|
|
3622
4064
|
constructor() {
|
|
3623
4065
|
super(...arguments), this.createAnchorElements = () => {
|
|
3624
|
-
|
|
4066
|
+
Wi(this.doc());
|
|
3625
4067
|
}, this.removeAnchorElements = () => {
|
|
3626
|
-
|
|
4068
|
+
Li(this.doc());
|
|
3627
4069
|
}, this.createCustomElement = () => {
|
|
3628
|
-
customElements.get("anchor-observer") || customElements.define("anchor-observer",
|
|
4070
|
+
customElements.get("anchor-observer") || customElements.define("anchor-observer", ki);
|
|
3629
4071
|
};
|
|
3630
4072
|
}
|
|
3631
4073
|
doc() {
|
|
@@ -3637,7 +4079,7 @@ const Rt = "readium-scroll-snapper-style", Me = class S extends ie {
|
|
|
3637
4079
|
mount(A, t) {
|
|
3638
4080
|
this.wnd = A, this.comms = t, A.navigator.epubReadingSystem.layoutStyle = "scrolling";
|
|
3639
4081
|
const e = A.document.createElement("style");
|
|
3640
|
-
return e.dataset.readium = "true", e.id =
|
|
4082
|
+
return e.dataset.readium = "true", e.id = zt, e.textContent = `
|
|
3641
4083
|
* {
|
|
3642
4084
|
scrollbar-width: none; /* for Firefox */
|
|
3643
4085
|
}
|
|
@@ -3645,7 +4087,7 @@ const Rt = "readium-scroll-snapper-style", Me = class S extends ie {
|
|
|
3645
4087
|
body::-webkit-scrollbar {
|
|
3646
4088
|
display: none; /* for Chrome, Safari, and Opera */
|
|
3647
4089
|
}
|
|
3648
|
-
`, A.document.head.appendChild(e), t.register("go_progression",
|
|
4090
|
+
`, A.document.head.appendChild(e), t.register("go_progression", V.moduleName, (n, r) => {
|
|
3649
4091
|
const s = n;
|
|
3650
4092
|
if (s < 0 || s > 1) {
|
|
3651
4093
|
t.send("error", {
|
|
@@ -3656,7 +4098,7 @@ const Rt = "readium-scroll-snapper-style", Me = class S extends ie {
|
|
|
3656
4098
|
this.wnd.requestAnimationFrame(() => {
|
|
3657
4099
|
this.doc().scrollTop = this.doc().offsetHeight * s, this.reportProgress({ progress: s, reference: this.wnd.innerHeight / this.doc().scrollHeight }), C(this.wnd), r(!0);
|
|
3658
4100
|
});
|
|
3659
|
-
}), t.register("go_id",
|
|
4101
|
+
}), t.register("go_id", V.moduleName, (n, r) => {
|
|
3660
4102
|
const s = A.document.getElementById(n);
|
|
3661
4103
|
if (!s) {
|
|
3662
4104
|
r(!1);
|
|
@@ -3667,14 +4109,14 @@ const Rt = "readium-scroll-snapper-style", Me = class S extends ie {
|
|
|
3667
4109
|
const o = this.doc().scrollTop / this.doc().offsetHeight;
|
|
3668
4110
|
this.reportProgress({ progress: o, reference: this.wnd.innerHeight / this.doc().scrollHeight }), C(this.wnd), r(!0);
|
|
3669
4111
|
});
|
|
3670
|
-
}), t.register("go_text",
|
|
4112
|
+
}), t.register("go_text", V.moduleName, (n, r) => {
|
|
3671
4113
|
let s;
|
|
3672
4114
|
Array.isArray(n) && (n.length > 1 && (s = n[1]), n = n[0]);
|
|
3673
|
-
const o =
|
|
4115
|
+
const o = oA.deserialize(n), a = it(this.wnd.document, new L({
|
|
3674
4116
|
href: A.location.href,
|
|
3675
4117
|
type: "text/html",
|
|
3676
4118
|
text: o,
|
|
3677
|
-
locations: s ? new
|
|
4119
|
+
locations: s ? new Q({
|
|
3678
4120
|
otherLocations: /* @__PURE__ */ new Map([
|
|
3679
4121
|
["cssSelector", s]
|
|
3680
4122
|
])
|
|
@@ -3689,704 +4131,309 @@ const Rt = "readium-scroll-snapper-style", Me = class S extends ie {
|
|
|
3689
4131
|
const h = this.doc().scrollTop / this.doc().offsetHeight;
|
|
3690
4132
|
this.reportProgress({ progress: h, reference: this.wnd.innerHeight / this.doc().scrollHeight }), C(this.wnd), r(!0);
|
|
3691
4133
|
});
|
|
3692
|
-
}), t.register("go_start",
|
|
3693
|
-
if (this.doc().scrollTop === 0)
|
|
3694
|
-
return r(!1);
|
|
3695
|
-
this.doc().scrollTop = 0, this.reportProgress({ progress: 0, reference: this.wnd.innerHeight / this.doc().scrollHeight }), r(!0);
|
|
3696
|
-
}), t.register("go_end", S.moduleName, (n, r) => {
|
|
4134
|
+
}), t.register("go_start", V.moduleName, (n, r) => {
|
|
3697
4135
|
if (this.doc().scrollTop === 0)
|
|
3698
4136
|
return r(!1);
|
|
3699
|
-
this.doc().scrollTop = 0, this.reportProgress({ progress: 0, reference: this.wnd.innerHeight / this.doc().scrollHeight }), r(!0);
|
|
3700
|
-
}), t.register("
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
}
|
|
3717
|
-
};
|
|
3718
|
-
Me.moduleName = "scroll_snapper";
|
|
3719
|
-
let yi = Me;
|
|
3720
|
-
class ue extends CA {
|
|
3721
|
-
constructor() {
|
|
3722
|
-
super(...arguments), this.pointerMoved = !1, this.onPointerUp = this.onPointUp.bind(this), this.onPointerMove = this.onPointMove.bind(this), this.onPointerDown = this.onPointDown.bind(this), this.onContextMenu = this.onContext.bind(this), this.onClicker = this.onClick.bind(this);
|
|
3723
|
-
}
|
|
3724
|
-
onPointUp(A) {
|
|
3725
|
-
var t, e, n, r, s;
|
|
3726
|
-
const o = this.wnd.getSelection();
|
|
3727
|
-
if (o && ((t = o.toString()) == null ? void 0 : t.length) > 0) {
|
|
3728
|
-
const h = (e = o.getRangeAt(0)) == null ? void 0 : e.getClientRects();
|
|
3729
|
-
if (!h || h.length === 0)
|
|
3730
|
-
return;
|
|
3731
|
-
const c = h[0], l = {
|
|
3732
|
-
text: o.toString(),
|
|
3733
|
-
x: c.x,
|
|
3734
|
-
y: c.y,
|
|
3735
|
-
width: c.width,
|
|
3736
|
-
height: c.height,
|
|
3737
|
-
targetFrameSrc: (r = (n = this.wnd) == null ? void 0 : n.location) == null ? void 0 : r.href
|
|
3738
|
-
};
|
|
3739
|
-
this.comms.send("text_selected", l);
|
|
3740
|
-
}
|
|
3741
|
-
if (this.pointerMoved) {
|
|
3742
|
-
this.pointerMoved = !1;
|
|
3743
|
-
return;
|
|
3744
|
-
}
|
|
3745
|
-
if (!(o != null && o.isCollapsed) || !A.isPrimary)
|
|
3746
|
-
return;
|
|
3747
|
-
const a = this.wnd.devicePixelRatio;
|
|
3748
|
-
A.preventDefault(), this.comms.send(A.pointerType === "touch" ? "tap" : "click", {
|
|
3749
|
-
defaultPrevented: A.defaultPrevented,
|
|
3750
|
-
x: A.clientX * a,
|
|
3751
|
-
y: A.clientY * a,
|
|
3752
|
-
targetFrameSrc: this.wnd.location.href,
|
|
3753
|
-
targetElement: A.target.outerHTML,
|
|
3754
|
-
interactiveElement: (s = ce(A.target)) == null ? void 0 : s.outerHTML,
|
|
3755
|
-
cssSelector: this.wnd._readium_cssSelectorGenerator.getCssSelector(A.target)
|
|
3756
|
-
}), this.pointerMoved = !1;
|
|
3757
|
-
}
|
|
3758
|
-
onPointMove(A) {
|
|
3759
|
-
if (A.movementY !== void 0 && A.movementX !== void 0) {
|
|
3760
|
-
(Math.abs(A.movementX) > 1 || Math.abs(A.movementY) > 1) && (this.pointerMoved = !0);
|
|
3761
|
-
return;
|
|
3762
|
-
}
|
|
3763
|
-
this.pointerMoved = !0;
|
|
3764
|
-
}
|
|
3765
|
-
onPointDown() {
|
|
3766
|
-
this.pointerMoved = !1;
|
|
3767
|
-
}
|
|
3768
|
-
onContext(A) {
|
|
3769
|
-
this.onPointUp(A), this.pointerMoved = !1;
|
|
3770
|
-
}
|
|
3771
|
-
onClick(A) {
|
|
3772
|
-
if (A.preventDefault(), !A.isTrusted) {
|
|
3773
|
-
const t = new PointerEvent("pointerup", {
|
|
3774
|
-
isPrimary: !0,
|
|
3775
|
-
pointerType: "mouse",
|
|
3776
|
-
// Not really a better choice than this
|
|
3777
|
-
clientX: A.clientX,
|
|
3778
|
-
clientY: A.clientY
|
|
3779
|
-
});
|
|
3780
|
-
Object.defineProperty(t, "target", { writable: !1, value: A.target }), Object.defineProperty(t, "defaultPrevented", { writable: !1, value: A.defaultPrevented }), this.onPointUp(t);
|
|
3781
|
-
}
|
|
3782
|
-
}
|
|
3783
|
-
mount(A, t) {
|
|
3784
|
-
return this.wnd = A, this.comms = t, A.document.addEventListener("pointerdown", this.onPointerDown), A.document.addEventListener("pointerup", this.onPointerUp), A.document.addEventListener("contextmenu", this.onContextMenu), A.document.addEventListener("pointermove", this.onPointerMove), A.document.addEventListener("click", this.onClicker), t.log("Peripherals Mounted"), !0;
|
|
3785
|
-
}
|
|
3786
|
-
unmount(A, t) {
|
|
3787
|
-
return A.document.removeEventListener("pointerdown", this.onPointerDown), A.document.removeEventListener("pointerup", this.onPointerUp), A.document.removeEventListener("contextmenu", this.onContextMenu), A.document.removeEventListener("pointermove", this.onPointerMove), A.document.removeEventListener("click", this.onClicker), t.log("Peripherals Unmounted"), !0;
|
|
3788
|
-
}
|
|
3789
|
-
}
|
|
3790
|
-
ue.moduleName = "peripherals";
|
|
3791
|
-
const me = class JA extends CA {
|
|
3792
|
-
constructor() {
|
|
3793
|
-
super(...arguments), this.mediaPlayingCount = 0, this.allAnimations = /* @__PURE__ */ new Set();
|
|
3794
|
-
}
|
|
3795
|
-
wndOnErr(A) {
|
|
3796
|
-
var t;
|
|
3797
|
-
(t = this.comms) == null || t.send("error", {
|
|
3798
|
-
message: A.message,
|
|
3799
|
-
filename: A.filename,
|
|
3800
|
-
lineno: A.lineno,
|
|
3801
|
-
colno: A.colno
|
|
3802
|
-
});
|
|
3803
|
-
}
|
|
3804
|
-
unblock(A) {
|
|
3805
|
-
var t;
|
|
3806
|
-
for (A._readium_blockEvents = !1; ((t = A._readium_blockedEvents) == null ? void 0 : t.length) > 0; ) {
|
|
3807
|
-
const e = A._readium_blockedEvents.shift();
|
|
3808
|
-
switch (e[0]) {
|
|
3809
|
-
case 0:
|
|
3810
|
-
Reflect.apply(e[1], e[2], e[3]);
|
|
3811
|
-
break;
|
|
3812
|
-
case 1:
|
|
3813
|
-
const n = e[1], r = e[2];
|
|
3814
|
-
A.removeEventListener(n.type, A._readium_eventBlocker, !0);
|
|
3815
|
-
const s = new Event(n.type, {
|
|
3816
|
-
bubbles: n.bubbles,
|
|
3817
|
-
cancelable: n.cancelable
|
|
3818
|
-
});
|
|
3819
|
-
r ? r.dispatchEvent(s) : A.dispatchEvent(s);
|
|
3820
|
-
break;
|
|
3821
|
-
}
|
|
3822
|
-
}
|
|
3823
|
-
}
|
|
3824
|
-
onMediaPlayEvent() {
|
|
3825
|
-
var A;
|
|
3826
|
-
this.mediaPlayingCount++, (A = this.comms) == null || A.send("media_play", this.mediaPlayingCount);
|
|
3827
|
-
}
|
|
3828
|
-
onMediaPauseEvent() {
|
|
3829
|
-
var A;
|
|
3830
|
-
this.mediaPlayingCount > 0 && this.mediaPlayingCount--, (A = this.comms) == null || A.send("media_pause", this.mediaPlayingCount);
|
|
3831
|
-
}
|
|
3832
|
-
pauseAllMedia(A) {
|
|
3833
|
-
const t = A.document.querySelectorAll("audio,video");
|
|
3834
|
-
for (let e = 0; e < t.length; e++)
|
|
3835
|
-
t[e].pause();
|
|
3836
|
-
}
|
|
3837
|
-
mount(A, t) {
|
|
3838
|
-
this.comms = t, A.addEventListener(
|
|
3839
|
-
"error",
|
|
3840
|
-
this.wndOnErr,
|
|
3841
|
-
!1
|
|
3842
|
-
), Reflect.defineProperty(A.navigator, "epubReadingSystem", {
|
|
3843
|
-
value: {
|
|
3844
|
-
name: "readium-ts-toolkit",
|
|
3845
|
-
version: "1.3.1",
|
|
3846
|
-
hasFeature: (n, r = "") => {
|
|
3847
|
-
switch (n) {
|
|
3848
|
-
case "dom-manipulation":
|
|
3849
|
-
return !0;
|
|
3850
|
-
case "layout-changes":
|
|
3851
|
-
return !0;
|
|
3852
|
-
case "touch-events":
|
|
3853
|
-
return !0;
|
|
3854
|
-
case "mouse-events":
|
|
3855
|
-
return !0;
|
|
3856
|
-
case "keyboard-events":
|
|
3857
|
-
return !0;
|
|
3858
|
-
case "spine-scripting":
|
|
3859
|
-
return !0;
|
|
3860
|
-
case "embedded-web-content":
|
|
3861
|
-
return !0;
|
|
3862
|
-
default:
|
|
3863
|
-
return !1;
|
|
3864
|
-
}
|
|
3865
|
-
}
|
|
3866
|
-
},
|
|
3867
|
-
writable: !1
|
|
3868
|
-
}), "getAnimations" in A.document && A.document.getAnimations().forEach((n) => {
|
|
3869
|
-
n.cancel(), this.allAnimations.add(n);
|
|
3870
|
-
}), t.register("activate", JA.moduleName, (n, r) => {
|
|
3871
|
-
this.allAnimations.forEach((s) => {
|
|
3872
|
-
s.cancel(), s.play();
|
|
3873
|
-
}), r(!0);
|
|
3874
|
-
}), t.register("unfocus", JA.moduleName, (n, r) => {
|
|
3875
|
-
this.pauseAllMedia(A), this.allAnimations.forEach((s) => s.pause()), r(!0);
|
|
3876
|
-
});
|
|
3877
|
-
const e = A.document.querySelectorAll("audio,video");
|
|
3878
|
-
for (let n = 0; n < e.length; n++) {
|
|
3879
|
-
const r = e[n];
|
|
3880
|
-
r.addEventListener("play", this.onMediaPlayEvent, {
|
|
3881
|
-
passive: !0
|
|
3882
|
-
}), r.addEventListener("pause", this.onMediaPauseEvent, {
|
|
3883
|
-
passive: !0
|
|
3884
|
-
});
|
|
3885
|
-
}
|
|
3886
|
-
return t.log("Setup Mounted"), !0;
|
|
3887
|
-
}
|
|
3888
|
-
unmount(A, t) {
|
|
3889
|
-
return A.removeEventListener("error", this.wndOnErr), A.removeEventListener("play", this.onMediaPlayEvent), A.removeEventListener("pause", this.onMediaPauseEvent), this.allAnimations.forEach((e) => e.cancel()), this.allAnimations.clear(), t.log("Setup Unmounted"), !0;
|
|
3890
|
-
}
|
|
3891
|
-
};
|
|
3892
|
-
me.moduleName = "setup";
|
|
3893
|
-
let Be = me;
|
|
3894
|
-
function Ri(i, A) {
|
|
3895
|
-
return i.document.documentElement.style.getPropertyValue(A);
|
|
3896
|
-
}
|
|
3897
|
-
function PA(i, A, t) {
|
|
3898
|
-
i.document.documentElement.style.setProperty(A, t);
|
|
3899
|
-
}
|
|
3900
|
-
function Ee(i, A) {
|
|
3901
|
-
i.document.documentElement.style.removeProperty(A);
|
|
3902
|
-
}
|
|
3903
|
-
const Yt = "readium-viewport", Ie = class sA extends Be {
|
|
3904
|
-
onViewportWidthChanged(A) {
|
|
3905
|
-
const t = A.target;
|
|
3906
|
-
PA(t, "--RS__viewportWidth", `${t.innerWidth}px`);
|
|
3907
|
-
}
|
|
3908
|
-
mount(A, t) {
|
|
3909
|
-
if (!super.mount(A, t))
|
|
3910
|
-
return !1;
|
|
3911
|
-
const e = A.document.createElement("meta");
|
|
3912
|
-
return e.dataset.readium = "true", e.setAttribute("name", "viewport"), e.setAttribute("id", Yt), e.setAttribute(
|
|
3913
|
-
"content",
|
|
3914
|
-
"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no"
|
|
3915
|
-
), A.document.head.appendChild(e), A.addEventListener("orientationchange", this.onViewportWidthChanged), A.addEventListener("resize", this.onViewportWidthChanged), this.onViewportWidthChanged({
|
|
3916
|
-
target: A
|
|
3917
|
-
}), t.register("set_property", sA.moduleName, (n, r) => {
|
|
3918
|
-
const s = n;
|
|
3919
|
-
PA(A, s[0], s[1]), r(!0);
|
|
3920
|
-
}), t.register("remove_property", sA.moduleName, (n, r) => {
|
|
3921
|
-
Ee(A, n), r(!0);
|
|
3922
|
-
}), t.register("activate", sA.moduleName, (n, r) => {
|
|
3923
|
-
this.unblock(A), r(!0);
|
|
3924
|
-
}), t.log("ReflowableSetup Mounted"), !0;
|
|
3925
|
-
}
|
|
3926
|
-
unmount(A, t) {
|
|
3927
|
-
var e;
|
|
3928
|
-
return t.unregisterAll(sA.moduleName), (e = A.document.head.querySelector(`#${Yt}`)) == null || e.remove(), A.removeEventListener("orientationchange", this.onViewportWidthChanged), t.log("ReflowableSetup Unmounted"), super.unmount(A, t);
|
|
3929
|
-
}
|
|
3930
|
-
};
|
|
3931
|
-
Ie.moduleName = "reflowable_setup";
|
|
3932
|
-
let Yi = Ie;
|
|
3933
|
-
const Ct = "readium-fixed-style", fe = class v extends Be {
|
|
3934
|
-
mount(A, t) {
|
|
3935
|
-
if (!super.mount(A, t))
|
|
3936
|
-
return !1;
|
|
3937
|
-
A.navigator.epubReadingSystem.layoutStyle = "paginated";
|
|
3938
|
-
const e = A.document.createElement("style");
|
|
3939
|
-
return e.id = Ct, e.dataset.readium = "true", e.textContent = `
|
|
3940
|
-
html, body {
|
|
3941
|
-
text-size-adjust: none;
|
|
3942
|
-
-ms-text-size-adjust: none;
|
|
3943
|
-
-webkit-text-size-adjust: none;
|
|
3944
|
-
-moz-text-size-adjust: none;
|
|
3945
|
-
|
|
3946
|
-
/* Fight Safari pinches */
|
|
3947
|
-
touch-action: none !important;
|
|
3948
|
-
min-height: 100%;
|
|
3949
|
-
|
|
3950
|
-
/*cursor: var() TODO*/
|
|
3951
|
-
}`, A.document.head.appendChild(e), t.register("set_property", v.moduleName, (n, r) => {
|
|
3952
|
-
const s = n;
|
|
3953
|
-
PA(A, s[0], s[1]), r(!0);
|
|
3954
|
-
}), t.register("remove_property", v.moduleName, (n, r) => {
|
|
3955
|
-
Ee(A, n), r(!0);
|
|
3956
|
-
}), t.register("first_visible_locator", v.moduleName, (n, r) => r(!1)), t.register("unfocus", v.moduleName, (n, r) => {
|
|
3957
|
-
C(A), r(!0);
|
|
3958
|
-
}), t.register([
|
|
3959
|
-
"focus",
|
|
3960
|
-
"go_next",
|
|
3961
|
-
"go_prev",
|
|
3962
|
-
"go_id",
|
|
3963
|
-
"go_end",
|
|
3964
|
-
"go_start",
|
|
3965
|
-
"go_text",
|
|
3966
|
-
"go_progression"
|
|
3967
|
-
], v.moduleName, (n, r) => r(!0)), t.register("activate", v.moduleName, (n, r) => {
|
|
3968
|
-
this.unblock(A), r(!0);
|
|
3969
|
-
}), t.log("FixedSetup Mounted"), !0;
|
|
4137
|
+
this.doc().scrollTop = 0, this.reportProgress({ progress: 0, reference: this.wnd.innerHeight / this.doc().scrollHeight }), r(!0);
|
|
4138
|
+
}), t.register("go_end", V.moduleName, (n, r) => {
|
|
4139
|
+
if (this.doc().scrollTop === 0)
|
|
4140
|
+
return r(!1);
|
|
4141
|
+
this.doc().scrollTop = 0, this.reportProgress({ progress: 0, reference: this.wnd.innerHeight / this.doc().scrollHeight }), r(!0);
|
|
4142
|
+
}), t.register("unfocus", V.moduleName, (n, r) => {
|
|
4143
|
+
C(this.wnd), r(!0);
|
|
4144
|
+
}), t.register([
|
|
4145
|
+
"go_next",
|
|
4146
|
+
"go_prev"
|
|
4147
|
+
], V.moduleName, (n, r) => r(!1)), t.register("focus", V.moduleName, (n, r) => {
|
|
4148
|
+
const s = this.doc().scrollTop / this.doc().offsetHeight;
|
|
4149
|
+
this.reportProgress({ progress: s, reference: this.wnd.innerHeight / this.doc().scrollHeight }), r(!0);
|
|
4150
|
+
}), t.register("first_visible_locator", V.moduleName, (n, r) => {
|
|
4151
|
+
const s = Ee(A, !0);
|
|
4152
|
+
this.comms.send("first_visible_locator", s.serialize()), r(!0);
|
|
4153
|
+
}), t.log("ScrollSnapper Mounted"), this.createCustomElement(), this.createAnchorElements(), !0;
|
|
3970
4154
|
}
|
|
3971
4155
|
unmount(A, t) {
|
|
3972
4156
|
var e;
|
|
3973
|
-
return t.unregisterAll(
|
|
4157
|
+
return t.unregisterAll(V.moduleName), this.removeAnchorElements(), (e = A.document.getElementById(zt)) == null || e.remove(), t.log("ScrollSnapper Unmounted"), !0;
|
|
3974
4158
|
}
|
|
3975
4159
|
};
|
|
3976
|
-
|
|
3977
|
-
let
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
const e = 1, n = [];
|
|
3982
|
-
for (const h of t)
|
|
3983
|
-
n.push({
|
|
3984
|
-
bottom: h.bottom,
|
|
3985
|
-
height: h.height,
|
|
3986
|
-
left: h.left,
|
|
3987
|
-
right: h.right,
|
|
3988
|
-
top: h.top,
|
|
3989
|
-
width: h.width
|
|
3990
|
-
});
|
|
3991
|
-
const r = pe(
|
|
3992
|
-
n,
|
|
3993
|
-
e,
|
|
3994
|
-
A
|
|
3995
|
-
), s = Ti(r, e), o = we(s), a = 2 * 2;
|
|
3996
|
-
for (let h = o.length - 1; h >= 0; h--) {
|
|
3997
|
-
const c = o[h];
|
|
3998
|
-
if (!(c.width * c.height > a))
|
|
3999
|
-
if (o.length > 1)
|
|
4000
|
-
o.splice(h, 1);
|
|
4001
|
-
else
|
|
4002
|
-
break;
|
|
4160
|
+
pe.moduleName = "scroll_snapper";
|
|
4161
|
+
let Oi = pe;
|
|
4162
|
+
class we extends zA {
|
|
4163
|
+
constructor() {
|
|
4164
|
+
super(...arguments), this.pointerMoved = !1, this.onPointerUp = this.onPointUp.bind(this), this.onPointerMove = this.onPointMove.bind(this), this.onPointerDown = this.onPointDown.bind(this), this.onContextMenu = this.onContext.bind(this), this.onClicker = this.onClick.bind(this);
|
|
4003
4165
|
}
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
}
|
|
4166
|
+
onPointUp(A) {
|
|
4167
|
+
var t, e, n, r, s;
|
|
4168
|
+
const o = this.wnd.getSelection();
|
|
4169
|
+
if (o && ((t = o.toString()) == null ? void 0 : t.length) > 0) {
|
|
4170
|
+
const h = (e = o.getRangeAt(0)) == null ? void 0 : e.getClientRects();
|
|
4171
|
+
if (!h || h.length === 0)
|
|
4172
|
+
return;
|
|
4173
|
+
const c = h[0], l = {
|
|
4174
|
+
text: o.toString(),
|
|
4175
|
+
x: c.x,
|
|
4176
|
+
y: c.y,
|
|
4177
|
+
width: c.width,
|
|
4178
|
+
height: c.height,
|
|
4179
|
+
targetFrameSrc: (r = (n = this.wnd) == null ? void 0 : n.location) == null ? void 0 : r.href
|
|
4180
|
+
};
|
|
4181
|
+
this.comms.send("text_selected", l);
|
|
4021
4182
|
}
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
const t = Math.min(i.left, A.left), e = Math.max(i.right, A.right), n = Math.min(i.top, A.top), r = Math.max(i.bottom, A.bottom);
|
|
4026
|
-
return {
|
|
4027
|
-
bottom: r,
|
|
4028
|
-
height: r - n,
|
|
4029
|
-
left: t,
|
|
4030
|
-
right: e,
|
|
4031
|
-
top: n,
|
|
4032
|
-
width: e - t
|
|
4033
|
-
};
|
|
4034
|
-
}
|
|
4035
|
-
function Ti(i, A) {
|
|
4036
|
-
const t = new Set(i);
|
|
4037
|
-
for (const e of i) {
|
|
4038
|
-
if (!(e.width > 1 && e.height > 1)) {
|
|
4039
|
-
t.delete(e);
|
|
4040
|
-
continue;
|
|
4183
|
+
if (this.pointerMoved) {
|
|
4184
|
+
this.pointerMoved = !1;
|
|
4185
|
+
return;
|
|
4041
4186
|
}
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4187
|
+
if (!(o != null && o.isCollapsed) || !A.isPrimary)
|
|
4188
|
+
return;
|
|
4189
|
+
const a = this.wnd.devicePixelRatio;
|
|
4190
|
+
A.preventDefault(), this.comms.send(A.pointerType === "touch" ? "tap" : "click", {
|
|
4191
|
+
defaultPrevented: A.defaultPrevented,
|
|
4192
|
+
x: A.clientX * a,
|
|
4193
|
+
y: A.clientY * a,
|
|
4194
|
+
targetFrameSrc: this.wnd.location.href,
|
|
4195
|
+
targetElement: A.target.outerHTML,
|
|
4196
|
+
interactiveElement: (s = Be(A.target)) == null ? void 0 : s.outerHTML,
|
|
4197
|
+
cssSelector: this.wnd._readium_cssSelectorGenerator.getCssSelector(A.target)
|
|
4198
|
+
}), this.pointerMoved = !1;
|
|
4047
4199
|
}
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
}
|
|
4053
|
-
function BA(i, A, t, e) {
|
|
4054
|
-
return (i.left < A || j(i.left, A, e)) && (i.right > A || j(i.right, A, e)) && (i.top < t || j(i.top, t, e)) && (i.bottom > t || j(i.bottom, t, e));
|
|
4055
|
-
}
|
|
4056
|
-
function we(i) {
|
|
4057
|
-
for (let A = 0; A < i.length; A++)
|
|
4058
|
-
for (let t = A + 1; t < i.length; t++) {
|
|
4059
|
-
const e = i[A], n = i[t];
|
|
4060
|
-
if (e !== n && Ue(e, n, -1)) {
|
|
4061
|
-
let r = [], s;
|
|
4062
|
-
const o = zt(e, n);
|
|
4063
|
-
if (o.length === 1)
|
|
4064
|
-
r = o, s = e;
|
|
4065
|
-
else {
|
|
4066
|
-
const h = zt(n, e);
|
|
4067
|
-
o.length < h.length ? (r = o, s = e) : (r = h, s = n);
|
|
4068
|
-
}
|
|
4069
|
-
const a = i.filter((h) => h !== s);
|
|
4070
|
-
return Array.prototype.push.apply(a, r), we(a);
|
|
4071
|
-
}
|
|
4200
|
+
onPointMove(A) {
|
|
4201
|
+
if (A.movementY !== void 0 && A.movementX !== void 0) {
|
|
4202
|
+
(Math.abs(A.movementX) > 1 || Math.abs(A.movementY) > 1) && (this.pointerMoved = !0);
|
|
4203
|
+
return;
|
|
4072
4204
|
}
|
|
4073
|
-
|
|
4074
|
-
}
|
|
4075
|
-
function zt(i, A) {
|
|
4076
|
-
const t = ji(A, i);
|
|
4077
|
-
if (t.height === 0 || t.width === 0)
|
|
4078
|
-
return [i];
|
|
4079
|
-
const e = [];
|
|
4080
|
-
{
|
|
4081
|
-
const n = {
|
|
4082
|
-
bottom: i.bottom,
|
|
4083
|
-
height: 0,
|
|
4084
|
-
left: i.left,
|
|
4085
|
-
right: t.left,
|
|
4086
|
-
top: i.top,
|
|
4087
|
-
width: 0
|
|
4088
|
-
};
|
|
4089
|
-
n.width = n.right - n.left, n.height = n.bottom - n.top, n.height !== 0 && n.width !== 0 && e.push(n);
|
|
4205
|
+
this.pointerMoved = !0;
|
|
4090
4206
|
}
|
|
4091
|
-
{
|
|
4092
|
-
|
|
4093
|
-
bottom: t.top,
|
|
4094
|
-
height: 0,
|
|
4095
|
-
left: t.left,
|
|
4096
|
-
right: t.right,
|
|
4097
|
-
top: i.top,
|
|
4098
|
-
width: 0
|
|
4099
|
-
};
|
|
4100
|
-
n.width = n.right - n.left, n.height = n.bottom - n.top, n.height !== 0 && n.width !== 0 && e.push(n);
|
|
4207
|
+
onPointDown() {
|
|
4208
|
+
this.pointerMoved = !1;
|
|
4101
4209
|
}
|
|
4102
|
-
{
|
|
4103
|
-
|
|
4104
|
-
bottom: i.bottom,
|
|
4105
|
-
height: 0,
|
|
4106
|
-
left: t.left,
|
|
4107
|
-
right: t.right,
|
|
4108
|
-
top: t.bottom,
|
|
4109
|
-
width: 0
|
|
4110
|
-
};
|
|
4111
|
-
n.width = n.right - n.left, n.height = n.bottom - n.top, n.height !== 0 && n.width !== 0 && e.push(n);
|
|
4210
|
+
onContext(A) {
|
|
4211
|
+
this.onPointUp(A), this.pointerMoved = !1;
|
|
4112
4212
|
}
|
|
4113
|
-
{
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4213
|
+
onClick(A) {
|
|
4214
|
+
if (A.preventDefault(), !A.isTrusted) {
|
|
4215
|
+
const t = new PointerEvent("pointerup", {
|
|
4216
|
+
isPrimary: !0,
|
|
4217
|
+
pointerType: "mouse",
|
|
4218
|
+
// Not really a better choice than this
|
|
4219
|
+
clientX: A.clientX,
|
|
4220
|
+
clientY: A.clientY
|
|
4221
|
+
});
|
|
4222
|
+
Object.defineProperty(t, "target", { writable: !1, value: A.target }), Object.defineProperty(t, "defaultPrevented", { writable: !1, value: A.defaultPrevented }), this.onPointUp(t);
|
|
4223
|
+
}
|
|
4123
4224
|
}
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
function ji(i, A) {
|
|
4127
|
-
const t = Math.max(i.left, A.left), e = Math.min(i.right, A.right), n = Math.max(i.top, A.top), r = Math.min(i.bottom, A.bottom);
|
|
4128
|
-
return {
|
|
4129
|
-
bottom: r,
|
|
4130
|
-
height: Math.max(0, r - n),
|
|
4131
|
-
left: t,
|
|
4132
|
-
right: e,
|
|
4133
|
-
top: n,
|
|
4134
|
-
width: Math.max(0, e - t)
|
|
4135
|
-
};
|
|
4136
|
-
}
|
|
4137
|
-
function Ue(i, A, t) {
|
|
4138
|
-
return (i.left < A.right || t >= 0 && j(i.left, A.right, t)) && (A.left < i.right || t >= 0 && j(A.left, i.right, t)) && (i.top < A.bottom || t >= 0 && j(i.top, A.bottom, t)) && (A.top < i.bottom || t >= 0 && j(A.top, i.bottom, t));
|
|
4139
|
-
}
|
|
4140
|
-
function j(i, A, t) {
|
|
4141
|
-
return Math.abs(i - A) <= t;
|
|
4142
|
-
}
|
|
4143
|
-
const Si = window.ResizeObserver || te, Vi = "Highlight" in window, Nt = ["IMG", "IMAGE", "AUDIO", "VIDEO", "SVG"];
|
|
4144
|
-
class Di {
|
|
4145
|
-
/**
|
|
4146
|
-
* Creates a DecorationGroup object
|
|
4147
|
-
* @param id Unique HTML ID-adhering name of the group
|
|
4148
|
-
* @param name Human-readable name of the group
|
|
4149
|
-
*/
|
|
4150
|
-
constructor(A, t, e, n) {
|
|
4151
|
-
this.wnd = A, this.comms = t, this.id = e, this.name = n, this.items = [], this.lastItemId = 0, this.container = void 0, this.activateable = !1, this.experimentalHighlights = !1, this.currentRender = 0, Vi && (this.experimentalHighlights = !0, this.notTextFlag = /* @__PURE__ */ new Map());
|
|
4225
|
+
mount(A, t) {
|
|
4226
|
+
return this.wnd = A, this.comms = t, A.document.addEventListener("pointerdown", this.onPointerDown), A.document.addEventListener("pointerup", this.onPointerUp), A.document.addEventListener("contextmenu", this.onContextMenu), A.document.addEventListener("pointermove", this.onPointerMove), A.document.addEventListener("click", this.onClicker), t.log("Peripherals Mounted"), !0;
|
|
4152
4227
|
}
|
|
4153
|
-
|
|
4154
|
-
return this.
|
|
4228
|
+
unmount(A, t) {
|
|
4229
|
+
return A.document.removeEventListener("pointerdown", this.onPointerDown), A.document.removeEventListener("pointerup", this.onPointerUp), A.document.removeEventListener("contextmenu", this.onContextMenu), A.document.removeEventListener("pointermove", this.onPointerMove), A.document.removeEventListener("click", this.onClicker), t.log("Peripherals Unmounted"), !0;
|
|
4155
4230
|
}
|
|
4156
|
-
|
|
4157
|
-
|
|
4231
|
+
}
|
|
4232
|
+
we.moduleName = "peripherals";
|
|
4233
|
+
const Fe = class OA extends zA {
|
|
4234
|
+
constructor() {
|
|
4235
|
+
super(...arguments), this.mediaPlayingCount = 0, this.allAnimations = /* @__PURE__ */ new Set();
|
|
4158
4236
|
}
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
this.comms.log("Can't locate DOM range for decoration", A);
|
|
4168
|
-
return;
|
|
4169
|
-
}
|
|
4170
|
-
const a = o.commonAncestorContainer;
|
|
4171
|
-
a.nodeType !== Node.TEXT_NODE && this.experimentalHighlights && (Nt.includes(a.nodeName.toUpperCase()) && ((t = this.notTextFlag) == null || t.set(s, !0)), a.querySelector(Nt.join(", ").toLowerCase()) && ((e = this.notTextFlag) == null || e.set(s, !0)), (((n = a.textContent) == null ? void 0 : n.trim()) || "").length === 0 && ((r = this.notTextFlag) == null || r.set(s, !0)));
|
|
4172
|
-
const h = {
|
|
4173
|
-
decoration: A,
|
|
4174
|
-
id: s,
|
|
4175
|
-
range: o
|
|
4176
|
-
};
|
|
4177
|
-
this.items.push(h), this.layout(h), this.renderLayout([h]);
|
|
4237
|
+
wndOnErr(A) {
|
|
4238
|
+
var t;
|
|
4239
|
+
(t = this.comms) == null || t.send("error", {
|
|
4240
|
+
message: A.message,
|
|
4241
|
+
filename: A.filename,
|
|
4242
|
+
lineno: A.lineno,
|
|
4243
|
+
colno: A.colno
|
|
4244
|
+
});
|
|
4178
4245
|
}
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4246
|
+
unblock(A) {
|
|
4247
|
+
var t;
|
|
4248
|
+
for (A._readium_blockEvents = !1; ((t = A._readium_blockedEvents) == null ? void 0 : t.length) > 0; ) {
|
|
4249
|
+
const e = A._readium_blockedEvents.shift();
|
|
4250
|
+
switch (e[0]) {
|
|
4251
|
+
case 0:
|
|
4252
|
+
Reflect.apply(e[1], e[2], e[3]);
|
|
4253
|
+
break;
|
|
4254
|
+
case 1:
|
|
4255
|
+
const n = e[1], r = e[2];
|
|
4256
|
+
A.removeEventListener(n.type, A._readium_eventBlocker, !0);
|
|
4257
|
+
const s = new Event(n.type, {
|
|
4258
|
+
bubbles: n.bubbles,
|
|
4259
|
+
cancelable: n.cancelable
|
|
4260
|
+
});
|
|
4261
|
+
r ? r.dispatchEvent(s) : A.dispatchEvent(s);
|
|
4262
|
+
break;
|
|
4263
|
+
}
|
|
4192
4264
|
}
|
|
4193
|
-
(e = this.notTextFlag) == null || e.delete(r.id);
|
|
4194
|
-
}
|
|
4195
|
-
/**
|
|
4196
|
-
* Notifies that the given decoration was modified and needs to be updated.
|
|
4197
|
-
* @param decoration Decoration to update
|
|
4198
|
-
*/
|
|
4199
|
-
update(A) {
|
|
4200
|
-
this.remove(A.id), this.add(A);
|
|
4201
4265
|
}
|
|
4202
|
-
|
|
4203
|
-
* Removes all decorations from this group.
|
|
4204
|
-
*/
|
|
4205
|
-
clear() {
|
|
4266
|
+
onMediaPlayEvent() {
|
|
4206
4267
|
var A;
|
|
4207
|
-
this.
|
|
4208
|
-
}
|
|
4209
|
-
/**
|
|
4210
|
-
* Recreates the decoration elements.
|
|
4211
|
-
* To be called after reflowing the resource, for example.
|
|
4212
|
-
*/
|
|
4213
|
-
requestLayout() {
|
|
4214
|
-
this.wnd.cancelAnimationFrame(this.currentRender), this.clearContainer(), this.items.forEach((A) => this.layout(A)), this.renderLayout(this.items);
|
|
4268
|
+
this.mediaPlayingCount++, (A = this.comms) == null || A.send("media_play", this.mediaPlayingCount);
|
|
4215
4269
|
}
|
|
4216
|
-
|
|
4217
|
-
var
|
|
4218
|
-
|
|
4219
|
-
r.add(A.range), n.innerHTML = `
|
|
4220
|
-
::highlight(${this.id}) {
|
|
4221
|
-
color: black;
|
|
4222
|
-
background-color: ${((e = (t = A.decoration) == null ? void 0 : t.style) == null ? void 0 : e.tint) ?? "yellow"};
|
|
4223
|
-
}`;
|
|
4270
|
+
onMediaPauseEvent() {
|
|
4271
|
+
var A;
|
|
4272
|
+
this.mediaPlayingCount > 0 && this.mediaPlayingCount--, (A = this.comms) == null || A.send("media_pause", this.mediaPlayingCount);
|
|
4224
4273
|
}
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
layout(A) {
|
|
4230
|
-
var t, e, n, r, s;
|
|
4231
|
-
if (this.experimentalHighlights && !((t = this.notTextFlag) != null && t.has(A.id)))
|
|
4232
|
-
return this.experimentalLayout(A);
|
|
4233
|
-
const o = this.wnd.document.createElement("div");
|
|
4234
|
-
o.setAttribute("id", A.id), o.style.setProperty("pointer-events", "none");
|
|
4235
|
-
const a = this.wnd.innerWidth, h = parseInt(
|
|
4236
|
-
getComputedStyle(this.wnd.document.documentElement).getPropertyValue(
|
|
4237
|
-
"column-count"
|
|
4238
|
-
)
|
|
4239
|
-
), c = a / (h || 1), l = this.wnd.document.scrollingElement, g = l.scrollLeft, u = l.scrollTop, m = (f, w, R) => {
|
|
4240
|
-
var q, k, W, L, gA, dA;
|
|
4241
|
-
if (f.style.position = "absolute", ((k = (q = A.decoration) == null ? void 0 : q.style) == null ? void 0 : k.width) === "viewport") {
|
|
4242
|
-
f.style.width = `${a}px`, f.style.height = `${w.height}px`;
|
|
4243
|
-
let _ = Math.floor(w.left / a) * a;
|
|
4244
|
-
f.style.left = `${_ + g}px`, f.style.top = `${w.top + u}px`;
|
|
4245
|
-
} else if (((L = (W = A.decoration) == null ? void 0 : W.style) == null ? void 0 : L.width) === "bounds")
|
|
4246
|
-
f.style.width = `${R.width}px`, f.style.height = `${w.height}px`, f.style.left = `${R.left + g}px`, f.style.top = `${w.top + u}px`;
|
|
4247
|
-
else if (((dA = (gA = A.decoration) == null ? void 0 : gA.style) == null ? void 0 : dA.width) === "page") {
|
|
4248
|
-
f.style.width = `${c}px`, f.style.height = `${w.height}px`;
|
|
4249
|
-
let _ = Math.floor(w.left / c) * c;
|
|
4250
|
-
f.style.left = `${_ + g}px`, f.style.top = `${w.top + u}px`;
|
|
4251
|
-
} else
|
|
4252
|
-
f.style.width = `${w.width}px`, f.style.height = `${w.height}px`, f.style.left = `${w.left + g}px`, f.style.top = `${w.top + u}px`;
|
|
4253
|
-
}, B = A.range.getBoundingClientRect();
|
|
4254
|
-
let I = this.wnd.document.createElement("template");
|
|
4255
|
-
const E = Ri(this.wnd, "--USER__appearance") === "readium-night-on";
|
|
4256
|
-
I.innerHTML = `
|
|
4257
|
-
<div
|
|
4258
|
-
class="r2-highlight-0"
|
|
4259
|
-
style="${[
|
|
4260
|
-
`background-color: ${((n = (e = A.decoration) == null ? void 0 : e.style) == null ? void 0 : n.tint) ?? "yellow"} !important`,
|
|
4261
|
-
//"opacity: 0.3 !important",
|
|
4262
|
-
`mix-blend-mode: ${E ? "exclusion" : "multiply"} !important`,
|
|
4263
|
-
"opacity: 1 !important",
|
|
4264
|
-
"box-sizing: border-box !important"
|
|
4265
|
-
].join("; ")}"
|
|
4266
|
-
>
|
|
4267
|
-
</div>
|
|
4268
|
-
`.trim();
|
|
4269
|
-
const p = I.content.firstElementChild;
|
|
4270
|
-
if (((s = (r = A.decoration) == null ? void 0 : r.style) == null ? void 0 : s.layout) === "bounds") {
|
|
4271
|
-
const f = p.cloneNode(!0);
|
|
4272
|
-
f.style.setProperty("pointer-events", "none"), m(f, B, B), o.append(f);
|
|
4273
|
-
} else {
|
|
4274
|
-
let f = zi(
|
|
4275
|
-
A.range,
|
|
4276
|
-
!0
|
|
4277
|
-
// doNotMergeHorizontallyAlignedRects
|
|
4278
|
-
);
|
|
4279
|
-
f = f.sort((w, R) => w.top < R.top ? -1 : w.top > R.top ? 1 : 0);
|
|
4280
|
-
for (let w of f) {
|
|
4281
|
-
const R = p.cloneNode(!0);
|
|
4282
|
-
R.style.setProperty("pointer-events", "none"), m(R, w, B), o.append(R);
|
|
4283
|
-
}
|
|
4284
|
-
}
|
|
4285
|
-
A.container = o, A.clickableElements = Array.from(
|
|
4286
|
-
o.querySelectorAll("[data-activable='1']")
|
|
4287
|
-
), A.clickableElements.length || (A.clickableElements = Array.from(o.children));
|
|
4274
|
+
pauseAllMedia(A) {
|
|
4275
|
+
const t = A.document.querySelectorAll("audio,video");
|
|
4276
|
+
for (let e = 0; e < t.length; e++)
|
|
4277
|
+
t[e].pause();
|
|
4288
4278
|
}
|
|
4289
|
-
|
|
4290
|
-
this.
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4279
|
+
mount(A, t) {
|
|
4280
|
+
this.comms = t, A.addEventListener(
|
|
4281
|
+
"error",
|
|
4282
|
+
this.wndOnErr,
|
|
4283
|
+
!1
|
|
4284
|
+
), Reflect.defineProperty(A.navigator, "epubReadingSystem", {
|
|
4285
|
+
value: {
|
|
4286
|
+
name: "readium-ts-toolkit",
|
|
4287
|
+
version: "1.3.2",
|
|
4288
|
+
hasFeature: (n, r = "") => {
|
|
4289
|
+
switch (n) {
|
|
4290
|
+
case "dom-manipulation":
|
|
4291
|
+
return !0;
|
|
4292
|
+
case "layout-changes":
|
|
4293
|
+
return !0;
|
|
4294
|
+
case "touch-events":
|
|
4295
|
+
return !0;
|
|
4296
|
+
case "mouse-events":
|
|
4297
|
+
return !0;
|
|
4298
|
+
case "keyboard-events":
|
|
4299
|
+
return !0;
|
|
4300
|
+
case "spine-scripting":
|
|
4301
|
+
return !0;
|
|
4302
|
+
case "embedded-web-content":
|
|
4303
|
+
return !0;
|
|
4304
|
+
default:
|
|
4305
|
+
return !1;
|
|
4306
|
+
}
|
|
4307
|
+
}
|
|
4308
|
+
},
|
|
4309
|
+
writable: !1
|
|
4310
|
+
}), "getAnimations" in A.document && A.document.getAnimations().forEach((n) => {
|
|
4311
|
+
n.cancel(), this.allAnimations.add(n);
|
|
4312
|
+
}), t.register("activate", OA.moduleName, (n, r) => {
|
|
4313
|
+
this.allAnimations.forEach((s) => {
|
|
4314
|
+
s.cancel(), s.play();
|
|
4315
|
+
}), r(!0);
|
|
4316
|
+
}), t.register("unfocus", OA.moduleName, (n, r) => {
|
|
4317
|
+
this.pauseAllMedia(A), this.allAnimations.forEach((s) => s.pause()), r(!0);
|
|
4295
4318
|
});
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
this.wnd.document.getElementById(`${this.id}-style`) ? t = this.wnd.document.getElementById(`${this.id}-style`) : (t = this.wnd.document.createElement("style"), t.dataset.readium = "true", t.id = `${this.id}-style`, this.wnd.document.head.appendChild(t));
|
|
4305
|
-
let e;
|
|
4306
|
-
return this.wnd.CSS.highlights.has(this.id) ? e = this.wnd.CSS.highlights.get(this.id) : (e = new this.wnd.Highlight(), this.wnd.CSS.highlights.set(this.id, e)), [t, e];
|
|
4319
|
+
const e = A.document.querySelectorAll("audio,video");
|
|
4320
|
+
for (let n = 0; n < e.length; n++) {
|
|
4321
|
+
const r = e[n];
|
|
4322
|
+
r.addEventListener("play", this.onMediaPlayEvent, {
|
|
4323
|
+
passive: !0
|
|
4324
|
+
}), r.addEventListener("pause", this.onMediaPauseEvent, {
|
|
4325
|
+
passive: !0
|
|
4326
|
+
});
|
|
4307
4327
|
}
|
|
4308
|
-
return
|
|
4328
|
+
return t.log("Setup Mounted"), !0;
|
|
4309
4329
|
}
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
*/
|
|
4313
|
-
clearContainer() {
|
|
4314
|
-
this.experimentalHighlights && this.wnd.CSS.highlights.delete(this.id), this.container && (this.container.remove(), this.container = void 0);
|
|
4330
|
+
unmount(A, t) {
|
|
4331
|
+
return A.removeEventListener("error", this.wndOnErr), A.removeEventListener("play", this.onMediaPlayEvent), A.removeEventListener("pause", this.onMediaPauseEvent), this.allAnimations.forEach((e) => e.cancel()), this.allAnimations.clear(), t.log("Setup Unmounted"), !0;
|
|
4315
4332
|
}
|
|
4316
|
-
}
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4333
|
+
};
|
|
4334
|
+
Fe.moduleName = "setup";
|
|
4335
|
+
let Ue = Fe;
|
|
4336
|
+
const Nt = "readium-viewport", ye = class aA extends Ue {
|
|
4337
|
+
onViewportWidthChanged(A) {
|
|
4338
|
+
const t = A.target;
|
|
4339
|
+
kA(t, "--RS__viewportWidth", `${t.innerWidth}px`);
|
|
4320
4340
|
}
|
|
4321
|
-
|
|
4322
|
-
|
|
4341
|
+
mount(A, t) {
|
|
4342
|
+
if (!super.mount(A, t))
|
|
4343
|
+
return !1;
|
|
4344
|
+
const e = A.document.createElement("meta");
|
|
4345
|
+
return e.dataset.readium = "true", e.setAttribute("name", "viewport"), e.setAttribute("id", Nt), e.setAttribute(
|
|
4346
|
+
"content",
|
|
4347
|
+
"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no"
|
|
4348
|
+
), A.document.head.appendChild(e), A.addEventListener("orientationchange", this.onViewportWidthChanged), A.addEventListener("resize", this.onViewportWidthChanged), this.onViewportWidthChanged({
|
|
4349
|
+
target: A
|
|
4350
|
+
}), t.register("set_property", aA.moduleName, (n, r) => {
|
|
4351
|
+
const s = n;
|
|
4352
|
+
kA(A, s[0], s[1]), r(!0);
|
|
4353
|
+
}), t.register("remove_property", aA.moduleName, (n, r) => {
|
|
4354
|
+
ge(A, n), r(!0);
|
|
4355
|
+
}), t.register("activate", aA.moduleName, (n, r) => {
|
|
4356
|
+
this.unblock(A), r(!0);
|
|
4357
|
+
}), t.log("ReflowableSetup Mounted"), !0;
|
|
4323
4358
|
}
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
A.experimentalHighlights || A.requestLayout();
|
|
4328
|
-
});
|
|
4329
|
-
}, 50);
|
|
4359
|
+
unmount(A, t) {
|
|
4360
|
+
var e;
|
|
4361
|
+
return t.unregisterAll(aA.moduleName), (e = A.document.head.querySelector(`#${Nt}`)) == null || e.remove(), A.removeEventListener("orientationchange", this.onViewportWidthChanged), t.log("ReflowableSetup Unmounted"), super.unmount(A, t);
|
|
4330
4362
|
}
|
|
4363
|
+
};
|
|
4364
|
+
ye.moduleName = "reflowable_setup";
|
|
4365
|
+
let Xi = ye;
|
|
4366
|
+
const Tt = "readium-fixed-style", Qe = class J extends Ue {
|
|
4331
4367
|
mount(A, t) {
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4368
|
+
if (!super.mount(A, t))
|
|
4369
|
+
return !1;
|
|
4370
|
+
A.navigator.epubReadingSystem.layoutStyle = "paginated";
|
|
4371
|
+
const e = A.document.createElement("style");
|
|
4372
|
+
return e.id = Tt, e.dataset.readium = "true", e.textContent = `
|
|
4373
|
+
html, body {
|
|
4374
|
+
text-size-adjust: none;
|
|
4375
|
+
-ms-text-size-adjust: none;
|
|
4376
|
+
-webkit-text-size-adjust: none;
|
|
4377
|
+
-moz-text-size-adjust: none;
|
|
4378
|
+
|
|
4379
|
+
/* Fight Safari pinches */
|
|
4380
|
+
touch-action: none !important;
|
|
4381
|
+
min-height: 100%;
|
|
4382
|
+
|
|
4383
|
+
/*cursor: var() TODO*/
|
|
4384
|
+
}`, A.document.head.appendChild(e), t.register("set_property", J.moduleName, (n, r) => {
|
|
4385
|
+
const s = n;
|
|
4386
|
+
kA(A, s[0], s[1]), r(!0);
|
|
4387
|
+
}), t.register("remove_property", J.moduleName, (n, r) => {
|
|
4388
|
+
ge(A, n), r(!0);
|
|
4389
|
+
}), t.register("first_visible_locator", J.moduleName, (n, r) => r(!1)), t.register("unfocus", J.moduleName, (n, r) => {
|
|
4390
|
+
C(A), r(!0);
|
|
4391
|
+
}), t.register([
|
|
4392
|
+
"focus",
|
|
4393
|
+
"go_next",
|
|
4394
|
+
"go_prev",
|
|
4395
|
+
"go_id",
|
|
4396
|
+
"go_end",
|
|
4397
|
+
"go_start",
|
|
4398
|
+
"go_text",
|
|
4399
|
+
"go_progression"
|
|
4400
|
+
], J.moduleName, (n, r) => r(!0)), t.register("activate", J.moduleName, (n, r) => {
|
|
4401
|
+
this.unblock(A), r(!0);
|
|
4402
|
+
}), t.log("FixedSetup Mounted"), !0;
|
|
4357
4403
|
}
|
|
4358
4404
|
unmount(A, t) {
|
|
4359
|
-
|
|
4405
|
+
var e;
|
|
4406
|
+
return t.unregisterAll(J.moduleName), (e = A.document.getElementById(Tt)) == null || e.remove(), t.log("FixedSetup Unmounted"), super.unmount(A, t);
|
|
4360
4407
|
}
|
|
4361
4408
|
};
|
|
4362
|
-
|
|
4363
|
-
let
|
|
4364
|
-
const
|
|
4409
|
+
Qe.moduleName = "fixed_setup";
|
|
4410
|
+
let Zi = Qe;
|
|
4411
|
+
const Ki = [
|
|
4365
4412
|
"fixed_setup",
|
|
4366
4413
|
"decorator",
|
|
4367
4414
|
"peripherals"
|
|
4368
|
-
],
|
|
4415
|
+
], qi = [
|
|
4369
4416
|
"reflowable_setup",
|
|
4370
4417
|
"decorator",
|
|
4371
4418
|
"peripherals",
|
|
4372
4419
|
"column_snapper",
|
|
4373
4420
|
"scroll_snapper"
|
|
4374
|
-
],
|
|
4421
|
+
], XA = new Map([
|
|
4375
4422
|
// All modules go here
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4423
|
+
Zi,
|
|
4424
|
+
Xi,
|
|
4425
|
+
we,
|
|
4426
|
+
Vi,
|
|
4427
|
+
Pi,
|
|
4428
|
+
Oi
|
|
4382
4429
|
].map((i) => [i.moduleName, i]));
|
|
4383
|
-
class
|
|
4430
|
+
class CA {
|
|
4384
4431
|
/**
|
|
4385
4432
|
* @param wnd Window instance to operate on
|
|
4386
4433
|
* @param initialModules List of initial modules to load
|
|
4387
4434
|
*/
|
|
4388
4435
|
constructor(A = window, t = []) {
|
|
4389
|
-
this.loadedModules = [], this.wnd = A, this.comms = new
|
|
4436
|
+
this.loadedModules = [], this.wnd = A, this.comms = new $e(A);
|
|
4390
4437
|
const e = [...new Set(t)];
|
|
4391
4438
|
if (e.length) {
|
|
4392
4439
|
if (typeof A > "u")
|
|
@@ -4399,7 +4446,7 @@ class YA {
|
|
|
4399
4446
|
}
|
|
4400
4447
|
}
|
|
4401
4448
|
loadModule(A) {
|
|
4402
|
-
const t =
|
|
4449
|
+
const t = XA.get(A);
|
|
4403
4450
|
return t === void 0 ? (this.comms.log(`Module "${name}" does not exist in the library`), t) : new t();
|
|
4404
4451
|
}
|
|
4405
4452
|
/**
|
|
@@ -4417,7 +4464,7 @@ class YA {
|
|
|
4417
4464
|
* @returns Success
|
|
4418
4465
|
*/
|
|
4419
4466
|
removeModule(A) {
|
|
4420
|
-
const t =
|
|
4467
|
+
const t = XA.get(A);
|
|
4421
4468
|
if (t === void 0)
|
|
4422
4469
|
return this.comms.log(`Module "${A}" does not exist in the library`), !1;
|
|
4423
4470
|
const e = this.loadedModules.findIndex((n) => n instanceof t);
|
|
@@ -4430,18 +4477,18 @@ class YA {
|
|
|
4430
4477
|
this.comms.destroy(), this.loadedModules.forEach((A) => A.unmount(this.wnd, this.comms)), this.loadedModules = [];
|
|
4431
4478
|
}
|
|
4432
4479
|
}
|
|
4433
|
-
const
|
|
4434
|
-
class
|
|
4480
|
+
const _i = 1e4;
|
|
4481
|
+
class Re {
|
|
4435
4482
|
constructor(A, t) {
|
|
4436
4483
|
this.registry = /* @__PURE__ */ new Map(), this._ready = !1, this.listenerBuffer = [], this.handler = this.handle.bind(this), this.wnd = A, this.origin = t;
|
|
4437
4484
|
try {
|
|
4438
4485
|
this.channelId = window.crypto.randomUUID();
|
|
4439
4486
|
} catch {
|
|
4440
|
-
this.channelId =
|
|
4487
|
+
this.channelId = bA();
|
|
4441
4488
|
}
|
|
4442
4489
|
this.gc = setInterval(() => {
|
|
4443
4490
|
this.registry.forEach((e, n) => {
|
|
4444
|
-
performance.now() - e.time >
|
|
4491
|
+
performance.now() - e.time > _i && (console.warn(n, "event for", e.key, "was never handled!"), this.registry.delete(n));
|
|
4445
4492
|
});
|
|
4446
4493
|
}, 5e3), window.addEventListener("message", this.handler), this.send("_ping", void 0);
|
|
4447
4494
|
}
|
|
@@ -4491,7 +4538,7 @@ class Qe {
|
|
|
4491
4538
|
* @returns Identifier associated with the message
|
|
4492
4539
|
*/
|
|
4493
4540
|
send(A, t, e, n = !1, r = []) {
|
|
4494
|
-
const s =
|
|
4541
|
+
const s = bA();
|
|
4495
4542
|
return e && this.registry.set(s, {
|
|
4496
4543
|
// Add callback to the registry
|
|
4497
4544
|
cb: e,
|
|
@@ -4499,7 +4546,7 @@ class Qe {
|
|
|
4499
4546
|
key: A
|
|
4500
4547
|
}), this.wnd.postMessage(
|
|
4501
4548
|
{
|
|
4502
|
-
_readium:
|
|
4549
|
+
_readium: eA,
|
|
4503
4550
|
_channel: this.channelId,
|
|
4504
4551
|
id: s,
|
|
4505
4552
|
data: t,
|
|
@@ -4512,7 +4559,7 @@ class Qe {
|
|
|
4512
4559
|
), s;
|
|
4513
4560
|
}
|
|
4514
4561
|
}
|
|
4515
|
-
class
|
|
4562
|
+
class $i {
|
|
4516
4563
|
constructor(A) {
|
|
4517
4564
|
this.currModules = [], this.frame = document.createElement("iframe"), this.frame.classList.add("readium-navigator-iframe"), this.frame.style.visibility = "hidden", this.frame.style.setProperty("aria-hidden", "true"), this.frame.style.opacity = "0", this.frame.style.position = "absolute", this.frame.style.pointerEvents = "none", this.frame.style.transition = "visibility 0s, opacity 0.1s linear", this.source = A;
|
|
4518
4565
|
}
|
|
@@ -4528,7 +4575,7 @@ class Ji {
|
|
|
4528
4575
|
}
|
|
4529
4576
|
return;
|
|
4530
4577
|
}
|
|
4531
|
-
(n = this.comms) == null || n.halt(), this.loader.destroy(), this.loader = new
|
|
4578
|
+
(n = this.comms) == null || n.halt(), this.loader.destroy(), this.loader = new CA(r, A), this.currModules = A, this.comms = void 0;
|
|
4532
4579
|
try {
|
|
4533
4580
|
t(r);
|
|
4534
4581
|
} catch {
|
|
@@ -4537,7 +4584,7 @@ class Ji {
|
|
|
4537
4584
|
}
|
|
4538
4585
|
this.frame.onload = () => {
|
|
4539
4586
|
const r = this.frame.contentWindow;
|
|
4540
|
-
this.loader = new
|
|
4587
|
+
this.loader = new CA(r, A), this.currModules = A;
|
|
4541
4588
|
try {
|
|
4542
4589
|
t(r);
|
|
4543
4590
|
} catch {
|
|
@@ -4571,7 +4618,7 @@ class Ji {
|
|
|
4571
4618
|
console.warn("Trying to show frame that is not attached to the DOM");
|
|
4572
4619
|
return;
|
|
4573
4620
|
}
|
|
4574
|
-
return this.comms ? this.comms.resume() : this.comms = new
|
|
4621
|
+
return this.comms ? this.comms.resume() : this.comms = new Re(this.frame.contentWindow, this.source), new Promise((t, e) => {
|
|
4575
4622
|
var n;
|
|
4576
4623
|
(n = this.comms) == null || n.send("activate", void 0, () => {
|
|
4577
4624
|
var r;
|
|
@@ -4609,8 +4656,8 @@ class Ji {
|
|
|
4609
4656
|
return this.loader;
|
|
4610
4657
|
}
|
|
4611
4658
|
}
|
|
4612
|
-
const
|
|
4613
|
-
class
|
|
4659
|
+
const xt = 5, jt = 3;
|
|
4660
|
+
class An {
|
|
4614
4661
|
constructor(A, t) {
|
|
4615
4662
|
this.pool = /* @__PURE__ */ new Map(), this.blobs = /* @__PURE__ */ new Map(), this.inprogress = /* @__PURE__ */ new Map(), this.container = A, this.positions = t;
|
|
4616
4663
|
}
|
|
@@ -4637,7 +4684,7 @@ class Pi {
|
|
|
4637
4684
|
var m, B, I;
|
|
4638
4685
|
const c = [], l = [];
|
|
4639
4686
|
this.positions.forEach((E, p) => {
|
|
4640
|
-
(p > r +
|
|
4687
|
+
(p > r + xt || p < r - xt) && (c.includes(E.href) || c.push(E.href)), p < r + jt && p > r - jt && (l.includes(E.href) || l.push(E.href));
|
|
4641
4688
|
}), c.forEach(async (E) => {
|
|
4642
4689
|
var p;
|
|
4643
4690
|
l.includes(E) || this.pool.has(E) && (await ((p = this.pool.get(E)) == null ? void 0 : p.destroy()), this.pool.delete(E));
|
|
@@ -4656,10 +4703,10 @@ class Pi {
|
|
|
4656
4703
|
if (!p)
|
|
4657
4704
|
return;
|
|
4658
4705
|
if (!this.blobs.has(E)) {
|
|
4659
|
-
const R = await new
|
|
4706
|
+
const R = await new Kt(A, this.currentBaseURL || "", p).build();
|
|
4660
4707
|
this.blobs.set(E, R);
|
|
4661
4708
|
}
|
|
4662
|
-
const f = new
|
|
4709
|
+
const f = new $i(this.blobs.get(E));
|
|
4663
4710
|
E !== s && await f.hide(), this.container.appendChild(f.iframe), await f.load(e), this.pool.set(E, f);
|
|
4664
4711
|
};
|
|
4665
4712
|
try {
|
|
@@ -4702,9 +4749,9 @@ class Pi {
|
|
|
4702
4749
|
}), A;
|
|
4703
4750
|
}
|
|
4704
4751
|
}
|
|
4705
|
-
class
|
|
4752
|
+
class tn {
|
|
4706
4753
|
constructor(A, t, e) {
|
|
4707
|
-
this.currModules = [], this.cachedPage = void 0, this.peripherals = A, this.debugHref = e, this.frame = document.createElement("iframe"), 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 = e, this.source = "about:blank", this.wrapper = document.createElement("div"), this.wrapper.style.position = "relative", this.wrapper.style.float = this.wrapper.style.cssFloat = t ===
|
|
4754
|
+
this.currModules = [], this.cachedPage = void 0, this.peripherals = A, this.debugHref = e, this.frame = document.createElement("iframe"), 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 = e, this.source = "about:blank", this.wrapper = document.createElement("div"), this.wrapper.style.position = "relative", this.wrapper.style.float = this.wrapper.style.cssFloat = t === F.rtl ? "right" : "left", this.wrapper.appendChild(this.frame);
|
|
4708
4755
|
}
|
|
4709
4756
|
async load(A, t) {
|
|
4710
4757
|
return this.source === t && this.loadPromise && [...this.currModules].sort().join("|") === [...A].sort().join("|") ? this.loadPromise : (this.loaded && this.source !== t && this.window.stop(), this.source = t, this.loadPromise = new Promise((e, n) => {
|
|
@@ -4718,7 +4765,7 @@ class ki {
|
|
|
4718
4765
|
}
|
|
4719
4766
|
return;
|
|
4720
4767
|
}
|
|
4721
|
-
(r = this.comms) == null || r.halt(), this.loader.destroy(), this.loader = new
|
|
4768
|
+
(r = this.comms) == null || r.halt(), this.loader.destroy(), this.loader = new CA(s, A), this.currModules = A, this.comms = void 0;
|
|
4722
4769
|
try {
|
|
4723
4770
|
e(s), this.loadPromise = void 0;
|
|
4724
4771
|
} catch {
|
|
@@ -4727,7 +4774,7 @@ class ki {
|
|
|
4727
4774
|
}
|
|
4728
4775
|
this.frame.addEventListener("load", () => {
|
|
4729
4776
|
const s = this.frame.contentWindow;
|
|
4730
|
-
this.loader = new
|
|
4777
|
+
this.loader = new CA(s, A), this.currModules = A, this.peripherals.observe(this.wrapper), this.peripherals.observe(s);
|
|
4731
4778
|
try {
|
|
4732
4779
|
e(s);
|
|
4733
4780
|
} catch {
|
|
@@ -4766,10 +4813,10 @@ class ki {
|
|
|
4766
4813
|
const e = Math.min(this.wrapper.clientWidth / t.width, this.wrapper.clientHeight / t.height);
|
|
4767
4814
|
this.frame.style.transform = `scale(${e})`;
|
|
4768
4815
|
const n = this.frame.getBoundingClientRect(), r = this.wrapper.clientHeight - n.height;
|
|
4769
|
-
if (this.frame.style.top = `${r / 2}px`, A ===
|
|
4816
|
+
if (this.frame.style.top = `${r / 2}px`, A === D.left) {
|
|
4770
4817
|
const s = this.wrapper.clientWidth - n.width;
|
|
4771
4818
|
this.frame.style.left = `${s}px`;
|
|
4772
|
-
} else if (A ===
|
|
4819
|
+
} else if (A === D.center) {
|
|
4773
4820
|
const s = this.wrapper.clientWidth - n.width;
|
|
4774
4821
|
this.frame.style.left = `${s / 2}px`;
|
|
4775
4822
|
} else
|
|
@@ -4822,7 +4869,7 @@ class ki {
|
|
|
4822
4869
|
this.showPromise = void 0;
|
|
4823
4870
|
return;
|
|
4824
4871
|
}
|
|
4825
|
-
return this.showPromise ? (this.cachedPage !== A && (this.update(A), this.cachedPage = A), this.showPromise) : (this.cachedPage = A, this.comms ? this.comms.resume() : this.comms = new
|
|
4872
|
+
return this.showPromise ? (this.cachedPage !== A && (this.update(A), this.cachedPage = A), this.showPromise) : (this.cachedPage = A, this.comms ? this.comms.resume() : this.comms = new Re(this.frame.contentWindow, this.source), this.showPromise = new Promise((t, e) => {
|
|
4826
4873
|
this.comms.send("focus", void 0, (n) => {
|
|
4827
4874
|
this.update(this.cachedPage), t();
|
|
4828
4875
|
});
|
|
@@ -4886,7 +4933,7 @@ class ki {
|
|
|
4886
4933
|
* Portions of this code come from the sML library
|
|
4887
4934
|
* Current version: 1.0.36
|
|
4888
4935
|
*/
|
|
4889
|
-
class
|
|
4936
|
+
class en {
|
|
4890
4937
|
constructor() {
|
|
4891
4938
|
const A = navigator.userAgentData, t = navigator.userAgent, e = (r) => (typeof r == "string" || typeof r == "number") && r ? String(r).replace(/_/g, ".").split(".").map((s) => parseInt(s) || 0) : [], n = (r = "") => {
|
|
4892
4939
|
if (!r)
|
|
@@ -4929,14 +4976,14 @@ class Wi {
|
|
|
4929
4976
|
}, []) };
|
|
4930
4977
|
}
|
|
4931
4978
|
}
|
|
4932
|
-
const
|
|
4933
|
-
var
|
|
4934
|
-
class
|
|
4979
|
+
const DA = new en();
|
|
4980
|
+
var nn = /* @__PURE__ */ ((i) => (i[i.Left = 0] = "Left", i[i.Center = 1] = "Center", i[i.Right = 2] = "Right", i))(nn || {}), rn = /* @__PURE__ */ ((i) => (i[i.Top = 0] = "Top", i[i.Middle = 1] = "Middle", i[i.Bottom = 2] = "Bottom", i))(rn || {});
|
|
4981
|
+
class sn {
|
|
4935
4982
|
constructor() {
|
|
4936
4983
|
this.outerWidth = 0, this.outerHeight = 0, this.HTML = document.documentElement, this.Head = document.head, this.Body = document.body;
|
|
4937
4984
|
}
|
|
4938
4985
|
refreshOuterPixels(A) {
|
|
4939
|
-
|
|
4986
|
+
DA.OS.iOS || (this.outerHeight = window.outerHeight - window.innerHeight, DA.OS.Android && DA.UA.Chrome && window.screen.height > window.innerHeight && (this.outerHeight = (window.screen.height - window.innerHeight) / 1.5), this.outerWidth = window.outerWidth - window.innerWidth);
|
|
4940
4987
|
}
|
|
4941
4988
|
getBibiEventCoord(A, t = 0) {
|
|
4942
4989
|
var n;
|
|
@@ -4983,7 +5030,7 @@ class Xi {
|
|
|
4983
5030
|
};
|
|
4984
5031
|
}
|
|
4985
5032
|
}
|
|
4986
|
-
class
|
|
5033
|
+
class on {
|
|
4987
5034
|
constructor() {
|
|
4988
5035
|
this._DOM = {
|
|
4989
5036
|
show: !1,
|
|
@@ -5001,8 +5048,8 @@ class Zi {
|
|
|
5001
5048
|
return this._DOM;
|
|
5002
5049
|
}
|
|
5003
5050
|
}
|
|
5004
|
-
const
|
|
5005
|
-
class
|
|
5051
|
+
const St = 6, HA = 1.02, Vt = 50;
|
|
5052
|
+
class an {
|
|
5006
5053
|
constructor(A, t = !1) {
|
|
5007
5054
|
this.dragState = 0, this.minimumMoved = !1, this.pan = {
|
|
5008
5055
|
startX: 0,
|
|
@@ -5021,14 +5068,14 @@ class Ki {
|
|
|
5021
5068
|
target: { X: 0, Y: 0 },
|
|
5022
5069
|
touchN: 0,
|
|
5023
5070
|
startTranslate: { X: 0, Y: 0 }
|
|
5024
|
-
}, 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 = A, this.coordinator = new
|
|
5071
|
+
}, 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 = A, this.coordinator = new sn(), this.attachEvents(), t && (this.debugger = new on());
|
|
5025
5072
|
}
|
|
5026
5073
|
get scale() {
|
|
5027
5074
|
return this._scale;
|
|
5028
5075
|
}
|
|
5029
5076
|
set scale(A) {
|
|
5030
5077
|
isNaN(A) && (A = 1), window.clearTimeout(this.scaleDebouncer), this.scaleDebouncer = window.setTimeout(() => {
|
|
5031
|
-
this.dragState === 0 && this.scale <
|
|
5078
|
+
this.dragState === 0 && this.scale < HA && (this.pan.translateX = 0, this.pan.translateY = 0, this.clearPan(), this.manager.updateBookStyle()), this.manager.listener("zoom", A);
|
|
5032
5079
|
}, 100), this._scale = A;
|
|
5033
5080
|
}
|
|
5034
5081
|
/**
|
|
@@ -5117,14 +5164,14 @@ class Ki {
|
|
|
5117
5164
|
touchendHandler(A) {
|
|
5118
5165
|
var t, e;
|
|
5119
5166
|
if (A.stopPropagation(), !A.touches || A.touches.length === 0)
|
|
5120
|
-
this.pan.endX && !this.isScaled ? (this.pinch.touchN && (this.pan.endX = this.pan.startX), this.updateAfterDrag()) : !this.pinch.touchN && Math.abs(this.pan.overscrollX) >
|
|
5167
|
+
this.pan.endX && !this.isScaled ? (this.pinch.touchN && (this.pan.endX = this.pan.startX), this.updateAfterDrag()) : !this.pinch.touchN && Math.abs(this.pan.overscrollX) > Vt && Math.abs(this.pan.overscrollY) < Vt / 2 && (this.pan.startX = 0, this.pan.endX = -this.pan.overscrollX, this.updateAfterDrag()), this.dragState = 0, this.minimumMoved = !1, this.clearPinch(), (t = this.debugger) != null && t.show && (this.debugger.DOM.center.style.display = "none", this.debugger.DOM.touch1.style.display = "none", this.debugger.DOM.touch2.style.display = "none");
|
|
5121
5168
|
else if (A.touches.length === 1) {
|
|
5122
5169
|
this.dragState = 1, A.touches[0].identifier !== this.pan.touchID && (this.pan.touchID = A.touches[0].identifier), (e = this.debugger) != null && e.show && (this.debugger.DOM.center.style.display = "none", this.debugger.DOM.touch2.style.display = "none", this.debugger.DOM.pinchTarget.style.display = "none");
|
|
5123
5170
|
const n = this.startTouch(A);
|
|
5124
5171
|
this.pan.startX = n.X, this.pan.startY = n.Y;
|
|
5125
5172
|
}
|
|
5126
5173
|
window.setTimeout(() => {
|
|
5127
|
-
this.manager.updateBookStyle(!0), this.dragState === 0 && (this.scale <
|
|
5174
|
+
this.manager.updateBookStyle(!0), this.dragState === 0 && (this.scale < HA && (this.pan.translateX = 0, this.pan.translateY = 0), this.clearPan()), this.manager.updateBookStyle(!0);
|
|
5128
5175
|
}, 50);
|
|
5129
5176
|
}
|
|
5130
5177
|
/**
|
|
@@ -5142,7 +5189,7 @@ class Ki {
|
|
|
5142
5189
|
if (this.pinch.touchN++, this.pinch.touchN < 4)
|
|
5143
5190
|
return;
|
|
5144
5191
|
let l = e / this.pinch.startDistance * this.scale;
|
|
5145
|
-
l >=
|
|
5192
|
+
l >= St && (l = St), l <= HA && (l = 1), this.scale = l, this.pinch.startDistance = e, n = !0;
|
|
5146
5193
|
}
|
|
5147
5194
|
if (this.pan.letItGo === !1 && (this.pan.letItGo = Math.abs(this.pan.startY - t.Y) < Math.abs(this.pan.startX - t.X)), (o = this.debugger) != null && o.show && (this.debugger.DOM.touch1.style.top = `${t.Y - 10}px`, this.debugger.DOM.touch1.style.left = `${t.X - 10}px`, this.debugger.DOM.touch1.innerText = `${t.X.toFixed(2)},${t.Y.toFixed(2)}`), this.dragState > 0 && this.isScaled || this.dragState > 1) {
|
|
5148
5195
|
if (this.dragState === 1) {
|
|
@@ -5224,7 +5271,7 @@ Overscroll: ${this.pan.overscrollX.toFixed(2)},${this.pan.overscrollY.toFixed(2)
|
|
|
5224
5271
|
A > 0 && t > this.manager.threshold && this.manager.slength > this.manager.perPage ? this.manager.listener("no_less", void 0) : A < 0 && t > this.manager.threshold && this.manager.slength > this.manager.perPage && this.manager.listener("no_more", void 0), this.manager.slideToCurrent(!0, !0);
|
|
5225
5272
|
}
|
|
5226
5273
|
}
|
|
5227
|
-
class
|
|
5274
|
+
class hn {
|
|
5228
5275
|
// TODO getter
|
|
5229
5276
|
constructor(A) {
|
|
5230
5277
|
this.shift = !0, this.spreads = [], this.nLandscape = 0, this.index(A), this.testShift(A), console.log(`Indexed ${this.spreads.length} spreads for ${A.readingOrder.items.length} items`);
|
|
@@ -5236,14 +5283,14 @@ class qi {
|
|
|
5236
5283
|
number: n + 1,
|
|
5237
5284
|
isImage: ((s = e.type) == null ? void 0 : s.indexOf("image/")) === 0
|
|
5238
5285
|
}));
|
|
5239
|
-
const r = ((o = e.properties) == null ? void 0 : o.getOrientation()) ===
|
|
5286
|
+
const r = ((o = e.properties) == null ? void 0 : o.getOrientation()) === q.landscape;
|
|
5240
5287
|
(!((a = e.properties) != null && a.getPage()) || t) && (e.properties = (h = e.properties) == null ? void 0 : h.add({
|
|
5241
5288
|
page: r ? (
|
|
5242
5289
|
// If a landscape image
|
|
5243
5290
|
"center"
|
|
5244
5291
|
) : (
|
|
5245
5292
|
// Center it
|
|
5246
|
-
((this.shift ? 0 : 1) + n - this.nLandscape) % 2 ? A.metadata.readingProgression ===
|
|
5293
|
+
((this.shift ? 0 : 1) + n - this.nLandscape) % 2 ? A.metadata.readingProgression === F.rtl ? "right" : "left" : A.metadata.readingProgression === F.rtl ? "left" : "right"
|
|
5247
5294
|
)
|
|
5248
5295
|
})), (r || (c = e.properties) != null && c.otherProperties.addBlank) && this.nLandscape++;
|
|
5249
5296
|
}), t && (this.spreads = []), this.buildSpreads(A.readingOrder);
|
|
@@ -5255,14 +5302,14 @@ class qi {
|
|
|
5255
5302
|
if (e.length > 1)
|
|
5256
5303
|
return;
|
|
5257
5304
|
const r = e[0], s = (o = r.properties) == null ? void 0 : o.getOrientation();
|
|
5258
|
-
n === 0 && (s ===
|
|
5305
|
+
n === 0 && (s === q.landscape || s !== q.portrait && ((r.width || 0) > (r.height || 0) || ((a = r.properties) == null ? void 0 : a.getSpread()) === wA.both)) && (this.shift = !1), t && ((h = r.properties) == null ? void 0 : h.getPage()) === D.center && this.spreads[n - 1][0].addProperties({ addBlank: !0 }), s === q.portrait && ((c = r.properties) == null ? void 0 : c.getPage()) !== "center" && ((l = r.properties) == null ? void 0 : l.otherProperties.number) > 1 ? t = !0 : t = !1;
|
|
5259
5306
|
}), this.shift || this.index(A, !0);
|
|
5260
5307
|
}
|
|
5261
5308
|
buildSpreads(A) {
|
|
5262
5309
|
let t = [];
|
|
5263
5310
|
A.items.forEach((e, n) => {
|
|
5264
5311
|
var r;
|
|
5265
|
-
!n && this.shift ? this.spreads.push([e]) : ((r = e.properties) == null ? void 0 : r.getPage()) ===
|
|
5312
|
+
!n && this.shift ? this.spreads.push([e]) : ((r = e.properties) == null ? void 0 : r.getPage()) === D.center ? (t.length > 0 && this.spreads.push(t), this.spreads.push([e]), t = []) : t.length >= 2 ? (this.spreads.push(t), t = [e]) : t.push(e);
|
|
5266
5313
|
}), t.length > 0 && this.spreads.push(t);
|
|
5267
5314
|
}
|
|
5268
5315
|
currentSpread(A, t) {
|
|
@@ -5272,16 +5319,16 @@ class qi {
|
|
|
5272
5319
|
return this.spreads.find((t) => t.includes(A)) || void 0;
|
|
5273
5320
|
}
|
|
5274
5321
|
}
|
|
5275
|
-
const
|
|
5276
|
-
class
|
|
5322
|
+
const Dt = 8, Ht = 5, cn = 300, ln = 15e3, gn = 250, dn = 150, Mn = 500;
|
|
5323
|
+
class un {
|
|
5277
5324
|
constructor(A, t, e) {
|
|
5278
5325
|
var n;
|
|
5279
|
-
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.width = 0, this.height = 0, this.transform = "", this.currentSlide = 0, this.spread = !0, this.orientationInternal = -1, this.container = A, this.positions = t, this.pub = e, this.spreadPresentation = ((n = e.metadata.getPresentation()) == null ? void 0 : n.spread) || wA.auto, this.pub.metadata.effectiveReadingProgression !==
|
|
5326
|
+
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.width = 0, this.height = 0, this.transform = "", this.currentSlide = 0, this.spread = !0, this.orientationInternal = -1, this.container = A, this.positions = t, this.pub = e, this.spreadPresentation = ((n = e.metadata.getPresentation()) == null ? void 0 : n.spread) || wA.auto, this.pub.metadata.effectiveReadingProgression !== F.rtl && this.pub.metadata.effectiveReadingProgression !== F.ltr)
|
|
5280
5327
|
throw Error("Unsupported reading progression for EPUB");
|
|
5281
|
-
this.spreader = new
|
|
5328
|
+
this.spreader = new hn(this.pub), this.containerHeightCached = A.clientHeight, this.resizeBoundHandler = this.nativeResizeHandler.bind(this), this.ownerWindow.addEventListener("resize", this.resizeBoundHandler), this.ownerWindow.addEventListener("orientationchange", this.resizeBoundHandler), 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 an(this), this.pub.readingOrder.items.forEach((r) => {
|
|
5282
5329
|
var o, a;
|
|
5283
|
-
const s = new
|
|
5284
|
-
this.spineElement.appendChild(s.element), this.pool.set(r.href, s), s.width = 100 / this.length * (((o = r.properties) == null ? void 0 : o.getOrientation()) ===
|
|
5330
|
+
const s = new tn(this.peripherals, this.pub.metadata.effectiveReadingProgression, r.href);
|
|
5331
|
+
this.spineElement.appendChild(s.element), this.pool.set(r.href, s), s.width = 100 / this.length * (((o = r.properties) == null ? void 0 : o.getOrientation()) === q.landscape || (a = r.properties) != null && a.otherProperties.addBlank ? this.perPage : 1), s.height = this.height;
|
|
5285
5332
|
});
|
|
5286
5333
|
}
|
|
5287
5334
|
set listener(A) {
|
|
@@ -5305,12 +5352,12 @@ class nn {
|
|
|
5305
5352
|
var a, h;
|
|
5306
5353
|
let r = this.pub.readingOrder.items.findIndex((c) => c.href === n);
|
|
5307
5354
|
const s = this.pub.readingOrder.items[r];
|
|
5308
|
-
if (e.width = 100 / this.length * (((a = s.properties) == null ? void 0 : a.getOrientation()) ===
|
|
5355
|
+
if (e.width = 100 / this.length * (((a = s.properties) == null ? void 0 : a.getOrientation()) === q.landscape || (h = s.properties) != null && h.otherProperties.addBlank ? this.perPage : 1), e.height = this.height, !e.loaded)
|
|
5309
5356
|
return;
|
|
5310
5357
|
const o = this.spreader.findByLink(s);
|
|
5311
5358
|
e.update(this.spreadPosition(o, s));
|
|
5312
5359
|
});
|
|
5313
|
-
},
|
|
5360
|
+
}, gn);
|
|
5314
5361
|
}
|
|
5315
5362
|
/**
|
|
5316
5363
|
* It is important that these values be cached to avoid spamming them on redraws, they are expensive.
|
|
@@ -5319,7 +5366,7 @@ class nn {
|
|
|
5319
5366
|
this.width = this.bookElement.clientWidth, this.height = this.bookElement.clientHeight;
|
|
5320
5367
|
}
|
|
5321
5368
|
get rtl() {
|
|
5322
|
-
return this.pub.metadata.effectiveReadingProgression ===
|
|
5369
|
+
return this.pub.metadata.effectiveReadingProgression === F.rtl;
|
|
5323
5370
|
}
|
|
5324
5371
|
get single() {
|
|
5325
5372
|
return !this.spread || this.portrait;
|
|
@@ -5337,7 +5384,7 @@ class nn {
|
|
|
5337
5384
|
let e = "0";
|
|
5338
5385
|
this.updateDimensions(), this.perPage > 1 && (e = `${this.width / 2}px`);
|
|
5339
5386
|
const n = {
|
|
5340
|
-
transition: A ? `all ${t ?
|
|
5387
|
+
transition: A ? `all ${t ? dn : Mn}ms ease-out` : "all 0ms ease-out",
|
|
5341
5388
|
marginRight: this.rtl ? e : "0",
|
|
5342
5389
|
marginLeft: this.rtl ? "0" : e,
|
|
5343
5390
|
width: `${this.width / this.perPage * this.length}px`,
|
|
@@ -5475,7 +5522,7 @@ class nn {
|
|
|
5475
5522
|
return A % 2 && !this.single && A++, A;
|
|
5476
5523
|
}
|
|
5477
5524
|
spreadPosition(A, t) {
|
|
5478
|
-
return this.perPage < 2 || A.length < 2 ?
|
|
5525
|
+
return this.perPage < 2 || A.length < 2 ? D.center : t.href === A[0].href ? this.rtl ? D.right : D.left : this.rtl ? D.left : D.right;
|
|
5479
5526
|
}
|
|
5480
5527
|
async waitForItem(A) {
|
|
5481
5528
|
if (this.inprogress.has(A) && await this.inprogress.get(A), this.delayedShow.has(A)) {
|
|
@@ -5501,7 +5548,7 @@ class nn {
|
|
|
5501
5548
|
const o = new Promise(async (a, h) => {
|
|
5502
5549
|
const c = [], l = [];
|
|
5503
5550
|
this.positions.forEach((m, B) => {
|
|
5504
|
-
(B > r +
|
|
5551
|
+
(B > r + Dt || B < r - Dt) && (c.includes(m.href) || c.push(m.href)), B < r + Ht && B > r - Ht && (l.includes(m.href) || l.push(m.href));
|
|
5505
5552
|
}), c.forEach(async (m) => {
|
|
5506
5553
|
var B;
|
|
5507
5554
|
l.includes(m) || this.pool.has(m) && (this.cancelShowing(m), await ((B = this.pool.get(m)) == null ? void 0 : B.unload()));
|
|
@@ -5510,19 +5557,19 @@ class nn {
|
|
|
5510
5557
|
const B = A.readingOrder.findIndexWithHref(m), I = A.readingOrder.items[B];
|
|
5511
5558
|
if (I) {
|
|
5512
5559
|
if (!this.blobs.has(m)) {
|
|
5513
|
-
const p = await new
|
|
5560
|
+
const p = await new Kt(A, this.currentBaseURL || "", I).build(!0);
|
|
5514
5561
|
this.blobs.set(m, p);
|
|
5515
5562
|
}
|
|
5516
5563
|
this.delayedShow.has(m) || this.delayedShow.set(m, new Promise((E, p) => {
|
|
5517
5564
|
let f = !1;
|
|
5518
5565
|
const w = window.setTimeout(async () => {
|
|
5519
5566
|
this.delayedTimeout.set(m, 0);
|
|
5520
|
-
const R = this.makeSpread(this.reAlign(B)),
|
|
5521
|
-
await
|
|
5522
|
-
},
|
|
5567
|
+
const R = this.makeSpread(this.reAlign(B)), AA = this.spreadPosition(R, I), O = this.pool.get(m);
|
|
5568
|
+
await O.load(e, this.blobs.get(m)), this.peripherals.isScaled || await O.show(AA), this.delayedShow.delete(m), f = !0, E();
|
|
5569
|
+
}, cn);
|
|
5523
5570
|
setTimeout(() => {
|
|
5524
5571
|
!f && this.delayedShow.has(m) && p(`Offscreen load timeout: ${m}`);
|
|
5525
|
-
},
|
|
5572
|
+
}, ln), this.delayedTimeout.set(m, w);
|
|
5526
5573
|
}));
|
|
5527
5574
|
}
|
|
5528
5575
|
};
|
|
@@ -5591,11 +5638,11 @@ class nn {
|
|
|
5591
5638
|
(A = this.currentFrames) == null || A.forEach((t) => t == null ? void 0 : t.deselect());
|
|
5592
5639
|
}
|
|
5593
5640
|
}
|
|
5594
|
-
function
|
|
5641
|
+
function G(i) {
|
|
5595
5642
|
if (typeof i != "string")
|
|
5596
5643
|
throw new TypeError("Path must be a string. Received " + JSON.stringify(i));
|
|
5597
5644
|
}
|
|
5598
|
-
function
|
|
5645
|
+
function Gt(i, A) {
|
|
5599
5646
|
for (var t = "", e = 0, n = -1, r = 0, s, o = 0; o <= i.length; ++o) {
|
|
5600
5647
|
if (o < i.length)
|
|
5601
5648
|
s = i.charCodeAt(o);
|
|
@@ -5628,39 +5675,39 @@ function Ht(i, A) {
|
|
|
5628
5675
|
}
|
|
5629
5676
|
return t;
|
|
5630
5677
|
}
|
|
5631
|
-
function
|
|
5678
|
+
function mn(i, A) {
|
|
5632
5679
|
var t = A.dir || A.root, e = A.base || (A.name || "") + (A.ext || "");
|
|
5633
5680
|
return t ? t === A.root ? t + e : t + i + e : e;
|
|
5634
5681
|
}
|
|
5635
|
-
var
|
|
5682
|
+
var sA = {
|
|
5636
5683
|
// path.resolve([from ...], to)
|
|
5637
5684
|
resolve: function() {
|
|
5638
5685
|
for (var A = "", t = !1, e, n = arguments.length - 1; n >= -1 && !t; n--) {
|
|
5639
5686
|
var r;
|
|
5640
|
-
n >= 0 ? r = arguments[n] : (e === void 0 && (e = process.cwd()), r = e),
|
|
5687
|
+
n >= 0 ? r = arguments[n] : (e === void 0 && (e = process.cwd()), r = e), G(r), r.length !== 0 && (A = r + "/" + A, t = r.charCodeAt(0) === 47);
|
|
5641
5688
|
}
|
|
5642
|
-
return A =
|
|
5689
|
+
return A = Gt(A, !t), t ? A.length > 0 ? "/" + A : "/" : A.length > 0 ? A : ".";
|
|
5643
5690
|
},
|
|
5644
5691
|
normalize: function(A) {
|
|
5645
|
-
if (
|
|
5692
|
+
if (G(A), A.length === 0)
|
|
5646
5693
|
return ".";
|
|
5647
5694
|
var t = A.charCodeAt(0) === 47, e = A.charCodeAt(A.length - 1) === 47;
|
|
5648
|
-
return A =
|
|
5695
|
+
return A = Gt(A, !t), A.length === 0 && !t && (A = "."), A.length > 0 && e && (A += "/"), t ? "/" + A : A;
|
|
5649
5696
|
},
|
|
5650
5697
|
isAbsolute: function(A) {
|
|
5651
|
-
return
|
|
5698
|
+
return G(A), A.length > 0 && A.charCodeAt(0) === 47;
|
|
5652
5699
|
},
|
|
5653
5700
|
join: function() {
|
|
5654
5701
|
if (arguments.length === 0)
|
|
5655
5702
|
return ".";
|
|
5656
5703
|
for (var A, t = 0; t < arguments.length; ++t) {
|
|
5657
5704
|
var e = arguments[t];
|
|
5658
|
-
|
|
5705
|
+
G(e), e.length > 0 && (A === void 0 ? A = e : A += "/" + e);
|
|
5659
5706
|
}
|
|
5660
|
-
return A === void 0 ? "." :
|
|
5707
|
+
return A === void 0 ? "." : sA.normalize(A);
|
|
5661
5708
|
},
|
|
5662
5709
|
relative: function(A, t) {
|
|
5663
|
-
if (
|
|
5710
|
+
if (G(A), G(t), A === t || (A = sA.resolve(A), t = sA.resolve(t), A === t))
|
|
5664
5711
|
return "";
|
|
5665
5712
|
for (var e = 1; e < A.length && A.charCodeAt(e) === 47; ++e)
|
|
5666
5713
|
;
|
|
@@ -5691,7 +5738,7 @@ var iA = {
|
|
|
5691
5738
|
return A;
|
|
5692
5739
|
},
|
|
5693
5740
|
dirname: function(A) {
|
|
5694
|
-
if (
|
|
5741
|
+
if (G(A), A.length === 0)
|
|
5695
5742
|
return ".";
|
|
5696
5743
|
for (var t = A.charCodeAt(0), e = t === 47, n = -1, r = !0, s = A.length - 1; s >= 1; --s)
|
|
5697
5744
|
if (t = A.charCodeAt(s), t === 47) {
|
|
@@ -5706,7 +5753,7 @@ var iA = {
|
|
|
5706
5753
|
basename: function(A, t) {
|
|
5707
5754
|
if (t !== void 0 && typeof t != "string")
|
|
5708
5755
|
throw new TypeError('"ext" argument must be a string');
|
|
5709
|
-
|
|
5756
|
+
G(A);
|
|
5710
5757
|
var e = 0, n = -1, r = !0, s;
|
|
5711
5758
|
if (t !== void 0 && t.length > 0 && t.length <= A.length) {
|
|
5712
5759
|
if (t.length === A.length && t === A)
|
|
@@ -5736,7 +5783,7 @@ var iA = {
|
|
|
5736
5783
|
}
|
|
5737
5784
|
},
|
|
5738
5785
|
extname: function(A) {
|
|
5739
|
-
|
|
5786
|
+
G(A);
|
|
5740
5787
|
for (var t = -1, e = 0, n = -1, r = !0, s = 0, o = A.length - 1; o >= 0; --o) {
|
|
5741
5788
|
var a = A.charCodeAt(o);
|
|
5742
5789
|
if (a === 47) {
|
|
@@ -5755,10 +5802,10 @@ var iA = {
|
|
|
5755
5802
|
format: function(A) {
|
|
5756
5803
|
if (A === null || typeof A != "object")
|
|
5757
5804
|
throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof A);
|
|
5758
|
-
return
|
|
5805
|
+
return mn("/", A);
|
|
5759
5806
|
},
|
|
5760
5807
|
parse: function(A) {
|
|
5761
|
-
|
|
5808
|
+
G(A);
|
|
5762
5809
|
var t = { root: "", dir: "", base: "", ext: "", name: "" };
|
|
5763
5810
|
if (A.length === 0)
|
|
5764
5811
|
return t;
|
|
@@ -5783,9 +5830,9 @@ var iA = {
|
|
|
5783
5830
|
win32: null,
|
|
5784
5831
|
posix: null
|
|
5785
5832
|
};
|
|
5786
|
-
|
|
5787
|
-
var
|
|
5788
|
-
const
|
|
5833
|
+
sA.posix = sA;
|
|
5834
|
+
var vt = sA;
|
|
5835
|
+
const Bn = (i) => ({
|
|
5789
5836
|
frameLoaded: i.frameLoaded || (() => {
|
|
5790
5837
|
}),
|
|
5791
5838
|
positionChanged: i.positionChanged || (() => {
|
|
@@ -5802,9 +5849,9 @@ const sn = (i) => ({
|
|
|
5802
5849
|
textSelected: i.textSelected || (() => {
|
|
5803
5850
|
})
|
|
5804
5851
|
});
|
|
5805
|
-
class
|
|
5852
|
+
class Ye extends We {
|
|
5806
5853
|
constructor(A, t, e, n = [], r = void 0) {
|
|
5807
|
-
super(), this.pub = t, this.layout =
|
|
5854
|
+
super(), this.pub = t, this.layout = Ye.determineLayout(t), this.currentProgression = t.metadata.effectiveReadingProgression, this.container = A, this.listeners = Bn(e), this.currentLocation = r, n.length && (this.positions = n);
|
|
5808
5855
|
}
|
|
5809
5856
|
static determineLayout(A) {
|
|
5810
5857
|
var e;
|
|
@@ -5813,9 +5860,9 @@ class ye extends je {
|
|
|
5813
5860
|
}
|
|
5814
5861
|
async load() {
|
|
5815
5862
|
var A;
|
|
5816
|
-
(A = this.positions) != null && A.length || (this.positions = await this.pub.positionsFromManifest()), this.layout === Y.fixed ? (this.framePool = new
|
|
5863
|
+
(A = this.positions) != null && A.length || (this.positions = await this.pub.positionsFromManifest()), this.layout === Y.fixed ? (this.framePool = new un(this.container, this.positions, this.pub), this.framePool.listener = (t, e) => {
|
|
5817
5864
|
this.eventListener(t, e);
|
|
5818
|
-
}) : this.framePool = new
|
|
5865
|
+
}) : this.framePool = new An(this.container, this.positions), this.currentLocation === void 0 && (this.currentLocation = this.positions[0]), await this.apply();
|
|
5819
5866
|
}
|
|
5820
5867
|
/**
|
|
5821
5868
|
* Exposed to the public to compensate for lack of implemented readium conveniences
|
|
@@ -5843,10 +5890,10 @@ class ye extends je {
|
|
|
5843
5890
|
this.listeners.frameLoaded(this._cframes[0].iframe.contentWindow), this.listeners.positionChanged(this.currentLocation);
|
|
5844
5891
|
break;
|
|
5845
5892
|
case "first_visible_locator":
|
|
5846
|
-
const h =
|
|
5893
|
+
const h = GA.deserialize(t);
|
|
5847
5894
|
if (!h)
|
|
5848
5895
|
break;
|
|
5849
|
-
this.currentLocation = new
|
|
5896
|
+
this.currentLocation = new GA({
|
|
5850
5897
|
href: this.currentLocation.href,
|
|
5851
5898
|
type: this.currentLocation.type,
|
|
5852
5899
|
title: this.currentLocation.title,
|
|
@@ -5873,30 +5920,30 @@ class ye extends je {
|
|
|
5873
5920
|
}), !1, () => {
|
|
5874
5921
|
});
|
|
5875
5922
|
else if (g.startsWith("http://") || g.startsWith("https://") || g.startsWith("mailto:") || g.startsWith("tel:"))
|
|
5876
|
-
this.listeners.handleLocator(new
|
|
5923
|
+
this.listeners.handleLocator(new b({
|
|
5877
5924
|
href: g
|
|
5878
5925
|
}).locator);
|
|
5879
5926
|
else
|
|
5880
5927
|
try {
|
|
5881
|
-
this.goLink(new
|
|
5882
|
-
href:
|
|
5928
|
+
this.goLink(new b({
|
|
5929
|
+
href: vt.join(vt.dirname(this.currentLocation.href), g)
|
|
5883
5930
|
}), !1, () => {
|
|
5884
5931
|
});
|
|
5885
5932
|
} catch (u) {
|
|
5886
|
-
console.warn(`Couldn't go to link for ${g}: ${u}`), this.listeners.handleLocator(new
|
|
5933
|
+
console.warn(`Couldn't go to link for ${g}: ${u}`), this.listeners.handleLocator(new b({
|
|
5887
5934
|
href: g
|
|
5888
5935
|
}).locator);
|
|
5889
5936
|
}
|
|
5890
5937
|
} else
|
|
5891
5938
|
console.log("Clicked on", l);
|
|
5892
5939
|
} else {
|
|
5893
|
-
if (this.layout === Y.fixed && this.framePool.doNotDisturb && (c.doNotDisturb = !0), this.layout === Y.fixed && (this.currentProgression ===
|
|
5940
|
+
if (this.layout === Y.fixed && this.framePool.doNotDisturb && (c.doNotDisturb = !0), this.layout === Y.fixed && (this.currentProgression === F.rtl || this.currentProgression === F.ltr) && this.framePool.currentFrames.length > 1) {
|
|
5894
5941
|
const u = this.framePool.currentFrames;
|
|
5895
|
-
c.targetFrameSrc === ((n = u[this.currentProgression ===
|
|
5942
|
+
c.targetFrameSrc === ((n = u[this.currentProgression === F.rtl ? 0 : 1]) == null ? void 0 : n.source) && (c.x += (((s = (r = u[this.currentProgression === F.rtl ? 1 : 0]) == null ? void 0 : r.iframe.contentWindow) == null ? void 0 : s.innerWidth) ?? 0) * window.devicePixelRatio);
|
|
5896
5943
|
}
|
|
5897
5944
|
if (A === "click" ? this.listeners.click(c) : this.listeners.tap(c))
|
|
5898
5945
|
break;
|
|
5899
|
-
if (this.currentProgression ===
|
|
5946
|
+
if (this.currentProgression === F.ttb || this.currentProgression === F.btt)
|
|
5900
5947
|
return;
|
|
5901
5948
|
const g = (this._cframes.length === 2 ? this._cframes[0].window.innerWidth + this._cframes[1].window.innerWidth : this._cframes[0].window.innerWidth) * window.devicePixelRatio / 4;
|
|
5902
5949
|
c.x >= g && c.x <= g * 3 && this.listeners.miscPointer(1), c.x < g ? this.goLeft(!1, () => {
|
|
@@ -5930,8 +5977,8 @@ class ye extends je {
|
|
|
5930
5977
|
}
|
|
5931
5978
|
}
|
|
5932
5979
|
determineModules() {
|
|
5933
|
-
let A = Array.from(
|
|
5934
|
-
return this.layout === Y.fixed ? A.filter((t) =>
|
|
5980
|
+
let A = Array.from(XA.keys());
|
|
5981
|
+
return this.layout === Y.fixed ? A.filter((t) => Ki.includes(t)) : (A = A.filter((t) => qi.includes(t)), this.readingProgression === F.ttb || this.readingProgression === F.btt ? A = A.filter((t) => t !== "column_snapper") : A = A.filter((t) => t !== "scroll_snapper"), A);
|
|
5935
5982
|
}
|
|
5936
5983
|
// Start listening to messages from the current iframe
|
|
5937
5984
|
attachListener() {
|
|
@@ -6121,7 +6168,7 @@ class ye extends je {
|
|
|
6121
6168
|
return this.go(A.locator, t, e);
|
|
6122
6169
|
}
|
|
6123
6170
|
}
|
|
6124
|
-
class
|
|
6171
|
+
class En {
|
|
6125
6172
|
constructor(A) {
|
|
6126
6173
|
var t;
|
|
6127
6174
|
this.sourceNode = null, this.listeners = {}, this.isMutedValue = !1, this.isPlayingValue = !1, this.isPausedValue = !1, this.isLoadingValue = !1, this.isLoadedValue = !1, this.isEndedValue = !1, this.playback = A.playback, this.audioContext = A.audioContext, this.gainNode = (t = this.audioContext) == null ? void 0 : t.createGain(), this.setVolume(this.playback.state.volume), this.mediaElement = document.createElement("audio"), this.mediaElement.crossOrigin = "use-credentials", this.mediaElement.addEventListener(
|
|
@@ -6296,18 +6343,19 @@ class on {
|
|
|
6296
6343
|
}
|
|
6297
6344
|
}
|
|
6298
6345
|
export {
|
|
6299
|
-
|
|
6300
|
-
|
|
6301
|
-
|
|
6302
|
-
|
|
6303
|
-
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
|
|
6310
|
-
|
|
6311
|
-
|
|
6312
|
-
|
|
6346
|
+
Ye as EpubNavigator,
|
|
6347
|
+
sn as FXLCoordinator,
|
|
6348
|
+
tn as FXLFrameManager,
|
|
6349
|
+
un as FXLFramePoolManager,
|
|
6350
|
+
an as FXLPeripherals,
|
|
6351
|
+
hn as FXLSpreader,
|
|
6352
|
+
Re as FrameComms,
|
|
6353
|
+
$i as FrameManager,
|
|
6354
|
+
An as FramePoolManager,
|
|
6355
|
+
nn as HorizontalThird,
|
|
6356
|
+
ke as Navigator,
|
|
6357
|
+
rn as VerticalThird,
|
|
6358
|
+
We as VisualNavigator,
|
|
6359
|
+
En as WebAudioEngine,
|
|
6360
|
+
DA as sML
|
|
6313
6361
|
};
|