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