@prose-reader/react-reader 1.211.0 → 1.212.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,59 +1,63 @@
1
1
  import { jsx as t, jsxs as d, Fragment as Z } from "react/jsx-runtime";
2
2
  import * as A from "react";
3
- import Oe, { createContext as ze, memo as m, useMemo as xe, useEffect as J, useContext as Ce, useState as I, useLayoutEffect as De, useCallback as q } from "react";
4
- import { signal as ee, useSignalState as ve, useLiveRef as Ee, useSubscribe as M, useObserve as x, useSignalValue as Ae, isDefined as Me } from "reactjrx";
5
- import { tap as de, switchMap as Q, NEVER as te, startWith as ye, distinctUntilChanged as Ie, map as ne, throttleTime as _e, filter as ie, first as ke, combineLatest as Le, EMPTY as Be, Subject as $e, finalize as Se, skip as le, mergeMap as Ne, merge as Fe, timer as He } from "rxjs";
6
- import { IconButton as b, Portal as he, Dialog as y, List as S, Link as oe, Stack as P, Text as p, Button as _, Presence as W, Box as R, createToaster as je, Toaster as Ge, Toast as L, Spinner as Ve, Heading as se, HStack as E, Kbd as fe, Popover as B, Progress as K, chakra as Ye, Collapsible as re, Input as Ue } from "@chakra-ui/react";
7
- import { LuX as qe, LuNotebookPen as ae, LuArrowBigRight as Qe, LuArrowBigLeft as Ke, LuChevronDown as We, LuCircleHelp as Xe, LuTableOfContents as Ze, LuSearch as Je, LuGalleryHorizontal as et, LuCircleCheck as be } from "react-icons/lu";
8
- import { createPortal as tt } from "react-dom";
9
- import { BsBookmarkPlus as nt, BsBookmarkXFill as ot, BsBookmarks as rt } from "react-icons/bs";
10
- import { isShallowEqual as it, observeIntersection as lt, isHtmlTagElement as st } from "@prose-reader/core";
11
- import { RiGalleryView2 as at } from "react-icons/ri";
12
- import { RxDoubleArrowUp as ct, RxDoubleArrowLeft as dt, RxDoubleArrowDown as ht, RxDoubleArrowRight as ut } from "react-icons/rx";
13
- import { HiOutlineInformationCircle as gt } from "react-icons/hi";
14
- import pt from "rc-slider";
3
+ import Oe, { createContext as ze, memo as f, useMemo as be, useEffect as J, useContext as De, useState as S, useLayoutEffect as Ee, useCallback as q } from "react";
4
+ import { signal as ae, useSignalState as xe, useConstant as Ae, useLiveRef as Me, useSubscribe as M, useObserve as x, useSignalValue as _e, isDefined as Le } from "reactjrx";
5
+ import { Subject as ce, tap as de, switchMap as Q, NEVER as ee, startWith as Ce, distinctUntilChanged as ve, map as te, throttleTime as Be, filter as re, first as ye, combineLatest as $e, EMPTY as Ne, finalize as Se, mergeMap as Fe, skip as Ie, merge as He, timer as je } from "rxjs";
6
+ import { IconButton as b, Portal as he, Dialog as y, List as k, Link as ne, Stack as P, Text as p, Button as _, Presence as X, Box as R, createToaster as Ge, Toaster as Ye, Toast as L, Spinner as Ve, Heading as ie, HStack as E, Kbd as fe, Popover as B, Progress as K, chakra as Ue, Collapsible as oe, Input as qe } from "@chakra-ui/react";
7
+ import { LuX as Qe, LuNotebookPen as le, LuArrowBigRight as Ke, LuArrowBigLeft as We, LuChevronDown as Xe, LuCircleHelp as Ze, LuTableOfContents as Je, LuSearch as et, LuGalleryHorizontal as tt, LuCircleCheck as me } from "react-icons/lu";
8
+ import { createPortal as nt } from "react-dom";
9
+ import { BsBookmarkPlus as ot, BsBookmarkXFill as rt, BsBookmarks as it } from "react-icons/bs";
10
+ import { isShallowEqual as lt, observeIntersection as st, isHtmlTagElement as at } from "@prose-reader/core";
11
+ import { RiGalleryView2 as ct } from "react-icons/ri";
12
+ import { RxDoubleArrowUp as dt, RxDoubleArrowLeft as ht, RxDoubleArrowDown as ut, RxDoubleArrowRight as gt } from "react-icons/rx";
13
+ import { HiOutlineInformationCircle as pt } from "react-icons/hi";
14
+ import ft from "rc-slider";
15
15
  import "rc-slider/assets/index.css";
16
- import { IoIosArrowBack as mt, IoMdMore as ft } from "react-icons/io";
17
- import { MdFullscreenExit as bt, MdFullscreen as xt } from "react-icons/md";
18
- const ue = ze({
16
+ import { IoIosArrowBack as mt, IoMdMore as bt } from "react-icons/io";
17
+ import { MdFullscreenExit as xt, MdFullscreen as Ct } from "react-icons/md";
18
+ const ke = ze({
19
19
  reader: void 0,
20
- quickMenuSignal: ee({ default: !1 })
21
- }), Sn = m(
20
+ quickMenuSignal: ae({ default: !1 }),
21
+ notificationsSubject: new ce()
22
+ }), wn = f(
22
23
  ({
23
24
  children: e,
24
25
  reader: n,
25
26
  quickMenuOpen: o,
26
27
  onQuickMenuOpenChange: r
27
28
  }) => {
28
- const [, i] = ve(
29
- () => ee({
29
+ const [, l] = xe(
30
+ () => ae({
30
31
  default: o
31
32
  })
32
- ), l = Ee(r), s = xe(
33
+ ), i = Ae(
34
+ () => new ce()
35
+ ), s = Me(r), c = be(
33
36
  () => ({
34
- quickMenuSignal: i,
35
- reader: n
37
+ quickMenuSignal: l,
38
+ reader: n,
39
+ notificationsSubject: i
36
40
  }),
37
- [i, n]
41
+ [l, n, i]
38
42
  );
39
43
  return J(() => {
40
- i.setValue(o);
41
- }, [o, i]), M(
42
- () => i.subject.pipe(de(l.current)),
43
- [i, l]
44
- ), /* @__PURE__ */ t(ue.Provider, { value: s, children: e });
44
+ l.setValue(o);
45
+ }, [o, l]), M(
46
+ () => l.pipe(de(s.current)),
47
+ [l, s]
48
+ ), /* @__PURE__ */ t(ke.Provider, { value: c, children: e });
45
49
  }
46
- ), Ct = A.forwardRef(function(n, o) {
47
- return /* @__PURE__ */ t(b, { variant: "ghost", "aria-label": "Close", ref: o, ...n, children: n.children ?? /* @__PURE__ */ t(qe, {}) });
50
+ ), vt = A.forwardRef(function(n, o) {
51
+ return /* @__PURE__ */ t(b, { variant: "ghost", "aria-label": "Close", ref: o, ...n, children: n.children ?? /* @__PURE__ */ t(Qe, {}) });
48
52
  }), $ = A.forwardRef(function(n, o) {
49
53
  const {
50
54
  children: r,
51
- portalled: i = !0,
52
- portalRef: l,
55
+ portalled: l = !0,
56
+ portalRef: i,
53
57
  backdrop: s = !0,
54
58
  ...c
55
59
  } = n;
56
- return /* @__PURE__ */ d(he, { disabled: !i, container: l, children: [
60
+ return /* @__PURE__ */ d(he, { disabled: !l, container: i, children: [
57
61
  s && /* @__PURE__ */ t(y.Backdrop, {}),
58
62
  /* @__PURE__ */ t(y.Positioner, { children: /* @__PURE__ */ t(y.Content, { ref: o, ...c, asChild: !1, children: r }) })
59
63
  ] });
@@ -66,46 +70,46 @@ const ue = ze({
66
70
  insetEnd: "2",
67
71
  ...n,
68
72
  asChild: !0,
69
- children: /* @__PURE__ */ t(Ct, { size: "sm", ref: o, children: n.children })
73
+ children: /* @__PURE__ */ t(vt, { size: "sm", ref: o, children: n.children })
70
74
  }
71
75
  );
72
76
  }), F = y.Root, H = y.Footer, j = y.Header, G = y.Body;
73
77
  y.Backdrop;
74
- const V = y.Title;
78
+ const Y = y.Title;
75
79
  y.Description;
76
80
  y.Trigger;
77
- const Y = y.ActionTrigger, C = () => {
78
- const { reader: e } = Ce(ue);
81
+ const V = y.ActionTrigger, W = () => De(ke), C = () => {
82
+ const { reader: e } = W();
79
83
  return e;
80
- }, we = (e) => !!e && "__PROSE_READER_ENHANCER_SEARCH" in e, ge = (e) => !!e && "__PROSE_READER_ENHANCER_BOOKMARKS" in e, Te = (e) => !!e && "__PROSE_READER_ENHANCER_ANNOTATIONS" in e, Pe = (e) => !!e && "__PROSE_READER_ENHANCER_GALLERY" in e, vt = m(
84
+ }, we = (e) => !!e && "__PROSE_READER_ENHANCER_SEARCH" in e, ue = (e) => !!e && "__PROSE_READER_ENHANCER_BOOKMARKS" in e, Te = (e) => !!e && "__PROSE_READER_ENHANCER_ANNOTATIONS" in e, Pe = (e) => !!e && "__PROSE_READER_ENHANCER_GALLERY" in e, yt = f(
81
85
  ({ onNavigate: e }) => {
82
86
  const n = C(), o = Te(n) ? n : void 0, r = x(
83
87
  () => o == null ? void 0 : o.annotations.highlights$.pipe(
84
88
  Q(
85
- (l) => o.locateResource(l)
89
+ (i) => o.locateResource(i)
86
90
  )
87
91
  ),
88
92
  [o]
89
- ), i = (l, s) => {
93
+ ), l = (i, s) => {
90
94
  var c, u, a;
91
- return /* @__PURE__ */ t(S.Item, { children: /* @__PURE__ */ d(
92
- oe,
95
+ return /* @__PURE__ */ t(k.Item, { children: /* @__PURE__ */ d(
96
+ ne,
93
97
  {
94
98
  href: "#",
95
99
  onClick: () => {
96
- e(), n == null || n.navigation.goToCfi(l.meta.cfi ?? "");
100
+ e(), n == null || n.navigation.goToCfi(i.meta.cfi ?? "");
97
101
  },
98
102
  children: [
99
- (((c = l.resource) == null ? void 0 : c.contents) ?? [])[0] ? /* @__PURE__ */ t(S.Indicator, { asChild: !0, children: /* @__PURE__ */ t(ae, {}) }) : /* @__PURE__ */ t(S.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ t(ae, {}) }),
103
+ (((c = i.resource) == null ? void 0 : c.contents) ?? [])[0] ? /* @__PURE__ */ t(k.Indicator, { asChild: !0, children: /* @__PURE__ */ t(le, {}) }) : /* @__PURE__ */ t(k.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ t(le, {}) }),
100
104
  /* @__PURE__ */ d(P, { gap: 0, children: [
101
- /* @__PURE__ */ t(p, { lineClamp: 2, fontSize: "md", children: (u = l.resource) != null && u.selectionAsText ? l.resource.selectionAsText ?? "" : /* @__PURE__ */ t("i", { children: /* @__PURE__ */ t("b", { children: "unknown (not loaded)" }) }) }),
105
+ /* @__PURE__ */ t(p, { lineClamp: 2, fontSize: "md", children: (u = i.resource) != null && u.selectionAsText ? i.resource.selectionAsText ?? "" : /* @__PURE__ */ t("i", { children: /* @__PURE__ */ t("b", { children: "unknown (not loaded)" }) }) }),
102
106
  /* @__PURE__ */ t(
103
107
  p,
104
108
  {
105
109
  fontStyle: "italic",
106
110
  fontWeight: "bold",
107
111
  fontSize: "sm",
108
- children: `Book page: ${((a = l.meta) == null ? void 0 : a.absolutePageIndex) !== void 0 ? l.meta.absolutePageIndex + 1 : "unknown (not loaded)"}`
112
+ children: `Book page: ${((a = i.meta) == null ? void 0 : a.absolutePageIndex) !== void 0 ? i.meta.absolutePageIndex + 1 : "unknown (not loaded)"}`
109
113
  }
110
114
  )
111
115
  ] })
@@ -113,11 +117,11 @@ const Y = y.ActionTrigger, C = () => {
113
117
  }
114
118
  ) }, s);
115
119
  };
116
- return /* @__PURE__ */ t(S.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children: r == null ? void 0 : r.map(
117
- (l, s) => i(l, s)
120
+ return /* @__PURE__ */ t(k.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children: r == null ? void 0 : r.map(
121
+ (i, s) => l(i, s)
118
122
  ) });
119
123
  }
120
- ), yt = m(
124
+ ), St = f(
121
125
  ({
122
126
  open: e,
123
127
  setOpen: n,
@@ -132,35 +136,35 @@ const Y = y.ActionTrigger, C = () => {
132
136
  size: { mdDown: "full", md: "lg" },
133
137
  scrollBehavior: "inside",
134
138
  children: /* @__PURE__ */ d($, { height: "100%", children: [
135
- /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(V, { children: "Annotations" }) }),
136
- /* @__PURE__ */ t(G, { flex: 1, children: /* @__PURE__ */ t(vt, { onNavigate: o }) }),
137
- /* @__PURE__ */ t(H, { children: /* @__PURE__ */ t(Y, { asChild: !0, children: /* @__PURE__ */ t(_, { variant: "outline", children: "Cancel" }) }) }),
139
+ /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(Y, { children: "Annotations" }) }),
140
+ /* @__PURE__ */ t(G, { flex: 1, children: /* @__PURE__ */ t(yt, { onNavigate: o }) }),
141
+ /* @__PURE__ */ t(H, { children: /* @__PURE__ */ t(V, { asChild: !0, children: /* @__PURE__ */ t(_, { variant: "outline", children: "Cancel" }) }) }),
138
142
  /* @__PURE__ */ t(N, {})
139
143
  ] })
140
144
  }
141
145
  )
142
- ), It = m(() => {
143
- const e = C(), n = ge(e) ? e : void 0, o = x(() => e == null ? void 0 : e.spine.element$, [e]), r = x(
146
+ ), It = f(() => {
147
+ const e = C(), n = ue(e) ? e : void 0, o = x(() => e == null ? void 0 : e.spine.element$, [e]), r = x(
144
148
  () => n == null ? void 0 : n.bookmarks.pages$,
145
149
  [n]
146
- ), i = x(
150
+ ), l = x(
147
151
  () => n == null ? void 0 : n.bookmarks.bookmarks$,
148
152
  [n]
149
- ), l = x(
150
- () => e == null ? void 0 : e.locateResource(i ?? []),
151
- [e, i]
153
+ ), i = x(
154
+ () => e == null ? void 0 : e.locateResource(l ?? []),
155
+ [e, l]
152
156
  );
153
- return o ? /* @__PURE__ */ t(Z, { children: tt(
157
+ return o ? /* @__PURE__ */ t(Z, { children: nt(
154
158
  r == null ? void 0 : r.map(
155
159
  ({ isBookmarkable: s, absolutePosition: { left: c, top: u, width: a } }, g) => {
156
- const h = l == null ? void 0 : l.find(
157
- (f) => {
160
+ const h = i == null ? void 0 : i.find(
161
+ (m) => {
158
162
  var v;
159
- return ((v = f == null ? void 0 : f.meta) == null ? void 0 : v.absolutePageIndex) === g;
163
+ return ((v = m == null ? void 0 : m.meta) == null ? void 0 : v.absolutePageIndex) === g;
160
164
  }
161
165
  );
162
166
  return s ? /* @__PURE__ */ t(
163
- W,
167
+ X,
164
168
  {
165
169
  present: !0,
166
170
  lazyMount: !0,
@@ -189,7 +193,7 @@ const Y = y.ActionTrigger, C = () => {
189
193
  size: "lg",
190
194
  variant: "ghost",
191
195
  _icon: { boxSize: "36px" },
192
- children: /* @__PURE__ */ t(ot, {})
196
+ children: /* @__PURE__ */ t(rt, {})
193
197
  }
194
198
  ) : /* @__PURE__ */ t(
195
199
  b,
@@ -204,7 +208,7 @@ const Y = y.ActionTrigger, C = () => {
204
208
  _hover: { opacity: 1 },
205
209
  variant: "ghost",
206
210
  _icon: { boxSize: "36px" },
207
- children: /* @__PURE__ */ t(nt, {})
211
+ children: /* @__PURE__ */ t(ot, {})
208
212
  }
209
213
  )
210
214
  }
@@ -216,25 +220,25 @@ const Y = y.ActionTrigger, C = () => {
216
220
  ),
217
221
  o
218
222
  ) }) : null;
219
- }), kt = m(
223
+ }), kt = f(
220
224
  ({ onNavigate: e }) => {
221
- const n = C(), o = ge(n) ? n : void 0, r = x(
225
+ const n = C(), o = ue(n) ? n : void 0, r = x(
222
226
  () => o == null ? void 0 : o.bookmarks.bookmarks$.pipe(
223
- Q((l) => o.locateResource(l))
227
+ Q((i) => o.locateResource(i))
224
228
  ),
225
229
  [o]
226
- ), i = (l, s) => {
230
+ ), l = (i, s) => {
227
231
  var c, u, a, g, h;
228
- return /* @__PURE__ */ d(S.Item, { justifyContent: "space-between", alignItems: "center", children: [
232
+ return /* @__PURE__ */ d(k.Item, { justifyContent: "space-between", alignItems: "center", children: [
229
233
  /* @__PURE__ */ t(
230
- oe,
234
+ ne,
231
235
  {
232
236
  href: "#",
233
237
  onClick: () => {
234
- e(), n == null || n.navigation.goToCfi(l.meta.cfi ?? "");
238
+ e(), n == null || n.navigation.goToCfi(i.meta.cfi ?? "");
235
239
  },
236
240
  children: /* @__PURE__ */ d(P, { gap: 0, children: [
237
- /* @__PURE__ */ t(p, { fontSize: "md", children: `Book page: ${((c = l.meta) == null ? void 0 : c.absolutePageIndex) !== void 0 ? l.meta.absolutePageIndex + 1 : "unknown"}` }),
241
+ /* @__PURE__ */ t(p, { fontSize: "md", children: `Book page: ${((c = i.meta) == null ? void 0 : c.absolutePageIndex) !== void 0 ? i.meta.absolutePageIndex + 1 : "unknown"}` }),
238
242
  /* @__PURE__ */ t(
239
243
  p,
240
244
  {
@@ -243,7 +247,7 @@ const Y = y.ActionTrigger, C = () => {
243
247
  fontSize: "sm",
244
248
  truncate: !0,
245
249
  lineClamp: 2,
246
- children: (a = (u = l.meta) == null ? void 0 : u.startNode) != null && a.textContent ? (h = (g = l.meta) == null ? void 0 : g.startNode) == null ? void 0 : h.textContent : "..."
250
+ children: (a = (u = i.meta) == null ? void 0 : u.startNode) != null && a.textContent ? (h = (g = i.meta) == null ? void 0 : g.startNode) == null ? void 0 : h.textContent : "..."
247
251
  }
248
252
  )
249
253
  ] })
@@ -256,18 +260,18 @@ const Y = y.ActionTrigger, C = () => {
256
260
  variant: "solid",
257
261
  size: "xs",
258
262
  onClick: () => {
259
- o == null || o.bookmarks.delete(l.resource.id);
263
+ o == null || o.bookmarks.delete(i.resource.id);
260
264
  },
261
265
  children: "Delete"
262
266
  }
263
267
  )
264
268
  ] }, s);
265
269
  };
266
- return /* @__PURE__ */ t(S.Root, { overflowY: "auto", gap: 3, variant: "plain", overflow: "auto", children: r == null ? void 0 : r.map(
267
- (l, s) => i(l, s)
270
+ return /* @__PURE__ */ t(k.Root, { overflowY: "auto", gap: 3, variant: "plain", overflow: "auto", children: r == null ? void 0 : r.map(
271
+ (i, s) => l(i, s)
268
272
  ) });
269
273
  }
270
- ), St = m(
274
+ ), wt = f(
271
275
  ({
272
276
  open: e,
273
277
  setOpen: n,
@@ -282,17 +286,17 @@ const Y = y.ActionTrigger, C = () => {
282
286
  size: { mdDown: "full", md: "lg" },
283
287
  scrollBehavior: "inside",
284
288
  children: /* @__PURE__ */ d($, { height: "100%", children: [
285
- /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(V, { children: "Bookmarks" }) }),
289
+ /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(Y, { children: "Bookmarks" }) }),
286
290
  /* @__PURE__ */ t(G, { children: /* @__PURE__ */ t(kt, { onNavigate: o }) }),
287
- /* @__PURE__ */ t(H, { children: /* @__PURE__ */ t(Y, { asChild: !0, children: /* @__PURE__ */ t(_, { variant: "outline", children: "Cancel" }) }) }),
291
+ /* @__PURE__ */ t(H, { children: /* @__PURE__ */ t(V, { asChild: !0, children: /* @__PURE__ */ t(_, { variant: "outline", children: "Cancel" }) }) }),
288
292
  /* @__PURE__ */ t(N, {})
289
293
  ] })
290
294
  }
291
295
  )
292
- ), ce = je({
296
+ ), se = Ge({
293
297
  placement: "bottom-end",
294
298
  pauseOnPageIdle: !0
295
- }), wt = () => /* @__PURE__ */ t(he, { children: /* @__PURE__ */ t(Ge, { toaster: ce, insetInline: { mdDown: "4" }, children: (e) => {
299
+ }), Tt = () => /* @__PURE__ */ t(he, { children: /* @__PURE__ */ t(Ye, { toaster: se, insetInline: { mdDown: "4" }, children: (e) => {
296
300
  var n;
297
301
  return /* @__PURE__ */ d(L.Root, { width: { md: "sm" }, children: [
298
302
  e.type === "loading" ? /* @__PURE__ */ t(Ve, { size: "sm", color: "blue.solid" }) : /* @__PURE__ */ t(L.Indicator, {}),
@@ -303,7 +307,7 @@ const Y = y.ActionTrigger, C = () => {
303
307
  e.action && /* @__PURE__ */ t(L.ActionTrigger, { children: e.action.label }),
304
308
  ((n = e.meta) == null ? void 0 : n.closable) && /* @__PURE__ */ t(L.CloseTrigger, {})
305
309
  ] });
306
- } }) }), Tt = {
310
+ } }) }), Pt = {
307
311
  x: 0,
308
312
  y: 0,
309
313
  width: 0,
@@ -313,61 +317,61 @@ const Y = y.ActionTrigger, C = () => {
313
317
  bottom: 0,
314
318
  right: 0
315
319
  };
316
- function Pt() {
317
- const [e, n] = I(null), [o, r] = I(Tt), i = xe(
318
- () => new ResizeObserver((l) => {
319
- if (l[0]) {
320
- const { x: s, y: c, width: u, height: a, top: g, left: h, bottom: f, right: v } = l[0].contentRect;
321
- r({ x: s, y: c, width: u, height: a, top: g, left: h, bottom: f, right: v });
320
+ function Rt() {
321
+ const [e, n] = S(null), [o, r] = S(Pt), l = be(
322
+ () => new ResizeObserver((i) => {
323
+ if (i[0]) {
324
+ const { x: s, y: c, width: u, height: a, top: g, left: h, bottom: m, right: v } = i[0].contentRect;
325
+ r({ x: s, y: c, width: u, height: a, top: g, left: h, bottom: m, right: v });
322
326
  }
323
327
  }),
324
328
  []
325
329
  );
326
- return De(() => {
330
+ return Ee(() => {
327
331
  if (e)
328
- return i.observe(e), () => {
329
- i.disconnect();
332
+ return l.observe(e), () => {
333
+ l.disconnect();
330
334
  };
331
- }, [e, i]), [n, o, e];
335
+ }, [e, l]), [n, o, e];
332
336
  }
333
- const Rt = (e, n, o) => {
334
- const r = C(), i = Pe(r) ? r : void 0;
337
+ const Ot = (e, n, o) => {
338
+ const r = C(), l = Pe(r) ? r : void 0;
335
339
  M(() => {
336
- if (!i || !e) return te;
337
- const l = n.layout.layout$.pipe(
338
- ye(n.layout.layoutInfo),
339
- Ie(it)
340
- ), s = lt(
340
+ if (!l || !e) return ee;
341
+ const i = n.layout.layout$.pipe(
342
+ Ce(n.layout.layoutInfo),
343
+ ve(lt)
344
+ ), s = st(
341
345
  e
342
- ).pipe(ne((c) => c.some((u) => u.isIntersecting)));
343
- return l.pipe(
344
- _e(100, void 0, { trailing: !0 }),
346
+ ).pipe(te((c) => c.some((u) => u.isIntersecting)));
347
+ return i.pipe(
348
+ Be(100, void 0, { trailing: !0 }),
345
349
  Q(() => s.pipe(
346
350
  de((c) => {
347
351
  c || (e.innerHTML = "");
348
352
  }),
349
- ie((c) => c),
350
- ke()
353
+ re((c) => c),
354
+ ye()
351
355
  ).pipe(
352
- Q(() => (e.innerHTML = "", i == null ? void 0 : i.gallery.snapshot(
356
+ Q(() => (e.innerHTML = "", l == null ? void 0 : l.gallery.snapshot(
353
357
  n,
354
358
  e,
355
359
  o
356
360
  )))
357
361
  ))
358
362
  );
359
- }, [i, n, o, e]);
360
- }, Ot = m(
363
+ }, [l, n, o, e]);
364
+ }, zt = f(
361
365
  ({
362
366
  item: e,
363
367
  onNavigated: n
364
368
  }) => {
365
369
  var c;
366
- const [o, r, i] = Pt(), l = C();
367
- Rt(i, e, r);
370
+ const [o, r, l] = Rt(), i = C();
371
+ Ot(l, e, r);
368
372
  const s = x(
369
- () => l == null ? void 0 : l.locateResource(e, { mode: "shallow" }),
370
- [l, e]
373
+ () => i == null ? void 0 : i.locateResource(e, { mode: "shallow" }),
374
+ [i, e]
371
375
  );
372
376
  return /* @__PURE__ */ d(
373
377
  R,
@@ -382,7 +386,7 @@ const Rt = (e, n, o) => {
382
386
  position: "relative",
383
387
  overflow: "hidden",
384
388
  onClick: () => {
385
- n(), l == null || l.navigation.goToSpineItem({ indexOrId: e });
389
+ n(), i == null || i.navigation.goToSpineItem({ indexOrId: e });
386
390
  },
387
391
  children: [
388
392
  /* @__PURE__ */ t(
@@ -416,7 +420,7 @@ const Rt = (e, n, o) => {
416
420
  }
417
421
  );
418
422
  }
419
- ), zt = m(
423
+ ), Dt = f(
420
424
  ({
421
425
  open: e,
422
426
  setOpen: n
@@ -428,11 +432,11 @@ const Rt = (e, n, o) => {
428
432
  lazyMount: !0,
429
433
  placement: "center",
430
434
  open: e,
431
- onOpenChange: (i) => n(i.open),
435
+ onOpenChange: (l) => n(l.open),
432
436
  size: { mdDown: "full", md: "lg" },
433
437
  scrollBehavior: "inside",
434
438
  children: /* @__PURE__ */ d($, { height: "100%", children: [
435
- /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(V, { children: "Gallery" }) }),
439
+ /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(Y, { children: "Gallery" }) }),
436
440
  /* @__PURE__ */ t(G, { children: /* @__PURE__ */ t(
437
441
  R,
438
442
  {
@@ -444,25 +448,25 @@ const Rt = (e, n, o) => {
444
448
  gap: [2, 4],
445
449
  pt: 2,
446
450
  "data-grid": !0,
447
- children: r == null ? void 0 : r.map((i) => /* @__PURE__ */ t(
448
- Ot,
451
+ children: r == null ? void 0 : r.map((l) => /* @__PURE__ */ t(
452
+ zt,
449
453
  {
450
- item: i,
454
+ item: l,
451
455
  onNavigated: () => {
452
456
  n(!1);
453
457
  }
454
458
  },
455
- i.item.id
459
+ l.item.id
456
460
  ))
457
461
  }
458
462
  ) }),
459
- /* @__PURE__ */ t(H, { children: /* @__PURE__ */ t(Y, { asChild: !0, children: /* @__PURE__ */ t(_, { variant: "outline", children: "Cancel" }) }) }),
463
+ /* @__PURE__ */ t(H, { children: /* @__PURE__ */ t(V, { asChild: !0, children: /* @__PURE__ */ t(_, { variant: "outline", children: "Cancel" }) }) }),
460
464
  /* @__PURE__ */ t(N, {})
461
465
  ] })
462
466
  }
463
467
  );
464
468
  }
465
- ), Dt = "@prose-reader/react-reader", Et = "1.210.0", At = m(
469
+ ), Et = "@prose-reader/react-reader", At = "1.211.0", Mt = f(
466
470
  ({
467
471
  open: e,
468
472
  setOpen: n
@@ -476,27 +480,27 @@ const Rt = (e, n, o) => {
476
480
  size: { mdDown: "full", md: "lg" },
477
481
  scrollBehavior: "inside",
478
482
  children: /* @__PURE__ */ d($, { children: [
479
- /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(V, { children: "Help" }) }),
483
+ /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(Y, { children: "Help" }) }),
480
484
  /* @__PURE__ */ d(G, { overflowY: "auto", flex: 1, children: [
481
- /* @__PURE__ */ t(se, { mb: 2, as: "h3", size: "lg", children: "Shortcuts" }),
485
+ /* @__PURE__ */ t(ie, { mb: 2, as: "h3", size: "lg", children: "Shortcuts" }),
482
486
  /* @__PURE__ */ d(E, { mb: 1, children: [
483
- /* @__PURE__ */ t(fe, { children: /* @__PURE__ */ t(Qe, {}) }),
487
+ /* @__PURE__ */ t(fe, { children: /* @__PURE__ */ t(Ke, {}) }),
484
488
  " ",
485
489
  /* @__PURE__ */ t(p, { children: "Navigate to right page" })
486
490
  ] }),
487
491
  /* @__PURE__ */ d(E, { mb: 1, children: [
488
- /* @__PURE__ */ t(fe, { children: /* @__PURE__ */ t(Ke, {}) }),
492
+ /* @__PURE__ */ t(fe, { children: /* @__PURE__ */ t(We, {}) }),
489
493
  " ",
490
494
  /* @__PURE__ */ t(p, { children: "Navigate to left page" })
491
495
  ] }),
492
- /* @__PURE__ */ t(se, { mb: 2, mt: 4, as: "h3", size: "lg", children: "About" }),
496
+ /* @__PURE__ */ t(ie, { mb: 2, mt: 4, as: "h3", size: "lg", children: "About" }),
493
497
  /* @__PURE__ */ d(p, { children: [
494
- Dt,
498
+ Et,
495
499
  " version: ",
496
- Et
500
+ At
497
501
  ] })
498
502
  ] }),
499
- /* @__PURE__ */ t(H, { children: /* @__PURE__ */ t(Y, { asChild: !0, children: /* @__PURE__ */ t(_, { variant: "outline", children: "Cancel" }) }) }),
503
+ /* @__PURE__ */ t(H, { children: /* @__PURE__ */ t(V, { asChild: !0, children: /* @__PURE__ */ t(_, { variant: "outline", children: "Cancel" }) }) }),
500
504
  /* @__PURE__ */ t(N, {})
501
505
  ] })
502
506
  }
@@ -504,13 +508,13 @@ const Rt = (e, n, o) => {
504
508
  ), U = () => {
505
509
  const e = C();
506
510
  return x(
507
- () => e ? Le([e.pagination.state$, e.context.state$]).pipe(
508
- ne(([n, o]) => {
509
- var i;
510
- const r = (i = o.manifest) == null ? void 0 : i.spineItems.every(
511
- (l) => {
511
+ () => e ? $e([e.pagination.state$, e.context.state$]).pipe(
512
+ te(([n, o]) => {
513
+ var l;
514
+ const r = (l = o.manifest) == null ? void 0 : l.spineItems.every(
515
+ (i) => {
512
516
  var s;
513
- return (s = l.mediaType) == null ? void 0 : s.startsWith("image/");
517
+ return (s = i.mediaType) == null ? void 0 : s.startsWith("image/");
514
518
  }
515
519
  );
516
520
  return {
@@ -518,10 +522,10 @@ const Rt = (e, n, o) => {
518
522
  hasChapters: !o.isFullyPrePaginated && !r
519
523
  };
520
524
  })
521
- ) : te,
525
+ ) : ee,
522
526
  [e]
523
527
  );
524
- }, Mt = () => {
528
+ }, _t = () => {
525
529
  const e = U(), n = Math.floor(
526
530
  ((e == null ? void 0 : e.percentageEstimateOfBook) ?? 0) * 100
527
531
  ), o = n > 0 ? n : 1;
@@ -529,25 +533,25 @@ const Rt = (e, n, o) => {
529
533
  o,
530
534
  " %"
531
535
  ] }) });
532
- }, _t = () => {
533
- const [e, n] = I(/* @__PURE__ */ new Date());
536
+ }, Lt = () => {
537
+ const [e, n] = S(/* @__PURE__ */ new Date());
534
538
  return J(() => {
535
539
  const o = setInterval(() => {
536
540
  n(/* @__PURE__ */ new Date());
537
541
  }, 6e4);
538
542
  return () => clearInterval(o);
539
543
  }, []), e;
540
- }, Lt = (e) => {
541
- const n = _t();
544
+ }, Bt = (e) => {
545
+ const n = Lt();
542
546
  return /* @__PURE__ */ t(p, { fontSize: "xs", ...e, children: n.toLocaleTimeString(navigator.language, {
543
547
  hour: "2-digit",
544
548
  minute: "2-digit"
545
549
  }) });
546
- }, pe = () => {
547
- const { quickMenuSignal: e } = Ce(ue);
548
- return [Ae(e), e.setValue, e];
549
- }, Bt = () => {
550
- const [e] = pe();
550
+ }, ge = () => {
551
+ const { quickMenuSignal: e } = W();
552
+ return [_e(e), e.setValue, e];
553
+ }, $t = () => {
554
+ const [e] = ge();
551
555
  return /* @__PURE__ */ t(
552
556
  R,
553
557
  {
@@ -556,14 +560,14 @@ const Rt = (e, n, o) => {
556
560
  bottom: 0,
557
561
  p: 2,
558
562
  color: e ? void 0 : "colorPalette.contrast",
559
- children: /* @__PURE__ */ t(Lt, {})
563
+ children: /* @__PURE__ */ t(Bt, {})
560
564
  }
561
565
  );
562
- }, $t = () => {
566
+ }, Nt = () => {
563
567
  const e = C();
564
568
  M(
565
569
  () => e == null ? void 0 : e.links$.subscribe((n) => {
566
- if (n.type === "click" && st(n.target, "a")) {
570
+ if (n.type === "click" && at(n.target, "a")) {
567
571
  if (!n.target.href) return;
568
572
  const o = new URL(n.target.href);
569
573
  window.location.host !== o.host && confirm(
@@ -573,80 +577,78 @@ const Rt = (e, n, o) => {
573
577
  }),
574
578
  [e]
575
579
  );
576
- }, X = ee({
577
- default: void 0
578
- }), Nt = () => {
579
- const e = C();
580
+ }, Ft = () => {
581
+ const e = C(), { notificationsSubject: n } = W();
580
582
  M(
581
583
  () => e == null ? void 0 : e.zoom.isZooming$.pipe(
582
- Q((n) => {
583
- if (!n) return Be;
584
- const o = new $e();
585
- return X.setValue({
584
+ Q((o) => {
585
+ if (!o) return Ne;
586
+ const r = new ce();
587
+ return n.next({
586
588
  key: "zoom",
587
589
  title: "Zooming",
588
590
  duration: 999999,
589
- abort: o
590
- }), te.pipe(
591
+ abort: r
592
+ }), ee.pipe(
591
593
  Se(() => {
592
- o.next(), o.complete();
594
+ r.next(), r.complete();
593
595
  })
594
596
  );
595
597
  })
596
598
  ),
597
599
  [e]
598
600
  );
599
- }, Ft = () => {
600
- const e = C();
601
+ }, Ht = () => {
602
+ const e = C(), { notificationsSubject: n } = W();
601
603
  M(
602
604
  () => e == null ? void 0 : e.settings.values$.pipe(
603
- ne(({ fontScale: n }) => n),
604
- Ie(),
605
- le(1),
606
- de((n) => {
607
- X.setValue({
605
+ te(({ fontScale: o }) => o),
606
+ ve(),
607
+ Ie(1),
608
+ de((o) => {
609
+ n.next({
608
610
  key: "fontScaleChange",
609
611
  title: "Font size changed",
610
- description: `${n * 100} %`
612
+ description: `${o * 100} %`
611
613
  });
612
614
  })
613
615
  ),
614
- [e]
616
+ [e, n]
615
617
  );
616
- }, Ht = () => {
617
- Ft(), Nt(), M(
618
- () => X.subject.pipe(
619
- // @todo implement Signal / BehaviorSignal / ReplaySignal
620
- le(1),
621
- ie(Me),
622
- Ne((e) => {
623
- const n = e.duration ?? 3e3, o = ce.create({
624
- title: e.title,
625
- description: e.description,
626
- duration: n
627
- }), r = X.subject.pipe(
628
- le(1),
629
- ie((i) => !!e.key && (i == null ? void 0 : i.key) === e.key)
618
+ }, jt = () => {
619
+ const { notificationsSubject: e } = W();
620
+ Ht(), Ft(), M(
621
+ () => e.pipe(
622
+ re(Le),
623
+ Fe((n) => {
624
+ const o = n.duration ?? 3e3, r = se.create({
625
+ title: n.title,
626
+ description: n.description,
627
+ duration: o
628
+ }), l = e.pipe(
629
+ Ie(1),
630
+ re((i) => !!n.key && (i == null ? void 0 : i.key) === n.key)
630
631
  );
631
- return Fe(
632
- He(n),
633
- e.abort ?? te,
634
- r
632
+ return He(
633
+ je(o),
634
+ n.abort ?? ee,
635
+ l
635
636
  ).pipe(
636
- ke(),
637
+ ye(),
637
638
  Se(() => {
638
- ce.dismiss(o);
639
+ se.dismiss(r);
639
640
  })
640
641
  );
641
642
  })
642
- )
643
+ ),
644
+ [e]
643
645
  );
644
- }, jt = A.forwardRef(
646
+ }, Gt = A.forwardRef(
645
647
  function(n, o) {
646
648
  const {
647
649
  showArrow: r,
648
- children: i,
649
- portalled: l = !0,
650
+ children: l,
651
+ portalled: i = !0,
650
652
  content: s,
651
653
  portalRef: c,
652
654
  ...u
@@ -657,8 +659,8 @@ const Rt = (e, n, o) => {
657
659
  ...u,
658
660
  positioning: { ...u.positioning, gutter: 4 },
659
661
  children: [
660
- /* @__PURE__ */ t(B.Trigger, { asChild: !0, children: i }),
661
- /* @__PURE__ */ t(he, { disabled: !l, container: c, children: /* @__PURE__ */ t(B.Positioner, { children: /* @__PURE__ */ d(
662
+ /* @__PURE__ */ t(B.Trigger, { asChild: !0, children: l }),
663
+ /* @__PURE__ */ t(he, { disabled: !i, container: c, children: /* @__PURE__ */ t(B.Positioner, { children: /* @__PURE__ */ d(
662
664
  B.Content,
663
665
  {
664
666
  width: "auto",
@@ -677,37 +679,37 @@ const Rt = (e, n, o) => {
677
679
  }
678
680
  );
679
681
  }
680
- ), Gt = A.forwardRef(function(n, o) {
681
- const { children: r, ...i } = n;
682
- return /* @__PURE__ */ t(jt, { content: r, ...i, ref: o, children: /* @__PURE__ */ t(
682
+ ), Yt = A.forwardRef(function(n, o) {
683
+ const { children: r, ...l } = n;
684
+ return /* @__PURE__ */ t(Gt, { content: r, ...l, ref: o, children: /* @__PURE__ */ t(
683
685
  b,
684
686
  {
685
687
  variant: "ghost",
686
688
  "aria-label": "info",
687
689
  size: "2xs",
688
690
  colorPalette: "gray",
689
- children: /* @__PURE__ */ t(gt, {})
691
+ children: /* @__PURE__ */ t(pt, {})
690
692
  }
691
693
  ) });
692
694
  }), Vt = A.forwardRef(function(n, o) {
693
695
  return /* @__PURE__ */ t(K.Track, { ...n, ref: o, children: /* @__PURE__ */ t(K.Range, {}) });
694
696
  });
695
697
  A.forwardRef(function(n, o) {
696
- const { children: r, info: i, ...l } = n;
697
- return /* @__PURE__ */ d(K.Label, { ...l, ref: o, children: [
698
+ const { children: r, info: l, ...i } = n;
699
+ return /* @__PURE__ */ d(K.Label, { ...i, ref: o, children: [
698
700
  r,
699
- i && /* @__PURE__ */ t(Gt, { children: i })
701
+ l && /* @__PURE__ */ t(Yt, { children: l })
700
702
  ] });
701
703
  });
702
- const Yt = K.Root, Ut = K.ValueText, me = () => {
703
- const e = U(), n = (e == null ? void 0 : e.numberOfTotalPages) === 1, o = ((e == null ? void 0 : e.beginNumberOfPagesInSpineItem) ?? 0) > 1, r = ((e == null ? void 0 : e.endNumberOfPagesInSpineItem) ?? 0) > 1, i = (e != null && e.hasChapters ? e == null ? void 0 : e.beginPageIndexInSpineItem : e == null ? void 0 : e.beginAbsolutePageIndex) ?? 0, l = (e != null && e.hasChapters ? e == null ? void 0 : e.endPageIndexInSpineItem : e == null ? void 0 : e.endAbsolutePageIndex) ?? 0, [s = 0, c = 0] = [
704
- i,
705
- l
704
+ const Ut = K.Root, qt = K.ValueText, pe = () => {
705
+ const e = U(), n = (e == null ? void 0 : e.numberOfTotalPages) === 1, o = ((e == null ? void 0 : e.beginNumberOfPagesInSpineItem) ?? 0) > 1, r = ((e == null ? void 0 : e.endNumberOfPagesInSpineItem) ?? 0) > 1, l = (e != null && e.hasChapters ? e == null ? void 0 : e.beginPageIndexInSpineItem : e == null ? void 0 : e.beginAbsolutePageIndex) ?? 0, i = (e != null && e.hasChapters ? e == null ? void 0 : e.endPageIndexInSpineItem : e == null ? void 0 : e.endAbsolutePageIndex) ?? 0, [s = 0, c = 0] = [
706
+ l,
707
+ i
706
708
  ].sort((g, h) => g - h), u = (e == null ? void 0 : e.beginPageIndexInSpineItem) !== (e == null ? void 0 : e.endPageIndexInSpineItem) || (e == null ? void 0 : e.beginSpineItemIndex) !== (e == null ? void 0 : e.endSpineItemIndex), a = e != null && e.hasChapters ? e == null ? void 0 : e.beginNumberOfPagesInSpineItem : e == null ? void 0 : e.numberOfTotalPages;
707
709
  return {
708
710
  hasOnlyOnePage: n,
709
- beginPageIndex: i,
710
- endPageIndex: l,
711
+ beginPageIndex: l,
712
+ endPageIndex: i,
711
713
  isBeginWithinChapter: o,
712
714
  isEndWithinChapter: r,
713
715
  beginAndEndAreDifferent: u,
@@ -715,22 +717,22 @@ const Yt = K.Root, Ut = K.ValueText, me = () => {
715
717
  leftPageIndex: s,
716
718
  rightPageIndex: c
717
719
  };
718
- }, qt = () => {
720
+ }, Qt = () => {
719
721
  const e = U(), {
720
722
  hasOnlyOnePage: n,
721
723
  leftPageIndex: o,
722
724
  rightPageIndex: r,
723
- totalApproximatePages: i,
724
- beginAndEndAreDifferent: l
725
- } = me(), s = Math.round(((e == null ? void 0 : e.percentageEstimateOfBook) ?? 0) * 100), c = (a) => a != null && a.subChapter ? `${a.title} / ${c(a.subChapter)}` : (a == null ? void 0 : a.title) || "", u = c(e == null ? void 0 : e.beginChapterInfo);
725
+ totalApproximatePages: l,
726
+ beginAndEndAreDifferent: i
727
+ } = pe(), s = Math.round(((e == null ? void 0 : e.percentageEstimateOfBook) ?? 0) * 100), c = (a) => a != null && a.subChapter ? `${a.title} / ${c(a.subChapter)}` : (a == null ? void 0 : a.title) || "", u = c(e == null ? void 0 : e.beginChapterInfo);
726
728
  return /* @__PURE__ */ d(P, { alignItems: "center", gap: 1, maxW: "100%", overflow: "auto", children: [
727
- /* @__PURE__ */ t(Yt, { value: s, size: "xs", width: 150, children: /* @__PURE__ */ d(E, { justifyContent: "space-between", children: [
729
+ /* @__PURE__ */ t(Ut, { value: s, size: "xs", width: 150, children: /* @__PURE__ */ d(E, { justifyContent: "space-between", children: [
728
730
  /* @__PURE__ */ t(Vt, { width: 110 }),
729
- /* @__PURE__ */ t(Ut, { children: `${s}%` })
731
+ /* @__PURE__ */ t(qt, { children: `${s}%` })
730
732
  ] }) }),
731
733
  /* @__PURE__ */ t(p, { truncate: !0, maxWidth: "100%", fontSize: "sm", mt: 1, children: u ? `Chapter: ${u}` : " " }),
732
734
  !n && /* @__PURE__ */ d(E, { children: [
733
- /* @__PURE__ */ t(p, { fontSize: "xs", children: l ? `${o + 1} - ${r + 1} of ${i}` : `${o + 1} of ${i}` }),
735
+ /* @__PURE__ */ t(p, { fontSize: "xs", children: i ? `${o + 1} - ${r + 1} of ${l}` : `${o + 1} of ${l}` }),
734
736
  !!(e != null && e.hasChapters) && /* @__PURE__ */ d(Z, { children: [
735
737
  /* @__PURE__ */ t(p, { children: "-" }),
736
738
  /* @__PURE__ */ d(p, { fontSize: "xs", children: [
@@ -741,13 +743,13 @@ const Yt = K.Root, Ut = K.ValueText, me = () => {
741
743
  ] })
742
744
  ] })
743
745
  ] });
744
- }, Re = m(
746
+ }, Re = f(
745
747
  ({
746
748
  children: e,
747
749
  position: n,
748
750
  ...o
749
751
  }) => /* @__PURE__ */ t(
750
- W,
752
+ X,
751
753
  {
752
754
  display: "flex",
753
755
  flexDirection: "row",
@@ -771,7 +773,7 @@ const Yt = K.Root, Ut = K.ValueText, me = () => {
771
773
  children: e
772
774
  }
773
775
  )
774
- ), Qt = Ye(pt), Kt = m((e) => /* @__PURE__ */ t(
776
+ ), Kt = Ue(ft), Wt = f((e) => /* @__PURE__ */ t(
775
777
  R,
776
778
  {
777
779
  display: "contents",
@@ -781,7 +783,7 @@ const Yt = K.Root, Ut = K.ValueText, me = () => {
781
783
  "--color-solid": "colors.colorPalette.solid"
782
784
  },
783
785
  children: /* @__PURE__ */ t(
784
- Qt,
786
+ Kt,
785
787
  {
786
788
  keyboard: !1,
787
789
  style: {
@@ -825,29 +827,29 @@ const Yt = K.Root, Ut = K.ValueText, me = () => {
825
827
  }
826
828
  )
827
829
  }
828
- )), Wt = () => {
829
- const e = U(), n = e == null ? void 0 : e.isUsingSpread, { beginPageIndex: o, totalApproximatePages: r = 0 } = me(), i = n ? Math.floor((o || 0) / 2) : o, [l, s] = ve(
830
- () => ee({
831
- default: i || 0
830
+ )), Xt = () => {
831
+ const e = U(), n = e == null ? void 0 : e.isUsingSpread, { beginPageIndex: o, totalApproximatePages: r = 0 } = pe(), l = n ? Math.floor((o || 0) / 2) : o, [i, s] = xe(
832
+ () => ae({
833
+ default: l || 0
832
834
  })
833
835
  ), c = 0, u = Math.max(
834
836
  0,
835
837
  n ? Math.floor((r - 1) / 2) : r - 1
836
838
  );
837
839
  return J(() => {
838
- s.update(i || 0);
839
- }, [i, s]), {
840
- value: l,
840
+ s.update(l || 0);
841
+ }, [l, s]), {
842
+ value: i,
841
843
  valueSignal: s,
842
844
  min: c,
843
845
  max: u
844
846
  };
845
- }, Xt = (e) => {
846
- const n = C(), o = U(), { manifest: r } = x(() => n == null ? void 0 : n.context.state$, [n]) ?? {}, i = (r == null ? void 0 : r.readingDirection) === "rtl", l = o == null ? void 0 : o.isUsingSpread, { totalApproximatePages: s = 0, isBeginWithinChapter: c } = me(), u = 1, a = c, { value: g, valueSignal: h, min: f, max: v } = Wt(), w = q(
847
+ }, Zt = (e) => {
848
+ const n = C(), o = U(), { manifest: r } = x(() => n == null ? void 0 : n.context.state$, [n]) ?? {}, l = (r == null ? void 0 : r.readingDirection) === "rtl", i = o == null ? void 0 : o.isUsingSpread, { totalApproximatePages: s = 0, isBeginWithinChapter: c } = pe(), u = 1, a = c, { value: g, valueSignal: h, min: m, max: v } = Xt(), w = q(
847
849
  (O) => {
848
- const [k = 0] = Array.isArray(O) ? O : [O];
849
- h.setValue(k);
850
- const D = l ? Math.floor(k) * 2 : Math.floor(k);
850
+ const [I = 0] = Array.isArray(O) ? O : [O];
851
+ h.setValue(I);
852
+ const D = i ? Math.floor(I) * 2 : Math.floor(I);
851
853
  a ? n == null || n.navigation.goToPageOfSpineItem({
852
854
  pageIndex: D,
853
855
  spineItemId: n.pagination.state.beginSpineItemIndex ?? 0,
@@ -857,7 +859,7 @@ const Yt = K.Root, Ut = K.ValueText, me = () => {
857
859
  animation: !1
858
860
  });
859
861
  },
860
- [n, l, h, a]
862
+ [n, i, h, a]
861
863
  );
862
864
  return M(
863
865
  () => n == null ? void 0 : n.navigation.throttleLock({
@@ -865,24 +867,24 @@ const Yt = K.Root, Ut = K.ValueText, me = () => {
865
867
  trigger: h.subject
866
868
  }),
867
869
  [n, h]
868
- ), s === 1 || l && s === 2 ? /* @__PURE__ */ t(R, { style: e.style }) : /* @__PURE__ */ t(
869
- Kt,
870
+ ), s === 1 || i && s === 2 ? /* @__PURE__ */ t(R, { style: e.style }) : /* @__PURE__ */ t(
871
+ Wt,
870
872
  {
871
873
  value: [g],
872
874
  max: v,
873
- min: f,
874
- reverse: i,
875
+ min: m,
876
+ reverse: l,
875
877
  step: u,
876
878
  onChange: w,
877
879
  ...e
878
880
  }
879
881
  );
880
- }, Zt = m(
882
+ }, Jt = f(
881
883
  ({
882
884
  open: e,
883
885
  onItemClick: n
884
886
  }) => {
885
- const o = C(), r = x(() => o == null ? void 0 : o.navigation.state$, [o]), i = x(() => o == null ? void 0 : o.settings.values$, [o]), l = (i == null ? void 0 : i.computedPageTurnDirection) === "vertical", [s, c] = I(!0);
887
+ const o = C(), r = x(() => o == null ? void 0 : o.navigation.state$, [o]), l = x(() => o == null ? void 0 : o.settings.values$, [o]), i = (l == null ? void 0 : l.computedPageTurnDirection) === "vertical", [s, c] = S(!0);
886
888
  return /* @__PURE__ */ d(
887
889
  Re,
888
890
  {
@@ -903,7 +905,7 @@ const Yt = K.Root, Ut = K.ValueText, me = () => {
903
905
  flexShrink: 0,
904
906
  onClick: () => o == null ? void 0 : o.navigation.goToLeftOrTopSpineItem(),
905
907
  disabled: !(r != null && r.canGoLeftSpineItem) && !(r != null && r.canGoTopSpineItem),
906
- children: l ? /* @__PURE__ */ t(ct, {}) : /* @__PURE__ */ t(dt, {})
908
+ children: i ? /* @__PURE__ */ t(dt, {}) : /* @__PURE__ */ t(ht, {})
907
909
  }
908
910
  ),
909
911
  /* @__PURE__ */ d(
@@ -916,9 +918,9 @@ const Yt = K.Root, Ut = K.ValueText, me = () => {
916
918
  overflow: "auto",
917
919
  px: 4,
918
920
  children: [
919
- /* @__PURE__ */ t(qt, {}),
921
+ /* @__PURE__ */ t(Qt, {}),
920
922
  /* @__PURE__ */ t(
921
- Xt,
923
+ Zt,
922
924
  {
923
925
  style: {
924
926
  width: "100%",
@@ -941,12 +943,12 @@ const Yt = K.Root, Ut = K.ValueText, me = () => {
941
943
  onClick: () => {
942
944
  o == null || o.navigation.goToRightOrBottomSpineItem();
943
945
  },
944
- children: l ? /* @__PURE__ */ t(ht, {}) : /* @__PURE__ */ t(ut, {})
946
+ children: i ? /* @__PURE__ */ t(ut, {}) : /* @__PURE__ */ t(gt, {})
945
947
  }
946
948
  )
947
949
  ] }),
948
- /* @__PURE__ */ t(E, { alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ d(
949
- re.Root,
950
+ /* @__PURE__ */ t(E, { alignSelf: "stretch", alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ d(
951
+ oe.Root,
950
952
  {
951
953
  open: s,
952
954
  flex: 1,
@@ -955,14 +957,14 @@ const Yt = K.Root, Ut = K.ValueText, me = () => {
955
957
  },
956
958
  children: [
957
959
  /* @__PURE__ */ t(
958
- re.Trigger,
960
+ oe.Trigger,
959
961
  {
960
962
  paddingY: "3",
961
963
  width: "100%",
962
964
  display: "flex",
963
965
  justifyContent: "center",
964
966
  children: /* @__PURE__ */ t(
965
- We,
967
+ Xe,
966
968
  {
967
969
  style: {
968
970
  transform: s ? "rotate(0deg)" : "rotate(180deg)"
@@ -971,7 +973,7 @@ const Yt = K.Root, Ut = K.ValueText, me = () => {
971
973
  )
972
974
  }
973
975
  ),
974
- /* @__PURE__ */ d(re.Content, { display: "flex", justifyContent: "center", children: [
976
+ /* @__PURE__ */ d(oe.Content, { display: "flex", justifyContent: "center", children: [
975
977
  /* @__PURE__ */ t(
976
978
  b,
977
979
  {
@@ -979,7 +981,7 @@ const Yt = K.Root, Ut = K.ValueText, me = () => {
979
981
  size: "lg",
980
982
  variant: "ghost",
981
983
  onClick: () => n("help"),
982
- children: /* @__PURE__ */ t(Xe, {})
984
+ children: /* @__PURE__ */ t(Ze, {})
983
985
  }
984
986
  ),
985
987
  /* @__PURE__ */ t(
@@ -989,7 +991,7 @@ const Yt = K.Root, Ut = K.ValueText, me = () => {
989
991
  size: "lg",
990
992
  variant: "ghost",
991
993
  onClick: () => n("toc"),
992
- children: /* @__PURE__ */ t(Ze, {})
994
+ children: /* @__PURE__ */ t(Je, {})
993
995
  }
994
996
  ),
995
997
  we(o) && /* @__PURE__ */ t(
@@ -999,17 +1001,17 @@ const Yt = K.Root, Ut = K.ValueText, me = () => {
999
1001
  size: "lg",
1000
1002
  variant: "ghost",
1001
1003
  onClick: () => n("search"),
1002
- children: /* @__PURE__ */ t(Je, {})
1004
+ children: /* @__PURE__ */ t(et, {})
1003
1005
  }
1004
1006
  ),
1005
- ge(o) && /* @__PURE__ */ t(
1007
+ ue(o) && /* @__PURE__ */ t(
1006
1008
  b,
1007
1009
  {
1008
1010
  "aria-label": "Search",
1009
1011
  size: "lg",
1010
1012
  variant: "ghost",
1011
1013
  onClick: () => n("bookmarks"),
1012
- children: /* @__PURE__ */ t(rt, {})
1014
+ children: /* @__PURE__ */ t(it, {})
1013
1015
  }
1014
1016
  ),
1015
1017
  Te(o) && /* @__PURE__ */ t(
@@ -1019,7 +1021,7 @@ const Yt = K.Root, Ut = K.ValueText, me = () => {
1019
1021
  size: "lg",
1020
1022
  variant: "ghost",
1021
1023
  onClick: () => n("annotations"),
1022
- children: /* @__PURE__ */ t(ae, {})
1024
+ children: /* @__PURE__ */ t(le, {})
1023
1025
  }
1024
1026
  ),
1025
1027
  /* @__PURE__ */ t(
@@ -1033,7 +1035,7 @@ const Yt = K.Root, Ut = K.ValueText, me = () => {
1033
1035
  viewportMode: (o == null ? void 0 : o.settings.values.viewportMode) === "normal" ? "thumbnails" : "normal"
1034
1036
  });
1035
1037
  },
1036
- children: /* @__PURE__ */ t(et, {})
1038
+ children: /* @__PURE__ */ t(tt, {})
1037
1039
  }
1038
1040
  ),
1039
1041
  Pe(o) && /* @__PURE__ */ t(
@@ -1043,7 +1045,7 @@ const Yt = K.Root, Ut = K.ValueText, me = () => {
1043
1045
  size: "lg",
1044
1046
  variant: "ghost",
1045
1047
  onClick: () => n("gallery"),
1046
- children: /* @__PURE__ */ t(at, {})
1048
+ children: /* @__PURE__ */ t(ct, {})
1047
1049
  }
1048
1050
  )
1049
1051
  ] })
@@ -1054,8 +1056,8 @@ const Yt = K.Root, Ut = K.ValueText, me = () => {
1054
1056
  }
1055
1057
  );
1056
1058
  }
1057
- ), Jt = () => {
1058
- const [e, n] = I(!1), o = q(() => document.fullscreenElement ? document.exitFullscreen().catch(console.error).then(() => {
1059
+ ), en = () => {
1060
+ const [e, n] = S(!1), o = q(() => document.fullscreenElement ? document.exitFullscreen().catch(console.error).then(() => {
1059
1061
  n(!1);
1060
1062
  }) : document.documentElement.requestFullscreen({ navigationUI: "hide" }).catch(console.error).then(() => {
1061
1063
  n(!0);
@@ -1071,12 +1073,12 @@ const Yt = K.Root, Ut = K.ValueText, me = () => {
1071
1073
  isFullscreen: e,
1072
1074
  onToggleFullscreenClick: o
1073
1075
  };
1074
- }, en = m(
1076
+ }, tn = f(
1075
1077
  ({
1076
1078
  open: e,
1077
1079
  onItemClick: n
1078
1080
  }) => {
1079
- const o = C(), r = x(() => o == null ? void 0 : o.context.manifest$, [o]), { isFullscreen: i, onToggleFullscreenClick: l } = Jt();
1081
+ const o = C(), r = x(() => o == null ? void 0 : o.context.manifest$, [o]), { isFullscreen: l, onToggleFullscreenClick: i } = en();
1080
1082
  return /* @__PURE__ */ d(
1081
1083
  Re,
1082
1084
  {
@@ -1117,7 +1119,7 @@ const Yt = K.Root, Ut = K.ValueText, me = () => {
1117
1119
  flexShrink: 0,
1118
1120
  variant: "ghost",
1119
1121
  onClick: () => n("more"),
1120
- children: /* @__PURE__ */ t(ft, {})
1122
+ children: /* @__PURE__ */ t(bt, {})
1121
1123
  }
1122
1124
  ),
1123
1125
  /* @__PURE__ */ t(
@@ -1127,8 +1129,8 @@ const Yt = K.Root, Ut = K.ValueText, me = () => {
1127
1129
  size: "lg",
1128
1130
  flexShrink: 0,
1129
1131
  variant: "ghost",
1130
- onClick: l,
1131
- children: i ? /* @__PURE__ */ t(bt, {}) : /* @__PURE__ */ t(xt, {})
1132
+ onClick: i,
1133
+ children: l ? /* @__PURE__ */ t(xt, {}) : /* @__PURE__ */ t(Ct, {})
1132
1134
  }
1133
1135
  )
1134
1136
  ] })
@@ -1136,24 +1138,24 @@ const Yt = K.Root, Ut = K.ValueText, me = () => {
1136
1138
  }
1137
1139
  );
1138
1140
  }
1139
- ), tn = m(
1141
+ ), nn = f(
1140
1142
  ({
1141
1143
  onItemClick: e
1142
1144
  }) => {
1143
- const [n] = pe();
1145
+ const [n] = ge();
1144
1146
  return /* @__PURE__ */ d(Z, { children: [
1145
- /* @__PURE__ */ t(en, { open: n, onItemClick: e }),
1146
- /* @__PURE__ */ t(Zt, { open: n, onItemClick: e })
1147
+ /* @__PURE__ */ t(tn, { open: n, onItemClick: e }),
1148
+ /* @__PURE__ */ t(Jt, { open: n, onItemClick: e })
1147
1149
  ] });
1148
1150
  }
1149
- ), nn = m(
1151
+ ), on = f(
1150
1152
  ({
1151
1153
  contextText: e = "",
1152
1154
  startOffset: n = 0,
1153
1155
  text: o,
1154
1156
  cfi: r = "#",
1155
- onClick: i,
1156
- absolutePageIndex: l
1157
+ onClick: l,
1158
+ absolutePageIndex: i
1157
1159
  }) => {
1158
1160
  const c = e.substring(
1159
1161
  Math.max(n - 15, 0),
@@ -1166,12 +1168,12 @@ const Yt = K.Root, Ut = K.ValueText, me = () => {
1166
1168
  )
1167
1169
  );
1168
1170
  return /* @__PURE__ */ d(
1169
- oe,
1171
+ ne,
1170
1172
  {
1171
1173
  href: r,
1172
1174
  style: { margin: 5, overflow: "hidden" },
1173
1175
  onClick: (a) => {
1174
- a.preventDefault(), i(r);
1176
+ a.preventDefault(), l(r);
1175
1177
  },
1176
1178
  display: "flex",
1177
1179
  flexDirection: "column",
@@ -1185,16 +1187,16 @@ const Yt = K.Root, Ut = K.ValueText, me = () => {
1185
1187
  u,
1186
1188
  '"'
1187
1189
  ] }),
1188
- /* @__PURE__ */ t(p, { fontSize: "sm", color: "gray.500", style: { textDecoration: "none" }, children: `Book page: ${l !== void 0 ? l + 1 : "unknown (not loaded)"}` })
1190
+ /* @__PURE__ */ t(p, { fontSize: "sm", color: "gray.500", style: { textDecoration: "none" }, children: `Book page: ${i !== void 0 ? i + 1 : "unknown (not loaded)"}` })
1189
1191
  ]
1190
1192
  }
1191
1193
  );
1192
1194
  }
1193
- ), on = m(
1195
+ ), rn = f(
1194
1196
  ({
1195
1197
  onNavigate: e
1196
1198
  }) => {
1197
- const [n, o] = I(""), r = C(), i = we(r) ? r : void 0, l = (h) => {
1199
+ const [n, o] = S(""), r = C(), l = we(r) ? r : void 0, i = (h) => {
1198
1200
  o(h.target.value);
1199
1201
  }, s = q(
1200
1202
  (h) => {
@@ -1202,9 +1204,9 @@ const Yt = K.Root, Ut = K.ValueText, me = () => {
1202
1204
  },
1203
1205
  [r, e]
1204
1206
  ), c = x(
1205
- () => i == null ? void 0 : i.search.search(n).pipe(
1206
- ne((h) => ({ type: "end", data: h })),
1207
- ye({ type: "start" })
1207
+ () => l == null ? void 0 : l.search.search(n).pipe(
1208
+ te((h) => ({ type: "end", data: h })),
1209
+ Ce({ type: "start" })
1208
1210
  ),
1209
1211
  [r, n]
1210
1212
  ), u = (c == null ? void 0 : c.type) === "start", a = (c == null ? void 0 : c.type) === "end" ? c.data : [], g = x(
@@ -1213,11 +1215,11 @@ const Yt = K.Root, Ut = K.ValueText, me = () => {
1213
1215
  );
1214
1216
  return /* @__PURE__ */ d(P, { flex: 1, height: "100%", children: [
1215
1217
  /* @__PURE__ */ t(R, { px: 4, children: /* @__PURE__ */ t(
1216
- Ue,
1218
+ qe,
1217
1219
  {
1218
1220
  placeholder: "Type something...",
1219
1221
  value: n,
1220
- onChange: l,
1222
+ onChange: i,
1221
1223
  borderRadius: 0
1222
1224
  }
1223
1225
  ) }),
@@ -1233,24 +1235,24 @@ const Yt = K.Root, Ut = K.ValueText, me = () => {
1233
1235
  u && /* @__PURE__ */ t(p, { children: "Searching ..." }),
1234
1236
  !u && a.length === 0 && /* @__PURE__ */ t("p", { children: "There are no results" }),
1235
1237
  !u && a.length >= 0 && /* @__PURE__ */ d(P, { children: [
1236
- /* @__PURE__ */ d(se, { as: "h2", size: "md", children: [
1238
+ /* @__PURE__ */ d(ie, { as: "h2", size: "md", children: [
1237
1239
  a.length,
1238
1240
  " result(s)"
1239
1241
  ] }),
1240
- /* @__PURE__ */ t(P, { gap: 0, children: g == null ? void 0 : g.map((h, f) => {
1241
- var v, w, z, O, k, D, T;
1242
+ /* @__PURE__ */ t(P, { gap: 0, children: g == null ? void 0 : g.map((h, m) => {
1243
+ var v, w, z, O, I, D, T;
1242
1244
  return /* @__PURE__ */ t(
1243
- nn,
1245
+ on,
1244
1246
  {
1245
1247
  contextText: ((z = (w = (v = h.meta) == null ? void 0 : v.range) == null ? void 0 : w.startContainer.parentElement) == null ? void 0 : z.textContent) ?? "",
1246
1248
  pageIndex: (O = h.meta) == null ? void 0 : O.itemPageIndex,
1247
- startOffset: ((D = (k = h.meta) == null ? void 0 : k.range) == null ? void 0 : D.startOffset) ?? 0,
1249
+ startOffset: ((D = (I = h.meta) == null ? void 0 : I.range) == null ? void 0 : D.startOffset) ?? 0,
1248
1250
  text: n,
1249
1251
  cfi: h.meta.cfi,
1250
1252
  onClick: s,
1251
1253
  absolutePageIndex: (T = h.meta) == null ? void 0 : T.absolutePageIndex
1252
1254
  },
1253
- f
1255
+ m
1254
1256
  );
1255
1257
  }) })
1256
1258
  ] })
@@ -1259,7 +1261,7 @@ const Yt = K.Root, Ut = K.ValueText, me = () => {
1259
1261
  )
1260
1262
  ] });
1261
1263
  }
1262
- ), rn = m(
1264
+ ), ln = f(
1263
1265
  ({
1264
1266
  open: e,
1265
1267
  setOpen: n,
@@ -1274,27 +1276,27 @@ const Yt = K.Root, Ut = K.ValueText, me = () => {
1274
1276
  size: { mdDown: "full", md: "lg" },
1275
1277
  scrollBehavior: "inside",
1276
1278
  children: /* @__PURE__ */ d($, { height: "100%", children: [
1277
- /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(V, { children: "Search" }) }),
1278
- /* @__PURE__ */ t(G, { flex: 1, children: /* @__PURE__ */ t(on, { onNavigate: o }) }),
1279
- /* @__PURE__ */ t(H, { children: /* @__PURE__ */ t(Y, { asChild: !0, children: /* @__PURE__ */ t(_, { variant: "outline", children: "Cancel" }) }) }),
1279
+ /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(Y, { children: "Search" }) }),
1280
+ /* @__PURE__ */ t(G, { flex: 1, children: /* @__PURE__ */ t(rn, { onNavigate: o }) }),
1281
+ /* @__PURE__ */ t(H, { children: /* @__PURE__ */ t(V, { asChild: !0, children: /* @__PURE__ */ t(_, { variant: "outline", children: "Cancel" }) }) }),
1280
1282
  /* @__PURE__ */ t(N, {})
1281
1283
  ] })
1282
1284
  }
1283
1285
  )
1284
- ), ln = m(
1286
+ ), sn = f(
1285
1287
  ({
1286
1288
  onNavigate: e
1287
1289
  }) => {
1288
- const n = C(), { manifest: o, assumedRenditionLayout: r } = x(() => n == null ? void 0 : n.context.state$, [n]) ?? {}, { nav: i } = o ?? {}, l = U();
1289
- i != null && i.toc;
1290
- const { beginSpineItemIndex: s, beginPageIndexInSpineItem: c } = l ?? {}, u = (r === "reflowable" ? c : s) || 0;
1290
+ const n = C(), { manifest: o, assumedRenditionLayout: r } = x(() => n == null ? void 0 : n.context.state$, [n]) ?? {}, { nav: l } = o ?? {}, i = U();
1291
+ l != null && l.toc;
1292
+ const { beginSpineItemIndex: s, beginPageIndexInSpineItem: c } = i ?? {}, u = (r === "reflowable" ? c : s) || 0;
1291
1293
  console.log({ assumedRenditionLayout: r, currentSpineItemOrChapterPageIndex: u });
1292
- let a = l == null ? void 0 : l.beginChapterInfo;
1294
+ let a = i == null ? void 0 : i.beginChapterInfo;
1293
1295
  for (; a != null && a.subChapter; )
1294
1296
  a = a == null ? void 0 : a.subChapter;
1295
- const g = (h, f, v) => /* @__PURE__ */ d(Oe.Fragment, { children: [
1297
+ const g = (h, m, v) => /* @__PURE__ */ d(Oe.Fragment, { children: [
1296
1298
  /* @__PURE__ */ t(
1297
- S.Item,
1299
+ k.Item,
1298
1300
  {
1299
1301
  pl: 4 * (v + 1),
1300
1302
  style: {
@@ -1302,15 +1304,15 @@ const Yt = K.Root, Ut = K.ValueText, me = () => {
1302
1304
  alignItems: "center"
1303
1305
  },
1304
1306
  children: /* @__PURE__ */ d(
1305
- oe,
1307
+ ne,
1306
1308
  {
1307
1309
  onClick: () => {
1308
1310
  e(), n == null || n.navigation.goToUrl(h.href);
1309
1311
  },
1310
1312
  href: "#",
1311
1313
  children: [
1312
- (a == null ? void 0 : a.path) === h.path && /* @__PURE__ */ t(S.Indicator, { asChild: !0, children: /* @__PURE__ */ t(be, {}) }),
1313
- (a == null ? void 0 : a.path) !== h.path && /* @__PURE__ */ t(S.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ t(be, {}) }),
1314
+ (a == null ? void 0 : a.path) === h.path && /* @__PURE__ */ t(k.Indicator, { asChild: !0, children: /* @__PURE__ */ t(me, {}) }),
1315
+ (a == null ? void 0 : a.path) !== h.path && /* @__PURE__ */ t(k.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ t(me, {}) }),
1314
1316
  /* @__PURE__ */ d(P, { gap: 0, children: [
1315
1317
  /* @__PURE__ */ t(p, { fontSize: "md", children: h.title || h.path }),
1316
1318
  (a == null ? void 0 : a.path) === h.path && /* @__PURE__ */ t(
@@ -1328,13 +1330,13 @@ const Yt = K.Root, Ut = K.ValueText, me = () => {
1328
1330
  )
1329
1331
  }
1330
1332
  ),
1331
- h.contents.length > 0 && /* @__PURE__ */ t(S.Root, { as: "div", gap: 2, children: h.contents.map(
1333
+ h.contents.length > 0 && /* @__PURE__ */ t(k.Root, { as: "div", gap: 2, children: h.contents.map(
1332
1334
  (w, z) => g(w, z, v + 1)
1333
1335
  ) })
1334
- ] }, f);
1335
- return /* @__PURE__ */ t(S.Root, { gap: 3, overflowY: "auto", py: 4, flex: 1, children: i == null ? void 0 : i.toc.map((h, f) => g(h, f, 0)) });
1336
+ ] }, m);
1337
+ return /* @__PURE__ */ t(k.Root, { gap: 3, overflowY: "auto", py: 4, flex: 1, children: l == null ? void 0 : l.toc.map((h, m) => g(h, m, 0)) });
1336
1338
  }
1337
- ), sn = m(
1339
+ ), an = f(
1338
1340
  ({
1339
1341
  open: e,
1340
1342
  setOpen: n,
@@ -1349,87 +1351,87 @@ const Yt = K.Root, Ut = K.ValueText, me = () => {
1349
1351
  size: { mdDown: "full", md: "lg" },
1350
1352
  scrollBehavior: "inside",
1351
1353
  children: /* @__PURE__ */ d($, { children: [
1352
- /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(V, { children: "Table of Contents" }) }),
1353
- /* @__PURE__ */ t(G, { overflowY: "auto", flex: 1, children: /* @__PURE__ */ t(ln, { onNavigate: o }) }),
1354
- /* @__PURE__ */ t(H, { children: /* @__PURE__ */ t(Y, { asChild: !0, children: /* @__PURE__ */ t(_, { variant: "outline", children: "Cancel" }) }) }),
1354
+ /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(Y, { children: "Table of Contents" }) }),
1355
+ /* @__PURE__ */ t(G, { overflowY: "auto", flex: 1, children: /* @__PURE__ */ t(sn, { onNavigate: o }) }),
1356
+ /* @__PURE__ */ t(H, { children: /* @__PURE__ */ t(V, { asChild: !0, children: /* @__PURE__ */ t(_, { variant: "outline", children: "Cancel" }) }) }),
1355
1357
  /* @__PURE__ */ t(N, {})
1356
1358
  ] })
1357
1359
  }
1358
1360
  )
1359
- ), wn = ({
1361
+ ), Tn = ({
1360
1362
  enableFloatingTime: e = !0,
1361
1363
  enableFloatingProgress: n = !0,
1362
1364
  onItemClick: o
1363
1365
  }) => {
1364
- const [r, i] = I(!1), [l, s] = I(!1), [c, u] = I(!1), [a, g] = I(!1), [h, f] = I(!1), [v, w] = I(!1), [z, O] = pe(), k = q(() => {
1365
- i(!1), s(!1), u(!1), g(!1), f(!1), O(!1), w(!1);
1366
+ const [r, l] = S(!1), [i, s] = S(!1), [c, u] = S(!1), [a, g] = S(!1), [h, m] = S(!1), [v, w] = S(!1), [z, O] = ge(), I = q(() => {
1367
+ l(!1), s(!1), u(!1), g(!1), m(!1), O(!1), w(!1);
1366
1368
  }, [O]), D = q(
1367
1369
  (T) => {
1368
- T === "annotations" ? g(!0) : T === "search" ? u(!0) : T === "help" ? s(!0) : T === "toc" ? i(!0) : T === "bookmarks" ? f(!0) : T === "gallery" && w(!0), o == null || o(T);
1370
+ T === "annotations" ? g(!0) : T === "search" ? u(!0) : T === "help" ? s(!0) : T === "toc" ? l(!0) : T === "bookmarks" ? m(!0) : T === "gallery" && w(!0), o == null || o(T);
1369
1371
  },
1370
1372
  [o]
1371
1373
  );
1372
- return $t(), Ht(), /* @__PURE__ */ d(Z, { children: [
1374
+ return Nt(), jt(), /* @__PURE__ */ d(Z, { children: [
1373
1375
  n && /* @__PURE__ */ t(
1374
- W,
1376
+ X,
1375
1377
  {
1376
1378
  present: !z,
1377
1379
  animationName: { _open: "fade-in", _closed: "fade-out" },
1378
1380
  animationDuration: "moderate",
1379
- children: /* @__PURE__ */ t(Mt, {})
1381
+ children: /* @__PURE__ */ t(_t, {})
1380
1382
  }
1381
1383
  ),
1382
- /* @__PURE__ */ t(zt, { open: v, setOpen: w }),
1383
- /* @__PURE__ */ t(tn, { onItemClick: D }),
1384
+ /* @__PURE__ */ t(Dt, { open: v, setOpen: w }),
1385
+ /* @__PURE__ */ t(nn, { onItemClick: D }),
1384
1386
  /* @__PURE__ */ t(It, {}),
1385
- /* @__PURE__ */ t(At, { open: l, setOpen: s }),
1387
+ /* @__PURE__ */ t(Mt, { open: i, setOpen: s }),
1386
1388
  /* @__PURE__ */ t(
1387
- sn,
1389
+ an,
1388
1390
  {
1389
1391
  open: r,
1390
- setOpen: i,
1391
- onNavigate: k
1392
+ setOpen: l,
1393
+ onNavigate: I
1392
1394
  }
1393
1395
  ),
1394
1396
  /* @__PURE__ */ t(
1395
- rn,
1397
+ ln,
1396
1398
  {
1397
1399
  open: c,
1398
1400
  setOpen: u,
1399
- onNavigate: k
1401
+ onNavigate: I
1400
1402
  }
1401
1403
  ),
1402
1404
  /* @__PURE__ */ t(
1403
- yt,
1405
+ St,
1404
1406
  {
1405
1407
  open: a,
1406
1408
  setOpen: g,
1407
- onNavigate: k
1409
+ onNavigate: I
1408
1410
  }
1409
1411
  ),
1410
1412
  /* @__PURE__ */ t(
1411
- St,
1413
+ wt,
1412
1414
  {
1413
1415
  open: h,
1414
- setOpen: f,
1415
- onNavigate: k
1416
+ setOpen: m,
1417
+ onNavigate: I
1416
1418
  }
1417
1419
  ),
1418
1420
  /* @__PURE__ */ t(
1419
- W,
1421
+ X,
1420
1422
  {
1421
1423
  present: e || z,
1422
1424
  animationName: { _open: "fade-in", _closed: "fade-out" },
1423
1425
  animationDuration: "slow",
1424
1426
  overflow: "hidden",
1425
- children: /* @__PURE__ */ t(Bt, {})
1427
+ children: /* @__PURE__ */ t($t, {})
1426
1428
  }
1427
1429
  ),
1428
- /* @__PURE__ */ t(wt, {})
1430
+ /* @__PURE__ */ t(Tt, {})
1429
1431
  ] });
1430
1432
  };
1431
1433
  export {
1432
- wn as ReactReader,
1433
- Sn as ReactReaderProvider
1434
+ Tn as ReactReader,
1435
+ wn as ReactReaderProvider
1434
1436
  };
1435
1437
  //# sourceMappingURL=index.js.map