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