@prose-reader/core 1.9.0 → 1.10.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.
Files changed (33) hide show
  1. package/dist/createReaderWithEnhancer.d.ts +116 -6605
  2. package/dist/enhancers/accessibility.d.ts +1 -2
  3. package/dist/enhancers/chrome.d.ts +1 -2
  4. package/dist/enhancers/fonts.d.ts +5 -2
  5. package/dist/enhancers/hotkeys.d.ts +1 -2
  6. package/dist/enhancers/layoutEnhancer/createMovingSafePan$.d.ts +2 -2
  7. package/dist/enhancers/layoutEnhancer/fixReflowable.d.ts +2 -2
  8. package/dist/enhancers/layoutEnhancer/layoutEnhancer.d.ts +8 -2
  9. package/dist/enhancers/layoutEnhancer/types.d.ts +2 -4
  10. package/dist/enhancers/links.d.ts +2 -3
  11. package/dist/enhancers/loadingEnhancer.d.ts +13 -5
  12. package/dist/enhancers/media.d.ts +1 -2
  13. package/dist/enhancers/navigation.d.ts +2 -3
  14. package/dist/enhancers/pagination.d.ts +350 -7
  15. package/dist/enhancers/progression.d.ts +3 -3
  16. package/dist/enhancers/resources/index.d.ts +1 -2
  17. package/dist/enhancers/theme.d.ts +4 -5
  18. package/dist/enhancers/types/enhancer.d.ts +5 -0
  19. package/dist/enhancers/utils.d.ts +2 -3
  20. package/dist/enhancers/webkit.d.ts +1 -2
  21. package/dist/enhancers/zoom/elementZoomer.d.ts +2 -2
  22. package/dist/enhancers/zoom/index.d.ts +3 -2
  23. package/dist/enhancers/zoom/types.d.ts +2 -6
  24. package/dist/enhancers/zoom/viewportZoomer.d.ts +2 -2
  25. package/dist/index.d.ts +3 -5
  26. package/dist/prose.js +671 -690
  27. package/dist/prose.js.map +1 -1
  28. package/dist/prose.umd.cjs +35 -35
  29. package/dist/prose.umd.cjs.map +1 -1
  30. package/dist/types/Reader.d.ts +2 -2
  31. package/package.json +3 -6
  32. package/dist/enhancers/composeEnhancer.d.ts +0 -24
  33. package/dist/enhancers/types.d.ts +0 -27
package/dist/prose.js CHANGED
@@ -1,12 +1,17 @@
1
- import { BehaviorSubject as q, takeUntil as dn, combineLatest as $e, map as ft, scheduled as fn, animationFrameScheduler as me, of as J, Subject as H, distinctUntilChanged as gn, switchMap as Ct, from as fe, merge as X, EMPTY as te, fromEvent as Ft, interval as pn, iif as hn, withLatestFrom as mn, take as yn, identity as ke, forkJoin as vn } from "rxjs";
2
- import { parseContentType as bn, detectMimeTypeFromName as wn } from "@prose-reader/shared";
3
- const Sn = !1, Pn = (e) => (t) => {
1
+ import { BehaviorSubject as q, takeUntil as an, combineLatest as $e, map as ft, of as J, scheduled as cn, animationFrameScheduler as me, Subject as H, distinctUntilChanged as un, switchMap as $t, from as fe, merge as X, EMPTY as te, fromEvent as xt, interval as ln, iif as dn, withLatestFrom as fn, identity as ke, take as gn, forkJoin as pn } from "rxjs";
2
+ import { parseContentType as hn, detectMimeTypeFromName as mn } from "@prose-reader/shared";
3
+ function ii(...e) {
4
+ return e.length === 0 ? (t) => t : e.length === 1 ? e[0] : e.reduce(
5
+ (t, n) => (...o) => n(t(...o))
6
+ );
7
+ }
8
+ const yn = !1, vn = (e) => (t) => {
4
9
  const n = e(t);
5
10
  return n.manipulateContainer((o) => {
6
11
  const r = () => {
7
12
  n.context.getSettings().computedPageTurnMode === "controlled" && o.scrollTo(0, 0);
8
13
  };
9
- return o.addEventListener("scroll", r), Sn;
14
+ return o.addEventListener("scroll", r), yn;
10
15
  }), n.registerHook("item.onLoad", ({ frame: o }) => {
11
16
  var r;
12
17
  (r = o.contentDocument) == null || r.body.setAttribute("tabindex", "-1");
@@ -15,12 +20,12 @@ const Sn = !1, Pn = (e) => (t) => {
15
20
  function G(e) {
16
21
  return typeof e == "function";
17
22
  }
18
- function In(e) {
23
+ function bn(e) {
19
24
  return G(e == null ? void 0 : e.lift);
20
25
  }
21
26
  function K(e) {
22
27
  return function(t) {
23
- if (In(t))
28
+ if (bn(t))
24
29
  return t.lift(function(n) {
25
30
  try {
26
31
  return e(n, this);
@@ -48,7 +53,7 @@ function le(e, t) {
48
53
  }
49
54
  e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
50
55
  }
51
- function $n(e, t, n, o) {
56
+ function wn(e, t, n, o) {
52
57
  function r(i) {
53
58
  return i instanceof n ? i : new n(function(s) {
54
59
  s(i);
@@ -75,7 +80,7 @@ function $n(e, t, n, o) {
75
80
  u((o = o.apply(e, t || [])).next());
76
81
  });
77
82
  }
78
- function Et(e, t) {
83
+ function Tt(e, t) {
79
84
  var n = { label: 0, sent: function() {
80
85
  if (i[0] & 1)
81
86
  throw i[1];
@@ -181,7 +186,7 @@ function ae(e, t, n) {
181
186
  function we(e) {
182
187
  return this instanceof we ? (this.v = e, this) : new we(e);
183
188
  }
184
- function xn(e, t, n) {
189
+ function Sn(e, t, n) {
185
190
  if (!Symbol.asyncIterator)
186
191
  throw new TypeError("Symbol.asyncIterator is not defined.");
187
192
  var o = n.apply(e, t || []), r, i = [];
@@ -189,15 +194,15 @@ function xn(e, t, n) {
189
194
  return this;
190
195
  }, r;
191
196
  function s(f) {
192
- o[f] && (r[f] = function(g) {
197
+ o[f] && (r[f] = function(p) {
193
198
  return new Promise(function(y, v) {
194
- i.push([f, g, y, v]) > 1 || a(f, g);
199
+ i.push([f, p, y, v]) > 1 || a(f, p);
195
200
  });
196
201
  });
197
202
  }
198
- function a(f, g) {
203
+ function a(f, p) {
199
204
  try {
200
- c(o[f](g));
205
+ c(o[f](p));
201
206
  } catch (y) {
202
207
  l(i[0][3], y);
203
208
  }
@@ -211,11 +216,11 @@ function xn(e, t, n) {
211
216
  function d(f) {
212
217
  a("throw", f);
213
218
  }
214
- function l(f, g) {
215
- f(g), i.shift(), i.length && a(i[0][0], i[0][1]);
219
+ function l(f, p) {
220
+ f(p), i.shift(), i.length && a(i[0][0], i[0][1]);
216
221
  }
217
222
  }
218
- function Tn(e) {
223
+ function Pn(e) {
219
224
  if (!Symbol.asyncIterator)
220
225
  throw new TypeError("Symbol.asyncIterator is not defined.");
221
226
  var t = e[Symbol.asyncIterator], n;
@@ -235,19 +240,19 @@ function Tn(e) {
235
240
  }, s);
236
241
  }
237
242
  }
238
- var At = function(e) {
243
+ var Ct = function(e) {
239
244
  return e && typeof e.length == "number" && typeof e != "function";
240
245
  };
241
- function Nt(e) {
246
+ function Ft(e) {
242
247
  return G(e == null ? void 0 : e.then);
243
248
  }
244
- function Ot(e) {
249
+ function Et(e) {
245
250
  var t = function(o) {
246
251
  Error.call(o), o.stack = new Error().stack;
247
252
  }, n = e(t);
248
253
  return n.prototype = Object.create(Error.prototype), n.prototype.constructor = n, n;
249
254
  }
250
- var ze = Ot(function(e) {
255
+ var ze = Et(function(e) {
251
256
  return function(n) {
252
257
  e(this), this.message = n ? n.length + ` errors occurred during unsubscription:
253
258
  ` + n.map(function(o, r) {
@@ -301,8 +306,8 @@ var xe = function() {
301
306
  if (l) {
302
307
  this._finalizers = null;
303
308
  try {
304
- for (var f = Se(l), g = f.next(); !g.done; g = f.next()) {
305
- var y = g.value;
309
+ for (var f = Se(l), p = f.next(); !p.done; p = f.next()) {
310
+ var y = p.value;
306
311
  try {
307
312
  gt(y);
308
313
  } catch (v) {
@@ -313,7 +318,7 @@ var xe = function() {
313
318
  o = { error: v };
314
319
  } finally {
315
320
  try {
316
- g && !g.done && (r = f.return) && r.call(f);
321
+ p && !p.done && (r = f.return) && r.call(f);
317
322
  } finally {
318
323
  if (o)
319
324
  throw o.error;
@@ -352,8 +357,8 @@ var xe = function() {
352
357
  var t = new e();
353
358
  return t.closed = !0, t;
354
359
  }(), e;
355
- }(), Rt = xe.EMPTY;
356
- function Lt(e) {
360
+ }(), At = xe.EMPTY;
361
+ function Nt(e) {
357
362
  return e instanceof xe || e && "closed" in e && G(e.remove) && G(e.add) && G(e.unsubscribe);
358
363
  }
359
364
  function gt(e) {
@@ -378,20 +383,20 @@ var nt = {
378
383
  },
379
384
  delegate: void 0
380
385
  };
381
- function Dt(e) {
386
+ function Ot(e) {
382
387
  Le.setTimeout(function() {
383
388
  throw e;
384
389
  });
385
390
  }
386
391
  function Pe() {
387
392
  }
388
- var Cn = function() {
393
+ var In = function() {
389
394
  return ot("C", void 0, void 0);
390
395
  }();
391
- function Fn(e) {
396
+ function $n(e) {
392
397
  return ot("E", void 0, e);
393
398
  }
394
- function En(e) {
399
+ function xn(e) {
395
400
  return ot("N", e, void 0);
396
401
  }
397
402
  function ot(e, t, n) {
@@ -408,16 +413,16 @@ var rt = function(e) {
408
413
  le(t, e);
409
414
  function t(n) {
410
415
  var o = e.call(this) || this;
411
- return o.isStopped = !1, n ? (o.destination = n, Lt(n) && n.add(o)) : o.destination = Rn, o;
416
+ return o.isStopped = !1, n ? (o.destination = n, Nt(n) && n.add(o)) : o.destination = En, o;
412
417
  }
413
418
  return t.create = function(n, o, r) {
414
419
  return new Ie(n, o, r);
415
420
  }, t.prototype.next = function(n) {
416
- this.isStopped ? We(En(n), this) : this._next(n);
421
+ this.isStopped ? We(xn(n), this) : this._next(n);
417
422
  }, t.prototype.error = function(n) {
418
- this.isStopped ? We(Fn(n), this) : (this.isStopped = !0, this._error(n));
423
+ this.isStopped ? We($n(n), this) : (this.isStopped = !0, this._error(n));
419
424
  }, t.prototype.complete = function() {
420
- this.isStopped ? We(Cn, this) : (this.isStopped = !0, this._complete());
425
+ this.isStopped ? We(In, this) : (this.isStopped = !0, this._complete());
421
426
  }, t.prototype.unsubscribe = function() {
422
427
  this.closed || (this.isStopped = !0, e.prototype.unsubscribe.call(this), this.destination = null);
423
428
  }, t.prototype._next = function(n) {
@@ -435,11 +440,11 @@ var rt = function(e) {
435
440
  this.unsubscribe();
436
441
  }
437
442
  }, t;
438
- }(xe), An = Function.prototype.bind;
443
+ }(xe), Tn = Function.prototype.bind;
439
444
  function Ue(e, t) {
440
- return An.call(e, t);
445
+ return Tn.call(e, t);
441
446
  }
442
- var Nn = function() {
447
+ var Cn = function() {
443
448
  function e(t) {
444
449
  this.partialObserver = t;
445
450
  }
@@ -490,14 +495,14 @@ var Nn = function() {
490
495
  complete: n.complete && Ue(n.complete, a)
491
496
  }) : s = n;
492
497
  }
493
- return i.destination = new Nn(s), i;
498
+ return i.destination = new Cn(s), i;
494
499
  }
495
500
  return t;
496
501
  }(rt);
497
502
  function Ce(e) {
498
- Dt(e);
503
+ Ot(e);
499
504
  }
500
- function On(e) {
505
+ function Fn(e) {
501
506
  throw e;
502
507
  }
503
508
  function We(e, t) {
@@ -506,10 +511,10 @@ function We(e, t) {
506
511
  return n(e, t);
507
512
  });
508
513
  }
509
- var Rn = {
514
+ var En = {
510
515
  closed: !0,
511
516
  next: Pe,
512
- error: On,
517
+ error: Fn,
513
518
  complete: Pe
514
519
  }, it = function() {
515
520
  return typeof Symbol == "function" && Symbol.observable || "@@observable";
@@ -517,7 +522,7 @@ var Rn = {
517
522
  function Te(e) {
518
523
  return e;
519
524
  }
520
- function Ln(e) {
525
+ function An(e) {
521
526
  return e.length === 0 ? Te : e.length === 1 ? e[0] : function(n) {
522
527
  return e.reduce(function(o, r) {
523
528
  return r(o);
@@ -532,7 +537,7 @@ var ne = function() {
532
537
  var n = new e();
533
538
  return n.source = this, n.operator = t, n;
534
539
  }, e.prototype.subscribe = function(t, n, o) {
535
- var r = this, i = _n(t) ? t : new Ie(t, n, o);
540
+ var r = this, i = On(t) ? t : new Ie(t, n, o);
536
541
  return Oe(function() {
537
542
  var s = r, a = s.operator, c = s.source;
538
543
  i.add(a ? a.call(i, c) : c ? r._subscribe(i) : r._trySubscribe(i));
@@ -567,7 +572,7 @@ var ne = function() {
567
572
  }, e.prototype.pipe = function() {
568
573
  for (var t = [], n = 0; n < arguments.length; n++)
569
574
  t[n] = arguments[n];
570
- return Ln(t)(this);
575
+ return An(t)(this);
571
576
  }, e.prototype.toPromise = function(t) {
572
577
  var n = this;
573
578
  return t = pt(t), new t(function(o, r) {
@@ -588,32 +593,32 @@ function pt(e) {
588
593
  var t;
589
594
  return (t = e ?? nt.Promise) !== null && t !== void 0 ? t : Promise;
590
595
  }
591
- function Dn(e) {
596
+ function Nn(e) {
592
597
  return e && G(e.next) && G(e.error) && G(e.complete);
593
598
  }
594
- function _n(e) {
595
- return e && e instanceof rt || Dn(e) && Lt(e);
599
+ function On(e) {
600
+ return e && e instanceof rt || Nn(e) && Nt(e);
596
601
  }
597
- function _t(e) {
602
+ function Rt(e) {
598
603
  return G(e[it]);
599
604
  }
600
- function Mt(e) {
605
+ function Lt(e) {
601
606
  return Symbol.asyncIterator && G(e == null ? void 0 : e[Symbol.asyncIterator]);
602
607
  }
603
- function jt(e) {
608
+ function Dt(e) {
604
609
  return new TypeError("You provided " + (e !== null && typeof e == "object" ? "an invalid object" : "'" + e + "'") + " where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.");
605
610
  }
606
- function Mn() {
611
+ function Rn() {
607
612
  return typeof Symbol != "function" || !Symbol.iterator ? "@@iterator" : Symbol.iterator;
608
613
  }
609
- var Vt = Mn();
610
- function kt(e) {
611
- return G(e == null ? void 0 : e[Vt]);
614
+ var _t = Rn();
615
+ function Mt(e) {
616
+ return G(e == null ? void 0 : e[_t]);
612
617
  }
613
- function zt(e) {
614
- return xn(this, arguments, function() {
618
+ function jt(e) {
619
+ return Sn(this, arguments, function() {
615
620
  var n, o, r, i;
616
- return Et(this, function(s) {
621
+ return Tt(this, function(s) {
617
622
  switch (s.label) {
618
623
  case 0:
619
624
  n = e.getReader(), s.label = 1;
@@ -641,29 +646,29 @@ function zt(e) {
641
646
  });
642
647
  });
643
648
  }
644
- function Ut(e) {
649
+ function Vt(e) {
645
650
  return G(e == null ? void 0 : e.getReader);
646
651
  }
647
652
  function ee(e) {
648
653
  if (e instanceof ne)
649
654
  return e;
650
655
  if (e != null) {
651
- if (_t(e))
652
- return jn(e);
653
- if (At(e))
654
- return Vn(e);
655
- if (Nt(e))
656
- return kn(e);
656
+ if (Rt(e))
657
+ return Ln(e);
658
+ if (Ct(e))
659
+ return Dn(e);
660
+ if (Ft(e))
661
+ return _n(e);
662
+ if (Lt(e))
663
+ return kt(e);
657
664
  if (Mt(e))
658
- return Wt(e);
659
- if (kt(e))
660
- return zn(e);
661
- if (Ut(e))
662
- return Un(e);
665
+ return Mn(e);
666
+ if (Vt(e))
667
+ return jn(e);
663
668
  }
664
- throw jt(e);
669
+ throw Dt(e);
665
670
  }
666
- function jn(e) {
671
+ function Ln(e) {
667
672
  return new ne(function(t) {
668
673
  var n = e[it]();
669
674
  if (G(n.subscribe))
@@ -671,23 +676,23 @@ function jn(e) {
671
676
  throw new TypeError("Provided object does not correctly implement Symbol.observable");
672
677
  });
673
678
  }
674
- function Vn(e) {
679
+ function Dn(e) {
675
680
  return new ne(function(t) {
676
681
  for (var n = 0; n < e.length && !t.closed; n++)
677
682
  t.next(e[n]);
678
683
  t.complete();
679
684
  });
680
685
  }
681
- function kn(e) {
686
+ function _n(e) {
682
687
  return new ne(function(t) {
683
688
  e.then(function(n) {
684
689
  t.closed || (t.next(n), t.complete());
685
690
  }, function(n) {
686
691
  return t.error(n);
687
- }).then(null, Dt);
692
+ }).then(null, Ot);
688
693
  });
689
694
  }
690
- function zn(e) {
695
+ function Mn(e) {
691
696
  return new ne(function(t) {
692
697
  var n, o;
693
698
  try {
@@ -709,24 +714,24 @@ function zn(e) {
709
714
  t.complete();
710
715
  });
711
716
  }
712
- function Wt(e) {
717
+ function kt(e) {
713
718
  return new ne(function(t) {
714
- Wn(e, t).catch(function(n) {
719
+ Vn(e, t).catch(function(n) {
715
720
  return t.error(n);
716
721
  });
717
722
  });
718
723
  }
719
- function Un(e) {
720
- return Wt(zt(e));
724
+ function jn(e) {
725
+ return kt(jt(e));
721
726
  }
722
- function Wn(e, t) {
727
+ function Vn(e, t) {
723
728
  var n, o, r, i;
724
- return $n(this, void 0, void 0, function() {
729
+ return wn(this, void 0, void 0, function() {
725
730
  var s, a;
726
- return Et(this, function(c) {
731
+ return Tt(this, function(c) {
727
732
  switch (c.label) {
728
733
  case 0:
729
- c.trys.push([0, 5, 6, 11]), n = Tn(e), c.label = 1;
734
+ c.trys.push([0, 5, 6, 11]), n = Pn(e), c.label = 1;
730
735
  case 1:
731
736
  return [4, n.next()];
732
737
  case 2:
@@ -760,9 +765,9 @@ function Wn(e, t) {
760
765
  });
761
766
  }
762
767
  function Z(e, t, n, o, r) {
763
- return new Hn(e, t, n, o, r);
768
+ return new kn(e, t, n, o, r);
764
769
  }
765
- var Hn = function(e) {
770
+ var kn = function(e) {
766
771
  le(t, e);
767
772
  function t(n, o, r, i, s, a) {
768
773
  var c = e.call(this, n) || this;
@@ -797,7 +802,7 @@ var Hn = function(e) {
797
802
  e.prototype.unsubscribe.call(this), !o && ((n = this.onFinalize) === null || n === void 0 || n.call(this));
798
803
  }
799
804
  }, t;
800
- }(rt), Bn = function(e) {
805
+ }(rt), zn = function(e) {
801
806
  le(t, e);
802
807
  function t(n, o) {
803
808
  return e.call(this) || this;
@@ -817,7 +822,7 @@ var Hn = function(e) {
817
822
  return ((t == null ? void 0 : t.clearInterval) || clearInterval)(e);
818
823
  },
819
824
  delegate: void 0
820
- }, Yn = function(e) {
825
+ }, Un = function(e) {
821
826
  le(t, e);
822
827
  function t(n, o) {
823
828
  var r = e.call(this, n, o) || this;
@@ -859,7 +864,7 @@ var Hn = function(e) {
859
864
  this.work = this.state = this.scheduler = null, this.pending = !1, Re(i, this), o != null && (this.id = this.recycleAsyncId(r, o, null)), this.delay = null, e.prototype.unsubscribe.call(this);
860
865
  }
861
866
  }, t;
862
- }(Bn), st = {
867
+ }(zn), st = {
863
868
  now: function() {
864
869
  return (st.delegate || Date).now();
865
870
  },
@@ -871,7 +876,7 @@ var Hn = function(e) {
871
876
  return e.prototype.schedule = function(t, n, o) {
872
877
  return n === void 0 && (n = 0), new this.schedulerActionCtor(this, t).schedule(o, n);
873
878
  }, e.now = st.now, e;
874
- }(), Xn = function(e) {
879
+ }(), Wn = function(e) {
875
880
  le(t, e);
876
881
  function t(n, o) {
877
882
  o === void 0 && (o = ht.now);
@@ -896,18 +901,18 @@ var Hn = function(e) {
896
901
  throw r;
897
902
  }
898
903
  }, t;
899
- }(ht), at = new Xn(Yn), qn = at;
900
- function Ht(e) {
904
+ }(ht), at = new Wn(Un), Hn = at;
905
+ function zt(e) {
901
906
  return e && G(e.schedule);
902
907
  }
903
- function Gn(e) {
908
+ function Bn(e) {
904
909
  return e instanceof Date && !isNaN(e);
905
910
  }
906
- function Zn(e, t, n) {
907
- e === void 0 && (e = 0), n === void 0 && (n = qn);
911
+ function Yn(e, t, n) {
912
+ e === void 0 && (e = 0), n === void 0 && (n = Hn);
908
913
  var o = -1;
909
- return t != null && (Ht(t) ? n = t : o = t), new ne(function(r) {
910
- var i = Gn(e) ? +e - n.now() : e;
914
+ return t != null && (zt(t) ? n = t : o = t), new ne(function(r) {
915
+ var i = Bn(e) ? +e - n.now() : e;
911
916
  i < 0 && (i = 0);
912
917
  var s = 0;
913
918
  return n.schedule(function() {
@@ -915,14 +920,14 @@ function Zn(e, t, n) {
915
920
  }, i);
916
921
  });
917
922
  }
918
- function Bt(e) {
923
+ function Ut(e) {
919
924
  return e[e.length - 1];
920
925
  }
921
- function Jn(e) {
922
- return G(Bt(e)) ? e.pop() : void 0;
926
+ function Xn(e) {
927
+ return G(Ut(e)) ? e.pop() : void 0;
923
928
  }
924
- function Yt(e) {
925
- return Ht(Bt(e)) ? e.pop() : void 0;
929
+ function Wt(e) {
930
+ return zt(Ut(e)) ? e.pop() : void 0;
926
931
  }
927
932
  function ge(e, t, n, o, r) {
928
933
  o === void 0 && (o = 0), r === void 0 && (r = !1);
@@ -940,7 +945,7 @@ function _e(e) {
940
945
  })), r && (o.unsubscribe(), o = null, i.subscribe(n));
941
946
  });
942
947
  }
943
- function Xt(e, t) {
948
+ function Ht(e, t) {
944
949
  return t === void 0 && (t = 0), K(function(n, o) {
945
950
  n.subscribe(Z(o, function(r) {
946
951
  return ge(o, e, function() {
@@ -957,20 +962,20 @@ function Xt(e, t) {
957
962
  }));
958
963
  });
959
964
  }
960
- function qt(e, t) {
965
+ function Bt(e, t) {
961
966
  return t === void 0 && (t = 0), K(function(n, o) {
962
967
  o.add(e.schedule(function() {
963
968
  return n.subscribe(o);
964
969
  }, t));
965
970
  });
966
971
  }
967
- function Kn(e, t) {
968
- return ee(e).pipe(qt(t), Xt(t));
972
+ function qn(e, t) {
973
+ return ee(e).pipe(Bt(t), Ht(t));
969
974
  }
970
- function Qn(e, t) {
971
- return ee(e).pipe(qt(t), Xt(t));
975
+ function Gn(e, t) {
976
+ return ee(e).pipe(Bt(t), Ht(t));
972
977
  }
973
- function eo(e, t) {
978
+ function Zn(e, t) {
974
979
  return new ne(function(n) {
975
980
  var o = 0;
976
981
  return t.schedule(function() {
@@ -978,11 +983,11 @@ function eo(e, t) {
978
983
  });
979
984
  });
980
985
  }
981
- function to(e, t) {
986
+ function Jn(e, t) {
982
987
  return new ne(function(n) {
983
988
  var o;
984
989
  return ge(n, t, function() {
985
- o = e[Vt](), ge(n, t, function() {
990
+ o = e[_t](), ge(n, t, function() {
986
991
  var r, i, s;
987
992
  try {
988
993
  r = o.next(), i = r.value, s = r.done;
@@ -997,7 +1002,7 @@ function to(e, t) {
997
1002
  };
998
1003
  });
999
1004
  }
1000
- function Gt(e, t) {
1005
+ function Yt(e, t) {
1001
1006
  if (!e)
1002
1007
  throw new Error("Iterable cannot be null");
1003
1008
  return new ne(function(n) {
@@ -1011,28 +1016,28 @@ function Gt(e, t) {
1011
1016
  });
1012
1017
  });
1013
1018
  }
1014
- function no(e, t) {
1015
- return Gt(zt(e), t);
1019
+ function Kn(e, t) {
1020
+ return Yt(jt(e), t);
1016
1021
  }
1017
- function oo(e, t) {
1022
+ function Qn(e, t) {
1018
1023
  if (e != null) {
1019
- if (_t(e))
1020
- return Kn(e, t);
1021
- if (At(e))
1022
- return eo(e, t);
1023
- if (Nt(e))
1024
- return Qn(e, t);
1024
+ if (Rt(e))
1025
+ return qn(e, t);
1026
+ if (Ct(e))
1027
+ return Zn(e, t);
1028
+ if (Ft(e))
1029
+ return Gn(e, t);
1030
+ if (Lt(e))
1031
+ return Yt(e, t);
1025
1032
  if (Mt(e))
1026
- return Gt(e, t);
1027
- if (kt(e))
1028
- return to(e, t);
1029
- if (Ut(e))
1030
- return no(e, t);
1033
+ return Jn(e, t);
1034
+ if (Vt(e))
1035
+ return Kn(e, t);
1031
1036
  }
1032
- throw jt(e);
1037
+ throw Dt(e);
1033
1038
  }
1034
- function ro(e, t) {
1035
- return t ? oo(e, t) : ee(e);
1039
+ function eo(e, t) {
1040
+ return t ? Qn(e, t) : ee(e);
1036
1041
  }
1037
1042
  function k(e, t) {
1038
1043
  return K(function(n, o) {
@@ -1042,36 +1047,36 @@ function k(e, t) {
1042
1047
  }));
1043
1048
  });
1044
1049
  }
1045
- function io(e, t, n, o, r, i, s, a) {
1050
+ function to(e, t, n, o, r, i, s, a) {
1046
1051
  var c = [], u = 0, d = 0, l = !1, f = function() {
1047
1052
  l && !c.length && !u && t.complete();
1048
- }, g = function(v) {
1053
+ }, p = function(v) {
1049
1054
  return u < o ? y(v) : c.push(v);
1050
1055
  }, y = function(v) {
1051
1056
  i && t.next(v), u++;
1052
1057
  var w = !1;
1053
- ee(n(v, d++)).subscribe(Z(t, function(p) {
1054
- r == null || r(p), i ? g(p) : t.next(p);
1058
+ ee(n(v, d++)).subscribe(Z(t, function(g) {
1059
+ r == null || r(g), i ? p(g) : t.next(g);
1055
1060
  }, function() {
1056
1061
  w = !0;
1057
1062
  }, void 0, function() {
1058
1063
  if (w)
1059
1064
  try {
1060
1065
  u--;
1061
- for (var p = function() {
1066
+ for (var g = function() {
1062
1067
  var C = c.shift();
1063
1068
  s ? ge(t, s, function() {
1064
1069
  return y(C);
1065
1070
  }) : y(C);
1066
1071
  }; c.length && u < o; )
1067
- p();
1072
+ g();
1068
1073
  f();
1069
1074
  } catch (C) {
1070
1075
  t.error(C);
1071
1076
  }
1072
1077
  }));
1073
1078
  };
1074
- return e.subscribe(Z(t, g, function() {
1079
+ return e.subscribe(Z(t, p, function() {
1075
1080
  l = !0, f();
1076
1081
  })), function() {
1077
1082
  a == null || a();
@@ -1083,16 +1088,16 @@ function ie(e, t, n) {
1083
1088
  return t(o, i, r, s);
1084
1089
  })(ee(e(o, r)));
1085
1090
  }, n) : (typeof t == "number" && (n = t), K(function(o, r) {
1086
- return io(o, r, e, n);
1091
+ return to(o, r, e, n);
1087
1092
  }));
1088
1093
  }
1089
- function so(e) {
1094
+ function no(e) {
1090
1095
  return e === void 0 && (e = 1 / 0), ie(Te, e);
1091
1096
  }
1092
- function ao() {
1093
- return so(1);
1097
+ function oo() {
1098
+ return no(1);
1094
1099
  }
1095
- var co = Ot(function(e) {
1100
+ var ro = Et(function(e) {
1096
1101
  return function() {
1097
1102
  e(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
1098
1103
  };
@@ -1107,7 +1112,7 @@ var co = Ot(function(e) {
1107
1112
  return o.operator = n, o;
1108
1113
  }, t.prototype._throwIfClosed = function() {
1109
1114
  if (this.closed)
1110
- throw new co();
1115
+ throw new ro();
1111
1116
  }, t.prototype.next = function(n) {
1112
1117
  var o = this;
1113
1118
  Oe(function() {
@@ -1164,7 +1169,7 @@ var co = Ot(function(e) {
1164
1169
  return this._throwIfClosed(), this._checkFinalizedStatuses(n), this._innerSubscribe(n);
1165
1170
  }, t.prototype._innerSubscribe = function(n) {
1166
1171
  var o = this, r = this, i = r.hasError, s = r.isStopped, a = r.observers;
1167
- return i || s ? Rt : (this.currentObservers = null, a.push(n), new xe(function() {
1172
+ return i || s ? At : (this.currentObservers = null, a.push(n), new xe(function() {
1168
1173
  o.currentObservers = null, Re(a, n);
1169
1174
  }));
1170
1175
  }, t.prototype._checkFinalizedStatuses = function(n) {
@@ -1193,10 +1198,10 @@ var co = Ot(function(e) {
1193
1198
  (o = (n = this.destination) === null || n === void 0 ? void 0 : n.complete) === null || o === void 0 || o.call(n);
1194
1199
  }, t.prototype._subscribe = function(n) {
1195
1200
  var o, r;
1196
- return (r = (o = this.source) === null || o === void 0 ? void 0 : o.subscribe(n)) !== null && r !== void 0 ? r : Rt;
1201
+ return (r = (o = this.source) === null || o === void 0 ? void 0 : o.subscribe(n)) !== null && r !== void 0 ? r : At;
1197
1202
  }, t;
1198
1203
  }(ct);
1199
- function uo(e) {
1204
+ function io(e) {
1200
1205
  return K(function(t, n) {
1201
1206
  var o = !1, r = null, i = null, s = function() {
1202
1207
  if (i == null || i.unsubscribe(), i = null, o) {
@@ -1243,14 +1248,14 @@ function Ze(e, t) {
1243
1248
  function Je() {
1244
1249
  for (var e = [], t = 0; t < arguments.length; t++)
1245
1250
  e[t] = arguments[t];
1246
- return ao()(ro(e, Yt(e)));
1251
+ return oo()(eo(e, Wt(e)));
1247
1252
  }
1248
- var lo = new ne(function(e) {
1253
+ var so = new ne(function(e) {
1249
1254
  return e.complete();
1250
1255
  });
1251
1256
  function ye(e) {
1252
1257
  return e <= 0 ? function() {
1253
- return lo;
1258
+ return so;
1254
1259
  } : K(function(t, n) {
1255
1260
  var o = 0;
1256
1261
  t.subscribe(Z(n, function(r) {
@@ -1258,7 +1263,7 @@ function ye(e) {
1258
1263
  }));
1259
1264
  });
1260
1265
  }
1261
- function fo() {
1266
+ function ao() {
1262
1267
  return K(function(e, t) {
1263
1268
  e.subscribe(Z(t, Pe));
1264
1269
  });
@@ -1268,22 +1273,22 @@ function he(e) {
1268
1273
  return e;
1269
1274
  });
1270
1275
  }
1271
- function Zt(e, t) {
1276
+ function Xt(e, t) {
1272
1277
  return t ? function(n) {
1273
- return Je(t.pipe(ye(1), fo()), n.pipe(Zt(e)));
1278
+ return Je(t.pipe(ye(1), ao()), n.pipe(Xt(e)));
1274
1279
  } : ie(function(n, o) {
1275
1280
  return ee(e(n, o)).pipe(ye(1), he(n));
1276
1281
  });
1277
1282
  }
1278
1283
  function He(e, t) {
1279
1284
  t === void 0 && (t = at);
1280
- var n = Zn(e, t);
1281
- return Zt(function() {
1285
+ var n = Yn(e, t);
1286
+ return Xt(function() {
1282
1287
  return n;
1283
1288
  });
1284
1289
  }
1285
1290
  function Q(e, t) {
1286
- return t === void 0 && (t = Te), e = e ?? go, K(function(n, o) {
1291
+ return t === void 0 && (t = Te), e = e ?? co, K(function(n, o) {
1287
1292
  var r, i = !0;
1288
1293
  n.subscribe(Z(o, function(s) {
1289
1294
  var a = t(s);
@@ -1291,7 +1296,7 @@ function Q(e, t) {
1291
1296
  }));
1292
1297
  });
1293
1298
  }
1294
- function go(e, t) {
1299
+ function co(e, t) {
1295
1300
  return e === t;
1296
1301
  }
1297
1302
  function B(e, t) {
@@ -1302,9 +1307,9 @@ function B(e, t) {
1302
1307
  }));
1303
1308
  });
1304
1309
  }
1305
- function Jt(e, t) {
1310
+ function qt(e, t) {
1306
1311
  return t ? function(n) {
1307
- return n.pipe(Jt(function(o, r) {
1312
+ return n.pipe(qt(function(o, r) {
1308
1313
  return ee(e(o, r)).pipe(k(function(i, s) {
1309
1314
  return t(o, i, r, s);
1310
1315
  }));
@@ -1320,7 +1325,7 @@ function Jt(e, t) {
1320
1325
  }));
1321
1326
  });
1322
1327
  }
1323
- function Kt() {
1328
+ function Gt() {
1324
1329
  return K(function(e, t) {
1325
1330
  var n, o = !1;
1326
1331
  e.subscribe(Z(t, function(r) {
@@ -1329,7 +1334,7 @@ function Kt() {
1329
1334
  }));
1330
1335
  });
1331
1336
  }
1332
- var po = function(e) {
1337
+ var uo = function(e) {
1333
1338
  le(t, e);
1334
1339
  function t(n, o, r) {
1335
1340
  n === void 0 && (n = 1 / 0), o === void 0 && (o = 1 / 0), r === void 0 && (r = st);
@@ -1359,28 +1364,28 @@ function oe(e) {
1359
1364
  return new ct();
1360
1365
  } : t, o = e.resetOnError, r = o === void 0 ? !0 : o, i = e.resetOnComplete, s = i === void 0 ? !0 : i, a = e.resetOnRefCountZero, c = a === void 0 ? !0 : a;
1361
1366
  return function(u) {
1362
- var d, l, f, g = 0, y = !1, v = !1, w = function() {
1367
+ var d, l, f, p = 0, y = !1, v = !1, w = function() {
1363
1368
  l == null || l.unsubscribe(), l = void 0;
1364
- }, p = function() {
1369
+ }, g = function() {
1365
1370
  w(), d = f = void 0, y = v = !1;
1366
1371
  }, C = function() {
1367
1372
  var N = d;
1368
- p(), N == null || N.unsubscribe();
1373
+ g(), N == null || N.unsubscribe();
1369
1374
  };
1370
1375
  return K(function(N, I) {
1371
- g++, !v && !y && w();
1376
+ p++, !v && !y && w();
1372
1377
  var S = f = f ?? n();
1373
1378
  I.add(function() {
1374
- g--, g === 0 && !v && !y && (l = Be(C, c));
1375
- }), S.subscribe(I), !d && g > 0 && (d = new Ie({
1379
+ p--, p === 0 && !v && !y && (l = Be(C, c));
1380
+ }), S.subscribe(I), !d && p > 0 && (d = new Ie({
1376
1381
  next: function(m) {
1377
1382
  return S.next(m);
1378
1383
  },
1379
1384
  error: function(m) {
1380
- v = !0, w(), l = Be(p, r, m), S.error(m);
1385
+ v = !0, w(), l = Be(g, r, m), S.error(m);
1381
1386
  },
1382
1387
  complete: function() {
1383
- y = !0, w(), l = Be(p, s), S.complete();
1388
+ y = !0, w(), l = Be(g, s), S.complete();
1384
1389
  }
1385
1390
  }), ee(N).subscribe(d));
1386
1391
  })(u);
@@ -1406,7 +1411,7 @@ function ut(e, t, n) {
1406
1411
  var o, r, i, s, a = !1;
1407
1412
  return e && typeof e == "object" ? (o = e.bufferSize, s = o === void 0 ? 1 / 0 : o, r = e.windowTime, t = r === void 0 ? 1 / 0 : r, i = e.refCount, a = i === void 0 ? !1 : i, n = e.scheduler) : s = e ?? 1 / 0, oe({
1408
1413
  connector: function() {
1409
- return new po(s, t, n);
1414
+ return new uo(s, t, n);
1410
1415
  },
1411
1416
  resetOnError: !0,
1412
1417
  resetOnComplete: !1,
@@ -1421,7 +1426,7 @@ function Me(e) {
1421
1426
  function lt() {
1422
1427
  for (var e = [], t = 0; t < arguments.length; t++)
1423
1428
  e[t] = arguments[t];
1424
- var n = Yt(e);
1429
+ var n = Wt(e);
1425
1430
  return K(function(o, r) {
1426
1431
  (n ? Je(e, o, n) : Je(e, o)).subscribe(r);
1427
1432
  });
@@ -1475,7 +1480,7 @@ function U(e, t, n) {
1475
1480
  function re() {
1476
1481
  for (var e = [], t = 0; t < arguments.length; t++)
1477
1482
  e[t] = arguments[t];
1478
- var n = Jn(e);
1483
+ var n = Xn(e);
1479
1484
  return K(function(o, r) {
1480
1485
  for (var i = e.length, s = new Array(i), a = e.map(function() {
1481
1486
  return !1;
@@ -1493,13 +1498,13 @@ function re() {
1493
1498
  }));
1494
1499
  });
1495
1500
  }
1496
- const ho = (e) => ({ fontScale: t = 1, lineHeight: n = "publisher", fontWeight: o = "publisher", fontJustification: r = "publisher", ...i }) => {
1497
- const s = new q({
1498
- fontScale: t,
1499
- lineHeight: n,
1500
- fontWeight: o,
1501
- fontJustification: r
1502
- }), a = e(i), c = () => `
1501
+ const lo = (e) => (t) => {
1502
+ const { fontScale: n = 1, lineHeight: o = "publisher", fontWeight: r = "publisher", fontJustification: i = "publisher" } = t, s = new q({
1503
+ fontScale: n,
1504
+ lineHeight: o,
1505
+ fontWeight: r,
1506
+ fontJustification: i
1507
+ }), a = e(t), c = () => `
1503
1508
 
1504
1509
  body {
1505
1510
  ${s.value.fontScale !== 1 ? `font-size: ${s.value.fontScale}em !important;` : ""}
@@ -1507,39 +1512,38 @@ const ho = (e) => ({ fontScale: t = 1, lineHeight: n = "publisher", fontWeight:
1507
1512
  ${s.value.fontWeight !== "publisher" ? `font-weight: ${s.value.fontWeight} !important;` : ""}
1508
1513
  ${s.value.fontJustification !== "publisher" ? `text-align: ${s.value.fontJustification} !important;` : ""}
1509
1514
  }
1510
- `, u = (l) => {
1511
- a.manipulateSpineItems(({ removeStyle: f, addStyle: g, item: y }) => (y.renditionLayout !== "pre-paginated" && (f("prose-reader-fonts"), g("prose-reader-fonts", c())), l));
1515
+ `, u = (f) => {
1516
+ a.manipulateSpineItems(({ removeStyle: p, addStyle: y, item: v }) => (v.renditionLayout !== "pre-paginated" && (p("prose-reader-fonts"), y("prose-reader-fonts", c())), f));
1512
1517
  };
1513
- a.registerHook("item.onLoad", ({ removeStyle: l, addStyle: f, item: g }) => {
1514
- g.renditionLayout !== "pre-paginated" && (l("prose-reader-fonts"), f("prose-reader-fonts", c()));
1518
+ a.registerHook("item.onLoad", ({ removeStyle: f, addStyle: p, item: y }) => {
1519
+ y.renditionLayout !== "pre-paginated" && (f("prose-reader-fonts"), p("prose-reader-fonts", c()));
1515
1520
  });
1516
- const d = (l) => l.pipe(
1517
- Kt(),
1518
- ft(([f, g]) => g.fontScale !== f.fontScale || g.lineHeight !== f.lineHeight)
1521
+ const d = (f) => f.pipe(
1522
+ Gt(),
1523
+ ft(([p, y]) => y.fontScale !== p.fontScale || y.lineHeight !== p.lineHeight)
1519
1524
  );
1520
- return s.asObservable().pipe(d, U(u), dn(a.$.destroy$)).subscribe(), {
1525
+ s.asObservable().pipe(d, U(u), an(a.$.destroy$)).subscribe();
1526
+ const l = $e([a.settings$, s]).pipe(
1527
+ ft(([f, p]) => ({
1528
+ ...f,
1529
+ ...p
1530
+ }))
1531
+ );
1532
+ return {
1521
1533
  ...a,
1522
- setSettings: (l) => {
1534
+ setSettings: (f) => {
1523
1535
  const {
1524
- fontJustification: f = s.value.fontJustification,
1525
- fontScale: g = s.value.fontScale,
1526
- fontWeight: y = s.value.fontWeight,
1527
- lineHeight: v = s.value.lineHeight,
1528
- ...w
1529
- } = l;
1530
- mo(l, ["fontJustification", "fontScale", "fontWeight", "lineHeight"]) && s.next({ fontJustification: f, fontScale: g, fontWeight: y, lineHeight: v }), a.setSettings(w);
1536
+ fontJustification: p = s.value.fontJustification,
1537
+ fontScale: y = s.value.fontScale,
1538
+ fontWeight: v = s.value.fontWeight,
1539
+ lineHeight: w = s.value.lineHeight,
1540
+ ...g
1541
+ } = f;
1542
+ fo(f, ["fontJustification", "fontScale", "fontWeight", "lineHeight"]) && s.next({ fontJustification: p, fontScale: y, fontWeight: v, lineHeight: w }), a.setSettings(g);
1531
1543
  },
1532
- $: {
1533
- ...a.$,
1534
- settings$: $e([a.$.settings$, s]).pipe(
1535
- ft(([l, f]) => ({
1536
- ...l,
1537
- ...f
1538
- }))
1539
- )
1540
- }
1544
+ settings$: l
1541
1545
  };
1542
- }, mo = (e, t) => t.some((n) => n in e), yo = (e) => (t) => {
1546
+ }, fo = (e, t) => t.some((n) => n in e), go = (e) => (t) => {
1543
1547
  const n = e(t), o = (i) => {
1544
1548
  i.key === "ArrowRight" && n.turnRight(), i.key === "ArrowLeft" && n.turnLeft();
1545
1549
  };
@@ -1555,7 +1559,7 @@ const ho = (e) => ({ fontScale: t = 1, lineHeight: n = "publisher", fontWeight:
1555
1559
  document.removeEventListener("keyup", o), n.destroy();
1556
1560
  }
1557
1561
  };
1558
- }, vo = !1, bo = (e) => {
1562
+ }, po = !1, ho = (e) => {
1559
1563
  let t;
1560
1564
  e.manipulateContainer((u) => (t = u.ownerDocument.createElement("div"), t.style.cssText = `
1561
1565
  position: absolute;
@@ -1564,8 +1568,8 @@ const ho = (e) => ({ fontScale: t = 1, lineHeight: n = "publisher", fontWeight:
1564
1568
  width: 100%;
1565
1569
  height: 100%;
1566
1570
  visibility: hidden;
1567
- `, u.appendChild(t), vo));
1568
- const n = (u) => fn(u, me).pipe(
1571
+ `, u.appendChild(t), po));
1572
+ const n = (u) => cn(u, me).pipe(
1569
1573
  U(() => {
1570
1574
  t == null || t.style.setProperty("visibility", "hidden");
1571
1575
  })
@@ -1583,10 +1587,10 @@ const ho = (e) => ({ fontScale: t = 1, lineHeight: n = "publisher", fontWeight:
1583
1587
  ),
1584
1588
  j(e.$.destroy$)
1585
1589
  );
1586
- }, Qt = (e) => k((t) => Object.entries(t).reduce((n, [o, r]) => e.includes(o) ? {
1590
+ }, Zt = (e) => k((t) => Object.entries(t).reduce((n, [o, r]) => e.includes(o) ? {
1587
1591
  ...n,
1588
1592
  [o]: r
1589
- } : n, {})), wo = Object.prototype.hasOwnProperty, So = (e, t) => e === t ? e !== 0 || t !== 0 || 1 / e === 1 / t : !1, ce = (e, t, n) => {
1593
+ } : n, {})), mo = Object.prototype.hasOwnProperty, yo = (e, t) => e === t ? e !== 0 || t !== 0 || 1 / e === 1 / t : !1, ce = (e, t, n) => {
1590
1594
  if (e === t)
1591
1595
  return !0;
1592
1596
  if (typeof e != "object" || e === null || typeof t != "object" || t === null)
@@ -1594,17 +1598,17 @@ const ho = (e) => ({ fontScale: t = 1, lineHeight: n = "publisher", fontWeight:
1594
1598
  const o = Object.keys(e), r = Object.keys(t);
1595
1599
  if (o.length !== r.length)
1596
1600
  return !1;
1597
- const i = n && typeof n.customEqual == "function" ? n.customEqual : So;
1601
+ const i = n && typeof n.customEqual == "function" ? n.customEqual : yo;
1598
1602
  for (let s = 0; s < o.length; s++) {
1599
1603
  const a = o[s] || "";
1600
- if (!wo.call(t, a) || !i(e[a], t[a]))
1604
+ if (!mo.call(t, a) || !i(e[a], t[a]))
1601
1605
  return !1;
1602
1606
  }
1603
1607
  return !0;
1604
- }, ui = (e, t) => e.reduce((n, o) => {
1608
+ }, si = (e, t) => e.reduce((n, o) => {
1605
1609
  const r = t(o);
1606
1610
  return n[r] || (n[r] = []), n[r].push(o), n;
1607
- }, {}), Po = (e) => {
1611
+ }, {}), vo = (e) => {
1608
1612
  const t = new FileReader();
1609
1613
  return new Promise((n) => {
1610
1614
  t.addEventListener(
@@ -1615,7 +1619,7 @@ const ho = (e) => ({ fontScale: t = 1, lineHeight: n = "publisher", fontWeight:
1615
1619
  !1
1616
1620
  ), t.readAsDataURL(e);
1617
1621
  });
1618
- }, Io = (e) => {
1622
+ }, bo = (e) => {
1619
1623
  e.registerHook("item.onAfterLayout", ({ item: t, blankPagePosition: n, minimumWidth: o }) => {
1620
1624
  var c;
1621
1625
  const r = e.getSpineItem(t.id);
@@ -1627,50 +1631,50 @@ const ho = (e) => ({ fontScale: t = 1, lineHeight: n = "publisher", fontWeight:
1627
1631
  n === "none" && u && (a == null || a.style.setProperty("left", e.context.isRTL() ? "75%" : "25%"));
1628
1632
  }
1629
1633
  });
1630
- }, $o = !1, xo = (e) => ({ pageHorizontalMargin: t = 24, pageVerticalMargin: n = 24, ...o }) => {
1631
- const r = e(o), i = new q({
1632
- pageHorizontalMargin: t,
1633
- pageVerticalMargin: n
1634
+ }, wo = !1, So = (e) => (t) => {
1635
+ const { pageHorizontalMargin: n = 24, pageVerticalMargin: o = 24 } = t, r = e(t), i = new q({
1636
+ pageHorizontalMargin: n,
1637
+ pageVerticalMargin: o
1634
1638
  });
1635
1639
  r.registerHook("onViewportOffsetAdjust", () => {
1636
1640
  let c = !1;
1637
- r.manipulateSpineItems(({ frame: u }) => (!c && u && (u.getBoundingClientRect().left, c = !0), $o));
1641
+ r.manipulateSpineItems(({ frame: u }) => (!c && u && (u.getBoundingClientRect().left, c = !0), wo));
1638
1642
  }), r.registerHook("item.onLayoutBeforeMeasurement", ({ frame: c, minimumWidth: u, item: d, isImageType: l }) => {
1639
1643
  var v, w;
1640
- const { pageHorizontalMargin: f = 0, pageVerticalMargin: g = 0 } = i.value, y = r.context.getPageSize();
1644
+ const { pageHorizontalMargin: f = 0, pageVerticalMargin: p = 0 } = i.value, y = r.context.getPageSize();
1641
1645
  if (d.renditionLayout === "reflowable" && c.getIsReady() && !l() && !c.getViewportDimensions()) {
1642
- let p = y.width - f * 2;
1643
- const C = y.height - g * 2;
1646
+ let g = y.width - f * 2;
1647
+ const C = y.height - p * 2;
1644
1648
  let N = y.width - f * 2, I = f * 2;
1645
- c.isUsingVerticalWriting() && (N = u - f * 2, p = C, I = g * 2), (v = c.getManipulableFrame()) == null || v.removeStyle("prose-layout-enhancer-css"), (w = c.getManipulableFrame()) == null || w.addStyle(
1649
+ c.isUsingVerticalWriting() && (N = u - f * 2, g = C, I = p * 2), (v = c.getManipulableFrame()) == null || v.removeStyle("prose-layout-enhancer-css"), (w = c.getManipulableFrame()) == null || w.addStyle(
1646
1650
  "prose-layout-enhancer-css",
1647
1651
  `
1648
1652
  body {
1649
1653
  width: ${N}px !important;
1650
- margin: ${g}px ${f}px !important;
1654
+ margin: ${p}px ${f}px !important;
1651
1655
  column-gap: ${I}px !important;
1652
- column-width: ${p}px !important;
1656
+ column-width: ${g}px !important;
1653
1657
  height: ${C}px !important;
1654
1658
  }
1655
1659
  img, video, audio, object, svg {
1656
- max-width: ${p}px !important;
1660
+ max-width: ${g}px !important;
1657
1661
  max-height: ${C}px !important;
1658
1662
  }
1659
1663
  table {
1660
- max-width: ${p}px !important;
1664
+ max-width: ${g}px !important;
1661
1665
  }
1662
1666
  td {
1663
- max-width: ${p}px;
1667
+ max-width: ${g}px;
1664
1668
  }
1665
1669
  `
1666
1670
  );
1667
1671
  }
1668
- }), Io(r);
1672
+ }), bo(r);
1669
1673
  let s;
1670
- return o.layoutAutoResize === "container" && (s = new ResizeObserver(() => {
1674
+ return t.layoutAutoResize === "container" && (s = new ResizeObserver(() => {
1671
1675
  r == null || r.layout();
1672
- }), s.observe(o.containerElement)), bo(r).subscribe(), i.pipe(
1673
- Qt(["pageHorizontalMargin", "pageVerticalMargin"]),
1676
+ }), s.observe(t.containerElement)), ho(r).subscribe(), i.pipe(
1677
+ Zt(["pageHorizontalMargin", "pageVerticalMargin"]),
1674
1678
  Q(ce),
1675
1679
  Me(1),
1676
1680
  U(() => {
@@ -1688,17 +1692,14 @@ const ho = (e) => ({ fontScale: t = 1, lineHeight: n = "publisher", fontWeight:
1688
1692
  pageVerticalMargin: c ?? i.value.pageVerticalMargin
1689
1693
  }), r.setSettings(d);
1690
1694
  },
1691
- $: {
1692
- ...r.$,
1693
- settings$: $e([r.$.settings$, i.asObservable()]).pipe(
1694
- k(([c, u]) => ({
1695
- ...c,
1696
- ...u
1697
- }))
1698
- )
1699
- }
1695
+ settings$: $e([r.settings$, i.asObservable()]).pipe(
1696
+ k(([c, u]) => ({
1697
+ ...c,
1698
+ ...u
1699
+ }))
1700
+ )
1700
1701
  };
1701
- }, Fe = "@prose-reader/core", ve = (e) => `[${e}]`, To = (e, t = 0) => {
1702
+ }, Fe = "@prose-reader/core", ve = (e) => `[${e}]`, Po = (e, t = 0) => {
1702
1703
  let n = 0;
1703
1704
  const o = performance.now();
1704
1705
  return () => {
@@ -1716,7 +1717,7 @@ const ho = (e) => ({ fontScale: t = 1, lineHeight: n = "publisher", fontWeight:
1716
1717
  error: (...t) => {
1717
1718
  console.error(...t);
1718
1719
  },
1719
- time: To,
1720
+ time: Po,
1720
1721
  logMetric: (t, n = 0) => {
1721
1722
  window.__PROSE_READER_DEBUG && (t.duration <= n || console.warn(
1722
1723
  "[prose-reader] [metric] ",
@@ -1736,7 +1737,7 @@ const ho = (e) => ({ fontScale: t = 1, lineHeight: n = "publisher", fontWeight:
1736
1737
  }), R = {
1737
1738
  ...yt(),
1738
1739
  namespace: (e) => yt(e)
1739
- }, Co = (e) => (t) => {
1740
+ }, Io = (e) => (t) => {
1740
1741
  const n = e(t), o = new H(), r = (i) => {
1741
1742
  var u;
1742
1743
  if (!i.href)
@@ -1757,7 +1758,7 @@ const ho = (e) => ({ fontScale: t = 1, lineHeight: n = "publisher", fontWeight:
1757
1758
  links$: o.asObservable()
1758
1759
  }
1759
1760
  };
1760
- }, Fo = (e) => (t) => {
1761
+ }, $o = (e) => (t) => {
1761
1762
  const n = e(t), o = () => {
1762
1763
  var u;
1763
1764
  const i = n.getFocusedSpineItemIndex() || 0, { end: s = i } = n.locator.getSpineItemsFromReadingOrderPosition(n.getCurrentNavigationPosition()) || {}, a = ((u = n.context.getManifest()) == null ? void 0 : u.spineItems.length) ?? 0, c = s + 1;
@@ -1771,7 +1772,7 @@ const ho = (e) => ({ fontScale: t = 1, lineHeight: n = "publisher", fontWeight:
1771
1772
  goToLeftSpineItem: () => n.context.isRTL() ? o() : r(),
1772
1773
  goToRightSpineItem: () => n.context.isRTL() ? r() : o()
1773
1774
  };
1774
- }, Eo = "pagination", Ao = ({ context: e }) => {
1775
+ }, xo = "pagination", To = ({ context: e }) => {
1775
1776
  const t = new q({
1776
1777
  beginPageIndex: void 0,
1777
1778
  beginNumberOfPages: 0,
@@ -1789,7 +1790,7 @@ const ho = (e) => ({ fontScale: t = 1, lineHeight: n = "publisher", fontWeight:
1789
1790
  pageIndex: c.pageIndex,
1790
1791
  cfi: c.cfi
1791
1792
  }), r = R.measurePerformance(
1792
- `${Eo} updateBeginAndEnd`,
1793
+ `${xo} updateBeginAndEnd`,
1793
1794
  1,
1794
1795
  (c, u) => {
1795
1796
  const d = o(c), l = o(u), f = {
@@ -1808,7 +1809,7 @@ const ho = (e) => ({ fontScale: t = 1, lineHeight: n = "publisher", fontWeight:
1808
1809
  });
1809
1810
  },
1810
1811
  { disable: !0 }
1811
- ), i = () => t.value, s = t.asObservable().pipe(gn(ce));
1812
+ ), i = () => t.value, s = t.asObservable().pipe(un(ce));
1812
1813
  return {
1813
1814
  destroy: () => {
1814
1815
  t.complete();
@@ -1825,19 +1826,19 @@ const ho = (e) => ({ fontScale: t = 1, lineHeight: n = "publisher", fontWeight:
1825
1826
  }, ue = (e, t) => (t || 0) === 0 || (e || 0) === 0 ? 1 : Math.floor(Math.max(1, e / t)), Ee = (e, t, n) => {
1826
1827
  const o = ue(n, t), r = [...Array(o)].map((i, s) => s * t);
1827
1828
  return e >= o * t ? r[r.length - 1] || 0 : r.find((i) => e < i + t) || 0;
1828
- }, No = "paginationEnhancer", Oo = R.namespace(No), Ro = (e) => (t) => {
1829
+ }, Co = "paginationEnhancer", Fo = R.namespace(Co), Eo = (e) => (t) => {
1829
1830
  const n = e(t), o = {}, r = (l) => {
1830
1831
  const f = n.context.getManifest();
1831
- return l && f && Lo(f, l);
1832
+ return l && f && Ao(f, l);
1832
1833
  }, i = (l) => {
1833
- const f = n.context, g = l.beginSpineItemIndex !== void 0 ? n.getSpineItem(l.beginSpineItemIndex) : void 0, y = l.endSpineItemIndex !== void 0 ? n.getSpineItem(l.endSpineItemIndex) : void 0;
1834
+ const f = n.context, p = l.beginSpineItemIndex !== void 0 ? n.getSpineItem(l.beginSpineItemIndex) : void 0, y = l.endSpineItemIndex !== void 0 ? n.getSpineItem(l.endSpineItemIndex) : void 0;
1834
1835
  return {
1835
1836
  beginPageIndexInChapter: l.beginPageIndex,
1836
1837
  beginNumberOfPagesInChapter: l.beginNumberOfPages,
1837
- beginChapterInfo: g ? o[g.item.id] : void 0,
1838
+ beginChapterInfo: p ? o[p.item.id] : void 0,
1838
1839
  beginSpineItemIndex: l.beginSpineItemIndex,
1839
1840
  beginCfi: l.beginCfi,
1840
- beginSpineItemReadingDirection: g == null ? void 0 : g.getReadingDirection(),
1841
+ beginSpineItemReadingDirection: p == null ? void 0 : p.getReadingDirection(),
1841
1842
  endChapterInfo: y ? o[y.item.id] : void 0,
1842
1843
  endPageIndexInChapter: l.endPageIndex,
1843
1844
  endNumberOfPagesInChapter: l.endNumberOfPages,
@@ -1855,8 +1856,8 @@ const ho = (e) => ({ fontScale: t = 1, lineHeight: n = "publisher", fontWeight:
1855
1856
  isUsingSpread: f.shouldDisplaySpread()
1856
1857
  };
1857
1858
  }, s = (l) => {
1858
- const f = l.spineItemFrame.getWritingMode(), { width: g, height: y } = l.getElementDimensions(), v = n.context.getSettings();
1859
- return v.pageTurnDirection === "vertical" && v.pageTurnMode === "scrollable" ? 1 : f === "vertical-rl" ? ue(y, n.context.getPageSize().height) : ue(g, n.context.getPageSize().width);
1859
+ const f = l.spineItemFrame.getWritingMode(), { width: p, height: y } = l.getElementDimensions(), v = n.context.getSettings();
1860
+ return v.pageTurnDirection === "vertical" && v.pageTurnMode === "scrollable" ? 1 : f === "vertical-rl" ? ue(y, n.context.getPageSize().height) : ue(p, n.context.getPageSize().width);
1860
1861
  }, a = () => n.getSpineItems().map((l) => s(l), 0);
1861
1862
  n.$.itemsCreated$.pipe(
1862
1863
  U(
@@ -1866,17 +1867,20 @@ const ho = (e) => ({ fontScale: t = 1, lineHeight: n = "publisher", fontWeight:
1866
1867
  ),
1867
1868
  j(n.$.destroy$)
1868
1869
  ).subscribe();
1869
- const c = n.$.pagination$.pipe(
1870
- k(i),
1870
+ const c = n.pagination$.pipe(
1871
+ k((l) => ({
1872
+ ...l,
1873
+ ...i(l)
1874
+ })),
1871
1875
  Q(ce)
1872
1876
  ), u = n.$.layout$.pipe(
1873
1877
  Ze(10, me),
1874
- re(n.$.pagination$),
1878
+ re(n.pagination$),
1875
1879
  k(() => {
1876
1880
  const l = a();
1877
1881
  return {
1878
1882
  numberOfPagesPerItems: l,
1879
- numberOfTotalPages: l.reduce((f, g) => f + g, 0)
1883
+ numberOfTotalPages: l.reduce((f, p) => f + p, 0)
1880
1884
  };
1881
1885
  }),
1882
1886
  Q(ce),
@@ -1888,33 +1892,30 @@ const ho = (e) => ({ fontScale: t = 1, lineHeight: n = "publisher", fontWeight:
1888
1892
  k(([l, f]) => ({
1889
1893
  ...l,
1890
1894
  ...f,
1891
- beginAbsolutePageIndex: f.numberOfPagesPerItems.slice(0, l.beginSpineItemIndex).reduce((g, y) => g + y, l.beginPageIndexInChapter ?? 0),
1892
- endAbsolutePageIndex: f.numberOfPagesPerItems.slice(0, l.endSpineItemIndex).reduce((g, y) => g + y, l.endPageIndexInChapter ?? 0)
1895
+ beginAbsolutePageIndex: f.numberOfPagesPerItems.slice(0, l.beginSpineItemIndex).reduce((p, y) => p + y, l.beginPageIndexInChapter ?? 0),
1896
+ endAbsolutePageIndex: f.numberOfPagesPerItems.slice(0, l.endSpineItemIndex).reduce((p, y) => p + y, l.endPageIndexInChapter ?? 0)
1893
1897
  })),
1894
1898
  U((l) => {
1895
- Oo.log("pagination", l);
1899
+ Fo.log("pagination", l);
1896
1900
  }),
1897
1901
  ut(1),
1898
1902
  j(n.$.destroy$)
1899
1903
  );
1900
1904
  return {
1901
1905
  ...n,
1902
- $: {
1903
- ...n.$,
1904
- pagination$: d
1905
- }
1906
+ pagination$: d
1906
1907
  };
1907
- }, Lo = (e, t) => {
1908
+ }, Ao = (e, t) => {
1908
1909
  const { href: n } = t;
1909
- return en(n, e.nav.toc);
1910
- }, en = (e, t) => t.reduce((n, o) => {
1910
+ return Jt(n, e.nav.toc);
1911
+ }, Jt = (e, t) => t.reduce((n, o) => {
1911
1912
  const r = o.path.indexOf("#"), i = r > 0 ? o.path.substr(0, r) : o.path;
1912
1913
  if (e.endsWith(i))
1913
1914
  return {
1914
1915
  title: o.title,
1915
1916
  path: o.path
1916
1917
  };
1917
- const s = en(e, o.contents);
1918
+ const s = Jt(e, o.contents);
1918
1919
  return s ? {
1919
1920
  subChapter: s,
1920
1921
  title: o.title,
@@ -1935,7 +1936,7 @@ const ho = (e) => ({ fontScale: t = 1, lineHeight: n = "publisher", fontWeight:
1935
1936
  backgroundColor: "#191717",
1936
1937
  foregroundColor: "#f1ebeb"
1937
1938
  }
1938
- ], Do = (e) => (t) => {
1939
+ ], No = (e) => (t) => {
1939
1940
  const n = e(t), o = new q(t.theme ?? "bright"), r = () => {
1940
1941
  const a = bt.find((c) => c.name === o.value);
1941
1942
  return `
@@ -1978,16 +1979,7 @@ const ho = (e) => ({ fontScale: t = 1, lineHeight: n = "publisher", fontWeight:
1978
1979
  }
1979
1980
  }
1980
1981
  };
1981
- };
1982
- function _o(...e) {
1983
- return e.length === 0 ? (t) => t : e.length === 1 ? e[0] : e.reduce(
1984
- (t, n) => (...o) => n(t(...o))
1985
- );
1986
- }
1987
- function tn(...e) {
1988
- return _o(...e);
1989
- }
1990
- const wt = !1, Mo = (e) => {
1982
+ }, wt = !1, Oo = (e) => {
1991
1983
  const t = new q(!1);
1992
1984
  let n, o = { x: 0, y: 0 }, r = { x: 0, y: 0 }, i = 1, s = 1;
1993
1985
  const a = (y) => {
@@ -2008,11 +2000,11 @@ const wt = !1, Mo = (e) => {
2008
2000
  }, c = () => {
2009
2001
  i = s;
2010
2002
  }, u = (y) => {
2011
- const v = n == null ? void 0 : n.querySelector("img"), w = Math.ceil((y < 1 ? i - (1 - y) : i + (y - 1)) * 100) / 100, p = Math.max(w, 1);
2003
+ const v = n == null ? void 0 : n.querySelector("img"), w = Math.ceil((y < 1 ? i - (1 - y) : i + (y - 1)) * 100) / 100, g = Math.max(w, 1);
2012
2004
  w < 1 && (o = { x: 0, y: 0 }), v == null || v.style.setProperty(
2013
2005
  "transform",
2014
- `translate3d(${o.x}px, ${o.y}px, 0px) scale3d(${p}, ${p}, 1)`
2015
- ), s = p;
2006
+ `translate3d(${o.x}px, ${o.y}px, 0px) scale3d(${g}, ${g}, 1)`
2007
+ ), s = g;
2016
2008
  };
2017
2009
  return {
2018
2010
  enter: a,
@@ -2020,13 +2012,13 @@ const wt = !1, Mo = (e) => {
2020
2012
  s = 1, e.manipulateContainer(() => (n == null || n.remove(), n = void 0, wt)), t.next(!1);
2021
2013
  },
2022
2014
  move: (y, { isFirst: v, isLast: w }) => {
2023
- const p = n == null ? void 0 : n.querySelector("img");
2015
+ const g = n == null ? void 0 : n.querySelector("img");
2024
2016
  if (v && (r = { x: 0, y: 0 }), y) {
2025
2017
  const C = y.x - ((r == null ? void 0 : r.x) || 0), N = y.y - ((r == null ? void 0 : r.y) || 0);
2026
2018
  o = {
2027
2019
  x: o.x + C,
2028
2020
  y: o.y + N
2029
- }, p == null || p.style.setProperty(
2021
+ }, g == null || g.style.setProperty(
2030
2022
  "transform",
2031
2023
  `translate3d(${o.x}px, ${o.y}px, 0px) scale3d(${i}, ${i}, 1)`
2032
2024
  ), r = y;
@@ -2050,7 +2042,7 @@ const wt = !1, Mo = (e) => {
2050
2042
  }) => {
2051
2043
  const r = n * e / 2 - n + n / 2, i = n * t / 2 - n + n / 2, s = e / t, a = o - i;
2052
2044
  return Math.max(r + a * s, 0);
2053
- }, jo = (e) => {
2045
+ }, Ro = (e) => {
2054
2046
  const t = new q(!1);
2055
2047
  let n = 1, o = 1;
2056
2048
  const r = () => {
@@ -2060,7 +2052,7 @@ const wt = !1, Mo = (e) => {
2060
2052
  }, s = () => {
2061
2053
  n = o;
2062
2054
  }, a = (f) => {
2063
- const g = Math.ceil((f < 1 ? n - (1 - f) : n + (f - 1)) * 100) / 100, y = Math.max(g, 1), v = e.spine.element.getBoundingClientRect().width / e.spine.element.offsetWidth, w = e.viewportNavigator.element.scrollTop;
2055
+ const p = Math.ceil((f < 1 ? n - (1 - f) : n + (f - 1)) * 100) / 100, y = Math.max(p, 1), v = e.spine.element.getBoundingClientRect().width / e.spine.element.offsetWidth, w = e.viewportNavigator.element.scrollTop;
2064
2056
  e.spine.element.style.transform = `scale(${y})`, e.viewportNavigator.element.scrollLeft = je({
2065
2057
  newScale: y,
2066
2058
  oldScale: v,
@@ -2080,7 +2072,7 @@ const wt = !1, Mo = (e) => {
2080
2072
  exit: () => {
2081
2073
  r(), t.next(!1);
2082
2074
  },
2083
- move: (f, g) => {
2075
+ move: (f, p) => {
2084
2076
  },
2085
2077
  scale: a,
2086
2078
  setCurrentScaleAsBase: s,
@@ -2091,61 +2083,61 @@ const wt = !1, Mo = (e) => {
2091
2083
  },
2092
2084
  isZooming$: t.asObservable()
2093
2085
  };
2094
- }, Vo = (e) => (t) => {
2095
- const n = e(t), o = Mo(n), r = jo(n), i = new q(void 0), s = () => n.context.getSettings().computedPageTurnMode === "scrollable";
2086
+ }, Lo = (e) => (t) => {
2087
+ const n = e(t), o = Oo(n), r = Ro(n), i = new q(void 0), s = () => n.context.getSettings().computedPageTurnMode === "scrollable";
2096
2088
  return {
2097
2089
  ...n,
2098
2090
  destroy: () => {
2099
2091
  o.destroy(), r.destroy(), i.complete(), n.destroy();
2100
2092
  },
2101
2093
  zoom: {
2102
- enter: (g) => {
2094
+ enter: (p) => {
2103
2095
  var y;
2104
2096
  if ((y = i == null ? void 0 : i.value) == null || y.exit(), s()) {
2105
2097
  r.enter(), i == null || i.next(r);
2106
2098
  return;
2107
2099
  }
2108
- if (!g) {
2100
+ if (!p) {
2109
2101
  R.warn("You should specify an element to zoom at");
2110
2102
  return;
2111
2103
  }
2112
- o.enter(g), i == null || i.next(o);
2104
+ o.enter(p), i == null || i.next(o);
2113
2105
  },
2114
2106
  exit: () => {
2115
- var g;
2116
- (g = i.value) == null || g.exit();
2107
+ var p;
2108
+ (p = i.value) == null || p.exit();
2117
2109
  },
2118
- move: (g, y) => {
2110
+ move: (p, y) => {
2119
2111
  var v;
2120
- (v = i.value) == null || v.move(g, y);
2112
+ (v = i.value) == null || v.move(p, y);
2121
2113
  },
2122
2114
  isZooming: () => {
2123
- var g;
2124
- return ((g = i.value) == null ? void 0 : g.isZooming()) || !1;
2115
+ var p;
2116
+ return ((p = i.value) == null ? void 0 : p.isZooming()) || !1;
2125
2117
  },
2126
2118
  getScaleValue: () => {
2127
- var g;
2128
- return ((g = i.value) == null ? void 0 : g.getScaleValue()) || 1;
2119
+ var p;
2120
+ return ((p = i.value) == null ? void 0 : p.getScaleValue()) || 1;
2129
2121
  },
2130
- scale: (g) => {
2122
+ scale: (p) => {
2131
2123
  var y;
2132
2124
  if (!((y = i.value) != null && y.isZooming())) {
2133
2125
  R.warn("You need to start zoom before being able to call this fn");
2134
2126
  return;
2135
2127
  }
2136
- i.value.scale(g);
2128
+ i.value.scale(p);
2137
2129
  },
2138
2130
  isUsingScrollableZoom: s,
2139
2131
  setCurrentScaleAsBase: () => {
2140
- var g;
2141
- (g = i.value) == null || g.setCurrentScaleAsBase();
2132
+ var p;
2133
+ (p = i.value) == null || p.setCurrentScaleAsBase();
2142
2134
  },
2143
2135
  $: {
2144
- isZooming$: i.pipe(Ct((g) => (g == null ? void 0 : g.isZooming$) || J(!1)))
2136
+ isZooming$: i.pipe($t((p) => (p == null ? void 0 : p.isZooming$) || J(!1)))
2145
2137
  }
2146
2138
  }
2147
2139
  };
2148
- }, ko = (e) => {
2140
+ }, Do = (e) => {
2149
2141
  const t = {
2150
2142
  forceSinglePageMode: !1,
2151
2143
  pageTurnAnimation: "none",
@@ -2182,23 +2174,23 @@ const wt = !1, Mo = (e) => {
2182
2174
  settings$: n.asObservable().pipe(Q(ce))
2183
2175
  }
2184
2176
  };
2185
- }, zo = (e) => !(e != null && e.spineItems.some((t) => t.renditionLayout === "reflowable")), Ye = (e, t, n) => {
2186
- t.computedPageTurnDirection = t.pageTurnDirection, t.computedPageTurnAnimation = t.pageTurnAnimation, t.computedPageTurnMode = "controlled", (e == null ? void 0 : e.renditionFlow) === "scrolled-continuous" ? (t.computedPageTurnMode = "scrollable", t.computedPageTurnDirection = "vertical") : e && t.pageTurnMode === "scrollable" && (e.renditionLayout !== "pre-paginated" || !zo(e)) ? (R.warn(`pageTurnMode ${t.pageTurnMode} incompatible with current book, switching back to default`), t.computedPageTurnAnimation = "none", t.computedPageTurnMode = "controlled") : t.pageTurnMode === "scrollable" && (t.computedPageTurnMode = "scrollable", t.computedPageTurnDirection = "vertical"), n && t.computedPageTurnAnimation === "slide" && (R.warn(
2177
+ }, _o = (e) => !(e != null && e.spineItems.some((t) => t.renditionLayout === "reflowable")), Ye = (e, t, n) => {
2178
+ t.computedPageTurnDirection = t.pageTurnDirection, t.computedPageTurnAnimation = t.pageTurnAnimation, t.computedPageTurnMode = "controlled", (e == null ? void 0 : e.renditionFlow) === "scrolled-continuous" ? (t.computedPageTurnMode = "scrollable", t.computedPageTurnDirection = "vertical") : e && t.pageTurnMode === "scrollable" && (e.renditionLayout !== "pre-paginated" || !_o(e)) ? (R.warn(`pageTurnMode ${t.pageTurnMode} incompatible with current book, switching back to default`), t.computedPageTurnAnimation = "none", t.computedPageTurnMode = "controlled") : t.pageTurnMode === "scrollable" && (t.computedPageTurnMode = "scrollable", t.computedPageTurnDirection = "vertical"), n && t.computedPageTurnAnimation === "slide" && (R.warn(
2187
2179
  `pageTurnAnimation ${t.computedPageTurnAnimation} incompatible with current book, switching back to default`
2188
2180
  ), t.computedPageTurnAnimation = "none"), t.computedPageTurnMode === "scrollable" ? (t.computedPageTurnAnimationDuration = 0, t.computedPageTurnAnimation = "none") : t.computedPageTurnAnimationDuration = t.pageTurnAnimationDuration !== void 0 ? t.pageTurnAnimationDuration : 300;
2189
- }, Uo = (e) => {
2181
+ }, Mo = (e) => {
2190
2182
  let t, n;
2191
2183
  const o = new q(!1), r = new H(), i = {
2192
2184
  width: 0,
2193
2185
  height: 0,
2194
2186
  x: 0,
2195
2187
  y: 0
2196
- }, s = 0, a = 0, c = new H(), u = ko(e), d = () => {
2197
- const { height: v, width: w } = i, p = w > v;
2198
- return u.getSettings().forceSinglePageMode || (t == null ? void 0 : t.renditionFlow) === "scrolled-continuous" ? !1 : !p && (t == null ? void 0 : t.renditionSpread) === "portrait" ? !0 : p && ((t == null ? void 0 : t.renditionSpread) === void 0 || (t == null ? void 0 : t.renditionSpread) === "auto" || (t == null ? void 0 : t.renditionSpread) === "landscape" || (t == null ? void 0 : t.renditionSpread) === "both");
2188
+ }, s = 0, a = 0, c = new H(), u = Do(e), d = () => {
2189
+ const { height: v, width: w } = i, g = w > v;
2190
+ return u.getSettings().forceSinglePageMode || (t == null ? void 0 : t.renditionFlow) === "scrolled-continuous" ? !1 : !g && (t == null ? void 0 : t.renditionSpread) === "portrait" ? !0 : g && ((t == null ? void 0 : t.renditionSpread) === void 0 || (t == null ? void 0 : t.renditionSpread) === "auto" || (t == null ? void 0 : t.renditionSpread) === "landscape" || (t == null ? void 0 : t.renditionSpread) === "both");
2199
2191
  }, l = (v, w) => {
2200
2192
  t = v, n = w, u.recompute({ manifest: t, hasVerticalWritingSubject: o.value }), r.next(v);
2201
- }, f = () => (t == null ? void 0 : t.readingDirection) === "rtl", g = () => o.next(!0);
2193
+ }, f = () => (t == null ? void 0 : t.readingDirection) === "rtl", p = () => o.next(!0);
2202
2194
  return o.pipe(
2203
2195
  Me(1),
2204
2196
  Q(),
@@ -2209,7 +2201,7 @@ const wt = !1, Mo = (e) => {
2209
2201
  ).subscribe(), {
2210
2202
  load: l,
2211
2203
  isRTL: f,
2212
- areAllItemsPrePaginated: () => Wo(t),
2204
+ areAllItemsPrePaginated: () => jo(t),
2213
2205
  destroy: () => {
2214
2206
  u.destroy(), r.complete(), c.next(), c.complete(), o.complete();
2215
2207
  },
@@ -2217,9 +2209,9 @@ const wt = !1, Mo = (e) => {
2217
2209
  getCalculatedInnerMargin: () => 0,
2218
2210
  getVisibleAreaRect: () => i,
2219
2211
  shouldDisplaySpread: d,
2220
- setHasVerticalWriting: g,
2221
- setVisibleAreaRect: (v, w, p, C) => {
2222
- i.width = p, i.height = C - s - a, i.x = v, i.y = w;
2212
+ setHasVerticalWriting: p,
2213
+ setVisibleAreaRect: (v, w, g, C) => {
2214
+ i.width = g, i.height = C - s - a, i.x = v, i.y = w;
2223
2215
  },
2224
2216
  getManifest: () => t,
2225
2217
  getReadingDirection: () => t == null ? void 0 : t.readingDirection,
@@ -2239,12 +2231,12 @@ const wt = !1, Mo = (e) => {
2239
2231
  load$: r.asObservable()
2240
2232
  }
2241
2233
  };
2242
- }, Wo = (e) => !(e != null && e.spineItems.some((t) => t.renditionLayout === "reflowable")), nn = "__UNSAFE_REFERENCE_ORIGINAL_IFRAME_EVENT", Ho = [".xhtml", ".html", ".htm"], Ve = "prose-reader", Bo = (e) => (t) => {
2234
+ }, jo = (e) => !(e != null && e.spineItems.some((t) => t.renditionLayout === "reflowable")), Kt = "__UNSAFE_REFERENCE_ORIGINAL_IFRAME_EVENT", Vo = [".xhtml", ".html", ".htm"], Ve = "prose-reader", ko = (e) => (t) => {
2243
2235
  if (e && e.contentDocument && e.contentDocument.head) {
2244
2236
  const n = e.contentDocument.getElementById(t);
2245
2237
  n && n.remove();
2246
2238
  }
2247
- }, Yo = (e) => (t, n, o = !1) => {
2239
+ }, zo = (e) => (t, n, o = !1) => {
2248
2240
  if (e && e.contentDocument && e.contentDocument.head) {
2249
2241
  const r = document.createElement("style");
2250
2242
  r.id = t, r.innerHTML = n, o ? e.contentDocument.head.prepend(r) : e.contentDocument.head.appendChild(r);
@@ -2252,9 +2244,9 @@ const wt = !1, Mo = (e) => {
2252
2244
  }, St = (e, t) => {
2253
2245
  const n = new RegExp(t + "\\s*=\\s*([0-9.]+)", "i"), o = e.match(n) || [], r = o[1] || "0";
2254
2246
  return o && parseFloat(r) || 0;
2255
- }, Xo = (e) => e[nn], qo = (e, t) => {
2256
- Object.defineProperty(e, nn, { value: t, enumerable: !0 });
2257
- }, Go = R.measurePerformance("SpineItemFrame createFrame", 1 / 0, () => {
2247
+ }, Uo = (e) => e[Kt], Wo = (e, t) => {
2248
+ Object.defineProperty(e, Kt, { value: t, enumerable: !0 });
2249
+ }, Ho = R.measurePerformance("SpineItemFrame createFrame", 1 / 0, () => {
2258
2250
  const e = document.createElement("iframe");
2259
2251
  return e.frameBorder = "no", e.tabIndex = 0, e.setAttribute("sandbox", "allow-same-origin allow-scripts"), e.scrolling = "no", e.style.cssText = `
2260
2252
  visibility: hidden;
@@ -2265,21 +2257,21 @@ const wt = !1, Mo = (e) => {
2265
2257
  transition: opacity 300ms;
2266
2258
  opacity: 0;
2267
2259
  `, J(e);
2268
- }), on = (e) => ({
2260
+ }), Qt = (e) => ({
2269
2261
  frame: e,
2270
- removeStyle: Bo(e),
2271
- addStyle: Yo(e)
2272
- }), Zo = (e) => new Promise((t, n) => {
2262
+ removeStyle: ko(e),
2263
+ addStyle: zo(e)
2264
+ }), Bo = (e) => new Promise((t, n) => {
2273
2265
  const o = new Image();
2274
2266
  o.src = e, o.onload = () => {
2275
2267
  t({ height: o.naturalHeight, width: o.naturalWidth });
2276
2268
  }, o.onerror = n;
2277
- }), rn = async (e, t) => {
2269
+ }), en = async (e, t) => {
2278
2270
  if (typeof e == "string")
2279
2271
  return e;
2280
- const n = bn(e.headers.get("Content-Type") || "") || wn(t.href);
2272
+ const n = hn(e.headers.get("Content-Type") || "") || mn(t.href);
2281
2273
  if (["image/jpg", "image/jpeg", "image/png", "image/webp"].some((r) => r === n)) {
2282
- const r = await Po(await e.blob()), { height: i, width: s } = await Zo(r);
2274
+ const r = await vo(await e.blob()), { height: i, width: s } = await Bo(r);
2283
2275
  return `
2284
2276
  <html>
2285
2277
  <head>
@@ -2311,7 +2303,7 @@ const wt = !1, Mo = (e) => {
2311
2303
  </body>
2312
2304
  </html>
2313
2305
  ` : await e.text();
2314
- }, Jo = (e) => e.name === "item.onLoad", Ko = ({
2306
+ }, Yo = (e) => e.name === "item.onLoad", Xo = ({
2315
2307
  item: e,
2316
2308
  parent: t,
2317
2309
  fetchResource: n,
@@ -2320,11 +2312,11 @@ const wt = !1, Mo = (e) => {
2320
2312
  viewportState$: i
2321
2313
  }) => {
2322
2314
  const s = new H(), a = new H(), c = new H(), u = new q(void 0), d = new q(!1), l = new q(!1);
2323
- let f = [], g;
2324
- const y = (I) => (I.pipe(j(r.$.destroy$)).subscribe(), I), v = (I) => rn(I, e), w = i.pipe(
2315
+ let f = [], p;
2316
+ const y = (I) => (I.pipe(j(r.$.destroy$)).subscribe(), I), v = (I) => en(I, e), w = i.pipe(
2325
2317
  B((I) => I === "free"),
2326
2318
  ye(1)
2327
- ), p = c.asObservable().pipe(
2319
+ ), g = c.asObservable().pipe(
2328
2320
  re(u),
2329
2321
  B(([I, S]) => !!S),
2330
2322
  k(([, I]) => {
@@ -2337,16 +2329,16 @@ const wt = !1, Mo = (e) => {
2337
2329
  ), C = a.asObservable().pipe(
2338
2330
  re(d),
2339
2331
  B(([I, S]) => !S),
2340
- Jt(() => Go().pipe(
2332
+ qt(() => Ho().pipe(
2341
2333
  ie((I) => w.pipe(he(I))),
2342
- ie((I) => (t.appendChild(I), u.next(I), !n && e.href.startsWith(window.location.origin) && (e.mediaType && ["application/xhtml+xml", "application/xml", "text/html", "text/xml"].includes(e.mediaType) || !e.mediaType && Ho.some((S) => e.href.endsWith(S))) ? (I == null || I.setAttribute("src", e.href), J(I)) : fe((n || (() => fetch(e.href)))(e)).pipe(
2334
+ ie((I) => (t.appendChild(I), u.next(I), !n && e.href.startsWith(window.location.origin) && (e.mediaType && ["application/xhtml+xml", "application/xml", "text/html", "text/xml"].includes(e.mediaType) || !e.mediaType && Vo.some((S) => e.href.endsWith(S))) ? (I == null || I.setAttribute("src", e.href), J(I)) : fe((n || (() => fetch(e.href)))(e)).pipe(
2343
2335
  ie((m) => v(m)),
2344
2336
  U((m) => {
2345
2337
  I == null || I.setAttribute("srcdoc", m);
2346
2338
  }),
2347
2339
  k(() => I)
2348
2340
  ))),
2349
- ie((I) => I ? (I.setAttribute("sandbox", "allow-same-origin allow-scripts"), Ft(I, "load").pipe(
2341
+ ie((I) => I ? (I.setAttribute("sandbox", "allow-same-origin allow-scripts"), xt(I, "load").pipe(
2350
2342
  ye(1),
2351
2343
  re(o),
2352
2344
  ie(([S, m]) => {
@@ -2354,9 +2346,9 @@ const wt = !1, Mo = (e) => {
2354
2346
  const h = (x = I.contentDocument) == null ? void 0 : x.body;
2355
2347
  if (!h)
2356
2348
  return R.error(`Something went wrong on iframe load ${e.id}`), te;
2357
- I.setAttribute("role", "main"), I != null && I.contentDocument && h && (g = ($ = I == null ? void 0 : I.contentWindow) == null ? void 0 : $.getComputedStyle(h)), r.getSettings().computedPageTurnMode !== "scrollable" && I.setAttribute("tab-index", "0");
2358
- const b = on(I);
2359
- return f = m.filter(Jo).map((T) => {
2349
+ I.setAttribute("role", "main"), I != null && I.contentDocument && h && (p = ($ = I == null ? void 0 : I.contentWindow) == null ? void 0 : $.getComputedStyle(h)), r.getSettings().computedPageTurnMode !== "scrollable" && I.setAttribute("tab-index", "0");
2350
+ const b = Qt(I);
2351
+ return f = m.filter(Yo).map((T) => {
2360
2352
  const A = T.fn({
2361
2353
  ...b,
2362
2354
  item: e
@@ -2379,13 +2371,13 @@ const wt = !1, Mo = (e) => {
2379
2371
  y,
2380
2372
  j(s)
2381
2373
  );
2382
- return X(C.pipe(he(!0)), c.pipe(he(!1))).pipe(Q(), j(s)).subscribe(d), X(N.pipe(he(!0)), c.pipe(he(!1))).pipe(Q(), j(s)).subscribe(l), p.subscribe(), {
2374
+ return X(C.pipe(he(!0)), c.pipe(he(!1))).pipe(Q(), j(s)).subscribe(d), X(N.pipe(he(!0)), c.pipe(he(!1))).pipe(Q(), j(s)).subscribe(l), g.subscribe(), {
2383
2375
  load: () => a.next(),
2384
2376
  unload: () => c.next(),
2385
2377
  destroy: () => {
2386
2378
  a.complete(), c.complete(), u.complete(), s.next(), s.complete(), l.complete(), d.complete();
2387
2379
  },
2388
- getComputedStyleAfterLoad: () => g,
2380
+ getComputedStyleAfterLoad: () => p,
2389
2381
  $: {
2390
2382
  load$: a.asObservable(),
2391
2383
  unload$: c.asObservable(),
@@ -2393,11 +2385,11 @@ const wt = !1, Mo = (e) => {
2393
2385
  isLoaded$: d.asObservable(),
2394
2386
  isReady$: l.asObservable().pipe(Q()),
2395
2387
  ready$: N,
2396
- unloaded$: p,
2388
+ unloaded$: g,
2397
2389
  frameElement$: u
2398
2390
  }
2399
2391
  };
2400
- }, Qo = ({
2392
+ }, qo = ({
2401
2393
  item: e,
2402
2394
  parent: t,
2403
2395
  fetchResource: n,
@@ -2406,17 +2398,17 @@ const wt = !1, Mo = (e) => {
2406
2398
  viewportState$: i
2407
2399
  }) => {
2408
2400
  const s = new H(), {
2409
- $: { unload$: a, loaded$: c, isLoaded$: u, isReady$: d, unloaded$: l, frameElement$: f, ready$: g },
2401
+ $: { unload$: a, loaded$: c, isLoaded$: u, isReady$: d, unloaded$: l, frameElement$: f, ready$: p },
2410
2402
  load: y,
2411
2403
  unload: v,
2412
2404
  destroy: w,
2413
- getComputedStyleAfterLoad: p
2414
- } = Ko({ context: o, hooks$: r, item: e, parent: t, fetchResource: n, viewportState$: i }), C = new q(!1), N = new q(!1);
2405
+ getComputedStyleAfterLoad: g
2406
+ } = Xo({ context: o, hooks$: r, item: e, parent: t, fetchResource: n, viewportState$: i }), C = new q(!1), N = new q(!1);
2415
2407
  u.subscribe(C), d.subscribe(N);
2416
2408
  const I = () => {
2417
2409
  const T = f.getValue();
2418
2410
  if (C.value && T)
2419
- return on(T);
2411
+ return Qt(T);
2420
2412
  }, S = () => {
2421
2413
  const T = f.getValue();
2422
2414
  if (T && (T != null && T.contentDocument)) {
@@ -2434,13 +2426,13 @@ const wt = !1, Mo = (e) => {
2434
2426
  }
2435
2427
  }, m = () => {
2436
2428
  var T;
2437
- return (T = p()) == null ? void 0 : T.writingMode;
2429
+ return (T = g()) == null ? void 0 : T.writingMode;
2438
2430
  }, h = () => {
2439
2431
  var T;
2440
2432
  return !!((T = m()) != null && T.startsWith("vertical"));
2441
- }, b = (T) => rn(T, e), x = X(
2433
+ }, b = (T) => en(T, e), x = X(
2442
2434
  l.pipe(k(() => ({ isFirstLayout: !1 }))),
2443
- g.pipe(k(() => ({ isFirstLayout: !0 })))
2435
+ p.pipe(k(() => ({ isFirstLayout: !0 })))
2444
2436
  );
2445
2437
  return {
2446
2438
  getIsLoaded: () => C.value,
@@ -2459,7 +2451,7 @@ const wt = !1, Mo = (e) => {
2459
2451
  var E;
2460
2452
  if (m() === "vertical-rl")
2461
2453
  return "rtl";
2462
- const A = (E = p()) == null ? void 0 : E.direction;
2454
+ const A = (E = g()) == null ? void 0 : E.direction;
2463
2455
  if (["ltr", "rtl"].includes(A || ""))
2464
2456
  return A;
2465
2457
  },
@@ -2472,12 +2464,12 @@ const wt = !1, Mo = (e) => {
2472
2464
  unload$: a,
2473
2465
  unloaded$: l,
2474
2466
  loaded$: c,
2475
- ready$: g,
2467
+ ready$: p,
2476
2468
  isReady$: N.asObservable(),
2477
2469
  contentLayoutChange$: x
2478
2470
  }
2479
2471
  };
2480
- }, er = () => {
2472
+ }, Go = () => {
2481
2473
  const e = { x: void 0, y: void 0 }, t = new H();
2482
2474
  let n = !1;
2483
2475
  return {
@@ -2498,7 +2490,7 @@ const wt = !1, Mo = (e) => {
2498
2490
  },
2499
2491
  $: t.asObservable()
2500
2492
  };
2501
- }, tr = () => {
2493
+ }, Zo = () => {
2502
2494
  let e = !1, t;
2503
2495
  const n = new H(), o = ["mouseup", "pointerup"];
2504
2496
  return {
@@ -2527,14 +2519,14 @@ const wt = !1, Mo = (e) => {
2527
2519
  },
2528
2520
  $: n.asObservable()
2529
2521
  };
2530
- }, nr = (e) => typeof e == "object" && !!e && "nodeType" in e && (e == null ? void 0 : e.nodeType) === Node.ELEMENT_NODE && "innerText" in e;
2531
- function or(e, t, n) {
2522
+ }, Jo = (e) => typeof e == "object" && !!e && "nodeType" in e && (e == null ? void 0 : e.nodeType) === Node.ELEMENT_NODE && "innerText" in e;
2523
+ function Ko(e, t, n) {
2532
2524
  if ("caretPositionFromPoint" in e)
2533
2525
  return e.caretPositionFromPoint(t, n);
2534
2526
  if (typeof e.caretRangeFromPoint < "u")
2535
2527
  return e.caretRangeFromPoint(t, n);
2536
2528
  }
2537
- const rr = R.measurePerformance(
2529
+ const Qo = R.measurePerformance(
2538
2530
  "getFirstVisibleNodeForViewport",
2539
2531
  1,
2540
2532
  (e, t) => {
@@ -2544,10 +2536,10 @@ const rr = R.measurePerformance(
2544
2536
  const s = o.createRange();
2545
2537
  return Array.from(n.childNodes).some((a) => {
2546
2538
  s.selectNodeContents(a);
2547
- const c = s.getClientRects(), u = ir(c, t);
2539
+ const c = s.getClientRects(), u = er(c, t);
2548
2540
  if (u) {
2549
2541
  r = s.cloneRange();
2550
- const d = or(o, Math.ceil(u.left), Math.ceil(u.top));
2542
+ const d = Ko(o, Math.ceil(u.left), Math.ceil(u.top));
2551
2543
  return d && "startContainer" in d && d.startContainer === r.startContainer && (i = d.startOffset), d && "offsetNode" in d && d.offsetNode === r.startContainer && (i = d.offset), !0;
2552
2544
  }
2553
2545
  return !1;
@@ -2556,22 +2548,22 @@ const rr = R.measurePerformance(
2556
2548
  }
2557
2549
  ), Ke = (e, t) => {
2558
2550
  let n;
2559
- const o = sn(e.getBoundingClientRect(), t);
2551
+ const o = tn(e.getBoundingClientRect(), t);
2560
2552
  return o !== "before" && o !== "after" && (n = e), Array.from(e.children).some((r) => {
2561
2553
  const i = Ke(r, t);
2562
2554
  return i ? (n = i, !0) : !1;
2563
2555
  }), n;
2564
2556
  };
2565
- function sn(e, { left: t, right: n }) {
2557
+ function tn(e, { left: t, right: n }) {
2566
2558
  return e.left <= t && e.right <= t ? "before" : e.left <= t && e.right > t && e.right <= n ? "partially-before" : e.left <= n && e.right > n ? "partially-after" : e.left > n ? "after" : "within";
2567
2559
  }
2568
- function ir(e, t) {
2560
+ function er(e, t) {
2569
2561
  return Array.from(e).find((n) => {
2570
- const o = sn(n, t);
2562
+ const o = tn(n, t);
2571
2563
  return o !== "before" && o !== "after";
2572
2564
  });
2573
2565
  }
2574
- const sr = (e, t) => {
2566
+ const tr = (e, t) => {
2575
2567
  var n;
2576
2568
  if (e.nodeType !== Node.CDATA_SECTION_NODE && e.nodeType !== Node.DOCUMENT_TYPE_NODE) {
2577
2569
  const o = (n = e.ownerDocument) == null ? void 0 : n.createRange();
@@ -2596,7 +2588,7 @@ const sr = (e, t) => {
2596
2588
  return e instanceof s.PointerEvent;
2597
2589
  }
2598
2590
  return !1;
2599
- }, an = (e) => {
2591
+ }, nn = (e) => {
2600
2592
  var t, n, o, r, i;
2601
2593
  if (dt(e))
2602
2594
  return !1;
@@ -2611,7 +2603,7 @@ const sr = (e, t) => {
2611
2603
  return e instanceof s.MouseEvent;
2612
2604
  }
2613
2605
  return !1;
2614
- }, ar = (e) => {
2606
+ }, nr = (e) => {
2615
2607
  var t, n, o, r, i;
2616
2608
  if (e != null && e.target && ((n = (t = e == null ? void 0 : e.target) == null ? void 0 : t.ownerDocument) != null && n.defaultView)) {
2617
2609
  const s = (r = (o = e == null ? void 0 : e.target) == null ? void 0 : o.ownerDocument) == null ? void 0 : r.defaultView;
@@ -2624,7 +2616,7 @@ const sr = (e, t) => {
2624
2616
  return e instanceof s.TouchEvent;
2625
2617
  }
2626
2618
  return !1;
2627
- }, cr = [
2619
+ }, or = [
2628
2620
  "pointercancel",
2629
2621
  "pointerdown",
2630
2622
  "pointerenter",
@@ -2633,7 +2625,7 @@ const sr = (e, t) => {
2633
2625
  "pointerout",
2634
2626
  "pointerover",
2635
2627
  "pointerup"
2636
- ], ur = [
2628
+ ], rr = [
2637
2629
  "mousedown",
2638
2630
  "mouseup",
2639
2631
  "mouseenter",
@@ -2641,7 +2633,7 @@ const sr = (e, t) => {
2641
2633
  "mousemove",
2642
2634
  "mouseout",
2643
2635
  "mouseover"
2644
- ], lr = [...cr, ...ur], cn = ({
2636
+ ], ir = [...or, ...rr], on = ({
2645
2637
  item: e,
2646
2638
  context: t,
2647
2639
  parentElement: n,
@@ -2650,7 +2642,7 @@ const sr = (e, t) => {
2650
2642
  viewportState$: i
2651
2643
  }) => {
2652
2644
  var _;
2653
- const s = new H(), a = dr(n, e, r), c = fr(n, e), u = er(), d = tr(), l = gr(o, u, d), f = Qo({
2645
+ const s = new H(), a = sr(n, e, r), c = ar(n, e), u = Go(), d = Zo(), l = cr(o, u, d), f = qo({
2654
2646
  parent: a,
2655
2647
  item: e,
2656
2648
  context: t,
@@ -2659,23 +2651,23 @@ const sr = (e, t) => {
2659
2651
  viewportState$: i
2660
2652
  });
2661
2653
  a.appendChild(c), n.appendChild(a);
2662
- let g;
2654
+ let p;
2663
2655
  const y = () => {
2664
- if (g)
2665
- return g;
2656
+ if (p)
2657
+ return p;
2666
2658
  const F = a.getBoundingClientRect();
2667
- return g = {
2659
+ return p = {
2668
2660
  ...F,
2669
2661
  width: Math.round(F.width * 10) / 10,
2670
2662
  height: Math.round(F.height * 10) / 10
2671
- }, g;
2663
+ }, p;
2672
2664
  }, v = () => {
2673
2665
  var F;
2674
2666
  return !!((F = e.mediaType) != null && F.startsWith("image/"));
2675
2667
  }, w = (F) => {
2676
2668
  var D, V;
2677
2669
  (D = f.getManipulableFrame()) == null || D.removeStyle("prose-reader-css"), (V = f.getManipulableFrame()) == null || V.addStyle("prose-reader-css", F);
2678
- }, p = ({ right: F, left: D, top: V }) => {
2670
+ }, g = ({ right: F, left: D, top: V }) => {
2679
2671
  F !== void 0 ? a.style.right = `${F}px` : a.style.removeProperty("right"), D !== void 0 ? a.style.left = `${D}px` : a.style.removeProperty("left"), V !== void 0 ? a.style.top = `${V}px` : a.style.removeProperty("top");
2680
2672
  }, C = () => {
2681
2673
  var L;
@@ -2690,7 +2682,7 @@ const sr = (e, t) => {
2690
2682
  if (D && F)
2691
2683
  return F.startsWith("#") ? (L = (P = D.contentDocument) == null ? void 0 : P.getElementById(F.replace("#", ""))) == null ? void 0 : L.getBoundingClientRect() : (z = (M = D.contentDocument) == null ? void 0 : M.querySelector(F)) == null ? void 0 : z.getBoundingClientRect();
2692
2684
  }, m = () => {
2693
- g = void 0;
2685
+ p = void 0;
2694
2686
  }, h = () => {
2695
2687
  const F = t.getPageSize(), D = F.width;
2696
2688
  return { columnHeight: F.height, columnWidth: D };
@@ -2761,7 +2753,7 @@ const sr = (e, t) => {
2761
2753
  m();
2762
2754
  },
2763
2755
  layout: x,
2764
- adjustPositionOfElement: p,
2756
+ adjustPositionOfElement: g,
2765
2757
  getElementDimensions: y,
2766
2758
  getHtmlFromResource: f.getHtmlFromResource,
2767
2759
  getResource: T,
@@ -2796,13 +2788,13 @@ const sr = (e, t) => {
2796
2788
  isReady$: f.$.isReady$
2797
2789
  }
2798
2790
  };
2799
- }, dr = (e, t, n) => {
2791
+ }, sr = (e, t, n) => {
2800
2792
  const o = e.ownerDocument.createElement("div");
2801
2793
  return o.classList.add("spineItem"), o.classList.add(`spineItem-${t.renditionLayout}`), o.style.cssText = `
2802
2794
  position: absolute;
2803
2795
  overflow: hidden;
2804
2796
  `, n.getValue().reduce((r, i) => i.name === "item.onBeforeContainerCreated" ? i.fn(r) : r, o);
2805
- }, fr = (e, t) => {
2797
+ }, ar = (e, t) => {
2806
2798
  const n = e.ownerDocument.createElement("div");
2807
2799
  return n.classList.add("spineItemOverlay"), n.classList.add(`spineItemOverlay-${t.renditionLayout}`), n.style.cssText = `
2808
2800
  position: absolute;
@@ -2811,15 +2803,15 @@ const sr = (e, t) => {
2811
2803
  pointer-events: none;
2812
2804
  background-color: transparent;
2813
2805
  `, n;
2814
- }, gr = (e, t, n) => [
2806
+ }, cr = (e, t, n) => [
2815
2807
  {
2816
2808
  name: "item.onLoad",
2817
2809
  fn: ({ frame: o }) => {
2818
- const r = lr.map((i) => {
2810
+ const r = ir.map((i) => {
2819
2811
  var a;
2820
2812
  const s = (c) => {
2821
2813
  let u = c;
2822
- dt(c) && (u = new PointerEvent(c.type, c)), an(c) && (u = new MouseEvent(c.type, c)), u !== c && (qo(u, c), e.dispatchEvent(u));
2814
+ dt(c) && (u = new PointerEvent(c.type, c)), nn(c) && (u = new MouseEvent(c.type, c)), u !== c && (Wo(u, c), e.dispatchEvent(u));
2823
2815
  };
2824
2816
  return (a = o.contentDocument) == null || a.addEventListener(i, s), () => {
2825
2817
  var c;
@@ -2831,12 +2823,12 @@ const sr = (e, t) => {
2831
2823
  };
2832
2824
  }
2833
2825
  }
2834
- ], un = () => `
2826
+ ], rn = () => `
2835
2827
  body {
2836
2828
  margin: 0;
2837
2829
  }
2838
2830
  }
2839
- `, pr = ({
2831
+ `, ur = ({
2840
2832
  item: e,
2841
2833
  context: t,
2842
2834
  containerElement: n,
@@ -2844,7 +2836,7 @@ const sr = (e, t) => {
2844
2836
  hooks$: r,
2845
2837
  viewportState$: i
2846
2838
  }) => {
2847
- const s = cn({
2839
+ const s = on({
2848
2840
  context: t,
2849
2841
  item: e,
2850
2842
  parentElement: n,
@@ -2860,9 +2852,9 @@ const sr = (e, t) => {
2860
2852
  spreadPosition: l
2861
2853
  }) => {
2862
2854
  var C;
2863
- const { width: f, height: g } = t.getPageSize(), { viewportDimensions: y, computedScale: v = 1 } = s.getViewPortInformation() ?? {}, w = t.getVisibleAreaRect(), p = (C = a.getManipulableFrame()) == null ? void 0 : C.frame;
2864
- if (a != null && a.getIsLoaded() && (p != null && p.contentDocument) && (p != null && p.contentWindow)) {
2865
- const N = f, I = w.height + t.getCalculatedInnerMargin(), S = hr(
2855
+ const { width: f, height: p } = t.getPageSize(), { viewportDimensions: y, computedScale: v = 1 } = s.getViewPortInformation() ?? {}, w = t.getVisibleAreaRect(), g = (C = a.getManipulableFrame()) == null ? void 0 : C.frame;
2856
+ if (a != null && a.getIsLoaded() && (g != null && g.contentDocument) && (g != null && g.contentWindow)) {
2857
+ const N = f, I = w.height + t.getCalculatedInnerMargin(), S = lr(
2866
2858
  {
2867
2859
  ...s.getDimensionsForPaginatedContent(),
2868
2860
  enableTouch: t.getSettings().computedPageTurnMode !== "scrollable",
@@ -2870,33 +2862,33 @@ const sr = (e, t) => {
2870
2862
  },
2871
2863
  y
2872
2864
  );
2873
- if (p == null || p.style.setProperty("visibility", "visible"), p == null || p.style.setProperty("opacity", "1"), y) {
2865
+ if (g == null || g.style.setProperty("visibility", "visible"), g == null || g.style.setProperty("opacity", "1"), y) {
2874
2866
  s.injectStyle(S), a.staticLayout({
2875
2867
  width: y.width,
2876
2868
  height: y.height
2877
- }), p == null || p.style.setProperty("position", "absolute"), p == null || p.style.setProperty("top", "50%"), l === "left" ? (p == null || p.style.setProperty("right", "0"), p == null || p.style.removeProperty("left")) : u === "before" && t.isRTL() ? (p == null || p.style.setProperty("right", "50%"), p == null || p.style.removeProperty("left")) : l === "right" ? (p == null || p.style.setProperty("left", "0"), p == null || p.style.removeProperty("right")) : (p == null || p.style.setProperty(
2869
+ }), g == null || g.style.setProperty("position", "absolute"), g == null || g.style.setProperty("top", "50%"), l === "left" ? (g == null || g.style.setProperty("right", "0"), g == null || g.style.removeProperty("left")) : u === "before" && t.isRTL() ? (g == null || g.style.setProperty("right", "50%"), g == null || g.style.removeProperty("left")) : l === "right" ? (g == null || g.style.setProperty("left", "0"), g == null || g.style.removeProperty("right")) : (g == null || g.style.setProperty(
2878
2870
  "left",
2879
2871
  u === "before" ? t.isRTL() ? "25%" : "75%" : u === "after" ? t.isRTL() ? "75%" : "25%" : "50%"
2880
- ), p == null || p.style.removeProperty("right"));
2872
+ ), g == null || g.style.removeProperty("right"));
2881
2873
  const m = l !== "none" ? "0" : "-50%", h = l === "right" && u !== "before" ? "left" : l === "left" || u === "before" && t.isRTL() ? "right" : "center";
2882
- p == null || p.style.setProperty("transform", `translate(${m}, -50%) scale(${v})`), p == null || p.style.setProperty("transform-origin", `${h} center`), s.executeOnLayoutBeforeMeasurementHook({ minimumWidth: d });
2874
+ g == null || g.style.setProperty("transform", `translate(${m}, -50%) scale(${v})`), g == null || g.style.setProperty("transform-origin", `${h} center`), s.executeOnLayoutBeforeMeasurementHook({ minimumWidth: d });
2883
2875
  } else
2884
2876
  s.injectStyle(S), a.staticLayout({
2885
2877
  width: N,
2886
2878
  height: I
2887
- }), u === "before" ? t.isRTL() ? p == null || p.style.setProperty("margin-right", `${f}px`) : p == null || p.style.setProperty("margin-left", `${f}px`) : (p == null || p.style.removeProperty("margin-left"), p == null || p.style.removeProperty("margin-right"));
2879
+ }), u === "before" ? t.isRTL() ? g == null || g.style.setProperty("margin-right", `${f}px`) : g == null || g.style.setProperty("margin-left", `${f}px`) : (g == null || g.style.removeProperty("margin-left"), g == null || g.style.removeProperty("margin-right"));
2888
2880
  return s.executeOnLayoutBeforeMeasurementHook({ minimumWidth: d }), s.layout({ width: d, height: I, blankPagePosition: u, minimumWidth: d }), { width: d, height: I };
2889
2881
  } else
2890
- s.executeOnLayoutBeforeMeasurementHook({ minimumWidth: d }), s.layout({ width: d, height: g, blankPagePosition: u, minimumWidth: d });
2891
- return { width: d, height: g };
2882
+ s.executeOnLayoutBeforeMeasurementHook({ minimumWidth: d }), s.layout({ width: d, height: p, blankPagePosition: u, minimumWidth: d });
2883
+ return { width: d, height: p };
2892
2884
  }
2893
2885
  };
2894
- }, hr = ({
2886
+ }, lr = ({
2895
2887
  columnWidth: e,
2896
2888
  enableTouch: t,
2897
2889
  spreadPosition: n
2898
2890
  }, o) => `
2899
- ${un()}
2891
+ ${rn()}
2900
2892
  body {
2901
2893
  ${o ? "" : `
2902
2894
  display: flex;
@@ -2936,7 +2928,7 @@ const sr = (e, t) => {
2936
2928
  object-fit:contain;
2937
2929
  `}
2938
2930
  }
2939
- `, mr = ({
2931
+ `, dr = ({
2940
2932
  item: e,
2941
2933
  context: t,
2942
2934
  containerElement: n,
@@ -2944,7 +2936,7 @@ const sr = (e, t) => {
2944
2936
  hooks$: r,
2945
2937
  viewportState$: i
2946
2938
  }) => {
2947
- const s = cn({
2939
+ const s = on({
2948
2940
  context: t,
2949
2941
  item: e,
2950
2942
  parentElement: n,
@@ -2960,53 +2952,53 @@ const sr = (e, t) => {
2960
2952
  minimumWidth: l
2961
2953
  }) => {
2962
2954
  var I, S, m, h, b, x, $, T;
2963
- const { width: f, height: g } = t.getPageSize();
2964
- (S = (I = a.getManipulableFrame()) == null ? void 0 : I.frame) == null || S.style.setProperty("width", `${f}px`), (h = (m = a.getManipulableFrame()) == null ? void 0 : m.frame) == null || h.style.setProperty("height", `${g}px`);
2965
- const { viewportDimensions: y, computedScale: v = 1 } = s.getViewPortInformation() ?? {}, w = t.getVisibleAreaRect(), p = (b = a.getManipulableFrame()) == null ? void 0 : b.frame, C = ((x = t.getManifest()) == null ? void 0 : x.renditionLayout) === "pre-paginated";
2966
- if (a != null && a.getIsLoaded() && (p != null && p.contentDocument) && (p != null && p.contentWindow)) {
2955
+ const { width: f, height: p } = t.getPageSize();
2956
+ (S = (I = a.getManipulableFrame()) == null ? void 0 : I.frame) == null || S.style.setProperty("width", `${f}px`), (h = (m = a.getManipulableFrame()) == null ? void 0 : m.frame) == null || h.style.setProperty("height", `${p}px`);
2957
+ const { viewportDimensions: y, computedScale: v = 1 } = s.getViewPortInformation() ?? {}, w = t.getVisibleAreaRect(), g = (b = a.getManipulableFrame()) == null ? void 0 : b.frame, C = ((x = t.getManifest()) == null ? void 0 : x.renditionLayout) === "pre-paginated";
2958
+ if (a != null && a.getIsLoaded() && (g != null && g.contentDocument) && (g != null && g.contentWindow)) {
2967
2959
  let A = f, E = w.height + t.getCalculatedInnerMargin();
2968
- if (p == null || p.style.setProperty("visibility", "visible"), p == null || p.style.setProperty("opacity", "1"), y)
2969
- s.injectStyle(yr()), s.executeOnLayoutBeforeMeasurementHook({ minimumWidth: l }), a.staticLayout({
2960
+ if (g == null || g.style.setProperty("visibility", "visible"), g == null || g.style.setProperty("opacity", "1"), y)
2961
+ s.injectStyle(fr()), s.executeOnLayoutBeforeMeasurementHook({ minimumWidth: l }), a.staticLayout({
2970
2962
  width: y.width,
2971
2963
  height: y.height
2972
- }), p == null || p.style.setProperty("position", "absolute"), p == null || p.style.setProperty("top", "50%"), p == null || p.style.setProperty(
2964
+ }), g == null || g.style.setProperty("position", "absolute"), g == null || g.style.setProperty("top", "50%"), g == null || g.style.setProperty(
2973
2965
  "left",
2974
2966
  d === "before" ? t.isRTL() ? "25%" : "75%" : d === "after" ? t.isRTL() ? "75%" : "25%" : "50%"
2975
- ), p == null || p.style.setProperty("transform", `translate(-50%, -50%) scale(${v})`), p == null || p.style.setProperty("transform-origin", "center center");
2967
+ ), g == null || g.style.setProperty("transform", `translate(-50%, -50%) scale(${v})`), g == null || g.style.setProperty("transform-origin", "center center");
2976
2968
  else {
2977
- const _ = s.isImageType() ? vr({
2969
+ const _ = s.isImageType() ? gr({
2978
2970
  isScrollable: (($ = t.getManifest()) == null ? void 0 : $.renditionFlow) === "scrolled-continuous",
2979
2971
  enableTouch: t.getSettings().computedPageTurnMode !== "scrollable"
2980
- }) : br(
2972
+ }) : pr(
2981
2973
  s.getDimensionsForReflowableContent(a.isUsingVerticalWriting(), l)
2982
2974
  );
2983
2975
  if (s.injectStyle(_), s.executeOnLayoutBeforeMeasurementHook({ minimumWidth: l }), a.isUsingVerticalWriting())
2984
- E = Math.ceil(p.contentDocument.documentElement.scrollHeight / g) * g, a.staticLayout({
2976
+ E = Math.ceil(g.contentDocument.documentElement.scrollHeight / p) * p, a.staticLayout({
2985
2977
  width: l,
2986
2978
  height: E
2987
2979
  });
2988
2980
  else if (((T = t.getManifest()) == null ? void 0 : T.renditionFlow) === "scrolled-continuous")
2989
- E = p.contentDocument.documentElement.scrollHeight, c = E, a.staticLayout({
2981
+ E = g.contentDocument.documentElement.scrollHeight, c = E, a.staticLayout({
2990
2982
  width: l,
2991
2983
  height: E
2992
2984
  });
2993
2985
  else {
2994
- const F = Math.ceil(p.contentDocument.documentElement.scrollWidth / f);
2986
+ const F = Math.ceil(g.contentDocument.documentElement.scrollWidth / f);
2995
2987
  C ? A = f : A = F * f, a.staticLayout({
2996
2988
  width: A,
2997
2989
  height: E
2998
2990
  });
2999
2991
  }
3000
2992
  }
3001
- return A % l === 0 ? p == null || p.style.setProperty("margin-left", "0px") : (A = A + f, t.isRTL() && !s.isUsingVerticalWriting() && (p == null || p.style.setProperty("margin-left", `${f}px`))), s.layout({ width: A, height: E, blankPagePosition: d, minimumWidth: l }), { width: A, height: E };
2993
+ return A % l === 0 ? g == null || g.style.setProperty("margin-left", "0px") : (A = A + f, t.isRTL() && !s.isUsingVerticalWriting() && (g == null || g.style.setProperty("margin-left", `${f}px`))), s.layout({ width: A, height: E, blankPagePosition: d, minimumWidth: l }), { width: A, height: E };
3002
2994
  } else
3003
2995
  s.executeOnLayoutBeforeMeasurementHook({ minimumWidth: l });
3004
- const N = c || g;
2996
+ const N = c || p;
3005
2997
  return s.layout({ width: l, height: N, blankPagePosition: d, minimumWidth: l }), { width: l, height: N };
3006
2998
  }
3007
2999
  };
3008
- }, yr = () => `
3009
- ${un()}
3000
+ }, fr = () => `
3001
+ ${rn()}
3010
3002
  html {
3011
3003
  width: 100%;
3012
3004
  height: 100%;
@@ -3020,7 +3012,7 @@ const sr = (e, t) => {
3020
3012
  html, body {
3021
3013
  touch-action: none;
3022
3014
  }
3023
- `, vr = ({ isScrollable: e, enableTouch: t }) => `
3015
+ `, gr = ({ isScrollable: e, enableTouch: t }) => `
3024
3016
 
3025
3017
  html, body {
3026
3018
  width: 100%;
@@ -3042,7 +3034,7 @@ const sr = (e, t) => {
3042
3034
  display: block;
3043
3035
  }
3044
3036
  ` : ""}
3045
- `, br = ({
3037
+ `, pr = ({
3046
3038
  width: e,
3047
3039
  columnHeight: t,
3048
3040
  columnWidth: n
@@ -3110,34 +3102,34 @@ const sr = (e, t) => {
3110
3102
  td {
3111
3103
  max-width: ${n}px;
3112
3104
  }
3113
- `, wr = ({
3105
+ `, hr = ({
3114
3106
  item: e,
3115
3107
  context: t,
3116
3108
  containerElement: n,
3117
3109
  iframeEventBridgeElement: o,
3118
3110
  hooks$: r,
3119
3111
  viewportState$: i
3120
- }) => e.renditionLayout === "pre-paginated" ? pr({
3112
+ }) => e.renditionLayout === "pre-paginated" ? ur({
3121
3113
  item: e,
3122
3114
  context: t,
3123
3115
  containerElement: n,
3124
3116
  iframeEventBridgeElement: o,
3125
3117
  hooks$: r,
3126
3118
  viewportState$: i
3127
- }) : mr({
3119
+ }) : dr({
3128
3120
  item: e,
3129
3121
  context: t,
3130
3122
  containerElement: n,
3131
3123
  iframeEventBridgeElement: o,
3132
3124
  hooks$: r,
3133
3125
  viewportState$: i
3134
- }), Sr = ({
3126
+ }), mr = ({
3135
3127
  iframeEventBridgeElement: e,
3136
3128
  locator: t
3137
3129
  }) => ({
3138
3130
  normalizeEventForViewport: (o) => {
3139
3131
  var c;
3140
- const r = o.target === e, i = Xo(o), s = (c = i == null ? void 0 : i.view) == null ? void 0 : c.frameElement;
3132
+ const r = o.target === e, i = Uo(o), s = (c = i == null ? void 0 : i.view) == null ? void 0 : c.frameElement;
3141
3133
  if (!r || !i || !s)
3142
3134
  return o;
3143
3135
  const a = t.getSpineItemFromIframe(s);
@@ -3151,7 +3143,7 @@ const sr = (e, t) => {
3151
3143
  });
3152
3144
  return Object.defineProperty(l, "target", { value: i.target, enumerable: !0 }), l;
3153
3145
  }
3154
- if (an(o)) {
3146
+ if (nn(o)) {
3155
3147
  const { clientX: u, clientY: d } = a.translateFramePositionIntoPage(o), l = new MouseEvent(o.type, {
3156
3148
  ...o,
3157
3149
  clientX: u,
@@ -3159,14 +3151,14 @@ const sr = (e, t) => {
3159
3151
  });
3160
3152
  return Object.defineProperty(l, "target", { value: i.target, enumerable: !0 }), l;
3161
3153
  }
3162
- if (ar(o)) {
3154
+ if (nr(o)) {
3163
3155
  const u = Array.from(o.touches).map((l) => {
3164
- const { clientX: f, clientY: g } = a.translateFramePositionIntoPage(l);
3156
+ const { clientX: f, clientY: p } = a.translateFramePositionIntoPage(l);
3165
3157
  return new Touch({
3166
3158
  identifier: l.identifier,
3167
3159
  target: l.target,
3168
3160
  clientX: f,
3169
- clientY: g
3161
+ clientY: p
3170
3162
  });
3171
3163
  }), d = new TouchEvent(o.type, {
3172
3164
  touches: u,
@@ -3178,10 +3170,10 @@ const sr = (e, t) => {
3178
3170
  return o;
3179
3171
  }
3180
3172
  }), Qe = Node.ELEMENT_NODE, et = Node.TEXT_NODE, tt = Node.CDATA_SECTION_NODE;
3181
- function Pr(e) {
3173
+ function yr(e) {
3182
3174
  return e.replace(/[\[\]\^,();]/g, "^$&");
3183
3175
  }
3184
- function Ir(e, t, n) {
3176
+ function vr(e, t, n) {
3185
3177
  n = n || 0;
3186
3178
  const o = [];
3187
3179
  let r = 0, i;
@@ -3192,13 +3184,13 @@ function Ir(e, t, n) {
3192
3184
  } while (r < e.length);
3193
3185
  return o;
3194
3186
  }
3195
- function $r(e, t) {
3187
+ function br(e, t) {
3196
3188
  let n, o, r, i;
3197
3189
  for (r = 0; r < e.length; r++)
3198
3190
  i = Math.abs(e[r] - t), (!r || i < n) && (i = n, o = e[r]);
3199
3191
  return o;
3200
3192
  }
3201
- function xr(e, t, n) {
3193
+ function wr(e, t, n) {
3202
3194
  let o = 0, r, i = 0, s = !0, a, c;
3203
3195
  for (a = 0; a < e.length; a++)
3204
3196
  if (c = e[a], c.nodeType === Qe) {
@@ -3213,11 +3205,11 @@ function xr(e, t, n) {
3213
3205
  continue;
3214
3206
  throw new Error("The specified node was not found in the array of siblings");
3215
3207
  }
3216
- function Tr(e, t) {
3208
+ function Sr(e, t) {
3217
3209
  const n = typeof e == "number", o = typeof t == "number";
3218
3210
  return !n && !o ? 0 : !n && o ? -1 : n && !o ? 1 : (e || 0) - (t || 0);
3219
3211
  }
3220
- function Cr(e, t) {
3212
+ function Pr(e, t) {
3221
3213
  if (!e && !t)
3222
3214
  return 0;
3223
3215
  if (!e && t)
@@ -3270,7 +3262,7 @@ class be {
3270
3262
  static generatePart(t, n, o) {
3271
3263
  let r = "", i;
3272
3264
  for (; t.parentNode; )
3273
- i = xr(t.parentNode.childNodes, t, n), !r && i.offset && (r = ":" + i.offset), r = "/" + i.count + (t.id ? "[" + Pr(t.id) + "]" : "") + r, t = t.parentNode;
3265
+ i = wr(t.parentNode.childNodes, t, n), !r && i.offset && (r = ":" + i.offset), r = "/" + i.count + (t.id ? "[" + yr(t.id) + "]" : "") + r, t = t.parentNode;
3274
3266
  return r;
3275
3267
  }
3276
3268
  static generate(t, n, o) {
@@ -3326,7 +3318,7 @@ class be {
3326
3318
  return a;
3327
3319
  if (i.nodeIndex === 0)
3328
3320
  return 0;
3329
- if (!(r < o - 1) && (i.nodeIndex % 2 === 0 && (a = Tr(i.temporal, s.temporal), a || (a = Cr(i.spatial, s.spatial), a)) || (a = (i.offset || 0) - (s.offset || 0), a)))
3321
+ if (!(r < o - 1) && (i.nodeIndex % 2 === 0 && (a = Sr(i.temporal, s.temporal), a || (a = Pr(i.spatial, s.spatial), a)) || (a = (i.offset || 0) - (s.offset || 0), a)))
3330
3322
  return a;
3331
3323
  }
3332
3324
  return 0;
@@ -3518,10 +3510,10 @@ class be {
3518
3510
  let d = "", l = 0;
3519
3511
  for (; this.isTextNode(i) && (c = this.decodeEntities(t, i.textContent), u[l] = c.length, d += c, !!i.nextSibling); )
3520
3512
  i = i.nextSibling, l++;
3521
- const f = r.pre ? r.pre.length : 0, g = Ir(d, new RegExp(s), f);
3522
- if (!g.length)
3513
+ const f = r.pre ? r.pre.length : 0, p = vr(d, new RegExp(s), f);
3514
+ if (!p.length)
3523
3515
  return { node: n, offset: o };
3524
- let y = $r(g, o);
3516
+ let y = br(p, o);
3525
3517
  if (i === n && y === o)
3526
3518
  return { node: n, offset: o };
3527
3519
  for (l = 0, i = a; y >= u[l]; ) {
@@ -3640,7 +3632,7 @@ const Xe = (e) => {
3640
3632
  itemId: t && decodeURIComponent(t),
3641
3633
  offset: isNaN(r) ? void 0 : r
3642
3634
  };
3643
- }, Fr = (e, t) => {
3635
+ }, Ir = (e, t) => {
3644
3636
  const n = e.toString();
3645
3637
  return {
3646
3638
  toString: () => n,
@@ -3653,7 +3645,7 @@ const Xe = (e) => {
3653
3645
  return be.generate(e.focusNode, e.focusOffset, `|[prose~anchor~${encodeURIComponent(t.id)}]`);
3654
3646
  }
3655
3647
  };
3656
- }, Ae = R.namespace("spine"), Er = ({
3648
+ }, Ae = R.namespace("spine"), $r = ({
3657
3649
  ownerDocument: e,
3658
3650
  context: t,
3659
3651
  pagination: n,
@@ -3668,7 +3660,7 @@ const Xe = (e) => {
3668
3660
  currentNavigationPosition$: l,
3669
3661
  viewportState$: f
3670
3662
  }) => {
3671
- const g = new H(), y = new H(), v = new H(), w = Ar(e, i), p = Sr({
3663
+ const p = new H(), y = new H(), v = new H(), w = xr(e, i), g = mr({
3672
3664
  context: t,
3673
3665
  spineItemManager: r,
3674
3666
  iframeEventBridgeElement: o,
@@ -3678,7 +3670,7 @@ const Xe = (e) => {
3678
3670
  const N = () => {
3679
3671
  var x;
3680
3672
  y.next(), r.destroyItems(), (x = t.getManifest()) == null || x.spineItems.map(async ($) => {
3681
- const T = wr({
3673
+ const T = hr({
3682
3674
  item: $,
3683
3675
  containerElement: w,
3684
3676
  iframeEventBridgeElement: o,
@@ -3687,7 +3679,7 @@ const Xe = (e) => {
3687
3679
  viewportState$: f
3688
3680
  });
3689
3681
  r.add(T);
3690
- }), g.next(r.getAll());
3682
+ }), p.next(r.getAll());
3691
3683
  }, I = (x) => {
3692
3684
  let $ = !1;
3693
3685
  r.getAll().forEach((T, A) => {
@@ -3752,7 +3744,7 @@ const Xe = (e) => {
3752
3744
  U((E) => {
3753
3745
  v.next({
3754
3746
  type: "onSelectionChange",
3755
- data: E.data ? Fr(E.data, $.item) : null
3747
+ data: E.data ? Ir(E.data, $.item) : null
3756
3748
  });
3757
3749
  })
3758
3750
  ),
@@ -3761,7 +3753,7 @@ const Xe = (e) => {
3761
3753
  W(
3762
3754
  (E) => T.pipe(
3763
3755
  B(({ event: O }) => O === "fingermove"),
3764
- uo(() => pn(1e3)),
3756
+ io(() => ln(1e3)),
3765
3757
  j(
3766
3758
  T.pipe(
3767
3759
  B(({ event: O }) => O === "fingerout"),
@@ -3851,11 +3843,11 @@ const Xe = (e) => {
3851
3843
  locator: a,
3852
3844
  spineItemLocator: s,
3853
3845
  cfiLocator: c,
3854
- normalizeEventForViewport: p.normalizeEventForViewport,
3846
+ normalizeEventForViewport: g.normalizeEventForViewport,
3855
3847
  manipulateSpineItems: I,
3856
3848
  manipulateSpineItem: S,
3857
3849
  destroy: () => {
3858
- g.complete(), y.next(), y.complete(), v.complete(), r.destroy(), C == null || C.unsubscribe(), w.remove();
3850
+ p.complete(), y.next(), y.complete(), v.complete(), r.destroy(), C == null || C.unsubscribe(), w.remove();
3859
3851
  },
3860
3852
  adjustPagination: h,
3861
3853
  isSelecting: () => {
@@ -3869,27 +3861,27 @@ const Xe = (e) => {
3869
3861
  $: {
3870
3862
  $: v.asObservable(),
3871
3863
  layout$: r.$.layout$,
3872
- itemsCreated$: g.asObservable(),
3864
+ itemsCreated$: p.asObservable(),
3873
3865
  itemsBeforeDestroy$: y.asObservable()
3874
3866
  }
3875
3867
  };
3876
- }, Ar = (e, t) => {
3868
+ }, xr = (e, t) => {
3877
3869
  const n = e.createElement("div");
3878
3870
  return n.style.cssText = `
3879
3871
  height: 100%;
3880
3872
  position: relative;
3881
3873
  `, n.className = `${Ve}-spine`, t.getValue().reduce((o, r) => r.name === "spine.onBeforeContainerCreated" ? r.fn(o) : o, n);
3882
- }, Nr = (e) => {
3874
+ }, Tr = (e) => {
3883
3875
  var n;
3884
3876
  const t = (n = e.guide) == null ? void 0 : n.find((o) => o.type === "cover");
3885
3877
  return e.spineItems.findIndex((o) => t != null && t.href ? o.href.endsWith(t.href) : !1);
3886
- }, Or = "spineItemManager", Rr = ({ context: e }) => {
3878
+ }, Cr = "spineItemManager", Fr = ({ context: e }) => {
3887
3879
  const t = new H(), n = new H();
3888
3880
  let o = [];
3889
3881
  const r = new q([]);
3890
3882
  let i;
3891
3883
  const s = () => {
3892
- const S = e.getManifest(), m = [], h = (S == null ? void 0 : S.renditionLayout) === "pre-paginated", b = S ? Nr(S) : void 0;
3884
+ const S = e.getManifest(), m = [], h = (S == null ? void 0 : S.renditionLayout) === "pre-paginated", b = S ? Tr(S) : void 0;
3893
3885
  r.value.reduce(
3894
3886
  ($, T, A) => {
3895
3887
  const E = b === A;
@@ -3944,7 +3936,7 @@ const Xe = (e) => {
3944
3936
  { edgeX: 0, edgeY: 0 }
3945
3937
  );
3946
3938
  const x = o.some(($, T) => !ce($, m[T]));
3947
- o = m, R.log(Or, "layout", { hasLayoutChanges: x, itemLayoutInformation: o }), n.next(x);
3939
+ o = m, R.log(Cr, "layout", { hasLayoutChanges: x, itemLayoutInformation: o }), n.next(x);
3948
3940
  }, a = (S) => {
3949
3941
  const m = typeof S == "number" ? u(S) : S;
3950
3942
  if (!m)
@@ -3981,7 +3973,7 @@ const Xe = (e) => {
3981
3973
  };
3982
3974
  },
3983
3975
  { disable: !0 }
3984
- ), l = () => i !== void 0 ? r.value[i] : void 0, f = (S, m) => r.value.indexOf(S) > r.value.indexOf(m) ? "after" : "before", g = (S) => {
3976
+ ), l = () => i !== void 0 ? r.value[i] : void 0, f = (S, m) => r.value.indexOf(S) > r.value.indexOf(m) ? "after" : "before", p = (S) => {
3985
3977
  if (!S)
3986
3978
  return;
3987
3979
  const m = r.value.indexOf(S);
@@ -3995,9 +3987,9 @@ const Xe = (e) => {
3995
3987
  }),
3996
3988
  j(e.$.destroy$)
3997
3989
  ).subscribe(), S.load();
3998
- }, v = () => r.value, w = () => r.value.length, p = () => {
3990
+ }, v = () => r.value, w = () => r.value.length, g = () => {
3999
3991
  const S = l();
4000
- return S && g(S);
3992
+ return S && p(S);
4001
3993
  }, C = R.measurePerformance(
4002
3994
  "getSpineItemAtPosition",
4003
3995
  10,
@@ -4025,8 +4017,8 @@ const Xe = (e) => {
4025
4017
  getAbsolutePositionOf: d,
4026
4018
  getSpineItemAtPosition: C,
4027
4019
  getFocusedSpineItem: l,
4028
- getFocusedSpineItemIndex: p,
4029
- getSpineItemIndex: g,
4020
+ getFocusedSpineItemIndex: g,
4021
+ getSpineItemIndex: p,
4030
4022
  destroy: () => {
4031
4023
  N(), t.complete(), n.complete();
4032
4024
  },
@@ -4041,16 +4033,16 @@ const Xe = (e) => {
4041
4033
  )
4042
4034
  }
4043
4035
  };
4044
- }, ln = ({ context: e }) => {
4036
+ }, sn = ({ context: e }) => {
4045
4037
  const t = (u, d) => {
4046
- const { width: l, height: f } = d.getElementDimensions(), g = d.getReadingDirection();
4038
+ const { width: l, height: f } = d.getElementDimensions(), p = d.getReadingDirection();
4047
4039
  if (d.isUsingVerticalWriting())
4048
4040
  return {
4049
4041
  x: 0,
4050
4042
  y: vt(e.getPageSize().height, u, f)
4051
4043
  };
4052
4044
  const y = vt(e.getPageSize().width, u, l);
4053
- return g === "rtl" ? {
4045
+ return p === "rtl" ? {
4054
4046
  x: l - y - e.getPageSize().width,
4055
4047
  y: 0
4056
4048
  } : {
@@ -4058,18 +4050,18 @@ const Xe = (e) => {
4058
4050
  y: 0
4059
4051
  };
4060
4052
  }, n = (u, d) => {
4061
- const { width: l, height: f } = d.getElementDimensions(), g = d.getReadingDirection(), y = e.getPageSize().width, v = e.getPageSize().height;
4053
+ const { width: l, height: f } = d.getElementDimensions(), p = d.getReadingDirection(), y = e.getPageSize().width, v = e.getPageSize().height;
4062
4054
  let w = Math.min(l, Math.max(0, u.x));
4063
- if (g === "rtl" && (w = l - w - e.getPageSize().width), d.isUsingVerticalWriting()) {
4064
- const p = ue(f, v);
4065
- return c(u.y, v, p);
4055
+ if (p === "rtl" && (w = l - w - e.getPageSize().width), d.isUsingVerticalWriting()) {
4056
+ const g = ue(f, v);
4057
+ return c(u.y, v, g);
4066
4058
  } else {
4067
- const p = ue(l, y);
4068
- return c(w, y, p);
4059
+ const g = ue(l, y);
4060
+ return c(w, y, g);
4069
4061
  }
4070
4062
  }, o = (u, d) => {
4071
4063
  var v;
4072
- const l = ((v = d.getElementDimensions()) == null ? void 0 : v.width) || 0, f = e.getPageSize().width, g = d.getBoundingRectOfElementFromSelector(u), y = (g == null ? void 0 : g.x) || 0;
4064
+ const l = ((v = d.getElementDimensions()) == null ? void 0 : v.width) || 0, f = e.getPageSize().width, p = d.getBoundingRectOfElementFromSelector(u), y = (p == null ? void 0 : p.x) || 0;
4073
4065
  return Ee(y, f, l);
4074
4066
  }, r = (u, d, l) => {
4075
4067
  var v;
@@ -4077,23 +4069,23 @@ const Xe = (e) => {
4077
4069
  if ((u == null ? void 0 : u.nodeName) === "img" || (u == null ? void 0 : u.textContent) === "" && u.nodeType === Node.ELEMENT_NODE)
4078
4070
  f = u.getBoundingClientRect().x;
4079
4071
  else if (u) {
4080
- const w = u ? sr(u, d) : void 0;
4072
+ const w = u ? tr(u, d) : void 0;
4081
4073
  f = (w == null ? void 0 : w.getBoundingClientRect().x) || f;
4082
4074
  }
4083
- const g = ((v = l.getElementDimensions()) == null ? void 0 : v.width) || 0, y = e.getPageSize().width;
4075
+ const p = ((v = l.getElementDimensions()) == null ? void 0 : v.width) || 0, y = e.getPageSize().width;
4084
4076
  if (f)
4085
- return { x: Ee(f, y, g), y: 0 };
4077
+ return { x: Ee(f, y, p), y: 0 };
4086
4078
  }, i = (u, d) => {
4087
- var g, y, v;
4088
- const l = e.getPageSize(), f = (y = (g = d.spineItemFrame) == null ? void 0 : g.getManipulableFrame()) == null ? void 0 : y.frame;
4079
+ var p, y, v;
4080
+ const l = e.getPageSize(), f = (y = (p = d.spineItemFrame) == null ? void 0 : p.getManipulableFrame()) == null ? void 0 : y.frame;
4089
4081
  if ((v = f == null ? void 0 : f.contentWindow) != null && v.document && f.contentWindow.document.body !== null) {
4090
- const { x: w, y: p } = t(u, d), C = {
4082
+ const { x: w, y: g } = t(u, d), C = {
4091
4083
  left: w,
4092
4084
  right: w + l.width,
4093
- top: p,
4094
- bottom: p + l.height
4085
+ top: g,
4086
+ bottom: g + l.height
4095
4087
  };
4096
- return rr(f.contentWindow.document, C);
4088
+ return Qo(f.contentWindow.document, C);
4097
4089
  }
4098
4090
  }, s = (u, d) => {
4099
4091
  const { width: l, height: f } = d.getElementDimensions();
@@ -4105,10 +4097,10 @@ const Xe = (e) => {
4105
4097
  const f = r(u, d, l);
4106
4098
  return f ? n(f, l) : void 0;
4107
4099
  }, c = (u, d, l) => {
4108
- const f = [...Array(l)].map((g, y) => y * d);
4100
+ const f = [...Array(l)].map((p, y) => y * d);
4109
4101
  return u <= 0 ? 0 : u >= l * d ? l - 1 : Math.max(
4110
4102
  0,
4111
- f.findIndex((g) => u < g + d)
4103
+ f.findIndex((p) => u < p + d)
4112
4104
  );
4113
4105
  };
4114
4106
  return {
@@ -4120,8 +4112,8 @@ const Xe = (e) => {
4120
4112
  getSpineItemClosestPositionFromUnsafePosition: s,
4121
4113
  getFirstNodeOrRangeAtPage: i
4122
4114
  };
4123
- }, Lr = ({ context: e }) => {
4124
- const t = ln({ context: e }), n = (c, u) => {
4115
+ }, Er = ({ context: e }) => {
4116
+ const t = sn({ context: e }), n = (c, u) => {
4125
4117
  let d = {
4126
4118
  x: c.x - e.getPageSize().width,
4127
4119
  y: c.y
@@ -4156,13 +4148,13 @@ const Xe = (e) => {
4156
4148
  getNavigationForPosition: (c, u) => t.getSpineItemClosestPositionFromUnsafePosition(u, c),
4157
4149
  getNavigationFromNode: (c, u, d) => t.getSpineItemPositionFromNode(u, d, c) || { x: 0, y: 0 }
4158
4150
  };
4159
- }, Pt = "spineNavigator", Dr = ({
4151
+ }, Pt = "spineNavigator", Ar = ({
4160
4152
  context: e,
4161
4153
  spineItemManager: t,
4162
4154
  cfiLocator: n,
4163
4155
  locator: o
4164
4156
  }) => {
4165
- const r = Lr({ context: e }), i = (m, h) => m.x !== h.x || m.y !== h.y, s = (m, h) => i(m, h) || !!m.spineItem && !!h.spineItem && m.spineItem !== h.spineItem, a = R.measurePerformance(
4157
+ const r = Er({ context: e }), i = (m, h) => m.x !== h.x || m.y !== h.y, s = (m, h) => i(m, h) || !!m.spineItem && !!h.spineItem && m.spineItem !== h.spineItem, a = R.measurePerformance(
4166
4158
  `${Pt} wrapPositionWithSafeEdge`,
4167
4159
  1,
4168
4160
  (m) => {
@@ -4199,7 +4191,7 @@ const Xe = (e) => {
4199
4191
  return { ...c(b), spineItem: h };
4200
4192
  }
4201
4193
  return { x: 0, y: 0 };
4202
- }, g = (m) => {
4194
+ }, p = (m) => {
4203
4195
  const h = e.getSettings().computedPageTurnDirection, b = o.getSpineItemFromPosition(m) || t.getFocusedSpineItem(), x = m;
4204
4196
  if (!b)
4205
4197
  return x;
@@ -4217,7 +4209,7 @@ const Xe = (e) => {
4217
4209
  );
4218
4210
  }, v = (m) => {
4219
4211
  const h = o.getSpineItemFromPosition(m) || t.getFocusedSpineItem();
4220
- let b = g(m);
4212
+ let b = p(m);
4221
4213
  if (h != null && h.isUsingVerticalWriting() && m.x === b.x)
4222
4214
  return c(b);
4223
4215
  if (e.shouldDisplaySpread()) {
@@ -4235,7 +4227,7 @@ const Xe = (e) => {
4235
4227
  );
4236
4228
  if (e.getSettings().computedPageTurnDirection === "vertical" && m.y !== b.y)
4237
4229
  return c(b);
4238
- b = g(b);
4230
+ b = p(b);
4239
4231
  }
4240
4232
  return c(b);
4241
4233
  }, w = (m) => {
@@ -4255,7 +4247,7 @@ const Xe = (e) => {
4255
4247
  b = y(b);
4256
4248
  }
4257
4249
  return c(b);
4258
- }, p = (m) => {
4250
+ }, g = (m) => {
4259
4251
  var b;
4260
4252
  let h;
4261
4253
  try {
@@ -4291,7 +4283,7 @@ const Xe = (e) => {
4291
4283
  getNavigationForSpineIndexOrId: f,
4292
4284
  getNavigationForRightPage: v,
4293
4285
  getNavigationForLeftPage: w,
4294
- getNavigationForUrl: p,
4286
+ getNavigationForUrl: g,
4295
4287
  getNavigationForAnchor: C,
4296
4288
  getNavigationForPosition: N,
4297
4289
  getMostPredominantNavigationForPosition: (m) => {
@@ -4303,7 +4295,7 @@ const Xe = (e) => {
4303
4295
  areNavigationDifferent: s,
4304
4296
  arePositionsDifferent: i
4305
4297
  };
4306
- }, It = 200, _r = ({
4298
+ }, It = 200, Nr = ({
4307
4299
  context: e,
4308
4300
  element: t,
4309
4301
  navigator: n,
@@ -4313,15 +4305,15 @@ const Xe = (e) => {
4313
4305
  let i = !1;
4314
4306
  const s = (w) => w.pipe(
4315
4307
  B(() => i ? (i = !1, !1) : !0)
4316
- ), a = ({ x: w, y: p }) => e.getSettings().computedPageTurnMode === "scrollable" ? (i = !0, t.scrollTo({ left: w, top: p }), !0) : !1, u = ((w) => e.$.settings$.pipe(
4308
+ ), a = ({ x: w, y: g }) => e.getSettings().computedPageTurnMode === "scrollable" ? (i = !0, t.scrollTo({ left: w, top: g }), !0) : !1, u = ((w) => e.$.settings$.pipe(
4317
4309
  k(() => e.getSettings().computedPageTurnMode),
4318
4310
  Q(),
4319
- W((p) => hn(() => p === "controlled", te, w))
4320
- ))(Ft(t, "scroll")).pipe(
4311
+ W((g) => dn(() => g === "controlled", te, w))
4312
+ ))(xt(t, "scroll")).pipe(
4321
4313
  s,
4322
4314
  oe(),
4323
4315
  j(e.$.destroy$)
4324
- ), d = ({ x: w, y: p }) => {
4316
+ ), d = ({ x: w, y: g }) => {
4325
4317
  const C = r.element.getBoundingClientRect().width / r.element.offsetWidth;
4326
4318
  return {
4327
4319
  x: je({
@@ -4336,10 +4328,10 @@ const Xe = (e) => {
4336
4328
  oldScale: C,
4337
4329
  screenSize: t.clientHeight,
4338
4330
  pageSize: r.element.scrollHeight,
4339
- scrollOffset: p
4331
+ scrollOffset: g
4340
4332
  })
4341
4333
  };
4342
- }, l = (w) => n.getMostPredominantNavigationForPosition(w), f = () => d({ x: t.scrollLeft, y: t.scrollTop }), g = u.pipe(
4334
+ }, l = (w) => n.getMostPredominantNavigationForPosition(w), f = () => d({ x: t.scrollLeft, y: t.scrollTop }), p = u.pipe(
4343
4335
  Ze(It, me),
4344
4336
  re(o),
4345
4337
  W(() => {
@@ -4366,10 +4358,10 @@ const Xe = (e) => {
4366
4358
  getCurrentViewportPosition: f,
4367
4359
  $: {
4368
4360
  state$: v,
4369
- navigation$: g
4361
+ navigation$: p
4370
4362
  }
4371
4363
  };
4372
- }, Ne = "manualViewportNavigator", Mr = ({
4364
+ }, Ne = "manualViewportNavigator", Or = ({
4373
4365
  navigator: e,
4374
4366
  spineItemManager: t,
4375
4367
  currentNavigationSubject$: n,
@@ -4378,7 +4370,7 @@ const Xe = (e) => {
4378
4370
  }) => {
4379
4371
  const i = new q("end"), s = new H(), a = ({ allowSpineItemChange: h = !0 } = {}) => s.next({ type: "leftPage", data: { allowSpineItemChange: h } }), c = ({ allowSpineItemChange: h = !0 } = {}) => {
4380
4372
  s.next({ type: "rightPage", data: { allowSpineItemChange: h } });
4381
- }, u = (h) => s.next({ type: "chapterPage", data: { pageIndex: h } }), d = (h) => s.next({ type: "pageIndex", data: { pageIndex: h } }), l = (h, b = { animate: !0 }) => s.next({ type: "cfi", data: { cfi: h, ...b } }), f = (h) => s.next({ type: "url", data: h }), g = (h, b = { animate: !0 }) => {
4373
+ }, u = (h) => s.next({ type: "chapterPage", data: { pageIndex: h } }), d = (h) => s.next({ type: "pageIndex", data: { pageIndex: h } }), l = (h, b = { animate: !0 }) => s.next({ type: "cfi", data: { cfi: h, ...b } }), f = (h) => s.next({ type: "url", data: h }), p = (h, b = { animate: !0 }) => {
4382
4374
  s.next({ type: "spineItem", data: { indexOrId: h, ...b } });
4383
4375
  }, y = s.pipe(
4384
4376
  B((h) => h.type === "url"),
@@ -4406,7 +4398,7 @@ const Xe = (e) => {
4406
4398
  lastUserExpectedNavigation: { type: "navigate-from-cfi", data: b }
4407
4399
  };
4408
4400
  })
4409
- ), p = s.pipe(
4401
+ ), g = s.pipe(
4410
4402
  B((h) => h.type === "chapterPage"),
4411
4403
  W(({ data: { pageIndex: h } }) => {
4412
4404
  const b = t.getFocusedSpineItem();
@@ -4477,7 +4469,7 @@ const Xe = (e) => {
4477
4469
  ), m = X(
4478
4470
  y,
4479
4471
  v,
4480
- p,
4472
+ g,
4481
4473
  I,
4482
4474
  S,
4483
4475
  X(w, C)
@@ -4494,7 +4486,7 @@ const Xe = (e) => {
4494
4486
  turnRight: c,
4495
4487
  goToCfi: l,
4496
4488
  goToPageOfCurrentChapter: u,
4497
- goToSpineItem: g,
4489
+ goToSpineItem: p,
4498
4490
  goToUrl: f,
4499
4491
  goToPage: d,
4500
4492
  $: {
@@ -4502,7 +4494,7 @@ const Xe = (e) => {
4502
4494
  navigation$: m
4503
4495
  }
4504
4496
  };
4505
- }, jr = "panViewportNavigator", Vr = ({
4497
+ }, Rr = "panViewportNavigator", Lr = ({
4506
4498
  getCurrentViewportPosition: e,
4507
4499
  navigator: t,
4508
4500
  spineItemManager: n,
@@ -4513,9 +4505,9 @@ const Xe = (e) => {
4513
4505
  const s = new H(), a = new q("end");
4514
4506
  let c = { x: 0, y: 0 }, u = { x: 0, y: 0 };
4515
4507
  const d = new H(), l = R.measurePerformance(
4516
- `${jr} moveTo`,
4508
+ `${Rr} moveTo`,
4517
4509
  5,
4518
- (w, { final: p, start: C } = {}) => {
4510
+ (w, { final: g, start: C } = {}) => {
4519
4511
  if (r.getSettings().computedPageTurnMode === "scrollable") {
4520
4512
  R.warn("pan control is not available on free page turn mode");
4521
4513
  return;
@@ -4531,7 +4523,7 @@ const Xe = (e) => {
4531
4523
  }), c = w;
4532
4524
  } else
4533
4525
  I = e();
4534
- if (u = I, p) {
4526
+ if (u = I, g) {
4535
4527
  c = { x: 0, y: 0 }, f({
4536
4528
  from: i.value,
4537
4529
  to: I,
@@ -4544,31 +4536,31 @@ const Xe = (e) => {
4544
4536
  { disable: !1 }
4545
4537
  ), f = (w) => {
4546
4538
  s.next({ type: "snap", data: w });
4547
- }, g = R.measurePerformance(
4539
+ }, p = R.measurePerformance(
4548
4540
  "turnTo",
4549
4541
  10,
4550
- (w, { allowSpineItemChange: p = !0 } = {}) => {
4542
+ (w, { allowSpineItemChange: g = !0 } = {}) => {
4551
4543
  const C = n.getFocusedSpineItem();
4552
4544
  if (!C)
4553
4545
  return;
4554
4546
  const N = o.getSpineItemFromPosition(w) || C;
4555
4547
  if (N !== C) {
4556
- if (p)
4548
+ if (g)
4557
4549
  return n.comparePositionOf(N, C) === "before" ? { type: "navigate-from-next-item" } : { type: "navigate-from-previous-item" };
4558
4550
  } else
4559
4551
  return;
4560
4552
  }
4561
4553
  ), y = s.pipe(
4562
4554
  B((w) => w.type === "snap"),
4563
- mn(r.$.settings$),
4555
+ fn(r.$.settings$),
4564
4556
  W(
4565
4557
  ([
4566
4558
  {
4567
- data: { from: w, to: p }
4559
+ data: { from: w, to: g }
4568
4560
  },
4569
4561
  { navigationSnapThreshold: C }
4570
4562
  ]) => {
4571
- const N = r.getSettings().computedPageTurnDirection, S = t.isNavigationGoingForwardFrom(p, w) ? 1 - C : C, m = N === "horizontal" ? p.x + r.getVisibleAreaRect().width * S : 0, h = N === "horizontal" ? 0 : p.y + r.getVisibleAreaRect().height * S, b = t.wrapPositionWithSafeEdge({ x: m, y: h }), x = t.getNavigationForPosition(b), $ = g(x);
4563
+ const N = r.getSettings().computedPageTurnDirection, S = t.isNavigationGoingForwardFrom(g, w) ? 1 - C : C, m = N === "horizontal" ? g.x + r.getVisibleAreaRect().width * S : 0, h = N === "horizontal" ? 0 : g.y + r.getVisibleAreaRect().height * S, b = t.wrapPositionWithSafeEdge({ x: m, y: h }), x = t.getNavigationForPosition(b), $ = p(x);
4572
4564
  return J({ ...x, lastUserExpectedNavigation: $ });
4573
4565
  }
4574
4566
  )
@@ -4585,7 +4577,7 @@ const Xe = (e) => {
4585
4577
  navigation$: X(y)
4586
4578
  }
4587
4579
  };
4588
- }, pe = "viewportNavigator", kr = ({
4580
+ }, pe = "viewportNavigator", Dr = ({
4589
4581
  spineItemManager: e,
4590
4582
  context: t,
4591
4583
  pagination: n,
@@ -4595,16 +4587,16 @@ const Xe = (e) => {
4595
4587
  hooks$: s,
4596
4588
  spine: a
4597
4589
  }) => {
4598
- const c = zr(o.ownerDocument, s);
4590
+ const c = _r(o.ownerDocument, s);
4599
4591
  c.appendChild(a.element);
4600
4592
  const u = new H();
4601
4593
  let d;
4602
- const l = new q({ x: -1, y: 0 }), f = Dr({
4594
+ const l = new q({ x: -1, y: 0 }), f = Ar({
4603
4595
  context: t,
4604
4596
  spineItemManager: e,
4605
4597
  cfiLocator: r,
4606
4598
  locator: i
4607
- }), g = new H();
4599
+ }), p = new H();
4608
4600
  o.appendChild(c);
4609
4601
  const y = R.measurePerformance(`${pe} getCurrentViewportPosition`, 1, () => {
4610
4602
  if (d && (d == null || d.x, ~~(Math.abs(c.getBoundingClientRect().x) * 10) / 10), t.getSettings().computedPageTurnMode === "scrollable")
@@ -4614,7 +4606,7 @@ const Xe = (e) => {
4614
4606
  x: ~~(Math.abs(P) * 10) / 10,
4615
4607
  y: ~~(Math.abs(L) * 10) / 10
4616
4608
  }, d;
4617
- }), v = Vr({
4609
+ }), v = Lr({
4618
4610
  context: t,
4619
4611
  element: c,
4620
4612
  navigator: f,
@@ -4622,21 +4614,21 @@ const Xe = (e) => {
4622
4614
  locator: i,
4623
4615
  getCurrentViewportPosition: y,
4624
4616
  currentNavigationSubject$: l
4625
- }), w = _r({
4617
+ }), w = Nr({
4626
4618
  context: t,
4627
4619
  element: c,
4628
4620
  navigator: f,
4629
4621
  currentNavigationSubject$: l,
4630
4622
  spine: a,
4631
4623
  spineItemManager: e
4632
- }), p = Mr({
4624
+ }), g = Or({
4633
4625
  context: t,
4634
4626
  element: c,
4635
4627
  navigator: f,
4636
4628
  currentNavigationSubject$: l,
4637
4629
  spineItemManager: e,
4638
4630
  locator: i
4639
- }), C = [w, v, p], N = X(...C.map(({ $: { state$: P } }) => P));
4631
+ }), C = [w, v, g], N = X(...C.map(({ $: { state$: P } }) => P));
4640
4632
  let I;
4641
4633
  const S = (P) => (P.pipe(j(t.$.destroy$)).subscribe(), P), m = R.measurePerformance(
4642
4634
  "adjustReadingOffset",
@@ -4675,7 +4667,7 @@ const Xe = (e) => {
4675
4667
  expectedSpineOffset: M,
4676
4668
  currentNavigationPosition: l.value,
4677
4669
  lastUserExpectedNavigation: I
4678
- }), Y && g.next({
4670
+ }), Y && p.next({
4679
4671
  position: M,
4680
4672
  animate: !1
4681
4673
  }), J({
@@ -4688,7 +4680,7 @@ const Xe = (e) => {
4688
4680
  d = void 0;
4689
4681
  });
4690
4682
  const b = t.$.settings$.pipe(
4691
- Qt(["computedPageTurnDirection", "computedPageTurnMode", "numberOfAdjacentSpineItemToPreLoad"]),
4683
+ Zt(["computedPageTurnDirection", "computedPageTurnMode", "numberOfAdjacentSpineItemToPreLoad"]),
4692
4684
  Q(ce),
4693
4685
  Me(1)
4694
4686
  );
@@ -4706,7 +4698,7 @@ const Xe = (e) => {
4706
4698
  triggeredBy: "manual"
4707
4699
  }))
4708
4700
  ),
4709
- p.$.navigation$.pipe(
4701
+ g.$.navigation$.pipe(
4710
4702
  k((P) => ({
4711
4703
  ...P,
4712
4704
  position: { x: P.x, y: P.y, spineItem: P.spineItem },
@@ -4714,7 +4706,7 @@ const Xe = (e) => {
4714
4706
  triggeredBy: "manual"
4715
4707
  }))
4716
4708
  ),
4717
- g.pipe(
4709
+ p.pipe(
4718
4710
  k((P) => ({
4719
4711
  ...P,
4720
4712
  triggeredBy: "adjust",
@@ -4747,7 +4739,7 @@ const Xe = (e) => {
4747
4739
  oe()
4748
4740
  ), E = X(A).pipe(
4749
4741
  lt(void 0),
4750
- Kt(),
4742
+ Gt(),
4751
4743
  U(([P, L]) => {
4752
4744
  (P == null ? void 0 : P.type) === "manualAdjust" && (L == null ? void 0 : L.type) !== "manualAdjust" && (c.style.setProperty("transition", "none"), c.style.setProperty("opacity", "1"));
4753
4745
  }),
@@ -4792,7 +4784,7 @@ const Xe = (e) => {
4792
4784
  S
4793
4785
  ), F = _.pipe(
4794
4786
  B((P) => P === "free"),
4795
- yn(1)
4787
+ gn(1)
4796
4788
  ), D = a.$.layout$.pipe(
4797
4789
  W(
4798
4790
  () => F.pipe(
@@ -4807,18 +4799,18 @@ const Xe = (e) => {
4807
4799
  );
4808
4800
  return {
4809
4801
  destroy: () => {
4810
- u.complete(), g.complete(), l.complete(), C.forEach((P) => P.destroy());
4802
+ u.complete(), p.complete(), l.complete(), C.forEach((P) => P.destroy());
4811
4803
  },
4812
4804
  layout: () => u.next(),
4813
4805
  getCurrentNavigationPosition: () => l.value,
4814
4806
  getCurrentViewportPosition: y,
4815
- turnLeft: p.turnLeft,
4816
- turnRight: p.turnRight,
4817
- goToPage: p.goToPage,
4818
- goToSpineItem: p.goToSpineItem,
4819
- goToUrl: p.goToUrl,
4820
- goToCfi: p.goToCfi,
4821
- goToPageOfCurrentChapter: p.goToPageOfCurrentChapter,
4807
+ turnLeft: g.turnLeft,
4808
+ turnRight: g.turnRight,
4809
+ goToPage: g.goToPage,
4810
+ goToSpineItem: g.goToSpineItem,
4811
+ goToUrl: g.goToUrl,
4812
+ goToCfi: g.goToCfi,
4813
+ goToPageOfCurrentChapter: g.goToPageOfCurrentChapter,
4822
4814
  adjustNavigation: h,
4823
4815
  moveTo: v.moveTo,
4824
4816
  getLastUserExpectedNavigation: () => I,
@@ -4830,13 +4822,13 @@ const Xe = (e) => {
4830
4822
  currentNavigationPosition$: l.asObservable()
4831
4823
  }
4832
4824
  };
4833
- }, zr = (e, t) => {
4825
+ }, _r = (e, t) => {
4834
4826
  const n = e.createElement("div");
4835
4827
  return n.style.cssText = `
4836
4828
  height: 100%;
4837
4829
  position: relative;
4838
4830
  `, n.className = `${Ve}-viewport-navigator`, t.getValue().reduce((o, r) => r.name === "viewportNavigator.onBeforeContainerCreated" ? r.fn(o) : o, n);
4839
- }, Ur = ({
4831
+ }, Mr = ({
4840
4832
  spineItemManager: e,
4841
4833
  context: t,
4842
4834
  spineItemLocator: n
@@ -4845,9 +4837,9 @@ const Xe = (e) => {
4845
4837
  "getSpineItemPositionFromSpinePosition",
4846
4838
  10,
4847
4839
  (l, f) => {
4848
- const { leftEnd: g, leftStart: y, topStart: v, topEnd: w } = e.getAbsolutePositionOf(f);
4840
+ const { leftEnd: p, leftStart: y, topStart: v, topEnd: w } = e.getAbsolutePositionOf(f);
4849
4841
  return t.isRTL() ? {
4850
- x: g - l.x - t.getPageSize().width,
4842
+ x: p - l.x - t.getPageSize().width,
4851
4843
  y: Math.max(0, l.y - v)
4852
4844
  } : {
4853
4845
  x: Math.max(0, l.x - y),
@@ -4856,9 +4848,9 @@ const Xe = (e) => {
4856
4848
  },
4857
4849
  { disable: !0 }
4858
4850
  ), r = (l, f) => {
4859
- const { leftEnd: g, leftStart: y, topStart: v, topEnd: w } = e.getAbsolutePositionOf(f);
4851
+ const { leftEnd: p, leftStart: y, topStart: v, topEnd: w } = e.getAbsolutePositionOf(f);
4860
4852
  return t.isRTL() ? {
4861
- x: g - l.x - t.getPageSize().width,
4853
+ x: p - l.x - t.getPageSize().width,
4862
4854
  y: v + l.y
4863
4855
  } : {
4864
4856
  x: y + l.x,
@@ -4874,44 +4866,44 @@ const Xe = (e) => {
4874
4866
  getSpinePositionFromSpineItemPosition: r,
4875
4867
  getSpinePositionFromSpineItem: (l) => r({ x: 0, y: 0 }, l),
4876
4868
  getSpinePositionFromSpineItemAnchor: (l, f) => {
4877
- const g = n.getSpineItemOffsetFromAnchor(l, f);
4878
- return r({ x: g, y: 0 }, f);
4869
+ const p = n.getSpineItemOffsetFromAnchor(l, f);
4870
+ return r({ x: p, y: 0 }, f);
4879
4871
  },
4880
4872
  getSpineItemPositionFromSpinePosition: o,
4881
4873
  getSpineItemFromPosition: i,
4882
4874
  getSpineItemFromIframe: (l) => e.getAll().find((f) => f.spineItemFrame.getFrameElement() === l),
4883
- getSpineItemPageIndexFromNode: (l, f, g) => {
4884
- if (typeof g == "number") {
4885
- const y = e.get(g);
4875
+ getSpineItemPageIndexFromNode: (l, f, p) => {
4876
+ if (typeof p == "number") {
4877
+ const y = e.get(p);
4886
4878
  return y ? n.getSpineItemPageIndexFromNode(l, f || 0, y) : void 0;
4887
4879
  }
4888
- return n.getSpineItemPageIndexFromNode(l, f || 0, g);
4880
+ return n.getSpineItemPageIndexFromNode(l, f || 0, p);
4889
4881
  },
4890
4882
  getSpineItemsFromReadingOrderPosition: (l) => {
4891
- const f = i(l) || e.getFocusedSpineItem(), g = e.getSpineItemIndex(f);
4892
- if (g === void 0)
4883
+ const f = i(l) || e.getFocusedSpineItem(), p = e.getSpineItemIndex(f);
4884
+ if (p === void 0)
4893
4885
  return;
4894
4886
  let y = l;
4895
4887
  t.shouldDisplaySpread() && (y = { x: l.x + t.getPageSize().width, y: l.y });
4896
- const v = e.getSpineItemIndex(i(y) || e.getFocusedSpineItem()) ?? g, [w = g, p = g] = [g, v].sort((C, N) => C - N);
4888
+ const v = e.getSpineItemIndex(i(y) || e.getFocusedSpineItem()) ?? p, [w = p, g = p] = [p, v].sort((C, N) => C - N);
4897
4889
  return {
4898
- begin: g,
4890
+ begin: p,
4899
4891
  beginPosition: l,
4900
4892
  end: v,
4901
4893
  endPosition: y,
4902
4894
  left: w,
4903
- right: p
4895
+ right: g
4904
4896
  };
4905
4897
  }
4906
4898
  };
4907
- }, Wr = ({
4899
+ }, jr = ({
4908
4900
  spineItemManager: e,
4909
4901
  spineItemLocator: t
4910
4902
  }) => {
4911
4903
  const n = (u) => `|[prose~anchor~${encodeURIComponent(u.item.id)}]`, o = R.measurePerformance("getCfi", 10, (u, d) => {
4912
- var v, w, p;
4913
- const l = t.getFirstNodeOrRangeAtPage(u, d), f = (p = (w = (v = d.spineItemFrame.getManipulableFrame()) == null ? void 0 : v.frame) == null ? void 0 : w.contentWindow) == null ? void 0 : p.document, g = n(d), y = `|[prose~offset~${(l == null ? void 0 : l.offset) || 0}]`;
4914
- return l && f ? be.generate(l.node, 0, `${g}${y}`) : r(d);
4904
+ var v, w, g;
4905
+ const l = t.getFirstNodeOrRangeAtPage(u, d), f = (g = (w = (v = d.spineItemFrame.getManipulableFrame()) == null ? void 0 : v.frame) == null ? void 0 : w.contentWindow) == null ? void 0 : g.document, p = n(d), y = `|[prose~offset~${(l == null ? void 0 : l.offset) || 0}]`;
4906
+ return l && f ? be.generate(l.node, 0, `${p}${y}`) : r(d);
4915
4907
  }), r = (u) => `epubcfi(/0${n(u)}) `, i = (u) => {
4916
4908
  const { itemId: d } = Xe(u);
4917
4909
  if (d) {
@@ -4931,17 +4923,17 @@ const Xe = (e) => {
4931
4923
  getCfi: o,
4932
4924
  getRootCfi: r,
4933
4925
  resolveCfi: (u) => {
4934
- var w, p, C;
4926
+ var w, g, C;
4935
4927
  if (!u)
4936
4928
  return;
4937
4929
  const d = i(u), l = e.getSpineItemIndex(d) || 0;
4938
4930
  if (!d)
4939
4931
  return;
4940
- const { cleanedCfi: f, offset: g } = Xe(u), y = new be(f, {}), v = (C = (p = (w = d.spineItemFrame.getManipulableFrame()) == null ? void 0 : w.frame) == null ? void 0 : p.contentWindow) == null ? void 0 : C.document;
4932
+ const { cleanedCfi: f, offset: p } = Xe(u), y = new be(f, {}), v = (C = (g = (w = d.spineItemFrame.getManipulableFrame()) == null ? void 0 : w.frame) == null ? void 0 : g.contentWindow) == null ? void 0 : C.document;
4941
4933
  if (v)
4942
4934
  try {
4943
4935
  const { node: N, offset: I } = y.resolve(v, {});
4944
- return { node: N, offset: g ?? I, spineItemIndex: l };
4936
+ return { node: N, offset: p ?? I, spineItemIndex: l };
4945
4937
  } catch (N) {
4946
4938
  return R.error(N), {
4947
4939
  spineItemIndex: l
@@ -4951,43 +4943,43 @@ const Xe = (e) => {
4951
4943
  spineItemIndex: l
4952
4944
  };
4953
4945
  },
4954
- generateFromRange: ({ startNode: u, start: d, end: l, endNode: f }, g) => {
4955
- const y = be.generate(u, d, `|[prose~anchor~${encodeURIComponent(g.id)}]`), v = be.generate(f, l, `|[prose~anchor~${encodeURIComponent(g.id)}]`);
4946
+ generateFromRange: ({ startNode: u, start: d, end: l, endNode: f }, p) => {
4947
+ const y = be.generate(u, d, `|[prose~anchor~${encodeURIComponent(p.id)}]`), v = be.generate(f, l, `|[prose~anchor~${encodeURIComponent(p.id)}]`);
4956
4948
  return { start: y, end: v };
4957
4949
  }
4958
4950
  };
4959
- }, Hr = "proseReaderIframeEventBridgeElement", $t = ({ containerElement: e, hooks: t, ...n }) => {
4951
+ }, Vr = "proseReaderIframeEventBridgeElement", kr = ({ containerElement: e, hooks: t, ...n }) => {
4960
4952
  const o = new q({
4961
4953
  supportedPageTurnAnimation: ["fade", "none", "slide"],
4962
4954
  supportedPageTurnMode: ["controlled", "scrollable"],
4963
4955
  supportedPageTurnDirection: ["horizontal", "vertical"],
4964
4956
  supportedComputedPageTurnDirection: ["horizontal", "vertical"]
4965
- }), r = new H(), i = new H(), s = new H(), a = new q(t || []), c = new H(), u = new H(), d = new q({ x: 0, y: 0 }), l = new q("free"), f = Uo(n), g = Rr({ context: f }), y = Ao({ context: f, spineItemManager: g }), v = Br(e), w = Yr(e), p = ln({ context: f }), C = Ur({
4957
+ }), r = new H(), i = new H(), s = new H(), a = new q(t || []), c = new H(), u = new H(), d = new q({ x: 0, y: 0 }), l = new q("free"), f = Mo(n), p = Fr({ context: f }), y = To({ context: f, spineItemManager: p }), v = zr(e), w = Ur(e), g = sn({ context: f }), C = Mr({
4966
4958
  context: f,
4967
- spineItemManager: g,
4968
- spineItemLocator: p
4969
- }), N = Wr({
4970
- spineItemManager: g,
4959
+ spineItemManager: p,
4960
+ spineItemLocator: g
4961
+ }), N = jr({
4962
+ spineItemManager: p,
4971
4963
  context: f,
4972
- spineItemLocator: p
4973
- }), I = c.asObservable(), S = Er({
4964
+ spineItemLocator: g
4965
+ }), I = c.asObservable(), S = $r({
4974
4966
  ownerDocument: v.ownerDocument,
4975
4967
  iframeEventBridgeElement: w,
4976
4968
  context: f,
4977
4969
  pagination: y,
4978
- spineItemManager: g,
4970
+ spineItemManager: p,
4979
4971
  hooks$: a,
4980
4972
  navigation$: I,
4981
4973
  spineLocator: C,
4982
- spineItemLocator: p,
4974
+ spineItemLocator: g,
4983
4975
  cfiLocator: N,
4984
4976
  navigationAdjusted$: u.asObservable(),
4985
4977
  viewportState$: l.asObservable(),
4986
4978
  currentNavigationPosition$: d.asObservable()
4987
- }), m = kr({
4979
+ }), m = Dr({
4988
4980
  context: f,
4989
4981
  pagination: y,
4990
- spineItemManager: g,
4982
+ spineItemManager: p,
4991
4983
  parentElement: v,
4992
4984
  cfiLocator: N,
4993
4985
  spineLocator: C,
@@ -5020,7 +5012,7 @@ const Xe = (e) => {
5020
5012
  }),
5021
5013
  j(i)
5022
5014
  ).subscribe(), m.$.navigationAdjustedAfterLayout$.pipe(
5023
- Ct(({ adjustedSpinePosition: E }) => S.adjustPagination(E).pipe(j(I))),
5015
+ $t(({ adjustedSpinePosition: E }) => S.adjustPagination(E).pipe(j(I))),
5024
5016
  j(f.$.destroy$)
5025
5017
  ).subscribe(), X(f.$.load$, f.$.settings$, f.$.hasVerticalWriting$).pipe(
5026
5018
  he(void 0),
@@ -5069,10 +5061,10 @@ const Xe = (e) => {
5069
5061
  goToUrl: m.goToUrl,
5070
5062
  goToCfi: m.goToCfi,
5071
5063
  goToSpineItem: m.goToSpineItem,
5072
- getFocusedSpineItemIndex: g.getFocusedSpineItemIndex,
5073
- getSpineItem: g.get,
5074
- getSpineItems: g.getAll,
5075
- getAbsolutePositionOf: g.getAbsolutePositionOf,
5064
+ getFocusedSpineItemIndex: p.getFocusedSpineItemIndex,
5065
+ getSpineItem: p.get,
5066
+ getSpineItems: p.getAll,
5067
+ getAbsolutePositionOf: p.getAbsolutePositionOf,
5076
5068
  getSelection: S.getSelection,
5077
5069
  isSelecting: S.isSelecting,
5078
5070
  normalizeEventForViewport: S.normalizeEventForViewport,
@@ -5086,9 +5078,9 @@ const Xe = (e) => {
5086
5078
  load: b,
5087
5079
  destroy: T,
5088
5080
  setSettings: f.setSettings,
5081
+ settings$: f.$.settings$,
5082
+ pagination$: y.$.info$,
5089
5083
  $: {
5090
- pagination$: y.$.info$,
5091
- settings$: f.$.settings$,
5092
5084
  state$: o.asObservable(),
5093
5085
  ready$: r.asObservable(),
5094
5086
  selection$: s.asObservable(),
@@ -5096,24 +5088,24 @@ const Xe = (e) => {
5096
5088
  layout$: S.$.layout$,
5097
5089
  itemsCreated$: S.$.itemsCreated$,
5098
5090
  itemsBeforeDestroy$: S.$.itemsBeforeDestroy$,
5099
- itemIsReady$: g.$.itemIsReady$,
5091
+ itemIsReady$: p.$.itemIsReady$,
5100
5092
  destroy$: i
5101
5093
  },
5102
5094
  __debug: {
5103
5095
  pagination: y,
5104
5096
  context: f,
5105
- spineItemManager: g
5097
+ spineItemManager: p
5106
5098
  }
5107
5099
  };
5108
- }, Br = (e) => {
5100
+ }, zr = (e) => {
5109
5101
  const t = e.ownerDocument.createElement("div");
5110
5102
  return t.style.cssText = `
5111
5103
  background-color: white;
5112
5104
  position: relative;
5113
5105
  `, t.className = `${Ve}-reader`, t;
5114
- }, Yr = (e) => {
5106
+ }, Ur = (e) => {
5115
5107
  const t = e.ownerDocument.createElement("div");
5116
- return t.id = Hr, t.style.cssText = `
5108
+ return t.id = Vr, t.style.cssText = `
5117
5109
  position: absolute;
5118
5110
  height: 100%;
5119
5111
  width: 100%;
@@ -5121,11 +5113,11 @@ const Xe = (e) => {
5121
5113
  left: 0;
5122
5114
  z-index: -1;
5123
5115
  `, t;
5124
- }, Xr = (e) => (t) => ({
5116
+ }, Wr = (e) => (t) => ({
5125
5117
  ...e(t),
5126
5118
  utils: {
5127
5119
  isOrIsWithinValidLink: (r) => {
5128
- if (nr(r)) {
5120
+ if (Jo(r)) {
5129
5121
  const i = r.nodeName === "a" ? r : r.closest("a");
5130
5122
  if (i != null && i.getAttribute("href"))
5131
5123
  return !0;
@@ -5133,7 +5125,7 @@ const Xe = (e) => {
5133
5125
  return !1;
5134
5126
  }
5135
5127
  }
5136
- }), qr = (e) => ({
5128
+ }), Hr = (e) => ({
5137
5129
  put: (i, s) => new Promise((a, c) => {
5138
5130
  const u = e.transaction(["store"], "readwrite");
5139
5131
  u.onerror = function(f) {
@@ -5191,11 +5183,11 @@ const Xe = (e) => {
5191
5183
  o.onerror = function(r) {
5192
5184
  n(r);
5193
5185
  }, o.onsuccess = function() {
5194
- t(qr(o.result));
5186
+ t(Hr(o.result));
5195
5187
  }, o.onupgradeneeded = () => {
5196
5188
  o.result.createObjectStore("store");
5197
5189
  };
5198
- }), Gr = (e) => {
5190
+ }), Br = (e) => {
5199
5191
  let t = Date.now().toString();
5200
5192
  const n = new H(), o = (c) => {
5201
5193
  var u, d;
@@ -5211,15 +5203,15 @@ const Xe = (e) => {
5211
5203
  const f = await (await qe("prose-reader")).get(`${t}_${d.id}`);
5212
5204
  if (f)
5213
5205
  return new Response(f, { status: 200 });
5214
- const g = u && await u(d) || await fetch(d.href);
5215
- return i(d, g.clone()), g;
5206
+ const p = u && await u(d) || await fetch(d.href);
5207
+ return i(d, p.clone()), p;
5216
5208
  }, i = (c, u) => {
5217
5209
  n.next({ id: c, data: u });
5218
5210
  };
5219
5211
  n.asObservable().pipe(
5220
5212
  ie(({ id: c, data: u }) => {
5221
5213
  const d = o(c);
5222
- return d ? fe(vn([qe("prose-reader"), fe(u.blob())])).pipe(
5214
+ return d ? fe(pn([qe("prose-reader"), fe(u.blob())])).pipe(
5223
5215
  W(([l, f]) => fe(l.put(`${t}_${d.id}`, f))),
5224
5216
  _e((l) => (R.error(l), te))
5225
5217
  ) : te;
@@ -5251,8 +5243,8 @@ const Xe = (e) => {
5251
5243
  n.complete();
5252
5244
  }
5253
5245
  };
5254
- }, Zr = (e) => (t) => {
5255
- const n = e(t), o = Gr(n.context), r = (s, a) => {
5246
+ }, Yr = (e) => (t) => {
5247
+ const n = e(t), o = Br(n.context), r = (s, a) => {
5256
5248
  n.load(s, {
5257
5249
  ...a
5258
5250
  });
@@ -5264,7 +5256,7 @@ const Xe = (e) => {
5264
5256
  },
5265
5257
  load: r
5266
5258
  };
5267
- }, Jr = (e) => (t) => {
5259
+ }, Xr = (e) => (t) => {
5268
5260
  const n = e(t), o = new IntersectionObserver(
5269
5261
  (s) => {
5270
5262
  s.forEach((a) => {
@@ -5306,14 +5298,14 @@ const Xe = (e) => {
5306
5298
  o.disconnect(), r.disconnect(), n.destroy();
5307
5299
  }
5308
5300
  };
5309
- }, Kr = (e) => (t) => {
5301
+ }, qr = (e) => (t) => {
5310
5302
  const n = e(t), o = (s, a, c, u, d, l) => {
5311
5303
  var C, N, I, S, m, h;
5312
- const f = ((C = s.getManifest()) == null ? void 0 : C.renditionLayout) === "pre-paginated", g = ((N = s.getManifest()) == null ? void 0 : N.spineItems.length) || 0, y = ((I = s.getManifest()) == null ? void 0 : I.spineItems.slice(0, a).reduce((b, x) => b + x.progressionWeight, 0)) || 0, v = ((m = (S = s.getManifest()) == null ? void 0 : S.spineItems[a]) == null ? void 0 : m.progressionWeight) || 0;
5304
+ const f = ((C = s.getManifest()) == null ? void 0 : C.renditionLayout) === "pre-paginated", p = ((N = s.getManifest()) == null ? void 0 : N.spineItems.length) || 0, y = ((I = s.getManifest()) == null ? void 0 : I.spineItems.slice(0, a).reduce((b, x) => b + x.progressionWeight, 0)) || 0, v = ((m = (S = s.getManifest()) == null ? void 0 : S.spineItems[a]) == null ? void 0 : m.progressionWeight) || 0;
5313
5305
  let w = (u + 1) * (v / c);
5314
5306
  !f && l.item.renditionLayout === "reflowable" && !l.isReady() && (w = 0);
5315
- let p = y + w;
5316
- return ((h = s.getManifest()) == null ? void 0 : h.renditionFlow) === "scrolled-continuous" && (l.isReady() ? w = i(s, d, l) : w = 0, p = r(y, v, w)), a === g - 1 && u === c - 1 && p > 0.99 ? 1 : p;
5307
+ let g = y + w;
5308
+ return ((h = s.getManifest()) == null ? void 0 : h.renditionFlow) === "scrolled-continuous" && (l.isReady() ? w = i(s, d, l) : w = 0, g = r(y, v, w)), a === p - 1 && u === c - 1 && g > 0.99 ? 1 : g;
5317
5309
  }, r = (s, a, c) => s + a * c, i = (s, a, c) => {
5318
5310
  const { height: u, width: d } = c.getElementDimensions(), { topStart: l, leftStart: f } = n.getAbsolutePositionOf(c);
5319
5311
  return s.getSettings().computedPageTurnDirection === "vertical" ? Math.max(0, Math.min(1, (a.y - l + s.getVisibleAreaRect().height) / u)) : Math.max(0, Math.min(1, (a.x - f + s.getVisibleAreaRect().width) / d));
@@ -5325,7 +5317,7 @@ const Xe = (e) => {
5325
5317
  getScrollPercentageWithinItem: i
5326
5318
  }
5327
5319
  };
5328
- }, Qr = (e) => (t) => {
5320
+ }, Gr = (e) => (t) => {
5329
5321
  const n = e(t), o = new IntersectionObserver((r) => {
5330
5322
  r.forEach((i) => {
5331
5323
  i.isIntersecting ? i.target.removeAttribute("tab-index") : i.target.setAttribute("tab-index", "-1");
@@ -5353,80 +5345,80 @@ const Xe = (e) => {
5353
5345
  }), {
5354
5346
  ...n
5355
5347
  };
5356
- }, ei = navigator.userAgent.indexOf("") > -1 && navigator.userAgent.indexOf("Chrome") <= -1, ti = (e) => (t) => {
5348
+ }, Zr = navigator.userAgent.indexOf("") > -1 && navigator.userAgent.indexOf("Chrome") <= -1, Jr = (e) => (t) => {
5357
5349
  const n = [
5358
5350
  {
5359
5351
  name: "viewportNavigator.onBeforeContainerCreated",
5360
- fn: (r) => (r.style.cssText = `
5361
- ${r.style.cssText}
5352
+ fn: (i) => (i.style.cssText = `
5353
+ ${i.style.cssText}
5362
5354
  -webkit-transform-style: preserve-3d;
5363
- `, r)
5355
+ `, i)
5364
5356
  },
5365
5357
  {
5366
5358
  name: "item.onBeforeContainerCreated",
5367
- fn: (r) => (r.style.cssText = `
5368
- ${r.style.cssText}
5359
+ fn: (i) => (i.style.cssText = `
5360
+ ${i.style.cssText}
5369
5361
  -webkit-transform-style: preserve-3d;
5370
5362
  -webkit-backface-visibility: hidden;
5371
- `, r)
5363
+ `, i)
5372
5364
  }
5373
- ];
5365
+ ], o = t.hooks || [];
5374
5366
  return e({
5375
5367
  ...t,
5376
- ...ei && {
5377
- hooks: [...t.hooks || [], ...n]
5368
+ ...Zr && {
5369
+ hooks: [...o, ...n]
5378
5370
  }
5379
5371
  });
5380
- }, ni = `${Ve}-enhancer-loading`, oi = `${ni}-container`, ri = (e) => (t) => {
5381
- const { loadingElementCreate: n = si, ...o } = t, r = e(o), i = (d) => J(
5382
- d.reduce((l, { item: f, element: g }) => {
5383
- const y = n({
5384
- container: ii(g, r.context),
5385
- item: f
5372
+ }, Kr = `${Ve}-enhancer-loading`, Qr = `${Kr}-container`, ei = (e) => (t) => {
5373
+ const { loadingElementCreate: n = ni } = t, o = e(t), r = (u) => J(
5374
+ u.reduce((d, { item: l, element: f }) => {
5375
+ const p = n({
5376
+ container: ti(f, o.context),
5377
+ item: l
5386
5378
  });
5387
- return g.appendChild(y), {
5388
- ...l,
5389
- [f.id]: y
5379
+ return f.appendChild(p), {
5380
+ ...d,
5381
+ [l.id]: p
5390
5382
  };
5391
5383
  }, {})
5392
- ), s = (d) => $e([r.$.layout$, r.theme.$.theme$]).pipe(
5393
- k(([, l]) => ({
5394
- width: r.context.getVisibleAreaRect().width,
5395
- theme: l
5384
+ ), i = (u) => $e([o.$.layout$, o.theme.$.theme$]).pipe(
5385
+ k(([, d]) => ({
5386
+ width: o.context.getVisibleAreaRect().width,
5387
+ theme: d
5396
5388
  })),
5397
5389
  Q(ce),
5398
- U(({ width: l, theme: f }) => {
5399
- Object.values(d).forEach((g) => {
5400
- g.style.setProperty("max-width", `${l}px`), g.style.setProperty("color", f === "sepia" ? "#939393" : "rgb(202, 202, 202)");
5390
+ U(({ width: d, theme: l }) => {
5391
+ Object.values(u).forEach((f) => {
5392
+ f.style.setProperty("max-width", `${d}px`), f.style.setProperty("color", l === "sepia" ? "#939393" : "rgb(202, 202, 202)");
5401
5393
  });
5402
5394
  })
5403
- ), a = (d) => r.$.itemIsReady$.pipe(
5404
- U(({ item: l, isReady: f }) => {
5405
- var g;
5406
- (g = d[l.id]) == null || g.style.setProperty("visibility", f ? "hidden" : "visible");
5395
+ ), s = (u) => o.$.itemIsReady$.pipe(
5396
+ U(({ item: d, isReady: l }) => {
5397
+ var f;
5398
+ (f = u[d.id]) == null || f.style.setProperty("visibility", l ? "hidden" : "visible");
5407
5399
  })
5408
- ), c = (d) => r.$.itemsBeforeDestroy$.pipe(
5409
- k(() => (Object.values(d).forEach((l) => l.remove()), {}))
5410
- ), u = r.$.itemsCreated$.pipe(
5411
- W((d) => i(d)),
5400
+ ), a = (u) => o.$.itemsBeforeDestroy$.pipe(
5401
+ k(() => (Object.values(u).forEach((d) => d.remove()), {}))
5402
+ ), c = o.$.itemsCreated$.pipe(
5403
+ W((u) => r(u)),
5412
5404
  ut(1),
5413
- j(r.context.$.destroy$)
5405
+ j(o.context.$.destroy$)
5414
5406
  );
5415
- return u.pipe(
5416
- W((d) => X(J(d), c(d))),
5417
- W((d) => X(s(d), a(d))),
5418
- j(r.$.destroy$)
5407
+ return c.pipe(
5408
+ W((u) => X(J(u), a(u))),
5409
+ W((u) => X(i(u), s(u))),
5410
+ j(o.$.destroy$)
5419
5411
  ).subscribe(), {
5420
- ...r,
5412
+ ...o,
5421
5413
  loading: {
5422
5414
  $: {
5423
- items$: u
5415
+ items$: c
5424
5416
  }
5425
5417
  }
5426
5418
  };
5427
- }, ii = (e, t) => {
5419
+ }, ti = (e, t) => {
5428
5420
  const n = e.ownerDocument.createElement("div");
5429
- return n.classList.add(oi), n.style.cssText = `
5421
+ return n.classList.add(Qr), n.style.cssText = `
5430
5422
  height: 100%;
5431
5423
  width: 100%;
5432
5424
  max-width: ${t.getVisibleAreaRect().width}px;
@@ -5441,7 +5433,7 @@ const Xe = (e) => {
5441
5433
  color: rgb(202, 202, 202);
5442
5434
  -background-color: white;
5443
5435
  `, n;
5444
- }, si = ({ container: e, item: t }) => {
5436
+ }, ni = ({ container: e, item: t }) => {
5445
5437
  const n = e.ownerDocument.createElement("div");
5446
5438
  n.innerText = "prose", n.style.cssText = `
5447
5439
  font-size: 4em;
@@ -5455,55 +5447,44 @@ const Xe = (e) => {
5455
5447
  max-width: 300px;
5456
5448
  width: 80%;
5457
5449
  `, e.appendChild(n), e.appendChild(o), e;
5458
- }, xt = (e) => {
5459
- const {
5460
- context: t,
5461
- manipulateContainer: n,
5462
- manipulateSpineItems: o,
5463
- getFocusedSpineItemIndex: r,
5464
- getCurrentNavigationPosition: i,
5465
- getSpineItem: s,
5466
- locator: a,
5467
- getAbsolutePositionOf: c,
5468
- generateCfi: u,
5469
- resolveCfi: d,
5470
- getCfiMetaInformation: l,
5471
- spine: f,
5472
- ...g
5473
- } = e;
5474
- return g;
5475
- }, Tt = tn(
5476
- Kr,
5477
- Ro,
5478
- yo,
5479
- Do,
5480
- Fo,
5481
- Pn,
5482
- Jr,
5483
- Vo,
5484
- xo,
5485
- Xr,
5486
- Zr,
5487
- Qr,
5488
- Co,
5489
- ho,
5490
- ti,
5491
- ri
5450
+ }, ai = ei(
5451
+ Jr(
5452
+ lo(
5453
+ Io(
5454
+ Gr(
5455
+ Yr(
5456
+ Wr(
5457
+ So(
5458
+ Lo(
5459
+ Xr(
5460
+ vn(
5461
+ $o(
5462
+ No(
5463
+ go(
5464
+ Eo(
5465
+ qr(
5466
+ kr
5467
+ )
5468
+ )
5469
+ )
5470
+ )
5471
+ )
5472
+ )
5473
+ )
5474
+ )
5475
+ )
5476
+ )
5477
+ )
5478
+ )
5479
+ )
5480
+ )
5481
+ )
5492
5482
  );
5493
- function li(e, t) {
5494
- if (!t) {
5495
- const r = Tt($t);
5496
- return xt(r(e));
5497
- }
5498
- const o = tn(Tt, t)($t);
5499
- return xt(o(e));
5500
- }
5501
5483
  export {
5502
5484
  R as Report,
5503
- _o as compose,
5504
- tn as composeEnhancer,
5505
- li as createReader,
5506
- ui as groupBy,
5485
+ ii as compose,
5486
+ ai as createReader,
5487
+ si as groupBy,
5507
5488
  ce as isShallowEqual
5508
5489
  };
5509
5490
  //# sourceMappingURL=prose.js.map