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