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