@prose-reader/react-reader 1.251.0 → 1.252.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 +389 -390
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { jsx as e, jsxs as s, Fragment as be } from "react/jsx-runtime";
|
|
2
2
|
import * as T from "react";
|
|
3
|
-
import Ne, { createContext as Ve, memo as f, useMemo as Pe, useEffect as H, useContext as Ge, useState as y, useLayoutEffect as je, useCallback as
|
|
3
|
+
import Ne, { createContext as Ve, memo as f, useMemo as Pe, useEffect as H, useContext as Ge, useState as y, useLayoutEffect as je, useCallback as ne, useRef as qe } from "react";
|
|
4
4
|
import { signal as L, useConstant as ee, useLiveRef as Ye, useSubscribe as N, useObserve as b, isDefined as Be, useSignalValue as ue, useSignalState as Ue } from "reactjrx";
|
|
5
|
-
import { Subject as Ae, tap as xe, map as _, filter as le, switchMap as W, EMPTY as ye, of as ce, withLatestFrom as Ze, NEVER as ve, startWith as Qe, distinctUntilChanged as Ce, throttleTime as Ke, first as ze, combineLatest as Xe, mergeMap as Je, skip as Oe, merge as Me, timer as Ee, finalize as
|
|
6
|
-
import { IconButton as v, Portal as ke, Dialog as k, List as P, Link as Se, Stack as C, Text as p, Tabs as D, Button as V, Presence as oe, Box as B, createToaster as
|
|
7
|
-
import { LuX as
|
|
8
|
-
import { createPortal as
|
|
9
|
-
import { isPositionInArea as
|
|
10
|
-
import { isShallowEqual as
|
|
11
|
-
import { BsBookmarks as
|
|
12
|
-
import { MdOutlineFitScreen as
|
|
13
|
-
import { RiGalleryView2 as
|
|
14
|
-
import { RxDoubleArrowUp as
|
|
15
|
-
import { HiOutlineInformationCircle as
|
|
16
|
-
import
|
|
5
|
+
import { Subject as Ae, tap as xe, map as _, filter as le, switchMap as W, EMPTY as ye, of as ce, withLatestFrom as Ze, NEVER as ve, startWith as Qe, distinctUntilChanged as Ce, throttleTime as Ke, first as ze, combineLatest as Xe, mergeMap as Je, skip as Oe, merge as Me, timer as Ee, finalize as et, BehaviorSubject as tt } from "rxjs";
|
|
6
|
+
import { IconButton as v, Portal as ke, Dialog as k, List as P, Link as Se, Stack as C, Text as p, Tabs as D, Button as V, Presence as oe, Box as B, createToaster as nt, Toaster as ot, Toast as $, Spinner as rt, Heading as ge, HStack as O, Kbd as Te, Popover as F, Progress as re, chakra as it, Collapsible as pe, Field as J, RadioGroup as te, Slider as R, For as at, Fieldset as fe, Input as st } from "@chakra-ui/react";
|
|
7
|
+
import { LuX as lt, LuNotebookPen as de, LuBookmark as ct, LuArrowBigRight as dt, LuArrowBigLeft as ut, LuChevronDown as ht, LuCircleHelp as gt, LuTableOfContents as pt, LuSearch as ft, LuZoomOut as mt, LuZoomIn as bt, LuGalleryHorizontal as xt, LuCircleCheck as we } from "react-icons/lu";
|
|
8
|
+
import { createPortal as vt } from "react-dom";
|
|
9
|
+
import { isPositionInArea as Ct } from "@prose-reader/enhancer-gestures";
|
|
10
|
+
import { isShallowEqual as kt, observeIntersection as St, isHtmlTagElement as It } from "@prose-reader/core";
|
|
11
|
+
import { BsBookmarks as Rt } from "react-icons/bs";
|
|
12
|
+
import { MdOutlineFitScreen as yt, MdFullscreenExit as Tt, MdFullscreen as wt } from "react-icons/md";
|
|
13
|
+
import { RiGalleryView2 as Pt } from "react-icons/ri";
|
|
14
|
+
import { RxDoubleArrowUp as Bt, RxDoubleArrowLeft as At, RxDoubleArrowDown as zt, RxDoubleArrowRight as Ot } from "react-icons/rx";
|
|
15
|
+
import { HiOutlineInformationCircle as Mt } from "react-icons/hi";
|
|
16
|
+
import Et from "rc-slider";
|
|
17
17
|
import "rc-slider/assets/index.css";
|
|
18
|
-
import { IoIosArrowBack as
|
|
19
|
-
const
|
|
18
|
+
import { IoIosArrowBack as Dt, IoMdMore as Lt } from "react-icons/io";
|
|
19
|
+
const _t = "data-bookmark-area", De = Ve({
|
|
20
20
|
reader: void 0,
|
|
21
21
|
quickMenuSignal: L({ default: !1 }),
|
|
22
22
|
quickMenuBottomBarBoundingBox: L({ default: void 0 }),
|
|
@@ -24,8 +24,8 @@ const $n = "data-bookmark-area", De = Ve({
|
|
|
24
24
|
refitMenuSignal: L({ default: !1 })
|
|
25
25
|
}), ao = f(
|
|
26
26
|
({
|
|
27
|
-
children:
|
|
28
|
-
reader:
|
|
27
|
+
children: t,
|
|
28
|
+
reader: n,
|
|
29
29
|
quickMenuOpen: o,
|
|
30
30
|
onQuickMenuOpenChange: r
|
|
31
31
|
}) => {
|
|
@@ -46,14 +46,14 @@ const $n = "data-bookmark-area", De = Ve({
|
|
|
46
46
|
), d = Ye(r), u = Pe(
|
|
47
47
|
() => ({
|
|
48
48
|
quickMenuSignal: i,
|
|
49
|
-
reader:
|
|
49
|
+
reader: n,
|
|
50
50
|
notificationsSubject: a,
|
|
51
51
|
refitMenuSignal: c,
|
|
52
52
|
quickMenuBottomBarBoundingBox: l
|
|
53
53
|
}),
|
|
54
54
|
[
|
|
55
55
|
i,
|
|
56
|
-
|
|
56
|
+
n,
|
|
57
57
|
a,
|
|
58
58
|
c,
|
|
59
59
|
l
|
|
@@ -64,32 +64,32 @@ const $n = "data-bookmark-area", De = Ve({
|
|
|
64
64
|
}, [o, i]), N(
|
|
65
65
|
() => i.pipe(xe(d.current)),
|
|
66
66
|
[i, d]
|
|
67
|
-
), /* @__PURE__ */ e(De.Provider, { value: u, children:
|
|
67
|
+
), /* @__PURE__ */ e(De.Provider, { value: u, children: t });
|
|
68
68
|
}
|
|
69
|
-
),
|
|
70
|
-
return /* @__PURE__ */ e(v, { variant: "ghost", "aria-label": "Close", ref: o, ...
|
|
71
|
-
}), G = T.forwardRef(function(
|
|
69
|
+
), $t = T.forwardRef(function(n, o) {
|
|
70
|
+
return /* @__PURE__ */ e(v, { variant: "ghost", "aria-label": "Close", ref: o, ...n, children: n.children ?? /* @__PURE__ */ e(lt, {}) });
|
|
71
|
+
}), G = T.forwardRef(function(n, o) {
|
|
72
72
|
const {
|
|
73
73
|
children: r,
|
|
74
74
|
portalled: i = !0,
|
|
75
75
|
portalRef: a,
|
|
76
76
|
backdrop: l = !0,
|
|
77
77
|
...c
|
|
78
|
-
} =
|
|
78
|
+
} = n;
|
|
79
79
|
return /* @__PURE__ */ s(ke, { disabled: !i, container: a, children: [
|
|
80
80
|
l && /* @__PURE__ */ e(k.Backdrop, {}),
|
|
81
81
|
/* @__PURE__ */ e(k.Positioner, { children: /* @__PURE__ */ e(k.Content, { ref: o, ...c, asChild: !1, children: r }) })
|
|
82
82
|
] });
|
|
83
|
-
}), j = T.forwardRef(function(
|
|
83
|
+
}), j = T.forwardRef(function(n, o) {
|
|
84
84
|
return /* @__PURE__ */ e(
|
|
85
85
|
k.CloseTrigger,
|
|
86
86
|
{
|
|
87
87
|
position: "absolute",
|
|
88
88
|
top: "2",
|
|
89
89
|
insetEnd: "2",
|
|
90
|
-
...
|
|
90
|
+
...n,
|
|
91
91
|
asChild: !0,
|
|
92
|
-
children: /* @__PURE__ */ e(
|
|
92
|
+
children: /* @__PURE__ */ e($t, { size: "sm", ref: o, children: n.children })
|
|
93
93
|
}
|
|
94
94
|
);
|
|
95
95
|
}), q = k.Root, Y = k.Footer, U = k.Header, Z = k.Body;
|
|
@@ -98,30 +98,30 @@ const Q = k.Title;
|
|
|
98
98
|
k.Description;
|
|
99
99
|
k.Trigger;
|
|
100
100
|
const K = k.ActionTrigger, E = () => Ge(De), m = () => {
|
|
101
|
-
const { reader:
|
|
102
|
-
return
|
|
103
|
-
}, Le = (
|
|
104
|
-
const
|
|
101
|
+
const { reader: t } = E();
|
|
102
|
+
return t;
|
|
103
|
+
}, Le = (t) => !!t && "__PROSE_READER_ENHANCER_SEARCH" in t, ie = (t) => !!t && "__PROSE_READER_ENHANCER_ANNOTATIONS" in t, _e = (t) => !!t && "__PROSE_READER_ENHANCER_GALLERY" in t, $e = (t) => !!t && "__PROSE_READER_ENHANCER_REFIT" in t, Ft = (t) => {
|
|
104
|
+
const n = m(), o = ie(n) ? n : void 0;
|
|
105
105
|
return { data: b(
|
|
106
106
|
() => o?.annotations.annotations$.pipe(
|
|
107
|
-
_((i) => i.find((a) => a.id ===
|
|
107
|
+
_((i) => i.find((a) => a.id === t)),
|
|
108
108
|
le(Be),
|
|
109
109
|
W((i) => o.locateResource(i))
|
|
110
110
|
),
|
|
111
111
|
[o]
|
|
112
112
|
) };
|
|
113
113
|
}, Fe = ({
|
|
114
|
-
id:
|
|
115
|
-
onNavigate:
|
|
114
|
+
id: t,
|
|
115
|
+
onNavigate: n,
|
|
116
116
|
allowLeftIcon: o = !0
|
|
117
117
|
}) => {
|
|
118
|
-
const r = m(), { data: i } =
|
|
118
|
+
const r = m(), { data: i } = Ft(t), a = i?.meta.range?.toString() || i?.meta.node?.textContent;
|
|
119
119
|
return /* @__PURE__ */ e(P.Item, { children: /* @__PURE__ */ s(
|
|
120
120
|
Se,
|
|
121
121
|
{
|
|
122
122
|
href: "#",
|
|
123
123
|
onClick: () => {
|
|
124
|
-
|
|
124
|
+
n(), r?.navigation.goToCfi(i?.meta.cfi ?? "");
|
|
125
125
|
},
|
|
126
126
|
children: [
|
|
127
127
|
i?.resource?.notes ? /* @__PURE__ */ e(P.Indicator, { asChild: !0, children: /* @__PURE__ */ e(de, {}) }) : o ? /* @__PURE__ */ e(P.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ e(de, {}) }) : null,
|
|
@@ -144,54 +144,54 @@ const K = k.ActionTrigger, E = () => Ge(De), m = () => {
|
|
|
144
144
|
}
|
|
145
145
|
) });
|
|
146
146
|
}, he = () => {
|
|
147
|
-
const
|
|
147
|
+
const t = m(), n = ie(t) ? t : void 0;
|
|
148
148
|
return { data: b(
|
|
149
|
-
() =>
|
|
149
|
+
() => n?.annotations.annotations$.pipe(
|
|
150
150
|
W(
|
|
151
|
-
(r) =>
|
|
151
|
+
(r) => n.locateResource(r)
|
|
152
152
|
)
|
|
153
153
|
),
|
|
154
|
-
[
|
|
154
|
+
[n]
|
|
155
155
|
) };
|
|
156
|
-
},
|
|
157
|
-
const { data:
|
|
156
|
+
}, Wt = () => {
|
|
157
|
+
const { data: t } = he();
|
|
158
158
|
return {
|
|
159
|
-
data:
|
|
159
|
+
data: t?.filter((n) => n.meta.isCfiRange)
|
|
160
160
|
};
|
|
161
|
-
},
|
|
162
|
-
const { data:
|
|
163
|
-
return /* @__PURE__ */ e(P.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children:
|
|
161
|
+
}, Ht = ({ onNavigate: t }) => {
|
|
162
|
+
const { data: n } = Wt();
|
|
163
|
+
return /* @__PURE__ */ e(P.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children: n?.map((o) => /* @__PURE__ */ e(
|
|
164
164
|
Fe,
|
|
165
165
|
{
|
|
166
166
|
id: o.resource.id,
|
|
167
|
-
onNavigate:
|
|
167
|
+
onNavigate: t
|
|
168
168
|
},
|
|
169
169
|
o.resource.id
|
|
170
170
|
)) });
|
|
171
|
-
},
|
|
172
|
-
const { data:
|
|
171
|
+
}, Nt = () => {
|
|
172
|
+
const { data: t } = he();
|
|
173
173
|
return {
|
|
174
|
-
data:
|
|
175
|
-
(
|
|
174
|
+
data: t?.filter(
|
|
175
|
+
(n) => !n.meta.isCfiRange && !n.resource.notes
|
|
176
176
|
)
|
|
177
177
|
};
|
|
178
|
-
},
|
|
179
|
-
const { data:
|
|
180
|
-
return /* @__PURE__ */ e(P.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children:
|
|
178
|
+
}, Vt = ({ onNavigate: t }) => {
|
|
179
|
+
const { data: n } = Nt();
|
|
180
|
+
return /* @__PURE__ */ e(P.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children: n?.map((o) => /* @__PURE__ */ e(
|
|
181
181
|
Fe,
|
|
182
182
|
{
|
|
183
183
|
id: o.resource.id,
|
|
184
|
-
onNavigate:
|
|
184
|
+
onNavigate: t,
|
|
185
185
|
allowLeftIcon: !1
|
|
186
186
|
},
|
|
187
187
|
o.resource.id
|
|
188
188
|
)) });
|
|
189
|
-
},
|
|
189
|
+
}, Gt = f(
|
|
190
190
|
({
|
|
191
|
-
onNavigate:
|
|
192
|
-
defaultTab:
|
|
191
|
+
onNavigate: t,
|
|
192
|
+
defaultTab: n
|
|
193
193
|
}) => {
|
|
194
|
-
const [o, r] = y(
|
|
194
|
+
const [o, r] = y(n ?? "bookmarks");
|
|
195
195
|
return /* @__PURE__ */ s(
|
|
196
196
|
D.Root,
|
|
197
197
|
{
|
|
@@ -200,7 +200,7 @@ const K = k.ActionTrigger, E = () => Ge(De), m = () => {
|
|
|
200
200
|
children: [
|
|
201
201
|
/* @__PURE__ */ s(D.List, { children: [
|
|
202
202
|
/* @__PURE__ */ s(D.Trigger, { value: "bookmarks", children: [
|
|
203
|
-
/* @__PURE__ */ e(
|
|
203
|
+
/* @__PURE__ */ e(ct, {}),
|
|
204
204
|
"Bookmarks"
|
|
205
205
|
] }),
|
|
206
206
|
/* @__PURE__ */ s(D.Trigger, { value: "annotations", children: [
|
|
@@ -209,33 +209,33 @@ const K = k.ActionTrigger, E = () => Ge(De), m = () => {
|
|
|
209
209
|
] }),
|
|
210
210
|
/* @__PURE__ */ e(D.Indicator, {})
|
|
211
211
|
] }),
|
|
212
|
-
/* @__PURE__ */ e(D.Content, { value: "bookmarks", children: /* @__PURE__ */ e(
|
|
213
|
-
/* @__PURE__ */ e(D.Content, { value: "annotations", children: /* @__PURE__ */ e(
|
|
212
|
+
/* @__PURE__ */ e(D.Content, { value: "bookmarks", children: /* @__PURE__ */ e(Vt, { onNavigate: t }) }),
|
|
213
|
+
/* @__PURE__ */ e(D.Content, { value: "annotations", children: /* @__PURE__ */ e(Ht, { onNavigate: t }) })
|
|
214
214
|
]
|
|
215
215
|
}
|
|
216
216
|
);
|
|
217
217
|
}
|
|
218
|
-
),
|
|
218
|
+
), jt = f(
|
|
219
219
|
({
|
|
220
|
-
openWith:
|
|
221
|
-
setOpen:
|
|
220
|
+
openWith: t,
|
|
221
|
+
setOpen: n,
|
|
222
222
|
onNavigate: o
|
|
223
223
|
}) => /* @__PURE__ */ e(
|
|
224
224
|
q,
|
|
225
225
|
{
|
|
226
226
|
lazyMount: !0,
|
|
227
227
|
placement: "center",
|
|
228
|
-
open: !!
|
|
229
|
-
onOpenChange: (r) =>
|
|
228
|
+
open: !!t,
|
|
229
|
+
onOpenChange: (r) => n(r.open),
|
|
230
230
|
size: { mdDown: "full", md: "lg" },
|
|
231
231
|
scrollBehavior: "inside",
|
|
232
232
|
children: /* @__PURE__ */ s(G, { height: "100%", children: [
|
|
233
233
|
/* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(Q, { children: "Annotations" }) }),
|
|
234
234
|
/* @__PURE__ */ e(Z, { flex: 1, children: /* @__PURE__ */ e(
|
|
235
|
-
|
|
235
|
+
Gt,
|
|
236
236
|
{
|
|
237
237
|
onNavigate: o,
|
|
238
|
-
defaultTab:
|
|
238
|
+
defaultTab: t
|
|
239
239
|
}
|
|
240
240
|
) }),
|
|
241
241
|
/* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(K, { asChild: !0, children: /* @__PURE__ */ e(V, { variant: "outline", children: "Cancel" }) }) }),
|
|
@@ -243,39 +243,39 @@ const K = k.ActionTrigger, E = () => Ge(De), m = () => {
|
|
|
243
243
|
] })
|
|
244
244
|
}
|
|
245
245
|
)
|
|
246
|
-
),
|
|
247
|
-
const
|
|
248
|
-
return o ? /* @__PURE__ */ e(be, { children:
|
|
249
|
-
}),
|
|
250
|
-
absolutePageIndex:
|
|
251
|
-
itemIndex:
|
|
246
|
+
), qt = f(({ children: t }) => {
|
|
247
|
+
const n = m(), o = b(() => n?.spine.element$, [n]);
|
|
248
|
+
return o ? /* @__PURE__ */ e(be, { children: vt(t, o) }) : null;
|
|
249
|
+
}), Yt = ({
|
|
250
|
+
absolutePageIndex: t,
|
|
251
|
+
itemIndex: n
|
|
252
252
|
}) => {
|
|
253
253
|
const o = m();
|
|
254
254
|
return {
|
|
255
|
-
spineItem: b(() => o ?
|
|
255
|
+
spineItem: b(() => o ? n !== void 0 ? ce(o.spine.spineItemsManager.get(n)) : t !== void 0 ? o.spine.pages.observeFromAbsolutePageIndex(t).pipe(
|
|
256
256
|
_((i) => o.spine.spineItemsManager.get(i?.itemIndex))
|
|
257
|
-
) : ye : ye, [
|
|
257
|
+
) : ye : ye, [n, t, o])
|
|
258
258
|
};
|
|
259
|
-
},
|
|
260
|
-
absolutePageIndex:
|
|
261
|
-
itemIndex:
|
|
259
|
+
}, Ut = ({
|
|
260
|
+
absolutePageIndex: t,
|
|
261
|
+
itemIndex: n
|
|
262
262
|
}) => {
|
|
263
|
-
const { spineItem: o } =
|
|
263
|
+
const { spineItem: o } = Yt({ absolutePageIndex: t, itemIndex: n }), r = b(
|
|
264
264
|
() => o?.isReady$ ?? ce(!1),
|
|
265
265
|
[o]
|
|
266
266
|
);
|
|
267
267
|
return { spineItem: o, isReady: r };
|
|
268
|
-
},
|
|
268
|
+
}, Zt = f(
|
|
269
269
|
({
|
|
270
|
-
absolutePageIndex:
|
|
271
|
-
left:
|
|
270
|
+
absolutePageIndex: t,
|
|
271
|
+
left: n,
|
|
272
272
|
top: o,
|
|
273
273
|
width: r
|
|
274
274
|
}) => {
|
|
275
|
-
const { isReady: i } =
|
|
276
|
-
absolutePageIndex:
|
|
275
|
+
const { isReady: i } = Ut({
|
|
276
|
+
absolutePageIndex: t
|
|
277
277
|
}), { data: a } = he(), l = a?.find(
|
|
278
|
-
(d) => d?.meta?.absolutePageIndex ===
|
|
278
|
+
(d) => d?.meta?.absolutePageIndex === t && d.meta.range === void 0
|
|
279
279
|
);
|
|
280
280
|
if (!i) return null;
|
|
281
281
|
const c = r * 0.1 / 2;
|
|
@@ -289,9 +289,9 @@ const K = k.ActionTrigger, E = () => Ge(De), m = () => {
|
|
|
289
289
|
children: /* @__PURE__ */ e(
|
|
290
290
|
B,
|
|
291
291
|
{
|
|
292
|
-
"data-bookmark-area":
|
|
292
|
+
"data-bookmark-area": _t,
|
|
293
293
|
position: "absolute",
|
|
294
|
-
left:
|
|
294
|
+
left: n + r,
|
|
295
295
|
transform: "translateX(-100%)",
|
|
296
296
|
pointerEvents: "none",
|
|
297
297
|
top: o,
|
|
@@ -312,11 +312,11 @@ const K = k.ActionTrigger, E = () => Ge(De), m = () => {
|
|
|
312
312
|
}
|
|
313
313
|
);
|
|
314
314
|
}
|
|
315
|
-
),
|
|
316
|
-
const
|
|
317
|
-
return /* @__PURE__ */ e(
|
|
315
|
+
), Qt = f(() => {
|
|
316
|
+
const t = m(), n = b(() => t?.layoutInfo$, [t]);
|
|
317
|
+
return /* @__PURE__ */ e(qt, { children: n?.pages.map(
|
|
318
318
|
({ absoluteLayout: { left: o, top: r, width: i } }, a) => /* @__PURE__ */ e(
|
|
319
|
-
|
|
319
|
+
Zt,
|
|
320
320
|
{
|
|
321
321
|
absolutePageIndex: a,
|
|
322
322
|
left: o,
|
|
@@ -326,15 +326,15 @@ const K = k.ActionTrigger, E = () => Ge(De), m = () => {
|
|
|
326
326
|
a
|
|
327
327
|
)
|
|
328
328
|
) });
|
|
329
|
-
}),
|
|
330
|
-
const
|
|
331
|
-
return ie(
|
|
332
|
-
},
|
|
333
|
-
const
|
|
334
|
-
H(() =>
|
|
329
|
+
}), Kt = () => {
|
|
330
|
+
const t = m();
|
|
331
|
+
return ie(t) ? t : void 0;
|
|
332
|
+
}, Xt = () => {
|
|
333
|
+
const t = Kt(), { data: n } = he();
|
|
334
|
+
H(() => t ? t.gestures.hooks.register(
|
|
335
335
|
"beforeTapGesture",
|
|
336
336
|
({ event$: r }) => r.pipe(
|
|
337
|
-
Ze(
|
|
337
|
+
Ze(t?.annotations.candidates$),
|
|
338
338
|
_(([i, a]) => {
|
|
339
339
|
if (!i.page) return !0;
|
|
340
340
|
const {
|
|
@@ -343,7 +343,7 @@ const K = k.ActionTrigger, E = () => Ge(De), m = () => {
|
|
|
343
343
|
spineItemPagePosition: d,
|
|
344
344
|
pageSize: u
|
|
345
345
|
} = i.page;
|
|
346
|
-
if (
|
|
346
|
+
if (Ct(
|
|
347
347
|
d,
|
|
348
348
|
{
|
|
349
349
|
type: "corner",
|
|
@@ -353,37 +353,37 @@ const K = k.ActionTrigger, E = () => Ge(De), m = () => {
|
|
|
353
353
|
},
|
|
354
354
|
u
|
|
355
355
|
)) {
|
|
356
|
-
const h =
|
|
356
|
+
const h = t.spine.pages.fromSpineItemPageIndex(
|
|
357
357
|
l,
|
|
358
358
|
c
|
|
359
359
|
);
|
|
360
360
|
if (!h) return !0;
|
|
361
|
-
const x =
|
|
361
|
+
const x = n?.find(
|
|
362
362
|
(I) => I?.meta?.absolutePageIndex === h.absolutePageIndex && I.meta.range === void 0
|
|
363
363
|
);
|
|
364
364
|
if (x)
|
|
365
|
-
return
|
|
365
|
+
return t?.annotations.delete(x.resource.id), !1;
|
|
366
366
|
if (a?.[h.absolutePageIndex])
|
|
367
|
-
return
|
|
367
|
+
return t?.annotations.annotateAbsolutePage({
|
|
368
368
|
absolutePageIndex: h.absolutePageIndex
|
|
369
369
|
}), !1;
|
|
370
370
|
}
|
|
371
371
|
return !0;
|
|
372
372
|
})
|
|
373
373
|
)
|
|
374
|
-
) : void 0, [
|
|
375
|
-
}, me =
|
|
374
|
+
) : void 0, [t, n]);
|
|
375
|
+
}, me = nt({
|
|
376
376
|
placement: "bottom-end",
|
|
377
377
|
pauseOnPageIdle: !0
|
|
378
|
-
}),
|
|
379
|
-
|
|
378
|
+
}), Jt = () => /* @__PURE__ */ e(ke, { children: /* @__PURE__ */ e(ot, { toaster: me, insetInline: { mdDown: "4" }, children: (t) => /* @__PURE__ */ s($.Root, { width: { md: "sm" }, children: [
|
|
379
|
+
t.type === "loading" ? /* @__PURE__ */ e(rt, { size: "sm", color: "blue.solid" }) : /* @__PURE__ */ e($.Indicator, {}),
|
|
380
380
|
/* @__PURE__ */ s(C, { gap: "1", flex: "1", maxWidth: "100%", children: [
|
|
381
|
-
|
|
382
|
-
|
|
381
|
+
t.title && /* @__PURE__ */ e($.Title, { children: t.title }),
|
|
382
|
+
t.description && /* @__PURE__ */ e($.Description, { children: t.description })
|
|
383
383
|
] }),
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
] }) }) }),
|
|
384
|
+
t.action && /* @__PURE__ */ e($.ActionTrigger, { children: t.action.label }),
|
|
385
|
+
t.meta?.closable && /* @__PURE__ */ e($.CloseTrigger, {})
|
|
386
|
+
] }) }) }), en = {
|
|
387
387
|
x: 0,
|
|
388
388
|
y: 0,
|
|
389
389
|
width: 0,
|
|
@@ -393,8 +393,8 @@ const K = k.ActionTrigger, E = () => Ge(De), m = () => {
|
|
|
393
393
|
bottom: 0,
|
|
394
394
|
right: 0
|
|
395
395
|
};
|
|
396
|
-
function
|
|
397
|
-
const [
|
|
396
|
+
function tn() {
|
|
397
|
+
const [t, n] = y(null), [o, r] = y(en), i = Pe(
|
|
398
398
|
() => new ResizeObserver((a) => {
|
|
399
399
|
if (a[0]) {
|
|
400
400
|
const { x: l, y: c, width: d, height: u, top: g, left: h, bottom: x, right: S } = a[0].contentRect;
|
|
@@ -404,46 +404,46 @@ function tt() {
|
|
|
404
404
|
[]
|
|
405
405
|
);
|
|
406
406
|
return je(() => {
|
|
407
|
-
if (
|
|
408
|
-
return i.observe(
|
|
407
|
+
if (t)
|
|
408
|
+
return i.observe(t), () => {
|
|
409
409
|
i.disconnect();
|
|
410
410
|
};
|
|
411
|
-
}, [
|
|
411
|
+
}, [t, i]), [n, o, t];
|
|
412
412
|
}
|
|
413
|
-
const
|
|
413
|
+
const nn = (t, n, o) => {
|
|
414
414
|
const r = m(), i = _e(r) ? r : void 0;
|
|
415
415
|
N(() => {
|
|
416
|
-
if (!i || !
|
|
417
|
-
const a =
|
|
418
|
-
Qe(
|
|
419
|
-
Ce(
|
|
420
|
-
), l =
|
|
421
|
-
|
|
416
|
+
if (!i || !t) return ve;
|
|
417
|
+
const a = n.layout.layout$.pipe(
|
|
418
|
+
Qe(n.layout.layoutInfo),
|
|
419
|
+
Ce(kt)
|
|
420
|
+
), l = St(
|
|
421
|
+
t
|
|
422
422
|
).pipe(_((c) => c.some((d) => d.isIntersecting)));
|
|
423
423
|
return a.pipe(
|
|
424
424
|
Ke(100, void 0, { trailing: !0 }),
|
|
425
425
|
W(() => l.pipe(
|
|
426
426
|
xe((c) => {
|
|
427
|
-
c || (
|
|
427
|
+
c || (t.innerHTML = "");
|
|
428
428
|
}),
|
|
429
429
|
le((c) => c),
|
|
430
430
|
ze()
|
|
431
431
|
).pipe(
|
|
432
|
-
W(() => (
|
|
433
|
-
t,
|
|
432
|
+
W(() => (t.innerHTML = "", i?.gallery.snapshot(
|
|
434
433
|
n,
|
|
434
|
+
t,
|
|
435
435
|
o
|
|
436
436
|
)))
|
|
437
437
|
))
|
|
438
438
|
);
|
|
439
|
-
}, [i,
|
|
440
|
-
},
|
|
441
|
-
({ item:
|
|
442
|
-
const [o, r, i] =
|
|
443
|
-
|
|
439
|
+
}, [i, n, o, t]);
|
|
440
|
+
}, on = f(
|
|
441
|
+
({ item: t, onNavigated: n }) => {
|
|
442
|
+
const [o, r, i] = tn(), a = m();
|
|
443
|
+
nn(i, t, r);
|
|
444
444
|
const l = b(
|
|
445
|
-
() => a?.locateResource(
|
|
446
|
-
[a,
|
|
445
|
+
() => a?.locateResource(t, { mode: "shallow" }),
|
|
446
|
+
[a, t]
|
|
447
447
|
);
|
|
448
448
|
return /* @__PURE__ */ s(
|
|
449
449
|
B,
|
|
@@ -458,7 +458,7 @@ const ot = (n, t, o) => {
|
|
|
458
458
|
position: "relative",
|
|
459
459
|
overflow: "hidden",
|
|
460
460
|
onClick: () => {
|
|
461
|
-
|
|
461
|
+
n(), a?.navigation.goToSpineItem({ indexOrId: t });
|
|
462
462
|
},
|
|
463
463
|
children: [
|
|
464
464
|
/* @__PURE__ */ e(
|
|
@@ -492,16 +492,16 @@ const ot = (n, t, o) => {
|
|
|
492
492
|
}
|
|
493
493
|
);
|
|
494
494
|
}
|
|
495
|
-
),
|
|
496
|
-
({ open:
|
|
495
|
+
), rn = f(
|
|
496
|
+
({ open: t, setOpen: n }) => {
|
|
497
497
|
const o = m(), r = b(() => o?.spineItemsManager.items$, [o]);
|
|
498
498
|
return /* @__PURE__ */ e(
|
|
499
499
|
q,
|
|
500
500
|
{
|
|
501
501
|
lazyMount: !0,
|
|
502
502
|
placement: "center",
|
|
503
|
-
open:
|
|
504
|
-
onOpenChange: (i) =>
|
|
503
|
+
open: t,
|
|
504
|
+
onOpenChange: (i) => n(i.open),
|
|
505
505
|
size: { mdDown: "full", md: "lg" },
|
|
506
506
|
scrollBehavior: "inside",
|
|
507
507
|
children: /* @__PURE__ */ s(G, { height: "100%", children: [
|
|
@@ -518,11 +518,11 @@ const ot = (n, t, o) => {
|
|
|
518
518
|
pt: 2,
|
|
519
519
|
"data-grid": !0,
|
|
520
520
|
children: r?.map((i) => /* @__PURE__ */ e(
|
|
521
|
-
|
|
521
|
+
on,
|
|
522
522
|
{
|
|
523
523
|
item: i,
|
|
524
524
|
onNavigated: () => {
|
|
525
|
-
|
|
525
|
+
n(!1);
|
|
526
526
|
}
|
|
527
527
|
},
|
|
528
528
|
i.item.id
|
|
@@ -535,14 +535,14 @@ const ot = (n, t, o) => {
|
|
|
535
535
|
}
|
|
536
536
|
);
|
|
537
537
|
}
|
|
538
|
-
),
|
|
539
|
-
({ open:
|
|
538
|
+
), an = "@prose-reader/react-reader", sn = "1.251.0", ln = f(
|
|
539
|
+
({ open: t, setOpen: n }) => /* @__PURE__ */ e(
|
|
540
540
|
q,
|
|
541
541
|
{
|
|
542
542
|
lazyMount: !0,
|
|
543
543
|
placement: "center",
|
|
544
|
-
open:
|
|
545
|
-
onOpenChange: (o) =>
|
|
544
|
+
open: t,
|
|
545
|
+
onOpenChange: (o) => n(o.open),
|
|
546
546
|
size: { mdDown: "full", md: "lg" },
|
|
547
547
|
scrollBehavior: "inside",
|
|
548
548
|
children: /* @__PURE__ */ s(G, { children: [
|
|
@@ -559,12 +559,12 @@ const ot = (n, t, o) => {
|
|
|
559
559
|
/* @__PURE__ */ s(C, { children: [
|
|
560
560
|
/* @__PURE__ */ e(ge, { mb: 2, as: "h3", size: "lg", children: "Shortcuts" }),
|
|
561
561
|
/* @__PURE__ */ s(O, { mb: 1, children: [
|
|
562
|
-
/* @__PURE__ */ e(Te, { children: /* @__PURE__ */ e(
|
|
562
|
+
/* @__PURE__ */ e(Te, { children: /* @__PURE__ */ e(dt, {}) }),
|
|
563
563
|
" ",
|
|
564
564
|
/* @__PURE__ */ e(p, { children: "Navigate to right page" })
|
|
565
565
|
] }),
|
|
566
566
|
/* @__PURE__ */ s(O, { mb: 1, children: [
|
|
567
|
-
/* @__PURE__ */ e(Te, { children: /* @__PURE__ */ e(
|
|
567
|
+
/* @__PURE__ */ e(Te, { children: /* @__PURE__ */ e(ut, {}) }),
|
|
568
568
|
" ",
|
|
569
569
|
/* @__PURE__ */ e(p, { children: "Navigate to left page" })
|
|
570
570
|
] })
|
|
@@ -576,9 +576,9 @@ const ot = (n, t, o) => {
|
|
|
576
576
|
/* @__PURE__ */ s(C, { children: [
|
|
577
577
|
/* @__PURE__ */ e(ge, { mb: 2, as: "h3", size: "lg", children: "About" }),
|
|
578
578
|
/* @__PURE__ */ s(p, { children: [
|
|
579
|
-
|
|
579
|
+
an,
|
|
580
580
|
" version: ",
|
|
581
|
-
|
|
581
|
+
sn
|
|
582
582
|
] })
|
|
583
583
|
] })
|
|
584
584
|
]
|
|
@@ -590,48 +590,48 @@ const ot = (n, t, o) => {
|
|
|
590
590
|
}
|
|
591
591
|
)
|
|
592
592
|
), X = () => {
|
|
593
|
-
const
|
|
593
|
+
const t = m();
|
|
594
594
|
return b(
|
|
595
|
-
() =>
|
|
596
|
-
_(([
|
|
595
|
+
() => t ? Xe([t.pagination.state$, t.context]).pipe(
|
|
596
|
+
_(([n, o]) => {
|
|
597
597
|
const r = o.manifest?.spineItems.every(
|
|
598
598
|
(i) => i.mediaType?.startsWith("image/")
|
|
599
599
|
);
|
|
600
600
|
return {
|
|
601
|
-
...
|
|
601
|
+
...n,
|
|
602
602
|
hasChapters: !o.isFullyPrePaginated && !r
|
|
603
603
|
};
|
|
604
604
|
})
|
|
605
605
|
) : ve,
|
|
606
|
-
[
|
|
606
|
+
[t]
|
|
607
607
|
);
|
|
608
|
-
},
|
|
609
|
-
const
|
|
610
|
-
(
|
|
611
|
-
), o =
|
|
612
|
-
return
|
|
608
|
+
}, cn = () => {
|
|
609
|
+
const t = X(), n = Math.floor(
|
|
610
|
+
(t?.percentageEstimateOfBook ?? 0) * 100
|
|
611
|
+
), o = n > 0 ? n : 1;
|
|
612
|
+
return t?.percentageEstimateOfBook === void 0 ? null : /* @__PURE__ */ e(B, { position: "absolute", right: 0, bottom: 0, p: 2, color: "black", children: /* @__PURE__ */ s(p, { fontSize: "sm", children: [
|
|
613
613
|
o,
|
|
614
614
|
" %"
|
|
615
615
|
] }) });
|
|
616
|
-
},
|
|
617
|
-
const [
|
|
616
|
+
}, dn = () => {
|
|
617
|
+
const [t, n] = y(/* @__PURE__ */ new Date());
|
|
618
618
|
return H(() => {
|
|
619
619
|
const o = setInterval(() => {
|
|
620
|
-
|
|
620
|
+
n(/* @__PURE__ */ new Date());
|
|
621
621
|
}, 6e4);
|
|
622
622
|
return () => clearInterval(o);
|
|
623
|
-
}, []),
|
|
624
|
-
},
|
|
625
|
-
const
|
|
626
|
-
return /* @__PURE__ */ e(p, { fontSize: "xs", ...
|
|
623
|
+
}, []), t;
|
|
624
|
+
}, un = (t) => {
|
|
625
|
+
const n = dn();
|
|
626
|
+
return /* @__PURE__ */ e(p, { fontSize: "xs", ...t, children: n.toLocaleTimeString(navigator.language, {
|
|
627
627
|
hour: "2-digit",
|
|
628
628
|
minute: "2-digit"
|
|
629
629
|
}) });
|
|
630
630
|
}, Ie = () => {
|
|
631
|
-
const { quickMenuSignal:
|
|
632
|
-
return [ue(
|
|
633
|
-
},
|
|
634
|
-
const [
|
|
631
|
+
const { quickMenuSignal: t } = E();
|
|
632
|
+
return [ue(t), t.update, t];
|
|
633
|
+
}, hn = () => {
|
|
634
|
+
const [t] = Ie();
|
|
635
635
|
return /* @__PURE__ */ e(
|
|
636
636
|
B,
|
|
637
637
|
{
|
|
@@ -639,71 +639,71 @@ const ot = (n, t, o) => {
|
|
|
639
639
|
left: 0,
|
|
640
640
|
bottom: 0,
|
|
641
641
|
p: 2,
|
|
642
|
-
color:
|
|
643
|
-
children: /* @__PURE__ */ e(
|
|
642
|
+
color: t ? void 0 : "colorPalette.contrast",
|
|
643
|
+
children: /* @__PURE__ */ e(un, {})
|
|
644
644
|
}
|
|
645
645
|
);
|
|
646
|
-
},
|
|
647
|
-
const
|
|
646
|
+
}, gn = () => {
|
|
647
|
+
const t = m();
|
|
648
648
|
N(
|
|
649
|
-
() =>
|
|
650
|
-
if (
|
|
651
|
-
if (!
|
|
652
|
-
const o = new URL(
|
|
649
|
+
() => t?.links$.subscribe((n) => {
|
|
650
|
+
if (n.type === "click" && It(n.target, "a")) {
|
|
651
|
+
if (!n.target.href) return;
|
|
652
|
+
const o = new URL(n.target.href);
|
|
653
653
|
window.location.host !== o.host && confirm(
|
|
654
654
|
"You are going to be redirected to external link"
|
|
655
|
-
) && window.open(
|
|
655
|
+
) && window.open(n.target.href, "__blank");
|
|
656
656
|
}
|
|
657
657
|
}),
|
|
658
|
-
[
|
|
658
|
+
[t]
|
|
659
659
|
);
|
|
660
|
-
},
|
|
661
|
-
const
|
|
660
|
+
}, pn = () => {
|
|
661
|
+
const t = m(), { notificationsSubject: n } = E();
|
|
662
662
|
N(
|
|
663
|
-
() =>
|
|
663
|
+
() => t?.settings.values$.pipe(
|
|
664
664
|
_(({ fontScale: o }) => o),
|
|
665
665
|
Ce(),
|
|
666
666
|
Oe(1),
|
|
667
667
|
xe((o) => {
|
|
668
|
-
|
|
668
|
+
n.next({
|
|
669
669
|
key: "fontScaleChange",
|
|
670
670
|
title: "Font size changed",
|
|
671
671
|
description: `${o * 100} %`
|
|
672
672
|
});
|
|
673
673
|
})
|
|
674
674
|
),
|
|
675
|
-
[
|
|
675
|
+
[t, n]
|
|
676
676
|
);
|
|
677
|
-
},
|
|
678
|
-
const { notificationsSubject:
|
|
679
|
-
|
|
680
|
-
() =>
|
|
677
|
+
}, fn = () => {
|
|
678
|
+
const { notificationsSubject: t } = E();
|
|
679
|
+
pn(), N(
|
|
680
|
+
() => t.pipe(
|
|
681
681
|
le(Be),
|
|
682
|
-
Je((
|
|
683
|
-
const o =
|
|
684
|
-
title:
|
|
685
|
-
description:
|
|
682
|
+
Je((n) => {
|
|
683
|
+
const o = n.duration ?? 3e3, r = me.create({
|
|
684
|
+
title: n.title,
|
|
685
|
+
description: n.description,
|
|
686
686
|
duration: o
|
|
687
|
-
}), i =
|
|
687
|
+
}), i = t.pipe(
|
|
688
688
|
Oe(1),
|
|
689
|
-
le((a) => !!
|
|
689
|
+
le((a) => !!n.key && a?.key === n.key)
|
|
690
690
|
);
|
|
691
691
|
return Me(
|
|
692
692
|
Ee(o),
|
|
693
|
-
|
|
693
|
+
n.abort ?? ve,
|
|
694
694
|
i
|
|
695
695
|
).pipe(
|
|
696
696
|
ze(),
|
|
697
|
-
|
|
697
|
+
et(() => {
|
|
698
698
|
me.dismiss(r);
|
|
699
699
|
})
|
|
700
700
|
);
|
|
701
701
|
})
|
|
702
702
|
),
|
|
703
|
-
[
|
|
703
|
+
[t]
|
|
704
704
|
);
|
|
705
|
-
},
|
|
706
|
-
function(
|
|
705
|
+
}, mn = T.forwardRef(
|
|
706
|
+
function(n, o) {
|
|
707
707
|
const {
|
|
708
708
|
showArrow: r,
|
|
709
709
|
children: i,
|
|
@@ -711,7 +711,7 @@ const ot = (n, t, o) => {
|
|
|
711
711
|
content: l,
|
|
712
712
|
portalRef: c,
|
|
713
713
|
...d
|
|
714
|
-
} =
|
|
714
|
+
} = n;
|
|
715
715
|
return /* @__PURE__ */ s(
|
|
716
716
|
F.Root,
|
|
717
717
|
{
|
|
@@ -738,35 +738,35 @@ const ot = (n, t, o) => {
|
|
|
738
738
|
}
|
|
739
739
|
);
|
|
740
740
|
}
|
|
741
|
-
),
|
|
742
|
-
const { children: r, ...i } =
|
|
743
|
-
return /* @__PURE__ */ e(
|
|
741
|
+
), bn = T.forwardRef(function(n, o) {
|
|
742
|
+
const { children: r, ...i } = n;
|
|
743
|
+
return /* @__PURE__ */ e(mn, { content: r, ...i, ref: o, children: /* @__PURE__ */ e(
|
|
744
744
|
v,
|
|
745
745
|
{
|
|
746
746
|
variant: "ghost",
|
|
747
747
|
"aria-label": "info",
|
|
748
748
|
size: "2xs",
|
|
749
749
|
colorPalette: "gray",
|
|
750
|
-
children: /* @__PURE__ */ e(
|
|
750
|
+
children: /* @__PURE__ */ e(Mt, {})
|
|
751
751
|
}
|
|
752
752
|
) });
|
|
753
|
-
}),
|
|
754
|
-
return /* @__PURE__ */ e(re.Track, { ...
|
|
753
|
+
}), xn = T.forwardRef(function(n, o) {
|
|
754
|
+
return /* @__PURE__ */ e(re.Track, { ...n, ref: o, children: /* @__PURE__ */ e(re.Range, {}) });
|
|
755
755
|
});
|
|
756
|
-
T.forwardRef(function(
|
|
757
|
-
const { children: r, info: i, ...a } =
|
|
756
|
+
T.forwardRef(function(n, o) {
|
|
757
|
+
const { children: r, info: i, ...a } = n;
|
|
758
758
|
return /* @__PURE__ */ s(re.Label, { ...a, ref: o, children: [
|
|
759
759
|
r,
|
|
760
|
-
i && /* @__PURE__ */ e(
|
|
760
|
+
i && /* @__PURE__ */ e(bn, { children: i })
|
|
761
761
|
] });
|
|
762
762
|
});
|
|
763
|
-
const
|
|
764
|
-
const
|
|
763
|
+
const vn = re.Root, Cn = re.ValueText, Re = () => {
|
|
764
|
+
const t = X(), n = t?.numberOfTotalPages === 1, o = (t?.beginNumberOfPagesInSpineItem ?? 0) > 1, r = (t?.endNumberOfPagesInSpineItem ?? 0) > 1, i = (t?.hasChapters ? t?.beginPageIndexInSpineItem : t?.beginAbsolutePageIndex) ?? 0, a = (t?.hasChapters ? t?.endPageIndexInSpineItem : t?.endAbsolutePageIndex) ?? 0, [l = 0, c = 0] = [
|
|
765
765
|
i,
|
|
766
766
|
a
|
|
767
|
-
].sort((g, h) => g - h), d =
|
|
767
|
+
].sort((g, h) => g - h), d = t?.beginPageIndexInSpineItem !== t?.endPageIndexInSpineItem || t?.beginSpineItemIndex !== t?.endSpineItemIndex, u = t?.hasChapters ? t?.beginNumberOfPagesInSpineItem : t?.numberOfTotalPages;
|
|
768
768
|
return {
|
|
769
|
-
hasOnlyOnePage:
|
|
769
|
+
hasOnlyOnePage: n,
|
|
770
770
|
beginPageIndex: i,
|
|
771
771
|
endPageIndex: a,
|
|
772
772
|
isBeginWithinChapter: o,
|
|
@@ -776,27 +776,27 @@ const vt = re.Root, Ct = re.ValueText, Re = () => {
|
|
|
776
776
|
leftPageIndex: l,
|
|
777
777
|
rightPageIndex: c
|
|
778
778
|
};
|
|
779
|
-
},
|
|
780
|
-
const
|
|
781
|
-
hasOnlyOnePage:
|
|
779
|
+
}, kn = () => {
|
|
780
|
+
const t = X(), {
|
|
781
|
+
hasOnlyOnePage: n,
|
|
782
782
|
leftPageIndex: o,
|
|
783
783
|
rightPageIndex: r,
|
|
784
784
|
totalApproximatePages: i,
|
|
785
785
|
beginAndEndAreDifferent: a
|
|
786
|
-
} = Re(), l = Math.round((
|
|
786
|
+
} = Re(), l = Math.round((t?.percentageEstimateOfBook ?? 0) * 100), c = (u) => u?.subChapter ? `${u.title} / ${c(u.subChapter)}` : u?.title || "", d = c(t?.beginChapterInfo);
|
|
787
787
|
return /* @__PURE__ */ s(C, { alignItems: "center", gap: 1, maxW: "100%", overflow: "auto", children: [
|
|
788
|
-
/* @__PURE__ */ e(
|
|
789
|
-
/* @__PURE__ */ e(
|
|
790
|
-
/* @__PURE__ */ e(
|
|
788
|
+
/* @__PURE__ */ e(vn, { value: l, size: "xs", width: 150, children: /* @__PURE__ */ s(O, { justifyContent: "space-between", children: [
|
|
789
|
+
/* @__PURE__ */ e(xn, { width: 110 }),
|
|
790
|
+
/* @__PURE__ */ e(Cn, { children: `${l}%` })
|
|
791
791
|
] }) }),
|
|
792
792
|
/* @__PURE__ */ e(p, { truncate: !0, maxWidth: "100%", fontSize: "sm", mt: 1, children: d ? `Chapter: ${d}` : " " }),
|
|
793
|
-
!
|
|
793
|
+
!n && /* @__PURE__ */ s(O, { children: [
|
|
794
794
|
/* @__PURE__ */ e(p, { fontSize: "xs", children: a ? `${o + 1} - ${r + 1} of ${i}` : `${o + 1} of ${i}` }),
|
|
795
|
-
!!
|
|
795
|
+
!!t?.hasChapters && /* @__PURE__ */ s(be, { children: [
|
|
796
796
|
/* @__PURE__ */ e(p, { children: "-" }),
|
|
797
797
|
/* @__PURE__ */ s(p, { fontSize: "xs", children: [
|
|
798
798
|
"(",
|
|
799
|
-
(
|
|
799
|
+
(t?.beginAbsolutePageIndex ?? 0) + 1,
|
|
800
800
|
")"
|
|
801
801
|
] })
|
|
802
802
|
] })
|
|
@@ -804,8 +804,8 @@ const vt = re.Root, Ct = re.ValueText, Re = () => {
|
|
|
804
804
|
] });
|
|
805
805
|
}, We = f(
|
|
806
806
|
({
|
|
807
|
-
children:
|
|
808
|
-
position:
|
|
807
|
+
children: t,
|
|
808
|
+
position: n,
|
|
809
809
|
...o
|
|
810
810
|
}) => /* @__PURE__ */ e(
|
|
811
811
|
oe,
|
|
@@ -814,8 +814,8 @@ const vt = re.Root, Ct = re.ValueText, Re = () => {
|
|
|
814
814
|
flexDirection: "row",
|
|
815
815
|
width: "100%",
|
|
816
816
|
position: "absolute",
|
|
817
|
-
...
|
|
818
|
-
animationName:
|
|
817
|
+
...n === "bottom" ? { bottom: 0 } : { top: 0 },
|
|
818
|
+
animationName: n === "bottom" ? {
|
|
819
819
|
_open: "slide-from-bottom, fade-in",
|
|
820
820
|
_closed: "slide-to-bottom, fade-out"
|
|
821
821
|
} : {
|
|
@@ -829,10 +829,10 @@ const vt = re.Root, Ct = re.ValueText, Re = () => {
|
|
|
829
829
|
shadow: "md",
|
|
830
830
|
p: 4,
|
|
831
831
|
...o,
|
|
832
|
-
children:
|
|
832
|
+
children: t
|
|
833
833
|
}
|
|
834
834
|
)
|
|
835
|
-
),
|
|
835
|
+
), Sn = it(Et), In = f((t) => /* @__PURE__ */ e(
|
|
836
836
|
B,
|
|
837
837
|
{
|
|
838
838
|
display: "contents",
|
|
@@ -842,7 +842,7 @@ const vt = re.Root, Ct = re.ValueText, Re = () => {
|
|
|
842
842
|
"--color-solid": "colors.colorPalette.solid"
|
|
843
843
|
},
|
|
844
844
|
children: /* @__PURE__ */ e(
|
|
845
|
-
|
|
845
|
+
Sn,
|
|
846
846
|
{
|
|
847
847
|
keyboard: !1,
|
|
848
848
|
style: {
|
|
@@ -877,23 +877,23 @@ const vt = re.Root, Ct = re.ValueText, Re = () => {
|
|
|
877
877
|
height: "24px",
|
|
878
878
|
top: "50%",
|
|
879
879
|
borderColor: "var(--color-solid)",
|
|
880
|
-
transform: `translate(${
|
|
880
|
+
transform: `translate(${t.reverse ? "50%" : "-50%"}, -50%)`,
|
|
881
881
|
backgroundColor: "var(--bg)",
|
|
882
882
|
marginTop: "0px"
|
|
883
883
|
}
|
|
884
884
|
},
|
|
885
|
-
...
|
|
885
|
+
...t
|
|
886
886
|
}
|
|
887
887
|
)
|
|
888
888
|
}
|
|
889
|
-
)),
|
|
890
|
-
const
|
|
889
|
+
)), Rn = () => {
|
|
890
|
+
const n = X()?.isUsingSpread, { beginPageIndex: o, totalApproximatePages: r = 0 } = Re(), i = n ? Math.floor((o || 0) / 2) : o, [a, l] = Ue(
|
|
891
891
|
() => L({
|
|
892
892
|
default: i || 0
|
|
893
893
|
})
|
|
894
894
|
), c = 0, d = Math.max(
|
|
895
895
|
0,
|
|
896
|
-
|
|
896
|
+
n ? Math.floor((r - 1) / 2) : r - 1
|
|
897
897
|
);
|
|
898
898
|
return H(() => {
|
|
899
899
|
l.update(i || 0);
|
|
@@ -903,31 +903,31 @@ const vt = re.Root, Ct = re.ValueText, Re = () => {
|
|
|
903
903
|
min: c,
|
|
904
904
|
max: d
|
|
905
905
|
};
|
|
906
|
-
},
|
|
907
|
-
const
|
|
906
|
+
}, yn = (t) => {
|
|
907
|
+
const n = m(), o = X(), { manifest: r } = b(() => n?.context, [n]) ?? {}, i = r?.readingDirection === "rtl", a = o?.isUsingSpread, { totalApproximatePages: l = 0, isBeginWithinChapter: c } = Re(), d = 1, u = c, { value: g, valueSignal: h, min: x, max: S } = Rn(), I = ne(
|
|
908
908
|
(M) => {
|
|
909
909
|
const [A = 0] = Array.isArray(M) ? M : [M];
|
|
910
910
|
h.update(A);
|
|
911
911
|
const ae = a ? Math.floor(A) * 2 : Math.floor(A);
|
|
912
|
-
u ?
|
|
912
|
+
u ? n?.navigation.goToPageOfSpineItem({
|
|
913
913
|
pageIndex: ae,
|
|
914
|
-
spineItemId:
|
|
914
|
+
spineItemId: n.pagination.state.beginSpineItemIndex ?? 0,
|
|
915
915
|
animation: !1
|
|
916
|
-
}) :
|
|
916
|
+
}) : n?.navigation.goToAbsolutePageIndex({
|
|
917
917
|
absolutePageIndex: ae,
|
|
918
918
|
animation: !1
|
|
919
919
|
});
|
|
920
920
|
},
|
|
921
|
-
[
|
|
921
|
+
[n, a, h, u]
|
|
922
922
|
);
|
|
923
923
|
return N(
|
|
924
|
-
() =>
|
|
924
|
+
() => n?.navigation.throttleLock({
|
|
925
925
|
duration: 100,
|
|
926
926
|
trigger: h.subject
|
|
927
927
|
}),
|
|
928
|
-
[
|
|
929
|
-
), l === 1 || a && l === 2 ? /* @__PURE__ */ e(B, { style:
|
|
930
|
-
|
|
928
|
+
[n, h]
|
|
929
|
+
), l === 1 || a && l === 2 ? /* @__PURE__ */ e(B, { style: t.style }) : /* @__PURE__ */ e(
|
|
930
|
+
In,
|
|
931
931
|
{
|
|
932
932
|
value: [g],
|
|
933
933
|
max: S,
|
|
@@ -935,13 +935,13 @@ const vt = re.Root, Ct = re.ValueText, Re = () => {
|
|
|
935
935
|
reverse: i,
|
|
936
936
|
step: d,
|
|
937
937
|
onChange: I,
|
|
938
|
-
...
|
|
938
|
+
...t
|
|
939
939
|
}
|
|
940
940
|
);
|
|
941
|
-
},
|
|
941
|
+
}, Tn = f(
|
|
942
942
|
({
|
|
943
|
-
open:
|
|
944
|
-
onItemClick:
|
|
943
|
+
open: t,
|
|
944
|
+
onItemClick: n
|
|
945
945
|
}) => {
|
|
946
946
|
const o = qe(null), r = m(), { refitMenuSignal: i, quickMenuBottomBarBoundingBox: a } = E(), l = b(() => r?.navigation.state$, [r]), c = b(() => r?.settings.values$, [r]), d = b(() => r?.zoom.state$, [r]), u = (d?.currentScale ?? 1) > 1, g = (d?.currentScale ?? 1) < 1, h = c?.computedPageTurnMode === "scrollable", x = c?.computedPageTurnDirection === "vertical", [S, I] = y(!0);
|
|
947
947
|
return H(() => {
|
|
@@ -956,7 +956,7 @@ const vt = re.Root, Ct = re.ValueText, Re = () => {
|
|
|
956
956
|
}, [a]), /* @__PURE__ */ s(
|
|
957
957
|
We,
|
|
958
958
|
{
|
|
959
|
-
present:
|
|
959
|
+
present: t,
|
|
960
960
|
position: "bottom",
|
|
961
961
|
display: "flex",
|
|
962
962
|
flexDirection: "column",
|
|
@@ -983,7 +983,7 @@ const vt = re.Root, Ct = re.ValueText, Re = () => {
|
|
|
983
983
|
flexShrink: 0,
|
|
984
984
|
onClick: () => r?.navigation.goToLeftOrTopSpineItem(),
|
|
985
985
|
disabled: !l?.canGoLeftSpineItem && !l?.canGoTopSpineItem,
|
|
986
|
-
children: x ? /* @__PURE__ */ e(
|
|
986
|
+
children: x ? /* @__PURE__ */ e(Bt, {}) : /* @__PURE__ */ e(At, {})
|
|
987
987
|
}
|
|
988
988
|
),
|
|
989
989
|
/* @__PURE__ */ s(
|
|
@@ -996,9 +996,9 @@ const vt = re.Root, Ct = re.ValueText, Re = () => {
|
|
|
996
996
|
overflow: "auto",
|
|
997
997
|
px: 4,
|
|
998
998
|
children: [
|
|
999
|
-
/* @__PURE__ */ e(
|
|
999
|
+
/* @__PURE__ */ e(kn, {}),
|
|
1000
1000
|
/* @__PURE__ */ e(
|
|
1001
|
-
|
|
1001
|
+
yn,
|
|
1002
1002
|
{
|
|
1003
1003
|
style: {
|
|
1004
1004
|
width: "100%",
|
|
@@ -1021,7 +1021,7 @@ const vt = re.Root, Ct = re.ValueText, Re = () => {
|
|
|
1021
1021
|
onClick: () => {
|
|
1022
1022
|
r?.navigation.goToRightOrBottomSpineItem();
|
|
1023
1023
|
},
|
|
1024
|
-
children: x ? /* @__PURE__ */ e(
|
|
1024
|
+
children: x ? /* @__PURE__ */ e(zt, {}) : /* @__PURE__ */ e(Ot, {})
|
|
1025
1025
|
}
|
|
1026
1026
|
)
|
|
1027
1027
|
]
|
|
@@ -1045,7 +1045,7 @@ const vt = re.Root, Ct = re.ValueText, Re = () => {
|
|
|
1045
1045
|
display: "flex",
|
|
1046
1046
|
justifyContent: "center",
|
|
1047
1047
|
children: /* @__PURE__ */ e(
|
|
1048
|
-
|
|
1048
|
+
ht,
|
|
1049
1049
|
{
|
|
1050
1050
|
style: {
|
|
1051
1051
|
transform: S ? "rotate(0deg)" : "rotate(180deg)"
|
|
@@ -1061,8 +1061,8 @@ const vt = re.Root, Ct = re.ValueText, Re = () => {
|
|
|
1061
1061
|
"aria-label": "Help",
|
|
1062
1062
|
size: "lg",
|
|
1063
1063
|
variant: "ghost",
|
|
1064
|
-
onClick: () =>
|
|
1065
|
-
children: /* @__PURE__ */ e(
|
|
1064
|
+
onClick: () => n("help"),
|
|
1065
|
+
children: /* @__PURE__ */ e(gt, {})
|
|
1066
1066
|
}
|
|
1067
1067
|
),
|
|
1068
1068
|
/* @__PURE__ */ e(
|
|
@@ -1071,8 +1071,8 @@ const vt = re.Root, Ct = re.ValueText, Re = () => {
|
|
|
1071
1071
|
"aria-label": "Table of contents",
|
|
1072
1072
|
size: "lg",
|
|
1073
1073
|
variant: "ghost",
|
|
1074
|
-
onClick: () =>
|
|
1075
|
-
children: /* @__PURE__ */ e(
|
|
1074
|
+
onClick: () => n("toc"),
|
|
1075
|
+
children: /* @__PURE__ */ e(pt, {})
|
|
1076
1076
|
}
|
|
1077
1077
|
),
|
|
1078
1078
|
Le(r) && /* @__PURE__ */ e(
|
|
@@ -1081,8 +1081,8 @@ const vt = re.Root, Ct = re.ValueText, Re = () => {
|
|
|
1081
1081
|
"aria-label": "Search",
|
|
1082
1082
|
size: "lg",
|
|
1083
1083
|
variant: "ghost",
|
|
1084
|
-
onClick: () =>
|
|
1085
|
-
children: /* @__PURE__ */ e(
|
|
1084
|
+
onClick: () => n("search"),
|
|
1085
|
+
children: /* @__PURE__ */ e(ft, {})
|
|
1086
1086
|
}
|
|
1087
1087
|
),
|
|
1088
1088
|
/* @__PURE__ */ e(
|
|
@@ -1091,14 +1091,13 @@ const vt = re.Root, Ct = re.ValueText, Re = () => {
|
|
|
1091
1091
|
"aria-label": "Zoom",
|
|
1092
1092
|
size: "lg",
|
|
1093
1093
|
variant: u ? "solid" : "ghost",
|
|
1094
|
-
disabled: !h,
|
|
1095
1094
|
onClick: () => {
|
|
1096
|
-
u ? r?.zoom.exit() : r?.zoom.enter({
|
|
1097
|
-
animate: !
|
|
1095
|
+
u ? r?.zoom.exit({ animate: !0 }) : r?.zoom.enter({
|
|
1096
|
+
animate: !0,
|
|
1098
1097
|
scale: 2
|
|
1099
1098
|
});
|
|
1100
1099
|
},
|
|
1101
|
-
children: u ? /* @__PURE__ */ e(
|
|
1100
|
+
children: u ? /* @__PURE__ */ e(mt, {}) : /* @__PURE__ */ e(bt, {})
|
|
1102
1101
|
}
|
|
1103
1102
|
),
|
|
1104
1103
|
ie(r) && /* @__PURE__ */ e(
|
|
@@ -1107,8 +1106,8 @@ const vt = re.Root, Ct = re.ValueText, Re = () => {
|
|
|
1107
1106
|
"aria-label": "Bookmarks",
|
|
1108
1107
|
size: "lg",
|
|
1109
1108
|
variant: "ghost",
|
|
1110
|
-
onClick: () =>
|
|
1111
|
-
children: /* @__PURE__ */ e(
|
|
1109
|
+
onClick: () => n("bookmarks"),
|
|
1110
|
+
children: /* @__PURE__ */ e(Rt, {})
|
|
1112
1111
|
}
|
|
1113
1112
|
),
|
|
1114
1113
|
ie(r) && /* @__PURE__ */ e(
|
|
@@ -1117,7 +1116,7 @@ const vt = re.Root, Ct = re.ValueText, Re = () => {
|
|
|
1117
1116
|
"aria-label": "Annotations",
|
|
1118
1117
|
size: "lg",
|
|
1119
1118
|
variant: "ghost",
|
|
1120
|
-
onClick: () =>
|
|
1119
|
+
onClick: () => n("annotations"),
|
|
1121
1120
|
children: /* @__PURE__ */ e(de, {})
|
|
1122
1121
|
}
|
|
1123
1122
|
),
|
|
@@ -1131,7 +1130,7 @@ const vt = re.Root, Ct = re.ValueText, Re = () => {
|
|
|
1131
1130
|
i.next(!0);
|
|
1132
1131
|
},
|
|
1133
1132
|
disabled: !h,
|
|
1134
|
-
children: /* @__PURE__ */ e(
|
|
1133
|
+
children: /* @__PURE__ */ e(yt, {})
|
|
1135
1134
|
}
|
|
1136
1135
|
),
|
|
1137
1136
|
/* @__PURE__ */ e(
|
|
@@ -1141,12 +1140,12 @@ const vt = re.Root, Ct = re.ValueText, Re = () => {
|
|
|
1141
1140
|
size: "lg",
|
|
1142
1141
|
variant: g ? "solid" : "ghost",
|
|
1143
1142
|
onClick: () => {
|
|
1144
|
-
g ? r?.zoom.exit() : r?.zoom.enter({
|
|
1143
|
+
g ? r?.zoom.exit({ animate: !0 }) : r?.zoom.enter({
|
|
1145
1144
|
animate: !0,
|
|
1146
1145
|
scale: 0.5
|
|
1147
1146
|
});
|
|
1148
1147
|
},
|
|
1149
|
-
children: /* @__PURE__ */ e(
|
|
1148
|
+
children: /* @__PURE__ */ e(xt, {})
|
|
1150
1149
|
}
|
|
1151
1150
|
),
|
|
1152
1151
|
_e(r) && /* @__PURE__ */ e(
|
|
@@ -1155,8 +1154,8 @@ const vt = re.Root, Ct = re.ValueText, Re = () => {
|
|
|
1155
1154
|
"aria-label": "Gallery",
|
|
1156
1155
|
size: "lg",
|
|
1157
1156
|
variant: "ghost",
|
|
1158
|
-
onClick: () =>
|
|
1159
|
-
children: /* @__PURE__ */ e(
|
|
1157
|
+
onClick: () => n("gallery"),
|
|
1158
|
+
children: /* @__PURE__ */ e(Pt, {})
|
|
1160
1159
|
}
|
|
1161
1160
|
)
|
|
1162
1161
|
] }) })
|
|
@@ -1167,33 +1166,33 @@ const vt = re.Root, Ct = re.ValueText, Re = () => {
|
|
|
1167
1166
|
}
|
|
1168
1167
|
);
|
|
1169
1168
|
}
|
|
1170
|
-
),
|
|
1171
|
-
const [
|
|
1172
|
-
|
|
1169
|
+
), wn = () => {
|
|
1170
|
+
const [t, n] = y(!1), o = ne(() => document.fullscreenElement ? document.exitFullscreen().catch(console.error).then(() => {
|
|
1171
|
+
n(!1);
|
|
1173
1172
|
}) : document.documentElement.requestFullscreen({ navigationUI: "hide" }).catch(console.error).then(() => {
|
|
1174
|
-
|
|
1173
|
+
n(!0);
|
|
1175
1174
|
}), []);
|
|
1176
1175
|
return H(() => {
|
|
1177
1176
|
function r() {
|
|
1178
|
-
|
|
1177
|
+
n(!!document.fullscreenElement);
|
|
1179
1178
|
}
|
|
1180
1179
|
return document.addEventListener("fullscreenchange", r), () => {
|
|
1181
1180
|
document.removeEventListener("fullscreenchange", r);
|
|
1182
1181
|
};
|
|
1183
1182
|
}, []), {
|
|
1184
|
-
isFullscreen:
|
|
1183
|
+
isFullscreen: t,
|
|
1185
1184
|
onToggleFullscreenClick: o
|
|
1186
1185
|
};
|
|
1187
|
-
},
|
|
1186
|
+
}, Pn = f(
|
|
1188
1187
|
({
|
|
1189
|
-
open:
|
|
1190
|
-
onItemClick:
|
|
1188
|
+
open: t,
|
|
1189
|
+
onItemClick: n
|
|
1191
1190
|
}) => {
|
|
1192
|
-
const o = m(), r = b(() => o?.context.manifest$, [o]), { isFullscreen: i, onToggleFullscreenClick: a } =
|
|
1191
|
+
const o = m(), r = b(() => o?.context.manifest$, [o]), { isFullscreen: i, onToggleFullscreenClick: a } = wn();
|
|
1193
1192
|
return /* @__PURE__ */ s(
|
|
1194
1193
|
We,
|
|
1195
1194
|
{
|
|
1196
|
-
present:
|
|
1195
|
+
present: t,
|
|
1197
1196
|
position: "top",
|
|
1198
1197
|
height: "80px",
|
|
1199
1198
|
justifyContent: "space-between",
|
|
@@ -1205,8 +1204,8 @@ const vt = re.Root, Ct = re.ValueText, Re = () => {
|
|
|
1205
1204
|
size: "lg",
|
|
1206
1205
|
variant: "ghost",
|
|
1207
1206
|
flexShrink: 0,
|
|
1208
|
-
onClick: () =>
|
|
1209
|
-
children: /* @__PURE__ */ e(
|
|
1207
|
+
onClick: () => n("back"),
|
|
1208
|
+
children: /* @__PURE__ */ e(Dt, {})
|
|
1210
1209
|
}
|
|
1211
1210
|
),
|
|
1212
1211
|
/* @__PURE__ */ e(
|
|
@@ -1229,8 +1228,8 @@ const vt = re.Root, Ct = re.ValueText, Re = () => {
|
|
|
1229
1228
|
size: "lg",
|
|
1230
1229
|
flexShrink: 0,
|
|
1231
1230
|
variant: "ghost",
|
|
1232
|
-
onClick: () =>
|
|
1233
|
-
children: /* @__PURE__ */ e(
|
|
1231
|
+
onClick: () => n("more"),
|
|
1232
|
+
children: /* @__PURE__ */ e(Lt, {})
|
|
1234
1233
|
}
|
|
1235
1234
|
),
|
|
1236
1235
|
/* @__PURE__ */ e(
|
|
@@ -1241,7 +1240,7 @@ const vt = re.Root, Ct = re.ValueText, Re = () => {
|
|
|
1241
1240
|
flexShrink: 0,
|
|
1242
1241
|
variant: "ghost",
|
|
1243
1242
|
onClick: a,
|
|
1244
|
-
children: i ? /* @__PURE__ */ e(
|
|
1243
|
+
children: i ? /* @__PURE__ */ e(Tt, {}) : /* @__PURE__ */ e(wt, {})
|
|
1245
1244
|
}
|
|
1246
1245
|
)
|
|
1247
1246
|
] })
|
|
@@ -1249,25 +1248,25 @@ const vt = re.Root, Ct = re.ValueText, Re = () => {
|
|
|
1249
1248
|
}
|
|
1250
1249
|
);
|
|
1251
1250
|
}
|
|
1252
|
-
),
|
|
1251
|
+
), Bn = f(
|
|
1253
1252
|
({
|
|
1254
|
-
onItemClick:
|
|
1253
|
+
onItemClick: t
|
|
1255
1254
|
}) => {
|
|
1256
|
-
const [
|
|
1255
|
+
const [n] = Ie(), { refitMenuSignal: o } = E(), r = ue(o);
|
|
1257
1256
|
return /* @__PURE__ */ s(be, { children: [
|
|
1258
|
-
/* @__PURE__ */ e(
|
|
1257
|
+
/* @__PURE__ */ e(Pn, { open: n && !r, onItemClick: t }),
|
|
1259
1258
|
/* @__PURE__ */ e(
|
|
1260
|
-
|
|
1259
|
+
Tn,
|
|
1261
1260
|
{
|
|
1262
|
-
open:
|
|
1263
|
-
onItemClick:
|
|
1261
|
+
open: n && !r,
|
|
1262
|
+
onItemClick: t
|
|
1264
1263
|
}
|
|
1265
1264
|
)
|
|
1266
1265
|
] });
|
|
1267
1266
|
}
|
|
1268
|
-
),
|
|
1269
|
-
function(
|
|
1270
|
-
const { label: r, children: i, helperText: a, errorText: l, optionalText: c, ...d } =
|
|
1267
|
+
), An = T.forwardRef(
|
|
1268
|
+
function(n, o) {
|
|
1269
|
+
const { label: r, children: i, helperText: a, errorText: l, optionalText: c, ...d } = n;
|
|
1271
1270
|
return /* @__PURE__ */ s(J.Root, { ref: o, ...d, children: [
|
|
1272
1271
|
r && /* @__PURE__ */ s(J.Label, { children: [
|
|
1273
1272
|
r,
|
|
@@ -1279,17 +1278,17 @@ const vt = re.Root, Ct = re.ValueText, Re = () => {
|
|
|
1279
1278
|
] });
|
|
1280
1279
|
}
|
|
1281
1280
|
), se = T.forwardRef(
|
|
1282
|
-
function(
|
|
1283
|
-
const { children: r, inputProps: i, rootRef: a, ...l } =
|
|
1284
|
-
return /* @__PURE__ */ s(
|
|
1285
|
-
/* @__PURE__ */ e(
|
|
1286
|
-
/* @__PURE__ */ e(
|
|
1287
|
-
r && /* @__PURE__ */ e(
|
|
1281
|
+
function(n, o) {
|
|
1282
|
+
const { children: r, inputProps: i, rootRef: a, ...l } = n;
|
|
1283
|
+
return /* @__PURE__ */ s(te.Item, { ref: a, ...l, children: [
|
|
1284
|
+
/* @__PURE__ */ e(te.ItemHiddenInput, { ref: o, ...i }),
|
|
1285
|
+
/* @__PURE__ */ e(te.ItemIndicator, {}),
|
|
1286
|
+
r && /* @__PURE__ */ e(te.ItemText, { children: r })
|
|
1288
1287
|
] });
|
|
1289
1288
|
}
|
|
1290
|
-
),
|
|
1291
|
-
function(
|
|
1292
|
-
const { marks: r, label: i, showValue: a, ...l } =
|
|
1289
|
+
), zn = te.Root, He = T.forwardRef(
|
|
1290
|
+
function(n, o) {
|
|
1291
|
+
const { marks: r, label: i, showValue: a, ...l } = n, c = n.defaultValue ?? n.value, d = r?.map((g) => typeof g == "number" ? { value: g, label: void 0 } : g), u = !!d?.some((g) => g.label);
|
|
1293
1292
|
return /* @__PURE__ */ s(R.Root, { ref: o, thumbAlignment: "center", ...l, children: [
|
|
1294
1293
|
i && !a && /* @__PURE__ */ e(R.Label, { children: i }),
|
|
1295
1294
|
i && a && /* @__PURE__ */ s(O, { justify: "space-between", children: [
|
|
@@ -1298,19 +1297,19 @@ const vt = re.Root, Ct = re.ValueText, Re = () => {
|
|
|
1298
1297
|
] }),
|
|
1299
1298
|
/* @__PURE__ */ s(R.Control, { "data-has-mark-label": u || void 0, children: [
|
|
1300
1299
|
/* @__PURE__ */ e(R.Track, { children: /* @__PURE__ */ e(R.Range, {}) }),
|
|
1301
|
-
/* @__PURE__ */ e(
|
|
1302
|
-
/* @__PURE__ */ e(
|
|
1300
|
+
/* @__PURE__ */ e(On, { value: c }),
|
|
1301
|
+
/* @__PURE__ */ e(Mn, { marks: d })
|
|
1303
1302
|
] })
|
|
1304
1303
|
] });
|
|
1305
1304
|
}
|
|
1306
1305
|
);
|
|
1307
|
-
function
|
|
1308
|
-
const { value:
|
|
1309
|
-
return /* @__PURE__ */ e(
|
|
1306
|
+
function On(t) {
|
|
1307
|
+
const { value: n } = t;
|
|
1308
|
+
return /* @__PURE__ */ e(at, { each: n, children: (o, r) => /* @__PURE__ */ e(R.Thumb, { index: r, children: /* @__PURE__ */ e(R.HiddenInput, {}) }, r) });
|
|
1310
1309
|
}
|
|
1311
|
-
const
|
|
1312
|
-
function(
|
|
1313
|
-
const { marks: r } =
|
|
1310
|
+
const Mn = T.forwardRef(
|
|
1311
|
+
function(n, o) {
|
|
1312
|
+
const { marks: r } = n;
|
|
1314
1313
|
return r?.length ? /* @__PURE__ */ e(R.MarkerGroup, { ref: o, children: r.map((i, a) => {
|
|
1315
1314
|
const l = typeof i == "number" ? i : i.value, c = typeof i == "number" ? void 0 : i.label;
|
|
1316
1315
|
return /* @__PURE__ */ s(R.Marker, { value: l, children: [
|
|
@@ -1319,8 +1318,8 @@ const Mt = T.forwardRef(
|
|
|
1319
1318
|
] }, a);
|
|
1320
1319
|
}) }) : null;
|
|
1321
1320
|
}
|
|
1322
|
-
),
|
|
1323
|
-
const { refitMenuSignal:
|
|
1321
|
+
), En = f(() => {
|
|
1322
|
+
const { refitMenuSignal: n } = E(), o = ue(n), r = m(), i = $e(r) ? r : void 0, a = b(
|
|
1324
1323
|
() => i?.refit.settings$,
|
|
1325
1324
|
[i]
|
|
1326
1325
|
);
|
|
@@ -1329,15 +1328,15 @@ const Mt = T.forwardRef(
|
|
|
1329
1328
|
{
|
|
1330
1329
|
lazyMount: !0,
|
|
1331
1330
|
open: o,
|
|
1332
|
-
onOpenChange: (l) =>
|
|
1331
|
+
onOpenChange: (l) => n.next(l.open),
|
|
1333
1332
|
placement: "center",
|
|
1334
1333
|
children: /* @__PURE__ */ s(G, { children: [
|
|
1335
1334
|
/* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(Q, { children: "Viewport fit" }) }),
|
|
1336
1335
|
/* @__PURE__ */ e(Z, { children: /* @__PURE__ */ s(fe.Root, { children: [
|
|
1337
1336
|
/* @__PURE__ */ e(fe.HelperText, { children: "Adjust the viewport for a more comfortable reading experience." }),
|
|
1338
1337
|
/* @__PURE__ */ s(fe.Content, { children: [
|
|
1339
|
-
/* @__PURE__ */ e(
|
|
1340
|
-
|
|
1338
|
+
/* @__PURE__ */ e(An, { label: "Profile", children: /* @__PURE__ */ e(
|
|
1339
|
+
zn,
|
|
1341
1340
|
{
|
|
1342
1341
|
defaultValue: "fit",
|
|
1343
1342
|
onValueChange: (l) => {
|
|
@@ -1381,23 +1380,23 @@ const Mt = T.forwardRef(
|
|
|
1381
1380
|
] })
|
|
1382
1381
|
}
|
|
1383
1382
|
);
|
|
1384
|
-
}),
|
|
1383
|
+
}), Dn = f(
|
|
1385
1384
|
({
|
|
1386
|
-
contextText:
|
|
1387
|
-
startOffset:
|
|
1385
|
+
contextText: t = "",
|
|
1386
|
+
startOffset: n = 0,
|
|
1388
1387
|
text: o,
|
|
1389
1388
|
cfi: r = "#",
|
|
1390
1389
|
onClick: i,
|
|
1391
1390
|
absolutePageIndex: a
|
|
1392
1391
|
}) => {
|
|
1393
|
-
const c =
|
|
1394
|
-
Math.max(
|
|
1395
|
-
Math.max(
|
|
1396
|
-
), d =
|
|
1397
|
-
Math.min(
|
|
1392
|
+
const c = t.substring(
|
|
1393
|
+
Math.max(n - 15, 0),
|
|
1394
|
+
Math.max(n, 0)
|
|
1395
|
+
), d = t.substring(
|
|
1396
|
+
Math.min(n + o.length, t.length - 1),
|
|
1398
1397
|
Math.min(
|
|
1399
|
-
|
|
1400
|
-
|
|
1398
|
+
n + o.length + 15,
|
|
1399
|
+
t.length - 1
|
|
1401
1400
|
)
|
|
1402
1401
|
);
|
|
1403
1402
|
return /* @__PURE__ */ s(
|
|
@@ -1425,8 +1424,8 @@ const Mt = T.forwardRef(
|
|
|
1425
1424
|
}
|
|
1426
1425
|
);
|
|
1427
1426
|
}
|
|
1428
|
-
),
|
|
1429
|
-
const
|
|
1427
|
+
), Ln = 500, _n = () => {
|
|
1428
|
+
const t = ee(() => new tt("")), n = b(t), o = m(), r = Le(o) ? o : void 0, i = b(() => t.pipe(
|
|
1430
1429
|
Ce(),
|
|
1431
1430
|
W(
|
|
1432
1431
|
(a) => a === "" || !r ? ce(void 0) : Me(
|
|
@@ -1434,35 +1433,35 @@ const Mt = T.forwardRef(
|
|
|
1434
1433
|
type: "start",
|
|
1435
1434
|
data: void 0
|
|
1436
1435
|
}),
|
|
1437
|
-
Ee(
|
|
1436
|
+
Ee(Ln).pipe(
|
|
1438
1437
|
W(() => r.search.search(a)),
|
|
1439
1438
|
_((l) => ({ type: "end", data: l }))
|
|
1440
1439
|
)
|
|
1441
1440
|
)
|
|
1442
1441
|
)
|
|
1443
|
-
), [r,
|
|
1442
|
+
), [r, t]);
|
|
1444
1443
|
return {
|
|
1445
|
-
value:
|
|
1446
|
-
setValue:
|
|
1444
|
+
value: n,
|
|
1445
|
+
setValue: t.next.bind(t),
|
|
1447
1446
|
status: i?.type ?? "idle",
|
|
1448
1447
|
data: i?.data
|
|
1449
1448
|
};
|
|
1450
|
-
}, $
|
|
1451
|
-
({ onNavigate:
|
|
1452
|
-
const
|
|
1449
|
+
}, $n = f(
|
|
1450
|
+
({ onNavigate: t }) => {
|
|
1451
|
+
const n = m(), { value: o, setValue: r, status: i, data: a } = _n(), l = (u) => {
|
|
1453
1452
|
r(u.target.value);
|
|
1454
|
-
}, c =
|
|
1453
|
+
}, c = ne(
|
|
1455
1454
|
(u) => {
|
|
1456
|
-
|
|
1455
|
+
t(), n?.navigation.goToCfi(u);
|
|
1457
1456
|
},
|
|
1458
|
-
[
|
|
1457
|
+
[n, t]
|
|
1459
1458
|
), d = b(
|
|
1460
|
-
() =>
|
|
1459
|
+
() => n?.locateResource(a?.slice(0, 100) ?? []),
|
|
1461
1460
|
[a]
|
|
1462
1461
|
);
|
|
1463
1462
|
return /* @__PURE__ */ s(C, { flex: 1, height: "100%", gap: 2, children: [
|
|
1464
1463
|
/* @__PURE__ */ e(
|
|
1465
|
-
|
|
1464
|
+
st,
|
|
1466
1465
|
{
|
|
1467
1466
|
placeholder: "Type something...",
|
|
1468
1467
|
value: o,
|
|
@@ -1492,7 +1491,7 @@ const Mt = T.forwardRef(
|
|
|
1492
1491
|
" result(s)"
|
|
1493
1492
|
] }),
|
|
1494
1493
|
/* @__PURE__ */ e(C, { gap: 0, children: d?.map((u, g) => /* @__PURE__ */ e(
|
|
1495
|
-
|
|
1494
|
+
Dn,
|
|
1496
1495
|
{
|
|
1497
1496
|
contextText: u.meta?.range?.startContainer.parentElement?.textContent ?? "",
|
|
1498
1497
|
pageIndex: u.meta?.itemPageIndex,
|
|
@@ -1510,31 +1509,31 @@ const Mt = T.forwardRef(
|
|
|
1510
1509
|
)
|
|
1511
1510
|
] });
|
|
1512
1511
|
}
|
|
1513
|
-
),
|
|
1512
|
+
), Fn = f(
|
|
1514
1513
|
({
|
|
1515
|
-
open:
|
|
1516
|
-
setOpen:
|
|
1514
|
+
open: t,
|
|
1515
|
+
setOpen: n,
|
|
1517
1516
|
onNavigate: o
|
|
1518
1517
|
}) => /* @__PURE__ */ e(
|
|
1519
1518
|
q,
|
|
1520
1519
|
{
|
|
1521
1520
|
lazyMount: !0,
|
|
1522
1521
|
placement: "center",
|
|
1523
|
-
open:
|
|
1524
|
-
onOpenChange: (r) =>
|
|
1522
|
+
open: t,
|
|
1523
|
+
onOpenChange: (r) => n(r.open),
|
|
1525
1524
|
size: { mdDown: "full", md: "lg" },
|
|
1526
1525
|
scrollBehavior: "inside",
|
|
1527
1526
|
children: /* @__PURE__ */ s(G, { height: "100%", children: [
|
|
1528
1527
|
/* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(Q, { children: "Search" }) }),
|
|
1529
|
-
/* @__PURE__ */ e(Z, { flex: 1, p: 0, children: /* @__PURE__ */ e($
|
|
1528
|
+
/* @__PURE__ */ e(Z, { flex: 1, p: 0, children: /* @__PURE__ */ e($n, { onNavigate: o }) }),
|
|
1530
1529
|
/* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(K, { asChild: !0, children: /* @__PURE__ */ e(V, { variant: "outline", children: "Cancel" }) }) }),
|
|
1531
1530
|
/* @__PURE__ */ e(j, {})
|
|
1532
1531
|
] })
|
|
1533
1532
|
}
|
|
1534
1533
|
)
|
|
1535
|
-
),
|
|
1536
|
-
({ onNavigate:
|
|
1537
|
-
const
|
|
1534
|
+
), Wn = f(
|
|
1535
|
+
({ onNavigate: t }) => {
|
|
1536
|
+
const n = m(), { manifest: o, assumedRenditionLayout: r } = b(() => n?.context, [n]) ?? {}, { nav: i } = o ?? {}, a = X();
|
|
1538
1537
|
i?.toc;
|
|
1539
1538
|
const { beginSpineItemIndex: l, beginPageIndexInSpineItem: c } = a ?? {}, d = (r === "reflowable" ? c : l) || 0;
|
|
1540
1539
|
let u = a?.beginChapterInfo;
|
|
@@ -1553,7 +1552,7 @@ const Mt = T.forwardRef(
|
|
|
1553
1552
|
Se,
|
|
1554
1553
|
{
|
|
1555
1554
|
onClick: () => {
|
|
1556
|
-
|
|
1555
|
+
t(), n?.navigation.goToUrl(h.href);
|
|
1557
1556
|
},
|
|
1558
1557
|
href: "#",
|
|
1559
1558
|
children: [
|
|
@@ -1582,36 +1581,36 @@ const Mt = T.forwardRef(
|
|
|
1582
1581
|
] }, x);
|
|
1583
1582
|
return /* @__PURE__ */ e(P.Root, { gap: 3, overflowY: "auto", py: 4, flex: 1, children: i?.toc.map((h, x) => g(h, x, 0)) });
|
|
1584
1583
|
}
|
|
1585
|
-
),
|
|
1584
|
+
), Hn = f(
|
|
1586
1585
|
({
|
|
1587
|
-
open:
|
|
1588
|
-
setOpen:
|
|
1586
|
+
open: t,
|
|
1587
|
+
setOpen: n,
|
|
1589
1588
|
onNavigate: o
|
|
1590
1589
|
}) => /* @__PURE__ */ e(
|
|
1591
1590
|
q,
|
|
1592
1591
|
{
|
|
1593
1592
|
lazyMount: !0,
|
|
1594
1593
|
placement: "center",
|
|
1595
|
-
open:
|
|
1596
|
-
onOpenChange: (r) =>
|
|
1594
|
+
open: t,
|
|
1595
|
+
onOpenChange: (r) => n(r.open),
|
|
1597
1596
|
size: { mdDown: "full", md: "lg" },
|
|
1598
1597
|
scrollBehavior: "inside",
|
|
1599
1598
|
children: /* @__PURE__ */ s(G, { children: [
|
|
1600
1599
|
/* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(Q, { children: "Table of Contents" }) }),
|
|
1601
|
-
/* @__PURE__ */ e(Z, { overflowY: "auto", flex: 1, children: /* @__PURE__ */ e(
|
|
1600
|
+
/* @__PURE__ */ e(Z, { overflowY: "auto", flex: 1, children: /* @__PURE__ */ e(Wn, { onNavigate: o }) }),
|
|
1602
1601
|
/* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(K, { asChild: !0, children: /* @__PURE__ */ e(V, { variant: "outline", children: "Cancel" }) }) }),
|
|
1603
1602
|
/* @__PURE__ */ e(j, {})
|
|
1604
1603
|
] })
|
|
1605
1604
|
}
|
|
1606
1605
|
)
|
|
1607
|
-
),
|
|
1608
|
-
const { quickMenuBottomBarBoundingBox:
|
|
1609
|
-
|
|
1610
|
-
), o = m(), r = b(() => o?.zoom.state$, [o]), i = r?.currentScale ?? 1, a = r?.isZooming
|
|
1606
|
+
), Nn = f(() => {
|
|
1607
|
+
const { quickMenuBottomBarBoundingBox: t } = E(), n = ue(
|
|
1608
|
+
t
|
|
1609
|
+
), o = m(), r = b(() => o?.zoom.state$, [o]), i = r?.currentScale ?? 1, a = r?.isZooming, l = n?.borderBoxSize?.[0]?.blockSize ?? 1;
|
|
1611
1610
|
return /* @__PURE__ */ e(
|
|
1612
1611
|
oe,
|
|
1613
1612
|
{
|
|
1614
|
-
present: a,
|
|
1613
|
+
present: a && i > 1,
|
|
1615
1614
|
animationName: { _open: "fade-in", _closed: "fade-out" },
|
|
1616
1615
|
animationDuration: "moderate",
|
|
1617
1616
|
position: "absolute",
|
|
@@ -1638,21 +1637,21 @@ const Mt = T.forwardRef(
|
|
|
1638
1637
|
}
|
|
1639
1638
|
);
|
|
1640
1639
|
}), so = ({
|
|
1641
|
-
enableFloatingTime:
|
|
1642
|
-
enableFloatingProgress:
|
|
1640
|
+
enableFloatingTime: t = !0,
|
|
1641
|
+
enableFloatingProgress: n = !0,
|
|
1643
1642
|
onItemClick: o,
|
|
1644
1643
|
children: r,
|
|
1645
1644
|
...i
|
|
1646
1645
|
}) => {
|
|
1647
|
-
const [a, l] = y(!1), [c, d] = y(!1), [u, g] = y(!1), [h, x] = y(void 0), [S, I] = y(!1), [w, M] = Ie(), A =
|
|
1646
|
+
const [a, l] = y(!1), [c, d] = y(!1), [u, g] = y(!1), [h, x] = y(void 0), [S, I] = y(!1), [w, M] = Ie(), A = ne(() => {
|
|
1648
1647
|
l(!1), d(!1), g(!1), x(void 0), M(!1), I(!1);
|
|
1649
|
-
}, [M]), ae =
|
|
1648
|
+
}, [M]), ae = ne(
|
|
1650
1649
|
(z) => {
|
|
1651
1650
|
z === "annotations" ? x("annotations") : z === "search" ? g(!0) : z === "help" ? d(!0) : z === "toc" ? l(!0) : z === "bookmarks" ? x("bookmarks") : z === "gallery" && I(!0), o?.(z);
|
|
1652
1651
|
},
|
|
1653
1652
|
[o]
|
|
1654
1653
|
);
|
|
1655
|
-
return
|
|
1654
|
+
return gn(), fn(), Xt(), /* @__PURE__ */ s(
|
|
1656
1655
|
B,
|
|
1657
1656
|
{
|
|
1658
1657
|
position: "absolute",
|
|
@@ -1665,23 +1664,23 @@ const Mt = T.forwardRef(
|
|
|
1665
1664
|
...i,
|
|
1666
1665
|
children: [
|
|
1667
1666
|
r,
|
|
1668
|
-
|
|
1667
|
+
n && /* @__PURE__ */ e(
|
|
1669
1668
|
oe,
|
|
1670
1669
|
{
|
|
1671
1670
|
present: !w,
|
|
1672
1671
|
animationName: { _open: "fade-in", _closed: "fade-out" },
|
|
1673
1672
|
animationDuration: "moderate",
|
|
1674
|
-
children: /* @__PURE__ */ e(
|
|
1673
|
+
children: /* @__PURE__ */ e(cn, {})
|
|
1675
1674
|
}
|
|
1676
1675
|
),
|
|
1677
|
-
/* @__PURE__ */ e(
|
|
1678
|
-
/* @__PURE__ */ e(
|
|
1679
|
-
/* @__PURE__ */ e(
|
|
1680
|
-
/* @__PURE__ */ e(
|
|
1681
|
-
/* @__PURE__ */ e(
|
|
1682
|
-
/* @__PURE__ */ e(
|
|
1676
|
+
/* @__PURE__ */ e(rn, { open: S, setOpen: I }),
|
|
1677
|
+
/* @__PURE__ */ e(En, {}),
|
|
1678
|
+
/* @__PURE__ */ e(Bn, { onItemClick: ae }),
|
|
1679
|
+
/* @__PURE__ */ e(Nn, {}),
|
|
1680
|
+
/* @__PURE__ */ e(Qt, {}),
|
|
1681
|
+
/* @__PURE__ */ e(ln, { open: c, setOpen: d }),
|
|
1683
1682
|
/* @__PURE__ */ e(
|
|
1684
|
-
|
|
1683
|
+
Hn,
|
|
1685
1684
|
{
|
|
1686
1685
|
open: a,
|
|
1687
1686
|
setOpen: l,
|
|
@@ -1689,7 +1688,7 @@ const Mt = T.forwardRef(
|
|
|
1689
1688
|
}
|
|
1690
1689
|
),
|
|
1691
1690
|
/* @__PURE__ */ e(
|
|
1692
|
-
|
|
1691
|
+
Fn,
|
|
1693
1692
|
{
|
|
1694
1693
|
open: u,
|
|
1695
1694
|
setOpen: g,
|
|
@@ -1697,7 +1696,7 @@ const Mt = T.forwardRef(
|
|
|
1697
1696
|
}
|
|
1698
1697
|
),
|
|
1699
1698
|
/* @__PURE__ */ e(
|
|
1700
|
-
|
|
1699
|
+
jt,
|
|
1701
1700
|
{
|
|
1702
1701
|
openWith: h,
|
|
1703
1702
|
setOpen: (z) => x(z ? "annotations" : void 0),
|
|
@@ -1707,20 +1706,20 @@ const Mt = T.forwardRef(
|
|
|
1707
1706
|
/* @__PURE__ */ e(
|
|
1708
1707
|
oe,
|
|
1709
1708
|
{
|
|
1710
|
-
present:
|
|
1709
|
+
present: t || w,
|
|
1711
1710
|
animationName: { _open: "fade-in", _closed: "fade-out" },
|
|
1712
1711
|
animationDuration: "slow",
|
|
1713
1712
|
overflow: "hidden",
|
|
1714
|
-
children: /* @__PURE__ */ e(
|
|
1713
|
+
children: /* @__PURE__ */ e(hn, {})
|
|
1715
1714
|
}
|
|
1716
1715
|
),
|
|
1717
|
-
/* @__PURE__ */ e(
|
|
1716
|
+
/* @__PURE__ */ e(Jt, {})
|
|
1718
1717
|
]
|
|
1719
1718
|
}
|
|
1720
1719
|
);
|
|
1721
1720
|
};
|
|
1722
1721
|
export {
|
|
1723
|
-
|
|
1722
|
+
_t as BOOKMARK_AREA_DATA_ATTRIBUTE,
|
|
1724
1723
|
so as ReactReader,
|
|
1725
1724
|
ao as ReactReaderProvider
|
|
1726
1725
|
};
|