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