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