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