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