@prose-reader/react-reader 1.252.0 → 1.253.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,137 +1,219 @@
1
- import { jsx as e, jsxs as s, Fragment as be } from "react/jsx-runtime";
2
- import * as T from "react";
3
- import Ne, { createContext as Ve, memo as f, useMemo as Pe, useEffect as H, useContext as Ge, useState as y, useLayoutEffect as je, useCallback as ne, useRef as qe } from "react";
4
- import { signal as L, useConstant as ee, useLiveRef as Ye, useSubscribe as N, useObserve as b, isDefined as Be, useSignalValue as ue, useSignalState as Ue } from "reactjrx";
5
- import { Subject as Ae, tap as xe, map as _, filter as le, switchMap as W, EMPTY as ye, of as ce, withLatestFrom as Ze, NEVER as ve, startWith as Qe, distinctUntilChanged as Ce, throttleTime as Ke, first as ze, combineLatest as Xe, mergeMap as Je, skip as Oe, merge as Me, timer as Ee, finalize as et, BehaviorSubject as tt } from "rxjs";
6
- import { IconButton as v, Portal as ke, Dialog as k, List as P, Link as Se, Stack as C, Text as p, Tabs as D, Button as V, Presence as oe, Box as B, createToaster as nt, Toaster as ot, Toast as $, Spinner as rt, Heading as ge, HStack as O, Kbd as Te, Popover as F, Progress as re, chakra as it, Collapsible as pe, Field as J, RadioGroup as te, Slider as R, For as at, Fieldset as fe, Input as st } from "@chakra-ui/react";
7
- import { LuX as lt, LuNotebookPen as de, LuBookmark as ct, LuArrowBigRight as dt, LuArrowBigLeft as ut, LuChevronDown as ht, LuCircleHelp as gt, LuTableOfContents as pt, LuSearch as ft, LuZoomOut as mt, LuZoomIn as bt, LuGalleryHorizontal as xt, LuCircleCheck as we } from "react-icons/lu";
8
- import { createPortal as vt } from "react-dom";
9
- import { isPositionInArea as Ct } from "@prose-reader/enhancer-gestures";
10
- import { isShallowEqual as kt, observeIntersection as St, isHtmlTagElement as It } from "@prose-reader/core";
11
- import { BsBookmarks as Rt } from "react-icons/bs";
12
- import { MdOutlineFitScreen as yt, MdFullscreenExit as Tt, MdFullscreen as wt } from "react-icons/md";
13
- import { RiGalleryView2 as Pt } from "react-icons/ri";
14
- import { RxDoubleArrowUp as Bt, RxDoubleArrowLeft as At, RxDoubleArrowDown as zt, RxDoubleArrowRight as Ot } from "react-icons/rx";
15
- import { HiOutlineInformationCircle as Mt } from "react-icons/hi";
16
- import Et from "rc-slider";
1
+ import { jsxs as l, jsx as e, Fragment as xe } from "react/jsx-runtime";
2
+ import * as w from "react";
3
+ import on, { createContext as rn, useContext as an, useEffect as j, memo as m, useCallback as B, useState as y, useMemo as ln, useLayoutEffect as sn, useRef as cn } from "react";
4
+ import { signal as V, useObserve as f, useConstant as H, useSignalValue as te, isDefined as $e, useSubscribe as ce, useSignalState as dn } from "reactjrx";
5
+ import { Subject as un, map as E, filter as ue, switchMap as N, EMPTY as Ce, of as he, withLatestFrom as hn, NEVER as ke, startWith as pn, distinctUntilChanged as Ie, throttleTime as He, tap as We, first as Ne, combineLatest as gn, mergeMap as fn, Observable as mn, skip as je, merge as qe, timer as Ge, finalize as bn, BehaviorSubject as Sn, animationFrameScheduler as Cn } from "rxjs";
6
+ import { IconButton as v, Portal as ze, Dialog as O, List as A, Link as Oe, Stack as k, Text as g, Tabs as $, Button as q, Presence as ae, Box as F, createToaster as vn, Toaster as xn, Toast as ee, Spinner as kn, Field as re, Slider as R, HStack as _, For as In, Fieldset as W, Heading as be, Kbd as Fe, Popover as ne, Progress as le, chakra as zn, Collapsible as Se, RadioGroup as ie, Input as On } from "@chakra-ui/react";
7
+ import { LuX as Rn, LuNotebookPen as pe, LuBookmark as Mn, LuArrowBigRight as Tn, LuArrowBigLeft as yn, LuChevronDown as wn, LuCircleHelp as Pn, LuTableOfContents as Bn, LuSearch as An, LuZoomOut as En, LuZoomIn as Fn, LuGalleryHorizontal as Dn, LuCircleCheck as De } from "react-icons/lu";
8
+ import { createPortal as Vn } from "react-dom";
9
+ import { isPositionInArea as _n } from "@prose-reader/enhancer-gestures";
10
+ import { isShallowEqual as Ln, observeIntersection as $n, isHtmlTagElement as Hn } from "@prose-reader/core";
11
+ import { BiFontSize as Wn } from "react-icons/bi";
12
+ import { BsBookmarks as Nn } from "react-icons/bs";
13
+ import { MdOutlineFitScreen as jn, MdFullscreenExit as qn, MdFullscreen as Gn } from "react-icons/md";
14
+ import { RiGalleryView2 as Yn } from "react-icons/ri";
15
+ import { RxDoubleArrowUp as Qn, RxDoubleArrowLeft as Un, RxDoubleArrowDown as Zn, RxDoubleArrowRight as Kn } from "react-icons/rx";
16
+ import { HiOutlineInformationCircle as Xn } from "react-icons/hi";
17
+ import Jn from "rc-slider";
17
18
  import "rc-slider/assets/index.css";
18
- import { IoIosArrowBack as Dt, IoMdMore as Lt } from "react-icons/io";
19
- const _t = "data-bookmark-area", De = Ve({
19
+ import { IoIosArrowBack as et, IoMdMore as nt } from "react-icons/io";
20
+ const tt = "data-bookmark-area", Ye = () => ({
20
21
  reader: void 0,
21
- quickMenuSignal: L({ default: !1 }),
22
- quickMenuBottomBarBoundingBox: L({ default: void 0 }),
23
- notificationsSubject: new Ae(),
24
- refitMenuSignal: L({ default: !1 })
25
- }), ao = f(
26
- ({
27
- children: t,
28
- reader: n,
29
- quickMenuOpen: o,
30
- onQuickMenuOpenChange: r
31
- }) => {
32
- const i = ee(
33
- () => L({
34
- default: o
35
- })
36
- ), a = ee(
37
- () => new Ae()
38
- ), l = ee(
39
- () => L({
40
- default: void 0
41
- })
42
- ), c = ee(
43
- () => L({
44
- default: !1
45
- })
46
- ), d = Ye(r), u = Pe(
47
- () => ({
48
- quickMenuSignal: i,
49
- reader: n,
50
- notificationsSubject: a,
51
- refitMenuSignal: c,
52
- quickMenuBottomBarBoundingBox: l
53
- }),
54
- [
55
- i,
56
- n,
57
- a,
58
- c,
59
- l
60
- ]
61
- );
62
- return H(() => {
63
- i.next(o);
64
- }, [o, i]), N(
65
- () => i.pipe(xe(d.current)),
66
- [i, d]
67
- ), /* @__PURE__ */ e(De.Provider, { value: u, children: t });
22
+ quickMenuOpen: !1,
23
+ onQuickMenuOpenChange: () => {
24
+ },
25
+ quickMenuBottomBarBoundingBoxSignal: V({
26
+ default: void 0
27
+ }),
28
+ notificationsSubject: new un(),
29
+ refitMenuOpen: !1,
30
+ onRefitMenuOpenChange: () => {
31
+ },
32
+ fontSizeMenuOpen: !0,
33
+ onFontSizeMenuOpenChange: () => {
34
+ },
35
+ fontSize: 1,
36
+ fontSizeMin: 0.2,
37
+ fontSizeMax: 5,
38
+ fontSizeScopeValue: "book",
39
+ onFontSizeValueChange: () => {
40
+ },
41
+ onFontSizeScopeValueChange: () => {
68
42
  }
69
- ), $t = T.forwardRef(function(n, o) {
70
- return /* @__PURE__ */ e(v, { variant: "ghost", "aria-label": "Close", ref: o, ...n, children: n.children ?? /* @__PURE__ */ e(lt, {}) });
71
- }), G = T.forwardRef(function(n, o) {
43
+ }), Qe = rn(
44
+ V({ default: Ye() })
45
+ ), D = (n) => {
46
+ const t = an(Qe);
47
+ return f(t, n);
48
+ }, b = () => {
49
+ const { reader: n } = D(["reader"]);
50
+ return n;
51
+ }, Ue = (n) => !!n && "__PROSE_READER_ENHANCER_SEARCH" in n, se = (n) => !!n && "__PROSE_READER_ENHANCER_ANNOTATIONS" in n, Ze = (n) => !!n && "__PROSE_READER_ENHANCER_GALLERY" in n, Ke = (n) => !!n && "__PROSE_READER_ENHANCER_REFIT" in n, ot = () => {
52
+ const n = b(), { fontSize: t } = D(["fontSize"]);
53
+ return j(() => {
54
+ if (n && t !== void 0) {
55
+ const o = setTimeout(() => {
56
+ n.settings.update({
57
+ fontScale: t
58
+ });
59
+ }, 200);
60
+ return () => clearTimeout(o);
61
+ }
62
+ }, [n, t]), null;
63
+ }, rt = ({
64
+ children: n,
65
+ onQuickMenuOpenChange: t,
66
+ quickMenuOpen: o,
67
+ fontSizeScope: r,
68
+ onFontSizeScopeValueChange: i,
69
+ fontSize: a,
70
+ onFontSizeValueChange: s,
71
+ ...c
72
+ }) => {
73
+ const d = H(() => V({ default: Ye() })), u = H(
74
+ () => V({ default: d.value.fontSizeMenuOpen })
75
+ ), p = te(
76
+ u
77
+ ), h = B(
78
+ (T) => {
79
+ u.update(T);
80
+ },
81
+ [u]
82
+ ), S = H(
83
+ () => V({ default: d.value.fontSize })
84
+ ), I = te(S), x = B(
85
+ (T) => {
86
+ S.update(T);
87
+ },
88
+ [S]
89
+ ), P = a ?? I, C = s ?? x, z = H(
90
+ () => V({ default: d.value.fontSizeScopeValue })
91
+ ), L = te(
92
+ z
93
+ ), M = B(
94
+ (T) => {
95
+ z.update(T);
96
+ },
97
+ [z]
98
+ ), ye = r ?? L, we = i ?? M, fe = H(
99
+ () => V({ default: d.value.quickMenuOpen })
100
+ ), nn = B(
101
+ (T) => {
102
+ fe.update(T);
103
+ },
104
+ [fe]
105
+ ), tn = te(
106
+ fe
107
+ ), Pe = o ?? tn, Be = t ?? nn, me = H(
108
+ () => V({ default: d.value.refitMenuOpen })
109
+ ), Ae = B(
110
+ (T) => {
111
+ me.update(T);
112
+ },
113
+ [me]
114
+ ), Ee = te(
115
+ me
116
+ );
117
+ return j(() => {
118
+ d.update((T) => ({
119
+ ...T,
120
+ ...c,
121
+ onQuickMenuOpenChange: Be,
122
+ quickMenuOpen: Pe,
123
+ onFontSizeMenuOpenChange: h,
124
+ fontSizeMenuOpen: p,
125
+ onRefitMenuOpenChange: Ae,
126
+ refitMenuOpen: Ee,
127
+ fontSizeScopeValue: ye,
128
+ onFontSizeScopeValueChange: we,
129
+ fontSize: P,
130
+ onFontSizeValueChange: C
131
+ }));
132
+ }, [
133
+ ...Object.values(c),
134
+ Pe,
135
+ Be,
136
+ ye,
137
+ we,
138
+ P,
139
+ C,
140
+ d,
141
+ p,
142
+ h,
143
+ Ee,
144
+ Ae
145
+ ]), /* @__PURE__ */ e(Qe.Provider, { value: d, children: n });
146
+ }, wo = m(
147
+ ({
148
+ children: n,
149
+ ...t
150
+ }) => /* @__PURE__ */ l(rt, { ...t, children: [
151
+ /* @__PURE__ */ e(ot, {}),
152
+ n
153
+ ] })
154
+ ), it = w.forwardRef(function(t, o) {
155
+ return /* @__PURE__ */ e(v, { variant: "ghost", "aria-label": "Close", ref: o, ...t, children: t.children ?? /* @__PURE__ */ e(Rn, {}) });
156
+ }), G = w.forwardRef(function(t, o) {
72
157
  const {
73
158
  children: r,
74
159
  portalled: i = !0,
75
160
  portalRef: a,
76
- backdrop: l = !0,
161
+ backdrop: s = !0,
77
162
  ...c
78
- } = n;
79
- return /* @__PURE__ */ s(ke, { disabled: !i, container: a, children: [
80
- l && /* @__PURE__ */ e(k.Backdrop, {}),
81
- /* @__PURE__ */ e(k.Positioner, { children: /* @__PURE__ */ e(k.Content, { ref: o, ...c, asChild: !1, children: r }) })
163
+ } = t;
164
+ return /* @__PURE__ */ l(ze, { disabled: !i, container: a, children: [
165
+ s && /* @__PURE__ */ e(O.Backdrop, {}),
166
+ /* @__PURE__ */ e(O.Positioner, { children: /* @__PURE__ */ e(O.Content, { ref: o, ...c, asChild: !1, children: r }) })
82
167
  ] });
83
- }), j = T.forwardRef(function(n, o) {
168
+ }), Y = w.forwardRef(function(t, o) {
84
169
  return /* @__PURE__ */ e(
85
- k.CloseTrigger,
170
+ O.CloseTrigger,
86
171
  {
87
172
  position: "absolute",
88
173
  top: "2",
89
174
  insetEnd: "2",
90
- ...n,
175
+ ...t,
91
176
  asChild: !0,
92
- children: /* @__PURE__ */ e($t, { size: "sm", ref: o, children: n.children })
177
+ children: /* @__PURE__ */ e(it, { size: "sm", ref: o, children: t.children })
93
178
  }
94
179
  );
95
- }), q = k.Root, Y = k.Footer, U = k.Header, Z = k.Body;
96
- k.Backdrop;
97
- const Q = k.Title;
98
- k.Description;
99
- k.Trigger;
100
- const K = k.ActionTrigger, E = () => Ge(De), m = () => {
101
- const { reader: t } = E();
102
- return t;
103
- }, Le = (t) => !!t && "__PROSE_READER_ENHANCER_SEARCH" in t, ie = (t) => !!t && "__PROSE_READER_ENHANCER_ANNOTATIONS" in t, _e = (t) => !!t && "__PROSE_READER_ENHANCER_GALLERY" in t, $e = (t) => !!t && "__PROSE_READER_ENHANCER_REFIT" in t, Ft = (t) => {
104
- const n = m(), o = ie(n) ? n : void 0;
105
- return { data: b(
180
+ }), Q = O.Root, U = O.Footer, Z = O.Header, K = O.Body;
181
+ O.Backdrop;
182
+ const X = O.Title;
183
+ O.Description;
184
+ O.Trigger;
185
+ const J = O.ActionTrigger, at = (n) => {
186
+ const t = b(), o = se(t) ? t : void 0;
187
+ return { data: f(
106
188
  () => o?.annotations.annotations$.pipe(
107
- _((i) => i.find((a) => a.id === t)),
108
- le(Be),
109
- W((i) => o.locateResource(i))
189
+ E((i) => i.find((a) => a.id === n)),
190
+ ue($e),
191
+ N((i) => o.locateResource(i))
110
192
  ),
111
193
  [o]
112
194
  ) };
113
- }, Fe = ({
114
- id: t,
115
- onNavigate: n,
195
+ }, Xe = ({
196
+ id: n,
197
+ onNavigate: t,
116
198
  allowLeftIcon: o = !0
117
199
  }) => {
118
- const r = m(), { data: i } = Ft(t), a = i?.meta.range?.toString() || i?.meta.node?.textContent;
119
- return /* @__PURE__ */ e(P.Item, { children: /* @__PURE__ */ s(
120
- Se,
200
+ const r = b(), { data: i } = at(n), a = i?.meta.range?.toString() || i?.meta.node?.textContent;
201
+ return /* @__PURE__ */ e(A.Item, { children: /* @__PURE__ */ l(
202
+ Oe,
121
203
  {
122
204
  href: "#",
123
205
  onClick: () => {
124
- n(), r?.navigation.goToCfi(i?.meta.cfi ?? "");
206
+ t(), r?.navigation.goToCfi(i?.meta.cfi ?? "");
125
207
  },
126
208
  children: [
127
- i?.resource?.notes ? /* @__PURE__ */ e(P.Indicator, { asChild: !0, children: /* @__PURE__ */ e(de, {}) }) : o ? /* @__PURE__ */ e(P.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ e(de, {}) }) : null,
128
- /* @__PURE__ */ s(C, { gap: 0, children: [
129
- a ? /* @__PURE__ */ e(p, { lineClamp: 2, fontSize: "md", children: a }) : /* @__PURE__ */ s(p, { lineClamp: 2, fontSize: "md", fontStyle: "italic", children: [
209
+ i?.resource?.notes ? /* @__PURE__ */ e(A.Indicator, { asChild: !0, children: /* @__PURE__ */ e(pe, {}) }) : o ? /* @__PURE__ */ e(A.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ e(pe, {}) }) : null,
210
+ /* @__PURE__ */ l(k, { gap: 0, children: [
211
+ a ? /* @__PURE__ */ e(g, { lineClamp: 2, fontSize: "md", children: a }) : /* @__PURE__ */ l(g, { lineClamp: 2, fontSize: "md", fontStyle: "italic", children: [
130
212
  "Page ",
131
213
  (i?.meta.absolutePageIndex ?? 0) + 1
132
214
  ] }),
133
215
  /* @__PURE__ */ e(
134
- p,
216
+ g,
135
217
  {
136
218
  fontStyle: "italic",
137
219
  fontWeight: "bold",
@@ -143,155 +225,155 @@ const K = k.ActionTrigger, E = () => Ge(De), m = () => {
143
225
  ]
144
226
  }
145
227
  ) });
146
- }, he = () => {
147
- const t = m(), n = ie(t) ? t : void 0;
148
- return { data: b(
149
- () => n?.annotations.annotations$.pipe(
150
- W(
151
- (r) => n.locateResource(r)
228
+ }, ge = () => {
229
+ const n = b(), t = se(n) ? n : void 0;
230
+ return { data: f(
231
+ () => t?.annotations.annotations$.pipe(
232
+ N(
233
+ (r) => t.locateResource(r)
152
234
  )
153
235
  ),
154
- [n]
236
+ [t]
155
237
  ) };
156
- }, Wt = () => {
157
- const { data: t } = he();
238
+ }, lt = () => {
239
+ const { data: n } = ge();
158
240
  return {
159
- data: t?.filter((n) => n.meta.isCfiRange)
241
+ data: n?.filter((t) => t.meta.isCfiRange)
160
242
  };
161
- }, Ht = ({ onNavigate: t }) => {
162
- const { data: n } = Wt();
163
- return /* @__PURE__ */ e(P.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children: n?.map((o) => /* @__PURE__ */ e(
164
- Fe,
243
+ }, st = ({ onNavigate: n }) => {
244
+ const { data: t } = lt();
245
+ return /* @__PURE__ */ e(A.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children: t?.map((o) => /* @__PURE__ */ e(
246
+ Xe,
165
247
  {
166
248
  id: o.resource.id,
167
- onNavigate: t
249
+ onNavigate: n
168
250
  },
169
251
  o.resource.id
170
252
  )) });
171
- }, Nt = () => {
172
- const { data: t } = he();
253
+ }, ct = () => {
254
+ const { data: n } = ge();
173
255
  return {
174
- data: t?.filter(
175
- (n) => !n.meta.isCfiRange && !n.resource.notes
256
+ data: n?.filter(
257
+ (t) => !t.meta.isCfiRange && !t.resource.notes
176
258
  )
177
259
  };
178
- }, Vt = ({ onNavigate: t }) => {
179
- const { data: n } = Nt();
180
- return /* @__PURE__ */ e(P.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children: n?.map((o) => /* @__PURE__ */ e(
181
- Fe,
260
+ }, dt = ({ onNavigate: n }) => {
261
+ const { data: t } = ct();
262
+ return /* @__PURE__ */ e(A.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children: t?.map((o) => /* @__PURE__ */ e(
263
+ Xe,
182
264
  {
183
265
  id: o.resource.id,
184
- onNavigate: t,
266
+ onNavigate: n,
185
267
  allowLeftIcon: !1
186
268
  },
187
269
  o.resource.id
188
270
  )) });
189
- }, Gt = f(
271
+ }, ut = m(
190
272
  ({
191
- onNavigate: t,
192
- defaultTab: n
273
+ onNavigate: n,
274
+ defaultTab: t
193
275
  }) => {
194
- const [o, r] = y(n ?? "bookmarks");
195
- return /* @__PURE__ */ s(
196
- D.Root,
276
+ const [o, r] = y(t ?? "bookmarks");
277
+ return /* @__PURE__ */ l(
278
+ $.Root,
197
279
  {
198
280
  value: o,
199
281
  onValueChange: (i) => r(i.value),
200
282
  children: [
201
- /* @__PURE__ */ s(D.List, { children: [
202
- /* @__PURE__ */ s(D.Trigger, { value: "bookmarks", children: [
203
- /* @__PURE__ */ e(ct, {}),
283
+ /* @__PURE__ */ l($.List, { children: [
284
+ /* @__PURE__ */ l($.Trigger, { value: "bookmarks", children: [
285
+ /* @__PURE__ */ e(Mn, {}),
204
286
  "Bookmarks"
205
287
  ] }),
206
- /* @__PURE__ */ s(D.Trigger, { value: "annotations", children: [
207
- /* @__PURE__ */ e(de, {}),
288
+ /* @__PURE__ */ l($.Trigger, { value: "annotations", children: [
289
+ /* @__PURE__ */ e(pe, {}),
208
290
  "Annotations"
209
291
  ] }),
210
- /* @__PURE__ */ e(D.Indicator, {})
292
+ /* @__PURE__ */ e($.Indicator, {})
211
293
  ] }),
212
- /* @__PURE__ */ e(D.Content, { value: "bookmarks", children: /* @__PURE__ */ e(Vt, { onNavigate: t }) }),
213
- /* @__PURE__ */ e(D.Content, { value: "annotations", children: /* @__PURE__ */ e(Ht, { onNavigate: t }) })
294
+ /* @__PURE__ */ e($.Content, { value: "bookmarks", children: /* @__PURE__ */ e(dt, { onNavigate: n }) }),
295
+ /* @__PURE__ */ e($.Content, { value: "annotations", children: /* @__PURE__ */ e(st, { onNavigate: n }) })
214
296
  ]
215
297
  }
216
298
  );
217
299
  }
218
- ), jt = f(
300
+ ), ht = m(
219
301
  ({
220
- openWith: t,
221
- setOpen: n,
302
+ openWith: n,
303
+ setOpen: t,
222
304
  onNavigate: o
223
305
  }) => /* @__PURE__ */ e(
224
- q,
306
+ Q,
225
307
  {
226
308
  lazyMount: !0,
227
309
  placement: "center",
228
- open: !!t,
229
- onOpenChange: (r) => n(r.open),
310
+ open: !!n,
311
+ onOpenChange: (r) => t(r.open),
230
312
  size: { mdDown: "full", md: "lg" },
231
313
  scrollBehavior: "inside",
232
- children: /* @__PURE__ */ s(G, { height: "100%", children: [
233
- /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(Q, { children: "Annotations" }) }),
234
- /* @__PURE__ */ e(Z, { flex: 1, children: /* @__PURE__ */ e(
235
- Gt,
314
+ children: /* @__PURE__ */ l(G, { height: "100%", children: [
315
+ /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(X, { children: "Annotations" }) }),
316
+ /* @__PURE__ */ e(K, { flex: 1, children: /* @__PURE__ */ e(
317
+ ut,
236
318
  {
237
319
  onNavigate: o,
238
- defaultTab: t
320
+ defaultTab: n
239
321
  }
240
322
  ) }),
241
- /* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(K, { asChild: !0, children: /* @__PURE__ */ e(V, { variant: "outline", children: "Cancel" }) }) }),
242
- /* @__PURE__ */ e(j, {})
323
+ /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(J, { asChild: !0, children: /* @__PURE__ */ e(q, { variant: "outline", children: "Cancel" }) }) }),
324
+ /* @__PURE__ */ e(Y, {})
243
325
  ] })
244
326
  }
245
327
  )
246
- ), qt = f(({ children: t }) => {
247
- const n = m(), o = b(() => n?.spine.element$, [n]);
248
- return o ? /* @__PURE__ */ e(be, { children: vt(t, o) }) : null;
249
- }), Yt = ({
250
- absolutePageIndex: t,
251
- itemIndex: n
328
+ ), pt = m(({ children: n }) => {
329
+ const t = b(), o = f(() => t?.spine.element$, [t]);
330
+ return o ? /* @__PURE__ */ e(xe, { children: Vn(n, o) }) : null;
331
+ }), gt = ({
332
+ absolutePageIndex: n,
333
+ itemIndex: t
252
334
  }) => {
253
- const o = m();
335
+ const o = b();
254
336
  return {
255
- spineItem: b(() => o ? n !== void 0 ? ce(o.spine.spineItemsManager.get(n)) : t !== void 0 ? o.spine.pages.observeFromAbsolutePageIndex(t).pipe(
256
- _((i) => o.spine.spineItemsManager.get(i?.itemIndex))
257
- ) : ye : ye, [n, t, o])
337
+ spineItem: f(() => o ? t !== void 0 ? he(o.spine.spineItemsManager.get(t)) : n !== void 0 ? o.spine.pages.observeFromAbsolutePageIndex(n).pipe(
338
+ E((i) => o.spine.spineItemsManager.get(i?.itemIndex))
339
+ ) : Ce : Ce, [t, n, o])
258
340
  };
259
- }, Ut = ({
260
- absolutePageIndex: t,
261
- itemIndex: n
341
+ }, ft = ({
342
+ absolutePageIndex: n,
343
+ itemIndex: t
262
344
  }) => {
263
- const { spineItem: o } = Yt({ absolutePageIndex: t, itemIndex: n }), r = b(
264
- () => o?.isReady$ ?? ce(!1),
345
+ const { spineItem: o } = gt({ absolutePageIndex: n, itemIndex: t }), r = f(
346
+ () => o?.isReady$ ?? he(!1),
265
347
  [o]
266
348
  );
267
349
  return { spineItem: o, isReady: r };
268
- }, Zt = f(
350
+ }, mt = m(
269
351
  ({
270
- absolutePageIndex: t,
271
- left: n,
352
+ absolutePageIndex: n,
353
+ left: t,
272
354
  top: o,
273
355
  width: r
274
356
  }) => {
275
- const { isReady: i } = Ut({
276
- absolutePageIndex: t
277
- }), { data: a } = he(), l = a?.find(
278
- (d) => d?.meta?.absolutePageIndex === t && d.meta.range === void 0
357
+ const { isReady: i } = ft({
358
+ absolutePageIndex: n
359
+ }), { data: a } = ge(), s = a?.find(
360
+ (d) => d?.meta?.absolutePageIndex === n && d.meta.range === void 0
279
361
  );
280
362
  if (!i) return null;
281
363
  const c = r * 0.1 / 2;
282
364
  return /* @__PURE__ */ e(
283
- oe,
365
+ ae,
284
366
  {
285
- present: !!l,
367
+ present: !!s,
286
368
  lazyMount: !0,
287
369
  animationName: { _open: "fade-in", _closed: "fade-out" },
288
370
  animationDuration: "moderate",
289
371
  children: /* @__PURE__ */ e(
290
- B,
372
+ F,
291
373
  {
292
- "data-bookmark-area": _t,
374
+ "data-bookmark-area": tt,
293
375
  position: "absolute",
294
- left: n + r,
376
+ left: t + r,
295
377
  transform: "translateX(-100%)",
296
378
  pointerEvents: "none",
297
379
  top: o,
@@ -312,11 +394,11 @@ const K = k.ActionTrigger, E = () => Ge(De), m = () => {
312
394
  }
313
395
  );
314
396
  }
315
- ), Qt = f(() => {
316
- const t = m(), n = b(() => t?.layoutInfo$, [t]);
317
- return /* @__PURE__ */ e(qt, { children: n?.pages.map(
397
+ ), bt = m(() => {
398
+ const n = b(), t = f(() => n?.layoutInfo$, [n]);
399
+ return /* @__PURE__ */ e(pt, { children: t?.pages.map(
318
400
  ({ absoluteLayout: { left: o, top: r, width: i } }, a) => /* @__PURE__ */ e(
319
- Zt,
401
+ mt,
320
402
  {
321
403
  absolutePageIndex: a,
322
404
  left: o,
@@ -326,24 +408,24 @@ const K = k.ActionTrigger, E = () => Ge(De), m = () => {
326
408
  a
327
409
  )
328
410
  ) });
329
- }), Kt = () => {
330
- const t = m();
331
- return ie(t) ? t : void 0;
332
- }, Xt = () => {
333
- const t = Kt(), { data: n } = he();
334
- H(() => t ? t.gestures.hooks.register(
411
+ }), St = () => {
412
+ const n = b();
413
+ return se(n) ? n : void 0;
414
+ }, Ct = () => {
415
+ const n = St(), { data: t } = ge();
416
+ j(() => n ? n.gestures.hooks.register(
335
417
  "beforeTapGesture",
336
418
  ({ event$: r }) => r.pipe(
337
- Ze(t?.annotations.candidates$),
338
- _(([i, a]) => {
419
+ hn(n?.annotations.candidates$),
420
+ E(([i, a]) => {
339
421
  if (!i.page) return !0;
340
422
  const {
341
- spineItem: l,
423
+ spineItem: s,
342
424
  spineItemPageIndex: c,
343
425
  spineItemPagePosition: d,
344
426
  pageSize: u
345
427
  } = i.page;
346
- if (Ct(
428
+ if (_n(
347
429
  d,
348
430
  {
349
431
  type: "corner",
@@ -353,37 +435,144 @@ const K = k.ActionTrigger, E = () => Ge(De), m = () => {
353
435
  },
354
436
  u
355
437
  )) {
356
- const h = t.spine.pages.fromSpineItemPageIndex(
357
- l,
438
+ const h = n.spine.pages.fromSpineItemPageIndex(
439
+ s,
358
440
  c
359
441
  );
360
442
  if (!h) return !0;
361
- const x = n?.find(
362
- (I) => I?.meta?.absolutePageIndex === h.absolutePageIndex && I.meta.range === void 0
443
+ const S = t?.find(
444
+ (x) => x?.meta?.absolutePageIndex === h.absolutePageIndex && x.meta.range === void 0
363
445
  );
364
- if (x)
365
- return t?.annotations.delete(x.resource.id), !1;
446
+ if (S)
447
+ return n?.annotations.delete(S.resource.id), !1;
366
448
  if (a?.[h.absolutePageIndex])
367
- return t?.annotations.annotateAbsolutePage({
449
+ return n?.annotations.annotateAbsolutePage({
368
450
  absolutePageIndex: h.absolutePageIndex
369
451
  }), !1;
370
452
  }
371
453
  return !0;
372
454
  })
373
455
  )
374
- ) : void 0, [t, n]);
375
- }, me = nt({
456
+ ) : void 0, [n, t]);
457
+ }, ve = vn({
376
458
  placement: "bottom-end",
377
459
  pauseOnPageIdle: !0
378
- }), Jt = () => /* @__PURE__ */ e(ke, { children: /* @__PURE__ */ e(ot, { toaster: me, insetInline: { mdDown: "4" }, children: (t) => /* @__PURE__ */ s($.Root, { width: { md: "sm" }, children: [
379
- t.type === "loading" ? /* @__PURE__ */ e(rt, { size: "sm", color: "blue.solid" }) : /* @__PURE__ */ e($.Indicator, {}),
380
- /* @__PURE__ */ s(C, { gap: "1", flex: "1", maxWidth: "100%", children: [
381
- t.title && /* @__PURE__ */ e($.Title, { children: t.title }),
382
- t.description && /* @__PURE__ */ e($.Description, { children: t.description })
460
+ }), vt = () => /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(xn, { toaster: ve, insetInline: { mdDown: "4" }, children: (n) => /* @__PURE__ */ l(ee.Root, { width: { md: "sm" }, children: [
461
+ n.type === "loading" ? /* @__PURE__ */ e(kn, { size: "sm", color: "blue.solid" }) : /* @__PURE__ */ e(ee.Indicator, {}),
462
+ /* @__PURE__ */ l(k, { gap: "1", flex: "1", maxWidth: "100%", children: [
463
+ n.title && /* @__PURE__ */ e(ee.Title, { children: n.title }),
464
+ n.description && /* @__PURE__ */ e(ee.Description, { children: n.description })
383
465
  ] }),
384
- t.action && /* @__PURE__ */ e($.ActionTrigger, { children: t.action.label }),
385
- t.meta?.closable && /* @__PURE__ */ e($.CloseTrigger, {})
386
- ] }) }) }), en = {
466
+ n.action && /* @__PURE__ */ e(ee.ActionTrigger, { children: n.action.label }),
467
+ n.meta?.closable && /* @__PURE__ */ e(ee.CloseTrigger, {})
468
+ ] }) }) }), Je = w.forwardRef(
469
+ function(t, o) {
470
+ const { label: r, children: i, helperText: a, errorText: s, optionalText: c, ...d } = t;
471
+ return /* @__PURE__ */ l(re.Root, { ref: o, ...d, children: [
472
+ r && /* @__PURE__ */ l(re.Label, { children: [
473
+ r,
474
+ /* @__PURE__ */ e(re.RequiredIndicator, { fallback: c })
475
+ ] }),
476
+ i,
477
+ a && /* @__PURE__ */ e(re.HelperText, { children: a }),
478
+ s && /* @__PURE__ */ e(re.ErrorText, { children: s })
479
+ ] });
480
+ }
481
+ ), Re = w.forwardRef(
482
+ function(t, o) {
483
+ const { marks: r, label: i, showValue: a, ...s } = t, c = t.defaultValue ?? t.value, d = r?.map((p) => typeof p == "number" ? { value: p, label: void 0 } : p), u = !!d?.some((p) => p.label);
484
+ return /* @__PURE__ */ l(R.Root, { ref: o, thumbAlignment: "center", ...s, children: [
485
+ i && !a && /* @__PURE__ */ e(R.Label, { children: i }),
486
+ i && a && /* @__PURE__ */ l(_, { justify: "space-between", children: [
487
+ /* @__PURE__ */ e(R.Label, { children: i }),
488
+ /* @__PURE__ */ e(R.ValueText, {})
489
+ ] }),
490
+ /* @__PURE__ */ l(R.Control, { "data-has-mark-label": u || void 0, children: [
491
+ /* @__PURE__ */ e(R.Track, { children: /* @__PURE__ */ e(R.Range, {}) }),
492
+ /* @__PURE__ */ e(xt, { value: c }),
493
+ /* @__PURE__ */ e(kt, { marks: d })
494
+ ] })
495
+ ] });
496
+ }
497
+ );
498
+ function xt(n) {
499
+ const { value: t } = n;
500
+ return /* @__PURE__ */ e(In, { each: t, children: (o, r) => /* @__PURE__ */ e(R.Thumb, { index: r, children: /* @__PURE__ */ e(R.HiddenInput, {}) }, r) });
501
+ }
502
+ const kt = w.forwardRef(
503
+ function(t, o) {
504
+ const { marks: r } = t;
505
+ return r?.length ? /* @__PURE__ */ e(R.MarkerGroup, { ref: o, children: r.map((i, a) => {
506
+ const s = typeof i == "number" ? i : i.value, c = typeof i == "number" ? void 0 : i.label;
507
+ return /* @__PURE__ */ l(R.Marker, { value: s, children: [
508
+ /* @__PURE__ */ e(R.MarkerIndicator, {}),
509
+ c
510
+ ] }, a);
511
+ }) }) : null;
512
+ }
513
+ ), It = m(() => {
514
+ const {
515
+ fontSizeMenuOpen: n,
516
+ onFontSizeMenuOpenChange: t,
517
+ fontSize: o,
518
+ fontSizeMin: r,
519
+ fontSizeMax: i,
520
+ fontSizeScopeValue: a,
521
+ onFontSizeValueChange: s
522
+ } = D([
523
+ "fontSizeMenuOpen",
524
+ "onFontSizeMenuOpenChange",
525
+ "fontSize",
526
+ "fontSizeMin",
527
+ "fontSizeMax",
528
+ "fontSizeScopeValue",
529
+ "onFontSizeValueChange"
530
+ ]), c = {
531
+ showValue: !0,
532
+ max: i * 100,
533
+ min: r * 100,
534
+ width: "100%",
535
+ step: 0.1 * 100,
536
+ marks: [
537
+ { value: 100, label: "Publisher" },
538
+ { value: r * 100, label: `${r * 100}%` },
539
+ { value: i * 100, label: `${i * 100}%` }
540
+ ]
541
+ };
542
+ return /* @__PURE__ */ e(
543
+ Q,
544
+ {
545
+ lazyMount: !0,
546
+ open: n,
547
+ onOpenChange: (d) => {
548
+ t(d.open);
549
+ },
550
+ placement: "center",
551
+ children: /* @__PURE__ */ l(G, { maxH: "40vh", overflow: "auto", children: [
552
+ /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(X, { children: "Font size" }) }),
553
+ /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e(k, { gap: 8, flex: 1, children: /* @__PURE__ */ l(W.Root, { children: [
554
+ /* @__PURE__ */ e(W.Legend, { children: "Font scale" }),
555
+ /* @__PURE__ */ e(W.HelperText, { children: "Only the one related to the scope will be applied." }),
556
+ /* @__PURE__ */ e(W.Content, { children: /* @__PURE__ */ e(Je, { label: "Book", children: /* @__PURE__ */ e(
557
+ Re,
558
+ {
559
+ label: "%",
560
+ disabled: a !== "book",
561
+ value: [(o ?? 1) * 100],
562
+ onValueChange: (d) => {
563
+ const u = d.value[0] ?? 0;
564
+ s(u / 100);
565
+ },
566
+ ...c
567
+ }
568
+ ) }) })
569
+ ] }) }) }),
570
+ /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(J, { asChild: !0, children: /* @__PURE__ */ e(q, { variant: "outline", children: "Close" }) }) }),
571
+ /* @__PURE__ */ e(Y, {})
572
+ ] })
573
+ }
574
+ );
575
+ }), zt = {
387
576
  x: 0,
388
577
  y: 0,
389
578
  width: 0,
@@ -393,60 +582,60 @@ const K = k.ActionTrigger, E = () => Ge(De), m = () => {
393
582
  bottom: 0,
394
583
  right: 0
395
584
  };
396
- function tn() {
397
- const [t, n] = y(null), [o, r] = y(en), i = Pe(
585
+ function Ot() {
586
+ const [n, t] = y(null), [o, r] = y(zt), i = ln(
398
587
  () => new ResizeObserver((a) => {
399
588
  if (a[0]) {
400
- const { x: l, y: c, width: d, height: u, top: g, left: h, bottom: x, right: S } = a[0].contentRect;
401
- r({ x: l, y: c, width: d, height: u, top: g, left: h, bottom: x, right: S });
589
+ const { x: s, y: c, width: d, height: u, top: p, left: h, bottom: S, right: I } = a[0].contentRect;
590
+ r({ x: s, y: c, width: d, height: u, top: p, left: h, bottom: S, right: I });
402
591
  }
403
592
  }),
404
593
  []
405
594
  );
406
- return je(() => {
407
- if (t)
408
- return i.observe(t), () => {
595
+ return sn(() => {
596
+ if (n)
597
+ return i.observe(n), () => {
409
598
  i.disconnect();
410
599
  };
411
- }, [t, i]), [n, o, t];
600
+ }, [n, i]), [t, o, n];
412
601
  }
413
- const nn = (t, n, o) => {
414
- const r = m(), i = _e(r) ? r : void 0;
415
- N(() => {
416
- if (!i || !t) return ve;
417
- const a = n.layout.layout$.pipe(
418
- Qe(n.layout.layoutInfo),
419
- Ce(kt)
420
- ), l = St(
421
- t
422
- ).pipe(_((c) => c.some((d) => d.isIntersecting)));
602
+ const Rt = (n, t, o) => {
603
+ const r = b(), i = Ze(r) ? r : void 0;
604
+ ce(() => {
605
+ if (!i || !n) return ke;
606
+ const a = t.layout.layout$.pipe(
607
+ pn(t.layout.layoutInfo),
608
+ Ie(Ln)
609
+ ), s = $n(
610
+ n
611
+ ).pipe(E((c) => c.some((d) => d.isIntersecting)));
423
612
  return a.pipe(
424
- Ke(100, void 0, { trailing: !0 }),
425
- W(() => l.pipe(
426
- xe((c) => {
427
- c || (t.innerHTML = "");
613
+ He(100, void 0, { trailing: !0 }),
614
+ N(() => s.pipe(
615
+ We((c) => {
616
+ c || (n.innerHTML = "");
428
617
  }),
429
- le((c) => c),
430
- ze()
618
+ ue((c) => c),
619
+ Ne()
431
620
  ).pipe(
432
- W(() => (t.innerHTML = "", i?.gallery.snapshot(
433
- n,
621
+ N(() => (n.innerHTML = "", i?.gallery.snapshot(
434
622
  t,
623
+ n,
435
624
  o
436
625
  )))
437
626
  ))
438
627
  );
439
- }, [i, n, o, t]);
440
- }, on = f(
441
- ({ item: t, onNavigated: n }) => {
442
- const [o, r, i] = tn(), a = m();
443
- nn(i, t, r);
444
- const l = b(
445
- () => a?.locateResource(t, { mode: "shallow" }),
446
- [a, t]
628
+ }, [i, t, o, n]);
629
+ }, Mt = m(
630
+ ({ item: n, onNavigated: t }) => {
631
+ const [o, r, i] = Ot(), a = b();
632
+ Rt(i, n, r);
633
+ const s = f(
634
+ () => a?.locateResource(n, { mode: "shallow" }),
635
+ [a, n]
447
636
  );
448
- return /* @__PURE__ */ s(
449
- B,
637
+ return /* @__PURE__ */ l(
638
+ F,
450
639
  {
451
640
  width: "100%",
452
641
  aspectRatio: "2/3",
@@ -458,11 +647,11 @@ const nn = (t, n, o) => {
458
647
  position: "relative",
459
648
  overflow: "hidden",
460
649
  onClick: () => {
461
- n(), a?.navigation.goToSpineItem({ indexOrId: t });
650
+ t(), a?.navigation.goToSpineItem({ indexOrId: n });
462
651
  },
463
652
  children: [
464
653
  /* @__PURE__ */ e(
465
- B,
654
+ F,
466
655
  {
467
656
  height: "100%",
468
657
  width: "100%",
@@ -471,8 +660,8 @@ const nn = (t, n, o) => {
471
660
  ref: o
472
661
  }
473
662
  ),
474
- /* @__PURE__ */ s(
475
- p,
663
+ /* @__PURE__ */ l(
664
+ g,
476
665
  {
477
666
  position: "absolute",
478
667
  bottom: 0,
@@ -484,7 +673,7 @@ const nn = (t, n, o) => {
484
673
  fontSize: "xs",
485
674
  children: [
486
675
  "Page ",
487
- (l?.meta?.absolutePageIndex ?? 0) + 1
676
+ (s?.meta?.absolutePageIndex ?? 0) + 1
488
677
  ]
489
678
  }
490
679
  )
@@ -492,22 +681,22 @@ const nn = (t, n, o) => {
492
681
  }
493
682
  );
494
683
  }
495
- ), rn = f(
496
- ({ open: t, setOpen: n }) => {
497
- const o = m(), r = b(() => o?.spineItemsManager.items$, [o]);
684
+ ), Tt = m(
685
+ ({ open: n, setOpen: t }) => {
686
+ const o = b(), r = f(() => o?.spineItemsManager.items$, [o]);
498
687
  return /* @__PURE__ */ e(
499
- q,
688
+ Q,
500
689
  {
501
690
  lazyMount: !0,
502
691
  placement: "center",
503
- open: t,
504
- onOpenChange: (i) => n(i.open),
692
+ open: n,
693
+ onOpenChange: (i) => t(i.open),
505
694
  size: { mdDown: "full", md: "lg" },
506
695
  scrollBehavior: "inside",
507
- children: /* @__PURE__ */ s(G, { height: "100%", children: [
508
- /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(Q, { children: "Gallery" }) }),
509
- /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(
510
- B,
696
+ children: /* @__PURE__ */ l(G, { height: "100%", children: [
697
+ /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(X, { children: "Gallery" }) }),
698
+ /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e(
699
+ F,
511
700
  {
512
701
  gridTemplateColumns: [
513
702
  "repeat(2, minmax(0, 1fr))",
@@ -518,37 +707,37 @@ const nn = (t, n, o) => {
518
707
  pt: 2,
519
708
  "data-grid": !0,
520
709
  children: r?.map((i) => /* @__PURE__ */ e(
521
- on,
710
+ Mt,
522
711
  {
523
712
  item: i,
524
713
  onNavigated: () => {
525
- n(!1);
714
+ t(!1);
526
715
  }
527
716
  },
528
717
  i.item.id
529
718
  ))
530
719
  }
531
720
  ) }),
532
- /* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(K, { asChild: !0, children: /* @__PURE__ */ e(V, { variant: "outline", children: "Cancel" }) }) }),
533
- /* @__PURE__ */ e(j, {})
721
+ /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(J, { asChild: !0, children: /* @__PURE__ */ e(q, { variant: "outline", children: "Cancel" }) }) }),
722
+ /* @__PURE__ */ e(Y, {})
534
723
  ] })
535
724
  }
536
725
  );
537
726
  }
538
- ), an = "@prose-reader/react-reader", sn = "1.251.0", ln = f(
539
- ({ open: t, setOpen: n }) => /* @__PURE__ */ e(
540
- q,
727
+ ), yt = "@prose-reader/react-reader", wt = "1.252.0", Pt = m(
728
+ ({ open: n, setOpen: t }) => /* @__PURE__ */ e(
729
+ Q,
541
730
  {
542
731
  lazyMount: !0,
543
732
  placement: "center",
544
- open: t,
545
- onOpenChange: (o) => n(o.open),
733
+ open: n,
734
+ onOpenChange: (o) => t(o.open),
546
735
  size: { mdDown: "full", md: "lg" },
547
736
  scrollBehavior: "inside",
548
- children: /* @__PURE__ */ s(G, { children: [
549
- /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(Q, { children: "Help" }) }),
550
- /* @__PURE__ */ s(
551
- Z,
737
+ children: /* @__PURE__ */ l(G, { children: [
738
+ /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(X, { children: "Help" }) }),
739
+ /* @__PURE__ */ l(
740
+ K,
552
741
  {
553
742
  overflowY: "auto",
554
743
  flex: 1,
@@ -556,171 +745,196 @@ const nn = (t, n, o) => {
556
745
  flexDirection: "column",
557
746
  gap: 4,
558
747
  children: [
559
- /* @__PURE__ */ s(C, { children: [
560
- /* @__PURE__ */ e(ge, { mb: 2, as: "h3", size: "lg", children: "Shortcuts" }),
561
- /* @__PURE__ */ s(O, { mb: 1, children: [
562
- /* @__PURE__ */ e(Te, { children: /* @__PURE__ */ e(dt, {}) }),
748
+ /* @__PURE__ */ l(k, { children: [
749
+ /* @__PURE__ */ e(be, { mb: 2, as: "h3", size: "lg", children: "Shortcuts" }),
750
+ /* @__PURE__ */ l(_, { mb: 1, children: [
751
+ /* @__PURE__ */ e(Fe, { children: /* @__PURE__ */ e(Tn, {}) }),
563
752
  " ",
564
- /* @__PURE__ */ e(p, { children: "Navigate to right page" })
753
+ /* @__PURE__ */ e(g, { children: "Navigate to right page" })
565
754
  ] }),
566
- /* @__PURE__ */ s(O, { mb: 1, children: [
567
- /* @__PURE__ */ e(Te, { children: /* @__PURE__ */ e(ut, {}) }),
755
+ /* @__PURE__ */ l(_, { mb: 1, children: [
756
+ /* @__PURE__ */ e(Fe, { children: /* @__PURE__ */ e(yn, {}) }),
568
757
  " ",
569
- /* @__PURE__ */ e(p, { children: "Navigate to left page" })
758
+ /* @__PURE__ */ e(g, { children: "Navigate to left page" })
570
759
  ] })
571
760
  ] }),
572
- /* @__PURE__ */ s(C, { children: [
573
- /* @__PURE__ */ e(ge, { mb: 2, as: "h3", size: "lg", children: "Bookmarks" }),
574
- /* @__PURE__ */ e(O, { mb: 1, children: /* @__PURE__ */ e(p, { children: "Tap on the top right corner of a page bookmark it" }) })
761
+ /* @__PURE__ */ l(k, { children: [
762
+ /* @__PURE__ */ e(be, { mb: 2, as: "h3", size: "lg", children: "Bookmarks" }),
763
+ /* @__PURE__ */ e(_, { mb: 1, children: /* @__PURE__ */ e(g, { children: "Tap on the top right corner of a page bookmark it" }) })
575
764
  ] }),
576
- /* @__PURE__ */ s(C, { children: [
577
- /* @__PURE__ */ e(ge, { mb: 2, as: "h3", size: "lg", children: "About" }),
578
- /* @__PURE__ */ s(p, { children: [
579
- an,
765
+ /* @__PURE__ */ l(k, { children: [
766
+ /* @__PURE__ */ e(be, { mb: 2, as: "h3", size: "lg", children: "About" }),
767
+ /* @__PURE__ */ l(g, { children: [
768
+ yt,
580
769
  " version: ",
581
- sn
770
+ wt
582
771
  ] })
583
772
  ] })
584
773
  ]
585
774
  }
586
775
  ),
587
- /* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(K, { asChild: !0, children: /* @__PURE__ */ e(V, { variant: "outline", children: "Cancel" }) }) }),
588
- /* @__PURE__ */ e(j, {})
776
+ /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(J, { asChild: !0, children: /* @__PURE__ */ e(q, { variant: "outline", children: "Cancel" }) }) }),
777
+ /* @__PURE__ */ e(Y, {})
589
778
  ] })
590
779
  }
591
780
  )
592
- ), X = () => {
593
- const t = m();
594
- return b(
595
- () => t ? Xe([t.pagination.state$, t.context]).pipe(
596
- _(([n, o]) => {
781
+ ), oe = () => {
782
+ const n = b();
783
+ return f(
784
+ () => n ? gn([n.pagination.state$, n.context]).pipe(
785
+ E(([t, o]) => {
597
786
  const r = o.manifest?.spineItems.every(
598
787
  (i) => i.mediaType?.startsWith("image/")
599
788
  );
600
789
  return {
601
- ...n,
790
+ ...t,
602
791
  hasChapters: !o.isFullyPrePaginated && !r
603
792
  };
604
793
  })
605
- ) : ve,
606
- [t]
794
+ ) : ke,
795
+ [n]
607
796
  );
608
- }, cn = () => {
609
- const t = X(), n = Math.floor(
610
- (t?.percentageEstimateOfBook ?? 0) * 100
611
- ), o = n > 0 ? n : 1;
612
- return t?.percentageEstimateOfBook === void 0 ? null : /* @__PURE__ */ e(B, { position: "absolute", right: 0, bottom: 0, p: 2, color: "black", children: /* @__PURE__ */ s(p, { fontSize: "sm", children: [
797
+ }, Bt = () => {
798
+ const n = oe(), t = Math.floor(
799
+ (n?.percentageEstimateOfBook ?? 0) * 100
800
+ ), o = t > 0 ? t : 1;
801
+ return n?.percentageEstimateOfBook === void 0 ? null : /* @__PURE__ */ e(F, { position: "absolute", right: 0, bottom: 0, p: 2, color: "black", children: /* @__PURE__ */ l(g, { fontSize: "sm", children: [
613
802
  o,
614
803
  " %"
615
804
  ] }) });
616
- }, dn = () => {
617
- const [t, n] = y(/* @__PURE__ */ new Date());
618
- return H(() => {
805
+ }, At = () => {
806
+ const [n, t] = y(/* @__PURE__ */ new Date());
807
+ return j(() => {
619
808
  const o = setInterval(() => {
620
- n(/* @__PURE__ */ new Date());
809
+ t(/* @__PURE__ */ new Date());
621
810
  }, 6e4);
622
811
  return () => clearInterval(o);
623
- }, []), t;
624
- }, un = (t) => {
625
- const n = dn();
626
- return /* @__PURE__ */ e(p, { fontSize: "xs", ...t, children: n.toLocaleTimeString(navigator.language, {
812
+ }, []), n;
813
+ }, Et = (n) => {
814
+ const t = At();
815
+ return /* @__PURE__ */ e(g, { fontSize: "xs", ...n, children: t.toLocaleTimeString(navigator.language, {
627
816
  hour: "2-digit",
628
817
  minute: "2-digit"
629
818
  }) });
630
- }, Ie = () => {
631
- const { quickMenuSignal: t } = E();
632
- return [ue(t), t.update, t];
633
- }, hn = () => {
634
- const [t] = Ie();
819
+ }, Me = () => {
820
+ const { quickMenuOpen: n, onQuickMenuOpenChange: t } = D([
821
+ "quickMenuOpen",
822
+ "onQuickMenuOpenChange"
823
+ ]);
824
+ return [n, t];
825
+ }, Ft = () => {
826
+ const [n] = Me();
635
827
  return /* @__PURE__ */ e(
636
- B,
828
+ F,
637
829
  {
638
830
  position: "absolute",
639
831
  left: 0,
640
832
  bottom: 0,
641
833
  p: 2,
642
- color: t ? void 0 : "colorPalette.contrast",
643
- children: /* @__PURE__ */ e(un, {})
834
+ color: n ? void 0 : "colorPalette.contrast",
835
+ children: /* @__PURE__ */ e(Et, {})
644
836
  }
645
837
  );
646
- }, gn = () => {
647
- const t = m();
648
- N(
649
- () => t?.links$.subscribe((n) => {
650
- if (n.type === "click" && It(n.target, "a")) {
651
- if (!n.target.href) return;
652
- const o = new URL(n.target.href);
838
+ }, Dt = () => {
839
+ const n = b();
840
+ ce(
841
+ () => n?.links$.subscribe((t) => {
842
+ if (t.type === "click" && Hn(t.target, "a")) {
843
+ if (!t.target.href) return;
844
+ const o = new URL(t.target.href);
653
845
  window.location.host !== o.host && confirm(
654
846
  "You are going to be redirected to external link"
655
- ) && window.open(n.target.href, "__blank");
847
+ ) && window.open(t.target.href, "__blank");
656
848
  }
657
849
  }),
658
- [t]
850
+ [n]
659
851
  );
660
- }, pn = () => {
661
- const t = m(), { notificationsSubject: n } = E();
662
- N(
663
- () => t?.settings.values$.pipe(
664
- _(({ fontScale: o }) => o),
665
- Ce(),
666
- Oe(1),
667
- xe((o) => {
668
- n.next({
669
- key: "fontScaleChange",
852
+ }, Vt = {
853
+ fontScaleChange: "fontScaleChange"
854
+ }, _t = () => {
855
+ const n = b(), { notificationsSubject: t, fontSizeMenuOpen: o } = D([
856
+ "notificationsSubject",
857
+ "fontSizeMenuOpen"
858
+ ]);
859
+ ce(
860
+ () => o ? Ce : n?.settings.values$.pipe(
861
+ E(({ fontScale: r }) => r),
862
+ Ie(),
863
+ je(1),
864
+ We((r) => {
865
+ t.next({
866
+ key: Vt.fontScaleChange,
670
867
  title: "Font size changed",
671
- description: `${o * 100} %`
868
+ description: `${r * 100} %`
672
869
  });
673
870
  })
674
871
  ),
675
- [t, n]
872
+ [n, t, o]
676
873
  );
677
- }, fn = () => {
678
- const { notificationsSubject: t } = E();
679
- pn(), N(
680
- () => t.pipe(
681
- le(Be),
682
- Je((n) => {
683
- const o = n.duration ?? 3e3, r = me.create({
684
- title: n.title,
685
- description: n.description,
686
- duration: o
687
- }), i = t.pipe(
688
- Oe(1),
689
- le((a) => !!n.key && a?.key === n.key)
874
+ }, Lt = () => {
875
+ const { notificationsSubject: n } = D([
876
+ "notificationsSubject"
877
+ ]);
878
+ _t(), ce(
879
+ () => n.pipe(
880
+ ue($e),
881
+ fn((t) => {
882
+ const o = t.duration ?? 3e3, r = new mn((a) => {
883
+ try {
884
+ queueMicrotask(() => {
885
+ const s = ve.create({
886
+ title: t.title,
887
+ description: t.description,
888
+ duration: o
889
+ });
890
+ a.next(s), a.complete();
891
+ });
892
+ } catch (s) {
893
+ a.error(s);
894
+ }
895
+ }), i = n.pipe(
896
+ je(1),
897
+ ue((a) => !!t.key && a?.key === t.key)
690
898
  );
691
- return Me(
692
- Ee(o),
693
- n.abort ?? ve,
694
- i
695
- ).pipe(
696
- ze(),
697
- et(() => {
698
- me.dismiss(r);
699
- })
899
+ return r.pipe(
900
+ N(
901
+ (a) => qe(
902
+ Ge(o),
903
+ t.abort ?? ke,
904
+ i
905
+ ).pipe(
906
+ Ne(),
907
+ bn(() => {
908
+ queueMicrotask(() => {
909
+ ve.dismiss(a);
910
+ });
911
+ })
912
+ )
913
+ )
700
914
  );
701
915
  })
702
916
  ),
703
- [t]
917
+ [n]
704
918
  );
705
- }, mn = T.forwardRef(
706
- function(n, o) {
919
+ }, $t = w.forwardRef(
920
+ function(t, o) {
707
921
  const {
708
922
  showArrow: r,
709
923
  children: i,
710
924
  portalled: a = !0,
711
- content: l,
925
+ content: s,
712
926
  portalRef: c,
713
927
  ...d
714
- } = n;
715
- return /* @__PURE__ */ s(
716
- F.Root,
928
+ } = t;
929
+ return /* @__PURE__ */ l(
930
+ ne.Root,
717
931
  {
718
932
  ...d,
719
933
  positioning: { ...d.positioning, gutter: 4 },
720
934
  children: [
721
- /* @__PURE__ */ e(F.Trigger, { asChild: !0, children: i }),
722
- /* @__PURE__ */ e(ke, { disabled: !a, container: c, children: /* @__PURE__ */ e(F.Positioner, { children: /* @__PURE__ */ s(
723
- F.Content,
935
+ /* @__PURE__ */ e(ne.Trigger, { asChild: !0, children: i }),
936
+ /* @__PURE__ */ e(ze, { disabled: !a, container: c, children: /* @__PURE__ */ e(ne.Positioner, { children: /* @__PURE__ */ l(
937
+ ne.Content,
724
938
  {
725
939
  width: "auto",
726
940
  px: "2",
@@ -729,8 +943,8 @@ const nn = (t, n, o) => {
729
943
  rounded: "sm",
730
944
  ref: o,
731
945
  children: [
732
- r && /* @__PURE__ */ e(F.Arrow, { children: /* @__PURE__ */ e(F.ArrowTip, {}) }),
733
- l
946
+ r && /* @__PURE__ */ e(ne.Arrow, { children: /* @__PURE__ */ e(ne.ArrowTip, {}) }),
947
+ s
734
948
  ]
735
949
  }
736
950
  ) }) })
@@ -738,84 +952,84 @@ const nn = (t, n, o) => {
738
952
  }
739
953
  );
740
954
  }
741
- ), bn = T.forwardRef(function(n, o) {
742
- const { children: r, ...i } = n;
743
- return /* @__PURE__ */ e(mn, { content: r, ...i, ref: o, children: /* @__PURE__ */ e(
955
+ ), Ht = w.forwardRef(function(t, o) {
956
+ const { children: r, ...i } = t;
957
+ return /* @__PURE__ */ e($t, { content: r, ...i, ref: o, children: /* @__PURE__ */ e(
744
958
  v,
745
959
  {
746
960
  variant: "ghost",
747
961
  "aria-label": "info",
748
962
  size: "2xs",
749
963
  colorPalette: "gray",
750
- children: /* @__PURE__ */ e(Mt, {})
964
+ children: /* @__PURE__ */ e(Xn, {})
751
965
  }
752
966
  ) });
753
- }), xn = T.forwardRef(function(n, o) {
754
- return /* @__PURE__ */ e(re.Track, { ...n, ref: o, children: /* @__PURE__ */ e(re.Range, {}) });
967
+ }), Wt = w.forwardRef(function(t, o) {
968
+ return /* @__PURE__ */ e(le.Track, { ...t, ref: o, children: /* @__PURE__ */ e(le.Range, {}) });
755
969
  });
756
- T.forwardRef(function(n, o) {
757
- const { children: r, info: i, ...a } = n;
758
- return /* @__PURE__ */ s(re.Label, { ...a, ref: o, children: [
970
+ w.forwardRef(function(t, o) {
971
+ const { children: r, info: i, ...a } = t;
972
+ return /* @__PURE__ */ l(le.Label, { ...a, ref: o, children: [
759
973
  r,
760
- i && /* @__PURE__ */ e(bn, { children: i })
974
+ i && /* @__PURE__ */ e(Ht, { children: i })
761
975
  ] });
762
976
  });
763
- const vn = re.Root, Cn = re.ValueText, Re = () => {
764
- const t = X(), n = t?.numberOfTotalPages === 1, o = (t?.beginNumberOfPagesInSpineItem ?? 0) > 1, r = (t?.endNumberOfPagesInSpineItem ?? 0) > 1, i = (t?.hasChapters ? t?.beginPageIndexInSpineItem : t?.beginAbsolutePageIndex) ?? 0, a = (t?.hasChapters ? t?.endPageIndexInSpineItem : t?.endAbsolutePageIndex) ?? 0, [l = 0, c = 0] = [
977
+ const Nt = le.Root, jt = le.ValueText, Te = () => {
978
+ const n = oe(), t = n?.numberOfTotalPages === 1, o = (n?.beginNumberOfPagesInSpineItem ?? 0) > 1, r = (n?.endNumberOfPagesInSpineItem ?? 0) > 1, i = (n?.hasChapters ? n?.beginPageIndexInSpineItem : n?.beginAbsolutePageIndex) ?? 0, a = (n?.hasChapters ? n?.endPageIndexInSpineItem : n?.endAbsolutePageIndex) ?? 0, [s = 0, c = 0] = [
765
979
  i,
766
980
  a
767
- ].sort((g, h) => g - h), d = t?.beginPageIndexInSpineItem !== t?.endPageIndexInSpineItem || t?.beginSpineItemIndex !== t?.endSpineItemIndex, u = t?.hasChapters ? t?.beginNumberOfPagesInSpineItem : t?.numberOfTotalPages;
981
+ ].sort((p, h) => p - h), d = n?.beginPageIndexInSpineItem !== n?.endPageIndexInSpineItem || n?.beginSpineItemIndex !== n?.endSpineItemIndex, u = n?.hasChapters ? n?.beginNumberOfPagesInSpineItem : n?.numberOfTotalPages;
768
982
  return {
769
- hasOnlyOnePage: n,
983
+ hasOnlyOnePage: t,
770
984
  beginPageIndex: i,
771
985
  endPageIndex: a,
772
986
  isBeginWithinChapter: o,
773
987
  isEndWithinChapter: r,
774
988
  beginAndEndAreDifferent: d,
775
989
  totalApproximatePages: u,
776
- leftPageIndex: l,
990
+ leftPageIndex: s,
777
991
  rightPageIndex: c
778
992
  };
779
- }, kn = () => {
780
- const t = X(), {
781
- hasOnlyOnePage: n,
993
+ }, qt = () => {
994
+ const n = oe(), {
995
+ hasOnlyOnePage: t,
782
996
  leftPageIndex: o,
783
997
  rightPageIndex: r,
784
998
  totalApproximatePages: i,
785
999
  beginAndEndAreDifferent: a
786
- } = Re(), l = Math.round((t?.percentageEstimateOfBook ?? 0) * 100), c = (u) => u?.subChapter ? `${u.title} / ${c(u.subChapter)}` : u?.title || "", d = c(t?.beginChapterInfo);
787
- return /* @__PURE__ */ s(C, { alignItems: "center", gap: 1, maxW: "100%", overflow: "auto", children: [
788
- /* @__PURE__ */ e(vn, { value: l, size: "xs", width: 150, children: /* @__PURE__ */ s(O, { justifyContent: "space-between", children: [
789
- /* @__PURE__ */ e(xn, { width: 110 }),
790
- /* @__PURE__ */ e(Cn, { children: `${l}%` })
1000
+ } = Te(), s = Math.round((n?.percentageEstimateOfBook ?? 0) * 100), c = (u) => u?.subChapter ? `${u.title} / ${c(u.subChapter)}` : u?.title || "", d = c(n?.beginChapterInfo);
1001
+ return /* @__PURE__ */ l(k, { alignItems: "center", gap: 1, maxW: "100%", overflow: "auto", children: [
1002
+ /* @__PURE__ */ e(Nt, { value: s, size: "xs", width: 150, children: /* @__PURE__ */ l(_, { justifyContent: "space-between", children: [
1003
+ /* @__PURE__ */ e(Wt, { width: 110 }),
1004
+ /* @__PURE__ */ e(jt, { children: `${s}%` })
791
1005
  ] }) }),
792
- /* @__PURE__ */ e(p, { truncate: !0, maxWidth: "100%", fontSize: "sm", mt: 1, children: d ? `Chapter: ${d}` : " " }),
793
- !n && /* @__PURE__ */ s(O, { children: [
794
- /* @__PURE__ */ e(p, { fontSize: "xs", children: a ? `${o + 1} - ${r + 1} of ${i}` : `${o + 1} of ${i}` }),
795
- !!t?.hasChapters && /* @__PURE__ */ s(be, { children: [
796
- /* @__PURE__ */ e(p, { children: "-" }),
797
- /* @__PURE__ */ s(p, { fontSize: "xs", children: [
1006
+ /* @__PURE__ */ e(g, { truncate: !0, maxWidth: "100%", fontSize: "sm", mt: 1, children: d ? `Chapter: ${d}` : " " }),
1007
+ !t && /* @__PURE__ */ l(_, { children: [
1008
+ /* @__PURE__ */ e(g, { fontSize: "xs", children: a ? `${o + 1} - ${r + 1} of ${i}` : `${o + 1} of ${i}` }),
1009
+ !!n?.hasChapters && /* @__PURE__ */ l(xe, { children: [
1010
+ /* @__PURE__ */ e(g, { children: "-" }),
1011
+ /* @__PURE__ */ l(g, { fontSize: "xs", children: [
798
1012
  "(",
799
- (t?.beginAbsolutePageIndex ?? 0) + 1,
1013
+ (n?.beginAbsolutePageIndex ?? 0) + 1,
800
1014
  ")"
801
1015
  ] })
802
1016
  ] })
803
1017
  ] })
804
1018
  ] });
805
- }, We = f(
1019
+ }, en = m(
806
1020
  ({
807
- children: t,
808
- position: n,
1021
+ children: n,
1022
+ position: t,
809
1023
  ...o
810
1024
  }) => /* @__PURE__ */ e(
811
- oe,
1025
+ ae,
812
1026
  {
813
1027
  display: "flex",
814
1028
  flexDirection: "row",
815
1029
  width: "100%",
816
1030
  position: "absolute",
817
- ...n === "bottom" ? { bottom: 0 } : { top: 0 },
818
- animationName: n === "bottom" ? {
1031
+ ...t === "bottom" ? { bottom: 0 } : { top: 0 },
1032
+ animationName: t === "bottom" ? {
819
1033
  _open: "slide-from-bottom, fade-in",
820
1034
  _closed: "slide-to-bottom, fade-out"
821
1035
  } : {
@@ -829,11 +1043,11 @@ const vn = re.Root, Cn = re.ValueText, Re = () => {
829
1043
  shadow: "md",
830
1044
  p: 4,
831
1045
  ...o,
832
- children: t
1046
+ children: n
833
1047
  }
834
1048
  )
835
- ), Sn = it(Et), In = f((t) => /* @__PURE__ */ e(
836
- B,
1049
+ ), Gt = zn(Jn), Yt = m((n) => /* @__PURE__ */ e(
1050
+ F,
837
1051
  {
838
1052
  display: "contents",
839
1053
  css: {
@@ -842,7 +1056,7 @@ const vn = re.Root, Cn = re.ValueText, Re = () => {
842
1056
  "--color-solid": "colors.colorPalette.solid"
843
1057
  },
844
1058
  children: /* @__PURE__ */ e(
845
- Sn,
1059
+ Gt,
846
1060
  {
847
1061
  keyboard: !1,
848
1062
  style: {
@@ -877,86 +1091,101 @@ const vn = re.Root, Cn = re.ValueText, Re = () => {
877
1091
  height: "24px",
878
1092
  top: "50%",
879
1093
  borderColor: "var(--color-solid)",
880
- transform: `translate(${t.reverse ? "50%" : "-50%"}, -50%)`,
1094
+ transform: `translate(${n.reverse ? "50%" : "-50%"}, -50%)`,
881
1095
  backgroundColor: "var(--bg)",
882
1096
  marginTop: "0px"
883
1097
  }
884
1098
  },
885
- ...t
1099
+ ...n
886
1100
  }
887
1101
  )
888
1102
  }
889
- )), Rn = () => {
890
- const n = X()?.isUsingSpread, { beginPageIndex: o, totalApproximatePages: r = 0 } = Re(), i = n ? Math.floor((o || 0) / 2) : o, [a, l] = Ue(
891
- () => L({
1103
+ )), Qt = () => {
1104
+ const t = oe()?.isUsingSpread, { beginPageIndex: o, totalApproximatePages: r = 0 } = Te(), i = t ? Math.floor((o || 0) / 2) : o, [a, s] = dn(
1105
+ () => V({
892
1106
  default: i || 0
893
1107
  })
894
1108
  ), c = 0, d = Math.max(
895
1109
  0,
896
- n ? Math.floor((r - 1) / 2) : r - 1
1110
+ t ? Math.floor((r - 1) / 2) : r - 1
897
1111
  );
898
- return H(() => {
899
- l.update(i || 0);
900
- }, [i, l]), {
1112
+ return j(() => {
1113
+ s.update(i || 0);
1114
+ }, [i, s]), {
901
1115
  value: a,
902
- valueSignal: l,
1116
+ valueSignal: s,
903
1117
  min: c,
904
1118
  max: d
905
1119
  };
906
- }, yn = (t) => {
907
- const n = m(), o = X(), { manifest: r } = b(() => n?.context, [n]) ?? {}, i = r?.readingDirection === "rtl", a = o?.isUsingSpread, { totalApproximatePages: l = 0, isBeginWithinChapter: c } = Re(), d = 1, u = c, { value: g, valueSignal: h, min: x, max: S } = Rn(), I = ne(
908
- (M) => {
909
- const [A = 0] = Array.isArray(M) ? M : [M];
910
- h.update(A);
911
- const ae = a ? Math.floor(A) * 2 : Math.floor(A);
912
- u ? n?.navigation.goToPageOfSpineItem({
913
- pageIndex: ae,
914
- spineItemId: n.pagination.state.beginSpineItemIndex ?? 0,
1120
+ }, Ut = (n) => {
1121
+ const t = b(), o = oe(), { manifest: r } = f(() => t?.context, [t]) ?? {}, i = r?.readingDirection === "rtl", a = o?.isUsingSpread, { totalApproximatePages: s = 0, isBeginWithinChapter: c } = Te(), d = 1, u = c, { value: p, valueSignal: h, min: S, max: I } = Qt(), x = B(
1122
+ (C) => {
1123
+ const [z = 0] = Array.isArray(C) ? C : [C];
1124
+ h.update(z);
1125
+ const L = a ? Math.floor(z) * 2 : Math.floor(z);
1126
+ u ? t?.navigation.goToPageOfSpineItem({
1127
+ pageIndex: L,
1128
+ spineItemId: t.pagination.state.beginSpineItemIndex ?? 0,
915
1129
  animation: !1
916
- }) : n?.navigation.goToAbsolutePageIndex({
917
- absolutePageIndex: ae,
1130
+ }) : t?.navigation.goToAbsolutePageIndex({
1131
+ absolutePageIndex: L,
918
1132
  animation: !1
919
1133
  });
920
1134
  },
921
- [n, a, h, u]
1135
+ [t, a, h, u]
922
1136
  );
923
- return N(
924
- () => n?.navigation.throttleLock({
1137
+ return ce(
1138
+ () => t?.navigation.throttleLock({
925
1139
  duration: 100,
926
1140
  trigger: h.subject
927
1141
  }),
928
- [n, h]
929
- ), l === 1 || a && l === 2 ? /* @__PURE__ */ e(B, { style: t.style }) : /* @__PURE__ */ e(
930
- In,
1142
+ [t, h]
1143
+ ), s === 1 || a && s === 2 ? /* @__PURE__ */ e(F, { style: n.style }) : /* @__PURE__ */ e(
1144
+ Yt,
931
1145
  {
932
- value: [g],
933
- max: S,
934
- min: x,
1146
+ value: [p],
1147
+ max: I,
1148
+ min: S,
935
1149
  reverse: i,
936
1150
  step: d,
937
- onChange: I,
938
- ...t
1151
+ onChange: x,
1152
+ ...n
939
1153
  }
940
1154
  );
941
- }, Tn = f(
1155
+ }, Zt = m(
942
1156
  ({
943
- open: t,
944
- onItemClick: n
1157
+ open: n,
1158
+ onItemClick: t
945
1159
  }) => {
946
- const o = qe(null), r = m(), { refitMenuSignal: i, quickMenuBottomBarBoundingBox: a } = E(), l = b(() => r?.navigation.state$, [r]), c = b(() => r?.settings.values$, [r]), d = b(() => r?.zoom.state$, [r]), u = (d?.currentScale ?? 1) > 1, g = (d?.currentScale ?? 1) < 1, h = c?.computedPageTurnMode === "scrollable", x = c?.computedPageTurnDirection === "vertical", [S, I] = y(!0);
947
- return H(() => {
1160
+ const o = cn(null), r = b(), {
1161
+ quickMenuBottomBarBoundingBoxSignal: i,
1162
+ onFontSizeMenuOpenChange: a,
1163
+ onRefitMenuOpenChange: s
1164
+ } = D([
1165
+ "quickMenuBottomBarBoundingBoxSignal",
1166
+ "onFontSizeMenuOpenChange",
1167
+ "onRefitMenuOpenChange"
1168
+ ]), c = f(() => r?.navigation.state$, [r]), d = f(() => r?.settings.values$, [r]), u = f(
1169
+ () => r?.zoom.state$.pipe(
1170
+ E(
1171
+ (C) => C.currentScale > 1 ? "in" : C.currentScale < 1 ? "out" : void 0
1172
+ )
1173
+ ),
1174
+ [r]
1175
+ ), p = u === "in", h = u === "out", S = d?.computedPageTurnMode === "scrollable", I = d?.computedPageTurnDirection === "vertical", [x, P] = y(!0);
1176
+ return j(() => {
948
1177
  if (!o.current) return;
949
- const w = new ResizeObserver((M) => {
950
- for (const A of M)
951
- a.next(A);
1178
+ const C = new ResizeObserver((z) => {
1179
+ for (const L of z)
1180
+ i.update(L);
952
1181
  });
953
- return w.observe(o.current), () => {
954
- w.disconnect();
1182
+ return C.observe(o.current), () => {
1183
+ C.disconnect();
955
1184
  };
956
- }, [a]), /* @__PURE__ */ s(
957
- We,
1185
+ }, [i]), /* @__PURE__ */ l(
1186
+ en,
958
1187
  {
959
- present: t,
1188
+ present: n,
960
1189
  position: "bottom",
961
1190
  display: "flex",
962
1191
  flexDirection: "column",
@@ -965,8 +1194,8 @@ const vn = re.Root, Cn = re.ValueText, Re = () => {
965
1194
  px: 0,
966
1195
  ref: o,
967
1196
  children: [
968
- /* @__PURE__ */ s(
969
- O,
1197
+ /* @__PURE__ */ l(
1198
+ _,
970
1199
  {
971
1200
  flex: 1,
972
1201
  alignItems: "center",
@@ -982,12 +1211,12 @@ const vn = re.Root, Cn = re.ValueText, Re = () => {
982
1211
  variant: "ghost",
983
1212
  flexShrink: 0,
984
1213
  onClick: () => r?.navigation.goToLeftOrTopSpineItem(),
985
- disabled: !l?.canGoLeftSpineItem && !l?.canGoTopSpineItem,
986
- children: x ? /* @__PURE__ */ e(Bt, {}) : /* @__PURE__ */ e(At, {})
1214
+ disabled: !c?.canGoLeftSpineItem && !c?.canGoTopSpineItem,
1215
+ children: I ? /* @__PURE__ */ e(Qn, {}) : /* @__PURE__ */ e(Un, {})
987
1216
  }
988
1217
  ),
989
- /* @__PURE__ */ s(
990
- C,
1218
+ /* @__PURE__ */ l(
1219
+ k,
991
1220
  {
992
1221
  flex: 1,
993
1222
  maxW: 400,
@@ -996,9 +1225,9 @@ const vn = re.Root, Cn = re.ValueText, Re = () => {
996
1225
  overflow: "auto",
997
1226
  px: 4,
998
1227
  children: [
999
- /* @__PURE__ */ e(kn, {}),
1228
+ /* @__PURE__ */ e(qt, {}),
1000
1229
  /* @__PURE__ */ e(
1001
- yn,
1230
+ Ut,
1002
1231
  {
1003
1232
  style: {
1004
1233
  width: "100%",
@@ -1017,52 +1246,52 @@ const vn = re.Root, Cn = re.ValueText, Re = () => {
1017
1246
  size: "lg",
1018
1247
  flexShrink: 0,
1019
1248
  variant: "ghost",
1020
- disabled: !l?.canGoRightSpineItem && !l?.canGoBottomSpineItem,
1249
+ disabled: !c?.canGoRightSpineItem && !c?.canGoBottomSpineItem,
1021
1250
  onClick: () => {
1022
1251
  r?.navigation.goToRightOrBottomSpineItem();
1023
1252
  },
1024
- children: x ? /* @__PURE__ */ e(zt, {}) : /* @__PURE__ */ e(Ot, {})
1253
+ children: I ? /* @__PURE__ */ e(Zn, {}) : /* @__PURE__ */ e(Kn, {})
1025
1254
  }
1026
1255
  )
1027
1256
  ]
1028
1257
  }
1029
1258
  ),
1030
- /* @__PURE__ */ e(O, { alignSelf: "stretch", alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ s(
1031
- pe.Root,
1259
+ /* @__PURE__ */ e(_, { alignSelf: "stretch", alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ l(
1260
+ Se.Root,
1032
1261
  {
1033
- open: S,
1262
+ open: x,
1034
1263
  flex: 1,
1035
- onOpenChange: ({ open: w }) => {
1036
- I(w);
1264
+ onOpenChange: ({ open: C }) => {
1265
+ P(C);
1037
1266
  },
1038
1267
  width: "100%",
1039
1268
  children: [
1040
1269
  /* @__PURE__ */ e(
1041
- pe.Trigger,
1270
+ Se.Trigger,
1042
1271
  {
1043
1272
  paddingY: "3",
1044
1273
  width: "100%",
1045
1274
  display: "flex",
1046
1275
  justifyContent: "center",
1047
1276
  children: /* @__PURE__ */ e(
1048
- ht,
1277
+ wn,
1049
1278
  {
1050
1279
  style: {
1051
- transform: S ? "rotate(0deg)" : "rotate(180deg)"
1280
+ transform: x ? "rotate(0deg)" : "rotate(180deg)"
1052
1281
  }
1053
1282
  }
1054
1283
  )
1055
1284
  }
1056
1285
  ),
1057
- /* @__PURE__ */ e(pe.Content, { display: "flex", justifyContent: "center", children: /* @__PURE__ */ s(B, { display: "flex", overflowX: "auto", px: 4, pb: 1, children: [
1286
+ /* @__PURE__ */ e(Se.Content, { display: "flex", justifyContent: "center", children: /* @__PURE__ */ l(F, { display: "flex", overflowX: "auto", px: 4, pb: 1, children: [
1058
1287
  /* @__PURE__ */ e(
1059
1288
  v,
1060
1289
  {
1061
1290
  "aria-label": "Help",
1062
1291
  size: "lg",
1063
1292
  variant: "ghost",
1064
- onClick: () => n("help"),
1065
- children: /* @__PURE__ */ e(gt, {})
1293
+ onClick: () => t("help"),
1294
+ children: /* @__PURE__ */ e(Pn, {})
1066
1295
  }
1067
1296
  ),
1068
1297
  /* @__PURE__ */ e(
@@ -1071,18 +1300,18 @@ const vn = re.Root, Cn = re.ValueText, Re = () => {
1071
1300
  "aria-label": "Table of contents",
1072
1301
  size: "lg",
1073
1302
  variant: "ghost",
1074
- onClick: () => n("toc"),
1075
- children: /* @__PURE__ */ e(pt, {})
1303
+ onClick: () => t("toc"),
1304
+ children: /* @__PURE__ */ e(Bn, {})
1076
1305
  }
1077
1306
  ),
1078
- Le(r) && /* @__PURE__ */ e(
1307
+ Ue(r) && /* @__PURE__ */ e(
1079
1308
  v,
1080
1309
  {
1081
1310
  "aria-label": "Search",
1082
1311
  size: "lg",
1083
1312
  variant: "ghost",
1084
- onClick: () => n("search"),
1085
- children: /* @__PURE__ */ e(ft, {})
1313
+ onClick: () => t("search"),
1314
+ children: /* @__PURE__ */ e(An, {})
1086
1315
  }
1087
1316
  ),
1088
1317
  /* @__PURE__ */ e(
@@ -1090,47 +1319,59 @@ const vn = re.Root, Cn = re.ValueText, Re = () => {
1090
1319
  {
1091
1320
  "aria-label": "Zoom",
1092
1321
  size: "lg",
1093
- variant: u ? "solid" : "ghost",
1322
+ variant: p ? "solid" : "ghost",
1094
1323
  onClick: () => {
1095
- u ? r?.zoom.exit({ animate: !0 }) : r?.zoom.enter({
1324
+ p ? r?.zoom.exit({ animate: !0 }) : r?.zoom.enter({
1096
1325
  animate: !0,
1097
1326
  scale: 2
1098
1327
  });
1099
1328
  },
1100
- children: u ? /* @__PURE__ */ e(mt, {}) : /* @__PURE__ */ e(bt, {})
1329
+ children: p ? /* @__PURE__ */ e(En, {}) : /* @__PURE__ */ e(Fn, {})
1330
+ }
1331
+ ),
1332
+ /* @__PURE__ */ e(
1333
+ v,
1334
+ {
1335
+ "aria-label": "font size",
1336
+ size: "lg",
1337
+ onClick: () => {
1338
+ a(!0);
1339
+ },
1340
+ variant: "ghost",
1341
+ children: /* @__PURE__ */ e(Wn, {})
1101
1342
  }
1102
1343
  ),
1103
- ie(r) && /* @__PURE__ */ e(
1344
+ se(r) && /* @__PURE__ */ e(
1104
1345
  v,
1105
1346
  {
1106
1347
  "aria-label": "Bookmarks",
1107
1348
  size: "lg",
1108
1349
  variant: "ghost",
1109
- onClick: () => n("bookmarks"),
1110
- children: /* @__PURE__ */ e(Rt, {})
1350
+ onClick: () => t("bookmarks"),
1351
+ children: /* @__PURE__ */ e(Nn, {})
1111
1352
  }
1112
1353
  ),
1113
- ie(r) && /* @__PURE__ */ e(
1354
+ se(r) && /* @__PURE__ */ e(
1114
1355
  v,
1115
1356
  {
1116
1357
  "aria-label": "Annotations",
1117
1358
  size: "lg",
1118
1359
  variant: "ghost",
1119
- onClick: () => n("annotations"),
1120
- children: /* @__PURE__ */ e(de, {})
1360
+ onClick: () => t("annotations"),
1361
+ children: /* @__PURE__ */ e(pe, {})
1121
1362
  }
1122
1363
  ),
1123
- $e(r) && /* @__PURE__ */ e(
1364
+ Ke(r) && /* @__PURE__ */ e(
1124
1365
  v,
1125
1366
  {
1126
1367
  "aria-label": "Refit",
1127
1368
  size: "lg",
1128
1369
  variant: "ghost",
1129
1370
  onClick: () => {
1130
- i.next(!0);
1371
+ s(!0);
1131
1372
  },
1132
- disabled: !h,
1133
- children: /* @__PURE__ */ e(yt, {})
1373
+ disabled: !S,
1374
+ children: /* @__PURE__ */ e(jn, {})
1134
1375
  }
1135
1376
  ),
1136
1377
  /* @__PURE__ */ e(
@@ -1138,24 +1379,24 @@ const vn = re.Root, Cn = re.ValueText, Re = () => {
1138
1379
  {
1139
1380
  "aria-label": "Thumbnails",
1140
1381
  size: "lg",
1141
- variant: g ? "solid" : "ghost",
1382
+ variant: h ? "solid" : "ghost",
1142
1383
  onClick: () => {
1143
- g ? r?.zoom.exit({ animate: !0 }) : r?.zoom.enter({
1384
+ h ? r?.zoom.exit({ animate: !0 }) : r?.zoom.enter({
1144
1385
  animate: !0,
1145
1386
  scale: 0.5
1146
1387
  });
1147
1388
  },
1148
- children: /* @__PURE__ */ e(xt, {})
1389
+ children: /* @__PURE__ */ e(Dn, {})
1149
1390
  }
1150
1391
  ),
1151
- _e(r) && /* @__PURE__ */ e(
1392
+ Ze(r) && /* @__PURE__ */ e(
1152
1393
  v,
1153
1394
  {
1154
1395
  "aria-label": "Gallery",
1155
1396
  size: "lg",
1156
1397
  variant: "ghost",
1157
- onClick: () => n("gallery"),
1158
- children: /* @__PURE__ */ e(Pt, {})
1398
+ onClick: () => t("gallery"),
1399
+ children: /* @__PURE__ */ e(Yn, {})
1159
1400
  }
1160
1401
  )
1161
1402
  ] }) })
@@ -1166,33 +1407,33 @@ const vn = re.Root, Cn = re.ValueText, Re = () => {
1166
1407
  }
1167
1408
  );
1168
1409
  }
1169
- ), wn = () => {
1170
- const [t, n] = y(!1), o = ne(() => document.fullscreenElement ? document.exitFullscreen().catch(console.error).then(() => {
1171
- n(!1);
1410
+ ), Kt = () => {
1411
+ const [n, t] = y(!1), o = B(() => document.fullscreenElement ? document.exitFullscreen().catch(console.error).then(() => {
1412
+ t(!1);
1172
1413
  }) : document.documentElement.requestFullscreen({ navigationUI: "hide" }).catch(console.error).then(() => {
1173
- n(!0);
1414
+ t(!0);
1174
1415
  }), []);
1175
- return H(() => {
1416
+ return j(() => {
1176
1417
  function r() {
1177
- n(!!document.fullscreenElement);
1418
+ t(!!document.fullscreenElement);
1178
1419
  }
1179
1420
  return document.addEventListener("fullscreenchange", r), () => {
1180
1421
  document.removeEventListener("fullscreenchange", r);
1181
1422
  };
1182
1423
  }, []), {
1183
- isFullscreen: t,
1424
+ isFullscreen: n,
1184
1425
  onToggleFullscreenClick: o
1185
1426
  };
1186
- }, Pn = f(
1427
+ }, Xt = m(
1187
1428
  ({
1188
- open: t,
1189
- onItemClick: n
1429
+ open: n,
1430
+ onItemClick: t
1190
1431
  }) => {
1191
- const o = m(), r = b(() => o?.context.manifest$, [o]), { isFullscreen: i, onToggleFullscreenClick: a } = wn();
1192
- return /* @__PURE__ */ s(
1193
- We,
1432
+ const o = b(), r = f(() => o?.context.manifest$, [o]), { isFullscreen: i, onToggleFullscreenClick: a } = Kt();
1433
+ return /* @__PURE__ */ l(
1434
+ en,
1194
1435
  {
1195
- present: t,
1436
+ present: n,
1196
1437
  position: "top",
1197
1438
  height: "80px",
1198
1439
  justifyContent: "space-between",
@@ -1204,12 +1445,12 @@ const vn = re.Root, Cn = re.ValueText, Re = () => {
1204
1445
  size: "lg",
1205
1446
  variant: "ghost",
1206
1447
  flexShrink: 0,
1207
- onClick: () => n("back"),
1208
- children: /* @__PURE__ */ e(Dt, {})
1448
+ onClick: () => t("back"),
1449
+ children: /* @__PURE__ */ e(et, {})
1209
1450
  }
1210
1451
  ),
1211
1452
  /* @__PURE__ */ e(
1212
- C,
1453
+ k,
1213
1454
  {
1214
1455
  flex: 1,
1215
1456
  maxW: 600,
@@ -1217,10 +1458,10 @@ const vn = re.Root, Cn = re.ValueText, Re = () => {
1217
1458
  alignItems: "center",
1218
1459
  overflow: "auto",
1219
1460
  px: 4,
1220
- children: /* @__PURE__ */ e(p, { truncate: !0, maxWidth: "100%", children: r?.title })
1461
+ children: /* @__PURE__ */ e(g, { truncate: !0, maxWidth: "100%", children: r?.title })
1221
1462
  }
1222
1463
  ),
1223
- /* @__PURE__ */ s(O, { children: [
1464
+ /* @__PURE__ */ l(_, { children: [
1224
1465
  /* @__PURE__ */ e(
1225
1466
  v,
1226
1467
  {
@@ -1228,8 +1469,8 @@ const vn = re.Root, Cn = re.ValueText, Re = () => {
1228
1469
  size: "lg",
1229
1470
  flexShrink: 0,
1230
1471
  variant: "ghost",
1231
- onClick: () => n("more"),
1232
- children: /* @__PURE__ */ e(Lt, {})
1472
+ onClick: () => t("more"),
1473
+ children: /* @__PURE__ */ e(nt, {})
1233
1474
  }
1234
1475
  ),
1235
1476
  /* @__PURE__ */ e(
@@ -1240,7 +1481,7 @@ const vn = re.Root, Cn = re.ValueText, Re = () => {
1240
1481
  flexShrink: 0,
1241
1482
  variant: "ghost",
1242
1483
  onClick: a,
1243
- children: i ? /* @__PURE__ */ e(Tt, {}) : /* @__PURE__ */ e(wt, {})
1484
+ children: i ? /* @__PURE__ */ e(qn, {}) : /* @__PURE__ */ e(Gn, {})
1244
1485
  }
1245
1486
  )
1246
1487
  ] })
@@ -1248,115 +1489,82 @@ const vn = re.Root, Cn = re.ValueText, Re = () => {
1248
1489
  }
1249
1490
  );
1250
1491
  }
1251
- ), Bn = f(
1492
+ ), Jt = m(
1252
1493
  ({
1253
- onItemClick: t
1494
+ onItemClick: n
1254
1495
  }) => {
1255
- const [n] = Ie(), { refitMenuSignal: o } = E(), r = ue(o);
1256
- return /* @__PURE__ */ s(be, { children: [
1257
- /* @__PURE__ */ e(Pn, { open: n && !r, onItemClick: t }),
1496
+ const [t] = Me(), { refitMenuOpen: o, fontSizeMenuOpen: r } = D([
1497
+ "refitMenuOpen",
1498
+ "fontSizeMenuOpen"
1499
+ ]);
1500
+ return /* @__PURE__ */ l(xe, { children: [
1258
1501
  /* @__PURE__ */ e(
1259
- Tn,
1502
+ Xt,
1260
1503
  {
1261
- open: n && !r,
1262
- onItemClick: t
1504
+ open: t && !o && !r,
1505
+ onItemClick: n
1506
+ }
1507
+ ),
1508
+ /* @__PURE__ */ e(
1509
+ Zt,
1510
+ {
1511
+ open: t && !o && !r,
1512
+ onItemClick: n
1263
1513
  }
1264
1514
  )
1265
1515
  ] });
1266
1516
  }
1267
- ), An = T.forwardRef(
1268
- function(n, o) {
1269
- const { label: r, children: i, helperText: a, errorText: l, optionalText: c, ...d } = n;
1270
- return /* @__PURE__ */ s(J.Root, { ref: o, ...d, children: [
1271
- r && /* @__PURE__ */ s(J.Label, { children: [
1272
- r,
1273
- /* @__PURE__ */ e(J.RequiredIndicator, { fallback: c })
1274
- ] }),
1275
- i,
1276
- a && /* @__PURE__ */ e(J.HelperText, { children: a }),
1277
- l && /* @__PURE__ */ e(J.ErrorText, { children: l })
1278
- ] });
1279
- }
1280
- ), se = T.forwardRef(
1281
- function(n, o) {
1282
- const { children: r, inputProps: i, rootRef: a, ...l } = n;
1283
- return /* @__PURE__ */ s(te.Item, { ref: a, ...l, children: [
1284
- /* @__PURE__ */ e(te.ItemHiddenInput, { ref: o, ...i }),
1285
- /* @__PURE__ */ e(te.ItemIndicator, {}),
1286
- r && /* @__PURE__ */ e(te.ItemText, { children: r })
1517
+ ), de = w.forwardRef(
1518
+ function(t, o) {
1519
+ const { children: r, inputProps: i, rootRef: a, ...s } = t;
1520
+ return /* @__PURE__ */ l(ie.Item, { ref: a, ...s, children: [
1521
+ /* @__PURE__ */ e(ie.ItemHiddenInput, { ref: o, ...i }),
1522
+ /* @__PURE__ */ e(ie.ItemIndicator, {}),
1523
+ r && /* @__PURE__ */ e(ie.ItemText, { children: r })
1287
1524
  ] });
1288
1525
  }
1289
- ), zn = te.Root, He = T.forwardRef(
1290
- function(n, o) {
1291
- const { marks: r, label: i, showValue: a, ...l } = n, c = n.defaultValue ?? n.value, d = r?.map((g) => typeof g == "number" ? { value: g, label: void 0 } : g), u = !!d?.some((g) => g.label);
1292
- return /* @__PURE__ */ s(R.Root, { ref: o, thumbAlignment: "center", ...l, children: [
1293
- i && !a && /* @__PURE__ */ e(R.Label, { children: i }),
1294
- i && a && /* @__PURE__ */ s(O, { justify: "space-between", children: [
1295
- /* @__PURE__ */ e(R.Label, { children: i }),
1296
- /* @__PURE__ */ e(R.ValueText, {})
1297
- ] }),
1298
- /* @__PURE__ */ s(R.Control, { "data-has-mark-label": u || void 0, children: [
1299
- /* @__PURE__ */ e(R.Track, { children: /* @__PURE__ */ e(R.Range, {}) }),
1300
- /* @__PURE__ */ e(On, { value: c }),
1301
- /* @__PURE__ */ e(Mn, { marks: d })
1302
- ] })
1303
- ] });
1304
- }
1305
- );
1306
- function On(t) {
1307
- const { value: n } = t;
1308
- return /* @__PURE__ */ e(at, { each: n, children: (o, r) => /* @__PURE__ */ e(R.Thumb, { index: r, children: /* @__PURE__ */ e(R.HiddenInput, {}) }, r) });
1309
- }
1310
- const Mn = T.forwardRef(
1311
- function(n, o) {
1312
- const { marks: r } = n;
1313
- return r?.length ? /* @__PURE__ */ e(R.MarkerGroup, { ref: o, children: r.map((i, a) => {
1314
- const l = typeof i == "number" ? i : i.value, c = typeof i == "number" ? void 0 : i.label;
1315
- return /* @__PURE__ */ s(R.Marker, { value: l, children: [
1316
- /* @__PURE__ */ e(R.MarkerIndicator, {}),
1317
- c
1318
- ] }, a);
1319
- }) }) : null;
1320
- }
1321
- ), En = f(() => {
1322
- const { refitMenuSignal: n } = E(), o = ue(n), r = m(), i = $e(r) ? r : void 0, a = b(
1526
+ ), eo = ie.Root, no = m(() => {
1527
+ const { refitMenuOpen: t, onRefitMenuOpenChange: o } = D([
1528
+ "refitMenuOpen",
1529
+ "onRefitMenuOpenChange"
1530
+ ]), r = b(), i = Ke(r) ? r : void 0, a = f(
1323
1531
  () => i?.refit.settings$,
1324
1532
  [i]
1325
1533
  );
1326
1534
  return /* @__PURE__ */ e(
1327
- q,
1535
+ Q,
1328
1536
  {
1329
1537
  lazyMount: !0,
1330
- open: o,
1331
- onOpenChange: (l) => n.next(l.open),
1538
+ open: t,
1539
+ onOpenChange: (s) => o(s.open),
1332
1540
  placement: "center",
1333
- children: /* @__PURE__ */ s(G, { children: [
1334
- /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(Q, { children: "Viewport fit" }) }),
1335
- /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ s(fe.Root, { children: [
1336
- /* @__PURE__ */ e(fe.HelperText, { children: "Adjust the viewport for a more comfortable reading experience." }),
1337
- /* @__PURE__ */ s(fe.Content, { children: [
1338
- /* @__PURE__ */ e(An, { label: "Profile", children: /* @__PURE__ */ e(
1339
- zn,
1541
+ children: /* @__PURE__ */ l(G, { children: [
1542
+ /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(X, { children: "Viewport fit" }) }),
1543
+ /* @__PURE__ */ e(K, { children: /* @__PURE__ */ l(W.Root, { children: [
1544
+ /* @__PURE__ */ e(W.HelperText, { children: "Adjust the viewport for a more comfortable reading experience." }),
1545
+ /* @__PURE__ */ l(W.Content, { children: [
1546
+ /* @__PURE__ */ e(Je, { label: "Profile", children: /* @__PURE__ */ e(
1547
+ eo,
1340
1548
  {
1341
1549
  defaultValue: "fit",
1342
- onValueChange: (l) => {
1343
- const c = l.value;
1550
+ onValueChange: (s) => {
1551
+ const c = s.value;
1344
1552
  i?.refit.update({
1345
1553
  viewportFit: c,
1346
1554
  customWidth: 60
1347
1555
  });
1348
1556
  },
1349
1557
  value: a?.viewportFit ?? "fit",
1350
- children: /* @__PURE__ */ s(C, { gap: 2, children: [
1351
- /* @__PURE__ */ e(se, { value: "desktop", children: "Desktop" }),
1352
- /* @__PURE__ */ e(se, { value: "tablet", children: "Tablet" }),
1353
- /* @__PURE__ */ e(se, { value: "fit", children: "Full width (default)" }),
1354
- /* @__PURE__ */ e(se, { value: "custom", children: "Custom" })
1558
+ children: /* @__PURE__ */ l(k, { gap: 2, children: [
1559
+ /* @__PURE__ */ e(de, { value: "desktop", children: "Desktop" }),
1560
+ /* @__PURE__ */ e(de, { value: "tablet", children: "Tablet" }),
1561
+ /* @__PURE__ */ e(de, { value: "fit", children: "Full width (default)" }),
1562
+ /* @__PURE__ */ e(de, { value: "custom", children: "Custom" })
1355
1563
  ] })
1356
1564
  }
1357
1565
  ) }),
1358
1566
  /* @__PURE__ */ e(
1359
- He,
1567
+ Re,
1360
1568
  {
1361
1569
  label: "Maximum width (%)",
1362
1570
  showValue: !0,
@@ -1365,8 +1573,8 @@ const Mn = T.forwardRef(
1365
1573
  step: 1,
1366
1574
  disabled: a?.viewportFit !== "custom",
1367
1575
  value: [a?.customWidth ?? 60],
1368
- onValueChange: (l) => {
1369
- const c = l.value[0] ?? 0;
1576
+ onValueChange: (s) => {
1577
+ const c = s.value[0] ?? 0;
1370
1578
  i?.refit.update({
1371
1579
  customWidth: c
1372
1580
  });
@@ -1375,32 +1583,32 @@ const Mn = T.forwardRef(
1375
1583
  )
1376
1584
  ] })
1377
1585
  ] }) }),
1378
- /* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(K, { asChild: !0, children: /* @__PURE__ */ e(V, { variant: "outline", children: "Close" }) }) }),
1379
- /* @__PURE__ */ e(j, {})
1586
+ /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(J, { asChild: !0, children: /* @__PURE__ */ e(q, { variant: "outline", children: "Close" }) }) }),
1587
+ /* @__PURE__ */ e(Y, {})
1380
1588
  ] })
1381
1589
  }
1382
1590
  );
1383
- }), Dn = f(
1591
+ }), to = m(
1384
1592
  ({
1385
- contextText: t = "",
1386
- startOffset: n = 0,
1593
+ contextText: n = "",
1594
+ startOffset: t = 0,
1387
1595
  text: o,
1388
1596
  cfi: r = "#",
1389
1597
  onClick: i,
1390
1598
  absolutePageIndex: a
1391
1599
  }) => {
1392
- const c = t.substring(
1393
- Math.max(n - 15, 0),
1394
- Math.max(n, 0)
1395
- ), d = t.substring(
1396
- Math.min(n + o.length, t.length - 1),
1600
+ const c = n.substring(
1601
+ Math.max(t - 15, 0),
1602
+ Math.max(t, 0)
1603
+ ), d = n.substring(
1604
+ Math.min(t + o.length, n.length - 1),
1397
1605
  Math.min(
1398
- n + o.length + 15,
1399
- t.length - 1
1606
+ t + o.length + 15,
1607
+ n.length - 1
1400
1608
  )
1401
1609
  );
1402
- return /* @__PURE__ */ s(
1403
- Se,
1610
+ return /* @__PURE__ */ l(
1611
+ Oe,
1404
1612
  {
1405
1613
  href: r,
1406
1614
  style: { margin: 5, overflow: "hidden" },
@@ -1412,60 +1620,60 @@ const Mn = T.forwardRef(
1412
1620
  alignItems: "flex-start",
1413
1621
  gap: 0,
1414
1622
  children: [
1415
- /* @__PURE__ */ s(p, { lineClamp: 1, as: "cite", style: { display: "block" }, children: [
1623
+ /* @__PURE__ */ l(g, { lineClamp: 1, as: "cite", style: { display: "block" }, children: [
1416
1624
  '"',
1417
1625
  c,
1418
1626
  /* @__PURE__ */ e("b", { children: o }),
1419
1627
  d,
1420
1628
  '"'
1421
1629
  ] }),
1422
- /* @__PURE__ */ e(p, { fontSize: "sm", color: "gray.500", style: { textDecoration: "none" }, children: `Book page: ${a !== void 0 ? a + 1 : "unknown (not loaded)"}` })
1630
+ /* @__PURE__ */ e(g, { fontSize: "sm", color: "gray.500", style: { textDecoration: "none" }, children: `Book page: ${a !== void 0 ? a + 1 : "unknown (not loaded)"}` })
1423
1631
  ]
1424
1632
  }
1425
1633
  );
1426
1634
  }
1427
- ), Ln = 500, _n = () => {
1428
- const t = ee(() => new tt("")), n = b(t), o = m(), r = Le(o) ? o : void 0, i = b(() => t.pipe(
1429
- Ce(),
1430
- W(
1431
- (a) => a === "" || !r ? ce(void 0) : Me(
1432
- ce({
1635
+ ), oo = 500, ro = () => {
1636
+ const n = H(() => new Sn("")), t = f(n), o = b(), r = Ue(o) ? o : void 0, i = f(() => n.pipe(
1637
+ Ie(),
1638
+ N(
1639
+ (a) => a === "" || !r ? he(void 0) : qe(
1640
+ he({
1433
1641
  type: "start",
1434
1642
  data: void 0
1435
1643
  }),
1436
- Ee(Ln).pipe(
1437
- W(() => r.search.search(a)),
1438
- _((l) => ({ type: "end", data: l }))
1644
+ Ge(oo).pipe(
1645
+ N(() => r.search.search(a)),
1646
+ E((s) => ({ type: "end", data: s }))
1439
1647
  )
1440
1648
  )
1441
1649
  )
1442
- ), [r, t]);
1650
+ ), [r, n]);
1443
1651
  return {
1444
- value: n,
1445
- setValue: t.next.bind(t),
1652
+ value: t,
1653
+ setValue: n.next.bind(n),
1446
1654
  status: i?.type ?? "idle",
1447
1655
  data: i?.data
1448
1656
  };
1449
- }, $n = f(
1450
- ({ onNavigate: t }) => {
1451
- const n = m(), { value: o, setValue: r, status: i, data: a } = _n(), l = (u) => {
1657
+ }, io = m(
1658
+ ({ onNavigate: n }) => {
1659
+ const t = b(), { value: o, setValue: r, status: i, data: a } = ro(), s = (u) => {
1452
1660
  r(u.target.value);
1453
- }, c = ne(
1661
+ }, c = B(
1454
1662
  (u) => {
1455
- t(), n?.navigation.goToCfi(u);
1663
+ n(), t?.navigation.goToCfi(u);
1456
1664
  },
1457
- [n, t]
1458
- ), d = b(
1459
- () => n?.locateResource(a?.slice(0, 100) ?? []),
1665
+ [t, n]
1666
+ ), d = f(
1667
+ () => t?.locateResource(a?.slice(0, 100) ?? []),
1460
1668
  [a]
1461
1669
  );
1462
- return /* @__PURE__ */ s(C, { flex: 1, height: "100%", gap: 2, children: [
1670
+ return /* @__PURE__ */ l(k, { flex: 1, height: "100%", gap: 2, children: [
1463
1671
  /* @__PURE__ */ e(
1464
- st,
1672
+ On,
1465
1673
  {
1466
1674
  placeholder: "Type something...",
1467
1675
  value: o,
1468
- onChange: l,
1676
+ onChange: s,
1469
1677
  flexShrink: 0,
1470
1678
  variant: "subtle",
1471
1679
  name: "search",
@@ -1475,23 +1683,23 @@ const Mn = T.forwardRef(
1475
1683
  focusRingColor: "transparent"
1476
1684
  }
1477
1685
  ),
1478
- /* @__PURE__ */ s(
1479
- C,
1686
+ /* @__PURE__ */ l(
1687
+ k,
1480
1688
  {
1481
1689
  style: { overflow: "hidden", overflowY: "auto" },
1482
1690
  overflow: "auto",
1483
1691
  px: 4,
1484
1692
  flex: 1,
1485
1693
  children: [
1486
- i === "start" && /* @__PURE__ */ e(p, { children: "Searching ..." }),
1487
- a?.length === 0 && /* @__PURE__ */ e(p, { children: "No results" }),
1488
- i === "end" && (a?.length ?? 0) > 0 && /* @__PURE__ */ s(C, { children: [
1489
- /* @__PURE__ */ s(p, { fontSize: "md", children: [
1694
+ i === "start" && /* @__PURE__ */ e(g, { children: "Searching ..." }),
1695
+ a?.length === 0 && /* @__PURE__ */ e(g, { children: "No results" }),
1696
+ i === "end" && (a?.length ?? 0) > 0 && /* @__PURE__ */ l(k, { children: [
1697
+ /* @__PURE__ */ l(g, { fontSize: "md", children: [
1490
1698
  a?.length,
1491
1699
  " result(s)"
1492
1700
  ] }),
1493
- /* @__PURE__ */ e(C, { gap: 0, children: d?.map((u, g) => /* @__PURE__ */ e(
1494
- Dn,
1701
+ /* @__PURE__ */ e(k, { gap: 0, children: d?.map((u, p) => /* @__PURE__ */ e(
1702
+ to,
1495
1703
  {
1496
1704
  contextText: u.meta?.range?.startContainer.parentElement?.textContent ?? "",
1497
1705
  pageIndex: u.meta?.itemPageIndex,
@@ -1501,7 +1709,7 @@ const Mn = T.forwardRef(
1501
1709
  onClick: c,
1502
1710
  absolutePageIndex: u.meta?.absolutePageIndex
1503
1711
  },
1504
- g
1712
+ p
1505
1713
  )) })
1506
1714
  ] })
1507
1715
  ]
@@ -1509,59 +1717,59 @@ const Mn = T.forwardRef(
1509
1717
  )
1510
1718
  ] });
1511
1719
  }
1512
- ), Fn = f(
1720
+ ), ao = m(
1513
1721
  ({
1514
- open: t,
1515
- setOpen: n,
1722
+ open: n,
1723
+ setOpen: t,
1516
1724
  onNavigate: o
1517
1725
  }) => /* @__PURE__ */ e(
1518
- q,
1726
+ Q,
1519
1727
  {
1520
1728
  lazyMount: !0,
1521
1729
  placement: "center",
1522
- open: t,
1523
- onOpenChange: (r) => n(r.open),
1730
+ open: n,
1731
+ onOpenChange: (r) => t(r.open),
1524
1732
  size: { mdDown: "full", md: "lg" },
1525
1733
  scrollBehavior: "inside",
1526
- children: /* @__PURE__ */ s(G, { height: "100%", children: [
1527
- /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(Q, { children: "Search" }) }),
1528
- /* @__PURE__ */ e(Z, { flex: 1, p: 0, children: /* @__PURE__ */ e($n, { onNavigate: o }) }),
1529
- /* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(K, { asChild: !0, children: /* @__PURE__ */ e(V, { variant: "outline", children: "Cancel" }) }) }),
1530
- /* @__PURE__ */ e(j, {})
1734
+ children: /* @__PURE__ */ l(G, { height: "100%", children: [
1735
+ /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(X, { children: "Search" }) }),
1736
+ /* @__PURE__ */ e(K, { flex: 1, p: 0, children: /* @__PURE__ */ e(io, { onNavigate: o }) }),
1737
+ /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(J, { asChild: !0, children: /* @__PURE__ */ e(q, { variant: "outline", children: "Cancel" }) }) }),
1738
+ /* @__PURE__ */ e(Y, {})
1531
1739
  ] })
1532
1740
  }
1533
1741
  )
1534
- ), Wn = f(
1535
- ({ onNavigate: t }) => {
1536
- const n = m(), { manifest: o, assumedRenditionLayout: r } = b(() => n?.context, [n]) ?? {}, { nav: i } = o ?? {}, a = X();
1742
+ ), lo = m(
1743
+ ({ onNavigate: n }) => {
1744
+ const t = b(), { manifest: o, assumedRenditionLayout: r } = f(() => t?.context, [t]) ?? {}, { nav: i } = o ?? {}, a = oe();
1537
1745
  i?.toc;
1538
- const { beginSpineItemIndex: l, beginPageIndexInSpineItem: c } = a ?? {}, d = (r === "reflowable" ? c : l) || 0;
1746
+ const { beginSpineItemIndex: s, beginPageIndexInSpineItem: c } = a ?? {}, d = (r === "reflowable" ? c : s) || 0;
1539
1747
  let u = a?.beginChapterInfo;
1540
1748
  for (; u?.subChapter; )
1541
1749
  u = u?.subChapter;
1542
- const g = (h, x, S) => /* @__PURE__ */ s(Ne.Fragment, { children: [
1750
+ const p = (h, S, I) => /* @__PURE__ */ l(on.Fragment, { children: [
1543
1751
  /* @__PURE__ */ e(
1544
- P.Item,
1752
+ A.Item,
1545
1753
  {
1546
- pl: 4 * (S + 1),
1754
+ pl: 4 * (I + 1),
1547
1755
  style: {
1548
1756
  display: "flex",
1549
1757
  alignItems: "center"
1550
1758
  },
1551
- children: /* @__PURE__ */ s(
1552
- Se,
1759
+ children: /* @__PURE__ */ l(
1760
+ Oe,
1553
1761
  {
1554
1762
  onClick: () => {
1555
- t(), n?.navigation.goToUrl(h.href);
1763
+ n(), t?.navigation.goToUrl(h.href);
1556
1764
  },
1557
1765
  href: "#",
1558
1766
  children: [
1559
- u?.path === h.path && /* @__PURE__ */ e(P.Indicator, { asChild: !0, children: /* @__PURE__ */ e(we, {}) }),
1560
- u?.path !== h.path && /* @__PURE__ */ e(P.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ e(we, {}) }),
1561
- /* @__PURE__ */ s(C, { gap: 0, children: [
1562
- /* @__PURE__ */ e(p, { fontSize: "md", children: h.title || h.path }),
1767
+ u?.path === h.path && /* @__PURE__ */ e(A.Indicator, { asChild: !0, children: /* @__PURE__ */ e(De, {}) }),
1768
+ u?.path !== h.path && /* @__PURE__ */ e(A.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ e(De, {}) }),
1769
+ /* @__PURE__ */ l(k, { gap: 0, children: [
1770
+ /* @__PURE__ */ e(g, { fontSize: "md", children: h.title || h.path }),
1563
1771
  u?.path === h.path && /* @__PURE__ */ e(
1564
- p,
1772
+ g,
1565
1773
  {
1566
1774
  fontStyle: "italic",
1567
1775
  fontWeight: "bold",
@@ -1575,58 +1783,82 @@ const Mn = T.forwardRef(
1575
1783
  )
1576
1784
  }
1577
1785
  ),
1578
- h.contents.length > 0 && /* @__PURE__ */ e(P.Root, { as: "div", gap: 2, children: h.contents.map(
1579
- (I, w) => g(I, w, S + 1)
1786
+ h.contents.length > 0 && /* @__PURE__ */ e(A.Root, { as: "div", gap: 2, children: h.contents.map(
1787
+ (x, P) => p(x, P, I + 1)
1580
1788
  ) })
1581
- ] }, x);
1582
- return /* @__PURE__ */ e(P.Root, { gap: 3, overflowY: "auto", py: 4, flex: 1, children: i?.toc.map((h, x) => g(h, x, 0)) });
1789
+ ] }, S);
1790
+ return /* @__PURE__ */ e(A.Root, { gap: 3, overflowY: "auto", py: 4, flex: 1, children: i?.toc.map((h, S) => p(h, S, 0)) });
1583
1791
  }
1584
- ), Hn = f(
1792
+ ), so = m(
1585
1793
  ({
1586
- open: t,
1587
- setOpen: n,
1794
+ open: n,
1795
+ setOpen: t,
1588
1796
  onNavigate: o
1589
1797
  }) => /* @__PURE__ */ e(
1590
- q,
1798
+ Q,
1591
1799
  {
1592
1800
  lazyMount: !0,
1593
1801
  placement: "center",
1594
- open: t,
1595
- onOpenChange: (r) => n(r.open),
1802
+ open: n,
1803
+ onOpenChange: (r) => t(r.open),
1596
1804
  size: { mdDown: "full", md: "lg" },
1597
1805
  scrollBehavior: "inside",
1598
- children: /* @__PURE__ */ s(G, { children: [
1599
- /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(Q, { children: "Table of Contents" }) }),
1600
- /* @__PURE__ */ e(Z, { overflowY: "auto", flex: 1, children: /* @__PURE__ */ e(Wn, { onNavigate: o }) }),
1601
- /* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(K, { asChild: !0, children: /* @__PURE__ */ e(V, { variant: "outline", children: "Cancel" }) }) }),
1602
- /* @__PURE__ */ e(j, {})
1806
+ children: /* @__PURE__ */ l(G, { children: [
1807
+ /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(X, { children: "Table of Contents" }) }),
1808
+ /* @__PURE__ */ e(K, { overflowY: "auto", flex: 1, children: /* @__PURE__ */ e(lo, { onNavigate: o }) }),
1809
+ /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(J, { asChild: !0, children: /* @__PURE__ */ e(q, { variant: "outline", children: "Cancel" }) }) }),
1810
+ /* @__PURE__ */ e(Y, {})
1603
1811
  ] })
1604
1812
  }
1605
1813
  )
1606
- ), Nn = f(() => {
1607
- const { quickMenuBottomBarBoundingBox: t } = E(), n = ue(
1608
- t
1609
- ), o = m(), r = b(() => o?.zoom.state$, [o]), i = r?.currentScale ?? 1, a = r?.isZooming, l = n?.borderBoxSize?.[0]?.blockSize ?? 1;
1814
+ ), Ve = 0.5, _e = 1, Le = 5, co = (n, t, o, r) => {
1815
+ if (n > t && n < t + r)
1816
+ return t + r;
1817
+ const i = Math.min(Math.max(n, t), o), a = Math.round((i - t) / r) * r + t;
1818
+ return Math.round(a * 100) / 100;
1819
+ }, uo = m(() => {
1820
+ const { quickMenuBottomBarBoundingBoxSignal: n } = D([
1821
+ "quickMenuBottomBarBoundingBoxSignal"
1822
+ ]), t = te(
1823
+ n
1824
+ ), o = b(), r = f(
1825
+ () => o?.zoom.state$.pipe(
1826
+ E((c) => c.currentScale),
1827
+ He(100, Cn, {
1828
+ leading: !0,
1829
+ trailing: !0
1830
+ })
1831
+ ),
1832
+ [o]
1833
+ ) ?? 1, i = f(
1834
+ () => o?.zoom.state$.pipe(E((c) => c.isZooming)),
1835
+ [o]
1836
+ ) ?? !1, a = co(
1837
+ r,
1838
+ _e,
1839
+ Le,
1840
+ Ve
1841
+ ), s = t?.borderBoxSize?.[0]?.blockSize ?? 1;
1610
1842
  return /* @__PURE__ */ e(
1611
- oe,
1843
+ ae,
1612
1844
  {
1613
- present: a && i > 1,
1845
+ present: i && r > 1,
1614
1846
  animationName: { _open: "fade-in", _closed: "fade-out" },
1615
1847
  animationDuration: "moderate",
1616
1848
  position: "absolute",
1617
- bottom: `calc(${l}px + var(--chakra-spacing-4))`,
1849
+ bottom: `calc(${s}px + var(--chakra-spacing-4))`,
1618
1850
  right: 4,
1619
1851
  backgroundColor: "bg.panel",
1620
1852
  shadow: "sm",
1621
1853
  borderRadius: "md",
1622
1854
  p: 4,
1623
1855
  children: /* @__PURE__ */ e(
1624
- He,
1856
+ Re,
1625
1857
  {
1626
- value: [i],
1627
- min: 1,
1628
- max: 5,
1629
- step: 0.5,
1858
+ value: [a],
1859
+ min: _e,
1860
+ max: Le,
1861
+ step: Ve,
1630
1862
  minWidth: 200,
1631
1863
  onValueChange: (c) => {
1632
1864
  const d = c.value?.[0] ?? 1;
@@ -1636,23 +1868,23 @@ const Mn = T.forwardRef(
1636
1868
  )
1637
1869
  }
1638
1870
  );
1639
- }), so = ({
1640
- enableFloatingTime: t = !0,
1641
- enableFloatingProgress: n = !0,
1871
+ }), Po = ({
1872
+ enableFloatingTime: n = !0,
1873
+ enableFloatingProgress: t = !0,
1642
1874
  onItemClick: o,
1643
1875
  children: r,
1644
1876
  ...i
1645
1877
  }) => {
1646
- const [a, l] = y(!1), [c, d] = y(!1), [u, g] = y(!1), [h, x] = y(void 0), [S, I] = y(!1), [w, M] = Ie(), A = ne(() => {
1647
- l(!1), d(!1), g(!1), x(void 0), M(!1), I(!1);
1648
- }, [M]), ae = ne(
1649
- (z) => {
1650
- z === "annotations" ? x("annotations") : z === "search" ? g(!0) : z === "help" ? d(!0) : z === "toc" ? l(!0) : z === "bookmarks" ? x("bookmarks") : z === "gallery" && I(!0), o?.(z);
1878
+ const [a, s] = y(!1), [c, d] = y(!1), [u, p] = y(!1), [h, S] = y(void 0), [I, x] = y(!1), [P, C] = Me(), z = B(() => {
1879
+ s(!1), d(!1), p(!1), S(void 0), C(!1), x(!1);
1880
+ }, [C]), L = B(
1881
+ (M) => {
1882
+ M === "annotations" ? S("annotations") : M === "search" ? p(!0) : M === "help" ? d(!0) : M === "toc" ? s(!0) : M === "bookmarks" ? S("bookmarks") : M === "gallery" && x(!0), o?.(M);
1651
1883
  },
1652
1884
  [o]
1653
1885
  );
1654
- return gn(), fn(), Xt(), /* @__PURE__ */ s(
1655
- B,
1886
+ return Dt(), Lt(), Ct(), /* @__PURE__ */ l(
1887
+ F,
1656
1888
  {
1657
1889
  position: "absolute",
1658
1890
  top: 0,
@@ -1664,63 +1896,64 @@ const Mn = T.forwardRef(
1664
1896
  ...i,
1665
1897
  children: [
1666
1898
  r,
1667
- n && /* @__PURE__ */ e(
1668
- oe,
1899
+ t && /* @__PURE__ */ e(
1900
+ ae,
1669
1901
  {
1670
- present: !w,
1902
+ present: !P,
1671
1903
  animationName: { _open: "fade-in", _closed: "fade-out" },
1672
1904
  animationDuration: "moderate",
1673
- children: /* @__PURE__ */ e(cn, {})
1905
+ children: /* @__PURE__ */ e(Bt, {})
1674
1906
  }
1675
1907
  ),
1676
- /* @__PURE__ */ e(rn, { open: S, setOpen: I }),
1677
- /* @__PURE__ */ e(En, {}),
1678
- /* @__PURE__ */ e(Bn, { onItemClick: ae }),
1679
- /* @__PURE__ */ e(Nn, {}),
1680
- /* @__PURE__ */ e(Qt, {}),
1681
- /* @__PURE__ */ e(ln, { open: c, setOpen: d }),
1908
+ /* @__PURE__ */ e(Tt, { open: I, setOpen: x }),
1909
+ /* @__PURE__ */ e(no, {}),
1910
+ /* @__PURE__ */ e(Jt, { onItemClick: L }),
1911
+ /* @__PURE__ */ e(uo, {}),
1912
+ /* @__PURE__ */ e(It, {}),
1913
+ /* @__PURE__ */ e(bt, {}),
1914
+ /* @__PURE__ */ e(Pt, { open: c, setOpen: d }),
1682
1915
  /* @__PURE__ */ e(
1683
- Hn,
1916
+ so,
1684
1917
  {
1685
1918
  open: a,
1686
- setOpen: l,
1687
- onNavigate: A
1919
+ setOpen: s,
1920
+ onNavigate: z
1688
1921
  }
1689
1922
  ),
1690
1923
  /* @__PURE__ */ e(
1691
- Fn,
1924
+ ao,
1692
1925
  {
1693
1926
  open: u,
1694
- setOpen: g,
1695
- onNavigate: A
1927
+ setOpen: p,
1928
+ onNavigate: z
1696
1929
  }
1697
1930
  ),
1698
1931
  /* @__PURE__ */ e(
1699
- jt,
1932
+ ht,
1700
1933
  {
1701
1934
  openWith: h,
1702
- setOpen: (z) => x(z ? "annotations" : void 0),
1703
- onNavigate: A
1935
+ setOpen: (M) => S(M ? "annotations" : void 0),
1936
+ onNavigate: z
1704
1937
  }
1705
1938
  ),
1706
1939
  /* @__PURE__ */ e(
1707
- oe,
1940
+ ae,
1708
1941
  {
1709
- present: t || w,
1942
+ present: n || P,
1710
1943
  animationName: { _open: "fade-in", _closed: "fade-out" },
1711
1944
  animationDuration: "slow",
1712
1945
  overflow: "hidden",
1713
- children: /* @__PURE__ */ e(hn, {})
1946
+ children: /* @__PURE__ */ e(Ft, {})
1714
1947
  }
1715
1948
  ),
1716
- /* @__PURE__ */ e(Jt, {})
1949
+ /* @__PURE__ */ e(vt, {})
1717
1950
  ]
1718
1951
  }
1719
1952
  );
1720
1953
  };
1721
1954
  export {
1722
- _t as BOOKMARK_AREA_DATA_ATTRIBUTE,
1723
- so as ReactReader,
1724
- ao as ReactReaderProvider
1955
+ tt as BOOKMARK_AREA_DATA_ATTRIBUTE,
1956
+ Po as ReactReader,
1957
+ wo as ReactReaderProvider
1725
1958
  };
1726
1959
  //# sourceMappingURL=index.js.map