@prose-reader/core 1.220.0 → 1.222.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,25 +1,25 @@
1
- import { switchMap as v, of as w, fromEvent as G, take as me, map as b, from as W, takeUntil as F, Observable as st, defer as Nt, Subject as U, combineLatest as q, merge as x, EMPTY as Q, withLatestFrom as D, NEVER as gt, tap as T, share as V, BehaviorSubject as k, filter as A, first as H, mergeMap as $t, endWith as pt, finalize as ut, catchError as fe, lastValueFrom as Ye, scheduled as Ze, animationFrameScheduler as at, shareReplay as et, distinctUntilChanged as E, throttleTime as Ge, debounceTime as St, startWith as nt, switchScan as Je, forkJoin as Ke, delay as wt, ReplaySubject as Jt, skip as ye, identity as Pt, exhaustMap as Vt, timer as Kt, reduce as Qe, concatMap as Qt } from "rxjs";
2
- import { Report as ti, isShallowEqual as N, shallowMergeIfDefined as vt, getParentPath as ei, parseContentType as ii, detectMimeTypeFromName as Lt, arrayEqual as ni } from "@prose-reader/shared";
3
- import { isShallowEqual as Ts } from "@prose-reader/shared";
4
- import { switchMap as _, first as Se, map as X, distinctUntilChanged as Z, startWith as be, shareReplay as Mt, tap as z, pairwise as oi, take as si, takeUntil as J, filter as tt, debounceTime as ri, skip as ai, mergeMap as ci, catchError as te, withLatestFrom as ui } from "rxjs/operators";
5
- import { generate as Ie, parse as we, isParsedCfiRange as di, isIndirectionOnly as gi, resolve as li } from "@prose-reader/cfi";
1
+ import { switchMap as v, of as w, fromEvent as G, take as me, map as b, from as W, takeUntil as F, Observable as st, defer as Nt, Subject as U, combineLatest as q, merge as x, EMPTY as Q, withLatestFrom as D, NEVER as gt, tap as T, share as V, BehaviorSubject as k, filter as A, first as H, mergeMap as $t, endWith as pt, finalize as ut, catchError as fe, lastValueFrom as Ye, scheduled as Ze, animationFrameScheduler as at, shareReplay as et, distinctUntilChanged as E, throttleTime as Ge, debounceTime as St, startWith as nt, switchScan as Je, defaultIfEmpty as Ke, forkJoin as Qe, delay as wt, ReplaySubject as Jt, skip as ye, identity as Pt, exhaustMap as Vt, timer as Kt, reduce as ti, concatMap as Qt } from "rxjs";
2
+ import { Report as ei, isShallowEqual as N, shallowMergeIfDefined as vt, getParentPath as ii, parseContentType as ni, detectMimeTypeFromName as Lt, arrayEqual as oi } from "@prose-reader/shared";
3
+ import { isShallowEqual as Fs } from "@prose-reader/shared";
4
+ import { switchMap as _, first as Se, map as X, distinctUntilChanged as Z, startWith as be, shareReplay as Mt, tap as z, pairwise as si, take as ri, takeUntil as J, filter as tt, debounceTime as ai, skip as ci, mergeMap as ui, catchError as te, withLatestFrom as di } from "rxjs/operators";
5
+ import { generate as Ie, parse as we, isParsedCfiRange as gi, isIndirectionOnly as li, resolve as pi } from "@prose-reader/cfi";
6
6
  const ee = (e, t) => {
7
7
  const i = new RegExp(`${t}\\s*=\\s*([0-9.]+)`, "i"), n = e.match(i) || [], o = n[1] || "0";
8
8
  return n && Number.parseFloat(o) || 0;
9
- }, pi = (e, t, i, n) => {
9
+ }, hi = (e, t, i, n) => {
10
10
  var o;
11
11
  if ((o = e == null ? void 0 : e.contentDocument) != null && o.head) {
12
12
  const s = e.contentDocument.createElement("style");
13
13
  s.id = t, s.innerHTML = i, n ? e.contentDocument.head.prepend(s) : e.contentDocument.head.appendChild(s);
14
14
  }
15
- }, hi = (e, t) => {
15
+ }, mi = (e, t) => {
16
16
  var i;
17
17
  if ((i = e == null ? void 0 : e.contentDocument) != null && i.head) {
18
18
  const n = e.contentDocument.getElementById(t);
19
19
  n && n.remove();
20
20
  }
21
21
  }, ot = (e, t, i, n) => {
22
- e && (hi(e, t), pi(e, t, i, n));
22
+ e && (mi(e, t), hi(e, t, i, n));
23
23
  }, Bt = (e) => {
24
24
  if (e != null && e.contentDocument) {
25
25
  const i = e.contentDocument.querySelector("meta[name='viewport']");
@@ -36,7 +36,7 @@ const ee = (e, t) => {
36
36
  }
37
37
  }
38
38
  return { hasViewport: !1 };
39
- }, mi = (e) => e.pipe(
39
+ }, fi = (e) => e.pipe(
40
40
  v((t) => {
41
41
  var i;
42
42
  return t.src === "about:blank" && ((i = t.contentDocument) == null ? void 0 : i.readyState) === "complete" && t.contentDocument.body ? w(t) : G(t, "load").pipe(
@@ -44,7 +44,7 @@ const ee = (e, t) => {
44
44
  b(() => t)
45
45
  );
46
46
  })
47
- ), fi = (e) => e.pipe(
47
+ ), yi = (e) => e.pipe(
48
48
  v(
49
49
  (t) => {
50
50
  var i;
@@ -53,7 +53,7 @@ const ee = (e, t) => {
53
53
  );
54
54
  }
55
55
  )
56
- ), yi = (e) => (t) => {
56
+ ), Si = (e) => (t) => {
57
57
  const i = e(t), n = new IntersectionObserver((o) => {
58
58
  o.forEach((s) => {
59
59
  s.isIntersecting ? s.target.removeAttribute("tab-index") : s.target.setAttribute("tab-index", "-1");
@@ -89,7 +89,7 @@ const ee = (e, t) => {
89
89
  ), {
90
90
  ...i
91
91
  };
92
- }, Si = (e) => (t) => {
92
+ }, bi = (e) => (t) => {
93
93
  const i = e(t);
94
94
  return i.context.state$.pipe(F(i.$.destroy$)).subscribe(({ containerElement: n }) => {
95
95
  if (!n) return;
@@ -102,7 +102,7 @@ const ee = (e, t) => {
102
102
  const o = i.spineItemsManager.get(n), s = o == null ? void 0 : o.renderer.getDocumentFrame();
103
103
  s && ((r = s.contentDocument) == null || r.body.setAttribute("tabindex", "-1"));
104
104
  }), i;
105
- }, bi = "@prose-reader/core", j = ti.namespace(bi), Ii = [
105
+ }, Ii = "@prose-reader/core", j = ei.namespace(Ii), wi = [
106
106
  "pointercancel",
107
107
  "pointerdown",
108
108
  "pointerenter",
@@ -114,24 +114,24 @@ const ee = (e, t) => {
114
114
  // `touchstart` as const,
115
115
  // `touchend` as const,
116
116
  ], Pe = (e) => typeof e == "object" && !!e && "nodeType" in e && (e == null ? void 0 : e.nodeType) === Node.ELEMENT_NODE;
117
- function wi(e, t, i) {
117
+ function Pi(e, t, i) {
118
118
  if ("caretPositionFromPoint" in e)
119
119
  return e.caretPositionFromPoint(t, i);
120
120
  if ("caretRangeFromPoint" in e && // @ts-expect-error limited availability
121
121
  typeof e.caretRangeFromPoint < "u")
122
122
  return e.caretRangeFromPoint(t, i);
123
123
  }
124
- const Pi = (e, t) => {
124
+ const vi = (e, t) => {
125
125
  const i = "body" in e ? jt(e.body, t) : jt(e, t), n = "createRange" in e ? e : e.ownerDocument;
126
126
  if (i) {
127
127
  let o, s = 0;
128
128
  const r = n.createRange();
129
129
  return Array.from(i.childNodes).some((a) => {
130
130
  r.selectNodeContents(a);
131
- const c = r.getClientRects(), u = vi(c, t);
131
+ const c = r.getClientRects(), u = xi(c, t);
132
132
  if (u) {
133
133
  o = r.cloneRange();
134
- const d = wi(
134
+ const d = Pi(
135
135
  n,
136
136
  Math.ceil(u.left),
137
137
  Math.ceil(u.top)
@@ -155,13 +155,13 @@ const Pi = (e, t) => {
155
155
  function ve(e, { left: t, right: i }) {
156
156
  return e.left <= t && e.right <= t ? "before" : e.left <= t && e.right > t && e.right <= i ? "partially-before" : e.left <= i && e.right > i ? "partially-after" : e.left > i ? "after" : "within";
157
157
  }
158
- function vi(e, t) {
158
+ function xi(e, t) {
159
159
  return Array.from(e).find((i) => {
160
160
  const n = ve(i, t);
161
161
  return n !== "before" && n !== "after";
162
162
  });
163
163
  }
164
- const xi = (e, t) => {
164
+ const $i = (e, t) => {
165
165
  var i;
166
166
  if (e.nodeType !== Node.CDATA_SECTION_NODE && e.nodeType !== Node.DOCUMENT_TYPE_NODE) {
167
167
  const n = (i = e.ownerDocument) == null ? void 0 : i.createRange();
@@ -185,8 +185,8 @@ const xi = (e, t) => {
185
185
  if (r.PointerEvent && e instanceof r.PointerEvent)
186
186
  return !0;
187
187
  }
188
- return !!Ii.includes(e.type);
189
- }, $i = (e) => {
188
+ return !!wi.includes(e.type);
189
+ }, Ti = (e) => {
190
190
  var t, i, n, o, s;
191
191
  if (_t(e)) return !1;
192
192
  if (e != null && e.target && ((i = (t = e == null ? void 0 : e.target) == null ? void 0 : t.ownerDocument) != null && i.defaultView)) {
@@ -200,7 +200,7 @@ const xi = (e, t) => {
200
200
  return e instanceof r.MouseEvent;
201
201
  }
202
202
  return !1;
203
- }, Ti = (e) => {
203
+ }, Fi = (e) => {
204
204
  var t, i, n, o, s;
205
205
  if (e != null && e.target && ((i = (t = e == null ? void 0 : e.target) == null ? void 0 : t.ownerDocument) != null && i.defaultView)) {
206
206
  const r = (o = (n = e == null ? void 0 : e.target) == null ? void 0 : n.ownerDocument) == null ? void 0 : o.defaultView;
@@ -213,7 +213,7 @@ const xi = (e, t) => {
213
213
  return e instanceof r.TouchEvent;
214
214
  }
215
215
  return !1;
216
- }, Fi = () => document.createElement("div"), xe = (e) => {
216
+ }, Li = () => document.createElement("div"), xe = (e) => {
217
217
  const t = [
218
218
  "img",
219
219
  // Images
@@ -229,7 +229,7 @@ const xi = (e, t) => {
229
229
  // JavaScript files
230
230
  ].join(",");
231
231
  return Array.from((e == null ? void 0 : e.querySelectorAll(t)) || []);
232
- }, Li = (e) => {
232
+ }, Mi = (e) => {
233
233
  if (xe(e).forEach((i) => {
234
234
  var o;
235
235
  const n = i.getAttribute("src") || i.getAttribute("href");
@@ -249,7 +249,7 @@ const xi = (e, t) => {
249
249
  }
250
250
  }
251
251
  };
252
- function Mi(e, t) {
252
+ function Ci(e, t) {
253
253
  return Pe(e) && e.tagName.toLowerCase() === t.toLowerCase();
254
254
  }
255
255
  const Rt = ({
@@ -261,7 +261,7 @@ const Rt = ({
261
261
  clientX: a,
262
262
  clientY: c
263
263
  };
264
- }, Ci = (e, t, i, n) => {
264
+ }, Ri = (e, t, i, n) => {
265
265
  var u;
266
266
  const o = (u = t == null ? void 0 : t.view) == null ? void 0 : u.frameElement;
267
267
  if (!t || !o) return e;
@@ -282,7 +282,7 @@ const Rt = ({
282
282
  enumerable: !0
283
283
  }), l;
284
284
  }
285
- if ($i(e)) {
285
+ if (Ti(e)) {
286
286
  const { clientX: d, clientY: g } = Rt({
287
287
  position: e,
288
288
  frameElement: r
@@ -296,7 +296,7 @@ const Rt = ({
296
296
  enumerable: !0
297
297
  }), l;
298
298
  }
299
- if (Ti(e)) {
299
+ if (Fi(e)) {
300
300
  const d = Array.from(e.touches).map((l) => {
301
301
  const { clientX: p, clientY: h } = Rt({
302
302
  position: l,
@@ -319,7 +319,7 @@ const Rt = ({
319
319
  }), g;
320
320
  }
321
321
  return e;
322
- }, Ri = [
322
+ }, Ai = [
323
323
  "pointercancel",
324
324
  "pointerdown",
325
325
  "pointerenter",
@@ -328,23 +328,23 @@ const Rt = ({
328
328
  "pointerout",
329
329
  "pointerover",
330
330
  "pointerup"
331
- ], Ai = [
332
- ...Ri
331
+ ], Oi = [
332
+ ...Ai
333
333
  /*, ...mouseEvents*/
334
- ], Oi = (e) => (t) => {
334
+ ], Di = (e) => (t) => {
335
335
  const i = e(t);
336
336
  return i.hookManager.register(
337
337
  "item.onDocumentLoad",
338
338
  ({ destroy: n, itemId: o }) => {
339
339
  const s = i.spineItemsManager.get(o), r = s == null ? void 0 : s.renderer.getDocumentFrame();
340
340
  if (!r || !s) return;
341
- const a = Ai.map((c) => {
341
+ const a = Oi.map((c) => {
342
342
  var d;
343
343
  const u = (g) => {
344
344
  var p;
345
345
  let l = g;
346
346
  if (_t(g) && (l = new PointerEvent(g.type, g)), l !== g) {
347
- const h = Ci(
347
+ const h = Ri(
348
348
  l,
349
349
  g,
350
350
  i.spine.locator,
@@ -389,7 +389,7 @@ const Ct = (e) => (t) => t.pipe(
389
389
  X(() => i)
390
390
  )
391
391
  )
392
- ), Di = (e) => {
392
+ ), Ni = (e) => {
393
393
  let t;
394
394
  const i = e.subscribe((n) => {
395
395
  t = { result: n };
@@ -419,7 +419,7 @@ const ne = (e, t) => new st((i) => {
419
419
  });
420
420
  return n.observe(e, t), () => n.disconnect();
421
421
  });
422
- function Is(e, t) {
422
+ function ws(e, t) {
423
423
  return new st((i) => {
424
424
  const n = new IntersectionObserver((o) => {
425
425
  i.next(o);
@@ -477,7 +477,7 @@ class Le {
477
477
  this.outputSettingsUpdateSubject.complete();
478
478
  }
479
479
  }
480
- const Ni = (e) => {
480
+ const Vi = (e) => {
481
481
  const t = new FileReader();
482
482
  return new Promise((i) => {
483
483
  t.addEventListener(
@@ -489,7 +489,7 @@ const Ni = (e) => {
489
489
  ), t.readAsDataURL(e);
490
490
  });
491
491
  };
492
- let Vi = class extends Le {
492
+ let ji = class extends Le {
493
493
  computeOutputSettings(t) {
494
494
  return t;
495
495
  }
@@ -509,8 +509,8 @@ let Vi = class extends Le {
509
509
  };
510
510
  }
511
511
  };
512
- const ji = (e) => (t) => {
513
- const { fontScale: i, lineHeight: n, fontWeight: o, fontJustification: s } = t, r = new U(), a = e(t), c = new Vi(
512
+ const ki = (e) => (t) => {
513
+ const { fontScale: i, lineHeight: n, fontWeight: o, fontJustification: s } = t, r = new U(), a = e(t), c = new ji(
514
514
  {
515
515
  fontScale: i,
516
516
  lineHeight: n,
@@ -542,7 +542,7 @@ const ji = (e) => (t) => {
542
542
  }
543
543
  });
544
544
  const g = (l) => l.pipe(
545
- oi(),
545
+ si(),
546
546
  b(([p, h]) => h.fontScale !== p.fontScale || h.lineHeight !== p.lineHeight)
547
547
  );
548
548
  return c.values$.pipe(
@@ -556,7 +556,7 @@ const ji = (e) => (t) => {
556
556
  },
557
557
  settings: c
558
558
  };
559
- }, ki = (e) => (t) => {
559
+ }, Wi = (e) => (t) => {
560
560
  const i = e(t), n = (o) => G(o, "keyup").pipe(
561
561
  D(i.settings.values$),
562
562
  b(([s, { pageTurnDirection: r }]) => {
@@ -590,7 +590,7 @@ const ji = (e) => (t) => {
590
590
  ),
591
591
  F(i.$.destroy$)
592
592
  ).subscribe(), i;
593
- }, Wi = (e) => e.spine.spineItemsManager.items$.pipe(
593
+ }, zi = (e) => e.spine.spineItemsManager.items$.pipe(
594
594
  v(
595
595
  (t) => x(
596
596
  ...t.map((i) => i.loaded$.pipe(
@@ -760,7 +760,7 @@ const Ft = class Ft extends Y {
760
760
  };
761
761
  Ft.DOCUMENT_CONTAINER_CLASS_NAME = "prose-reader-document-container";
762
762
  let ht = Ft;
763
- const zi = (e) => new URL(e.href);
763
+ const Ui = (e) => new URL(e.href);
764
764
  class qt {
765
765
  constructor(t, i) {
766
766
  this.item = t, this.settings = i;
@@ -769,7 +769,7 @@ class qt {
769
769
  var i, n;
770
770
  return await Ye(
771
771
  ((n = (i = this.settings.values).getResource) == null ? void 0 : n.call(i, this.item)) ?? w(void 0)
772
- ) ?? zi(this.item);
772
+ ) ?? Ui(this.item);
773
773
  }
774
774
  async fetchResource() {
775
775
  const t = await this.getResource();
@@ -779,7 +779,7 @@ class qt {
779
779
  const Me = (e, t) => {
780
780
  const i = e.startsWith("file://"), n = i ? e.replace("file://", "http://") : e, o = new URL(t, n).toString();
781
781
  return i ? o.replace("http://", "file://") : o;
782
- }, Ui = async (e, t, i, n, o) => {
782
+ }, Hi = async (e, t, i, n, o) => {
783
783
  if (!e || !e.defaultView) return;
784
784
  const s = t.sheet;
785
785
  if (s)
@@ -828,7 +828,7 @@ const Me = (e, t) => {
828
828
  } catch (r) {
829
829
  console.error("Could not access stylesheet rules:", r);
830
830
  }
831
- }, Hi = (e, t, i, n, o) => {
831
+ }, Ei = (e, t, i, n, o) => {
832
832
  var c;
833
833
  const s = t.getAttribute("src") || t.getAttribute("href");
834
834
  if (!s) return w(null);
@@ -852,7 +852,7 @@ const Me = (e, t) => {
852
852
  return new st((l) => {
853
853
  t.onload = async () => {
854
854
  try {
855
- t.sheet && await Ui(
855
+ t.sheet && await Hi(
856
856
  e,
857
857
  t,
858
858
  i,
@@ -867,7 +867,7 @@ const Me = (e, t) => {
867
867
  return w(null);
868
868
  })
869
869
  );
870
- }, Ei = ({
870
+ }, Bi = ({
871
871
  settings: e,
872
872
  item: t,
873
873
  context: i
@@ -875,8 +875,8 @@ const Me = (e, t) => {
875
875
  v((o) => {
876
876
  const s = xe(
877
877
  o.contentDocument
878
- ), r = ei(t.href), a = s.map(
879
- (c) => Hi(
878
+ ), r = ii(t.href), a = s.map(
879
+ (c) => Ei(
880
880
  o.contentDocument,
881
881
  c,
882
882
  r,
@@ -886,20 +886,20 @@ const Me = (e, t) => {
886
886
  );
887
887
  return q(a).pipe(b(() => o));
888
888
  })
889
- ), Bi = (e) => {
890
- Li(e == null ? void 0 : e.contentDocument);
891
- }, _i = [".xhtml", ".html", ".htm"], lt = "prose-reader", Xi = (e) => new Promise((t, i) => {
889
+ ), _i = (e) => {
890
+ Mi(e == null ? void 0 : e.contentDocument);
891
+ }, Xi = [".xhtml", ".html", ".htm"], lt = "prose-reader", qi = (e) => new Promise((t, i) => {
892
892
  const n = new Image();
893
893
  n.src = e, n.onload = () => {
894
894
  t({ height: n.naturalHeight, width: n.naturalWidth });
895
895
  }, n.onerror = i;
896
- }), qi = async (e, t) => {
896
+ }), Yi = async (e, t) => {
897
897
  if (typeof e == "string") return e;
898
- const i = ii(e.headers.get("Content-Type") || "") || Lt(t.href);
898
+ const i = ni(e.headers.get("Content-Type") || "") || Lt(t.href);
899
899
  if (["image/jpg", "image/jpeg", "image/png", "image/webp"].some(
900
900
  (o) => o === i
901
901
  )) {
902
- const o = await Ni(await e.blob()), { height: s, width: r } = await Xi(o);
902
+ const o = await Vi(await e.blob()), { height: s, width: r } = await qi(o);
903
903
  return `
904
904
  <html>
905
905
  <head>
@@ -931,11 +931,11 @@ const Me = (e, t) => {
931
931
  </body>
932
932
  </html>
933
933
  ` : await e.text();
934
- }, Yi = ({
934
+ }, Zi = ({
935
935
  item: e,
936
936
  resourcesHandler: t
937
937
  }) => {
938
- const i = (n) => qi(n, e);
938
+ const i = (n) => Yi(n, e);
939
939
  return (n) => n.pipe(
940
940
  v((o) => W(t.getResource()).pipe(
941
941
  v((s) => s instanceof URL && e.href.startsWith(window.location.origin) && // we have an encoding and it's a valid html
@@ -945,7 +945,7 @@ const Me = (e, t) => {
945
945
  "text/html",
946
946
  "text/xml"
947
947
  ].includes(e.mediaType) || // no encoding ? then try to detect html
948
- !e.mediaType && _i.some(
948
+ !e.mediaType && Xi.some(
949
949
  (a) => e.href.endsWith(a)
950
950
  )) ? (o == null || o.setAttribute("src", e.href), w(o)) : (s instanceof URL ? W(t.fetchResource()) : w(s)).pipe(
951
951
  v((a) => {
@@ -967,7 +967,7 @@ const Me = (e, t) => {
967
967
  ))
968
968
  ))
969
969
  );
970
- }, Zi = () => {
970
+ }, Gi = () => {
971
971
  const e = document.createElement("iframe");
972
972
  return e.frameBorder = "no", e.tabIndex = 0, e.setAttribute(
973
973
  "sandbox",
@@ -1000,7 +1000,7 @@ const Me = (e, t) => {
1000
1000
  e / (n.height ?? 1)
1001
1001
  ), computedWidthScale: o, viewportDimensions: n };
1002
1002
  }
1003
- }, Gi = ({
1003
+ }, Ji = ({
1004
1004
  columnWidth: e,
1005
1005
  enableTouch: t,
1006
1006
  spreadPosition: i
@@ -1045,12 +1045,12 @@ const Me = (e, t) => {
1045
1045
  object-fit:contain;
1046
1046
  `}
1047
1047
  }
1048
- `, Ji = ({
1048
+ `, Ki = ({
1049
1049
  pageHeight: e,
1050
1050
  pageWidth: t
1051
1051
  }) => ({ columnHeight: e, columnWidth: t }), oe = (e, t) => {
1052
1052
  e.style.width = `${t.width}px`, e.style.height = `${t.height}px`;
1053
- }, Ki = ({
1053
+ }, Qi = ({
1054
1054
  minPageSpread: e,
1055
1055
  blankPagePosition: t,
1056
1056
  spreadPosition: i,
@@ -1062,9 +1062,9 @@ const Me = (e, t) => {
1062
1062
  }) => {
1063
1063
  const c = e * o;
1064
1064
  if (s != null && s.contentDocument && (s != null && s.contentWindow)) {
1065
- const { viewportDimensions: u, computedScale: d = 1 } = Re({ frameElement: s, pageHeight: n, pageWidth: o }) ?? {}, g = o, l = n, p = Gi(
1065
+ const { viewportDimensions: u, computedScale: d = 1 } = Re({ frameElement: s, pageHeight: n, pageWidth: o }) ?? {}, g = o, l = n, p = Ji(
1066
1066
  {
1067
- ...Ji({ pageHeight: n, pageWidth: o }),
1067
+ ...Ki({ pageHeight: n, pageWidth: o }),
1068
1068
  enableTouch: a,
1069
1069
  spreadPosition: i
1070
1070
  },
@@ -1094,7 +1094,7 @@ const Me = (e, t) => {
1094
1094
  return { width: c, height: l };
1095
1095
  }
1096
1096
  return { width: c, height: n };
1097
- }, Qi = () => `
1097
+ }, tn = () => `
1098
1098
  ${Ce()}
1099
1099
  html {
1100
1100
  width: 100%;
@@ -1109,7 +1109,7 @@ const Me = (e, t) => {
1109
1109
  html, body {
1110
1110
  touch-action: none;
1111
1111
  }
1112
- `, tn = ({
1112
+ `, en = ({
1113
1113
  isScrollable: e,
1114
1114
  enableTouch: t
1115
1115
  }) => `
@@ -1134,7 +1134,7 @@ const Me = (e, t) => {
1134
1134
  display: block;
1135
1135
  }
1136
1136
  ` : ""}
1137
- `, en = ({
1137
+ `, nn = ({
1138
1138
  width: e,
1139
1139
  columnHeight: t,
1140
1140
  columnWidth: i
@@ -1202,7 +1202,7 @@ const Me = (e, t) => {
1202
1202
  td {
1203
1203
  max-width: ${i}px;
1204
1204
  }
1205
- `, nn = ({
1205
+ `, on = ({
1206
1206
  isUsingVerticalWriting: e,
1207
1207
  minimumWidth: t,
1208
1208
  pageHeight: i,
@@ -1218,7 +1218,7 @@ const Me = (e, t) => {
1218
1218
  };
1219
1219
  }, It = (e, t) => {
1220
1220
  e.style.width = `${t.width}px`, e.style.height = `${t.height}px`;
1221
- }, on = ({
1221
+ }, sn = ({
1222
1222
  pageHeight: e,
1223
1223
  pageWidth: t,
1224
1224
  frameElement: i,
@@ -1246,7 +1246,7 @@ const Me = (e, t) => {
1246
1246
  ot(
1247
1247
  i,
1248
1248
  "prose-reader-html-renderer-framce-css",
1249
- Qi()
1249
+ tn()
1250
1250
  ), It(i, {
1251
1251
  width: m.width ?? 1,
1252
1252
  height: m.height ?? 1
@@ -1258,11 +1258,11 @@ const Me = (e, t) => {
1258
1258
  `translate(-50%, -50%) scale(${S})`
1259
1259
  ), i == null || i.style.setProperty("transform-origin", "center center");
1260
1260
  else {
1261
- const L = c ? tn({
1261
+ const L = c ? en({
1262
1262
  isScrollable: (n == null ? void 0 : n.renditionFlow) === "scrolled-continuous",
1263
1263
  enableTouch: u
1264
- }) : en(
1265
- nn({
1264
+ }) : nn(
1265
+ on({
1266
1266
  isUsingVerticalWriting: d,
1267
1267
  minimumWidth: g,
1268
1268
  pageHeight: h,
@@ -1299,7 +1299,7 @@ const Me = (e, t) => {
1299
1299
  latestContentHeightWhenLoaded: l
1300
1300
  };
1301
1301
  };
1302
- class sn extends ht {
1302
+ class rn extends ht {
1303
1303
  constructor() {
1304
1304
  super(...arguments), this.isImageType = () => {
1305
1305
  const t = this.item.mediaType ?? Lt(this.item.href);
@@ -1307,14 +1307,14 @@ class sn extends ht {
1307
1307
  };
1308
1308
  }
1309
1309
  onCreateDocument() {
1310
- const t = Zi();
1310
+ const t = Gi();
1311
1311
  return this.setDocumentContainer(t), w(t);
1312
1312
  }
1313
1313
  onLoadDocument() {
1314
1314
  const t = this.getFrameElement();
1315
1315
  if (!t) throw new Error("invalid frame");
1316
1316
  return w(t).pipe(
1317
- Yi({
1317
+ Zi({
1318
1318
  item: this.item,
1319
1319
  resourcesHandler: this.resourcesHandler,
1320
1320
  settings: this.settings
@@ -1323,17 +1323,17 @@ class sn extends ht {
1323
1323
  T(() => {
1324
1324
  this.attach();
1325
1325
  }),
1326
- mi,
1327
- Ei({
1326
+ fi,
1327
+ Bi({
1328
1328
  context: this.context,
1329
1329
  item: this.item,
1330
1330
  settings: this.settings
1331
1331
  }),
1332
- fi
1332
+ yi
1333
1333
  );
1334
1334
  }
1335
1335
  onUnload() {
1336
- return Bi(this.getFrameElement()), this.detach(), Q;
1336
+ return _i(this.getFrameElement()), this.detach(), Q;
1337
1337
  }
1338
1338
  onLayout({
1339
1339
  minPageSpread: t,
@@ -1345,7 +1345,7 @@ class sn extends ht {
1345
1345
  if (!r) return w(void 0);
1346
1346
  const a = !!((d = this.writingMode) != null && d.startsWith("vertical"));
1347
1347
  if (this.item.renditionLayout === "pre-paginated" || !this.item.renditionLayout && ((g = this.context.manifest) == null ? void 0 : g.renditionLayout) === "pre-paginated") {
1348
- const l = Ki({
1348
+ const l = Qi({
1349
1349
  blankPagePosition: i,
1350
1350
  enableTouch: this.settings.values.computedPageTurnMode !== "scrollable",
1351
1351
  frameElement: r,
@@ -1357,7 +1357,7 @@ class sn extends ht {
1357
1357
  });
1358
1358
  return w(l);
1359
1359
  }
1360
- const { latestContentHeightWhenLoaded: c, ...u } = on({
1360
+ const { latestContentHeightWhenLoaded: c, ...u } = sn({
1361
1361
  pageHeight: s,
1362
1362
  pageWidth: o,
1363
1363
  frameElement: r,
@@ -1429,14 +1429,14 @@ class sn extends ht {
1429
1429
  return this.getFrameElement();
1430
1430
  }
1431
1431
  }
1432
- const rn = (e) => (t) => {
1432
+ const an = (e) => (t) => {
1433
1433
  const i = e({
1434
1434
  ...t,
1435
1435
  getRenderer(o) {
1436
1436
  var r;
1437
- return ((r = t.getRenderer) == null ? void 0 : r.call(t, o)) ?? ((a) => new sn(a));
1437
+ return ((r = t.getRenderer) == null ? void 0 : r.call(t, o)) ?? ((a) => new rn(a));
1438
1438
  }
1439
- }), n = Wi(i);
1439
+ }), n = zi(i);
1440
1440
  return n.pipe(F(i.$.destroy$)).subscribe(), {
1441
1441
  ...i,
1442
1442
  links$: n
@@ -1445,7 +1445,7 @@ const rn = (e) => (t) => {
1445
1445
  function ct(e) {
1446
1446
  return e != null;
1447
1447
  }
1448
- let an = class extends Le {
1448
+ let cn = class extends Le {
1449
1449
  computeOutputSettings(t) {
1450
1450
  return t;
1451
1451
  }
@@ -1473,7 +1473,7 @@ let an = class extends Le {
1473
1473
  };
1474
1474
  }
1475
1475
  };
1476
- const cn = (e) => {
1476
+ const un = (e) => {
1477
1477
  let t;
1478
1478
  const i = e.context.state$.pipe(
1479
1479
  _(({ containerElement: c }) => c ? new st(() => (t = c.ownerDocument.createElement("div"), t.style.cssText = `
@@ -1501,7 +1501,7 @@ const cn = (e) => {
1501
1501
  );
1502
1502
  })
1503
1503
  ), s = n(e.viewportFree$).pipe(
1504
- si(1)
1504
+ ri(1)
1505
1505
  ), a = e.settings.values$.pipe(
1506
1506
  X(() => e.settings.values.computedPageTurnMode),
1507
1507
  Z()
@@ -1512,7 +1512,7 @@ const cn = (e) => {
1512
1512
  J(e.$.destroy$)
1513
1513
  );
1514
1514
  return x(i, a);
1515
- }, un = (e) => {
1515
+ }, dn = (e) => {
1516
1516
  e.hookManager.register(
1517
1517
  "item.onAfterLayout",
1518
1518
  ({ item: t, blankPagePosition: i, minimumWidth: n }) => {
@@ -1540,7 +1540,7 @@ class kt extends Ae {
1540
1540
  super(...arguments), this.__symbol = "SpineItemSpineLayout";
1541
1541
  }
1542
1542
  }
1543
- class dn extends Ae {
1543
+ class gn extends Ae {
1544
1544
  constructor() {
1545
1545
  super(...arguments), this.__symbol = "SpineItemPageSpineLayout";
1546
1546
  }
@@ -1558,10 +1558,10 @@ class Yt {
1558
1558
  return new Yt(t);
1559
1559
  }
1560
1560
  }
1561
- const gn = ({
1561
+ const ln = ({
1562
1562
  position: e,
1563
1563
  pageSize: t
1564
- }) => new dn({
1564
+ }) => new gn({
1565
1565
  x: e.x,
1566
1566
  y: e.y,
1567
1567
  left: e.x,
@@ -1570,7 +1570,7 @@ const gn = ({
1570
1570
  height: t.height,
1571
1571
  bottom: e.y + t.height,
1572
1572
  right: e.x + t.width
1573
- }), ln = (e) => {
1573
+ }), pn = (e) => {
1574
1574
  const t = e.spine.spineLayout.layout$.pipe(
1575
1575
  b(() => ({
1576
1576
  pages: e.spine.spineItemsManager.items.reduce((s, r, a) => {
@@ -1582,7 +1582,7 @@ const gn = ({
1582
1582
  spineItem: r,
1583
1583
  spineItemPosition: p
1584
1584
  });
1585
- return gn({
1585
+ return ln({
1586
1586
  pageSize: e.context.getPageSize(),
1587
1587
  position: h
1588
1588
  });
@@ -1600,17 +1600,17 @@ const gn = ({
1600
1600
  V()
1601
1601
  ), i = t.pipe(et({ refCount: !0, bufferSize: 1 }));
1602
1602
  return i.pipe(F(e.$.destroy$)).subscribe(), { layout$: t, info$: i };
1603
- }, pn = (e, t) => t.pipe(
1603
+ }, hn = (e, t) => t.pipe(
1604
1604
  T((i) => {
1605
1605
  e.viewport.value.element.style.transition = "transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275)", e.settings.values.computedPageTurnMode === "scrollable" ? e.viewport.value.element.style.transformOrigin = "top" : e.viewport.value.element.style.transformOrigin = "center", i === "thumbnails" ? e.viewport.value.element.style.transform = "scale(0.5)" : e.viewport.value.element.style.transform = "scale(1)", e.layout();
1606
1606
  })
1607
- ), hn = (e) => (t) => {
1607
+ ), mn = (e) => (t) => {
1608
1608
  const {
1609
1609
  pageHorizontalMargin: i,
1610
1610
  pageVerticalMargin: n,
1611
1611
  layoutAutoResize: o,
1612
1612
  layoutLayerTransition: s
1613
- } = t, r = e(t), a = new an(
1613
+ } = t, r = e(t), a = new cn(
1614
1614
  {
1615
1615
  pageHorizontalMargin: i,
1616
1616
  pageVerticalMargin: n,
@@ -1657,7 +1657,7 @@ const gn = ({
1657
1657
  `
1658
1658
  );
1659
1659
  }
1660
- }), un(r), r.hookManager.register(
1660
+ }), dn(r), r.hookManager.register(
1661
1661
  "item.onDocumentCreated",
1662
1662
  ({ documentContainer: S }) => {
1663
1663
  S.style.opacity = "0", a.values.layoutLayerTransition && (S.style.transition = "opacity 300ms");
@@ -1684,13 +1684,13 @@ const gn = ({
1684
1684
  _(() => r.context.containerElement$),
1685
1685
  tt(ct),
1686
1686
  _((S) => u(S)),
1687
- ri(100),
1687
+ ai(100),
1688
1688
  z(() => {
1689
1689
  r == null || r.layout();
1690
1690
  })
1691
- ), g = cn(r);
1691
+ ), g = un(r);
1692
1692
  a.watch(["pageHorizontalMargin", "pageVerticalMargin"]).pipe(
1693
- ai(1),
1693
+ ci(1),
1694
1694
  z(() => {
1695
1695
  r.layout();
1696
1696
  }),
@@ -1701,7 +1701,7 @@ const gn = ({
1701
1701
  const y = "prose-spineItem-ready";
1702
1702
  f ? S.containerElement.classList.add(y) : S.containerElement.classList.remove(y);
1703
1703
  })
1704
- ), { layout$: p, info$: h } = ln(r), m = pn(
1704
+ ), { layout$: p, info$: h } = pn(r), m = hn(
1705
1705
  r,
1706
1706
  a.watch("viewportMode")
1707
1707
  );
@@ -1720,7 +1720,7 @@ const gn = ({
1720
1720
  layout$: p,
1721
1721
  layoutInfo$: h
1722
1722
  };
1723
- }, mn = `${lt}-enhancer-loading`, Oe = `${mn}-container`, fn = (e, t) => {
1723
+ }, fn = `${lt}-enhancer-loading`, Oe = `${fn}-container`, yn = (e, t) => {
1724
1724
  const i = e.ownerDocument.createElement("div");
1725
1725
  return i.classList.add(Oe), i.style.cssText = `
1726
1726
  height: 100%;
@@ -1738,7 +1738,7 @@ const gn = ({
1738
1738
  background-color: white;
1739
1739
  z-index: 1;
1740
1740
  `, i;
1741
- }, yn = ({
1741
+ }, Sn = ({
1742
1742
  container: e,
1743
1743
  item: t
1744
1744
  }) => {
@@ -1755,8 +1755,8 @@ const gn = ({
1755
1755
  max-width: 300px;
1756
1756
  width: 80%;
1757
1757
  `, e.appendChild(i), e.appendChild(n), e;
1758
- }, Sn = (e) => (t) => {
1759
- const { loadingElementCreate: i = yn } = t, n = e(t), o = (c) => w(
1758
+ }, bn = (e) => (t) => {
1759
+ const { loadingElementCreate: i = Sn } = t, n = e(t), o = (c) => w(
1760
1760
  c.reduce((u, { item: d, element: g }) => {
1761
1761
  g.style.zIndex = "0";
1762
1762
  const l = g.querySelector(
@@ -1765,7 +1765,7 @@ const gn = ({
1765
1765
  if (l instanceof HTMLElement)
1766
1766
  return u[d.id] = l, u;
1767
1767
  const p = i({
1768
- container: fn(g, n.context),
1768
+ container: yn(g, n.context),
1769
1769
  item: d
1770
1770
  });
1771
1771
  return g.appendChild(p), u[d.id] = p, u;
@@ -1820,7 +1820,7 @@ const gn = ({
1820
1820
  }
1821
1821
  };
1822
1822
  };
1823
- class bn extends ht {
1823
+ class In extends ht {
1824
1824
  getImageElement() {
1825
1825
  const t = this.documentContainer;
1826
1826
  if (t instanceof HTMLImageElement)
@@ -1872,13 +1872,13 @@ class bn extends ht {
1872
1872
  getDocumentFrame() {
1873
1873
  }
1874
1874
  }
1875
- const In = (e) => (t) => {
1875
+ const wn = (e) => (t) => {
1876
1876
  const i = e({
1877
1877
  ...t,
1878
1878
  getRenderer(r) {
1879
1879
  var d;
1880
1880
  const a = (d = t.getRenderer) == null ? void 0 : d.call(t, r), c = r.mediaType ?? Lt(r.href), u = !!(c != null && c.startsWith("image/"));
1881
- return !a && u ? (g) => new bn(g) : a;
1881
+ return !a && u ? (g) => new In(g) : a;
1882
1882
  }
1883
1883
  }), n = new IntersectionObserver(
1884
1884
  (r) => {
@@ -1928,10 +1928,10 @@ const In = (e) => (t) => {
1928
1928
  n.disconnect(), o.disconnect(), i.destroy();
1929
1929
  }
1930
1930
  };
1931
- }, wn = (e, t) => e.links$.pipe(
1931
+ }, Pn = (e, t) => e.links$.pipe(
1932
1932
  T((i) => {
1933
1933
  var r;
1934
- if (!Mi(i.target, "a") || i.type !== "click") return;
1934
+ if (!Ci(i.target, "a") || i.type !== "click") return;
1935
1935
  const n = new URL(i.target.href), o = `${n.origin}${n.pathname}`;
1936
1936
  ((r = e.context.manifest) == null ? void 0 : r.spineItems.some(
1937
1937
  (a) => a.href === o
@@ -1943,7 +1943,7 @@ class R {
1943
1943
  this.__symbol = Symbol("SpineItemPosition"), this.x = t.x, this.y = t.y;
1944
1944
  }
1945
1945
  }
1946
- const Pn = ({
1946
+ const vn = ({
1947
1947
  position: e,
1948
1948
  spineItem: t,
1949
1949
  pageHeight: i,
@@ -1975,7 +1975,7 @@ const Pn = ({
1975
1975
  const u = o.getSpineItemPositionFromSpinePosition(
1976
1976
  e,
1977
1977
  a
1978
- ), d = Pn({
1978
+ ), d = vn({
1979
1979
  position: u,
1980
1980
  spineItem: a,
1981
1981
  pageHeight: s.getPageSize().height,
@@ -1997,7 +1997,7 @@ const Pn = ({
1997
1997
  x: 0
1998
1998
  })
1999
1999
  );
2000
- }, vn = ({
2000
+ }, xn = ({
2001
2001
  position: e,
2002
2002
  spineItem: t,
2003
2003
  context: i,
@@ -2039,7 +2039,7 @@ const Pn = ({
2039
2039
  return n.getAdjustedPositionForSpread(c);
2040
2040
  }
2041
2041
  return n.getAdjustedPositionForSpread(a);
2042
- }, xn = ({
2042
+ }, $n = ({
2043
2043
  position: e,
2044
2044
  spineItem: t,
2045
2045
  pageHeight: i,
@@ -2071,7 +2071,7 @@ const Pn = ({
2071
2071
  const u = o.getSpineItemPositionFromSpinePosition(
2072
2072
  e,
2073
2073
  a
2074
- ), d = xn({
2074
+ ), d = $n({
2075
2075
  position: u,
2076
2076
  spineItem: a,
2077
2077
  pageHeight: s.getPageSize().height,
@@ -2093,7 +2093,7 @@ const Pn = ({
2093
2093
  x: 0
2094
2094
  })
2095
2095
  );
2096
- }, $n = ({
2096
+ }, Tn = ({
2097
2097
  position: e,
2098
2098
  spineItem: t,
2099
2099
  context: i,
@@ -2139,7 +2139,7 @@ const Pn = ({
2139
2139
  }
2140
2140
  return n.getAdjustedPositionForSpread(a);
2141
2141
  };
2142
- class Tn {
2142
+ class Fn {
2143
2143
  constructor(t) {
2144
2144
  this.reader = t, this.movingLastDelta = { x: 0, y: 0 }, this.movingLastPosition = new M({ x: 0, y: 0 }), this.unlock = void 0;
2145
2145
  }
@@ -2158,7 +2158,7 @@ class Tn {
2158
2158
  turnRightOrBottom() {
2159
2159
  const t = this.reader.navigation.getNavigation(), i = this.reader.spineItemsManager.get(t.spineItem);
2160
2160
  if (!i) return;
2161
- const n = $n({
2161
+ const n = Tn({
2162
2162
  context: this.reader.context,
2163
2163
  navigationResolver: this.reader.navigation.navigationResolver,
2164
2164
  position: t.position,
@@ -2174,7 +2174,7 @@ class Tn {
2174
2174
  turnLeftOrTop() {
2175
2175
  const t = this.reader.navigation.getNavigation(), i = this.reader.spineItemsManager.get(t.spineItem);
2176
2176
  if (!i) return;
2177
- const n = vn({
2177
+ const n = xn({
2178
2178
  context: this.reader.context,
2179
2179
  navigationResolver: this.reader.navigation.navigationResolver,
2180
2180
  position: t.position,
@@ -2316,7 +2316,7 @@ class Tn {
2316
2316
  }
2317
2317
  }
2318
2318
  }
2319
- class Fn {
2319
+ class Ln {
2320
2320
  constructor(t) {
2321
2321
  this.reader = t, this.lastDelta = { x: 0, y: 0 }, this.lastPosition = new M({ x: 0, y: 0 }), this.lastStartPosition = new M({ x: 0, y: 0 }), this.unlock = void 0;
2322
2322
  }
@@ -2356,7 +2356,7 @@ class Fn {
2356
2356
  });
2357
2357
  }
2358
2358
  }
2359
- const Ln = (e) => e.pagination.state$.pipe(
2359
+ const Mn = (e) => e.pagination.state$.pipe(
2360
2360
  D(e.context.manifest$, e.settings.values$),
2361
2361
  b(
2362
2362
  ([
@@ -2376,7 +2376,7 @@ const Ln = (e) => e.pagination.state$.pipe(
2376
2376
  }
2377
2377
  ),
2378
2378
  E(N)
2379
- ), Mn = ({ reader: e, duration: t }) => (i) => {
2379
+ ), Cn = ({ reader: e, duration: t }) => (i) => {
2380
2380
  let n;
2381
2381
  const o = () => {
2382
2382
  n == null || n(), n = void 0;
@@ -2392,18 +2392,18 @@ const Ln = (e) => e.pagination.state$.pipe(
2392
2392
  T(o),
2393
2393
  ut(o)
2394
2394
  );
2395
- }, Cn = (e) => (t) => {
2396
- const i = e(t), n = Ln(i), o = new Tn(i), s = new Fn(i), r = (c) => {
2395
+ }, Rn = (e) => (t) => {
2396
+ const i = e(t), n = Mn(i), o = new Fn(i), s = new Ln(i), r = (c) => {
2397
2397
  const { cfi: u, ...d } = c;
2398
2398
  i.load(d), u && o.goToCfi(u, { animate: !1 });
2399
2399
  };
2400
- return wn(i, o).pipe(F(i.$.destroy$)).subscribe(), {
2400
+ return Pn(i, o).pipe(F(i.$.destroy$)).subscribe(), {
2401
2401
  ...i,
2402
2402
  load: r,
2403
2403
  navigation: {
2404
2404
  ...i.navigation,
2405
2405
  state$: n,
2406
- throttleLock: ({ duration: c, trigger: u }) => u.pipe(Mn({ duration: c, reader: i })),
2406
+ throttleLock: ({ duration: c, trigger: u }) => u.pipe(Cn({ duration: c, reader: i })),
2407
2407
  moveTo: s.moveTo.bind(s),
2408
2408
  turnBottom: o.turnBottom.bind(o),
2409
2409
  turnTop: o.turnTop.bind(o),
@@ -2447,10 +2447,10 @@ const Ln = (e) => e.pagination.state$.pipe(
2447
2447
  n.offset,
2448
2448
  t.item
2449
2449
  ).trim() : mt(t.item);
2450
- }, Rn = (e, t) => {
2450
+ }, An = (e, t) => {
2451
2451
  const i = ft(e.startContainer, e.startOffset, t), n = ft(e.endContainer, e.endOffset, t);
2452
2452
  return { start: i, end: n };
2453
- }, An = ({
2453
+ }, On = ({
2454
2454
  item: e,
2455
2455
  selection: t
2456
2456
  }) => {
@@ -2464,10 +2464,10 @@ const Ln = (e) => e.pagination.state$.pipe(
2464
2464
  return ((t = e[0]) == null ? void 0 : t.index) === 6 && e.length > 1;
2465
2465
  }, zt = (e) => {
2466
2466
  const t = we(e);
2467
- return gi(t);
2468
- }, On = (e) => Array.isArray(e) ? e[0] && ae(e[0]) ? e[0] : void 0 : e.parent[0] && ae(e.parent[0]) ? e.parent[0] : void 0, Zt = (e) => {
2467
+ return li(t);
2468
+ }, Dn = (e) => Array.isArray(e) ? e[0] && ae(e[0]) ? e[0] : void 0 : e.parent[0] && ae(e.parent[0]) ? e.parent[0] : void 0, Zt = (e) => {
2469
2469
  var a, c, u, d;
2470
- const t = we(e), n = (On(t) ?? [])[1], s = ((n == null ? void 0 : n.index) ?? 2) / 2 - 1, r = di(t) ? (c = (a = t.end.at(-1)) == null ? void 0 : a.at(-1)) == null ? void 0 : c.offset : (d = (u = t.at(-1)) == null ? void 0 : u.at(-1)) == null ? void 0 : d.offset;
2470
+ const t = we(e), n = (Dn(t) ?? [])[1], s = ((n == null ? void 0 : n.index) ?? 2) / 2 - 1, r = gi(t) ? (c = (a = t.end.at(-1)) == null ? void 0 : a.at(-1)) == null ? void 0 : c.offset : (d = (u = t.at(-1)) == null ? void 0 : u.at(-1)) == null ? void 0 : d.offset;
2471
2471
  return {
2472
2472
  cleanedCfi: e,
2473
2473
  itemIndex: s,
@@ -2487,7 +2487,7 @@ const Ln = (e) => e.pagination.state$.pipe(
2487
2487
  const a = (s = o.contentWindow) == null ? void 0 : s.document;
2488
2488
  if (a)
2489
2489
  try {
2490
- const c = li(e, a, {
2490
+ const c = pi(e, a, {
2491
2491
  throwOnError: !0
2492
2492
  });
2493
2493
  return {
@@ -2504,7 +2504,7 @@ const Ln = (e) => e.pagination.state$.pipe(
2504
2504
  return {
2505
2505
  spineItem: n
2506
2506
  };
2507
- }, Dn = (e, t) => {
2507
+ }, Nn = (e, t) => {
2508
2508
  if ("cfi" in t)
2509
2509
  return t;
2510
2510
  const i = e.spineItemsManager.get(t);
@@ -2513,7 +2513,7 @@ const Ln = (e) => e.pagination.state$.pipe(
2513
2513
  return {
2514
2514
  cfi: mt(i.item)
2515
2515
  };
2516
- }, Nn = (e, t) => {
2516
+ }, Vn = (e, t) => {
2517
2517
  let i = e == null ? void 0 : e.itemPageIndex;
2518
2518
  const { itemIndex: n } = t.cfi.parseCfi(e.cfi), o = t.spineItemsManager.get(n);
2519
2519
  return o ? Fe().pipe(
@@ -2546,19 +2546,19 @@ const Ln = (e) => e.pagination.state$.pipe(
2546
2546
  })
2547
2547
  ) : w({ ...e, itemIndex: n });
2548
2548
  };
2549
- class Vn {
2549
+ class jn {
2550
2550
  constructor(t) {
2551
2551
  this.reader = t, this.locate = (i, n) => {
2552
2552
  const o = {
2553
2553
  resource: i,
2554
- meta: Dn(this.reader, i)
2554
+ meta: Nn(this.reader, i)
2555
2555
  };
2556
2556
  return ie(() => {
2557
2557
  var d;
2558
2558
  const s = this.reader.spine.spineLayout.layout$.pipe(
2559
2559
  St(10),
2560
2560
  nt(o),
2561
- Je((g) => Nn(g.meta, this.reader).pipe(
2561
+ Je((g) => Vn(g.meta, this.reader).pipe(
2562
2562
  b((l) => ({
2563
2563
  ...g,
2564
2564
  meta: l
@@ -2580,7 +2580,9 @@ class Vn {
2580
2580
  }
2581
2581
  locateResource(t, i) {
2582
2582
  return Array.isArray(t) ? ie(
2583
- () => q(t.map((n) => this.locate(n, i ?? {})))
2583
+ () => q(
2584
+ t.map((n) => this.locate(n, i ?? {}))
2585
+ ).pipe(Ke([]))
2584
2586
  ) : this.locate(t, i ?? {});
2585
2587
  }
2586
2588
  }
@@ -2609,20 +2611,20 @@ const Ne = (e, t, i) => {
2609
2611
  }
2610
2612
  return o;
2611
2613
  }, void 0);
2612
- }, jn = (e, t) => {
2614
+ }, kn = (e, t) => {
2613
2615
  var n;
2614
2616
  const { href: i } = t;
2615
2617
  return Ne(i, ((n = e.nav) == null ? void 0 : n.toc) ?? [], e);
2616
- }, kn = (e) => {
2618
+ }, Wn = (e) => {
2617
2619
  const t = e.context.manifest, i = e.spineItemsManager.items;
2618
2620
  return t ? i.reduce(
2619
- (n, { item: o }) => (n[o.id] = jn(t, o), n),
2621
+ (n, { item: o }) => (n[o.id] = kn(t, o), n),
2620
2622
  {}
2621
2623
  ) : {};
2622
- }, Wn = (e) => e.spineItemsManager.items$.pipe(
2624
+ }, zn = (e) => e.spineItemsManager.items$.pipe(
2623
2625
  nt([]),
2624
- b(() => kn(e))
2625
- ), zn = (e, t, i) => e + t * i, Un = (e, t, i) => {
2626
+ b(() => Wn(e))
2627
+ ), Un = (e, t, i) => e + t * i, Hn = (e, t, i) => {
2626
2628
  const n = e.context, { height: o, width: s } = i.layout.layoutInfo, { top: r, left: a } = e.spine.spineLayout.getSpineItemSpineLayoutInfo(i);
2627
2629
  return e.settings.values.computedPageTurnDirection === "vertical" ? Math.max(
2628
2630
  0,
@@ -2637,7 +2639,7 @@ const Ne = (e, t, i) => {
2637
2639
  (t.x - a + n.state.visibleAreaRect.width) / s
2638
2640
  )
2639
2641
  );
2640
- }, Hn = (e, t, i, n, o) => o.isReady$.pipe(
2642
+ }, En = (e, t, i, n, o) => o.isReady$.pipe(
2641
2643
  H(),
2642
2644
  D(e.layoutInfo$),
2643
2645
  b(([s, r]) => {
@@ -2648,17 +2650,17 @@ const Ne = (e, t, i) => {
2648
2650
  let m = (i + 1) * (h / p);
2649
2651
  !c && o.renditionLayout === "reflowable" && !s && (m = 0);
2650
2652
  let S = d + m;
2651
- return ((C = a.manifest) == null ? void 0 : C.renditionFlow) === "scrolled-continuous" && (s ? m = Un(
2653
+ return ((C = a.manifest) == null ? void 0 : C.renditionFlow) === "scrolled-continuous" && (s ? m = Hn(
2652
2654
  e,
2653
2655
  n,
2654
2656
  o
2655
- ) : m = 0, S = zn(
2657
+ ) : m = 0, S = Un(
2656
2658
  d,
2657
2659
  h,
2658
2660
  m
2659
2661
  )), t === u - 1 && i === p - 1 && S > 0.99 ? 1 : S;
2660
2662
  })
2661
- ), En = (e) => e.spine.spineLayout.layout$.pipe(
2663
+ ), Bn = (e) => e.spine.spineLayout.layout$.pipe(
2662
2664
  St(10, at),
2663
2665
  D(e.pagination.state$),
2664
2666
  b(() => ({
@@ -2676,7 +2678,7 @@ const Ne = (e, t, i) => {
2676
2678
  numberOfPagesPerItems: [],
2677
2679
  numberOfTotalPages: 0
2678
2680
  })
2679
- ), Bn = (e, t, i, n) => {
2681
+ ), _n = (e, t, i, n) => {
2680
2682
  const o = e.context, s = t.beginSpineItemIndex !== void 0 ? e.spineItemsManager.get(t.beginSpineItemIndex) : void 0, r = t.endSpineItemIndex !== void 0 ? e.spineItemsManager.get(t.endSpineItemIndex) : void 0;
2681
2683
  return w({
2682
2684
  ...t,
@@ -2707,7 +2709,7 @@ const Ne = (e, t, i) => {
2707
2709
  // hasPreviousChapter: (reader.spine.spineItemIndex || 0) < (manifest.readingOrder.length - 1),
2708
2710
  // numberOfSpineItems: context.manifest?.readingOrder.length,
2709
2711
  });
2710
- }, _n = (e) => q([
2712
+ }, Xn = (e) => q([
2711
2713
  e.pagination.state$,
2712
2714
  // Usually pagination change if layout changes (number of pages) however it is especially
2713
2715
  // useful for like webtoon where you still have one page but only the layout will give you the final size
@@ -2716,7 +2718,7 @@ const Ne = (e, t, i) => {
2716
2718
  ]).pipe(
2717
2719
  v(([t]) => {
2718
2720
  const i = t.endSpineItemIndex !== void 0 ? e.spineItemsManager.get(t.endSpineItemIndex) : void 0;
2719
- return i ? Hn(
2721
+ return i ? En(
2720
2722
  e,
2721
2723
  t.endSpineItemIndex ?? 0,
2722
2724
  t.endPageIndexInSpineItem || 0,
@@ -2724,8 +2726,8 @@ const Ne = (e, t, i) => {
2724
2726
  i
2725
2727
  ) : w(0);
2726
2728
  })
2727
- ), Xn = (e) => {
2728
- const t = Wn(e), i = En(e), n = new k({
2729
+ ), qn = (e) => {
2730
+ const t = zn(e), i = Bn(e), n = new k({
2729
2731
  ...e.pagination.state,
2730
2732
  beginChapterInfo: void 0,
2731
2733
  beginCfi: void 0,
@@ -2743,10 +2745,10 @@ const Ne = (e, t, i) => {
2743
2745
  }), o = q([
2744
2746
  e.pagination.state$,
2745
2747
  t,
2746
- _n(e)
2748
+ Xn(e)
2747
2749
  ]).pipe(
2748
2750
  v(
2749
- ([r, a, c]) => Bn(
2751
+ ([r, a, c]) => _n(
2750
2752
  e,
2751
2753
  r,
2752
2754
  a,
@@ -2781,10 +2783,10 @@ const Ne = (e, t, i) => {
2781
2783
  }),
2782
2784
  et(1)
2783
2785
  ), getPaginationInfo: () => n.value };
2784
- }, qn = (e) => (t) => {
2785
- const i = e(t), { paginationInfo$: n, getPaginationInfo: o } = Xn(i);
2786
+ }, Yn = (e) => (t) => {
2787
+ const i = e(t), { paginationInfo$: n, getPaginationInfo: o } = qn(i);
2786
2788
  n.pipe(F(i.$.destroy$)).subscribe();
2787
- const s = new Vn(i);
2789
+ const s = new jn(i);
2788
2790
  return {
2789
2791
  ...i,
2790
2792
  locateResource: s.locateResource.bind(s),
@@ -2798,7 +2800,7 @@ const Ne = (e, t, i) => {
2798
2800
  }
2799
2801
  }
2800
2802
  };
2801
- }, Yn = (e) => ({
2803
+ }, Zn = (e) => ({
2802
2804
  put: (s, r) => new Promise((a, c) => {
2803
2805
  const u = e.transaction(["store"], "readwrite");
2804
2806
  u.onerror = (l) => {
@@ -2856,11 +2858,11 @@ const Ne = (e, t, i) => {
2856
2858
  n.onerror = (o) => {
2857
2859
  i(o);
2858
2860
  }, n.onsuccess = () => {
2859
- t(Yn(n.result));
2861
+ t(Zn(n.result));
2860
2862
  }, n.onupgradeneeded = () => {
2861
2863
  n.result.createObjectStore("store");
2862
2864
  };
2863
- }), Zn = (e) => {
2865
+ }), Gn = (e) => {
2864
2866
  let t = Date.now().toString();
2865
2867
  const i = new U(), n = (c) => {
2866
2868
  var u, d;
@@ -2881,10 +2883,10 @@ const Ne = (e, t, i) => {
2881
2883
  i.next({ id: c, data: u });
2882
2884
  };
2883
2885
  i.asObservable().pipe(
2884
- ci(({ id: c, data: u }) => {
2886
+ ui(({ id: c, data: u }) => {
2885
2887
  const d = n(c);
2886
2888
  return d ? W(
2887
- Ke([At("prose-reader"), W(u.blob())])
2889
+ Qe([At("prose-reader"), W(u.blob())])
2888
2890
  ).pipe(
2889
2891
  _(([g, l]) => W(g.put(`${t}_${d.id}`, l))),
2890
2892
  te((g) => (j.error(g), Q))
@@ -2919,8 +2921,8 @@ const Ne = (e, t, i) => {
2919
2921
  i.complete();
2920
2922
  }
2921
2923
  };
2922
- }, Gn = (e) => (t) => {
2923
- const i = e(t), n = Zn(i.context);
2924
+ }, Jn = (e) => (t) => {
2925
+ const i = e(t), n = Gn(i.context);
2924
2926
  return {
2925
2927
  ...i,
2926
2928
  // $: {
@@ -2932,7 +2934,7 @@ const Ne = (e, t, i) => {
2932
2934
  }
2933
2935
  // load,
2934
2936
  };
2935
- }, Jn = (e, t) => {
2937
+ }, Kn = (e, t) => {
2936
2938
  var o;
2937
2939
  const i = (o = e.node.ownerDocument) == null ? void 0 : o.createRange(), n = e.node.compareDocumentPosition(t.node);
2938
2940
  if (i) {
@@ -2953,14 +2955,14 @@ const Ne = (e, t, i) => {
2953
2955
  }
2954
2956
  return i;
2955
2957
  }
2956
- }, Kn = ({
2958
+ }, Qn = ({
2957
2959
  selection: e,
2958
2960
  spineItem: t
2959
2961
  }) => {
2960
2962
  const { anchorNode: i, anchorOffset: n, focusNode: o, focusOffset: s } = e;
2961
2963
  if (!(!i || !o))
2962
2964
  try {
2963
- return Jn(
2965
+ return Kn(
2964
2966
  { node: i, offset: n },
2965
2967
  { node: o, offset: s }
2966
2968
  );
@@ -2972,7 +2974,7 @@ const Ne = (e, t, i) => {
2972
2974
  return;
2973
2975
  }
2974
2976
  };
2975
- class Qn extends Y {
2977
+ class to extends Y {
2976
2978
  constructor(t) {
2977
2979
  var n;
2978
2980
  super();
@@ -3028,12 +3030,12 @@ class Qn extends Y {
3028
3030
  }
3029
3031
  }
3030
3032
  }
3031
- const to = (e) => e.loaded$.pipe(
3033
+ const eo = (e) => e.loaded$.pipe(
3032
3034
  v(() => {
3033
3035
  var o;
3034
3036
  const t = e.renderer.getDocumentFrame(), i = (t == null ? void 0 : t.contentDocument) || ((o = t == null ? void 0 : t.contentWindow) == null ? void 0 : o.document);
3035
3037
  if (!t || !i) return gt;
3036
- const n = new Qn(t);
3038
+ const n = new to(t);
3037
3039
  return x(
3038
3040
  n.selectionChange$.pipe(
3039
3041
  b((s) => {
@@ -3060,14 +3062,14 @@ const to = (e) => e.loaded$.pipe(
3060
3062
  );
3061
3063
  }),
3062
3064
  E()
3063
- ), eo = (e) => (t) => {
3065
+ ), io = (e) => (t) => {
3064
3066
  const i = e(t);
3065
3067
  let n;
3066
3068
  const o = i.spineItemsManager.items$.pipe(
3067
3069
  v((d) => {
3068
3070
  const g = d.map((l) => {
3069
3071
  const p = i.spineItemsManager.getSpineItemIndex(l) ?? 0;
3070
- return to(l).pipe(
3072
+ return eo(l).pipe(
3071
3073
  b((h) => {
3072
3074
  if (h)
3073
3075
  return {
@@ -3114,7 +3116,7 @@ const to = (e) => e.loaded$.pipe(
3114
3116
  selectionOver$: c,
3115
3117
  lastSelectionOnPointerdown$: u,
3116
3118
  getSelection: () => n,
3117
- createOrderedRangeFromSelection: Kn
3119
+ createOrderedRangeFromSelection: Qn
3118
3120
  }
3119
3121
  };
3120
3122
  }, ce = [
@@ -3132,7 +3134,7 @@ const to = (e) => e.loaded$.pipe(
3132
3134
  backgroundColor: "#191717",
3133
3135
  foregroundColor: "#f1ebeb"
3134
3136
  }
3135
- ], io = (e) => (t) => {
3137
+ ], no = (e) => (t) => {
3136
3138
  const i = e(t), n = new k(
3137
3139
  t.theme ?? "bright"
3138
3140
  ), o = () => {
@@ -3197,7 +3199,7 @@ const to = (e) => e.loaded$.pipe(
3197
3199
  }
3198
3200
  }
3199
3201
  };
3200
- }, no = (e) => (t) => ({
3202
+ }, oo = (e) => (t) => ({
3201
3203
  ...e(t),
3202
3204
  utils: {
3203
3205
  isOrIsWithinValidLink: (o) => {
@@ -3211,13 +3213,13 @@ const to = (e) => e.loaded$.pipe(
3211
3213
  }
3212
3214
  });
3213
3215
  navigator.userAgent.indexOf("") > -1 && navigator.userAgent.indexOf("Chrome") <= -1;
3214
- const oo = (e) => (t) => e(t);
3216
+ const so = (e) => (t) => e(t);
3215
3217
  class Ve {
3216
3218
  constructor(t) {
3217
3219
  this.reader = t;
3218
3220
  }
3219
3221
  }
3220
- class so extends Ve {
3222
+ class ro extends Ve {
3221
3223
  constructor() {
3222
3224
  super(...arguments), this.isZooming$ = new k(!1), this.currentScale = 1, this.currentPosition = { x: 0, y: 0 };
3223
3225
  }
@@ -3274,7 +3276,7 @@ const Tt = ({
3274
3276
  const o = i * e / 2 - i + i / 2, s = i * t / 2 - i + i / 2, r = e / t, a = n - s;
3275
3277
  return Math.max(o + a * r, 0);
3276
3278
  };
3277
- class ro extends Ve {
3279
+ class ao extends Ve {
3278
3280
  constructor() {
3279
3281
  super(...arguments), this.isZooming$ = new k(!1), this.currentScale = 1, this.currentPosition = { x: 0, y: 0 };
3280
3282
  }
@@ -3307,8 +3309,8 @@ class ro extends Ve {
3307
3309
  }), this.currentScale = o;
3308
3310
  }
3309
3311
  }
3310
- const ao = (e) => (t) => {
3311
- const i = e(t), n = new so(i), o = new ro(i), s = new k(o);
3312
+ const co = (e) => (t) => {
3313
+ const i = e(t), n = new ro(i), o = new ao(i), s = new k(o);
3312
3314
  return {
3313
3315
  ...i,
3314
3316
  destroy: () => {
@@ -3367,7 +3369,7 @@ class bt extends st {
3367
3369
  this.stateSubject.complete(), this.destroy$.complete();
3368
3370
  }
3369
3371
  }
3370
- class co {
3372
+ class uo {
3371
3373
  constructor() {
3372
3374
  this.navigationSubject = new Jt(1), this.viewportStateSubject = new k("free"), this.paginationSubject = new Jt(), this.navigationIsLockedSubject = new k(!1), this.pagination$ = this.paginationSubject.asObservable(), this.navigationUnlocked$ = this.navigationIsLockedSubject.pipe(
3373
3375
  E(),
@@ -3379,7 +3381,7 @@ class co {
3379
3381
  ), this.navigation$ = this.navigationSubject.asObservable();
3380
3382
  }
3381
3383
  }
3382
- const uo = ({
3384
+ const go = ({
3383
3385
  manifest: e,
3384
3386
  visibleAreaRect: t,
3385
3387
  forceSinglePageMode: i
@@ -3387,7 +3389,7 @@ const uo = ({
3387
3389
  const { height: n, width: o } = t, s = o > n;
3388
3390
  return i || (e == null ? void 0 : e.renditionFlow) === "scrolled-continuous" ? !1 : !s && (e == null ? void 0 : e.renditionSpread) === "portrait" ? !0 : s && ((e == null ? void 0 : e.renditionSpread) === void 0 || (e == null ? void 0 : e.renditionSpread) === "auto" || (e == null ? void 0 : e.renditionSpread) === "landscape" || (e == null ? void 0 : e.renditionSpread) === "both");
3389
3391
  };
3390
- class go extends bt {
3392
+ class lo extends bt {
3391
3393
  constructor() {
3392
3394
  super({
3393
3395
  marginBottom: 0,
@@ -3400,7 +3402,7 @@ class go extends bt {
3400
3402
  x: 0,
3401
3403
  y: 0
3402
3404
  }
3403
- }), this.bridgeEvent = new co(), this.destroy$ = new U(), this.state$ = this.pipe(Z(N)), this.manifest$ = this.pipe(
3405
+ }), this.bridgeEvent = new uo(), this.destroy$ = new U(), this.state$ = this.pipe(Z(N)), this.manifest$ = this.pipe(
3404
3406
  X((t) => t.manifest),
3405
3407
  tt(ct),
3406
3408
  Z()
@@ -3435,7 +3437,7 @@ class go extends bt {
3435
3437
  isFullyPrePaginated: je(n),
3436
3438
  assumedRenditionLayout: (n == null ? void 0 : n.renditionLayout) ?? "reflowable"
3437
3439
  },
3438
- isUsingSpreadMode: uo({
3440
+ isUsingSpreadMode: go({
3439
3441
  manifest: n,
3440
3442
  visibleAreaRect: s,
3441
3443
  forceSinglePageMode: o
@@ -3467,7 +3469,7 @@ class go extends bt {
3467
3469
  };
3468
3470
  }
3469
3471
  }
3470
- class lo extends bt {
3472
+ class po extends bt {
3471
3473
  constructor(t, i) {
3472
3474
  super({
3473
3475
  supportedPageTurnAnimation: ["fade", "none", "slide"],
@@ -3503,7 +3505,7 @@ class lo extends bt {
3503
3505
  ).subscribe(this.next.bind(this));
3504
3506
  }
3505
3507
  }
3506
- class po {
3508
+ class ho {
3507
3509
  constructor() {
3508
3510
  this._hooks = [], this._hookExecutions = [];
3509
3511
  }
@@ -3537,7 +3539,7 @@ class po {
3537
3539
  const c = new U(), u = (l) => {
3538
3540
  a = l;
3539
3541
  }, d = () => (c.next(), c.complete(), a() ?? w(void 0)), g = r.runFn({
3540
- // biome-ignore lint/suspicious/noExplicitAny: <explanation>
3542
+ // biome-ignore lint/suspicious/noExplicitAny: TODO
3541
3543
  ...n,
3542
3544
  destroy$: c.asObservable(),
3543
3545
  destroy: u
@@ -3579,7 +3581,7 @@ class ke {
3579
3581
  };
3580
3582
  }
3581
3583
  }
3582
- const ho = () => (e) => e.pipe(
3584
+ const mo = () => (e) => e.pipe(
3583
3585
  b(({ navigation: t, pagination: i, ...n }) => ({
3584
3586
  navigation: {
3585
3587
  ...t,
@@ -3587,7 +3589,7 @@ const ho = () => (e) => e.pipe(
3587
3589
  },
3588
3590
  ...n
3589
3591
  }))
3590
- ), mo = (e, t, i) => e.bridgeEvent.pagination$.pipe(
3592
+ ), fo = (e, t, i) => e.bridgeEvent.pagination$.pipe(
3591
3593
  D(t),
3592
3594
  A(
3593
3595
  ([n, o]) => n.navigationId === o.id
@@ -3607,7 +3609,7 @@ const ho = () => (e) => e.pipe(
3607
3609
  }))
3608
3610
  );
3609
3611
  }),
3610
- ho(),
3612
+ mo(),
3611
3613
  E(
3612
3614
  (n, o) => n.navigation.paginationBeginCfi === o.navigation.paginationBeginCfi
3613
3615
  ),
@@ -3619,7 +3621,7 @@ const ho = () => (e) => e.pipe(
3619
3621
  }
3620
3622
  })
3621
3623
  )
3622
- ), fo = (e) => e.pipe(
3624
+ ), yo = (e) => e.pipe(
3623
3625
  b(([t, i]) => {
3624
3626
  const n = {
3625
3627
  type: "api",
@@ -3635,7 +3637,7 @@ const ho = () => (e) => e.pipe(
3635
3637
  navigation: n
3636
3638
  };
3637
3639
  })
3638
- ), yo = ({ navigationResolver: e }) => (t) => t.pipe(
3640
+ ), So = ({ navigationResolver: e }) => (t) => t.pipe(
3639
3641
  b((i) => {
3640
3642
  if (i.navigation.cfi) {
3641
3643
  const n = e.getNavigationForCfi(
@@ -3652,16 +3654,16 @@ const ho = () => (e) => e.pipe(
3652
3654
  }
3653
3655
  return i;
3654
3656
  })
3655
- ), So = ({
3657
+ ), bo = ({
3656
3658
  navigation: e,
3657
3659
  previousNavigation: t,
3658
3660
  settings: i
3659
- }) => e.directionFromLastNavigation ? e.directionFromLastNavigation : e.url !== void 0 || e.cfi !== void 0 ? "anchor" : t.spineItem === void 0 || e.spineItem || !e.position ? "forward" : i.values.computedPageTurnDirection === "vertical" ? e.position.y > t.position.y || e.position.y === t.position.y && t.directionFromLastNavigation !== "backward" ? "forward" : "backward" : Math.abs(e.position.x) > Math.abs(t.position.x) || e.position.x === t.position.x && t.directionFromLastNavigation !== "backward" ? "forward" : "backward", bo = ({
3661
+ }) => e.directionFromLastNavigation ? e.directionFromLastNavigation : e.url !== void 0 || e.cfi !== void 0 ? "anchor" : t.spineItem === void 0 || e.spineItem || !e.position ? "forward" : i.values.computedPageTurnDirection === "vertical" ? e.position.y > t.position.y || e.position.y === t.position.y && t.directionFromLastNavigation !== "backward" ? "forward" : "backward" : Math.abs(e.position.x) > Math.abs(t.position.x) || e.position.x === t.position.x && t.directionFromLastNavigation !== "backward" ? "forward" : "backward", Io = ({
3660
3662
  context: e,
3661
3663
  settings: t
3662
3664
  }) => (i) => i.pipe(
3663
3665
  b(({ navigation: n, previousNavigation: o }) => {
3664
- const s = So({
3666
+ const s = bo({
3665
3667
  navigation: n,
3666
3668
  previousNavigation: o,
3667
3669
  settings: t
@@ -3675,7 +3677,7 @@ const ho = () => (e) => e.pipe(
3675
3677
  direction: s
3676
3678
  };
3677
3679
  })
3678
- ), Io = ({
3680
+ ), wo = ({
3679
3681
  spineItemsManager: e,
3680
3682
  navigationResolver: t
3681
3683
  }) => (i) => i.pipe(
@@ -3827,7 +3829,7 @@ const ho = () => (e) => e.pipe(
3827
3829
  ...a
3828
3830
  }))
3829
3831
  );
3830
- }, wo = ({ navigationResolver: e }) => (t) => t.pipe(
3832
+ }, Po = ({ navigationResolver: e }) => (t) => t.pipe(
3831
3833
  b((i) => {
3832
3834
  if (i.navigation.url) {
3833
3835
  const n = e.getNavigationForUrl(
@@ -3845,7 +3847,7 @@ const ho = () => (e) => e.pipe(
3845
3847
  }
3846
3848
  return i;
3847
3849
  })
3848
- ), Po = ({
3850
+ ), vo = ({
3849
3851
  spineLocator: e,
3850
3852
  navigation: t,
3851
3853
  navigationResolver: i,
@@ -3903,7 +3905,7 @@ const ho = () => (e) => e.pipe(
3903
3905
  return c ? i.getNavigationForPosition(t.position) : i.getNavigationForSpineIndexOrId(s);
3904
3906
  })
3905
3907
  ) : w(new M({ x: 0, y: 0 }));
3906
- }, vo = ({
3908
+ }, xo = ({
3907
3909
  navigation: e,
3908
3910
  spineLocator: t,
3909
3911
  spineItemsManager: i,
@@ -3972,7 +3974,7 @@ const ho = () => (e) => e.pipe(
3972
3974
  }
3973
3975
  }
3974
3976
  return e.position;
3975
- }, xo = ({
3977
+ }, $o = ({
3976
3978
  navigation: e,
3977
3979
  spineItemsManager: t,
3978
3980
  settings: i,
@@ -3980,7 +3982,7 @@ const ho = () => (e) => e.pipe(
3980
3982
  navigationResolver: o,
3981
3983
  spineLayout: s
3982
3984
  }) => i.values.computedPageTurnMode === "scrollable" ? w(
3983
- vo({
3985
+ xo({
3984
3986
  navigation: e,
3985
3987
  spineLocator: n,
3986
3988
  navigationResolver: o,
@@ -3988,7 +3990,7 @@ const ho = () => (e) => e.pipe(
3988
3990
  spineItemsManager: t,
3989
3991
  spineLayout: s
3990
3992
  })
3991
- ) : Po({
3993
+ ) : vo({
3992
3994
  navigation: e,
3993
3995
  spineLocator: n,
3994
3996
  navigationResolver: o,
@@ -4000,7 +4002,7 @@ const ho = () => (e) => e.pipe(
4000
4002
  context: i,
4001
4003
  spine: n
4002
4004
  }) => (o) => o.pipe(
4003
- v((s) => xo({
4005
+ v((s) => $o({
4004
4006
  spineLocator: n.locator,
4005
4007
  navigation: s.navigation,
4006
4008
  navigationResolver: t,
@@ -4017,8 +4019,8 @@ const ho = () => (e) => e.pipe(
4017
4019
  }
4018
4020
  }))
4019
4021
  ))
4020
- ), $o = "navigation/InternalNavigator", To = j.namespace($o);
4021
- class Fo extends Y {
4022
+ ), To = "navigation/InternalNavigator", Fo = j.namespace(To);
4023
+ class Lo extends Y {
4022
4024
  constructor(t, i, n, o, s, r, a, c) {
4023
4025
  super(), this.settings = t, this.context = i, this.userNavigation$ = n, this.viewportController = o, this.scrollNavigationController = s, this.navigationResolver = r, this.spine = a, this.isUserLocked$ = c, this.navigationSubject = new k({
4024
4026
  animation: !1,
@@ -4041,22 +4043,22 @@ class Fo extends Y {
4041
4043
  ), this.locker = new ke();
4042
4044
  const u = n.pipe(
4043
4045
  D(this.navigationSubject),
4044
- fo,
4046
+ yo,
4045
4047
  /**
4046
4048
  * Url lookup is heavier so we start with it to fill
4047
4049
  * as much information as needed to reduce later lookup
4048
4050
  */
4049
- wo({
4051
+ Po({
4050
4052
  navigationResolver: r
4051
4053
  }),
4052
4054
  /**
4053
4055
  * Cfi lookup is heavier so we start with it to fill
4054
4056
  * as much information as needed to reduce later lookup
4055
4057
  */
4056
- yo({
4058
+ So({
4057
4059
  navigationResolver: r
4058
4060
  }),
4059
- bo({ context: i, settings: t }),
4061
+ Io({ context: i, settings: t }),
4060
4062
  ue({
4061
4063
  navigationResolver: r,
4062
4064
  settings: t,
@@ -4073,7 +4075,7 @@ class Fo extends Y {
4073
4075
  spine: a
4074
4076
  })
4075
4077
  ).pipe(
4076
- Io({
4078
+ wo({
4077
4079
  navigationResolver: r,
4078
4080
  spineItemsManager: a.spineItemsManager
4079
4081
  }),
@@ -4189,7 +4191,7 @@ class Fo extends Y {
4189
4191
  }),
4190
4192
  b(({ navigation: f }) => f),
4191
4193
  V()
4192
- ), p = mo(
4194
+ ), p = fo(
4193
4195
  i,
4194
4196
  this.navigationSubject,
4195
4197
  a
@@ -4199,7 +4201,7 @@ class Fo extends Y {
4199
4201
  p
4200
4202
  ), m = (f) => f.pipe(
4201
4203
  T(([y, I]) => {
4202
- To.info(
4204
+ Fo.info(
4203
4205
  `navigation updated from ${y.meta.triggeredBy} of type ${y.type}`,
4204
4206
  {
4205
4207
  previousNavigation: I,
@@ -4263,8 +4265,8 @@ const We = ({
4263
4265
  scrollOffset: t
4264
4266
  })
4265
4267
  });
4266
- }, Lo = 500;
4267
- class Mo extends Y {
4268
+ }, Mo = 500;
4269
+ class Co extends Y {
4268
4270
  constructor(t, i, n, o, s) {
4269
4271
  super(), this.settings = t, this.context = i, this.spine = n, this.scrollNavigationController = o, this.locker = s, this.navigationSubject = new U(), this.navigation$ = this.navigationSubject.asObservable();
4270
4272
  const r = this.scrollNavigationController.userScroll$.pipe(
@@ -4275,7 +4277,7 @@ class Mo extends Y {
4275
4277
  w(a)
4276
4278
  ).pipe(
4277
4279
  St(
4278
- Lo,
4280
+ Mo,
4279
4281
  at
4280
4282
  ),
4281
4283
  H(),
@@ -4303,17 +4305,17 @@ class Mo extends Y {
4303
4305
  x(r).pipe(F(this.destroy$)).subscribe();
4304
4306
  }
4305
4307
  }
4306
- const Co = (e) => ({
4308
+ const Ro = (e) => ({
4307
4309
  x: -e.x,
4308
4310
  y: -e.y
4309
- }), Ro = (e) => e instanceof DOMMatrix ? new M({
4311
+ }), Ao = (e) => e instanceof DOMMatrix ? new M({
4310
4312
  x: -e.e,
4311
4313
  y: -e.f
4312
4314
  }) : new M({
4313
4315
  x: -e.x,
4314
4316
  y: -e.y
4315
- }), Ao = "navigation/ViewportNavigator", le = j.namespace(Ao);
4316
- class Oo extends Y {
4317
+ }), Oo = "navigation/ViewportNavigator", le = j.namespace(Oo);
4318
+ class Do extends Y {
4317
4319
  constructor(t, i, n, o, s) {
4318
4320
  super(), this.settings = t, this.hookManager = i, this.context = n, this.spine = o, this.viewport = s, this.navigateSubject = new U(), this.element$ = new k(
4319
4321
  document.createElement("div")
@@ -4424,7 +4426,7 @@ class Oo extends Y {
4424
4426
  * for remark about flicker / fonts smoothing
4425
4427
  */
4426
4428
  setViewportPosition(t) {
4427
- const i = this.element$.getValue(), n = Co(t);
4429
+ const i = this.element$.getValue(), n = Ro(t);
4428
4430
  i.style.transform = `translate(${n.x}px, ${n.y}px)`, this.hookManager.execute("onViewportOffsetAdjust", void 0, {});
4429
4431
  }
4430
4432
  navigate(t) {
@@ -4439,10 +4441,10 @@ class Oo extends Y {
4439
4441
  if (!n || n === "none")
4440
4442
  return new M({ x: 0, y: 0 });
4441
4443
  const o = new DOMMatrix(n);
4442
- return Ro(o);
4444
+ return Ao(o);
4443
4445
  }
4444
4446
  }
4445
- class Do extends bt {
4447
+ class No extends bt {
4446
4448
  constructor(t, i, n, o, s) {
4447
4449
  super({
4448
4450
  element: void 0
@@ -4590,7 +4592,7 @@ const pe = (e, t, i) => {
4590
4592
  x: o,
4591
4593
  y: 0
4592
4594
  });
4593
- }, No = ({
4595
+ }, Vo = ({
4594
4596
  context: e,
4595
4597
  isUsingVerticalWriting: t,
4596
4598
  settings: i,
@@ -4646,7 +4648,7 @@ const pe = (e, t, i) => {
4646
4648
  if ((u == null ? void 0 : u.nodeName) === "img" || (u == null ? void 0 : u.textContent) === "" && u.nodeType === Node.ELEMENT_NODE)
4647
4649
  l = u.getBoundingClientRect().x;
4648
4650
  else if (u) {
4649
- const S = u ? xi(u, d) : void 0;
4651
+ const S = u ? $i(u, d) : void 0;
4650
4652
  l = (S == null ? void 0 : S.getBoundingClientRect().x) || l;
4651
4653
  }
4652
4654
  const p = ((m = g.layout.layoutInfo) == null ? void 0 : m.width) || 0, h = e.getPageSize().width;
@@ -4673,7 +4675,7 @@ const pe = (e, t, i) => {
4673
4675
  right: m + g.width,
4674
4676
  bottom: S + g.height
4675
4677
  };
4676
- return Pi(
4678
+ return vi(
4677
4679
  l.contentWindow.document,
4678
4680
  f
4679
4681
  );
@@ -4722,14 +4724,14 @@ const pe = (e, t, i) => {
4722
4724
  getSpineItemPageIndexFromNode: a,
4723
4725
  getSpineItemClosestPositionFromUnsafePosition: r,
4724
4726
  getFirstNodeOrRangeAtPage: s,
4725
- getSpineItemPagesPosition: ({ item: u }) => No({
4727
+ getSpineItemPagesPosition: ({ item: u }) => Vo({
4726
4728
  context: e,
4727
4729
  isUsingVerticalWriting: !!u.isUsingVerticalWriting(),
4728
4730
  settings: t,
4729
4731
  itemLayout: u.layout.layoutInfo
4730
4732
  })
4731
4733
  };
4732
- }, Vo = ({
4734
+ }, jo = ({
4733
4735
  context: e,
4734
4736
  settings: t
4735
4737
  }) => {
@@ -4807,7 +4809,7 @@ const pe = (e, t, i) => {
4807
4809
  });
4808
4810
  }
4809
4811
  return new M({ x: 0, y: 0 });
4810
- }, jo = ({
4812
+ }, ko = ({
4811
4813
  pageIndex: e,
4812
4814
  spineItemsManager: t,
4813
4815
  spineItemId: i,
@@ -4837,7 +4839,7 @@ const pe = (e, t, i) => {
4837
4839
  pageSizeWidth: n.getPageSize().width,
4838
4840
  visibleAreaRectWidth: n.state.visibleAreaRect.width
4839
4841
  });
4840
- }, ko = ({
4842
+ }, Wo = ({
4841
4843
  anchor: e,
4842
4844
  spineItem: t,
4843
4845
  context: i
@@ -4849,13 +4851,13 @@ const pe = (e, t, i) => {
4849
4851
  o,
4850
4852
  n
4851
4853
  );
4852
- }, Wo = ({
4854
+ }, zo = ({
4853
4855
  anchor: e,
4854
4856
  context: t,
4855
4857
  spineItem: i,
4856
4858
  spineLocator: n
4857
4859
  }) => {
4858
- const o = ko({
4860
+ const o = Wo({
4859
4861
  anchor: e,
4860
4862
  spineItem: i,
4861
4863
  context: t
@@ -4864,7 +4866,7 @@ const pe = (e, t, i) => {
4864
4866
  spineItemPosition: new R({ x: o, y: 0 }),
4865
4867
  spineItem: i
4866
4868
  });
4867
- }, zo = ({
4869
+ }, Uo = ({
4868
4870
  anchor: e,
4869
4871
  spineItem: t,
4870
4872
  spineLocator: i,
@@ -4872,7 +4874,7 @@ const pe = (e, t, i) => {
4872
4874
  pageSizeWidth: o,
4873
4875
  visibleAreaRectWidth: s
4874
4876
  }) => {
4875
- const r = Wo({
4877
+ const r = zo({
4876
4878
  anchor: e,
4877
4879
  context: n,
4878
4880
  spineItem: t,
@@ -4883,7 +4885,7 @@ const pe = (e, t, i) => {
4883
4885
  pageSizeWidth: o,
4884
4886
  visibleAreaRectWidth: s
4885
4887
  });
4886
- }, Uo = ({
4888
+ }, Ho = ({
4887
4889
  context: e,
4888
4890
  spineItemsManager: t,
4889
4891
  spineLocator: i,
@@ -4899,7 +4901,7 @@ const pe = (e, t, i) => {
4899
4901
  if (u) {
4900
4902
  const d = t.get(u.id);
4901
4903
  if (d) {
4902
- const g = zo({
4904
+ const g = Uo({
4903
4905
  anchor: a.hash,
4904
4906
  spineItem: d,
4905
4907
  context: e,
@@ -4922,7 +4924,7 @@ const pe = (e, t, i) => {
4922
4924
  console.error(a);
4923
4925
  return;
4924
4926
  }
4925
- }, Ho = ({
4927
+ }, Eo = ({
4926
4928
  spineItem: e,
4927
4929
  spineItemPosition: t,
4928
4930
  spineLocator: i,
@@ -4941,16 +4943,16 @@ const pe = (e, t, i) => {
4941
4943
  pageSizeWidth: o.getPageSize().width,
4942
4944
  visibleAreaRectWidth: o.state.visibleAreaRect.width
4943
4945
  });
4944
- }, Eo = "spineNavigator", Bo = ({
4946
+ }, Bo = "spineNavigator", _o = ({
4945
4947
  context: e,
4946
4948
  spineItemsManager: t,
4947
4949
  locator: i,
4948
4950
  settings: n,
4949
4951
  spineLayout: o
4950
4952
  }) => {
4951
- const s = Vo({ context: e, settings: n });
4953
+ const s = jo({ context: e, settings: n });
4952
4954
  return {
4953
- getNavigationForUrl: (l) => Uo({
4955
+ getNavigationForUrl: (l) => Ho({
4954
4956
  context: e,
4955
4957
  spineItemsManager: t,
4956
4958
  spineLocator: i,
@@ -4958,14 +4960,14 @@ const pe = (e, t, i) => {
4958
4960
  pageSizeWidth: e.getPageSize().width,
4959
4961
  visibleAreaRectWidth: e.state.visibleAreaRect.width
4960
4962
  }),
4961
- getNavigationForSpineItemPage: (l) => jo({
4963
+ getNavigationForSpineItemPage: (l) => ko({
4962
4964
  ...l,
4963
4965
  context: e,
4964
4966
  spineItemsManager: t,
4965
4967
  spineItemNavigationResolver: s,
4966
4968
  spineLocator: i
4967
4969
  }),
4968
- getNavigationFromSpineItemPosition: (l) => Ho({
4970
+ getNavigationFromSpineItemPosition: (l) => Eo({
4969
4971
  ...l,
4970
4972
  spineItemLocator: i.spineItemLocator,
4971
4973
  spineLocator: i,
@@ -4977,7 +4979,7 @@ const pe = (e, t, i) => {
4977
4979
  spineItemsManager: t
4978
4980
  }) || {};
4979
4981
  if (!p) {
4980
- j.warn(Eo, `unable to detect item id from cfi ${l}`);
4982
+ j.warn(Bo, `unable to detect item id from cfi ${l}`);
4981
4983
  return;
4982
4984
  }
4983
4985
  const S = h ? s.getNavigationFromNode(p, h, m) : new R({ x: 0, y: 0 }), f = i.getSpinePositionFromSpineItemPosition({
@@ -5055,7 +5057,7 @@ const pe = (e, t, i) => {
5055
5057
  }),
5056
5058
  spineItemNavigator: s
5057
5059
  };
5058
- }, _o = ({
5060
+ }, Xo = ({
5059
5061
  spineItemsManager: e,
5060
5062
  context: t,
5061
5063
  hookManager: i,
@@ -5063,25 +5065,25 @@ const pe = (e, t, i) => {
5063
5065
  settings: o,
5064
5066
  viewport: s
5065
5067
  }) => {
5066
- const r = new U(), a = new ke(), c = Bo({
5068
+ const r = new U(), a = new ke(), c = _o({
5067
5069
  context: t,
5068
5070
  settings: o,
5069
5071
  spineItemsManager: e,
5070
5072
  locator: n.locator,
5071
5073
  spineLayout: n.spineLayout
5072
- }), u = new Oo(
5074
+ }), u = new Do(
5073
5075
  o,
5074
5076
  i,
5075
5077
  t,
5076
5078
  n,
5077
5079
  s
5078
- ), d = new Do(
5080
+ ), d = new No(
5079
5081
  s,
5080
5082
  o,
5081
5083
  i,
5082
5084
  n,
5083
5085
  t
5084
- ), g = new Mo(
5086
+ ), g = new Co(
5085
5087
  o,
5086
5088
  t,
5087
5089
  n,
@@ -5090,7 +5092,7 @@ const pe = (e, t, i) => {
5090
5092
  ), l = x(
5091
5093
  r,
5092
5094
  g.navigation$
5093
- ), p = new Fo(
5095
+ ), p = new Lo(
5094
5096
  o,
5095
5097
  t,
5096
5098
  l,
@@ -5129,7 +5131,7 @@ const pe = (e, t, i) => {
5129
5131
  navigation$: p.navigation$
5130
5132
  };
5131
5133
  };
5132
- class Xo extends bt {
5134
+ class qo extends bt {
5133
5135
  constructor(t, i) {
5134
5136
  super({
5135
5137
  beginPageIndexInSpineItem: void 0,
@@ -5147,7 +5149,7 @@ class Xo extends bt {
5147
5149
  this.mergeCompare(t);
5148
5150
  }
5149
5151
  }
5150
- class qo extends Y {
5152
+ class Yo extends Y {
5151
5153
  constructor(t, i, n, o, s) {
5152
5154
  super(), this.context = t, this.pagination = i, this.spineItemsManager = n, this.spine = o, this.spineItemLocator = s;
5153
5155
  const r = x(
@@ -5225,7 +5227,7 @@ class qo extends Y {
5225
5227
  x(r, a).pipe(F(this.destroy$)).subscribe();
5226
5228
  }
5227
5229
  }
5228
- class Yo extends Y {
5230
+ class Zo extends Y {
5229
5231
  constructor(t) {
5230
5232
  super();
5231
5233
  const i = {
@@ -5270,7 +5272,7 @@ class Yo extends Y {
5270
5272
  super.destroy(), this.outputSettingsUpdateSubject.complete();
5271
5273
  }
5272
5274
  }
5273
- class Zo extends Yo {
5275
+ class Go extends Zo {
5274
5276
  constructor(t, i) {
5275
5277
  super(t), this.context = i;
5276
5278
  const n = q([
@@ -5315,7 +5317,7 @@ class Zo extends Yo {
5315
5317
  };
5316
5318
  }
5317
5319
  }
5318
- class Go extends Y {
5320
+ class Jo extends Y {
5319
5321
  constructor(t, i, n, o, s, r) {
5320
5322
  super(), this.item = t, this.containerElement = i, this.context = n, this.hookManager = o, this.renderer = s, this.settings = r, this.layoutTriggerSubject = new U(), this.lastLayout = null, this.applyDimsAfterLayout = ({
5321
5323
  blankPagePosition: a,
@@ -5346,7 +5348,7 @@ class Go extends Y {
5346
5348
  }), { width: y, height: I };
5347
5349
  })
5348
5350
  ), this.layout = (a) => {
5349
- const c = Di(this.layout$.pipe(H()));
5351
+ const c = Ni(this.layout$.pipe(H()));
5350
5352
  return this.layoutTriggerSubject.next(a), c();
5351
5353
  }, this.adjustPositionOfElement = ({
5352
5354
  right: a,
@@ -5401,7 +5403,7 @@ class Go extends Y {
5401
5403
  };
5402
5404
  }
5403
5405
  }
5404
- class Jo extends ht {
5406
+ class Ko extends ht {
5405
5407
  onUnload() {
5406
5408
  return Q;
5407
5409
  }
@@ -5437,7 +5439,7 @@ class Ue extends Y {
5437
5439
  }, this.isUsingVerticalWriting = () => {
5438
5440
  var g;
5439
5441
  return !!((g = this.renderer.writingMode) != null && g.startsWith("vertical"));
5440
- }, this.containerElement = Ko(
5442
+ }, this.containerElement = Qo(
5441
5443
  i,
5442
5444
  t,
5443
5445
  s
@@ -5452,7 +5454,7 @@ class Ue extends Y {
5452
5454
  containerElement: this.containerElement,
5453
5455
  resourcesHandler: this.resourcesHandler
5454
5456
  };
5455
- this.renderer = a ? a(c) : new Jo(c), this.layout = new Go(
5457
+ this.renderer = a ? a(c) : new Ko(c), this.layout = new Jo(
5456
5458
  t,
5457
5459
  this.containerElement,
5458
5460
  n,
@@ -5460,7 +5462,7 @@ class Ue extends Y {
5460
5462
  this.renderer,
5461
5463
  this.settings
5462
5464
  ), this.isReady$ = this.layout.layoutProcess$.pipe(
5463
- ui(this.renderer.isLoaded$),
5465
+ di(this.renderer.isLoaded$),
5464
5466
  X(([g, l]) => !!(g.type === "end" && l)),
5465
5467
  be(!1),
5466
5468
  Z(),
@@ -5524,14 +5526,14 @@ class Ue extends Y {
5524
5526
  });
5525
5527
  }
5526
5528
  }
5527
- const Ko = (e, t, i) => {
5529
+ const Qo = (e, t, i) => {
5528
5530
  const n = e.ownerDocument.createElement("div");
5529
5531
  return n.classList.add("spineItem"), n.classList.add(`spineItem-${t.renditionLayout ?? "reflowable"}`), n.style.cssText = `
5530
5532
  position: absolute;
5531
5533
  overflow: hidden;
5532
5534
  `, n.dataset.isReady = "false", i.execute("item.onBeforeContainerCreated", void 0, { element: n }), n;
5533
5535
  };
5534
- class Qo extends Y {
5536
+ class ts extends Y {
5535
5537
  constructor(t, i) {
5536
5538
  super(), this.spineItemsManager = t, this.spineLocator = i, this.itemIsReady$ = this.spineItemsManager.items$.pipe(
5537
5539
  v((n) => {
@@ -5561,7 +5563,7 @@ class Qo extends Y {
5561
5563
  );
5562
5564
  }
5563
5565
  }
5564
- const ts = ({
5566
+ const es = ({
5565
5567
  horizontalOffset: e,
5566
5568
  verticalOffset: t,
5567
5569
  context: i,
@@ -5631,7 +5633,7 @@ const ts = ({
5631
5633
  })
5632
5634
  );
5633
5635
  };
5634
- class es extends Y {
5636
+ class is extends Y {
5635
5637
  constructor(t, i, n, o) {
5636
5638
  super(), this.spineItemsManager = t, this.context = i, this.settings = n, this.viewport = o, this.layoutSubject = new U(), this.spineItemsRelativeLayouts = [], t.items$.pipe(
5637
5639
  T(() => {
@@ -5672,10 +5674,10 @@ class es extends Y {
5672
5674
  s.next(!0);
5673
5675
  const r = this.context.manifest, a = je(r) ?? !1;
5674
5676
  return W(this.spineItemsManager.items).pipe(
5675
- Qe(
5677
+ ti(
5676
5678
  (u, d, g) => u.pipe(
5677
5679
  Qt(
5678
- ({ horizontalOffset: l, verticalOffset: p, pages: h }) => ts({
5680
+ ({ horizontalOffset: l, verticalOffset: p, pages: h }) => es({
5679
5681
  context: this.context,
5680
5682
  horizontalOffset: l,
5681
5683
  index: g,
@@ -5734,12 +5736,12 @@ class es extends Y {
5734
5736
  super.destroy(), this.layoutSubject.complete();
5735
5737
  }
5736
5738
  }
5737
- class is extends Y {
5739
+ class ns extends Y {
5738
5740
  constructor(t, i, n, o, s) {
5739
5741
  super(), this.context = t, this.spineItemsManager = i, this.spineLocator = n, this.settings = o, this.spineLayout = s, this.forcedOpenSubject = new k([]);
5740
5742
  const r = this.forcedOpenSubject.pipe(
5741
5743
  b((u) => [...new Set(u.flat())].sort()),
5742
- E(ni),
5744
+ E(oi),
5743
5745
  et({ bufferSize: 1, refCount: !0 })
5744
5746
  );
5745
5747
  x(
@@ -5810,17 +5812,17 @@ class yt extends DOMRect {
5810
5812
  return new yt(n.x, n.y, n.width, n.height);
5811
5813
  }
5812
5814
  }
5813
- class ns {
5815
+ class os {
5814
5816
  constructor({ width: t, height: i }) {
5815
5817
  this.__symbol = Symbol("AbsoluteViewport"), this.width = t, this.height = i;
5816
5818
  }
5817
5819
  }
5818
- class os {
5820
+ class ss {
5819
5821
  constructor({ width: t, height: i }) {
5820
5822
  this.__symbol = Symbol("RelativeViewport"), this.width = t, this.height = i;
5821
5823
  }
5822
5824
  }
5823
- const ss = ({
5825
+ const rs = ({
5824
5826
  pageIndex: e,
5825
5827
  spineItemOrId: t,
5826
5828
  spineItemsManager: i
@@ -5842,7 +5844,7 @@ const ss = ({
5842
5844
  { currentAbsolutePage: 0, found: !1 }
5843
5845
  );
5844
5846
  return s;
5845
- }, rs = ({
5847
+ }, as = ({
5846
5848
  itemHeight: e,
5847
5849
  itemWidth: t,
5848
5850
  visibleWidthOfItem: i,
@@ -5851,7 +5853,7 @@ const ss = ({
5851
5853
  }) => {
5852
5854
  const s = i / t, r = n / e;
5853
5855
  return s >= o && r >= o;
5854
- }, as = ({
5856
+ }, cs = ({
5855
5857
  visibleWidthOfItem: e,
5856
5858
  visibleHeightOfItem: t,
5857
5859
  threshold: i,
@@ -5883,14 +5885,14 @@ const ss = ({
5883
5885
  Math.min(e, l) - Math.max(n, g)
5884
5886
  );
5885
5887
  if (p <= 0 || h <= 0) return { visible: !1 };
5886
- const S = as({
5888
+ const S = cs({
5887
5889
  threshold: r,
5888
5890
  visibleHeightOfItem: h,
5889
5891
  visibleWidthOfItem: p,
5890
5892
  viewportPosition: a
5891
5893
  });
5892
5894
  return c ? { visible: S } : {
5893
- visible: rs({
5895
+ visible: as({
5894
5896
  itemHeight: s,
5895
5897
  itemWidth: o,
5896
5898
  threshold: r,
@@ -5898,7 +5900,7 @@ const ss = ({
5898
5900
  visibleWidthOfItem: p
5899
5901
  }) || S
5900
5902
  };
5901
- }, cs = ({
5903
+ }, us = ({
5902
5904
  absolutePageIndex: e,
5903
5905
  spineItemsManager: t
5904
5906
  }) => {
@@ -5941,7 +5943,7 @@ const ss = ({
5941
5943
  }) => new M({
5942
5944
  x: t + e.x,
5943
5945
  y: i + e.y
5944
- }), us = ({
5946
+ }), ds = ({
5945
5947
  position: e,
5946
5948
  threshold: t,
5947
5949
  restrictToScreen: i,
@@ -5981,7 +5983,7 @@ const ss = ({
5981
5983
  beginIndex: l ?? 0,
5982
5984
  endIndex: p ?? 0
5983
5985
  };
5984
- }, ds = ({
5986
+ }, gs = ({
5985
5987
  spineItemsManager: e,
5986
5988
  context: t,
5987
5989
  spineItemLocator: i,
@@ -6082,11 +6084,11 @@ const ss = ({
6082
6084
  spineItemPosition: h
6083
6085
  });
6084
6086
  },
6085
- getAbsolutePageIndexFromPageIndex: (p) => ss({
6087
+ getAbsolutePageIndexFromPageIndex: (p) => rs({
6086
6088
  ...p,
6087
6089
  spineItemsManager: e
6088
6090
  }),
6089
- getSpineInfoFromAbsolutePageIndex: (p) => cs({
6091
+ getSpineInfoFromAbsolutePageIndex: (p) => us({
6090
6092
  ...p,
6091
6093
  spineItemsManager: e
6092
6094
  }),
@@ -6100,7 +6102,7 @@ const ss = ({
6100
6102
  }),
6101
6103
  getSpineItemFromIframe: c,
6102
6104
  getSpineItemPageIndexFromNode: u,
6103
- getVisibleSpineItemsFromPosition: (p) => us({
6105
+ getVisibleSpineItemsFromPosition: (p) => ds({
6104
6106
  settings: n,
6105
6107
  spineItemsManager: e,
6106
6108
  spineLayout: o,
@@ -6125,27 +6127,27 @@ const ss = ({
6125
6127
  }
6126
6128
  };
6127
6129
  };
6128
- class gs extends Y {
6130
+ class ls extends Y {
6129
6131
  constructor(t, i, n, o, s, r, a, c) {
6130
- super(), this.parentElement$ = t, this.context = i, this.pagination = n, this.spineItemsManager = o, this.spineItemLocator = s, this.settings = r, this.hookManager = a, this.viewport = c, this.elementSubject = new k(Fi()), this.element$ = this.elementSubject.asObservable(), this.spineLayout = new es(
6132
+ super(), this.parentElement$ = t, this.context = i, this.pagination = n, this.spineItemsManager = o, this.spineItemLocator = s, this.settings = r, this.hookManager = a, this.viewport = c, this.elementSubject = new k(Li()), this.element$ = this.elementSubject.asObservable(), this.spineLayout = new is(
6131
6133
  o,
6132
6134
  i,
6133
6135
  r,
6134
6136
  c
6135
- ), this.locator = ds({
6137
+ ), this.locator = gs({
6136
6138
  context: i,
6137
6139
  spineItemsManager: o,
6138
6140
  spineItemLocator: s,
6139
6141
  settings: r,
6140
6142
  spineLayout: this.spineLayout,
6141
6143
  viewport: c
6142
- }), this.spineItemsLoader = new is(
6144
+ }), this.spineItemsLoader = new ns(
6143
6145
  this.context,
6144
6146
  o,
6145
6147
  this.locator,
6146
6148
  r,
6147
6149
  this.spineLayout
6148
- ), this.spineItemsObserver = new Qo(
6150
+ ), this.spineItemsObserver = new ts(
6149
6151
  o,
6150
6152
  this.locator
6151
6153
  );
@@ -6185,7 +6187,7 @@ class gs extends Y {
6185
6187
  super.destroy(), this.spineItemsLoader.destroy(), this.elementSubject.getValue().remove(), this.elementSubject.complete();
6186
6188
  }
6187
6189
  }
6188
- class ls extends Y {
6190
+ class ps extends Y {
6189
6191
  constructor(t, i) {
6190
6192
  super(), this.context = t, this.settings = i, this.orderedSpineItemsSubject = new k([]), this.items$ = this.orderedSpineItemsSubject.asObservable();
6191
6193
  }
@@ -6226,7 +6228,7 @@ class ls extends Y {
6226
6228
  this.orderedSpineItemsSubject.value.forEach((t) => t.destroy());
6227
6229
  }
6228
6230
  }
6229
- class ps extends bt {
6231
+ class hs extends bt {
6230
6232
  constructor(t) {
6231
6233
  const i = document.createElement("div");
6232
6234
  i.style.cssText = `
@@ -6260,7 +6262,7 @@ class ps extends bt {
6260
6262
  }
6261
6263
  get absoluteViewport() {
6262
6264
  const t = this.context.state.visibleAreaRect;
6263
- return new ns({
6265
+ return new os({
6264
6266
  width: t.width,
6265
6267
  height: t.height
6266
6268
  });
@@ -6275,19 +6277,19 @@ class ps extends bt {
6275
6277
  */
6276
6278
  get relativeViewport() {
6277
6279
  const t = this.absoluteViewport, i = this.value.element.getBoundingClientRect(), n = ((i == null ? void 0 : i.width) ?? t.width) / t.width;
6278
- return new os({
6280
+ return new ss({
6279
6281
  width: t.width / n,
6280
6282
  height: t.height / n
6281
6283
  });
6282
6284
  }
6283
6285
  }
6284
- const hs = (e) => {
6285
- const t = new U(), i = new po(), n = new go(), o = new Zo(e, n), s = new lo(n, o), r = new ls(n, o), a = new k(
6286
+ const ms = (e) => {
6287
+ const t = new U(), i = new ho(), n = new lo(), o = new Go(e, n), s = new po(n, o), r = new ps(n, o), a = new k(
6286
6288
  void 0
6287
- ), c = new ps(n), u = a.pipe(tt(ct)), d = ze({
6289
+ ), c = new hs(n), u = a.pipe(tt(ct)), d = ze({
6288
6290
  context: n,
6289
6291
  settings: o
6290
- }), g = new Xo(n, r), l = new gs(
6292
+ }), g = new qo(n, r), l = new ls(
6291
6293
  u,
6292
6294
  n,
6293
6295
  g,
@@ -6296,14 +6298,14 @@ const hs = (e) => {
6296
6298
  o,
6297
6299
  i,
6298
6300
  c
6299
- ), p = _o({
6301
+ ), p = Xo({
6300
6302
  context: n,
6301
6303
  spineItemsManager: r,
6302
6304
  hookManager: i,
6303
6305
  spine: l,
6304
6306
  settings: o,
6305
6307
  viewport: c
6306
- }), h = new qo(
6308
+ }), h = new Yo(
6307
6309
  n,
6308
6310
  g,
6309
6311
  r,
@@ -6339,7 +6341,7 @@ const hs = (e) => {
6339
6341
  return;
6340
6342
  }
6341
6343
  j.log("load", { options: y });
6342
- const $ = ms(I);
6344
+ const $ = fs(I);
6343
6345
  I !== ((L = a.getValue()) == null ? void 0 : L.parentElement) && (a.next($), I.appendChild($)), n.update({
6344
6346
  manifest: P,
6345
6347
  containerElement: I,
@@ -6355,8 +6357,8 @@ const hs = (e) => {
6355
6357
  spine: l,
6356
6358
  hookManager: i,
6357
6359
  cfi: {
6358
- generateCfiFromRange: Rn,
6359
- generateCfiFromSelection: An,
6360
+ generateCfiFromRange: An,
6361
+ generateCfiFromSelection: On,
6360
6362
  parseCfi: Zt,
6361
6363
  generateCfiForSpineItemPage: (y) => Wt({
6362
6364
  ...y,
@@ -6397,33 +6399,33 @@ const hs = (e) => {
6397
6399
  destroy$: t
6398
6400
  }
6399
6401
  };
6400
- }, ms = (e) => {
6402
+ }, fs = (e) => {
6401
6403
  const t = e.ownerDocument.createElement("div");
6402
6404
  return t.style.cssText = `
6403
6405
  background-color: white;
6404
6406
  position: relative;
6405
6407
  `, t.className = `${lt}-reader`, t;
6406
- }, vs = (
6408
+ }, xs = (
6407
6409
  //__
6408
- eo(
6409
- ki(
6410
- Sn(
6411
- oo(
6412
- ji(
6413
- yi(
6414
- Gn(
6415
- no(
6416
- ao(
6417
- Cn(
6418
- rn(
6419
- In(
6420
- Si(
6421
- io(
6422
- qn(
6423
- hn(
6424
- Oi(
6410
+ io(
6411
+ Wi(
6412
+ bn(
6413
+ so(
6414
+ ki(
6415
+ Si(
6416
+ Jn(
6417
+ oo(
6418
+ co(
6419
+ Rn(
6420
+ an(
6421
+ wn(
6422
+ bi(
6423
+ no(
6424
+ Yn(
6425
+ mn(
6426
+ Di(
6425
6427
  // __
6426
- hs
6428
+ ms
6427
6429
  )
6428
6430
  )
6429
6431
  )
@@ -6443,43 +6445,43 @@ const hs = (e) => {
6443
6445
  )
6444
6446
  );
6445
6447
  export {
6446
- go as Context,
6447
- Oo as ControlledNavigationController,
6448
+ lo as Context,
6449
+ Do as ControlledNavigationController,
6448
6450
  Y as DestroyableClass,
6449
6451
  ht as DocumentRenderer,
6450
- po as HookManager,
6451
- Fo as InternalNavigator,
6452
+ ho as HookManager,
6453
+ Lo as InternalNavigator,
6452
6454
  ke as Locker,
6453
6455
  qt as ResourceHandler,
6454
- Do as ScrollNavigationController,
6455
- Yo as SettingsManager,
6456
- gs as Spine,
6456
+ No as ScrollNavigationController,
6457
+ Zo as SettingsManager,
6458
+ ls as Spine,
6457
6459
  Ae as SpineElementLayout,
6458
6460
  Ue as SpineItem,
6459
- dn as SpineItemPageSpineLayout,
6461
+ gn as SpineItemPageSpineLayout,
6460
6462
  kt as SpineItemSpineLayout,
6461
- ls as SpineItemsManager,
6463
+ ps as SpineItemsManager,
6462
6464
  M as SpinePosition,
6463
6465
  Yt as UnsafeSpinePosition,
6464
- vs as createReader,
6466
+ xs as createReader,
6465
6467
  ie as deferIdle,
6466
- Di as deferNextResult,
6468
+ Ni as deferNextResult,
6467
6469
  ee as getAttributeValueFromString,
6468
6470
  Bt as getFrameViewportInfo,
6469
6471
  Fe as idle,
6470
- pi as injectCSS,
6472
+ hi as injectCSS,
6471
6473
  Pe as isHtmlElement,
6472
- Mi as isHtmlTagElement,
6473
- Ts as isShallowEqual,
6474
- hn as layoutEnhancer,
6474
+ Ci as isHtmlTagElement,
6475
+ Fs as isShallowEqual,
6476
+ mn as layoutEnhancer,
6475
6477
  $e as mapKeysTo,
6476
- Is as observeIntersection,
6478
+ ws as observeIntersection,
6477
6479
  ne as observeMutation,
6478
6480
  Te as observeResize,
6479
- hi as removeCSS,
6481
+ mi as removeCSS,
6480
6482
  ot as upsertCSSToFrame,
6481
- mi as waitForFrameLoad,
6482
- fi as waitForFrameReady,
6483
+ fi as waitForFrameLoad,
6484
+ yi as waitForFrameReady,
6483
6485
  Ct as waitForSwitch,
6484
6486
  Xt as watchKeys
6485
6487
  };