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