@prose-reader/react-reader 1.255.0 → 1.256.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { jsxs as l, jsx as e, Fragment as
|
|
1
|
+
import { jsxs as l, jsx as e, Fragment as Ce } from "react/jsx-runtime";
|
|
2
2
|
import * as B from "react";
|
|
3
|
-
import
|
|
4
|
-
import { signal as V, useObserve as b, useConstant as oe, useSignalValue as
|
|
5
|
-
import { Subject as
|
|
6
|
-
import { IconButton as I, Portal as
|
|
7
|
-
import { LuX as Sn, LuNotebookPen as
|
|
3
|
+
import Ue, { createContext as Ye, useContext as Ae, useEffect as N, memo as v, useCallback as D, useState as y, useMemo as Ze, useLayoutEffect as Xe, useRef as Ke } from "react";
|
|
4
|
+
import { signal as V, useObserve as b, useConstant as oe, useSignalValue as ce, isDefined as De, useLiveRef as Je, useSubscribe as pe, useSignalState as en } from "reactjrx";
|
|
5
|
+
import { Subject as nn, map as L, filter as de, switchMap as W, EMPTY as Te, of as ue, withLatestFrom as tn, NEVER as Se, startWith as on, distinctUntilChanged as Fe, throttleTime as _e, tap as rn, first as Le, combineLatest as an, mergeMap as ln, Observable as sn, skip as cn, merge as $e, timer as Ve, finalize as dn, BehaviorSubject as un, animationFrameScheduler as hn } from "rxjs";
|
|
6
|
+
import { IconButton as I, Portal as xe, Dialog as T, List as A, Link as ke, Stack as O, Text as m, Tabs as E, Button as G, Presence as ae, Box as _, createToaster as pn, Toaster as gn, Toast as J, Spinner as fn, RadioGroup as re, Slider as w, HStack as F, For as mn, useMediaQuery as bn, Fieldset as H, Heading as me, Kbd as ze, Popover as ee, Progress as le, chakra as vn, Collapsible as be, Field as te, Input as Cn } from "@chakra-ui/react";
|
|
7
|
+
import { LuX as Sn, LuNotebookPen as he, LuBookmark as xn, LuCheck as kn, LuArrowBigRight as In, LuArrowBigLeft as Rn, LuChevronDown as On, LuCircleHelp as Mn, LuTableOfContents as Tn, LuSearch as zn, LuZoomOut as wn, LuZoomIn as yn, LuGalleryHorizontal as Pn, LuCircleCheck as we } from "react-icons/lu";
|
|
8
8
|
import { createPortal as En } from "react-dom";
|
|
9
9
|
import { isPositionInArea as Bn } from "@prose-reader/enhancer-gestures";
|
|
10
10
|
import { isShallowEqual as An, observeIntersection as Dn, isHtmlTagElement as Fn } from "@prose-reader/core";
|
|
11
11
|
import { BiFontSize as _n } from "react-icons/bi";
|
|
12
12
|
import { BsBookmarks as Ln } from "react-icons/bs";
|
|
13
|
-
import { MdOutlineFitScreen as $n, MdFullscreenExit as Vn, MdFullscreen as
|
|
14
|
-
import { RiGalleryView2 as
|
|
15
|
-
import { RxDoubleArrowUp as
|
|
13
|
+
import { MdOutlineFitScreen as $n, MdFullscreenExit as Vn, MdFullscreen as Hn } from "react-icons/md";
|
|
14
|
+
import { RiGalleryView2 as Wn } from "react-icons/ri";
|
|
15
|
+
import { RxDoubleArrowUp as Nn, RxDoubleArrowLeft as Gn, RxDoubleArrowDown as qn, RxDoubleArrowRight as jn } from "react-icons/rx";
|
|
16
16
|
import { HiOutlineInformationCircle as Qn } from "react-icons/hi";
|
|
17
|
-
import
|
|
17
|
+
import Un from "rc-slider";
|
|
18
18
|
import "rc-slider/assets/index.css";
|
|
19
|
-
import { IoIosArrowBack as
|
|
20
|
-
const
|
|
19
|
+
import { IoIosArrowBack as Yn, IoMdMore as Zn } from "react-icons/io";
|
|
20
|
+
const Xn = "data-bookmark-area", He = () => ({
|
|
21
21
|
reader: void 0,
|
|
22
22
|
quickMenuOpen: !1,
|
|
23
23
|
onQuickMenuOpenChange: () => {
|
|
@@ -25,7 +25,7 @@ const Kn = "data-bookmark-area", We = () => ({
|
|
|
25
25
|
quickMenuBottomBarBoundingBoxSignal: V({
|
|
26
26
|
default: void 0
|
|
27
27
|
}),
|
|
28
|
-
notificationsSubject: new
|
|
28
|
+
notificationsSubject: new nn(),
|
|
29
29
|
refitMenuOpen: !1,
|
|
30
30
|
onRefitMenuOpenChange: () => {
|
|
31
31
|
},
|
|
@@ -35,26 +35,29 @@ const Kn = "data-bookmark-area", We = () => ({
|
|
|
35
35
|
fontSizeMin: 0.2,
|
|
36
36
|
fontSizeMax: 5,
|
|
37
37
|
uncontrolledFontSize: 1
|
|
38
|
-
}),
|
|
39
|
-
V({ default:
|
|
38
|
+
}), Ie = Ye(
|
|
39
|
+
V({ default: He() })
|
|
40
40
|
), $ = (n) => {
|
|
41
|
-
const t =
|
|
41
|
+
const t = Ae(Ie);
|
|
42
42
|
return b(t, n);
|
|
43
|
-
},
|
|
43
|
+
}, Kn = () => Ae(Ie), C = () => {
|
|
44
44
|
const { reader: n } = $(["reader"]);
|
|
45
45
|
return n;
|
|
46
|
-
},
|
|
47
|
-
const n = C(), { fontSize: t } = $([
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
}, We = (n) => !!n && "__PROSE_READER_ENHANCER_SEARCH" in n, se = (n) => !!n && "__PROSE_READER_ENHANCER_ANNOTATIONS" in n, Ne = (n) => !!n && "__PROSE_READER_ENHANCER_GALLERY" in n, Ge = (n) => !!n && "__PROSE_READER_ENHANCER_REFIT" in n, Jn = () => {
|
|
47
|
+
const n = C(), { fontSize: t, uncontrolledFontSize: o } = $([
|
|
48
|
+
"fontSize",
|
|
49
|
+
"uncontrolledFontSize"
|
|
50
|
+
]), r = t ?? o;
|
|
51
|
+
return N(() => {
|
|
52
|
+
if (n && r) {
|
|
53
|
+
const i = setTimeout(() => {
|
|
51
54
|
n.settings.update({
|
|
52
|
-
fontScale:
|
|
55
|
+
fontScale: r
|
|
53
56
|
});
|
|
54
57
|
}, 200);
|
|
55
|
-
return () => clearTimeout(
|
|
58
|
+
return () => clearTimeout(i);
|
|
56
59
|
}
|
|
57
|
-
}, [n,
|
|
60
|
+
}, [n, r]), null;
|
|
58
61
|
}, et = ({
|
|
59
62
|
children: n,
|
|
60
63
|
onQuickMenuOpenChange: t,
|
|
@@ -65,9 +68,9 @@ const Kn = "data-bookmark-area", We = () => ({
|
|
|
65
68
|
onFontSizeChange: s,
|
|
66
69
|
...c
|
|
67
70
|
}) => {
|
|
68
|
-
const d = oe(() => V({ default:
|
|
71
|
+
const d = oe(() => V({ default: He() })), u = oe(
|
|
69
72
|
() => V({ default: d.value.fontSizeMenuOpen })
|
|
70
|
-
), g =
|
|
73
|
+
), g = ce(
|
|
71
74
|
u
|
|
72
75
|
), p = D(
|
|
73
76
|
(M) => {
|
|
@@ -81,7 +84,7 @@ const Kn = "data-bookmark-area", We = () => ({
|
|
|
81
84
|
f.update(M);
|
|
82
85
|
},
|
|
83
86
|
[f]
|
|
84
|
-
), k =
|
|
87
|
+
), k = ce(
|
|
85
88
|
f
|
|
86
89
|
), z = o ?? k, x = t ?? S, R = oe(
|
|
87
90
|
() => V({ default: d.value.refitMenuOpen })
|
|
@@ -90,10 +93,10 @@ const Kn = "data-bookmark-area", We = () => ({
|
|
|
90
93
|
R.update(M);
|
|
91
94
|
},
|
|
92
95
|
[R]
|
|
93
|
-
), h =
|
|
96
|
+
), h = ce(
|
|
94
97
|
R
|
|
95
98
|
);
|
|
96
|
-
return
|
|
99
|
+
return N(() => {
|
|
97
100
|
d.update((M) => ({
|
|
98
101
|
...M,
|
|
99
102
|
...c,
|
|
@@ -121,8 +124,8 @@ const Kn = "data-bookmark-area", We = () => ({
|
|
|
121
124
|
p,
|
|
122
125
|
h,
|
|
123
126
|
P
|
|
124
|
-
]), /* @__PURE__ */ e(
|
|
125
|
-
},
|
|
127
|
+
]), /* @__PURE__ */ e(Ie.Provider, { value: d, children: n });
|
|
128
|
+
}, To = v(
|
|
126
129
|
({
|
|
127
130
|
children: n,
|
|
128
131
|
...t
|
|
@@ -132,7 +135,7 @@ const Kn = "data-bookmark-area", We = () => ({
|
|
|
132
135
|
] })
|
|
133
136
|
), nt = B.forwardRef(function(t, o) {
|
|
134
137
|
return /* @__PURE__ */ e(I, { variant: "ghost", "aria-label": "Close", ref: o, ...t, children: t.children ?? /* @__PURE__ */ e(Sn, {}) });
|
|
135
|
-
}),
|
|
138
|
+
}), q = B.forwardRef(function(t, o) {
|
|
136
139
|
const {
|
|
137
140
|
children: r,
|
|
138
141
|
portalled: i = !0,
|
|
@@ -140,11 +143,11 @@ const Kn = "data-bookmark-area", We = () => ({
|
|
|
140
143
|
backdrop: s = !0,
|
|
141
144
|
...c
|
|
142
145
|
} = t;
|
|
143
|
-
return /* @__PURE__ */ l(
|
|
146
|
+
return /* @__PURE__ */ l(xe, { disabled: !i, container: a, children: [
|
|
144
147
|
s && /* @__PURE__ */ e(T.Backdrop, {}),
|
|
145
148
|
/* @__PURE__ */ e(T.Positioner, { children: /* @__PURE__ */ e(T.Content, { ref: o, ...c, asChild: !1, children: r }) })
|
|
146
149
|
] });
|
|
147
|
-
}),
|
|
150
|
+
}), j = B.forwardRef(function(t, o) {
|
|
148
151
|
return /* @__PURE__ */ e(
|
|
149
152
|
T.CloseTrigger,
|
|
150
153
|
{
|
|
@@ -156,36 +159,36 @@ const Kn = "data-bookmark-area", We = () => ({
|
|
|
156
159
|
children: /* @__PURE__ */ e(nt, { size: "sm", ref: o, children: t.children })
|
|
157
160
|
}
|
|
158
161
|
);
|
|
159
|
-
}), Q = T.Root,
|
|
162
|
+
}), Q = T.Root, U = T.Footer, Y = T.Header, Z = T.Body;
|
|
160
163
|
T.Backdrop;
|
|
161
|
-
const
|
|
164
|
+
const X = T.Title;
|
|
162
165
|
T.Description;
|
|
163
166
|
T.Trigger;
|
|
164
|
-
const
|
|
167
|
+
const K = T.ActionTrigger, tt = (n) => {
|
|
165
168
|
const t = C(), o = se(t) ? t : void 0;
|
|
166
169
|
return { data: b(
|
|
167
170
|
() => o?.annotations.annotations$.pipe(
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
+
L((i) => i.find((a) => a.id === n)),
|
|
172
|
+
de(De),
|
|
173
|
+
W((i) => o.locateResource(i))
|
|
171
174
|
),
|
|
172
175
|
[o]
|
|
173
176
|
) };
|
|
174
|
-
},
|
|
177
|
+
}, qe = ({
|
|
175
178
|
id: n,
|
|
176
179
|
onNavigate: t,
|
|
177
180
|
allowLeftIcon: o = !0
|
|
178
181
|
}) => {
|
|
179
182
|
const r = C(), { data: i } = tt(n), a = i?.meta.range?.toString() || i?.meta.node?.textContent;
|
|
180
183
|
return /* @__PURE__ */ e(A.Item, { children: /* @__PURE__ */ l(
|
|
181
|
-
|
|
184
|
+
ke,
|
|
182
185
|
{
|
|
183
186
|
href: "#",
|
|
184
187
|
onClick: () => {
|
|
185
188
|
t(), r?.navigation.goToCfi(i?.meta.cfi ?? "");
|
|
186
189
|
},
|
|
187
190
|
children: [
|
|
188
|
-
i?.resource?.notes ? /* @__PURE__ */ e(A.Indicator, { asChild: !0, children: /* @__PURE__ */ e(
|
|
191
|
+
i?.resource?.notes ? /* @__PURE__ */ e(A.Indicator, { asChild: !0, children: /* @__PURE__ */ e(he, {}) }) : o ? /* @__PURE__ */ e(A.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ e(he, {}) }) : null,
|
|
189
192
|
/* @__PURE__ */ l(O, { gap: 0, children: [
|
|
190
193
|
a ? /* @__PURE__ */ e(m, { lineClamp: 2, fontSize: "md", children: a }) : /* @__PURE__ */ l(m, { lineClamp: 2, fontSize: "md", fontStyle: "italic", children: [
|
|
191
194
|
"Page ",
|
|
@@ -208,7 +211,7 @@ const X = T.ActionTrigger, tt = (n) => {
|
|
|
208
211
|
const n = C(), t = se(n) ? n : void 0;
|
|
209
212
|
return { data: b(
|
|
210
213
|
() => t?.annotations.annotations$.pipe(
|
|
211
|
-
|
|
214
|
+
W(
|
|
212
215
|
(r) => t.locateResource(r)
|
|
213
216
|
)
|
|
214
217
|
),
|
|
@@ -222,7 +225,7 @@ const X = T.ActionTrigger, tt = (n) => {
|
|
|
222
225
|
}, rt = ({ onNavigate: n }) => {
|
|
223
226
|
const { data: t } = ot();
|
|
224
227
|
return /* @__PURE__ */ e(A.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children: t?.map((o) => /* @__PURE__ */ e(
|
|
225
|
-
|
|
228
|
+
qe,
|
|
226
229
|
{
|
|
227
230
|
id: o.resource.id,
|
|
228
231
|
onNavigate: n
|
|
@@ -239,7 +242,7 @@ const X = T.ActionTrigger, tt = (n) => {
|
|
|
239
242
|
}, at = ({ onNavigate: n }) => {
|
|
240
243
|
const { data: t } = it();
|
|
241
244
|
return /* @__PURE__ */ e(A.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children: t?.map((o) => /* @__PURE__ */ e(
|
|
242
|
-
|
|
245
|
+
qe,
|
|
243
246
|
{
|
|
244
247
|
id: o.resource.id,
|
|
245
248
|
onNavigate: n,
|
|
@@ -252,7 +255,7 @@ const X = T.ActionTrigger, tt = (n) => {
|
|
|
252
255
|
onNavigate: n,
|
|
253
256
|
defaultTab: t
|
|
254
257
|
}) => {
|
|
255
|
-
const [o, r] =
|
|
258
|
+
const [o, r] = y(t ?? "bookmarks");
|
|
256
259
|
return /* @__PURE__ */ l(
|
|
257
260
|
E.Root,
|
|
258
261
|
{
|
|
@@ -265,7 +268,7 @@ const X = T.ActionTrigger, tt = (n) => {
|
|
|
265
268
|
"Bookmarks"
|
|
266
269
|
] }),
|
|
267
270
|
/* @__PURE__ */ l(E.Trigger, { value: "annotations", children: [
|
|
268
|
-
/* @__PURE__ */ e(
|
|
271
|
+
/* @__PURE__ */ e(he, {}),
|
|
269
272
|
"Annotations"
|
|
270
273
|
] }),
|
|
271
274
|
/* @__PURE__ */ e(E.Indicator, {})
|
|
@@ -290,8 +293,8 @@ const X = T.ActionTrigger, tt = (n) => {
|
|
|
290
293
|
onOpenChange: (r) => t(r.open),
|
|
291
294
|
size: { mdDown: "full", md: "lg" },
|
|
292
295
|
scrollBehavior: "inside",
|
|
293
|
-
children: /* @__PURE__ */ l(
|
|
294
|
-
/* @__PURE__ */ e(
|
|
296
|
+
children: /* @__PURE__ */ l(q, { height: "100%", children: [
|
|
297
|
+
/* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(X, { children: "Annotations" }) }),
|
|
295
298
|
/* @__PURE__ */ e(Z, { flex: 1, children: /* @__PURE__ */ e(
|
|
296
299
|
lt,
|
|
297
300
|
{
|
|
@@ -299,30 +302,30 @@ const X = T.ActionTrigger, tt = (n) => {
|
|
|
299
302
|
defaultTab: n
|
|
300
303
|
}
|
|
301
304
|
) }),
|
|
302
|
-
/* @__PURE__ */ e(
|
|
303
|
-
/* @__PURE__ */ e(
|
|
305
|
+
/* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(K, { asChild: !0, children: /* @__PURE__ */ e(G, { variant: "outline", children: "Cancel" }) }) }),
|
|
306
|
+
/* @__PURE__ */ e(j, {})
|
|
304
307
|
] })
|
|
305
308
|
}
|
|
306
309
|
)
|
|
307
310
|
), ct = v(({ children: n }) => {
|
|
308
311
|
const t = C(), o = b(() => t?.spine.element$, [t]);
|
|
309
|
-
return o ? /* @__PURE__ */ e(
|
|
312
|
+
return o ? /* @__PURE__ */ e(Ce, { children: En(n, o) }) : null;
|
|
310
313
|
}), dt = ({
|
|
311
314
|
absolutePageIndex: n,
|
|
312
315
|
itemIndex: t
|
|
313
316
|
}) => {
|
|
314
317
|
const o = C();
|
|
315
318
|
return {
|
|
316
|
-
spineItem: b(() => o ? t !== void 0 ?
|
|
317
|
-
|
|
318
|
-
) :
|
|
319
|
+
spineItem: b(() => o ? t !== void 0 ? ue(o.spine.spineItemsManager.get(t)) : n !== void 0 ? o.spine.pages.observeFromAbsolutePageIndex(n).pipe(
|
|
320
|
+
L((i) => o.spine.spineItemsManager.get(i?.itemIndex))
|
|
321
|
+
) : Te : Te, [t, n, o])
|
|
319
322
|
};
|
|
320
323
|
}, ut = ({
|
|
321
324
|
absolutePageIndex: n,
|
|
322
325
|
itemIndex: t
|
|
323
326
|
}) => {
|
|
324
327
|
const { spineItem: o } = dt({ absolutePageIndex: n, itemIndex: t }), r = b(
|
|
325
|
-
() => o?.isReady$ ??
|
|
328
|
+
() => o?.isReady$ ?? ue(!1),
|
|
326
329
|
[o]
|
|
327
330
|
);
|
|
328
331
|
return { spineItem: o, isReady: r };
|
|
@@ -348,9 +351,9 @@ const X = T.ActionTrigger, tt = (n) => {
|
|
|
348
351
|
animationName: { _open: "fade-in", _closed: "fade-out" },
|
|
349
352
|
animationDuration: "moderate",
|
|
350
353
|
children: /* @__PURE__ */ e(
|
|
351
|
-
|
|
354
|
+
_,
|
|
352
355
|
{
|
|
353
|
-
"data-bookmark-area":
|
|
356
|
+
"data-bookmark-area": Xn,
|
|
354
357
|
position: "absolute",
|
|
355
358
|
left: t + r,
|
|
356
359
|
transform: "translateX(-100%)",
|
|
@@ -392,11 +395,11 @@ const X = T.ActionTrigger, tt = (n) => {
|
|
|
392
395
|
return se(n) ? n : void 0;
|
|
393
396
|
}, ft = () => {
|
|
394
397
|
const n = gt(), { data: t } = ge();
|
|
395
|
-
|
|
398
|
+
N(() => n ? n.gestures.hooks.register(
|
|
396
399
|
"beforeTapGesture",
|
|
397
400
|
({ event$: r }) => r.pipe(
|
|
398
|
-
|
|
399
|
-
|
|
401
|
+
tn(n?.annotations.candidates$),
|
|
402
|
+
L(([i, a]) => {
|
|
400
403
|
if (!i.page) return !0;
|
|
401
404
|
const {
|
|
402
405
|
spineItem: s,
|
|
@@ -433,10 +436,10 @@ const X = T.ActionTrigger, tt = (n) => {
|
|
|
433
436
|
})
|
|
434
437
|
)
|
|
435
438
|
) : void 0, [n, t]);
|
|
436
|
-
},
|
|
439
|
+
}, ve = pn({
|
|
437
440
|
placement: "bottom-end",
|
|
438
441
|
pauseOnPageIdle: !0
|
|
439
|
-
}), mt = () => /* @__PURE__ */ e(
|
|
442
|
+
}), mt = () => /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e(gn, { toaster: ve, insetInline: { mdDown: "4" }, children: (n) => /* @__PURE__ */ l(J.Root, { width: { md: "sm" }, children: [
|
|
440
443
|
n.type === "loading" ? /* @__PURE__ */ e(fn, { size: "sm", color: "blue.solid" }) : /* @__PURE__ */ e(J.Indicator, {}),
|
|
441
444
|
/* @__PURE__ */ l(O, { gap: "1", flex: "1", maxWidth: "100%", children: [
|
|
442
445
|
n.title && /* @__PURE__ */ e(J.Title, { children: n.title }),
|
|
@@ -453,17 +456,17 @@ const X = T.ActionTrigger, tt = (n) => {
|
|
|
453
456
|
r && /* @__PURE__ */ e(re.ItemText, { children: r })
|
|
454
457
|
] });
|
|
455
458
|
}
|
|
456
|
-
),
|
|
459
|
+
), je = re.Root, Re = B.forwardRef(
|
|
457
460
|
function(t, o) {
|
|
458
461
|
const { marks: r, label: i, showValue: a, ...s } = t, c = t.defaultValue ?? t.value, d = r?.map((g) => typeof g == "number" ? { value: g, label: void 0 } : g), u = !!d?.some((g) => g.label);
|
|
459
|
-
return /* @__PURE__ */ l(
|
|
460
|
-
i && !a && /* @__PURE__ */ e(
|
|
462
|
+
return /* @__PURE__ */ l(w.Root, { ref: o, thumbAlignment: "center", ...s, children: [
|
|
463
|
+
i && !a && /* @__PURE__ */ e(w.Label, { children: i }),
|
|
461
464
|
i && a && /* @__PURE__ */ l(F, { justify: "space-between", children: [
|
|
462
|
-
/* @__PURE__ */ e(
|
|
463
|
-
/* @__PURE__ */ e(
|
|
465
|
+
/* @__PURE__ */ e(w.Label, { children: i }),
|
|
466
|
+
/* @__PURE__ */ e(w.ValueText, {})
|
|
464
467
|
] }),
|
|
465
|
-
/* @__PURE__ */ l(
|
|
466
|
-
/* @__PURE__ */ e(
|
|
468
|
+
/* @__PURE__ */ l(w.Control, { "data-has-mark-label": u || void 0, children: [
|
|
469
|
+
/* @__PURE__ */ e(w.Track, { children: /* @__PURE__ */ e(w.Range, {}) }),
|
|
467
470
|
/* @__PURE__ */ e(bt, { value: c }),
|
|
468
471
|
/* @__PURE__ */ e(vt, { marks: d })
|
|
469
472
|
] })
|
|
@@ -472,27 +475,27 @@ const X = T.ActionTrigger, tt = (n) => {
|
|
|
472
475
|
);
|
|
473
476
|
function bt(n) {
|
|
474
477
|
const { value: t } = n;
|
|
475
|
-
return /* @__PURE__ */ e(mn, { each: t, children: (o, r) => /* @__PURE__ */ e(
|
|
478
|
+
return /* @__PURE__ */ e(mn, { each: t, children: (o, r) => /* @__PURE__ */ e(w.Thumb, { index: r, children: /* @__PURE__ */ e(w.HiddenInput, {}) }, r) });
|
|
476
479
|
}
|
|
477
480
|
const vt = B.forwardRef(
|
|
478
481
|
function(t, o) {
|
|
479
482
|
const { marks: r } = t;
|
|
480
|
-
return r?.length ? /* @__PURE__ */ e(
|
|
483
|
+
return r?.length ? /* @__PURE__ */ e(w.MarkerGroup, { ref: o, children: r.map((i, a) => {
|
|
481
484
|
const s = typeof i == "number" ? i : i.value, c = typeof i == "number" ? void 0 : i.label;
|
|
482
|
-
return /* @__PURE__ */ l(
|
|
483
|
-
/* @__PURE__ */ e(
|
|
485
|
+
return /* @__PURE__ */ l(w.Marker, { value: s, children: [
|
|
486
|
+
/* @__PURE__ */ e(w.MarkerIndicator, {}),
|
|
484
487
|
c
|
|
485
488
|
] }, a);
|
|
486
489
|
}) }) : null;
|
|
487
490
|
}
|
|
488
|
-
), Ct = ["global", "book", "device"],
|
|
491
|
+
), Ct = ["global", "book", "device"], ye = [
|
|
489
492
|
"global",
|
|
490
493
|
"book",
|
|
491
494
|
"mobile",
|
|
492
495
|
"tablet",
|
|
493
496
|
"desktop"
|
|
494
497
|
], St = "(max-width: 767px)", xt = "(max-width: 1023px)", kt = v(() => {
|
|
495
|
-
const n =
|
|
498
|
+
const n = Kn(), {
|
|
496
499
|
fontSizeMenuOpen: t,
|
|
497
500
|
onFontSizeMenuOpenChange: o,
|
|
498
501
|
uncontrolledFontSize: r,
|
|
@@ -512,10 +515,10 @@ const vt = B.forwardRef(
|
|
|
512
515
|
"onFontSizeChange",
|
|
513
516
|
"onFontSizeScopeChange",
|
|
514
517
|
"uncontrolledFontSize"
|
|
515
|
-
]), g =
|
|
518
|
+
]), g = Je(d), [p, f] = bn([
|
|
516
519
|
St,
|
|
517
520
|
xt
|
|
518
|
-
]), S = c === "book" ? "book" : c === "device" ? p ? "mobile" : f ? "tablet" : "desktop" : "global", [k, z] =
|
|
521
|
+
]), S = c === "book" ? "book" : c === "device" ? p ? "mobile" : f ? "tablet" : "desktop" : "global", [k, z] = y(S), x = D(
|
|
519
522
|
(h, M) => {
|
|
520
523
|
h === S && (g.current ? g.current(M) : n.update((fe) => ({
|
|
521
524
|
...fe,
|
|
@@ -549,14 +552,14 @@ const vt = B.forwardRef(
|
|
|
549
552
|
o(h.open);
|
|
550
553
|
},
|
|
551
554
|
placement: "center",
|
|
552
|
-
children: /* @__PURE__ */ l(
|
|
553
|
-
/* @__PURE__ */ e(
|
|
555
|
+
children: /* @__PURE__ */ l(q, { maxH: "40vh", overflow: "auto", children: [
|
|
556
|
+
/* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(X, { children: "Font size" }) }),
|
|
554
557
|
/* @__PURE__ */ e(Z, { children: /* @__PURE__ */ l(O, { gap: 8, flex: 1, children: [
|
|
555
|
-
/* @__PURE__ */ l(
|
|
556
|
-
/* @__PURE__ */ e(
|
|
557
|
-
/* @__PURE__ */ e(
|
|
558
|
-
/* @__PURE__ */ e(
|
|
559
|
-
|
|
558
|
+
/* @__PURE__ */ l(H.Root, { children: [
|
|
559
|
+
/* @__PURE__ */ e(H.Legend, { children: "Scope" }),
|
|
560
|
+
/* @__PURE__ */ e(H.HelperText, { children: "The scope to which apply the font size for this book." }),
|
|
561
|
+
/* @__PURE__ */ e(H.Content, { children: /* @__PURE__ */ e(
|
|
562
|
+
je,
|
|
560
563
|
{
|
|
561
564
|
onValueChange: (h) => {
|
|
562
565
|
const M = h.value;
|
|
@@ -574,7 +577,7 @@ const vt = B.forwardRef(
|
|
|
574
577
|
value: k,
|
|
575
578
|
onValueChange: (h) => z(h.value),
|
|
576
579
|
children: [
|
|
577
|
-
/* @__PURE__ */ e(E.List, { children:
|
|
580
|
+
/* @__PURE__ */ e(E.List, { children: ye.map((h) => /* @__PURE__ */ l(
|
|
578
581
|
E.Trigger,
|
|
579
582
|
{
|
|
580
583
|
value: h,
|
|
@@ -587,8 +590,8 @@ const vt = B.forwardRef(
|
|
|
587
590
|
},
|
|
588
591
|
h
|
|
589
592
|
)) }),
|
|
590
|
-
|
|
591
|
-
|
|
593
|
+
ye.map((h) => /* @__PURE__ */ e(E.Content, { value: h, children: /* @__PURE__ */ e(
|
|
594
|
+
Re,
|
|
592
595
|
{
|
|
593
596
|
label: "%",
|
|
594
597
|
value: [(R(h) ?? 1) * 100],
|
|
@@ -603,8 +606,8 @@ const vt = B.forwardRef(
|
|
|
603
606
|
}
|
|
604
607
|
)
|
|
605
608
|
] }) }),
|
|
606
|
-
/* @__PURE__ */ e(
|
|
607
|
-
/* @__PURE__ */ e(
|
|
609
|
+
/* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(K, { asChild: !0, children: /* @__PURE__ */ e(G, { variant: "outline", children: "Close" }) }) }),
|
|
610
|
+
/* @__PURE__ */ e(j, {})
|
|
608
611
|
] })
|
|
609
612
|
}
|
|
610
613
|
);
|
|
@@ -619,7 +622,7 @@ const vt = B.forwardRef(
|
|
|
619
622
|
right: 0
|
|
620
623
|
};
|
|
621
624
|
function Rt() {
|
|
622
|
-
const [n, t] =
|
|
625
|
+
const [n, t] = y(null), [o, r] = y(It), i = Ze(
|
|
623
626
|
() => new ResizeObserver((a) => {
|
|
624
627
|
if (a[0]) {
|
|
625
628
|
const { x: s, y: c, width: d, height: u, top: g, left: p, bottom: f, right: S } = a[0].contentRect;
|
|
@@ -628,7 +631,7 @@ function Rt() {
|
|
|
628
631
|
}),
|
|
629
632
|
[]
|
|
630
633
|
);
|
|
631
|
-
return
|
|
634
|
+
return Xe(() => {
|
|
632
635
|
if (n)
|
|
633
636
|
return i.observe(n), () => {
|
|
634
637
|
i.disconnect();
|
|
@@ -636,25 +639,25 @@ function Rt() {
|
|
|
636
639
|
}, [n, i]), [t, o, n];
|
|
637
640
|
}
|
|
638
641
|
const Ot = (n, t, o) => {
|
|
639
|
-
const r = C(), i =
|
|
640
|
-
|
|
641
|
-
if (!i || !n) return
|
|
642
|
+
const r = C(), i = Ne(r) ? r : void 0;
|
|
643
|
+
pe(() => {
|
|
644
|
+
if (!i || !n) return Se;
|
|
642
645
|
const a = t.layout.layout$.pipe(
|
|
643
|
-
|
|
644
|
-
|
|
646
|
+
on(t.layout.layoutInfo),
|
|
647
|
+
Fe(An)
|
|
645
648
|
), s = Dn(
|
|
646
649
|
n
|
|
647
|
-
).pipe(
|
|
650
|
+
).pipe(L((c) => c.some((d) => d.isIntersecting)));
|
|
648
651
|
return a.pipe(
|
|
649
652
|
_e(100, void 0, { trailing: !0 }),
|
|
650
|
-
|
|
651
|
-
|
|
653
|
+
W(() => s.pipe(
|
|
654
|
+
rn((c) => {
|
|
652
655
|
c || (n.innerHTML = "");
|
|
653
656
|
}),
|
|
654
|
-
|
|
655
|
-
|
|
657
|
+
de((c) => c),
|
|
658
|
+
Le()
|
|
656
659
|
).pipe(
|
|
657
|
-
|
|
660
|
+
W(() => (n.innerHTML = "", i?.gallery.snapshot(
|
|
658
661
|
t,
|
|
659
662
|
n,
|
|
660
663
|
o
|
|
@@ -671,7 +674,7 @@ const Ot = (n, t, o) => {
|
|
|
671
674
|
[a, n]
|
|
672
675
|
);
|
|
673
676
|
return /* @__PURE__ */ l(
|
|
674
|
-
|
|
677
|
+
_,
|
|
675
678
|
{
|
|
676
679
|
width: "100%",
|
|
677
680
|
aspectRatio: "2/3",
|
|
@@ -687,7 +690,7 @@ const Ot = (n, t, o) => {
|
|
|
687
690
|
},
|
|
688
691
|
children: [
|
|
689
692
|
/* @__PURE__ */ e(
|
|
690
|
-
|
|
693
|
+
_,
|
|
691
694
|
{
|
|
692
695
|
height: "100%",
|
|
693
696
|
width: "100%",
|
|
@@ -729,10 +732,10 @@ const Ot = (n, t, o) => {
|
|
|
729
732
|
onOpenChange: (i) => t(i.open),
|
|
730
733
|
size: { mdDown: "full", md: "lg" },
|
|
731
734
|
scrollBehavior: "inside",
|
|
732
|
-
children: /* @__PURE__ */ l(
|
|
733
|
-
/* @__PURE__ */ e(
|
|
735
|
+
children: /* @__PURE__ */ l(q, { height: "100%", children: [
|
|
736
|
+
/* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(X, { children: "Gallery" }) }),
|
|
734
737
|
/* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(
|
|
735
|
-
|
|
738
|
+
_,
|
|
736
739
|
{
|
|
737
740
|
gridTemplateColumns: [
|
|
738
741
|
"repeat(2, minmax(0, 1fr))",
|
|
@@ -754,13 +757,13 @@ const Ot = (n, t, o) => {
|
|
|
754
757
|
))
|
|
755
758
|
}
|
|
756
759
|
) }),
|
|
757
|
-
/* @__PURE__ */ e(
|
|
758
|
-
/* @__PURE__ */ e(
|
|
760
|
+
/* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(K, { asChild: !0, children: /* @__PURE__ */ e(G, { variant: "outline", children: "Cancel" }) }) }),
|
|
761
|
+
/* @__PURE__ */ e(j, {})
|
|
759
762
|
] })
|
|
760
763
|
}
|
|
761
764
|
);
|
|
762
765
|
}
|
|
763
|
-
), zt = "@prose-reader/react-reader",
|
|
766
|
+
), zt = "@prose-reader/react-reader", wt = "1.255.0", yt = v(
|
|
764
767
|
({ open: n, setOpen: t }) => /* @__PURE__ */ e(
|
|
765
768
|
Q,
|
|
766
769
|
{
|
|
@@ -770,8 +773,8 @@ const Ot = (n, t, o) => {
|
|
|
770
773
|
onOpenChange: (o) => t(o.open),
|
|
771
774
|
size: { mdDown: "full", md: "lg" },
|
|
772
775
|
scrollBehavior: "inside",
|
|
773
|
-
children: /* @__PURE__ */ l(
|
|
774
|
-
/* @__PURE__ */ e(
|
|
776
|
+
children: /* @__PURE__ */ l(q, { children: [
|
|
777
|
+
/* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(X, { children: "Help" }) }),
|
|
775
778
|
/* @__PURE__ */ l(
|
|
776
779
|
Z,
|
|
777
780
|
{
|
|
@@ -784,12 +787,12 @@ const Ot = (n, t, o) => {
|
|
|
784
787
|
/* @__PURE__ */ l(O, { children: [
|
|
785
788
|
/* @__PURE__ */ e(me, { mb: 2, as: "h3", size: "lg", children: "Shortcuts" }),
|
|
786
789
|
/* @__PURE__ */ l(F, { mb: 1, children: [
|
|
787
|
-
/* @__PURE__ */ e(
|
|
790
|
+
/* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(In, {}) }),
|
|
788
791
|
" ",
|
|
789
792
|
/* @__PURE__ */ e(m, { children: "Navigate to right page" })
|
|
790
793
|
] }),
|
|
791
794
|
/* @__PURE__ */ l(F, { mb: 1, children: [
|
|
792
|
-
/* @__PURE__ */ e(
|
|
795
|
+
/* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(Rn, {}) }),
|
|
793
796
|
" ",
|
|
794
797
|
/* @__PURE__ */ e(m, { children: "Navigate to left page" })
|
|
795
798
|
] })
|
|
@@ -803,22 +806,22 @@ const Ot = (n, t, o) => {
|
|
|
803
806
|
/* @__PURE__ */ l(m, { children: [
|
|
804
807
|
zt,
|
|
805
808
|
" version: ",
|
|
806
|
-
|
|
809
|
+
wt
|
|
807
810
|
] })
|
|
808
811
|
] })
|
|
809
812
|
]
|
|
810
813
|
}
|
|
811
814
|
),
|
|
812
|
-
/* @__PURE__ */ e(
|
|
813
|
-
/* @__PURE__ */ e(
|
|
815
|
+
/* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(K, { asChild: !0, children: /* @__PURE__ */ e(G, { variant: "outline", children: "Cancel" }) }) }),
|
|
816
|
+
/* @__PURE__ */ e(j, {})
|
|
814
817
|
] })
|
|
815
818
|
}
|
|
816
819
|
)
|
|
817
820
|
), ne = () => {
|
|
818
821
|
const n = C();
|
|
819
822
|
return b(
|
|
820
|
-
() => n ?
|
|
821
|
-
|
|
823
|
+
() => n ? an([n.pagination.state$, n.context]).pipe(
|
|
824
|
+
L(([t, o]) => {
|
|
822
825
|
const r = o.manifest?.spineItems.every(
|
|
823
826
|
(i) => i.mediaType?.startsWith("image/")
|
|
824
827
|
);
|
|
@@ -827,20 +830,20 @@ const Ot = (n, t, o) => {
|
|
|
827
830
|
hasChapters: !o.isFullyPrePaginated && !r
|
|
828
831
|
};
|
|
829
832
|
})
|
|
830
|
-
) :
|
|
833
|
+
) : Se,
|
|
831
834
|
[n]
|
|
832
835
|
);
|
|
833
836
|
}, Pt = () => {
|
|
834
837
|
const n = ne(), t = Math.floor(
|
|
835
838
|
(n?.percentageEstimateOfBook ?? 0) * 100
|
|
836
839
|
), o = t > 0 ? t : 1;
|
|
837
|
-
return n?.percentageEstimateOfBook === void 0 ? null : /* @__PURE__ */ e(
|
|
840
|
+
return n?.percentageEstimateOfBook === void 0 ? null : /* @__PURE__ */ e(_, { position: "absolute", right: 0, bottom: 0, p: 2, color: "black", children: /* @__PURE__ */ l(m, { fontSize: "sm", children: [
|
|
838
841
|
o,
|
|
839
842
|
" %"
|
|
840
843
|
] }) });
|
|
841
844
|
}, Et = () => {
|
|
842
|
-
const [n, t] =
|
|
843
|
-
return
|
|
845
|
+
const [n, t] = y(/* @__PURE__ */ new Date());
|
|
846
|
+
return N(() => {
|
|
844
847
|
const o = setInterval(() => {
|
|
845
848
|
t(/* @__PURE__ */ new Date());
|
|
846
849
|
}, 6e4);
|
|
@@ -852,16 +855,16 @@ const Ot = (n, t, o) => {
|
|
|
852
855
|
hour: "2-digit",
|
|
853
856
|
minute: "2-digit"
|
|
854
857
|
}) });
|
|
855
|
-
},
|
|
858
|
+
}, Oe = () => {
|
|
856
859
|
const { quickMenuOpen: n, onQuickMenuOpenChange: t } = $([
|
|
857
860
|
"quickMenuOpen",
|
|
858
861
|
"onQuickMenuOpenChange"
|
|
859
862
|
]);
|
|
860
863
|
return [n, t];
|
|
861
864
|
}, At = () => {
|
|
862
|
-
const [n] =
|
|
865
|
+
const [n] = Oe();
|
|
863
866
|
return /* @__PURE__ */ e(
|
|
864
|
-
|
|
867
|
+
_,
|
|
865
868
|
{
|
|
866
869
|
position: "absolute",
|
|
867
870
|
left: 0,
|
|
@@ -873,7 +876,7 @@ const Ot = (n, t, o) => {
|
|
|
873
876
|
);
|
|
874
877
|
}, Dt = () => {
|
|
875
878
|
const n = C();
|
|
876
|
-
|
|
879
|
+
pe(
|
|
877
880
|
() => n?.links$.subscribe((t) => {
|
|
878
881
|
if (t.type === "click" && Fn(t.target, "a")) {
|
|
879
882
|
if (!t.target.href) return;
|
|
@@ -885,40 +888,18 @@ const Ot = (n, t, o) => {
|
|
|
885
888
|
}),
|
|
886
889
|
[n]
|
|
887
890
|
);
|
|
888
|
-
}, Ft = {
|
|
889
|
-
fontScaleChange: "fontScaleChange"
|
|
890
|
-
}, _t = () => {
|
|
891
|
-
const n = C(), { notificationsSubject: t, fontSizeMenuOpen: o } = $([
|
|
892
|
-
"notificationsSubject",
|
|
893
|
-
"fontSizeMenuOpen"
|
|
894
|
-
]);
|
|
895
|
-
ce(
|
|
896
|
-
() => o ? ve : n?.settings.values$.pipe(
|
|
897
|
-
_(({ fontScale: r }) => r),
|
|
898
|
-
ke(),
|
|
899
|
-
Ve(1),
|
|
900
|
-
Le((r) => {
|
|
901
|
-
t.next({
|
|
902
|
-
key: Ft.fontScaleChange,
|
|
903
|
-
title: "Font size changed",
|
|
904
|
-
description: `${r * 100} %`
|
|
905
|
-
});
|
|
906
|
-
})
|
|
907
|
-
),
|
|
908
|
-
[n, t, o]
|
|
909
|
-
);
|
|
910
|
-
}, Lt = () => {
|
|
891
|
+
}, Ft = () => {
|
|
911
892
|
const { notificationsSubject: n } = $([
|
|
912
893
|
"notificationsSubject"
|
|
913
894
|
]);
|
|
914
|
-
|
|
895
|
+
pe(
|
|
915
896
|
() => n.pipe(
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
const o = t.duration ?? 3e3, r = new
|
|
897
|
+
de(De),
|
|
898
|
+
ln((t) => {
|
|
899
|
+
const o = t.duration ?? 3e3, r = new sn((a) => {
|
|
919
900
|
try {
|
|
920
901
|
queueMicrotask(() => {
|
|
921
|
-
const s =
|
|
902
|
+
const s = ve.create({
|
|
922
903
|
title: t.title,
|
|
923
904
|
description: t.description,
|
|
924
905
|
duration: o
|
|
@@ -929,20 +910,20 @@ const Ot = (n, t, o) => {
|
|
|
929
910
|
a.error(s);
|
|
930
911
|
}
|
|
931
912
|
}), i = n.pipe(
|
|
932
|
-
|
|
933
|
-
|
|
913
|
+
cn(1),
|
|
914
|
+
de((a) => !!t.key && a?.key === t.key)
|
|
934
915
|
);
|
|
935
916
|
return r.pipe(
|
|
936
|
-
|
|
937
|
-
(a) =>
|
|
938
|
-
|
|
939
|
-
t.abort ??
|
|
917
|
+
W(
|
|
918
|
+
(a) => $e(
|
|
919
|
+
Ve(o),
|
|
920
|
+
t.abort ?? Se,
|
|
940
921
|
i
|
|
941
922
|
).pipe(
|
|
942
|
-
|
|
923
|
+
Le(),
|
|
943
924
|
dn(() => {
|
|
944
925
|
queueMicrotask(() => {
|
|
945
|
-
|
|
926
|
+
ve.dismiss(a);
|
|
946
927
|
});
|
|
947
928
|
})
|
|
948
929
|
)
|
|
@@ -952,7 +933,7 @@ const Ot = (n, t, o) => {
|
|
|
952
933
|
),
|
|
953
934
|
[n]
|
|
954
935
|
);
|
|
955
|
-
},
|
|
936
|
+
}, _t = B.forwardRef(
|
|
956
937
|
function(t, o) {
|
|
957
938
|
const {
|
|
958
939
|
showArrow: r,
|
|
@@ -969,7 +950,7 @@ const Ot = (n, t, o) => {
|
|
|
969
950
|
positioning: { ...d.positioning, gutter: 4 },
|
|
970
951
|
children: [
|
|
971
952
|
/* @__PURE__ */ e(ee.Trigger, { asChild: !0, children: i }),
|
|
972
|
-
/* @__PURE__ */ e(
|
|
953
|
+
/* @__PURE__ */ e(xe, { disabled: !a, container: c, children: /* @__PURE__ */ e(ee.Positioner, { children: /* @__PURE__ */ l(
|
|
973
954
|
ee.Content,
|
|
974
955
|
{
|
|
975
956
|
width: "auto",
|
|
@@ -988,9 +969,9 @@ const Ot = (n, t, o) => {
|
|
|
988
969
|
}
|
|
989
970
|
);
|
|
990
971
|
}
|
|
991
|
-
),
|
|
972
|
+
), Lt = B.forwardRef(function(t, o) {
|
|
992
973
|
const { children: r, ...i } = t;
|
|
993
|
-
return /* @__PURE__ */ e(
|
|
974
|
+
return /* @__PURE__ */ e(_t, { content: r, ...i, ref: o, children: /* @__PURE__ */ e(
|
|
994
975
|
I,
|
|
995
976
|
{
|
|
996
977
|
variant: "ghost",
|
|
@@ -1000,17 +981,17 @@ const Ot = (n, t, o) => {
|
|
|
1000
981
|
children: /* @__PURE__ */ e(Qn, {})
|
|
1001
982
|
}
|
|
1002
983
|
) });
|
|
1003
|
-
}),
|
|
984
|
+
}), $t = B.forwardRef(function(t, o) {
|
|
1004
985
|
return /* @__PURE__ */ e(le.Track, { ...t, ref: o, children: /* @__PURE__ */ e(le.Range, {}) });
|
|
1005
986
|
});
|
|
1006
987
|
B.forwardRef(function(t, o) {
|
|
1007
988
|
const { children: r, info: i, ...a } = t;
|
|
1008
989
|
return /* @__PURE__ */ l(le.Label, { ...a, ref: o, children: [
|
|
1009
990
|
r,
|
|
1010
|
-
i && /* @__PURE__ */ e(
|
|
991
|
+
i && /* @__PURE__ */ e(Lt, { children: i })
|
|
1011
992
|
] });
|
|
1012
993
|
});
|
|
1013
|
-
const
|
|
994
|
+
const Vt = le.Root, Ht = le.ValueText, Me = () => {
|
|
1014
995
|
const n = ne(), t = n?.numberOfTotalPages === 1, o = (n?.beginNumberOfPagesInSpineItem ?? 0) > 1, r = (n?.endNumberOfPagesInSpineItem ?? 0) > 1, i = (n?.hasChapters ? n?.beginPageIndexInSpineItem : n?.beginAbsolutePageIndex) ?? 0, a = (n?.hasChapters ? n?.endPageIndexInSpineItem : n?.endAbsolutePageIndex) ?? 0, [s = 0, c = 0] = [
|
|
1015
996
|
i,
|
|
1016
997
|
a
|
|
@@ -1026,23 +1007,23 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1026
1007
|
leftPageIndex: s,
|
|
1027
1008
|
rightPageIndex: c
|
|
1028
1009
|
};
|
|
1029
|
-
},
|
|
1010
|
+
}, Wt = () => {
|
|
1030
1011
|
const n = ne(), {
|
|
1031
1012
|
hasOnlyOnePage: t,
|
|
1032
1013
|
leftPageIndex: o,
|
|
1033
1014
|
rightPageIndex: r,
|
|
1034
1015
|
totalApproximatePages: i,
|
|
1035
1016
|
beginAndEndAreDifferent: a
|
|
1036
|
-
} =
|
|
1017
|
+
} = Me(), s = Math.round((n?.percentageEstimateOfBook ?? 0) * 100), c = (u) => u?.subChapter ? `${u.title} / ${c(u.subChapter)}` : u?.title || "", d = c(n?.beginChapterInfo);
|
|
1037
1018
|
return /* @__PURE__ */ l(O, { alignItems: "center", gap: 1, maxW: "100%", overflow: "auto", children: [
|
|
1038
|
-
/* @__PURE__ */ e(
|
|
1039
|
-
/* @__PURE__ */ e(
|
|
1040
|
-
/* @__PURE__ */ e(
|
|
1019
|
+
/* @__PURE__ */ e(Vt, { value: s, size: "xs", width: 150, children: /* @__PURE__ */ l(F, { justifyContent: "space-between", children: [
|
|
1020
|
+
/* @__PURE__ */ e($t, { width: 110 }),
|
|
1021
|
+
/* @__PURE__ */ e(Ht, { children: `${s}%` })
|
|
1041
1022
|
] }) }),
|
|
1042
1023
|
/* @__PURE__ */ e(m, { truncate: !0, maxWidth: "100%", fontSize: "sm", mt: 1, children: d ? `Chapter: ${d}` : " " }),
|
|
1043
1024
|
!t && /* @__PURE__ */ l(F, { children: [
|
|
1044
1025
|
/* @__PURE__ */ e(m, { fontSize: "xs", children: a ? `${o + 1} - ${r + 1} of ${i}` : `${o + 1} of ${i}` }),
|
|
1045
|
-
!!n?.hasChapters && /* @__PURE__ */ l(
|
|
1026
|
+
!!n?.hasChapters && /* @__PURE__ */ l(Ce, { children: [
|
|
1046
1027
|
/* @__PURE__ */ e(m, { children: "-" }),
|
|
1047
1028
|
/* @__PURE__ */ l(m, { fontSize: "xs", children: [
|
|
1048
1029
|
"(",
|
|
@@ -1052,7 +1033,7 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1052
1033
|
] })
|
|
1053
1034
|
] })
|
|
1054
1035
|
] });
|
|
1055
|
-
},
|
|
1036
|
+
}, Qe = v(
|
|
1056
1037
|
({
|
|
1057
1038
|
children: n,
|
|
1058
1039
|
position: t,
|
|
@@ -1082,8 +1063,8 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1082
1063
|
children: n
|
|
1083
1064
|
}
|
|
1084
1065
|
)
|
|
1085
|
-
),
|
|
1086
|
-
|
|
1066
|
+
), Nt = vn(Un), Gt = v((n) => /* @__PURE__ */ e(
|
|
1067
|
+
_,
|
|
1087
1068
|
{
|
|
1088
1069
|
display: "contents",
|
|
1089
1070
|
css: {
|
|
@@ -1092,7 +1073,7 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1092
1073
|
"--color-solid": "colors.colorPalette.solid"
|
|
1093
1074
|
},
|
|
1094
1075
|
children: /* @__PURE__ */ e(
|
|
1095
|
-
|
|
1076
|
+
Nt,
|
|
1096
1077
|
{
|
|
1097
1078
|
keyboard: !1,
|
|
1098
1079
|
style: {
|
|
@@ -1136,8 +1117,8 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1136
1117
|
}
|
|
1137
1118
|
)
|
|
1138
1119
|
}
|
|
1139
|
-
)),
|
|
1140
|
-
const t = ne()?.isUsingSpread, { beginPageIndex: o, totalApproximatePages: r = 0 } =
|
|
1120
|
+
)), qt = () => {
|
|
1121
|
+
const t = ne()?.isUsingSpread, { beginPageIndex: o, totalApproximatePages: r = 0 } = Me(), i = t ? Math.floor((o || 0) / 2) : o, [a, s] = en(
|
|
1141
1122
|
() => V({
|
|
1142
1123
|
default: i || 0
|
|
1143
1124
|
})
|
|
@@ -1145,7 +1126,7 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1145
1126
|
0,
|
|
1146
1127
|
t ? Math.floor((r - 1) / 2) : r - 1
|
|
1147
1128
|
);
|
|
1148
|
-
return
|
|
1129
|
+
return N(() => {
|
|
1149
1130
|
s.update(i || 0);
|
|
1150
1131
|
}, [i, s]), {
|
|
1151
1132
|
value: a,
|
|
@@ -1153,8 +1134,8 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1153
1134
|
min: c,
|
|
1154
1135
|
max: d
|
|
1155
1136
|
};
|
|
1156
|
-
},
|
|
1157
|
-
const t = C(), o = ne(), { manifest: r } = b(() => t?.context, [t]) ?? {}, i = r?.readingDirection === "rtl", a = o?.isUsingSpread, { totalApproximatePages: s = 0, isBeginWithinChapter: c } =
|
|
1137
|
+
}, jt = (n) => {
|
|
1138
|
+
const t = C(), o = ne(), { manifest: r } = b(() => t?.context, [t]) ?? {}, i = r?.readingDirection === "rtl", a = o?.isUsingSpread, { totalApproximatePages: s = 0, isBeginWithinChapter: c } = Me(), d = 1, u = c, { value: g, valueSignal: p, min: f, max: S } = qt(), k = D(
|
|
1158
1139
|
(x) => {
|
|
1159
1140
|
const [R = 0] = Array.isArray(x) ? x : [x];
|
|
1160
1141
|
p.update(R);
|
|
@@ -1170,14 +1151,14 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1170
1151
|
},
|
|
1171
1152
|
[t, a, p, u]
|
|
1172
1153
|
);
|
|
1173
|
-
return
|
|
1154
|
+
return pe(
|
|
1174
1155
|
() => t?.navigation.throttleLock({
|
|
1175
1156
|
duration: 100,
|
|
1176
1157
|
trigger: p.subject
|
|
1177
1158
|
}),
|
|
1178
1159
|
[t, p]
|
|
1179
|
-
), s === 1 || a && s === 2 ? /* @__PURE__ */ e(
|
|
1180
|
-
|
|
1160
|
+
), s === 1 || a && s === 2 ? /* @__PURE__ */ e(_, { style: n.style }) : /* @__PURE__ */ e(
|
|
1161
|
+
Gt,
|
|
1181
1162
|
{
|
|
1182
1163
|
value: [g],
|
|
1183
1164
|
max: S,
|
|
@@ -1188,12 +1169,12 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1188
1169
|
...n
|
|
1189
1170
|
}
|
|
1190
1171
|
);
|
|
1191
|
-
},
|
|
1172
|
+
}, Qt = v(
|
|
1192
1173
|
({
|
|
1193
1174
|
open: n,
|
|
1194
1175
|
onItemClick: t
|
|
1195
1176
|
}) => {
|
|
1196
|
-
const o =
|
|
1177
|
+
const o = Ke(null), r = C(), {
|
|
1197
1178
|
quickMenuBottomBarBoundingBoxSignal: i,
|
|
1198
1179
|
onFontSizeMenuOpenChange: a,
|
|
1199
1180
|
onRefitMenuOpenChange: s
|
|
@@ -1203,13 +1184,13 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1203
1184
|
"onRefitMenuOpenChange"
|
|
1204
1185
|
]), c = b(() => r?.navigation.state$, [r]), d = b(() => r?.settings.values$, [r]), u = b(
|
|
1205
1186
|
() => r?.zoom.state$.pipe(
|
|
1206
|
-
|
|
1187
|
+
L(
|
|
1207
1188
|
(x) => x.currentScale > 1 ? "in" : x.currentScale < 1 ? "out" : void 0
|
|
1208
1189
|
)
|
|
1209
1190
|
),
|
|
1210
1191
|
[r]
|
|
1211
|
-
), g = u === "in", p = u === "out", f = d?.computedPageTurnMode === "scrollable", S = d?.computedPageTurnDirection === "vertical", [k, z] =
|
|
1212
|
-
return
|
|
1192
|
+
), g = u === "in", p = u === "out", f = d?.computedPageTurnMode === "scrollable", S = d?.computedPageTurnDirection === "vertical", [k, z] = y(!0);
|
|
1193
|
+
return N(() => {
|
|
1213
1194
|
if (!o.current) return;
|
|
1214
1195
|
const x = new ResizeObserver((R) => {
|
|
1215
1196
|
for (const P of R)
|
|
@@ -1219,7 +1200,7 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1219
1200
|
x.disconnect();
|
|
1220
1201
|
};
|
|
1221
1202
|
}, [i]), /* @__PURE__ */ l(
|
|
1222
|
-
|
|
1203
|
+
Qe,
|
|
1223
1204
|
{
|
|
1224
1205
|
present: n,
|
|
1225
1206
|
position: "bottom",
|
|
@@ -1248,7 +1229,7 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1248
1229
|
flexShrink: 0,
|
|
1249
1230
|
onClick: () => r?.navigation.goToLeftOrTopSpineItem(),
|
|
1250
1231
|
disabled: !c?.canGoLeftSpineItem && !c?.canGoTopSpineItem,
|
|
1251
|
-
children: S ? /* @__PURE__ */ e(
|
|
1232
|
+
children: S ? /* @__PURE__ */ e(Nn, {}) : /* @__PURE__ */ e(Gn, {})
|
|
1252
1233
|
}
|
|
1253
1234
|
),
|
|
1254
1235
|
/* @__PURE__ */ l(
|
|
@@ -1261,9 +1242,9 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1261
1242
|
overflow: "auto",
|
|
1262
1243
|
px: 4,
|
|
1263
1244
|
children: [
|
|
1264
|
-
/* @__PURE__ */ e(
|
|
1245
|
+
/* @__PURE__ */ e(Wt, {}),
|
|
1265
1246
|
/* @__PURE__ */ e(
|
|
1266
|
-
|
|
1247
|
+
jt,
|
|
1267
1248
|
{
|
|
1268
1249
|
style: {
|
|
1269
1250
|
width: "100%",
|
|
@@ -1286,7 +1267,7 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1286
1267
|
onClick: () => {
|
|
1287
1268
|
r?.navigation.goToRightOrBottomSpineItem();
|
|
1288
1269
|
},
|
|
1289
|
-
children: S ? /* @__PURE__ */ e(
|
|
1270
|
+
children: S ? /* @__PURE__ */ e(qn, {}) : /* @__PURE__ */ e(jn, {})
|
|
1290
1271
|
}
|
|
1291
1272
|
)
|
|
1292
1273
|
]
|
|
@@ -1319,7 +1300,7 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1319
1300
|
)
|
|
1320
1301
|
}
|
|
1321
1302
|
),
|
|
1322
|
-
/* @__PURE__ */ e(be.Content, { display: "flex", justifyContent: "center", children: /* @__PURE__ */ l(
|
|
1303
|
+
/* @__PURE__ */ e(be.Content, { display: "flex", justifyContent: "center", children: /* @__PURE__ */ l(_, { display: "flex", overflowX: "auto", px: 4, pb: 1, children: [
|
|
1323
1304
|
/* @__PURE__ */ e(
|
|
1324
1305
|
I,
|
|
1325
1306
|
{
|
|
@@ -1340,7 +1321,7 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1340
1321
|
children: /* @__PURE__ */ e(Tn, {})
|
|
1341
1322
|
}
|
|
1342
1323
|
),
|
|
1343
|
-
|
|
1324
|
+
We(r) && /* @__PURE__ */ e(
|
|
1344
1325
|
I,
|
|
1345
1326
|
{
|
|
1346
1327
|
"aria-label": "Search",
|
|
@@ -1362,7 +1343,7 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1362
1343
|
scale: 2
|
|
1363
1344
|
});
|
|
1364
1345
|
},
|
|
1365
|
-
children: g ? /* @__PURE__ */ e(
|
|
1346
|
+
children: g ? /* @__PURE__ */ e(wn, {}) : /* @__PURE__ */ e(yn, {})
|
|
1366
1347
|
}
|
|
1367
1348
|
),
|
|
1368
1349
|
/* @__PURE__ */ e(
|
|
@@ -1394,10 +1375,10 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1394
1375
|
size: "lg",
|
|
1395
1376
|
variant: "ghost",
|
|
1396
1377
|
onClick: () => t("annotations"),
|
|
1397
|
-
children: /* @__PURE__ */ e(
|
|
1378
|
+
children: /* @__PURE__ */ e(he, {})
|
|
1398
1379
|
}
|
|
1399
1380
|
),
|
|
1400
|
-
|
|
1381
|
+
Ge(r) && /* @__PURE__ */ e(
|
|
1401
1382
|
I,
|
|
1402
1383
|
{
|
|
1403
1384
|
"aria-label": "Refit",
|
|
@@ -1425,14 +1406,14 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1425
1406
|
children: /* @__PURE__ */ e(Pn, {})
|
|
1426
1407
|
}
|
|
1427
1408
|
),
|
|
1428
|
-
|
|
1409
|
+
Ne(r) && /* @__PURE__ */ e(
|
|
1429
1410
|
I,
|
|
1430
1411
|
{
|
|
1431
1412
|
"aria-label": "Gallery",
|
|
1432
1413
|
size: "lg",
|
|
1433
1414
|
variant: "ghost",
|
|
1434
1415
|
onClick: () => t("gallery"),
|
|
1435
|
-
children: /* @__PURE__ */ e(
|
|
1416
|
+
children: /* @__PURE__ */ e(Wn, {})
|
|
1436
1417
|
}
|
|
1437
1418
|
)
|
|
1438
1419
|
] }) })
|
|
@@ -1443,13 +1424,13 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1443
1424
|
}
|
|
1444
1425
|
);
|
|
1445
1426
|
}
|
|
1446
|
-
),
|
|
1447
|
-
const [n, t] =
|
|
1427
|
+
), Ut = () => {
|
|
1428
|
+
const [n, t] = y(!1), o = D(() => document.fullscreenElement ? document.exitFullscreen().catch(console.error).then(() => {
|
|
1448
1429
|
t(!1);
|
|
1449
1430
|
}) : document.documentElement.requestFullscreen({ navigationUI: "hide" }).catch(console.error).then(() => {
|
|
1450
1431
|
t(!0);
|
|
1451
1432
|
}), []);
|
|
1452
|
-
return
|
|
1433
|
+
return N(() => {
|
|
1453
1434
|
function r() {
|
|
1454
1435
|
t(!!document.fullscreenElement);
|
|
1455
1436
|
}
|
|
@@ -1460,14 +1441,14 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1460
1441
|
isFullscreen: n,
|
|
1461
1442
|
onToggleFullscreenClick: o
|
|
1462
1443
|
};
|
|
1463
|
-
},
|
|
1444
|
+
}, Yt = v(
|
|
1464
1445
|
({
|
|
1465
1446
|
open: n,
|
|
1466
1447
|
onItemClick: t
|
|
1467
1448
|
}) => {
|
|
1468
|
-
const o = C(), r = b(() => o?.context.manifest$, [o]), { isFullscreen: i, onToggleFullscreenClick: a } =
|
|
1449
|
+
const o = C(), r = b(() => o?.context.manifest$, [o]), { isFullscreen: i, onToggleFullscreenClick: a } = Ut();
|
|
1469
1450
|
return /* @__PURE__ */ l(
|
|
1470
|
-
|
|
1451
|
+
Qe,
|
|
1471
1452
|
{
|
|
1472
1453
|
present: n,
|
|
1473
1454
|
position: "top",
|
|
@@ -1482,7 +1463,7 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1482
1463
|
variant: "ghost",
|
|
1483
1464
|
flexShrink: 0,
|
|
1484
1465
|
onClick: () => t("back"),
|
|
1485
|
-
children: /* @__PURE__ */ e(
|
|
1466
|
+
children: /* @__PURE__ */ e(Yn, {})
|
|
1486
1467
|
}
|
|
1487
1468
|
),
|
|
1488
1469
|
/* @__PURE__ */ e(
|
|
@@ -1517,7 +1498,7 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1517
1498
|
flexShrink: 0,
|
|
1518
1499
|
variant: "ghost",
|
|
1519
1500
|
onClick: a,
|
|
1520
|
-
children: i ? /* @__PURE__ */ e(Vn, {}) : /* @__PURE__ */ e(
|
|
1501
|
+
children: i ? /* @__PURE__ */ e(Vn, {}) : /* @__PURE__ */ e(Hn, {})
|
|
1521
1502
|
}
|
|
1522
1503
|
)
|
|
1523
1504
|
] })
|
|
@@ -1525,24 +1506,24 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1525
1506
|
}
|
|
1526
1507
|
);
|
|
1527
1508
|
}
|
|
1528
|
-
),
|
|
1509
|
+
), Zt = v(
|
|
1529
1510
|
({
|
|
1530
1511
|
onItemClick: n
|
|
1531
1512
|
}) => {
|
|
1532
|
-
const [t] =
|
|
1513
|
+
const [t] = Oe(), { refitMenuOpen: o, fontSizeMenuOpen: r } = $([
|
|
1533
1514
|
"refitMenuOpen",
|
|
1534
1515
|
"fontSizeMenuOpen"
|
|
1535
1516
|
]);
|
|
1536
|
-
return /* @__PURE__ */ l(
|
|
1517
|
+
return /* @__PURE__ */ l(Ce, { children: [
|
|
1537
1518
|
/* @__PURE__ */ e(
|
|
1538
|
-
|
|
1519
|
+
Yt,
|
|
1539
1520
|
{
|
|
1540
1521
|
open: t && !o && !r,
|
|
1541
1522
|
onItemClick: n
|
|
1542
1523
|
}
|
|
1543
1524
|
),
|
|
1544
1525
|
/* @__PURE__ */ e(
|
|
1545
|
-
|
|
1526
|
+
Qt,
|
|
1546
1527
|
{
|
|
1547
1528
|
open: t && !o && !r,
|
|
1548
1529
|
onItemClick: n
|
|
@@ -1550,7 +1531,7 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1550
1531
|
)
|
|
1551
1532
|
] });
|
|
1552
1533
|
}
|
|
1553
|
-
),
|
|
1534
|
+
), Xt = B.forwardRef(
|
|
1554
1535
|
function(t, o) {
|
|
1555
1536
|
const { label: r, children: i, helperText: a, errorText: s, optionalText: c, ...d } = t;
|
|
1556
1537
|
return /* @__PURE__ */ l(te.Root, { ref: o, ...d, children: [
|
|
@@ -1563,11 +1544,11 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1563
1544
|
s && /* @__PURE__ */ e(te.ErrorText, { children: s })
|
|
1564
1545
|
] });
|
|
1565
1546
|
}
|
|
1566
|
-
),
|
|
1547
|
+
), Kt = v(() => {
|
|
1567
1548
|
const { refitMenuOpen: t, onRefitMenuOpenChange: o } = $([
|
|
1568
1549
|
"refitMenuOpen",
|
|
1569
1550
|
"onRefitMenuOpenChange"
|
|
1570
|
-
]), r = C(), i =
|
|
1551
|
+
]), r = C(), i = Ge(r) ? r : void 0, a = b(
|
|
1571
1552
|
() => i?.refit.settings$,
|
|
1572
1553
|
[i]
|
|
1573
1554
|
);
|
|
@@ -1578,13 +1559,13 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1578
1559
|
open: t,
|
|
1579
1560
|
onOpenChange: (s) => o(s.open),
|
|
1580
1561
|
placement: "center",
|
|
1581
|
-
children: /* @__PURE__ */ l(
|
|
1582
|
-
/* @__PURE__ */ e(
|
|
1583
|
-
/* @__PURE__ */ e(Z, { children: /* @__PURE__ */ l(
|
|
1584
|
-
/* @__PURE__ */ e(
|
|
1585
|
-
/* @__PURE__ */ l(
|
|
1586
|
-
/* @__PURE__ */ e(
|
|
1587
|
-
|
|
1562
|
+
children: /* @__PURE__ */ l(q, { children: [
|
|
1563
|
+
/* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(X, { children: "Viewport fit" }) }),
|
|
1564
|
+
/* @__PURE__ */ e(Z, { children: /* @__PURE__ */ l(H.Root, { children: [
|
|
1565
|
+
/* @__PURE__ */ e(H.HelperText, { children: "Adjust the viewport for a more comfortable reading experience." }),
|
|
1566
|
+
/* @__PURE__ */ l(H.Content, { children: [
|
|
1567
|
+
/* @__PURE__ */ e(Xt, { label: "Profile", children: /* @__PURE__ */ e(
|
|
1568
|
+
je,
|
|
1588
1569
|
{
|
|
1589
1570
|
defaultValue: "fit",
|
|
1590
1571
|
onValueChange: (s) => {
|
|
@@ -1604,7 +1585,7 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1604
1585
|
}
|
|
1605
1586
|
) }),
|
|
1606
1587
|
/* @__PURE__ */ e(
|
|
1607
|
-
|
|
1588
|
+
Re,
|
|
1608
1589
|
{
|
|
1609
1590
|
label: "Maximum width (%)",
|
|
1610
1591
|
showValue: !0,
|
|
@@ -1623,12 +1604,12 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1623
1604
|
)
|
|
1624
1605
|
] })
|
|
1625
1606
|
] }) }),
|
|
1626
|
-
/* @__PURE__ */ e(
|
|
1627
|
-
/* @__PURE__ */ e(
|
|
1607
|
+
/* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(K, { asChild: !0, children: /* @__PURE__ */ e(G, { variant: "outline", children: "Close" }) }) }),
|
|
1608
|
+
/* @__PURE__ */ e(j, {})
|
|
1628
1609
|
] })
|
|
1629
1610
|
}
|
|
1630
1611
|
);
|
|
1631
|
-
}),
|
|
1612
|
+
}), Jt = v(
|
|
1632
1613
|
({
|
|
1633
1614
|
contextText: n = "",
|
|
1634
1615
|
startOffset: t = 0,
|
|
@@ -1648,7 +1629,7 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1648
1629
|
)
|
|
1649
1630
|
);
|
|
1650
1631
|
return /* @__PURE__ */ l(
|
|
1651
|
-
|
|
1632
|
+
ke,
|
|
1652
1633
|
{
|
|
1653
1634
|
href: r,
|
|
1654
1635
|
style: { margin: 5, overflow: "hidden" },
|
|
@@ -1672,18 +1653,18 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1672
1653
|
}
|
|
1673
1654
|
);
|
|
1674
1655
|
}
|
|
1675
|
-
),
|
|
1676
|
-
const n = oe(() => new un("")), t = b(n), o = C(), r =
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
(a) => a === "" || !r ?
|
|
1680
|
-
|
|
1656
|
+
), eo = 500, no = () => {
|
|
1657
|
+
const n = oe(() => new un("")), t = b(n), o = C(), r = We(o) ? o : void 0, i = b(() => n.pipe(
|
|
1658
|
+
Fe(),
|
|
1659
|
+
W(
|
|
1660
|
+
(a) => a === "" || !r ? ue(void 0) : $e(
|
|
1661
|
+
ue({
|
|
1681
1662
|
type: "start",
|
|
1682
1663
|
data: void 0
|
|
1683
1664
|
}),
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1665
|
+
Ve(eo).pipe(
|
|
1666
|
+
W(() => r.search.search(a)),
|
|
1667
|
+
L((s) => ({ type: "end", data: s }))
|
|
1687
1668
|
)
|
|
1688
1669
|
)
|
|
1689
1670
|
)
|
|
@@ -1694,9 +1675,9 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1694
1675
|
status: i?.type ?? "idle",
|
|
1695
1676
|
data: i?.data
|
|
1696
1677
|
};
|
|
1697
|
-
},
|
|
1678
|
+
}, to = v(
|
|
1698
1679
|
({ onNavigate: n }) => {
|
|
1699
|
-
const t = C(), { value: o, setValue: r, status: i, data: a } =
|
|
1680
|
+
const t = C(), { value: o, setValue: r, status: i, data: a } = no(), s = (u) => {
|
|
1700
1681
|
r(u.target.value);
|
|
1701
1682
|
}, c = D(
|
|
1702
1683
|
(u) => {
|
|
@@ -1739,7 +1720,7 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1739
1720
|
" result(s)"
|
|
1740
1721
|
] }),
|
|
1741
1722
|
/* @__PURE__ */ e(O, { gap: 0, children: d?.map((u, g) => /* @__PURE__ */ e(
|
|
1742
|
-
|
|
1723
|
+
Jt,
|
|
1743
1724
|
{
|
|
1744
1725
|
contextText: u.meta?.range?.startContainer.parentElement?.textContent ?? "",
|
|
1745
1726
|
pageIndex: u.meta?.itemPageIndex,
|
|
@@ -1757,7 +1738,7 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1757
1738
|
)
|
|
1758
1739
|
] });
|
|
1759
1740
|
}
|
|
1760
|
-
),
|
|
1741
|
+
), oo = v(
|
|
1761
1742
|
({
|
|
1762
1743
|
open: n,
|
|
1763
1744
|
setOpen: t,
|
|
@@ -1771,15 +1752,15 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1771
1752
|
onOpenChange: (r) => t(r.open),
|
|
1772
1753
|
size: { mdDown: "full", md: "lg" },
|
|
1773
1754
|
scrollBehavior: "inside",
|
|
1774
|
-
children: /* @__PURE__ */ l(
|
|
1775
|
-
/* @__PURE__ */ e(
|
|
1776
|
-
/* @__PURE__ */ e(Z, { flex: 1, p: 0, children: /* @__PURE__ */ e(
|
|
1777
|
-
/* @__PURE__ */ e(
|
|
1778
|
-
/* @__PURE__ */ e(
|
|
1755
|
+
children: /* @__PURE__ */ l(q, { height: "100%", children: [
|
|
1756
|
+
/* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(X, { children: "Search" }) }),
|
|
1757
|
+
/* @__PURE__ */ e(Z, { flex: 1, p: 0, children: /* @__PURE__ */ e(to, { onNavigate: o }) }),
|
|
1758
|
+
/* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(K, { asChild: !0, children: /* @__PURE__ */ e(G, { variant: "outline", children: "Cancel" }) }) }),
|
|
1759
|
+
/* @__PURE__ */ e(j, {})
|
|
1779
1760
|
] })
|
|
1780
1761
|
}
|
|
1781
1762
|
)
|
|
1782
|
-
),
|
|
1763
|
+
), ro = v(
|
|
1783
1764
|
({ onNavigate: n }) => {
|
|
1784
1765
|
const t = C(), { manifest: o, assumedRenditionLayout: r } = b(() => t?.context, [t]) ?? {}, { nav: i } = o ?? {}, a = ne();
|
|
1785
1766
|
i?.toc;
|
|
@@ -1787,7 +1768,7 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1787
1768
|
let u = a?.beginChapterInfo;
|
|
1788
1769
|
for (; u?.subChapter; )
|
|
1789
1770
|
u = u?.subChapter;
|
|
1790
|
-
const g = (p, f, S) => /* @__PURE__ */ l(
|
|
1771
|
+
const g = (p, f, S) => /* @__PURE__ */ l(Ue.Fragment, { children: [
|
|
1791
1772
|
/* @__PURE__ */ e(
|
|
1792
1773
|
A.Item,
|
|
1793
1774
|
{
|
|
@@ -1797,7 +1778,7 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1797
1778
|
alignItems: "center"
|
|
1798
1779
|
},
|
|
1799
1780
|
children: /* @__PURE__ */ l(
|
|
1800
|
-
|
|
1781
|
+
ke,
|
|
1801
1782
|
{
|
|
1802
1783
|
onClick: () => {
|
|
1803
1784
|
n(), t?.navigation.goToUrl(p.href);
|
|
@@ -1829,7 +1810,7 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1829
1810
|
] }, f);
|
|
1830
1811
|
return /* @__PURE__ */ e(A.Root, { gap: 3, overflowY: "auto", py: 4, flex: 1, children: i?.toc.map((p, f) => g(p, f, 0)) });
|
|
1831
1812
|
}
|
|
1832
|
-
),
|
|
1813
|
+
), io = v(
|
|
1833
1814
|
({
|
|
1834
1815
|
open: n,
|
|
1835
1816
|
setOpen: t,
|
|
@@ -1843,27 +1824,27 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1843
1824
|
onOpenChange: (r) => t(r.open),
|
|
1844
1825
|
size: { mdDown: "full", md: "lg" },
|
|
1845
1826
|
scrollBehavior: "inside",
|
|
1846
|
-
children: /* @__PURE__ */ l(
|
|
1847
|
-
/* @__PURE__ */ e(
|
|
1848
|
-
/* @__PURE__ */ e(Z, { overflowY: "auto", flex: 1, children: /* @__PURE__ */ e(
|
|
1849
|
-
/* @__PURE__ */ e(
|
|
1850
|
-
/* @__PURE__ */ e(
|
|
1827
|
+
children: /* @__PURE__ */ l(q, { children: [
|
|
1828
|
+
/* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(X, { children: "Table of Contents" }) }),
|
|
1829
|
+
/* @__PURE__ */ e(Z, { overflowY: "auto", flex: 1, children: /* @__PURE__ */ e(ro, { onNavigate: o }) }),
|
|
1830
|
+
/* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(K, { asChild: !0, children: /* @__PURE__ */ e(G, { variant: "outline", children: "Cancel" }) }) }),
|
|
1831
|
+
/* @__PURE__ */ e(j, {})
|
|
1851
1832
|
] })
|
|
1852
1833
|
}
|
|
1853
1834
|
)
|
|
1854
|
-
),
|
|
1835
|
+
), Pe = 0.5, Ee = 1, Be = 5, ao = (n, t, o, r) => {
|
|
1855
1836
|
if (n > t && n < t + r)
|
|
1856
1837
|
return t + r;
|
|
1857
1838
|
const i = Math.min(Math.max(n, t), o), a = Math.round((i - t) / r) * r + t;
|
|
1858
1839
|
return Math.round(a * 100) / 100;
|
|
1859
|
-
},
|
|
1840
|
+
}, lo = v(() => {
|
|
1860
1841
|
const { quickMenuBottomBarBoundingBoxSignal: n } = $([
|
|
1861
1842
|
"quickMenuBottomBarBoundingBoxSignal"
|
|
1862
|
-
]), t =
|
|
1843
|
+
]), t = ce(
|
|
1863
1844
|
n
|
|
1864
1845
|
), o = C(), r = b(
|
|
1865
1846
|
() => o?.zoom.state$.pipe(
|
|
1866
|
-
|
|
1847
|
+
L((c) => c.currentScale),
|
|
1867
1848
|
_e(100, hn, {
|
|
1868
1849
|
leading: !0,
|
|
1869
1850
|
trailing: !0
|
|
@@ -1871,13 +1852,13 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1871
1852
|
),
|
|
1872
1853
|
[o]
|
|
1873
1854
|
) ?? 1, i = b(
|
|
1874
|
-
() => o?.zoom.state$.pipe(
|
|
1855
|
+
() => o?.zoom.state$.pipe(L((c) => c.isZooming)),
|
|
1875
1856
|
[o]
|
|
1876
|
-
) ?? !1, a =
|
|
1857
|
+
) ?? !1, a = ao(
|
|
1877
1858
|
r,
|
|
1859
|
+
Ee,
|
|
1878
1860
|
Be,
|
|
1879
|
-
|
|
1880
|
-
Ee
|
|
1861
|
+
Pe
|
|
1881
1862
|
), s = t?.borderBoxSize?.[0]?.blockSize ?? 1;
|
|
1882
1863
|
return /* @__PURE__ */ e(
|
|
1883
1864
|
ae,
|
|
@@ -1893,12 +1874,12 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1893
1874
|
borderRadius: "md",
|
|
1894
1875
|
p: 4,
|
|
1895
1876
|
children: /* @__PURE__ */ e(
|
|
1896
|
-
|
|
1877
|
+
Re,
|
|
1897
1878
|
{
|
|
1898
1879
|
value: [a],
|
|
1899
|
-
min:
|
|
1900
|
-
max:
|
|
1901
|
-
step:
|
|
1880
|
+
min: Ee,
|
|
1881
|
+
max: Be,
|
|
1882
|
+
step: Pe,
|
|
1902
1883
|
minWidth: 200,
|
|
1903
1884
|
onValueChange: (c) => {
|
|
1904
1885
|
const d = c.value?.[0] ?? 1;
|
|
@@ -1908,14 +1889,14 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1908
1889
|
)
|
|
1909
1890
|
}
|
|
1910
1891
|
);
|
|
1911
|
-
}),
|
|
1892
|
+
}), zo = ({
|
|
1912
1893
|
enableFloatingTime: n = !0,
|
|
1913
1894
|
enableFloatingProgress: t = !0,
|
|
1914
1895
|
onItemClick: o,
|
|
1915
1896
|
children: r,
|
|
1916
1897
|
...i
|
|
1917
1898
|
}) => {
|
|
1918
|
-
const [a, s] =
|
|
1899
|
+
const [a, s] = y(!1), [c, d] = y(!1), [u, g] = y(!1), [p, f] = y(void 0), [S, k] = y(!1), [z, x] = Oe(), R = D(() => {
|
|
1919
1900
|
s(!1), d(!1), g(!1), f(void 0), x(!1), k(!1);
|
|
1920
1901
|
}, [x]), P = D(
|
|
1921
1902
|
(h) => {
|
|
@@ -1923,8 +1904,8 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1923
1904
|
},
|
|
1924
1905
|
[o]
|
|
1925
1906
|
);
|
|
1926
|
-
return Dt(),
|
|
1927
|
-
|
|
1907
|
+
return Dt(), Ft(), ft(), /* @__PURE__ */ l(
|
|
1908
|
+
_,
|
|
1928
1909
|
{
|
|
1929
1910
|
position: "absolute",
|
|
1930
1911
|
top: 0,
|
|
@@ -1946,14 +1927,14 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1946
1927
|
}
|
|
1947
1928
|
),
|
|
1948
1929
|
/* @__PURE__ */ e(Tt, { open: S, setOpen: k }),
|
|
1949
|
-
/* @__PURE__ */ e(
|
|
1950
|
-
/* @__PURE__ */ e(
|
|
1951
|
-
/* @__PURE__ */ e(
|
|
1930
|
+
/* @__PURE__ */ e(Kt, {}),
|
|
1931
|
+
/* @__PURE__ */ e(Zt, { onItemClick: P }),
|
|
1932
|
+
/* @__PURE__ */ e(lo, {}),
|
|
1952
1933
|
/* @__PURE__ */ e(kt, {}),
|
|
1953
1934
|
/* @__PURE__ */ e(pt, {}),
|
|
1954
|
-
/* @__PURE__ */ e(
|
|
1935
|
+
/* @__PURE__ */ e(yt, { open: c, setOpen: d }),
|
|
1955
1936
|
/* @__PURE__ */ e(
|
|
1956
|
-
|
|
1937
|
+
io,
|
|
1957
1938
|
{
|
|
1958
1939
|
open: a,
|
|
1959
1940
|
setOpen: s,
|
|
@@ -1961,7 +1942,7 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1961
1942
|
}
|
|
1962
1943
|
),
|
|
1963
1944
|
/* @__PURE__ */ e(
|
|
1964
|
-
|
|
1945
|
+
oo,
|
|
1965
1946
|
{
|
|
1966
1947
|
open: u,
|
|
1967
1948
|
setOpen: g,
|
|
@@ -1992,8 +1973,8 @@ const Ht = le.Root, Wt = le.ValueText, ze = () => {
|
|
|
1992
1973
|
);
|
|
1993
1974
|
};
|
|
1994
1975
|
export {
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1976
|
+
Xn as BOOKMARK_AREA_DATA_ATTRIBUTE,
|
|
1977
|
+
zo as ReactReader,
|
|
1978
|
+
To as ReactReaderProvider
|
|
1998
1979
|
};
|
|
1999
1980
|
//# sourceMappingURL=index.js.map
|