@prose-reader/core 1.297.0 → 1.299.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/createReaderWithEnhancer.d.ts +3 -1
- package/dist/index.js +761 -749
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +18 -18
- package/dist/index.umd.cjs.map +1 -1
- package/dist/reader.d.ts +4 -1
- package/dist/spine/Spine.d.ts +2 -2
- package/dist/spine/SpineLayout.d.ts +5 -2
- package/dist/spine/SpineLayout.test.d.ts +1 -0
- package/dist/utilities.d.ts +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Report as wn, isShallowEqual as U, shallowMergeIfDefined as
|
|
2
|
-
import { isShallowEqual as
|
|
3
|
-
import { switchMap as
|
|
4
|
-
import { switchMap as G, first as
|
|
5
|
-
import { generate as
|
|
6
|
-
const
|
|
1
|
+
import { Report as wn, isShallowEqual as U, shallowMergeIfDefined as Le, getParentPath as xn, parseContentType as Pn, detectMimeTypeFromName as Qe, arrayEqual as $n } from "@prose-reader/shared";
|
|
2
|
+
import { isShallowEqual as oa } from "@prose-reader/shared";
|
|
3
|
+
import { switchMap as $, of as P, fromEvent as K, take as Dt, map as y, from as B, takeUntil as M, defer as Ot, Observable as le, Subject as k, combineLatest as j, merge as T, EMPTY as q, NEVER as Se, tap as F, share as R, BehaviorSubject as Q, distinctUntilChanged as E, filter as L, mergeMap as ye, first as W, endWith as we, catchError as Ne, finalize as be, lastValueFrom as Tn, scheduled as Cn, animationFrameScheduler as xe, skip as Vt, exhaustMap as Fn, debounceTime as et, withLatestFrom as H, throttleTime as Mn, startWith as Ie, switchScan as Ln, shareReplay as Z, defaultIfEmpty as Nn, auditTime as An, forkJoin as En, delay as Ae, timer as $e, ReplaySubject as ke, identity as Pe, debounce as Rn, concatMap as Dn, timeout as On } from "rxjs";
|
|
4
|
+
import { switchMap as G, first as Vn, map as pe, distinctUntilChanged as Oe, startWith as kn, shareReplay as kt, tap as z, pairwise as jn, take as Un, takeUntil as ie, filter as fe, debounceTime as zn, skip as jt, mergeMap as Wn, catchError as ut, share as _n } from "rxjs/operators";
|
|
5
|
+
import { generate as qe, parse as Ut, isIndirectionOnly as Bn, isParsedCfiRange as Hn, resolve as qn } from "@prose-reader/cfi";
|
|
6
|
+
const Yn = "@prose-reader/core", N = wn.namespace(Yn, void 0, {
|
|
7
7
|
color: "#98cde7"
|
|
8
|
-
}),
|
|
8
|
+
}), Xn = [
|
|
9
9
|
"pointercancel",
|
|
10
10
|
"pointerdown",
|
|
11
11
|
"pointerenter",
|
|
@@ -24,7 +24,7 @@ function te(t, e, n) {
|
|
|
24
24
|
function zt(t, e) {
|
|
25
25
|
t.hasAttribute(e) && t.removeAttribute(e);
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function Gn(t, e, n) {
|
|
28
28
|
t[e] !== n && (t[e] = n);
|
|
29
29
|
}
|
|
30
30
|
function w(t, e, n) {
|
|
@@ -33,26 +33,26 @@ function w(t, e, n) {
|
|
|
33
33
|
function ce(t, e) {
|
|
34
34
|
t.getPropertyValue(e) !== "" && t.removeProperty(e);
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function Zn(t, e, n) {
|
|
37
37
|
if ("caretPositionFromPoint" in t)
|
|
38
38
|
return t.caretPositionFromPoint(e, n);
|
|
39
39
|
if ("caretRangeFromPoint" in t && // @ts-expect-error limited availability
|
|
40
40
|
typeof t.caretRangeFromPoint < "u")
|
|
41
41
|
return t.caretRangeFromPoint(e, n);
|
|
42
42
|
}
|
|
43
|
-
const
|
|
43
|
+
const Jn = (t, e) => {
|
|
44
44
|
const n = "createRange" in t ? t : t.ownerDocument;
|
|
45
45
|
if (!n) return;
|
|
46
|
-
const i = "body" in t ?
|
|
46
|
+
const i = "body" in t ? Ye(t.body, e) : Ye(t, e);
|
|
47
47
|
if (i) {
|
|
48
48
|
let o, r = 0;
|
|
49
49
|
const s = n.createRange();
|
|
50
50
|
return Array.from(i.childNodes).some((a) => {
|
|
51
51
|
s.selectNodeContents(a);
|
|
52
|
-
const c = s.getClientRects(), u =
|
|
52
|
+
const c = s.getClientRects(), u = Kn(c, e);
|
|
53
53
|
if (u) {
|
|
54
54
|
o = s.cloneRange();
|
|
55
|
-
const d =
|
|
55
|
+
const d = Zn(
|
|
56
56
|
n,
|
|
57
57
|
Math.ceil(u.left),
|
|
58
58
|
Math.ceil(u.top)
|
|
@@ -65,7 +65,7 @@ const Zn = (t, e) => {
|
|
|
65
65
|
offset: r
|
|
66
66
|
} : { node: i, offset: 0 };
|
|
67
67
|
}
|
|
68
|
-
},
|
|
68
|
+
}, Ye = (t, e) => {
|
|
69
69
|
const n = t.getBoundingClientRect(), i = Wt(
|
|
70
70
|
n,
|
|
71
71
|
e
|
|
@@ -73,7 +73,7 @@ const Zn = (t, e) => {
|
|
|
73
73
|
let o;
|
|
74
74
|
i !== "before" && i !== "after" && (o = t);
|
|
75
75
|
for (const r of t.children) {
|
|
76
|
-
const s =
|
|
76
|
+
const s = Ye(r, e);
|
|
77
77
|
if (s)
|
|
78
78
|
return s;
|
|
79
79
|
}
|
|
@@ -82,13 +82,13 @@ const Zn = (t, e) => {
|
|
|
82
82
|
function Wt(t, { left: e, right: n }) {
|
|
83
83
|
return t.left <= e && t.right <= e ? "before" : t.left <= e && t.right > e && t.right <= n ? "partially-before" : t.left <= n && t.right > n ? "partially-after" : t.left > n ? "after" : "within";
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function Kn(t, e) {
|
|
86
86
|
return Array.from(t).find((n) => {
|
|
87
87
|
const i = Wt(n, e);
|
|
88
88
|
return i !== "before" && i !== "after";
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
|
-
const
|
|
91
|
+
const Qn = (t, e) => {
|
|
92
92
|
if (t.nodeType !== Node.CDATA_SECTION_NODE && t.nodeType !== Node.DOCUMENT_TYPE_NODE) {
|
|
93
93
|
const n = t.ownerDocument?.createRange();
|
|
94
94
|
n?.selectNodeContents(t);
|
|
@@ -110,8 +110,8 @@ const Kn = (t, e) => {
|
|
|
110
110
|
if (e.PointerEvent && t instanceof e.PointerEvent)
|
|
111
111
|
return !0;
|
|
112
112
|
}
|
|
113
|
-
return !!
|
|
114
|
-
},
|
|
113
|
+
return !!Xn.includes(t.type);
|
|
114
|
+
}, ei = (t) => {
|
|
115
115
|
if (tt(t)) return !1;
|
|
116
116
|
if (t?.target && t?.target?.ownerDocument?.defaultView) {
|
|
117
117
|
const e = t?.target?.ownerDocument?.defaultView;
|
|
@@ -124,7 +124,7 @@ const Kn = (t, e) => {
|
|
|
124
124
|
return t instanceof e.MouseEvent;
|
|
125
125
|
}
|
|
126
126
|
return !1;
|
|
127
|
-
},
|
|
127
|
+
}, ti = (t) => {
|
|
128
128
|
if (t?.target && t?.target?.ownerDocument?.defaultView) {
|
|
129
129
|
const e = t?.target?.ownerDocument?.defaultView;
|
|
130
130
|
if (e.TouchEvent)
|
|
@@ -136,7 +136,7 @@ const Kn = (t, e) => {
|
|
|
136
136
|
return t instanceof e.TouchEvent;
|
|
137
137
|
}
|
|
138
138
|
return !1;
|
|
139
|
-
},
|
|
139
|
+
}, ni = () => document.createElement("div"), _t = (t) => {
|
|
140
140
|
const e = [
|
|
141
141
|
"img",
|
|
142
142
|
// Images
|
|
@@ -152,7 +152,7 @@ const Kn = (t, e) => {
|
|
|
152
152
|
// JavaScript files
|
|
153
153
|
].join(",");
|
|
154
154
|
return Array.from(t?.querySelectorAll(e) || []);
|
|
155
|
-
},
|
|
155
|
+
}, ii = (t) => {
|
|
156
156
|
if (_t(t).forEach((n) => {
|
|
157
157
|
const i = n.getAttribute("src") || n.getAttribute("href");
|
|
158
158
|
i?.startsWith("blob:") && t?.defaultView?.URL.revokeObjectURL(i);
|
|
@@ -193,10 +193,10 @@ function Ht(t) {
|
|
|
193
193
|
// biome-ignore lint/suspicious/noExplicitAny: TODO
|
|
194
194
|
) && t.nodeType === Node.ELEMENT_NODE;
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function oi(t, e) {
|
|
197
197
|
return Ht(t) && t.tagName.toLowerCase() === e.toLowerCase();
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function ri(t) {
|
|
200
200
|
return Bt(
|
|
201
201
|
t,
|
|
202
202
|
[
|
|
@@ -220,17 +220,17 @@ const nt = (t, e, n, i) => {
|
|
|
220
220
|
const n = t.getElementById(e);
|
|
221
221
|
n && n.remove();
|
|
222
222
|
}
|
|
223
|
-
},
|
|
223
|
+
}, Xe = (t, e) => {
|
|
224
224
|
const n = new RegExp(`${e}\\s*=\\s*([^,\\s]+)`, "i");
|
|
225
225
|
return t.match(n)?.[1]?.trim().toLowerCase();
|
|
226
226
|
}, dt = (t, e) => {
|
|
227
|
-
const n =
|
|
227
|
+
const n = Xe(t, e);
|
|
228
228
|
if (!n) return 0;
|
|
229
229
|
const i = Number.parseFloat(n);
|
|
230
230
|
return Number.isFinite(i) ? i : 0;
|
|
231
|
-
},
|
|
231
|
+
}, si = (t, e, n, i) => {
|
|
232
232
|
t?.contentDocument?.head && nt(t.contentDocument, e, n, i);
|
|
233
|
-
},
|
|
233
|
+
}, _s = (t, e) => {
|
|
234
234
|
t?.contentDocument && it(t.contentDocument, e);
|
|
235
235
|
}, de = (t, e, n, i) => {
|
|
236
236
|
if (!t) return;
|
|
@@ -241,14 +241,14 @@ const nt = (t, e, n, i) => {
|
|
|
241
241
|
o.textContent !== n && (o.textContent = n);
|
|
242
242
|
return;
|
|
243
243
|
}
|
|
244
|
-
|
|
244
|
+
si(t, e, n, i);
|
|
245
245
|
}, ot = (t) => {
|
|
246
246
|
if (t?.contentDocument) {
|
|
247
247
|
const n = t.contentDocument.querySelector("meta[name='viewport']");
|
|
248
248
|
if (n) {
|
|
249
249
|
const i = n.getAttribute("content");
|
|
250
250
|
if (i) {
|
|
251
|
-
const o =
|
|
251
|
+
const o = Xe(i, "width"), r = Xe(
|
|
252
252
|
i,
|
|
253
253
|
"height"
|
|
254
254
|
), s = dt(i, "width"), a = dt(i, "height");
|
|
@@ -263,17 +263,17 @@ const nt = (t, e, n, i) => {
|
|
|
263
263
|
}
|
|
264
264
|
}
|
|
265
265
|
return { hasViewport: !1 };
|
|
266
|
-
},
|
|
267
|
-
|
|
266
|
+
}, ai = (t) => t.pipe(
|
|
267
|
+
$((e) => e.src === "about:blank" && e.contentDocument?.readyState === "complete" && e.contentDocument.body ? P(e) : K(e, "load").pipe(
|
|
268
268
|
Dt(1),
|
|
269
269
|
y(() => e)
|
|
270
270
|
))
|
|
271
|
-
),
|
|
272
|
-
|
|
271
|
+
), ci = (t) => t.pipe(
|
|
272
|
+
$((e) => {
|
|
273
273
|
const n = e?.contentDocument?.fonts.ready;
|
|
274
|
-
return n ? B(n).pipe(y(() => e)) :
|
|
274
|
+
return n ? B(n).pipe(y(() => e)) : P(e);
|
|
275
275
|
})
|
|
276
|
-
),
|
|
276
|
+
), ui = (t) => (e) => {
|
|
277
277
|
const n = t(e), i = new IntersectionObserver((r) => {
|
|
278
278
|
r.forEach((s) => {
|
|
279
279
|
s.isIntersecting ? zt(s.target, "tab-index") : te(s.target, "tab-index", "-1");
|
|
@@ -310,7 +310,7 @@ const nt = (t, e, n, i) => {
|
|
|
310
310
|
}), {
|
|
311
311
|
...n
|
|
312
312
|
};
|
|
313
|
-
},
|
|
313
|
+
}, di = (t) => (e) => {
|
|
314
314
|
const n = t(e);
|
|
315
315
|
return n.context.watch("rootElement").pipe(M(n.context.destroy$)).subscribe((i) => {
|
|
316
316
|
if (!i) return;
|
|
@@ -322,7 +322,7 @@ const nt = (t, e, n, i) => {
|
|
|
322
322
|
const r = n.spineItemsManager.get(i)?.renderer.getDocumentFrame();
|
|
323
323
|
r && r.contentDocument?.body && te(r.contentDocument.body, "tabindex", "-1");
|
|
324
324
|
}), n;
|
|
325
|
-
},
|
|
325
|
+
}, je = ({
|
|
326
326
|
position: t,
|
|
327
327
|
frameElement: e
|
|
328
328
|
}) => {
|
|
@@ -331,13 +331,13 @@ const nt = (t, e, n, i) => {
|
|
|
331
331
|
clientX: a,
|
|
332
332
|
clientY: c
|
|
333
333
|
};
|
|
334
|
-
},
|
|
334
|
+
}, li = (t, e, n, i) => {
|
|
335
335
|
const o = e?.view?.frameElement;
|
|
336
336
|
if (!e || !o) return t;
|
|
337
337
|
const r = n.getSpineItemFromIframe(o), s = o, { height: a, width: c } = i.pageSize;
|
|
338
338
|
if (!r || !(s instanceof HTMLIFrameElement)) return t;
|
|
339
339
|
if (tt(t)) {
|
|
340
|
-
const { clientX: u, clientY: d } =
|
|
340
|
+
const { clientX: u, clientY: d } = je({
|
|
341
341
|
position: t,
|
|
342
342
|
frameElement: s
|
|
343
343
|
}), l = new PointerEvent(t.type, {
|
|
@@ -351,8 +351,8 @@ const nt = (t, e, n, i) => {
|
|
|
351
351
|
enumerable: !0
|
|
352
352
|
}), l;
|
|
353
353
|
}
|
|
354
|
-
if (
|
|
355
|
-
const { clientX: u, clientY: d } =
|
|
354
|
+
if (ei(t)) {
|
|
355
|
+
const { clientX: u, clientY: d } = je({
|
|
356
356
|
position: t,
|
|
357
357
|
frameElement: s
|
|
358
358
|
}), l = new MouseEvent(t.type, {
|
|
@@ -365,9 +365,9 @@ const nt = (t, e, n, i) => {
|
|
|
365
365
|
enumerable: !0
|
|
366
366
|
}), l;
|
|
367
367
|
}
|
|
368
|
-
if (
|
|
368
|
+
if (ti(t)) {
|
|
369
369
|
const u = Array.from(t.touches).map((l) => {
|
|
370
|
-
const { clientX: g, clientY: h } =
|
|
370
|
+
const { clientX: g, clientY: h } = je({
|
|
371
371
|
position: l,
|
|
372
372
|
frameElement: s
|
|
373
373
|
});
|
|
@@ -388,7 +388,7 @@ const nt = (t, e, n, i) => {
|
|
|
388
388
|
}), d;
|
|
389
389
|
}
|
|
390
390
|
return t;
|
|
391
|
-
},
|
|
391
|
+
}, pi = [
|
|
392
392
|
"pointercancel",
|
|
393
393
|
"pointerdown",
|
|
394
394
|
"pointerenter",
|
|
@@ -397,20 +397,20 @@ const nt = (t, e, n, i) => {
|
|
|
397
397
|
"pointerout",
|
|
398
398
|
"pointerover",
|
|
399
399
|
"pointerup"
|
|
400
|
-
],
|
|
401
|
-
...
|
|
400
|
+
], gi = [
|
|
401
|
+
...pi
|
|
402
402
|
/*, ...mouseEvents*/
|
|
403
|
-
],
|
|
403
|
+
], hi = (t) => (e) => {
|
|
404
404
|
const n = t(e), i = /* @__PURE__ */ new Map();
|
|
405
405
|
return n.hookManager.register("item.onDocumentLoad", async ({ itemId: o }) => {
|
|
406
406
|
i.get(o)?.(), i.delete(o);
|
|
407
407
|
const r = n.spineItemsManager.get(o), s = r?.renderer.getDocumentFrame();
|
|
408
408
|
if (!s || !r) return;
|
|
409
|
-
const a =
|
|
409
|
+
const a = gi.map((u) => {
|
|
410
410
|
const d = (l) => {
|
|
411
411
|
let g = l;
|
|
412
412
|
if (tt(l) && (g = new PointerEvent(l.type, l)), g !== l) {
|
|
413
|
-
const h =
|
|
413
|
+
const h = li(
|
|
414
414
|
g,
|
|
415
415
|
l,
|
|
416
416
|
n.spine.locator,
|
|
@@ -431,7 +431,7 @@ const nt = (t, e, n, i) => {
|
|
|
431
431
|
}), n.hookManager.register("item.onDocumentUnload", async ({ itemId: o }) => {
|
|
432
432
|
i.get(o)?.(), i.delete(o);
|
|
433
433
|
}), n;
|
|
434
|
-
},
|
|
434
|
+
}, Bs = (t) => {
|
|
435
435
|
const e = new FileReader();
|
|
436
436
|
return new Promise((n) => {
|
|
437
437
|
e.addEventListener(
|
|
@@ -442,13 +442,13 @@ const nt = (t, e, n, i) => {
|
|
|
442
442
|
!1
|
|
443
443
|
), e.readAsDataURL(t);
|
|
444
444
|
});
|
|
445
|
-
},
|
|
445
|
+
}, mi = (t, e) => Object.entries(t).reduce(
|
|
446
446
|
(n, [i, o]) => e.includes(i) ? {
|
|
447
447
|
...n,
|
|
448
448
|
[i]: o
|
|
449
449
|
} : n,
|
|
450
450
|
{}
|
|
451
|
-
), qt = (t) => pe((e) =>
|
|
451
|
+
), qt = (t) => pe((e) => mi(e, t)), rt = (t) => (e) => e.pipe(qt(t), Oe(U));
|
|
452
452
|
function st(t) {
|
|
453
453
|
return new le((e) => {
|
|
454
454
|
const n = new ResizeObserver((i) => {
|
|
@@ -459,19 +459,19 @@ function st(t) {
|
|
|
459
459
|
};
|
|
460
460
|
});
|
|
461
461
|
}
|
|
462
|
-
const
|
|
462
|
+
const Ve = (t) => (e) => e.pipe(
|
|
463
463
|
G(
|
|
464
464
|
(n) => t.pipe(
|
|
465
|
-
|
|
465
|
+
Vn(),
|
|
466
466
|
pe(() => n)
|
|
467
467
|
)
|
|
468
468
|
)
|
|
469
|
-
),
|
|
469
|
+
), fi = (t) => {
|
|
470
470
|
let e;
|
|
471
471
|
const n = t.subscribe((i) => {
|
|
472
472
|
e = { result: i };
|
|
473
473
|
});
|
|
474
|
-
return () => (n.unsubscribe(), e ?
|
|
474
|
+
return () => (n.unsubscribe(), e ? P(e.result) : t);
|
|
475
475
|
};
|
|
476
476
|
function Yt() {
|
|
477
477
|
return new le((t) => {
|
|
@@ -496,7 +496,7 @@ const pt = (t, e) => new le((n) => {
|
|
|
496
496
|
});
|
|
497
497
|
return i.observe(t, e), () => i.disconnect();
|
|
498
498
|
});
|
|
499
|
-
function
|
|
499
|
+
function Hs(t, e) {
|
|
500
500
|
return new le((n) => {
|
|
501
501
|
const i = new IntersectionObserver((o) => {
|
|
502
502
|
n.next(o);
|
|
@@ -509,23 +509,23 @@ function Bs(t, e) {
|
|
|
509
509
|
class Xt {
|
|
510
510
|
constructor(e, n) {
|
|
511
511
|
this.settingsManager = n;
|
|
512
|
-
const i =
|
|
512
|
+
const i = Le(
|
|
513
513
|
this.getDefaultSettings(),
|
|
514
514
|
e
|
|
515
515
|
);
|
|
516
|
-
this.outputSettings = this.computeOutputSettings(i), this.inputSettings =
|
|
516
|
+
this.outputSettings = this.computeOutputSettings(i), this.inputSettings = Le(
|
|
517
517
|
this.getDefaultSettings(),
|
|
518
518
|
e
|
|
519
519
|
), this.outputSettingsUpdateSubject = new k(), this.values$ = j([
|
|
520
520
|
this.settingsManager.values$,
|
|
521
|
-
this.outputSettingsUpdateSubject.pipe(
|
|
521
|
+
this.outputSettingsUpdateSubject.pipe(kn(this.outputSettings))
|
|
522
522
|
]).pipe(
|
|
523
523
|
pe(([o, r]) => ({ ...o, ...r })),
|
|
524
524
|
kt(1)
|
|
525
525
|
), this.values$.subscribe();
|
|
526
526
|
}
|
|
527
527
|
_prepareUpdate(e) {
|
|
528
|
-
const n = this.getCleanedParentInputSettings(e), i = this.settingsManager._prepareUpdate(n), o =
|
|
528
|
+
const n = this.getCleanedParentInputSettings(e), i = this.settingsManager._prepareUpdate(n), o = Le(this.inputSettings, e), r = this.computeOutputSettings(o), s = this.hasSettingsChanged(r);
|
|
529
529
|
return {
|
|
530
530
|
hasChanged: s || i.hasChanged,
|
|
531
531
|
commit: () => (this.inputSettings = o, this.outputSettings = r, !i.hasChanged && s && this.outputSettingsUpdateSubject.next(r), {
|
|
@@ -547,14 +547,14 @@ class Xt {
|
|
|
547
547
|
watch(e) {
|
|
548
548
|
return Array.isArray(e) ? this.values$.pipe(rt(e)) : this.values$.pipe(
|
|
549
549
|
pe((n) => n[e]),
|
|
550
|
-
|
|
550
|
+
Oe(U)
|
|
551
551
|
);
|
|
552
552
|
}
|
|
553
553
|
destroy() {
|
|
554
554
|
this.outputSettingsUpdateSubject.complete();
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
|
-
let
|
|
557
|
+
let yi = class extends Xt {
|
|
558
558
|
computeOutputSettings(e) {
|
|
559
559
|
return e;
|
|
560
560
|
}
|
|
@@ -580,8 +580,8 @@ let fi = class extends Xt {
|
|
|
580
580
|
};
|
|
581
581
|
}
|
|
582
582
|
};
|
|
583
|
-
const
|
|
584
|
-
const { fontScale: n, lineHeight: i, fontWeight: o, fontJustification: r } = e, s = new k(), a = t(e), c = new
|
|
583
|
+
const Si = (t) => (e) => {
|
|
584
|
+
const { fontScale: n, lineHeight: i, fontWeight: o, fontJustification: r } = e, s = new k(), a = t(e), c = new yi(
|
|
585
585
|
{
|
|
586
586
|
fontScale: n,
|
|
587
587
|
lineHeight: i,
|
|
@@ -613,7 +613,7 @@ const yi = (t) => (e) => {
|
|
|
613
613
|
}
|
|
614
614
|
});
|
|
615
615
|
const l = (g) => g.pipe(
|
|
616
|
-
|
|
616
|
+
jn(),
|
|
617
617
|
y(([h, p]) => p.fontScale !== h.fontScale || p.lineHeight !== h.lineHeight)
|
|
618
618
|
);
|
|
619
619
|
return c.values$.pipe(
|
|
@@ -627,7 +627,7 @@ const yi = (t) => (e) => {
|
|
|
627
627
|
},
|
|
628
628
|
settings: c
|
|
629
629
|
};
|
|
630
|
-
},
|
|
630
|
+
}, Ii = (t) => (e) => {
|
|
631
631
|
const n = t(e), i = (o) => K(o, "keyup").pipe(
|
|
632
632
|
y((r) => {
|
|
633
633
|
const { pageTurnDirection: s, computedPageTurnMode: a } = n.settings.values;
|
|
@@ -649,11 +649,11 @@ const yi = (t) => (e) => {
|
|
|
649
649
|
})
|
|
650
650
|
);
|
|
651
651
|
return i(document).pipe(M(n.$.destroy$)).subscribe(), n.spineItemsManager.items$.pipe(
|
|
652
|
-
|
|
652
|
+
$(
|
|
653
653
|
(o) => T(
|
|
654
654
|
...o.map(
|
|
655
655
|
(r) => r.watch("isLoaded").pipe(
|
|
656
|
-
|
|
656
|
+
$(() => {
|
|
657
657
|
const s = r.renderer.getDocumentFrame();
|
|
658
658
|
return s instanceof HTMLIFrameElement && s?.contentDocument ? i(s.contentDocument) : q;
|
|
659
659
|
})
|
|
@@ -663,11 +663,11 @@ const yi = (t) => (e) => {
|
|
|
663
663
|
),
|
|
664
664
|
M(n.$.destroy$)
|
|
665
665
|
).subscribe(), n;
|
|
666
|
-
},
|
|
667
|
-
|
|
666
|
+
}, bi = (t) => t.spine.spineItemsManager.items$.pipe(
|
|
667
|
+
$(
|
|
668
668
|
(e) => T(
|
|
669
669
|
...e.map((n) => n.watch("isLoaded").pipe(
|
|
670
|
-
|
|
670
|
+
$(() => {
|
|
671
671
|
const i = n.renderer.getDocumentFrame();
|
|
672
672
|
if (!i || !i?.contentDocument) return Se;
|
|
673
673
|
const r = Array.from(
|
|
@@ -683,7 +683,7 @@ const yi = (t) => (e) => {
|
|
|
683
683
|
F((e) => {
|
|
684
684
|
e.preventDefault();
|
|
685
685
|
}),
|
|
686
|
-
|
|
686
|
+
R()
|
|
687
687
|
);
|
|
688
688
|
class oe extends le {
|
|
689
689
|
constructor(e) {
|
|
@@ -702,7 +702,7 @@ class oe extends le {
|
|
|
702
702
|
watch(e) {
|
|
703
703
|
return Array.isArray(e) ? this.stateSubject.pipe(rt(e)) : this.stateSubject.pipe(
|
|
704
704
|
y((n) => n[e]),
|
|
705
|
-
|
|
705
|
+
E(U)
|
|
706
706
|
);
|
|
707
707
|
}
|
|
708
708
|
get value() {
|
|
@@ -733,8 +733,8 @@ const De = class De extends oe {
|
|
|
733
733
|
we(null),
|
|
734
734
|
W()
|
|
735
735
|
).pipe(
|
|
736
|
-
|
|
737
|
-
|
|
736
|
+
Ve(this.context.bridgeEvent.viewportFree$),
|
|
737
|
+
$(
|
|
738
738
|
() => this.hookManager.fromExecuteAsync(
|
|
739
739
|
"item.onDocumentLoad",
|
|
740
740
|
this.item.id,
|
|
@@ -750,11 +750,11 @@ const De = class De extends oe {
|
|
|
750
750
|
}),
|
|
751
751
|
M(n)
|
|
752
752
|
))),
|
|
753
|
-
|
|
753
|
+
R()
|
|
754
754
|
), this.unloaded$ = n.pipe(
|
|
755
755
|
ye(() => this.value.state === "unloading" || this.value.state === "idle" ? q : (this.mergeCompare({ state: "unloading", error: void 0 }), this.context.bridgeEvent.viewportFree$.pipe(
|
|
756
756
|
W(),
|
|
757
|
-
|
|
757
|
+
$(() => {
|
|
758
758
|
const r = this.value.documentContainer, s = r ? (
|
|
759
759
|
// we voluntarily don't use fromExecuteAsync here because we want to ensure that the hook is executed even if the unload is cancelled
|
|
760
760
|
this.hookManager.executeAsync("item.onDocumentUnload", this.item.id, {
|
|
@@ -763,10 +763,10 @@ const De = class De extends oe {
|
|
|
763
763
|
}).then(() => null)
|
|
764
764
|
) : Promise.resolve(null);
|
|
765
765
|
return B(s).pipe(
|
|
766
|
-
|
|
766
|
+
$(() => this.onUnload()),
|
|
767
767
|
we(null),
|
|
768
768
|
W(),
|
|
769
|
-
|
|
769
|
+
Ne((a) => (N.error("Error unloading document", a), P(null)))
|
|
770
770
|
);
|
|
771
771
|
}),
|
|
772
772
|
y(() => {
|
|
@@ -774,9 +774,9 @@ const De = class De extends oe {
|
|
|
774
774
|
}),
|
|
775
775
|
M(i)
|
|
776
776
|
))),
|
|
777
|
-
|
|
777
|
+
R()
|
|
778
778
|
), T(this.loaded$, this.unloaded$).pipe(
|
|
779
|
-
|
|
779
|
+
Ne((o) => (this.mergeCompare({ state: "error", error: o }), q)),
|
|
780
780
|
M(this.destroy$)
|
|
781
781
|
).subscribe();
|
|
782
782
|
}
|
|
@@ -818,7 +818,7 @@ const De = class De extends oe {
|
|
|
818
818
|
be(() => {
|
|
819
819
|
e.complete();
|
|
820
820
|
}),
|
|
821
|
-
|
|
821
|
+
Ne((n) => (N.error(n), P(void 0)))
|
|
822
822
|
);
|
|
823
823
|
}
|
|
824
824
|
layout(e) {
|
|
@@ -847,15 +847,15 @@ const De = class De extends oe {
|
|
|
847
847
|
};
|
|
848
848
|
De.DOCUMENT_CONTAINER_CLASS_NAME = "prose-reader-document-container";
|
|
849
849
|
let Ee = De;
|
|
850
|
-
const
|
|
850
|
+
const vi = (t) => new URL(t.href);
|
|
851
851
|
class at {
|
|
852
852
|
constructor(e, n) {
|
|
853
853
|
this.item = e, this.settings = n;
|
|
854
854
|
}
|
|
855
855
|
async getResource() {
|
|
856
856
|
return await Tn(
|
|
857
|
-
this.settings.values.getResource?.(this.item) ??
|
|
858
|
-
) ??
|
|
857
|
+
this.settings.values.getResource?.(this.item) ?? P(void 0)
|
|
858
|
+
) ?? vi(this.item);
|
|
859
859
|
}
|
|
860
860
|
async fetchResource() {
|
|
861
861
|
const e = await this.getResource();
|
|
@@ -865,7 +865,7 @@ class at {
|
|
|
865
865
|
const Gt = (t, e) => {
|
|
866
866
|
const n = t.startsWith("file://"), i = n ? t.replace("file://", "http://") : t, o = new URL(e, i).toString();
|
|
867
867
|
return n ? o.replace("http://", "file://") : o;
|
|
868
|
-
},
|
|
868
|
+
}, wi = async (t, e, n, i, o) => {
|
|
869
869
|
if (!t || !t.defaultView) return;
|
|
870
870
|
const r = e.sheet;
|
|
871
871
|
if (r)
|
|
@@ -913,21 +913,21 @@ const Gt = (t, e) => {
|
|
|
913
913
|
} catch (s) {
|
|
914
914
|
console.error("Could not access stylesheet rules:", s);
|
|
915
915
|
}
|
|
916
|
-
},
|
|
916
|
+
}, xi = (t, e, n, i, o) => {
|
|
917
917
|
const r = e.getAttribute("src") || e.getAttribute("href");
|
|
918
|
-
if (!r) return
|
|
918
|
+
if (!r) return P(null);
|
|
919
919
|
const s = i.manifest?.items.find(({ href: c }) => `${Gt(n, r).toLowerCase()}`.endsWith(
|
|
920
920
|
`${c.toLowerCase()}`
|
|
921
921
|
));
|
|
922
|
-
if (!s) return
|
|
922
|
+
if (!s) return P(null);
|
|
923
923
|
const a = new at(s, o);
|
|
924
924
|
return B(a.getResource()).pipe(
|
|
925
925
|
ye(
|
|
926
|
-
(c) => c instanceof Response ? B(c.blob()) :
|
|
926
|
+
(c) => c instanceof Response ? B(c.blob()) : P(void 0)
|
|
927
927
|
),
|
|
928
928
|
ye((c) => {
|
|
929
929
|
if (!c)
|
|
930
|
-
return
|
|
930
|
+
return P(null);
|
|
931
931
|
const u = t?.defaultView?.URL.createObjectURL(c) ?? "";
|
|
932
932
|
if (e.hasAttribute("src"))
|
|
933
933
|
e.setAttribute("src", u);
|
|
@@ -935,7 +935,7 @@ const Gt = (t, e) => {
|
|
|
935
935
|
return new le((d) => {
|
|
936
936
|
e.onload = async () => {
|
|
937
937
|
try {
|
|
938
|
-
e.sheet && await
|
|
938
|
+
e.sheet && await wi(
|
|
939
939
|
t,
|
|
940
940
|
e,
|
|
941
941
|
n,
|
|
@@ -947,19 +947,19 @@ const Gt = (t, e) => {
|
|
|
947
947
|
}
|
|
948
948
|
}, e.onerror = d.error;
|
|
949
949
|
});
|
|
950
|
-
return
|
|
950
|
+
return P(null);
|
|
951
951
|
})
|
|
952
952
|
);
|
|
953
|
-
},
|
|
953
|
+
}, Pi = ({
|
|
954
954
|
settings: t,
|
|
955
955
|
item: e,
|
|
956
956
|
context: n
|
|
957
957
|
}) => (i) => i.pipe(
|
|
958
|
-
|
|
958
|
+
$((o) => {
|
|
959
959
|
const r = _t(
|
|
960
960
|
o.contentDocument
|
|
961
961
|
), s = xn(e.href), a = r.map(
|
|
962
|
-
(c) =>
|
|
962
|
+
(c) => xi(
|
|
963
963
|
o.contentDocument,
|
|
964
964
|
c,
|
|
965
965
|
s,
|
|
@@ -967,14 +967,14 @@ const Gt = (t, e) => {
|
|
|
967
967
|
t
|
|
968
968
|
)
|
|
969
969
|
);
|
|
970
|
-
return a.length === 0 ?
|
|
970
|
+
return a.length === 0 ? P(o) : j(a).pipe(y(() => o));
|
|
971
971
|
})
|
|
972
|
-
),
|
|
973
|
-
|
|
974
|
-
},
|
|
972
|
+
), $i = (t) => {
|
|
973
|
+
ii(t?.contentDocument);
|
|
974
|
+
}, Ti = async (t, e) => {
|
|
975
975
|
if (typeof t == "string")
|
|
976
976
|
return new Blob([t], { type: "text/html" });
|
|
977
|
-
const n = Pn(t.headers.get("Content-Type") || "") ||
|
|
977
|
+
const n = Pn(t.headers.get("Content-Type") || "") || Qe(e.href);
|
|
978
978
|
if (["image/jpg", "image/jpeg", "image/png", "image/webp"].some(
|
|
979
979
|
(i) => i === n
|
|
980
980
|
)) {
|
|
@@ -1024,55 +1024,55 @@ const Gt = (t, e) => {
|
|
|
1024
1024
|
);
|
|
1025
1025
|
}
|
|
1026
1026
|
return await t.blob();
|
|
1027
|
-
},
|
|
1027
|
+
}, Ci = [
|
|
1028
1028
|
".txt",
|
|
1029
1029
|
".jpg",
|
|
1030
1030
|
".jpeg",
|
|
1031
1031
|
".png",
|
|
1032
1032
|
".webp"
|
|
1033
|
-
],
|
|
1033
|
+
], Fi = [
|
|
1034
1034
|
"text/plain",
|
|
1035
1035
|
"image/jpg",
|
|
1036
1036
|
"image/jpeg",
|
|
1037
1037
|
"image/png",
|
|
1038
1038
|
"image/webp"
|
|
1039
|
-
],
|
|
1039
|
+
], Ge = (t) => {
|
|
1040
1040
|
const e = t?.getAttribute("src");
|
|
1041
1041
|
e?.startsWith("blob:") && URL.revokeObjectURL(e);
|
|
1042
|
-
},
|
|
1042
|
+
}, Mi = ({
|
|
1043
1043
|
item: t,
|
|
1044
1044
|
resourcesHandler: e
|
|
1045
1045
|
}) => {
|
|
1046
1046
|
const n = (i, o) => {
|
|
1047
|
-
|
|
1047
|
+
Ge(i);
|
|
1048
1048
|
const r = URL.createObjectURL(o);
|
|
1049
1049
|
i.setAttribute("src", r);
|
|
1050
1050
|
};
|
|
1051
1051
|
return (i) => i.pipe(
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
const s =
|
|
1052
|
+
$((o) => B(e.getResource()).pipe(
|
|
1053
|
+
$((r) => {
|
|
1054
|
+
const s = Ci.some(
|
|
1055
1055
|
(c) => t.href.endsWith(c)
|
|
1056
|
-
) || t.mediaType &&
|
|
1057
|
-
return r instanceof URL && t.href.startsWith(window.location.origin) && !s ? (
|
|
1058
|
-
|
|
1056
|
+
) || t.mediaType && Fi.includes(t.mediaType);
|
|
1057
|
+
return r instanceof URL && t.href.startsWith(window.location.origin) && !s ? (Ge(o), o?.setAttribute("src", r.href), P(o)) : (r instanceof URL ? B(e.fetchResource()) : P(r)).pipe(
|
|
1058
|
+
$((c) => {
|
|
1059
1059
|
if (!(c instanceof Response))
|
|
1060
1060
|
throw new Error("Invalid resource");
|
|
1061
|
-
return
|
|
1061
|
+
return Ti(c, t);
|
|
1062
1062
|
}),
|
|
1063
1063
|
F((c) => {
|
|
1064
1064
|
n(o, c);
|
|
1065
1065
|
}),
|
|
1066
1066
|
y(() => o),
|
|
1067
|
-
|
|
1067
|
+
Ne((c) => (N.error(
|
|
1068
1068
|
`Error while trying to fetch or load resource for item ${t.id}`,
|
|
1069
1069
|
r
|
|
1070
|
-
), N.error(c),
|
|
1070
|
+
), N.error(c), P(o)))
|
|
1071
1071
|
);
|
|
1072
1072
|
})
|
|
1073
1073
|
))
|
|
1074
1074
|
);
|
|
1075
|
-
},
|
|
1075
|
+
}, Li = () => {
|
|
1076
1076
|
const t = document.createElement("iframe");
|
|
1077
1077
|
return t.frameBorder = "no", t.tabIndex = 0, t.setAttribute(
|
|
1078
1078
|
"sandbox",
|
|
@@ -1087,7 +1087,7 @@ const Gt = (t, e) => {
|
|
|
1087
1087
|
border: 0px none transparent;
|
|
1088
1088
|
padding: 0px;
|
|
1089
1089
|
`, t.setAttribute("role", "main"), t;
|
|
1090
|
-
},
|
|
1090
|
+
}, Ni = "body{margin:0}html,body{height:100%;width:100%}html[data-prose-reader-html-renderer-has-viewport-dimensions=false] body{display:flex}html[data-prose-reader-html-renderer-has-viewport-dimensions=false][data-prose-reader-html-renderer-spread-position=left] body{justify-content:flex-end}html[data-prose-reader-html-renderer-has-viewport-dimensions=false][data-prose-reader-html-renderer-spread-position=right] body{justify-content:flex-start}html[data-prose-reader-html-renderer-has-viewport-dimensions=false][data-prose-reader-html-renderer-spread-position=none] body{justify-content:center}:not(html.prose-reader-html-renderer-touch-enabled),:not(html.prose-reader-html-renderer-touch-enabled) body{touch-action:none}img{-webkit-user-select:none;user-select:none;-webkit-user-drag:none;-khtml-user-drag:none;-moz-user-drag:none;-o-user-drag:none;display:flex}html[data-prose-reader-html-renderer-has-viewport-dimensions=false] img{max-width:100%;height:100%;object-fit:contain}", Zt = ({
|
|
1091
1091
|
pageHeight: t,
|
|
1092
1092
|
pageWidth: e,
|
|
1093
1093
|
frameElement: n
|
|
@@ -1118,10 +1118,10 @@ const Gt = (t, e) => {
|
|
|
1118
1118
|
}, ht = (t, e) => {
|
|
1119
1119
|
const n = `${e.width}px`, i = `${e.height}px`;
|
|
1120
1120
|
t.style.width !== n && (t.style.width = n), t.style.height !== i && (t.style.height = i);
|
|
1121
|
-
},
|
|
1121
|
+
}, Ai = (t, e, n) => {
|
|
1122
1122
|
const i = t.contentDocument?.documentElement;
|
|
1123
1123
|
i && i.getAttribute(e) !== n && i.setAttribute(e, n);
|
|
1124
|
-
},
|
|
1124
|
+
}, Ei = ({
|
|
1125
1125
|
hasViewportDimensions: t,
|
|
1126
1126
|
viewportWidth: e,
|
|
1127
1127
|
viewportHeight: n,
|
|
@@ -1141,7 +1141,7 @@ const Gt = (t, e) => {
|
|
|
1141
1141
|
s ? "1" : "0",
|
|
1142
1142
|
a,
|
|
1143
1143
|
c
|
|
1144
|
-
].join("|"),
|
|
1144
|
+
].join("|"), Ri = ({
|
|
1145
1145
|
frameElement: t,
|
|
1146
1146
|
viewportDimensions: e,
|
|
1147
1147
|
computedScale: n,
|
|
@@ -1169,7 +1169,7 @@ const Gt = (t, e) => {
|
|
|
1169
1169
|
return;
|
|
1170
1170
|
}
|
|
1171
1171
|
o === "before" ? r ? ee(t, "margin-right", `${s}px`) : ee(t, "margin-left", `${s}px`) : (me(t, "margin-left"), me(t, "margin-right"));
|
|
1172
|
-
},
|
|
1172
|
+
}, Di = ({
|
|
1173
1173
|
minPageSpread: t,
|
|
1174
1174
|
blankPagePosition: e,
|
|
1175
1175
|
spreadPosition: n,
|
|
@@ -1180,7 +1180,7 @@ const Gt = (t, e) => {
|
|
|
1180
1180
|
}) => {
|
|
1181
1181
|
const a = t * o;
|
|
1182
1182
|
if (r?.contentDocument && r?.contentWindow) {
|
|
1183
|
-
const { viewportDimensions: c, computedScale: u = 1 } = Zt({ frameElement: r, pageHeight: i, pageWidth: o }) ?? {}, d = !!c, l = o, g = i, h =
|
|
1183
|
+
const { viewportDimensions: c, computedScale: u = 1 } = Zt({ frameElement: r, pageHeight: i, pageWidth: o }) ?? {}, d = !!c, l = o, g = i, h = Ei({
|
|
1184
1184
|
hasViewportDimensions: d,
|
|
1185
1185
|
viewportWidth: c?.width,
|
|
1186
1186
|
viewportHeight: c?.height,
|
|
@@ -1191,7 +1191,7 @@ const Gt = (t, e) => {
|
|
|
1191
1191
|
pageWidth: o,
|
|
1192
1192
|
pageHeight: i
|
|
1193
1193
|
});
|
|
1194
|
-
return gt.get(r) === h ? { width: a, height: g } : (gt.set(r, h),
|
|
1194
|
+
return gt.get(r) === h ? { width: a, height: g } : (gt.set(r, h), Ai(
|
|
1195
1195
|
r,
|
|
1196
1196
|
"data-prose-reader-html-renderer-has-viewport-dimensions",
|
|
1197
1197
|
d.toString()
|
|
@@ -1201,7 +1201,7 @@ const Gt = (t, e) => {
|
|
|
1201
1201
|
}) : ht(r, {
|
|
1202
1202
|
width: l,
|
|
1203
1203
|
height: g
|
|
1204
|
-
}),
|
|
1204
|
+
}), Ri({
|
|
1205
1205
|
frameElement: r,
|
|
1206
1206
|
viewportDimensions: c,
|
|
1207
1207
|
computedScale: u,
|
|
@@ -1212,7 +1212,7 @@ const Gt = (t, e) => {
|
|
|
1212
1212
|
}), { width: a, height: g });
|
|
1213
1213
|
}
|
|
1214
1214
|
return { width: a, height: i };
|
|
1215
|
-
},
|
|
1215
|
+
}, Oi = () => `
|
|
1216
1216
|
body {
|
|
1217
1217
|
margin: 0;
|
|
1218
1218
|
}
|
|
@@ -1229,7 +1229,7 @@ const Gt = (t, e) => {
|
|
|
1229
1229
|
html, body {
|
|
1230
1230
|
touch-action: none;
|
|
1231
1231
|
}
|
|
1232
|
-
`,
|
|
1232
|
+
`, Vi = ({
|
|
1233
1233
|
isScrollable: t,
|
|
1234
1234
|
enableTouch: e
|
|
1235
1235
|
}) => `
|
|
@@ -1254,7 +1254,7 @@ const Gt = (t, e) => {
|
|
|
1254
1254
|
display: block;
|
|
1255
1255
|
}
|
|
1256
1256
|
` : ""}
|
|
1257
|
-
`,
|
|
1257
|
+
`, ki = ({
|
|
1258
1258
|
width: t,
|
|
1259
1259
|
columnHeight: e,
|
|
1260
1260
|
columnWidth: n
|
|
@@ -1322,7 +1322,7 @@ const Gt = (t, e) => {
|
|
|
1322
1322
|
td {
|
|
1323
1323
|
max-width: ${n}px;
|
|
1324
1324
|
}
|
|
1325
|
-
`,
|
|
1325
|
+
`, ji = ({
|
|
1326
1326
|
isUsingVerticalWriting: t,
|
|
1327
1327
|
minimumWidth: e,
|
|
1328
1328
|
pageHeight: n,
|
|
@@ -1336,9 +1336,9 @@ const Gt = (t, e) => {
|
|
|
1336
1336
|
columnWidth: s,
|
|
1337
1337
|
width: c
|
|
1338
1338
|
};
|
|
1339
|
-
},
|
|
1339
|
+
}, Fe = (t, e) => {
|
|
1340
1340
|
w(t.style, "width", `${e.width}px`), w(t.style, "height", `${e.height}px`);
|
|
1341
|
-
},
|
|
1341
|
+
}, Ui = ({
|
|
1342
1342
|
pageHeight: t,
|
|
1343
1343
|
pageWidth: e,
|
|
1344
1344
|
frameElement: n,
|
|
@@ -1364,8 +1364,8 @@ const Gt = (t, e) => {
|
|
|
1364
1364
|
de(
|
|
1365
1365
|
n,
|
|
1366
1366
|
"prose-reader-html-renderer-framce-css",
|
|
1367
|
-
|
|
1368
|
-
),
|
|
1367
|
+
Oi()
|
|
1368
|
+
), Fe(n, {
|
|
1369
1369
|
width: p.width ?? 1,
|
|
1370
1370
|
height: p.height ?? 1
|
|
1371
1371
|
}), w(n.style, "position", "absolute"), w(n.style, "top", "50%"), w(
|
|
@@ -1382,11 +1382,11 @@ const Gt = (t, e) => {
|
|
|
1382
1382
|
"center center"
|
|
1383
1383
|
);
|
|
1384
1384
|
else {
|
|
1385
|
-
const b = c ?
|
|
1385
|
+
const b = c ? Vi({
|
|
1386
1386
|
isScrollable: o === "scrolled-continuous",
|
|
1387
1387
|
enableTouch: u
|
|
1388
|
-
}) :
|
|
1389
|
-
|
|
1388
|
+
}) : ki(
|
|
1389
|
+
ji({
|
|
1390
1390
|
isUsingVerticalWriting: d,
|
|
1391
1391
|
minimumWidth: l,
|
|
1392
1392
|
pageHeight: h,
|
|
@@ -1396,12 +1396,12 @@ const Gt = (t, e) => {
|
|
|
1396
1396
|
if (de(n, "prose-reader-css", b, !0), d)
|
|
1397
1397
|
x = Math.ceil(
|
|
1398
1398
|
n.contentDocument.documentElement.scrollHeight / h
|
|
1399
|
-
) * h,
|
|
1399
|
+
) * h, Fe(n, {
|
|
1400
1400
|
width: l,
|
|
1401
1401
|
height: x
|
|
1402
1402
|
});
|
|
1403
1403
|
else if (o === "scrolled-continuous")
|
|
1404
|
-
x = n.contentDocument.body.scrollHeight,
|
|
1404
|
+
x = n.contentDocument.body.scrollHeight, Fe(n, {
|
|
1405
1405
|
width: l,
|
|
1406
1406
|
height: x
|
|
1407
1407
|
});
|
|
@@ -1409,7 +1409,7 @@ const Gt = (t, e) => {
|
|
|
1409
1409
|
const C = Math.ceil(
|
|
1410
1410
|
n.contentDocument.documentElement.scrollWidth / e
|
|
1411
1411
|
);
|
|
1412
|
-
f ? S = e : S = C * e,
|
|
1412
|
+
f ? S = e : S = C * e, Fe(n, {
|
|
1413
1413
|
width: S,
|
|
1414
1414
|
height: x
|
|
1415
1415
|
});
|
|
@@ -1422,19 +1422,19 @@ const Gt = (t, e) => {
|
|
|
1422
1422
|
)), { width: S, height: x };
|
|
1423
1423
|
}
|
|
1424
1424
|
};
|
|
1425
|
-
class
|
|
1425
|
+
class zi extends Ee {
|
|
1426
1426
|
constructor() {
|
|
1427
|
-
super(...arguments), this.isPrePaginated = () => this.item.renditionLayout === "pre-paginated" || !this.item.renditionLayout && this.context.manifest?.renditionLayout === "pre-paginated", this.isImageType = () => !!(this.item.mediaType ??
|
|
1427
|
+
super(...arguments), this.isPrePaginated = () => this.item.renditionLayout === "pre-paginated" || !this.item.renditionLayout && this.context.manifest?.renditionLayout === "pre-paginated", this.isImageType = () => !!(this.item.mediaType ?? Qe(this.item.href))?.startsWith("image/");
|
|
1428
1428
|
}
|
|
1429
1429
|
onCreateDocument() {
|
|
1430
|
-
const e =
|
|
1431
|
-
return this.setDocumentContainer(e),
|
|
1430
|
+
const e = Li();
|
|
1431
|
+
return this.setDocumentContainer(e), P(e);
|
|
1432
1432
|
}
|
|
1433
1433
|
onLoadDocument() {
|
|
1434
1434
|
const e = this.getFrameElement();
|
|
1435
1435
|
if (!e) throw new Error("invalid frame");
|
|
1436
|
-
return
|
|
1437
|
-
|
|
1436
|
+
return P(e).pipe(
|
|
1437
|
+
Mi({
|
|
1438
1438
|
item: this.item,
|
|
1439
1439
|
resourcesHandler: this.resourcesHandler,
|
|
1440
1440
|
settings: this.settings
|
|
@@ -1443,20 +1443,20 @@ class Ui extends Ee {
|
|
|
1443
1443
|
* Preload iframes only when the viewport is stable to avoid competing with
|
|
1444
1444
|
* navigation/transition work on the main thread.
|
|
1445
1445
|
*/
|
|
1446
|
-
|
|
1446
|
+
Ve(this.context.bridgeEvent.viewportFree$),
|
|
1447
1447
|
F((n) => {
|
|
1448
1448
|
this.prepareFrameForAttach(n), this.attach();
|
|
1449
1449
|
}),
|
|
1450
|
-
|
|
1450
|
+
ai,
|
|
1451
1451
|
F((n) => {
|
|
1452
|
-
this.isPrePaginated() ? de(n, "prose-reader-css",
|
|
1452
|
+
this.isPrePaginated() ? de(n, "prose-reader-css", Ni) : this.isImageType();
|
|
1453
1453
|
}),
|
|
1454
|
-
|
|
1454
|
+
Pi({
|
|
1455
1455
|
context: this.context,
|
|
1456
1456
|
item: this.item,
|
|
1457
1457
|
settings: this.settings
|
|
1458
1458
|
}),
|
|
1459
|
-
|
|
1459
|
+
ci,
|
|
1460
1460
|
F((n) => {
|
|
1461
1461
|
this.revealFrameAfterReady(n);
|
|
1462
1462
|
})
|
|
@@ -1464,7 +1464,7 @@ class Ui extends Ee {
|
|
|
1464
1464
|
}
|
|
1465
1465
|
onUnload() {
|
|
1466
1466
|
const e = this.getFrameElement();
|
|
1467
|
-
return
|
|
1467
|
+
return $i(e), Ge(e), this.detach(), q;
|
|
1468
1468
|
}
|
|
1469
1469
|
onLayout({
|
|
1470
1470
|
minPageSpread: e,
|
|
@@ -1472,7 +1472,7 @@ class Ui extends Ee {
|
|
|
1472
1472
|
spreadPosition: i
|
|
1473
1473
|
}) {
|
|
1474
1474
|
const { width: o, height: r } = this.viewport.pageSize, s = this.getFrameElement();
|
|
1475
|
-
if (!s) return
|
|
1475
|
+
if (!s) return P(void 0);
|
|
1476
1476
|
const a = this.settings.values.computedPageTurnMode === "scrollable";
|
|
1477
1477
|
if (s.contentDocument?.documentElement && (te(
|
|
1478
1478
|
s.contentDocument.documentElement,
|
|
@@ -1483,7 +1483,7 @@ class Ui extends Ee {
|
|
|
1483
1483
|
) : s.contentDocument?.documentElement.classList.remove(
|
|
1484
1484
|
"prose-reader-html-renderer-touch-enabled"
|
|
1485
1485
|
)), this.isPrePaginated()) {
|
|
1486
|
-
const l =
|
|
1486
|
+
const l = Di({
|
|
1487
1487
|
blankPagePosition: n,
|
|
1488
1488
|
frameElement: s,
|
|
1489
1489
|
isRTL: this.context.isRTL(),
|
|
@@ -1492,9 +1492,9 @@ class Ui extends Ee {
|
|
|
1492
1492
|
pageWidth: o,
|
|
1493
1493
|
spreadPosition: i
|
|
1494
1494
|
});
|
|
1495
|
-
return
|
|
1495
|
+
return P(l);
|
|
1496
1496
|
}
|
|
1497
|
-
const c = !!this.writingMode?.startsWith("vertical"), u = this.isImageType(), d =
|
|
1497
|
+
const c = !!this.writingMode?.startsWith("vertical"), u = this.isImageType(), d = Ui({
|
|
1498
1498
|
pageHeight: r,
|
|
1499
1499
|
pageWidth: o,
|
|
1500
1500
|
frameElement: s,
|
|
@@ -1512,11 +1512,11 @@ class Ui extends Ee {
|
|
|
1512
1512
|
*/
|
|
1513
1513
|
enableTouch: this.settings.values.computedPageTurnMode === "scrollable"
|
|
1514
1514
|
});
|
|
1515
|
-
return
|
|
1515
|
+
return P(d);
|
|
1516
1516
|
}
|
|
1517
1517
|
onRenderHeadless() {
|
|
1518
1518
|
return B(this.resourcesHandler.fetchResource()).pipe(
|
|
1519
|
-
|
|
1519
|
+
$((e) => {
|
|
1520
1520
|
if (e instanceof Response) {
|
|
1521
1521
|
const n = e.headers.get("content-type") ?? "";
|
|
1522
1522
|
if ([
|
|
@@ -1532,7 +1532,7 @@ class Ui extends Ee {
|
|
|
1532
1532
|
))
|
|
1533
1533
|
);
|
|
1534
1534
|
}
|
|
1535
|
-
return
|
|
1535
|
+
return P(void 0);
|
|
1536
1536
|
})
|
|
1537
1537
|
);
|
|
1538
1538
|
}
|
|
@@ -1575,13 +1575,13 @@ class Ui extends Ee {
|
|
|
1575
1575
|
return this.getFrameElement();
|
|
1576
1576
|
}
|
|
1577
1577
|
}
|
|
1578
|
-
const
|
|
1578
|
+
const Wi = (t) => (e) => {
|
|
1579
1579
|
const n = t({
|
|
1580
1580
|
...e,
|
|
1581
1581
|
getRenderer(o) {
|
|
1582
|
-
return e.getRenderer?.(o) ?? ((s) => new
|
|
1582
|
+
return e.getRenderer?.(o) ?? ((s) => new zi(s));
|
|
1583
1583
|
}
|
|
1584
|
-
}), i =
|
|
1584
|
+
}), i = bi(n);
|
|
1585
1585
|
return i.pipe(M(n.$.destroy$)).subscribe(), {
|
|
1586
1586
|
...n,
|
|
1587
1587
|
links$: i
|
|
@@ -1595,27 +1595,27 @@ class ct {
|
|
|
1595
1595
|
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;
|
|
1596
1596
|
}
|
|
1597
1597
|
}
|
|
1598
|
-
class
|
|
1598
|
+
class D {
|
|
1599
1599
|
constructor(e) {
|
|
1600
1600
|
this.__symbol = /* @__PURE__ */ Symbol("SpineItemPosition"), this.x = e.x, this.y = e.y;
|
|
1601
1601
|
}
|
|
1602
1602
|
}
|
|
1603
|
-
class
|
|
1603
|
+
class Ue {
|
|
1604
1604
|
constructor(e) {
|
|
1605
1605
|
this.__symbol = /* @__PURE__ */ Symbol("SpineItemPagePosition"), this.x = e.x, this.y = e.y;
|
|
1606
1606
|
}
|
|
1607
1607
|
}
|
|
1608
|
-
class
|
|
1608
|
+
class _i extends ct {
|
|
1609
1609
|
constructor() {
|
|
1610
1610
|
super(...arguments), this.__symbol = "SpineItemPageLayout";
|
|
1611
1611
|
}
|
|
1612
1612
|
}
|
|
1613
|
-
class
|
|
1613
|
+
class ze extends ct {
|
|
1614
1614
|
constructor() {
|
|
1615
1615
|
super(...arguments), this.__symbol = "SpineItemSpineLayout";
|
|
1616
1616
|
}
|
|
1617
1617
|
}
|
|
1618
|
-
class
|
|
1618
|
+
class Bi extends ct {
|
|
1619
1619
|
constructor() {
|
|
1620
1620
|
super(...arguments), this.__symbol = "SpineItemPageSpineLayout";
|
|
1621
1621
|
}
|
|
@@ -1633,25 +1633,25 @@ class V extends Jt {
|
|
|
1633
1633
|
return new V(e);
|
|
1634
1634
|
}
|
|
1635
1635
|
}
|
|
1636
|
-
class
|
|
1636
|
+
class O extends Jt {
|
|
1637
1637
|
constructor() {
|
|
1638
1638
|
super(...arguments), this.__symbol = "UnboundSpinePosition";
|
|
1639
1639
|
}
|
|
1640
1640
|
static from(e) {
|
|
1641
|
-
return new
|
|
1641
|
+
return new O(e);
|
|
1642
1642
|
}
|
|
1643
1643
|
}
|
|
1644
|
-
const
|
|
1644
|
+
const Hi = (t, e) => {
|
|
1645
1645
|
const n = e.getBoundingClientRect(), { x: i, y: o } = t, { left: r, top: s } = n, a = n.width / e.offsetWidth, c = n.height / e.offsetHeight, u = i - r, d = o - s;
|
|
1646
1646
|
return {
|
|
1647
1647
|
x: u / a,
|
|
1648
1648
|
y: d / c
|
|
1649
1649
|
};
|
|
1650
|
-
},
|
|
1651
|
-
|
|
1652
|
-
),
|
|
1653
|
-
getSpinePositionFromClientPosition: (e) => t.spine.element ?
|
|
1654
|
-
}),
|
|
1650
|
+
}, qi = (t, e) => new O(
|
|
1651
|
+
Hi(t, e)
|
|
1652
|
+
), Yi = (t) => ({
|
|
1653
|
+
getSpinePositionFromClientPosition: (e) => t.spine.element ? qi(e, t.spine.element) : void 0
|
|
1654
|
+
}), Xi = (t) => {
|
|
1655
1655
|
let e;
|
|
1656
1656
|
const n = t.context.watch("rootElement").pipe(
|
|
1657
1657
|
G((c) => c ? new le(() => (e = c.ownerDocument.createElement("div"), e.style.cssText = `
|
|
@@ -1681,27 +1681,27 @@ const Bi = (t, e) => {
|
|
|
1681
1681
|
);
|
|
1682
1682
|
})
|
|
1683
1683
|
), r = i(t.viewportFree$).pipe(
|
|
1684
|
-
|
|
1684
|
+
Un(1)
|
|
1685
1685
|
), a = t.settings.values$.pipe(
|
|
1686
1686
|
pe(() => t.settings.values.computedPageTurnMode),
|
|
1687
|
-
|
|
1687
|
+
Oe()
|
|
1688
1688
|
).pipe(
|
|
1689
1689
|
G(
|
|
1690
|
-
(c) => c === "controlled" ? o.pipe(G(() => r)) : i(
|
|
1690
|
+
(c) => c === "controlled" ? o.pipe(G(() => r)) : i(P(void 0))
|
|
1691
1691
|
),
|
|
1692
1692
|
ie(t.$.destroy$)
|
|
1693
1693
|
);
|
|
1694
1694
|
return T(n, a);
|
|
1695
|
-
},
|
|
1695
|
+
}, Ys = "@prose-reader/core", Xs = 0, Gs = 200, _ = "prose-reader", Gi = `${_}-style`, Zi = `data-${_}-id`, Ji = `${_}-viewport`, Ki = `${_}-scroll-navigator`, Qi = `${_}-spine-item`, eo = `${_}-enhancer-loading`, Kt = `${eo}-container`, to = ({
|
|
1696
1696
|
container: t,
|
|
1697
1697
|
item: e,
|
|
1698
1698
|
viewport: n
|
|
1699
1699
|
}) => {
|
|
1700
|
-
const i = t.ownerDocument.createElement("div");
|
|
1701
|
-
|
|
1700
|
+
const i = n.absoluteViewport.width, o = i > 0 ? `max-width: ${i}px;` : "", r = t.ownerDocument.createElement("div");
|
|
1701
|
+
r.classList.add(Kt), r.style.cssText = `
|
|
1702
1702
|
height: 100%;
|
|
1703
1703
|
width: 100%;
|
|
1704
|
-
|
|
1704
|
+
${o}
|
|
1705
1705
|
text-align: center;
|
|
1706
1706
|
display: flex;
|
|
1707
1707
|
justify-content: center;
|
|
@@ -1714,27 +1714,27 @@ const Bi = (t, e) => {
|
|
|
1714
1714
|
background-color: white;
|
|
1715
1715
|
z-index: 1;
|
|
1716
1716
|
`;
|
|
1717
|
-
const
|
|
1718
|
-
|
|
1717
|
+
const s = r.ownerDocument.createElement("div");
|
|
1718
|
+
s.innerText = "prose", s.style.cssText = `
|
|
1719
1719
|
font-size: 4em;
|
|
1720
1720
|
`;
|
|
1721
|
-
const
|
|
1722
|
-
return
|
|
1721
|
+
const a = r.ownerDocument.createElement("div");
|
|
1722
|
+
return a.setAttribute("data-details-element", "true"), a.innerText = `loading ${e.id}`, a.style.cssText = `
|
|
1723
1723
|
font-size: 1.2em;
|
|
1724
1724
|
text-overflow: ellipsis;
|
|
1725
1725
|
white-space: nowrap;
|
|
1726
1726
|
overflow: hidden;
|
|
1727
1727
|
max-width: 300px;
|
|
1728
1728
|
width: 80%;
|
|
1729
|
-
`,
|
|
1730
|
-
},
|
|
1729
|
+
`, r.appendChild(s), r.appendChild(a), r;
|
|
1730
|
+
}, no = (t) => t.spineItemsManager.items$.pipe(
|
|
1731
1731
|
G(
|
|
1732
1732
|
(e) => T(
|
|
1733
1733
|
...e.map((n) => {
|
|
1734
1734
|
w(n.containerElement.style, "z-index", "0");
|
|
1735
1735
|
const i = n.containerElement.querySelector(
|
|
1736
1736
|
`.${Kt}`
|
|
1737
|
-
), o = i instanceof HTMLElement ? i :
|
|
1737
|
+
), o = i instanceof HTMLElement ? i : to({
|
|
1738
1738
|
container: n.containerElement,
|
|
1739
1739
|
item: n.item,
|
|
1740
1740
|
viewport: t.viewport
|
|
@@ -1754,7 +1754,7 @@ const Bi = (t, e) => {
|
|
|
1754
1754
|
const s = o.querySelector(
|
|
1755
1755
|
"[data-details-element]"
|
|
1756
1756
|
);
|
|
1757
|
-
s instanceof HTMLElement &&
|
|
1757
|
+
s instanceof HTMLElement && Gn(
|
|
1758
1758
|
s,
|
|
1759
1759
|
"innerText",
|
|
1760
1760
|
r.error?.toString() ?? "Unknown error"
|
|
@@ -1765,7 +1765,7 @@ const Bi = (t, e) => {
|
|
|
1765
1765
|
j([t.spine.layout$, t.theme.$.theme$]).pipe(
|
|
1766
1766
|
z(([, r]) => {
|
|
1767
1767
|
const s = t.viewport.absoluteViewport.width;
|
|
1768
|
-
w(
|
|
1768
|
+
s > 0 && w(
|
|
1769
1769
|
o.style,
|
|
1770
1770
|
"max-width",
|
|
1771
1771
|
`${s}px`
|
|
@@ -1780,12 +1780,12 @@ const Bi = (t, e) => {
|
|
|
1780
1780
|
})
|
|
1781
1781
|
)
|
|
1782
1782
|
)
|
|
1783
|
-
),
|
|
1783
|
+
), io = (t) => {
|
|
1784
1784
|
t.hookManager.register("item.onDocumentLoad", async ({ itemId: e }) => {
|
|
1785
1785
|
const i = t.spineItemsManager.get(e)?.renderer.getDocumentFrame();
|
|
1786
1786
|
i && te(i, "scrolling", "no");
|
|
1787
1787
|
});
|
|
1788
|
-
},
|
|
1788
|
+
}, oo = (t) => {
|
|
1789
1789
|
t.hookManager.register(
|
|
1790
1790
|
"item.onAfterLayout",
|
|
1791
1791
|
({ item: e, blankPagePosition: n, minimumWidth: i }) => {
|
|
@@ -1803,12 +1803,12 @@ const Bi = (t, e) => {
|
|
|
1803
1803
|
}
|
|
1804
1804
|
}
|
|
1805
1805
|
);
|
|
1806
|
-
},
|
|
1806
|
+
}, ro = (t) => t.spineItemsObserver.states$.pipe(
|
|
1807
1807
|
F(({ item: e, isReady: n, isDirty: i }) => {
|
|
1808
1808
|
e.containerElement.dataset.isDirty = i.toString(), e.containerElement.dataset.isReady = n.toString();
|
|
1809
1809
|
})
|
|
1810
1810
|
);
|
|
1811
|
-
let
|
|
1811
|
+
let so = class extends Xt {
|
|
1812
1812
|
computeOutputSettings(e) {
|
|
1813
1813
|
return e;
|
|
1814
1814
|
}
|
|
@@ -1837,19 +1837,19 @@ let ro = class extends Xt {
|
|
|
1837
1837
|
const Qt = ({
|
|
1838
1838
|
manifest: t,
|
|
1839
1839
|
spreadMode: e
|
|
1840
|
-
}) => t?.renditionFlow === "scrolled-continuous" ? !1 : e,
|
|
1840
|
+
}) => t?.renditionFlow === "scrolled-continuous" ? !1 : e, ao = (t) => t === void 0 || t === "auto" || t === "landscape" || t === "both", en = ({
|
|
1841
1841
|
manifest: t,
|
|
1842
1842
|
viewport: e
|
|
1843
1843
|
}) => {
|
|
1844
1844
|
const n = e.width > e.height;
|
|
1845
|
-
return !!(!n && t?.renditionSpread === "portrait" || n &&
|
|
1846
|
-
},
|
|
1845
|
+
return !!(!n && t?.renditionSpread === "portrait" || n && ao(t?.renditionSpread));
|
|
1846
|
+
}, Js = ({
|
|
1847
1847
|
manifest: t,
|
|
1848
1848
|
viewport: e
|
|
1849
1849
|
}) => Qt({
|
|
1850
1850
|
manifest: t,
|
|
1851
1851
|
spreadMode: en({ manifest: t, viewport: e })
|
|
1852
|
-
}),
|
|
1852
|
+
}), co = (t) => j([
|
|
1853
1853
|
t.viewport.watch(["width", "height"]),
|
|
1854
1854
|
t.context.watch("manifest")
|
|
1855
1855
|
]).pipe(
|
|
@@ -1861,13 +1861,13 @@ const Qt = ({
|
|
|
1861
1861
|
})
|
|
1862
1862
|
})
|
|
1863
1863
|
)
|
|
1864
|
-
),
|
|
1864
|
+
), uo = (t) => (e) => {
|
|
1865
1865
|
const {
|
|
1866
1866
|
pageHorizontalMargin: n,
|
|
1867
1867
|
pageVerticalMargin: i,
|
|
1868
1868
|
layoutAutoResize: o,
|
|
1869
1869
|
layoutLayerTransition: r
|
|
1870
|
-
} = e, s = t(e), a = new
|
|
1870
|
+
} = e, s = t(e), a = new so(
|
|
1871
1871
|
{
|
|
1872
1872
|
pageHorizontalMargin: n,
|
|
1873
1873
|
pageVerticalMargin: i,
|
|
@@ -1885,12 +1885,12 @@ const Qt = ({
|
|
|
1885
1885
|
}
|
|
1886
1886
|
}
|
|
1887
1887
|
}), s.hookManager.register("item.onBeforeLayout", ({ item: m }) => {
|
|
1888
|
-
const f = s.spineItemsManager.get(m.id), x = !!(m.mediaType ??
|
|
1888
|
+
const f = s.spineItemsManager.get(m.id), x = !!(m.mediaType ?? Qe(m.href))?.startsWith("image/"), { pageHorizontalMargin: v = 0, pageVerticalMargin: b = 0 } = a.values, C = s.viewport.pageSize;
|
|
1889
1889
|
if (f?.renditionLayout === "reflowable" && !x) {
|
|
1890
1890
|
let I = C.width - v * 2;
|
|
1891
|
-
const
|
|
1891
|
+
const A = C.height - b * 2;
|
|
1892
1892
|
let Y = C.width - v * 2, X = v * 2;
|
|
1893
|
-
f.isUsingVerticalWriting() && (Y = C.width - v * 2, I =
|
|
1893
|
+
f.isUsingVerticalWriting() && (Y = C.width - v * 2, I = A, X = b * 2);
|
|
1894
1894
|
const re = f?.renderer.getDocumentFrame();
|
|
1895
1895
|
re && de(
|
|
1896
1896
|
re,
|
|
@@ -1901,11 +1901,11 @@ const Qt = ({
|
|
|
1901
1901
|
margin: ${b}px ${v}px !important;
|
|
1902
1902
|
column-gap: ${X}px !important;
|
|
1903
1903
|
column-width: ${I}px !important;
|
|
1904
|
-
height: ${
|
|
1904
|
+
height: ${A}px !important;
|
|
1905
1905
|
}
|
|
1906
1906
|
img, video, audio, object, svg {
|
|
1907
1907
|
-max-width: ${I}px !important;
|
|
1908
|
-
-max-height: ${
|
|
1908
|
+
-max-height: ${A}px !important;
|
|
1909
1909
|
}
|
|
1910
1910
|
table {
|
|
1911
1911
|
max-width: ${I}px !important;
|
|
@@ -1916,7 +1916,7 @@ const Qt = ({
|
|
|
1916
1916
|
`
|
|
1917
1917
|
);
|
|
1918
1918
|
}
|
|
1919
|
-
}),
|
|
1919
|
+
}), oo(s), io(s), s.hookManager.register(
|
|
1920
1920
|
"item.onDocumentCreated",
|
|
1921
1921
|
({ documentContainer: m }) => {
|
|
1922
1922
|
w(m.style, "opacity", "0"), a.values.layoutLayerTransition && w(
|
|
@@ -1940,12 +1940,12 @@ const Qt = ({
|
|
|
1940
1940
|
G(() => s.context.watch("rootElement")),
|
|
1941
1941
|
fe(ne),
|
|
1942
1942
|
G((m) => st(m)),
|
|
1943
|
-
|
|
1943
|
+
zn(100),
|
|
1944
1944
|
fe(ne),
|
|
1945
1945
|
z(() => {
|
|
1946
1946
|
s?.layout();
|
|
1947
1947
|
})
|
|
1948
|
-
), d =
|
|
1948
|
+
), d = Xi(s);
|
|
1949
1949
|
a.watch(["pageHorizontalMargin", "pageVerticalMargin"]).pipe(
|
|
1950
1950
|
jt(1),
|
|
1951
1951
|
z(() => {
|
|
@@ -1955,7 +1955,7 @@ const Qt = ({
|
|
|
1955
1955
|
).subscribe();
|
|
1956
1956
|
const l = s.spine.pages.pipe(
|
|
1957
1957
|
kt({ refCount: !0, bufferSize: 1 })
|
|
1958
|
-
), g =
|
|
1958
|
+
), g = ro(s), h = co(s), p = no(s);
|
|
1959
1959
|
return T(
|
|
1960
1960
|
c,
|
|
1961
1961
|
d,
|
|
@@ -1972,9 +1972,9 @@ const Qt = ({
|
|
|
1972
1972
|
settings: a,
|
|
1973
1973
|
layout$: s.spine.layout$,
|
|
1974
1974
|
layoutInfo$: l,
|
|
1975
|
-
coordinates:
|
|
1975
|
+
coordinates: Yi(s)
|
|
1976
1976
|
};
|
|
1977
|
-
},
|
|
1977
|
+
}, lo = (t) => (e) => {
|
|
1978
1978
|
const n = t(e), i = new IntersectionObserver(
|
|
1979
1979
|
(a) => {
|
|
1980
1980
|
a.forEach((c) => {
|
|
@@ -2024,7 +2024,7 @@ const Qt = ({
|
|
|
2024
2024
|
}
|
|
2025
2025
|
};
|
|
2026
2026
|
}, tn = (t) => (e) => e.pipe(
|
|
2027
|
-
|
|
2027
|
+
$(
|
|
2028
2028
|
(n) => t.pipe(
|
|
2029
2029
|
L((i) => i === "free"),
|
|
2030
2030
|
W(),
|
|
@@ -2034,7 +2034,7 @@ const Qt = ({
|
|
|
2034
2034
|
), nn = ({
|
|
2035
2035
|
navigation$: t,
|
|
2036
2036
|
navigationState$: e
|
|
2037
|
-
}) => t.pipe(tn(e)),
|
|
2037
|
+
}) => t.pipe(tn(e)), po = (t) => nn(t).pipe(Vt(1)), go = (t) => (e) => e.pipe(M(po(t))), on = (t) => t.navigation.navigation$.pipe(
|
|
2038
2038
|
L((e) => e.triggeredBy === "user"),
|
|
2039
2039
|
tn(t.navigation.navigationState$),
|
|
2040
2040
|
y((e) => {
|
|
@@ -2046,27 +2046,27 @@ const Qt = ({
|
|
|
2046
2046
|
}),
|
|
2047
2047
|
L((e) => e !== void 0),
|
|
2048
2048
|
y((e) => ({ boundary: e })),
|
|
2049
|
-
|
|
2050
|
-
),
|
|
2049
|
+
R()
|
|
2050
|
+
), ho = (t, e) => t.links$.pipe(
|
|
2051
2051
|
F((n) => {
|
|
2052
|
-
if (!
|
|
2052
|
+
if (!oi(n.target, "a") || n.type !== "click") return;
|
|
2053
2053
|
const i = new URL(n.target.href), o = `${i.origin}${i.pathname}`;
|
|
2054
2054
|
t.context.manifest?.spineItems.some(
|
|
2055
2055
|
(s) => s.href === o
|
|
2056
2056
|
) && e.goToUrl(i);
|
|
2057
2057
|
})
|
|
2058
|
-
), se = N.namespace("navigation"),
|
|
2058
|
+
), se = N.namespace("navigation"), mo = ({
|
|
2059
2059
|
position: t,
|
|
2060
2060
|
spineItem: e,
|
|
2061
2061
|
pageHeight: n,
|
|
2062
2062
|
pageWidth: i,
|
|
2063
2063
|
spineItemLocator: o
|
|
2064
2064
|
}) => {
|
|
2065
|
-
let r = new
|
|
2065
|
+
let r = new D({
|
|
2066
2066
|
x: t.x - i,
|
|
2067
2067
|
y: t.y
|
|
2068
2068
|
});
|
|
2069
|
-
return e.isUsingVerticalWriting() && (r = new
|
|
2069
|
+
return e.isUsingVerticalWriting() && (r = new D({
|
|
2070
2070
|
x: t.x,
|
|
2071
2071
|
y: t.y + n
|
|
2072
2072
|
})), o.getSpineItemClosestPositionFromUnsafePosition(
|
|
@@ -2087,7 +2087,7 @@ const Qt = ({
|
|
|
2087
2087
|
const u = o.getSpineItemPositionFromSpinePosition(
|
|
2088
2088
|
t,
|
|
2089
2089
|
a
|
|
2090
|
-
), d =
|
|
2090
|
+
), d = mo({
|
|
2091
2091
|
position: u,
|
|
2092
2092
|
spineItem: a,
|
|
2093
2093
|
pageHeight: r.pageSize.height,
|
|
@@ -2100,14 +2100,14 @@ const Qt = ({
|
|
|
2100
2100
|
) ? o.getSpinePositionFromSpineItemPosition({
|
|
2101
2101
|
spineItemPosition: d,
|
|
2102
2102
|
spineItem: a
|
|
2103
|
-
}) : s === "horizontal" ? new
|
|
2103
|
+
}) : s === "horizontal" ? new O({
|
|
2104
2104
|
x: t.x - r.pageSize.width,
|
|
2105
2105
|
y: 0
|
|
2106
|
-
}) : new
|
|
2106
|
+
}) : new O({
|
|
2107
2107
|
y: t.y - r.pageSize.height,
|
|
2108
2108
|
x: 0
|
|
2109
2109
|
});
|
|
2110
|
-
},
|
|
2110
|
+
}, fo = ({
|
|
2111
2111
|
position: t,
|
|
2112
2112
|
spineItem: e,
|
|
2113
2113
|
context: n,
|
|
@@ -2119,7 +2119,7 @@ const Qt = ({
|
|
|
2119
2119
|
settings: c
|
|
2120
2120
|
}) => {
|
|
2121
2121
|
if (c.values.computedPageTurnMode === "scrollable" && s === "vertical")
|
|
2122
|
-
return new
|
|
2122
|
+
return new O({
|
|
2123
2123
|
x: t.x,
|
|
2124
2124
|
y: t.y - a.pageSize.height
|
|
2125
2125
|
});
|
|
@@ -2136,10 +2136,10 @@ const Qt = ({
|
|
|
2136
2136
|
if (c.values.computedSpreadMode) {
|
|
2137
2137
|
if (e?.isUsingVerticalWriting() && t.x !== u.x)
|
|
2138
2138
|
return i.getAdjustedPositionForSpread(
|
|
2139
|
-
n.isRTL() ? new
|
|
2139
|
+
n.isRTL() ? new O({
|
|
2140
2140
|
x: u.x + a.pageSize.width,
|
|
2141
2141
|
y: u.y
|
|
2142
|
-
}) : new
|
|
2142
|
+
}) : new O({
|
|
2143
2143
|
x: u.x - a.pageSize.width,
|
|
2144
2144
|
y: u.y
|
|
2145
2145
|
})
|
|
@@ -2157,18 +2157,18 @@ const Qt = ({
|
|
|
2157
2157
|
return i.getAdjustedPositionForSpread(d);
|
|
2158
2158
|
}
|
|
2159
2159
|
return i.getAdjustedPositionForSpread(u);
|
|
2160
|
-
},
|
|
2160
|
+
}, yo = ({
|
|
2161
2161
|
position: t,
|
|
2162
2162
|
spineItem: e,
|
|
2163
2163
|
pageHeight: n,
|
|
2164
2164
|
pageWidth: i,
|
|
2165
2165
|
spineItemLocator: o
|
|
2166
2166
|
}) => {
|
|
2167
|
-
let r = new
|
|
2167
|
+
let r = new D({
|
|
2168
2168
|
x: t.x + i,
|
|
2169
2169
|
y: t.y
|
|
2170
2170
|
});
|
|
2171
|
-
return e.isUsingVerticalWriting() && (r = new
|
|
2171
|
+
return e.isUsingVerticalWriting() && (r = new D({
|
|
2172
2172
|
x: t.x,
|
|
2173
2173
|
y: t.y - n
|
|
2174
2174
|
})), o.getSpineItemClosestPositionFromUnsafePosition(
|
|
@@ -2189,7 +2189,7 @@ const Qt = ({
|
|
|
2189
2189
|
const u = o.getSpineItemPositionFromSpinePosition(
|
|
2190
2190
|
t,
|
|
2191
2191
|
a
|
|
2192
|
-
), d =
|
|
2192
|
+
), d = yo({
|
|
2193
2193
|
position: u,
|
|
2194
2194
|
spineItem: a,
|
|
2195
2195
|
pageHeight: r.pageSize.height,
|
|
@@ -2202,14 +2202,14 @@ const Qt = ({
|
|
|
2202
2202
|
) ? o.getSpinePositionFromSpineItemPosition({
|
|
2203
2203
|
spineItemPosition: d,
|
|
2204
2204
|
spineItem: a
|
|
2205
|
-
}) : s === "horizontal" ? new
|
|
2205
|
+
}) : s === "horizontal" ? new O({
|
|
2206
2206
|
x: t.x + r.pageSize.width,
|
|
2207
2207
|
y: 0
|
|
2208
|
-
}) : new
|
|
2208
|
+
}) : new O({
|
|
2209
2209
|
y: t.y + r.pageSize.height,
|
|
2210
2210
|
x: 0
|
|
2211
2211
|
});
|
|
2212
|
-
},
|
|
2212
|
+
}, So = ({
|
|
2213
2213
|
position: t,
|
|
2214
2214
|
spineItem: e,
|
|
2215
2215
|
context: n,
|
|
@@ -2221,7 +2221,7 @@ const Qt = ({
|
|
|
2221
2221
|
settings: c
|
|
2222
2222
|
}) => {
|
|
2223
2223
|
if (c.values.computedPageTurnMode === "scrollable" && s === "vertical")
|
|
2224
|
-
return new
|
|
2224
|
+
return new O({
|
|
2225
2225
|
x: t.x,
|
|
2226
2226
|
y: t.y + a.pageSize.height
|
|
2227
2227
|
});
|
|
@@ -2238,10 +2238,10 @@ const Qt = ({
|
|
|
2238
2238
|
if (c.values.computedSpreadMode) {
|
|
2239
2239
|
if (e?.isUsingVerticalWriting() && t.x !== u.x)
|
|
2240
2240
|
return i.getAdjustedPositionForSpread(
|
|
2241
|
-
n.isRTL() ? new
|
|
2241
|
+
n.isRTL() ? new O({
|
|
2242
2242
|
x: u.x - a.pageSize.width,
|
|
2243
2243
|
y: u.y
|
|
2244
|
-
}) : new
|
|
2244
|
+
}) : new O({
|
|
2245
2245
|
x: u.x + a.pageSize.width,
|
|
2246
2246
|
y: u.y
|
|
2247
2247
|
})
|
|
@@ -2260,7 +2260,7 @@ const Qt = ({
|
|
|
2260
2260
|
}
|
|
2261
2261
|
return i.getAdjustedPositionForSpread(u);
|
|
2262
2262
|
};
|
|
2263
|
-
class
|
|
2263
|
+
class Io {
|
|
2264
2264
|
constructor(e) {
|
|
2265
2265
|
this.reader = e, this.movingLastDelta = { x: 0, y: 0 }, this.movingLastPosition = new V({ x: 0, y: 0 }), this.unlock = void 0;
|
|
2266
2266
|
}
|
|
@@ -2279,7 +2279,7 @@ class So {
|
|
|
2279
2279
|
turnRightOrBottom() {
|
|
2280
2280
|
const e = this.reader.navigation.getNavigation(), n = this.reader.spineItemsManager.get(e.spineItem);
|
|
2281
2281
|
if (!n) return;
|
|
2282
|
-
const i =
|
|
2282
|
+
const i = So({
|
|
2283
2283
|
context: this.reader.context,
|
|
2284
2284
|
navigationResolver: this.reader.navigation.navigationResolver,
|
|
2285
2285
|
position: e.position,
|
|
@@ -2297,7 +2297,7 @@ class So {
|
|
|
2297
2297
|
turnLeftOrTop() {
|
|
2298
2298
|
const e = this.reader.navigation.getNavigation(), n = this.reader.spineItemsManager.get(e.spineItem);
|
|
2299
2299
|
if (!n) return;
|
|
2300
|
-
const i =
|
|
2300
|
+
const i = fo({
|
|
2301
2301
|
context: this.reader.context,
|
|
2302
2302
|
navigationResolver: this.reader.navigation.navigationResolver,
|
|
2303
2303
|
position: e.position,
|
|
@@ -2439,7 +2439,7 @@ class So {
|
|
|
2439
2439
|
}
|
|
2440
2440
|
}
|
|
2441
2441
|
}
|
|
2442
|
-
class
|
|
2442
|
+
class bo extends oe {
|
|
2443
2443
|
constructor(e) {
|
|
2444
2444
|
super({
|
|
2445
2445
|
lastDelta: { x: 0, y: 0 },
|
|
@@ -2504,8 +2504,8 @@ class J {
|
|
|
2504
2504
|
this.isDestroyed || (this.isDestroyed = !0, this.destroySubject.next(), this.destroySubject.complete());
|
|
2505
2505
|
}
|
|
2506
2506
|
}
|
|
2507
|
-
const
|
|
2508
|
-
class
|
|
2507
|
+
const vo = 500;
|
|
2508
|
+
class wo extends J {
|
|
2509
2509
|
constructor(e, n) {
|
|
2510
2510
|
super(), this.scrollNavigationController = e, this.lock = n, this.navigationSubject = new k(), this.navigation$ = this.navigationSubject.asObservable();
|
|
2511
2511
|
const i = this.scrollNavigationController.userScroll$.pipe(
|
|
@@ -2513,10 +2513,10 @@ class vo extends J {
|
|
|
2513
2513
|
const r = this.lock();
|
|
2514
2514
|
return T(
|
|
2515
2515
|
this.scrollNavigationController.userScroll$,
|
|
2516
|
-
|
|
2516
|
+
P(o)
|
|
2517
2517
|
).pipe(
|
|
2518
|
-
|
|
2519
|
-
|
|
2518
|
+
et(
|
|
2519
|
+
vo,
|
|
2520
2520
|
xe
|
|
2521
2521
|
),
|
|
2522
2522
|
W(),
|
|
@@ -2539,7 +2539,7 @@ class vo extends J {
|
|
|
2539
2539
|
T(i).pipe(M(this.destroy$)).subscribe();
|
|
2540
2540
|
}
|
|
2541
2541
|
}
|
|
2542
|
-
const
|
|
2542
|
+
const xo = (t) => t.pagination.state$.pipe(
|
|
2543
2543
|
H(t.context.manifest$, t.settings.values$),
|
|
2544
2544
|
y(
|
|
2545
2545
|
([
|
|
@@ -2558,8 +2558,8 @@ const wo = (t) => t.pagination.state$.pipe(
|
|
|
2558
2558
|
};
|
|
2559
2559
|
}
|
|
2560
2560
|
),
|
|
2561
|
-
|
|
2562
|
-
),
|
|
2561
|
+
E(U)
|
|
2562
|
+
), Po = ({ reader: t, duration: e }) => (n) => {
|
|
2563
2563
|
let i;
|
|
2564
2564
|
const o = () => {
|
|
2565
2565
|
i?.(), i = void 0;
|
|
@@ -2575,11 +2575,11 @@ const wo = (t) => t.pagination.state$.pipe(
|
|
|
2575
2575
|
F(o),
|
|
2576
2576
|
be(o)
|
|
2577
2577
|
);
|
|
2578
|
-
},
|
|
2579
|
-
const n = t(e), i =
|
|
2578
|
+
}, $o = (t) => (e) => {
|
|
2579
|
+
const n = t(e), i = xo(n), o = on(n), r = new Io(n), s = new bo(n), a = new wo(
|
|
2580
2580
|
n.navigation.scrollNavigationController,
|
|
2581
2581
|
n.navigation.lock
|
|
2582
|
-
), c =
|
|
2582
|
+
), c = ho(n, r), u = a.navigation$.pipe(
|
|
2583
2583
|
F((g) => {
|
|
2584
2584
|
n.navigation.navigate(g);
|
|
2585
2585
|
})
|
|
@@ -2597,7 +2597,7 @@ const wo = (t) => t.pagination.state$.pipe(
|
|
|
2597
2597
|
...n.navigation,
|
|
2598
2598
|
state$: i,
|
|
2599
2599
|
outOfSpineBoundary$: o,
|
|
2600
|
-
throttleLock: ({ duration: g, trigger: h }) => h.pipe(
|
|
2600
|
+
throttleLock: ({ duration: g, trigger: h }) => h.pipe(Po({ duration: g, reader: n })),
|
|
2601
2601
|
panNavigator: s,
|
|
2602
2602
|
turnBottom: r.turnBottom.bind(r),
|
|
2603
2603
|
turnTop: r.turnTop.bind(r),
|
|
@@ -2620,7 +2620,7 @@ const wo = (t) => t.pagination.state$.pipe(
|
|
|
2620
2620
|
goToAbsolutePageIndex: r.goToAbsolutePageIndex.bind(r)
|
|
2621
2621
|
}
|
|
2622
2622
|
};
|
|
2623
|
-
},
|
|
2623
|
+
}, To = (t, e) => {
|
|
2624
2624
|
if ("cfi" in e) {
|
|
2625
2625
|
const { itemIndex: r, ...s } = t.cfi.parseCfi(e.cfi);
|
|
2626
2626
|
return {
|
|
@@ -2640,7 +2640,7 @@ const wo = (t) => t.pagination.state$.pipe(
|
|
|
2640
2640
|
itemIndex: n.index,
|
|
2641
2641
|
node: null
|
|
2642
2642
|
};
|
|
2643
|
-
},
|
|
2643
|
+
}, Co = (t, e) => {
|
|
2644
2644
|
let n = t?.itemPageIndex;
|
|
2645
2645
|
const { itemIndex: i, ...o } = e.cfi.parseCfi(t.cfi), r = e.spineItemsManager.get(i);
|
|
2646
2646
|
return r ? Yt().pipe(
|
|
@@ -2671,9 +2671,9 @@ const wo = (t) => t.pagination.state$.pipe(
|
|
|
2671
2671
|
itemPageIndex: n
|
|
2672
2672
|
};
|
|
2673
2673
|
})
|
|
2674
|
-
) :
|
|
2674
|
+
) : P({ ...t, itemIndex: i, ...o });
|
|
2675
2675
|
};
|
|
2676
|
-
class
|
|
2676
|
+
class Fo {
|
|
2677
2677
|
constructor(e) {
|
|
2678
2678
|
this.reader = e, this.locatorsByKey = /* @__PURE__ */ new Map(), this.deregisterMemoizedStream = (n) => {
|
|
2679
2679
|
const i = this.locatorsByKey.get(n);
|
|
@@ -2681,7 +2681,7 @@ class Co {
|
|
|
2681
2681
|
}, this.locate = (n, i) => {
|
|
2682
2682
|
const o = {
|
|
2683
2683
|
resource: n,
|
|
2684
|
-
meta:
|
|
2684
|
+
meta: To(this.reader, n)
|
|
2685
2685
|
};
|
|
2686
2686
|
return lt(() => {
|
|
2687
2687
|
const r = this.reader.spineItemsManager.get(
|
|
@@ -2704,9 +2704,9 @@ class Co {
|
|
|
2704
2704
|
)
|
|
2705
2705
|
);
|
|
2706
2706
|
const l = this.reader.spine.layout$.pipe(
|
|
2707
|
-
|
|
2707
|
+
et(10),
|
|
2708
2708
|
Ie(o),
|
|
2709
|
-
Ln((g) =>
|
|
2709
|
+
Ln((g) => Co(g.meta, this.reader).pipe(
|
|
2710
2710
|
y((h) => ({
|
|
2711
2711
|
...g,
|
|
2712
2712
|
meta: h
|
|
@@ -2729,10 +2729,10 @@ class Co {
|
|
|
2729
2729
|
) : this.locate(e, n ?? {});
|
|
2730
2730
|
}
|
|
2731
2731
|
}
|
|
2732
|
-
const
|
|
2732
|
+
const Mo = N.namespace("spine"), Lo = ({
|
|
2733
2733
|
position: t,
|
|
2734
2734
|
pageSize: e
|
|
2735
|
-
}) => new
|
|
2735
|
+
}) => new Bi({
|
|
2736
2736
|
...t,
|
|
2737
2737
|
left: t.x,
|
|
2738
2738
|
top: t.y,
|
|
@@ -2740,7 +2740,7 @@ const Fo = N.namespace("spine"), Mo = ({
|
|
|
2740
2740
|
height: e.height,
|
|
2741
2741
|
bottom: t.y + e.height,
|
|
2742
2742
|
right: t.x + e.width
|
|
2743
|
-
}),
|
|
2743
|
+
}), No = 10, Ao = (t) => {
|
|
2744
2744
|
const { spineItem: e, ...n } = t;
|
|
2745
2745
|
if (!t.spineItem.value.isLoaded)
|
|
2746
2746
|
return {
|
|
@@ -2753,12 +2753,12 @@ const Fo = N.namespace("spine"), Mo = ({
|
|
|
2753
2753
|
firstVisibleNode: void 0
|
|
2754
2754
|
} : {
|
|
2755
2755
|
...n,
|
|
2756
|
-
firstVisibleNode:
|
|
2756
|
+
firstVisibleNode: Jn(
|
|
2757
2757
|
o,
|
|
2758
2758
|
t.layout
|
|
2759
2759
|
)
|
|
2760
2760
|
};
|
|
2761
|
-
},
|
|
2761
|
+
}, Eo = (t) => new le((e) => {
|
|
2762
2762
|
if (t.length === 0) {
|
|
2763
2763
|
e.next([]), e.complete();
|
|
2764
2764
|
return;
|
|
@@ -2769,13 +2769,13 @@ const Fo = N.namespace("spine"), Mo = ({
|
|
|
2769
2769
|
}, s = () => {
|
|
2770
2770
|
n = void 0;
|
|
2771
2771
|
let c = 0;
|
|
2772
|
-
for (; i < t.length && c <
|
|
2772
|
+
for (; i < t.length && c < No; ) {
|
|
2773
2773
|
const u = t[i];
|
|
2774
2774
|
if (!u) {
|
|
2775
2775
|
i = t.length;
|
|
2776
2776
|
break;
|
|
2777
2777
|
}
|
|
2778
|
-
o[i] =
|
|
2778
|
+
o[i] = Ao(u), i += 1, c += 1;
|
|
2779
2779
|
}
|
|
2780
2780
|
if (i >= t.length) {
|
|
2781
2781
|
e.next(o), e.complete();
|
|
@@ -2792,7 +2792,7 @@ const Fo = N.namespace("spine"), Mo = ({
|
|
|
2792
2792
|
constructor(e, n, i, o, r, s) {
|
|
2793
2793
|
super({ pages: [] }), this.spineLayout = e, this.spineItemsManager = n, this.spineItemLocator = i, this.context = o, this.locator = r, this.viewport = s, this.fromSpineItemPageIndex = (a, c) => ae.fromSpineItemPageIndex(this.value, a, c), this.fromNextPageWithinSameSpineItem = (a) => ae.fromNextPageWithinSameSpineItem(this.value, a), this.fromAbsolutePageIndex = (a) => ae.fromAbsolutePageIndex(this.value, a), this.observeFromAbsolutePageIndex = (a) => this.pipe(y(() => this.fromAbsolutePageIndex(a))), this.layout$ = e.layout$.pipe(
|
|
2794
2794
|
H(s),
|
|
2795
|
-
|
|
2795
|
+
$(([, { pageSize: a }]) => {
|
|
2796
2796
|
const c = n.items.reduce(
|
|
2797
2797
|
(u, d, l) => {
|
|
2798
2798
|
for (let g = 0; g < d.numberOfPages; g += 1) {
|
|
@@ -2804,11 +2804,11 @@ const Fo = N.namespace("spine"), Mo = ({
|
|
|
2804
2804
|
spineItemPosition: h
|
|
2805
2805
|
}), m = u.length;
|
|
2806
2806
|
u.push({
|
|
2807
|
-
absoluteLayout:
|
|
2807
|
+
absoluteLayout: Lo({
|
|
2808
2808
|
pageSize: a,
|
|
2809
2809
|
position: p
|
|
2810
2810
|
}),
|
|
2811
|
-
layout: new
|
|
2811
|
+
layout: new _i({
|
|
2812
2812
|
left: h.x,
|
|
2813
2813
|
right: h.x + a.width,
|
|
2814
2814
|
top: h.y,
|
|
@@ -2828,10 +2828,10 @@ const Fo = N.namespace("spine"), Mo = ({
|
|
|
2828
2828
|
},
|
|
2829
2829
|
[]
|
|
2830
2830
|
);
|
|
2831
|
-
return
|
|
2831
|
+
return Eo(c);
|
|
2832
2832
|
}),
|
|
2833
|
-
y((a) => (
|
|
2834
|
-
|
|
2833
|
+
y((a) => (Mo.info("Pages layout", a), { pages: a })),
|
|
2834
|
+
R()
|
|
2835
2835
|
), this.layout$.pipe(M(this.destroy$)).subscribe(this.next.bind(this));
|
|
2836
2836
|
}
|
|
2837
2837
|
};
|
|
@@ -2848,14 +2848,14 @@ ae.fromSpineItemPageIndex = (e, n, i) => {
|
|
|
2848
2848
|
(i) => i.absolutePageIndex === n
|
|
2849
2849
|
);
|
|
2850
2850
|
let he = ae;
|
|
2851
|
-
const
|
|
2851
|
+
const Te = (t) => {
|
|
2852
2852
|
const e = t.indexOf("#");
|
|
2853
2853
|
return e >= 0 ? t.substring(0, e) : t;
|
|
2854
2854
|
}, yt = (t) => {
|
|
2855
2855
|
if (!t) return;
|
|
2856
2856
|
const e = t.indexOf("#");
|
|
2857
2857
|
return e < 0 ? void 0 : t.substring(e + 1) || void 0;
|
|
2858
|
-
},
|
|
2858
|
+
}, Ro = (t) => {
|
|
2859
2859
|
try {
|
|
2860
2860
|
return decodeURIComponent(t);
|
|
2861
2861
|
} catch {
|
|
@@ -2871,22 +2871,22 @@ const $e = (t) => {
|
|
|
2871
2871
|
},
|
|
2872
2872
|
...rn(n.contents, i)
|
|
2873
2873
|
];
|
|
2874
|
-
}),
|
|
2874
|
+
}), Do = (t) => {
|
|
2875
2875
|
const e = /* @__PURE__ */ new Map();
|
|
2876
2876
|
return t.spineItems.forEach((n, i) => {
|
|
2877
2877
|
e.has(n.href) || e.set(n.href, i);
|
|
2878
2878
|
}), e;
|
|
2879
|
-
},
|
|
2880
|
-
const n =
|
|
2879
|
+
}, Oo = (t, e) => {
|
|
2880
|
+
const n = Do(e);
|
|
2881
2881
|
return rn(t).map((i) => {
|
|
2882
|
-
const o =
|
|
2882
|
+
const o = Te(i.href), r = n.get(o) ?? -1;
|
|
2883
2883
|
return {
|
|
2884
2884
|
...i,
|
|
2885
2885
|
hrefWithoutAnchor: o,
|
|
2886
2886
|
spineItemIndex: r
|
|
2887
2887
|
};
|
|
2888
2888
|
});
|
|
2889
|
-
},
|
|
2889
|
+
}, Vo = ({
|
|
2890
2890
|
manifest: t,
|
|
2891
2891
|
tocIndex: e
|
|
2892
2892
|
}) => {
|
|
@@ -2902,7 +2902,7 @@ const $e = (t) => {
|
|
|
2902
2902
|
const i = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
|
|
2903
2903
|
for (const r of t.spineItems) {
|
|
2904
2904
|
if (i.has(r.href)) continue;
|
|
2905
|
-
const s =
|
|
2905
|
+
const s = Te(r.href);
|
|
2906
2906
|
let a = o.get(s);
|
|
2907
2907
|
if (!a) {
|
|
2908
2908
|
const c = [];
|
|
@@ -2910,7 +2910,7 @@ const $e = (t) => {
|
|
|
2910
2910
|
u,
|
|
2911
2911
|
d
|
|
2912
2912
|
] of n)
|
|
2913
|
-
|
|
2913
|
+
ko(
|
|
2914
2914
|
s,
|
|
2915
2915
|
u
|
|
2916
2916
|
) && c.push(...d);
|
|
@@ -2921,7 +2921,7 @@ const $e = (t) => {
|
|
|
2921
2921
|
i.set(r.href, a);
|
|
2922
2922
|
}
|
|
2923
2923
|
return i;
|
|
2924
|
-
},
|
|
2924
|
+
}, ko = (t, e) => t === e || t.endsWith(e) || e.endsWith(t), jo = (t, e) => {
|
|
2925
2925
|
const n = t.endsWith(e), i = t.substring(
|
|
2926
2926
|
0,
|
|
2927
2927
|
t.lastIndexOf("/")
|
|
@@ -2946,7 +2946,7 @@ const $e = (t) => {
|
|
|
2946
2946
|
o.subChapter = s, o = s;
|
|
2947
2947
|
}
|
|
2948
2948
|
return i;
|
|
2949
|
-
},
|
|
2949
|
+
}, Uo = ({
|
|
2950
2950
|
doc: t,
|
|
2951
2951
|
node: e,
|
|
2952
2952
|
offset: n
|
|
@@ -2960,14 +2960,14 @@ const $e = (t) => {
|
|
|
2960
2960
|
i.setStart(e, r);
|
|
2961
2961
|
}
|
|
2962
2962
|
return i.collapse(!0), i;
|
|
2963
|
-
},
|
|
2963
|
+
}, zo = ({
|
|
2964
2964
|
rangeToTest: t,
|
|
2965
2965
|
upperBoundRange: e
|
|
2966
|
-
}) => t.compareBoundaryPoints(Range.START_TO_START, e) < 0,
|
|
2966
|
+
}) => t.compareBoundaryPoints(Range.START_TO_START, e) < 0, Wo = (t) => {
|
|
2967
2967
|
const e = t.createRange(), n = t.body ?? t.documentElement;
|
|
2968
2968
|
if (n)
|
|
2969
2969
|
return e.selectNodeContents(n), e.collapse(!1), e;
|
|
2970
|
-
},
|
|
2970
|
+
}, _o = ({
|
|
2971
2971
|
anchorNode: t,
|
|
2972
2972
|
nextPageNode: e
|
|
2973
2973
|
}) => t === e || t.contains(e), St = ({
|
|
@@ -2980,11 +2980,11 @@ const $e = (t) => {
|
|
|
2980
2980
|
if (!t || e === void 0 || !i || n.length === 0) return;
|
|
2981
2981
|
const r = i.renderer.getDocumentFrame()?.contentDocument;
|
|
2982
2982
|
if (!r || t.ownerDocument !== r) return;
|
|
2983
|
-
const s = o?.firstVisibleNode?.node, a = o?.firstVisibleNode?.offset, c = o ? s !== void 0 && a !== void 0 && s.ownerDocument === r ?
|
|
2983
|
+
const s = o?.firstVisibleNode?.node, a = o?.firstVisibleNode?.offset, c = o ? s !== void 0 && a !== void 0 && s.ownerDocument === r ? Uo({
|
|
2984
2984
|
doc: r,
|
|
2985
2985
|
node: s,
|
|
2986
2986
|
offset: a
|
|
2987
|
-
}) : void 0 :
|
|
2987
|
+
}) : void 0 : Wo(r);
|
|
2988
2988
|
if (!c) return;
|
|
2989
2989
|
const u = o !== void 0 && s !== void 0 && s.ownerDocument === r;
|
|
2990
2990
|
let d, l, g;
|
|
@@ -2993,14 +2993,14 @@ const $e = (t) => {
|
|
|
2993
2993
|
g = p.chain;
|
|
2994
2994
|
continue;
|
|
2995
2995
|
}
|
|
2996
|
-
const m = r.getElementById(
|
|
2997
|
-
if (!m || u &&
|
|
2996
|
+
const m = r.getElementById(Ro(p.anchorId));
|
|
2997
|
+
if (!m || u && _o({
|
|
2998
2998
|
anchorNode: m,
|
|
2999
2999
|
nextPageNode: s
|
|
3000
3000
|
}))
|
|
3001
3001
|
continue;
|
|
3002
3002
|
const f = r.createRange();
|
|
3003
|
-
f.setStartBefore(m), f.collapse(!0),
|
|
3003
|
+
f.setStartBefore(m), f.collapse(!0), zo({
|
|
3004
3004
|
rangeToTest: f,
|
|
3005
3005
|
upperBoundRange: c
|
|
3006
3006
|
}) && (!l || f.compareBoundaryPoints(
|
|
@@ -3010,35 +3010,35 @@ const $e = (t) => {
|
|
|
3010
3010
|
}
|
|
3011
3011
|
const h = d ?? g;
|
|
3012
3012
|
return h ? sn(h) : void 0;
|
|
3013
|
-
},
|
|
3013
|
+
}, Bo = ({
|
|
3014
3014
|
candidate: t,
|
|
3015
3015
|
hrefHasAnchor: e
|
|
3016
3016
|
}) => {
|
|
3017
3017
|
if (e || !t.anchorId) return !1;
|
|
3018
3018
|
const n = t.chain[t.chain.length - 1], i = t.chain[t.chain.length - 2];
|
|
3019
|
-
return !n || !i ? !1 :
|
|
3020
|
-
},
|
|
3019
|
+
return !n || !i ? !1 : Te(n.path) === Te(i.path);
|
|
3020
|
+
}, Ho = ({
|
|
3021
3021
|
href: t,
|
|
3022
3022
|
tocIndex: e,
|
|
3023
3023
|
manifest: n
|
|
3024
3024
|
}) => {
|
|
3025
|
-
const i =
|
|
3025
|
+
const i = Te(t), o = t.includes("#"), r = n.spineItems.findIndex(
|
|
3026
3026
|
(a) => a.href === i
|
|
3027
3027
|
);
|
|
3028
3028
|
let s;
|
|
3029
3029
|
for (const a of e)
|
|
3030
|
-
|
|
3030
|
+
jo(
|
|
3031
3031
|
i,
|
|
3032
3032
|
a.hrefWithoutAnchor
|
|
3033
|
-
) && (r < a.spineItemIndex ||
|
|
3033
|
+
) && (r < a.spineItemIndex || Bo({ candidate: a, hrefHasAnchor: o }) || (s = a.chain));
|
|
3034
3034
|
return s;
|
|
3035
|
-
},
|
|
3036
|
-
const { href: i } = n, o =
|
|
3035
|
+
}, qo = (t, e, n) => {
|
|
3036
|
+
const { href: i } = n, o = Ho({ href: i, tocIndex: e, manifest: t });
|
|
3037
3037
|
return o ? sn(o) : void 0;
|
|
3038
|
-
},
|
|
3039
|
-
(i, o) => (i[o.id] =
|
|
3038
|
+
}, Yo = (t, e) => t ? t.spineItems.reduce(
|
|
3039
|
+
(i, o) => (i[o.id] = qo(t, e, o), i),
|
|
3040
3040
|
{}
|
|
3041
|
-
) : {},
|
|
3041
|
+
) : {}, Xo = (t, e, n) => t + e * n, Go = (t, e, n) => {
|
|
3042
3042
|
const { height: i, width: o } = n.layoutInfo, { top: r, left: s } = t.spine.getSpineItemSpineLayoutInfo(n);
|
|
3043
3043
|
return t.settings.values.computedPageTurnDirection === "vertical" ? Math.max(
|
|
3044
3044
|
0,
|
|
@@ -3053,7 +3053,7 @@ const $e = (t) => {
|
|
|
3053
3053
|
(e.x - s + t.viewport.absoluteViewport.width) / o
|
|
3054
3054
|
)
|
|
3055
3055
|
);
|
|
3056
|
-
},
|
|
3056
|
+
}, Zo = (t, e, n, i, o, r) => o.isReady$.pipe(
|
|
3057
3057
|
W(),
|
|
3058
3058
|
H(t.layoutInfo$),
|
|
3059
3059
|
y(([s, a]) => {
|
|
@@ -3063,11 +3063,11 @@ const $e = (t) => {
|
|
|
3063
3063
|
let m = (n + 1) * (p / h);
|
|
3064
3064
|
!c && o.renditionLayout === "reflowable" && !s && (m = 0);
|
|
3065
3065
|
let f = d + m;
|
|
3066
|
-
return r.renditionFlow === "scrolled-continuous" && (s ? m =
|
|
3066
|
+
return r.renditionFlow === "scrolled-continuous" && (s ? m = Go(
|
|
3067
3067
|
t,
|
|
3068
3068
|
i,
|
|
3069
3069
|
o
|
|
3070
|
-
) : m = 0, f =
|
|
3070
|
+
) : m = 0, f = Xo(
|
|
3071
3071
|
d,
|
|
3072
3072
|
p,
|
|
3073
3073
|
m
|
|
@@ -3083,10 +3083,10 @@ const $e = (t) => {
|
|
|
3083
3083
|
item: t,
|
|
3084
3084
|
nextItem: e,
|
|
3085
3085
|
previousItem: n
|
|
3086
|
-
}) => bt(t, n) || bt(t, e),
|
|
3086
|
+
}) => bt(t, n) || bt(t, e), Jo = {
|
|
3087
3087
|
tocCandidatesBySpineHref: /* @__PURE__ */ new Map(),
|
|
3088
3088
|
chaptersInfo: {}
|
|
3089
|
-
},
|
|
3089
|
+
}, Ko = ({
|
|
3090
3090
|
beginItem: t,
|
|
3091
3091
|
endItem: e,
|
|
3092
3092
|
paginationInfo: n,
|
|
@@ -3133,7 +3133,7 @@ const $e = (t) => {
|
|
|
3133
3133
|
endSpineItemReadingDirection: e?.readingDirection,
|
|
3134
3134
|
endAbsolutePageIndex: c?.absolutePageIndex
|
|
3135
3135
|
};
|
|
3136
|
-
},
|
|
3136
|
+
}, Qo = ({
|
|
3137
3137
|
items: t,
|
|
3138
3138
|
pagesState: e
|
|
3139
3139
|
}) => {
|
|
@@ -3147,47 +3147,47 @@ const $e = (t) => {
|
|
|
3147
3147
|
*/
|
|
3148
3148
|
numberOfTotalPages: e.pages.length
|
|
3149
3149
|
};
|
|
3150
|
-
},
|
|
3150
|
+
}, er = (t, e) => t.numberOfTotalPages !== e.numberOfTotalPages || t.numberOfPagesPerItems.length !== e.numberOfPagesPerItems.length ? !1 : t.numberOfPagesPerItems.every(
|
|
3151
3151
|
(n, i) => n === e.numberOfPagesPerItems[i]
|
|
3152
|
-
),
|
|
3152
|
+
), tr = ({
|
|
3153
3153
|
reader: t,
|
|
3154
3154
|
paginationInfo: e,
|
|
3155
3155
|
navigationPosition: n,
|
|
3156
3156
|
manifest: i
|
|
3157
3157
|
}) => {
|
|
3158
3158
|
const o = t.spineItemsManager.get(e.endSpineItemIndex);
|
|
3159
|
-
return o ?
|
|
3159
|
+
return o ? Zo(
|
|
3160
3160
|
t,
|
|
3161
3161
|
e.endSpineItemIndex ?? 0,
|
|
3162
3162
|
e.endPageIndexInSpineItem || 0,
|
|
3163
3163
|
n,
|
|
3164
3164
|
o,
|
|
3165
3165
|
i
|
|
3166
|
-
) :
|
|
3167
|
-
},
|
|
3166
|
+
) : P(0);
|
|
3167
|
+
}, nr = (t) => t.context.manifest$.pipe(
|
|
3168
3168
|
y((e) => {
|
|
3169
3169
|
if (!e)
|
|
3170
|
-
return
|
|
3171
|
-
const n =
|
|
3170
|
+
return Jo;
|
|
3171
|
+
const n = Oo(e.nav?.toc ?? [], e);
|
|
3172
3172
|
return {
|
|
3173
|
-
tocCandidatesBySpineHref:
|
|
3173
|
+
tocCandidatesBySpineHref: Vo({
|
|
3174
3174
|
manifest: e,
|
|
3175
3175
|
tocIndex: n
|
|
3176
3176
|
}),
|
|
3177
|
-
chaptersInfo:
|
|
3177
|
+
chaptersInfo: Yo(e, n)
|
|
3178
3178
|
};
|
|
3179
3179
|
})
|
|
3180
|
-
),
|
|
3180
|
+
), ir = (t) => ({
|
|
3181
3181
|
beginSpineItemIndex: t.beginSpineItemIndex,
|
|
3182
3182
|
beginPageIndexInSpineItem: t.beginPageIndexInSpineItem,
|
|
3183
3183
|
endSpineItemIndex: t.endSpineItemIndex,
|
|
3184
3184
|
endPageIndexInSpineItem: t.endPageIndexInSpineItem
|
|
3185
|
-
}),
|
|
3186
|
-
const e = t.pagination.state$, n = t.spine.pages.layout$, i =
|
|
3185
|
+
}), or = (t) => {
|
|
3186
|
+
const e = t.pagination.state$, n = t.spine.pages.layout$, i = nr(t).pipe(
|
|
3187
3187
|
Z({ bufferSize: 1, refCount: !0 })
|
|
3188
3188
|
), o = e.pipe(
|
|
3189
|
-
y(
|
|
3190
|
-
|
|
3189
|
+
y(ir),
|
|
3190
|
+
E(U)
|
|
3191
3191
|
), r = j([
|
|
3192
3192
|
o,
|
|
3193
3193
|
i,
|
|
@@ -3196,7 +3196,7 @@ const $e = (t) => {
|
|
|
3196
3196
|
]).pipe(
|
|
3197
3197
|
y(([l, g, h, p]) => {
|
|
3198
3198
|
const m = l.beginSpineItemIndex !== void 0 ? p[l.beginSpineItemIndex] : void 0, f = l.endSpineItemIndex !== void 0 ? p[l.endSpineItemIndex] : void 0;
|
|
3199
|
-
return
|
|
3199
|
+
return Ko({
|
|
3200
3200
|
beginItem: m,
|
|
3201
3201
|
endItem: f,
|
|
3202
3202
|
paginationInfo: l,
|
|
@@ -3208,15 +3208,15 @@ const $e = (t) => {
|
|
|
3208
3208
|
Z({ bufferSize: 1, refCount: !0 })
|
|
3209
3209
|
), s = t.settings.watch(["computedSpreadMode"]).pipe(
|
|
3210
3210
|
y((l) => l.computedSpreadMode ?? !1),
|
|
3211
|
-
|
|
3211
|
+
E()
|
|
3212
3212
|
), a = j([
|
|
3213
3213
|
n,
|
|
3214
3214
|
t.spineItemsManager.items$
|
|
3215
3215
|
]).pipe(
|
|
3216
3216
|
y(
|
|
3217
|
-
([l, g]) =>
|
|
3217
|
+
([l, g]) => Qo({ items: g, pagesState: l })
|
|
3218
3218
|
),
|
|
3219
|
-
|
|
3219
|
+
E(er)
|
|
3220
3220
|
), c = j([
|
|
3221
3221
|
e,
|
|
3222
3222
|
s,
|
|
@@ -3231,15 +3231,15 @@ const $e = (t) => {
|
|
|
3231
3231
|
}))
|
|
3232
3232
|
), u = nn(t.navigation).pipe(
|
|
3233
3233
|
y(({ position: l }) => l),
|
|
3234
|
-
|
|
3234
|
+
E(U)
|
|
3235
3235
|
), d = j([
|
|
3236
3236
|
e,
|
|
3237
3237
|
t.layout$,
|
|
3238
3238
|
u,
|
|
3239
3239
|
t.context.manifest$
|
|
3240
3240
|
]).pipe(
|
|
3241
|
-
|
|
3242
|
-
([l, g, h, p]) =>
|
|
3241
|
+
$(
|
|
3242
|
+
([l, g, h, p]) => tr({
|
|
3243
3243
|
reader: t,
|
|
3244
3244
|
paginationInfo: l,
|
|
3245
3245
|
navigationPosition: h,
|
|
@@ -3261,10 +3261,10 @@ const $e = (t) => {
|
|
|
3261
3261
|
...l,
|
|
3262
3262
|
...g
|
|
3263
3263
|
})),
|
|
3264
|
-
|
|
3264
|
+
E(U),
|
|
3265
3265
|
An(5)
|
|
3266
3266
|
);
|
|
3267
|
-
},
|
|
3267
|
+
}, rr = (t) => (e) => {
|
|
3268
3268
|
const n = t(e), i = new Q({
|
|
3269
3269
|
...n.pagination.state,
|
|
3270
3270
|
beginChapterInfo: void 0,
|
|
@@ -3282,7 +3282,7 @@ const $e = (t) => {
|
|
|
3282
3282
|
endHasAdjacentSpreadPage: !1,
|
|
3283
3283
|
endSpineItemReadingDirection: void 0,
|
|
3284
3284
|
percentageEstimateOfBook: 0
|
|
3285
|
-
}), o = new
|
|
3285
|
+
}), o = new Fo(n), r = or(n).pipe(F((s) => N.log("Pagination", s))).subscribe(i);
|
|
3286
3286
|
return {
|
|
3287
3287
|
...n,
|
|
3288
3288
|
locateResource: o.locateResource.bind(o),
|
|
@@ -3299,7 +3299,7 @@ const $e = (t) => {
|
|
|
3299
3299
|
}
|
|
3300
3300
|
}
|
|
3301
3301
|
};
|
|
3302
|
-
},
|
|
3302
|
+
}, sr = (t) => ({
|
|
3303
3303
|
put: (r, s) => new Promise((a, c) => {
|
|
3304
3304
|
const u = t.transaction(["store"], "readwrite");
|
|
3305
3305
|
u.onerror = (g) => {
|
|
@@ -3351,16 +3351,16 @@ const $e = (t) => {
|
|
|
3351
3351
|
a(l);
|
|
3352
3352
|
};
|
|
3353
3353
|
})
|
|
3354
|
-
}),
|
|
3354
|
+
}), We = async (t) => new Promise((e, n) => {
|
|
3355
3355
|
const i = window.indexedDB.open(t);
|
|
3356
3356
|
i.onerror = (o) => {
|
|
3357
3357
|
n(o);
|
|
3358
3358
|
}, i.onsuccess = () => {
|
|
3359
|
-
e(
|
|
3359
|
+
e(sr(i.result));
|
|
3360
3360
|
}, i.onupgradeneeded = () => {
|
|
3361
3361
|
i.result.createObjectStore("store");
|
|
3362
3362
|
};
|
|
3363
|
-
}),
|
|
3363
|
+
}), ar = (t) => {
|
|
3364
3364
|
let e = Date.now().toString();
|
|
3365
3365
|
const n = new k(), i = (c) => {
|
|
3366
3366
|
if (typeof c == "string" || typeof c == "object") {
|
|
@@ -3371,7 +3371,7 @@ const $e = (t) => {
|
|
|
3371
3371
|
}, o = async (c, u) => {
|
|
3372
3372
|
const d = i(c);
|
|
3373
3373
|
if (!d) return new Response("Item not found", { status: 404 });
|
|
3374
|
-
const g = await (await
|
|
3374
|
+
const g = await (await We("prose-reader")).get(`${e}_${d.id}`);
|
|
3375
3375
|
if (g)
|
|
3376
3376
|
return new Response(g, { status: 200 });
|
|
3377
3377
|
const h = u && await u(d) || await fetch(d.href);
|
|
@@ -3380,10 +3380,10 @@ const $e = (t) => {
|
|
|
3380
3380
|
n.next({ id: c, data: u });
|
|
3381
3381
|
};
|
|
3382
3382
|
n.asObservable().pipe(
|
|
3383
|
-
|
|
3383
|
+
Wn(({ id: c, data: u }) => {
|
|
3384
3384
|
const d = i(c);
|
|
3385
3385
|
return d ? B(
|
|
3386
|
-
En([
|
|
3386
|
+
En([We("prose-reader"), B(u.blob())])
|
|
3387
3387
|
).pipe(
|
|
3388
3388
|
G(([l, g]) => B(l.put(`${e}_${d.id}`, g))),
|
|
3389
3389
|
ut((l) => (N.error(l), q))
|
|
@@ -3397,7 +3397,7 @@ const $e = (t) => {
|
|
|
3397
3397
|
})
|
|
3398
3398
|
);
|
|
3399
3399
|
return T(s).pipe(
|
|
3400
|
-
G(() => (N.debug("Cleanup up old cache..."), B(
|
|
3400
|
+
G(() => (N.debug("Cleanup up old cache..."), B(We("prose-reader")).pipe(
|
|
3401
3401
|
G(
|
|
3402
3402
|
(c) => B(c.keys()).pipe(
|
|
3403
3403
|
pe(
|
|
@@ -3418,8 +3418,8 @@ const $e = (t) => {
|
|
|
3418
3418
|
n.complete();
|
|
3419
3419
|
}
|
|
3420
3420
|
};
|
|
3421
|
-
},
|
|
3422
|
-
const n = t(e), i =
|
|
3421
|
+
}, cr = (t) => (e) => {
|
|
3422
|
+
const n = t(e), i = ar(n.context);
|
|
3423
3423
|
return {
|
|
3424
3424
|
...n,
|
|
3425
3425
|
// $: {
|
|
@@ -3431,7 +3431,7 @@ const $e = (t) => {
|
|
|
3431
3431
|
}
|
|
3432
3432
|
// load,
|
|
3433
3433
|
};
|
|
3434
|
-
},
|
|
3434
|
+
}, ur = (t, e) => {
|
|
3435
3435
|
const n = t.node.ownerDocument?.createRange(), i = t.node.compareDocumentPosition(e.node);
|
|
3436
3436
|
if (n) {
|
|
3437
3437
|
try {
|
|
@@ -3451,14 +3451,14 @@ const $e = (t) => {
|
|
|
3451
3451
|
}
|
|
3452
3452
|
return n;
|
|
3453
3453
|
}
|
|
3454
|
-
},
|
|
3454
|
+
}, dr = ({
|
|
3455
3455
|
selection: t,
|
|
3456
3456
|
spineItem: e
|
|
3457
3457
|
}) => {
|
|
3458
3458
|
const { anchorNode: n, anchorOffset: i, focusNode: o, focusOffset: r } = t;
|
|
3459
3459
|
if (!(!n || !o))
|
|
3460
3460
|
try {
|
|
3461
|
-
return
|
|
3461
|
+
return ur(
|
|
3462
3462
|
{ node: n, offset: i },
|
|
3463
3463
|
{ node: o, offset: r }
|
|
3464
3464
|
);
|
|
@@ -3470,7 +3470,7 @@ const $e = (t) => {
|
|
|
3470
3470
|
return;
|
|
3471
3471
|
}
|
|
3472
3472
|
};
|
|
3473
|
-
class
|
|
3473
|
+
class lr extends J {
|
|
3474
3474
|
constructor(e) {
|
|
3475
3475
|
super();
|
|
3476
3476
|
const n = e.contentDocument || e.contentWindow?.document;
|
|
@@ -3492,7 +3492,7 @@ class dr extends J {
|
|
|
3492
3492
|
(s) => Array.from(s.removedNodes).includes(e)
|
|
3493
3493
|
)
|
|
3494
3494
|
)
|
|
3495
|
-
) :
|
|
3495
|
+
) : P(null);
|
|
3496
3496
|
this.selectionChange$ = T(
|
|
3497
3497
|
K(n, "selectionchange"),
|
|
3498
3498
|
i
|
|
@@ -3501,7 +3501,7 @@ class dr extends J {
|
|
|
3501
3501
|
M(T(o, this.destroy$)),
|
|
3502
3502
|
we(null)
|
|
3503
3503
|
), this.selectionOver$ = K(n, "pointerdown").pipe(
|
|
3504
|
-
|
|
3504
|
+
$(
|
|
3505
3505
|
() => T(
|
|
3506
3506
|
K(n, "pointerup"),
|
|
3507
3507
|
K(n, "pointercancel"),
|
|
@@ -3512,7 +3512,7 @@ class dr extends J {
|
|
|
3512
3512
|
* The selection is still valid during the event even if it will
|
|
3513
3513
|
* be discarded. The timeout make sure to detect this edge case.
|
|
3514
3514
|
*/
|
|
3515
|
-
|
|
3515
|
+
Ae(0),
|
|
3516
3516
|
y((r) => {
|
|
3517
3517
|
const s = n.getSelection();
|
|
3518
3518
|
return s && !s.isCollapsed ? [r, s] : void 0;
|
|
@@ -3525,11 +3525,11 @@ class dr extends J {
|
|
|
3525
3525
|
}
|
|
3526
3526
|
}
|
|
3527
3527
|
}
|
|
3528
|
-
const
|
|
3529
|
-
|
|
3528
|
+
const pr = (t) => t.watch("isLoaded").pipe(
|
|
3529
|
+
$(() => {
|
|
3530
3530
|
const e = t.renderer.getDocumentFrame(), n = e?.contentDocument || e?.contentWindow?.document;
|
|
3531
3531
|
if (!e || !n) return Se;
|
|
3532
|
-
const i = new
|
|
3532
|
+
const i = new lr(e);
|
|
3533
3533
|
return T(
|
|
3534
3534
|
i.selectionChange$.pipe(
|
|
3535
3535
|
y((o) => {
|
|
@@ -3555,15 +3555,15 @@ const lr = (t) => t.watch("isLoaded").pipe(
|
|
|
3555
3555
|
})
|
|
3556
3556
|
);
|
|
3557
3557
|
}),
|
|
3558
|
-
|
|
3559
|
-
),
|
|
3558
|
+
E()
|
|
3559
|
+
), gr = (t) => (e) => {
|
|
3560
3560
|
const n = t(e);
|
|
3561
3561
|
let i;
|
|
3562
3562
|
const o = n.spineItemsManager.items$.pipe(
|
|
3563
|
-
|
|
3563
|
+
$((d) => {
|
|
3564
3564
|
const l = d.map((g) => {
|
|
3565
3565
|
const h = n.spineItemsManager.getSpineItemIndex(g) ?? 0;
|
|
3566
|
-
return
|
|
3566
|
+
return pr(g).pipe(
|
|
3567
3567
|
y((p) => {
|
|
3568
3568
|
if (p)
|
|
3569
3569
|
return {
|
|
@@ -3576,27 +3576,27 @@ const lr = (t) => t.watch("isLoaded").pipe(
|
|
|
3576
3576
|
return T(...l);
|
|
3577
3577
|
}),
|
|
3578
3578
|
Ie(void 0),
|
|
3579
|
-
|
|
3579
|
+
E(),
|
|
3580
3580
|
F((d) => {
|
|
3581
3581
|
i = d;
|
|
3582
3582
|
}),
|
|
3583
3583
|
Z({ refCount: !0, bufferSize: 1 })
|
|
3584
3584
|
), r = o, s = o.pipe(
|
|
3585
3585
|
y((d) => !!d),
|
|
3586
|
-
|
|
3586
|
+
E(),
|
|
3587
3587
|
L((d) => d),
|
|
3588
|
-
|
|
3588
|
+
R()
|
|
3589
3589
|
), a = s.pipe(
|
|
3590
|
-
|
|
3591
|
-
|
|
3590
|
+
$(() => r),
|
|
3591
|
+
E(),
|
|
3592
3592
|
L((d) => !d),
|
|
3593
|
-
|
|
3593
|
+
R()
|
|
3594
3594
|
), c = o.pipe(
|
|
3595
3595
|
L((d) => d?.type === "over"),
|
|
3596
|
-
|
|
3596
|
+
R()
|
|
3597
3597
|
), u = n.context.watch("rootElement").pipe(
|
|
3598
3598
|
L(ne),
|
|
3599
|
-
|
|
3599
|
+
$((d) => K(d, "pointerdown")),
|
|
3600
3600
|
H(r),
|
|
3601
3601
|
y(([, d]) => d),
|
|
3602
3602
|
Ie(void 0),
|
|
@@ -3611,7 +3611,7 @@ const lr = (t) => t.watch("isLoaded").pipe(
|
|
|
3611
3611
|
selectionOver$: c,
|
|
3612
3612
|
lastSelectionOnPointerdown$: u,
|
|
3613
3613
|
getSelection: () => i,
|
|
3614
|
-
createOrderedRangeFromSelection:
|
|
3614
|
+
createOrderedRangeFromSelection: dr
|
|
3615
3615
|
}
|
|
3616
3616
|
};
|
|
3617
3617
|
}, wt = [
|
|
@@ -3629,7 +3629,7 @@ const lr = (t) => t.watch("isLoaded").pipe(
|
|
|
3629
3629
|
backgroundColor: "#191717",
|
|
3630
3630
|
foregroundColor: "#f1ebeb"
|
|
3631
3631
|
}
|
|
3632
|
-
],
|
|
3632
|
+
], hr = (t) => (e) => {
|
|
3633
3633
|
const n = t(e), i = new Q(
|
|
3634
3634
|
e.theme ?? "bright"
|
|
3635
3635
|
), o = () => {
|
|
@@ -3695,7 +3695,7 @@ const lr = (t) => t.watch("isLoaded").pipe(
|
|
|
3695
3695
|
}
|
|
3696
3696
|
}
|
|
3697
3697
|
};
|
|
3698
|
-
},
|
|
3698
|
+
}, mr = (t) => (e) => {
|
|
3699
3699
|
const n = t(e);
|
|
3700
3700
|
return {
|
|
3701
3701
|
...n,
|
|
@@ -3709,7 +3709,7 @@ const lr = (t) => t.watch("isLoaded").pipe(
|
|
|
3709
3709
|
};
|
|
3710
3710
|
};
|
|
3711
3711
|
navigator.userAgent.indexOf("") > -1 && navigator.userAgent.indexOf("Chrome") <= -1;
|
|
3712
|
-
const
|
|
3712
|
+
const fr = (t) => (e) => t(e), xt = (t, e, n) => {
|
|
3713
3713
|
const { clientWidth: i, clientHeight: o } = n.value.element, r = {
|
|
3714
3714
|
maxX: 0,
|
|
3715
3715
|
minX: i * (1 - e),
|
|
@@ -3720,7 +3720,7 @@ const mr = (t) => (e) => t(e), xt = (t, e, n) => {
|
|
|
3720
3720
|
x: Math.min(Math.max(t.x, r.minX), r.maxX),
|
|
3721
3721
|
y: Math.min(Math.max(t.y, r.minY), r.maxY)
|
|
3722
3722
|
};
|
|
3723
|
-
},
|
|
3723
|
+
}, yr = (t, e, n) => {
|
|
3724
3724
|
w(n.style, "transform-origin", "0 0");
|
|
3725
3725
|
const i = `translate3d(${e.x}px, ${e.y}px, 0px)`, o = `scale(${t})`;
|
|
3726
3726
|
w(
|
|
@@ -3728,7 +3728,7 @@ const mr = (t) => (e) => t(e), xt = (t, e, n) => {
|
|
|
3728
3728
|
"transform",
|
|
3729
3729
|
`${i} ${o}`
|
|
3730
3730
|
);
|
|
3731
|
-
},
|
|
3731
|
+
}, Sr = (t, e, n, i) => {
|
|
3732
3732
|
const o = e / t, r = n.clientWidth, s = n.clientHeight, a = r / 2 - i.x, c = s / 2 - i.y;
|
|
3733
3733
|
return {
|
|
3734
3734
|
x: i.x + a * (1 - o),
|
|
@@ -3742,12 +3742,12 @@ class an {
|
|
|
3742
3742
|
}
|
|
3743
3743
|
class Pt extends an {
|
|
3744
3744
|
}
|
|
3745
|
-
class
|
|
3745
|
+
class Ir extends an {
|
|
3746
3746
|
constructor() {
|
|
3747
3747
|
super(...arguments), this.__symbol = /* @__PURE__ */ Symbol("UnboundScrollPosition");
|
|
3748
3748
|
}
|
|
3749
3749
|
}
|
|
3750
|
-
class
|
|
3750
|
+
class br extends oe {
|
|
3751
3751
|
constructor(e, n, i, o, r) {
|
|
3752
3752
|
super({
|
|
3753
3753
|
element: void 0
|
|
@@ -3759,7 +3759,7 @@ class Ir extends oe {
|
|
|
3759
3759
|
left: h.x,
|
|
3760
3760
|
top: h.y,
|
|
3761
3761
|
behavior: "instant"
|
|
3762
|
-
}),
|
|
3762
|
+
}), $e(1).pipe(
|
|
3763
3763
|
F(() => {
|
|
3764
3764
|
this.scrollingSubject.next(!1);
|
|
3765
3765
|
}),
|
|
@@ -3771,7 +3771,7 @@ class Ir extends oe {
|
|
|
3771
3771
|
F(({ rootElement: l }) => {
|
|
3772
3772
|
if (!l) return;
|
|
3773
3773
|
const g = document.createElement("div");
|
|
3774
|
-
g.setAttribute(`data-${
|
|
3774
|
+
g.setAttribute(`data-${Ki}`, ""), g.appendChild(this.viewport.value.element), l.appendChild(g), this.update({ element: g });
|
|
3775
3775
|
})
|
|
3776
3776
|
), a = j([
|
|
3777
3777
|
n.watch(["computedPageTurnMode"]),
|
|
@@ -3787,21 +3787,21 @@ class Ir extends oe {
|
|
|
3787
3787
|
const u = T(
|
|
3788
3788
|
o.element$.pipe(
|
|
3789
3789
|
L(ne),
|
|
3790
|
-
|
|
3790
|
+
$((l) => st(l))
|
|
3791
3791
|
),
|
|
3792
3792
|
o.element$.pipe(
|
|
3793
3793
|
L(ne),
|
|
3794
|
-
|
|
3794
|
+
$((l) => K(l, "scroll"))
|
|
3795
3795
|
),
|
|
3796
3796
|
o.spineItemsObserver.itemResize$
|
|
3797
3797
|
).pipe(
|
|
3798
|
-
|
|
3799
|
-
() =>
|
|
3798
|
+
$(
|
|
3799
|
+
() => $e(10).pipe(
|
|
3800
3800
|
y(() => !1),
|
|
3801
3801
|
Ie(!0)
|
|
3802
3802
|
)
|
|
3803
3803
|
),
|
|
3804
|
-
|
|
3804
|
+
E(),
|
|
3805
3805
|
Ie(!1)
|
|
3806
3806
|
), d = j([
|
|
3807
3807
|
u,
|
|
@@ -3814,9 +3814,9 @@ class Ir extends oe {
|
|
|
3814
3814
|
);
|
|
3815
3815
|
this.userScroll$ = this.watch("element").pipe(
|
|
3816
3816
|
L(ne),
|
|
3817
|
-
|
|
3817
|
+
$(
|
|
3818
3818
|
(l) => n.watch(["computedPageTurnMode"]).pipe(
|
|
3819
|
-
|
|
3819
|
+
$(
|
|
3820
3820
|
({ computedPageTurnMode: g }) => g === "controlled" ? Se : K(l, "scroll").pipe(
|
|
3821
3821
|
H(d),
|
|
3822
3822
|
L(
|
|
@@ -3827,7 +3827,7 @@ class Ir extends oe {
|
|
|
3827
3827
|
)
|
|
3828
3828
|
)
|
|
3829
3829
|
),
|
|
3830
|
-
|
|
3830
|
+
R()
|
|
3831
3831
|
), T(
|
|
3832
3832
|
s,
|
|
3833
3833
|
a,
|
|
@@ -3842,7 +3842,7 @@ class Ir extends oe {
|
|
|
3842
3842
|
}
|
|
3843
3843
|
fromScrollPosition(e) {
|
|
3844
3844
|
const n = this.viewport.scaleFactor;
|
|
3845
|
-
return new
|
|
3845
|
+
return new O({
|
|
3846
3846
|
x: e.x / n,
|
|
3847
3847
|
y: e.y / n
|
|
3848
3848
|
});
|
|
@@ -3862,15 +3862,15 @@ class Ir extends oe {
|
|
|
3862
3862
|
});
|
|
3863
3863
|
}
|
|
3864
3864
|
}
|
|
3865
|
-
const
|
|
3865
|
+
const vr = (t, e, n, i, o) => {
|
|
3866
3866
|
const r = t.clientWidth, s = t.clientHeight, a = t.scrollLeft, c = t.scrollTop, u = a + r / 2 - i, d = c + s / 2 - o, l = n / e, g = u * l, h = d * l, p = g - r / 2 + i, m = h - s / 2 + o;
|
|
3867
|
-
return new
|
|
3867
|
+
return new Ir({
|
|
3868
3868
|
x: p,
|
|
3869
3869
|
y: m
|
|
3870
3870
|
});
|
|
3871
|
-
},
|
|
3872
|
-
const n = e.viewport, i = e.navigation.scrollNavigationController, o = n.value.element, r = i.value.element, s = i.value.element, a = Math.round(n.scaleFactor * 100) / 100, c = o.offsetLeft, u = o.offsetTop, d =
|
|
3873
|
-
r ??
|
|
3871
|
+
}, wr = (t, e) => {
|
|
3872
|
+
const n = e.viewport, i = e.navigation.scrollNavigationController, o = n.value.element, r = i.value.element, s = i.value.element, a = Math.round(n.scaleFactor * 100) / 100, c = o.offsetLeft, u = o.offsetTop, d = vr(
|
|
3873
|
+
r ?? ni(),
|
|
3874
3874
|
a,
|
|
3875
3875
|
t,
|
|
3876
3876
|
c,
|
|
@@ -3895,8 +3895,8 @@ const br = (t, e, n, i, o) => {
|
|
|
3895
3895
|
e.navigation.navigate({
|
|
3896
3896
|
position: g
|
|
3897
3897
|
});
|
|
3898
|
-
},
|
|
3899
|
-
class
|
|
3898
|
+
}, Me = 200;
|
|
3899
|
+
class xr extends oe {
|
|
3900
3900
|
constructor(e) {
|
|
3901
3901
|
super({
|
|
3902
3902
|
isZooming: !1,
|
|
@@ -3904,7 +3904,7 @@ class wr extends oe {
|
|
|
3904
3904
|
currentPosition: { x: 0, y: 0 }
|
|
3905
3905
|
}), this.reader = e, this.enterSubject = new k(), this.exitSubject = new k();
|
|
3906
3906
|
const n = this.enterSubject.pipe(
|
|
3907
|
-
|
|
3907
|
+
$((o) => {
|
|
3908
3908
|
const { scale: r = 1, animate: s = !1 } = o ?? {}, a = this.reader.viewport.value.element;
|
|
3909
3909
|
te(
|
|
3910
3910
|
this.viewport.element,
|
|
@@ -3919,19 +3919,19 @@ class wr extends oe {
|
|
|
3919
3919
|
), s && this.isControlled && w(
|
|
3920
3920
|
a.style,
|
|
3921
3921
|
"transition",
|
|
3922
|
-
`transform ${
|
|
3922
|
+
`transform ${Me}ms`
|
|
3923
3923
|
), this.mergeCompare({
|
|
3924
3924
|
isZooming: !0,
|
|
3925
3925
|
currentScale: 1,
|
|
3926
3926
|
currentPosition: { x: 0, y: 0 }
|
|
3927
|
-
}), this.updateZoom(r), r !== 1 && this.isControlled ?
|
|
3927
|
+
}), this.updateZoom(r), r !== 1 && this.isControlled ? $e(o?.animate ? Me : 0).pipe(
|
|
3928
3928
|
F(() => {
|
|
3929
3929
|
this.reader.layout();
|
|
3930
3930
|
})
|
|
3931
3931
|
) : q;
|
|
3932
3932
|
})
|
|
3933
3933
|
), i = this.exitSubject.pipe(
|
|
3934
|
-
|
|
3934
|
+
$((o) => {
|
|
3935
3935
|
const r = this.reader.viewport.value.element;
|
|
3936
3936
|
te(
|
|
3937
3937
|
this.viewport.element,
|
|
@@ -3949,10 +3949,10 @@ class wr extends oe {
|
|
|
3949
3949
|
)), o?.animate && this.isControlled && w(
|
|
3950
3950
|
r.style,
|
|
3951
3951
|
"transition",
|
|
3952
|
-
`transform ${
|
|
3952
|
+
`transform ${Me}ms`
|
|
3953
3953
|
), this.updateZoom(1, { x: 0, y: 0 }), ce(r.style, "transform"), this.mergeCompare({
|
|
3954
3954
|
isZooming: !1
|
|
3955
|
-
}),
|
|
3955
|
+
}), $e(o?.animate ? Me : 0).pipe(
|
|
3956
3956
|
F(() => {
|
|
3957
3957
|
const a = this.reader.viewport.value.element;
|
|
3958
3958
|
ce(
|
|
@@ -3987,7 +3987,7 @@ class wr extends oe {
|
|
|
3987
3987
|
}
|
|
3988
3988
|
updateZoom(e, n, i) {
|
|
3989
3989
|
if (this.isControlled) {
|
|
3990
|
-
const o = n ||
|
|
3990
|
+
const o = n || Sr(
|
|
3991
3991
|
this.value.currentScale,
|
|
3992
3992
|
e,
|
|
3993
3993
|
this.viewport.element,
|
|
@@ -4003,11 +4003,11 @@ class wr extends oe {
|
|
|
4003
4003
|
});
|
|
4004
4004
|
}
|
|
4005
4005
|
applyZoom(e, n) {
|
|
4006
|
-
this.isControlled ?
|
|
4006
|
+
this.isControlled ? yr(
|
|
4007
4007
|
e,
|
|
4008
4008
|
n,
|
|
4009
4009
|
this.viewport.element
|
|
4010
|
-
) :
|
|
4010
|
+
) : wr(e, this.reader), this.reader.viewport.layout();
|
|
4011
4011
|
}
|
|
4012
4012
|
get isControlled() {
|
|
4013
4013
|
return this.reader.settings.values.computedPageTurnMode === "controlled";
|
|
@@ -4019,8 +4019,8 @@ class wr extends oe {
|
|
|
4019
4019
|
return this.reader.viewport.value;
|
|
4020
4020
|
}
|
|
4021
4021
|
}
|
|
4022
|
-
const
|
|
4023
|
-
const n = t(e), i = new
|
|
4022
|
+
const Pr = (t) => (e) => {
|
|
4023
|
+
const n = t(e), i = new xr(n), o = () => {
|
|
4024
4024
|
i.destroy(), n.destroy();
|
|
4025
4025
|
}, r = i;
|
|
4026
4026
|
return {
|
|
@@ -4037,7 +4037,7 @@ const xr = (t) => (e) => {
|
|
|
4037
4037
|
}
|
|
4038
4038
|
}
|
|
4039
4039
|
};
|
|
4040
|
-
}, cn = (t) =>
|
|
4040
|
+
}, cn = (t) => qe({
|
|
4041
4041
|
spineIndex: t.index,
|
|
4042
4042
|
spineId: t.id
|
|
4043
4043
|
}), un = ({
|
|
@@ -4046,7 +4046,7 @@ const xr = (t) => (e) => {
|
|
|
4046
4046
|
item: n
|
|
4047
4047
|
}) => {
|
|
4048
4048
|
const i = "ownerDocument" in t ? t.ownerDocument : t.startContainer.ownerDocument;
|
|
4049
|
-
return !i?.documentElement || t === i ? cn(n) :
|
|
4049
|
+
return !i?.documentElement || t === i ? cn(n) : ri(t) ? qe({
|
|
4050
4050
|
start: {
|
|
4051
4051
|
node: t.startContainer,
|
|
4052
4052
|
offset: t.startOffset,
|
|
@@ -4059,33 +4059,33 @@ const xr = (t) => (e) => {
|
|
|
4059
4059
|
spineIndex: n.index,
|
|
4060
4060
|
spineId: n.id
|
|
4061
4061
|
}
|
|
4062
|
-
}) :
|
|
4062
|
+
}) : qe({
|
|
4063
4063
|
node: t,
|
|
4064
4064
|
offset: e,
|
|
4065
4065
|
spineIndex: n.index,
|
|
4066
4066
|
spineId: n.id
|
|
4067
4067
|
});
|
|
4068
|
-
},
|
|
4068
|
+
}, $r = ({
|
|
4069
4069
|
spineItem: t,
|
|
4070
4070
|
pageNode: e
|
|
4071
4071
|
}) => un({
|
|
4072
4072
|
nodeOrRange: e.node,
|
|
4073
4073
|
offset: e.offset,
|
|
4074
4074
|
item: t
|
|
4075
|
-
}).trim(),
|
|
4075
|
+
}).trim(), Tr = (t, e) => un({
|
|
4076
4076
|
nodeOrRange: t,
|
|
4077
4077
|
item: e
|
|
4078
|
-
}),
|
|
4078
|
+
}), Ks = (t) => t.index.toString(), $t = (t) => t[0]?.index === 6 && t.length > 1, Cr = (t) => {
|
|
4079
4079
|
const e = Ut(t);
|
|
4080
|
-
return
|
|
4081
|
-
},
|
|
4082
|
-
const e = Ut(t), r = ((
|
|
4080
|
+
return Bn(e);
|
|
4081
|
+
}, Fr = (t) => Array.isArray(t) ? t[0] && $t(t[0]) ? t[0] : void 0 : t.parent[0] && $t(t.parent[0]) ? t.parent[0] : void 0, dn = (t) => {
|
|
4082
|
+
const e = Ut(t), r = ((Fr(e) ?? [])[1]?.index ?? 2) / 2 - 1, s = Hn(e), a = s ? e.end.at(-1)?.at(-1)?.offset : e.at(-1)?.at(-1)?.offset;
|
|
4083
4083
|
return {
|
|
4084
4084
|
isCfiRange: s,
|
|
4085
4085
|
itemIndex: r,
|
|
4086
4086
|
offset: a ?? 0
|
|
4087
4087
|
};
|
|
4088
|
-
},
|
|
4088
|
+
}, Mr = ({
|
|
4089
4089
|
cfi: t,
|
|
4090
4090
|
spineItemsManager: e
|
|
4091
4091
|
}) => {
|
|
@@ -4101,7 +4101,7 @@ const xr = (t) => (e) => {
|
|
|
4101
4101
|
const s = r.contentWindow?.document;
|
|
4102
4102
|
if (s)
|
|
4103
4103
|
try {
|
|
4104
|
-
const a =
|
|
4104
|
+
const a = qn(t, s, {
|
|
4105
4105
|
throwOnError: !0
|
|
4106
4106
|
});
|
|
4107
4107
|
return {
|
|
@@ -4129,7 +4129,7 @@ const xr = (t) => (e) => {
|
|
|
4129
4129
|
node: null
|
|
4130
4130
|
};
|
|
4131
4131
|
};
|
|
4132
|
-
class
|
|
4132
|
+
class Lr {
|
|
4133
4133
|
constructor(e, n) {
|
|
4134
4134
|
this.hookManager = e, this.spineItemsManager = n, this.transformForResolve = (i) => {
|
|
4135
4135
|
const { finalParams: o } = this.hookManager.executeSequential(
|
|
@@ -4144,19 +4144,19 @@ class Mr {
|
|
|
4144
4144
|
const { itemIndex: o } = this.parseCfi(i);
|
|
4145
4145
|
if (o !== void 0)
|
|
4146
4146
|
return this.spineItemsManager.get(o);
|
|
4147
|
-
}, this.isRootCfi = (i) =>
|
|
4147
|
+
}, this.isRootCfi = (i) => Cr(i), this.generateRootCfi = (i) => this.transformGeneratedCfi({
|
|
4148
4148
|
cfi: cn(i),
|
|
4149
4149
|
spineItem: i
|
|
4150
4150
|
}), this.generateCfiForSpineItemPage = ({
|
|
4151
4151
|
spineItem: i,
|
|
4152
4152
|
pageNode: o
|
|
4153
4153
|
}) => this.transformGeneratedCfi({
|
|
4154
|
-
cfi:
|
|
4154
|
+
cfi: $r({ spineItem: i, pageNode: o }),
|
|
4155
4155
|
spineItem: i
|
|
4156
4156
|
}), this.generateCfiFromRange = (i, o) => this.transformGeneratedCfi({
|
|
4157
|
-
cfi:
|
|
4157
|
+
cfi: Tr(i, o),
|
|
4158
4158
|
spineItem: o
|
|
4159
|
-
}), this.resolveCfi = (i) =>
|
|
4159
|
+
}), this.resolveCfi = (i) => Mr({
|
|
4160
4160
|
...i,
|
|
4161
4161
|
cfi: this.transformForResolve(i.cfi),
|
|
4162
4162
|
spineItemsManager: this.spineItemsManager
|
|
@@ -4177,23 +4177,23 @@ class Mr {
|
|
|
4177
4177
|
const ln = (t) => t?.spineItems.every(
|
|
4178
4178
|
(e) => (e.renditionLayout ?? t.renditionLayout) === "pre-paginated"
|
|
4179
4179
|
);
|
|
4180
|
-
class
|
|
4180
|
+
class Nr {
|
|
4181
4181
|
constructor() {
|
|
4182
|
-
this.navigationSubject = new
|
|
4182
|
+
this.navigationSubject = new ke(1), this.positionSubject = new ke(1), this.viewportStateSubject = new Q("free"), this.paginationSubject = new ke(1), this.pagination$ = this.paginationSubject.asObservable(), this.viewportState$ = this.viewportStateSubject.asObservable(), this.viewportFree$ = this.viewportState$.pipe(
|
|
4183
4183
|
L((e) => e === "free")
|
|
4184
4184
|
), this.viewportBusy$ = this.viewportState$.pipe(
|
|
4185
4185
|
L((e) => e === "busy")
|
|
4186
4186
|
), this.navigation$ = this.navigationSubject.asObservable(), this.position$ = this.positionSubject.asObservable();
|
|
4187
4187
|
}
|
|
4188
4188
|
}
|
|
4189
|
-
class
|
|
4189
|
+
class Ar extends oe {
|
|
4190
4190
|
constructor() {
|
|
4191
4191
|
super({
|
|
4192
4192
|
assumedRenditionLayout: "reflowable"
|
|
4193
|
-
}), this.bridgeEvent = new
|
|
4193
|
+
}), this.bridgeEvent = new Nr(), this.manifest$ = this.pipe(
|
|
4194
4194
|
pe((e) => e.manifest),
|
|
4195
4195
|
fe(ne),
|
|
4196
|
-
|
|
4196
|
+
Oe()
|
|
4197
4197
|
), this.isRTL = () => this.value.manifest?.readingDirection === "rtl";
|
|
4198
4198
|
}
|
|
4199
4199
|
update(e) {
|
|
@@ -4214,7 +4214,7 @@ class Nr extends oe {
|
|
|
4214
4214
|
return this.manifest?.readingDirection;
|
|
4215
4215
|
}
|
|
4216
4216
|
}
|
|
4217
|
-
class
|
|
4217
|
+
class Er extends oe {
|
|
4218
4218
|
constructor(e, n) {
|
|
4219
4219
|
super({
|
|
4220
4220
|
supportedPageTurnAnimation: ["fade", "none", "slide"],
|
|
@@ -4231,7 +4231,7 @@ class Ar extends oe {
|
|
|
4231
4231
|
renditionLayout: i?.renditionLayout,
|
|
4232
4232
|
computedPageTurnMode: r
|
|
4233
4233
|
})),
|
|
4234
|
-
|
|
4234
|
+
E(U),
|
|
4235
4235
|
y(
|
|
4236
4236
|
({
|
|
4237
4237
|
hasVerticalWriting: i,
|
|
@@ -4249,7 +4249,7 @@ class Ar extends oe {
|
|
|
4249
4249
|
).subscribe(this.next.bind(this));
|
|
4250
4250
|
}
|
|
4251
4251
|
}
|
|
4252
|
-
class
|
|
4252
|
+
class Rr {
|
|
4253
4253
|
constructor() {
|
|
4254
4254
|
this._hooks = [], this._hookExecutions = [];
|
|
4255
4255
|
}
|
|
@@ -4300,7 +4300,7 @@ class Er {
|
|
|
4300
4300
|
id: n,
|
|
4301
4301
|
ref: d,
|
|
4302
4302
|
abortController: l,
|
|
4303
|
-
destroyFn: () => (l.abort(),
|
|
4303
|
+
destroyFn: () => (l.abort(), P(void 0))
|
|
4304
4304
|
};
|
|
4305
4305
|
});
|
|
4306
4306
|
this._hookExecutions.push(...s);
|
|
@@ -4381,17 +4381,17 @@ class Er {
|
|
|
4381
4381
|
return j(r);
|
|
4382
4382
|
}
|
|
4383
4383
|
}
|
|
4384
|
-
const
|
|
4384
|
+
const Dr = "[data-prose-reader-spine-item][data-is-ready=false]{pointer-events:none;user-select:none;-webkit-user-select:none}[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}[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%}", Or = (t) => ({
|
|
4385
4385
|
x: -t.x,
|
|
4386
4386
|
y: -t.y
|
|
4387
|
-
}),
|
|
4387
|
+
}), Vr = (t) => t instanceof DOMMatrix ? new V({
|
|
4388
4388
|
x: -t.e,
|
|
4389
4389
|
y: -t.f
|
|
4390
4390
|
}) : new V({
|
|
4391
4391
|
x: -t.x,
|
|
4392
4392
|
y: -t.y
|
|
4393
|
-
}),
|
|
4394
|
-
class
|
|
4393
|
+
}), kr = "navigation/ControlledNavigationController", Tt = N.namespace(kr);
|
|
4394
|
+
class jr extends J {
|
|
4395
4395
|
constructor(e, n, i, o, r) {
|
|
4396
4396
|
super(), this.settings = e, this.hookManager = n, this.context = i, this.spine = o, this.viewport = r, this.navigateSubject = new k(), this.element$ = new Q(
|
|
4397
4397
|
document.createElement("div")
|
|
@@ -4422,24 +4422,24 @@ class kr extends J {
|
|
|
4422
4422
|
F(() => {
|
|
4423
4423
|
Tt.info("layout", e.values);
|
|
4424
4424
|
}),
|
|
4425
|
-
|
|
4425
|
+
R()
|
|
4426
4426
|
), this.isNavigating$ = this.navigateSubject.pipe(
|
|
4427
|
-
|
|
4427
|
+
E((u, d) => U(u.position, d.position)),
|
|
4428
4428
|
y(({ animation: u, position: d }) => (Tt.info("Navigation requested", { animation: u, position: d }), {
|
|
4429
4429
|
type: "manualAdjust",
|
|
4430
4430
|
shouldAnimate: !(!u || u === "turn" && e.values.computedPageTurnAnimation === "none"),
|
|
4431
4431
|
animation: u,
|
|
4432
4432
|
position: d
|
|
4433
4433
|
})),
|
|
4434
|
-
|
|
4434
|
+
$((u) => {
|
|
4435
4435
|
const d = this.element$.getValue();
|
|
4436
4436
|
return w(d.style, "transition", "none"), w(d.style, "opacity", "1"), T(
|
|
4437
|
-
|
|
4438
|
-
|
|
4437
|
+
P(!0),
|
|
4438
|
+
P(null).pipe(
|
|
4439
4439
|
ye(() => {
|
|
4440
|
-
if (u?.type !== "manualAdjust") return
|
|
4440
|
+
if (u?.type !== "manualAdjust") return P(!1);
|
|
4441
4441
|
const l = u.animation === "snap" ? e.values.snapAnimationDuration : e.values.computedPageTurnAnimationDuration, g = u.animation === "snap" ? "slide" : e.values.computedPageTurnAnimation;
|
|
4442
|
-
return
|
|
4442
|
+
return P(u).pipe(
|
|
4443
4443
|
/**
|
|
4444
4444
|
* @important
|
|
4445
4445
|
* Optimization:
|
|
@@ -4448,7 +4448,7 @@ class kr extends J {
|
|
|
4448
4448
|
* anything for x ms while we effectively adjust. We want it to be immediate.
|
|
4449
4449
|
* However when user is repeatedly turning page, we can improve smoothness by delaying a bit the adjustment
|
|
4450
4450
|
*/
|
|
4451
|
-
u.shouldAnimate ?
|
|
4451
|
+
u.shouldAnimate ? Ae(1, xe) : Pe,
|
|
4452
4452
|
F((h) => {
|
|
4453
4453
|
const p = this.element$.getValue();
|
|
4454
4454
|
h.shouldAnimate ? g === "fade" ? (w(
|
|
@@ -4476,12 +4476,12 @@ class kr extends J {
|
|
|
4476
4476
|
F((h) => {
|
|
4477
4477
|
g !== "fade" && this.applyNavigationPosition(h.position);
|
|
4478
4478
|
}),
|
|
4479
|
-
u.shouldAnimate ?
|
|
4479
|
+
u.shouldAnimate ? Ae(l / 2, xe) : Pe,
|
|
4480
4480
|
F((h) => {
|
|
4481
4481
|
const p = this.element$.getValue();
|
|
4482
4482
|
g === "fade" && (this.applyNavigationPosition(h.position), w(p.style, "opacity", "1"));
|
|
4483
4483
|
}),
|
|
4484
|
-
u.shouldAnimate ?
|
|
4484
|
+
u.shouldAnimate ? Ae(l / 2, xe) : Pe,
|
|
4485
4485
|
F((h) => {
|
|
4486
4486
|
g === "fade" && this.applyNavigationPosition(h.position);
|
|
4487
4487
|
})
|
|
@@ -4504,7 +4504,7 @@ class kr extends J {
|
|
|
4504
4504
|
* for remark about flicker / fonts smoothing
|
|
4505
4505
|
*/
|
|
4506
4506
|
applyNavigationPosition(e) {
|
|
4507
|
-
const n = this.element$.getValue(), i =
|
|
4507
|
+
const n = this.element$.getValue(), i = Or(e);
|
|
4508
4508
|
w(
|
|
4509
4509
|
n.style,
|
|
4510
4510
|
"transform",
|
|
@@ -4523,10 +4523,10 @@ class kr extends J {
|
|
|
4523
4523
|
if (!i || i === "none")
|
|
4524
4524
|
return new V({ x: 0, y: 0 });
|
|
4525
4525
|
const o = new DOMMatrix(i);
|
|
4526
|
-
return
|
|
4526
|
+
return Vr(o);
|
|
4527
4527
|
}
|
|
4528
4528
|
}
|
|
4529
|
-
const
|
|
4529
|
+
const Ur = () => (t) => t.pipe(
|
|
4530
4530
|
y(({ navigation: e, pagination: n, ...i }) => ({
|
|
4531
4531
|
navigation: {
|
|
4532
4532
|
...e,
|
|
@@ -4534,7 +4534,7 @@ const jr = () => (t) => t.pipe(
|
|
|
4534
4534
|
},
|
|
4535
4535
|
...i
|
|
4536
4536
|
}))
|
|
4537
|
-
),
|
|
4537
|
+
), zr = (t, e, n) => t.bridgeEvent.pagination$.pipe(
|
|
4538
4538
|
H(e),
|
|
4539
4539
|
L(
|
|
4540
4540
|
([i, o]) => i.navigationId === o.id
|
|
@@ -4544,15 +4544,15 @@ const jr = () => (t) => t.pipe(
|
|
|
4544
4544
|
* Otherwise we might save something incomplete and thus restore
|
|
4545
4545
|
* the user to an invalid location.
|
|
4546
4546
|
*/
|
|
4547
|
-
|
|
4547
|
+
$(([i, o]) => (n.spineItemsManager.get(o.spineItem)?.isReady$.pipe(W()) ?? P(!1)).pipe(
|
|
4548
4548
|
L((s) => s),
|
|
4549
4549
|
y(() => ({
|
|
4550
4550
|
pagination: i,
|
|
4551
4551
|
navigation: o
|
|
4552
4552
|
}))
|
|
4553
4553
|
)),
|
|
4554
|
-
|
|
4555
|
-
|
|
4554
|
+
Ur(),
|
|
4555
|
+
E(
|
|
4556
4556
|
(i, o) => i.navigation.paginationBeginCfi === o.navigation.paginationBeginCfi
|
|
4557
4557
|
),
|
|
4558
4558
|
y(
|
|
@@ -4564,7 +4564,7 @@ const jr = () => (t) => t.pipe(
|
|
|
4564
4564
|
requestedPosition: i.position
|
|
4565
4565
|
})
|
|
4566
4566
|
)
|
|
4567
|
-
),
|
|
4567
|
+
), Wr = ({
|
|
4568
4568
|
navigationResolver: t,
|
|
4569
4569
|
getNavigationVisibleArea: e
|
|
4570
4570
|
}) => (n) => n.pipe(
|
|
@@ -4597,7 +4597,7 @@ const jr = () => (t) => t.pipe(
|
|
|
4597
4597
|
navigation: c
|
|
4598
4598
|
};
|
|
4599
4599
|
})
|
|
4600
|
-
),
|
|
4600
|
+
), _r = ({ navigationResolver: t }) => (e) => e.pipe(
|
|
4601
4601
|
y((n) => {
|
|
4602
4602
|
if (n.navigation.cfi) {
|
|
4603
4603
|
const i = t.getNavigationForCfi(
|
|
@@ -4614,16 +4614,16 @@ const jr = () => (t) => t.pipe(
|
|
|
4614
4614
|
}
|
|
4615
4615
|
return n;
|
|
4616
4616
|
})
|
|
4617
|
-
),
|
|
4617
|
+
), Br = ({
|
|
4618
4618
|
navigation: t,
|
|
4619
4619
|
previousNavigation: e,
|
|
4620
4620
|
settings: n
|
|
4621
|
-
}) => t.directionFromLastNavigation ? t.directionFromLastNavigation : t.url !== void 0 || t.cfi !== void 0 ? "anchor" : e.spineItem === void 0 || t.spineItem || !t.position ? "forward" : n.values.computedPageTurnDirection === "vertical" ? t.position.y > e.position.y || t.position.y === e.position.y && e.directionFromLastNavigation !== "backward" ? "forward" : "backward" : Math.abs(t.position.x) > Math.abs(e.position.x) || t.position.x === e.position.x && e.directionFromLastNavigation !== "backward" ? "forward" : "backward",
|
|
4621
|
+
}) => t.directionFromLastNavigation ? t.directionFromLastNavigation : t.url !== void 0 || t.cfi !== void 0 ? "anchor" : e.spineItem === void 0 || t.spineItem || !t.position ? "forward" : n.values.computedPageTurnDirection === "vertical" ? t.position.y > e.position.y || t.position.y === e.position.y && e.directionFromLastNavigation !== "backward" ? "forward" : "backward" : Math.abs(t.position.x) > Math.abs(e.position.x) || t.position.x === e.position.x && e.directionFromLastNavigation !== "backward" ? "forward" : "backward", Hr = ({
|
|
4622
4622
|
context: t,
|
|
4623
4623
|
settings: e
|
|
4624
4624
|
}) => (n) => n.pipe(
|
|
4625
4625
|
y(({ navigation: i, previousNavigation: o }) => {
|
|
4626
|
-
const r =
|
|
4626
|
+
const r = Br({
|
|
4627
4627
|
navigation: i,
|
|
4628
4628
|
previousNavigation: o,
|
|
4629
4629
|
settings: e
|
|
@@ -4637,7 +4637,7 @@ const jr = () => (t) => t.pipe(
|
|
|
4637
4637
|
direction: r
|
|
4638
4638
|
};
|
|
4639
4639
|
})
|
|
4640
|
-
),
|
|
4640
|
+
), qr = ({
|
|
4641
4641
|
spineItemsManager: t,
|
|
4642
4642
|
navigationResolver: e,
|
|
4643
4643
|
settings: n,
|
|
@@ -4670,7 +4670,7 @@ const jr = () => (t) => t.pipe(
|
|
|
4670
4670
|
},
|
|
4671
4671
|
...s
|
|
4672
4672
|
};
|
|
4673
|
-
const c = e.getNavigationForSpineIndexOrId(a), u = n.values.computedPageTurnMode === "scrollable" ? new
|
|
4673
|
+
const c = e.getNavigationForSpineIndexOrId(a), u = n.values.computedPageTurnMode === "scrollable" ? new O({
|
|
4674
4674
|
x: c.x + s.previousNavigation.position.x,
|
|
4675
4675
|
y: c.y
|
|
4676
4676
|
}) : e.clampPositionInSpine(
|
|
@@ -4728,8 +4728,8 @@ const jr = () => (t) => t.pipe(
|
|
|
4728
4728
|
position: C,
|
|
4729
4729
|
threshold: g,
|
|
4730
4730
|
restrictToScreen: !1
|
|
4731
|
-
}),
|
|
4732
|
-
return e.get(
|
|
4731
|
+
}), A = l === "forward" || l === "anchor" ? I?.beginIndex : I?.endIndex;
|
|
4732
|
+
return e.get(A);
|
|
4733
4733
|
}
|
|
4734
4734
|
return c && h === "scrollable" ? i.getSpineItemFromPosition(c) : e.get(0);
|
|
4735
4735
|
};
|
|
@@ -4746,11 +4746,11 @@ const jr = () => (t) => t.pipe(
|
|
|
4746
4746
|
})
|
|
4747
4747
|
);
|
|
4748
4748
|
}, Ft = ({ spine: t }) => (e) => e.pipe(
|
|
4749
|
-
|
|
4749
|
+
$(({ navigation: n, ...i }) => {
|
|
4750
4750
|
const o = t.getSpineItemSpineLayoutInfo(
|
|
4751
4751
|
n.spineItem
|
|
4752
4752
|
), r = t.spineItemsManager.get(n.spineItem);
|
|
4753
|
-
return (r?.isReady$ ??
|
|
4753
|
+
return (r?.isReady$ ?? P(!1)).pipe(
|
|
4754
4754
|
W(),
|
|
4755
4755
|
y(
|
|
4756
4756
|
(s) => ({
|
|
@@ -4768,7 +4768,7 @@ const jr = () => (t) => t.pipe(
|
|
|
4768
4768
|
)
|
|
4769
4769
|
);
|
|
4770
4770
|
})
|
|
4771
|
-
),
|
|
4771
|
+
), _e = ({
|
|
4772
4772
|
settings: t,
|
|
4773
4773
|
spineItemsManager: e,
|
|
4774
4774
|
spineLocator: n,
|
|
@@ -4812,7 +4812,7 @@ const jr = () => (t) => t.pipe(
|
|
|
4812
4812
|
...a
|
|
4813
4813
|
}))
|
|
4814
4814
|
);
|
|
4815
|
-
},
|
|
4815
|
+
}, Yr = ({ navigationResolver: t }) => (e) => e.pipe(
|
|
4816
4816
|
y((n) => {
|
|
4817
4817
|
if (n.navigation.url) {
|
|
4818
4818
|
const i = t.getNavigationForUrl(
|
|
@@ -4835,7 +4835,7 @@ class pn {
|
|
|
4835
4835
|
constructor() {
|
|
4836
4836
|
this.isLockedSubject = new Q(0), this.isLocked$ = this.isLockedSubject.pipe(
|
|
4837
4837
|
y((e) => !!e),
|
|
4838
|
-
|
|
4838
|
+
E()
|
|
4839
4839
|
);
|
|
4840
4840
|
}
|
|
4841
4841
|
lock() {
|
|
@@ -4845,7 +4845,7 @@ class pn {
|
|
|
4845
4845
|
};
|
|
4846
4846
|
}
|
|
4847
4847
|
}
|
|
4848
|
-
const
|
|
4848
|
+
const Xr = ({
|
|
4849
4849
|
spineLocator: t,
|
|
4850
4850
|
navigation: e,
|
|
4851
4851
|
navigationResolver: n,
|
|
@@ -4879,7 +4879,7 @@ const Yr = ({
|
|
|
4879
4879
|
return p;
|
|
4880
4880
|
}
|
|
4881
4881
|
if (u && g && e.directionFromLastNavigation === "backward") {
|
|
4882
|
-
const p = new
|
|
4882
|
+
const p = new D({
|
|
4883
4883
|
x: (e.positionInSpineItem?.x ?? 0) + d,
|
|
4884
4884
|
y: (e.positionInSpineItem?.y ?? 0) + l
|
|
4885
4885
|
});
|
|
@@ -4902,8 +4902,8 @@ const Yr = ({
|
|
|
4902
4902
|
}
|
|
4903
4903
|
return u ? n.getNavigationForPosition(e.position) : n.getNavigationForSpineIndexOrId(s);
|
|
4904
4904
|
})
|
|
4905
|
-
) :
|
|
4906
|
-
},
|
|
4905
|
+
) : P(new V({ x: 0, y: 0 }));
|
|
4906
|
+
}, Gr = ({
|
|
4907
4907
|
navigation: t,
|
|
4908
4908
|
spineLocator: e,
|
|
4909
4909
|
spineItemsManager: n,
|
|
@@ -4916,7 +4916,7 @@ const Yr = ({
|
|
|
4916
4916
|
const { height: c, top: u } = r.getSpineItemSpineLayoutInfo(a), d = e.isPositionWithinSpineItem(
|
|
4917
4917
|
t.position,
|
|
4918
4918
|
a
|
|
4919
|
-
), l = t.positionInSpineItem ?? new
|
|
4919
|
+
), l = t.positionInSpineItem ?? new D({
|
|
4920
4920
|
y: 0,
|
|
4921
4921
|
x: 0
|
|
4922
4922
|
});
|
|
@@ -4927,7 +4927,7 @@ const Yr = ({
|
|
|
4927
4927
|
return o.getNavigationForSpineIndexOrId(a);
|
|
4928
4928
|
if (u !== t.spineItemTop) {
|
|
4929
4929
|
const g = e.getSafeSpineItemPositionFromUnsafeSpineItemPosition(
|
|
4930
|
-
t.positionInSpineItem ?? new
|
|
4930
|
+
t.positionInSpineItem ?? new D({
|
|
4931
4931
|
x: 0,
|
|
4932
4932
|
y: 0
|
|
4933
4933
|
}),
|
|
@@ -4939,7 +4939,7 @@ const Yr = ({
|
|
|
4939
4939
|
});
|
|
4940
4940
|
}
|
|
4941
4941
|
if (u === t.spineItemTop && c !== t.spineItemHeight) {
|
|
4942
|
-
const g = (t.spineItemHeight ?? l.y) - l.y, h = new
|
|
4942
|
+
const g = (t.spineItemHeight ?? l.y) - l.y, h = new D({
|
|
4943
4943
|
y: t.directionFromLastNavigation === "backward" ? c - g : l.y,
|
|
4944
4944
|
x: t.position.x
|
|
4945
4945
|
});
|
|
@@ -4955,7 +4955,7 @@ const Yr = ({
|
|
|
4955
4955
|
}
|
|
4956
4956
|
if (!d) {
|
|
4957
4957
|
if (!(t.position.y < u)) {
|
|
4958
|
-
const m = new
|
|
4958
|
+
const m = new D({
|
|
4959
4959
|
y: c - g,
|
|
4960
4960
|
x: t.position.x
|
|
4961
4961
|
});
|
|
@@ -4972,7 +4972,7 @@ const Yr = ({
|
|
|
4972
4972
|
}
|
|
4973
4973
|
}
|
|
4974
4974
|
return t.position;
|
|
4975
|
-
},
|
|
4975
|
+
}, Zr = ({
|
|
4976
4976
|
navigation: t,
|
|
4977
4977
|
spineItemsManager: e,
|
|
4978
4978
|
settings: n,
|
|
@@ -4980,8 +4980,8 @@ const Yr = ({
|
|
|
4980
4980
|
navigationResolver: o,
|
|
4981
4981
|
spine: r,
|
|
4982
4982
|
cfiManager: s
|
|
4983
|
-
}) => n.values.computedPageTurnMode === "scrollable" ?
|
|
4984
|
-
|
|
4983
|
+
}) => n.values.computedPageTurnMode === "scrollable" ? P(
|
|
4984
|
+
Gr({
|
|
4985
4985
|
navigation: t,
|
|
4986
4986
|
spineLocator: i,
|
|
4987
4987
|
navigationResolver: o,
|
|
@@ -4989,7 +4989,7 @@ const Yr = ({
|
|
|
4989
4989
|
spineItemsManager: e,
|
|
4990
4990
|
spine: r
|
|
4991
4991
|
})
|
|
4992
|
-
) :
|
|
4992
|
+
) : Xr({
|
|
4993
4993
|
navigation: t,
|
|
4994
4994
|
spineLocator: i,
|
|
4995
4995
|
navigationResolver: o,
|
|
@@ -5003,7 +5003,7 @@ const Yr = ({
|
|
|
5003
5003
|
spine: i,
|
|
5004
5004
|
cfiManager: o
|
|
5005
5005
|
}) => (r) => r.pipe(
|
|
5006
|
-
|
|
5006
|
+
$((s) => Zr({
|
|
5007
5007
|
spineLocator: i.locator,
|
|
5008
5008
|
navigation: s.navigation,
|
|
5009
5009
|
navigationResolver: e,
|
|
@@ -5021,8 +5021,8 @@ const Yr = ({
|
|
|
5021
5021
|
}
|
|
5022
5022
|
}))
|
|
5023
5023
|
))
|
|
5024
|
-
),
|
|
5025
|
-
class
|
|
5024
|
+
), Jr = "navigation/InternalNavigator", Kr = N.namespace(Jr), Lt = (t, e) => t === e || !!t && !!e && t.x === e.x && t.y === e.y, Qr = (t, e) => t === e || !!t && !!e && t.width === e.width && t.height === e.height, es = (t, e) => t.id === e.id && Lt(t.position, e.position) && Lt(t.requestedPosition, e.requestedPosition) && Qr(t.requestedVisibleArea, e.requestedVisibleArea);
|
|
5025
|
+
class ts extends J {
|
|
5026
5026
|
constructor(e, n, i, o, r, s, a, c, u, d) {
|
|
5027
5027
|
super(), this.settings = e, this.context = n, this.userNavigation$ = i, this.getActiveNavigationModeController = o, this.navigationModeLayout$ = r, this.navigationResolver = s, this.spine = a, this.viewport = c, this.cfiManager = u, this.isUserInteractionLocked$ = d, this.navigationSubject = new Q({
|
|
5028
5028
|
animation: !1,
|
|
@@ -5035,19 +5035,19 @@ class es extends J {
|
|
|
5035
5035
|
type: "api",
|
|
5036
5036
|
id: /* @__PURE__ */ Symbol("init")
|
|
5037
5037
|
}), this.navigation$ = this.navigationSubject.pipe(
|
|
5038
|
-
y(({ position: b, id: C, requestedPosition: I, requestedVisibleArea:
|
|
5038
|
+
y(({ position: b, id: C, requestedPosition: I, requestedVisibleArea: A, meta: Y }) => ({
|
|
5039
5039
|
position: b,
|
|
5040
5040
|
id: C,
|
|
5041
5041
|
requestedPosition: I,
|
|
5042
|
-
requestedVisibleArea:
|
|
5042
|
+
requestedVisibleArea: A,
|
|
5043
5043
|
triggeredBy: Y.triggeredBy
|
|
5044
5044
|
})),
|
|
5045
|
-
|
|
5045
|
+
E(es),
|
|
5046
5046
|
Z(1)
|
|
5047
5047
|
), this.locker = new pn();
|
|
5048
5048
|
const l = () => o().getNavigationVisibleArea(), g = i.pipe(
|
|
5049
5049
|
H(this.navigationSubject),
|
|
5050
|
-
|
|
5050
|
+
Wr({
|
|
5051
5051
|
navigationResolver: s,
|
|
5052
5052
|
getNavigationVisibleArea: l
|
|
5053
5053
|
}),
|
|
@@ -5055,17 +5055,17 @@ class es extends J {
|
|
|
5055
5055
|
* Url lookup is heavier so we start with it to fill
|
|
5056
5056
|
* as much information as needed to reduce later lookup
|
|
5057
5057
|
*/
|
|
5058
|
-
|
|
5058
|
+
Yr({
|
|
5059
5059
|
navigationResolver: s
|
|
5060
5060
|
}),
|
|
5061
5061
|
/**
|
|
5062
5062
|
* Cfi lookup is heavier so we start with it to fill
|
|
5063
5063
|
* as much information as needed to reduce later lookup
|
|
5064
5064
|
*/
|
|
5065
|
-
|
|
5065
|
+
_r({
|
|
5066
5066
|
navigationResolver: s
|
|
5067
5067
|
}),
|
|
5068
|
-
|
|
5068
|
+
Hr({ context: n, settings: e }),
|
|
5069
5069
|
Ct({
|
|
5070
5070
|
cfi: u,
|
|
5071
5071
|
navigationResolver: s,
|
|
@@ -5073,7 +5073,7 @@ class es extends J {
|
|
|
5073
5073
|
spineItemsManager: a.spineItemsManager,
|
|
5074
5074
|
spineLocator: a.locator
|
|
5075
5075
|
}),
|
|
5076
|
-
|
|
5076
|
+
_e({
|
|
5077
5077
|
navigationResolver: s,
|
|
5078
5078
|
settings: e,
|
|
5079
5079
|
spineItemsManager: a.spineItemsManager,
|
|
@@ -5083,16 +5083,16 @@ class es extends J {
|
|
|
5083
5083
|
spine: a
|
|
5084
5084
|
})
|
|
5085
5085
|
).pipe(
|
|
5086
|
-
|
|
5086
|
+
qr({
|
|
5087
5087
|
navigationResolver: s,
|
|
5088
5088
|
spineItemsManager: a.spineItemsManager,
|
|
5089
5089
|
settings: e,
|
|
5090
5090
|
viewport: c
|
|
5091
5091
|
}),
|
|
5092
5092
|
H(d),
|
|
5093
|
-
|
|
5093
|
+
$(([b, C]) => {
|
|
5094
5094
|
const I = b.navigation.cfi || b.navigation.url || e.values.computedPageTurnMode === "scrollable" || C;
|
|
5095
|
-
return
|
|
5095
|
+
return P(b).pipe(
|
|
5096
5096
|
I ? Pe : Mt({
|
|
5097
5097
|
navigationResolver: s,
|
|
5098
5098
|
settings: e,
|
|
@@ -5102,18 +5102,18 @@ class es extends J {
|
|
|
5102
5102
|
})
|
|
5103
5103
|
);
|
|
5104
5104
|
}),
|
|
5105
|
-
|
|
5105
|
+
_e({
|
|
5106
5106
|
spineItemsManager: a.spineItemsManager,
|
|
5107
5107
|
spineLocator: a.locator,
|
|
5108
5108
|
settings: e,
|
|
5109
5109
|
navigationResolver: s
|
|
5110
5110
|
}),
|
|
5111
5111
|
y((b) => b.navigation),
|
|
5112
|
-
|
|
5112
|
+
R()
|
|
5113
5113
|
), h = g.pipe(
|
|
5114
5114
|
H(d),
|
|
5115
5115
|
L(([, b]) => b),
|
|
5116
|
-
|
|
5116
|
+
$(([b]) => {
|
|
5117
5117
|
const C = this.locker.lock();
|
|
5118
5118
|
return d.pipe(
|
|
5119
5119
|
L((I) => !I),
|
|
@@ -5130,13 +5130,13 @@ class es extends J {
|
|
|
5130
5130
|
M(g)
|
|
5131
5131
|
);
|
|
5132
5132
|
}),
|
|
5133
|
-
|
|
5133
|
+
R()
|
|
5134
5134
|
), p = T(
|
|
5135
5135
|
r,
|
|
5136
5136
|
a.layout$
|
|
5137
5137
|
).pipe(
|
|
5138
|
-
|
|
5139
|
-
|
|
5138
|
+
$(() => P(null).pipe(
|
|
5139
|
+
$(
|
|
5140
5140
|
() => d.pipe(
|
|
5141
5141
|
L((b) => !b),
|
|
5142
5142
|
W()
|
|
@@ -5190,15 +5190,15 @@ class es extends J {
|
|
|
5190
5190
|
Ft({
|
|
5191
5191
|
spine: a
|
|
5192
5192
|
}),
|
|
5193
|
-
|
|
5193
|
+
_e({
|
|
5194
5194
|
spineItemsManager: a.spineItemsManager,
|
|
5195
5195
|
spineLocator: a.locator,
|
|
5196
5196
|
settings: e,
|
|
5197
5197
|
navigationResolver: s
|
|
5198
5198
|
}),
|
|
5199
5199
|
y(({ navigation: b }) => b),
|
|
5200
|
-
|
|
5201
|
-
), f =
|
|
5200
|
+
R()
|
|
5201
|
+
), f = zr(
|
|
5202
5202
|
n,
|
|
5203
5203
|
this.navigationSubject,
|
|
5204
5204
|
a
|
|
@@ -5208,7 +5208,7 @@ class es extends J {
|
|
|
5208
5208
|
f
|
|
5209
5209
|
), x = (b) => b.pipe(
|
|
5210
5210
|
F(([C, I]) => {
|
|
5211
|
-
|
|
5211
|
+
Kr.info(
|
|
5212
5212
|
`navigation updated from ${C.meta.triggeredBy} of type ${C.type}`,
|
|
5213
5213
|
{
|
|
5214
5214
|
previousNavigation: I,
|
|
@@ -5218,8 +5218,8 @@ class es extends J {
|
|
|
5218
5218
|
})
|
|
5219
5219
|
), v = (b) => b.pipe(
|
|
5220
5220
|
F(([C]) => {
|
|
5221
|
-
const I = C.type === "scroll",
|
|
5222
|
-
if (I && !Y ||
|
|
5221
|
+
const I = C.type === "scroll", A = C.meta.triggeredBy === "pagination", Y = C.meta.triggeredBy === "restoration";
|
|
5222
|
+
if (I && !Y || A) return;
|
|
5223
5223
|
const X = {
|
|
5224
5224
|
position: C.position,
|
|
5225
5225
|
animation: C.animation
|
|
@@ -5247,17 +5247,17 @@ class es extends J {
|
|
|
5247
5247
|
const Re = (t, e, n) => {
|
|
5248
5248
|
const i = n - t, o = n * (e * t) / (n || 1);
|
|
5249
5249
|
return Math.max(0, Math.min(i, o));
|
|
5250
|
-
},
|
|
5251
|
-
const i =
|
|
5250
|
+
}, Ze = (t, e) => (e || 0) === 0 || (t || 0) === 0 ? 1 : Math.floor(Math.max(1, t / e)), Be = (t, e, n) => {
|
|
5251
|
+
const i = Ze(n, e), o = [...Array(i)].map((r, s) => s * e);
|
|
5252
5252
|
return t >= i * e ? o[o.length - 1] || 0 : o.find((r) => t < r + e) || 0;
|
|
5253
5253
|
}, Nt = (t, e, n) => {
|
|
5254
5254
|
const i = [...Array(n)].map((o, r) => r * e);
|
|
5255
5255
|
return t <= 0 || n === 0 ? 0 : t >= n * e ? n - 1 : i.findIndex((o) => t < o + e) ?? 0;
|
|
5256
|
-
},
|
|
5256
|
+
}, ns = ({
|
|
5257
5257
|
itemWidth: t,
|
|
5258
5258
|
itemHeight: e,
|
|
5259
5259
|
spineItemPosition: n
|
|
5260
|
-
}) => new
|
|
5260
|
+
}) => new D({
|
|
5261
5261
|
x: Math.min(t, Math.max(0, n.x)),
|
|
5262
5262
|
y: Math.min(e, Math.max(0, n.y))
|
|
5263
5263
|
}), gn = ({
|
|
@@ -5268,7 +5268,7 @@ const Re = (t, e, n) => {
|
|
|
5268
5268
|
pageHeight: o,
|
|
5269
5269
|
pageTurnDirection: r,
|
|
5270
5270
|
pageTurnMode: s
|
|
5271
|
-
}) => r === "vertical" && s === "scrollable" ? 1 : n || r === "vertical" ?
|
|
5271
|
+
}) => r === "vertical" && s === "scrollable" ? 1 : n || r === "vertical" ? Ze(t, o) : Ze(e, i), At = ({
|
|
5272
5272
|
itemWidth: t,
|
|
5273
5273
|
itemHeight: e,
|
|
5274
5274
|
position: n,
|
|
@@ -5279,7 +5279,7 @@ const Re = (t, e, n) => {
|
|
|
5279
5279
|
pageTurnMode: a,
|
|
5280
5280
|
isRTL: c
|
|
5281
5281
|
}) => {
|
|
5282
|
-
const d =
|
|
5282
|
+
const d = ns({
|
|
5283
5283
|
spineItemPosition: n,
|
|
5284
5284
|
itemHeight: e,
|
|
5285
5285
|
itemWidth: t
|
|
@@ -5296,7 +5296,7 @@ const Re = (t, e, n) => {
|
|
|
5296
5296
|
return Nt(n.y, r, l);
|
|
5297
5297
|
const g = Nt(d, o, l);
|
|
5298
5298
|
return c ? l - 1 - g : g;
|
|
5299
|
-
},
|
|
5299
|
+
}, is = ({
|
|
5300
5300
|
pageIndex: t,
|
|
5301
5301
|
itemLayout: e,
|
|
5302
5302
|
context: n,
|
|
@@ -5309,7 +5309,7 @@ const Re = (t, e, n) => {
|
|
|
5309
5309
|
t,
|
|
5310
5310
|
e.height
|
|
5311
5311
|
);
|
|
5312
|
-
return new
|
|
5312
|
+
return new D({
|
|
5313
5313
|
x: 0,
|
|
5314
5314
|
y: s
|
|
5315
5315
|
});
|
|
@@ -5319,10 +5319,10 @@ const Re = (t, e, n) => {
|
|
|
5319
5319
|
t,
|
|
5320
5320
|
e.width
|
|
5321
5321
|
);
|
|
5322
|
-
return n.isRTL() ? new
|
|
5322
|
+
return n.isRTL() ? new D({
|
|
5323
5323
|
x: e.width - r - o.pageSize.width,
|
|
5324
5324
|
y: 0
|
|
5325
|
-
}) : new
|
|
5325
|
+
}) : new D({
|
|
5326
5326
|
x: r,
|
|
5327
5327
|
y: 0
|
|
5328
5328
|
});
|
|
@@ -5333,15 +5333,15 @@ const Re = (t, e, n) => {
|
|
|
5333
5333
|
}) => {
|
|
5334
5334
|
const i = (a, c, u) => {
|
|
5335
5335
|
let d;
|
|
5336
|
-
a?.nodeName === "img" || a?.textContent === "" && a.nodeType === Node.ELEMENT_NODE ? d = a.getBoundingClientRect().x : a && (d = (a ?
|
|
5336
|
+
a?.nodeName === "img" || a?.textContent === "" && a.nodeType === Node.ELEMENT_NODE ? d = a.getBoundingClientRect().x : a && (d = (a ? Qn(a, c) : void 0)?.getBoundingClientRect().x || d);
|
|
5337
5337
|
const l = u.layoutInfo?.width || 0, g = n.pageSize.width;
|
|
5338
5338
|
if (d !== void 0) {
|
|
5339
|
-
const h =
|
|
5339
|
+
const h = Be(
|
|
5340
5340
|
d,
|
|
5341
5341
|
g,
|
|
5342
5342
|
l
|
|
5343
5343
|
);
|
|
5344
|
-
return new
|
|
5344
|
+
return new D({ x: h, y: 0 });
|
|
5345
5345
|
}
|
|
5346
5346
|
};
|
|
5347
5347
|
return {
|
|
@@ -5349,7 +5349,7 @@ const Re = (t, e, n) => {
|
|
|
5349
5349
|
getSpineItemPositionFromPageIndex: ({
|
|
5350
5350
|
pageIndex: a,
|
|
5351
5351
|
spineItem: c
|
|
5352
|
-
}) =>
|
|
5352
|
+
}) => is({
|
|
5353
5353
|
context: t,
|
|
5354
5354
|
isUsingVerticalWriting: !!c.isUsingVerticalWriting(),
|
|
5355
5355
|
itemLayout: c.layoutInfo,
|
|
@@ -5380,13 +5380,13 @@ const Re = (t, e, n) => {
|
|
|
5380
5380
|
},
|
|
5381
5381
|
getSpineItemClosestPositionFromUnsafePosition: (a, c) => {
|
|
5382
5382
|
const { width: u, height: d } = c.layoutInfo;
|
|
5383
|
-
return new
|
|
5384
|
-
x:
|
|
5383
|
+
return new D({
|
|
5384
|
+
x: Be(
|
|
5385
5385
|
a.x,
|
|
5386
5386
|
n.pageSize.width,
|
|
5387
5387
|
u
|
|
5388
5388
|
),
|
|
5389
|
-
y:
|
|
5389
|
+
y: Be(
|
|
5390
5390
|
a.y,
|
|
5391
5391
|
n.pageSize.height,
|
|
5392
5392
|
d
|
|
@@ -5401,7 +5401,7 @@ const Re = (t, e, n) => {
|
|
|
5401
5401
|
c,
|
|
5402
5402
|
l
|
|
5403
5403
|
);
|
|
5404
|
-
return new
|
|
5404
|
+
return new Ue({
|
|
5405
5405
|
x: a.x,
|
|
5406
5406
|
y: a.y - f
|
|
5407
5407
|
});
|
|
@@ -5409,18 +5409,18 @@ const Re = (t, e, n) => {
|
|
|
5409
5409
|
const m = Re(g, c, d);
|
|
5410
5410
|
if (t.isRTL()) {
|
|
5411
5411
|
const f = d - (c + 1) * g;
|
|
5412
|
-
return new
|
|
5412
|
+
return new Ue({
|
|
5413
5413
|
x: a.x - Math.max(0, f),
|
|
5414
5414
|
y: a.y
|
|
5415
5415
|
});
|
|
5416
5416
|
}
|
|
5417
|
-
return new
|
|
5417
|
+
return new Ue({
|
|
5418
5418
|
x: a.x - m,
|
|
5419
5419
|
y: a.y
|
|
5420
5420
|
});
|
|
5421
5421
|
}
|
|
5422
5422
|
};
|
|
5423
|
-
},
|
|
5423
|
+
}, os = ({
|
|
5424
5424
|
context: t,
|
|
5425
5425
|
settings: e,
|
|
5426
5426
|
viewport: n
|
|
@@ -5446,7 +5446,7 @@ const Re = (t, e, n) => {
|
|
|
5446
5446
|
c,
|
|
5447
5447
|
u,
|
|
5448
5448
|
a
|
|
5449
|
-
) || new
|
|
5449
|
+
) || new D({ x: 0, y: 0 })
|
|
5450
5450
|
};
|
|
5451
5451
|
}, mn = ({
|
|
5452
5452
|
size: t,
|
|
@@ -5487,10 +5487,10 @@ const Re = (t, e, n) => {
|
|
|
5487
5487
|
spineItemsManager: i,
|
|
5488
5488
|
spine: o
|
|
5489
5489
|
});
|
|
5490
|
-
if (!r) return new
|
|
5490
|
+
if (!r) return new O({ x: 0, y: 0 });
|
|
5491
5491
|
const s = Math.min(Math.max(r.yMin, t.y), r.yMax), a = n ? Math.max(r.xMin, Math.min(r.xMax, t.x)) : Math.min(Math.max(r.xMin, t.x), r.xMax);
|
|
5492
|
-
return new
|
|
5493
|
-
},
|
|
5492
|
+
return new O({ x: a, y: s });
|
|
5493
|
+
}, rs = ({
|
|
5494
5494
|
position: t,
|
|
5495
5495
|
size: e,
|
|
5496
5496
|
isRTL: n,
|
|
@@ -5520,8 +5520,8 @@ const Re = (t, e, n) => {
|
|
|
5520
5520
|
visibleAreaRectWidth: n
|
|
5521
5521
|
}) => {
|
|
5522
5522
|
const { x: i, y: o } = t, s = i % n !== 0 ? i - e : i;
|
|
5523
|
-
return t instanceof
|
|
5524
|
-
},
|
|
5523
|
+
return t instanceof O ? new O({ x: s, y: o }) : new V({ x: s, y: o });
|
|
5524
|
+
}, Je = ({
|
|
5525
5525
|
viewportPosition: t,
|
|
5526
5526
|
spineLocator: e,
|
|
5527
5527
|
spineItemNavigationResolver: n,
|
|
@@ -5546,7 +5546,7 @@ const Re = (t, e, n) => {
|
|
|
5546
5546
|
});
|
|
5547
5547
|
}
|
|
5548
5548
|
return new V({ x: 0, y: 0 });
|
|
5549
|
-
},
|
|
5549
|
+
}, ss = ({
|
|
5550
5550
|
pageIndex: t,
|
|
5551
5551
|
spineItemsManager: e,
|
|
5552
5552
|
spineItemId: n,
|
|
@@ -5557,7 +5557,7 @@ const Re = (t, e, n) => {
|
|
|
5557
5557
|
const s = e.get(n);
|
|
5558
5558
|
if (!s) {
|
|
5559
5559
|
const u = t * r.pageSize.width;
|
|
5560
|
-
return
|
|
5560
|
+
return Je({
|
|
5561
5561
|
viewportPosition: new V({ x: u, y: 0 }),
|
|
5562
5562
|
spineItemNavigationResolver: o,
|
|
5563
5563
|
spineLocator: i,
|
|
@@ -5576,7 +5576,7 @@ const Re = (t, e, n) => {
|
|
|
5576
5576
|
pageSizeWidth: r.pageSize.width,
|
|
5577
5577
|
visibleAreaRectWidth: r.absoluteViewport.width
|
|
5578
5578
|
});
|
|
5579
|
-
},
|
|
5579
|
+
}, as = (t, e) => {
|
|
5580
5580
|
if (e && e instanceof HTMLIFrameElement) {
|
|
5581
5581
|
const n = e.contentDocument, i = t.trim();
|
|
5582
5582
|
if (!n || i.length === 0)
|
|
@@ -5591,32 +5591,32 @@ const Re = (t, e, n) => {
|
|
|
5591
5591
|
return;
|
|
5592
5592
|
}
|
|
5593
5593
|
}
|
|
5594
|
-
},
|
|
5594
|
+
}, cs = ({
|
|
5595
5595
|
anchor: t,
|
|
5596
5596
|
spineItem: e,
|
|
5597
5597
|
spine: n
|
|
5598
5598
|
}) => {
|
|
5599
|
-
const i =
|
|
5599
|
+
const i = as(
|
|
5600
5600
|
t,
|
|
5601
5601
|
e.renderer.getDocumentFrame()
|
|
5602
5602
|
);
|
|
5603
5603
|
return i ? n.spineItemLocator.getSpineItemPositionFromNode(i, 0, e)?.x ?? 0 : 0;
|
|
5604
|
-
},
|
|
5604
|
+
}, us = ({
|
|
5605
5605
|
anchor: t,
|
|
5606
5606
|
spineItem: e,
|
|
5607
5607
|
spineLocator: n,
|
|
5608
5608
|
spine: i
|
|
5609
5609
|
}) => {
|
|
5610
|
-
const o =
|
|
5610
|
+
const o = cs({
|
|
5611
5611
|
anchor: t,
|
|
5612
5612
|
spineItem: e,
|
|
5613
5613
|
spine: i
|
|
5614
5614
|
});
|
|
5615
5615
|
return n.getSpinePositionFromSpineItemPosition({
|
|
5616
|
-
spineItemPosition: new
|
|
5616
|
+
spineItemPosition: new D({ x: o, y: 0 }),
|
|
5617
5617
|
spineItem: e
|
|
5618
5618
|
});
|
|
5619
|
-
},
|
|
5619
|
+
}, ds = ({
|
|
5620
5620
|
anchor: t,
|
|
5621
5621
|
spineItem: e,
|
|
5622
5622
|
spineLocator: n,
|
|
@@ -5624,7 +5624,7 @@ const Re = (t, e, n) => {
|
|
|
5624
5624
|
pageSizeWidth: o,
|
|
5625
5625
|
visibleAreaRectWidth: r
|
|
5626
5626
|
}) => {
|
|
5627
|
-
const s =
|
|
5627
|
+
const s = us({
|
|
5628
5628
|
anchor: t,
|
|
5629
5629
|
spineItem: e,
|
|
5630
5630
|
spineLocator: n,
|
|
@@ -5635,7 +5635,7 @@ const Re = (t, e, n) => {
|
|
|
5635
5635
|
pageSizeWidth: o,
|
|
5636
5636
|
visibleAreaRectWidth: r
|
|
5637
5637
|
});
|
|
5638
|
-
},
|
|
5638
|
+
}, ls = ({
|
|
5639
5639
|
spine: t,
|
|
5640
5640
|
spineItemsManager: e,
|
|
5641
5641
|
spineLocator: n,
|
|
@@ -5651,7 +5651,7 @@ const Re = (t, e, n) => {
|
|
|
5651
5651
|
if (u) {
|
|
5652
5652
|
const d = e.get(u.id);
|
|
5653
5653
|
if (d) {
|
|
5654
|
-
const l =
|
|
5654
|
+
const l = ds({
|
|
5655
5655
|
anchor: a.hash,
|
|
5656
5656
|
spineItem: d,
|
|
5657
5657
|
spine: t,
|
|
@@ -5674,7 +5674,7 @@ const Re = (t, e, n) => {
|
|
|
5674
5674
|
console.error(a);
|
|
5675
5675
|
return;
|
|
5676
5676
|
}
|
|
5677
|
-
},
|
|
5677
|
+
}, ps = ({
|
|
5678
5678
|
spineItem: t,
|
|
5679
5679
|
spineItemPosition: e,
|
|
5680
5680
|
spineLocator: n,
|
|
@@ -5693,7 +5693,7 @@ const Re = (t, e, n) => {
|
|
|
5693
5693
|
pageSizeWidth: o.pageSize.width,
|
|
5694
5694
|
visibleAreaRectWidth: o.absoluteViewport.width
|
|
5695
5695
|
});
|
|
5696
|
-
},
|
|
5696
|
+
}, gs = "spineNavigator", hs = ({
|
|
5697
5697
|
context: t,
|
|
5698
5698
|
spineItemsManager: e,
|
|
5699
5699
|
locator: n,
|
|
@@ -5702,13 +5702,13 @@ const Re = (t, e, n) => {
|
|
|
5702
5702
|
viewport: r,
|
|
5703
5703
|
cfi: s
|
|
5704
5704
|
}) => {
|
|
5705
|
-
const a =
|
|
5705
|
+
const a = os({
|
|
5706
5706
|
context: t,
|
|
5707
5707
|
settings: i,
|
|
5708
5708
|
viewport: r
|
|
5709
5709
|
});
|
|
5710
5710
|
return {
|
|
5711
|
-
getNavigationForUrl: (p) =>
|
|
5711
|
+
getNavigationForUrl: (p) => ls({
|
|
5712
5712
|
context: t,
|
|
5713
5713
|
spineItemsManager: e,
|
|
5714
5714
|
spineLocator: n,
|
|
@@ -5717,14 +5717,14 @@ const Re = (t, e, n) => {
|
|
|
5717
5717
|
visibleAreaRectWidth: r.absoluteViewport.width,
|
|
5718
5718
|
spine: o
|
|
5719
5719
|
}),
|
|
5720
|
-
getNavigationForSpineItemPage: (p) =>
|
|
5720
|
+
getNavigationForSpineItemPage: (p) => ss({
|
|
5721
5721
|
...p,
|
|
5722
5722
|
spineItemsManager: e,
|
|
5723
5723
|
spineItemNavigationResolver: a,
|
|
5724
5724
|
spineLocator: n,
|
|
5725
5725
|
viewport: r
|
|
5726
5726
|
}),
|
|
5727
|
-
getNavigationFromSpineItemPosition: (p) =>
|
|
5727
|
+
getNavigationFromSpineItemPosition: (p) => ps({
|
|
5728
5728
|
...p,
|
|
5729
5729
|
spineItemLocator: n.spineItemLocator,
|
|
5730
5730
|
spineLocator: n,
|
|
@@ -5739,10 +5739,10 @@ const Re = (t, e, n) => {
|
|
|
5739
5739
|
cfi: p
|
|
5740
5740
|
});
|
|
5741
5741
|
if (!S) {
|
|
5742
|
-
N.warn(
|
|
5742
|
+
N.warn(gs, `unable to detect item id from cfi ${p}`);
|
|
5743
5743
|
return;
|
|
5744
5744
|
}
|
|
5745
|
-
const x = m ? a.getNavigationFromNode(S, m, f) : new
|
|
5745
|
+
const x = m ? a.getNavigationFromNode(S, m, f) : new D({ x: 0, y: 0 }), v = n.getSpinePositionFromSpineItemPosition({
|
|
5746
5746
|
spineItemPosition: x,
|
|
5747
5747
|
spineItem: S
|
|
5748
5748
|
});
|
|
@@ -5775,7 +5775,7 @@ const Re = (t, e, n) => {
|
|
|
5775
5775
|
}
|
|
5776
5776
|
return new V({ x: 0, y: 0 });
|
|
5777
5777
|
},
|
|
5778
|
-
getNavigationForPosition: (p) =>
|
|
5778
|
+
getNavigationForPosition: (p) => Je({
|
|
5779
5779
|
viewportPosition: p,
|
|
5780
5780
|
spineItemNavigationResolver: a,
|
|
5781
5781
|
spineLocator: n,
|
|
@@ -5792,7 +5792,7 @@ const Re = (t, e, n) => {
|
|
|
5792
5792
|
spineItemsManager: e,
|
|
5793
5793
|
spine: o
|
|
5794
5794
|
});
|
|
5795
|
-
return
|
|
5795
|
+
return Je({
|
|
5796
5796
|
spineItemNavigationResolver: a,
|
|
5797
5797
|
spineLocator: n,
|
|
5798
5798
|
viewportPosition: v,
|
|
@@ -5806,7 +5806,7 @@ const Re = (t, e, n) => {
|
|
|
5806
5806
|
spineItemsManager: e,
|
|
5807
5807
|
spine: o
|
|
5808
5808
|
}),
|
|
5809
|
-
getBoundaryForPosition: (p, m = r.absoluteViewport) =>
|
|
5809
|
+
getBoundaryForPosition: (p, m = r.absoluteViewport) => rs({
|
|
5810
5810
|
position: p,
|
|
5811
5811
|
size: m,
|
|
5812
5812
|
isRTL: t.isRTL(),
|
|
@@ -5822,7 +5822,7 @@ const Re = (t, e, n) => {
|
|
|
5822
5822
|
}),
|
|
5823
5823
|
spineItemNavigator: a
|
|
5824
5824
|
};
|
|
5825
|
-
},
|
|
5825
|
+
}, ms = ({
|
|
5826
5826
|
spineItemsManager: t,
|
|
5827
5827
|
context: e,
|
|
5828
5828
|
hookManager: n,
|
|
@@ -5831,7 +5831,7 @@ const Re = (t, e, n) => {
|
|
|
5831
5831
|
viewport: r,
|
|
5832
5832
|
cfi: s
|
|
5833
5833
|
}) => {
|
|
5834
|
-
const a = new k(), c = a.asObservable(), u = new pn(), d = s, l =
|
|
5834
|
+
const a = new k(), c = a.asObservable(), u = new pn(), d = s, l = hs({
|
|
5835
5835
|
cfi: d,
|
|
5836
5836
|
context: e,
|
|
5837
5837
|
settings: o,
|
|
@@ -5839,13 +5839,13 @@ const Re = (t, e, n) => {
|
|
|
5839
5839
|
locator: i.locator,
|
|
5840
5840
|
spine: i,
|
|
5841
5841
|
viewport: r
|
|
5842
|
-
}), g = new
|
|
5842
|
+
}), g = new jr(
|
|
5843
5843
|
o,
|
|
5844
5844
|
n,
|
|
5845
5845
|
e,
|
|
5846
5846
|
i,
|
|
5847
5847
|
r
|
|
5848
|
-
), h = new
|
|
5848
|
+
), h = new br(
|
|
5849
5849
|
r,
|
|
5850
5850
|
o,
|
|
5851
5851
|
n,
|
|
@@ -5858,7 +5858,7 @@ const Re = (t, e, n) => {
|
|
|
5858
5858
|
...p.flatMap(
|
|
5859
5859
|
(I) => I.layout$ ? [I.layout$] : []
|
|
5860
5860
|
)
|
|
5861
|
-
), S = new
|
|
5861
|
+
), S = new ts(
|
|
5862
5862
|
o,
|
|
5863
5863
|
e,
|
|
5864
5864
|
c,
|
|
@@ -5874,12 +5874,12 @@ const Re = (t, e, n) => {
|
|
|
5874
5874
|
u.isLocked$,
|
|
5875
5875
|
S.locker.isLocked$
|
|
5876
5876
|
]).pipe(
|
|
5877
|
-
y((I) => I.some((
|
|
5878
|
-
|
|
5877
|
+
y((I) => I.some((A) => A) ? "busy" : "free"),
|
|
5878
|
+
E(),
|
|
5879
5879
|
Z(1)
|
|
5880
5880
|
), v = S.navigation$.pipe(
|
|
5881
5881
|
y(({ position: I }) => I),
|
|
5882
|
-
|
|
5882
|
+
E(U),
|
|
5883
5883
|
Z(1)
|
|
5884
5884
|
);
|
|
5885
5885
|
return {
|
|
@@ -5912,7 +5912,7 @@ const Re = (t, e, n) => {
|
|
|
5912
5912
|
position$: v
|
|
5913
5913
|
};
|
|
5914
5914
|
};
|
|
5915
|
-
class
|
|
5915
|
+
class fs extends oe {
|
|
5916
5916
|
constructor(e, n) {
|
|
5917
5917
|
super({
|
|
5918
5918
|
beginPageIndexInSpineItem: void 0,
|
|
@@ -5930,14 +5930,14 @@ class ms extends oe {
|
|
|
5930
5930
|
this.mergeCompare(e);
|
|
5931
5931
|
}
|
|
5932
5932
|
}
|
|
5933
|
-
class
|
|
5933
|
+
class ys extends J {
|
|
5934
5934
|
constructor(e, n, i, o, r, s, a) {
|
|
5935
5935
|
super(), this.context = e, this.pagination = n, this.spineItemsManager = i, this.spine = o, this.spineItemLocator = r, this.isNavigationLocked$ = s, this.cfi = a;
|
|
5936
5936
|
const c = T(
|
|
5937
5937
|
this.context.bridgeEvent.navigation$,
|
|
5938
5938
|
o.layout$
|
|
5939
5939
|
).pipe(
|
|
5940
|
-
|
|
5940
|
+
$(() => {
|
|
5941
5941
|
const d = ({
|
|
5942
5942
|
spineItem: l,
|
|
5943
5943
|
position: g
|
|
@@ -5965,7 +5965,7 @@ class fs extends J {
|
|
|
5965
5965
|
}) ?? {}, { endPageIndex: C = 0 } = d({
|
|
5966
5966
|
spineItem: S,
|
|
5967
5967
|
position: g
|
|
5968
|
-
}) ?? {}, I = x === void 0 || this.cfi.isRootCfi(x) || h.beginSpineItemIndex !== p,
|
|
5968
|
+
}) ?? {}, I = x === void 0 || this.cfi.isRootCfi(x) || h.beginSpineItemIndex !== p, A = h.endSpineItemIndex !== m || v === void 0 || this.cfi.isRootCfi(v), Y = I ? this.cfi.generateRootCfi(f.item) : x, X = A ? this.cfi.generateRootCfi(S.item) : v, re = f.numberOfPages, ve = S.numberOfPages;
|
|
5969
5969
|
this.pagination.update({
|
|
5970
5970
|
beginCfi: Y,
|
|
5971
5971
|
beginNumberOfPagesInSpineItem: re,
|
|
@@ -5981,7 +5981,7 @@ class fs extends J {
|
|
|
5981
5981
|
);
|
|
5982
5982
|
})
|
|
5983
5983
|
), u = c.pipe(
|
|
5984
|
-
|
|
5984
|
+
Ve(this.context.bridgeEvent.viewportFree$),
|
|
5985
5985
|
F(() => {
|
|
5986
5986
|
const {
|
|
5987
5987
|
beginSpineItemIndex: d,
|
|
@@ -6015,7 +6015,7 @@ class fs extends J {
|
|
|
6015
6015
|
T(c, u).pipe(M(this.destroy$)).subscribe();
|
|
6016
6016
|
}
|
|
6017
6017
|
}
|
|
6018
|
-
class
|
|
6018
|
+
class Ss extends J {
|
|
6019
6019
|
constructor(e) {
|
|
6020
6020
|
super();
|
|
6021
6021
|
const n = {
|
|
@@ -6025,7 +6025,7 @@ class ys extends J {
|
|
|
6025
6025
|
this.inputSettings = n, this.outputSettingsUpdateSubject = new k(), this._settings$ = this.outputSettingsUpdateSubject.asObservable().pipe(Z(1)), this._settings$.subscribe();
|
|
6026
6026
|
}
|
|
6027
6027
|
_prepareUpdate(e) {
|
|
6028
|
-
const n =
|
|
6028
|
+
const n = Le(this.inputSettings, e), i = this.getOutputSettings(n), o = !U(this.outputSettings, i);
|
|
6029
6029
|
return {
|
|
6030
6030
|
hasChanged: o,
|
|
6031
6031
|
state: i,
|
|
@@ -6053,14 +6053,14 @@ class ys extends J {
|
|
|
6053
6053
|
watch(e) {
|
|
6054
6054
|
return this.values$.pipe(
|
|
6055
6055
|
qt(e),
|
|
6056
|
-
|
|
6056
|
+
E(U)
|
|
6057
6057
|
);
|
|
6058
6058
|
}
|
|
6059
6059
|
destroy() {
|
|
6060
6060
|
super.destroy(), this.outputSettingsUpdateSubject.complete();
|
|
6061
6061
|
}
|
|
6062
6062
|
}
|
|
6063
|
-
class
|
|
6063
|
+
class Is extends Ss {
|
|
6064
6064
|
constructor(e, n) {
|
|
6065
6065
|
super(e), this.context = n, n.watch(["manifest", "hasVerticalWriting"]).pipe(
|
|
6066
6066
|
F(() => this.update(this.values)),
|
|
@@ -6099,18 +6099,18 @@ class Ss extends ys {
|
|
|
6099
6099
|
};
|
|
6100
6100
|
}
|
|
6101
6101
|
}
|
|
6102
|
-
class
|
|
6102
|
+
class bs extends Ee {
|
|
6103
6103
|
onUnload() {
|
|
6104
6104
|
return q;
|
|
6105
6105
|
}
|
|
6106
6106
|
onCreateDocument() {
|
|
6107
|
-
return
|
|
6107
|
+
return P(document.createElement("div"));
|
|
6108
6108
|
}
|
|
6109
6109
|
onLoadDocument() {
|
|
6110
6110
|
return q;
|
|
6111
6111
|
}
|
|
6112
6112
|
onLayout() {
|
|
6113
|
-
return
|
|
6113
|
+
return P(void 0);
|
|
6114
6114
|
}
|
|
6115
6115
|
onRenderHeadless() {
|
|
6116
6116
|
return q;
|
|
@@ -6118,7 +6118,7 @@ class Is extends Ee {
|
|
|
6118
6118
|
getDocumentFrame() {
|
|
6119
6119
|
}
|
|
6120
6120
|
}
|
|
6121
|
-
class
|
|
6121
|
+
class vs extends J {
|
|
6122
6122
|
constructor(e, n, i, o, r, s, a) {
|
|
6123
6123
|
super(), this.item = e, this.containerElement = n, this.context = i, this.hookManager = o, this.renderer = r, this.settings = s, this.viewport = a, this.layoutTriggerSubject = new k(), this.lastLayout = null, this.computeLayoutInformation = ({
|
|
6124
6124
|
isLastItem: u,
|
|
@@ -6187,11 +6187,11 @@ class bs extends J {
|
|
|
6187
6187
|
), { width: C, height: I });
|
|
6188
6188
|
})
|
|
6189
6189
|
), this.layout = (u) => {
|
|
6190
|
-
const d =
|
|
6190
|
+
const d = fi(this.didLayout$.pipe(W()));
|
|
6191
6191
|
return this.layoutTriggerSubject.next(u), d();
|
|
6192
6192
|
};
|
|
6193
6193
|
const c = this.layoutTriggerSubject.pipe(
|
|
6194
|
-
|
|
6194
|
+
$(
|
|
6195
6195
|
({ spreadPosition: u, horizontalOffset: d, isLastItem: l, edgeX: g, edgeY: h }) => {
|
|
6196
6196
|
const { blankPagePosition: p, minimumWidth: m } = this.computeLayoutInformation({ horizontalOffset: d, isLastItem: l });
|
|
6197
6197
|
this.hookManager.execute("item.onBeforeLayout", {
|
|
@@ -6206,7 +6206,7 @@ class bs extends J {
|
|
|
6206
6206
|
spreadPosition: u
|
|
6207
6207
|
});
|
|
6208
6208
|
return T(
|
|
6209
|
-
|
|
6209
|
+
P({ type: "start" }),
|
|
6210
6210
|
f.pipe(
|
|
6211
6211
|
/**
|
|
6212
6212
|
* Now that inner layout is done from the renderer, we adjust the dimensions
|
|
@@ -6229,12 +6229,12 @@ class bs extends J {
|
|
|
6229
6229
|
);
|
|
6230
6230
|
}
|
|
6231
6231
|
),
|
|
6232
|
-
|
|
6232
|
+
R()
|
|
6233
6233
|
);
|
|
6234
6234
|
this.didLayout$ = c.pipe(
|
|
6235
6235
|
L((u) => u.type === "end"),
|
|
6236
6236
|
y((u) => u.data),
|
|
6237
|
-
|
|
6237
|
+
R()
|
|
6238
6238
|
);
|
|
6239
6239
|
}
|
|
6240
6240
|
validateDimension(e, n, i) {
|
|
@@ -6268,7 +6268,7 @@ class fn extends oe {
|
|
|
6268
6268
|
});
|
|
6269
6269
|
}, this.destroy = () => {
|
|
6270
6270
|
super.destroy(), this.containerElement.remove(), this.renderer.destroy();
|
|
6271
|
-
}, this.isUsingVerticalWriting = () => !!this.renderer.writingMode?.startsWith("vertical"), this.layout = (l) => this._layout.layout(l), this.containerElement =
|
|
6271
|
+
}, this.isUsingVerticalWriting = () => !!this.renderer.writingMode?.startsWith("vertical"), this.layout = (l) => this._layout.layout(l), this.containerElement = ws(
|
|
6272
6272
|
n,
|
|
6273
6273
|
e,
|
|
6274
6274
|
r
|
|
@@ -6284,7 +6284,7 @@ class fn extends oe {
|
|
|
6284
6284
|
resourcesHandler: this.resourcesHandler,
|
|
6285
6285
|
viewport: this.viewport
|
|
6286
6286
|
};
|
|
6287
|
-
this.renderer = c ? c(u) : new
|
|
6287
|
+
this.renderer = c ? c(u) : new bs(u), this._layout = new vs(
|
|
6288
6288
|
e,
|
|
6289
6289
|
this.containerElement,
|
|
6290
6290
|
i,
|
|
@@ -6309,7 +6309,7 @@ class fn extends oe {
|
|
|
6309
6309
|
isReady: this.renderer.value.state === "loaded"
|
|
6310
6310
|
});
|
|
6311
6311
|
}),
|
|
6312
|
-
|
|
6312
|
+
_n()
|
|
6313
6313
|
), T(
|
|
6314
6314
|
/**
|
|
6315
6315
|
* @important
|
|
@@ -6372,21 +6372,21 @@ class fn extends oe {
|
|
|
6372
6372
|
});
|
|
6373
6373
|
}
|
|
6374
6374
|
}
|
|
6375
|
-
const
|
|
6375
|
+
const ws = (t, e, n) => {
|
|
6376
6376
|
const i = t.ownerDocument.createElement("div");
|
|
6377
|
-
return i.setAttribute(`data-${
|
|
6377
|
+
return i.setAttribute(`data-${Qi}`, ""), i.classList.add("spineItem"), i.classList.add(`spineItem-${e.renditionLayout ?? "reflowable"}`), i.style.cssText = `
|
|
6378
6378
|
position: absolute;
|
|
6379
6379
|
overflow: hidden;
|
|
6380
6380
|
`, i.dataset.isReady = "false", n.execute("item.onBeforeContainerCreated", { element: i }), i;
|
|
6381
6381
|
};
|
|
6382
|
-
class
|
|
6382
|
+
class xs extends J {
|
|
6383
6383
|
constructor(e, n, i, o, r, s) {
|
|
6384
6384
|
super(), this.context = e, this.spineItemsManager = n, this.spineLocator = i, this.settings = o, this.spineLayout = r, this.viewport = s, this.forcedOpenSubject = new Q(
|
|
6385
6385
|
/* @__PURE__ */ new Map()
|
|
6386
6386
|
);
|
|
6387
6387
|
const a = this.forcedOpenSubject.pipe(
|
|
6388
6388
|
y((d) => Array.from(d.keys()).sort((l, g) => l - g)),
|
|
6389
|
-
|
|
6389
|
+
E($n),
|
|
6390
6390
|
Z({ bufferSize: 1, refCount: !0 })
|
|
6391
6391
|
);
|
|
6392
6392
|
T(
|
|
@@ -6399,8 +6399,8 @@ class ws extends J {
|
|
|
6399
6399
|
// this can be changed by whatever we want and SHOULD not break navigation.
|
|
6400
6400
|
// Ideally loading faster is better but loading too close to user navigating can
|
|
6401
6401
|
// be dangerous.
|
|
6402
|
-
|
|
6403
|
-
|
|
6402
|
+
et(100),
|
|
6403
|
+
Ve(this.context.bridgeEvent.viewportFree$),
|
|
6404
6404
|
H(this.context.bridgeEvent.position$, a),
|
|
6405
6405
|
y(([, d, l]) => {
|
|
6406
6406
|
const { numberOfAdjacentSpineItemToPreLoad: g } = o.values, { beginIndex: h = 0, endIndex: p = 0 } = i.getVisibleSpineItemsFromPosition({
|
|
@@ -6437,19 +6437,19 @@ class ws extends J {
|
|
|
6437
6437
|
}
|
|
6438
6438
|
const yn = (t, e, n) => {
|
|
6439
6439
|
const i = (n.width - e.width) / 2, o = (n.height - e.height) / 2;
|
|
6440
|
-
return new
|
|
6440
|
+
return new O({
|
|
6441
6441
|
x: t.x - i,
|
|
6442
6442
|
y: t.y - o
|
|
6443
6443
|
});
|
|
6444
6444
|
};
|
|
6445
|
-
class
|
|
6445
|
+
class Ce extends DOMRect {
|
|
6446
6446
|
constructor() {
|
|
6447
6447
|
super(...arguments), this.__symbol = /* @__PURE__ */ Symbol("ViewportPosition");
|
|
6448
6448
|
}
|
|
6449
6449
|
static from(e, n) {
|
|
6450
6450
|
if (n) {
|
|
6451
6451
|
const o = e;
|
|
6452
|
-
return new
|
|
6452
|
+
return new Ce(
|
|
6453
6453
|
o.x,
|
|
6454
6454
|
o.y,
|
|
6455
6455
|
n.width,
|
|
@@ -6457,20 +6457,20 @@ class Te extends DOMRect {
|
|
|
6457
6457
|
);
|
|
6458
6458
|
}
|
|
6459
6459
|
const i = e;
|
|
6460
|
-
return new
|
|
6460
|
+
return new Ce(i.x, i.y, i.width, i.height);
|
|
6461
6461
|
}
|
|
6462
6462
|
}
|
|
6463
|
-
class
|
|
6463
|
+
class Ps {
|
|
6464
6464
|
constructor({ width: e, height: n }) {
|
|
6465
6465
|
this.__symbol = /* @__PURE__ */ Symbol("AbsoluteViewport"), this.width = e, this.height = n;
|
|
6466
6466
|
}
|
|
6467
6467
|
}
|
|
6468
|
-
class
|
|
6468
|
+
class $s {
|
|
6469
6469
|
constructor({ width: e, height: n }) {
|
|
6470
6470
|
this.__symbol = /* @__PURE__ */ Symbol("RelativeViewport"), this.width = e, this.height = n;
|
|
6471
6471
|
}
|
|
6472
6472
|
}
|
|
6473
|
-
const
|
|
6473
|
+
const Ts = ({
|
|
6474
6474
|
pageIndex: t,
|
|
6475
6475
|
spineItemOrId: e,
|
|
6476
6476
|
spineItemsManager: n
|
|
@@ -6492,7 +6492,7 @@ const $s = ({
|
|
|
6492
6492
|
{ currentAbsolutePage: 0, found: !1 }
|
|
6493
6493
|
);
|
|
6494
6494
|
return r;
|
|
6495
|
-
},
|
|
6495
|
+
}, Cs = ({
|
|
6496
6496
|
itemHeight: t,
|
|
6497
6497
|
itemWidth: e,
|
|
6498
6498
|
visibleWidthOfItem: n,
|
|
@@ -6501,7 +6501,7 @@ const $s = ({
|
|
|
6501
6501
|
}) => {
|
|
6502
6502
|
const r = n / e, s = i / t;
|
|
6503
6503
|
return o.type === "percentage" ? r >= o.value && s >= o.value : n >= o.value && i >= o.value;
|
|
6504
|
-
},
|
|
6504
|
+
}, Fs = ({
|
|
6505
6505
|
visibleWidthOfItem: t,
|
|
6506
6506
|
visibleHeightOfItem: e,
|
|
6507
6507
|
threshold: n,
|
|
@@ -6533,14 +6533,14 @@ const $s = ({
|
|
|
6533
6533
|
Math.min(t, g) - Math.max(i, l)
|
|
6534
6534
|
);
|
|
6535
6535
|
if (h <= 0 || p <= 0) return { visible: !1 };
|
|
6536
|
-
const f =
|
|
6536
|
+
const f = Fs({
|
|
6537
6537
|
threshold: s,
|
|
6538
6538
|
visibleHeightOfItem: p,
|
|
6539
6539
|
visibleWidthOfItem: h,
|
|
6540
6540
|
viewportPosition: a
|
|
6541
6541
|
});
|
|
6542
6542
|
return c ? { visible: f } : {
|
|
6543
|
-
visible:
|
|
6543
|
+
visible: Cs({
|
|
6544
6544
|
itemHeight: r,
|
|
6545
6545
|
itemWidth: o,
|
|
6546
6546
|
threshold: s,
|
|
@@ -6548,7 +6548,7 @@ const $s = ({
|
|
|
6548
6548
|
visibleWidthOfItem: h
|
|
6549
6549
|
}) || f
|
|
6550
6550
|
};
|
|
6551
|
-
},
|
|
6551
|
+
}, Ke = ({
|
|
6552
6552
|
position: t,
|
|
6553
6553
|
spineItemsManager: e,
|
|
6554
6554
|
spineLayout: n
|
|
@@ -6558,13 +6558,13 @@ const $s = ({
|
|
|
6558
6558
|
return u && d;
|
|
6559
6559
|
});
|
|
6560
6560
|
return t.x === 0 && !i ? e.items[0] : i;
|
|
6561
|
-
},
|
|
6561
|
+
}, He = ({
|
|
6562
6562
|
spineItemPosition: t,
|
|
6563
6563
|
itemLayout: { left: e, top: n }
|
|
6564
6564
|
}) => new V({
|
|
6565
6565
|
x: e + t.x,
|
|
6566
6566
|
y: n + t.y
|
|
6567
|
-
}),
|
|
6567
|
+
}), Ms = ({
|
|
6568
6568
|
position: t,
|
|
6569
6569
|
threshold: e,
|
|
6570
6570
|
restrictToScreen: n,
|
|
@@ -6573,7 +6573,7 @@ const $s = ({
|
|
|
6573
6573
|
useAbsoluteViewport: r = !0,
|
|
6574
6574
|
viewport: s
|
|
6575
6575
|
}) => {
|
|
6576
|
-
const a =
|
|
6576
|
+
const a = Ke({
|
|
6577
6577
|
position: t,
|
|
6578
6578
|
spineItemsManager: i,
|
|
6579
6579
|
spineLayout: o
|
|
@@ -6583,7 +6583,7 @@ const $s = ({
|
|
|
6583
6583
|
t,
|
|
6584
6584
|
s.absoluteViewport,
|
|
6585
6585
|
f
|
|
6586
|
-
), x =
|
|
6586
|
+
), x = Ce.from(
|
|
6587
6587
|
S,
|
|
6588
6588
|
f
|
|
6589
6589
|
), { visible: v } = Sn({
|
|
@@ -6602,7 +6602,7 @@ const $s = ({
|
|
|
6602
6602
|
beginIndex: l ?? 0,
|
|
6603
6603
|
endIndex: g ?? 0
|
|
6604
6604
|
};
|
|
6605
|
-
},
|
|
6605
|
+
}, Ls = ({
|
|
6606
6606
|
spineItemsManager: t,
|
|
6607
6607
|
context: e,
|
|
6608
6608
|
spineItemLocator: n,
|
|
@@ -6612,7 +6612,7 @@ const $s = ({
|
|
|
6612
6612
|
}) => {
|
|
6613
6613
|
const s = (p, m) => {
|
|
6614
6614
|
const { left: f, top: S } = o.getSpineItemSpineLayoutInfo(m);
|
|
6615
|
-
return new
|
|
6615
|
+
return new D({
|
|
6616
6616
|
/**
|
|
6617
6617
|
* when using spread the item could be on the right and therefore will be negative
|
|
6618
6618
|
* @example
|
|
@@ -6623,8 +6623,8 @@ const $s = ({
|
|
|
6623
6623
|
x: Math.max(p.x - f, 0),
|
|
6624
6624
|
y: Math.max(p.y - S, 0)
|
|
6625
6625
|
});
|
|
6626
|
-
}, a = (p) =>
|
|
6627
|
-
spineItemPosition: new
|
|
6626
|
+
}, a = (p) => He({
|
|
6627
|
+
spineItemPosition: new D({ x: 0, y: 0 }),
|
|
6628
6628
|
itemLayout: o.getSpineItemSpineLayoutInfo(p)
|
|
6629
6629
|
}), c = (p) => t.items.find((m) => m.renderer.getDocumentFrame() === p), u = (p, m, f) => {
|
|
6630
6630
|
if (typeof f == "number") {
|
|
@@ -6652,7 +6652,7 @@ const $s = ({
|
|
|
6652
6652
|
const ve = n.getSpineItemPositionFromPageIndex({
|
|
6653
6653
|
pageIndex: re,
|
|
6654
6654
|
spineItem: f
|
|
6655
|
-
}), ge =
|
|
6655
|
+
}), ge = He({
|
|
6656
6656
|
spineItemPosition: ve,
|
|
6657
6657
|
itemLayout: o.getSpineItemSpineLayoutInfo(f)
|
|
6658
6658
|
});
|
|
@@ -6673,7 +6673,7 @@ const $s = ({
|
|
|
6673
6673
|
p,
|
|
6674
6674
|
v.absoluteViewport,
|
|
6675
6675
|
ge
|
|
6676
|
-
), bn =
|
|
6676
|
+
), bn = Ce.from(
|
|
6677
6677
|
In,
|
|
6678
6678
|
ge
|
|
6679
6679
|
), { visible: vn } = Sn({
|
|
@@ -6685,10 +6685,10 @@ const $s = ({
|
|
|
6685
6685
|
return vn ? [...X, ve] : X;
|
|
6686
6686
|
},
|
|
6687
6687
|
[]
|
|
6688
|
-
),
|
|
6689
|
-
if (!(
|
|
6688
|
+
), A = I[0], Y = I[I.length - 1] ?? A;
|
|
6689
|
+
if (!(A === void 0 || Y === void 0))
|
|
6690
6690
|
return {
|
|
6691
|
-
beginPageIndex:
|
|
6691
|
+
beginPageIndex: A,
|
|
6692
6692
|
endPageIndex: Y
|
|
6693
6693
|
};
|
|
6694
6694
|
};
|
|
@@ -6698,7 +6698,7 @@ const $s = ({
|
|
|
6698
6698
|
spineItemPosition: m
|
|
6699
6699
|
}) => {
|
|
6700
6700
|
const f = o.getSpineItemSpineLayoutInfo(p);
|
|
6701
|
-
return
|
|
6701
|
+
return He({
|
|
6702
6702
|
itemLayout: f,
|
|
6703
6703
|
spineItemPosition: m
|
|
6704
6704
|
});
|
|
@@ -6706,12 +6706,12 @@ const $s = ({
|
|
|
6706
6706
|
/**
|
|
6707
6707
|
* @deprecated use Pages
|
|
6708
6708
|
*/
|
|
6709
|
-
_getAbsolutePageIndexFromPageIndex: (p) =>
|
|
6709
|
+
_getAbsolutePageIndexFromPageIndex: (p) => Ts({
|
|
6710
6710
|
...p,
|
|
6711
6711
|
spineItemsManager: t
|
|
6712
6712
|
}),
|
|
6713
6713
|
getSpineItemPagePositionFromSpinePosition: (p) => {
|
|
6714
|
-
const m =
|
|
6714
|
+
const m = Ke({
|
|
6715
6715
|
position: p,
|
|
6716
6716
|
spineItemsManager: t,
|
|
6717
6717
|
spineLayout: o
|
|
@@ -6740,14 +6740,14 @@ const $s = ({
|
|
|
6740
6740
|
},
|
|
6741
6741
|
getSpinePositionFromSpineItem: a,
|
|
6742
6742
|
getSpineItemPositionFromSpinePosition: s,
|
|
6743
|
-
getSpineItemFromPosition: (p) =>
|
|
6743
|
+
getSpineItemFromPosition: (p) => Ke({
|
|
6744
6744
|
position: p,
|
|
6745
6745
|
spineItemsManager: t,
|
|
6746
6746
|
spineLayout: o
|
|
6747
6747
|
}),
|
|
6748
6748
|
getSpineItemFromIframe: c,
|
|
6749
6749
|
getSpineItemPageIndexFromNode: u,
|
|
6750
|
-
getVisibleSpineItemsFromPosition: (p) =>
|
|
6750
|
+
getVisibleSpineItemsFromPosition: (p) => Ms({
|
|
6751
6751
|
spineItemsManager: t,
|
|
6752
6752
|
spineLayout: o,
|
|
6753
6753
|
viewport: r,
|
|
@@ -6764,27 +6764,27 @@ const $s = ({
|
|
|
6764
6764
|
spineItemLocator: n,
|
|
6765
6765
|
getSafeSpineItemPositionFromUnsafeSpineItemPosition: (p, m) => {
|
|
6766
6766
|
const { height: f, width: S } = o.getSpineItemSpineLayoutInfo(m);
|
|
6767
|
-
return new
|
|
6767
|
+
return new D({
|
|
6768
6768
|
x: Math.min(Math.max(0, p.x), S),
|
|
6769
6769
|
y: Math.min(Math.max(0, p.y), f)
|
|
6770
6770
|
});
|
|
6771
6771
|
}
|
|
6772
6772
|
};
|
|
6773
6773
|
};
|
|
6774
|
-
class
|
|
6774
|
+
class Ns extends J {
|
|
6775
6775
|
constructor(e) {
|
|
6776
6776
|
super(), this.spineItemsManager = e, this.states$ = this.spineItemsManager.items$.pipe(
|
|
6777
|
-
|
|
6777
|
+
$((n) => T(
|
|
6778
6778
|
...n.map(
|
|
6779
6779
|
(i) => i.pipe(
|
|
6780
6780
|
y((o) => ({ item: i, ...o })),
|
|
6781
|
-
|
|
6781
|
+
E(U)
|
|
6782
6782
|
)
|
|
6783
6783
|
)
|
|
6784
6784
|
)),
|
|
6785
|
-
|
|
6785
|
+
R()
|
|
6786
6786
|
), this.itemResize$ = this.spineItemsManager.items$.pipe(
|
|
6787
|
-
|
|
6787
|
+
$((n) => {
|
|
6788
6788
|
const i = n.map(
|
|
6789
6789
|
(o) => st(o.element).pipe(
|
|
6790
6790
|
y((r) => ({ entries: r, item: o }))
|
|
@@ -6792,24 +6792,30 @@ class Ls extends J {
|
|
|
6792
6792
|
);
|
|
6793
6793
|
return T(...i);
|
|
6794
6794
|
}),
|
|
6795
|
-
|
|
6795
|
+
R()
|
|
6796
6796
|
), this.itemLoad$ = this.spineItemsManager.items$.pipe(
|
|
6797
|
-
|
|
6798
|
-
|
|
6797
|
+
$((n) => T(...n.map((i) => i.loaded$.pipe(y(() => i))))),
|
|
6798
|
+
R()
|
|
6799
6799
|
), this.itemUnload$ = this.spineItemsManager.items$.pipe(
|
|
6800
|
-
|
|
6800
|
+
$((n) => T(
|
|
6801
6801
|
...n.map((i) => i.unloaded$.pipe(y(() => i)))
|
|
6802
6802
|
)),
|
|
6803
|
-
|
|
6803
|
+
R()
|
|
6804
6804
|
);
|
|
6805
6805
|
}
|
|
6806
6806
|
}
|
|
6807
|
-
class
|
|
6807
|
+
class As extends J {
|
|
6808
6808
|
constructor(e, n, i, o, r) {
|
|
6809
6809
|
super(), this.spineItemsManager = e, this.spineItemsObserver = n, this.context = i, this.settings = o, this.viewport = r, this.externalLayoutTrigger = new k(), this.spineItemsRelativeLayouts = [];
|
|
6810
6810
|
const s = T(
|
|
6811
6811
|
n.itemLoad$,
|
|
6812
6812
|
n.itemUnload$
|
|
6813
|
+
).pipe(
|
|
6814
|
+
y(
|
|
6815
|
+
() => ({
|
|
6816
|
+
immediate: !1
|
|
6817
|
+
})
|
|
6818
|
+
)
|
|
6813
6819
|
), a = T(
|
|
6814
6820
|
this.externalLayoutTrigger,
|
|
6815
6821
|
s
|
|
@@ -6820,11 +6826,13 @@ class Ns extends J {
|
|
|
6820
6826
|
c.markDirty();
|
|
6821
6827
|
});
|
|
6822
6828
|
}),
|
|
6823
|
-
|
|
6824
|
-
|
|
6829
|
+
// Immediate only skips this artificial delay. Item layout itself can still
|
|
6830
|
+
// complete asynchronously depending on the renderer.
|
|
6831
|
+
Rn((c) => c.immediate ? P(void 0) : $e(50)),
|
|
6832
|
+
$(
|
|
6825
6833
|
() => this.spineItemsManager.items.reduce(
|
|
6826
6834
|
(c, u, d) => c.pipe(
|
|
6827
|
-
|
|
6835
|
+
Dn(({ horizontalOffset: l, verticalOffset: g }) => {
|
|
6828
6836
|
const h = l % r.absoluteViewport.width === 0, p = d === e.items.length - 1, m = o.values.computedPageTurnDirection === "vertical", f = i.isRTL(), S = this.getSpreadPosition(
|
|
6829
6837
|
h,
|
|
6830
6838
|
f
|
|
@@ -6860,11 +6868,11 @@ class Ns extends J {
|
|
|
6860
6868
|
);
|
|
6861
6869
|
})
|
|
6862
6870
|
),
|
|
6863
|
-
|
|
6871
|
+
P({ horizontalOffset: 0, verticalOffset: 0 })
|
|
6864
6872
|
)
|
|
6865
6873
|
),
|
|
6866
6874
|
M(this.destroy$),
|
|
6867
|
-
|
|
6875
|
+
R()
|
|
6868
6876
|
), this.layout$.subscribe(), this.watchForVerticalWritingUpdate();
|
|
6869
6877
|
}
|
|
6870
6878
|
watchForVerticalWritingUpdate() {
|
|
@@ -6877,12 +6885,12 @@ class Ns extends J {
|
|
|
6877
6885
|
M(this.destroy$)
|
|
6878
6886
|
).subscribe();
|
|
6879
6887
|
}
|
|
6880
|
-
layout() {
|
|
6881
|
-
this.externalLayoutTrigger.next(
|
|
6888
|
+
layout(e = {}) {
|
|
6889
|
+
this.externalLayoutTrigger.next(e);
|
|
6882
6890
|
}
|
|
6883
6891
|
getSpineItemSpineLayoutInfo(e) {
|
|
6884
6892
|
const n = this.spineItemsManager.getSpineItemIndex(e) ?? 0;
|
|
6885
|
-
return this.spineItemsRelativeLayouts[n] || new
|
|
6893
|
+
return this.spineItemsRelativeLayouts[n] || new ze({
|
|
6886
6894
|
left: 0,
|
|
6887
6895
|
right: 0,
|
|
6888
6896
|
top: 0,
|
|
@@ -6914,7 +6922,7 @@ class Ns extends J {
|
|
|
6914
6922
|
createSpineItemLayout(e, n, i, o, r, s, a) {
|
|
6915
6923
|
if (e) {
|
|
6916
6924
|
const u = r + i, d = s + o;
|
|
6917
|
-
return new
|
|
6925
|
+
return new ze({
|
|
6918
6926
|
left: i,
|
|
6919
6927
|
right: u,
|
|
6920
6928
|
top: o,
|
|
@@ -6926,7 +6934,7 @@ class Ns extends J {
|
|
|
6926
6934
|
});
|
|
6927
6935
|
}
|
|
6928
6936
|
const c = n ? a - i - r : i;
|
|
6929
|
-
return new
|
|
6937
|
+
return new ze({
|
|
6930
6938
|
right: n ? a - i : i + r,
|
|
6931
6939
|
left: c,
|
|
6932
6940
|
x: c,
|
|
@@ -6938,24 +6946,24 @@ class Ns extends J {
|
|
|
6938
6946
|
});
|
|
6939
6947
|
}
|
|
6940
6948
|
}
|
|
6941
|
-
class
|
|
6949
|
+
class Es extends J {
|
|
6942
6950
|
constructor(e, n, i, o, r, s, a) {
|
|
6943
6951
|
super(), this.context = e, this.pagination = n, this.spineItemsManager = i, this.spineItemLocator = o, this.settings = r, this.hookManager = s, this.viewport = a, this.elementSubject = new Q(
|
|
6944
6952
|
void 0
|
|
6945
|
-
), this.element$ = this.elementSubject.asObservable(), this.spineItemsObserver = new
|
|
6953
|
+
), this.element$ = this.elementSubject.asObservable(), this.spineItemsObserver = new Ns(i), this.spineLayout = new As(
|
|
6946
6954
|
i,
|
|
6947
6955
|
this.spineItemsObserver,
|
|
6948
6956
|
e,
|
|
6949
6957
|
r,
|
|
6950
6958
|
a
|
|
6951
|
-
), this.locator =
|
|
6959
|
+
), this.locator = Ls({
|
|
6952
6960
|
context: e,
|
|
6953
6961
|
spineItemsManager: i,
|
|
6954
6962
|
spineItemLocator: o,
|
|
6955
6963
|
settings: r,
|
|
6956
6964
|
spineLayout: this.spineLayout,
|
|
6957
6965
|
viewport: a
|
|
6958
|
-
}), this.spineItemsLoader = new
|
|
6966
|
+
}), this.spineItemsLoader = new xs(
|
|
6959
6967
|
this.context,
|
|
6960
6968
|
i,
|
|
6961
6969
|
this.locator,
|
|
@@ -7005,8 +7013,8 @@ class As extends J {
|
|
|
7005
7013
|
get element() {
|
|
7006
7014
|
return this.elementSubject.getValue();
|
|
7007
7015
|
}
|
|
7008
|
-
layout() {
|
|
7009
|
-
this.spineLayout.layout();
|
|
7016
|
+
layout(e) {
|
|
7017
|
+
this.spineLayout.layout(e);
|
|
7010
7018
|
}
|
|
7011
7019
|
getSpineItemSpineLayoutInfo(e) {
|
|
7012
7020
|
return this.spineLayout.getSpineItemSpineLayoutInfo(e);
|
|
@@ -7018,7 +7026,7 @@ class As extends J {
|
|
|
7018
7026
|
super.destroy(), this.pages.destroy(), this.spineItemsLoader.destroy(), this.elementSubject.getValue()?.remove(), this.elementSubject.complete();
|
|
7019
7027
|
}
|
|
7020
7028
|
}
|
|
7021
|
-
class
|
|
7029
|
+
class Rs extends J {
|
|
7022
7030
|
constructor(e, n) {
|
|
7023
7031
|
super(), this.context = e, this.settings = n, this.orderedSpineItemsSubject = new Q([]), this.items$ = this.orderedSpineItemsSubject.asObservable();
|
|
7024
7032
|
}
|
|
@@ -7055,10 +7063,10 @@ class Es extends J {
|
|
|
7055
7063
|
});
|
|
7056
7064
|
}
|
|
7057
7065
|
}
|
|
7058
|
-
class
|
|
7066
|
+
class Ds extends oe {
|
|
7059
7067
|
constructor(e, n) {
|
|
7060
7068
|
const i = document.createElement("div");
|
|
7061
|
-
i.setAttribute(`data-${
|
|
7069
|
+
i.setAttribute(`data-${Ji}`, ""), super({
|
|
7062
7070
|
element: i,
|
|
7063
7071
|
pageSize: {
|
|
7064
7072
|
width: 1,
|
|
@@ -7107,7 +7115,7 @@ class Rs extends oe {
|
|
|
7107
7115
|
}), this.layoutSubject.next();
|
|
7108
7116
|
}
|
|
7109
7117
|
get absoluteViewport() {
|
|
7110
|
-
return new
|
|
7118
|
+
return new Ps({
|
|
7111
7119
|
width: this.value.width,
|
|
7112
7120
|
height: this.value.height
|
|
7113
7121
|
});
|
|
@@ -7135,7 +7143,7 @@ class Rs extends oe {
|
|
|
7135
7143
|
*/
|
|
7136
7144
|
get relativeViewport() {
|
|
7137
7145
|
const e = this.absoluteViewport, n = this.scaleFactor;
|
|
7138
|
-
return new
|
|
7146
|
+
return new $s({
|
|
7139
7147
|
width: e.width / n,
|
|
7140
7148
|
height: e.height / n
|
|
7141
7149
|
});
|
|
@@ -7144,12 +7152,12 @@ class Rs extends oe {
|
|
|
7144
7152
|
super.destroy(), this.layoutSubject.complete();
|
|
7145
7153
|
}
|
|
7146
7154
|
}
|
|
7147
|
-
const Rt = `${
|
|
7148
|
-
const e = crypto.randomUUID(), n = new k(), i = new k(), o = new
|
|
7155
|
+
const Rt = `${Gi}-core`, Os = (t) => {
|
|
7156
|
+
const e = crypto.randomUUID(), n = new k(), i = new k(), o = new Rr(), r = new Ar(), s = new Is(t, r), a = new Er(r, s), c = new Rs(r, s), u = new Lr(o, c), d = new Ds(r, s), l = hn({
|
|
7149
7157
|
context: r,
|
|
7150
7158
|
settings: s,
|
|
7151
7159
|
viewport: d
|
|
7152
|
-
}), g = new
|
|
7160
|
+
}), g = new fs(r, c), h = new Es(
|
|
7153
7161
|
r,
|
|
7154
7162
|
g,
|
|
7155
7163
|
c,
|
|
@@ -7157,7 +7165,7 @@ const Rt = `${Xi}-core`, Ds = (t) => {
|
|
|
7157
7165
|
s,
|
|
7158
7166
|
o,
|
|
7159
7167
|
d
|
|
7160
|
-
), p =
|
|
7168
|
+
), p = ms({
|
|
7161
7169
|
cfi: u,
|
|
7162
7170
|
context: r,
|
|
7163
7171
|
spineItemsManager: c,
|
|
@@ -7165,7 +7173,7 @@ const Rt = `${Xi}-core`, Ds = (t) => {
|
|
|
7165
7173
|
spine: h,
|
|
7166
7174
|
settings: s,
|
|
7167
7175
|
viewport: d
|
|
7168
|
-
}), m = new
|
|
7176
|
+
}), m = new ys(
|
|
7169
7177
|
r,
|
|
7170
7178
|
g,
|
|
7171
7179
|
c,
|
|
@@ -7175,28 +7183,31 @@ const Rt = `${Xi}-core`, Ds = (t) => {
|
|
|
7175
7183
|
u
|
|
7176
7184
|
);
|
|
7177
7185
|
p.navigationState$.subscribe(r.bridgeEvent.viewportStateSubject), p.navigation$.subscribe(r.bridgeEvent.navigationSubject), p.position$.subscribe(r.bridgeEvent.positionSubject), g.subscribe(r.bridgeEvent.paginationSubject);
|
|
7178
|
-
const f = () => {
|
|
7179
|
-
n.next();
|
|
7186
|
+
const f = (I = {}) => {
|
|
7187
|
+
n.next(I);
|
|
7180
7188
|
}, S = (I) => {
|
|
7181
|
-
const { containerElement:
|
|
7189
|
+
const { containerElement: A, manifest: Y } = I;
|
|
7182
7190
|
if (r.manifest) {
|
|
7183
7191
|
N.warn("loading a new book is not supported yet");
|
|
7184
7192
|
return;
|
|
7185
7193
|
}
|
|
7186
7194
|
N.log("load", { options: I });
|
|
7187
|
-
const X =
|
|
7195
|
+
const X = Vs(A, e);
|
|
7188
7196
|
r.update({
|
|
7189
7197
|
manifest: Y,
|
|
7190
7198
|
rootElement: X
|
|
7191
|
-
}), f();
|
|
7192
|
-
}, x = s.watch(["computedSpreadMode"]).pipe(
|
|
7193
|
-
|
|
7194
|
-
|
|
7195
|
-
|
|
7199
|
+
}), f({ immediate: !0 });
|
|
7200
|
+
}, x = s.watch(["computedSpreadMode"]).pipe(
|
|
7201
|
+
jt(1),
|
|
7202
|
+
z(() => f())
|
|
7203
|
+
), v = n.pipe(
|
|
7204
|
+
z((I) => {
|
|
7205
|
+
const A = r.value.rootElement;
|
|
7206
|
+
A && (w(A.style, "overflow", "hidden"), d.layout(), h.layout(I));
|
|
7196
7207
|
}),
|
|
7197
7208
|
ie(i)
|
|
7198
7209
|
), b = T(v, x).subscribe();
|
|
7199
|
-
nt(document, Rt,
|
|
7210
|
+
nt(document, Rt, Dr);
|
|
7200
7211
|
const C = () => {
|
|
7201
7212
|
it(document, Rt), b.unsubscribe(), c.destroy(), m.destroy(), s.destroy(), g.destroy(), r.destroy(), p.destroy(), h.destroy(), a.destroy(), i.next(), i.complete(), d.destroy();
|
|
7202
7213
|
};
|
|
@@ -7221,7 +7232,7 @@ const Rt = `${Xi}-core`, Ds = (t) => {
|
|
|
7221
7232
|
}
|
|
7222
7233
|
},
|
|
7223
7234
|
settings: s,
|
|
7224
|
-
renderHeadless: (I) => c.get(I)?.renderer.renderHeadless() ??
|
|
7235
|
+
renderHeadless: (I) => c.get(I)?.renderer.renderHeadless() ?? P(void 0),
|
|
7225
7236
|
viewport: d,
|
|
7226
7237
|
viewportState$: r.bridgeEvent.viewportState$,
|
|
7227
7238
|
viewportFree$: r.bridgeEvent.viewportFree$,
|
|
@@ -7239,30 +7250,30 @@ const Rt = `${Xi}-core`, Ds = (t) => {
|
|
|
7239
7250
|
destroy$: i
|
|
7240
7251
|
}
|
|
7241
7252
|
};
|
|
7242
|
-
},
|
|
7253
|
+
}, Vs = (t, e) => (t.style.cssText = `
|
|
7243
7254
|
${t.style.cssText}
|
|
7244
7255
|
background-color: white;
|
|
7245
7256
|
position: relative;
|
|
7246
|
-
`, t.classList.add(`${_}-reader`), t.setAttribute(
|
|
7257
|
+
`, t.classList.add(`${_}-reader`), t.setAttribute(Zi, e), t.setAttribute("data-prose-reader-container", e), t), Qs = (
|
|
7247
7258
|
//__
|
|
7248
|
-
|
|
7249
|
-
|
|
7250
|
-
|
|
7251
|
-
|
|
7252
|
-
|
|
7253
|
-
|
|
7254
|
-
|
|
7255
|
-
|
|
7256
|
-
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
|
|
7261
|
-
|
|
7262
|
-
|
|
7263
|
-
|
|
7259
|
+
gr(
|
|
7260
|
+
Ii(
|
|
7261
|
+
fr(
|
|
7262
|
+
Si(
|
|
7263
|
+
ui(
|
|
7264
|
+
cr(
|
|
7265
|
+
mr(
|
|
7266
|
+
Pr(
|
|
7267
|
+
$o(
|
|
7268
|
+
Wi(
|
|
7269
|
+
lo(
|
|
7270
|
+
di(
|
|
7271
|
+
hi(
|
|
7272
|
+
rr(
|
|
7273
|
+
uo(
|
|
7274
|
+
hr(
|
|
7264
7275
|
// __
|
|
7265
|
-
|
|
7276
|
+
Os
|
|
7266
7277
|
)
|
|
7267
7278
|
)
|
|
7268
7279
|
)
|
|
@@ -7279,115 +7290,116 @@ const Rt = `${Xi}-core`, Ds = (t) => {
|
|
|
7279
7290
|
)
|
|
7280
7291
|
)
|
|
7281
7292
|
)
|
|
7282
|
-
),
|
|
7283
|
-
itemReadinessTimeoutMs: e =
|
|
7293
|
+
), ea = (t) => (e) => t(e), ks = 5e3, ta = (t, {
|
|
7294
|
+
itemReadinessTimeoutMs: e = ks
|
|
7284
7295
|
} = {}) => on(t).pipe(
|
|
7285
|
-
|
|
7286
|
-
if (n.boundary === "start") return
|
|
7296
|
+
$((n) => {
|
|
7297
|
+
if (n.boundary === "start") return P(n);
|
|
7287
7298
|
const i = t.spineItemsManager.items, o = i[i.length - 1];
|
|
7288
|
-
return o ? o.value.isReady ?
|
|
7299
|
+
return o ? o.value.isReady ? P(n) : o.isReady$.pipe(
|
|
7289
7300
|
L(Boolean),
|
|
7290
7301
|
W(),
|
|
7291
7302
|
y(() => n),
|
|
7292
|
-
e === 1 / 0 ? Pe :
|
|
7303
|
+
e === 1 / 0 ? Pe : On({
|
|
7293
7304
|
first: e,
|
|
7294
7305
|
with: () => q
|
|
7295
7306
|
}),
|
|
7296
|
-
|
|
7307
|
+
go(t.navigation)
|
|
7297
7308
|
) : q;
|
|
7298
7309
|
}),
|
|
7299
|
-
|
|
7310
|
+
R()
|
|
7300
7311
|
);
|
|
7301
7312
|
export {
|
|
7302
7313
|
Jt as AbstractSpinePosition,
|
|
7303
|
-
|
|
7304
|
-
|
|
7305
|
-
|
|
7314
|
+
Lr as CfiManager,
|
|
7315
|
+
Ar as Context,
|
|
7316
|
+
jr as ControlledNavigationController,
|
|
7306
7317
|
J as DestroyableClass,
|
|
7307
7318
|
Ee as DocumentRenderer,
|
|
7308
|
-
|
|
7309
|
-
|
|
7319
|
+
Er as Features,
|
|
7320
|
+
Zi as HTML_ATTRIBUTE_DATA_READER_ID,
|
|
7310
7321
|
_ as HTML_PREFIX,
|
|
7311
|
-
|
|
7312
|
-
|
|
7313
|
-
|
|
7314
|
-
|
|
7315
|
-
|
|
7316
|
-
|
|
7322
|
+
Ki as HTML_PREFIX_SCROLL_NAVIGATOR,
|
|
7323
|
+
Qi as HTML_PREFIX_SPINE_ITEM,
|
|
7324
|
+
Ji as HTML_PREFIX_VIEWPORT,
|
|
7325
|
+
Gi as HTML_STYLE_PREFIX,
|
|
7326
|
+
Rr as HookManager,
|
|
7327
|
+
ts as InternalNavigator,
|
|
7317
7328
|
ct as LayoutEntry,
|
|
7318
7329
|
pn as Locker,
|
|
7319
|
-
|
|
7320
|
-
|
|
7330
|
+
Gs as PAGINATION_UPDATE_AFTER_VIEWPORT_ADJUSTMENT_DEBOUNCE,
|
|
7331
|
+
Ys as PROSE_READER_NAMESPACE,
|
|
7321
7332
|
he as Pages,
|
|
7322
|
-
|
|
7323
|
-
|
|
7333
|
+
fs as Pagination,
|
|
7334
|
+
ys as PaginationController,
|
|
7324
7335
|
oe as ReactiveEntity,
|
|
7325
7336
|
at as ResourceHandler,
|
|
7326
|
-
|
|
7327
|
-
|
|
7337
|
+
Fo as ResourcesLocator,
|
|
7338
|
+
br as ScrollNavigationController,
|
|
7328
7339
|
Pt as ScrollPosition,
|
|
7329
|
-
|
|
7330
|
-
|
|
7340
|
+
Ss as SettingsManager,
|
|
7341
|
+
Es as Spine,
|
|
7331
7342
|
fn as SpineItem,
|
|
7332
|
-
|
|
7333
|
-
|
|
7334
|
-
|
|
7335
|
-
|
|
7336
|
-
|
|
7337
|
-
|
|
7343
|
+
_i as SpineItemPageLayout,
|
|
7344
|
+
Bi as SpineItemPageSpineLayout,
|
|
7345
|
+
D as SpineItemPosition,
|
|
7346
|
+
ze as SpineItemSpineLayout,
|
|
7347
|
+
Rs as SpineItemsManager,
|
|
7348
|
+
Ns as SpineItemsObserver,
|
|
7338
7349
|
V as SpinePosition,
|
|
7339
|
-
|
|
7340
|
-
|
|
7341
|
-
|
|
7342
|
-
|
|
7343
|
-
|
|
7344
|
-
|
|
7345
|
-
|
|
7350
|
+
Ir as UnboundScrollPosition,
|
|
7351
|
+
Ue as UnboundSpineItemPagePosition,
|
|
7352
|
+
O as UnboundSpinePosition,
|
|
7353
|
+
Xs as VIEWPORT_ADJUSTMENT_THROTTLE,
|
|
7354
|
+
Ds as Viewport,
|
|
7355
|
+
Co as consolidate,
|
|
7356
|
+
Qs as createReader,
|
|
7346
7357
|
lt as deferIdle,
|
|
7347
|
-
|
|
7348
|
-
|
|
7349
|
-
|
|
7358
|
+
fi as deferNextResult,
|
|
7359
|
+
$r as generateCfiForSpineItemPage,
|
|
7360
|
+
Tr as generateCfiFromRange,
|
|
7350
7361
|
cn as generateRootCfi,
|
|
7351
7362
|
dt as getAttributeValueFromString,
|
|
7352
|
-
|
|
7363
|
+
Bs as getBase64FromBlob,
|
|
7353
7364
|
ot as getFrameViewportInfo,
|
|
7354
|
-
|
|
7355
|
-
|
|
7365
|
+
Ks as getItemAnchor,
|
|
7366
|
+
Wi as htmlEnhancer,
|
|
7356
7367
|
Yt as idle,
|
|
7357
|
-
|
|
7368
|
+
nt as injectCSS,
|
|
7369
|
+
si as injectCSSToFrame,
|
|
7358
7370
|
ne as isDefined,
|
|
7359
7371
|
Ht as isHtmlElement,
|
|
7360
|
-
|
|
7361
|
-
|
|
7362
|
-
|
|
7363
|
-
|
|
7372
|
+
oi as isHtmlTagElement,
|
|
7373
|
+
Cr as isRootCfi,
|
|
7374
|
+
oa as isShallowEqual,
|
|
7375
|
+
uo as layoutEnhancer,
|
|
7364
7376
|
qt as mapKeysTo,
|
|
7365
|
-
|
|
7366
|
-
|
|
7377
|
+
ta as observeBookBoundaryReached,
|
|
7378
|
+
Hs as observeIntersection,
|
|
7367
7379
|
pt as observeMutation,
|
|
7368
|
-
|
|
7380
|
+
po as observeNextSettledNavigation,
|
|
7369
7381
|
st as observeResize,
|
|
7370
7382
|
nn as observeSettledNavigation,
|
|
7371
|
-
|
|
7383
|
+
rr as paginationEnhancer,
|
|
7372
7384
|
dn as parseCfi,
|
|
7373
|
-
|
|
7385
|
+
mi as pick,
|
|
7374
7386
|
zt as removeAttributeIfPresent,
|
|
7375
|
-
|
|
7387
|
+
_s as removeCSS,
|
|
7376
7388
|
ce as removeStylePropertyIfPresent,
|
|
7377
|
-
|
|
7378
|
-
|
|
7389
|
+
Mr as resolveCfi,
|
|
7390
|
+
ea as rootEnhancer,
|
|
7379
7391
|
te as setAttributeIfChanged,
|
|
7380
|
-
|
|
7392
|
+
Gn as setPropertyIfChanged,
|
|
7381
7393
|
w as setStylePropertyIfChanged,
|
|
7382
7394
|
en as shouldEnableSpreadModeForViewport,
|
|
7383
|
-
|
|
7384
|
-
|
|
7385
|
-
|
|
7395
|
+
Js as shouldUseComputedSpreadModeForViewport,
|
|
7396
|
+
Lo as spinePositionToSpineItemSpineLayout,
|
|
7397
|
+
go as takeUntilNextNavigationSettled,
|
|
7386
7398
|
de as upsertCSSToFrame,
|
|
7387
|
-
|
|
7388
|
-
|
|
7399
|
+
ai as waitForFrameLoad,
|
|
7400
|
+
ci as waitForFrameReady,
|
|
7389
7401
|
tn as waitForNavigationSettled,
|
|
7390
|
-
|
|
7402
|
+
Ve as waitForSwitch,
|
|
7391
7403
|
rt as watchKeys
|
|
7392
7404
|
};
|
|
7393
7405
|
//# sourceMappingURL=index.js.map
|