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