@prose-reader/core 1.258.0 → 1.260.0
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.d.ts +1 -0
- package/dist/index.js +674 -674
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +21 -21
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { switchMap as w, of as v, fromEvent as q, take as
|
|
2
|
-
import { Report as
|
|
3
|
-
import { isShallowEqual as
|
|
4
|
-
import { map as
|
|
5
|
-
import { generate as ze, parse as
|
|
6
|
-
|
|
7
|
-
const Tn = "@prose-reader/core", D = hn.namespace(Tn, void 0, {
|
|
1
|
+
import { switchMap as w, of as v, fromEvent as q, take as $t, map as S, from as N, takeUntil as T, Observable as ie, defer as ke, Subject as R, combineLatest as k, merge as P, EMPTY as Z, NEVER as ge, tap as x, share as E, BehaviorSubject as H, withLatestFrom as O, filter as L, first as U, mergeMap as $e, endWith as me, finalize as de, catchError as Tt, lastValueFrom as rn, scheduled as an, animationFrameScheduler as ae, exhaustMap as Ue, debounceTime as Se, distinctUntilChanged as z, throttleTime as cn, startWith as te, shareReplay as K, switchScan as un, defaultIfEmpty as ln, forkJoin as dn, delay as we, timer as Te, skip as Ft, ReplaySubject as ot, identity as Pe, reduce as pn, concatMap as st } from "rxjs";
|
|
2
|
+
import { Report as gn, isShallowEqual as V, shallowMergeIfDefined as xe, getParentPath as hn, parseContentType as mn, detectMimeTypeFromName as Me, arrayEqual as fn } from "@prose-reader/shared";
|
|
3
|
+
import { isShallowEqual as or } from "@prose-reader/shared";
|
|
4
|
+
import { map as Q, distinctUntilChanged as pe, switchMap as _, first as Lt, startWith as yn, shareReplay as Ce, tap as j, pairwise as Sn, take as bn, takeUntil as G, filter as re, debounceTime as In, skip as Mt, mergeMap as vn, catchError as rt } from "rxjs/operators";
|
|
5
|
+
import { generate as ze, parse as Ct, isIndirectionOnly as wn, isParsedCfiRange as Pn, resolve as xn } from "@prose-reader/cfi";
|
|
6
|
+
const $n = "@prose-reader/core", D = gn.namespace($n, void 0, {
|
|
8
7
|
color: "#98cde7"
|
|
9
|
-
}),
|
|
8
|
+
}), Tn = [
|
|
10
9
|
"pointercancel",
|
|
11
10
|
"pointerdown",
|
|
12
11
|
"pointerenter",
|
|
@@ -18,24 +17,24 @@ const Tn = "@prose-reader/core", D = hn.namespace(Tn, void 0, {
|
|
|
18
17
|
// `touchstart` as const,
|
|
19
18
|
// `touchend` as const,
|
|
20
19
|
];
|
|
21
|
-
function
|
|
20
|
+
function Fn(n, e, t) {
|
|
22
21
|
if ("caretPositionFromPoint" in n)
|
|
23
22
|
return n.caretPositionFromPoint(e, t);
|
|
24
23
|
if ("caretRangeFromPoint" in n && // @ts-expect-error limited availability
|
|
25
24
|
typeof n.caretRangeFromPoint < "u")
|
|
26
25
|
return n.caretRangeFromPoint(e, t);
|
|
27
26
|
}
|
|
28
|
-
const
|
|
27
|
+
const Ln = (n, e) => {
|
|
29
28
|
const t = "body" in n ? We(n.body, e) : We(n, e), i = "createRange" in n ? n : n.ownerDocument;
|
|
30
29
|
if (t) {
|
|
31
30
|
let o, s = 0;
|
|
32
31
|
const r = i.createRange();
|
|
33
32
|
return Array.from(t.childNodes).some((a) => {
|
|
34
33
|
r.selectNodeContents(a);
|
|
35
|
-
const c = r.getClientRects(), u =
|
|
34
|
+
const c = r.getClientRects(), u = Mn(c, e);
|
|
36
35
|
if (u) {
|
|
37
36
|
o = r.cloneRange();
|
|
38
|
-
const l =
|
|
37
|
+
const l = Fn(
|
|
39
38
|
i,
|
|
40
39
|
Math.ceil(u.left),
|
|
41
40
|
Math.ceil(u.top)
|
|
@@ -49,7 +48,7 @@ const Mn = (n, e) => {
|
|
|
49
48
|
} : { node: t, offset: 0 };
|
|
50
49
|
}
|
|
51
50
|
}, We = (n, e) => {
|
|
52
|
-
const t = n.getBoundingClientRect(), i =
|
|
51
|
+
const t = n.getBoundingClientRect(), i = Et(
|
|
53
52
|
t,
|
|
54
53
|
e
|
|
55
54
|
);
|
|
@@ -62,16 +61,16 @@ const Mn = (n, e) => {
|
|
|
62
61
|
}
|
|
63
62
|
return o;
|
|
64
63
|
};
|
|
65
|
-
function
|
|
64
|
+
function Et(n, { left: e, right: t }) {
|
|
66
65
|
return n.left <= e && n.right <= e ? "before" : n.left <= e && n.right > e && n.right <= t ? "partially-before" : n.left <= t && n.right > t ? "partially-after" : n.left > t ? "after" : "within";
|
|
67
66
|
}
|
|
68
|
-
function
|
|
67
|
+
function Mn(n, e) {
|
|
69
68
|
return Array.from(n).find((t) => {
|
|
70
|
-
const i =
|
|
69
|
+
const i = Et(t, e);
|
|
71
70
|
return i !== "before" && i !== "after";
|
|
72
71
|
});
|
|
73
72
|
}
|
|
74
|
-
const
|
|
73
|
+
const Cn = (n, e) => {
|
|
75
74
|
if (n.nodeType !== Node.CDATA_SECTION_NODE && n.nodeType !== Node.DOCUMENT_TYPE_NODE) {
|
|
76
75
|
const t = n.ownerDocument?.createRange();
|
|
77
76
|
t?.selectNodeContents(n);
|
|
@@ -82,7 +81,7 @@ const En = (n, e) => {
|
|
|
82
81
|
}
|
|
83
82
|
return t;
|
|
84
83
|
}
|
|
85
|
-
},
|
|
84
|
+
}, Ge = (n) => {
|
|
86
85
|
if (n?.target && n?.target?.ownerDocument?.defaultView) {
|
|
87
86
|
const e = n?.target?.ownerDocument?.defaultView;
|
|
88
87
|
if (e.PointerEvent && n instanceof e.PointerEvent)
|
|
@@ -93,9 +92,9 @@ const En = (n, e) => {
|
|
|
93
92
|
if (e.PointerEvent && n instanceof e.PointerEvent)
|
|
94
93
|
return !0;
|
|
95
94
|
}
|
|
96
|
-
return !!
|
|
97
|
-
},
|
|
98
|
-
if (
|
|
95
|
+
return !!Tn.includes(n.type);
|
|
96
|
+
}, En = (n) => {
|
|
97
|
+
if (Ge(n)) return !1;
|
|
99
98
|
if (n?.target && n?.target?.ownerDocument?.defaultView) {
|
|
100
99
|
const e = n?.target?.ownerDocument?.defaultView;
|
|
101
100
|
if (e.MouseEvent)
|
|
@@ -107,7 +106,7 @@ const En = (n, e) => {
|
|
|
107
106
|
return n instanceof e.MouseEvent;
|
|
108
107
|
}
|
|
109
108
|
return !1;
|
|
110
|
-
},
|
|
109
|
+
}, Dn = (n) => {
|
|
111
110
|
if (n?.target && n?.target?.ownerDocument?.defaultView) {
|
|
112
111
|
const e = n?.target?.ownerDocument?.defaultView;
|
|
113
112
|
if (e.TouchEvent)
|
|
@@ -119,7 +118,7 @@ const En = (n, e) => {
|
|
|
119
118
|
return n instanceof e.TouchEvent;
|
|
120
119
|
}
|
|
121
120
|
return !1;
|
|
122
|
-
},
|
|
121
|
+
}, Rn = () => document.createElement("div"), Dt = (n) => {
|
|
123
122
|
const e = [
|
|
124
123
|
"img",
|
|
125
124
|
// Images
|
|
@@ -135,8 +134,8 @@ const En = (n, e) => {
|
|
|
135
134
|
// JavaScript files
|
|
136
135
|
].join(",");
|
|
137
136
|
return Array.from(n?.querySelectorAll(e) || []);
|
|
138
|
-
},
|
|
139
|
-
if (
|
|
137
|
+
}, An = (n) => {
|
|
138
|
+
if (Dt(n).forEach((t) => {
|
|
140
139
|
const i = t.getAttribute("src") || t.getAttribute("href");
|
|
141
140
|
i?.startsWith("blob:") && n?.defaultView?.URL.revokeObjectURL(i);
|
|
142
141
|
}), n) {
|
|
@@ -153,7 +152,7 @@ const En = (n, e) => {
|
|
|
153
152
|
}
|
|
154
153
|
}
|
|
155
154
|
};
|
|
156
|
-
function
|
|
155
|
+
function Rt(n, e, t = []) {
|
|
157
156
|
if (typeof n != "object" || n === null) return !1;
|
|
158
157
|
for (const i of e)
|
|
159
158
|
if (!(i in n)) return !1;
|
|
@@ -162,19 +161,19 @@ function At(n, e, t = []) {
|
|
|
162
161
|
return !1;
|
|
163
162
|
return !0;
|
|
164
163
|
}
|
|
165
|
-
function
|
|
166
|
-
return
|
|
164
|
+
function At(n) {
|
|
165
|
+
return Rt(
|
|
167
166
|
n,
|
|
168
167
|
["nodeType"],
|
|
169
168
|
[]
|
|
170
169
|
// biome-ignore lint/suspicious/noExplicitAny: TODO
|
|
171
170
|
) && n.nodeType === Node.ELEMENT_NODE;
|
|
172
171
|
}
|
|
173
|
-
function
|
|
174
|
-
return
|
|
172
|
+
function On(n, e) {
|
|
173
|
+
return At(n) && n.tagName.toLowerCase() === e.toLowerCase();
|
|
175
174
|
}
|
|
176
|
-
function
|
|
177
|
-
return
|
|
175
|
+
function Nn(n) {
|
|
176
|
+
return Rt(
|
|
178
177
|
n,
|
|
179
178
|
[
|
|
180
179
|
"startContainer",
|
|
@@ -187,22 +186,22 @@ function Vn(n) {
|
|
|
187
186
|
["setStart", "setEnd", "selectNodeContents"]
|
|
188
187
|
);
|
|
189
188
|
}
|
|
190
|
-
const
|
|
189
|
+
const Ze = (n, e, t, i) => {
|
|
191
190
|
const o = n.createElement("style");
|
|
192
191
|
o.id = e, o.innerHTML = t, i ? n.head.prepend(o) : n.head.appendChild(o);
|
|
193
|
-
},
|
|
192
|
+
}, Je = (n, e) => {
|
|
194
193
|
if (n?.head) {
|
|
195
194
|
const t = n.getElementById(e);
|
|
196
195
|
t && t.remove();
|
|
197
196
|
}
|
|
198
|
-
},
|
|
197
|
+
}, at = (n, e) => {
|
|
199
198
|
const t = new RegExp(`${e}\\s*=\\s*([0-9.]+)`, "i"), i = n.match(t) || [], o = i[1] || "0";
|
|
200
199
|
return i && Number.parseFloat(o) || 0;
|
|
201
|
-
},
|
|
202
|
-
n?.contentDocument?.head &&
|
|
203
|
-
},
|
|
204
|
-
n?.contentDocument &&
|
|
205
|
-
},
|
|
200
|
+
}, Vn = (n, e, t, i) => {
|
|
201
|
+
n?.contentDocument?.head && Ze(n.contentDocument, e, t, i);
|
|
202
|
+
}, Bs = (n, e) => {
|
|
203
|
+
n?.contentDocument && Je(n.contentDocument, e);
|
|
204
|
+
}, ne = (n, e, t, i) => {
|
|
206
205
|
if (!n) return;
|
|
207
206
|
const o = n?.contentDocument?.getElementById(
|
|
208
207
|
e
|
|
@@ -211,14 +210,14 @@ const Je = (n, e, t, i) => {
|
|
|
211
210
|
o.innerHTML = t;
|
|
212
211
|
return;
|
|
213
212
|
}
|
|
214
|
-
|
|
215
|
-
},
|
|
213
|
+
Vn(n, e, t, i);
|
|
214
|
+
}, Ke = (n) => {
|
|
216
215
|
if (n?.contentDocument) {
|
|
217
216
|
const t = n.contentDocument.querySelector("meta[name='viewport']");
|
|
218
217
|
if (t) {
|
|
219
218
|
const i = t.getAttribute("content");
|
|
220
219
|
if (i) {
|
|
221
|
-
const o =
|
|
220
|
+
const o = at(i, "width"), s = at(i, "height");
|
|
222
221
|
return o > 0 && s > 0 ? {
|
|
223
222
|
hasViewport: !0,
|
|
224
223
|
width: o,
|
|
@@ -228,17 +227,17 @@ const Je = (n, e, t, i) => {
|
|
|
228
227
|
}
|
|
229
228
|
}
|
|
230
229
|
return { hasViewport: !1 };
|
|
231
|
-
},
|
|
230
|
+
}, jn = (n) => n.pipe(
|
|
232
231
|
w((e) => e.src === "about:blank" && e.contentDocument?.readyState === "complete" && e.contentDocument.body ? v(e) : q(e, "load").pipe(
|
|
233
|
-
|
|
232
|
+
$t(1),
|
|
234
233
|
S(() => e)
|
|
235
234
|
))
|
|
236
|
-
),
|
|
235
|
+
), kn = (n) => n.pipe(
|
|
237
236
|
w((e) => {
|
|
238
237
|
const t = e?.contentDocument?.fonts.ready;
|
|
239
238
|
return t ? N(t).pipe(S(() => e)) : v(void 0);
|
|
240
239
|
})
|
|
241
|
-
),
|
|
240
|
+
), Un = (n) => (e) => {
|
|
242
241
|
const t = n(e), i = new IntersectionObserver((o) => {
|
|
243
242
|
o.forEach((s) => {
|
|
244
243
|
s.isIntersecting ? s.target.removeAttribute("tab-index") : s.target.setAttribute("tab-index", "-1");
|
|
@@ -251,7 +250,7 @@ const Je = (n, e, t, i) => {
|
|
|
251
250
|
if (!r) return;
|
|
252
251
|
const a = r.renderer.getDocumentFrame();
|
|
253
252
|
if (!a) return;
|
|
254
|
-
|
|
253
|
+
ne(
|
|
255
254
|
a,
|
|
256
255
|
"prose-reader-accessibility",
|
|
257
256
|
`
|
|
@@ -273,7 +272,7 @@ const Je = (n, e, t, i) => {
|
|
|
273
272
|
), {
|
|
274
273
|
...t
|
|
275
274
|
};
|
|
276
|
-
},
|
|
275
|
+
}, zn = (n) => (e) => {
|
|
277
276
|
const t = n(e);
|
|
278
277
|
return t.context.watch("rootElement").pipe(T(t.context.destroy$)).subscribe((i) => {
|
|
279
278
|
if (!i) return;
|
|
@@ -294,12 +293,12 @@ const Je = (n, e, t, i) => {
|
|
|
294
293
|
clientX: a,
|
|
295
294
|
clientY: c
|
|
296
295
|
};
|
|
297
|
-
},
|
|
296
|
+
}, Wn = (n, e, t, i) => {
|
|
298
297
|
const o = e?.view?.frameElement;
|
|
299
298
|
if (!e || !o) return n;
|
|
300
299
|
const s = t.getSpineItemFromIframe(o), r = o, { height: a, width: c } = i.pageSize;
|
|
301
300
|
if (!s || !(r instanceof HTMLIFrameElement)) return n;
|
|
302
|
-
if (
|
|
301
|
+
if (Ge(n)) {
|
|
303
302
|
const { clientX: u, clientY: l } = Re({
|
|
304
303
|
position: n,
|
|
305
304
|
frameElement: r
|
|
@@ -314,7 +313,7 @@ const Je = (n, e, t, i) => {
|
|
|
314
313
|
enumerable: !0
|
|
315
314
|
}), d;
|
|
316
315
|
}
|
|
317
|
-
if (
|
|
316
|
+
if (En(n)) {
|
|
318
317
|
const { clientX: u, clientY: l } = Re({
|
|
319
318
|
position: n,
|
|
320
319
|
frameElement: r
|
|
@@ -328,7 +327,7 @@ const Je = (n, e, t, i) => {
|
|
|
328
327
|
enumerable: !0
|
|
329
328
|
}), d;
|
|
330
329
|
}
|
|
331
|
-
if (
|
|
330
|
+
if (Dn(n)) {
|
|
332
331
|
const u = Array.from(n.touches).map((d) => {
|
|
333
332
|
const { clientX: g, clientY: h } = Re({
|
|
334
333
|
position: d,
|
|
@@ -351,7 +350,7 @@ const Je = (n, e, t, i) => {
|
|
|
351
350
|
}), l;
|
|
352
351
|
}
|
|
353
352
|
return n;
|
|
354
|
-
},
|
|
353
|
+
}, _n = [
|
|
355
354
|
"pointercancel",
|
|
356
355
|
"pointerdown",
|
|
357
356
|
"pointerenter",
|
|
@@ -360,21 +359,21 @@ const Je = (n, e, t, i) => {
|
|
|
360
359
|
"pointerout",
|
|
361
360
|
"pointerover",
|
|
362
361
|
"pointerup"
|
|
363
|
-
],
|
|
364
|
-
...
|
|
362
|
+
], Hn = [
|
|
363
|
+
..._n
|
|
365
364
|
/*, ...mouseEvents*/
|
|
366
|
-
],
|
|
365
|
+
], Bn = (n) => (e) => {
|
|
367
366
|
const t = n(e);
|
|
368
367
|
return t.hookManager.register(
|
|
369
368
|
"item.onDocumentLoad",
|
|
370
369
|
({ destroy: i, itemId: o }) => {
|
|
371
370
|
const s = t.spineItemsManager.get(o), r = s?.renderer.getDocumentFrame();
|
|
372
371
|
if (!r || !s) return;
|
|
373
|
-
const a =
|
|
372
|
+
const a = Hn.map((c) => {
|
|
374
373
|
const u = (l) => {
|
|
375
374
|
let d = l;
|
|
376
|
-
if (
|
|
377
|
-
const g =
|
|
375
|
+
if (Ge(l) && (d = new PointerEvent(l.type, l)), d !== l) {
|
|
376
|
+
const g = Wn(
|
|
378
377
|
d,
|
|
379
378
|
l,
|
|
380
379
|
t.spine.locator,
|
|
@@ -394,15 +393,15 @@ const Je = (n, e, t, i) => {
|
|
|
394
393
|
});
|
|
395
394
|
}
|
|
396
395
|
), t;
|
|
397
|
-
},
|
|
396
|
+
}, Ot = (n) => Q((e) => Object.entries(e).reduce(
|
|
398
397
|
(t, [i, o]) => n.includes(i) ? {
|
|
399
398
|
...t,
|
|
400
399
|
[i]: o
|
|
401
400
|
} : t,
|
|
402
401
|
{}
|
|
403
|
-
)),
|
|
404
|
-
function
|
|
405
|
-
return new
|
|
402
|
+
)), Qe = (n) => (e) => e.pipe(Ot(n), pe(V));
|
|
403
|
+
function et(n) {
|
|
404
|
+
return new ie((e) => {
|
|
406
405
|
const t = new ResizeObserver((i) => {
|
|
407
406
|
e.next(i);
|
|
408
407
|
});
|
|
@@ -414,19 +413,19 @@ function tt(n) {
|
|
|
414
413
|
const Ee = (n) => (e) => e.pipe(
|
|
415
414
|
_(
|
|
416
415
|
(t) => n.pipe(
|
|
417
|
-
|
|
418
|
-
|
|
416
|
+
Lt(),
|
|
417
|
+
Q(() => t)
|
|
419
418
|
)
|
|
420
419
|
)
|
|
421
|
-
),
|
|
420
|
+
), Xn = (n) => {
|
|
422
421
|
let e;
|
|
423
422
|
const t = n.subscribe((i) => {
|
|
424
423
|
e = { result: i };
|
|
425
424
|
});
|
|
426
425
|
return () => (t.unsubscribe(), e ? v(e.result) : n);
|
|
427
426
|
};
|
|
428
|
-
function
|
|
429
|
-
return new
|
|
427
|
+
function Nt() {
|
|
428
|
+
return new ie((n) => {
|
|
430
429
|
if (window.requestIdleCallback) {
|
|
431
430
|
const t = window.requestIdleCallback(() => {
|
|
432
431
|
n.next(), n.complete();
|
|
@@ -439,17 +438,17 @@ function Vt() {
|
|
|
439
438
|
return () => clearTimeout(e);
|
|
440
439
|
});
|
|
441
440
|
}
|
|
442
|
-
function
|
|
443
|
-
return ke(() =>
|
|
441
|
+
function ct(n) {
|
|
442
|
+
return ke(() => Nt().pipe(_(n)));
|
|
444
443
|
}
|
|
445
|
-
const
|
|
444
|
+
const ut = (n, e) => new ie((t) => {
|
|
446
445
|
const i = new MutationObserver((o) => {
|
|
447
446
|
t.next(o);
|
|
448
447
|
});
|
|
449
448
|
return i.observe(n, e), () => i.disconnect();
|
|
450
449
|
});
|
|
451
|
-
function
|
|
452
|
-
return new
|
|
450
|
+
function Xs(n, e) {
|
|
451
|
+
return new ie((t) => {
|
|
453
452
|
const i = new IntersectionObserver((o) => {
|
|
454
453
|
t.next(o);
|
|
455
454
|
}, e);
|
|
@@ -458,7 +457,7 @@ function qs(n, e) {
|
|
|
458
457
|
};
|
|
459
458
|
});
|
|
460
459
|
}
|
|
461
|
-
class
|
|
460
|
+
class Vt {
|
|
462
461
|
constructor(e, t) {
|
|
463
462
|
this.settingsManager = t;
|
|
464
463
|
const i = xe(
|
|
@@ -470,9 +469,9 @@ class jt {
|
|
|
470
469
|
e
|
|
471
470
|
), this.outputSettingsUpdateSubject = new R(), this.values$ = k([
|
|
472
471
|
this.settingsManager.values$,
|
|
473
|
-
this.outputSettingsUpdateSubject.pipe(
|
|
472
|
+
this.outputSettingsUpdateSubject.pipe(yn(this.outputSettings))
|
|
474
473
|
]).pipe(
|
|
475
|
-
|
|
474
|
+
Q(([o, s]) => ({ ...o, ...s })),
|
|
476
475
|
Ce(1)
|
|
477
476
|
), this.values$.subscribe();
|
|
478
477
|
}
|
|
@@ -497,8 +496,8 @@ class jt {
|
|
|
497
496
|
};
|
|
498
497
|
}
|
|
499
498
|
watch(e) {
|
|
500
|
-
return Array.isArray(e) ? this.values$.pipe(
|
|
501
|
-
|
|
499
|
+
return Array.isArray(e) ? this.values$.pipe(Qe(e)) : this.values$.pipe(
|
|
500
|
+
Q((t) => t[e]),
|
|
502
501
|
pe(V)
|
|
503
502
|
);
|
|
504
503
|
}
|
|
@@ -506,7 +505,7 @@ class jt {
|
|
|
506
505
|
this.outputSettingsUpdateSubject.complete();
|
|
507
506
|
}
|
|
508
507
|
}
|
|
509
|
-
const
|
|
508
|
+
const Ys = (n) => {
|
|
510
509
|
const e = new FileReader();
|
|
511
510
|
return new Promise((t) => {
|
|
512
511
|
e.addEventListener(
|
|
@@ -518,7 +517,7 @@ const Gs = (n) => {
|
|
|
518
517
|
), e.readAsDataURL(n);
|
|
519
518
|
});
|
|
520
519
|
};
|
|
521
|
-
let
|
|
520
|
+
let Yn = class extends Vt {
|
|
522
521
|
computeOutputSettings(e) {
|
|
523
522
|
return e;
|
|
524
523
|
}
|
|
@@ -544,8 +543,8 @@ let qn = class extends jt {
|
|
|
544
543
|
};
|
|
545
544
|
}
|
|
546
545
|
};
|
|
547
|
-
const
|
|
548
|
-
const { fontScale: t, lineHeight: i, fontWeight: o, fontJustification: s } = e, r = new R(), a = n(e), c = new
|
|
546
|
+
const qn = (n) => (e) => {
|
|
547
|
+
const { fontScale: t, lineHeight: i, fontWeight: o, fontJustification: s } = e, r = new R(), a = n(e), c = new Yn(
|
|
549
548
|
{
|
|
550
549
|
fontScale: t,
|
|
551
550
|
lineHeight: i,
|
|
@@ -565,7 +564,7 @@ const Gn = (n) => (e) => {
|
|
|
565
564
|
a.spineItemsManager.items.forEach((h) => {
|
|
566
565
|
if (h.renditionLayout !== "pre-paginated") {
|
|
567
566
|
const p = h.renderer.getDocumentFrame();
|
|
568
|
-
p &&
|
|
567
|
+
p && ne(p, "prose-reader-fonts", u());
|
|
569
568
|
}
|
|
570
569
|
}), g && a.layout();
|
|
571
570
|
};
|
|
@@ -573,11 +572,11 @@ const Gn = (n) => (e) => {
|
|
|
573
572
|
const h = a.spineItemsManager.get(g);
|
|
574
573
|
if (h?.renditionLayout !== "pre-paginated") {
|
|
575
574
|
const p = h?.renderer.getDocumentFrame();
|
|
576
|
-
p &&
|
|
575
|
+
p && ne(p, "prose-reader-fonts", u());
|
|
577
576
|
}
|
|
578
577
|
});
|
|
579
578
|
const d = (g) => g.pipe(
|
|
580
|
-
|
|
579
|
+
Sn(),
|
|
581
580
|
S(([h, p]) => p.fontScale !== h.fontScale || p.lineHeight !== h.lineHeight)
|
|
582
581
|
);
|
|
583
582
|
return c.values$.pipe(
|
|
@@ -591,7 +590,7 @@ const Gn = (n) => (e) => {
|
|
|
591
590
|
},
|
|
592
591
|
settings: c
|
|
593
592
|
};
|
|
594
|
-
},
|
|
593
|
+
}, Gn = (n) => (e) => {
|
|
595
594
|
const t = n(e), i = (o) => q(o, "keyup").pipe(
|
|
596
595
|
S((s) => {
|
|
597
596
|
const { pageTurnDirection: r, computedPageTurnMode: a } = t.settings.values;
|
|
@@ -627,7 +626,7 @@ const Gn = (n) => (e) => {
|
|
|
627
626
|
),
|
|
628
627
|
T(t.$.destroy$)
|
|
629
628
|
).subscribe(), t;
|
|
630
|
-
},
|
|
629
|
+
}, Zn = (n) => n.spine.spineItemsManager.items$.pipe(
|
|
631
630
|
w(
|
|
632
631
|
(e) => P(
|
|
633
632
|
...e.map((t) => t.watch("isLoaded").pipe(
|
|
@@ -700,7 +699,7 @@ const Le = class Le extends X {
|
|
|
700
699
|
itemId: this.item.id,
|
|
701
700
|
documentContainer: s
|
|
702
701
|
}).filter(
|
|
703
|
-
(c) => c instanceof
|
|
702
|
+
(c) => c instanceof ie
|
|
704
703
|
);
|
|
705
704
|
return k([v(null), ...a]).pipe(U());
|
|
706
705
|
})
|
|
@@ -767,7 +766,7 @@ const Le = class Le extends X {
|
|
|
767
766
|
de(() => {
|
|
768
767
|
e.complete();
|
|
769
768
|
}),
|
|
770
|
-
|
|
769
|
+
Tt((t) => (D.error(t), v(void 0)))
|
|
771
770
|
);
|
|
772
771
|
}
|
|
773
772
|
layout(e) {
|
|
@@ -788,7 +787,7 @@ const Le = class Le extends X {
|
|
|
788
787
|
if (e) return e;
|
|
789
788
|
const t = this.getDocumentFrame();
|
|
790
789
|
if (t) {
|
|
791
|
-
const { hasViewport: i } =
|
|
790
|
+
const { hasViewport: i } = Ke(t);
|
|
792
791
|
if (i) return "pre-paginated";
|
|
793
792
|
}
|
|
794
793
|
return this.context.manifest?.renditionLayout ?? "reflowable";
|
|
@@ -796,25 +795,25 @@ const Le = class Le extends X {
|
|
|
796
795
|
};
|
|
797
796
|
Le.DOCUMENT_CONTAINER_CLASS_NAME = "prose-reader-document-container";
|
|
798
797
|
let fe = Le;
|
|
799
|
-
const
|
|
800
|
-
class
|
|
798
|
+
const Jn = (n) => new URL(n.href);
|
|
799
|
+
class tt {
|
|
801
800
|
constructor(e, t) {
|
|
802
801
|
this.item = e, this.settings = t;
|
|
803
802
|
}
|
|
804
803
|
async getResource() {
|
|
805
|
-
return await
|
|
804
|
+
return await rn(
|
|
806
805
|
this.settings.values.getResource?.(this.item) ?? v(void 0)
|
|
807
|
-
) ??
|
|
806
|
+
) ?? Jn(this.item);
|
|
808
807
|
}
|
|
809
808
|
async fetchResource() {
|
|
810
809
|
const e = await this.getResource();
|
|
811
810
|
return e instanceof Response ? e : e instanceof URL ? fetch(e) : e;
|
|
812
811
|
}
|
|
813
812
|
}
|
|
814
|
-
const
|
|
813
|
+
const jt = (n, e) => {
|
|
815
814
|
const t = n.startsWith("file://"), i = t ? n.replace("file://", "http://") : n, o = new URL(e, i).toString();
|
|
816
815
|
return t ? o.replace("http://", "file://") : o;
|
|
817
|
-
},
|
|
816
|
+
}, Kn = async (n, e, t, i, o) => {
|
|
818
817
|
if (!n || !n.defaultView) return;
|
|
819
818
|
const s = e.sheet;
|
|
820
819
|
if (s)
|
|
@@ -831,11 +830,11 @@ const kt = (n, e) => {
|
|
|
831
830
|
return p;
|
|
832
831
|
const m = p.match(/url\(['"]?([^'"]+)['"]?\)/);
|
|
833
832
|
if (!m) return p;
|
|
834
|
-
const y = m[1] ?? "", f = i.manifest?.items.find(({ href: b }) => `${
|
|
833
|
+
const y = m[1] ?? "", f = i.manifest?.items.find(({ href: b }) => `${jt(t, y).toLowerCase()}`.endsWith(
|
|
835
834
|
`${b.toLowerCase()}`
|
|
836
835
|
));
|
|
837
836
|
if (f) {
|
|
838
|
-
const b = new
|
|
837
|
+
const b = new tt(f, o);
|
|
839
838
|
try {
|
|
840
839
|
const I = await b.getResource();
|
|
841
840
|
if (I instanceof Response) {
|
|
@@ -862,14 +861,14 @@ const kt = (n, e) => {
|
|
|
862
861
|
} catch (r) {
|
|
863
862
|
console.error("Could not access stylesheet rules:", r);
|
|
864
863
|
}
|
|
865
|
-
},
|
|
864
|
+
}, Qn = (n, e, t, i, o) => {
|
|
866
865
|
const s = e.getAttribute("src") || e.getAttribute("href");
|
|
867
866
|
if (!s) return v(null);
|
|
868
|
-
const r = i.manifest?.items.find(({ href: c }) => `${
|
|
867
|
+
const r = i.manifest?.items.find(({ href: c }) => `${jt(t, s).toLowerCase()}`.endsWith(
|
|
869
868
|
`${c.toLowerCase()}`
|
|
870
869
|
));
|
|
871
870
|
if (!r) return v(null);
|
|
872
|
-
const a = new
|
|
871
|
+
const a = new tt(r, o);
|
|
873
872
|
return N(a.getResource()).pipe(
|
|
874
873
|
$e(
|
|
875
874
|
(c) => c instanceof Response ? N(c.blob()) : v(void 0)
|
|
@@ -881,10 +880,10 @@ const kt = (n, e) => {
|
|
|
881
880
|
if (e.hasAttribute("src"))
|
|
882
881
|
e.setAttribute("src", u);
|
|
883
882
|
else if (e.hasAttribute("href") && (e.setAttribute("href", u), n?.defaultView && e instanceof n.defaultView.HTMLLinkElement))
|
|
884
|
-
return new
|
|
883
|
+
return new ie((l) => {
|
|
885
884
|
e.onload = async () => {
|
|
886
885
|
try {
|
|
887
|
-
e.sheet && await
|
|
886
|
+
e.sheet && await Kn(
|
|
888
887
|
n,
|
|
889
888
|
e,
|
|
890
889
|
t,
|
|
@@ -899,16 +898,16 @@ const kt = (n, e) => {
|
|
|
899
898
|
return v(null);
|
|
900
899
|
})
|
|
901
900
|
);
|
|
902
|
-
},
|
|
901
|
+
}, ei = ({
|
|
903
902
|
settings: n,
|
|
904
903
|
item: e,
|
|
905
904
|
context: t
|
|
906
905
|
}) => (i) => i.pipe(
|
|
907
906
|
w((o) => {
|
|
908
|
-
const s =
|
|
907
|
+
const s = Dt(
|
|
909
908
|
o.contentDocument
|
|
910
|
-
), r =
|
|
911
|
-
(c) =>
|
|
909
|
+
), r = hn(e.href), a = s.map(
|
|
910
|
+
(c) => Qn(
|
|
912
911
|
o.contentDocument,
|
|
913
912
|
c,
|
|
914
913
|
r,
|
|
@@ -918,11 +917,11 @@ const kt = (n, e) => {
|
|
|
918
917
|
);
|
|
919
918
|
return k(a).pipe(S(() => o));
|
|
920
919
|
})
|
|
921
|
-
),
|
|
922
|
-
|
|
923
|
-
},
|
|
920
|
+
), ti = (n) => {
|
|
921
|
+
An(n?.contentDocument);
|
|
922
|
+
}, Gs = "@prose-reader/core", Zs = 0, Js = 200, ni = [".xhtml", ".html", ".htm"], W = "prose-reader", kt = `${W}-style`, ii = `data-${W}-id`, oi = `${W}-viewport`, si = `${W}-scroll-navigator`, ri = async (n, e) => {
|
|
924
923
|
if (typeof n == "string") return n;
|
|
925
|
-
const t =
|
|
924
|
+
const t = mn(n.headers.get("Content-Type") || "") || Me(e.href);
|
|
926
925
|
if (["image/jpg", "image/jpeg", "image/png", "image/webp"].some(
|
|
927
926
|
(o) => o === t
|
|
928
927
|
)) {
|
|
@@ -958,11 +957,11 @@ const kt = (n, e) => {
|
|
|
958
957
|
</body>
|
|
959
958
|
</html>
|
|
960
959
|
` : await n.text();
|
|
961
|
-
},
|
|
960
|
+
}, ai = ({
|
|
962
961
|
item: n,
|
|
963
962
|
resourcesHandler: e
|
|
964
963
|
}) => {
|
|
965
|
-
const t = (i) =>
|
|
964
|
+
const t = (i) => ri(i, n);
|
|
966
965
|
return (i) => i.pipe(
|
|
967
966
|
w((o) => N(e.getResource()).pipe(
|
|
968
967
|
w((s) => s instanceof URL && n.href.startsWith(window.location.origin) && // we have an encoding and it's a valid html
|
|
@@ -972,7 +971,7 @@ const kt = (n, e) => {
|
|
|
972
971
|
"text/html",
|
|
973
972
|
"text/xml"
|
|
974
973
|
].includes(n.mediaType) || // no encoding ? then try to detect html
|
|
975
|
-
!n.mediaType &&
|
|
974
|
+
!n.mediaType && ni.some(
|
|
976
975
|
(a) => n.href.endsWith(a)
|
|
977
976
|
)) ? (o?.setAttribute("src", n.href), v(o)) : (s instanceof URL ? N(e.fetchResource()) : v(s)).pipe(
|
|
978
977
|
w((a) => {
|
|
@@ -987,14 +986,14 @@ const kt = (n, e) => {
|
|
|
987
986
|
}
|
|
988
987
|
}),
|
|
989
988
|
S(() => o),
|
|
990
|
-
|
|
989
|
+
Tt((a) => (D.error(
|
|
991
990
|
`Error while trying to fetch or load resource for item ${n.id}`,
|
|
992
991
|
s
|
|
993
992
|
), D.error(a), v(o)))
|
|
994
993
|
))
|
|
995
994
|
))
|
|
996
995
|
);
|
|
997
|
-
},
|
|
996
|
+
}, ci = () => {
|
|
998
997
|
const n = document.createElement("iframe");
|
|
999
998
|
return n.frameBorder = "no", n.tabIndex = 0, n.setAttribute(
|
|
1000
999
|
"sandbox",
|
|
@@ -1009,17 +1008,17 @@ const kt = (n, e) => {
|
|
|
1009
1008
|
border: 0px none transparent;
|
|
1010
1009
|
padding: 0px;
|
|
1011
1010
|
`, n.setAttribute("role", "main"), n;
|
|
1012
|
-
},
|
|
1011
|
+
}, Ut = () => `
|
|
1013
1012
|
body {
|
|
1014
1013
|
margin: 0;
|
|
1015
1014
|
}
|
|
1016
1015
|
}
|
|
1017
|
-
`,
|
|
1016
|
+
`, zt = ({
|
|
1018
1017
|
pageHeight: n,
|
|
1019
1018
|
pageWidth: e,
|
|
1020
1019
|
frameElement: t
|
|
1021
1020
|
}) => {
|
|
1022
|
-
const i =
|
|
1021
|
+
const i = Ke(t);
|
|
1023
1022
|
if (t?.contentDocument && t.contentWindow && i) {
|
|
1024
1023
|
const o = e / (i.width ?? 1);
|
|
1025
1024
|
return { computedScale: Math.min(
|
|
@@ -1027,12 +1026,12 @@ const kt = (n, e) => {
|
|
|
1027
1026
|
n / (i.height ?? 1)
|
|
1028
1027
|
), computedWidthScale: o, viewportDimensions: i };
|
|
1029
1028
|
}
|
|
1030
|
-
},
|
|
1029
|
+
}, ui = ({
|
|
1031
1030
|
columnWidth: n,
|
|
1032
1031
|
enableTouch: e,
|
|
1033
1032
|
spreadPosition: t
|
|
1034
1033
|
}, i) => `
|
|
1035
|
-
${
|
|
1034
|
+
${Ut()}
|
|
1036
1035
|
body {
|
|
1037
1036
|
${i ? "" : `
|
|
1038
1037
|
display: flex;
|
|
@@ -1072,12 +1071,12 @@ const kt = (n, e) => {
|
|
|
1072
1071
|
object-fit:contain;
|
|
1073
1072
|
`}
|
|
1074
1073
|
}
|
|
1075
|
-
`,
|
|
1074
|
+
`, li = ({
|
|
1076
1075
|
pageHeight: n,
|
|
1077
1076
|
pageWidth: e
|
|
1078
|
-
}) => ({ columnHeight: n, columnWidth: e }),
|
|
1077
|
+
}) => ({ columnHeight: n, columnWidth: e }), lt = (n, e) => {
|
|
1079
1078
|
n.style.width = `${e.width}px`, n.style.height = `${e.height}px`;
|
|
1080
|
-
},
|
|
1079
|
+
}, di = ({
|
|
1081
1080
|
minPageSpread: n,
|
|
1082
1081
|
blankPagePosition: e,
|
|
1083
1082
|
spreadPosition: t,
|
|
@@ -1089,18 +1088,18 @@ const kt = (n, e) => {
|
|
|
1089
1088
|
}) => {
|
|
1090
1089
|
const c = n * o;
|
|
1091
1090
|
if (s?.contentDocument && s?.contentWindow) {
|
|
1092
|
-
const { viewportDimensions: u, computedScale: l = 1 } =
|
|
1091
|
+
const { viewportDimensions: u, computedScale: l = 1 } = zt({ frameElement: s, pageHeight: i, pageWidth: o }) ?? {}, d = o, g = i, h = ui(
|
|
1093
1092
|
{
|
|
1094
|
-
...
|
|
1093
|
+
...li({ pageHeight: i, pageWidth: o }),
|
|
1095
1094
|
enableTouch: a,
|
|
1096
1095
|
spreadPosition: t
|
|
1097
1096
|
},
|
|
1098
1097
|
u
|
|
1099
1098
|
);
|
|
1100
|
-
if (
|
|
1099
|
+
if (ne(s, "prose-reader-css", h), u ? lt(s, {
|
|
1101
1100
|
width: u.width ?? 1,
|
|
1102
1101
|
height: u.height ?? 1
|
|
1103
|
-
}) :
|
|
1102
|
+
}) : lt(s, {
|
|
1104
1103
|
width: d,
|
|
1105
1104
|
height: g
|
|
1106
1105
|
}), u) {
|
|
@@ -1121,8 +1120,8 @@ const kt = (n, e) => {
|
|
|
1121
1120
|
return { width: c, height: g };
|
|
1122
1121
|
}
|
|
1123
1122
|
return { width: c, height: i };
|
|
1124
|
-
},
|
|
1125
|
-
${
|
|
1123
|
+
}, pi = () => `
|
|
1124
|
+
${Ut()}
|
|
1126
1125
|
html {
|
|
1127
1126
|
width: 100%;
|
|
1128
1127
|
height: 100%;
|
|
@@ -1136,7 +1135,7 @@ const kt = (n, e) => {
|
|
|
1136
1135
|
html, body {
|
|
1137
1136
|
touch-action: none;
|
|
1138
1137
|
}
|
|
1139
|
-
`,
|
|
1138
|
+
`, gi = ({
|
|
1140
1139
|
isScrollable: n,
|
|
1141
1140
|
enableTouch: e
|
|
1142
1141
|
}) => `
|
|
@@ -1161,7 +1160,7 @@ const kt = (n, e) => {
|
|
|
1161
1160
|
display: block;
|
|
1162
1161
|
}
|
|
1163
1162
|
` : ""}
|
|
1164
|
-
`,
|
|
1163
|
+
`, hi = ({
|
|
1165
1164
|
width: n,
|
|
1166
1165
|
columnHeight: e,
|
|
1167
1166
|
columnWidth: t
|
|
@@ -1229,7 +1228,7 @@ const kt = (n, e) => {
|
|
|
1229
1228
|
td {
|
|
1230
1229
|
max-width: ${t}px;
|
|
1231
1230
|
}
|
|
1232
|
-
`,
|
|
1231
|
+
`, mi = ({
|
|
1233
1232
|
isUsingVerticalWriting: n,
|
|
1234
1233
|
minimumWidth: e,
|
|
1235
1234
|
pageHeight: t,
|
|
@@ -1245,7 +1244,7 @@ const kt = (n, e) => {
|
|
|
1245
1244
|
};
|
|
1246
1245
|
}, Ie = (n, e) => {
|
|
1247
1246
|
n.style.width = `${e.width}px`, n.style.height = `${e.height}px`;
|
|
1248
|
-
},
|
|
1247
|
+
}, fi = ({
|
|
1249
1248
|
pageHeight: n,
|
|
1250
1249
|
pageWidth: e,
|
|
1251
1250
|
frameElement: t,
|
|
@@ -1259,7 +1258,7 @@ const kt = (n, e) => {
|
|
|
1259
1258
|
}) => {
|
|
1260
1259
|
const l = o * e, d = i?.renditionLayout === "reflowable" && i?.renditionFlow === "scrolled-continuous", g = d ? Math.min(400, n) : n;
|
|
1261
1260
|
t?.style.setProperty("width", `${e}px`), d ? t?.style.removeProperty("height") : t?.style.setProperty("height", `${g}px`);
|
|
1262
|
-
const { viewportDimensions: h, computedScale: p = 1 } =
|
|
1261
|
+
const { viewportDimensions: h, computedScale: p = 1 } = zt({
|
|
1263
1262
|
frameElement: t,
|
|
1264
1263
|
pageHeight: g,
|
|
1265
1264
|
pageWidth: e
|
|
@@ -1267,10 +1266,10 @@ const kt = (n, e) => {
|
|
|
1267
1266
|
if (t?.contentDocument && t?.contentWindow && t.contentDocument.body) {
|
|
1268
1267
|
let y = e, f = g;
|
|
1269
1268
|
if (h?.hasViewport)
|
|
1270
|
-
|
|
1269
|
+
ne(
|
|
1271
1270
|
t,
|
|
1272
1271
|
"prose-reader-html-renderer-framce-css",
|
|
1273
|
-
|
|
1272
|
+
pi()
|
|
1274
1273
|
), Ie(t, {
|
|
1275
1274
|
width: h.width ?? 1,
|
|
1276
1275
|
height: h.height ?? 1
|
|
@@ -1282,18 +1281,18 @@ const kt = (n, e) => {
|
|
|
1282
1281
|
`translate(-50%, -50%) scale(${p})`
|
|
1283
1282
|
), t?.style.setProperty("transform-origin", "center center");
|
|
1284
1283
|
else {
|
|
1285
|
-
const I = a ?
|
|
1284
|
+
const I = a ? gi({
|
|
1286
1285
|
isScrollable: i?.renditionFlow === "scrolled-continuous",
|
|
1287
1286
|
enableTouch: c
|
|
1288
|
-
}) :
|
|
1289
|
-
|
|
1287
|
+
}) : hi(
|
|
1288
|
+
mi({
|
|
1290
1289
|
isUsingVerticalWriting: u,
|
|
1291
1290
|
minimumWidth: l,
|
|
1292
1291
|
pageHeight: g,
|
|
1293
1292
|
pageWidth: e
|
|
1294
1293
|
})
|
|
1295
1294
|
);
|
|
1296
|
-
if (
|
|
1295
|
+
if (ne(t, "prose-reader-css", I, !0), u)
|
|
1297
1296
|
f = Math.ceil(
|
|
1298
1297
|
t.contentDocument.documentElement.scrollHeight / g
|
|
1299
1298
|
) * g, Ie(t, {
|
|
@@ -1318,19 +1317,19 @@ const kt = (n, e) => {
|
|
|
1318
1317
|
return y % l === 0 ? t?.style.setProperty("margin-left", "0px") : (y = y + e, s && !u && t?.style.setProperty("margin-left", `${e}px`)), { width: y, height: f };
|
|
1319
1318
|
}
|
|
1320
1319
|
};
|
|
1321
|
-
class
|
|
1320
|
+
class yi extends fe {
|
|
1322
1321
|
constructor() {
|
|
1323
1322
|
super(...arguments), this.isImageType = () => !!(this.item.mediaType ?? Me(this.item.href))?.startsWith("image/");
|
|
1324
1323
|
}
|
|
1325
1324
|
onCreateDocument() {
|
|
1326
|
-
const e =
|
|
1325
|
+
const e = ci();
|
|
1327
1326
|
return this.setDocumentContainer(e), v(e);
|
|
1328
1327
|
}
|
|
1329
1328
|
onLoadDocument() {
|
|
1330
1329
|
const e = this.getFrameElement();
|
|
1331
1330
|
if (!e) throw new Error("invalid frame");
|
|
1332
1331
|
return v(e).pipe(
|
|
1333
|
-
|
|
1332
|
+
ai({
|
|
1334
1333
|
item: this.item,
|
|
1335
1334
|
resourcesHandler: this.resourcesHandler,
|
|
1336
1335
|
settings: this.settings
|
|
@@ -1339,17 +1338,17 @@ class Si extends fe {
|
|
|
1339
1338
|
x(() => {
|
|
1340
1339
|
this.attach();
|
|
1341
1340
|
}),
|
|
1342
|
-
|
|
1343
|
-
|
|
1341
|
+
jn,
|
|
1342
|
+
ei({
|
|
1344
1343
|
context: this.context,
|
|
1345
1344
|
item: this.item,
|
|
1346
1345
|
settings: this.settings
|
|
1347
1346
|
}),
|
|
1348
|
-
|
|
1347
|
+
kn
|
|
1349
1348
|
);
|
|
1350
1349
|
}
|
|
1351
1350
|
onUnload() {
|
|
1352
|
-
return
|
|
1351
|
+
return ti(this.getFrameElement()), this.detach(), Z;
|
|
1353
1352
|
}
|
|
1354
1353
|
onLayout({
|
|
1355
1354
|
minPageSpread: e,
|
|
@@ -1360,7 +1359,7 @@ class Si extends fe {
|
|
|
1360
1359
|
if (!r) return v(void 0);
|
|
1361
1360
|
const a = !!this.writingMode?.startsWith("vertical");
|
|
1362
1361
|
if (this.item.renditionLayout === "pre-paginated" || !this.item.renditionLayout && this.context.manifest?.renditionLayout === "pre-paginated") {
|
|
1363
|
-
const u =
|
|
1362
|
+
const u = di({
|
|
1364
1363
|
blankPagePosition: t,
|
|
1365
1364
|
enableTouch: this.settings.values.computedPageTurnMode !== "scrollable",
|
|
1366
1365
|
frameElement: r,
|
|
@@ -1372,7 +1371,7 @@ class Si extends fe {
|
|
|
1372
1371
|
});
|
|
1373
1372
|
return v(u);
|
|
1374
1373
|
}
|
|
1375
|
-
const c =
|
|
1374
|
+
const c = fi({
|
|
1376
1375
|
pageHeight: s,
|
|
1377
1376
|
pageWidth: o,
|
|
1378
1377
|
frameElement: r,
|
|
@@ -1440,22 +1439,22 @@ class Si extends fe {
|
|
|
1440
1439
|
return this.getFrameElement();
|
|
1441
1440
|
}
|
|
1442
1441
|
}
|
|
1443
|
-
const
|
|
1442
|
+
const Si = (n) => (e) => {
|
|
1444
1443
|
const t = n({
|
|
1445
1444
|
...e,
|
|
1446
1445
|
getRenderer(o) {
|
|
1447
|
-
return e.getRenderer?.(o) ?? ((r) => new
|
|
1446
|
+
return e.getRenderer?.(o) ?? ((r) => new yi(r));
|
|
1448
1447
|
}
|
|
1449
|
-
}), i =
|
|
1448
|
+
}), i = Zn(t);
|
|
1450
1449
|
return i.pipe(T(t.$.destroy$)).subscribe(), {
|
|
1451
1450
|
...t,
|
|
1452
1451
|
links$: i
|
|
1453
1452
|
};
|
|
1454
1453
|
};
|
|
1455
|
-
function
|
|
1454
|
+
function J(n) {
|
|
1456
1455
|
return n != null;
|
|
1457
1456
|
}
|
|
1458
|
-
class
|
|
1457
|
+
class nt {
|
|
1459
1458
|
constructor(e) {
|
|
1460
1459
|
this.left = e.left, this.right = e.right, this.top = e.top, this.bottom = e.bottom, this.width = e.width, this.height = e.height, this.x = e.x, this.y = e.y;
|
|
1461
1460
|
}
|
|
@@ -1470,27 +1469,27 @@ class Ae {
|
|
|
1470
1469
|
this.__symbol = Symbol("SpineItemPagePosition"), this.x = e.x, this.y = e.y;
|
|
1471
1470
|
}
|
|
1472
1471
|
}
|
|
1473
|
-
class
|
|
1472
|
+
class bi extends nt {
|
|
1474
1473
|
constructor() {
|
|
1475
1474
|
super(...arguments), this.__symbol = "SpineItemPageLayout";
|
|
1476
1475
|
}
|
|
1477
1476
|
}
|
|
1478
|
-
class _e extends
|
|
1477
|
+
class _e extends nt {
|
|
1479
1478
|
constructor() {
|
|
1480
1479
|
super(...arguments), this.__symbol = "SpineItemSpineLayout";
|
|
1481
1480
|
}
|
|
1482
1481
|
}
|
|
1483
|
-
class
|
|
1482
|
+
class Ii extends nt {
|
|
1484
1483
|
constructor() {
|
|
1485
1484
|
super(...arguments), this.__symbol = "SpineItemPageSpineLayout";
|
|
1486
1485
|
}
|
|
1487
1486
|
}
|
|
1488
|
-
class
|
|
1487
|
+
class Wt {
|
|
1489
1488
|
constructor(e) {
|
|
1490
1489
|
this.x = e.x, this.y = e.y;
|
|
1491
1490
|
}
|
|
1492
1491
|
}
|
|
1493
|
-
class M extends
|
|
1492
|
+
class M extends Wt {
|
|
1494
1493
|
constructor() {
|
|
1495
1494
|
super(...arguments), this.__symbol = "SpinePosition";
|
|
1496
1495
|
}
|
|
@@ -1498,28 +1497,28 @@ class M extends _t {
|
|
|
1498
1497
|
return new M(e);
|
|
1499
1498
|
}
|
|
1500
1499
|
}
|
|
1501
|
-
class
|
|
1500
|
+
class ce extends Wt {
|
|
1502
1501
|
constructor() {
|
|
1503
1502
|
super(...arguments), this.__symbol = "UnboundSpinePosition";
|
|
1504
1503
|
}
|
|
1505
1504
|
static from(e) {
|
|
1506
|
-
return new
|
|
1505
|
+
return new ce(e);
|
|
1507
1506
|
}
|
|
1508
1507
|
}
|
|
1509
|
-
const
|
|
1508
|
+
const vi = (n, e) => {
|
|
1510
1509
|
const t = e.getBoundingClientRect(), { x: i, y: o } = n, { left: s, top: r } = t, a = t.width / e.offsetWidth, c = t.height / e.offsetHeight, u = i - s, l = o - r;
|
|
1511
1510
|
return {
|
|
1512
1511
|
x: u / a,
|
|
1513
1512
|
y: l / c
|
|
1514
1513
|
};
|
|
1515
|
-
},
|
|
1516
|
-
|
|
1517
|
-
),
|
|
1518
|
-
getSpinePositionFromClientPosition: (e) => n.spine.element ?
|
|
1519
|
-
}),
|
|
1514
|
+
}, wi = (n, e) => new ce(
|
|
1515
|
+
vi(n, e)
|
|
1516
|
+
), Pi = (n) => ({
|
|
1517
|
+
getSpinePositionFromClientPosition: (e) => n.spine.element ? wi(e, n.spine.element) : void 0
|
|
1518
|
+
}), xi = (n) => {
|
|
1520
1519
|
let e;
|
|
1521
1520
|
const t = n.context.watch("rootElement").pipe(
|
|
1522
|
-
_((c) => c ? new
|
|
1521
|
+
_((c) => c ? new ie(() => (e = c.ownerDocument.createElement("div"), e.style.cssText = `
|
|
1523
1522
|
position: absolute;
|
|
1524
1523
|
left: 0;
|
|
1525
1524
|
top: 0;
|
|
@@ -1529,7 +1528,7 @@ const wi = (n, e) => {
|
|
|
1529
1528
|
`, c.appendChild(e), () => {
|
|
1530
1529
|
e?.remove(), e = void 0;
|
|
1531
1530
|
})) : ge)
|
|
1532
|
-
), i = (c) =>
|
|
1531
|
+
), i = (c) => an(c, ae).pipe(
|
|
1533
1532
|
j(() => {
|
|
1534
1533
|
e?.style.setProperty(
|
|
1535
1534
|
"visibility",
|
|
@@ -1544,9 +1543,9 @@ const wi = (n, e) => {
|
|
|
1544
1543
|
);
|
|
1545
1544
|
})
|
|
1546
1545
|
), s = i(n.viewportFree$).pipe(
|
|
1547
|
-
|
|
1546
|
+
bn(1)
|
|
1548
1547
|
), a = n.settings.values$.pipe(
|
|
1549
|
-
|
|
1548
|
+
Q(() => n.settings.values.computedPageTurnMode),
|
|
1550
1549
|
pe()
|
|
1551
1550
|
).pipe(
|
|
1552
1551
|
_(
|
|
@@ -1555,18 +1554,18 @@ const wi = (n, e) => {
|
|
|
1555
1554
|
G(n.$.destroy$)
|
|
1556
1555
|
);
|
|
1557
1556
|
return P(t, a);
|
|
1558
|
-
},
|
|
1557
|
+
}, $i = (n) => {
|
|
1559
1558
|
n.hookManager.register("item.onDocumentLoad", ({ itemId: e }) => {
|
|
1560
1559
|
n.spineItemsManager.get(e)?.renderer.getDocumentFrame()?.setAttribute("scrolling", "no");
|
|
1561
1560
|
});
|
|
1562
|
-
},
|
|
1561
|
+
}, Ti = (n) => {
|
|
1563
1562
|
n.hookManager.register(
|
|
1564
1563
|
"item.onAfterLayout",
|
|
1565
1564
|
({ item: e, blankPagePosition: t, minimumWidth: i }) => {
|
|
1566
1565
|
const o = n.spineItemsManager.get(e.id), s = o?.renderer.getDocumentFrame();
|
|
1567
1566
|
if (o?.renditionLayout !== "reflowable" || !(s instanceof HTMLIFrameElement))
|
|
1568
1567
|
return;
|
|
1569
|
-
const { hasViewport: r } =
|
|
1568
|
+
const { hasViewport: r } = Ke(s), { width: a } = n.viewport.pageSize, c = o?.renderer.getDocumentFrame();
|
|
1570
1569
|
if (r) {
|
|
1571
1570
|
const u = a < i;
|
|
1572
1571
|
t === "none" && u && c instanceof HTMLIFrameElement && c?.style.setProperty(
|
|
@@ -1576,7 +1575,7 @@ const wi = (n, e) => {
|
|
|
1576
1575
|
}
|
|
1577
1576
|
}
|
|
1578
1577
|
);
|
|
1579
|
-
},
|
|
1578
|
+
}, Fi = (n) => n.spineItemsManager.items$.pipe(
|
|
1580
1579
|
w(
|
|
1581
1580
|
(e) => P(
|
|
1582
1581
|
...e.map(
|
|
@@ -1589,7 +1588,7 @@ const wi = (n, e) => {
|
|
|
1589
1588
|
)
|
|
1590
1589
|
)
|
|
1591
1590
|
);
|
|
1592
|
-
let
|
|
1591
|
+
let Li = class extends Vt {
|
|
1593
1592
|
computeOutputSettings(e) {
|
|
1594
1593
|
return e;
|
|
1595
1594
|
}
|
|
@@ -1615,7 +1614,7 @@ let Mi = class extends jt {
|
|
|
1615
1614
|
};
|
|
1616
1615
|
}
|
|
1617
1616
|
};
|
|
1618
|
-
const
|
|
1617
|
+
const Mi = (n) => k([
|
|
1619
1618
|
n.viewport.watch(["width", "height"]),
|
|
1620
1619
|
n.context.watch("manifest")
|
|
1621
1620
|
]).pipe(
|
|
@@ -1623,13 +1622,13 @@ const Ci = (n) => k([
|
|
|
1623
1622
|
const o = e > t;
|
|
1624
1623
|
return !o && i?.renditionSpread === "portrait" ? n.settings.update({ spreadMode: !0 }) : o && (i?.renditionSpread === void 0 || i?.renditionSpread === "auto" || i?.renditionSpread === "landscape" || i?.renditionSpread === "both") ? n.settings.update({ spreadMode: !0 }) : n.settings.update({ spreadMode: !1 });
|
|
1625
1624
|
})
|
|
1626
|
-
),
|
|
1625
|
+
), Ci = (n) => (e) => {
|
|
1627
1626
|
const {
|
|
1628
1627
|
pageHorizontalMargin: t,
|
|
1629
1628
|
pageVerticalMargin: i,
|
|
1630
1629
|
layoutAutoResize: o,
|
|
1631
1630
|
layoutLayerTransition: s
|
|
1632
|
-
} = e, r = n(e), a = new
|
|
1631
|
+
} = e, r = n(e), a = new Li(
|
|
1633
1632
|
{
|
|
1634
1633
|
pageHorizontalMargin: t,
|
|
1635
1634
|
pageVerticalMargin: i,
|
|
@@ -1651,9 +1650,9 @@ const Ci = (n) => k([
|
|
|
1651
1650
|
const A = F.height - I * 2;
|
|
1652
1651
|
let Y = F.width - b * 2, B = b * 2;
|
|
1653
1652
|
m.isUsingVerticalWriting() && (Y = F.width - b * 2, $ = A, B = I * 2);
|
|
1654
|
-
const
|
|
1655
|
-
|
|
1656
|
-
|
|
1653
|
+
const oe = m?.renderer.getDocumentFrame();
|
|
1654
|
+
oe && ne(
|
|
1655
|
+
oe,
|
|
1657
1656
|
"prose-layout-enhancer-css",
|
|
1658
1657
|
`
|
|
1659
1658
|
body {
|
|
@@ -1676,7 +1675,7 @@ const Ci = (n) => k([
|
|
|
1676
1675
|
`
|
|
1677
1676
|
);
|
|
1678
1677
|
}
|
|
1679
|
-
}),
|
|
1678
|
+
}), Ti(r), $i(r), r.hookManager.register(
|
|
1680
1679
|
"item.onDocumentCreated",
|
|
1681
1680
|
({ documentContainer: p }) => {
|
|
1682
1681
|
p.style.opacity = "0", a.values.layoutLayerTransition && (p.style.transition = "opacity 300ms");
|
|
@@ -1686,24 +1685,24 @@ const Ci = (n) => k([
|
|
|
1686
1685
|
r.settings.values.computedPageTurnMode !== "scrollable" && y?.setAttribute("tab-index", "0");
|
|
1687
1686
|
});
|
|
1688
1687
|
const c = r.spineItemsObserver.itemIsReady$.pipe(
|
|
1689
|
-
|
|
1688
|
+
re(({ isReady: p }) => p),
|
|
1690
1689
|
j(({ item: p }) => {
|
|
1691
1690
|
const m = p.renderer.documentContainer;
|
|
1692
1691
|
m && (m.style.opacity = "1");
|
|
1693
1692
|
})
|
|
1694
1693
|
), u = a.values$.pipe(
|
|
1695
|
-
|
|
1694
|
+
re(({ layoutAutoResize: p }) => p === "container"),
|
|
1696
1695
|
_(() => r.context.watch("rootElement")),
|
|
1697
|
-
|
|
1698
|
-
_((p) =>
|
|
1699
|
-
|
|
1700
|
-
|
|
1696
|
+
re(J),
|
|
1697
|
+
_((p) => et(p)),
|
|
1698
|
+
In(100),
|
|
1699
|
+
re(J),
|
|
1701
1700
|
j(() => {
|
|
1702
1701
|
r?.layout();
|
|
1703
1702
|
})
|
|
1704
|
-
), l =
|
|
1703
|
+
), l = xi(r);
|
|
1705
1704
|
a.watch(["pageHorizontalMargin", "pageVerticalMargin"]).pipe(
|
|
1706
|
-
|
|
1705
|
+
Mt(1),
|
|
1707
1706
|
j(() => {
|
|
1708
1707
|
r.layout();
|
|
1709
1708
|
}),
|
|
@@ -1711,7 +1710,7 @@ const Ci = (n) => k([
|
|
|
1711
1710
|
).subscribe();
|
|
1712
1711
|
const d = r.spine.pages.pipe(
|
|
1713
1712
|
Ce({ refCount: !0, bufferSize: 1 })
|
|
1714
|
-
), g =
|
|
1713
|
+
), g = Fi(r), h = Mi(r);
|
|
1715
1714
|
return P(
|
|
1716
1715
|
c,
|
|
1717
1716
|
l,
|
|
@@ -1727,11 +1726,11 @@ const Ci = (n) => k([
|
|
|
1727
1726
|
settings: a,
|
|
1728
1727
|
layout$: r.spine.layout$,
|
|
1729
1728
|
layoutInfo$: d,
|
|
1730
|
-
coordinates:
|
|
1729
|
+
coordinates: Pi(r)
|
|
1731
1730
|
};
|
|
1732
|
-
},
|
|
1731
|
+
}, Ei = `${W}-enhancer-loading`, _t = `${Ei}-container`, Di = (n, e) => {
|
|
1733
1732
|
const t = n.ownerDocument.createElement("div");
|
|
1734
|
-
return t.classList.add(
|
|
1733
|
+
return t.classList.add(_t), t.style.cssText = `
|
|
1735
1734
|
height: 100%;
|
|
1736
1735
|
width: 100%;
|
|
1737
1736
|
max-width: ${e.absoluteViewport.width}px;
|
|
@@ -1747,7 +1746,7 @@ const Ci = (n) => k([
|
|
|
1747
1746
|
background-color: white;
|
|
1748
1747
|
z-index: 1;
|
|
1749
1748
|
`, t;
|
|
1750
|
-
},
|
|
1749
|
+
}, Ri = ({
|
|
1751
1750
|
container: n,
|
|
1752
1751
|
item: e
|
|
1753
1752
|
}) => {
|
|
@@ -1764,23 +1763,23 @@ const Ci = (n) => k([
|
|
|
1764
1763
|
max-width: 300px;
|
|
1765
1764
|
width: 80%;
|
|
1766
1765
|
`, n.appendChild(t), n.appendChild(i), n;
|
|
1767
|
-
},
|
|
1768
|
-
const { loadingElementCreate: t =
|
|
1766
|
+
}, Ai = (n) => (e) => {
|
|
1767
|
+
const { loadingElementCreate: t = Ri } = e, i = n(e), o = (c) => v(
|
|
1769
1768
|
c.reduce((u, { item: l, element: d }) => {
|
|
1770
1769
|
d.style.zIndex = "0";
|
|
1771
1770
|
const g = d.querySelector(
|
|
1772
|
-
`.${
|
|
1771
|
+
`.${_t}`
|
|
1773
1772
|
);
|
|
1774
1773
|
if (g instanceof HTMLElement)
|
|
1775
1774
|
return u[l.id] = g, u;
|
|
1776
1775
|
const h = t({
|
|
1777
|
-
container:
|
|
1776
|
+
container: Di(d, i.viewport),
|
|
1778
1777
|
item: l
|
|
1779
1778
|
});
|
|
1780
1779
|
return d.appendChild(h), u[l.id] = h, u;
|
|
1781
1780
|
}, {})
|
|
1782
1781
|
), s = (c) => k([i.spine.layout$, i.theme.$.theme$]).pipe(
|
|
1783
|
-
|
|
1782
|
+
Q(([, u]) => ({
|
|
1784
1783
|
width: i.viewport.absoluteViewport.width,
|
|
1785
1784
|
theme: u
|
|
1786
1785
|
})),
|
|
@@ -1825,7 +1824,7 @@ const Ci = (n) => k([
|
|
|
1825
1824
|
}
|
|
1826
1825
|
};
|
|
1827
1826
|
};
|
|
1828
|
-
class
|
|
1827
|
+
class Oi extends fe {
|
|
1829
1828
|
getImageElement() {
|
|
1830
1829
|
const e = this.documentContainer;
|
|
1831
1830
|
if (e instanceof HTMLImageElement)
|
|
@@ -1877,12 +1876,12 @@ class Ni extends fe {
|
|
|
1877
1876
|
getDocumentFrame() {
|
|
1878
1877
|
}
|
|
1879
1878
|
}
|
|
1880
|
-
const
|
|
1879
|
+
const Ni = (n) => (e) => {
|
|
1881
1880
|
const t = n({
|
|
1882
1881
|
...e,
|
|
1883
1882
|
getRenderer(r) {
|
|
1884
1883
|
const a = e.getRenderer?.(r), u = !!(r.mediaType ?? Me(r.href))?.startsWith("image/");
|
|
1885
|
-
return !a && u ? (l) => new
|
|
1884
|
+
return !a && u ? (l) => new Oi(l) : a;
|
|
1886
1885
|
}
|
|
1887
1886
|
}), i = new IntersectionObserver(
|
|
1888
1887
|
(r) => {
|
|
@@ -1932,15 +1931,15 @@ const Vi = (n) => (e) => {
|
|
|
1932
1931
|
i.disconnect(), o.disconnect(), t.destroy();
|
|
1933
1932
|
}
|
|
1934
1933
|
};
|
|
1935
|
-
},
|
|
1934
|
+
}, Vi = (n, e) => n.links$.pipe(
|
|
1936
1935
|
x((t) => {
|
|
1937
|
-
if (!
|
|
1936
|
+
if (!On(t.target, "a") || t.type !== "click") return;
|
|
1938
1937
|
const i = new URL(t.target.href), o = `${i.origin}${i.pathname}`;
|
|
1939
1938
|
n.context.manifest?.spineItems.some(
|
|
1940
1939
|
(r) => r.href === o
|
|
1941
1940
|
) && e.goToUrl(i);
|
|
1942
1941
|
})
|
|
1943
|
-
),
|
|
1942
|
+
), se = D.namespace("navigation"), ji = ({
|
|
1944
1943
|
position: n,
|
|
1945
1944
|
spineItem: e,
|
|
1946
1945
|
pageHeight: t,
|
|
@@ -1958,7 +1957,7 @@ const Vi = (n) => (e) => {
|
|
|
1958
1957
|
s,
|
|
1959
1958
|
e
|
|
1960
1959
|
);
|
|
1961
|
-
},
|
|
1960
|
+
}, dt = ({
|
|
1962
1961
|
position: n,
|
|
1963
1962
|
navigationResolver: e,
|
|
1964
1963
|
computedPageTurnDirection: t,
|
|
@@ -1972,7 +1971,7 @@ const Vi = (n) => (e) => {
|
|
|
1972
1971
|
const u = o.getSpineItemPositionFromSpinePosition(
|
|
1973
1972
|
n,
|
|
1974
1973
|
a
|
|
1975
|
-
), l =
|
|
1974
|
+
), l = ji({
|
|
1976
1975
|
position: u,
|
|
1977
1976
|
spineItem: a,
|
|
1978
1977
|
pageHeight: s.pageSize.height,
|
|
@@ -1994,7 +1993,7 @@ const Vi = (n) => (e) => {
|
|
|
1994
1993
|
x: 0
|
|
1995
1994
|
})
|
|
1996
1995
|
);
|
|
1997
|
-
},
|
|
1996
|
+
}, ki = ({
|
|
1998
1997
|
position: n,
|
|
1999
1998
|
spineItem: e,
|
|
2000
1999
|
context: t,
|
|
@@ -2005,7 +2004,7 @@ const Vi = (n) => (e) => {
|
|
|
2005
2004
|
viewport: a,
|
|
2006
2005
|
settings: c
|
|
2007
2006
|
}) => {
|
|
2008
|
-
const u =
|
|
2007
|
+
const u = dt({
|
|
2009
2008
|
position: n,
|
|
2010
2009
|
viewport: a,
|
|
2011
2010
|
navigationResolver: i,
|
|
@@ -2027,7 +2026,7 @@ const Vi = (n) => (e) => {
|
|
|
2027
2026
|
);
|
|
2028
2027
|
if (r === "vertical" && n.y !== u.y)
|
|
2029
2028
|
return i.getAdjustedPositionForSpread(u);
|
|
2030
|
-
const l =
|
|
2029
|
+
const l = dt({
|
|
2031
2030
|
position: u,
|
|
2032
2031
|
viewport: a,
|
|
2033
2032
|
navigationResolver: i,
|
|
@@ -2038,7 +2037,7 @@ const Vi = (n) => (e) => {
|
|
|
2038
2037
|
return i.getAdjustedPositionForSpread(l);
|
|
2039
2038
|
}
|
|
2040
2039
|
return i.getAdjustedPositionForSpread(u);
|
|
2041
|
-
},
|
|
2040
|
+
}, Ui = ({
|
|
2042
2041
|
position: n,
|
|
2043
2042
|
spineItem: e,
|
|
2044
2043
|
pageHeight: t,
|
|
@@ -2056,7 +2055,7 @@ const Vi = (n) => (e) => {
|
|
|
2056
2055
|
s,
|
|
2057
2056
|
e
|
|
2058
2057
|
);
|
|
2059
|
-
},
|
|
2058
|
+
}, pt = ({
|
|
2060
2059
|
position: n,
|
|
2061
2060
|
navigationResolver: e,
|
|
2062
2061
|
computedPageTurnDirection: t,
|
|
@@ -2070,7 +2069,7 @@ const Vi = (n) => (e) => {
|
|
|
2070
2069
|
const u = o.getSpineItemPositionFromSpinePosition(
|
|
2071
2070
|
n,
|
|
2072
2071
|
a
|
|
2073
|
-
), l =
|
|
2072
|
+
), l = Ui({
|
|
2074
2073
|
position: u,
|
|
2075
2074
|
spineItem: a,
|
|
2076
2075
|
pageHeight: s.pageSize.height,
|
|
@@ -2084,15 +2083,15 @@ const Vi = (n) => (e) => {
|
|
|
2084
2083
|
spineItemPosition: l,
|
|
2085
2084
|
spineItem: a
|
|
2086
2085
|
}) : e.fromUnboundSpinePosition(
|
|
2087
|
-
r === "horizontal" ? new
|
|
2086
|
+
r === "horizontal" ? new ce({
|
|
2088
2087
|
x: n.x + s.pageSize.width,
|
|
2089
2088
|
y: 0
|
|
2090
|
-
}) : new
|
|
2089
|
+
}) : new ce({
|
|
2091
2090
|
y: n.y + s.pageSize.height,
|
|
2092
2091
|
x: 0
|
|
2093
2092
|
})
|
|
2094
2093
|
);
|
|
2095
|
-
},
|
|
2094
|
+
}, zi = ({
|
|
2096
2095
|
position: n,
|
|
2097
2096
|
spineItem: e,
|
|
2098
2097
|
context: t,
|
|
@@ -2103,7 +2102,7 @@ const Vi = (n) => (e) => {
|
|
|
2103
2102
|
viewport: a,
|
|
2104
2103
|
settings: c
|
|
2105
2104
|
}) => {
|
|
2106
|
-
const u =
|
|
2105
|
+
const u = pt({
|
|
2107
2106
|
position: n,
|
|
2108
2107
|
viewport: a,
|
|
2109
2108
|
navigationResolver: i,
|
|
@@ -2128,7 +2127,7 @@ const Vi = (n) => (e) => {
|
|
|
2128
2127
|
);
|
|
2129
2128
|
if (r === "vertical" && n.y !== u.y)
|
|
2130
2129
|
return i.getAdjustedPositionForSpread(u);
|
|
2131
|
-
const l =
|
|
2130
|
+
const l = pt({
|
|
2132
2131
|
position: u,
|
|
2133
2132
|
viewport: a,
|
|
2134
2133
|
navigationResolver: i,
|
|
@@ -2140,7 +2139,7 @@ const Vi = (n) => (e) => {
|
|
|
2140
2139
|
}
|
|
2141
2140
|
return i.getAdjustedPositionForSpread(u);
|
|
2142
2141
|
};
|
|
2143
|
-
class
|
|
2142
|
+
class Wi {
|
|
2144
2143
|
constructor(e) {
|
|
2145
2144
|
this.reader = e, this.movingLastDelta = { x: 0, y: 0 }, this.movingLastPosition = new M({ x: 0, y: 0 }), this.unlock = void 0;
|
|
2146
2145
|
}
|
|
@@ -2159,7 +2158,7 @@ class _i {
|
|
|
2159
2158
|
turnRightOrBottom() {
|
|
2160
2159
|
const e = this.reader.navigation.getNavigation(), t = this.reader.spineItemsManager.get(e.spineItem);
|
|
2161
2160
|
if (!t) return;
|
|
2162
|
-
const i =
|
|
2161
|
+
const i = zi({
|
|
2163
2162
|
context: this.reader.context,
|
|
2164
2163
|
navigationResolver: this.reader.navigation.navigationResolver,
|
|
2165
2164
|
position: e.position,
|
|
@@ -2177,7 +2176,7 @@ class _i {
|
|
|
2177
2176
|
turnLeftOrTop() {
|
|
2178
2177
|
const e = this.reader.navigation.getNavigation(), t = this.reader.spineItemsManager.get(e.spineItem);
|
|
2179
2178
|
if (!t) return;
|
|
2180
|
-
const i =
|
|
2179
|
+
const i = ki({
|
|
2181
2180
|
context: this.reader.context,
|
|
2182
2181
|
navigationResolver: this.reader.navigation.navigationResolver,
|
|
2183
2182
|
position: e.position,
|
|
@@ -2204,7 +2203,7 @@ class _i {
|
|
|
2204
2203
|
}) {
|
|
2205
2204
|
const i = this.reader.spineItemsManager.get(e);
|
|
2206
2205
|
if (i === void 0) {
|
|
2207
|
-
|
|
2206
|
+
se.warn(
|
|
2208
2207
|
"goToSpineItem",
|
|
2209
2208
|
`Ignore navigation to ${e} since the item does not exist`
|
|
2210
2209
|
);
|
|
@@ -2237,7 +2236,7 @@ class _i {
|
|
|
2237
2236
|
}
|
|
2238
2237
|
goToRightSpineItem() {
|
|
2239
2238
|
if (this.reader.settings.values.computedPageTurnDirection === "vertical") {
|
|
2240
|
-
|
|
2239
|
+
se.warn(
|
|
2241
2240
|
"You cannot call this navigation method on vertical direction"
|
|
2242
2241
|
);
|
|
2243
2242
|
return;
|
|
@@ -2252,7 +2251,7 @@ class _i {
|
|
|
2252
2251
|
}
|
|
2253
2252
|
goToLeftSpineItem() {
|
|
2254
2253
|
if (this.reader.settings.values.computedPageTurnDirection === "vertical") {
|
|
2255
|
-
|
|
2254
|
+
se.warn(
|
|
2256
2255
|
"You cannot call this navigation method on vertical direction"
|
|
2257
2256
|
);
|
|
2258
2257
|
return;
|
|
@@ -2261,7 +2260,7 @@ class _i {
|
|
|
2261
2260
|
}
|
|
2262
2261
|
goToTopSpineItem() {
|
|
2263
2262
|
if (this.reader.settings.values.computedPageTurnDirection === "horizontal") {
|
|
2264
|
-
|
|
2263
|
+
se.warn(
|
|
2265
2264
|
"You cannot call this navigation method on horizontal direction"
|
|
2266
2265
|
);
|
|
2267
2266
|
return;
|
|
@@ -2270,7 +2269,7 @@ class _i {
|
|
|
2270
2269
|
}
|
|
2271
2270
|
goToBottomSpineItem() {
|
|
2272
2271
|
if (this.reader.settings.values.computedPageTurnDirection === "horizontal") {
|
|
2273
|
-
|
|
2272
|
+
se.warn(
|
|
2274
2273
|
"You cannot call this navigation method on horizontal direction"
|
|
2275
2274
|
);
|
|
2276
2275
|
return;
|
|
@@ -2286,7 +2285,7 @@ class _i {
|
|
|
2286
2285
|
pageIndex: e,
|
|
2287
2286
|
spineItemId: t
|
|
2288
2287
|
});
|
|
2289
|
-
|
|
2288
|
+
se.debug(".goToPageOfSpineItem()", {
|
|
2290
2289
|
pageIndex: e,
|
|
2291
2290
|
spineItemId: t,
|
|
2292
2291
|
...i,
|
|
@@ -2301,7 +2300,7 @@ class _i {
|
|
|
2301
2300
|
...t
|
|
2302
2301
|
}) {
|
|
2303
2302
|
const i = this.reader.spine.pages.fromAbsolutePageIndex(e);
|
|
2304
|
-
if (
|
|
2303
|
+
if (se.debug(".goToAbsolutePageIndex()", {
|
|
2305
2304
|
absolutePageIndex: e,
|
|
2306
2305
|
...t,
|
|
2307
2306
|
foundInfo: i
|
|
@@ -2319,13 +2318,13 @@ class _i {
|
|
|
2319
2318
|
}
|
|
2320
2319
|
}
|
|
2321
2320
|
}
|
|
2322
|
-
class
|
|
2321
|
+
class _i {
|
|
2323
2322
|
constructor(e) {
|
|
2324
2323
|
this.reader = e, this.lastDelta = { x: 0, y: 0 }, this.lastPosition = new M({ x: 0, y: 0 }), this.lastStartPosition = new M({ x: 0, y: 0 }), this.unlock = void 0;
|
|
2325
2324
|
}
|
|
2326
2325
|
moveTo(e, { final: t, start: i } = {}) {
|
|
2327
2326
|
if (this.reader.settings.values.computedPageTurnMode === "scrollable") {
|
|
2328
|
-
|
|
2327
|
+
se.warn(
|
|
2329
2328
|
"pan control is not available on free page turn mode"
|
|
2330
2329
|
);
|
|
2331
2330
|
return;
|
|
@@ -2358,8 +2357,8 @@ class Hi {
|
|
|
2358
2357
|
});
|
|
2359
2358
|
}
|
|
2360
2359
|
}
|
|
2361
|
-
const
|
|
2362
|
-
class
|
|
2360
|
+
const Hi = 500;
|
|
2361
|
+
class Bi extends X {
|
|
2363
2362
|
constructor(e, t) {
|
|
2364
2363
|
super(), this.scrollNavigationController = e, this.locker = t, this.navigationSubject = new R(), this.navigation$ = this.navigationSubject.asObservable();
|
|
2365
2364
|
const i = this.scrollNavigationController.userScroll$.pipe(
|
|
@@ -2370,8 +2369,8 @@ class Xi extends X {
|
|
|
2370
2369
|
v(o)
|
|
2371
2370
|
).pipe(
|
|
2372
2371
|
Se(
|
|
2373
|
-
|
|
2374
|
-
|
|
2372
|
+
Hi,
|
|
2373
|
+
ae
|
|
2375
2374
|
),
|
|
2376
2375
|
U(),
|
|
2377
2376
|
x(() => {
|
|
@@ -2393,7 +2392,7 @@ class Xi extends X {
|
|
|
2393
2392
|
P(i).pipe(T(this.destroy$)).subscribe();
|
|
2394
2393
|
}
|
|
2395
2394
|
}
|
|
2396
|
-
const
|
|
2395
|
+
const Xi = (n) => n.pagination.state$.pipe(
|
|
2397
2396
|
O(n.context.manifest$, n.settings.values$),
|
|
2398
2397
|
S(
|
|
2399
2398
|
([
|
|
@@ -2413,7 +2412,7 @@ const Yi = (n) => n.pagination.state$.pipe(
|
|
|
2413
2412
|
}
|
|
2414
2413
|
),
|
|
2415
2414
|
z(V)
|
|
2416
|
-
),
|
|
2415
|
+
), Yi = ({ reader: n, duration: e }) => (t) => {
|
|
2417
2416
|
let i;
|
|
2418
2417
|
const o = () => {
|
|
2419
2418
|
i?.(), i = void 0;
|
|
@@ -2422,18 +2421,18 @@ const Yi = (n) => n.pagination.state$.pipe(
|
|
|
2422
2421
|
x(() => {
|
|
2423
2422
|
i || (i = n?.navigation.lock());
|
|
2424
2423
|
}),
|
|
2425
|
-
|
|
2424
|
+
cn(e, ae, {
|
|
2426
2425
|
trailing: !0,
|
|
2427
2426
|
leading: !0
|
|
2428
2427
|
}),
|
|
2429
2428
|
x(o),
|
|
2430
2429
|
de(o)
|
|
2431
2430
|
);
|
|
2432
|
-
},
|
|
2433
|
-
const t = n(e), i =
|
|
2431
|
+
}, qi = (n) => (e) => {
|
|
2432
|
+
const t = n(e), i = Xi(t), o = new Wi(t), s = new _i(t), r = new Bi(
|
|
2434
2433
|
t.navigation.scrollNavigationController,
|
|
2435
2434
|
t.navigation.locker
|
|
2436
|
-
), a =
|
|
2435
|
+
), a = Vi(t, o), c = r.navigation$.pipe(
|
|
2437
2436
|
x((d) => {
|
|
2438
2437
|
t.navigation.navigate(d);
|
|
2439
2438
|
})
|
|
@@ -2450,7 +2449,7 @@ const Yi = (n) => n.pagination.state$.pipe(
|
|
|
2450
2449
|
navigation: {
|
|
2451
2450
|
...t.navigation,
|
|
2452
2451
|
state$: i,
|
|
2453
|
-
throttleLock: ({ duration: d, trigger: g }) => g.pipe(
|
|
2452
|
+
throttleLock: ({ duration: d, trigger: g }) => g.pipe(Yi({ duration: d, reader: t })),
|
|
2454
2453
|
moveTo: s.moveTo.bind(s),
|
|
2455
2454
|
turnBottom: o.turnBottom.bind(o),
|
|
2456
2455
|
turnTop: o.turnTop.bind(o),
|
|
@@ -2473,7 +2472,7 @@ const Yi = (n) => n.pagination.state$.pipe(
|
|
|
2473
2472
|
goToAbsolutePageIndex: o.goToAbsolutePageIndex.bind(o)
|
|
2474
2473
|
}
|
|
2475
2474
|
};
|
|
2476
|
-
},
|
|
2475
|
+
}, Ht = (n, e, t) => {
|
|
2477
2476
|
const i = t.spineItems.findIndex(
|
|
2478
2477
|
(o) => o.href === n
|
|
2479
2478
|
);
|
|
@@ -2490,7 +2489,7 @@ const Yi = (n) => n.pagination.state$.pipe(
|
|
|
2490
2489
|
const m = {
|
|
2491
2490
|
title: s.title,
|
|
2492
2491
|
path: s.path
|
|
2493
|
-
}, y =
|
|
2492
|
+
}, y = Ht(n, s.contents, t);
|
|
2494
2493
|
return y ? {
|
|
2495
2494
|
...m,
|
|
2496
2495
|
subChapter: y
|
|
@@ -2498,19 +2497,19 @@ const Yi = (n) => n.pagination.state$.pipe(
|
|
|
2498
2497
|
}
|
|
2499
2498
|
return o;
|
|
2500
2499
|
}, void 0);
|
|
2501
|
-
},
|
|
2500
|
+
}, Gi = (n, e) => {
|
|
2502
2501
|
const { href: t } = e;
|
|
2503
|
-
return
|
|
2504
|
-
},
|
|
2502
|
+
return Ht(t, n.nav?.toc ?? [], n);
|
|
2503
|
+
}, Zi = (n) => {
|
|
2505
2504
|
const e = n.context.manifest, t = n.spineItemsManager.items;
|
|
2506
2505
|
return e ? t.reduce(
|
|
2507
|
-
(i, { item: o }) => (i[o.id] =
|
|
2506
|
+
(i, { item: o }) => (i[o.id] = Gi(e, o), i),
|
|
2508
2507
|
{}
|
|
2509
2508
|
) : {};
|
|
2510
|
-
},
|
|
2511
|
-
|
|
2512
|
-
S(() =>
|
|
2513
|
-
),
|
|
2509
|
+
}, Ji = (n) => n.spineItemsManager.items$.pipe(
|
|
2510
|
+
te([]),
|
|
2511
|
+
S(() => Zi(n))
|
|
2512
|
+
), Ki = (n, e, t) => n + e * t, Qi = (n, e, t) => {
|
|
2514
2513
|
const { height: i, width: o } = t.layout.layoutInfo, { top: s, left: r } = n.spine.getSpineItemSpineLayoutInfo(t);
|
|
2515
2514
|
return n.settings.values.computedPageTurnDirection === "vertical" ? Math.max(
|
|
2516
2515
|
0,
|
|
@@ -2525,7 +2524,7 @@ const Yi = (n) => n.pagination.state$.pipe(
|
|
|
2525
2524
|
(e.x - r + n.viewport.absoluteViewport.width) / o
|
|
2526
2525
|
)
|
|
2527
2526
|
);
|
|
2528
|
-
},
|
|
2527
|
+
}, eo = (n, e, t, i, o) => o.isReady$.pipe(
|
|
2529
2528
|
U(),
|
|
2530
2529
|
O(n.layoutInfo$),
|
|
2531
2530
|
S(([s, r]) => {
|
|
@@ -2535,18 +2534,18 @@ const Yi = (n) => n.pagination.state$.pipe(
|
|
|
2535
2534
|
let m = (t + 1) * (p / h);
|
|
2536
2535
|
!c && o.renditionLayout === "reflowable" && !s && (m = 0);
|
|
2537
2536
|
let y = l + m;
|
|
2538
|
-
return a.manifest?.renditionFlow === "scrolled-continuous" && (s ? m =
|
|
2537
|
+
return a.manifest?.renditionFlow === "scrolled-continuous" && (s ? m = Qi(
|
|
2539
2538
|
n,
|
|
2540
2539
|
i,
|
|
2541
2540
|
o
|
|
2542
|
-
) : m = 0, y =
|
|
2541
|
+
) : m = 0, y = Ki(
|
|
2543
2542
|
l,
|
|
2544
2543
|
p,
|
|
2545
2544
|
m
|
|
2546
2545
|
)), e === u - 1 && t === h - 1 && y > 0.99 ? 1 : y;
|
|
2547
2546
|
})
|
|
2548
|
-
),
|
|
2549
|
-
Se(10,
|
|
2547
|
+
), to = (n) => n.spine.layout$.pipe(
|
|
2548
|
+
Se(10, ae),
|
|
2550
2549
|
O(n.pagination.state$),
|
|
2551
2550
|
S(() => ({
|
|
2552
2551
|
numberOfPagesPerItems: n.spineItemsManager.items.reduce(
|
|
@@ -2559,11 +2558,11 @@ const Yi = (n) => n.pagination.state$.pipe(
|
|
|
2559
2558
|
numberOfTotalPages: n.spine.pages.value.pages.length
|
|
2560
2559
|
})),
|
|
2561
2560
|
z(V),
|
|
2562
|
-
|
|
2561
|
+
te({
|
|
2563
2562
|
numberOfPagesPerItems: [],
|
|
2564
2563
|
numberOfTotalPages: 0
|
|
2565
2564
|
})
|
|
2566
|
-
),
|
|
2565
|
+
), no = (n, e, t, i) => {
|
|
2567
2566
|
const o = e.beginSpineItemIndex !== void 0 ? n.spineItemsManager.get(e.beginSpineItemIndex) : void 0, s = e.endSpineItemIndex !== void 0 ? n.spineItemsManager.get(e.endSpineItemIndex) : void 0;
|
|
2568
2567
|
return v({
|
|
2569
2568
|
...e,
|
|
@@ -2594,7 +2593,7 @@ const Yi = (n) => n.pagination.state$.pipe(
|
|
|
2594
2593
|
// hasPreviousChapter: (reader.spine.spineItemIndex || 0) < (manifest.readingOrder.length - 1),
|
|
2595
2594
|
// numberOfSpineItems: context.manifest?.readingOrder.length,
|
|
2596
2595
|
});
|
|
2597
|
-
},
|
|
2596
|
+
}, io = (n) => k([
|
|
2598
2597
|
n.pagination.state$,
|
|
2599
2598
|
// Usually pagination change if layout changes (number of pages) however it is especially
|
|
2600
2599
|
// useful for like webtoon where you still have one page but only the layout will give you the final size
|
|
@@ -2603,7 +2602,7 @@ const Yi = (n) => n.pagination.state$.pipe(
|
|
|
2603
2602
|
]).pipe(
|
|
2604
2603
|
w(([e]) => {
|
|
2605
2604
|
const t = e.endSpineItemIndex !== void 0 ? n.spineItemsManager.get(e.endSpineItemIndex) : void 0;
|
|
2606
|
-
return t ?
|
|
2605
|
+
return t ? eo(
|
|
2607
2606
|
n,
|
|
2608
2607
|
e.endSpineItemIndex ?? 0,
|
|
2609
2608
|
e.endPageIndexInSpineItem || 0,
|
|
@@ -2611,8 +2610,8 @@ const Yi = (n) => n.pagination.state$.pipe(
|
|
|
2611
2610
|
t
|
|
2612
2611
|
) : v(0);
|
|
2613
2612
|
})
|
|
2614
|
-
),
|
|
2615
|
-
const e =
|
|
2613
|
+
), oo = (n) => {
|
|
2614
|
+
const e = Ji(n), t = to(n), i = new H({
|
|
2616
2615
|
...n.pagination.state,
|
|
2617
2616
|
beginChapterInfo: void 0,
|
|
2618
2617
|
beginCfi: void 0,
|
|
@@ -2630,10 +2629,10 @@ const Yi = (n) => n.pagination.state$.pipe(
|
|
|
2630
2629
|
}), o = k([
|
|
2631
2630
|
n.pagination.state$,
|
|
2632
2631
|
e,
|
|
2633
|
-
|
|
2632
|
+
io(n)
|
|
2634
2633
|
]).pipe(
|
|
2635
2634
|
w(
|
|
2636
|
-
([r, a, c]) =>
|
|
2635
|
+
([r, a, c]) => no(
|
|
2637
2636
|
n,
|
|
2638
2637
|
r,
|
|
2639
2638
|
a,
|
|
@@ -2666,18 +2665,18 @@ const Yi = (n) => n.pagination.state$.pipe(
|
|
|
2666
2665
|
x((r) => {
|
|
2667
2666
|
i.next(r);
|
|
2668
2667
|
}),
|
|
2669
|
-
|
|
2668
|
+
K(1)
|
|
2670
2669
|
), getPaginationInfo: () => i.value };
|
|
2671
2670
|
}, he = (n) => ze({
|
|
2672
2671
|
spineIndex: n.index,
|
|
2673
2672
|
spineId: n.id
|
|
2674
|
-
}),
|
|
2673
|
+
}), Bt = ({
|
|
2675
2674
|
nodeOrRange: n,
|
|
2676
2675
|
offset: e,
|
|
2677
2676
|
item: t
|
|
2678
2677
|
}) => {
|
|
2679
2678
|
const i = "ownerDocument" in n ? n.ownerDocument : n.startContainer.ownerDocument;
|
|
2680
|
-
return !i || !i?.documentElement || n === i ? he(t) :
|
|
2679
|
+
return !i || !i?.documentElement || n === i ? he(t) : Nn(n) ? ze({
|
|
2681
2680
|
start: {
|
|
2682
2681
|
node: n.startContainer,
|
|
2683
2682
|
offset: n.startOffset,
|
|
@@ -2704,30 +2703,30 @@ const Yi = (n) => n.pagination.state$.pipe(
|
|
|
2704
2703
|
const o = t.pages.value.pages.find(
|
|
2705
2704
|
(r) => r.itemIndex === e.index && r.pageIndex === n
|
|
2706
2705
|
)?.firstVisibleNode, s = e.renderer.getDocumentFrame();
|
|
2707
|
-
return o && s instanceof HTMLIFrameElement && s.contentWindow?.document ?
|
|
2706
|
+
return o && s instanceof HTMLIFrameElement && s.contentWindow?.document ? Bt({
|
|
2708
2707
|
nodeOrRange: o.node,
|
|
2709
2708
|
offset: o.offset,
|
|
2710
2709
|
item: e.item
|
|
2711
2710
|
}).trim() : he(e.item);
|
|
2712
|
-
},
|
|
2711
|
+
}, so = (n, e) => Bt({
|
|
2713
2712
|
nodeOrRange: n,
|
|
2714
2713
|
item: e
|
|
2715
|
-
}),
|
|
2716
|
-
const e =
|
|
2717
|
-
return
|
|
2718
|
-
},
|
|
2719
|
-
const e =
|
|
2714
|
+
}), Qs = (n) => n.index.toString(), gt = (n) => n[0]?.index === 6 && n.length > 1, Be = (n) => {
|
|
2715
|
+
const e = Ct(n);
|
|
2716
|
+
return wn(e);
|
|
2717
|
+
}, ro = (n) => Array.isArray(n) ? n[0] && gt(n[0]) ? n[0] : void 0 : n.parent[0] && gt(n.parent[0]) ? n.parent[0] : void 0, it = (n) => {
|
|
2718
|
+
const e = Ct(n), s = ((ro(e) ?? [])[1]?.index ?? 2) / 2 - 1, r = Pn(e), a = r ? e.end.at(-1)?.at(-1)?.offset : e.at(-1)?.at(-1)?.offset;
|
|
2720
2719
|
return {
|
|
2721
2720
|
isCfiRange: r,
|
|
2722
2721
|
cleanedCfi: n,
|
|
2723
2722
|
itemIndex: s,
|
|
2724
2723
|
offset: a ?? 0
|
|
2725
2724
|
};
|
|
2726
|
-
},
|
|
2725
|
+
}, Xt = ({
|
|
2727
2726
|
cfi: n,
|
|
2728
2727
|
spineItemsManager: e
|
|
2729
2728
|
}) => {
|
|
2730
|
-
const { itemIndex: t, ...i } =
|
|
2729
|
+
const { itemIndex: t, ...i } = it(n), o = e.get(t);
|
|
2731
2730
|
if (!o)
|
|
2732
2731
|
return {
|
|
2733
2732
|
...i,
|
|
@@ -2739,7 +2738,7 @@ const Yi = (n) => n.pagination.state$.pipe(
|
|
|
2739
2738
|
const r = s.contentWindow?.document;
|
|
2740
2739
|
if (r)
|
|
2741
2740
|
try {
|
|
2742
|
-
const a =
|
|
2741
|
+
const a = xn(n, r, {
|
|
2743
2742
|
throwOnError: !0
|
|
2744
2743
|
});
|
|
2745
2744
|
return {
|
|
@@ -2766,7 +2765,7 @@ const Yi = (n) => n.pagination.state$.pipe(
|
|
|
2766
2765
|
spineItem: o,
|
|
2767
2766
|
node: null
|
|
2768
2767
|
};
|
|
2769
|
-
},
|
|
2768
|
+
}, ao = (n, e) => {
|
|
2770
2769
|
if ("cfi" in e) {
|
|
2771
2770
|
const { itemIndex: s, ...r } = n.cfi.parseCfi(e.cfi);
|
|
2772
2771
|
return {
|
|
@@ -2786,10 +2785,10 @@ const Yi = (n) => n.pagination.state$.pipe(
|
|
|
2786
2785
|
itemIndex: t.index,
|
|
2787
2786
|
node: null
|
|
2788
2787
|
};
|
|
2789
|
-
},
|
|
2788
|
+
}, co = (n, e) => {
|
|
2790
2789
|
let t = n?.itemPageIndex;
|
|
2791
2790
|
const { itemIndex: i, ...o } = e.cfi.parseCfi(n.cfi), s = e.spineItemsManager.get(i);
|
|
2792
|
-
return s ?
|
|
2791
|
+
return s ? Nt().pipe(
|
|
2793
2792
|
O(s.isReady$),
|
|
2794
2793
|
S(([, r]) => {
|
|
2795
2794
|
const {
|
|
@@ -2819,7 +2818,7 @@ const Yi = (n) => n.pagination.state$.pipe(
|
|
|
2819
2818
|
})
|
|
2820
2819
|
) : v({ ...n, itemIndex: i, ...o });
|
|
2821
2820
|
};
|
|
2822
|
-
class
|
|
2821
|
+
class uo {
|
|
2823
2822
|
constructor(e) {
|
|
2824
2823
|
this.reader = e, this.locatorsByKey = /* @__PURE__ */ new Map(), this.deregisterMemoizedStream = (t) => {
|
|
2825
2824
|
const i = this.locatorsByKey.get(t);
|
|
@@ -2827,9 +2826,9 @@ class lo {
|
|
|
2827
2826
|
}, this.locate = (t, i) => {
|
|
2828
2827
|
const o = {
|
|
2829
2828
|
resource: t,
|
|
2830
|
-
meta:
|
|
2829
|
+
meta: ao(this.reader, t)
|
|
2831
2830
|
};
|
|
2832
|
-
return
|
|
2831
|
+
return ct(() => {
|
|
2833
2832
|
const s = this.reader.spineItemsManager.get(
|
|
2834
2833
|
o.meta.itemIndex ?? 0
|
|
2835
2834
|
), r = s?.renditionLayout === "reflowable", a = i.mode === "shallow" || !r || !s ? () => {
|
|
@@ -2851,14 +2850,14 @@ class lo {
|
|
|
2851
2850
|
);
|
|
2852
2851
|
const d = this.reader.spine.layout$.pipe(
|
|
2853
2852
|
Se(10),
|
|
2854
|
-
|
|
2855
|
-
|
|
2853
|
+
te(o),
|
|
2854
|
+
un((g) => co(g.meta, this.reader).pipe(
|
|
2856
2855
|
S((h) => ({
|
|
2857
2856
|
...g,
|
|
2858
2857
|
meta: h
|
|
2859
2858
|
}))
|
|
2860
2859
|
), o),
|
|
2861
|
-
|
|
2860
|
+
K({ refCount: !0, bufferSize: 1 })
|
|
2862
2861
|
);
|
|
2863
2862
|
return c && this.locatorsByKey.set(c, {
|
|
2864
2863
|
observerCount: 1,
|
|
@@ -2868,17 +2867,17 @@ class lo {
|
|
|
2868
2867
|
};
|
|
2869
2868
|
}
|
|
2870
2869
|
locateResource(e, t) {
|
|
2871
|
-
return Array.isArray(e) ?
|
|
2870
|
+
return Array.isArray(e) ? ct(
|
|
2872
2871
|
() => k(
|
|
2873
2872
|
e.map((i) => this.locate(i, t ?? {}))
|
|
2874
|
-
).pipe(
|
|
2873
|
+
).pipe(ln([]))
|
|
2875
2874
|
) : this.locate(e, t ?? {});
|
|
2876
2875
|
}
|
|
2877
2876
|
}
|
|
2878
|
-
const
|
|
2879
|
-
const t = n(e), { paginationInfo$: i, getPaginationInfo: o } =
|
|
2877
|
+
const lo = (n) => (e) => {
|
|
2878
|
+
const t = n(e), { paginationInfo$: i, getPaginationInfo: o } = oo(t);
|
|
2880
2879
|
i.pipe(T(t.$.destroy$)).subscribe();
|
|
2881
|
-
const s = new
|
|
2880
|
+
const s = new uo(t);
|
|
2882
2881
|
return {
|
|
2883
2882
|
...t,
|
|
2884
2883
|
locateResource: s.locateResource.bind(s),
|
|
@@ -2892,7 +2891,7 @@ const po = (n) => (e) => {
|
|
|
2892
2891
|
}
|
|
2893
2892
|
}
|
|
2894
2893
|
};
|
|
2895
|
-
},
|
|
2894
|
+
}, po = (n) => ({
|
|
2896
2895
|
put: (s, r) => new Promise((a, c) => {
|
|
2897
2896
|
const u = n.transaction(["store"], "readwrite");
|
|
2898
2897
|
u.onerror = (g) => {
|
|
@@ -2949,11 +2948,11 @@ const po = (n) => (e) => {
|
|
|
2949
2948
|
i.onerror = (o) => {
|
|
2950
2949
|
t(o);
|
|
2951
2950
|
}, i.onsuccess = () => {
|
|
2952
|
-
e(
|
|
2951
|
+
e(po(i.result));
|
|
2953
2952
|
}, i.onupgradeneeded = () => {
|
|
2954
2953
|
i.result.createObjectStore("store");
|
|
2955
2954
|
};
|
|
2956
|
-
}),
|
|
2955
|
+
}), go = (n) => {
|
|
2957
2956
|
let e = Date.now().toString();
|
|
2958
2957
|
const t = new R(), i = (c) => {
|
|
2959
2958
|
if (typeof c == "string" || typeof c == "object") {
|
|
@@ -2973,13 +2972,13 @@ const po = (n) => (e) => {
|
|
|
2973
2972
|
t.next({ id: c, data: u });
|
|
2974
2973
|
};
|
|
2975
2974
|
t.asObservable().pipe(
|
|
2976
|
-
|
|
2975
|
+
vn(({ id: c, data: u }) => {
|
|
2977
2976
|
const l = i(c);
|
|
2978
2977
|
return l ? N(
|
|
2979
|
-
|
|
2978
|
+
dn([Oe("prose-reader"), N(u.blob())])
|
|
2980
2979
|
).pipe(
|
|
2981
2980
|
_(([d, g]) => N(d.put(`${e}_${l.id}`, g))),
|
|
2982
|
-
|
|
2981
|
+
rt((d) => (D.error(d), Z))
|
|
2983
2982
|
) : Z;
|
|
2984
2983
|
}),
|
|
2985
2984
|
G(n.destroy$)
|
|
@@ -2993,7 +2992,7 @@ const po = (n) => (e) => {
|
|
|
2993
2992
|
_(() => (D.debug("Cleanup up old cache..."), N(Oe("prose-reader")).pipe(
|
|
2994
2993
|
_(
|
|
2995
2994
|
(c) => N(c.keys()).pipe(
|
|
2996
|
-
|
|
2995
|
+
Q(
|
|
2997
2996
|
(u) => u.filter((l) => !l.toString().startsWith(e))
|
|
2998
2997
|
),
|
|
2999
2998
|
_((u) => {
|
|
@@ -3002,7 +3001,7 @@ const po = (n) => (e) => {
|
|
|
3002
3001
|
})
|
|
3003
3002
|
)
|
|
3004
3003
|
),
|
|
3005
|
-
|
|
3004
|
+
rt((c) => (D.error(c), Z))
|
|
3006
3005
|
))),
|
|
3007
3006
|
G(n.destroy$)
|
|
3008
3007
|
).subscribe(), {
|
|
@@ -3011,8 +3010,8 @@ const po = (n) => (e) => {
|
|
|
3011
3010
|
t.complete();
|
|
3012
3011
|
}
|
|
3013
3012
|
};
|
|
3014
|
-
},
|
|
3015
|
-
const t = n(e), i =
|
|
3013
|
+
}, ho = (n) => (e) => {
|
|
3014
|
+
const t = n(e), i = go(t.context);
|
|
3016
3015
|
return {
|
|
3017
3016
|
...t,
|
|
3018
3017
|
// $: {
|
|
@@ -3024,7 +3023,7 @@ const po = (n) => (e) => {
|
|
|
3024
3023
|
}
|
|
3025
3024
|
// load,
|
|
3026
3025
|
};
|
|
3027
|
-
},
|
|
3026
|
+
}, mo = (n, e) => {
|
|
3028
3027
|
const t = n.node.ownerDocument?.createRange(), i = n.node.compareDocumentPosition(e.node);
|
|
3029
3028
|
if (t) {
|
|
3030
3029
|
try {
|
|
@@ -3044,14 +3043,14 @@ const po = (n) => (e) => {
|
|
|
3044
3043
|
}
|
|
3045
3044
|
return t;
|
|
3046
3045
|
}
|
|
3047
|
-
},
|
|
3046
|
+
}, fo = ({
|
|
3048
3047
|
selection: n,
|
|
3049
3048
|
spineItem: e
|
|
3050
3049
|
}) => {
|
|
3051
3050
|
const { anchorNode: t, anchorOffset: i, focusNode: o, focusOffset: s } = n;
|
|
3052
3051
|
if (!(!t || !o))
|
|
3053
3052
|
try {
|
|
3054
|
-
return
|
|
3053
|
+
return mo(
|
|
3055
3054
|
{ node: t, offset: i },
|
|
3056
3055
|
{ node: o, offset: s }
|
|
3057
3056
|
);
|
|
@@ -3063,21 +3062,21 @@ const po = (n) => (e) => {
|
|
|
3063
3062
|
return;
|
|
3064
3063
|
}
|
|
3065
3064
|
};
|
|
3066
|
-
class
|
|
3065
|
+
class yo extends X {
|
|
3067
3066
|
constructor(e) {
|
|
3068
3067
|
super();
|
|
3069
3068
|
const t = e.contentDocument || e.contentWindow?.document;
|
|
3070
3069
|
if (!t)
|
|
3071
3070
|
this.selectionChange$ = ge, this.selectionOver$ = ge;
|
|
3072
3071
|
else {
|
|
3073
|
-
const i =
|
|
3072
|
+
const i = ut(t.body, {
|
|
3074
3073
|
childList: !0,
|
|
3075
3074
|
subtree: !0
|
|
3076
3075
|
}).pipe(
|
|
3077
3076
|
L(
|
|
3078
3077
|
(s) => !!s.find((r) => r.type === "childList" && r.removedNodes.length)
|
|
3079
3078
|
)
|
|
3080
|
-
), o = e.parentElement ?
|
|
3079
|
+
), o = e.parentElement ? ut(e.parentElement, {
|
|
3081
3080
|
childList: !0
|
|
3082
3081
|
}).pipe(
|
|
3083
3082
|
L(
|
|
@@ -3110,7 +3109,7 @@ class So extends X {
|
|
|
3110
3109
|
const r = t.getSelection();
|
|
3111
3110
|
return r && !r.isCollapsed ? [s, r] : void 0;
|
|
3112
3111
|
}),
|
|
3113
|
-
L(
|
|
3112
|
+
L(J)
|
|
3114
3113
|
)
|
|
3115
3114
|
),
|
|
3116
3115
|
T(P(o, this.destroy$))
|
|
@@ -3118,11 +3117,11 @@ class So extends X {
|
|
|
3118
3117
|
}
|
|
3119
3118
|
}
|
|
3120
3119
|
}
|
|
3121
|
-
const
|
|
3120
|
+
const So = (n) => n.watch("isLoaded").pipe(
|
|
3122
3121
|
w(() => {
|
|
3123
3122
|
const e = n.renderer.getDocumentFrame(), t = e?.contentDocument || e?.contentWindow?.document;
|
|
3124
3123
|
if (!e || !t) return ge;
|
|
3125
|
-
const i = new
|
|
3124
|
+
const i = new yo(e);
|
|
3126
3125
|
return P(
|
|
3127
3126
|
i.selectionChange$.pipe(
|
|
3128
3127
|
S((o) => {
|
|
@@ -3149,14 +3148,14 @@ const bo = (n) => n.watch("isLoaded").pipe(
|
|
|
3149
3148
|
);
|
|
3150
3149
|
}),
|
|
3151
3150
|
z()
|
|
3152
|
-
),
|
|
3151
|
+
), bo = (n) => (e) => {
|
|
3153
3152
|
const t = n(e);
|
|
3154
3153
|
let i;
|
|
3155
3154
|
const o = t.spineItemsManager.items$.pipe(
|
|
3156
3155
|
w((l) => {
|
|
3157
3156
|
const d = l.map((g) => {
|
|
3158
3157
|
const h = t.spineItemsManager.getSpineItemIndex(g) ?? 0;
|
|
3159
|
-
return
|
|
3158
|
+
return So(g).pipe(
|
|
3160
3159
|
S((p) => {
|
|
3161
3160
|
if (p)
|
|
3162
3161
|
return {
|
|
@@ -3168,12 +3167,12 @@ const bo = (n) => n.watch("isLoaded").pipe(
|
|
|
3168
3167
|
});
|
|
3169
3168
|
return P(...d);
|
|
3170
3169
|
}),
|
|
3171
|
-
|
|
3170
|
+
te(void 0),
|
|
3172
3171
|
z(),
|
|
3173
3172
|
x((l) => {
|
|
3174
3173
|
i = l;
|
|
3175
3174
|
}),
|
|
3176
|
-
|
|
3175
|
+
K({ refCount: !0, bufferSize: 1 })
|
|
3177
3176
|
), s = o, r = o.pipe(
|
|
3178
3177
|
S((l) => !!l),
|
|
3179
3178
|
z(),
|
|
@@ -3188,12 +3187,12 @@ const bo = (n) => n.watch("isLoaded").pipe(
|
|
|
3188
3187
|
L((l) => l?.type === "over"),
|
|
3189
3188
|
E()
|
|
3190
3189
|
), u = t.context.watch("rootElement").pipe(
|
|
3191
|
-
L(
|
|
3190
|
+
L(J),
|
|
3192
3191
|
w((l) => q(l, "pointerdown")),
|
|
3193
3192
|
O(s),
|
|
3194
3193
|
S(([, l]) => l),
|
|
3195
|
-
|
|
3196
|
-
|
|
3194
|
+
te(void 0),
|
|
3195
|
+
K({ refCount: !0, bufferSize: 1 })
|
|
3197
3196
|
);
|
|
3198
3197
|
return P(s, u).pipe(T(t.$.destroy$)).subscribe(), {
|
|
3199
3198
|
...t,
|
|
@@ -3204,10 +3203,10 @@ const bo = (n) => n.watch("isLoaded").pipe(
|
|
|
3204
3203
|
selectionOver$: c,
|
|
3205
3204
|
lastSelectionOnPointerdown$: u,
|
|
3206
3205
|
getSelection: () => i,
|
|
3207
|
-
createOrderedRangeFromSelection:
|
|
3206
|
+
createOrderedRangeFromSelection: fo
|
|
3208
3207
|
}
|
|
3209
3208
|
};
|
|
3210
|
-
},
|
|
3209
|
+
}, ht = [
|
|
3211
3210
|
{
|
|
3212
3211
|
name: "bright",
|
|
3213
3212
|
backgroundColor: "white"
|
|
@@ -3222,11 +3221,11 @@ const bo = (n) => n.watch("isLoaded").pipe(
|
|
|
3222
3221
|
backgroundColor: "#191717",
|
|
3223
3222
|
foregroundColor: "#f1ebeb"
|
|
3224
3223
|
}
|
|
3225
|
-
],
|
|
3224
|
+
], Io = (n) => (e) => {
|
|
3226
3225
|
const t = n(e), i = new H(
|
|
3227
3226
|
e.theme ?? "bright"
|
|
3228
3227
|
), o = () => {
|
|
3229
|
-
const a =
|
|
3228
|
+
const a = ht.find(
|
|
3230
3229
|
(c) => c.name === i.value
|
|
3231
3230
|
);
|
|
3232
3231
|
return `
|
|
@@ -3243,7 +3242,7 @@ const bo = (n) => n.watch("isLoaded").pipe(
|
|
|
3243
3242
|
}, s = ({
|
|
3244
3243
|
container: a
|
|
3245
3244
|
}) => {
|
|
3246
|
-
const c =
|
|
3245
|
+
const c = ht.find(
|
|
3247
3246
|
(u) => u.name === i.value
|
|
3248
3247
|
);
|
|
3249
3248
|
return c && a.style.setProperty(
|
|
@@ -3254,14 +3253,14 @@ const bo = (n) => n.watch("isLoaded").pipe(
|
|
|
3254
3253
|
}, r = () => {
|
|
3255
3254
|
t.spineItemsManager.items.forEach((a) => {
|
|
3256
3255
|
const c = a.renderer.getDocumentFrame();
|
|
3257
|
-
c &&
|
|
3256
|
+
c && ne(c, "prose-reader-theme", o()), s({ container: a.element });
|
|
3258
3257
|
});
|
|
3259
3258
|
};
|
|
3260
3259
|
return t.hookManager.register("item.onDocumentLoad", ({ itemId: a }) => {
|
|
3261
3260
|
const c = t.spineItemsManager.get(a);
|
|
3262
3261
|
if (c?.renditionLayout !== "pre-paginated") {
|
|
3263
3262
|
const u = c?.renderer.getDocumentFrame();
|
|
3264
|
-
u &&
|
|
3263
|
+
u && ne(u, "prose-reader-theme", o());
|
|
3265
3264
|
}
|
|
3266
3265
|
}), t.spineItemsManager.items$.pipe(
|
|
3267
3266
|
j(
|
|
@@ -3287,15 +3286,15 @@ const bo = (n) => n.watch("isLoaded").pipe(
|
|
|
3287
3286
|
}
|
|
3288
3287
|
}
|
|
3289
3288
|
};
|
|
3290
|
-
},
|
|
3289
|
+
}, vo = (n) => (e) => ({
|
|
3291
3290
|
...n(e),
|
|
3292
3291
|
utils: {
|
|
3293
|
-
isOrIsWithinValidLink: (o) => !!(
|
|
3292
|
+
isOrIsWithinValidLink: (o) => !!(At(o) && (o.nodeName === "a" ? o : o.closest("a"))?.getAttribute("href"))
|
|
3294
3293
|
}
|
|
3295
3294
|
});
|
|
3296
3295
|
navigator.userAgent.indexOf("") > -1 && navigator.userAgent.indexOf("Chrome") <= -1;
|
|
3297
|
-
const
|
|
3298
|
-
class
|
|
3296
|
+
const wo = (n) => (e) => n(e), Po = "[data-prose-reader-scroll-navigator][data-prose-reader-zooming=true]{overflow:scroll}[data-prose-reader-scroll-navigator][data-prose-reader-zooming=true][data-prose-reader-zooming-direction=down]{overflow-x:auto}";
|
|
3297
|
+
class ue extends ie {
|
|
3299
3298
|
constructor(e) {
|
|
3300
3299
|
super((t) => this.stateSubject.pipe(T(this._destroy$)).subscribe(t)), this._destroy$ = new R(), this.destroy$ = this._destroy$.asObservable(), this.stateSubject = new H(e);
|
|
3301
3300
|
}
|
|
@@ -3310,7 +3309,7 @@ class ce extends ne {
|
|
|
3310
3309
|
V(this.value, t) || this.stateSubject.next(t);
|
|
3311
3310
|
}
|
|
3312
3311
|
watch(e) {
|
|
3313
|
-
return Array.isArray(e) ? this.stateSubject.pipe(
|
|
3312
|
+
return Array.isArray(e) ? this.stateSubject.pipe(Qe(e)) : this.stateSubject.pipe(
|
|
3314
3313
|
S((t) => t[e]),
|
|
3315
3314
|
z(V)
|
|
3316
3315
|
);
|
|
@@ -3322,30 +3321,30 @@ class ce extends ne {
|
|
|
3322
3321
|
this.stateSubject.complete(), this._destroy$.complete();
|
|
3323
3322
|
}
|
|
3324
3323
|
}
|
|
3325
|
-
const
|
|
3324
|
+
const xo = (n, e, t) => {
|
|
3326
3325
|
t.style.transformOrigin = "0 0";
|
|
3327
3326
|
const i = `translate3d(${e.x}px, ${e.y}px, 0px)`, o = `scale(${n})`;
|
|
3328
3327
|
t.style.transform = `${i} ${o}`;
|
|
3329
|
-
},
|
|
3328
|
+
}, $o = (n, e, t, i) => {
|
|
3330
3329
|
const o = e / n, s = t.clientWidth, r = t.clientHeight, a = s / 2 - i.x, c = r / 2 - i.y;
|
|
3331
3330
|
return {
|
|
3332
3331
|
x: i.x + a * (1 - o),
|
|
3333
3332
|
y: i.y + c * (1 - o)
|
|
3334
3333
|
};
|
|
3335
3334
|
};
|
|
3336
|
-
class
|
|
3335
|
+
class Yt {
|
|
3337
3336
|
constructor(e) {
|
|
3338
3337
|
this.x = e.x, this.y = e.y;
|
|
3339
3338
|
}
|
|
3340
3339
|
}
|
|
3341
|
-
class
|
|
3340
|
+
class mt extends Yt {
|
|
3342
3341
|
}
|
|
3343
|
-
class
|
|
3342
|
+
class To extends Yt {
|
|
3344
3343
|
constructor() {
|
|
3345
3344
|
super(...arguments), this.__symbol = Symbol("UnboundScrollPosition");
|
|
3346
3345
|
}
|
|
3347
3346
|
}
|
|
3348
|
-
class
|
|
3347
|
+
class Fo extends ue {
|
|
3349
3348
|
constructor(e, t, i, o, s) {
|
|
3350
3349
|
super({
|
|
3351
3350
|
element: void 0
|
|
@@ -3363,15 +3362,15 @@ class Lo extends ce {
|
|
|
3363
3362
|
x(() => {
|
|
3364
3363
|
this.scrollingSubject.next(!1);
|
|
3365
3364
|
}),
|
|
3366
|
-
T(P(this.scrollingSubject.pipe(
|
|
3365
|
+
T(P(this.scrollingSubject.pipe(Ft(1)), this.destroy$))
|
|
3367
3366
|
).subscribe(), this.hookManager.execute("onViewportOffsetAdjust", void 0, {});
|
|
3368
3367
|
};
|
|
3369
3368
|
const r = this.context.pipe(
|
|
3370
|
-
|
|
3369
|
+
Qe(["rootElement"]),
|
|
3371
3370
|
x(({ rootElement: d }) => {
|
|
3372
3371
|
if (!d) return;
|
|
3373
3372
|
const g = document.createElement("div");
|
|
3374
|
-
g.setAttribute(`data-${
|
|
3373
|
+
g.setAttribute(`data-${si}`, ""), g.appendChild(this.viewport.value.element), d.appendChild(g), this.update({ element: g });
|
|
3375
3374
|
})
|
|
3376
3375
|
), a = k([
|
|
3377
3376
|
t.watch(["computedPageTurnMode"]),
|
|
@@ -3382,17 +3381,17 @@ class Lo extends ce {
|
|
|
3382
3381
|
})
|
|
3383
3382
|
), c = this.navigateSubject.pipe(x(this.setViewportPosition));
|
|
3384
3383
|
this.isNavigating$ = this.navigateSubject.pipe(
|
|
3385
|
-
|
|
3384
|
+
te(!1),
|
|
3386
3385
|
w(() => P(v(!0), v(!1))),
|
|
3387
|
-
|
|
3386
|
+
K(1)
|
|
3388
3387
|
);
|
|
3389
3388
|
const u = P(
|
|
3390
3389
|
o.element$.pipe(
|
|
3391
|
-
L(
|
|
3392
|
-
w((d) =>
|
|
3390
|
+
L(J),
|
|
3391
|
+
w((d) => et(d))
|
|
3393
3392
|
),
|
|
3394
3393
|
o.element$.pipe(
|
|
3395
|
-
L(
|
|
3394
|
+
L(J),
|
|
3396
3395
|
w((d) => q(d, "scroll"))
|
|
3397
3396
|
),
|
|
3398
3397
|
o.spineItemsObserver.itemResize$
|
|
@@ -3400,11 +3399,11 @@ class Lo extends ce {
|
|
|
3400
3399
|
w(
|
|
3401
3400
|
() => Te(10).pipe(
|
|
3402
3401
|
S(() => !1),
|
|
3403
|
-
|
|
3402
|
+
te(!0)
|
|
3404
3403
|
)
|
|
3405
3404
|
),
|
|
3406
3405
|
z(),
|
|
3407
|
-
|
|
3406
|
+
te(!1)
|
|
3408
3407
|
), l = k([
|
|
3409
3408
|
u,
|
|
3410
3409
|
this.isScrolling$
|
|
@@ -3412,10 +3411,10 @@ class Lo extends ce {
|
|
|
3412
3411
|
S(
|
|
3413
3412
|
([d, g]) => d || g
|
|
3414
3413
|
),
|
|
3415
|
-
|
|
3414
|
+
K(1)
|
|
3416
3415
|
);
|
|
3417
3416
|
this.userScroll$ = this.watch("element").pipe(
|
|
3418
|
-
L(
|
|
3417
|
+
L(J),
|
|
3419
3418
|
w(
|
|
3420
3419
|
(d) => t.watch(["computedPageTurnMode"]).pipe(
|
|
3421
3420
|
w(
|
|
@@ -3440,35 +3439,35 @@ class Lo extends ce {
|
|
|
3440
3439
|
}
|
|
3441
3440
|
fromScrollPosition(e) {
|
|
3442
3441
|
const t = this.viewport.scaleFactor;
|
|
3443
|
-
return new
|
|
3442
|
+
return new ce({
|
|
3444
3443
|
x: e.x / t,
|
|
3445
3444
|
y: e.y / t
|
|
3446
3445
|
});
|
|
3447
3446
|
}
|
|
3448
3447
|
fromSpinePosition(e) {
|
|
3449
3448
|
const t = this.viewport.scaleFactor;
|
|
3450
|
-
return new
|
|
3449
|
+
return new mt({
|
|
3451
3450
|
x: e.x * t,
|
|
3452
3451
|
y: e.y * t
|
|
3453
3452
|
});
|
|
3454
3453
|
}
|
|
3455
3454
|
get scrollPosition() {
|
|
3456
3455
|
const e = this.value.element;
|
|
3457
|
-
return new
|
|
3456
|
+
return new mt({
|
|
3458
3457
|
x: e?.scrollLeft ?? 0,
|
|
3459
3458
|
y: e?.scrollTop ?? 0
|
|
3460
3459
|
});
|
|
3461
3460
|
}
|
|
3462
3461
|
}
|
|
3463
|
-
const
|
|
3462
|
+
const Lo = (n, e, t, i, o) => {
|
|
3464
3463
|
const s = n.clientWidth, r = n.clientHeight, a = n.scrollLeft, c = n.scrollTop, u = a + s / 2 - i, l = c + r / 2 - o, d = t / e, g = u * d, h = l * d, p = g - s / 2 + i, m = h - r / 2 + o;
|
|
3465
|
-
return new
|
|
3464
|
+
return new To({
|
|
3466
3465
|
x: p,
|
|
3467
3466
|
y: m
|
|
3468
3467
|
});
|
|
3469
|
-
},
|
|
3470
|
-
const t = e.viewport, i = e.navigation.scrollNavigationController, o = t.value.element, s = i.value.element, r = i.value.element, a = Math.round(t.scaleFactor * 100) / 100, c = o.offsetLeft, u = o.offsetTop, l =
|
|
3471
|
-
s ??
|
|
3468
|
+
}, Mo = (n, e) => {
|
|
3469
|
+
const t = e.viewport, i = e.navigation.scrollNavigationController, o = t.value.element, s = i.value.element, r = i.value.element, a = Math.round(t.scaleFactor * 100) / 100, c = o.offsetLeft, u = o.offsetTop, l = Lo(
|
|
3470
|
+
s ?? Rn(),
|
|
3472
3471
|
a,
|
|
3473
3472
|
n,
|
|
3474
3473
|
c,
|
|
@@ -3481,7 +3480,7 @@ const Mo = (n, e, t, i, o) => {
|
|
|
3481
3480
|
l
|
|
3482
3481
|
);
|
|
3483
3482
|
}, ve = 200;
|
|
3484
|
-
class
|
|
3483
|
+
class Co extends ue {
|
|
3485
3484
|
constructor(e) {
|
|
3486
3485
|
super({
|
|
3487
3486
|
isZooming: !1,
|
|
@@ -3547,7 +3546,7 @@ class Eo extends ce {
|
|
|
3547
3546
|
}
|
|
3548
3547
|
updateZoom(e, t) {
|
|
3549
3548
|
if (this.isControlled) {
|
|
3550
|
-
const i = t ||
|
|
3549
|
+
const i = t || $o(
|
|
3551
3550
|
this.value.currentScale,
|
|
3552
3551
|
e,
|
|
3553
3552
|
this.viewport.element,
|
|
@@ -3564,13 +3563,13 @@ class Eo extends ce {
|
|
|
3564
3563
|
}
|
|
3565
3564
|
applyZoom(e, t) {
|
|
3566
3565
|
if (this.isControlled)
|
|
3567
|
-
|
|
3566
|
+
xo(
|
|
3568
3567
|
e,
|
|
3569
3568
|
t,
|
|
3570
3569
|
this.viewport.element
|
|
3571
3570
|
);
|
|
3572
3571
|
else {
|
|
3573
|
-
const i =
|
|
3572
|
+
const i = Mo(e, this.reader);
|
|
3574
3573
|
this.reader.navigation.navigate({
|
|
3575
3574
|
position: i
|
|
3576
3575
|
});
|
|
@@ -3586,11 +3585,11 @@ class Eo extends ce {
|
|
|
3586
3585
|
return this.reader.viewport.value;
|
|
3587
3586
|
}
|
|
3588
3587
|
}
|
|
3589
|
-
const
|
|
3590
|
-
const t = n(e), i = new
|
|
3591
|
-
|
|
3588
|
+
const ft = `${kt}-enhancer-zoom`, Eo = (n) => (e) => {
|
|
3589
|
+
const t = n(e), i = new Co(t);
|
|
3590
|
+
Ze(document, ft, Po);
|
|
3592
3591
|
const o = () => {
|
|
3593
|
-
|
|
3592
|
+
Je(document, ft), i.destroy(), t.destroy();
|
|
3594
3593
|
}, s = i;
|
|
3595
3594
|
return {
|
|
3596
3595
|
...t,
|
|
@@ -3606,10 +3605,10 @@ const yt = `${Ut}-enhancer-zoom`, Do = (n) => (e) => {
|
|
|
3606
3605
|
}
|
|
3607
3606
|
}
|
|
3608
3607
|
};
|
|
3609
|
-
},
|
|
3610
|
-
class
|
|
3608
|
+
}, qt = (n) => n?.renditionLayout === "pre-paginated" || n?.spineItems.every((e) => e.renditionLayout === "pre-paginated");
|
|
3609
|
+
class Do {
|
|
3611
3610
|
constructor() {
|
|
3612
|
-
this.navigationSubject = new
|
|
3611
|
+
this.navigationSubject = new ot(1), this.viewportStateSubject = new H("free"), this.paginationSubject = new ot(), this.navigationIsLockedSubject = new H(!1), this.pagination$ = this.paginationSubject.asObservable(), this.navigationUnlocked$ = this.navigationIsLockedSubject.pipe(
|
|
3613
3612
|
z(),
|
|
3614
3613
|
L((e) => !e)
|
|
3615
3614
|
), this.viewportState$ = this.viewportStateSubject.asObservable(), this.viewportFree$ = this.viewportState$.pipe(
|
|
@@ -3619,13 +3618,13 @@ class Ro {
|
|
|
3619
3618
|
), this.navigation$ = this.navigationSubject.asObservable();
|
|
3620
3619
|
}
|
|
3621
3620
|
}
|
|
3622
|
-
class
|
|
3621
|
+
class Ro extends ue {
|
|
3623
3622
|
constructor() {
|
|
3624
3623
|
super({
|
|
3625
3624
|
assumedRenditionLayout: "reflowable"
|
|
3626
|
-
}), this.bridgeEvent = new
|
|
3627
|
-
|
|
3628
|
-
|
|
3625
|
+
}), this.bridgeEvent = new Do(), this.manifest$ = this.pipe(
|
|
3626
|
+
Q((e) => e.manifest),
|
|
3627
|
+
re(J),
|
|
3629
3628
|
pe()
|
|
3630
3629
|
), this.isRTL = () => this.value.manifest?.readingDirection === "rtl";
|
|
3631
3630
|
}
|
|
@@ -3634,7 +3633,7 @@ class Ao extends ce {
|
|
|
3634
3633
|
...t,
|
|
3635
3634
|
...e,
|
|
3636
3635
|
...e.manifest && {
|
|
3637
|
-
isFullyPrePaginated:
|
|
3636
|
+
isFullyPrePaginated: qt(i),
|
|
3638
3637
|
assumedRenditionLayout: i?.renditionLayout ?? "reflowable"
|
|
3639
3638
|
}
|
|
3640
3639
|
};
|
|
@@ -3647,7 +3646,7 @@ class Ao extends ce {
|
|
|
3647
3646
|
return this.manifest?.readingDirection;
|
|
3648
3647
|
}
|
|
3649
3648
|
}
|
|
3650
|
-
class
|
|
3649
|
+
class Ao extends ue {
|
|
3651
3650
|
constructor(e, t) {
|
|
3652
3651
|
super({
|
|
3653
3652
|
supportedPageTurnAnimation: ["fade", "none", "slide"],
|
|
@@ -3682,7 +3681,7 @@ class Oo extends ce {
|
|
|
3682
3681
|
).subscribe(this.next.bind(this));
|
|
3683
3682
|
}
|
|
3684
3683
|
}
|
|
3685
|
-
class
|
|
3684
|
+
class Oo {
|
|
3686
3685
|
constructor() {
|
|
3687
3686
|
this._hooks = [], this._hookExecutions = [];
|
|
3688
3687
|
}
|
|
@@ -3744,23 +3743,23 @@ class No {
|
|
|
3744
3743
|
return k(s);
|
|
3745
3744
|
}
|
|
3746
3745
|
}
|
|
3747
|
-
const
|
|
3746
|
+
const No = "[data-prose-reader-scroll-navigator]{height:100%;width:100%;position:relative;overflow-y:scroll;overflow-x:hidden}[data-prose-reader-viewport]{background-color:#fff;position:relative;height:100%;width:100%}", Vo = (n) => ({
|
|
3748
3747
|
x: -n.x,
|
|
3749
3748
|
y: -n.y
|
|
3750
|
-
}),
|
|
3749
|
+
}), jo = (n) => n instanceof DOMMatrix ? new M({
|
|
3751
3750
|
x: -n.e,
|
|
3752
3751
|
y: -n.f
|
|
3753
3752
|
}) : new M({
|
|
3754
3753
|
x: -n.x,
|
|
3755
3754
|
y: -n.y
|
|
3756
|
-
}),
|
|
3757
|
-
class
|
|
3755
|
+
}), ko = "navigation/ViewportNavigator", yt = D.namespace(ko);
|
|
3756
|
+
class Uo extends X {
|
|
3758
3757
|
constructor(e, t, i, o, s) {
|
|
3759
3758
|
super(), this.settings = e, this.hookManager = t, this.context = i, this.spine = o, this.viewport = s, this.navigateSubject = new R(), this.element$ = new H(
|
|
3760
3759
|
document.createElement("div")
|
|
3761
3760
|
);
|
|
3762
3761
|
const r = this.spine.element$.pipe(
|
|
3763
|
-
L(
|
|
3762
|
+
L(J),
|
|
3764
3763
|
O(this.element$),
|
|
3765
3764
|
x(([l, d]) => {
|
|
3766
3765
|
d.style.cssText = `
|
|
@@ -3783,13 +3782,13 @@ class zo extends X {
|
|
|
3783
3782
|
);
|
|
3784
3783
|
this.layout$ = c.pipe(
|
|
3785
3784
|
x(() => {
|
|
3786
|
-
|
|
3785
|
+
yt.info("layout", e.values);
|
|
3787
3786
|
}),
|
|
3788
3787
|
E()
|
|
3789
3788
|
);
|
|
3790
3789
|
const u = this.navigateSubject.pipe(
|
|
3791
3790
|
x((l) => {
|
|
3792
|
-
|
|
3791
|
+
yt.info("Navigation requested", l);
|
|
3793
3792
|
})
|
|
3794
3793
|
);
|
|
3795
3794
|
this.isNavigating$ = u.pipe(
|
|
@@ -3816,7 +3815,7 @@ class zo extends X {
|
|
|
3816
3815
|
* anything for x ms while we effectively adjust. We want it to be immediate.
|
|
3817
3816
|
* However when user is repeatedly turning page, we can improve smoothness by delaying a bit the adjustment
|
|
3818
3817
|
*/
|
|
3819
|
-
l.shouldAnimate ? we(1,
|
|
3818
|
+
l.shouldAnimate ? we(1, ae) : Pe,
|
|
3820
3819
|
x((p) => {
|
|
3821
3820
|
const m = this.element$.getValue();
|
|
3822
3821
|
p.shouldAnimate ? h === "fade" ? (m.style.setProperty(
|
|
@@ -3838,12 +3837,12 @@ class zo extends X {
|
|
|
3838
3837
|
x((p) => {
|
|
3839
3838
|
h !== "fade" && this.setViewportPosition(p.position);
|
|
3840
3839
|
}),
|
|
3841
|
-
l.shouldAnimate ? we(g / 2,
|
|
3840
|
+
l.shouldAnimate ? we(g / 2, ae) : Pe,
|
|
3842
3841
|
x((p) => {
|
|
3843
3842
|
const m = this.element$.getValue();
|
|
3844
3843
|
h === "fade" && (this.setViewportPosition(p.position), m.style.setProperty("opacity", "1"));
|
|
3845
3844
|
}),
|
|
3846
|
-
l.shouldAnimate ? we(g / 2,
|
|
3845
|
+
l.shouldAnimate ? we(g / 2, ae) : Pe,
|
|
3847
3846
|
x((p) => {
|
|
3848
3847
|
h === "fade" && this.setViewportPosition(p.position);
|
|
3849
3848
|
})
|
|
@@ -3853,8 +3852,8 @@ class zo extends X {
|
|
|
3853
3852
|
)
|
|
3854
3853
|
);
|
|
3855
3854
|
}),
|
|
3856
|
-
|
|
3857
|
-
|
|
3855
|
+
te(!1),
|
|
3856
|
+
K(1)
|
|
3858
3857
|
), P(r, this.isNavigating$, this.layout$).pipe(T(this.destroy$)).subscribe();
|
|
3859
3858
|
}
|
|
3860
3859
|
/**
|
|
@@ -3866,7 +3865,7 @@ class zo extends X {
|
|
|
3866
3865
|
* for remark about flicker / fonts smoothing
|
|
3867
3866
|
*/
|
|
3868
3867
|
setViewportPosition(e) {
|
|
3869
|
-
const t = this.element$.getValue(), i =
|
|
3868
|
+
const t = this.element$.getValue(), i = Vo(e);
|
|
3870
3869
|
t.style.transform = `translate(${i.x}px, ${i.y}px)`, this.hookManager.execute("onViewportOffsetAdjust", void 0, {});
|
|
3871
3870
|
}
|
|
3872
3871
|
navigate(e) {
|
|
@@ -3881,10 +3880,10 @@ class zo extends X {
|
|
|
3881
3880
|
if (!i || i === "none")
|
|
3882
3881
|
return new M({ x: 0, y: 0 });
|
|
3883
3882
|
const o = new DOMMatrix(i);
|
|
3884
|
-
return
|
|
3883
|
+
return jo(o);
|
|
3885
3884
|
}
|
|
3886
3885
|
}
|
|
3887
|
-
const
|
|
3886
|
+
const zo = () => (n) => n.pipe(
|
|
3888
3887
|
S(({ navigation: e, pagination: t, ...i }) => ({
|
|
3889
3888
|
navigation: {
|
|
3890
3889
|
...e,
|
|
@@ -3892,7 +3891,7 @@ const Wo = () => (n) => n.pipe(
|
|
|
3892
3891
|
},
|
|
3893
3892
|
...i
|
|
3894
3893
|
}))
|
|
3895
|
-
),
|
|
3894
|
+
), Wo = (n, e, t) => n.bridgeEvent.pagination$.pipe(
|
|
3896
3895
|
O(e),
|
|
3897
3896
|
L(
|
|
3898
3897
|
([i, o]) => i.navigationId === o.id
|
|
@@ -3909,7 +3908,7 @@ const Wo = () => (n) => n.pipe(
|
|
|
3909
3908
|
navigation: o
|
|
3910
3909
|
}))
|
|
3911
3910
|
)),
|
|
3912
|
-
|
|
3911
|
+
zo(),
|
|
3913
3912
|
z(
|
|
3914
3913
|
(i, o) => i.navigation.paginationBeginCfi === o.navigation.paginationBeginCfi
|
|
3915
3914
|
),
|
|
@@ -3921,7 +3920,7 @@ const Wo = () => (n) => n.pipe(
|
|
|
3921
3920
|
}
|
|
3922
3921
|
})
|
|
3923
3922
|
)
|
|
3924
|
-
),
|
|
3923
|
+
), _o = ({ navigationResolver: n }) => (e) => e.pipe(
|
|
3925
3924
|
S(([t, i]) => {
|
|
3926
3925
|
const o = {
|
|
3927
3926
|
type: "api",
|
|
@@ -3958,7 +3957,7 @@ const Wo = () => (n) => n.pipe(
|
|
|
3958
3957
|
navigation: o
|
|
3959
3958
|
};
|
|
3960
3959
|
})
|
|
3961
|
-
),
|
|
3960
|
+
), Ho = ({ navigationResolver: n }) => (e) => e.pipe(
|
|
3962
3961
|
S((t) => {
|
|
3963
3962
|
if (t.navigation.cfi) {
|
|
3964
3963
|
const i = n.getNavigationForCfi(
|
|
@@ -3975,16 +3974,16 @@ const Wo = () => (n) => n.pipe(
|
|
|
3975
3974
|
}
|
|
3976
3975
|
return t;
|
|
3977
3976
|
})
|
|
3978
|
-
),
|
|
3977
|
+
), Bo = ({
|
|
3979
3978
|
navigation: n,
|
|
3980
3979
|
previousNavigation: e,
|
|
3981
3980
|
settings: t
|
|
3982
|
-
}) => n.directionFromLastNavigation ? n.directionFromLastNavigation : n.url !== void 0 || n.cfi !== void 0 ? "anchor" : e.spineItem === void 0 || n.spineItem || !n.position ? "forward" : t.values.computedPageTurnDirection === "vertical" ? n.position.y > e.position.y || n.position.y === e.position.y && e.directionFromLastNavigation !== "backward" ? "forward" : "backward" : Math.abs(n.position.x) > Math.abs(e.position.x) || n.position.x === e.position.x && e.directionFromLastNavigation !== "backward" ? "forward" : "backward",
|
|
3981
|
+
}) => n.directionFromLastNavigation ? n.directionFromLastNavigation : n.url !== void 0 || n.cfi !== void 0 ? "anchor" : e.spineItem === void 0 || n.spineItem || !n.position ? "forward" : t.values.computedPageTurnDirection === "vertical" ? n.position.y > e.position.y || n.position.y === e.position.y && e.directionFromLastNavigation !== "backward" ? "forward" : "backward" : Math.abs(n.position.x) > Math.abs(e.position.x) || n.position.x === e.position.x && e.directionFromLastNavigation !== "backward" ? "forward" : "backward", Xo = ({
|
|
3983
3982
|
context: n,
|
|
3984
3983
|
settings: e
|
|
3985
3984
|
}) => (t) => t.pipe(
|
|
3986
3985
|
S(({ navigation: i, previousNavigation: o }) => {
|
|
3987
|
-
const s =
|
|
3986
|
+
const s = Bo({
|
|
3988
3987
|
navigation: i,
|
|
3989
3988
|
previousNavigation: o,
|
|
3990
3989
|
settings: e
|
|
@@ -3998,7 +3997,7 @@ const Wo = () => (n) => n.pipe(
|
|
|
3998
3997
|
direction: s
|
|
3999
3998
|
};
|
|
4000
3999
|
})
|
|
4001
|
-
),
|
|
4000
|
+
), Yo = ({
|
|
4002
4001
|
spineItemsManager: n,
|
|
4003
4002
|
navigationResolver: e,
|
|
4004
4003
|
settings: t
|
|
@@ -4029,7 +4028,7 @@ const Wo = () => (n) => n.pipe(
|
|
|
4029
4028
|
},
|
|
4030
4029
|
...s
|
|
4031
4030
|
};
|
|
4032
|
-
const a = e.getNavigationForSpineIndexOrId(r), c = t.values.computedPageTurnMode === "scrollable" ? new
|
|
4031
|
+
const a = e.getNavigationForSpineIndexOrId(r), c = t.values.computedPageTurnMode === "scrollable" ? new ce({
|
|
4033
4032
|
x: a.x + s.previousNavigation.position.x,
|
|
4034
4033
|
y: a.y
|
|
4035
4034
|
}) : e.fromUnboundSpinePosition(a);
|
|
@@ -4041,7 +4040,7 @@ const Wo = () => (n) => n.pipe(
|
|
|
4041
4040
|
...s
|
|
4042
4041
|
};
|
|
4043
4042
|
})
|
|
4044
|
-
),
|
|
4043
|
+
), St = ({
|
|
4045
4044
|
settings: n,
|
|
4046
4045
|
spineItemsManager: e,
|
|
4047
4046
|
navigationResolver: t,
|
|
@@ -4100,7 +4099,7 @@ const Wo = () => (n) => n.pipe(
|
|
|
4100
4099
|
};
|
|
4101
4100
|
})
|
|
4102
4101
|
);
|
|
4103
|
-
},
|
|
4102
|
+
}, bt = ({ spine: n }) => (e) => e.pipe(
|
|
4104
4103
|
w(({ navigation: t, ...i }) => {
|
|
4105
4104
|
const o = n.getSpineItemSpineLayoutInfo(
|
|
4106
4105
|
t.spineItem
|
|
@@ -4167,7 +4166,7 @@ const Wo = () => (n) => n.pipe(
|
|
|
4167
4166
|
...a
|
|
4168
4167
|
}))
|
|
4169
4168
|
);
|
|
4170
|
-
},
|
|
4169
|
+
}, qo = ({ navigationResolver: n }) => (e) => e.pipe(
|
|
4171
4170
|
S((t) => {
|
|
4172
4171
|
if (t.navigation.url) {
|
|
4173
4172
|
const i = n.getNavigationForUrl(
|
|
@@ -4186,7 +4185,7 @@ const Wo = () => (n) => n.pipe(
|
|
|
4186
4185
|
return t;
|
|
4187
4186
|
})
|
|
4188
4187
|
);
|
|
4189
|
-
class
|
|
4188
|
+
class Gt {
|
|
4190
4189
|
constructor() {
|
|
4191
4190
|
this.isLockedSubject = new H(0), this.isLocked$ = this.isLockedSubject.pipe(
|
|
4192
4191
|
S((e) => !!e),
|
|
@@ -4200,7 +4199,7 @@ class Zt {
|
|
|
4200
4199
|
};
|
|
4201
4200
|
}
|
|
4202
4201
|
}
|
|
4203
|
-
const
|
|
4202
|
+
const Go = ({
|
|
4204
4203
|
spineLocator: n,
|
|
4205
4204
|
navigation: e,
|
|
4206
4205
|
navigationResolver: t,
|
|
@@ -4257,7 +4256,7 @@ const Zo = ({
|
|
|
4257
4256
|
return c ? t.getNavigationForPosition(e.position) : t.getNavigationForSpineIndexOrId(s);
|
|
4258
4257
|
})
|
|
4259
4258
|
) : v(new M({ x: 0, y: 0 }));
|
|
4260
|
-
},
|
|
4259
|
+
}, Zo = ({
|
|
4261
4260
|
navigation: n,
|
|
4262
4261
|
spineLocator: e,
|
|
4263
4262
|
spineItemsManager: t,
|
|
@@ -4326,7 +4325,7 @@ const Zo = ({
|
|
|
4326
4325
|
}
|
|
4327
4326
|
}
|
|
4328
4327
|
return n.position;
|
|
4329
|
-
},
|
|
4328
|
+
}, Jo = ({
|
|
4330
4329
|
navigation: n,
|
|
4331
4330
|
spineItemsManager: e,
|
|
4332
4331
|
settings: t,
|
|
@@ -4334,7 +4333,7 @@ const Zo = ({
|
|
|
4334
4333
|
navigationResolver: o,
|
|
4335
4334
|
spine: s
|
|
4336
4335
|
}) => t.values.computedPageTurnMode === "scrollable" ? v(
|
|
4337
|
-
|
|
4336
|
+
Zo({
|
|
4338
4337
|
navigation: n,
|
|
4339
4338
|
spineLocator: i,
|
|
4340
4339
|
navigationResolver: o,
|
|
@@ -4342,19 +4341,19 @@ const Zo = ({
|
|
|
4342
4341
|
spineItemsManager: e,
|
|
4343
4342
|
spine: s
|
|
4344
4343
|
})
|
|
4345
|
-
) :
|
|
4344
|
+
) : Go({
|
|
4346
4345
|
navigation: n,
|
|
4347
4346
|
spineLocator: i,
|
|
4348
4347
|
navigationResolver: o,
|
|
4349
4348
|
spineItemsManager: e,
|
|
4350
4349
|
spine: s
|
|
4351
|
-
}),
|
|
4350
|
+
}), It = ({
|
|
4352
4351
|
settings: n,
|
|
4353
4352
|
navigationResolver: e,
|
|
4354
4353
|
context: t,
|
|
4355
4354
|
spine: i
|
|
4356
4355
|
}) => (o) => o.pipe(
|
|
4357
|
-
w((s) =>
|
|
4356
|
+
w((s) => Jo({
|
|
4358
4357
|
spineLocator: i.locator,
|
|
4359
4358
|
navigation: s.navigation,
|
|
4360
4359
|
navigationResolver: e,
|
|
@@ -4371,8 +4370,8 @@ const Zo = ({
|
|
|
4371
4370
|
}
|
|
4372
4371
|
}))
|
|
4373
4372
|
))
|
|
4374
|
-
),
|
|
4375
|
-
class
|
|
4373
|
+
), Ko = "navigation/InternalNavigator", Qo = D.namespace(Ko);
|
|
4374
|
+
class es extends X {
|
|
4376
4375
|
constructor(e, t, i, o, s, r, a, c) {
|
|
4377
4376
|
super(), this.settings = e, this.context = t, this.userNavigation$ = i, this.controlledNavigationController = o, this.scrollNavigationController = s, this.navigationResolver = r, this.spine = a, this.isUserLocked$ = c, this.navigationSubject = new H({
|
|
4378
4377
|
animation: !1,
|
|
@@ -4383,7 +4382,7 @@ class ts extends X {
|
|
|
4383
4382
|
spineItemIsReady: !1,
|
|
4384
4383
|
type: "api",
|
|
4385
4384
|
id: Symbol()
|
|
4386
|
-
}), this.navigated$ = this.navigationSubject.pipe(
|
|
4385
|
+
}), this.navigated$ = this.navigationSubject.pipe(Ft(1)), this.navigation$ = this.navigationSubject.pipe(
|
|
4387
4386
|
S(({ position: f, id: b }) => ({
|
|
4388
4387
|
position: f,
|
|
4389
4388
|
id: b
|
|
@@ -4391,29 +4390,29 @@ class ts extends X {
|
|
|
4391
4390
|
z(
|
|
4392
4391
|
({ position: f, ...b }, { position: I, ...F }) => V(b, F) && V(f, I)
|
|
4393
4392
|
),
|
|
4394
|
-
|
|
4395
|
-
), this.locker = new
|
|
4393
|
+
K(1)
|
|
4394
|
+
), this.locker = new Gt();
|
|
4396
4395
|
const u = i.pipe(
|
|
4397
4396
|
O(this.navigationSubject),
|
|
4398
|
-
|
|
4397
|
+
_o({
|
|
4399
4398
|
navigationResolver: r
|
|
4400
4399
|
}),
|
|
4401
4400
|
/**
|
|
4402
4401
|
* Url lookup is heavier so we start with it to fill
|
|
4403
4402
|
* as much information as needed to reduce later lookup
|
|
4404
4403
|
*/
|
|
4405
|
-
|
|
4404
|
+
qo({
|
|
4406
4405
|
navigationResolver: r
|
|
4407
4406
|
}),
|
|
4408
4407
|
/**
|
|
4409
4408
|
* Cfi lookup is heavier so we start with it to fill
|
|
4410
4409
|
* as much information as needed to reduce later lookup
|
|
4411
4410
|
*/
|
|
4412
|
-
|
|
4411
|
+
Ho({
|
|
4413
4412
|
navigationResolver: r
|
|
4414
4413
|
}),
|
|
4415
|
-
|
|
4416
|
-
|
|
4414
|
+
Xo({ context: t, settings: e }),
|
|
4415
|
+
St({
|
|
4417
4416
|
navigationResolver: r,
|
|
4418
4417
|
settings: e,
|
|
4419
4418
|
spineItemsManager: a.spineItemsManager,
|
|
@@ -4425,11 +4424,11 @@ class ts extends X {
|
|
|
4425
4424
|
spineItemsManager: a.spineItemsManager,
|
|
4426
4425
|
spineLocator: a.locator
|
|
4427
4426
|
}),
|
|
4428
|
-
|
|
4427
|
+
bt({
|
|
4429
4428
|
spine: a
|
|
4430
4429
|
})
|
|
4431
4430
|
).pipe(
|
|
4432
|
-
|
|
4431
|
+
Yo({
|
|
4433
4432
|
navigationResolver: r,
|
|
4434
4433
|
spineItemsManager: a.spineItemsManager,
|
|
4435
4434
|
settings: e
|
|
@@ -4438,7 +4437,7 @@ class ts extends X {
|
|
|
4438
4437
|
w(([f, b]) => {
|
|
4439
4438
|
const I = f.navigation.cfi || f.navigation.url || e.values.computedPageTurnMode === "scrollable" || b;
|
|
4440
4439
|
return v(f).pipe(
|
|
4441
|
-
I ? Pe :
|
|
4440
|
+
I ? Pe : It({
|
|
4442
4441
|
navigationResolver: r,
|
|
4443
4442
|
settings: e,
|
|
4444
4443
|
spine: a,
|
|
@@ -4506,7 +4505,7 @@ class ts extends X {
|
|
|
4506
4505
|
l
|
|
4507
4506
|
).pipe(
|
|
4508
4507
|
S((f) => ({ navigation: f })),
|
|
4509
|
-
|
|
4508
|
+
It({
|
|
4510
4509
|
navigationResolver: r,
|
|
4511
4510
|
settings: e,
|
|
4512
4511
|
context: t,
|
|
@@ -4529,13 +4528,13 @@ class ts extends X {
|
|
|
4529
4528
|
* eg: after the reader load and the user has never navigated
|
|
4530
4529
|
* yet.
|
|
4531
4530
|
*/
|
|
4532
|
-
|
|
4531
|
+
St({
|
|
4533
4532
|
navigationResolver: r,
|
|
4534
4533
|
settings: e,
|
|
4535
4534
|
spineItemsManager: a.spineItemsManager,
|
|
4536
4535
|
spineLocator: a.locator
|
|
4537
4536
|
}),
|
|
4538
|
-
|
|
4537
|
+
bt({
|
|
4539
4538
|
spine: a
|
|
4540
4539
|
}),
|
|
4541
4540
|
Ne({
|
|
@@ -4546,7 +4545,7 @@ class ts extends X {
|
|
|
4546
4545
|
}),
|
|
4547
4546
|
S(({ navigation: f }) => f),
|
|
4548
4547
|
E()
|
|
4549
|
-
), h =
|
|
4548
|
+
), h = Wo(
|
|
4550
4549
|
t,
|
|
4551
4550
|
this.navigationSubject,
|
|
4552
4551
|
a
|
|
@@ -4556,7 +4555,7 @@ class ts extends X {
|
|
|
4556
4555
|
h
|
|
4557
4556
|
), m = (f) => f.pipe(
|
|
4558
4557
|
x(([b, I]) => {
|
|
4559
|
-
|
|
4558
|
+
Qo.info(
|
|
4560
4559
|
`navigation updated from ${b.meta.triggeredBy} of type ${b.type}`,
|
|
4561
4560
|
{
|
|
4562
4561
|
previousNavigation: I,
|
|
@@ -4611,17 +4610,17 @@ const Fe = (n, e, t) => {
|
|
|
4611
4610
|
}, Xe = (n, e) => (e || 0) === 0 || (n || 0) === 0 ? 1 : Math.floor(Math.max(1, n / e)), Ve = (n, e, t) => {
|
|
4612
4611
|
const i = Xe(t, e), o = [...Array(i)].map((s, r) => r * e);
|
|
4613
4612
|
return n >= i * e ? o[o.length - 1] || 0 : o.find((s) => n < s + e) || 0;
|
|
4614
|
-
},
|
|
4613
|
+
}, vt = (n, e, t) => {
|
|
4615
4614
|
const i = [...Array(t)].map((o, s) => s * e);
|
|
4616
4615
|
return n <= 0 || t === 0 ? 0 : n >= t * e ? t - 1 : i.findIndex((o) => n < o + e) ?? 0;
|
|
4617
|
-
},
|
|
4616
|
+
}, ts = ({
|
|
4618
4617
|
itemWidth: n,
|
|
4619
4618
|
itemHeight: e,
|
|
4620
4619
|
spineItemPosition: t
|
|
4621
4620
|
}) => new C({
|
|
4622
4621
|
x: Math.min(n, Math.max(0, t.x)),
|
|
4623
4622
|
y: Math.min(e, Math.max(0, t.y))
|
|
4624
|
-
}),
|
|
4623
|
+
}), Zt = ({
|
|
4625
4624
|
itemHeight: n,
|
|
4626
4625
|
itemWidth: e,
|
|
4627
4626
|
isUsingVerticalWriting: t,
|
|
@@ -4629,7 +4628,7 @@ const Fe = (n, e, t) => {
|
|
|
4629
4628
|
pageHeight: o,
|
|
4630
4629
|
pageTurnDirection: s,
|
|
4631
4630
|
pageTurnMode: r
|
|
4632
|
-
}) => s === "vertical" && r === "scrollable" ? 1 : t || s === "vertical" ? Xe(n, o) : Xe(e, i),
|
|
4631
|
+
}) => s === "vertical" && r === "scrollable" ? 1 : t || s === "vertical" ? Xe(n, o) : Xe(e, i), wt = ({
|
|
4633
4632
|
itemWidth: n,
|
|
4634
4633
|
itemHeight: e,
|
|
4635
4634
|
position: t,
|
|
@@ -4640,11 +4639,11 @@ const Fe = (n, e, t) => {
|
|
|
4640
4639
|
pageTurnMode: a,
|
|
4641
4640
|
isRTL: c
|
|
4642
4641
|
}) => {
|
|
4643
|
-
const l =
|
|
4642
|
+
const l = ts({
|
|
4644
4643
|
spineItemPosition: t,
|
|
4645
4644
|
itemHeight: e,
|
|
4646
4645
|
itemWidth: n
|
|
4647
|
-
}).x, d =
|
|
4646
|
+
}).x, d = Zt({
|
|
4648
4647
|
isUsingVerticalWriting: i,
|
|
4649
4648
|
itemHeight: e,
|
|
4650
4649
|
itemWidth: n,
|
|
@@ -4654,10 +4653,10 @@ const Fe = (n, e, t) => {
|
|
|
4654
4653
|
pageTurnMode: a
|
|
4655
4654
|
});
|
|
4656
4655
|
if (i)
|
|
4657
|
-
return
|
|
4658
|
-
const g =
|
|
4656
|
+
return vt(t.y, s, d);
|
|
4657
|
+
const g = vt(l, o, d);
|
|
4659
4658
|
return c ? d - 1 - g : g;
|
|
4660
|
-
},
|
|
4659
|
+
}, ns = ({
|
|
4661
4660
|
pageIndex: n,
|
|
4662
4661
|
itemLayout: e,
|
|
4663
4662
|
context: t,
|
|
@@ -4687,14 +4686,14 @@ const Fe = (n, e, t) => {
|
|
|
4687
4686
|
x: s,
|
|
4688
4687
|
y: 0
|
|
4689
4688
|
});
|
|
4690
|
-
},
|
|
4689
|
+
}, Jt = ({
|
|
4691
4690
|
context: n,
|
|
4692
4691
|
settings: e,
|
|
4693
4692
|
viewport: t
|
|
4694
4693
|
}) => {
|
|
4695
4694
|
const i = (a, c, u) => {
|
|
4696
4695
|
let l;
|
|
4697
|
-
a?.nodeName === "img" || a?.textContent === "" && a.nodeType === Node.ELEMENT_NODE ? l = a.getBoundingClientRect().x : a && (l = (a ?
|
|
4696
|
+
a?.nodeName === "img" || a?.textContent === "" && a.nodeType === Node.ELEMENT_NODE ? l = a.getBoundingClientRect().x : a && (l = (a ? Cn(a, c) : void 0)?.getBoundingClientRect().x || l);
|
|
4698
4697
|
const d = u.layout.layoutInfo?.width || 0, g = t.pageSize.width;
|
|
4699
4698
|
if (l !== void 0) {
|
|
4700
4699
|
const h = Ve(
|
|
@@ -4710,14 +4709,14 @@ const Fe = (n, e, t) => {
|
|
|
4710
4709
|
getSpineItemPositionFromPageIndex: ({
|
|
4711
4710
|
pageIndex: a,
|
|
4712
4711
|
spineItem: c
|
|
4713
|
-
}) =>
|
|
4712
|
+
}) => ns({
|
|
4714
4713
|
context: n,
|
|
4715
4714
|
isUsingVerticalWriting: !!c.isUsingVerticalWriting(),
|
|
4716
4715
|
itemLayout: c.layout.layoutInfo,
|
|
4717
4716
|
pageIndex: a,
|
|
4718
4717
|
viewport: t
|
|
4719
4718
|
}),
|
|
4720
|
-
getSpineItemPageIndexFromPosition: (a) =>
|
|
4719
|
+
getSpineItemPageIndexFromPosition: (a) => wt({
|
|
4721
4720
|
...a,
|
|
4722
4721
|
isRTL: n.isRTL(),
|
|
4723
4722
|
pageWidth: t.pageSize.width,
|
|
@@ -4727,7 +4726,7 @@ const Fe = (n, e, t) => {
|
|
|
4727
4726
|
}),
|
|
4728
4727
|
getSpineItemPageIndexFromNode: (a, c, u) => {
|
|
4729
4728
|
const l = i(a, c, u), { height: d, width: g } = u.layout.layoutInfo;
|
|
4730
|
-
return l ?
|
|
4729
|
+
return l ? wt({
|
|
4731
4730
|
isUsingVerticalWriting: !!u.isUsingVerticalWriting(),
|
|
4732
4731
|
position: l,
|
|
4733
4732
|
itemHeight: d,
|
|
@@ -4781,12 +4780,12 @@ const Fe = (n, e, t) => {
|
|
|
4781
4780
|
});
|
|
4782
4781
|
}
|
|
4783
4782
|
};
|
|
4784
|
-
},
|
|
4783
|
+
}, is = ({
|
|
4785
4784
|
context: n,
|
|
4786
4785
|
settings: e,
|
|
4787
4786
|
viewport: t
|
|
4788
4787
|
}) => {
|
|
4789
|
-
const i =
|
|
4788
|
+
const i = Jt({
|
|
4790
4789
|
context: n,
|
|
4791
4790
|
settings: e,
|
|
4792
4791
|
viewport: t
|
|
@@ -4810,7 +4809,7 @@ const Fe = (n, e, t) => {
|
|
|
4810
4809
|
) || new C({ x: 0, y: 0 })
|
|
4811
4810
|
};
|
|
4812
4811
|
};
|
|
4813
|
-
function
|
|
4812
|
+
function Kt({
|
|
4814
4813
|
position: n,
|
|
4815
4814
|
isRTL: e,
|
|
4816
4815
|
spineItemsManager: t,
|
|
@@ -4835,7 +4834,7 @@ function Qt({
|
|
|
4835
4834
|
y: u
|
|
4836
4835
|
});
|
|
4837
4836
|
}
|
|
4838
|
-
const
|
|
4837
|
+
const Pt = ({
|
|
4839
4838
|
position: n,
|
|
4840
4839
|
isRTL: e,
|
|
4841
4840
|
pageSizeHeight: t,
|
|
@@ -4843,7 +4842,7 @@ const xt = ({
|
|
|
4843
4842
|
visibleAreaRectWidth: o,
|
|
4844
4843
|
spine: s
|
|
4845
4844
|
}) => {
|
|
4846
|
-
const r =
|
|
4845
|
+
const r = Kt({
|
|
4847
4846
|
position: n,
|
|
4848
4847
|
isRTL: e,
|
|
4849
4848
|
spineItemsManager: i,
|
|
@@ -4864,7 +4863,7 @@ const xt = ({
|
|
|
4864
4863
|
x: Math.min(r.x, d),
|
|
4865
4864
|
y: l
|
|
4866
4865
|
});
|
|
4867
|
-
},
|
|
4866
|
+
}, ee = ({
|
|
4868
4867
|
position: { x: n, y: e },
|
|
4869
4868
|
pageSizeWidth: t,
|
|
4870
4869
|
visibleAreaRectWidth: i
|
|
@@ -4889,14 +4888,14 @@ const xt = ({
|
|
|
4889
4888
|
spineItemPosition: r,
|
|
4890
4889
|
spineItem: o
|
|
4891
4890
|
});
|
|
4892
|
-
return
|
|
4891
|
+
return ee({
|
|
4893
4892
|
position: a,
|
|
4894
4893
|
pageSizeWidth: i.pageSize.width,
|
|
4895
4894
|
visibleAreaRectWidth: i.absoluteViewport.width
|
|
4896
4895
|
});
|
|
4897
4896
|
}
|
|
4898
4897
|
return new M({ x: 0, y: 0 });
|
|
4899
|
-
},
|
|
4898
|
+
}, os = ({
|
|
4900
4899
|
pageIndex: n,
|
|
4901
4900
|
spineItemsManager: e,
|
|
4902
4901
|
spineItemId: t,
|
|
@@ -4921,33 +4920,33 @@ const xt = ({
|
|
|
4921
4920
|
spineItemPosition: a,
|
|
4922
4921
|
spineItem: r
|
|
4923
4922
|
});
|
|
4924
|
-
return
|
|
4923
|
+
return ee({
|
|
4925
4924
|
position: c,
|
|
4926
4925
|
pageSizeWidth: s.pageSize.width,
|
|
4927
4926
|
visibleAreaRectWidth: s.absoluteViewport.width
|
|
4928
4927
|
});
|
|
4929
|
-
},
|
|
4928
|
+
}, ss = (n, e) => {
|
|
4930
4929
|
if (e && e instanceof HTMLIFrameElement)
|
|
4931
4930
|
return n.startsWith("#") ? e.contentDocument?.getElementById(
|
|
4932
4931
|
n.replace("#", "")
|
|
4933
4932
|
) : e.contentDocument?.querySelector(n);
|
|
4934
|
-
},
|
|
4933
|
+
}, rs = ({
|
|
4935
4934
|
anchor: n,
|
|
4936
4935
|
spineItem: e,
|
|
4937
4936
|
spine: t
|
|
4938
4937
|
}) => {
|
|
4939
|
-
const i =
|
|
4938
|
+
const i = ss(
|
|
4940
4939
|
n,
|
|
4941
4940
|
e.renderer.getDocumentFrame()
|
|
4942
4941
|
);
|
|
4943
4942
|
return i ? t.spineItemLocator.getSpineItemPositionFromNode(i, 0, e)?.x ?? 0 : 0;
|
|
4944
|
-
},
|
|
4943
|
+
}, as = ({
|
|
4945
4944
|
anchor: n,
|
|
4946
4945
|
spineItem: e,
|
|
4947
4946
|
spineLocator: t,
|
|
4948
4947
|
spine: i
|
|
4949
4948
|
}) => {
|
|
4950
|
-
const o =
|
|
4949
|
+
const o = rs({
|
|
4951
4950
|
anchor: n,
|
|
4952
4951
|
spineItem: e,
|
|
4953
4952
|
spine: i
|
|
@@ -4956,7 +4955,7 @@ const xt = ({
|
|
|
4956
4955
|
spineItemPosition: new C({ x: o, y: 0 }),
|
|
4957
4956
|
spineItem: e
|
|
4958
4957
|
});
|
|
4959
|
-
},
|
|
4958
|
+
}, cs = ({
|
|
4960
4959
|
anchor: n,
|
|
4961
4960
|
spineItem: e,
|
|
4962
4961
|
spineLocator: t,
|
|
@@ -4964,18 +4963,18 @@ const xt = ({
|
|
|
4964
4963
|
pageSizeWidth: o,
|
|
4965
4964
|
visibleAreaRectWidth: s
|
|
4966
4965
|
}) => {
|
|
4967
|
-
const r =
|
|
4966
|
+
const r = as({
|
|
4968
4967
|
anchor: n,
|
|
4969
4968
|
spineItem: e,
|
|
4970
4969
|
spineLocator: t,
|
|
4971
4970
|
spine: i
|
|
4972
4971
|
});
|
|
4973
|
-
return
|
|
4972
|
+
return ee({
|
|
4974
4973
|
position: r,
|
|
4975
4974
|
pageSizeWidth: o,
|
|
4976
4975
|
visibleAreaRectWidth: s
|
|
4977
4976
|
});
|
|
4978
|
-
},
|
|
4977
|
+
}, us = ({
|
|
4979
4978
|
spine: n,
|
|
4980
4979
|
spineItemsManager: e,
|
|
4981
4980
|
spineLocator: t,
|
|
@@ -4991,7 +4990,7 @@ const xt = ({
|
|
|
4991
4990
|
if (u) {
|
|
4992
4991
|
const l = e.get(u.id);
|
|
4993
4992
|
if (l) {
|
|
4994
|
-
const d =
|
|
4993
|
+
const d = cs({
|
|
4995
4994
|
anchor: a.hash,
|
|
4996
4995
|
spineItem: l,
|
|
4997
4996
|
spine: n,
|
|
@@ -5000,7 +4999,7 @@ const xt = ({
|
|
|
5000
4999
|
visibleAreaRectWidth: r
|
|
5001
5000
|
});
|
|
5002
5001
|
return {
|
|
5003
|
-
position:
|
|
5002
|
+
position: ee({
|
|
5004
5003
|
position: d,
|
|
5005
5004
|
pageSizeWidth: s,
|
|
5006
5005
|
visibleAreaRectWidth: r
|
|
@@ -5014,7 +5013,7 @@ const xt = ({
|
|
|
5014
5013
|
console.error(a);
|
|
5015
5014
|
return;
|
|
5016
5015
|
}
|
|
5017
|
-
},
|
|
5016
|
+
}, ls = ({
|
|
5018
5017
|
spineItem: n,
|
|
5019
5018
|
spineItemPosition: e,
|
|
5020
5019
|
spineLocator: t,
|
|
@@ -5028,12 +5027,12 @@ const xt = ({
|
|
|
5028
5027
|
spineItemPosition: s,
|
|
5029
5028
|
spineItem: n
|
|
5030
5029
|
});
|
|
5031
|
-
return
|
|
5030
|
+
return ee({
|
|
5032
5031
|
position: r,
|
|
5033
5032
|
pageSizeWidth: o.pageSize.width,
|
|
5034
5033
|
visibleAreaRectWidth: o.absoluteViewport.width
|
|
5035
5034
|
});
|
|
5036
|
-
},
|
|
5035
|
+
}, ds = "spineNavigator", ps = ({
|
|
5037
5036
|
context: n,
|
|
5038
5037
|
spineItemsManager: e,
|
|
5039
5038
|
locator: t,
|
|
@@ -5041,13 +5040,13 @@ const xt = ({
|
|
|
5041
5040
|
spine: o,
|
|
5042
5041
|
viewport: s
|
|
5043
5042
|
}) => {
|
|
5044
|
-
const r =
|
|
5043
|
+
const r = is({
|
|
5045
5044
|
context: n,
|
|
5046
5045
|
settings: i,
|
|
5047
5046
|
viewport: s
|
|
5048
5047
|
});
|
|
5049
5048
|
return {
|
|
5050
|
-
getNavigationForUrl: (h) =>
|
|
5049
|
+
getNavigationForUrl: (h) => us({
|
|
5051
5050
|
context: n,
|
|
5052
5051
|
spineItemsManager: e,
|
|
5053
5052
|
spineLocator: t,
|
|
@@ -5056,33 +5055,33 @@ const xt = ({
|
|
|
5056
5055
|
visibleAreaRectWidth: s.absoluteViewport.width,
|
|
5057
5056
|
spine: o
|
|
5058
5057
|
}),
|
|
5059
|
-
getNavigationForSpineItemPage: (h) =>
|
|
5058
|
+
getNavigationForSpineItemPage: (h) => os({
|
|
5060
5059
|
...h,
|
|
5061
5060
|
spineItemsManager: e,
|
|
5062
5061
|
spineItemNavigationResolver: r,
|
|
5063
5062
|
spineLocator: t,
|
|
5064
5063
|
viewport: s
|
|
5065
5064
|
}),
|
|
5066
|
-
getNavigationFromSpineItemPosition: (h) =>
|
|
5065
|
+
getNavigationFromSpineItemPosition: (h) => ls({
|
|
5067
5066
|
...h,
|
|
5068
5067
|
spineItemLocator: t.spineItemLocator,
|
|
5069
5068
|
spineLocator: t,
|
|
5070
5069
|
viewport: s
|
|
5071
5070
|
}),
|
|
5072
5071
|
getNavigationForCfi: (h) => {
|
|
5073
|
-
const p = e.getSpineItemFromCfi(h), { node: m, offset: y = 0 } =
|
|
5072
|
+
const p = e.getSpineItemFromCfi(h), { node: m, offset: y = 0 } = Xt({
|
|
5074
5073
|
cfi: h,
|
|
5075
5074
|
spineItemsManager: e
|
|
5076
5075
|
});
|
|
5077
5076
|
if (!p) {
|
|
5078
|
-
D.warn(
|
|
5077
|
+
D.warn(ds, `unable to detect item id from cfi ${h}`);
|
|
5079
5078
|
return;
|
|
5080
5079
|
}
|
|
5081
5080
|
const f = m ? r.getNavigationFromNode(p, m, y) : new C({ x: 0, y: 0 }), b = t.getSpinePositionFromSpineItemPosition({
|
|
5082
5081
|
spineItemPosition: f,
|
|
5083
5082
|
spineItem: p
|
|
5084
5083
|
});
|
|
5085
|
-
return
|
|
5084
|
+
return ee({
|
|
5086
5085
|
position: b,
|
|
5087
5086
|
pageSizeWidth: s.pageSize.width,
|
|
5088
5087
|
visibleAreaRectWidth: s.absoluteViewport.width
|
|
@@ -5093,7 +5092,7 @@ const xt = ({
|
|
|
5093
5092
|
spineItemPosition: p,
|
|
5094
5093
|
spineItem: h
|
|
5095
5094
|
});
|
|
5096
|
-
return
|
|
5095
|
+
return ee({
|
|
5097
5096
|
position: m,
|
|
5098
5097
|
pageSizeWidth: s.pageSize.width,
|
|
5099
5098
|
visibleAreaRectWidth: s.absoluteViewport.width
|
|
@@ -5103,7 +5102,7 @@ const xt = ({
|
|
|
5103
5102
|
const p = e.get(h);
|
|
5104
5103
|
if (p) {
|
|
5105
5104
|
const m = t.getSpinePositionFromSpineItem(p);
|
|
5106
|
-
return
|
|
5105
|
+
return ee({
|
|
5107
5106
|
position: m,
|
|
5108
5107
|
pageSizeWidth: s.pageSize.width,
|
|
5109
5108
|
visibleAreaRectWidth: s.absoluteViewport.width
|
|
@@ -5118,7 +5117,7 @@ const xt = ({
|
|
|
5118
5117
|
viewport: s
|
|
5119
5118
|
}),
|
|
5120
5119
|
getMostPredominantNavigationForPosition: (h) => {
|
|
5121
|
-
const p = i.values.computedPageTurnDirection, m = 0.5, y = p === "horizontal" ? h.x + s.absoluteViewport.width * m : 0, f = p === "horizontal" ? 0 : h.y + s.absoluteViewport.height * m, b =
|
|
5120
|
+
const p = i.values.computedPageTurnDirection, m = 0.5, y = p === "horizontal" ? h.x + s.absoluteViewport.width * m : 0, f = p === "horizontal" ? 0 : h.y + s.absoluteViewport.height * m, b = Pt({
|
|
5122
5121
|
position: new M({
|
|
5123
5122
|
x: y,
|
|
5124
5123
|
y: f
|
|
@@ -5136,7 +5135,7 @@ const xt = ({
|
|
|
5136
5135
|
viewport: s
|
|
5137
5136
|
});
|
|
5138
5137
|
},
|
|
5139
|
-
fromUnboundSpinePosition: (h) =>
|
|
5138
|
+
fromUnboundSpinePosition: (h) => Pt({
|
|
5140
5139
|
position: h,
|
|
5141
5140
|
isRTL: n.isRTL(),
|
|
5142
5141
|
pageSizeHeight: s.pageSize.height,
|
|
@@ -5144,7 +5143,7 @@ const xt = ({
|
|
|
5144
5143
|
spineItemsManager: e,
|
|
5145
5144
|
spine: o
|
|
5146
5145
|
}),
|
|
5147
|
-
fromOutOfBoundsSpinePosition: (h) =>
|
|
5146
|
+
fromOutOfBoundsSpinePosition: (h) => Kt({
|
|
5148
5147
|
position: h,
|
|
5149
5148
|
isRTL: n.isRTL(),
|
|
5150
5149
|
spineItemsManager: e,
|
|
@@ -5153,14 +5152,14 @@ const xt = ({
|
|
|
5153
5152
|
}),
|
|
5154
5153
|
isNavigationGoingForwardFrom: (h, p) => i.values.computedPageTurnDirection === "vertical" ? h.y > p.y : h.x > p.x,
|
|
5155
5154
|
arePositionsDifferent: (h, p) => h.x !== p.x || h.y !== p.y,
|
|
5156
|
-
getAdjustedPositionForSpread: (h) =>
|
|
5155
|
+
getAdjustedPositionForSpread: (h) => ee({
|
|
5157
5156
|
position: h,
|
|
5158
5157
|
pageSizeWidth: s.pageSize.width,
|
|
5159
5158
|
visibleAreaRectWidth: s.absoluteViewport.width
|
|
5160
5159
|
}),
|
|
5161
5160
|
spineItemNavigator: r
|
|
5162
5161
|
};
|
|
5163
|
-
},
|
|
5162
|
+
}, gs = ({
|
|
5164
5163
|
spineItemsManager: n,
|
|
5165
5164
|
context: e,
|
|
5166
5165
|
hookManager: t,
|
|
@@ -5168,26 +5167,26 @@ const xt = ({
|
|
|
5168
5167
|
settings: o,
|
|
5169
5168
|
viewport: s
|
|
5170
5169
|
}) => {
|
|
5171
|
-
const r = new R(), a = r.asObservable(), c = new
|
|
5170
|
+
const r = new R(), a = r.asObservable(), c = new Gt(), u = ps({
|
|
5172
5171
|
context: e,
|
|
5173
5172
|
settings: o,
|
|
5174
5173
|
spineItemsManager: n,
|
|
5175
5174
|
locator: i.locator,
|
|
5176
5175
|
spine: i,
|
|
5177
5176
|
viewport: s
|
|
5178
|
-
}), l = new
|
|
5177
|
+
}), l = new Uo(
|
|
5179
5178
|
o,
|
|
5180
5179
|
t,
|
|
5181
5180
|
e,
|
|
5182
5181
|
i,
|
|
5183
5182
|
s
|
|
5184
|
-
), d = new
|
|
5183
|
+
), d = new Fo(
|
|
5185
5184
|
s,
|
|
5186
5185
|
o,
|
|
5187
5186
|
t,
|
|
5188
5187
|
i,
|
|
5189
5188
|
e
|
|
5190
|
-
), g = new
|
|
5189
|
+
), g = new es(
|
|
5191
5190
|
o,
|
|
5192
5191
|
e,
|
|
5193
5192
|
a,
|
|
@@ -5202,7 +5201,7 @@ const xt = ({
|
|
|
5202
5201
|
c.isLocked$,
|
|
5203
5202
|
g.locker.isLocked$
|
|
5204
5203
|
]).pipe(
|
|
5205
|
-
|
|
5204
|
+
Q((y) => y.some((f) => f) ? "busy" : "free"),
|
|
5206
5205
|
pe(),
|
|
5207
5206
|
Ce(1)
|
|
5208
5207
|
);
|
|
@@ -5226,7 +5225,7 @@ const xt = ({
|
|
|
5226
5225
|
navigation$: g.navigation$
|
|
5227
5226
|
};
|
|
5228
5227
|
};
|
|
5229
|
-
class
|
|
5228
|
+
class hs extends ue {
|
|
5230
5229
|
constructor(e, t) {
|
|
5231
5230
|
super({
|
|
5232
5231
|
beginPageIndexInSpineItem: void 0,
|
|
@@ -5244,7 +5243,7 @@ class ms extends ce {
|
|
|
5244
5243
|
this.mergeCompare(e);
|
|
5245
5244
|
}
|
|
5246
5245
|
}
|
|
5247
|
-
class
|
|
5246
|
+
class ms extends X {
|
|
5248
5247
|
constructor(e, t, i, o, s) {
|
|
5249
5248
|
super(), this.context = e, this.pagination = t, this.spineItemsManager = i, this.spine = o, this.spineItemLocator = s;
|
|
5250
5249
|
const r = P(
|
|
@@ -5261,7 +5260,7 @@ class fs extends X {
|
|
|
5261
5260
|
threshold: { type: "percentage", value: 0.5 }
|
|
5262
5261
|
});
|
|
5263
5262
|
return this.context.bridgeEvent.navigationUnlocked$.pipe(
|
|
5264
|
-
|
|
5263
|
+
$t(1),
|
|
5265
5264
|
O(this.context.bridgeEvent.navigation$),
|
|
5266
5265
|
x(([, u]) => {
|
|
5267
5266
|
const { position: l } = u, d = this.pagination.value, {
|
|
@@ -5278,14 +5277,14 @@ class fs extends X {
|
|
|
5278
5277
|
}) ?? {}, { endPageIndex: I = 0 } = c({
|
|
5279
5278
|
spineItem: m,
|
|
5280
5279
|
position: l
|
|
5281
|
-
}) ?? {}, F = y === void 0 || Be(y) || d.beginSpineItemIndex !== g, $ = d.endSpineItemIndex !== h || f === void 0 || Be(f), A = F ? he(p.item) : y, Y = $ ? he(m.item) : f, B = p.numberOfPages,
|
|
5280
|
+
}) ?? {}, F = y === void 0 || Be(y) || d.beginSpineItemIndex !== g, $ = d.endSpineItemIndex !== h || f === void 0 || Be(f), A = F ? he(p.item) : y, Y = $ ? he(m.item) : f, B = p.numberOfPages, oe = m.numberOfPages;
|
|
5282
5281
|
this.pagination.update({
|
|
5283
5282
|
beginCfi: A,
|
|
5284
5283
|
beginNumberOfPagesInSpineItem: B,
|
|
5285
5284
|
beginPageIndexInSpineItem: b,
|
|
5286
5285
|
beginSpineItemIndex: g,
|
|
5287
5286
|
endCfi: Y,
|
|
5288
|
-
endNumberOfPagesInSpineItem:
|
|
5287
|
+
endNumberOfPagesInSpineItem: oe,
|
|
5289
5288
|
endPageIndexInSpineItem: I,
|
|
5290
5289
|
endSpineItemIndex: h,
|
|
5291
5290
|
navigationId: u.id
|
|
@@ -5322,18 +5321,18 @@ class fs extends X {
|
|
|
5322
5321
|
P(r, a).pipe(T(this.destroy$)).subscribe();
|
|
5323
5322
|
}
|
|
5324
5323
|
}
|
|
5325
|
-
const
|
|
5324
|
+
const fs = ({
|
|
5326
5325
|
manifest: n,
|
|
5327
5326
|
spreadMode: e
|
|
5328
5327
|
}) => n?.renditionFlow === "scrolled-continuous" ? !1 : e;
|
|
5329
|
-
class
|
|
5328
|
+
class ys extends X {
|
|
5330
5329
|
constructor(e) {
|
|
5331
5330
|
super();
|
|
5332
5331
|
const t = {
|
|
5333
5332
|
...this.getDefaultSettings(),
|
|
5334
5333
|
...e
|
|
5335
5334
|
};
|
|
5336
|
-
this.inputSettings = t, this.outputSettingsUpdateSubject = new R(), this._settings$ = this.outputSettingsUpdateSubject.asObservable().pipe(
|
|
5335
|
+
this.inputSettings = t, this.outputSettingsUpdateSubject = new R(), this._settings$ = this.outputSettingsUpdateSubject.asObservable().pipe(K(1)), this._settings$.subscribe();
|
|
5337
5336
|
}
|
|
5338
5337
|
_prepareUpdate(e) {
|
|
5339
5338
|
const t = xe(this.inputSettings, e), i = this.getOutputSettings(t), o = !V(this.outputSettings, i);
|
|
@@ -5363,7 +5362,7 @@ class Ss extends X {
|
|
|
5363
5362
|
}
|
|
5364
5363
|
watch(e) {
|
|
5365
5364
|
return this.values$.pipe(
|
|
5366
|
-
|
|
5365
|
+
Ot(e),
|
|
5367
5366
|
z(V)
|
|
5368
5367
|
);
|
|
5369
5368
|
}
|
|
@@ -5371,7 +5370,7 @@ class Ss extends X {
|
|
|
5371
5370
|
super.destroy(), this.outputSettingsUpdateSubject.complete();
|
|
5372
5371
|
}
|
|
5373
5372
|
}
|
|
5374
|
-
class
|
|
5373
|
+
class Ss extends ys {
|
|
5375
5374
|
constructor(e, t) {
|
|
5376
5375
|
super(e), this.context = t, t.watch(["manifest", "hasVerticalWriting"]).pipe(
|
|
5377
5376
|
x(() => this.update(this.values)),
|
|
@@ -5384,7 +5383,7 @@ class bs extends Ss {
|
|
|
5384
5383
|
computedPageTurnAnimation: e.pageTurnAnimation,
|
|
5385
5384
|
computedPageTurnMode: e.pageTurnMode,
|
|
5386
5385
|
computedPageTurnAnimationDuration: 0,
|
|
5387
|
-
computedSpreadMode:
|
|
5386
|
+
computedSpreadMode: fs({
|
|
5388
5387
|
spreadMode: e.spreadMode,
|
|
5389
5388
|
manifest: t
|
|
5390
5389
|
})
|
|
@@ -5410,7 +5409,7 @@ class bs extends Ss {
|
|
|
5410
5409
|
};
|
|
5411
5410
|
}
|
|
5412
5411
|
}
|
|
5413
|
-
class
|
|
5412
|
+
class bs extends fe {
|
|
5414
5413
|
onUnload() {
|
|
5415
5414
|
return Z;
|
|
5416
5415
|
}
|
|
@@ -5429,7 +5428,7 @@ class Is extends fe {
|
|
|
5429
5428
|
getDocumentFrame() {
|
|
5430
5429
|
}
|
|
5431
5430
|
}
|
|
5432
|
-
class
|
|
5431
|
+
class Is extends X {
|
|
5433
5432
|
constructor(e, t, i, o, s, r, a) {
|
|
5434
5433
|
super(), this.item = e, this.containerElement = t, this.context = i, this.hookManager = o, this.renderer = s, this.settings = r, this.viewport = a, this.layoutTriggerSubject = new R(), this.lastLayout = null, this.applyDimsAfterLayout = ({
|
|
5435
5434
|
blankPagePosition: c,
|
|
@@ -5459,7 +5458,7 @@ class vs extends X {
|
|
|
5459
5458
|
}), { width: I, height: F };
|
|
5460
5459
|
})
|
|
5461
5460
|
), this.layout = (c) => {
|
|
5462
|
-
const u =
|
|
5461
|
+
const u = Xn(this.layout$.pipe(U()));
|
|
5463
5462
|
return this.layoutTriggerSubject.next(c), u();
|
|
5464
5463
|
}, this.adjustPositionOfElement = ({
|
|
5465
5464
|
right: c,
|
|
@@ -5514,7 +5513,7 @@ class vs extends X {
|
|
|
5514
5513
|
};
|
|
5515
5514
|
}
|
|
5516
5515
|
}
|
|
5517
|
-
class
|
|
5516
|
+
class Qt extends ue {
|
|
5518
5517
|
constructor(e, t, i, o, s, r, a) {
|
|
5519
5518
|
super({
|
|
5520
5519
|
isLoaded: !1,
|
|
@@ -5530,13 +5529,13 @@ class en extends ce {
|
|
|
5530
5529
|
});
|
|
5531
5530
|
}, this.destroy = () => {
|
|
5532
5531
|
super.destroy(), this.containerElement.remove(), this.renderer.destroy();
|
|
5533
|
-
}, this.isUsingVerticalWriting = () => !!this.renderer.writingMode?.startsWith("vertical"), this.containerElement =
|
|
5532
|
+
}, this.isUsingVerticalWriting = () => !!this.renderer.writingMode?.startsWith("vertical"), this.containerElement = vs(
|
|
5534
5533
|
t,
|
|
5535
5534
|
e,
|
|
5536
5535
|
s
|
|
5537
5536
|
), t.appendChild(this.containerElement);
|
|
5538
5537
|
const c = this.settings.values.getRenderer?.(e);
|
|
5539
|
-
this.resourcesHandler = new
|
|
5538
|
+
this.resourcesHandler = new tt(e, this.settings);
|
|
5540
5539
|
const u = {
|
|
5541
5540
|
context: i,
|
|
5542
5541
|
settings: o,
|
|
@@ -5546,7 +5545,7 @@ class en extends ce {
|
|
|
5546
5545
|
resourcesHandler: this.resourcesHandler,
|
|
5547
5546
|
viewport: this.viewport
|
|
5548
5547
|
};
|
|
5549
|
-
this.renderer = c ? c(u) : new
|
|
5548
|
+
this.renderer = c ? c(u) : new bs(u), this.layout = new Is(
|
|
5550
5549
|
e,
|
|
5551
5550
|
this.containerElement,
|
|
5552
5551
|
i,
|
|
@@ -5608,11 +5607,11 @@ class en extends ce {
|
|
|
5608
5607
|
get unloaded$() {
|
|
5609
5608
|
return this.renderer.state$.pipe(
|
|
5610
5609
|
pe(),
|
|
5611
|
-
|
|
5610
|
+
re((e) => e !== "idle"),
|
|
5612
5611
|
_(
|
|
5613
5612
|
() => this.renderer.state$.pipe(
|
|
5614
|
-
|
|
5615
|
-
|
|
5613
|
+
re((e) => e === "idle"),
|
|
5614
|
+
Lt()
|
|
5616
5615
|
)
|
|
5617
5616
|
)
|
|
5618
5617
|
);
|
|
@@ -5621,7 +5620,7 @@ class en extends ce {
|
|
|
5621
5620
|
return this.renderer.renditionLayout;
|
|
5622
5621
|
}
|
|
5623
5622
|
get numberOfPages() {
|
|
5624
|
-
return
|
|
5623
|
+
return Zt({
|
|
5625
5624
|
isUsingVerticalWriting: !!this.isUsingVerticalWriting(),
|
|
5626
5625
|
itemHeight: this.layout.layoutInfo.height,
|
|
5627
5626
|
itemWidth: this.layout.layoutInfo.width,
|
|
@@ -5632,20 +5631,20 @@ class en extends ce {
|
|
|
5632
5631
|
});
|
|
5633
5632
|
}
|
|
5634
5633
|
}
|
|
5635
|
-
const
|
|
5634
|
+
const vs = (n, e, t) => {
|
|
5636
5635
|
const i = n.ownerDocument.createElement("div");
|
|
5637
5636
|
return i.classList.add("spineItem"), i.classList.add(`spineItem-${e.renditionLayout ?? "reflowable"}`), i.style.cssText = `
|
|
5638
5637
|
position: absolute;
|
|
5639
5638
|
overflow: hidden;
|
|
5640
5639
|
`, i.dataset.isReady = "false", t.execute("item.onBeforeContainerCreated", void 0, { element: i }), i;
|
|
5641
5640
|
};
|
|
5642
|
-
class
|
|
5641
|
+
class ws extends X {
|
|
5643
5642
|
constructor(e, t, i, o, s) {
|
|
5644
5643
|
super(), this.context = e, this.spineItemsManager = t, this.spineLocator = i, this.settings = o, this.spineLayout = s, this.forcedOpenSubject = new H([]);
|
|
5645
5644
|
const r = this.forcedOpenSubject.pipe(
|
|
5646
5645
|
S((u) => [...new Set(u.flat())].sort()),
|
|
5647
|
-
z(
|
|
5648
|
-
|
|
5646
|
+
z(fn),
|
|
5647
|
+
K({ bufferSize: 1, refCount: !0 })
|
|
5649
5648
|
);
|
|
5650
5649
|
P(
|
|
5651
5650
|
this.context.bridgeEvent.navigation$,
|
|
@@ -5656,7 +5655,7 @@ class Ps extends X {
|
|
|
5656
5655
|
// this can be changed by whatever we want and SHOULD not break navigation.
|
|
5657
5656
|
// Ideally loading faster is better but loading too close to user navigating can
|
|
5658
5657
|
// be dangerous.
|
|
5659
|
-
Se(100,
|
|
5658
|
+
Se(100, ae),
|
|
5660
5659
|
Ee(this.context.bridgeEvent.viewportFree$),
|
|
5661
5660
|
O(this.context.bridgeEvent.navigation$, r),
|
|
5662
5661
|
S(([, u, l]) => {
|
|
@@ -5690,9 +5689,9 @@ class Ps extends X {
|
|
|
5690
5689
|
super.destroy(), this.forcedOpenSubject.complete();
|
|
5691
5690
|
}
|
|
5692
5691
|
}
|
|
5693
|
-
const
|
|
5692
|
+
const en = (n, e, t) => {
|
|
5694
5693
|
const i = (t.width - e.width) / 2, o = (t.height - e.height) / 2;
|
|
5695
|
-
return new
|
|
5694
|
+
return new ce({
|
|
5696
5695
|
x: n.x - i,
|
|
5697
5696
|
y: n.y - o
|
|
5698
5697
|
});
|
|
@@ -5715,17 +5714,17 @@ class ye extends DOMRect {
|
|
|
5715
5714
|
return new ye(i.x, i.y, i.width, i.height);
|
|
5716
5715
|
}
|
|
5717
5716
|
}
|
|
5718
|
-
class
|
|
5717
|
+
class Ps {
|
|
5719
5718
|
constructor({ width: e, height: t }) {
|
|
5720
5719
|
this.__symbol = Symbol("AbsoluteViewport"), this.width = e, this.height = t;
|
|
5721
5720
|
}
|
|
5722
5721
|
}
|
|
5723
|
-
class
|
|
5722
|
+
class xs {
|
|
5724
5723
|
constructor({ width: e, height: t }) {
|
|
5725
5724
|
this.__symbol = Symbol("RelativeViewport"), this.width = e, this.height = t;
|
|
5726
5725
|
}
|
|
5727
5726
|
}
|
|
5728
|
-
const
|
|
5727
|
+
const $s = ({
|
|
5729
5728
|
pageIndex: n,
|
|
5730
5729
|
spineItemOrId: e,
|
|
5731
5730
|
spineItemsManager: t
|
|
@@ -5747,7 +5746,7 @@ const Ts = ({
|
|
|
5747
5746
|
{ currentAbsolutePage: 0, found: !1 }
|
|
5748
5747
|
);
|
|
5749
5748
|
return s;
|
|
5750
|
-
},
|
|
5749
|
+
}, Ts = ({
|
|
5751
5750
|
itemHeight: n,
|
|
5752
5751
|
itemWidth: e,
|
|
5753
5752
|
visibleWidthOfItem: t,
|
|
@@ -5756,7 +5755,7 @@ const Ts = ({
|
|
|
5756
5755
|
}) => {
|
|
5757
5756
|
const s = t / e, r = i / n;
|
|
5758
5757
|
return o.type === "percentage" ? s >= o.value && r >= o.value : t >= o.value && i >= o.value;
|
|
5759
|
-
},
|
|
5758
|
+
}, Fs = ({
|
|
5760
5759
|
visibleWidthOfItem: n,
|
|
5761
5760
|
visibleHeightOfItem: e,
|
|
5762
5761
|
threshold: t,
|
|
@@ -5764,7 +5763,7 @@ const Ts = ({
|
|
|
5764
5763
|
}) => {
|
|
5765
5764
|
const o = n / i.width, s = e / i.height;
|
|
5766
5765
|
return t.type === "percentage" ? s >= t.value && o >= t.value : e >= t.value && n >= t.value;
|
|
5767
|
-
},
|
|
5766
|
+
}, tn = ({
|
|
5768
5767
|
itemPosition: {
|
|
5769
5768
|
bottom: n,
|
|
5770
5769
|
left: e,
|
|
@@ -5788,14 +5787,14 @@ const Ts = ({
|
|
|
5788
5787
|
Math.min(n, g) - Math.max(i, d)
|
|
5789
5788
|
);
|
|
5790
5789
|
if (h <= 0 || p <= 0) return { visible: !1 };
|
|
5791
|
-
const y =
|
|
5790
|
+
const y = Fs({
|
|
5792
5791
|
threshold: r,
|
|
5793
5792
|
visibleHeightOfItem: p,
|
|
5794
5793
|
visibleWidthOfItem: h,
|
|
5795
5794
|
viewportPosition: a
|
|
5796
5795
|
});
|
|
5797
5796
|
return c ? { visible: y } : {
|
|
5798
|
-
visible:
|
|
5797
|
+
visible: Ts({
|
|
5799
5798
|
itemHeight: s,
|
|
5800
5799
|
itemWidth: o,
|
|
5801
5800
|
threshold: r,
|
|
@@ -5819,7 +5818,7 @@ const Ts = ({
|
|
|
5819
5818
|
}) => new M({
|
|
5820
5819
|
x: e + n.x,
|
|
5821
5820
|
y: t + n.y
|
|
5822
|
-
}),
|
|
5821
|
+
}), Ls = ({
|
|
5823
5822
|
position: n,
|
|
5824
5823
|
threshold: e,
|
|
5825
5824
|
restrictToScreen: t,
|
|
@@ -5834,14 +5833,14 @@ const Ts = ({
|
|
|
5834
5833
|
spineLayout: o
|
|
5835
5834
|
}) || i.get(0), c = i.items.reduce(
|
|
5836
5835
|
(h, p) => {
|
|
5837
|
-
const m = o.getSpineItemSpineLayoutInfo(p), y = s ? r.absoluteViewport : r.relativeViewport, f =
|
|
5836
|
+
const m = o.getSpineItemSpineLayoutInfo(p), y = s ? r.absoluteViewport : r.relativeViewport, f = en(
|
|
5838
5837
|
n,
|
|
5839
5838
|
r.absoluteViewport,
|
|
5840
5839
|
y
|
|
5841
5840
|
), b = ye.from(
|
|
5842
5841
|
f,
|
|
5843
5842
|
y
|
|
5844
|
-
), { visible: I } =
|
|
5843
|
+
), { visible: I } = tn({
|
|
5845
5844
|
itemPosition: m,
|
|
5846
5845
|
threshold: e,
|
|
5847
5846
|
viewportPosition: b,
|
|
@@ -5857,7 +5856,7 @@ const Ts = ({
|
|
|
5857
5856
|
beginIndex: d ?? 0,
|
|
5858
5857
|
endIndex: g ?? 0
|
|
5859
5858
|
};
|
|
5860
|
-
},
|
|
5859
|
+
}, Ms = ({
|
|
5861
5860
|
spineItemsManager: n,
|
|
5862
5861
|
context: e,
|
|
5863
5862
|
spineItemLocator: t,
|
|
@@ -5903,11 +5902,11 @@ const Ts = ({
|
|
|
5903
5902
|
useAbsoluteViewport: b = !0,
|
|
5904
5903
|
viewport: I
|
|
5905
5904
|
}) => {
|
|
5906
|
-
const F = y.numberOfPages, A = Array.from(Array(F)).map((
|
|
5905
|
+
const F = y.numberOfPages, A = Array.from(Array(F)).map((oe, be) => {
|
|
5907
5906
|
const De = t.getSpineItemPositionFromPageIndex({
|
|
5908
5907
|
pageIndex: be,
|
|
5909
5908
|
spineItem: y
|
|
5910
|
-
}),
|
|
5909
|
+
}), le = je({
|
|
5911
5910
|
spineItemPosition: De,
|
|
5912
5911
|
itemLayout: o.getSpineItemSpineLayoutInfo(y)
|
|
5913
5912
|
});
|
|
@@ -5916,28 +5915,28 @@ const Ts = ({
|
|
|
5916
5915
|
absolutePosition: {
|
|
5917
5916
|
width: I.pageSize.width,
|
|
5918
5917
|
height: I.pageSize.height,
|
|
5919
|
-
left:
|
|
5920
|
-
top:
|
|
5921
|
-
bottom:
|
|
5922
|
-
right:
|
|
5918
|
+
left: le.x,
|
|
5919
|
+
top: le.y,
|
|
5920
|
+
bottom: le.y + I.pageSize.height,
|
|
5921
|
+
right: le.x + I.pageSize.width
|
|
5923
5922
|
}
|
|
5924
5923
|
};
|
|
5925
5924
|
}).reduce(
|
|
5926
|
-
(
|
|
5927
|
-
const
|
|
5925
|
+
(oe, { absolutePosition: be, index: De }) => {
|
|
5926
|
+
const le = b ? I.absoluteViewport : I.relativeViewport, nn = en(
|
|
5928
5927
|
p,
|
|
5929
5928
|
I.absoluteViewport,
|
|
5930
|
-
|
|
5931
|
-
),
|
|
5932
|
-
|
|
5933
|
-
|
|
5934
|
-
), { visible:
|
|
5935
|
-
viewportPosition:
|
|
5929
|
+
le
|
|
5930
|
+
), on = ye.from(
|
|
5931
|
+
nn,
|
|
5932
|
+
le
|
|
5933
|
+
), { visible: sn } = tn({
|
|
5934
|
+
viewportPosition: on,
|
|
5936
5935
|
restrictToScreen: f,
|
|
5937
5936
|
threshold: m,
|
|
5938
5937
|
itemPosition: be
|
|
5939
5938
|
});
|
|
5940
|
-
return
|
|
5939
|
+
return sn ? [...oe, De] : oe;
|
|
5941
5940
|
},
|
|
5942
5941
|
[]
|
|
5943
5942
|
), Y = A[0], B = A[A.length - 1] ?? Y;
|
|
@@ -5961,7 +5960,7 @@ const Ts = ({
|
|
|
5961
5960
|
/**
|
|
5962
5961
|
* @deprecated use Pages
|
|
5963
5962
|
*/
|
|
5964
|
-
_getAbsolutePageIndexFromPageIndex: (p) =>
|
|
5963
|
+
_getAbsolutePageIndexFromPageIndex: (p) => $s({
|
|
5965
5964
|
...p,
|
|
5966
5965
|
spineItemsManager: n
|
|
5967
5966
|
}),
|
|
@@ -6002,7 +6001,7 @@ const Ts = ({
|
|
|
6002
6001
|
}),
|
|
6003
6002
|
getSpineItemFromIframe: c,
|
|
6004
6003
|
getSpineItemPageIndexFromNode: u,
|
|
6005
|
-
getVisibleSpineItemsFromPosition: (p) =>
|
|
6004
|
+
getVisibleSpineItemsFromPosition: (p) => Ls({
|
|
6006
6005
|
spineItemsManager: n,
|
|
6007
6006
|
spineLayout: o,
|
|
6008
6007
|
viewport: s,
|
|
@@ -6025,10 +6024,10 @@ const Ts = ({
|
|
|
6025
6024
|
});
|
|
6026
6025
|
}
|
|
6027
6026
|
};
|
|
6028
|
-
},
|
|
6027
|
+
}, Cs = D.namespace("spine"), Es = ({
|
|
6029
6028
|
position: n,
|
|
6030
6029
|
pageSize: e
|
|
6031
|
-
}) => new
|
|
6030
|
+
}) => new Ii({
|
|
6032
6031
|
...n,
|
|
6033
6032
|
left: n.x,
|
|
6034
6033
|
top: n.y,
|
|
@@ -6037,7 +6036,7 @@ const Ts = ({
|
|
|
6037
6036
|
bottom: n.y + e.height,
|
|
6038
6037
|
right: n.x + e.width
|
|
6039
6038
|
});
|
|
6040
|
-
class
|
|
6039
|
+
class Ds extends ue {
|
|
6041
6040
|
constructor(e, t, i, o, s, r) {
|
|
6042
6041
|
super({ pages: [] }), this.spineLayout = e, this.spineItemsManager = t, this.spineItemLocator = i, this.context = o, this.locator = s, this.viewport = r, this.fromSpineItemPageIndex = (a, c) => this.value.pages.find(
|
|
6043
6042
|
(u) => u.itemIndex === a.index && u.pageIndex === c
|
|
@@ -6055,11 +6054,11 @@ class Rs extends ce {
|
|
|
6055
6054
|
spineItemPosition: f
|
|
6056
6055
|
});
|
|
6057
6056
|
return {
|
|
6058
|
-
absoluteLayout:
|
|
6057
|
+
absoluteLayout: Es({
|
|
6059
6058
|
pageSize: a,
|
|
6060
6059
|
position: b
|
|
6061
6060
|
}),
|
|
6062
|
-
layout: new
|
|
6061
|
+
layout: new bi({
|
|
6063
6062
|
left: f.x,
|
|
6064
6063
|
right: f.x + a.width,
|
|
6065
6064
|
top: f.y,
|
|
@@ -6082,11 +6081,11 @@ class Rs extends ce {
|
|
|
6082
6081
|
return k(
|
|
6083
6082
|
c.map((l) => {
|
|
6084
6083
|
const { spineItem: d, ...g } = l;
|
|
6085
|
-
return new
|
|
6084
|
+
return new ie((h) => {
|
|
6086
6085
|
const p = l.spineItem.renderer?.getDocumentFrame();
|
|
6087
6086
|
let m;
|
|
6088
6087
|
p && p?.contentWindow?.document && // very important because it is being used by next functions
|
|
6089
|
-
p.contentWindow.document.body !== null && (m =
|
|
6088
|
+
p.contentWindow.document.body !== null && (m = Ln(
|
|
6090
6089
|
p.contentWindow.document,
|
|
6091
6090
|
l.layout
|
|
6092
6091
|
)), h.next({ ...g, firstVisibleNode: m });
|
|
@@ -6094,12 +6093,12 @@ class Rs extends ce {
|
|
|
6094
6093
|
})
|
|
6095
6094
|
);
|
|
6096
6095
|
}),
|
|
6097
|
-
S((a) => (
|
|
6096
|
+
S((a) => (Cs.info("Pages layout", a), { pages: a })),
|
|
6098
6097
|
E()
|
|
6099
6098
|
), this.layout$.pipe(T(this.destroy$)).subscribe(this.next.bind(this));
|
|
6100
6099
|
}
|
|
6101
6100
|
}
|
|
6102
|
-
class
|
|
6101
|
+
class Rs extends X {
|
|
6103
6102
|
constructor(e, t) {
|
|
6104
6103
|
super(), this.spineItemsManager = e, this.spineLocator = t, this.itemIsReady$ = this.spineItemsManager.items$.pipe(
|
|
6105
6104
|
w((i) => {
|
|
@@ -6112,7 +6111,7 @@ class As extends X {
|
|
|
6112
6111
|
), this.itemResize$ = this.spineItemsManager.items$.pipe(
|
|
6113
6112
|
w((i) => {
|
|
6114
6113
|
const o = i.map(
|
|
6115
|
-
(s) =>
|
|
6114
|
+
(s) => et(s.element).pipe(
|
|
6116
6115
|
S((r) => ({ entries: r, item: s }))
|
|
6117
6116
|
)
|
|
6118
6117
|
);
|
|
@@ -6122,7 +6121,7 @@ class As extends X {
|
|
|
6122
6121
|
);
|
|
6123
6122
|
}
|
|
6124
6123
|
}
|
|
6125
|
-
const
|
|
6124
|
+
const As = ({
|
|
6126
6125
|
horizontalOffset: n,
|
|
6127
6126
|
verticalOffset: e,
|
|
6128
6127
|
context: t,
|
|
@@ -6192,7 +6191,7 @@ const Os = ({
|
|
|
6192
6191
|
})
|
|
6193
6192
|
);
|
|
6194
6193
|
};
|
|
6195
|
-
class
|
|
6194
|
+
class Os extends X {
|
|
6196
6195
|
constructor(e, t, i, o) {
|
|
6197
6196
|
super(), this.spineItemsManager = e, this.context = t, this.settings = i, this.viewport = o, this.layoutSubject = new R(), this.spineItemsRelativeLayouts = [], e.items$.pipe(
|
|
6198
6197
|
x(() => {
|
|
@@ -6236,12 +6235,12 @@ class Ns extends X {
|
|
|
6236
6235
|
),
|
|
6237
6236
|
Ue(() => {
|
|
6238
6237
|
s.next(!0);
|
|
6239
|
-
const r = this.context.manifest, a =
|
|
6238
|
+
const r = this.context.manifest, a = qt(r) ?? !1;
|
|
6240
6239
|
return N(this.spineItemsManager.items).pipe(
|
|
6241
|
-
|
|
6240
|
+
pn(
|
|
6242
6241
|
(u, l, d) => u.pipe(
|
|
6243
|
-
|
|
6244
|
-
({ horizontalOffset: g, verticalOffset: h }) =>
|
|
6242
|
+
st(
|
|
6243
|
+
({ horizontalOffset: g, verticalOffset: h }) => As({
|
|
6245
6244
|
context: this.context,
|
|
6246
6245
|
horizontalOffset: g,
|
|
6247
6246
|
index: d,
|
|
@@ -6267,7 +6266,7 @@ class Ns extends X {
|
|
|
6267
6266
|
),
|
|
6268
6267
|
v({ horizontalOffset: 0, verticalOffset: 0 })
|
|
6269
6268
|
),
|
|
6270
|
-
|
|
6269
|
+
st((u) => u),
|
|
6271
6270
|
de(() => {
|
|
6272
6271
|
s.next(!1);
|
|
6273
6272
|
})
|
|
@@ -6299,32 +6298,32 @@ class Ns extends X {
|
|
|
6299
6298
|
super.destroy(), this.layoutSubject.complete();
|
|
6300
6299
|
}
|
|
6301
6300
|
}
|
|
6302
|
-
class
|
|
6301
|
+
class Ns extends X {
|
|
6303
6302
|
constructor(e, t, i, o, s, r, a) {
|
|
6304
6303
|
super(), this.context = e, this.pagination = t, this.spineItemsManager = i, this.spineItemLocator = o, this.settings = s, this.hookManager = r, this.viewport = a, this.elementSubject = new H(
|
|
6305
6304
|
void 0
|
|
6306
|
-
), this.element$ = this.elementSubject.asObservable(), this.spineLayout = new
|
|
6305
|
+
), this.element$ = this.elementSubject.asObservable(), this.spineLayout = new Os(
|
|
6307
6306
|
i,
|
|
6308
6307
|
e,
|
|
6309
6308
|
s,
|
|
6310
6309
|
a
|
|
6311
|
-
), this.locator =
|
|
6310
|
+
), this.locator = Ms({
|
|
6312
6311
|
context: e,
|
|
6313
6312
|
spineItemsManager: i,
|
|
6314
6313
|
spineItemLocator: o,
|
|
6315
6314
|
settings: s,
|
|
6316
6315
|
spineLayout: this.spineLayout,
|
|
6317
6316
|
viewport: a
|
|
6318
|
-
}), this.spineItemsLoader = new
|
|
6317
|
+
}), this.spineItemsLoader = new ws(
|
|
6319
6318
|
this.context,
|
|
6320
6319
|
i,
|
|
6321
6320
|
this.locator,
|
|
6322
6321
|
s,
|
|
6323
6322
|
this.spineLayout
|
|
6324
|
-
), this.spineItemsObserver = new
|
|
6323
|
+
), this.spineItemsObserver = new Rs(
|
|
6325
6324
|
i,
|
|
6326
6325
|
this.locator
|
|
6327
|
-
), this.pages = new
|
|
6326
|
+
), this.pages = new Ds(
|
|
6328
6327
|
this.spineLayout,
|
|
6329
6328
|
this.spineItemsManager,
|
|
6330
6329
|
this.spineItemLocator,
|
|
@@ -6333,7 +6332,7 @@ class Vs extends X {
|
|
|
6333
6332
|
this.viewport
|
|
6334
6333
|
);
|
|
6335
6334
|
const c = e.watch("rootElement").pipe(
|
|
6336
|
-
|
|
6335
|
+
re(J),
|
|
6337
6336
|
j((l) => {
|
|
6338
6337
|
const d = l.ownerDocument.createElement("div");
|
|
6339
6338
|
d.style.cssText = `
|
|
@@ -6349,7 +6348,7 @@ class Vs extends X {
|
|
|
6349
6348
|
if (!d) return;
|
|
6350
6349
|
this.spineItemsManager.destroyItems();
|
|
6351
6350
|
const g = l.spineItems.map(
|
|
6352
|
-
(h, p) => new
|
|
6351
|
+
(h, p) => new Qt(
|
|
6353
6352
|
h,
|
|
6354
6353
|
d,
|
|
6355
6354
|
this.context,
|
|
@@ -6380,7 +6379,7 @@ class Vs extends X {
|
|
|
6380
6379
|
super.destroy(), this.pages.destroy(), this.spineItemsLoader.destroy(), this.elementSubject.getValue()?.remove(), this.elementSubject.complete();
|
|
6381
6380
|
}
|
|
6382
6381
|
}
|
|
6383
|
-
class
|
|
6382
|
+
class Vs extends X {
|
|
6384
6383
|
constructor(e, t) {
|
|
6385
6384
|
super(), this.context = e, this.settings = t, this.orderedSpineItemsSubject = new H([]), this.items$ = this.orderedSpineItemsSubject.asObservable();
|
|
6386
6385
|
}
|
|
@@ -6394,7 +6393,7 @@ class js extends X {
|
|
|
6394
6393
|
return i > o ? "after" : i === o ? "same" : "before";
|
|
6395
6394
|
}
|
|
6396
6395
|
getSpineItemIndex(e) {
|
|
6397
|
-
const t = e instanceof
|
|
6396
|
+
const t = e instanceof Qt ? e : this.get(e);
|
|
6398
6397
|
if (!t) return;
|
|
6399
6398
|
const i = this.orderedSpineItemsSubject.value.indexOf(t);
|
|
6400
6399
|
return i < 0 ? void 0 : i;
|
|
@@ -6407,7 +6406,7 @@ class js extends X {
|
|
|
6407
6406
|
}
|
|
6408
6407
|
// @todo move
|
|
6409
6408
|
getSpineItemFromCfi(e) {
|
|
6410
|
-
const { itemIndex: t } =
|
|
6409
|
+
const { itemIndex: t } = it(e);
|
|
6411
6410
|
if (t !== void 0)
|
|
6412
6411
|
return this.get(t);
|
|
6413
6412
|
}
|
|
@@ -6423,10 +6422,10 @@ class js extends X {
|
|
|
6423
6422
|
});
|
|
6424
6423
|
}
|
|
6425
6424
|
}
|
|
6426
|
-
class
|
|
6425
|
+
class js extends ue {
|
|
6427
6426
|
constructor(e, t) {
|
|
6428
6427
|
const i = document.createElement("div");
|
|
6429
|
-
i.setAttribute(`data-${
|
|
6428
|
+
i.setAttribute(`data-${oi}`, ""), super({
|
|
6430
6429
|
element: i,
|
|
6431
6430
|
pageSize: {
|
|
6432
6431
|
width: 1,
|
|
@@ -6466,7 +6465,7 @@ class ks extends ce {
|
|
|
6466
6465
|
});
|
|
6467
6466
|
}
|
|
6468
6467
|
get absoluteViewport() {
|
|
6469
|
-
return new
|
|
6468
|
+
return new Ps({
|
|
6470
6469
|
width: this.value.width,
|
|
6471
6470
|
height: this.value.height
|
|
6472
6471
|
});
|
|
@@ -6494,18 +6493,18 @@ class ks extends ce {
|
|
|
6494
6493
|
*/
|
|
6495
6494
|
get relativeViewport() {
|
|
6496
6495
|
const e = this.absoluteViewport, t = this.scaleFactor;
|
|
6497
|
-
return new
|
|
6496
|
+
return new xs({
|
|
6498
6497
|
width: e.width / t,
|
|
6499
6498
|
height: e.height / t
|
|
6500
6499
|
});
|
|
6501
6500
|
}
|
|
6502
6501
|
}
|
|
6503
|
-
const
|
|
6504
|
-
const e = crypto.randomUUID(), t = new R(), i = new R(), o = new
|
|
6502
|
+
const xt = `${kt}-core`, ks = (n) => {
|
|
6503
|
+
const e = crypto.randomUUID(), t = new R(), i = new R(), o = new Oo(), s = new Ro(), r = new Ss(n, s), a = new Ao(s, r), c = new Vs(s, r), u = new js(s, r), l = Jt({
|
|
6505
6504
|
context: s,
|
|
6506
6505
|
settings: r,
|
|
6507
6506
|
viewport: u
|
|
6508
|
-
}), d = new
|
|
6507
|
+
}), d = new hs(s, c), g = new Ns(
|
|
6509
6508
|
s,
|
|
6510
6509
|
d,
|
|
6511
6510
|
c,
|
|
@@ -6513,14 +6512,14 @@ const $t = `${Ut}-core`, Us = (n) => {
|
|
|
6513
6512
|
r,
|
|
6514
6513
|
o,
|
|
6515
6514
|
u
|
|
6516
|
-
), h =
|
|
6515
|
+
), h = gs({
|
|
6517
6516
|
context: s,
|
|
6518
6517
|
spineItemsManager: c,
|
|
6519
6518
|
hookManager: o,
|
|
6520
6519
|
spine: g,
|
|
6521
6520
|
settings: r,
|
|
6522
6521
|
viewport: u
|
|
6523
|
-
}), p = new
|
|
6522
|
+
}), p = new ms(
|
|
6524
6523
|
s,
|
|
6525
6524
|
d,
|
|
6526
6525
|
c,
|
|
@@ -6539,21 +6538,21 @@ const $t = `${Ut}-core`, Us = (n) => {
|
|
|
6539
6538
|
return;
|
|
6540
6539
|
}
|
|
6541
6540
|
D.log("load", { options: $ });
|
|
6542
|
-
const B =
|
|
6541
|
+
const B = Us(A, e);
|
|
6543
6542
|
s.update({
|
|
6544
6543
|
manifest: Y,
|
|
6545
6544
|
rootElement: B
|
|
6546
6545
|
}), m();
|
|
6547
|
-
}, f = r.watch(["computedSpreadMode"]).pipe(
|
|
6546
|
+
}, f = r.watch(["computedSpreadMode"]).pipe(Mt(1), j(m)), b = t.pipe(
|
|
6548
6547
|
j(() => {
|
|
6549
6548
|
const $ = s.value.rootElement;
|
|
6550
6549
|
$ && ($.style.setProperty("overflow", "hidden"), u.layout(), g.layout());
|
|
6551
6550
|
}),
|
|
6552
6551
|
G(i)
|
|
6553
6552
|
), I = P(b, f).subscribe();
|
|
6554
|
-
|
|
6553
|
+
Ze(document, xt, No);
|
|
6555
6554
|
const F = () => {
|
|
6556
|
-
|
|
6555
|
+
Je(document, xt), I.unsubscribe(), c.destroy(), p.destroy(), r.destroy(), d.destroy(), s.destroy(), h.destroy(), g.destroy(), a.destroy(), i.next(), i.complete(), u.destroy();
|
|
6557
6556
|
};
|
|
6558
6557
|
return {
|
|
6559
6558
|
id: e,
|
|
@@ -6561,13 +6560,13 @@ const $t = `${Ut}-core`, Us = (n) => {
|
|
|
6561
6560
|
spine: g,
|
|
6562
6561
|
hookManager: o,
|
|
6563
6562
|
cfi: {
|
|
6564
|
-
generateCfiFromRange:
|
|
6565
|
-
parseCfi:
|
|
6563
|
+
generateCfiFromRange: so,
|
|
6564
|
+
parseCfi: it,
|
|
6566
6565
|
generateCfiForSpineItemPage: ($) => He({
|
|
6567
6566
|
...$,
|
|
6568
6567
|
spine: g
|
|
6569
6568
|
}),
|
|
6570
|
-
resolveCfi: ($) =>
|
|
6569
|
+
resolveCfi: ($) => Xt({ ...$, spineItemsManager: c })
|
|
6571
6570
|
},
|
|
6572
6571
|
navigation: h,
|
|
6573
6572
|
spineItemsObserver: g.spineItemsObserver,
|
|
@@ -6595,38 +6594,38 @@ const $t = `${Ut}-core`, Us = (n) => {
|
|
|
6595
6594
|
* It can typically be used to hide a loading indicator.
|
|
6596
6595
|
*/
|
|
6597
6596
|
state$: s.manifest$.pipe(
|
|
6598
|
-
|
|
6597
|
+
Q(($) => $ ? "ready" : "idle")
|
|
6599
6598
|
),
|
|
6600
6599
|
features: a,
|
|
6601
6600
|
$: {
|
|
6602
6601
|
destroy$: i
|
|
6603
6602
|
}
|
|
6604
6603
|
};
|
|
6605
|
-
},
|
|
6604
|
+
}, Us = (n, e) => (n.style.cssText = `
|
|
6606
6605
|
${n.style.cssText}
|
|
6607
6606
|
background-color: white;
|
|
6608
6607
|
position: relative;
|
|
6609
|
-
`, n.classList.add(`${W}-reader`), n.setAttribute(
|
|
6608
|
+
`, n.classList.add(`${W}-reader`), n.setAttribute(ii, e), n), er = (
|
|
6610
6609
|
//__
|
|
6611
|
-
|
|
6612
|
-
|
|
6613
|
-
|
|
6614
|
-
|
|
6615
|
-
|
|
6616
|
-
|
|
6617
|
-
|
|
6618
|
-
|
|
6619
|
-
|
|
6620
|
-
|
|
6621
|
-
|
|
6622
|
-
|
|
6623
|
-
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
|
|
6610
|
+
bo(
|
|
6611
|
+
Gn(
|
|
6612
|
+
Ai(
|
|
6613
|
+
wo(
|
|
6614
|
+
qn(
|
|
6615
|
+
Un(
|
|
6616
|
+
ho(
|
|
6617
|
+
vo(
|
|
6618
|
+
Eo(
|
|
6619
|
+
qi(
|
|
6620
|
+
Si(
|
|
6621
|
+
Ni(
|
|
6622
|
+
zn(
|
|
6623
|
+
Io(
|
|
6624
|
+
lo(
|
|
6625
|
+
Ci(
|
|
6626
|
+
Bn(
|
|
6628
6627
|
// __
|
|
6629
|
-
|
|
6628
|
+
ks
|
|
6630
6629
|
)
|
|
6631
6630
|
)
|
|
6632
6631
|
)
|
|
@@ -6644,82 +6643,83 @@ const $t = `${Ut}-core`, Us = (n) => {
|
|
|
6644
6643
|
)
|
|
6645
6644
|
)
|
|
6646
6645
|
)
|
|
6647
|
-
),
|
|
6646
|
+
), tr = (n) => (e) => n(e);
|
|
6648
6647
|
export {
|
|
6649
|
-
|
|
6650
|
-
|
|
6651
|
-
|
|
6648
|
+
Wt as AbstractSpinePosition,
|
|
6649
|
+
Ro as Context,
|
|
6650
|
+
Uo as ControlledNavigationController,
|
|
6652
6651
|
X as DestroyableClass,
|
|
6653
6652
|
fe as DocumentRenderer,
|
|
6654
|
-
|
|
6655
|
-
|
|
6653
|
+
Ao as Features,
|
|
6654
|
+
ii as HTML_ATTRIBUTE_DATA_READER_ID,
|
|
6656
6655
|
W as HTML_PREFIX,
|
|
6657
|
-
|
|
6658
|
-
|
|
6659
|
-
|
|
6660
|
-
|
|
6661
|
-
|
|
6662
|
-
|
|
6663
|
-
|
|
6664
|
-
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6668
|
-
|
|
6669
|
-
|
|
6670
|
-
|
|
6671
|
-
|
|
6672
|
-
|
|
6673
|
-
|
|
6674
|
-
|
|
6675
|
-
|
|
6676
|
-
|
|
6677
|
-
|
|
6678
|
-
|
|
6679
|
-
|
|
6656
|
+
si as HTML_PREFIX_SCROLL_NAVIGATOR,
|
|
6657
|
+
oi as HTML_PREFIX_VIEWPORT,
|
|
6658
|
+
kt as HTML_STYLE_PREFIX,
|
|
6659
|
+
Oo as HookManager,
|
|
6660
|
+
ni as ITEM_EXTENSION_VALID_FOR_FRAME_SRC,
|
|
6661
|
+
es as InternalNavigator,
|
|
6662
|
+
nt as LayoutEntry,
|
|
6663
|
+
Gt as Locker,
|
|
6664
|
+
Js as PAGINATION_UPDATE_AFTER_VIEWPORT_ADJUSTMENT_DEBOUNCE,
|
|
6665
|
+
Gs as PROSE_READER_NAMESPACE,
|
|
6666
|
+
Ds as Pages,
|
|
6667
|
+
hs as Pagination,
|
|
6668
|
+
ms as PaginationController,
|
|
6669
|
+
ue as ReactiveEntity,
|
|
6670
|
+
tt as ResourceHandler,
|
|
6671
|
+
uo as ResourcesLocator,
|
|
6672
|
+
Fo as ScrollNavigationController,
|
|
6673
|
+
mt as ScrollPosition,
|
|
6674
|
+
ys as SettingsManager,
|
|
6675
|
+
Ns as Spine,
|
|
6676
|
+
Qt as SpineItem,
|
|
6677
|
+
bi as SpineItemPageLayout,
|
|
6678
|
+
Ii as SpineItemPageSpineLayout,
|
|
6680
6679
|
C as SpineItemPosition,
|
|
6681
6680
|
_e as SpineItemSpineLayout,
|
|
6682
|
-
|
|
6683
|
-
|
|
6681
|
+
Vs as SpineItemsManager,
|
|
6682
|
+
Rs as SpineItemsObserver,
|
|
6684
6683
|
M as SpinePosition,
|
|
6685
|
-
|
|
6684
|
+
To as UnboundScrollPosition,
|
|
6686
6685
|
Ae as UnboundSpineItemPagePosition,
|
|
6687
|
-
|
|
6688
|
-
|
|
6689
|
-
|
|
6690
|
-
|
|
6691
|
-
|
|
6692
|
-
|
|
6693
|
-
|
|
6686
|
+
ce as UnboundSpinePosition,
|
|
6687
|
+
Zs as VIEWPORT_ADJUSTMENT_THROTTLE,
|
|
6688
|
+
js as Viewport,
|
|
6689
|
+
co as consolidate,
|
|
6690
|
+
er as createReader,
|
|
6691
|
+
ct as deferIdle,
|
|
6692
|
+
Xn as deferNextResult,
|
|
6694
6693
|
He as generateCfiForSpineItemPage,
|
|
6695
|
-
|
|
6694
|
+
so as generateCfiFromRange,
|
|
6696
6695
|
he as generateRootCfi,
|
|
6697
|
-
|
|
6698
|
-
|
|
6699
|
-
|
|
6700
|
-
|
|
6701
|
-
|
|
6702
|
-
|
|
6703
|
-
|
|
6704
|
-
|
|
6705
|
-
|
|
6696
|
+
at as getAttributeValueFromString,
|
|
6697
|
+
Ys as getBase64FromBlob,
|
|
6698
|
+
Ke as getFrameViewportInfo,
|
|
6699
|
+
Qs as getItemAnchor,
|
|
6700
|
+
Si as htmlEnhancer,
|
|
6701
|
+
Nt as idle,
|
|
6702
|
+
Vn as injectCSS,
|
|
6703
|
+
J as isDefined,
|
|
6704
|
+
At as isHtmlElement,
|
|
6705
|
+
On as isHtmlTagElement,
|
|
6706
6706
|
Be as isRootCfi,
|
|
6707
|
-
|
|
6708
|
-
|
|
6709
|
-
|
|
6710
|
-
|
|
6711
|
-
|
|
6712
|
-
|
|
6713
|
-
|
|
6714
|
-
|
|
6715
|
-
|
|
6716
|
-
|
|
6717
|
-
|
|
6718
|
-
|
|
6719
|
-
|
|
6720
|
-
|
|
6721
|
-
|
|
6707
|
+
or as isShallowEqual,
|
|
6708
|
+
Ci as layoutEnhancer,
|
|
6709
|
+
Ot as mapKeysTo,
|
|
6710
|
+
Xs as observeIntersection,
|
|
6711
|
+
ut as observeMutation,
|
|
6712
|
+
et as observeResize,
|
|
6713
|
+
lo as paginationEnhancer,
|
|
6714
|
+
it as parseCfi,
|
|
6715
|
+
Bs as removeCSS,
|
|
6716
|
+
Xt as resolveCfi,
|
|
6717
|
+
tr as rootEnhancer,
|
|
6718
|
+
Es as spinePositionToSpineItemSpineLayout,
|
|
6719
|
+
ne as upsertCSSToFrame,
|
|
6720
|
+
jn as waitForFrameLoad,
|
|
6721
|
+
kn as waitForFrameReady,
|
|
6722
6722
|
Ee as waitForSwitch,
|
|
6723
|
-
|
|
6723
|
+
Qe as watchKeys
|
|
6724
6724
|
};
|
|
6725
6725
|
//# sourceMappingURL=index.js.map
|