@prose-reader/react-reader 1.186.0 → 1.188.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/ReactReader.d.ts +5 -0
- package/dist/annotations/AnnotationsDialog.d.ts +5 -0
- package/dist/annotations/AnnotationsDialogContent.d.ts +3 -0
- package/dist/bookmarks/BookmarksDialog.d.ts +5 -0
- package/dist/bookmarks/BookmarksDialogContent.d.ts +3 -0
- package/dist/context/useReader.d.ts +8 -0
- package/dist/index.js +791 -503
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/dist/{src/navigation/QuickMenu → quickmenu}/BottomBar.d.ts +2 -3
- package/dist/quickmenu/QuickMenu.d.ts +3 -0
- package/dist/quickmenu/Scrubber.d.ts +3 -0
- package/dist/quickmenu/TopBar.d.ts +4 -0
- package/dist/search/SearchDialog.d.ts +5 -0
- package/dist/search/SearchDialogContent.d.ts +4 -0
- package/dist/search/SearchListItem.d.ts +9 -0
- package/dist/theme/config.d.ts +1 -0
- package/package.json +17 -2
- package/dist/src/ReactReader.d.ts +0 -6
- package/dist/src/context/useReader.d.ts +0 -2
- package/dist/src/navigation/QuickMenu/QuickMenu.d.ts +0 -6
- package/dist/src/navigation/QuickMenu/Scrubber.d.ts +0 -1
- package/dist/src/navigation/QuickMenu/TopBar.d.ts +0 -5
- /package/dist/{src/common → common}/useFullscreen.d.ts +0 -0
- /package/dist/{src/components → components}/ui/accordion.d.ts +0 -0
- /package/dist/{src/components → components}/ui/avatar.d.ts +0 -0
- /package/dist/{src/components → components}/ui/checkbox.d.ts +0 -0
- /package/dist/{src/components → components}/ui/close-button.d.ts +0 -0
- /package/dist/{src/components → components}/ui/color-mode.d.ts +0 -0
- /package/dist/{src/components → components}/ui/dialog.d.ts +0 -0
- /package/dist/{src/components → components}/ui/drawer.d.ts +0 -0
- /package/dist/{src/components → components}/ui/field.d.ts +0 -0
- /package/dist/{src/components → components}/ui/input-group.d.ts +0 -0
- /package/dist/{src/components → components}/ui/popover.d.ts +0 -0
- /package/dist/{src/components → components}/ui/progress.d.ts +0 -0
- /package/dist/{src/components → components}/ui/provider.d.ts +0 -0
- /package/dist/{src/components → components}/ui/radio.d.ts +0 -0
- /package/dist/{src/components → components}/ui/slider.d.ts +0 -0
- /package/dist/{src/components → components}/ui/toggle-tip.d.ts +0 -0
- /package/dist/{src/components → components}/ui/tooltip.d.ts +0 -0
- /package/dist/{src/context → context}/ReactReaderProvider.d.ts +0 -0
- /package/dist/{src/context → context}/context.d.ts +0 -0
- /package/dist/{src/navigation/help → help}/HelpDialog.d.ts +0 -0
- /package/dist/{src/index.d.ts → index.d.ts} +0 -0
- /package/dist/{src/navigation → navigation}/FloatingProgress.d.ts +0 -0
- /package/dist/{src/navigation → navigation}/FloatingTime.d.ts +0 -0
- /package/dist/{src/navigation → navigation}/useNavigationContext.d.ts +0 -0
- /package/dist/{src/pagination → pagination}/usePagination.d.ts +0 -0
- /package/dist/{src/navigation/QuickMenu → quickmenu}/PaginationInfoSection.d.ts +0 -0
- /package/dist/{src/navigation/QuickMenu → quickmenu}/QuickBar.d.ts +0 -0
- /package/dist/{src/navigation/QuickMenu → quickmenu}/ThemedSlider.d.ts +0 -0
- /package/dist/{src/navigation/QuickMenu → quickmenu}/TimeIndicator.d.ts +0 -0
- /package/dist/{src/navigation/QuickMenu → quickmenu}/useQuickMenu.d.ts +0 -0
- /package/dist/{src/settings → settings}/useSettings.d.ts +0 -0
- /package/dist/{src/navigation/toc → toc}/TableOfContentsDialog.d.ts +0 -0
- /package/dist/{src/navigation/toc → toc}/TableOfContentsDialogContent.d.ts +0 -0
package/dist/index.js
CHANGED
|
@@ -1,131 +1,337 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
import { signal as
|
|
5
|
-
import { tap as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
1
|
+
import { jsx as e, jsxs as a, Fragment as X } from "react/jsx-runtime";
|
|
2
|
+
import * as D from "react";
|
|
3
|
+
import fe, { createContext as me, memo as f, useMemo as be, useEffect as Y, useContext as ie, useState as w, useCallback as B } from "react";
|
|
4
|
+
import { signal as xe, useSignal as le, useLiveRef as Ce, useSubscribe as se, useObserve as P, useSignalValue as ve } from "reactjrx";
|
|
5
|
+
import { tap as Ie, switchMap as ae, NEVER as Se, combineLatest as ke, map as ce, startWith as Pe } from "rxjs";
|
|
6
|
+
import { IconButton as C, Portal as de, Dialog as b, List as I, Link as q, Stack as k, Text as g, Button as z, Heading as Q, HStack as O, Kbd as oe, Box as M, Popover as A, Progress as L, Presence as G, chakra as Te, Collapsible as U, Input as we } from "@chakra-ui/react";
|
|
7
|
+
import { LuX as ye, LuNotebookPen as K, LuArrowBigRight as Re, LuArrowBigLeft as Oe, LuChevronDown as De, LuCircleHelp as Ae, LuTableOfContents as ze, LuSearch as Ee, LuCircleCheck as re } from "react-icons/lu";
|
|
8
|
+
import { BsBookmarks as Be } from "react-icons/bs";
|
|
9
|
+
import { RxDoubleArrowUp as Me, RxDoubleArrowLeft as Le, RxDoubleArrowDown as _e, RxDoubleArrowRight as $e } from "react-icons/rx";
|
|
10
|
+
import { HiOutlineInformationCircle as Ne } from "react-icons/hi";
|
|
11
|
+
import Fe from "rc-slider";
|
|
11
12
|
import "rc-slider/assets/index.css";
|
|
12
|
-
import { IoIosArrowBack as
|
|
13
|
-
import { MdFullscreenExit as
|
|
14
|
-
const
|
|
13
|
+
import { IoIosArrowBack as He, IoMdMore as je } from "react-icons/io";
|
|
14
|
+
import { MdFullscreenExit as Ve, MdFullscreen as We } from "react-icons/md";
|
|
15
|
+
const J = me({
|
|
15
16
|
reader: void 0,
|
|
16
|
-
quickMenuSignal:
|
|
17
|
-
}),
|
|
17
|
+
quickMenuSignal: xe({ default: !1 })
|
|
18
|
+
}), Ln = f(
|
|
18
19
|
({
|
|
19
|
-
children:
|
|
20
|
-
reader:
|
|
21
|
-
quickMenuOpen:
|
|
22
|
-
onQuickMenuOpenChange:
|
|
20
|
+
children: n,
|
|
21
|
+
reader: t,
|
|
22
|
+
quickMenuOpen: o,
|
|
23
|
+
onQuickMenuOpenChange: r
|
|
23
24
|
}) => {
|
|
24
|
-
const [,
|
|
25
|
-
default:
|
|
26
|
-
}),
|
|
25
|
+
const [, l] = le({
|
|
26
|
+
default: o
|
|
27
|
+
}), i = Ce(r), c = be(
|
|
27
28
|
() => ({
|
|
28
|
-
quickMenuSignal:
|
|
29
|
-
reader:
|
|
29
|
+
quickMenuSignal: l,
|
|
30
|
+
reader: t
|
|
30
31
|
}),
|
|
31
|
-
[
|
|
32
|
+
[l, t]
|
|
32
33
|
);
|
|
33
|
-
return
|
|
34
|
-
|
|
35
|
-
}, [
|
|
36
|
-
() =>
|
|
37
|
-
[
|
|
38
|
-
), /* @__PURE__ */
|
|
34
|
+
return Y(() => {
|
|
35
|
+
l.setValue(o);
|
|
36
|
+
}, [o, l]), se(
|
|
37
|
+
() => l.subject.pipe(Ie(i.current)),
|
|
38
|
+
[l, i]
|
|
39
|
+
), /* @__PURE__ */ e(J.Provider, { value: c, children: n });
|
|
39
40
|
}
|
|
40
|
-
),
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
41
|
+
), Ye = D.forwardRef(function(t, o) {
|
|
42
|
+
return /* @__PURE__ */ e(C, { variant: "ghost", "aria-label": "Close", ref: o, ...t, children: t.children ?? /* @__PURE__ */ e(ye, {}) });
|
|
43
|
+
}), _ = D.forwardRef(function(t, o) {
|
|
44
|
+
const {
|
|
45
|
+
children: r,
|
|
46
|
+
portalled: l = !0,
|
|
47
|
+
portalRef: i,
|
|
48
|
+
backdrop: c = !0,
|
|
49
|
+
...d
|
|
50
|
+
} = t;
|
|
51
|
+
return /* @__PURE__ */ a(de, { disabled: !l, container: i, children: [
|
|
52
|
+
c && /* @__PURE__ */ e(b.Backdrop, {}),
|
|
53
|
+
/* @__PURE__ */ e(b.Positioner, { children: /* @__PURE__ */ e(b.Content, { ref: o, ...d, asChild: !1, children: r }) })
|
|
54
|
+
] });
|
|
55
|
+
}), $ = D.forwardRef(function(t, o) {
|
|
56
|
+
return /* @__PURE__ */ e(
|
|
57
|
+
b.CloseTrigger,
|
|
58
|
+
{
|
|
59
|
+
position: "absolute",
|
|
60
|
+
top: "2",
|
|
61
|
+
insetEnd: "2",
|
|
62
|
+
...t,
|
|
63
|
+
asChild: !0,
|
|
64
|
+
children: /* @__PURE__ */ e(Ye, { size: "sm", ref: o, children: t.children })
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}), N = b.Root, F = b.Footer, H = b.Header, j = b.Body;
|
|
68
|
+
b.Backdrop;
|
|
69
|
+
const V = b.Title;
|
|
70
|
+
b.Description;
|
|
71
|
+
b.Trigger;
|
|
72
|
+
const W = b.ActionTrigger, R = () => {
|
|
73
|
+
const { reader: n } = ie(J);
|
|
74
|
+
return n;
|
|
75
|
+
}, he = (n) => !!n && "__PROSE_READER_ENHANCER_SEARCH" in n, ue = (n) => !!n && "__PROSE_READER_ENHANCER_BOOKMARKS" in n, ge = (n) => !!n && "__PROSE_READER_ENHANCER_ANNOTATIONS" in n, qe = f(
|
|
76
|
+
({ onNavigate: n }) => {
|
|
77
|
+
const t = R(), o = ge(t) ? t : void 0, r = P(
|
|
78
|
+
() => o == null ? void 0 : o.annotations.highlights$.pipe(
|
|
79
|
+
ae(
|
|
80
|
+
(i) => o.pagination.locate(i)
|
|
81
|
+
)
|
|
82
|
+
),
|
|
83
|
+
[o]
|
|
84
|
+
), l = (i, c) => {
|
|
85
|
+
var d;
|
|
86
|
+
return /* @__PURE__ */ e(I.Item, { children: /* @__PURE__ */ a(
|
|
87
|
+
q,
|
|
88
|
+
{
|
|
89
|
+
href: "#",
|
|
90
|
+
onClick: () => {
|
|
91
|
+
n(), t == null || t.navigation.goToCfi(i.cfi ?? "");
|
|
92
|
+
},
|
|
93
|
+
children: [
|
|
94
|
+
(i.contents ?? [])[0] ? /* @__PURE__ */ e(I.Indicator, { asChild: !0, children: /* @__PURE__ */ e(K, {}) }) : /* @__PURE__ */ e(I.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ e(K, {}) }),
|
|
95
|
+
/* @__PURE__ */ a(k, { gap: 0, children: [
|
|
96
|
+
/* @__PURE__ */ e(g, { lineClamp: 2, fontSize: "md", children: i.selectionAsText ? i.selectionAsText ?? "" : /* @__PURE__ */ e("i", { children: /* @__PURE__ */ e("b", { children: "unknown (not loaded)" }) }) }),
|
|
97
|
+
/* @__PURE__ */ e(
|
|
98
|
+
g,
|
|
99
|
+
{
|
|
100
|
+
fontStyle: "italic",
|
|
101
|
+
fontWeight: "bold",
|
|
102
|
+
fontSize: "sm",
|
|
103
|
+
children: `Book page: ${((d = i.meta) == null ? void 0 : d.absolutePageIndex) !== void 0 ? i.meta.absolutePageIndex + 1 : "unknown (not loaded)"}`
|
|
104
|
+
}
|
|
105
|
+
)
|
|
106
|
+
] })
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
) }, c);
|
|
110
|
+
};
|
|
111
|
+
return /* @__PURE__ */ e(I.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children: r == null ? void 0 : r.map(
|
|
112
|
+
(i, c) => l(i, c)
|
|
113
|
+
) });
|
|
114
|
+
}
|
|
115
|
+
), Ue = f(
|
|
116
|
+
({
|
|
117
|
+
open: n,
|
|
118
|
+
setOpen: t,
|
|
119
|
+
onNavigate: o
|
|
120
|
+
}) => /* @__PURE__ */ e(
|
|
121
|
+
N,
|
|
122
|
+
{
|
|
123
|
+
lazyMount: !0,
|
|
124
|
+
placement: "center",
|
|
125
|
+
open: n,
|
|
126
|
+
onOpenChange: (r) => t(r.open),
|
|
127
|
+
size: { mdDown: "full", md: "lg" },
|
|
128
|
+
scrollBehavior: "inside",
|
|
129
|
+
children: /* @__PURE__ */ a(_, { height: "100%", children: [
|
|
130
|
+
/* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(V, { children: "Annotations" }) }),
|
|
131
|
+
/* @__PURE__ */ e(j, { flex: 1, children: /* @__PURE__ */ e(qe, { onNavigate: o }) }),
|
|
132
|
+
/* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(W, { asChild: !0, children: /* @__PURE__ */ e(z, { variant: "outline", children: "Cancel" }) }) }),
|
|
133
|
+
/* @__PURE__ */ e($, {})
|
|
134
|
+
] })
|
|
135
|
+
}
|
|
136
|
+
)
|
|
137
|
+
), Qe = f(
|
|
138
|
+
({ onNavigate: n }) => {
|
|
139
|
+
const t = R(), o = ue(t) ? t : void 0, r = P(
|
|
140
|
+
() => o == null ? void 0 : o.bookmarks.bookmarks$.pipe(
|
|
141
|
+
ae((i) => o.pagination.locate(i))
|
|
142
|
+
),
|
|
143
|
+
[o]
|
|
144
|
+
), l = (i, c) => {
|
|
145
|
+
var d, u, s, p, h;
|
|
146
|
+
return /* @__PURE__ */ a(I.Item, { justifyContent: "space-between", alignItems: "center", children: [
|
|
147
|
+
/* @__PURE__ */ e(
|
|
148
|
+
q,
|
|
149
|
+
{
|
|
150
|
+
href: "#",
|
|
151
|
+
onClick: () => {
|
|
152
|
+
n(), t == null || t.navigation.goToCfi(i.cfi ?? "");
|
|
153
|
+
},
|
|
154
|
+
children: /* @__PURE__ */ a(k, { gap: 0, children: [
|
|
155
|
+
/* @__PURE__ */ e(g, { fontSize: "md", children: `Book page: ${((d = i.meta) == null ? void 0 : d.absolutePageIndex) !== void 0 ? i.meta.absolutePageIndex + 1 : "unknown"}` }),
|
|
156
|
+
/* @__PURE__ */ e(
|
|
157
|
+
g,
|
|
158
|
+
{
|
|
159
|
+
fontStyle: "italic",
|
|
160
|
+
fontWeight: "bold",
|
|
161
|
+
fontSize: "sm",
|
|
162
|
+
truncate: !0,
|
|
163
|
+
lineClamp: 2,
|
|
164
|
+
children: (s = (u = i.meta) == null ? void 0 : u.startNode) != null && s.textContent ? (h = (p = i.meta) == null ? void 0 : p.startNode) == null ? void 0 : h.textContent : "..."
|
|
165
|
+
}
|
|
166
|
+
)
|
|
167
|
+
] })
|
|
168
|
+
}
|
|
169
|
+
),
|
|
170
|
+
/* @__PURE__ */ e(
|
|
171
|
+
z,
|
|
172
|
+
{
|
|
173
|
+
colorPalette: "red",
|
|
174
|
+
variant: "solid",
|
|
175
|
+
size: "xs",
|
|
176
|
+
onClick: () => {
|
|
177
|
+
o == null || o.bookmarks.delete(i.id);
|
|
178
|
+
},
|
|
179
|
+
children: "Delete"
|
|
180
|
+
}
|
|
181
|
+
)
|
|
182
|
+
] }, c);
|
|
183
|
+
};
|
|
184
|
+
return /* @__PURE__ */ e(I.Root, { overflowY: "auto", gap: 3, variant: "plain", overflow: "auto", children: r == null ? void 0 : r.map(
|
|
185
|
+
(i, c) => l(i, c)
|
|
186
|
+
) });
|
|
187
|
+
}
|
|
188
|
+
), Ge = f(
|
|
189
|
+
({
|
|
190
|
+
open: n,
|
|
191
|
+
setOpen: t,
|
|
192
|
+
onNavigate: o
|
|
193
|
+
}) => /* @__PURE__ */ e(
|
|
194
|
+
N,
|
|
195
|
+
{
|
|
196
|
+
lazyMount: !0,
|
|
197
|
+
placement: "center",
|
|
198
|
+
open: n,
|
|
199
|
+
onOpenChange: (r) => t(r.open),
|
|
200
|
+
size: { mdDown: "full", md: "lg" },
|
|
201
|
+
scrollBehavior: "inside",
|
|
202
|
+
children: /* @__PURE__ */ a(_, { height: "100%", children: [
|
|
203
|
+
/* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(V, { children: "Bookmarks" }) }),
|
|
204
|
+
/* @__PURE__ */ e(j, { children: /* @__PURE__ */ e(Qe, { onNavigate: o }) }),
|
|
205
|
+
/* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(W, { asChild: !0, children: /* @__PURE__ */ e(z, { variant: "outline", children: "Cancel" }) }) }),
|
|
206
|
+
/* @__PURE__ */ e($, {})
|
|
207
|
+
] })
|
|
208
|
+
}
|
|
209
|
+
)
|
|
210
|
+
), Ke = "@prose-reader/react-reader", Xe = "1.187.0", Je = f(
|
|
211
|
+
({
|
|
212
|
+
open: n,
|
|
213
|
+
setOpen: t
|
|
214
|
+
}) => /* @__PURE__ */ e(
|
|
215
|
+
N,
|
|
216
|
+
{
|
|
217
|
+
lazyMount: !0,
|
|
218
|
+
placement: "center",
|
|
219
|
+
open: n,
|
|
220
|
+
onOpenChange: (o) => t(o.open),
|
|
221
|
+
size: { mdDown: "full", md: "lg" },
|
|
222
|
+
scrollBehavior: "inside",
|
|
223
|
+
children: /* @__PURE__ */ a(_, { children: [
|
|
224
|
+
/* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(V, { children: "Help" }) }),
|
|
225
|
+
/* @__PURE__ */ a(j, { overflowY: "auto", flex: 1, children: [
|
|
226
|
+
/* @__PURE__ */ e(Q, { mb: 2, as: "h3", size: "lg", children: "Shortcuts" }),
|
|
227
|
+
/* @__PURE__ */ a(O, { mb: 1, children: [
|
|
228
|
+
/* @__PURE__ */ e(oe, { children: /* @__PURE__ */ e(Re, {}) }),
|
|
229
|
+
" ",
|
|
230
|
+
/* @__PURE__ */ e(g, { children: "Navigate to right page" })
|
|
231
|
+
] }),
|
|
232
|
+
/* @__PURE__ */ a(O, { mb: 1, children: [
|
|
233
|
+
/* @__PURE__ */ e(oe, { children: /* @__PURE__ */ e(Oe, {}) }),
|
|
234
|
+
" ",
|
|
235
|
+
/* @__PURE__ */ e(g, { children: "Navigate to left page" })
|
|
236
|
+
] }),
|
|
237
|
+
/* @__PURE__ */ e(Q, { mb: 2, mt: 4, as: "h3", size: "lg", children: "About" }),
|
|
238
|
+
/* @__PURE__ */ a(g, { children: [
|
|
239
|
+
Ke,
|
|
240
|
+
" version: ",
|
|
241
|
+
Xe
|
|
242
|
+
] })
|
|
243
|
+
] }),
|
|
244
|
+
/* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(W, { asChild: !0, children: /* @__PURE__ */ e(z, { variant: "outline", children: "Cancel" }) }) }),
|
|
245
|
+
/* @__PURE__ */ e($, {})
|
|
246
|
+
] })
|
|
247
|
+
}
|
|
248
|
+
)
|
|
249
|
+
), E = () => {
|
|
250
|
+
const n = R();
|
|
251
|
+
return P(
|
|
252
|
+
() => n ? ke([n.pagination.state$, n.context.state$]).pipe(
|
|
253
|
+
ce(([t, o]) => {
|
|
254
|
+
var l;
|
|
255
|
+
const r = (l = o.manifest) == null ? void 0 : l.spineItems.every(
|
|
256
|
+
(i) => {
|
|
51
257
|
var c;
|
|
52
|
-
return (c =
|
|
258
|
+
return (c = i.mediaType) == null ? void 0 : c.startsWith("image/");
|
|
53
259
|
}
|
|
54
260
|
);
|
|
55
261
|
return {
|
|
56
|
-
...
|
|
57
|
-
hasChapters: !
|
|
262
|
+
...t,
|
|
263
|
+
hasChapters: !o.isFullyPrePaginated && !r
|
|
58
264
|
};
|
|
59
265
|
})
|
|
60
|
-
) :
|
|
61
|
-
[
|
|
266
|
+
) : Se,
|
|
267
|
+
[n]
|
|
62
268
|
);
|
|
63
|
-
},
|
|
64
|
-
const
|
|
65
|
-
((
|
|
66
|
-
),
|
|
67
|
-
return (
|
|
68
|
-
|
|
269
|
+
}, Ze = () => {
|
|
270
|
+
const n = E(), t = Math.floor(
|
|
271
|
+
((n == null ? void 0 : n.percentageEstimateOfBook) ?? 0) * 100
|
|
272
|
+
), o = t > 0 ? t : 1;
|
|
273
|
+
return (n == null ? void 0 : n.percentageEstimateOfBook) === void 0 ? null : /* @__PURE__ */ e(M, { position: "absolute", right: 0, bottom: 0, p: 2, color: "black", children: /* @__PURE__ */ a(g, { fontSize: "sm", children: [
|
|
274
|
+
o,
|
|
69
275
|
" %"
|
|
70
276
|
] }) });
|
|
71
|
-
},
|
|
72
|
-
const [
|
|
73
|
-
return
|
|
74
|
-
const
|
|
75
|
-
|
|
277
|
+
}, en = () => {
|
|
278
|
+
const [n, t] = w(/* @__PURE__ */ new Date());
|
|
279
|
+
return Y(() => {
|
|
280
|
+
const o = setInterval(() => {
|
|
281
|
+
t(/* @__PURE__ */ new Date());
|
|
76
282
|
}, 6e4);
|
|
77
|
-
return () => clearInterval(
|
|
78
|
-
}, []),
|
|
79
|
-
},
|
|
80
|
-
const
|
|
81
|
-
return /* @__PURE__ */
|
|
283
|
+
return () => clearInterval(o);
|
|
284
|
+
}, []), n;
|
|
285
|
+
}, nn = (n) => {
|
|
286
|
+
const t = en();
|
|
287
|
+
return /* @__PURE__ */ e(g, { fontSize: "xs", ...n, children: t.toLocaleTimeString(navigator.language, {
|
|
82
288
|
hour: "2-digit",
|
|
83
289
|
minute: "2-digit"
|
|
84
290
|
}) });
|
|
85
|
-
},
|
|
86
|
-
const { quickMenuSignal:
|
|
87
|
-
return [
|
|
88
|
-
},
|
|
89
|
-
const [
|
|
90
|
-
return /* @__PURE__ */
|
|
91
|
-
|
|
291
|
+
}, Z = () => {
|
|
292
|
+
const { quickMenuSignal: n } = ie(J);
|
|
293
|
+
return [ve(n), n.setValue, n];
|
|
294
|
+
}, tn = () => {
|
|
295
|
+
const [n] = Z();
|
|
296
|
+
return /* @__PURE__ */ e(
|
|
297
|
+
M,
|
|
92
298
|
{
|
|
93
299
|
position: "absolute",
|
|
94
300
|
left: 0,
|
|
95
301
|
bottom: 0,
|
|
96
302
|
p: 2,
|
|
97
|
-
color:
|
|
98
|
-
children: /* @__PURE__ */
|
|
303
|
+
color: n ? void 0 : "colorPalette.contrast",
|
|
304
|
+
children: /* @__PURE__ */ e(nn, {})
|
|
99
305
|
}
|
|
100
306
|
);
|
|
101
|
-
},
|
|
102
|
-
function(
|
|
307
|
+
}, on = D.forwardRef(
|
|
308
|
+
function(t, o) {
|
|
103
309
|
const {
|
|
104
|
-
showArrow:
|
|
105
|
-
children:
|
|
106
|
-
portalled:
|
|
310
|
+
showArrow: r,
|
|
311
|
+
children: l,
|
|
312
|
+
portalled: i = !0,
|
|
107
313
|
content: c,
|
|
108
314
|
portalRef: d,
|
|
109
315
|
...u
|
|
110
|
-
} =
|
|
316
|
+
} = t;
|
|
111
317
|
return /* @__PURE__ */ a(
|
|
112
|
-
|
|
318
|
+
A.Root,
|
|
113
319
|
{
|
|
114
320
|
...u,
|
|
115
321
|
positioning: { ...u.positioning, gutter: 4 },
|
|
116
322
|
children: [
|
|
117
|
-
/* @__PURE__ */
|
|
118
|
-
/* @__PURE__ */
|
|
119
|
-
|
|
323
|
+
/* @__PURE__ */ e(A.Trigger, { asChild: !0, children: l }),
|
|
324
|
+
/* @__PURE__ */ e(de, { disabled: !i, container: d, children: /* @__PURE__ */ e(A.Positioner, { children: /* @__PURE__ */ a(
|
|
325
|
+
A.Content,
|
|
120
326
|
{
|
|
121
327
|
width: "auto",
|
|
122
328
|
px: "2",
|
|
123
329
|
py: "1",
|
|
124
330
|
textStyle: "xs",
|
|
125
331
|
rounded: "sm",
|
|
126
|
-
ref:
|
|
332
|
+
ref: o,
|
|
127
333
|
children: [
|
|
128
|
-
|
|
334
|
+
r && /* @__PURE__ */ e(A.Arrow, { children: /* @__PURE__ */ e(A.ArrowTip, {}) }),
|
|
129
335
|
c
|
|
130
336
|
]
|
|
131
337
|
}
|
|
@@ -134,84 +340,84 @@ const F = le({
|
|
|
134
340
|
}
|
|
135
341
|
);
|
|
136
342
|
}
|
|
137
|
-
),
|
|
138
|
-
const { children:
|
|
139
|
-
return /* @__PURE__ */
|
|
140
|
-
|
|
343
|
+
), rn = D.forwardRef(function(t, o) {
|
|
344
|
+
const { children: r, ...l } = t;
|
|
345
|
+
return /* @__PURE__ */ e(on, { content: r, ...l, ref: o, children: /* @__PURE__ */ e(
|
|
346
|
+
C,
|
|
141
347
|
{
|
|
142
348
|
variant: "ghost",
|
|
143
349
|
"aria-label": "info",
|
|
144
350
|
size: "2xs",
|
|
145
351
|
colorPalette: "gray",
|
|
146
|
-
children: /* @__PURE__ */
|
|
352
|
+
children: /* @__PURE__ */ e(Ne, {})
|
|
147
353
|
}
|
|
148
354
|
) });
|
|
149
|
-
}),
|
|
150
|
-
return /* @__PURE__ */
|
|
355
|
+
}), ln = D.forwardRef(function(t, o) {
|
|
356
|
+
return /* @__PURE__ */ e(L.Track, { ...t, ref: o, children: /* @__PURE__ */ e(L.Range, {}) });
|
|
151
357
|
});
|
|
152
|
-
|
|
153
|
-
const { children:
|
|
154
|
-
return /* @__PURE__ */ a(
|
|
155
|
-
|
|
156
|
-
|
|
358
|
+
D.forwardRef(function(t, o) {
|
|
359
|
+
const { children: r, info: l, ...i } = t;
|
|
360
|
+
return /* @__PURE__ */ a(L.Label, { ...i, ref: o, children: [
|
|
361
|
+
r,
|
|
362
|
+
l && /* @__PURE__ */ e(rn, { children: l })
|
|
157
363
|
] });
|
|
158
364
|
});
|
|
159
|
-
const
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
].sort((
|
|
365
|
+
const sn = L.Root, an = L.ValueText, ee = () => {
|
|
366
|
+
const n = E(), t = (n == null ? void 0 : n.numberOfTotalPages) === 1, o = ((n == null ? void 0 : n.beginNumberOfPagesInSpineItem) ?? 0) > 1, r = ((n == null ? void 0 : n.endNumberOfPagesInSpineItem) ?? 0) > 1, l = (n != null && n.hasChapters ? n == null ? void 0 : n.beginPageIndexInSpineItem : n == null ? void 0 : n.beginAbsolutePageIndex) ?? 0, i = (n != null && n.hasChapters ? n == null ? void 0 : n.endPageIndexInSpineItem : n == null ? void 0 : n.endAbsolutePageIndex) ?? 0, [c = 0, d = 0] = [
|
|
367
|
+
l,
|
|
368
|
+
i
|
|
369
|
+
].sort((p, h) => p - h), u = (n == null ? void 0 : n.beginPageIndexInSpineItem) !== (n == null ? void 0 : n.endPageIndexInSpineItem) || (n == null ? void 0 : n.beginSpineItemIndex) !== (n == null ? void 0 : n.endSpineItemIndex), s = n != null && n.hasChapters ? n == null ? void 0 : n.beginNumberOfPagesInSpineItem : n == null ? void 0 : n.numberOfTotalPages;
|
|
164
370
|
return {
|
|
165
|
-
hasOnlyOnePage:
|
|
166
|
-
beginPageIndex:
|
|
167
|
-
endPageIndex:
|
|
168
|
-
isBeginWithinChapter:
|
|
169
|
-
isEndWithinChapter:
|
|
371
|
+
hasOnlyOnePage: t,
|
|
372
|
+
beginPageIndex: l,
|
|
373
|
+
endPageIndex: i,
|
|
374
|
+
isBeginWithinChapter: o,
|
|
375
|
+
isEndWithinChapter: r,
|
|
170
376
|
beginAndEndAreDifferent: u,
|
|
171
377
|
totalApproximatePages: s,
|
|
172
378
|
leftPageIndex: c,
|
|
173
379
|
rightPageIndex: d
|
|
174
380
|
};
|
|
175
|
-
},
|
|
176
|
-
const
|
|
177
|
-
hasOnlyOnePage:
|
|
178
|
-
leftPageIndex:
|
|
179
|
-
rightPageIndex:
|
|
180
|
-
totalApproximatePages:
|
|
181
|
-
beginAndEndAreDifferent:
|
|
182
|
-
} =
|
|
183
|
-
return /* @__PURE__ */ a(
|
|
184
|
-
/* @__PURE__ */
|
|
185
|
-
/* @__PURE__ */
|
|
186
|
-
/* @__PURE__ */
|
|
381
|
+
}, cn = () => {
|
|
382
|
+
const n = E(), {
|
|
383
|
+
hasOnlyOnePage: t,
|
|
384
|
+
leftPageIndex: o,
|
|
385
|
+
rightPageIndex: r,
|
|
386
|
+
totalApproximatePages: l,
|
|
387
|
+
beginAndEndAreDifferent: i
|
|
388
|
+
} = ee(), c = Math.round(((n == null ? void 0 : n.percentageEstimateOfBook) ?? 0) * 100), d = (s) => s != null && s.subChapter ? `${s.title} / ${d(s.subChapter)}` : (s == null ? void 0 : s.title) || "", u = d(n == null ? void 0 : n.beginChapterInfo);
|
|
389
|
+
return /* @__PURE__ */ a(k, { alignItems: "center", gap: 1, maxW: "100%", overflow: "auto", children: [
|
|
390
|
+
/* @__PURE__ */ e(sn, { value: c, size: "xs", width: 150, children: /* @__PURE__ */ a(O, { justifyContent: "space-between", children: [
|
|
391
|
+
/* @__PURE__ */ e(ln, { width: 110 }),
|
|
392
|
+
/* @__PURE__ */ e(an, { children: `${c}%` })
|
|
187
393
|
] }) }),
|
|
188
|
-
/* @__PURE__ */
|
|
189
|
-
!
|
|
190
|
-
/* @__PURE__ */
|
|
191
|
-
!!(
|
|
192
|
-
/* @__PURE__ */
|
|
193
|
-
/* @__PURE__ */ a(
|
|
394
|
+
/* @__PURE__ */ e(g, { truncate: !0, maxWidth: "100%", fontSize: "sm", mt: 1, children: u ? `Chapter: ${u}` : " " }),
|
|
395
|
+
!t && /* @__PURE__ */ a(O, { children: [
|
|
396
|
+
/* @__PURE__ */ e(g, { fontSize: "xs", children: i ? `${o + 1} - ${r + 1} of ${l}` : `${o + 1} of ${l}` }),
|
|
397
|
+
!!(n != null && n.hasChapters) && /* @__PURE__ */ a(X, { children: [
|
|
398
|
+
/* @__PURE__ */ e(g, { children: "-" }),
|
|
399
|
+
/* @__PURE__ */ a(g, { fontSize: "xs", children: [
|
|
194
400
|
"(",
|
|
195
|
-
((
|
|
401
|
+
((n == null ? void 0 : n.beginAbsolutePageIndex) ?? 0) + 1,
|
|
196
402
|
")"
|
|
197
403
|
] })
|
|
198
404
|
] })
|
|
199
405
|
] })
|
|
200
406
|
] });
|
|
201
|
-
},
|
|
407
|
+
}, pe = f(
|
|
202
408
|
({
|
|
203
|
-
children:
|
|
204
|
-
position:
|
|
205
|
-
...
|
|
206
|
-
}) => /* @__PURE__ */
|
|
207
|
-
|
|
409
|
+
children: n,
|
|
410
|
+
position: t,
|
|
411
|
+
...o
|
|
412
|
+
}) => /* @__PURE__ */ e(
|
|
413
|
+
G,
|
|
208
414
|
{
|
|
209
415
|
display: "flex",
|
|
210
416
|
flexDirection: "row",
|
|
211
417
|
width: "100%",
|
|
212
418
|
position: "absolute",
|
|
213
|
-
...
|
|
214
|
-
animationName:
|
|
419
|
+
...t === "bottom" ? { bottom: 0 } : { top: 0 },
|
|
420
|
+
animationName: t === "bottom" ? {
|
|
215
421
|
_open: "slide-from-bottom, fade-in",
|
|
216
422
|
_closed: "slide-to-bottom, fade-out"
|
|
217
423
|
} : {
|
|
@@ -224,12 +430,12 @@ const We = O.Root, je = O.ValueText, H = () => {
|
|
|
224
430
|
justifyContent: "center",
|
|
225
431
|
shadow: "md",
|
|
226
432
|
p: 4,
|
|
227
|
-
...
|
|
228
|
-
children:
|
|
433
|
+
...o,
|
|
434
|
+
children: n
|
|
229
435
|
}
|
|
230
436
|
)
|
|
231
|
-
),
|
|
232
|
-
|
|
437
|
+
), dn = Te(Fe), hn = f((n) => /* @__PURE__ */ e(
|
|
438
|
+
M,
|
|
233
439
|
{
|
|
234
440
|
display: "contents",
|
|
235
441
|
css: {
|
|
@@ -237,8 +443,8 @@ const We = O.Root, je = O.ValueText, H = () => {
|
|
|
237
443
|
"--bg-emphasized": "colors.bg.emphasized",
|
|
238
444
|
"--color-solid": "colors.colorPalette.solid"
|
|
239
445
|
},
|
|
240
|
-
children: /* @__PURE__ */
|
|
241
|
-
|
|
446
|
+
children: /* @__PURE__ */ e(
|
|
447
|
+
dn,
|
|
242
448
|
{
|
|
243
449
|
keyboard: !1,
|
|
244
450
|
style: {
|
|
@@ -273,408 +479,468 @@ const We = O.Root, je = O.ValueText, H = () => {
|
|
|
273
479
|
height: "24px",
|
|
274
480
|
top: "50%",
|
|
275
481
|
borderColor: "var(--color-solid)",
|
|
276
|
-
transform: `translate(${
|
|
482
|
+
transform: `translate(${n.reverse ? "50%" : "-50%"}, -50%)`,
|
|
277
483
|
backgroundColor: "var(--bg)",
|
|
278
484
|
marginTop: "0px"
|
|
279
485
|
}
|
|
280
486
|
},
|
|
281
|
-
...
|
|
487
|
+
...n
|
|
282
488
|
}
|
|
283
489
|
)
|
|
284
490
|
}
|
|
285
|
-
)),
|
|
286
|
-
const
|
|
287
|
-
default:
|
|
491
|
+
)), un = () => {
|
|
492
|
+
const n = E(), t = n == null ? void 0 : n.isUsingSpread, { beginPageIndex: o, totalApproximatePages: r = 0 } = ee(), l = t ? Math.floor((o || 0) / 2) : o, [i, c] = le({
|
|
493
|
+
default: l || 0
|
|
288
494
|
}), d = 0, u = Math.max(
|
|
289
495
|
0,
|
|
290
|
-
|
|
496
|
+
t ? Math.floor((r - 1) / 2) : r - 1
|
|
291
497
|
);
|
|
292
|
-
return
|
|
293
|
-
c.setValue(
|
|
294
|
-
}, [
|
|
295
|
-
value:
|
|
498
|
+
return Y(() => {
|
|
499
|
+
c.setValue(l || 0);
|
|
500
|
+
}, [l, c]), {
|
|
501
|
+
value: i,
|
|
296
502
|
valueSignal: c,
|
|
297
503
|
min: d,
|
|
298
504
|
max: u
|
|
299
505
|
};
|
|
300
|
-
},
|
|
301
|
-
const
|
|
302
|
-
(
|
|
303
|
-
const [
|
|
304
|
-
|
|
305
|
-
const
|
|
306
|
-
|
|
307
|
-
pageIndex:
|
|
308
|
-
spineItemId:
|
|
506
|
+
}, gn = (n) => {
|
|
507
|
+
const t = R(), o = E(), { manifest: r } = P(() => t == null ? void 0 : t.context.state$, []) ?? {}, l = (r == null ? void 0 : r.readingDirection) === "rtl", i = o == null ? void 0 : o.isUsingSpread, { totalApproximatePages: c = 0, isBeginWithinChapter: d } = ee(), u = 1, s = d, { value: p, valueSignal: h, min: v, max: S } = un(), T = B(
|
|
508
|
+
(m) => {
|
|
509
|
+
const [y = 0] = Array.isArray(m) ? m : [m];
|
|
510
|
+
h.setValue(y);
|
|
511
|
+
const x = i ? Math.floor(y) * 2 : Math.floor(y);
|
|
512
|
+
s ? t == null || t.navigation.goToPageOfSpineItem({
|
|
513
|
+
pageIndex: x,
|
|
514
|
+
spineItemId: t.pagination.getState().beginSpineItemIndex ?? 0,
|
|
309
515
|
animation: !1
|
|
310
|
-
}) :
|
|
311
|
-
absolutePageIndex:
|
|
516
|
+
}) : t == null || t.navigation.goToAbsolutePageIndex({
|
|
517
|
+
absolutePageIndex: x,
|
|
312
518
|
animation: !1
|
|
313
519
|
});
|
|
314
520
|
},
|
|
315
|
-
[
|
|
521
|
+
[t, i, h, s]
|
|
316
522
|
);
|
|
317
|
-
return
|
|
318
|
-
() =>
|
|
523
|
+
return se(
|
|
524
|
+
() => t == null ? void 0 : t.navigation.throttleLock({
|
|
319
525
|
duration: 100,
|
|
320
|
-
trigger:
|
|
526
|
+
trigger: h.subject
|
|
321
527
|
}),
|
|
322
|
-
[
|
|
323
|
-
),
|
|
324
|
-
|
|
528
|
+
[t, h]
|
|
529
|
+
), c === 1 || i && c === 2 ? null : /* @__PURE__ */ e(
|
|
530
|
+
hn,
|
|
325
531
|
{
|
|
326
|
-
value: [
|
|
532
|
+
value: [p],
|
|
327
533
|
max: S,
|
|
328
|
-
min:
|
|
329
|
-
reverse:
|
|
330
|
-
step:
|
|
331
|
-
onChange:
|
|
534
|
+
min: v,
|
|
535
|
+
reverse: l,
|
|
536
|
+
step: u,
|
|
537
|
+
onChange: T,
|
|
538
|
+
...n
|
|
332
539
|
}
|
|
333
540
|
);
|
|
334
|
-
},
|
|
541
|
+
}, pn = f(
|
|
335
542
|
({
|
|
336
|
-
open:
|
|
337
|
-
|
|
338
|
-
onHelpClick: r
|
|
543
|
+
open: n,
|
|
544
|
+
onItemClick: t
|
|
339
545
|
}) => {
|
|
340
|
-
const
|
|
341
|
-
return /* @__PURE__ */
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
546
|
+
const o = R(), r = P(() => o == null ? void 0 : o.navigation.state$, [o]), l = P(() => o == null ? void 0 : o.settings.values$, [o]), i = (l == null ? void 0 : l.computedPageTurnDirection) === "vertical", [c, d] = w(!0);
|
|
547
|
+
return /* @__PURE__ */ e(pe, { present: n, position: "bottom", children: /* @__PURE__ */ a(k, { flex: 1, overflow: "auto", children: [
|
|
548
|
+
/* @__PURE__ */ a(O, { flex: 1, alignItems: "center", justifyContent: "center", children: [
|
|
549
|
+
/* @__PURE__ */ e(
|
|
550
|
+
C,
|
|
551
|
+
{
|
|
552
|
+
"aria-label": "left",
|
|
553
|
+
size: "lg",
|
|
554
|
+
variant: "ghost",
|
|
555
|
+
flexShrink: 0,
|
|
556
|
+
onClick: () => o == null ? void 0 : o.navigation.goToLeftOrTopSpineItem(),
|
|
557
|
+
disabled: !(r != null && r.canGoLeftSpineItem) && !(r != null && r.canGoTopSpineItem),
|
|
558
|
+
children: i ? /* @__PURE__ */ e(Me, {}) : /* @__PURE__ */ e(Le, {})
|
|
559
|
+
}
|
|
560
|
+
),
|
|
561
|
+
/* @__PURE__ */ a(
|
|
562
|
+
k,
|
|
348
563
|
{
|
|
349
564
|
flex: 1,
|
|
565
|
+
maxW: 400,
|
|
566
|
+
gap: 2,
|
|
567
|
+
alignItems: "center",
|
|
568
|
+
overflow: "auto",
|
|
569
|
+
px: 4,
|
|
350
570
|
children: [
|
|
351
|
-
/* @__PURE__ */
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
onClick: () => i == null ? void 0 : i.navigation.goToLeftOrTopSpineItem(),
|
|
360
|
-
disabled: !(o != null && o.canGoLeftSpineItem) && !(o != null && o.canGoTopSpineItem),
|
|
361
|
-
children: c ? /* @__PURE__ */ t(Se, {}) : /* @__PURE__ */ t(Te, {})
|
|
362
|
-
}
|
|
363
|
-
),
|
|
364
|
-
/* @__PURE__ */ a(
|
|
365
|
-
y,
|
|
366
|
-
{
|
|
367
|
-
flex: 1,
|
|
368
|
-
maxW: 400,
|
|
369
|
-
gap: 2,
|
|
370
|
-
alignItems: "center",
|
|
371
|
-
overflow: "visible",
|
|
372
|
-
px: 4,
|
|
373
|
-
children: [
|
|
374
|
-
/* @__PURE__ */ t(Ne, {}),
|
|
375
|
-
/* @__PURE__ */ t(z, { height: 5, maxW: 300, width: "100%", overflow: "visible", children: /* @__PURE__ */ t(Ue, {}) })
|
|
376
|
-
]
|
|
571
|
+
/* @__PURE__ */ e(cn, {}),
|
|
572
|
+
/* @__PURE__ */ e(
|
|
573
|
+
gn,
|
|
574
|
+
{
|
|
575
|
+
style: {
|
|
576
|
+
width: "100%",
|
|
577
|
+
maxWidth: "300px",
|
|
578
|
+
height: "35px"
|
|
377
579
|
}
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
580
|
+
}
|
|
581
|
+
)
|
|
582
|
+
]
|
|
583
|
+
}
|
|
584
|
+
),
|
|
585
|
+
/* @__PURE__ */ e(
|
|
586
|
+
C,
|
|
587
|
+
{
|
|
588
|
+
"aria-label": "right",
|
|
589
|
+
size: "lg",
|
|
590
|
+
flexShrink: 0,
|
|
591
|
+
variant: "ghost",
|
|
592
|
+
disabled: !(r != null && r.canGoRightSpineItem) && !(r != null && r.canGoBottomSpineItem),
|
|
593
|
+
onClick: () => {
|
|
594
|
+
o == null || o.navigation.goToRightOrBottomSpineItem();
|
|
595
|
+
},
|
|
596
|
+
children: i ? /* @__PURE__ */ e(_e, {}) : /* @__PURE__ */ e($e, {})
|
|
597
|
+
}
|
|
598
|
+
)
|
|
599
|
+
] }),
|
|
600
|
+
/* @__PURE__ */ e(O, { alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ a(
|
|
601
|
+
U.Root,
|
|
602
|
+
{
|
|
603
|
+
open: c,
|
|
604
|
+
flex: 1,
|
|
605
|
+
onOpenChange: ({ open: u }) => {
|
|
606
|
+
d(u);
|
|
607
|
+
},
|
|
608
|
+
children: [
|
|
609
|
+
/* @__PURE__ */ e(
|
|
610
|
+
U.Trigger,
|
|
611
|
+
{
|
|
612
|
+
paddingY: "3",
|
|
613
|
+
width: "100%",
|
|
614
|
+
display: "flex",
|
|
615
|
+
justifyContent: "center",
|
|
616
|
+
children: /* @__PURE__ */ e(
|
|
617
|
+
De,
|
|
381
618
|
{
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
variant: "ghost",
|
|
386
|
-
disabled: !(o != null && o.canGoRightSpineItem) && !(o != null && o.canGoBottomSpineItem),
|
|
387
|
-
onClick: () => {
|
|
388
|
-
i == null || i.navigation.goToRightOrBottomSpineItem();
|
|
389
|
-
},
|
|
390
|
-
children: c ? /* @__PURE__ */ t(ke, {}) : /* @__PURE__ */ t(we, {})
|
|
619
|
+
style: {
|
|
620
|
+
transform: c ? "rotate(0deg)" : "rotate(180deg)"
|
|
621
|
+
}
|
|
391
622
|
}
|
|
392
623
|
)
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
624
|
+
}
|
|
625
|
+
),
|
|
626
|
+
/* @__PURE__ */ a(U.Content, { display: "flex", justifyContent: "center", children: [
|
|
627
|
+
/* @__PURE__ */ e(
|
|
628
|
+
C,
|
|
396
629
|
{
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
/* @__PURE__ */ t(
|
|
443
|
-
p,
|
|
444
|
-
{
|
|
445
|
-
"aria-label": "Table of contents",
|
|
446
|
-
size: "lg",
|
|
447
|
-
variant: "ghost",
|
|
448
|
-
onClick: n,
|
|
449
|
-
children: /* @__PURE__ */ t(Ce, {})
|
|
450
|
-
}
|
|
451
|
-
)
|
|
452
|
-
]
|
|
453
|
-
}
|
|
454
|
-
)
|
|
455
|
-
]
|
|
456
|
-
}
|
|
457
|
-
)
|
|
630
|
+
"aria-label": "Help",
|
|
631
|
+
size: "lg",
|
|
632
|
+
variant: "ghost",
|
|
633
|
+
onClick: () => t("help"),
|
|
634
|
+
children: /* @__PURE__ */ e(Ae, {})
|
|
635
|
+
}
|
|
636
|
+
),
|
|
637
|
+
/* @__PURE__ */ e(
|
|
638
|
+
C,
|
|
639
|
+
{
|
|
640
|
+
"aria-label": "Table of contents",
|
|
641
|
+
size: "lg",
|
|
642
|
+
variant: "ghost",
|
|
643
|
+
onClick: () => t("toc"),
|
|
644
|
+
children: /* @__PURE__ */ e(ze, {})
|
|
645
|
+
}
|
|
646
|
+
),
|
|
647
|
+
he(o) && /* @__PURE__ */ e(
|
|
648
|
+
C,
|
|
649
|
+
{
|
|
650
|
+
"aria-label": "Search",
|
|
651
|
+
size: "lg",
|
|
652
|
+
variant: "ghost",
|
|
653
|
+
onClick: () => t("search"),
|
|
654
|
+
children: /* @__PURE__ */ e(Ee, {})
|
|
655
|
+
}
|
|
656
|
+
),
|
|
657
|
+
ue(o) && /* @__PURE__ */ e(
|
|
658
|
+
C,
|
|
659
|
+
{
|
|
660
|
+
"aria-label": "Search",
|
|
661
|
+
size: "lg",
|
|
662
|
+
variant: "ghost",
|
|
663
|
+
onClick: () => t("bookmarks"),
|
|
664
|
+
children: /* @__PURE__ */ e(Be, {})
|
|
665
|
+
}
|
|
666
|
+
),
|
|
667
|
+
ge(o) && /* @__PURE__ */ e(
|
|
668
|
+
C,
|
|
669
|
+
{
|
|
670
|
+
"aria-label": "Search",
|
|
671
|
+
size: "lg",
|
|
672
|
+
variant: "ghost",
|
|
673
|
+
onClick: () => t("annotations"),
|
|
674
|
+
children: /* @__PURE__ */ e(K, {})
|
|
458
675
|
}
|
|
459
676
|
)
|
|
460
|
-
]
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
}
|
|
464
|
-
);
|
|
677
|
+
] })
|
|
678
|
+
]
|
|
679
|
+
}
|
|
680
|
+
) })
|
|
681
|
+
] }) });
|
|
465
682
|
}
|
|
466
|
-
),
|
|
467
|
-
const [
|
|
468
|
-
|
|
683
|
+
), fn = () => {
|
|
684
|
+
const [n, t] = w(!1), o = B(() => document.fullscreenElement ? document.exitFullscreen().catch(console.error).then(() => {
|
|
685
|
+
t(!1);
|
|
469
686
|
}) : document.documentElement.requestFullscreen({ navigationUI: "hide" }).catch(console.error).then(() => {
|
|
470
|
-
|
|
687
|
+
t(!0);
|
|
471
688
|
}), []);
|
|
472
|
-
return
|
|
473
|
-
function
|
|
474
|
-
|
|
689
|
+
return Y(() => {
|
|
690
|
+
function r() {
|
|
691
|
+
t(!!document.fullscreenElement);
|
|
475
692
|
}
|
|
476
|
-
return document.addEventListener("fullscreenchange",
|
|
477
|
-
document.removeEventListener("fullscreenchange",
|
|
693
|
+
return document.addEventListener("fullscreenchange", r), () => {
|
|
694
|
+
document.removeEventListener("fullscreenchange", r);
|
|
478
695
|
};
|
|
479
696
|
}, []), {
|
|
480
|
-
isFullscreen:
|
|
481
|
-
onToggleFullscreenClick:
|
|
697
|
+
isFullscreen: n,
|
|
698
|
+
onToggleFullscreenClick: o
|
|
482
699
|
};
|
|
483
|
-
},
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
}) => {
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
{
|
|
500
|
-
"aria-label": "left",
|
|
501
|
-
size: "lg",
|
|
502
|
-
variant: "ghost",
|
|
503
|
-
flexShrink: 0,
|
|
504
|
-
onClick: n,
|
|
505
|
-
children: /* @__PURE__ */ t(ye, {})
|
|
506
|
-
}
|
|
507
|
-
),
|
|
508
|
-
/* @__PURE__ */ t(
|
|
509
|
-
y,
|
|
510
|
-
{
|
|
511
|
-
flex: 1,
|
|
512
|
-
maxW: 600,
|
|
513
|
-
gap: 1,
|
|
514
|
-
alignItems: "center",
|
|
515
|
-
overflow: "auto",
|
|
516
|
-
px: 4,
|
|
517
|
-
children: /* @__PURE__ */ t(m, { truncate: !0, maxWidth: "100%", children: o == null ? void 0 : o.title })
|
|
518
|
-
}
|
|
519
|
-
),
|
|
520
|
-
/* @__PURE__ */ a(x, { children: [
|
|
521
|
-
/* @__PURE__ */ t(
|
|
522
|
-
p,
|
|
700
|
+
}, mn = f(
|
|
701
|
+
({
|
|
702
|
+
open: n,
|
|
703
|
+
onItemClick: t
|
|
704
|
+
}) => {
|
|
705
|
+
const o = R(), r = P(() => o == null ? void 0 : o.context.manifest$, [o]), { isFullscreen: l, onToggleFullscreenClick: i } = fn();
|
|
706
|
+
return /* @__PURE__ */ a(
|
|
707
|
+
pe,
|
|
708
|
+
{
|
|
709
|
+
present: n,
|
|
710
|
+
position: "top",
|
|
711
|
+
height: "80px",
|
|
712
|
+
justifyContent: "space-between",
|
|
713
|
+
children: [
|
|
714
|
+
/* @__PURE__ */ e(
|
|
715
|
+
C,
|
|
523
716
|
{
|
|
524
|
-
"aria-label": "
|
|
717
|
+
"aria-label": "left",
|
|
525
718
|
size: "lg",
|
|
526
|
-
flexShrink: 0,
|
|
527
719
|
variant: "ghost",
|
|
528
|
-
|
|
529
|
-
|
|
720
|
+
flexShrink: 0,
|
|
721
|
+
onClick: () => t("back"),
|
|
722
|
+
children: /* @__PURE__ */ e(He, {})
|
|
530
723
|
}
|
|
531
724
|
),
|
|
532
|
-
/* @__PURE__ */
|
|
533
|
-
|
|
725
|
+
/* @__PURE__ */ e(
|
|
726
|
+
k,
|
|
534
727
|
{
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
728
|
+
flex: 1,
|
|
729
|
+
maxW: 600,
|
|
730
|
+
gap: 1,
|
|
731
|
+
alignItems: "center",
|
|
732
|
+
overflow: "auto",
|
|
733
|
+
px: 4,
|
|
734
|
+
children: /* @__PURE__ */ e(g, { truncate: !0, maxWidth: "100%", children: r == null ? void 0 : r.title })
|
|
541
735
|
}
|
|
542
|
-
)
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
736
|
+
),
|
|
737
|
+
/* @__PURE__ */ a(O, { children: [
|
|
738
|
+
/* @__PURE__ */ e(
|
|
739
|
+
C,
|
|
740
|
+
{
|
|
741
|
+
"aria-label": "right",
|
|
742
|
+
size: "lg",
|
|
743
|
+
flexShrink: 0,
|
|
744
|
+
variant: "ghost",
|
|
745
|
+
onClick: () => t("more"),
|
|
746
|
+
children: /* @__PURE__ */ e(je, {})
|
|
747
|
+
}
|
|
748
|
+
),
|
|
749
|
+
/* @__PURE__ */ e(
|
|
750
|
+
C,
|
|
751
|
+
{
|
|
752
|
+
"aria-label": "right",
|
|
753
|
+
size: "lg",
|
|
754
|
+
flexShrink: 0,
|
|
755
|
+
variant: "ghost",
|
|
756
|
+
onClick: i,
|
|
757
|
+
children: l ? /* @__PURE__ */ e(Ve, {}) : /* @__PURE__ */ e(We, {})
|
|
758
|
+
}
|
|
759
|
+
)
|
|
760
|
+
] })
|
|
761
|
+
]
|
|
762
|
+
}
|
|
763
|
+
);
|
|
764
|
+
}
|
|
765
|
+
), bn = f(
|
|
766
|
+
({
|
|
767
|
+
onItemClick: n
|
|
768
|
+
}) => {
|
|
769
|
+
const [t] = Z();
|
|
770
|
+
return /* @__PURE__ */ a(X, { children: [
|
|
771
|
+
/* @__PURE__ */ e(mn, { open: t, onItemClick: n }),
|
|
772
|
+
/* @__PURE__ */ e(pn, { open: t, onItemClick: n })
|
|
773
|
+
] });
|
|
774
|
+
}
|
|
775
|
+
), xn = f(
|
|
776
|
+
({
|
|
777
|
+
contextText: n = "",
|
|
778
|
+
startOffset: t = 0,
|
|
779
|
+
text: o,
|
|
780
|
+
cfi: r = "#",
|
|
781
|
+
onClick: l,
|
|
782
|
+
absolutePageIndex: i
|
|
783
|
+
}) => {
|
|
784
|
+
const d = n.substring(
|
|
785
|
+
Math.max(t - 15, 0),
|
|
786
|
+
Math.max(t, 0)
|
|
787
|
+
), u = n.substring(
|
|
788
|
+
Math.min(t + o.length, n.length - 1),
|
|
789
|
+
Math.min(
|
|
790
|
+
t + o.length + 15,
|
|
791
|
+
n.length - 1
|
|
792
|
+
)
|
|
793
|
+
);
|
|
794
|
+
return /* @__PURE__ */ a(
|
|
795
|
+
q,
|
|
796
|
+
{
|
|
797
|
+
href: r,
|
|
798
|
+
style: { margin: 5, overflow: "hidden" },
|
|
799
|
+
onClick: (s) => {
|
|
800
|
+
s.preventDefault(), l(r);
|
|
801
|
+
},
|
|
802
|
+
display: "flex",
|
|
803
|
+
flexDirection: "column",
|
|
804
|
+
alignItems: "flex-start",
|
|
805
|
+
gap: 0,
|
|
806
|
+
children: [
|
|
807
|
+
/* @__PURE__ */ a(g, { lineClamp: 1, as: "cite", style: { display: "block" }, children: [
|
|
808
|
+
'"',
|
|
809
|
+
d,
|
|
810
|
+
/* @__PURE__ */ e("b", { children: o }),
|
|
811
|
+
u,
|
|
812
|
+
'"'
|
|
813
|
+
] }),
|
|
814
|
+
/* @__PURE__ */ e(g, { fontSize: "sm", color: "gray.500", style: { textDecoration: "none" }, children: `Book page: ${i !== void 0 ? i + 1 : "unknown (not loaded)"}` })
|
|
815
|
+
]
|
|
816
|
+
}
|
|
817
|
+
);
|
|
818
|
+
}
|
|
819
|
+
), Cn = f(
|
|
548
820
|
({
|
|
549
|
-
|
|
550
|
-
onMoreClick: n,
|
|
551
|
-
onTableOfContentsClick: r,
|
|
552
|
-
onHelpClick: i
|
|
821
|
+
onNavigate: n
|
|
553
822
|
}) => {
|
|
554
|
-
const [o] =
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
823
|
+
const [t, o] = w(""), r = R(), l = he(r) ? r : void 0, i = (h) => {
|
|
824
|
+
o(h.target.value);
|
|
825
|
+
}, c = B(
|
|
826
|
+
(h) => {
|
|
827
|
+
n(), r == null || r.navigation.goToCfi(h);
|
|
828
|
+
},
|
|
829
|
+
[r, n]
|
|
830
|
+
), d = P(
|
|
831
|
+
() => l == null ? void 0 : l.search.search(t).pipe(
|
|
832
|
+
ce((h) => ({ type: "end", data: h })),
|
|
833
|
+
Pe({ type: "start" })
|
|
834
|
+
),
|
|
835
|
+
[r, t]
|
|
836
|
+
), u = (d == null ? void 0 : d.type) === "start", s = (d == null ? void 0 : d.type) === "end" ? d.data : [], p = P(
|
|
837
|
+
() => r == null ? void 0 : r.pagination.locate(s.slice(0, 100)),
|
|
838
|
+
[s]
|
|
839
|
+
);
|
|
840
|
+
return /* @__PURE__ */ a(k, { flex: 1, height: "100%", children: [
|
|
841
|
+
/* @__PURE__ */ e(M, { px: 4, children: /* @__PURE__ */ e(
|
|
842
|
+
we,
|
|
558
843
|
{
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
844
|
+
placeholder: "Type something...",
|
|
845
|
+
value: t,
|
|
846
|
+
onChange: i,
|
|
847
|
+
borderRadius: 0
|
|
562
848
|
}
|
|
563
|
-
),
|
|
564
|
-
/* @__PURE__ */
|
|
565
|
-
|
|
849
|
+
) }),
|
|
850
|
+
/* @__PURE__ */ a(
|
|
851
|
+
M,
|
|
566
852
|
{
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
853
|
+
px: 4,
|
|
854
|
+
pb: 4,
|
|
855
|
+
mt: 2,
|
|
856
|
+
flex: 1,
|
|
857
|
+
style: { overflow: "hidden", overflowY: "auto" },
|
|
858
|
+
children: [
|
|
859
|
+
u && /* @__PURE__ */ e(g, { children: "Searching ..." }),
|
|
860
|
+
!u && s.length === 0 && /* @__PURE__ */ e("p", { children: "There are no results" }),
|
|
861
|
+
!u && s.length >= 0 && /* @__PURE__ */ a(k, { children: [
|
|
862
|
+
/* @__PURE__ */ a(Q, { as: "h2", size: "md", children: [
|
|
863
|
+
s.length,
|
|
864
|
+
" result(s)"
|
|
865
|
+
] }),
|
|
866
|
+
/* @__PURE__ */ e(k, { gap: 0, children: p == null ? void 0 : p.map((h, v) => {
|
|
867
|
+
var S, T, m, y, x, ne, te;
|
|
868
|
+
return /* @__PURE__ */ e(
|
|
869
|
+
xn,
|
|
870
|
+
{
|
|
871
|
+
contextText: ((m = (T = (S = h.meta) == null ? void 0 : S.range) == null ? void 0 : T.startContainer.parentElement) == null ? void 0 : m.textContent) ?? "",
|
|
872
|
+
pageIndex: (y = h.meta) == null ? void 0 : y.itemPageIndex,
|
|
873
|
+
startOffset: ((ne = (x = h.meta) == null ? void 0 : x.range) == null ? void 0 : ne.startOffset) ?? 0,
|
|
874
|
+
text: t,
|
|
875
|
+
cfi: h.cfi,
|
|
876
|
+
onClick: c,
|
|
877
|
+
absolutePageIndex: (te = h.meta) == null ? void 0 : te.absolutePageIndex
|
|
878
|
+
},
|
|
879
|
+
v
|
|
880
|
+
);
|
|
881
|
+
}) })
|
|
882
|
+
] })
|
|
883
|
+
]
|
|
570
884
|
}
|
|
571
885
|
)
|
|
572
886
|
] });
|
|
573
887
|
}
|
|
574
|
-
),
|
|
575
|
-
return /* @__PURE__ */ t(p, { variant: "ghost", "aria-label": "Close", ref: r, ...n, children: n.children ?? /* @__PURE__ */ t(Ie, {}) });
|
|
576
|
-
}), X = C.forwardRef(function(n, r) {
|
|
577
|
-
const {
|
|
578
|
-
children: i,
|
|
579
|
-
portalled: o = !0,
|
|
580
|
-
portalRef: l,
|
|
581
|
-
backdrop: c = !0,
|
|
582
|
-
...d
|
|
583
|
-
} = n;
|
|
584
|
-
return /* @__PURE__ */ a(Q, { disabled: !o, container: l, children: [
|
|
585
|
-
c && /* @__PURE__ */ t(g.Backdrop, {}),
|
|
586
|
-
/* @__PURE__ */ t(g.Positioner, { children: /* @__PURE__ */ t(g.Content, { ref: r, ...d, asChild: !1, children: i }) })
|
|
587
|
-
] });
|
|
588
|
-
}), J = C.forwardRef(function(n, r) {
|
|
589
|
-
return /* @__PURE__ */ t(
|
|
590
|
-
g.CloseTrigger,
|
|
591
|
-
{
|
|
592
|
-
position: "absolute",
|
|
593
|
-
top: "2",
|
|
594
|
-
insetEnd: "2",
|
|
595
|
-
...n,
|
|
596
|
-
asChild: !0,
|
|
597
|
-
children: /* @__PURE__ */ t(Ze, { size: "sm", ref: r, children: n.children })
|
|
598
|
-
}
|
|
599
|
-
);
|
|
600
|
-
}), Z = g.Root, ee = g.Footer, te = g.Header, ne = g.Body;
|
|
601
|
-
g.Backdrop;
|
|
602
|
-
const oe = g.Title;
|
|
603
|
-
g.Description;
|
|
604
|
-
g.Trigger;
|
|
605
|
-
const re = g.ActionTrigger, et = b(
|
|
888
|
+
), vn = f(
|
|
606
889
|
({
|
|
607
|
-
open:
|
|
608
|
-
setOpen:
|
|
609
|
-
|
|
610
|
-
|
|
890
|
+
open: n,
|
|
891
|
+
setOpen: t,
|
|
892
|
+
onNavigate: o
|
|
893
|
+
}) => /* @__PURE__ */ e(
|
|
894
|
+
N,
|
|
611
895
|
{
|
|
612
896
|
lazyMount: !0,
|
|
613
897
|
placement: "center",
|
|
614
|
-
open:
|
|
615
|
-
onOpenChange: (r) =>
|
|
898
|
+
open: n,
|
|
899
|
+
onOpenChange: (r) => t(r.open),
|
|
616
900
|
size: { mdDown: "full", md: "lg" },
|
|
617
901
|
scrollBehavior: "inside",
|
|
618
|
-
children: /* @__PURE__ */ a(
|
|
619
|
-
/* @__PURE__ */
|
|
620
|
-
/* @__PURE__ */
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
/* @__PURE__ */ t(N, { children: /* @__PURE__ */ t(ve, {}) }),
|
|
624
|
-
" ",
|
|
625
|
-
/* @__PURE__ */ t(m, { children: "Navigate to right page" })
|
|
626
|
-
] }),
|
|
627
|
-
/* @__PURE__ */ a(x, { mb: 1, children: [
|
|
628
|
-
/* @__PURE__ */ t(N, { children: /* @__PURE__ */ t(Pe, {}) }),
|
|
629
|
-
" ",
|
|
630
|
-
/* @__PURE__ */ t(m, { children: "Navigate to left page" })
|
|
631
|
-
] }),
|
|
632
|
-
/* @__PURE__ */ t(j, { mb: 2, mt: 4, as: "h3", size: "lg", children: "About" }),
|
|
633
|
-
/* @__PURE__ */ a(m, { children: [
|
|
634
|
-
Xe,
|
|
635
|
-
" version: ",
|
|
636
|
-
Je
|
|
637
|
-
] })
|
|
638
|
-
] }),
|
|
639
|
-
/* @__PURE__ */ t(ee, { children: /* @__PURE__ */ t(re, { asChild: !0, children: /* @__PURE__ */ t(G, { variant: "outline", children: "Cancel" }) }) }),
|
|
640
|
-
/* @__PURE__ */ t(J, {})
|
|
902
|
+
children: /* @__PURE__ */ a(_, { height: "100%", children: [
|
|
903
|
+
/* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(V, { children: "Search" }) }),
|
|
904
|
+
/* @__PURE__ */ e(j, { flex: 1, children: /* @__PURE__ */ e(Cn, { onNavigate: o }) }),
|
|
905
|
+
/* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(W, { asChild: !0, children: /* @__PURE__ */ e(z, { variant: "outline", children: "Cancel" }) }) }),
|
|
906
|
+
/* @__PURE__ */ e($, {})
|
|
641
907
|
] })
|
|
642
908
|
}
|
|
643
909
|
)
|
|
644
|
-
),
|
|
910
|
+
), In = f(
|
|
645
911
|
({
|
|
646
|
-
onNavigate:
|
|
912
|
+
onNavigate: n
|
|
647
913
|
}) => {
|
|
648
|
-
const
|
|
649
|
-
|
|
650
|
-
const { beginSpineItemIndex: c, beginPageIndexInSpineItem: d } =
|
|
651
|
-
console.log({ assumedRenditionLayout:
|
|
652
|
-
let s =
|
|
914
|
+
const t = R(), { manifest: o, assumedRenditionLayout: r } = P(() => t == null ? void 0 : t.context.state$, [t]) ?? {}, { nav: l } = o ?? {}, i = E();
|
|
915
|
+
l != null && l.toc;
|
|
916
|
+
const { beginSpineItemIndex: c, beginPageIndexInSpineItem: d } = i ?? {}, u = (r === "reflowable" ? d : c) || 0;
|
|
917
|
+
console.log({ assumedRenditionLayout: r, currentSpineItemOrChapterPageIndex: u });
|
|
918
|
+
let s = i == null ? void 0 : i.beginChapterInfo;
|
|
653
919
|
for (; s != null && s.subChapter; )
|
|
654
920
|
s = s == null ? void 0 : s.subChapter;
|
|
655
|
-
const
|
|
656
|
-
/* @__PURE__ */
|
|
657
|
-
|
|
921
|
+
const p = (h, v, S) => /* @__PURE__ */ a(fe.Fragment, { children: [
|
|
922
|
+
/* @__PURE__ */ e(
|
|
923
|
+
I.Item,
|
|
658
924
|
{
|
|
659
|
-
pl: 4 * (
|
|
925
|
+
pl: 4 * (S + 1),
|
|
660
926
|
style: {
|
|
661
927
|
display: "flex",
|
|
662
928
|
alignItems: "center"
|
|
663
929
|
},
|
|
664
930
|
children: /* @__PURE__ */ a(
|
|
665
|
-
|
|
931
|
+
q,
|
|
666
932
|
{
|
|
667
933
|
onClick: () => {
|
|
668
|
-
|
|
934
|
+
n(), t == null || t.navigation.goToUrl(h.href);
|
|
669
935
|
},
|
|
670
936
|
href: "#",
|
|
671
937
|
children: [
|
|
672
|
-
(s == null ? void 0 : s.path) === h.path && /* @__PURE__ */
|
|
673
|
-
(s == null ? void 0 : s.path) !== h.path && /* @__PURE__ */
|
|
674
|
-
/* @__PURE__ */ a(
|
|
675
|
-
/* @__PURE__ */
|
|
676
|
-
(s == null ? void 0 : s.path) === h.path && /* @__PURE__ */
|
|
677
|
-
|
|
938
|
+
(s == null ? void 0 : s.path) === h.path && /* @__PURE__ */ e(I.Indicator, { asChild: !0, children: /* @__PURE__ */ e(re, {}) }),
|
|
939
|
+
(s == null ? void 0 : s.path) !== h.path && /* @__PURE__ */ e(I.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ e(re, {}) }),
|
|
940
|
+
/* @__PURE__ */ a(k, { gap: 0, children: [
|
|
941
|
+
/* @__PURE__ */ e(g, { fontSize: "md", children: h.title || h.path }),
|
|
942
|
+
(s == null ? void 0 : s.path) === h.path && /* @__PURE__ */ e(
|
|
943
|
+
g,
|
|
678
944
|
{
|
|
679
945
|
fontStyle: "italic",
|
|
680
946
|
fontWeight: "bold",
|
|
@@ -688,83 +954,105 @@ const re = g.ActionTrigger, et = b(
|
|
|
688
954
|
)
|
|
689
955
|
}
|
|
690
956
|
),
|
|
691
|
-
h.contents.length > 0 && /* @__PURE__ */
|
|
692
|
-
(T,
|
|
957
|
+
h.contents.length > 0 && /* @__PURE__ */ e(I.Root, { as: "div", gap: 2, children: h.contents.map(
|
|
958
|
+
(T, m) => p(T, m, S + 1)
|
|
693
959
|
) })
|
|
694
|
-
] },
|
|
695
|
-
return /* @__PURE__ */
|
|
960
|
+
] }, v);
|
|
961
|
+
return /* @__PURE__ */ e(I.Root, { gap: 3, overflowY: "auto", py: 4, flex: 1, children: l == null ? void 0 : l.toc.map((h, v) => p(h, v, 0)) });
|
|
696
962
|
}
|
|
697
|
-
),
|
|
963
|
+
), Sn = f(
|
|
698
964
|
({
|
|
699
|
-
open:
|
|
700
|
-
setOpen:
|
|
701
|
-
onNavigate:
|
|
702
|
-
}) => /* @__PURE__ */
|
|
703
|
-
|
|
965
|
+
open: n,
|
|
966
|
+
setOpen: t,
|
|
967
|
+
onNavigate: o
|
|
968
|
+
}) => /* @__PURE__ */ e(
|
|
969
|
+
N,
|
|
704
970
|
{
|
|
705
971
|
lazyMount: !0,
|
|
706
972
|
placement: "center",
|
|
707
|
-
open:
|
|
708
|
-
onOpenChange: (
|
|
973
|
+
open: n,
|
|
974
|
+
onOpenChange: (r) => t(r.open),
|
|
709
975
|
size: { mdDown: "full", md: "lg" },
|
|
710
976
|
scrollBehavior: "inside",
|
|
711
|
-
children: /* @__PURE__ */ a(
|
|
712
|
-
/* @__PURE__ */
|
|
713
|
-
/* @__PURE__ */
|
|
714
|
-
/* @__PURE__ */
|
|
715
|
-
/* @__PURE__ */
|
|
977
|
+
children: /* @__PURE__ */ a(_, { children: [
|
|
978
|
+
/* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(V, { children: "Table of Contents" }) }),
|
|
979
|
+
/* @__PURE__ */ e(j, { overflowY: "auto", flex: 1, children: /* @__PURE__ */ e(In, { onNavigate: o }) }),
|
|
980
|
+
/* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(W, { asChild: !0, children: /* @__PURE__ */ e(z, { variant: "outline", children: "Cancel" }) }) }),
|
|
981
|
+
/* @__PURE__ */ e($, {})
|
|
716
982
|
] })
|
|
717
983
|
}
|
|
718
984
|
)
|
|
719
|
-
),
|
|
720
|
-
enableFloatingTime:
|
|
721
|
-
enableFloatingProgress:
|
|
722
|
-
|
|
985
|
+
), _n = ({
|
|
986
|
+
enableFloatingTime: n = !0,
|
|
987
|
+
enableFloatingProgress: t = !0,
|
|
988
|
+
onItemClick: o
|
|
723
989
|
}) => {
|
|
724
|
-
const [
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
990
|
+
const [r, l] = w(!1), [i, c] = w(!1), [d, u] = w(!1), [s, p] = w(!1), [h, v] = w(!1), [S, T] = Z(), m = B(() => {
|
|
991
|
+
l(!1), c(!1), u(!1), p(!1), v(!1), T(!1);
|
|
992
|
+
}, [T]), y = B(
|
|
993
|
+
(x) => {
|
|
994
|
+
x === "annotations" ? p(!0) : x === "search" ? u(!0) : x === "help" ? c(!0) : x === "toc" ? l(!0) : x === "bookmarks" && v(!0), o == null || o(x);
|
|
995
|
+
},
|
|
996
|
+
[o]
|
|
997
|
+
);
|
|
998
|
+
return /* @__PURE__ */ a(X, { children: [
|
|
999
|
+
t && /* @__PURE__ */ e(
|
|
1000
|
+
G,
|
|
728
1001
|
{
|
|
729
|
-
present: !
|
|
1002
|
+
present: !S,
|
|
730
1003
|
animationName: { _open: "fade-in", _closed: "fade-out" },
|
|
731
1004
|
animationDuration: "moderate",
|
|
732
|
-
children: /* @__PURE__ */
|
|
1005
|
+
children: /* @__PURE__ */ e(Ze, {})
|
|
733
1006
|
}
|
|
734
1007
|
),
|
|
735
|
-
/* @__PURE__ */
|
|
736
|
-
|
|
1008
|
+
/* @__PURE__ */ e(bn, { onItemClick: y }),
|
|
1009
|
+
/* @__PURE__ */ e(Je, { open: i, setOpen: c }),
|
|
1010
|
+
/* @__PURE__ */ e(
|
|
1011
|
+
Sn,
|
|
737
1012
|
{
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
1013
|
+
open: r,
|
|
1014
|
+
setOpen: l,
|
|
1015
|
+
onNavigate: m
|
|
741
1016
|
}
|
|
742
1017
|
),
|
|
743
|
-
/* @__PURE__ */
|
|
744
|
-
|
|
745
|
-
nt,
|
|
1018
|
+
/* @__PURE__ */ e(
|
|
1019
|
+
vn,
|
|
746
1020
|
{
|
|
747
|
-
open:
|
|
748
|
-
setOpen:
|
|
749
|
-
onNavigate:
|
|
750
|
-
|
|
751
|
-
|
|
1021
|
+
open: d,
|
|
1022
|
+
setOpen: u,
|
|
1023
|
+
onNavigate: m
|
|
1024
|
+
}
|
|
1025
|
+
),
|
|
1026
|
+
/* @__PURE__ */ e(
|
|
1027
|
+
Ue,
|
|
1028
|
+
{
|
|
1029
|
+
open: s,
|
|
1030
|
+
setOpen: p,
|
|
1031
|
+
onNavigate: m
|
|
1032
|
+
}
|
|
1033
|
+
),
|
|
1034
|
+
/* @__PURE__ */ e(
|
|
1035
|
+
Ge,
|
|
1036
|
+
{
|
|
1037
|
+
open: h,
|
|
1038
|
+
setOpen: v,
|
|
1039
|
+
onNavigate: m
|
|
752
1040
|
}
|
|
753
1041
|
),
|
|
754
|
-
/* @__PURE__ */
|
|
755
|
-
|
|
1042
|
+
/* @__PURE__ */ e(
|
|
1043
|
+
G,
|
|
756
1044
|
{
|
|
757
|
-
present:
|
|
1045
|
+
present: n || S,
|
|
758
1046
|
animationName: { _open: "fade-in", _closed: "fade-out" },
|
|
759
1047
|
animationDuration: "slow",
|
|
760
1048
|
overflow: "hidden",
|
|
761
|
-
children: /* @__PURE__ */
|
|
1049
|
+
children: /* @__PURE__ */ e(tn, {})
|
|
762
1050
|
}
|
|
763
1051
|
)
|
|
764
1052
|
] });
|
|
765
1053
|
};
|
|
766
1054
|
export {
|
|
767
|
-
|
|
768
|
-
|
|
1055
|
+
_n as ReactReader,
|
|
1056
|
+
Ln as ReactReaderProvider
|
|
769
1057
|
};
|
|
770
1058
|
//# sourceMappingURL=index.js.map
|