@pdf-viewer/react 1.1.0-beta.9 → 1.1.0-rc.1
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/{RPDefaultLayout-39eb8e56.js → RPDefaultLayout-69712c15.js} +949 -946
- package/dist/components/RPController.js +42 -35
- package/dist/components/RPPages.js +1 -1
- package/dist/components/RPProvider.js +1 -1
- package/dist/components/layout/RPDefaultLayout.js +1 -1
- package/dist/components/layout/sidebar/RPSidebar.js +1 -1
- package/dist/components/layout/sidebar/Thumbnail.js +1 -1
- package/dist/components/layout/sidebar/Thumbnails.js +1 -1
- package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
- package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/MostPageTool.js +1 -1
- package/dist/components/layout/toolbar/OtherTool.js +1 -1
- package/dist/components/layout/toolbar/Paginate.js +1 -1
- package/dist/components/layout/toolbar/PrintTool.js +1 -1
- package/dist/components/layout/toolbar/RPToolbar.js +1 -1
- package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
- package/dist/components/layout/toolbar/SearchTool.js +1 -1
- package/dist/components/layout/toolbar/ZoomTool.js +1 -1
- package/dist/components/page/AnnotationLayer.js +1 -1
- package/dist/components/page/CanvasLayer.js +1 -1
- package/dist/components/page/DualPage.js +1 -1
- package/dist/components/page/RPPage.js +2 -3
- package/dist/components/page/SinglePage.js +1 -1
- package/dist/components/page/TextLayer.js +1 -1
- package/dist/components/ui/LoadingIndicator.js +1 -1
- package/dist/contexts/LayoutContainerContext.js +7 -4
- package/dist/contexts/PaginationContext.js +1 -1
- package/dist/contexts/PrintContext.js +1 -1
- package/dist/contexts/SearchContext.js +1 -1
- package/dist/contexts/ThumbnailsContext.js +1 -1
- package/dist/main.js +1 -1
- package/dist/types/contexts/LayoutContainerContext.d.ts +2 -0
- package/dist/types/utils/hooks/useWatermark.d.ts +1 -4
- package/dist/utils/hooks/useFileDownload.js +1 -1
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/usePaginate.js +1 -1
- package/dist/utils/hooks/usePrint.js +1 -1
- package/dist/utils/hooks/useScrollToPage.js +1 -1
- package/dist/utils/hooks/useSearch.js +1 -1
- package/dist/utils/hooks/useThumbnail.js +1 -1
- package/dist/utils/hooks/useVirtualReactWindow.js +1 -1
- package/dist/utils/hooks/useWatermark.js +26 -28
- package/package.json +1 -1
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { useRef as W, useEffect as E, useCallback as R, useState as H, createContext as Ue, useContext as qe, useMemo as z, forwardRef as je, useImperativeHandle as Kt, createElement as ze, PureComponent as
|
|
4
|
-
import { ChevronUpIcon as
|
|
5
|
-
import { UIButton as
|
|
1
|
+
import { jsx as a, jsxs as O, Fragment as He } from "react/jsx-runtime";
|
|
2
|
+
import * as V from "react";
|
|
3
|
+
import { useRef as W, useEffect as E, useCallback as R, useState as H, createContext as Ue, useContext as qe, useMemo as z, forwardRef as je, useImperativeHandle as Kt, createElement as ze, PureComponent as jn, Component as Zn, memo as Bn } from "react";
|
|
4
|
+
import { ChevronUpIcon as Oe } from "./components/icons/ChevronUpIcon.js";
|
|
5
|
+
import { UIButton as Q } from "./components/ui/Button.js";
|
|
6
6
|
import { UIInput as Xt } from "./components/ui/Input.js";
|
|
7
|
-
import { useScrollModeContext as
|
|
8
|
-
import { useDocumentContext as
|
|
7
|
+
import { useScrollModeContext as Le } from "./contexts/ScrollModeContext.js";
|
|
8
|
+
import { useDocumentContext as Y } from "./contexts/RPDocumentContext.js";
|
|
9
9
|
import "./contexts/DarkModeContext.js";
|
|
10
|
-
import { ViewMode as $e, ScrollMode as
|
|
10
|
+
import { ViewMode as $e, ScrollMode as X, AnnotationSubType as lt, SelectionMode as Kn, ZoomLevel as Ye } from "./utils/types.js";
|
|
11
11
|
import { useRotationContext as Ze } from "./contexts/RotationContext.js";
|
|
12
|
-
import { useLayerContext as
|
|
12
|
+
import { useLayerContext as Xn } from "./contexts/LayerContext.js";
|
|
13
13
|
import { useZoomContext as Be } from "./contexts/ZoomContext.js";
|
|
14
14
|
import { useViewModeContext as Ke } from "./contexts/ViewModeContext.js";
|
|
15
15
|
import { useVirtualScrollContext as Xe } from "./contexts/VirtualScrollContext.js";
|
|
16
16
|
import { useVirtualGridContext as Jt } from "./contexts/VirtualGridContext.js";
|
|
17
17
|
import { useScrollStateContext as Je } from "./contexts/ScrollStateContext.js";
|
|
18
|
-
import { useSelectionModeContext as
|
|
19
|
-
import { useInitialStateContext as
|
|
20
|
-
import { useFullScreenContext as
|
|
18
|
+
import { useSelectionModeContext as Jn } from "./contexts/SelectionModeContext.js";
|
|
19
|
+
import { useInitialStateContext as Yn } from "./contexts/InitialStateContext.js";
|
|
20
|
+
import { useFullScreenContext as Qn } from "./contexts/FullScreenContext.js";
|
|
21
21
|
import "./contexts/FileInputContext.js";
|
|
22
22
|
import "./contexts/DropFileZoneContext.js";
|
|
23
23
|
import { renderPage as ut } from "./utils/renderPage.js";
|
|
24
|
-
import { highlightMatches as Yt, findMatches as
|
|
24
|
+
import { highlightMatches as Yt, findMatches as er, resetDivs as tr } from "./utils/highlight.js";
|
|
25
25
|
import * as Qt from "pdfjs-dist";
|
|
26
|
-
import { PixelsPerInch as
|
|
27
|
-
import { useLayoutContainer as
|
|
26
|
+
import { PixelsPerInch as nr, AnnotationMode as rr, RenderingCancelledException as or, AnnotationLayer as sr } from "pdfjs-dist";
|
|
27
|
+
import { useLayoutContainer as be } from "./contexts/LayoutContainerContext.js";
|
|
28
28
|
import { useDimensionPagesContext as en } from "./contexts/DimensionPagesContext.js";
|
|
29
29
|
import "./components/RPConfig.js";
|
|
30
|
-
import { ThumbnailIcon as
|
|
31
|
-
import { c as
|
|
32
|
-
import { LoaderIcon as
|
|
33
|
-
import { useInfiniteScroll as
|
|
34
|
-
import { RPSplitter as
|
|
35
|
-
import { useToolbarComponentContext as
|
|
36
|
-
import { useIconContext as ce, IconProvider as
|
|
37
|
-
import
|
|
38
|
-
import { c as
|
|
39
|
-
import { WrapperLayout as
|
|
40
|
-
import { RPDropFileZone as
|
|
41
|
-
import { useViewportContext as
|
|
30
|
+
import { ThumbnailIcon as ar } from "./components/icons/Thumbnail.js";
|
|
31
|
+
import { c as te } from "./clsx-0c6e471a.js";
|
|
32
|
+
import { LoaderIcon as De } from "./components/icons/LoaderIcon.js";
|
|
33
|
+
import { useInfiniteScroll as ir } from "./utils/hooks/useInfiniteScroll.js";
|
|
34
|
+
import { RPSplitter as cr } from "./components/layout/sidebar/RPSplitter.js";
|
|
35
|
+
import { useToolbarComponentContext as fe, ToolbarComponentProvider as lr } from "./contexts/ToolbarComponentContext.js";
|
|
36
|
+
import { useIconContext as ce, IconProvider as ur } from "./contexts/IconContext.js";
|
|
37
|
+
import ne from "./components/ui/RPTooltip.js";
|
|
38
|
+
import { c as Ie, C as dr } from "./Container-fdb0a71f.js";
|
|
39
|
+
import { WrapperLayout as pr } from "./components/layout/WrapperLayout.js";
|
|
40
|
+
import { RPDropFileZone as hr } from "./components/RPDropFileZone.js";
|
|
41
|
+
import { useViewportContext as Ce, ViewportProvider as mr } from "./contexts/ViewportContext.js";
|
|
42
42
|
import "./contexts/ThemeContext.js";
|
|
43
|
-
import { SimpleLinkService as
|
|
43
|
+
import { SimpleLinkService as fr } from "./utils/link_service.js";
|
|
44
44
|
import { dateFormatter as dt } from "./utils/dateFormatter.js";
|
|
45
|
-
import { sanitizeExternalUrl as
|
|
46
|
-
import { useWatermark as
|
|
45
|
+
import { sanitizeExternalUrl as gr } from "./utils/sanitizeExternalUrl.js";
|
|
46
|
+
import { useWatermark as vr } from "./utils/hooks/useWatermark.js";
|
|
47
47
|
import { useMousePressed as _r } from "./utils/hooks/useMousePressed.js";
|
|
48
48
|
import { useGrabScroll as wr } from "./utils/hooks/useGrabScroll.js";
|
|
49
49
|
import { usePinch as br } from "./utils/hooks/usePinch.js";
|
|
50
|
-
import { useDebounce as
|
|
50
|
+
import { useDebounce as tn } from "./utils/hooks/useDebounce.js";
|
|
51
51
|
import { getThumbnailViewport as Rt } from "./utils/getThumbnailViewport.js";
|
|
52
52
|
import { useDimensionPages as Cr } from "./utils/hooks/useDimensionPages.js";
|
|
53
53
|
import { appConsole as Tr } from "./utils/appConsole.js";
|
|
54
|
-
import { FileUploadTool as
|
|
55
|
-
import { DarkModeTool as
|
|
56
|
-
import { ThreeDotIcon as
|
|
54
|
+
import { FileUploadTool as nn } from "./components/layout/toolbar/FileUploadTool.js";
|
|
55
|
+
import { DarkModeTool as Pr } from "./components/layout/toolbar/DarkModeTool.js";
|
|
56
|
+
import { ThreeDotIcon as Sr } from "./components/icons/ThreeDotIcon.js";
|
|
57
57
|
import { UIDropDown as vt } from "./components/ui/DropDown.js";
|
|
58
|
-
import { c as Ir, a as _t, P as
|
|
58
|
+
import { c as Ir, a as _t, P as Ae, b as Ee, d as wt, i as yr, k as xr, u as Rr } from "./index-3dff3fa8.js";
|
|
59
59
|
import { D as Lr, u as Qe } from "./index-4f17fe4d.js";
|
|
60
60
|
import { a as Nr, h as Mr, u as Er, F as Or, b as Dr, G as Ge } from "./index-1db49c1a.js";
|
|
61
|
-
import { CloseIcon as
|
|
61
|
+
import { CloseIcon as rn } from "./components/icons/CloseIcon.js";
|
|
62
62
|
import { PropertyItem as Ar } from "./components/layout/toolbar/PropertyItem.js";
|
|
63
63
|
import { useOtherToolContext as zr, OtherToolProvider as Fr } from "./contexts/OtherToolContext.js";
|
|
64
64
|
import { DocumentProperties as kr } from "./components/layout/toolbar/DocumentProperties.js";
|
|
@@ -66,9 +66,9 @@ import { RotateTool as Wr } from "./components/layout/toolbar/RotateTool.js";
|
|
|
66
66
|
import { ScrollModeTool as Hr } from "./components/layout/toolbar/ScrollModeTool.js";
|
|
67
67
|
import { MenuSeparator as bt } from "./components/layout/toolbar/MenuSeparator.js";
|
|
68
68
|
import { FileDownloadDefaultIcon as $r } from "./components/icons/FileDownloadDefaultIcon.js";
|
|
69
|
-
import { MenuItem as
|
|
69
|
+
import { MenuItem as ge } from "./components/layout/toolbar/MenuItem.js";
|
|
70
70
|
import { PrintDefaultTool as Gr } from "./components/icons/PrintDefaultIcon.js";
|
|
71
|
-
import { FullScreenTool as
|
|
71
|
+
import { FullScreenTool as on } from "./components/layout/toolbar/FullScreenTool.js";
|
|
72
72
|
import { GoToDownIcon as sn } from "./components/icons/GoToDownIcon.js";
|
|
73
73
|
import { SelectionModeTool as Vr } from "./components/layout/toolbar/SelectionModeTool.js";
|
|
74
74
|
import { ZoomInIcon as Ur } from "./components/icons/ZoomInIcon.js";
|
|
@@ -78,27 +78,27 @@ import { getZoomLevel as jr } from "./utils/getZoomLevel.js";
|
|
|
78
78
|
import { SearchIcon as Zr } from "./components/icons/SearchIcon.js";
|
|
79
79
|
import { UICheckbox as Nt } from "./components/ui/Checkbox.js";
|
|
80
80
|
import { ClearIcon as Br } from "./components/icons/ClearIcon.js";
|
|
81
|
-
import './assets/RPDefaultLayout.css';const
|
|
82
|
-
const { viewMode: e } = Ke(), { scrollMode: t } =
|
|
81
|
+
import './assets/RPDefaultLayout.css';const an = () => {
|
|
82
|
+
const { viewMode: e } = Ke(), { scrollMode: t } = Le(), { virtualScrollRef: n, virtualScrollableElementRef: r, pageScrollElementRef: o } = Xe(), { setFocusedPage: s } = oe(), i = W(), c = W(null), { columnCount: l } = Jt(), { widths: p, heights: h } = Cr(), m = W(t), u = W(e), g = W(l);
|
|
83
83
|
E(() => {
|
|
84
84
|
n != null && n.scrollToItem && (i.current = n);
|
|
85
85
|
}, [n]), E(() => {
|
|
86
86
|
m.current = t, u.current = e;
|
|
87
87
|
}, [t, e]);
|
|
88
|
-
const f = R((
|
|
88
|
+
const f = R((b, P, C) => {
|
|
89
89
|
c.current && cancelAnimationFrame(c.current), c.current = requestAnimationFrame(() => {
|
|
90
|
-
|
|
91
|
-
left:
|
|
92
|
-
top:
|
|
90
|
+
b.scrollTo({
|
|
91
|
+
left: P,
|
|
92
|
+
top: C,
|
|
93
93
|
behavior: "instant"
|
|
94
94
|
});
|
|
95
95
|
});
|
|
96
|
-
}, []),
|
|
97
|
-
(
|
|
96
|
+
}, []), w = R(
|
|
97
|
+
(b) => {
|
|
98
98
|
if (!o)
|
|
99
99
|
return;
|
|
100
|
-
const
|
|
101
|
-
|
|
100
|
+
const P = Math.ceil(b / 2) * 2 - 1;
|
|
101
|
+
b === P + 1 ? f(o, p[P], 0) : f(o, 0, 0);
|
|
102
102
|
},
|
|
103
103
|
[o, p, f]
|
|
104
104
|
);
|
|
@@ -108,38 +108,38 @@ import './assets/RPDefaultLayout.css';const cn = () => {
|
|
|
108
108
|
g.current = l;
|
|
109
109
|
}, [l]);
|
|
110
110
|
const v = R(
|
|
111
|
-
(
|
|
112
|
-
const
|
|
113
|
-
let
|
|
114
|
-
if (u.current === $e.DUAL_PAGE && m.current ===
|
|
115
|
-
|
|
111
|
+
(b) => {
|
|
112
|
+
const P = b - 1;
|
|
113
|
+
let C = P, y = 0;
|
|
114
|
+
if (u.current === $e.DUAL_PAGE && m.current === X.PAGE_SCROLLING) {
|
|
115
|
+
w(b);
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
118
|
-
if (m.current ===
|
|
119
|
-
|
|
118
|
+
if (m.current === X.PAGE_SCROLLING) {
|
|
119
|
+
s(b);
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
122
|
if (!i.current || !r)
|
|
123
123
|
return;
|
|
124
124
|
const d = r;
|
|
125
|
-
if (m.current ===
|
|
126
|
-
y =
|
|
127
|
-
const
|
|
128
|
-
f(d,
|
|
125
|
+
if (m.current === X.HORIZONTAL_SCROLLING) {
|
|
126
|
+
y = P;
|
|
127
|
+
const T = P * (p[P] ?? 0);
|
|
128
|
+
f(d, T, 0);
|
|
129
129
|
} else if (u.current === $e.DUAL_PAGE) {
|
|
130
|
-
y =
|
|
131
|
-
const
|
|
132
|
-
f(d,
|
|
130
|
+
y = P % 2, C = Math.floor(P / 2);
|
|
131
|
+
const _ = C * (h[C] ?? 0), S = y * (p[y] ?? 0);
|
|
132
|
+
f(d, S, _);
|
|
133
133
|
} else {
|
|
134
|
-
const
|
|
135
|
-
f(d, 0,
|
|
134
|
+
const T = C * (h[C] ?? 0);
|
|
135
|
+
f(d, 0, T);
|
|
136
136
|
}
|
|
137
137
|
},
|
|
138
138
|
[
|
|
139
139
|
r,
|
|
140
140
|
l,
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
w,
|
|
142
|
+
s,
|
|
143
143
|
f,
|
|
144
144
|
h,
|
|
145
145
|
p
|
|
@@ -149,24 +149,24 @@ import './assets/RPDefaultLayout.css';const cn = () => {
|
|
|
149
149
|
c.current && cancelAnimationFrame(c.current);
|
|
150
150
|
}, []), { scrollToPage: v };
|
|
151
151
|
}, Kr = (e = 1) => {
|
|
152
|
-
const [t, n] = H(e), [r, o] = H(0), { scrollToPage:
|
|
152
|
+
const [t, n] = H(e), [r, o] = H(0), { scrollToPage: s } = an(), i = W(1), { isScrolling: c } = Je(), { viewMode: l } = Ke(), { scrollMode: p } = Le(), h = tn(t, 100), m = R(
|
|
153
153
|
(v) => {
|
|
154
154
|
if (!/^[0-9]*$/g.test(v.toString()) || !v)
|
|
155
155
|
return { success: !1, currentPage: i.current };
|
|
156
|
-
const
|
|
157
|
-
return
|
|
156
|
+
const P = +v;
|
|
157
|
+
return P < 0 || P > r ? { success: !1, currentPage: i.current } : (n(P), i.current = P, { success: !0, currentPage: +v });
|
|
158
158
|
},
|
|
159
159
|
[r]
|
|
160
160
|
), u = R(m, [m]), g = R(
|
|
161
161
|
(v) => {
|
|
162
|
-
const
|
|
163
|
-
return
|
|
162
|
+
const b = m(v);
|
|
163
|
+
return b.success && (c.current = !0, s(b.currentPage)), b;
|
|
164
164
|
},
|
|
165
|
-
[m,
|
|
165
|
+
[m, s]
|
|
166
166
|
), f = R(() => {
|
|
167
167
|
let v = t - 1;
|
|
168
168
|
g(v);
|
|
169
|
-
}, [g, t, l, p]),
|
|
169
|
+
}, [g, t, l, p]), w = R(() => {
|
|
170
170
|
let v = t + 1;
|
|
171
171
|
g(v);
|
|
172
172
|
}, [g, t, l, p]);
|
|
@@ -175,11 +175,11 @@ import './assets/RPDefaultLayout.css';const cn = () => {
|
|
|
175
175
|
totalPages: r,
|
|
176
176
|
setFocusedPage: u,
|
|
177
177
|
setTotalPages: o,
|
|
178
|
-
nextPage:
|
|
178
|
+
nextPage: w,
|
|
179
179
|
prevPage: f,
|
|
180
180
|
goToPage: g
|
|
181
181
|
};
|
|
182
|
-
},
|
|
182
|
+
}, cn = Ue({
|
|
183
183
|
focusedPage: 0,
|
|
184
184
|
setFocusedPage: (e) => {
|
|
185
185
|
},
|
|
@@ -191,21 +191,21 @@ import './assets/RPDefaultLayout.css';const cn = () => {
|
|
|
191
191
|
},
|
|
192
192
|
nextPage: () => {
|
|
193
193
|
}
|
|
194
|
-
}),
|
|
195
|
-
const e = qe(
|
|
194
|
+
}), oe = () => {
|
|
195
|
+
const e = qe(cn);
|
|
196
196
|
return typeof (e == null ? void 0 : e.focusedPage) > "u" && Tr.error("Please use this hooks inside children component of RPProvider"), e;
|
|
197
|
-
},
|
|
198
|
-
const { pdf: t } =
|
|
197
|
+
}, Ja = ({ children: e }) => {
|
|
198
|
+
const { pdf: t } = Y(), { focusedPage: n, totalPages: r, setFocusedPage: o, setTotalPages: s, goToPage: i, nextPage: c, prevPage: l } = Kr();
|
|
199
199
|
return E(() => {
|
|
200
|
-
t != null && t.numPages &&
|
|
201
|
-
}, [t,
|
|
202
|
-
|
|
200
|
+
t != null && t.numPages && s(t.numPages);
|
|
201
|
+
}, [t, s]), /* @__PURE__ */ a(
|
|
202
|
+
cn.Provider,
|
|
203
203
|
{
|
|
204
204
|
value: {
|
|
205
205
|
focusedPage: n,
|
|
206
206
|
totalPages: r,
|
|
207
207
|
setFocusedPage: o,
|
|
208
|
-
setTotalPages:
|
|
208
|
+
setTotalPages: s,
|
|
209
209
|
nextPage: c,
|
|
210
210
|
prevPage: l,
|
|
211
211
|
goToPage: i
|
|
@@ -215,20 +215,20 @@ import './assets/RPDefaultLayout.css';const cn = () => {
|
|
|
215
215
|
);
|
|
216
216
|
};
|
|
217
217
|
const Xr = () => {
|
|
218
|
-
const { pdf: e, pages: t } =
|
|
218
|
+
const { pdf: e, pages: t } = Y(), [n, r] = H({
|
|
219
219
|
loadedPages: 0,
|
|
220
220
|
totalPages: 0,
|
|
221
221
|
percentage: 0
|
|
222
|
-
}), [o,
|
|
222
|
+
}), [o, s] = H(!1), [i, c] = H(!1), [l, p] = H(null), h = W(!1);
|
|
223
223
|
E(() => {
|
|
224
224
|
h.current;
|
|
225
225
|
}, [h]);
|
|
226
226
|
const m = R(() => {
|
|
227
227
|
document.documentElement.classList.remove("rp-print-html-printing"), document.body.classList.remove("rp-print-body-printing");
|
|
228
|
-
const
|
|
229
|
-
|
|
228
|
+
const C = document.querySelector(".rp-print-zone");
|
|
229
|
+
C && C.remove();
|
|
230
230
|
}, []), u = R(() => {
|
|
231
|
-
h.current = !1,
|
|
231
|
+
h.current = !1, s(!1), c(!1), p(null), r({
|
|
232
232
|
loadedPages: 0,
|
|
233
233
|
totalPages: 0,
|
|
234
234
|
percentage: 0
|
|
@@ -236,23 +236,23 @@ const Xr = () => {
|
|
|
236
236
|
}, []), g = () => {
|
|
237
237
|
h.current = !0;
|
|
238
238
|
}, f = async ({
|
|
239
|
-
scratchCanvas:
|
|
239
|
+
scratchCanvas: C,
|
|
240
240
|
pdfDocument: y,
|
|
241
241
|
pageNumber: d,
|
|
242
|
-
viewerPdfPage:
|
|
243
|
-
printResolution:
|
|
244
|
-
optionalContentConfigPromise:
|
|
242
|
+
viewerPdfPage: T,
|
|
243
|
+
printResolution: _,
|
|
244
|
+
optionalContentConfigPromise: S,
|
|
245
245
|
printAnnotationStoragePromise: A
|
|
246
246
|
}) => {
|
|
247
247
|
if (h.current) {
|
|
248
248
|
u();
|
|
249
249
|
return;
|
|
250
250
|
}
|
|
251
|
-
const
|
|
252
|
-
|
|
253
|
-
const
|
|
254
|
-
|
|
255
|
-
const [
|
|
251
|
+
const I = _ / nr.PDF;
|
|
252
|
+
C.width = Math.floor(T.width * I), C.height = Math.floor(T.height * I);
|
|
253
|
+
const N = C.getContext("2d");
|
|
254
|
+
N.save(), N.fillStyle = "rgb(255, 255, 255)", N.fillRect(0, 0, C.width, C.height), N.restore();
|
|
255
|
+
const [x, L] = await Promise.all([
|
|
256
256
|
y.getPage(d),
|
|
257
257
|
A
|
|
258
258
|
]);
|
|
@@ -260,121 +260,121 @@ const Xr = () => {
|
|
|
260
260
|
u();
|
|
261
261
|
return;
|
|
262
262
|
}
|
|
263
|
-
const
|
|
264
|
-
canvasContext:
|
|
265
|
-
transform: [
|
|
266
|
-
viewport:
|
|
263
|
+
const M = {
|
|
264
|
+
canvasContext: N,
|
|
265
|
+
transform: [I, 0, 0, I, 0, 0],
|
|
266
|
+
viewport: x.getViewport({ scale: 1, rotation: T.rotation }),
|
|
267
267
|
intent: "print",
|
|
268
|
-
annotationMode:
|
|
269
|
-
optionalContentConfigPromise:
|
|
268
|
+
annotationMode: rr.ENABLE_STORAGE,
|
|
269
|
+
optionalContentConfigPromise: S,
|
|
270
270
|
printAnnotationStorage: L
|
|
271
271
|
};
|
|
272
272
|
try {
|
|
273
|
-
return
|
|
273
|
+
return x.render(M).promise;
|
|
274
274
|
} catch (D) {
|
|
275
|
-
throw D instanceof
|
|
275
|
+
throw D instanceof or || console.error(D), D;
|
|
276
276
|
}
|
|
277
|
-
},
|
|
278
|
-
const
|
|
277
|
+
}, w = R(() => {
|
|
278
|
+
const C = window.print;
|
|
279
279
|
return new Promise((y) => {
|
|
280
|
-
const d = (
|
|
280
|
+
const d = (S) => {
|
|
281
281
|
setTimeout(() => {
|
|
282
|
-
|
|
282
|
+
C.call(window), setTimeout(() => S(), 20);
|
|
283
283
|
}, 0);
|
|
284
284
|
};
|
|
285
285
|
if (document.querySelector(".rp-print-zone")) {
|
|
286
286
|
d(y);
|
|
287
287
|
return;
|
|
288
288
|
}
|
|
289
|
-
const
|
|
290
|
-
document.querySelector(".rp-print-zone") && (d(y),
|
|
289
|
+
const _ = new MutationObserver(() => {
|
|
290
|
+
document.querySelector(".rp-print-zone") && (d(y), _.disconnect());
|
|
291
291
|
});
|
|
292
|
-
|
|
292
|
+
_.observe(document.body, { childList: !0, subtree: !0 });
|
|
293
293
|
});
|
|
294
|
-
}, []), v = async (
|
|
294
|
+
}, []), v = async (C) => {
|
|
295
295
|
const y = document.createElement("img"), d = document.createElement("div");
|
|
296
|
-
return d.classList.add("rp-print-page"), await new Promise((
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
URL.revokeObjectURL(y.src),
|
|
300
|
-
}, y.onerror =
|
|
296
|
+
return d.classList.add("rp-print-page"), await new Promise((T, _) => {
|
|
297
|
+
C.toBlob((S) => {
|
|
298
|
+
S ? (y.src = URL.createObjectURL(S), y.onload = () => {
|
|
299
|
+
URL.revokeObjectURL(y.src), T();
|
|
300
|
+
}, y.onerror = _) : _(new Error("Failed to create blob"));
|
|
301
301
|
});
|
|
302
302
|
}).catch(() => {
|
|
303
303
|
}), d.appendChild(y), d;
|
|
304
|
-
},
|
|
304
|
+
}, b = (C, y) => {
|
|
305
305
|
const d = document.createElement("div");
|
|
306
306
|
d.classList.add("rp-print-zone");
|
|
307
|
-
const
|
|
308
|
-
if (
|
|
309
|
-
const { width:
|
|
310
|
-
|
|
307
|
+
const T = document.createElement("style"), _ = y.get(1);
|
|
308
|
+
if (_) {
|
|
309
|
+
const { width: S, height: A } = _ == null ? void 0 : _.page.getViewport({ scale: 1 });
|
|
310
|
+
T.innerHTML = `@page { size: ${S}px ${A}px }`;
|
|
311
311
|
}
|
|
312
|
-
return d.appendChild(
|
|
313
|
-
},
|
|
312
|
+
return d.appendChild(T), d.append(...C), d;
|
|
313
|
+
}, P = R(async () => {
|
|
314
314
|
if (!e)
|
|
315
315
|
return;
|
|
316
316
|
u();
|
|
317
|
-
const
|
|
317
|
+
const C = document.createElement("canvas"), y = [];
|
|
318
318
|
try {
|
|
319
319
|
e.isPureXfa && console.warn("[rp] XFA Form is not supported at the moment.");
|
|
320
|
-
const
|
|
320
|
+
const T = e.getOptionalContentConfig({ intent: "print" }), _ = Promise.resolve(
|
|
321
321
|
e.annotationStorage.print ?? void 0
|
|
322
|
-
),
|
|
323
|
-
for (const [
|
|
322
|
+
), S = t.size;
|
|
323
|
+
for (const [I, N] of t) {
|
|
324
324
|
if (h.current) {
|
|
325
325
|
u();
|
|
326
326
|
return;
|
|
327
327
|
}
|
|
328
|
-
const
|
|
328
|
+
const x = N.page.getViewport({ scale: 1 });
|
|
329
329
|
if (await f({
|
|
330
|
-
scratchCanvas:
|
|
330
|
+
scratchCanvas: C,
|
|
331
331
|
pdfDocument: e,
|
|
332
|
-
pageNumber:
|
|
333
|
-
viewerPdfPage:
|
|
332
|
+
pageNumber: I,
|
|
333
|
+
viewerPdfPage: x,
|
|
334
334
|
printResolution: 150,
|
|
335
|
-
optionalContentConfigPromise:
|
|
336
|
-
printAnnotationStoragePromise:
|
|
335
|
+
optionalContentConfigPromise: T,
|
|
336
|
+
printAnnotationStoragePromise: _
|
|
337
337
|
}), h.current) {
|
|
338
338
|
u();
|
|
339
339
|
return;
|
|
340
340
|
}
|
|
341
|
-
const L = await v(
|
|
341
|
+
const L = await v(C);
|
|
342
342
|
y.push(L);
|
|
343
|
-
const
|
|
343
|
+
const M = parseFloat((y.length / S * 100).toFixed(2));
|
|
344
344
|
r({
|
|
345
|
-
loadedPages:
|
|
346
|
-
totalPages:
|
|
347
|
-
percentage:
|
|
345
|
+
loadedPages: I,
|
|
346
|
+
totalPages: S,
|
|
347
|
+
percentage: M
|
|
348
348
|
});
|
|
349
349
|
}
|
|
350
350
|
if (h.current) {
|
|
351
351
|
u();
|
|
352
352
|
return;
|
|
353
353
|
}
|
|
354
|
-
const A =
|
|
355
|
-
document.body.appendChild(A), document.documentElement.classList.add("rp-print-html-printing"), document.body.classList.add("rp-print-body-printing"),
|
|
354
|
+
const A = b(y, t);
|
|
355
|
+
document.body.appendChild(A), document.documentElement.classList.add("rp-print-html-printing"), document.body.classList.add("rp-print-body-printing"), s(!0), await w();
|
|
356
356
|
} catch (d) {
|
|
357
357
|
c(!0), d instanceof Error && p(d);
|
|
358
358
|
} finally {
|
|
359
|
-
|
|
359
|
+
C.height = 0, C.width = 0;
|
|
360
360
|
}
|
|
361
361
|
}, [e, t, h]);
|
|
362
362
|
return E(() => {
|
|
363
|
-
const
|
|
363
|
+
const C = () => {
|
|
364
364
|
u(), m();
|
|
365
365
|
};
|
|
366
|
-
return window.addEventListener("afterprint",
|
|
367
|
-
window.removeEventListener("afterprint",
|
|
366
|
+
return window.addEventListener("afterprint", C, !0), () => {
|
|
367
|
+
window.removeEventListener("afterprint", C, !0);
|
|
368
368
|
};
|
|
369
369
|
}, [m, u]), {
|
|
370
|
-
print:
|
|
370
|
+
print: P,
|
|
371
371
|
cancel: g,
|
|
372
372
|
progress: n,
|
|
373
373
|
isComplete: o,
|
|
374
374
|
isError: i,
|
|
375
375
|
error: l
|
|
376
376
|
};
|
|
377
|
-
},
|
|
377
|
+
}, ln = Ue({
|
|
378
378
|
print: () => {
|
|
379
379
|
},
|
|
380
380
|
cancel: () => {
|
|
@@ -391,8 +391,8 @@ const Xr = () => {
|
|
|
391
391
|
console.error("Error in setOnError callback:", t);
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
|
-
}),
|
|
395
|
-
const [t, n] = H(null), [r, o] = H(null), { print:
|
|
394
|
+
}), Ya = ({ children: e }) => {
|
|
395
|
+
const [t, n] = H(null), [r, o] = H(null), { print: s, cancel: i, progress: c, isComplete: l, isError: p, error: h } = Xr(), m = R((v) => {
|
|
396
396
|
v && typeof v == "function" && o(() => v);
|
|
397
397
|
}, []), u = (v) => {
|
|
398
398
|
h && v(h);
|
|
@@ -413,22 +413,22 @@ const Xr = () => {
|
|
|
413
413
|
}, [c, t]);
|
|
414
414
|
const f = () => {
|
|
415
415
|
r && (r(), o(null));
|
|
416
|
-
},
|
|
417
|
-
print:
|
|
416
|
+
}, w = {
|
|
417
|
+
print: s,
|
|
418
418
|
cancel: i,
|
|
419
419
|
setOnProgress: g,
|
|
420
420
|
setOnComplete: m,
|
|
421
421
|
setOnError: u,
|
|
422
422
|
progress: c
|
|
423
423
|
};
|
|
424
|
-
return /* @__PURE__ */
|
|
424
|
+
return /* @__PURE__ */ a(ln.Provider, { value: w, children: e });
|
|
425
425
|
}, Ct = () => {
|
|
426
|
-
const e = qe(
|
|
426
|
+
const e = qe(ln);
|
|
427
427
|
if (!e)
|
|
428
428
|
throw new Error("usePrintContext must be used within a PrintProvider");
|
|
429
429
|
return e;
|
|
430
430
|
}, Jr = () => {
|
|
431
|
-
const [e, t] = H({}), { pages: n } =
|
|
431
|
+
const [e, t] = H({}), { pages: n } = Y(), { rotate: r } = Ze(), o = z(() => Object.keys(e).length, [e]), s = R(
|
|
432
432
|
(c) => {
|
|
433
433
|
if (!n.size)
|
|
434
434
|
return;
|
|
@@ -470,8 +470,8 @@ const Xr = () => {
|
|
|
470
470
|
[n, r]
|
|
471
471
|
);
|
|
472
472
|
E(() => {
|
|
473
|
-
|
|
474
|
-
}, [
|
|
473
|
+
s(10);
|
|
474
|
+
}, [s]);
|
|
475
475
|
const i = R(
|
|
476
476
|
(c) => {
|
|
477
477
|
if (!n)
|
|
@@ -504,8 +504,8 @@ const Xr = () => {
|
|
|
504
504
|
},
|
|
505
505
|
[n, r]
|
|
506
506
|
);
|
|
507
|
-
return { thumbnailPages: e, addPage: i, addToPage:
|
|
508
|
-
},
|
|
507
|
+
return { thumbnailPages: e, addPage: i, addToPage: s, thumbnailLength: o };
|
|
508
|
+
}, un = Ue({
|
|
509
509
|
thumbnailPages: {},
|
|
510
510
|
addPage: (e) => {
|
|
511
511
|
},
|
|
@@ -515,107 +515,108 @@ const Xr = () => {
|
|
|
515
515
|
setActive: (e) => {
|
|
516
516
|
},
|
|
517
517
|
active: !1
|
|
518
|
-
}),
|
|
518
|
+
}), dn = () => qe(un), Qa = ({
|
|
519
519
|
children: e,
|
|
520
520
|
initialThumbnailsVisible: t
|
|
521
521
|
}) => {
|
|
522
|
-
const { thumbnailPages: n, addPage: r, addToPage: o, thumbnailLength:
|
|
523
|
-
return /* @__PURE__ */
|
|
524
|
-
|
|
522
|
+
const { thumbnailPages: n, addPage: r, addToPage: o, thumbnailLength: s } = Jr(), [i, c] = H(t);
|
|
523
|
+
return /* @__PURE__ */ a(
|
|
524
|
+
un.Provider,
|
|
525
525
|
{
|
|
526
|
-
value: { thumbnailPages: n, addPage: r, addToPage: o, thumbnailLength:
|
|
526
|
+
value: { thumbnailPages: n, addPage: r, addToPage: o, thumbnailLength: s, active: i, setActive: c },
|
|
527
527
|
children: e
|
|
528
528
|
}
|
|
529
529
|
);
|
|
530
530
|
}, Yr = (e = {}, t = "") => {
|
|
531
|
-
const [n, r] = H(t), [o,
|
|
531
|
+
const [n, r] = H(t), [o, s] = H(!1), { pdf: i, pages: c } = Y(), l = en(), p = W(!n), { currentZoom: h } = Be(), [m, u] = H([]), { setFocusedPage: g } = oe(), [f, w] = H(0), { pageScrollElementRef: v, virtualScrollableElementRef: b } = Xe(), { scrollMode: P } = Le(), { pagesRef: C } = be(), [y, d] = H(null), T = W({}), _ = z(() => f === 0 ? null : m[f - 1], [f, m]), S = z(() => m.length, [m]);
|
|
532
532
|
E(() => {
|
|
533
|
-
if (!
|
|
533
|
+
if (!_ || !c)
|
|
534
534
|
return;
|
|
535
|
-
const
|
|
536
|
-
if (!
|
|
535
|
+
const x = b || v;
|
|
536
|
+
if (!x || !C)
|
|
537
537
|
return;
|
|
538
|
-
const
|
|
539
|
-
let
|
|
540
|
-
|
|
541
|
-
let
|
|
542
|
-
if (!
|
|
538
|
+
const L = c.get(_.page), M = C.clientHeight / 2, D = C.clientWidth / 2;
|
|
539
|
+
let F = 0, G = 0;
|
|
540
|
+
P === X.PAGE_SCROLLING && g(_.page), P === X.VERTICAL_SCROLLING && (F = l.heights.slice(0, _.page - 1).reduce((Z, B) => Z + B, 0)), P === X.HORIZONTAL_SCROLLING && (G = l.widths.slice(0, _.page - 1).reduce((Z, B) => Z + B, 0));
|
|
541
|
+
let U;
|
|
542
|
+
if (!L)
|
|
543
543
|
return;
|
|
544
|
-
const q =
|
|
545
|
-
|
|
544
|
+
const q = T.current[_.page], j = L.page.getViewport({ scale: 1 });
|
|
545
|
+
U = new Qt.TextLayer({
|
|
546
546
|
viewport: j,
|
|
547
547
|
textContentSource: q,
|
|
548
548
|
container: document.createElement("div")
|
|
549
|
-
}),
|
|
550
|
-
const
|
|
551
|
-
|
|
552
|
-
const
|
|
553
|
-
left:
|
|
554
|
-
top:
|
|
549
|
+
}), U.render().then(() => {
|
|
550
|
+
const Z = U.textDivs[_.start.idx], [B] = Yt([_], q, U.textDivs), le = l.widths[_.page - 1], ue = l.heights[_.page - 1], ee = document.createElement("div"), K = document.createElement("div");
|
|
551
|
+
Z.style.position = "absolute", Z.style.color = "transparent", K.style.position = "absolute", K.style.top = "0", K.style.setProperty("--scale-factor", `${h}`), ee.style.position = "relative", ee.style.width = `${le}px`, ee.style.height = `${ue}px`, ee.style.zIndex = "-1", ee.appendChild(Z), K.appendChild(ee), C.prepend(K);
|
|
552
|
+
const ae = B.element.getBoundingClientRect(), Te = K.getBoundingClientRect(), ve = ae.top - Te.top, Pe = ae.left - Te.left, de = F + ve - M + ae.height / 2, pe = G + Pe - D + ae.width / 2, k = {
|
|
553
|
+
left: Math.max(pe, 0),
|
|
554
|
+
top: Math.max(de, 0)
|
|
555
555
|
};
|
|
556
|
-
|
|
557
|
-
...
|
|
556
|
+
C.removeChild(K), x.scrollTo({
|
|
557
|
+
...k
|
|
558
558
|
});
|
|
559
559
|
});
|
|
560
560
|
}, [
|
|
561
561
|
c,
|
|
562
562
|
g,
|
|
563
563
|
l,
|
|
564
|
+
_,
|
|
565
|
+
P,
|
|
564
566
|
b,
|
|
565
|
-
|
|
566
|
-
C
|
|
567
|
-
v
|
|
567
|
+
v,
|
|
568
|
+
C
|
|
568
569
|
]);
|
|
569
|
-
const
|
|
570
|
-
|
|
571
|
-
}, [
|
|
572
|
-
|
|
573
|
-
}, [
|
|
574
|
-
if (!
|
|
570
|
+
const A = R(() => {
|
|
571
|
+
w((x) => S ? x + 1 > S ? 1 : x + 1 : 0);
|
|
572
|
+
}, [S]), I = R(() => {
|
|
573
|
+
w((x) => S ? x - 1 <= 0 ? S : x - 1 : 0);
|
|
574
|
+
}, [S]), N = R(async (x) => {
|
|
575
|
+
if (!x)
|
|
575
576
|
return {};
|
|
576
|
-
const
|
|
577
|
-
for (let
|
|
577
|
+
const L = x.numPages, M = {};
|
|
578
|
+
for (let D = 1; D <= L; D++) {
|
|
578
579
|
if (p.current)
|
|
579
580
|
throw "close pop over";
|
|
580
|
-
const
|
|
581
|
-
|
|
581
|
+
const F = await x.getPage(D);
|
|
582
|
+
M[D.toString()] = await F.getTextContent();
|
|
582
583
|
}
|
|
583
|
-
return
|
|
584
|
+
return M;
|
|
584
585
|
}, []);
|
|
585
586
|
return E(() => {
|
|
586
587
|
if (!n) {
|
|
587
|
-
p.current = !0, u([]),
|
|
588
|
+
p.current = !0, u([]), w(0);
|
|
588
589
|
return;
|
|
589
590
|
}
|
|
590
|
-
p.current = !1,
|
|
591
|
-
|
|
592
|
-
const
|
|
593
|
-
const
|
|
591
|
+
p.current = !1, s(!0), u([]), w(0), N(i).then((x) => {
|
|
592
|
+
T.current = x;
|
|
593
|
+
const M = Object.keys(x).reduce((D, F) => {
|
|
594
|
+
const G = er(
|
|
594
595
|
[n],
|
|
595
|
-
|
|
596
|
-
Number(
|
|
596
|
+
x[F],
|
|
597
|
+
Number(F) - 1,
|
|
597
598
|
e
|
|
598
|
-
).map((
|
|
599
|
-
return [...
|
|
599
|
+
).map((U, q) => ({ ...U, page: Number(F), pageMatchIdx: q }));
|
|
600
|
+
return [...D, ...G];
|
|
600
601
|
}, []);
|
|
601
|
-
u(
|
|
602
|
+
u(M), w(M.length ? 1 : 0);
|
|
602
603
|
}).catch(() => {
|
|
603
|
-
u([]),
|
|
604
|
-
}).finally(() =>
|
|
605
|
-
}, [n,
|
|
604
|
+
u([]), w(0);
|
|
605
|
+
}).finally(() => s(!1));
|
|
606
|
+
}, [n, N, i, e]), {
|
|
606
607
|
search: n,
|
|
607
608
|
setSearch: r,
|
|
608
609
|
loading: o,
|
|
609
610
|
matches: m,
|
|
610
|
-
totalMatches:
|
|
611
|
+
totalMatches: S,
|
|
611
612
|
currentMatchPosition: f,
|
|
612
|
-
currentMatch:
|
|
613
|
-
nextMatch:
|
|
614
|
-
prevMatch:
|
|
615
|
-
currentMatchElement:
|
|
616
|
-
setCurrentMatchElement:
|
|
613
|
+
currentMatch: _,
|
|
614
|
+
nextMatch: A,
|
|
615
|
+
prevMatch: I,
|
|
616
|
+
currentMatchElement: y,
|
|
617
|
+
setCurrentMatchElement: d
|
|
617
618
|
};
|
|
618
|
-
},
|
|
619
|
+
}, pn = Ue({
|
|
619
620
|
search: "",
|
|
620
621
|
setSearch: (e) => {
|
|
621
622
|
},
|
|
@@ -639,7 +640,7 @@ const Xr = () => {
|
|
|
639
640
|
}) => {
|
|
640
641
|
const [n, r] = H({}), {
|
|
641
642
|
loading: o,
|
|
642
|
-
setSearch:
|
|
643
|
+
setSearch: s,
|
|
643
644
|
totalMatches: i,
|
|
644
645
|
currentMatchPosition: c,
|
|
645
646
|
currentMatch: l,
|
|
@@ -650,14 +651,14 @@ const Xr = () => {
|
|
|
650
651
|
currentMatchElement: g,
|
|
651
652
|
setCurrentMatchElement: f
|
|
652
653
|
} = Yr(n, t);
|
|
653
|
-
return /* @__PURE__ */
|
|
654
|
-
|
|
654
|
+
return /* @__PURE__ */ a(
|
|
655
|
+
pn.Provider,
|
|
655
656
|
{
|
|
656
657
|
value: {
|
|
657
658
|
searchOptions: n,
|
|
658
659
|
setSearchOptions: r,
|
|
659
660
|
loading: o,
|
|
660
|
-
setSearch:
|
|
661
|
+
setSearch: s,
|
|
661
662
|
totalMatches: i,
|
|
662
663
|
currentMatchPosition: c,
|
|
663
664
|
currentMatch: l,
|
|
@@ -671,7 +672,7 @@ const Xr = () => {
|
|
|
671
672
|
children: e
|
|
672
673
|
}
|
|
673
674
|
);
|
|
674
|
-
},
|
|
675
|
+
}, hn = () => qe(pn), he = {
|
|
675
676
|
"rp-pages": "_rp-pages_34orh_1",
|
|
676
677
|
"rp-pages-horizontal-scroll": "_rp-pages-horizontal-scroll_34orh_7",
|
|
677
678
|
"rp-pages-container": "_rp-pages-container_34orh_11",
|
|
@@ -684,11 +685,11 @@ const Xr = () => {
|
|
|
684
685
|
"rp-page": "_rp-page_h7a2q_1",
|
|
685
686
|
"rp-loader-wrapper": "_rp-loader-wrapper_h7a2q_14"
|
|
686
687
|
}, Qr = (e) => {
|
|
687
|
-
const { pageNumber: t, onLoaded: n, onLoading: r } = e, o = W(null), { pages:
|
|
688
|
+
const { pageNumber: t, onLoaded: n, onLoading: r } = e, o = W(null), { pages: s } = Y(), { rotate: i } = Ze(), c = W(), { currentZoom: l } = Be();
|
|
688
689
|
return E(() => {
|
|
689
|
-
if (!
|
|
690
|
+
if (!s || l === 0)
|
|
690
691
|
return;
|
|
691
|
-
const p =
|
|
692
|
+
const p = s.get(t);
|
|
692
693
|
if (o.current && p) {
|
|
693
694
|
const h = o.current;
|
|
694
695
|
h.hidden = !0;
|
|
@@ -700,65 +701,65 @@ const Xr = () => {
|
|
|
700
701
|
n && n();
|
|
701
702
|
});
|
|
702
703
|
}
|
|
703
|
-
}, [
|
|
704
|
+
}, [s, t, i, l, r, n]), /* @__PURE__ */ a("canvas", { "data-rp": `page-${t}-canvas`, ref: o });
|
|
704
705
|
}, tt = {
|
|
705
706
|
"rp-text-layer": "_rp-text-layer_1mgyz_1",
|
|
706
707
|
"rp-text-layer-text": "_rp-text-layer-text_1mgyz_9"
|
|
707
708
|
}, eo = (e) => {
|
|
708
|
-
const { pageNumber: t } = e, { pages: n } =
|
|
709
|
+
const { pageNumber: t } = e, { pages: n } = Y(), r = W(null), { matches: o, currentMatch: s, setCurrentMatchElement: i } = hn(), [c, l] = H(
|
|
709
710
|
[]
|
|
710
711
|
), p = W(), h = W(), m = W(), u = z(() => o.filter((f) => f.pageIndex === t - 1), [o, t]), g = R(
|
|
711
|
-
(f,
|
|
712
|
-
if (v &&
|
|
712
|
+
(f, w, v = !1) => {
|
|
713
|
+
if (v && tr(f, w), !u.length) {
|
|
713
714
|
m.current = void 0, l([]);
|
|
714
715
|
return;
|
|
715
716
|
}
|
|
716
|
-
const
|
|
717
|
-
l(
|
|
717
|
+
const b = Yt(u, f, w);
|
|
718
|
+
l(b);
|
|
718
719
|
},
|
|
719
720
|
[u]
|
|
720
721
|
);
|
|
721
722
|
return E(() => {
|
|
722
723
|
var v;
|
|
723
|
-
if ((v = m.current) == null || v.classList.remove("selected"), !c.length || !
|
|
724
|
+
if ((v = m.current) == null || v.classList.remove("selected"), !c.length || !s || s.pageIndex !== t - 1)
|
|
724
725
|
return;
|
|
725
726
|
const f = u.findIndex(
|
|
726
|
-
(
|
|
727
|
+
(b) => JSON.stringify(b) === JSON.stringify(s)
|
|
727
728
|
);
|
|
728
729
|
if (f === -1)
|
|
729
730
|
return;
|
|
730
|
-
const
|
|
731
|
-
|
|
732
|
-
}, [
|
|
731
|
+
const w = c.find((b) => b.index === f);
|
|
732
|
+
w && (m.current = w.element, i(w.element), w.element.classList.add("selected"));
|
|
733
|
+
}, [s, c, u]), E(() => {
|
|
733
734
|
const f = n.get(t);
|
|
734
735
|
if (!(!f || !r.current))
|
|
735
|
-
return p.current && p.current.cancel(), f.page.getTextContent().then((
|
|
736
|
+
return p.current && p.current.cancel(), f.page.getTextContent().then((w) => {
|
|
736
737
|
const v = f.page.getViewport({ scale: 1 });
|
|
737
738
|
return p.current = new Qt.TextLayer({
|
|
738
739
|
viewport: v,
|
|
739
|
-
textContentSource:
|
|
740
|
+
textContentSource: w,
|
|
740
741
|
container: r.current
|
|
741
|
-
}), h.current =
|
|
742
|
+
}), h.current = w, r.current && (r.current.innerText = ""), p.current.render();
|
|
742
743
|
}).then(() => {
|
|
743
|
-
var
|
|
744
|
-
[].slice.call(r.current.children).forEach((
|
|
745
|
-
|
|
744
|
+
var b;
|
|
745
|
+
[].slice.call(r.current.children).forEach((P) => {
|
|
746
|
+
P.classList.add(tt["rp-text-layer-text"]);
|
|
746
747
|
});
|
|
747
|
-
const v = (
|
|
748
|
+
const v = (b = p.current) == null ? void 0 : b.textDivs;
|
|
748
749
|
v && h.current && g(h.current, v);
|
|
749
750
|
}).catch(() => {
|
|
750
751
|
}), () => {
|
|
751
|
-
var
|
|
752
|
-
(
|
|
752
|
+
var w;
|
|
753
|
+
(w = p.current) == null || w.cancel();
|
|
753
754
|
};
|
|
754
755
|
}, [n, t]), E(() => {
|
|
755
756
|
var v;
|
|
756
|
-
[].slice.call(r.current.children).forEach((
|
|
757
|
-
|
|
757
|
+
[].slice.call(r.current.children).forEach((b) => {
|
|
758
|
+
b.classList.add(tt["rp-text-layer-text"]);
|
|
758
759
|
});
|
|
759
|
-
const
|
|
760
|
-
|
|
761
|
-
}, [g]), /* @__PURE__ */
|
|
760
|
+
const w = (v = p.current) == null ? void 0 : v.textDivs;
|
|
761
|
+
w && h.current && g(h.current, w, !0);
|
|
762
|
+
}, [g]), /* @__PURE__ */ a(
|
|
762
763
|
"div",
|
|
763
764
|
{
|
|
764
765
|
"data-rp": `page-${t}-textLayer`,
|
|
@@ -768,15 +769,15 @@ const Xr = () => {
|
|
|
768
769
|
);
|
|
769
770
|
}, to = {
|
|
770
771
|
"rp-annotation-layer": "_rp-annotation-layer_o0ksd_1"
|
|
771
|
-
},
|
|
772
|
+
}, mn = ["click", "dblclick", "mouseover", "input", "change"];
|
|
772
773
|
let no = "https://unpkg.com/pdfjs-dist@4.4.168/web/images/";
|
|
773
|
-
const pt = /* @__PURE__ */ new Map(),
|
|
774
|
+
const pt = /* @__PURE__ */ new Map(), fn = (e, t) => `${e.loadingTask.docId}___${t.num}R${t.gen === 0 ? "" : t.gen}`;
|
|
774
775
|
function ro(e, t) {
|
|
775
|
-
const n =
|
|
776
|
+
const n = fn(e, t);
|
|
776
777
|
return pt.has(n) ? pt.get(n) ?? null : null;
|
|
777
778
|
}
|
|
778
779
|
const oo = (e, t, n) => {
|
|
779
|
-
pt.set(
|
|
780
|
+
pt.set(fn(e, t), n);
|
|
780
781
|
}, Mt = (e, t) => {
|
|
781
782
|
switch (t[1].name) {
|
|
782
783
|
case "XYZ":
|
|
@@ -811,29 +812,29 @@ const oo = (e, t, n) => {
|
|
|
811
812
|
};
|
|
812
813
|
}
|
|
813
814
|
};
|
|
814
|
-
async function
|
|
815
|
+
async function gn(e, t) {
|
|
815
816
|
let n;
|
|
816
817
|
if (typeof t == "string" ? n = await e.getDestination(t) : n = t, n && typeof n[0] == "object" && n[0] !== null) {
|
|
817
818
|
const r = n[0], o = ro(e, r);
|
|
818
819
|
if (o === null) {
|
|
819
|
-
const
|
|
820
|
-
return oo(e, r,
|
|
820
|
+
const s = await e.getPageIndex(r);
|
|
821
|
+
return oo(e, r, s), await gn(e, n);
|
|
821
822
|
} else
|
|
822
823
|
return Mt(o, n);
|
|
823
824
|
} else
|
|
824
825
|
return Mt(n[0], n);
|
|
825
826
|
}
|
|
826
|
-
function
|
|
827
|
+
function so(e) {
|
|
827
828
|
const { id: t, url: n, unsafeUrl: r } = e;
|
|
828
|
-
new MutationObserver((
|
|
829
|
+
new MutationObserver((s, i) => {
|
|
829
830
|
const c = document.querySelector(`[data-annotation-id="${t}"]`);
|
|
830
831
|
if (c) {
|
|
831
|
-
const l = c.querySelector("a"), p =
|
|
832
|
+
const l = c.querySelector("a"), p = gr((n || r) ?? "", "");
|
|
832
833
|
l && (l.setAttribute("target", "_blank"), l.setAttribute("href", p), l.setAttribute("rel", "noopener noreferrer")), i.disconnect();
|
|
833
834
|
}
|
|
834
835
|
}).observe(document.body, { childList: !0, subtree: !0 });
|
|
835
836
|
}
|
|
836
|
-
const
|
|
837
|
+
const ao = (e) => {
|
|
837
838
|
const n = e.target.parentNode;
|
|
838
839
|
if (!n)
|
|
839
840
|
return;
|
|
@@ -863,81 +864,81 @@ const so = (e) => {
|
|
|
863
864
|
}, Et = (e, t, n, r) => {
|
|
864
865
|
if (e.type !== "click")
|
|
865
866
|
return;
|
|
866
|
-
const o = e.target,
|
|
867
|
+
const o = e.target, s = o.getAttribute("data-element-id"), i = o.getAttribute("href");
|
|
867
868
|
if (i && i !== "#")
|
|
868
869
|
return;
|
|
869
|
-
const c = t.find((l) => l.id ===
|
|
870
|
-
!c || c.annotationType !== lt.Link || c.dest &&
|
|
870
|
+
const c = t.find((l) => l.id === s);
|
|
871
|
+
!c || c.annotationType !== lt.Link || c.dest && gn(n, c.dest).then((l) => {
|
|
871
872
|
r(l);
|
|
872
873
|
});
|
|
873
874
|
};
|
|
874
875
|
function io(e, t) {
|
|
875
|
-
for (const n of
|
|
876
|
+
for (const n of mn)
|
|
876
877
|
e.addEventListener(n, t);
|
|
877
878
|
}
|
|
878
879
|
function Ot(e, t) {
|
|
879
|
-
for (const n of
|
|
880
|
+
for (const n of mn)
|
|
880
881
|
e.removeEventListener(n, t);
|
|
881
882
|
}
|
|
882
883
|
const co = (e) => {
|
|
883
|
-
const { pageNumber: t } = e, n = W(null), { pages: r, pdf: o } =
|
|
884
|
+
const { pageNumber: t } = e, n = W(null), { pages: r, pdf: o } = Y(), s = W(), [i, c] = H(), { setFocusedPage: l, goToPage: p } = oe(), { scrollMode: h } = Le(), m = z(() => r.get(t), [r, t]), u = z(() => m == null ? void 0 : m.page.getViewport(), [m]);
|
|
884
885
|
E(() => {
|
|
885
|
-
|
|
886
|
+
s.current && (s.current.div.replaceChildren(), s.current = void 0);
|
|
886
887
|
}, [o]);
|
|
887
888
|
const g = z(() => o == null ? void 0 : o.annotationStorage, [o]);
|
|
888
889
|
E(() => {
|
|
889
|
-
m && m.page.getAnnotations().then((
|
|
890
|
-
|
|
890
|
+
m && m.page.getAnnotations().then((w) => {
|
|
891
|
+
s.current = void 0, c(w), n.current && (n.current.innerText = "");
|
|
891
892
|
});
|
|
892
893
|
}, [m]);
|
|
893
894
|
const f = R(
|
|
894
|
-
(
|
|
895
|
-
|
|
895
|
+
(w) => {
|
|
896
|
+
ao(w), !(!i || !o) && (h === X.PAGE_SCROLLING ? Et(w, i, o, (v) => l(v.pageIndex + 1)) : Et(w, i, o, (v) => p(v.pageIndex + 1)));
|
|
896
897
|
},
|
|
897
898
|
[o, i, p, l, h]
|
|
898
899
|
);
|
|
899
900
|
return E(() => {
|
|
900
901
|
if (!m || !i)
|
|
901
902
|
return;
|
|
902
|
-
const
|
|
903
|
-
if (
|
|
904
|
-
|
|
905
|
-
viewport:
|
|
903
|
+
const w = m.page.getViewport();
|
|
904
|
+
if (s.current) {
|
|
905
|
+
s.current.update({
|
|
906
|
+
viewport: w.clone({ dontFlip: !0 })
|
|
906
907
|
});
|
|
907
908
|
return;
|
|
908
909
|
}
|
|
909
|
-
for (const
|
|
910
|
-
const { annotationType:
|
|
911
|
-
switch (
|
|
910
|
+
for (const b of i) {
|
|
911
|
+
const { annotationType: P } = b;
|
|
912
|
+
switch (P) {
|
|
912
913
|
case lt.Link:
|
|
913
|
-
|
|
914
|
+
so(b);
|
|
914
915
|
break;
|
|
915
916
|
case lt.Widget:
|
|
916
917
|
break;
|
|
917
918
|
}
|
|
918
919
|
}
|
|
919
920
|
return (async () => {
|
|
920
|
-
|
|
921
|
+
s.current = new sr({
|
|
921
922
|
div: n.current,
|
|
922
923
|
accessibilityManager: void 0,
|
|
923
924
|
annotationCanvasMap: void 0,
|
|
924
925
|
annotationEditorUIManager: void 0,
|
|
925
926
|
structTreeLayer: void 0,
|
|
926
927
|
page: m.page,
|
|
927
|
-
viewport:
|
|
928
|
+
viewport: w.clone({ dontFlip: !0 })
|
|
928
929
|
}), n.current && Ot(n.current, f);
|
|
929
|
-
const
|
|
930
|
-
return
|
|
930
|
+
const b = await (o == null ? void 0 : o.hasJSActions()), P = await (o == null ? void 0 : o.getFieldObjects());
|
|
931
|
+
return s.current.render({
|
|
931
932
|
annotations: i,
|
|
932
933
|
annotationStorage: g,
|
|
933
|
-
hasJSActions:
|
|
934
|
-
fieldObjects:
|
|
934
|
+
hasJSActions: b,
|
|
935
|
+
fieldObjects: P,
|
|
935
936
|
div: n.current,
|
|
936
|
-
viewport:
|
|
937
|
+
viewport: w.clone({ dontFlip: !0 }),
|
|
937
938
|
page: m.page,
|
|
938
939
|
imageResourcesPath: no,
|
|
939
940
|
renderForms: !1,
|
|
940
|
-
linkService: new
|
|
941
|
+
linkService: new fr(),
|
|
941
942
|
downloadManager: null,
|
|
942
943
|
enableScripting: !1
|
|
943
944
|
});
|
|
@@ -946,7 +947,7 @@ const co = (e) => {
|
|
|
946
947
|
}), () => {
|
|
947
948
|
n.current && Ot(n.current, f);
|
|
948
949
|
};
|
|
949
|
-
}, [o, i, f]), /* @__PURE__ */
|
|
950
|
+
}, [o, i, f]), /* @__PURE__ */ a(
|
|
950
951
|
"div",
|
|
951
952
|
{
|
|
952
953
|
"data-rp": `page-${t}-annotationLayer`,
|
|
@@ -955,53 +956,53 @@ const co = (e) => {
|
|
|
955
956
|
ref: n
|
|
956
957
|
}
|
|
957
958
|
);
|
|
958
|
-
}, lo =
|
|
959
|
-
const { pageNumber: n, style: r, onIntersectRatioChange: o, ...
|
|
959
|
+
}, lo = Array.from({ length: 21 }, (e, t) => Number((t * 0.05).toFixed(2))), Tt = je((e, t) => {
|
|
960
|
+
const { pageNumber: n, style: r, onIntersectRatioChange: o, ...s } = e, { pages: i } = Y(), { rotate: c } = Ze(), { textLayer: l } = Xn(), { currentZoom: p } = Be(), h = W(i.get(n)), [m, u] = H(!1), g = W(null), [f, w] = H({
|
|
960
961
|
width: 0,
|
|
961
962
|
height: 0
|
|
962
963
|
});
|
|
963
|
-
Kt(t, () =>
|
|
964
|
-
if (i && (
|
|
965
|
-
const
|
|
966
|
-
|
|
964
|
+
Kt(t, () => g.current), E(() => {
|
|
965
|
+
if (i && (h.current = i.get(n), h.current)) {
|
|
966
|
+
const C = h.current.page.getViewport({ scale: p, rotation: c });
|
|
967
|
+
w(C);
|
|
967
968
|
}
|
|
968
969
|
}, [i, n, c, p]);
|
|
969
|
-
const
|
|
970
|
+
const v = z(() => {
|
|
970
971
|
switch (c) {
|
|
971
972
|
case 90:
|
|
972
|
-
return `${
|
|
973
|
+
return `${f.width / 2}px ${f.width / 2}px`;
|
|
973
974
|
case -90:
|
|
974
975
|
case 270:
|
|
975
|
-
return `${
|
|
976
|
+
return `${f.height / 2}px ${f.height / 2}px`;
|
|
976
977
|
default:
|
|
977
978
|
return "center";
|
|
978
979
|
}
|
|
979
|
-
}, [c,
|
|
980
|
-
|
|
981
|
-
}, []),
|
|
982
|
-
|
|
980
|
+
}, [c, f]), b = R(() => {
|
|
981
|
+
u(!0);
|
|
982
|
+
}, []), P = R(() => {
|
|
983
|
+
u(!1);
|
|
983
984
|
}, []);
|
|
984
985
|
return E(() => {
|
|
985
|
-
const
|
|
986
|
-
(
|
|
987
|
-
o(n,
|
|
986
|
+
const C = new IntersectionObserver(
|
|
987
|
+
(y) => {
|
|
988
|
+
o(n, y[0].intersectionRatio);
|
|
988
989
|
},
|
|
989
|
-
{ threshold: lo
|
|
990
|
+
{ threshold: lo }
|
|
990
991
|
);
|
|
991
|
-
return
|
|
992
|
-
|
|
992
|
+
return g.current && C.observe(g.current), () => {
|
|
993
|
+
C.disconnect(), o(n, -1);
|
|
993
994
|
};
|
|
994
|
-
}, [o, n, c,
|
|
995
|
+
}, [o, n, c, f]), /* @__PURE__ */ a(
|
|
995
996
|
"div",
|
|
996
997
|
{
|
|
997
|
-
ref:
|
|
998
|
+
ref: g,
|
|
998
999
|
id: `page-${n}`,
|
|
999
1000
|
"data-rp": `page-${n}`,
|
|
1000
|
-
...
|
|
1001
|
+
...s,
|
|
1001
1002
|
style: {
|
|
1002
1003
|
...r,
|
|
1003
1004
|
"--rp-rotate": `${c}deg`,
|
|
1004
|
-
"--rp-page-rotate-translate": `${
|
|
1005
|
+
"--rp-page-rotate-translate": `${v}`,
|
|
1005
1006
|
"--scale-factor": p
|
|
1006
1007
|
},
|
|
1007
1008
|
className: et["rp-page-wrapper"],
|
|
@@ -1009,15 +1010,15 @@ const co = (e) => {
|
|
|
1009
1010
|
"div",
|
|
1010
1011
|
{
|
|
1011
1012
|
style: {
|
|
1012
|
-
width: `${
|
|
1013
|
-
height: `${
|
|
1013
|
+
width: `${f.width}px`,
|
|
1014
|
+
height: `${f.height}px`
|
|
1014
1015
|
},
|
|
1015
1016
|
className: et["rp-page"],
|
|
1016
1017
|
children: [
|
|
1017
|
-
/* @__PURE__ */
|
|
1018
|
-
|
|
1019
|
-
l && /* @__PURE__ */
|
|
1020
|
-
/* @__PURE__ */
|
|
1018
|
+
/* @__PURE__ */ a(Qr, { onLoading: b, onLoaded: P, pageNumber: n }),
|
|
1019
|
+
m && /* @__PURE__ */ a("div", { className: et["rp-loader-wrapper"], children: /* @__PURE__ */ a(De, {}) }),
|
|
1020
|
+
l && /* @__PURE__ */ a(eo, { pageNumber: n }),
|
|
1021
|
+
/* @__PURE__ */ a(co, { pageNumber: n })
|
|
1021
1022
|
]
|
|
1022
1023
|
}
|
|
1023
1024
|
)
|
|
@@ -1063,11 +1064,11 @@ function ho(e, t) {
|
|
|
1063
1064
|
}
|
|
1064
1065
|
function nt(e, t) {
|
|
1065
1066
|
t === void 0 && (t = ho);
|
|
1066
|
-
var n, r = [], o,
|
|
1067
|
+
var n, r = [], o, s = !1;
|
|
1067
1068
|
function i() {
|
|
1068
1069
|
for (var c = [], l = 0; l < arguments.length; l++)
|
|
1069
1070
|
c[l] = arguments[l];
|
|
1070
|
-
return
|
|
1071
|
+
return s && n === this && t(c, r) || (o = e.apply(this, c), s = !0, n = this, r = c), o;
|
|
1071
1072
|
}
|
|
1072
1073
|
return i;
|
|
1073
1074
|
}
|
|
@@ -1109,15 +1110,15 @@ function go(e) {
|
|
|
1109
1110
|
}
|
|
1110
1111
|
return rt;
|
|
1111
1112
|
}
|
|
1112
|
-
var
|
|
1113
|
+
var ye = null;
|
|
1113
1114
|
function Wt(e) {
|
|
1114
|
-
if (e === void 0 && (e = !1),
|
|
1115
|
+
if (e === void 0 && (e = !1), ye === null || e) {
|
|
1115
1116
|
var t = document.createElement("div"), n = t.style;
|
|
1116
1117
|
n.width = "50px", n.height = "50px", n.overflow = "scroll", n.direction = "rtl";
|
|
1117
1118
|
var r = document.createElement("div"), o = r.style;
|
|
1118
|
-
return o.width = "100px", o.height = "100px", t.appendChild(r), document.body.appendChild(t), t.scrollLeft > 0 ?
|
|
1119
|
+
return o.width = "100px", o.height = "100px", t.appendChild(r), document.body.appendChild(t), t.scrollLeft > 0 ? ye = "positive-descending" : (t.scrollLeft = 1, t.scrollLeft === 0 ? ye = "negative" : ye = "positive-ascending"), document.body.removeChild(t), ye;
|
|
1119
1120
|
}
|
|
1120
|
-
return
|
|
1121
|
+
return ye;
|
|
1121
1122
|
}
|
|
1122
1123
|
var vo = 150, _o = function(t) {
|
|
1123
1124
|
var n = t.columnIndex;
|
|
@@ -1127,12 +1128,12 @@ var vo = 150, _o = function(t) {
|
|
|
1127
1128
|
}, Fe = null, ke = null, We = null;
|
|
1128
1129
|
process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (Fe = /* @__PURE__ */ new WeakSet(), ke = /* @__PURE__ */ new WeakSet(), We = /* @__PURE__ */ new WeakSet());
|
|
1129
1130
|
function wo(e) {
|
|
1130
|
-
var t, n = e.getColumnOffset, r = e.getColumnStartIndexForOffset, o = e.getColumnStopIndexForStartIndex,
|
|
1131
|
-
return t = /* @__PURE__ */ function(
|
|
1132
|
-
uo(
|
|
1133
|
-
function
|
|
1131
|
+
var t, n = e.getColumnOffset, r = e.getColumnStartIndexForOffset, o = e.getColumnStopIndexForStartIndex, s = e.getColumnWidth, i = e.getEstimatedTotalHeight, c = e.getEstimatedTotalWidth, l = e.getOffsetForColumnAndAlignment, p = e.getOffsetForRowAndAlignment, h = e.getRowHeight, m = e.getRowOffset, u = e.getRowStartIndexForOffset, g = e.getRowStopIndexForStartIndex, f = e.initInstanceProps, w = e.shouldResetStyleCacheOnItemSizeChange, v = e.validateProps;
|
|
1132
|
+
return t = /* @__PURE__ */ function(b) {
|
|
1133
|
+
uo(P, b);
|
|
1134
|
+
function P(y) {
|
|
1134
1135
|
var d;
|
|
1135
|
-
return d =
|
|
1136
|
+
return d = b.call(this, y) || this, d._instanceProps = f(d.props, Dt(d)), d._resetIsScrollingTimeoutId = null, d._outerRef = void 0, d.state = {
|
|
1136
1137
|
instance: Dt(d),
|
|
1137
1138
|
isScrolling: !1,
|
|
1138
1139
|
horizontalScrollDirection: "forward",
|
|
@@ -1140,72 +1141,72 @@ function wo(e) {
|
|
|
1140
1141
|
scrollTop: typeof d.props.initialScrollTop == "number" ? d.props.initialScrollTop : 0,
|
|
1141
1142
|
scrollUpdateWasRequested: !1,
|
|
1142
1143
|
verticalScrollDirection: "forward"
|
|
1143
|
-
}, d._callOnItemsRendered = void 0, d._callOnItemsRendered = nt(function(
|
|
1144
|
+
}, d._callOnItemsRendered = void 0, d._callOnItemsRendered = nt(function(T, _, S, A, I, N, x, L) {
|
|
1144
1145
|
return d.props.onItemsRendered({
|
|
1145
|
-
overscanColumnStartIndex:
|
|
1146
|
-
overscanColumnStopIndex:
|
|
1147
|
-
overscanRowStartIndex:
|
|
1146
|
+
overscanColumnStartIndex: T,
|
|
1147
|
+
overscanColumnStopIndex: _,
|
|
1148
|
+
overscanRowStartIndex: S,
|
|
1148
1149
|
overscanRowStopIndex: A,
|
|
1149
|
-
visibleColumnStartIndex:
|
|
1150
|
-
visibleColumnStopIndex:
|
|
1151
|
-
visibleRowStartIndex:
|
|
1150
|
+
visibleColumnStartIndex: I,
|
|
1151
|
+
visibleColumnStopIndex: N,
|
|
1152
|
+
visibleRowStartIndex: x,
|
|
1152
1153
|
visibleRowStopIndex: L
|
|
1153
1154
|
});
|
|
1154
|
-
}), d._callOnScroll = void 0, d._callOnScroll = nt(function(
|
|
1155
|
+
}), d._callOnScroll = void 0, d._callOnScroll = nt(function(T, _, S, A, I) {
|
|
1155
1156
|
return d.props.onScroll({
|
|
1156
|
-
horizontalScrollDirection:
|
|
1157
|
-
scrollLeft:
|
|
1158
|
-
scrollTop:
|
|
1157
|
+
horizontalScrollDirection: S,
|
|
1158
|
+
scrollLeft: T,
|
|
1159
|
+
scrollTop: _,
|
|
1159
1160
|
verticalScrollDirection: A,
|
|
1160
|
-
scrollUpdateWasRequested:
|
|
1161
|
+
scrollUpdateWasRequested: I
|
|
1161
1162
|
});
|
|
1162
|
-
}), d._getItemStyle = void 0, d._getItemStyle = function(
|
|
1163
|
-
var
|
|
1164
|
-
if (
|
|
1165
|
-
|
|
1163
|
+
}), d._getItemStyle = void 0, d._getItemStyle = function(T, _) {
|
|
1164
|
+
var S = d.props, A = S.columnWidth, I = S.direction, N = S.rowHeight, x = d._getItemStyleCache(w && A, w && I, w && N), L = T + ":" + _, M;
|
|
1165
|
+
if (x.hasOwnProperty(L))
|
|
1166
|
+
M = x[L];
|
|
1166
1167
|
else {
|
|
1167
|
-
var D = n(d.props,
|
|
1168
|
-
|
|
1168
|
+
var D = n(d.props, _, d._instanceProps), F = I === "rtl";
|
|
1169
|
+
x[L] = M = {
|
|
1169
1170
|
position: "absolute",
|
|
1170
1171
|
left: F ? void 0 : D,
|
|
1171
1172
|
right: F ? D : void 0,
|
|
1172
|
-
top: m(d.props,
|
|
1173
|
-
height: h(d.props,
|
|
1174
|
-
width:
|
|
1173
|
+
top: m(d.props, T, d._instanceProps),
|
|
1174
|
+
height: h(d.props, T, d._instanceProps),
|
|
1175
|
+
width: s(d.props, _, d._instanceProps)
|
|
1175
1176
|
};
|
|
1176
1177
|
}
|
|
1177
|
-
return
|
|
1178
|
-
}, d._getItemStyleCache = void 0, d._getItemStyleCache = nt(function(
|
|
1178
|
+
return M;
|
|
1179
|
+
}, d._getItemStyleCache = void 0, d._getItemStyleCache = nt(function(T, _, S) {
|
|
1179
1180
|
return {};
|
|
1180
|
-
}), d._onScroll = function(
|
|
1181
|
-
var
|
|
1182
|
-
d.setState(function(
|
|
1183
|
-
if (
|
|
1181
|
+
}), d._onScroll = function(T) {
|
|
1182
|
+
var _ = T.currentTarget, S = _.clientHeight, A = _.clientWidth, I = _.scrollLeft, N = _.scrollTop, x = _.scrollHeight, L = _.scrollWidth;
|
|
1183
|
+
d.setState(function(M) {
|
|
1184
|
+
if (M.scrollLeft === I && M.scrollTop === N)
|
|
1184
1185
|
return null;
|
|
1185
|
-
var D = d.props.direction, F =
|
|
1186
|
+
var D = d.props.direction, F = I;
|
|
1186
1187
|
if (D === "rtl")
|
|
1187
1188
|
switch (Wt()) {
|
|
1188
1189
|
case "negative":
|
|
1189
|
-
F = -
|
|
1190
|
+
F = -I;
|
|
1190
1191
|
break;
|
|
1191
1192
|
case "positive-descending":
|
|
1192
|
-
F = L - A -
|
|
1193
|
+
F = L - A - I;
|
|
1193
1194
|
break;
|
|
1194
1195
|
}
|
|
1195
1196
|
F = Math.max(0, Math.min(F, L - A));
|
|
1196
|
-
var
|
|
1197
|
+
var G = Math.max(0, Math.min(N, x - S));
|
|
1197
1198
|
return {
|
|
1198
1199
|
isScrolling: !0,
|
|
1199
|
-
horizontalScrollDirection:
|
|
1200
|
+
horizontalScrollDirection: M.scrollLeft < I ? "forward" : "backward",
|
|
1200
1201
|
scrollLeft: F,
|
|
1201
|
-
scrollTop:
|
|
1202
|
-
verticalScrollDirection:
|
|
1202
|
+
scrollTop: G,
|
|
1203
|
+
verticalScrollDirection: M.scrollTop < N ? "forward" : "backward",
|
|
1203
1204
|
scrollUpdateWasRequested: !1
|
|
1204
1205
|
};
|
|
1205
1206
|
}, d._resetIsScrollingDebounced);
|
|
1206
|
-
}, d._outerRefSetter = function(
|
|
1207
|
-
var
|
|
1208
|
-
d._outerRef =
|
|
1207
|
+
}, d._outerRefSetter = function(T) {
|
|
1208
|
+
var _ = d.props.outerRef;
|
|
1209
|
+
d._outerRef = T, typeof _ == "function" ? _(T) : _ != null && typeof _ == "object" && _.hasOwnProperty("current") && (_.current = T);
|
|
1209
1210
|
}, d._resetIsScrollingDebounced = function() {
|
|
1210
1211
|
d._resetIsScrollingTimeoutId !== null && kt(d._resetIsScrollingTimeoutId), d._resetIsScrollingTimeoutId = fo(d._resetIsScrolling, vo);
|
|
1211
1212
|
}, d._resetIsScrolling = function() {
|
|
@@ -1216,131 +1217,131 @@ function wo(e) {
|
|
|
1216
1217
|
});
|
|
1217
1218
|
}, d;
|
|
1218
1219
|
}
|
|
1219
|
-
|
|
1220
|
-
return bo(d,
|
|
1220
|
+
P.getDerivedStateFromProps = function(d, T) {
|
|
1221
|
+
return bo(d, T), v(d), null;
|
|
1221
1222
|
};
|
|
1222
|
-
var
|
|
1223
|
-
return
|
|
1224
|
-
var
|
|
1225
|
-
|
|
1226
|
-
return
|
|
1227
|
-
horizontalScrollDirection:
|
|
1228
|
-
scrollLeft:
|
|
1229
|
-
scrollTop:
|
|
1223
|
+
var C = P.prototype;
|
|
1224
|
+
return C.scrollTo = function(d) {
|
|
1225
|
+
var T = d.scrollLeft, _ = d.scrollTop;
|
|
1226
|
+
T !== void 0 && (T = Math.max(0, T)), _ !== void 0 && (_ = Math.max(0, _)), this.setState(function(S) {
|
|
1227
|
+
return T === void 0 && (T = S.scrollLeft), _ === void 0 && (_ = S.scrollTop), S.scrollLeft === T && S.scrollTop === _ ? null : {
|
|
1228
|
+
horizontalScrollDirection: S.scrollLeft < T ? "forward" : "backward",
|
|
1229
|
+
scrollLeft: T,
|
|
1230
|
+
scrollTop: _,
|
|
1230
1231
|
scrollUpdateWasRequested: !0,
|
|
1231
|
-
verticalScrollDirection:
|
|
1232
|
+
verticalScrollDirection: S.scrollTop < _ ? "forward" : "backward"
|
|
1232
1233
|
};
|
|
1233
1234
|
}, this._resetIsScrollingDebounced);
|
|
1234
|
-
},
|
|
1235
|
-
var
|
|
1236
|
-
|
|
1237
|
-
var
|
|
1235
|
+
}, C.scrollToItem = function(d) {
|
|
1236
|
+
var T = d.align, _ = T === void 0 ? "auto" : T, S = d.columnIndex, A = d.rowIndex, I = this.props, N = I.columnCount, x = I.height, L = I.rowCount, M = I.width, D = this.state, F = D.scrollLeft, G = D.scrollTop, U = go();
|
|
1237
|
+
S !== void 0 && (S = Math.max(0, Math.min(S, N - 1))), A !== void 0 && (A = Math.max(0, Math.min(A, L - 1)));
|
|
1238
|
+
var q = i(this.props, this._instanceProps), j = c(this.props, this._instanceProps), Z = j > M ? U : 0, B = q > x ? U : 0;
|
|
1238
1239
|
this.scrollTo({
|
|
1239
|
-
scrollLeft:
|
|
1240
|
-
scrollTop: A !== void 0 ? p(this.props, A,
|
|
1240
|
+
scrollLeft: S !== void 0 ? l(this.props, S, _, F, this._instanceProps, B) : F,
|
|
1241
|
+
scrollTop: A !== void 0 ? p(this.props, A, _, G, this._instanceProps, Z) : G
|
|
1241
1242
|
});
|
|
1242
|
-
},
|
|
1243
|
-
var d = this.props,
|
|
1243
|
+
}, C.componentDidMount = function() {
|
|
1244
|
+
var d = this.props, T = d.initialScrollLeft, _ = d.initialScrollTop;
|
|
1244
1245
|
if (this._outerRef != null) {
|
|
1245
|
-
var
|
|
1246
|
-
typeof
|
|
1246
|
+
var S = this._outerRef;
|
|
1247
|
+
typeof T == "number" && (S.scrollLeft = T), typeof _ == "number" && (S.scrollTop = _);
|
|
1247
1248
|
}
|
|
1248
1249
|
this._callPropsCallbacks();
|
|
1249
|
-
},
|
|
1250
|
-
var d = this.props.direction,
|
|
1250
|
+
}, C.componentDidUpdate = function() {
|
|
1251
|
+
var d = this.props.direction, T = this.state, _ = T.scrollLeft, S = T.scrollTop, A = T.scrollUpdateWasRequested;
|
|
1251
1252
|
if (A && this._outerRef != null) {
|
|
1252
|
-
var
|
|
1253
|
+
var I = this._outerRef;
|
|
1253
1254
|
if (d === "rtl")
|
|
1254
1255
|
switch (Wt()) {
|
|
1255
1256
|
case "negative":
|
|
1256
|
-
|
|
1257
|
+
I.scrollLeft = -_;
|
|
1257
1258
|
break;
|
|
1258
1259
|
case "positive-ascending":
|
|
1259
|
-
|
|
1260
|
+
I.scrollLeft = _;
|
|
1260
1261
|
break;
|
|
1261
1262
|
default:
|
|
1262
|
-
var
|
|
1263
|
-
|
|
1263
|
+
var N = I.clientWidth, x = I.scrollWidth;
|
|
1264
|
+
I.scrollLeft = x - N - _;
|
|
1264
1265
|
break;
|
|
1265
1266
|
}
|
|
1266
1267
|
else
|
|
1267
|
-
|
|
1268
|
-
|
|
1268
|
+
I.scrollLeft = Math.max(0, _);
|
|
1269
|
+
I.scrollTop = Math.max(0, S);
|
|
1269
1270
|
}
|
|
1270
1271
|
this._callPropsCallbacks();
|
|
1271
|
-
},
|
|
1272
|
+
}, C.componentWillUnmount = function() {
|
|
1272
1273
|
this._resetIsScrollingTimeoutId !== null && kt(this._resetIsScrollingTimeoutId);
|
|
1273
|
-
},
|
|
1274
|
-
var d = this.props,
|
|
1275
|
-
if (
|
|
1276
|
-
for (var
|
|
1277
|
-
for (var
|
|
1278
|
-
|
|
1279
|
-
columnIndex:
|
|
1280
|
-
data:
|
|
1274
|
+
}, C.render = function() {
|
|
1275
|
+
var d = this.props, T = d.children, _ = d.className, S = d.columnCount, A = d.direction, I = d.height, N = d.innerRef, x = d.innerElementType, L = d.innerTagName, M = d.itemData, D = d.itemKey, F = D === void 0 ? _o : D, G = d.outerElementType, U = d.outerTagName, q = d.rowCount, j = d.style, Z = d.useIsScrolling, B = d.width, le = this.state.isScrolling, ue = this._getHorizontalRangeToRender(), ee = ue[0], K = ue[1], ae = this._getVerticalRangeToRender(), Te = ae[0], ve = ae[1], Pe = [];
|
|
1276
|
+
if (S > 0 && q)
|
|
1277
|
+
for (var de = Te; de <= ve; de++)
|
|
1278
|
+
for (var pe = ee; pe <= K; pe++)
|
|
1279
|
+
Pe.push(ze(T, {
|
|
1280
|
+
columnIndex: pe,
|
|
1281
|
+
data: M,
|
|
1281
1282
|
isScrolling: Z ? le : void 0,
|
|
1282
1283
|
key: F({
|
|
1283
|
-
columnIndex:
|
|
1284
|
-
data:
|
|
1285
|
-
rowIndex:
|
|
1284
|
+
columnIndex: pe,
|
|
1285
|
+
data: M,
|
|
1286
|
+
rowIndex: de
|
|
1286
1287
|
}),
|
|
1287
|
-
rowIndex:
|
|
1288
|
-
style: this._getItemStyle(
|
|
1288
|
+
rowIndex: de,
|
|
1289
|
+
style: this._getItemStyle(de, pe)
|
|
1289
1290
|
}));
|
|
1290
|
-
var k = i(this.props, this._instanceProps),
|
|
1291
|
-
return ze(
|
|
1292
|
-
className:
|
|
1291
|
+
var k = i(this.props, this._instanceProps), $ = c(this.props, this._instanceProps);
|
|
1292
|
+
return ze(G || U || "div", {
|
|
1293
|
+
className: _,
|
|
1293
1294
|
onScroll: this._onScroll,
|
|
1294
1295
|
ref: this._outerRefSetter,
|
|
1295
1296
|
style: ht({
|
|
1296
1297
|
position: "relative",
|
|
1297
|
-
height:
|
|
1298
|
-
width:
|
|
1298
|
+
height: I,
|
|
1299
|
+
width: B,
|
|
1299
1300
|
overflow: "auto",
|
|
1300
1301
|
WebkitOverflowScrolling: "touch",
|
|
1301
1302
|
willChange: "transform",
|
|
1302
1303
|
direction: A
|
|
1303
|
-
},
|
|
1304
|
-
}, ze(
|
|
1305
|
-
children:
|
|
1306
|
-
ref:
|
|
1304
|
+
}, j)
|
|
1305
|
+
}, ze(x || L || "div", {
|
|
1306
|
+
children: Pe,
|
|
1307
|
+
ref: N,
|
|
1307
1308
|
style: {
|
|
1308
1309
|
height: k,
|
|
1309
1310
|
pointerEvents: le ? "none" : void 0,
|
|
1310
|
-
width:
|
|
1311
|
+
width: $
|
|
1311
1312
|
}
|
|
1312
1313
|
}));
|
|
1313
|
-
},
|
|
1314
|
-
var d = this.props,
|
|
1315
|
-
if (typeof
|
|
1316
|
-
var
|
|
1317
|
-
this._callOnItemsRendered(
|
|
1314
|
+
}, C._callPropsCallbacks = function() {
|
|
1315
|
+
var d = this.props, T = d.columnCount, _ = d.onItemsRendered, S = d.onScroll, A = d.rowCount;
|
|
1316
|
+
if (typeof _ == "function" && T > 0 && A > 0) {
|
|
1317
|
+
var I = this._getHorizontalRangeToRender(), N = I[0], x = I[1], L = I[2], M = I[3], D = this._getVerticalRangeToRender(), F = D[0], G = D[1], U = D[2], q = D[3];
|
|
1318
|
+
this._callOnItemsRendered(N, x, F, G, L, M, U, q);
|
|
1318
1319
|
}
|
|
1319
|
-
if (typeof
|
|
1320
|
-
var
|
|
1321
|
-
this._callOnScroll(
|
|
1320
|
+
if (typeof S == "function") {
|
|
1321
|
+
var j = this.state, Z = j.horizontalScrollDirection, B = j.scrollLeft, le = j.scrollTop, ue = j.scrollUpdateWasRequested, ee = j.verticalScrollDirection;
|
|
1322
|
+
this._callOnScroll(B, le, Z, ee, ue);
|
|
1322
1323
|
}
|
|
1323
|
-
},
|
|
1324
|
-
var d = this.props,
|
|
1325
|
-
if (
|
|
1324
|
+
}, C._getHorizontalRangeToRender = function() {
|
|
1325
|
+
var d = this.props, T = d.columnCount, _ = d.overscanColumnCount, S = d.overscanColumnsCount, A = d.overscanCount, I = d.rowCount, N = this.state, x = N.horizontalScrollDirection, L = N.isScrolling, M = N.scrollLeft, D = _ || S || A || 1;
|
|
1326
|
+
if (T === 0 || I === 0)
|
|
1326
1327
|
return [0, 0, 0, 0];
|
|
1327
|
-
var F = r(this.props,
|
|
1328
|
-
return [Math.max(0, F -
|
|
1329
|
-
},
|
|
1330
|
-
var d = this.props,
|
|
1331
|
-
if (
|
|
1328
|
+
var F = r(this.props, M, this._instanceProps), G = o(this.props, F, M, this._instanceProps), U = !L || x === "backward" ? Math.max(1, D) : 1, q = !L || x === "forward" ? Math.max(1, D) : 1;
|
|
1329
|
+
return [Math.max(0, F - U), Math.max(0, Math.min(T - 1, G + q)), F, G];
|
|
1330
|
+
}, C._getVerticalRangeToRender = function() {
|
|
1331
|
+
var d = this.props, T = d.columnCount, _ = d.overscanCount, S = d.overscanRowCount, A = d.overscanRowsCount, I = d.rowCount, N = this.state, x = N.isScrolling, L = N.verticalScrollDirection, M = N.scrollTop, D = S || A || _ || 1;
|
|
1332
|
+
if (T === 0 || I === 0)
|
|
1332
1333
|
return [0, 0, 0, 0];
|
|
1333
|
-
var F = u(this.props,
|
|
1334
|
-
return [Math.max(0, F -
|
|
1335
|
-
},
|
|
1336
|
-
}(
|
|
1334
|
+
var F = u(this.props, M, this._instanceProps), G = g(this.props, F, M, this._instanceProps), U = !x || L === "backward" ? Math.max(1, D) : 1, q = !x || L === "forward" ? Math.max(1, D) : 1;
|
|
1335
|
+
return [Math.max(0, F - U), Math.max(0, Math.min(I - 1, G + q)), F, G];
|
|
1336
|
+
}, P;
|
|
1337
|
+
}(jn), t.defaultProps = {
|
|
1337
1338
|
direction: "ltr",
|
|
1338
1339
|
itemData: void 0,
|
|
1339
1340
|
useIsScrolling: !1
|
|
1340
1341
|
}, t;
|
|
1341
1342
|
}
|
|
1342
1343
|
var bo = function(t, n) {
|
|
1343
|
-
var r = t.children, o = t.direction,
|
|
1344
|
+
var r = t.children, o = t.direction, s = t.height, i = t.innerTagName, c = t.outerTagName, l = t.overscanColumnsCount, p = t.overscanCount, h = t.overscanRowsCount, m = t.width, u = n.instance;
|
|
1344
1345
|
if (process.env.NODE_ENV !== "production") {
|
|
1345
1346
|
if (typeof p == "number" && Fe && !Fe.has(u) && (Fe.add(u), console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (typeof l == "number" || typeof h == "number") && ke && !ke.has(u) && (ke.add(u), console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (i != null || c != null) && We && !We.has(u) && (We.add(u), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")), r == null)
|
|
1346
1347
|
throw Error('An invalid "children" prop has been specified. Value should be a React component. ' + ('"' + (r === null ? "null" : typeof r) + '" was specified.'));
|
|
@@ -1353,63 +1354,63 @@ var bo = function(t, n) {
|
|
|
1353
1354
|
}
|
|
1354
1355
|
if (typeof m != "number")
|
|
1355
1356
|
throw Error('An invalid "width" prop has been specified. Grids must specify a number for width. ' + ('"' + (m === null ? "null" : typeof m) + '" was specified.'));
|
|
1356
|
-
if (typeof
|
|
1357
|
-
throw Error('An invalid "height" prop has been specified. Grids must specify a number for height. ' + ('"' + (
|
|
1357
|
+
if (typeof s != "number")
|
|
1358
|
+
throw Error('An invalid "height" prop has been specified. Grids must specify a number for height. ' + ('"' + (s === null ? "null" : typeof s) + '" was specified.'));
|
|
1358
1359
|
}
|
|
1359
|
-
}, Ht = 50,
|
|
1360
|
-
var r = t.rowCount, o = n.rowMetadataMap,
|
|
1360
|
+
}, Ht = 50, vn = function(t, n) {
|
|
1361
|
+
var r = t.rowCount, o = n.rowMetadataMap, s = n.estimatedRowHeight, i = n.lastMeasuredRowIndex, c = 0;
|
|
1361
1362
|
if (i >= r && (i = r - 1), i >= 0) {
|
|
1362
1363
|
var l = o[i];
|
|
1363
1364
|
c = l.offset + l.size;
|
|
1364
1365
|
}
|
|
1365
|
-
var p = r - i - 1, h = p *
|
|
1366
|
+
var p = r - i - 1, h = p * s;
|
|
1366
1367
|
return c + h;
|
|
1367
|
-
},
|
|
1368
|
-
var r = t.columnCount, o = n.columnMetadataMap,
|
|
1368
|
+
}, _n = function(t, n) {
|
|
1369
|
+
var r = t.columnCount, o = n.columnMetadataMap, s = n.estimatedColumnWidth, i = n.lastMeasuredColumnIndex, c = 0;
|
|
1369
1370
|
if (i >= r && (i = r - 1), i >= 0) {
|
|
1370
1371
|
var l = o[i];
|
|
1371
1372
|
c = l.offset + l.size;
|
|
1372
1373
|
}
|
|
1373
|
-
var p = r - i - 1, h = p *
|
|
1374
|
+
var p = r - i - 1, h = p * s;
|
|
1374
1375
|
return c + h;
|
|
1375
|
-
},
|
|
1376
|
-
var
|
|
1377
|
-
if (t === "column" ? (
|
|
1376
|
+
}, me = function(t, n, r, o) {
|
|
1377
|
+
var s, i, c;
|
|
1378
|
+
if (t === "column" ? (s = o.columnMetadataMap, i = n.columnWidth, c = o.lastMeasuredColumnIndex) : (s = o.rowMetadataMap, i = n.rowHeight, c = o.lastMeasuredRowIndex), r > c) {
|
|
1378
1379
|
var l = 0;
|
|
1379
1380
|
if (c >= 0) {
|
|
1380
|
-
var p =
|
|
1381
|
+
var p = s[c];
|
|
1381
1382
|
l = p.offset + p.size;
|
|
1382
1383
|
}
|
|
1383
1384
|
for (var h = c + 1; h <= r; h++) {
|
|
1384
1385
|
var m = i(h);
|
|
1385
|
-
|
|
1386
|
+
s[h] = {
|
|
1386
1387
|
offset: l,
|
|
1387
1388
|
size: m
|
|
1388
1389
|
}, l += m;
|
|
1389
1390
|
}
|
|
1390
1391
|
t === "column" ? o.lastMeasuredColumnIndex = r : o.lastMeasuredRowIndex = r;
|
|
1391
1392
|
}
|
|
1392
|
-
return
|
|
1393
|
+
return s[r];
|
|
1393
1394
|
}, $t = function(t, n, r, o) {
|
|
1394
|
-
var
|
|
1395
|
-
t === "column" ? (
|
|
1396
|
-
var c = i > 0 ?
|
|
1397
|
-
return c >= o ?
|
|
1398
|
-
},
|
|
1399
|
-
for (;
|
|
1400
|
-
var c =
|
|
1395
|
+
var s, i;
|
|
1396
|
+
t === "column" ? (s = r.columnMetadataMap, i = r.lastMeasuredColumnIndex) : (s = r.rowMetadataMap, i = r.lastMeasuredRowIndex);
|
|
1397
|
+
var c = i > 0 ? s[i].offset : 0;
|
|
1398
|
+
return c >= o ? wn(t, n, r, i, 0, o) : Co(t, n, r, Math.max(0, i), o);
|
|
1399
|
+
}, wn = function(t, n, r, o, s, i) {
|
|
1400
|
+
for (; s <= o; ) {
|
|
1401
|
+
var c = s + Math.floor((o - s) / 2), l = me(t, n, c, r).offset;
|
|
1401
1402
|
if (l === i)
|
|
1402
1403
|
return c;
|
|
1403
|
-
l < i ?
|
|
1404
|
+
l < i ? s = c + 1 : l > i && (o = c - 1);
|
|
1404
1405
|
}
|
|
1405
|
-
return
|
|
1406
|
-
}, Co = function(t, n, r, o,
|
|
1407
|
-
for (var i = t === "column" ? n.columnCount : n.rowCount, c = 1; o < i &&
|
|
1406
|
+
return s > 0 ? s - 1 : 0;
|
|
1407
|
+
}, Co = function(t, n, r, o, s) {
|
|
1408
|
+
for (var i = t === "column" ? n.columnCount : n.rowCount, c = 1; o < i && me(t, n, o, r).offset < s; )
|
|
1408
1409
|
o += c, c *= 2;
|
|
1409
|
-
return
|
|
1410
|
-
}, Gt = function(t, n, r, o,
|
|
1411
|
-
var l = t === "column" ? n.width : n.height, p =
|
|
1412
|
-
switch (o === "smart" && (
|
|
1410
|
+
return wn(t, n, r, Math.min(o, i - 1), Math.floor(o / 2), s);
|
|
1411
|
+
}, Gt = function(t, n, r, o, s, i, c) {
|
|
1412
|
+
var l = t === "column" ? n.width : n.height, p = me(t, n, r, i), h = t === "column" ? _n(n, i) : vn(n, i), m = Math.max(0, Math.min(h - l, p.offset)), u = Math.max(0, p.offset - l + c + p.size);
|
|
1413
|
+
switch (o === "smart" && (s >= u - l && s <= m + l ? o = "auto" : o = "center"), o) {
|
|
1413
1414
|
case "start":
|
|
1414
1415
|
return m;
|
|
1415
1416
|
case "end":
|
|
@@ -1418,33 +1419,33 @@ var bo = function(t, n) {
|
|
|
1418
1419
|
return Math.round(u + (m - u) / 2);
|
|
1419
1420
|
case "auto":
|
|
1420
1421
|
default:
|
|
1421
|
-
return
|
|
1422
|
+
return s >= u && s <= m ? s : u > m || s < u ? u : m;
|
|
1422
1423
|
}
|
|
1423
1424
|
}, To = /* @__PURE__ */ wo({
|
|
1424
1425
|
getColumnOffset: function(t, n, r) {
|
|
1425
|
-
return
|
|
1426
|
+
return me("column", t, n, r).offset;
|
|
1426
1427
|
},
|
|
1427
1428
|
getColumnStartIndexForOffset: function(t, n, r) {
|
|
1428
1429
|
return $t("column", t, r, n);
|
|
1429
1430
|
},
|
|
1430
1431
|
getColumnStopIndexForStartIndex: function(t, n, r, o) {
|
|
1431
|
-
for (var
|
|
1432
|
-
h++, p +=
|
|
1432
|
+
for (var s = t.columnCount, i = t.width, c = me("column", t, n, o), l = r + i, p = c.offset + c.size, h = n; h < s - 1 && p < l; )
|
|
1433
|
+
h++, p += me("column", t, h, o).size;
|
|
1433
1434
|
return h;
|
|
1434
1435
|
},
|
|
1435
1436
|
getColumnWidth: function(t, n, r) {
|
|
1436
1437
|
return r.columnMetadataMap[n].size;
|
|
1437
1438
|
},
|
|
1438
|
-
getEstimatedTotalHeight:
|
|
1439
|
-
getEstimatedTotalWidth:
|
|
1440
|
-
getOffsetForColumnAndAlignment: function(t, n, r, o,
|
|
1441
|
-
return Gt("column", t, n, r, o,
|
|
1439
|
+
getEstimatedTotalHeight: vn,
|
|
1440
|
+
getEstimatedTotalWidth: _n,
|
|
1441
|
+
getOffsetForColumnAndAlignment: function(t, n, r, o, s, i) {
|
|
1442
|
+
return Gt("column", t, n, r, o, s, i);
|
|
1442
1443
|
},
|
|
1443
|
-
getOffsetForRowAndAlignment: function(t, n, r, o,
|
|
1444
|
-
return Gt("row", t, n, r, o,
|
|
1444
|
+
getOffsetForRowAndAlignment: function(t, n, r, o, s, i) {
|
|
1445
|
+
return Gt("row", t, n, r, o, s, i);
|
|
1445
1446
|
},
|
|
1446
1447
|
getRowOffset: function(t, n, r) {
|
|
1447
|
-
return
|
|
1448
|
+
return me("row", t, n, r).offset;
|
|
1448
1449
|
},
|
|
1449
1450
|
getRowHeight: function(t, n, r) {
|
|
1450
1451
|
return r.rowMetadataMap[n].size;
|
|
@@ -1453,15 +1454,15 @@ var bo = function(t, n) {
|
|
|
1453
1454
|
return $t("row", t, r, n);
|
|
1454
1455
|
},
|
|
1455
1456
|
getRowStopIndexForStartIndex: function(t, n, r, o) {
|
|
1456
|
-
for (var
|
|
1457
|
-
h++, p +=
|
|
1457
|
+
for (var s = t.rowCount, i = t.height, c = me("row", t, n, o), l = r + i, p = c.offset + c.size, h = n; h < s - 1 && p < l; )
|
|
1458
|
+
h++, p += me("row", t, h, o).size;
|
|
1458
1459
|
return h;
|
|
1459
1460
|
},
|
|
1460
1461
|
initInstanceProps: function(t, n) {
|
|
1461
|
-
var r = t, o = r.estimatedColumnWidth,
|
|
1462
|
+
var r = t, o = r.estimatedColumnWidth, s = r.estimatedRowHeight, i = {
|
|
1462
1463
|
columnMetadataMap: {},
|
|
1463
1464
|
estimatedColumnWidth: o || Ht,
|
|
1464
|
-
estimatedRowHeight:
|
|
1465
|
+
estimatedRowHeight: s || Ht,
|
|
1465
1466
|
lastMeasuredColumnIndex: -1,
|
|
1466
1467
|
lastMeasuredRowIndex: -1,
|
|
1467
1468
|
rowMetadataMap: {}
|
|
@@ -1502,78 +1503,78 @@ function Vt(e, t) {
|
|
|
1502
1503
|
return !0;
|
|
1503
1504
|
return !1;
|
|
1504
1505
|
}
|
|
1505
|
-
var
|
|
1506
|
+
var Po = ["style"], So = ["style"];
|
|
1506
1507
|
function Io(e, t) {
|
|
1507
|
-
var n = e.style, r = zt(e,
|
|
1508
|
-
return !Vt(n, o) && !Vt(r,
|
|
1508
|
+
var n = e.style, r = zt(e, Po), o = t.style, s = zt(t, So);
|
|
1509
|
+
return !Vt(n, o) && !Vt(r, s);
|
|
1509
1510
|
}
|
|
1510
1511
|
const yo = () => {
|
|
1511
|
-
const { viewMode: e } = Ke(), { scrollMode: t } =
|
|
1512
|
+
const { viewMode: e } = Ke(), { scrollMode: t } = Le(), { setColumnCount: n } = Jt(), { virtualScrollableElementRef: r } = Xe(), o = en(), s = R(
|
|
1512
1513
|
(g) => o.widths[g] || 0,
|
|
1513
1514
|
[o.widths]
|
|
1514
1515
|
), i = R(
|
|
1515
1516
|
(g) => o.heights[g] || 0,
|
|
1516
1517
|
[o.heights]
|
|
1517
|
-
), c = z(() => o.heights.length, [o.heights]), l = z(() => Math.max(...o.widths), [o.widths]), p = z(() => t ===
|
|
1518
|
+
), c = z(() => o.heights.length, [o.heights]), l = z(() => Math.max(...o.widths), [o.widths]), p = z(() => t === X.HORIZONTAL_SCROLLING ? c : e === $e.DUAL_PAGE ? 2 : 1, [e, t, t, c, r, l]);
|
|
1518
1519
|
E(() => {
|
|
1519
1520
|
n(p);
|
|
1520
1521
|
}, [p, n]);
|
|
1521
|
-
const h = z(() => t ===
|
|
1522
|
+
const h = z(() => t === X.HORIZONTAL_SCROLLING || t === X.PAGE_SCROLLING ? 1 : Math.round(c / p), [p, c, t]), m = z(() => o.heights.reduce((g, f) => g + f, 0) / o.heights.length || 0, [o]), u = z(() => o.widths.reduce((g, f) => g + f, 0) / o.heights.length || 0, [o]);
|
|
1522
1523
|
return {
|
|
1523
1524
|
rowCount: h,
|
|
1524
1525
|
rowHeight: i,
|
|
1525
1526
|
columnCount: p,
|
|
1526
|
-
columnWidth:
|
|
1527
|
+
columnWidth: s,
|
|
1527
1528
|
pageDimension: o,
|
|
1528
1529
|
estimatedRowHeight: m,
|
|
1529
1530
|
estimatedColumnWidth: u
|
|
1530
1531
|
};
|
|
1531
1532
|
};
|
|
1532
|
-
let
|
|
1533
|
-
typeof window < "u" ?
|
|
1533
|
+
let re;
|
|
1534
|
+
typeof window < "u" ? re = window : typeof self < "u" ? re = self : re = global;
|
|
1534
1535
|
let ft = null, gt = null;
|
|
1535
|
-
const Ut = 20, ot =
|
|
1536
|
-
|
|
1536
|
+
const Ut = 20, ot = re.clearTimeout, qt = re.setTimeout, st = re.cancelAnimationFrame || re.mozCancelAnimationFrame || re.webkitCancelAnimationFrame, jt = re.requestAnimationFrame || re.mozRequestAnimationFrame || re.webkitRequestAnimationFrame;
|
|
1537
|
+
st == null || jt == null ? (ft = ot, gt = function(t) {
|
|
1537
1538
|
return qt(t, Ut);
|
|
1538
1539
|
}) : (ft = function([t, n]) {
|
|
1539
|
-
|
|
1540
|
+
st(t), ot(n);
|
|
1540
1541
|
}, gt = function(t) {
|
|
1541
1542
|
const n = jt(function() {
|
|
1542
1543
|
ot(r), t();
|
|
1543
1544
|
}), r = qt(function() {
|
|
1544
|
-
|
|
1545
|
+
st(n), t();
|
|
1545
1546
|
}, Ut);
|
|
1546
1547
|
return [n, r];
|
|
1547
1548
|
});
|
|
1548
1549
|
function xo(e) {
|
|
1549
|
-
let t, n, r, o,
|
|
1550
|
+
let t, n, r, o, s, i, c;
|
|
1550
1551
|
const l = typeof document < "u" && document.attachEvent;
|
|
1551
1552
|
if (!l) {
|
|
1552
|
-
i = function(
|
|
1553
|
-
const
|
|
1554
|
-
y.scrollLeft = y.scrollWidth, y.scrollTop = y.scrollHeight, d.style.width =
|
|
1555
|
-
},
|
|
1556
|
-
return
|
|
1557
|
-
}, c = function(
|
|
1558
|
-
if (
|
|
1553
|
+
i = function(b) {
|
|
1554
|
+
const P = b.__resizeTriggers__, C = P.firstElementChild, y = P.lastElementChild, d = C.firstElementChild;
|
|
1555
|
+
y.scrollLeft = y.scrollWidth, y.scrollTop = y.scrollHeight, d.style.width = C.offsetWidth + 1 + "px", d.style.height = C.offsetHeight + 1 + "px", C.scrollLeft = C.scrollWidth, C.scrollTop = C.scrollHeight;
|
|
1556
|
+
}, s = function(b) {
|
|
1557
|
+
return b.offsetWidth !== b.__resizeLast__.width || b.offsetHeight !== b.__resizeLast__.height;
|
|
1558
|
+
}, c = function(b) {
|
|
1559
|
+
if (b.target.className && typeof b.target.className.indexOf == "function" && b.target.className.indexOf("contract-trigger") < 0 && b.target.className.indexOf("expand-trigger") < 0)
|
|
1559
1560
|
return;
|
|
1560
|
-
const
|
|
1561
|
+
const P = this;
|
|
1561
1562
|
i(this), this.__resizeRAF__ && ft(this.__resizeRAF__), this.__resizeRAF__ = gt(function() {
|
|
1562
|
-
|
|
1563
|
-
d.call(
|
|
1563
|
+
s(P) && (P.__resizeLast__.width = P.offsetWidth, P.__resizeLast__.height = P.offsetHeight, P.__resizeListeners__.forEach(function(d) {
|
|
1564
|
+
d.call(P, b);
|
|
1564
1565
|
}));
|
|
1565
1566
|
});
|
|
1566
1567
|
};
|
|
1567
1568
|
let u = !1, g = "";
|
|
1568
1569
|
r = "animationstart";
|
|
1569
1570
|
const f = "Webkit Moz O ms".split(" ");
|
|
1570
|
-
let
|
|
1571
|
+
let w = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "), v = "";
|
|
1571
1572
|
{
|
|
1572
|
-
const
|
|
1573
|
-
if (
|
|
1574
|
-
for (let
|
|
1575
|
-
if (
|
|
1576
|
-
v = f[
|
|
1573
|
+
const b = document.createElement("fakeelement");
|
|
1574
|
+
if (b.style.animationName !== void 0 && (u = !0), u === !1) {
|
|
1575
|
+
for (let P = 0; P < f.length; P++)
|
|
1576
|
+
if (b.style[f[P] + "AnimationName"] !== void 0) {
|
|
1577
|
+
v = f[P], g = "-" + v.toLowerCase() + "-", r = w[P], u = !0;
|
|
1577
1578
|
break;
|
|
1578
1579
|
}
|
|
1579
1580
|
}
|
|
@@ -1582,8 +1583,8 @@ function xo(e) {
|
|
|
1582
1583
|
}
|
|
1583
1584
|
const p = function(u) {
|
|
1584
1585
|
if (!u.getElementById("detectElementResize")) {
|
|
1585
|
-
const g = (t || "") + ".resize-triggers { " + (o || "") + 'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }', f = u.head || u.getElementsByTagName("head")[0],
|
|
1586
|
-
|
|
1586
|
+
const g = (t || "") + ".resize-triggers { " + (o || "") + 'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }', f = u.head || u.getElementsByTagName("head")[0], w = u.createElement("style");
|
|
1587
|
+
w.id = "detectElementResize", w.type = "text/css", e != null && w.setAttribute("nonce", e), w.styleSheet ? w.styleSheet.cssText = g : w.appendChild(u.createTextNode(g)), f.appendChild(w);
|
|
1587
1588
|
}
|
|
1588
1589
|
};
|
|
1589
1590
|
return {
|
|
@@ -1592,13 +1593,13 @@ function xo(e) {
|
|
|
1592
1593
|
u.attachEvent("onresize", g);
|
|
1593
1594
|
else {
|
|
1594
1595
|
if (!u.__resizeTriggers__) {
|
|
1595
|
-
const f = u.ownerDocument,
|
|
1596
|
-
|
|
1596
|
+
const f = u.ownerDocument, w = re.getComputedStyle(u);
|
|
1597
|
+
w && w.position === "static" && (u.style.position = "relative"), p(f), u.__resizeLast__ = {}, u.__resizeListeners__ = [], (u.__resizeTriggers__ = f.createElement("div")).className = "resize-triggers";
|
|
1597
1598
|
const v = f.createElement("div");
|
|
1598
1599
|
v.className = "expand-trigger", v.appendChild(f.createElement("div"));
|
|
1599
|
-
const
|
|
1600
|
-
|
|
1601
|
-
|
|
1600
|
+
const b = f.createElement("div");
|
|
1601
|
+
b.className = "contract-trigger", u.__resizeTriggers__.appendChild(v), u.__resizeTriggers__.appendChild(b), u.appendChild(u.__resizeTriggers__), i(u), u.addEventListener("scroll", c, !0), r && (u.__resizeTriggers__.__animationListener__ = function(C) {
|
|
1602
|
+
C.animationName === n && i(u);
|
|
1602
1603
|
}, u.__resizeTriggers__.addEventListener(r, u.__resizeTriggers__.__animationListener__));
|
|
1603
1604
|
}
|
|
1604
1605
|
u.__resizeListeners__.push(g);
|
|
@@ -1617,7 +1618,7 @@ function xo(e) {
|
|
|
1617
1618
|
}
|
|
1618
1619
|
};
|
|
1619
1620
|
}
|
|
1620
|
-
class Ro extends
|
|
1621
|
+
class Ro extends Zn {
|
|
1621
1622
|
constructor(...t) {
|
|
1622
1623
|
super(...t), this.state = {
|
|
1623
1624
|
height: this.props.defaultHeight || 0,
|
|
@@ -1632,7 +1633,7 @@ class Ro extends Bn {
|
|
|
1632
1633
|
onResize: o
|
|
1633
1634
|
} = this.props;
|
|
1634
1635
|
if (this._parentNode) {
|
|
1635
|
-
const
|
|
1636
|
+
const s = window.getComputedStyle(this._parentNode) || {}, i = parseFloat(s.paddingLeft || "0"), c = parseFloat(s.paddingRight || "0"), l = parseFloat(s.paddingTop || "0"), p = parseFloat(s.paddingBottom || "0"), h = this._parentNode.getBoundingClientRect(), m = h.height - l - p, u = h.width - i - c, g = this._parentNode.offsetHeight - l - p, f = this._parentNode.offsetWidth - i - c;
|
|
1636
1637
|
(!n && (this.state.height !== g || this.state.scaledHeight !== m) || !r && (this.state.width !== f || this.state.scaledWidth !== u)) && (this.setState({
|
|
1637
1638
|
height: g,
|
|
1638
1639
|
width: f,
|
|
@@ -1670,7 +1671,7 @@ class Ro extends Bn {
|
|
|
1670
1671
|
defaultHeight: n,
|
|
1671
1672
|
defaultWidth: r,
|
|
1672
1673
|
disableHeight: o = !1,
|
|
1673
|
-
disableWidth:
|
|
1674
|
+
disableWidth: s = !1,
|
|
1674
1675
|
doNotBailOutOnEmptyChildren: i = !1,
|
|
1675
1676
|
nonce: c,
|
|
1676
1677
|
onResize: l,
|
|
@@ -1681,23 +1682,23 @@ class Ro extends Bn {
|
|
|
1681
1682
|
height: u,
|
|
1682
1683
|
scaledHeight: g,
|
|
1683
1684
|
scaledWidth: f,
|
|
1684
|
-
width:
|
|
1685
|
+
width: w
|
|
1685
1686
|
} = this.state, v = {
|
|
1686
1687
|
overflow: "visible"
|
|
1687
|
-
},
|
|
1688
|
-
let
|
|
1689
|
-
return o || (u === 0 && (
|
|
1688
|
+
}, b = {};
|
|
1689
|
+
let P = !1;
|
|
1690
|
+
return o || (u === 0 && (P = !0), v.height = 0, b.height = u, b.scaledHeight = g), s || (w === 0 && (P = !0), v.width = 0, b.width = w, b.scaledWidth = f), i && (P = !1), ze(h, {
|
|
1690
1691
|
ref: this._setRef,
|
|
1691
1692
|
style: {
|
|
1692
1693
|
...v,
|
|
1693
1694
|
...p
|
|
1694
1695
|
},
|
|
1695
1696
|
...m
|
|
1696
|
-
}, !
|
|
1697
|
+
}, !P && t(b));
|
|
1697
1698
|
}
|
|
1698
1699
|
}
|
|
1699
1700
|
const Lo = ({ widths: e, heights: t }) => {
|
|
1700
|
-
const { focusedPage: n, totalPages: r } =
|
|
1701
|
+
const { focusedPage: n, totalPages: r } = oe(), { isScrolling: o } = Je(), s = z(() => {
|
|
1701
1702
|
const l = [], p = Math.ceil(n / 2) * 2 - 1;
|
|
1702
1703
|
if (l.push(p), p + 1 < r) {
|
|
1703
1704
|
const h = p + 1;
|
|
@@ -1718,15 +1719,15 @@ const Lo = ({ widths: e, heights: t }) => {
|
|
|
1718
1719
|
width: e(n),
|
|
1719
1720
|
height: t(n)
|
|
1720
1721
|
}
|
|
1721
|
-
], [e, t,
|
|
1722
|
+
], [e, t, s]);
|
|
1722
1723
|
E(() => {
|
|
1723
1724
|
o.current = !1;
|
|
1724
1725
|
}, [n]);
|
|
1725
1726
|
const c = z(() => i.reduce((l, p) => l + Number(p.width || 0), 0), [i]);
|
|
1726
|
-
return /* @__PURE__ */
|
|
1727
|
+
return /* @__PURE__ */ a("div", { style: { width: c, position: "relative" }, children: s.map((l, p) => /* @__PURE__ */ a(Tt, { onIntersectRatioChange: () => {
|
|
1727
1728
|
}, style: i[p], pageNumber: l }, l)) });
|
|
1728
1729
|
}, No = ({ widths: e, heights: t }) => {
|
|
1729
|
-
const { focusedPage: n } =
|
|
1730
|
+
const { focusedPage: n } = oe(), { isScrolling: r } = Je(), o = z(() => ({
|
|
1730
1731
|
position: "absolute",
|
|
1731
1732
|
width: e(n - 1),
|
|
1732
1733
|
height: t(n - 1)
|
|
@@ -1734,15 +1735,15 @@ const Lo = ({ widths: e, heights: t }) => {
|
|
|
1734
1735
|
E(() => {
|
|
1735
1736
|
r.current = !1;
|
|
1736
1737
|
}, [n]);
|
|
1737
|
-
const
|
|
1738
|
-
return /* @__PURE__ */
|
|
1738
|
+
const s = z(() => e(n - 1), [e]);
|
|
1739
|
+
return /* @__PURE__ */ a(
|
|
1739
1740
|
"div",
|
|
1740
1741
|
{
|
|
1741
1742
|
style: {
|
|
1742
|
-
width:
|
|
1743
|
+
width: s,
|
|
1743
1744
|
position: "relative"
|
|
1744
1745
|
},
|
|
1745
|
-
children: /* @__PURE__ */
|
|
1746
|
+
children: /* @__PURE__ */ a(
|
|
1746
1747
|
Tt,
|
|
1747
1748
|
{
|
|
1748
1749
|
style: o,
|
|
@@ -1754,9 +1755,9 @@ const Lo = ({ widths: e, heights: t }) => {
|
|
|
1754
1755
|
)
|
|
1755
1756
|
}
|
|
1756
1757
|
);
|
|
1757
|
-
}, Mo =
|
|
1758
|
+
}, Mo = Bn(({ columnIndex: e, rowIndex: t, data: n, style: r }) => {
|
|
1758
1759
|
const o = e + 1 + t * n.columnCount;
|
|
1759
|
-
return /* @__PURE__ */
|
|
1760
|
+
return /* @__PURE__ */ a(
|
|
1760
1761
|
Tt,
|
|
1761
1762
|
{
|
|
1762
1763
|
style: r,
|
|
@@ -1766,141 +1767,143 @@ const Lo = ({ widths: e, heights: t }) => {
|
|
|
1766
1767
|
o
|
|
1767
1768
|
);
|
|
1768
1769
|
}, Io), ti = () => {
|
|
1769
|
-
const { initialPage: e = 1, initialScrollMode: t } =
|
|
1770
|
-
|
|
1770
|
+
const { initialPage: e = 1, initialScrollMode: t } = Yn(), { pagesRef: n, setPagesRef: r } = be();
|
|
1771
|
+
vr(n);
|
|
1772
|
+
const { scrollToPage: o } = an(), {
|
|
1773
|
+
virtualScrollRef: s,
|
|
1771
1774
|
getVirtualScrollRef: i,
|
|
1772
1775
|
getPageScrollElementRef: c,
|
|
1773
1776
|
getVirtualScrollableElementRef: l,
|
|
1774
1777
|
setTotalInnerDimensions: p,
|
|
1775
1778
|
totalInnerDimensions: h,
|
|
1776
1779
|
pageScrollElementRef: m
|
|
1777
|
-
} = Xe(), { nextPage: u, prevPage: g, setFocusedPage: f, focusedPage:
|
|
1780
|
+
} = Xe(), { nextPage: u, prevPage: g, setFocusedPage: f, focusedPage: w } = oe(), { scrollMode: v } = Le(), { viewMode: b } = Ke(), P = W(null), { loading: C } = Y(), y = W(
|
|
1778
1781
|
h
|
|
1779
1782
|
), d = W({
|
|
1780
|
-
viewMode:
|
|
1783
|
+
viewMode: b,
|
|
1781
1784
|
scrollMode: v
|
|
1782
|
-
}),
|
|
1785
|
+
}), T = W(!1), _ = W(), { isFullScreen: S } = Qn(), {
|
|
1783
1786
|
pageDimension: A,
|
|
1784
|
-
rowCount:
|
|
1785
|
-
rowHeight:
|
|
1786
|
-
columnCount:
|
|
1787
|
+
rowCount: I,
|
|
1788
|
+
rowHeight: N,
|
|
1789
|
+
columnCount: x,
|
|
1787
1790
|
columnWidth: L,
|
|
1788
|
-
estimatedColumnWidth:
|
|
1791
|
+
estimatedColumnWidth: M,
|
|
1789
1792
|
estimatedRowHeight: D
|
|
1790
|
-
} = yo(), [F,
|
|
1793
|
+
} = yo(), [F, G] = H({}), U = tn(F, 100), { isScrolling: q } = Je(), j = W(), Z = W({
|
|
1791
1794
|
scrollTop: 0,
|
|
1792
1795
|
scrollLeft: 0
|
|
1793
1796
|
});
|
|
1794
|
-
br(
|
|
1795
|
-
const { isPressed:
|
|
1796
|
-
isPressed:
|
|
1797
|
-
}),
|
|
1798
|
-
|
|
1799
|
-
}, []),
|
|
1800
|
-
columnCount:
|
|
1801
|
-
handleIntersectRatioChange:
|
|
1802
|
-
}), [
|
|
1797
|
+
br(n);
|
|
1798
|
+
const { isPressed: B } = _r(), { selectionMode: le } = Jn(), { initializeGrabScroll: ue, resetGrabState: ee } = wr({
|
|
1799
|
+
isPressed: B
|
|
1800
|
+
}), K = z(() => le === Kn.HAND, [le]), ae = R((k, $) => {
|
|
1801
|
+
G((J) => $ > -1 ? { ...J, [k]: Math.round($ * 100) } : (delete J[k], J));
|
|
1802
|
+
}, []), Te = z(() => ({
|
|
1803
|
+
columnCount: x,
|
|
1804
|
+
handleIntersectRatioChange: ae
|
|
1805
|
+
}), [x, ae]), ve = R(
|
|
1803
1806
|
(k) => {
|
|
1804
|
-
const
|
|
1805
|
-
!
|
|
1807
|
+
const $ = document.activeElement !== n;
|
|
1808
|
+
!S && $ || (["ArrowUp", "ArrowLeft"].includes(k.key) ? (k.preventDefault(), g()) : ["ArrowDown", "ArrowRight"].includes(k.key) && (k.preventDefault(), u()));
|
|
1806
1809
|
},
|
|
1807
|
-
[u, g,
|
|
1808
|
-
),
|
|
1810
|
+
[u, g, S, v]
|
|
1811
|
+
), Pe = R((k) => {
|
|
1809
1812
|
Z.current = {
|
|
1810
1813
|
scrollTop: k.scrollTop,
|
|
1811
1814
|
scrollLeft: k.scrollLeft
|
|
1812
1815
|
};
|
|
1813
1816
|
}, []);
|
|
1814
|
-
E(() => (window.addEventListener("keydown",
|
|
1815
|
-
window.removeEventListener("keydown",
|
|
1816
|
-
}), [
|
|
1817
|
-
if (
|
|
1817
|
+
E(() => (window.addEventListener("keydown", ve), () => {
|
|
1818
|
+
window.removeEventListener("keydown", ve);
|
|
1819
|
+
}), [ve]), E(() => {
|
|
1820
|
+
if (P.current && (P.current.style.position = "relative"), !!s) {
|
|
1818
1821
|
y.current = {
|
|
1819
1822
|
height: h.height,
|
|
1820
1823
|
width: h.width
|
|
1821
1824
|
}, p({
|
|
1822
|
-
height: Array.from({ length:
|
|
1823
|
-
(k,
|
|
1825
|
+
height: Array.from({ length: I }).reduce(
|
|
1826
|
+
(k, $, J) => k + N(J),
|
|
1824
1827
|
0
|
|
1825
1828
|
),
|
|
1826
|
-
width: Array.from({ length:
|
|
1827
|
-
(k,
|
|
1829
|
+
width: Array.from({ length: x }).reduce(
|
|
1830
|
+
(k, $, J) => k + L(J),
|
|
1828
1831
|
0
|
|
1829
1832
|
)
|
|
1830
1833
|
});
|
|
1831
|
-
for (let k = 0; k <
|
|
1832
|
-
for (let
|
|
1833
|
-
|
|
1834
|
-
columnIndex:
|
|
1834
|
+
for (let k = 0; k < I; k++)
|
|
1835
|
+
for (let $ = 0; $ < x; $++)
|
|
1836
|
+
s.resetAfterIndices({
|
|
1837
|
+
columnIndex: $,
|
|
1835
1838
|
rowIndex: k,
|
|
1836
1839
|
shouldForceUpdate: !0
|
|
1837
1840
|
});
|
|
1838
1841
|
}
|
|
1839
|
-
}, [
|
|
1840
|
-
if (
|
|
1842
|
+
}, [I, x, A, s, o]), E(() => {
|
|
1843
|
+
if (q.current)
|
|
1841
1844
|
return;
|
|
1842
|
-
if (d.current.viewMode !==
|
|
1843
|
-
|
|
1845
|
+
if (d.current.viewMode !== b || d.current.scrollMode !== v) {
|
|
1846
|
+
j.current && clearTimeout(j.current), G({}), T.current = !0, o(w), v === X.HORIZONTAL_SCROLLING && (s == null || s.scrollTo({
|
|
1844
1847
|
scrollTop: 0
|
|
1845
|
-
})),
|
|
1848
|
+
})), j.current = setTimeout(() => {
|
|
1846
1849
|
requestAnimationFrame(() => {
|
|
1847
|
-
d.current = { viewMode:
|
|
1850
|
+
d.current = { viewMode: b, scrollMode: v };
|
|
1848
1851
|
});
|
|
1849
1852
|
}, 100);
|
|
1850
1853
|
return;
|
|
1851
1854
|
}
|
|
1852
|
-
const
|
|
1855
|
+
const $ = Z.current.scrollTop, J = Z.current.scrollLeft;
|
|
1853
1856
|
if (h.height && h.width) {
|
|
1854
|
-
|
|
1855
|
-
const { height:
|
|
1856
|
-
|
|
1857
|
-
scrollTop:
|
|
1858
|
-
scrollLeft:
|
|
1859
|
-
}),
|
|
1860
|
-
|
|
1857
|
+
T.current = !0;
|
|
1858
|
+
const { height: Se, width: xt } = h, { height: Hn, width: $n } = y.current, Gn = $ / Hn * Se, Vn = J / $n * xt, Un = Math.min(Gn, Se) || 0, qn = Math.min(Vn, xt) || 0;
|
|
1859
|
+
s == null || s.scrollTo({
|
|
1860
|
+
scrollTop: Un,
|
|
1861
|
+
scrollLeft: qn
|
|
1862
|
+
}), _.current && clearTimeout(_.current), _.current = setTimeout(() => {
|
|
1863
|
+
T.current = !1;
|
|
1861
1864
|
}, 100);
|
|
1862
1865
|
}
|
|
1863
|
-
}, [h,
|
|
1864
|
-
if ((
|
|
1866
|
+
}, [h, b, v]), E(() => {
|
|
1867
|
+
if ((q.current || T.current) && (q.current = !1), q.current)
|
|
1865
1868
|
return;
|
|
1866
|
-
const k = Object.entries(
|
|
1867
|
-
let
|
|
1868
|
-
k.forEach((
|
|
1869
|
-
|
|
1870
|
-
}),
|
|
1871
|
-
}, [
|
|
1872
|
-
|
|
1869
|
+
const k = Object.entries(U);
|
|
1870
|
+
let $ = 0, J = -1;
|
|
1871
|
+
k.forEach((Se) => {
|
|
1872
|
+
J < Se[1] && ($ = Number(Se[0]), J = Se[1]);
|
|
1873
|
+
}), $ && f($);
|
|
1874
|
+
}, [U, f]), E(() => () => {
|
|
1875
|
+
j.current && clearTimeout(j.current), _.current && clearTimeout(_.current);
|
|
1873
1876
|
}, []);
|
|
1874
|
-
const
|
|
1875
|
-
[
|
|
1876
|
-
[
|
|
1877
|
-
}), [
|
|
1877
|
+
const de = z(() => te(he["rp-pages-container"], {
|
|
1878
|
+
[he["rp-cursor-grab"]]: K && !B,
|
|
1879
|
+
[he["rp-cursor-grabbing"]]: K && B
|
|
1880
|
+
}), [K, B]), pe = R(
|
|
1878
1881
|
(k) => {
|
|
1879
|
-
if (
|
|
1880
|
-
const
|
|
1881
|
-
|
|
1882
|
+
if (K && k) {
|
|
1883
|
+
const $ = te(he["rp-pages"]), J = document.querySelector(`.${$}`);
|
|
1884
|
+
ue(J);
|
|
1882
1885
|
}
|
|
1883
1886
|
},
|
|
1884
|
-
[
|
|
1887
|
+
[K, ue, he]
|
|
1885
1888
|
);
|
|
1886
1889
|
return E(() => {
|
|
1887
|
-
|
|
1888
|
-
}, [
|
|
1889
|
-
if (t ===
|
|
1890
|
-
e !==
|
|
1890
|
+
C && ee();
|
|
1891
|
+
}, [C]), E(() => {
|
|
1892
|
+
if (t === X.PAGE_SCROLLING) {
|
|
1893
|
+
e !== w && m && f(e);
|
|
1891
1894
|
return;
|
|
1892
1895
|
}
|
|
1893
|
-
if (
|
|
1896
|
+
if (s != null && s.scrollToItem) {
|
|
1894
1897
|
switch (t) {
|
|
1895
|
-
case
|
|
1896
|
-
|
|
1898
|
+
case X.HORIZONTAL_SCROLLING:
|
|
1899
|
+
s.scrollToItem({
|
|
1897
1900
|
columnIndex: e - 1,
|
|
1898
1901
|
rowIndex: 0,
|
|
1899
1902
|
align: "start"
|
|
1900
1903
|
});
|
|
1901
1904
|
break;
|
|
1902
1905
|
default:
|
|
1903
|
-
|
|
1906
|
+
s.scrollToItem({
|
|
1904
1907
|
columnIndex: 0,
|
|
1905
1908
|
rowIndex: e - 1,
|
|
1906
1909
|
align: "start"
|
|
@@ -1909,37 +1912,37 @@ const Lo = ({ widths: e, heights: t }) => {
|
|
|
1909
1912
|
}
|
|
1910
1913
|
f(e);
|
|
1911
1914
|
}
|
|
1912
|
-
}, [
|
|
1915
|
+
}, [s, t, m, f]), /* @__PURE__ */ a("div", { ref: r, tabIndex: -1, className: de, children: /* @__PURE__ */ a(Ro, { children: ({ width: k, height: $ }) => /* @__PURE__ */ a("div", { "data-rp": "pages", ref: pe, style: { width: k, height: $ }, children: v === X.PAGE_SCROLLING ? /* @__PURE__ */ a(
|
|
1913
1916
|
"div",
|
|
1914
1917
|
{
|
|
1915
1918
|
ref: c,
|
|
1916
|
-
style: { width: k, height:
|
|
1917
|
-
className:
|
|
1918
|
-
children:
|
|
1919
|
+
style: { width: k, height: $ },
|
|
1920
|
+
className: te(he["rp-pages"], he["rp-page-scrolling-wrapper"]),
|
|
1921
|
+
children: b === $e.DUAL_PAGE ? /* @__PURE__ */ a(Lo, { widths: L, heights: N }) : /* @__PURE__ */ a(No, { widths: L, heights: N })
|
|
1919
1922
|
}
|
|
1920
|
-
) :
|
|
1923
|
+
) : M ? /* @__PURE__ */ a(
|
|
1921
1924
|
To,
|
|
1922
1925
|
{
|
|
1923
1926
|
ref: i,
|
|
1924
|
-
itemData:
|
|
1927
|
+
itemData: Te,
|
|
1925
1928
|
outerRef: l,
|
|
1926
|
-
innerRef:
|
|
1927
|
-
onScroll:
|
|
1928
|
-
columnCount:
|
|
1929
|
+
innerRef: P,
|
|
1930
|
+
onScroll: Pe,
|
|
1931
|
+
columnCount: x,
|
|
1929
1932
|
columnWidth: L,
|
|
1930
|
-
rowHeight:
|
|
1931
|
-
height:
|
|
1933
|
+
rowHeight: N,
|
|
1934
|
+
height: $,
|
|
1932
1935
|
width: k,
|
|
1933
|
-
estimatedColumnWidth:
|
|
1936
|
+
estimatedColumnWidth: M,
|
|
1934
1937
|
estimatedRowHeight: D,
|
|
1935
|
-
rowCount:
|
|
1936
|
-
className:
|
|
1937
|
-
|
|
1938
|
-
v ===
|
|
1938
|
+
rowCount: I,
|
|
1939
|
+
className: te(
|
|
1940
|
+
he["rp-pages"],
|
|
1941
|
+
v === X.HORIZONTAL_SCROLLING ? he["rp-pages-horizontal-scroll"] : ""
|
|
1939
1942
|
),
|
|
1940
1943
|
children: Mo
|
|
1941
1944
|
}
|
|
1942
|
-
) :
|
|
1945
|
+
) : C ? null : /* @__PURE__ */ a(
|
|
1943
1946
|
"div",
|
|
1944
1947
|
{
|
|
1945
1948
|
style: {
|
|
@@ -1949,37 +1952,37 @@ const Lo = ({ widths: e, heights: t }) => {
|
|
|
1949
1952
|
height: "100%",
|
|
1950
1953
|
width: "100%"
|
|
1951
1954
|
},
|
|
1952
|
-
children: /* @__PURE__ */
|
|
1955
|
+
children: /* @__PURE__ */ a(De, {})
|
|
1953
1956
|
}
|
|
1954
1957
|
) }) }) });
|
|
1955
|
-
},
|
|
1958
|
+
}, Ne = {
|
|
1956
1959
|
"rp-toolbar-content": "_rp-toolbar-content_1js09_1",
|
|
1957
1960
|
"rp-toolbar-wrapper": "_rp-toolbar-wrapper_1js09_10",
|
|
1958
1961
|
"rp-toolbar-start": "_rp-toolbar-start_1js09_32",
|
|
1959
1962
|
"rp-toolbar-middle": "_rp-toolbar-middle_1js09_38",
|
|
1960
1963
|
"rp-toolbar-end": "_rp-toolbar-end_1js09_45"
|
|
1961
|
-
},
|
|
1964
|
+
}, at = {
|
|
1962
1965
|
"rp-paginate": "_rp-paginate_1vu6o_1",
|
|
1963
1966
|
"rp-page-input": "_rp-page-input_1vu6o_6",
|
|
1964
1967
|
"rp-total-page": "_rp-total-page_1vu6o_12"
|
|
1965
1968
|
}, Eo = () => {
|
|
1966
1969
|
const { prevIcon: e } = ce();
|
|
1967
|
-
return e || /* @__PURE__ */
|
|
1970
|
+
return e || /* @__PURE__ */ a(Oe, {});
|
|
1968
1971
|
}, Oo = () => {
|
|
1969
1972
|
const { nextIcon: e } = ce();
|
|
1970
|
-
return e || /* @__PURE__ */
|
|
1973
|
+
return e || /* @__PURE__ */ a(Oe, { style: { transform: "rotate(180deg" } });
|
|
1971
1974
|
}, Do = () => {
|
|
1972
|
-
const { focusedPage: e, totalPages: t, setFocusedPage: n, nextPage: r, prevPage: o, goToPage:
|
|
1975
|
+
const { focusedPage: e, totalPages: t, setFocusedPage: n, nextPage: r, prevPage: o, goToPage: s } = oe(), [i, c] = H(e.toString()), { pageNavigationTool: l = !0 } = fe(), { isSmallScreen: p } = Ce();
|
|
1973
1976
|
E(() => {
|
|
1974
1977
|
c(e.toString());
|
|
1975
1978
|
}, [e]);
|
|
1976
1979
|
const h = R((f) => {
|
|
1977
|
-
const
|
|
1978
|
-
c(
|
|
1980
|
+
const w = f.target.value;
|
|
1981
|
+
c(w);
|
|
1979
1982
|
}, []), m = R(() => {
|
|
1980
|
-
const f =
|
|
1983
|
+
const f = s(i);
|
|
1981
1984
|
f.success || c(f.currentPage.toString());
|
|
1982
|
-
}, [
|
|
1985
|
+
}, [s, i, t]), u = R(() => {
|
|
1983
1986
|
c(e.toString());
|
|
1984
1987
|
}, [e]), g = R(
|
|
1985
1988
|
(f) => {
|
|
@@ -1987,49 +1990,49 @@ const Lo = ({ widths: e, heights: t }) => {
|
|
|
1987
1990
|
},
|
|
1988
1991
|
[m]
|
|
1989
1992
|
);
|
|
1990
|
-
return typeof l != "boolean" ? /* @__PURE__ */
|
|
1993
|
+
return typeof l != "boolean" ? /* @__PURE__ */ a(
|
|
1991
1994
|
l,
|
|
1992
1995
|
{
|
|
1993
1996
|
total: t,
|
|
1994
1997
|
current: e,
|
|
1995
1998
|
nextPage: r,
|
|
1996
1999
|
prevPage: o,
|
|
1997
|
-
goToPage:
|
|
2000
|
+
goToPage: s,
|
|
1998
2001
|
changePage: n
|
|
1999
2002
|
}
|
|
2000
|
-
) : l ? /* @__PURE__ */ O("div", { className:
|
|
2001
|
-
!p && /* @__PURE__ */
|
|
2002
|
-
/* @__PURE__ */
|
|
2003
|
+
) : l ? /* @__PURE__ */ O("div", { className: at["rp-paginate"], children: [
|
|
2004
|
+
!p && /* @__PURE__ */ a(ne, { content: "Previous page", children: /* @__PURE__ */ a(Q, { onClick: o, disabled: e === 1, children: /* @__PURE__ */ a(Eo, {}) }) }),
|
|
2005
|
+
/* @__PURE__ */ a(
|
|
2003
2006
|
Xt,
|
|
2004
2007
|
{
|
|
2005
2008
|
onKeyDown: g,
|
|
2006
2009
|
onBlur: u,
|
|
2007
2010
|
onChange: h,
|
|
2008
2011
|
value: i,
|
|
2009
|
-
className:
|
|
2012
|
+
className: at["rp-page-input"]
|
|
2010
2013
|
}
|
|
2011
2014
|
),
|
|
2012
|
-
/* @__PURE__ */ O("span", { className:
|
|
2015
|
+
/* @__PURE__ */ O("span", { className: at["rp-total-page"], children: [
|
|
2013
2016
|
"/",
|
|
2014
2017
|
t
|
|
2015
2018
|
] }),
|
|
2016
|
-
!p && /* @__PURE__ */
|
|
2019
|
+
!p && /* @__PURE__ */ a(ne, { content: "Next page", children: /* @__PURE__ */ a(Q, { onClick: r, disabled: e === t, children: /* @__PURE__ */ a(Oo, {}) }) })
|
|
2017
2020
|
] }) : null;
|
|
2018
2021
|
};
|
|
2019
|
-
var
|
|
2022
|
+
var Pt = "Dialog", [bn, ni] = Ir(Pt), [Ao, se] = bn(Pt), Cn = (e) => {
|
|
2020
2023
|
const {
|
|
2021
2024
|
__scopeDialog: t,
|
|
2022
2025
|
children: n,
|
|
2023
2026
|
open: r,
|
|
2024
2027
|
defaultOpen: o,
|
|
2025
|
-
onOpenChange:
|
|
2028
|
+
onOpenChange: s,
|
|
2026
2029
|
modal: i = !0
|
|
2027
|
-
} = e, c =
|
|
2030
|
+
} = e, c = V.useRef(null), l = V.useRef(null), [p = !1, h] = Rr({
|
|
2028
2031
|
prop: r,
|
|
2029
2032
|
defaultProp: o,
|
|
2030
|
-
onChange:
|
|
2033
|
+
onChange: s
|
|
2031
2034
|
});
|
|
2032
|
-
return /* @__PURE__ */
|
|
2035
|
+
return /* @__PURE__ */ a(
|
|
2033
2036
|
Ao,
|
|
2034
2037
|
{
|
|
2035
2038
|
scope: t,
|
|
@@ -2040,18 +2043,18 @@ var St = "Dialog", [Cn, ni] = Ir(St), [Ao, se] = Cn(St), Tn = (e) => {
|
|
|
2040
2043
|
descriptionId: Qe(),
|
|
2041
2044
|
open: p,
|
|
2042
2045
|
onOpenChange: h,
|
|
2043
|
-
onOpenToggle:
|
|
2046
|
+
onOpenToggle: V.useCallback(() => h((m) => !m), [h]),
|
|
2044
2047
|
modal: i,
|
|
2045
2048
|
children: n
|
|
2046
2049
|
}
|
|
2047
2050
|
);
|
|
2048
2051
|
};
|
|
2049
|
-
|
|
2050
|
-
var
|
|
2052
|
+
Cn.displayName = Pt;
|
|
2053
|
+
var Tn = "DialogTrigger", zo = V.forwardRef(
|
|
2051
2054
|
(e, t) => {
|
|
2052
|
-
const { __scopeDialog: n, ...r } = e, o = se(
|
|
2053
|
-
return /* @__PURE__ */
|
|
2054
|
-
|
|
2055
|
+
const { __scopeDialog: n, ...r } = e, o = se(Tn, n), s = _t(t, o.triggerRef);
|
|
2056
|
+
return /* @__PURE__ */ a(
|
|
2057
|
+
Ae.button,
|
|
2055
2058
|
{
|
|
2056
2059
|
type: "button",
|
|
2057
2060
|
"aria-haspopup": "dialog",
|
|
@@ -2059,35 +2062,35 @@ var Sn = "DialogTrigger", zo = U.forwardRef(
|
|
|
2059
2062
|
"aria-controls": o.contentId,
|
|
2060
2063
|
"data-state": yt(o.open),
|
|
2061
2064
|
...r,
|
|
2062
|
-
ref:
|
|
2063
|
-
onClick:
|
|
2065
|
+
ref: s,
|
|
2066
|
+
onClick: Ee(e.onClick, o.onOpenToggle)
|
|
2064
2067
|
}
|
|
2065
2068
|
);
|
|
2066
2069
|
}
|
|
2067
2070
|
);
|
|
2068
|
-
zo.displayName =
|
|
2069
|
-
var
|
|
2071
|
+
zo.displayName = Tn;
|
|
2072
|
+
var St = "DialogPortal", [Fo, Pn] = bn(St, {
|
|
2070
2073
|
forceMount: void 0
|
|
2071
|
-
}),
|
|
2072
|
-
const { __scopeDialog: t, forceMount: n, children: r, container: o } = e,
|
|
2073
|
-
return /* @__PURE__ */
|
|
2074
|
+
}), Sn = (e) => {
|
|
2075
|
+
const { __scopeDialog: t, forceMount: n, children: r, container: o } = e, s = se(St, t);
|
|
2076
|
+
return /* @__PURE__ */ a(Fo, { scope: t, forceMount: n, children: V.Children.map(r, (i) => /* @__PURE__ */ a(wt, { present: n || s.open, children: /* @__PURE__ */ a(Dr, { asChild: !0, container: o, children: i }) })) });
|
|
2074
2077
|
};
|
|
2075
|
-
|
|
2076
|
-
var Ve = "DialogOverlay",
|
|
2078
|
+
Sn.displayName = St;
|
|
2079
|
+
var Ve = "DialogOverlay", In = V.forwardRef(
|
|
2077
2080
|
(e, t) => {
|
|
2078
|
-
const n = Pn(Ve, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e,
|
|
2079
|
-
return
|
|
2081
|
+
const n = Pn(Ve, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, s = se(Ve, e.__scopeDialog);
|
|
2082
|
+
return s.modal ? /* @__PURE__ */ a(wt, { present: r || s.open, children: /* @__PURE__ */ a(ko, { ...o, ref: t }) }) : null;
|
|
2080
2083
|
}
|
|
2081
2084
|
);
|
|
2082
|
-
|
|
2083
|
-
var ko =
|
|
2085
|
+
In.displayName = Ve;
|
|
2086
|
+
var ko = V.forwardRef(
|
|
2084
2087
|
(e, t) => {
|
|
2085
2088
|
const { __scopeDialog: n, ...r } = e, o = se(Ve, n);
|
|
2086
2089
|
return (
|
|
2087
2090
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
2088
2091
|
// ie. when `Overlay` and `Content` are siblings
|
|
2089
|
-
/* @__PURE__ */
|
|
2090
|
-
|
|
2092
|
+
/* @__PURE__ */ a(Nr, { as: yr, allowPinchZoom: !0, shards: [o.contentRef], children: /* @__PURE__ */ a(
|
|
2093
|
+
Ae.div,
|
|
2091
2094
|
{
|
|
2092
2095
|
"data-state": yt(o.open),
|
|
2093
2096
|
...r,
|
|
@@ -2097,78 +2100,78 @@ var ko = U.forwardRef(
|
|
|
2097
2100
|
) })
|
|
2098
2101
|
);
|
|
2099
2102
|
}
|
|
2100
|
-
), we = "DialogContent",
|
|
2103
|
+
), we = "DialogContent", yn = V.forwardRef(
|
|
2101
2104
|
(e, t) => {
|
|
2102
|
-
const n = Pn(we, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e,
|
|
2103
|
-
return /* @__PURE__ */
|
|
2105
|
+
const n = Pn(we, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, s = se(we, e.__scopeDialog);
|
|
2106
|
+
return /* @__PURE__ */ a(wt, { present: r || s.open, children: s.modal ? /* @__PURE__ */ a(Wo, { ...o, ref: t }) : /* @__PURE__ */ a(Ho, { ...o, ref: t }) });
|
|
2104
2107
|
}
|
|
2105
2108
|
);
|
|
2106
|
-
|
|
2107
|
-
var Wo =
|
|
2109
|
+
yn.displayName = we;
|
|
2110
|
+
var Wo = V.forwardRef(
|
|
2108
2111
|
(e, t) => {
|
|
2109
|
-
const n = se(we, e.__scopeDialog), r =
|
|
2110
|
-
return
|
|
2111
|
-
const
|
|
2112
|
-
if (
|
|
2113
|
-
return Mr(
|
|
2114
|
-
}, []), /* @__PURE__ */
|
|
2115
|
-
|
|
2112
|
+
const n = se(we, e.__scopeDialog), r = V.useRef(null), o = _t(t, n.contentRef, r);
|
|
2113
|
+
return V.useEffect(() => {
|
|
2114
|
+
const s = r.current;
|
|
2115
|
+
if (s)
|
|
2116
|
+
return Mr(s);
|
|
2117
|
+
}, []), /* @__PURE__ */ a(
|
|
2118
|
+
xn,
|
|
2116
2119
|
{
|
|
2117
2120
|
...e,
|
|
2118
2121
|
ref: o,
|
|
2119
2122
|
trapFocus: n.open,
|
|
2120
2123
|
disableOutsidePointerEvents: !0,
|
|
2121
|
-
onCloseAutoFocus:
|
|
2124
|
+
onCloseAutoFocus: Ee(e.onCloseAutoFocus, (s) => {
|
|
2122
2125
|
var i;
|
|
2123
|
-
|
|
2126
|
+
s.preventDefault(), (i = n.triggerRef.current) == null || i.focus();
|
|
2124
2127
|
}),
|
|
2125
|
-
onPointerDownOutside:
|
|
2126
|
-
const i =
|
|
2127
|
-
(i.button === 2 || c) &&
|
|
2128
|
+
onPointerDownOutside: Ee(e.onPointerDownOutside, (s) => {
|
|
2129
|
+
const i = s.detail.originalEvent, c = i.button === 0 && i.ctrlKey === !0;
|
|
2130
|
+
(i.button === 2 || c) && s.preventDefault();
|
|
2128
2131
|
}),
|
|
2129
|
-
onFocusOutside:
|
|
2132
|
+
onFocusOutside: Ee(
|
|
2130
2133
|
e.onFocusOutside,
|
|
2131
|
-
(
|
|
2134
|
+
(s) => s.preventDefault()
|
|
2132
2135
|
)
|
|
2133
2136
|
}
|
|
2134
2137
|
);
|
|
2135
2138
|
}
|
|
2136
|
-
), Ho =
|
|
2139
|
+
), Ho = V.forwardRef(
|
|
2137
2140
|
(e, t) => {
|
|
2138
|
-
const n = se(we, e.__scopeDialog), r =
|
|
2139
|
-
return /* @__PURE__ */
|
|
2140
|
-
|
|
2141
|
+
const n = se(we, e.__scopeDialog), r = V.useRef(!1), o = V.useRef(!1);
|
|
2142
|
+
return /* @__PURE__ */ a(
|
|
2143
|
+
xn,
|
|
2141
2144
|
{
|
|
2142
2145
|
...e,
|
|
2143
2146
|
ref: t,
|
|
2144
2147
|
trapFocus: !1,
|
|
2145
2148
|
disableOutsidePointerEvents: !1,
|
|
2146
|
-
onCloseAutoFocus: (
|
|
2149
|
+
onCloseAutoFocus: (s) => {
|
|
2147
2150
|
var i, c;
|
|
2148
|
-
(i = e.onCloseAutoFocus) == null || i.call(e,
|
|
2151
|
+
(i = e.onCloseAutoFocus) == null || i.call(e, s), s.defaultPrevented || (r.current || (c = n.triggerRef.current) == null || c.focus(), s.preventDefault()), r.current = !1, o.current = !1;
|
|
2149
2152
|
},
|
|
2150
|
-
onInteractOutside: (
|
|
2153
|
+
onInteractOutside: (s) => {
|
|
2151
2154
|
var l, p;
|
|
2152
|
-
(l = e.onInteractOutside) == null || l.call(e,
|
|
2153
|
-
const i =
|
|
2154
|
-
((p = n.triggerRef.current) == null ? void 0 : p.contains(i)) &&
|
|
2155
|
+
(l = e.onInteractOutside) == null || l.call(e, s), s.defaultPrevented || (r.current = !0, s.detail.originalEvent.type === "pointerdown" && (o.current = !0));
|
|
2156
|
+
const i = s.target;
|
|
2157
|
+
((p = n.triggerRef.current) == null ? void 0 : p.contains(i)) && s.preventDefault(), s.detail.originalEvent.type === "focusin" && o.current && s.preventDefault();
|
|
2155
2158
|
}
|
|
2156
2159
|
}
|
|
2157
2160
|
);
|
|
2158
2161
|
}
|
|
2159
|
-
),
|
|
2162
|
+
), xn = V.forwardRef(
|
|
2160
2163
|
(e, t) => {
|
|
2161
|
-
const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus:
|
|
2164
|
+
const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: s, ...i } = e, c = se(we, n), l = V.useRef(null), p = _t(t, l);
|
|
2162
2165
|
return Er(), /* @__PURE__ */ O(He, { children: [
|
|
2163
|
-
/* @__PURE__ */
|
|
2166
|
+
/* @__PURE__ */ a(
|
|
2164
2167
|
Or,
|
|
2165
2168
|
{
|
|
2166
2169
|
asChild: !0,
|
|
2167
2170
|
loop: !0,
|
|
2168
2171
|
trapped: r,
|
|
2169
2172
|
onMountAutoFocus: o,
|
|
2170
|
-
onUnmountAutoFocus:
|
|
2171
|
-
children: /* @__PURE__ */
|
|
2173
|
+
onUnmountAutoFocus: s,
|
|
2174
|
+
children: /* @__PURE__ */ a(
|
|
2172
2175
|
Lr,
|
|
2173
2176
|
{
|
|
2174
2177
|
role: "dialog",
|
|
@@ -2184,64 +2187,64 @@ var Wo = U.forwardRef(
|
|
|
2184
2187
|
}
|
|
2185
2188
|
),
|
|
2186
2189
|
/* @__PURE__ */ O(He, { children: [
|
|
2187
|
-
/* @__PURE__ */
|
|
2188
|
-
/* @__PURE__ */
|
|
2190
|
+
/* @__PURE__ */ a(Go, { titleId: c.titleId }),
|
|
2191
|
+
/* @__PURE__ */ a(Uo, { contentRef: l, descriptionId: c.descriptionId })
|
|
2189
2192
|
] })
|
|
2190
2193
|
] });
|
|
2191
2194
|
}
|
|
2192
|
-
), It = "DialogTitle",
|
|
2195
|
+
), It = "DialogTitle", Rn = V.forwardRef(
|
|
2193
2196
|
(e, t) => {
|
|
2194
2197
|
const { __scopeDialog: n, ...r } = e, o = se(It, n);
|
|
2195
|
-
return /* @__PURE__ */
|
|
2198
|
+
return /* @__PURE__ */ a(Ae.h2, { id: o.titleId, ...r, ref: t });
|
|
2196
2199
|
}
|
|
2197
2200
|
);
|
|
2198
|
-
|
|
2199
|
-
var
|
|
2201
|
+
Rn.displayName = It;
|
|
2202
|
+
var Ln = "DialogDescription", $o = V.forwardRef(
|
|
2200
2203
|
(e, t) => {
|
|
2201
|
-
const { __scopeDialog: n, ...r } = e, o = se(
|
|
2202
|
-
return /* @__PURE__ */
|
|
2204
|
+
const { __scopeDialog: n, ...r } = e, o = se(Ln, n);
|
|
2205
|
+
return /* @__PURE__ */ a(Ae.p, { id: o.descriptionId, ...r, ref: t });
|
|
2203
2206
|
}
|
|
2204
2207
|
);
|
|
2205
|
-
$o.displayName =
|
|
2206
|
-
var
|
|
2208
|
+
$o.displayName = Ln;
|
|
2209
|
+
var Nn = "DialogClose", Mn = V.forwardRef(
|
|
2207
2210
|
(e, t) => {
|
|
2208
|
-
const { __scopeDialog: n, ...r } = e, o = se(
|
|
2209
|
-
return /* @__PURE__ */
|
|
2210
|
-
|
|
2211
|
+
const { __scopeDialog: n, ...r } = e, o = se(Nn, n);
|
|
2212
|
+
return /* @__PURE__ */ a(
|
|
2213
|
+
Ae.button,
|
|
2211
2214
|
{
|
|
2212
2215
|
type: "button",
|
|
2213
2216
|
...r,
|
|
2214
2217
|
ref: t,
|
|
2215
|
-
onClick:
|
|
2218
|
+
onClick: Ee(e.onClick, () => o.onOpenChange(!1))
|
|
2216
2219
|
}
|
|
2217
2220
|
);
|
|
2218
2221
|
}
|
|
2219
2222
|
);
|
|
2220
|
-
|
|
2223
|
+
Mn.displayName = Nn;
|
|
2221
2224
|
function yt(e) {
|
|
2222
2225
|
return e ? "open" : "closed";
|
|
2223
2226
|
}
|
|
2224
|
-
var
|
|
2227
|
+
var En = "DialogTitleWarning", [ri, On] = xr(En, {
|
|
2225
2228
|
contentName: we,
|
|
2226
2229
|
titleName: It,
|
|
2227
2230
|
docsSlug: "dialog"
|
|
2228
2231
|
}), Go = ({ titleId: e }) => {
|
|
2229
|
-
const t =
|
|
2232
|
+
const t = On(En), n = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
2230
2233
|
|
|
2231
2234
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
2232
2235
|
|
|
2233
2236
|
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;
|
|
2234
|
-
return
|
|
2237
|
+
return V.useEffect(() => {
|
|
2235
2238
|
e && (document.getElementById(e) || console.error(n));
|
|
2236
2239
|
}, [n, e]), null;
|
|
2237
2240
|
}, Vo = "DialogDescriptionWarning", Uo = ({ contentRef: e, descriptionId: t }) => {
|
|
2238
|
-
const r = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${
|
|
2239
|
-
return
|
|
2240
|
-
var
|
|
2241
|
-
const o = (
|
|
2241
|
+
const r = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${On(Vo).contentName}}.`;
|
|
2242
|
+
return V.useEffect(() => {
|
|
2243
|
+
var s;
|
|
2244
|
+
const o = (s = e.current) == null ? void 0 : s.getAttribute("aria-describedby");
|
|
2242
2245
|
t && o && (document.getElementById(t) || console.warn(r));
|
|
2243
2246
|
}, [r, e, t]), null;
|
|
2244
|
-
}, qo =
|
|
2247
|
+
}, qo = Cn, jo = Sn, Zo = In, Bo = yn, Ko = Rn, Xo = Mn;
|
|
2245
2248
|
const _e = {
|
|
2246
2249
|
"rp-dialog-wrapper": "_rp-dialog-wrapper_slqo7_1",
|
|
2247
2250
|
"rp-dialog-overlay": "_rp-dialog-overlay_slqo7_7",
|
|
@@ -2251,11 +2254,11 @@ const _e = {
|
|
|
2251
2254
|
"rp-dialog-close": "_rp-dialog-close_slqo7_47",
|
|
2252
2255
|
"rp-properties-divider": "_rp-properties-divider_slqo7_55"
|
|
2253
2256
|
}, Jo = () => {
|
|
2254
|
-
const { pdfProperties: e } =
|
|
2257
|
+
const { pdfProperties: e } = Y(), { container: t } = be(), { activeDocumentProperties: n, setActiveDocumentProperties: r } = zr(), o = z(() => {
|
|
2255
2258
|
if (!e)
|
|
2256
2259
|
return [];
|
|
2257
2260
|
const {
|
|
2258
|
-
fileSize:
|
|
2261
|
+
fileSize: s,
|
|
2259
2262
|
filename: i,
|
|
2260
2263
|
title: c,
|
|
2261
2264
|
author: l,
|
|
@@ -2265,12 +2268,12 @@ const _e = {
|
|
|
2265
2268
|
keywords: u,
|
|
2266
2269
|
modifiedOn: g,
|
|
2267
2270
|
pdfProducer: f,
|
|
2268
|
-
pdfVersion:
|
|
2271
|
+
pdfVersion: w,
|
|
2269
2272
|
pageCount: v
|
|
2270
2273
|
} = e;
|
|
2271
2274
|
return [
|
|
2272
2275
|
{ label: "File name", value: i },
|
|
2273
|
-
{ label: "File size", value:
|
|
2276
|
+
{ label: "File size", value: s },
|
|
2274
2277
|
{ separate: !0 },
|
|
2275
2278
|
{ label: "Title", value: c },
|
|
2276
2279
|
{ label: "Author", value: l },
|
|
@@ -2287,49 +2290,49 @@ const _e = {
|
|
|
2287
2290
|
},
|
|
2288
2291
|
{ separate: !0 },
|
|
2289
2292
|
{ label: "PDF producer", value: f },
|
|
2290
|
-
{ label: "PDF version", value:
|
|
2293
|
+
{ label: "PDF version", value: w },
|
|
2291
2294
|
{ label: "Page count", value: v }
|
|
2292
2295
|
];
|
|
2293
2296
|
}, [e]);
|
|
2294
|
-
return /* @__PURE__ */
|
|
2295
|
-
/* @__PURE__ */
|
|
2297
|
+
return /* @__PURE__ */ a(qo, { open: n, onOpenChange: r, children: /* @__PURE__ */ a(jo, { container: t, children: /* @__PURE__ */ O("div", { className: _e["rp-dialog-wrapper"], children: [
|
|
2298
|
+
/* @__PURE__ */ a(Zo, { className: _e["rp-dialog-overlay"] }),
|
|
2296
2299
|
/* @__PURE__ */ O(Bo, { className: _e["rp-document-dialog"], children: [
|
|
2297
|
-
/* @__PURE__ */
|
|
2298
|
-
/* @__PURE__ */
|
|
2299
|
-
/* @__PURE__ */
|
|
2300
|
+
/* @__PURE__ */ a(Ko, { className: _e["rp-dialog-title"], children: "Document Properties" }),
|
|
2301
|
+
/* @__PURE__ */ a("div", { className: _e["rp-document-properties"], children: o.map((s, i) => /* @__PURE__ */ a("div", { children: s.separate ? /* @__PURE__ */ a("div", { className: _e["rp-properties-divider"] }) : /* @__PURE__ */ a(Ar, { label: s.label, value: s.value }) }, i)) }),
|
|
2302
|
+
/* @__PURE__ */ a(Xo, { asChild: !0, className: _e["rp-dialog-close"], children: /* @__PURE__ */ a(rn, {}) })
|
|
2300
2303
|
] })
|
|
2301
2304
|
] }) }) });
|
|
2302
2305
|
}, Yo = {
|
|
2303
2306
|
"rp-other-tool-content": "_rp-other-tool-content_su718_1"
|
|
2304
|
-
}, Qo = (e) => URL.createObjectURL(e),
|
|
2307
|
+
}, Qo = (e) => URL.createObjectURL(e), es = async (e) => {
|
|
2305
2308
|
const n = await (await fetch(e)).blob();
|
|
2306
2309
|
return Qo(n);
|
|
2307
|
-
},
|
|
2308
|
-
const { filename: e, pdfSrc: t } =
|
|
2310
|
+
}, ts = () => {
|
|
2311
|
+
const { filename: e, pdfSrc: t } = Y();
|
|
2309
2312
|
return { download: R(async () => {
|
|
2310
2313
|
if (!e || !t)
|
|
2311
2314
|
throw new Error("There is no PDF source to download");
|
|
2312
2315
|
const r = document.createElement("a");
|
|
2313
|
-
r.href = await
|
|
2316
|
+
r.href = await es(t), r.download = e, document.body.appendChild(r), r.click(), document.body.removeChild(r);
|
|
2314
2317
|
}, []) };
|
|
2315
|
-
},
|
|
2318
|
+
}, Dn = () => {
|
|
2316
2319
|
const { downloadIcon: e } = ce();
|
|
2317
|
-
return e || /* @__PURE__ */
|
|
2318
|
-
},
|
|
2319
|
-
/* @__PURE__ */
|
|
2320
|
+
return e || /* @__PURE__ */ a($r, {});
|
|
2321
|
+
}, An = ({ children: e, className: t }) => /* @__PURE__ */ a(ne, { className: t, content: "Download file", children: e }), ns = ({ download: e }) => /* @__PURE__ */ a(An, { children: /* @__PURE__ */ a(Q, { onClick: e, children: /* @__PURE__ */ a(Dn, {}) }) }), rs = ({ download: e }) => /* @__PURE__ */ a(ge, { onClick: e, children: /* @__PURE__ */ O(An, { className: "rp-menu-item", children: [
|
|
2322
|
+
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(Dn, {}) }),
|
|
2320
2323
|
"Download file"
|
|
2321
|
-
] }) }),
|
|
2322
|
-
const { download: e } =
|
|
2323
|
-
return t ? n ? /* @__PURE__ */
|
|
2324
|
-
},
|
|
2324
|
+
] }) }), zn = () => {
|
|
2325
|
+
const { download: e } = ts(), { downloadTool: t = !0 } = fe(), { isSmallScreen: n } = Ce();
|
|
2326
|
+
return t ? n ? /* @__PURE__ */ a(rs, { download: e }) : typeof t == "function" ? /* @__PURE__ */ a(t, { download: e }) : t ? /* @__PURE__ */ a(ns, { download: e }) : null : null;
|
|
2327
|
+
}, Fn = () => {
|
|
2325
2328
|
const { printIcon: e } = ce();
|
|
2326
|
-
return e || /* @__PURE__ */
|
|
2327
|
-
},
|
|
2328
|
-
/* @__PURE__ */
|
|
2329
|
+
return e || /* @__PURE__ */ a(Gr, {});
|
|
2330
|
+
}, kn = ({ children: e, className: t }) => /* @__PURE__ */ a(ne, { className: t, content: "Print", children: e }), os = ({ print: e }) => /* @__PURE__ */ a(kn, { children: /* @__PURE__ */ a(Q, { onClick: e, children: /* @__PURE__ */ a(Fn, {}) }) }), ss = ({ print: e }) => /* @__PURE__ */ a(ge, { onClick: e, children: /* @__PURE__ */ O(kn, { className: "rp-menu-item", children: [
|
|
2331
|
+
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(Fn, {}) }),
|
|
2329
2332
|
"Print"
|
|
2330
|
-
] }) }),
|
|
2331
|
-
const { print: e, cancel: t, setOnProgress: n, setOnComplete: r, setOnError: o, progress:
|
|
2332
|
-
return i ? c ? /* @__PURE__ */
|
|
2333
|
+
] }) }), Wn = () => {
|
|
2334
|
+
const { print: e, cancel: t, setOnProgress: n, setOnComplete: r, setOnError: o, progress: s } = Ct(), { printTool: i = !0 } = fe(), { isSmallScreen: c } = Ce();
|
|
2335
|
+
return i ? c ? /* @__PURE__ */ a(ss, { print: e }) : typeof i == "function" ? /* @__PURE__ */ a(
|
|
2333
2336
|
i,
|
|
2334
2337
|
{
|
|
2335
2338
|
print: e,
|
|
@@ -2337,161 +2340,161 @@ const _e = {
|
|
|
2337
2340
|
setOnProgress: n,
|
|
2338
2341
|
setOnError: o,
|
|
2339
2342
|
setOnComplete: r,
|
|
2340
|
-
progress:
|
|
2343
|
+
progress: s
|
|
2341
2344
|
}
|
|
2342
|
-
) : i ? /* @__PURE__ */
|
|
2343
|
-
},
|
|
2345
|
+
) : i ? /* @__PURE__ */ a(os, { print: e }) : null : null;
|
|
2346
|
+
}, as = {
|
|
2344
2347
|
"rp-go-to-Top": "_rp-go-to-Top_4e0yd_1"
|
|
2345
|
-
},
|
|
2348
|
+
}, is = () => {
|
|
2346
2349
|
const { goToFirstPageIcon: e } = ce();
|
|
2347
|
-
return e || /* @__PURE__ */
|
|
2348
|
-
},
|
|
2350
|
+
return e || /* @__PURE__ */ a(sn, { className: as["rp-go-to-Top"] });
|
|
2351
|
+
}, cs = () => {
|
|
2349
2352
|
const { goToLastPageIcon: e } = ce();
|
|
2350
|
-
return e || /* @__PURE__ */
|
|
2351
|
-
},
|
|
2352
|
-
const { goToPage: e, totalPages: t, focusedPage: n } =
|
|
2353
|
+
return e || /* @__PURE__ */ a(sn, {});
|
|
2354
|
+
}, ls = () => {
|
|
2355
|
+
const { goToPage: e, totalPages: t, focusedPage: n } = oe(), { jumpNavigationTool: r = !0 } = fe(), o = z(() => n === 1, [n]), s = z(() => n === t, [n, t]), i = R(() => {
|
|
2353
2356
|
e(1);
|
|
2354
2357
|
}, [e]), c = R(() => {
|
|
2355
2358
|
e(t);
|
|
2356
2359
|
}, [e, t]);
|
|
2357
2360
|
return r ? /* @__PURE__ */ O(Ge, { children: [
|
|
2358
|
-
/* @__PURE__ */
|
|
2359
|
-
/* @__PURE__ */
|
|
2361
|
+
/* @__PURE__ */ a(ge, { disabled: o, onClick: i, children: /* @__PURE__ */ O(ne, { className: "rp-menu-item", content: "Go to first page", children: [
|
|
2362
|
+
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(is, {}) }),
|
|
2360
2363
|
"First page"
|
|
2361
2364
|
] }) }),
|
|
2362
|
-
/* @__PURE__ */
|
|
2363
|
-
/* @__PURE__ */
|
|
2365
|
+
/* @__PURE__ */ a(ge, { disabled: s, onClick: c, children: /* @__PURE__ */ O(ne, { className: "rp-menu-item", content: "Go to last page", children: [
|
|
2366
|
+
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(cs, {}) }),
|
|
2364
2367
|
"Last page"
|
|
2365
2368
|
] }) }),
|
|
2366
|
-
/* @__PURE__ */
|
|
2369
|
+
/* @__PURE__ */ a(bt, {})
|
|
2367
2370
|
] }) : null;
|
|
2368
|
-
},
|
|
2369
|
-
const { container: e } =
|
|
2371
|
+
}, us = () => {
|
|
2372
|
+
const { container: e } = be(), { isSmallScreen: t } = Ce(), {
|
|
2370
2373
|
openFileTool: n,
|
|
2371
2374
|
downloadTool: r,
|
|
2372
2375
|
documentProperties: o,
|
|
2373
|
-
scrollModeTool:
|
|
2376
|
+
scrollModeTool: s,
|
|
2374
2377
|
rotateTool: i,
|
|
2375
2378
|
selectionModeTool: c,
|
|
2376
2379
|
jumpNavigationTool: l,
|
|
2377
2380
|
printTool: p,
|
|
2378
2381
|
fullscreenTool: h
|
|
2379
|
-
} =
|
|
2382
|
+
} = fe();
|
|
2380
2383
|
return z(() => {
|
|
2381
|
-
const u = l || i || c ||
|
|
2384
|
+
const u = l || i || c || s || o;
|
|
2382
2385
|
let g = !1;
|
|
2383
2386
|
return t && (g = !(!n && !r && !p && !h)), u || g;
|
|
2384
2387
|
}, [
|
|
2385
2388
|
n,
|
|
2386
2389
|
r,
|
|
2387
2390
|
o,
|
|
2388
|
-
|
|
2391
|
+
s,
|
|
2389
2392
|
i,
|
|
2390
2393
|
c,
|
|
2391
2394
|
l,
|
|
2392
2395
|
t
|
|
2393
2396
|
]) ? /* @__PURE__ */ O(Fr, { children: [
|
|
2394
|
-
/* @__PURE__ */
|
|
2397
|
+
/* @__PURE__ */ a(
|
|
2395
2398
|
vt,
|
|
2396
2399
|
{
|
|
2397
2400
|
container: e,
|
|
2398
|
-
triggerComponent: /* @__PURE__ */
|
|
2401
|
+
triggerComponent: /* @__PURE__ */ a("div", { role: "button", children: /* @__PURE__ */ a(ne, { content: "More options", children: /* @__PURE__ */ a(Q, { children: /* @__PURE__ */ a(Sr, {}) }) }) }),
|
|
2399
2402
|
children: /* @__PURE__ */ O("div", { className: Yo["rp-other-tool-content"], "data-rp": "moreOptionsDropdown", children: [
|
|
2400
2403
|
t && /* @__PURE__ */ O(Ge, { children: [
|
|
2401
|
-
/* @__PURE__ */
|
|
2402
|
-
/* @__PURE__ */
|
|
2403
|
-
/* @__PURE__ */
|
|
2404
|
-
/* @__PURE__ */
|
|
2405
|
-
/* @__PURE__ */
|
|
2404
|
+
/* @__PURE__ */ a(nn, {}),
|
|
2405
|
+
/* @__PURE__ */ a(zn, {}),
|
|
2406
|
+
/* @__PURE__ */ a(Wn, {}),
|
|
2407
|
+
/* @__PURE__ */ a(on, {}),
|
|
2408
|
+
/* @__PURE__ */ a(bt, {})
|
|
2406
2409
|
] }),
|
|
2407
|
-
/* @__PURE__ */
|
|
2408
|
-
/* @__PURE__ */
|
|
2409
|
-
/* @__PURE__ */
|
|
2410
|
-
/* @__PURE__ */
|
|
2411
|
-
/* @__PURE__ */
|
|
2410
|
+
/* @__PURE__ */ a(ls, {}),
|
|
2411
|
+
/* @__PURE__ */ a(Wr, {}),
|
|
2412
|
+
/* @__PURE__ */ a(Vr, {}),
|
|
2413
|
+
/* @__PURE__ */ a(Hr, {}),
|
|
2414
|
+
/* @__PURE__ */ a(kr, {})
|
|
2412
2415
|
] })
|
|
2413
2416
|
}
|
|
2414
2417
|
),
|
|
2415
|
-
/* @__PURE__ */
|
|
2418
|
+
/* @__PURE__ */ a(Jo, {})
|
|
2416
2419
|
] }) : null;
|
|
2417
|
-
},
|
|
2418
|
-
const { isSmallScreen: e } =
|
|
2420
|
+
}, ds = () => {
|
|
2421
|
+
const { isSmallScreen: e } = Ce();
|
|
2419
2422
|
return /* @__PURE__ */ O(He, { children: [
|
|
2420
|
-
/* @__PURE__ */
|
|
2423
|
+
/* @__PURE__ */ a(Pr, {}),
|
|
2421
2424
|
!e && /* @__PURE__ */ O(He, { children: [
|
|
2422
|
-
/* @__PURE__ */
|
|
2423
|
-
/* @__PURE__ */
|
|
2424
|
-
/* @__PURE__ */
|
|
2425
|
-
/* @__PURE__ */
|
|
2425
|
+
/* @__PURE__ */ a(nn, {}),
|
|
2426
|
+
/* @__PURE__ */ a(zn, {}),
|
|
2427
|
+
/* @__PURE__ */ a(Wn, {}),
|
|
2428
|
+
/* @__PURE__ */ a(on, {})
|
|
2426
2429
|
] }),
|
|
2427
|
-
/* @__PURE__ */
|
|
2430
|
+
/* @__PURE__ */ a(us, {})
|
|
2428
2431
|
] });
|
|
2429
|
-
},
|
|
2432
|
+
}, xe = {
|
|
2430
2433
|
"rp-zoom-wrapper": "_rp-zoom-wrapper_cocqs_1",
|
|
2431
2434
|
"rp-current-zoom-wrapper": "_rp-current-zoom-wrapper_cocqs_6",
|
|
2432
2435
|
"rp-current-zoom-icon": "_rp-current-zoom-icon_cocqs_11",
|
|
2433
2436
|
"rp-current-zoom-text": "_rp-current-zoom-text_cocqs_16",
|
|
2434
2437
|
"rp-zoom-dropdown-content": "_rp-zoom-dropdown-content_cocqs_20"
|
|
2435
|
-
},
|
|
2438
|
+
}, ps = 25, it = 1e3, hs = [50, 75, 100, 125, 150, 200, 300, 400], ms = () => {
|
|
2436
2439
|
const { zoomInIcon: e } = ce();
|
|
2437
|
-
return e || /* @__PURE__ */
|
|
2438
|
-
},
|
|
2440
|
+
return e || /* @__PURE__ */ a(Ur, {});
|
|
2441
|
+
}, fs = () => {
|
|
2439
2442
|
const { zoomOutIcon: e } = ce();
|
|
2440
|
-
return e || /* @__PURE__ */
|
|
2441
|
-
},
|
|
2442
|
-
const { zoomLevel: e, setZoomLevel: t } = Be(), { container: n, contentRef: r } =
|
|
2443
|
+
return e || /* @__PURE__ */ a(qr, {});
|
|
2444
|
+
}, gs = () => {
|
|
2445
|
+
const { zoomLevel: e, setZoomLevel: t } = Be(), { container: n, contentRef: r } = be(), { zoomTool: o = !0 } = fe(), { focusedPage: s } = oe(), { rotate: i } = Ze(), { pages: c } = Y(), { isSmallScreen: l } = Ce(), p = R(() => {
|
|
2443
2446
|
t((v) => {
|
|
2444
|
-
const
|
|
2445
|
-
return Math.min(
|
|
2447
|
+
const b = Math.floor(v / 25) * 25;
|
|
2448
|
+
return Math.min(b + 25, it);
|
|
2446
2449
|
});
|
|
2447
2450
|
}, [t]), h = R(() => {
|
|
2448
2451
|
t((v) => {
|
|
2449
|
-
const
|
|
2450
|
-
return Math.min(
|
|
2452
|
+
const b = Math.ceil(v / 25) * 25;
|
|
2453
|
+
return Math.min(b - 25, it);
|
|
2451
2454
|
});
|
|
2452
|
-
}, [t]), m = z(() => e ===
|
|
2455
|
+
}, [t]), m = z(() => e === ps, [e]), u = z(() => e === it, [e]), g = z(() => {
|
|
2453
2456
|
var v;
|
|
2454
|
-
return (v = c.get(
|
|
2455
|
-
}, [c,
|
|
2457
|
+
return (v = c.get(s)) == null ? void 0 : v.page.getViewport({ scale: 1, rotation: i });
|
|
2458
|
+
}, [c, s, i]), f = R(
|
|
2456
2459
|
(v) => {
|
|
2457
|
-
const
|
|
2460
|
+
const b = ((g == null ? void 0 : g.width) || 0) + 2 * Lt, P = ((g == null ? void 0 : g.height) || 0) + 2 * Lt, C = (r == null ? void 0 : r.clientWidth) || 0, y = (r == null ? void 0 : r.clientHeight) || 0, d = jr(v, C, y, b, P);
|
|
2458
2461
|
t(d);
|
|
2459
2462
|
},
|
|
2460
2463
|
[t, g]
|
|
2461
|
-
),
|
|
2464
|
+
), w = R(
|
|
2462
2465
|
(v) => {
|
|
2463
2466
|
typeof v == "number" ? t(v) : f(v);
|
|
2464
2467
|
},
|
|
2465
2468
|
[t, f]
|
|
2466
2469
|
);
|
|
2467
|
-
return typeof o != "boolean" ? /* @__PURE__ */
|
|
2468
|
-
/* @__PURE__ */
|
|
2469
|
-
!l && /* @__PURE__ */
|
|
2470
|
+
return typeof o != "boolean" ? /* @__PURE__ */ a(o, { zoomLevel: e, setZoomLevel: t }) : o ? /* @__PURE__ */ O("div", { className: xe["rp-zoom-wrapper"], children: [
|
|
2471
|
+
/* @__PURE__ */ a(ne, { content: "Zoom out", children: /* @__PURE__ */ a(Q, { disabled: m, onClick: h, children: /* @__PURE__ */ a(fs, {}) }) }),
|
|
2472
|
+
!l && /* @__PURE__ */ a(
|
|
2470
2473
|
vt,
|
|
2471
2474
|
{
|
|
2472
2475
|
container: n,
|
|
2473
|
-
triggerComponent: /* @__PURE__ */
|
|
2474
|
-
/* @__PURE__ */
|
|
2475
|
-
/* @__PURE__ */
|
|
2476
|
-
/* @__PURE__ */
|
|
2476
|
+
triggerComponent: /* @__PURE__ */ a("div", { role: "button", children: /* @__PURE__ */ a(ne, { content: "Select zoom level", children: /* @__PURE__ */ O(Q, { className: xe["rp-current-zoom-wrapper"], children: [
|
|
2477
|
+
/* @__PURE__ */ a("span", { className: xe["rp-current-zoom-text"], children: e }),
|
|
2478
|
+
/* @__PURE__ */ a("span", { className: xe["rp-current-zoom-text"], children: "%" }),
|
|
2479
|
+
/* @__PURE__ */ a(Oe, { className: xe["rp-current-zoom-icon"] })
|
|
2477
2480
|
] }) }) }),
|
|
2478
2481
|
style: { minWidth: "200px" },
|
|
2479
2482
|
align: "center",
|
|
2480
|
-
children: /* @__PURE__ */ O("div", { className:
|
|
2483
|
+
children: /* @__PURE__ */ O("div", { className: xe["rp-zoom-dropdown-content"], children: [
|
|
2481
2484
|
/* @__PURE__ */ O(Ge, { children: [
|
|
2482
|
-
/* @__PURE__ */
|
|
2483
|
-
/* @__PURE__ */
|
|
2484
|
-
/* @__PURE__ */
|
|
2485
|
+
/* @__PURE__ */ a(ge, { onClick: () => w(Ye.ACTUAL), children: "Actual size" }),
|
|
2486
|
+
/* @__PURE__ */ a(ge, { onClick: () => w(Ye.PAGE_FIT), children: "Page fit" }),
|
|
2487
|
+
/* @__PURE__ */ a(ge, { onClick: () => w(Ye.PAGE_WIDTH), children: "Page width" })
|
|
2485
2488
|
] }),
|
|
2486
|
-
/* @__PURE__ */
|
|
2487
|
-
/* @__PURE__ */
|
|
2489
|
+
/* @__PURE__ */ a(bt, {}),
|
|
2490
|
+
/* @__PURE__ */ a(Ge, { children: hs.map((v) => /* @__PURE__ */ O(ge, { onClick: () => w(v), children: [
|
|
2488
2491
|
v,
|
|
2489
2492
|
" %"
|
|
2490
2493
|
] }, v)) })
|
|
2491
2494
|
] })
|
|
2492
2495
|
}
|
|
2493
2496
|
),
|
|
2494
|
-
/* @__PURE__ */
|
|
2497
|
+
/* @__PURE__ */ a(ne, { content: "Zoom in", children: /* @__PURE__ */ a(Q, { disabled: u, onClick: p, children: /* @__PURE__ */ a(ms, {}) }) })
|
|
2495
2498
|
] }) : null;
|
|
2496
2499
|
}, ie = {
|
|
2497
2500
|
"rp-search-tool-content": "_rp-search-tool-content_1vxow_1",
|
|
@@ -2504,9 +2507,9 @@ const _e = {
|
|
|
2504
2507
|
"rp-search-input": "_rp-search-input_1vxow_49"
|
|
2505
2508
|
}, Zt = () => {
|
|
2506
2509
|
const { searchIcon: e } = ce();
|
|
2507
|
-
return e || /* @__PURE__ */
|
|
2508
|
-
},
|
|
2509
|
-
const { container: e } =
|
|
2510
|
+
return e || /* @__PURE__ */ a(Zr, {});
|
|
2511
|
+
}, vs = () => {
|
|
2512
|
+
const { container: e } = be(), [t, n] = H(!1), { pdf: r } = Y(), [o, s] = H(null), {
|
|
2510
2513
|
searchOptions: i,
|
|
2511
2514
|
setSearchOptions: c,
|
|
2512
2515
|
loading: l,
|
|
@@ -2516,13 +2519,13 @@ const _e = {
|
|
|
2516
2519
|
nextMatch: u,
|
|
2517
2520
|
prevMatch: g,
|
|
2518
2521
|
search: f
|
|
2519
|
-
} =
|
|
2522
|
+
} = hn(), { searchTool: w = !0 } = fe(), [v, b] = H(f), P = R(() => {
|
|
2520
2523
|
n(!0);
|
|
2521
|
-
}, []),
|
|
2522
|
-
p(""),
|
|
2524
|
+
}, []), C = R(() => {
|
|
2525
|
+
p(""), b(""), n(!1);
|
|
2523
2526
|
}, [p]), y = R(
|
|
2524
2527
|
(L) => {
|
|
2525
|
-
L.key === "Escape" && t &&
|
|
2528
|
+
L.key === "Escape" && t && C();
|
|
2526
2529
|
},
|
|
2527
2530
|
[t]
|
|
2528
2531
|
), d = R(
|
|
@@ -2536,127 +2539,127 @@ const _e = {
|
|
|
2536
2539
|
}), [y]), E(() => {
|
|
2537
2540
|
o && o.focus();
|
|
2538
2541
|
}, [o]);
|
|
2539
|
-
const
|
|
2540
|
-
|
|
2541
|
-
}, []),
|
|
2542
|
-
|
|
2543
|
-
}, [p]),
|
|
2542
|
+
const T = R((L) => {
|
|
2543
|
+
b(L.target.value);
|
|
2544
|
+
}, []), _ = R(() => {
|
|
2545
|
+
b(""), p("");
|
|
2546
|
+
}, [p]), S = z(() => `${m} / ${h}`, [m, h]), { wholeWords: A, matchCase: I } = z(() => i, [i]), N = R(
|
|
2544
2547
|
(L) => {
|
|
2545
|
-
c((
|
|
2548
|
+
c((M) => ({ ...M, matchCase: L }));
|
|
2546
2549
|
},
|
|
2547
2550
|
[c]
|
|
2548
|
-
),
|
|
2551
|
+
), x = R(
|
|
2549
2552
|
(L) => {
|
|
2550
|
-
c((
|
|
2553
|
+
c((M) => ({ ...M, wholeWords: L }));
|
|
2551
2554
|
},
|
|
2552
2555
|
[c]
|
|
2553
2556
|
);
|
|
2554
2557
|
return E(() => {
|
|
2555
|
-
|
|
2556
|
-
}, [r,
|
|
2558
|
+
C();
|
|
2559
|
+
}, [r, C]), w ? /* @__PURE__ */ a(
|
|
2557
2560
|
vt,
|
|
2558
2561
|
{
|
|
2559
2562
|
open: t,
|
|
2560
2563
|
container: e,
|
|
2561
2564
|
align: "start",
|
|
2562
|
-
triggerComponent: /* @__PURE__ */
|
|
2565
|
+
triggerComponent: /* @__PURE__ */ a(ne, { content: "Search in document", children: /* @__PURE__ */ a(Q, { onClick: P, children: /* @__PURE__ */ a(Zt, {}) }) }),
|
|
2563
2566
|
children: /* @__PURE__ */ O("div", { className: ie["rp-search-tool-content"], children: [
|
|
2564
2567
|
/* @__PURE__ */ O("div", { className: ie["rp-search-tool-input-wrapper"], children: [
|
|
2565
2568
|
/* @__PURE__ */ O("div", { className: ie["rp-search-tool-input"], children: [
|
|
2566
|
-
/* @__PURE__ */
|
|
2569
|
+
/* @__PURE__ */ a(
|
|
2567
2570
|
Xt,
|
|
2568
2571
|
{
|
|
2569
2572
|
value: v,
|
|
2570
2573
|
onKeyDown: d,
|
|
2571
|
-
onChange:
|
|
2572
|
-
icon: /* @__PURE__ */
|
|
2574
|
+
onChange: T,
|
|
2575
|
+
icon: /* @__PURE__ */ a(Zt, {}),
|
|
2573
2576
|
placeholder: "Enter to Search",
|
|
2574
2577
|
className: ie["rp-search-input"],
|
|
2575
|
-
ref:
|
|
2576
|
-
children: !!v && /* @__PURE__ */
|
|
2578
|
+
ref: s,
|
|
2579
|
+
children: !!v && /* @__PURE__ */ a("span", { className: ie["rp-search-tool-input-clear"], onClick: _, children: /* @__PURE__ */ a(Br, {}) })
|
|
2577
2580
|
}
|
|
2578
2581
|
),
|
|
2579
|
-
l ? /* @__PURE__ */
|
|
2582
|
+
l ? /* @__PURE__ */ a("span", { children: /* @__PURE__ */ a(De, {}) }) : /* @__PURE__ */ a("span", { children: S })
|
|
2580
2583
|
] }),
|
|
2581
2584
|
/* @__PURE__ */ O("div", { className: ie["rp-search-tool-input-checkboxes"], children: [
|
|
2582
|
-
/* @__PURE__ */
|
|
2583
|
-
/* @__PURE__ */
|
|
2585
|
+
/* @__PURE__ */ a(Nt, { name: "matchCase", value: I, onChange: N, children: "Match Case" }),
|
|
2586
|
+
/* @__PURE__ */ a(Nt, { name: "wholeWord", value: A, onChange: x, children: "Whole Word" })
|
|
2584
2587
|
] })
|
|
2585
2588
|
] }),
|
|
2586
2589
|
/* @__PURE__ */ O("div", { className: ie["rp-search-tool-controls"], children: [
|
|
2587
|
-
/* @__PURE__ */
|
|
2588
|
-
/* @__PURE__ */
|
|
2589
|
-
|
|
2590
|
+
/* @__PURE__ */ a(Q, { onClick: g, children: /* @__PURE__ */ a(Oe, { className: ie["rp-search-tool-input-icon"] }) }),
|
|
2591
|
+
/* @__PURE__ */ a(Q, { onClick: u, children: /* @__PURE__ */ a(
|
|
2592
|
+
Oe,
|
|
2590
2593
|
{
|
|
2591
2594
|
style: { transform: "rotate(180deg" },
|
|
2592
2595
|
className: ie["rp-search-tool-input-icon"]
|
|
2593
2596
|
}
|
|
2594
2597
|
) }),
|
|
2595
|
-
/* @__PURE__ */
|
|
2598
|
+
/* @__PURE__ */ a(Q, { children: /* @__PURE__ */ a(rn, { onClick: C, className: ie["rp-search-tool-input-icon"] }) })
|
|
2596
2599
|
] })
|
|
2597
2600
|
] })
|
|
2598
2601
|
}
|
|
2599
2602
|
) : null;
|
|
2600
|
-
},
|
|
2603
|
+
}, _s = "_loading_1snj5_1", Re = {
|
|
2601
2604
|
"rp-loading-overlay": "_rp-loading-overlay_1snj5_1",
|
|
2602
2605
|
"rp-loading-modal": "_rp-loading-modal_1snj5_14",
|
|
2603
2606
|
"rp-loading-title": "_rp-loading-title_1snj5_27",
|
|
2604
2607
|
"rp-loading-progress-bar": "_rp-loading-progress-bar_1snj5_35",
|
|
2605
2608
|
"rp-loading-progress": "_rp-loading-progress_1snj5_35",
|
|
2606
2609
|
"rp-loading-cancel-button": "_rp-loading-cancel-button_1snj5_52",
|
|
2607
|
-
loading:
|
|
2608
|
-
},
|
|
2610
|
+
loading: _s
|
|
2611
|
+
}, ws = ({ percentage: e }) => {
|
|
2609
2612
|
const { cancel: t } = Ct();
|
|
2610
|
-
return e < 1 ? null : /* @__PURE__ */
|
|
2611
|
-
/* @__PURE__ */
|
|
2612
|
-
/* @__PURE__ */
|
|
2613
|
+
return e < 1 ? null : /* @__PURE__ */ a("div", { className: te(Re["rp-loading-overlay"]), children: /* @__PURE__ */ O("div", { className: te(Re["rp-loading-modal"]), children: [
|
|
2614
|
+
/* @__PURE__ */ a("div", { className: te(Re["rp-loading-title"]), children: "Preparing document..." }),
|
|
2615
|
+
/* @__PURE__ */ a("div", { className: te(Re["rp-loading-progress-bar"]), children: /* @__PURE__ */ a(
|
|
2613
2616
|
"div",
|
|
2614
2617
|
{
|
|
2615
|
-
className:
|
|
2618
|
+
className: te(Re["rp-loading-progress"]),
|
|
2616
2619
|
style: { width: `${e}%` }
|
|
2617
2620
|
}
|
|
2618
2621
|
) }),
|
|
2619
|
-
/* @__PURE__ */
|
|
2622
|
+
/* @__PURE__ */ a("button", { className: te(Re["rp-loading-cancel-button"]), onClick: t, children: "Cancel" })
|
|
2620
2623
|
] }) });
|
|
2621
|
-
},
|
|
2622
|
-
const { showPrintProgress: n } =
|
|
2624
|
+
}, bs = je((e, t) => {
|
|
2625
|
+
const { showPrintProgress: n } = fe(), { progress: r } = Ct(), { isSmallScreen: o } = Ce(), { percentage: s } = r || {}, i = () => o ? { gridTemplateColumns: "25% 60% 15%" } : void 0;
|
|
2623
2626
|
return /* @__PURE__ */ O("div", { children: [
|
|
2624
|
-
/* @__PURE__ */
|
|
2625
|
-
/* @__PURE__ */ O("div", { "data-rp": "topBarLeft", className:
|
|
2626
|
-
/* @__PURE__ */
|
|
2627
|
-
/* @__PURE__ */
|
|
2627
|
+
/* @__PURE__ */ a("div", { "data-rp": "topBar", ref: t, className: Ne["rp-toolbar-content"], children: /* @__PURE__ */ O("div", { className: Ne["rp-toolbar-wrapper"], style: i(), children: [
|
|
2628
|
+
/* @__PURE__ */ O("div", { "data-rp": "topBarLeft", className: Ne["rp-toolbar-start"], children: [
|
|
2629
|
+
/* @__PURE__ */ a(vs, {}),
|
|
2630
|
+
/* @__PURE__ */ a(Do, {})
|
|
2628
2631
|
] }),
|
|
2629
|
-
/* @__PURE__ */
|
|
2630
|
-
/* @__PURE__ */
|
|
2632
|
+
/* @__PURE__ */ a("div", { "data-rp": "topBarCenter", className: Ne["rp-toolbar-middle"], children: /* @__PURE__ */ a(gs, {}) }),
|
|
2633
|
+
/* @__PURE__ */ a("div", { "data-rp": "topBarRight", className: Ne["rp-toolbar-end"], children: /* @__PURE__ */ a(ds, {}) })
|
|
2631
2634
|
] }) }),
|
|
2632
|
-
n &&
|
|
2635
|
+
n && s ? /* @__PURE__ */ a(ws, { percentage: s }) : null
|
|
2633
2636
|
] });
|
|
2634
2637
|
}), ct = {
|
|
2635
2638
|
"rp-sidebar-content-wrapper": "_rp-sidebar-content-wrapper_4wlw3_1",
|
|
2636
2639
|
"rp-sidebar-content": "_rp-sidebar-content_4wlw3_1",
|
|
2637
2640
|
"rp-thumbnails-wrapper": "_rp-thumbnails-wrapper_4wlw3_16",
|
|
2638
2641
|
"rp-thumbnail-dragging": "_rp-thumbnail-dragging_4wlw3_21"
|
|
2639
|
-
},
|
|
2642
|
+
}, Me = {
|
|
2640
2643
|
"rp-thumbnail-wrapper": "_rp-thumbnail-wrapper_3fenb_1",
|
|
2641
2644
|
"rp-thumbnail-text": "_rp-thumbnail-text_3fenb_10",
|
|
2642
2645
|
"rp-thumbnail": "_rp-thumbnail_3fenb_1",
|
|
2643
2646
|
"rp-thumbnail-active": "_rp-thumbnail-active_3fenb_22",
|
|
2644
2647
|
"rp-thumbnail-loader": "_rp-thumbnail-loader_3fenb_31"
|
|
2645
|
-
},
|
|
2646
|
-
const { thumbnailSrc: t, pageNumber: n, isFocused: r, viewport: o } = e, { goToPage:
|
|
2648
|
+
}, Cs = (e) => {
|
|
2649
|
+
const { thumbnailSrc: t, pageNumber: n, isFocused: r, viewport: o } = e, { goToPage: s } = oe(), i = z(() => r ? Me["rp-thumbnail-active"] : "", [r]), c = z(() => ({
|
|
2647
2650
|
width: Math.round(o.width),
|
|
2648
2651
|
height: Math.round(o.height)
|
|
2649
2652
|
}), [o]), l = R(() => {
|
|
2650
|
-
n &&
|
|
2651
|
-
}, [
|
|
2653
|
+
n && s(n);
|
|
2654
|
+
}, [s, n]);
|
|
2652
2655
|
return /* @__PURE__ */ O(
|
|
2653
2656
|
"div",
|
|
2654
2657
|
{
|
|
2655
2658
|
onClick: l,
|
|
2656
2659
|
id: `page-${n}`,
|
|
2657
|
-
className:
|
|
2660
|
+
className: Me["rp-thumbnail-wrapper"],
|
|
2658
2661
|
children: [
|
|
2659
|
-
/* @__PURE__ */
|
|
2662
|
+
/* @__PURE__ */ a("div", { className: te(i, Me["rp-thumbnail"]), children: t ? /* @__PURE__ */ a(
|
|
2660
2663
|
"img",
|
|
2661
2664
|
{
|
|
2662
2665
|
src: t,
|
|
@@ -2664,42 +2667,42 @@ const _e = {
|
|
|
2664
2667
|
height: c.height,
|
|
2665
2668
|
alt: "thumbnail"
|
|
2666
2669
|
}
|
|
2667
|
-
) : /* @__PURE__ */
|
|
2670
|
+
) : /* @__PURE__ */ a(
|
|
2668
2671
|
"div",
|
|
2669
2672
|
{
|
|
2670
|
-
className:
|
|
2673
|
+
className: Me["rp-thumbnail-loader"],
|
|
2671
2674
|
style: {
|
|
2672
2675
|
width: `${c.width}px`,
|
|
2673
2676
|
height: `${c.height}px`
|
|
2674
2677
|
},
|
|
2675
|
-
children: /* @__PURE__ */
|
|
2678
|
+
children: /* @__PURE__ */ a(De, {})
|
|
2676
2679
|
}
|
|
2677
2680
|
) }),
|
|
2678
|
-
/* @__PURE__ */
|
|
2681
|
+
/* @__PURE__ */ a("div", { className: Me["rp-thumbnail-text"], children: n })
|
|
2679
2682
|
]
|
|
2680
2683
|
}
|
|
2681
2684
|
);
|
|
2682
2685
|
}, Bt = {
|
|
2683
2686
|
"rp-thumbnails-container": "_rp-thumbnails-container_16vqr_1",
|
|
2684
2687
|
"rp-thumbnails": "_rp-thumbnails_16vqr_1"
|
|
2685
|
-
},
|
|
2688
|
+
}, Ts = 16, Ps = (e, t) => {
|
|
2686
2689
|
const n = e == null ? void 0 : e.querySelector(`#page-${t}`);
|
|
2687
|
-
e && (n != null && n.offsetTop) && (e.scrollTop = (n == null ? void 0 : n.offsetTop) -
|
|
2688
|
-
},
|
|
2689
|
-
const { show: n } = e, { focusedPage: r, totalPages: o } =
|
|
2690
|
+
e && (n != null && n.offsetTop) && (e.scrollTop = (n == null ? void 0 : n.offsetTop) - Ts);
|
|
2691
|
+
}, Ss = je((e, t) => {
|
|
2692
|
+
const { show: n } = e, { focusedPage: r, totalPages: o } = oe(), { thumbnailPages: s, addPage: i, thumbnailLength: c, addToPage: l } = dn(), p = W(null), h = W(1);
|
|
2690
2693
|
Kt(t, () => p.current);
|
|
2691
|
-
const m = z(() => Object.values(
|
|
2694
|
+
const m = z(() => Object.values(s), [s]), u = R(() => {
|
|
2692
2695
|
const g = c + 1;
|
|
2693
2696
|
g <= o && i(g);
|
|
2694
2697
|
}, [i, o, c]);
|
|
2695
2698
|
return E(() => {
|
|
2696
|
-
r > c ? l(r) : n && h.current !== r && (
|
|
2697
|
-
}, [r, c, l, n, m]),
|
|
2698
|
-
var
|
|
2699
|
-
return /* @__PURE__ */
|
|
2700
|
-
|
|
2699
|
+
r > c ? l(r) : n && h.current !== r && (Ps(p.current, r), h.current = r);
|
|
2700
|
+
}, [r, c, l, n, m]), ir(p.current, u), /* @__PURE__ */ a("div", { ref: p, className: Bt["rp-thumbnails-container"], children: /* @__PURE__ */ a("div", { className: Bt["rp-thumbnails"], children: n ? m.map((g, f) => {
|
|
2701
|
+
var w, v;
|
|
2702
|
+
return /* @__PURE__ */ a(
|
|
2703
|
+
Cs,
|
|
2701
2704
|
{
|
|
2702
|
-
isFocused: r === ((
|
|
2705
|
+
isFocused: r === ((w = g.page) == null ? void 0 : w.pageNumber),
|
|
2703
2706
|
pageNumber: (v = g.page) == null ? void 0 : v.pageNumber,
|
|
2704
2707
|
thumbnailSrc: g.thumbnailSrc,
|
|
2705
2708
|
loading: g.loading,
|
|
@@ -2708,13 +2711,13 @@ const _e = {
|
|
|
2708
2711
|
f
|
|
2709
2712
|
);
|
|
2710
2713
|
}) : null }) });
|
|
2711
|
-
}),
|
|
2714
|
+
}), Is = () => {
|
|
2712
2715
|
const { thumbnailIcon: e } = ce();
|
|
2713
|
-
return e || /* @__PURE__ */
|
|
2714
|
-
},
|
|
2715
|
-
const { active: e, setActive: t } =
|
|
2716
|
+
return e || /* @__PURE__ */ a(ar, {});
|
|
2717
|
+
}, ys = () => {
|
|
2718
|
+
const { active: e, setActive: t } = dn(), [n, r] = H(200), o = W(null), { thumbnailTool: s } = fe(), i = R(() => {
|
|
2716
2719
|
t((l) => !l);
|
|
2717
|
-
}, []), c = z(() => typeof
|
|
2720
|
+
}, []), c = z(() => typeof s != "boolean" && s ? /* @__PURE__ */ a(s, { onClick: i, active: e }) : s ? /* @__PURE__ */ a(ne, { content: "Thumbnail", children: /* @__PURE__ */ a(Q, { onClick: i, active: e, children: /* @__PURE__ */ a(Is, {}) }) }) : null, [s, e, i]);
|
|
2718
2721
|
return /* @__PURE__ */ O(
|
|
2719
2722
|
"div",
|
|
2720
2723
|
{
|
|
@@ -2722,37 +2725,37 @@ const _e = {
|
|
|
2722
2725
|
className: ct["rp-sidebar-content-wrapper"],
|
|
2723
2726
|
"data-rp": "sidebar",
|
|
2724
2727
|
children: [
|
|
2725
|
-
/* @__PURE__ */
|
|
2728
|
+
/* @__PURE__ */ a("div", { className: ct["rp-sidebar-content"], children: c }),
|
|
2726
2729
|
/* @__PURE__ */ O("div", { "data-rp": "thumbnailSidebar", hidden: !e, className: ct["rp-thumbnails-wrapper"], children: [
|
|
2727
|
-
/* @__PURE__ */
|
|
2728
|
-
/* @__PURE__ */
|
|
2730
|
+
/* @__PURE__ */ a(Ss, { show: e, ref: o }),
|
|
2731
|
+
/* @__PURE__ */ a(cr, { onWidthChange: r, thumbnailRef: o })
|
|
2729
2732
|
] })
|
|
2730
2733
|
]
|
|
2731
2734
|
}
|
|
2732
2735
|
);
|
|
2733
2736
|
}, oi = je((e, t) => {
|
|
2734
|
-
const { children: n, slots: r, icons: o, style:
|
|
2737
|
+
const { children: n, slots: r, icons: o, style: s, className: i, mobileWidth: c, onLoaded: l, cleanupOnLoaded: p } = e, [h, m] = H(null), { setContainer: u, setContentRef: g } = be(), { loading: f } = Y();
|
|
2735
2738
|
return E(() => (l && l(), () => {
|
|
2736
2739
|
p && p();
|
|
2737
|
-
}), [l, p]), /* @__PURE__ */
|
|
2738
|
-
|
|
2740
|
+
}), [l, p]), /* @__PURE__ */ a("div", { ref: t, className: te(Ie["rp-theme-variables"], Ie["rp-container"]), children: /* @__PURE__ */ a(mr, { mobileWidth: c, children: /* @__PURE__ */ a(lr, { slots: r, children: /* @__PURE__ */ a(ur, { icons: o, children: /* @__PURE__ */ O(
|
|
2741
|
+
dr,
|
|
2739
2742
|
{
|
|
2740
2743
|
getContainerRef: u,
|
|
2741
2744
|
toolbarRef: h,
|
|
2742
|
-
style:
|
|
2745
|
+
style: s,
|
|
2743
2746
|
className: i,
|
|
2744
2747
|
children: [
|
|
2745
|
-
/* @__PURE__ */ O(
|
|
2746
|
-
/* @__PURE__ */ O("div", { className:
|
|
2747
|
-
/* @__PURE__ */
|
|
2748
|
-
/* @__PURE__ */ O("div", { className:
|
|
2749
|
-
/* @__PURE__ */
|
|
2750
|
-
/* @__PURE__ */
|
|
2748
|
+
/* @__PURE__ */ O(pr, { children: [
|
|
2749
|
+
/* @__PURE__ */ O("div", { className: Ie["rp-layout"], children: [
|
|
2750
|
+
/* @__PURE__ */ a(bs, { ref: m }),
|
|
2751
|
+
/* @__PURE__ */ O("div", { className: Ie["rp-content"], children: [
|
|
2752
|
+
/* @__PURE__ */ a("div", { className: Ie["rp-sidebar"], children: /* @__PURE__ */ a(ys, {}) }),
|
|
2753
|
+
/* @__PURE__ */ a("div", { ref: g, className: Ie["rp-pages"], children: n })
|
|
2751
2754
|
] })
|
|
2752
2755
|
] }),
|
|
2753
|
-
/* @__PURE__ */
|
|
2756
|
+
/* @__PURE__ */ a(hr, {})
|
|
2754
2757
|
] }),
|
|
2755
|
-
f ? /* @__PURE__ */
|
|
2758
|
+
f ? /* @__PURE__ */ a(
|
|
2756
2759
|
"div",
|
|
2757
2760
|
{
|
|
2758
2761
|
style: {
|
|
@@ -2765,7 +2768,7 @@ const _e = {
|
|
|
2765
2768
|
height: "100%",
|
|
2766
2769
|
backgroundColor: "rgba(0, 0, 0, 0.2)"
|
|
2767
2770
|
},
|
|
2768
|
-
children: /* @__PURE__ */
|
|
2771
|
+
children: /* @__PURE__ */ a(
|
|
2769
2772
|
"div",
|
|
2770
2773
|
{
|
|
2771
2774
|
style: {
|
|
@@ -2775,7 +2778,7 @@ const _e = {
|
|
|
2775
2778
|
height: "100%",
|
|
2776
2779
|
width: "100%"
|
|
2777
2780
|
},
|
|
2778
|
-
children: /* @__PURE__ */
|
|
2781
|
+
children: /* @__PURE__ */ a(De, {})
|
|
2779
2782
|
}
|
|
2780
2783
|
)
|
|
2781
2784
|
}
|
|
@@ -2786,44 +2789,44 @@ const _e = {
|
|
|
2786
2789
|
});
|
|
2787
2790
|
export {
|
|
2788
2791
|
co as A,
|
|
2789
|
-
|
|
2792
|
+
Cs as B,
|
|
2790
2793
|
Qr as C,
|
|
2791
2794
|
Lo as D,
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2795
|
+
Ss as E,
|
|
2796
|
+
zn as F,
|
|
2797
|
+
ys as G,
|
|
2798
|
+
ws as L,
|
|
2799
|
+
ls as M,
|
|
2800
|
+
us as O,
|
|
2801
|
+
Ja as P,
|
|
2799
2802
|
ti as R,
|
|
2800
2803
|
ei as S,
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
+
Qa as T,
|
|
2805
|
+
gs as Z,
|
|
2806
|
+
Ya as a,
|
|
2804
2807
|
oi as b,
|
|
2805
|
-
|
|
2808
|
+
ts as c,
|
|
2806
2809
|
Ct as d,
|
|
2807
|
-
|
|
2808
|
-
|
|
2810
|
+
hn as e,
|
|
2811
|
+
an as f,
|
|
2809
2812
|
Kr as g,
|
|
2810
|
-
|
|
2813
|
+
cn as h,
|
|
2811
2814
|
Xr as i,
|
|
2812
|
-
|
|
2815
|
+
ln as j,
|
|
2813
2816
|
Jr as k,
|
|
2814
|
-
|
|
2815
|
-
|
|
2817
|
+
un as l,
|
|
2818
|
+
dn as m,
|
|
2816
2819
|
Yr as n,
|
|
2817
|
-
|
|
2820
|
+
pn as o,
|
|
2818
2821
|
eo as p,
|
|
2819
2822
|
Tt as q,
|
|
2820
2823
|
yo as r,
|
|
2821
2824
|
No as s,
|
|
2822
2825
|
Do as t,
|
|
2823
|
-
|
|
2826
|
+
oe as u,
|
|
2824
2827
|
Jo as v,
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2828
|
+
Wn as w,
|
|
2829
|
+
ds as x,
|
|
2830
|
+
vs as y,
|
|
2831
|
+
bs as z
|
|
2829
2832
|
};
|