@pdf-viewer/react 1.0.1-rc.1 → 1.1.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{RPDefaultLayout-4ef5f3c7.js → RPDefaultLayout-43ed3fda.js} +620 -615
- package/dist/components/RPConfig.js +318 -340
- package/dist/components/RPController.js +1 -1
- 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/MenuItem.js +1 -1
- package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
- package/dist/components/layout/toolbar/MostPageTool.js +2 -2
- package/dist/components/layout/toolbar/OtherTool.js +2 -2
- 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/RotateTool.js +1 -1
- package/dist/components/layout/toolbar/ScrollModeTool.js +1 -1
- package/dist/components/layout/toolbar/SearchTool.js +1 -1
- package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
- package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
- package/dist/components/layout/toolbar/ZoomTool.js +2 -2
- 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 +1 -1
- package/dist/components/page/SinglePage.js +1 -1
- package/dist/components/page/TextLayer.js +1 -1
- package/dist/components/ui/Checkbox.js +252 -92
- package/dist/components/ui/DropDown.js +1 -1
- package/dist/components/ui/LoadingIndicator.js +1 -1
- package/dist/components/ui/RPTooltip.js +961 -224
- 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/floating-ui.react-dom-e6d5fe8f.js +1327 -0
- package/dist/index-316854c1.js +2299 -0
- package/dist/index-71898eb9.js +139 -0
- package/dist/main.js +1 -1
- 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/package.json +1 -1
- package/dist/index-1db49c1a.js +0 -1664
- package/dist/index-3dff3fa8.js +0 -307
- package/dist/index-4f17fe4d.js +0 -1657
|
@@ -1,88 +1,88 @@
|
|
|
1
1
|
import { jsx as s, jsxs as O, Fragment as Ae } from "react/jsx-runtime";
|
|
2
2
|
import * as V from "react";
|
|
3
|
-
import { useRef as
|
|
3
|
+
import { useRef as W, useEffect as z, useCallback as x, useState as H, createContext as We, useContext as He, useMemo as A, forwardRef as $e, useImperativeHandle as Zt, createElement as Me, PureComponent as Hn, Component as $n, memo as Gn } from "react";
|
|
4
4
|
import { ChevronUpIcon as Re } from "./components/icons/ChevronUpIcon.js";
|
|
5
5
|
import { UIButton as X } from "./components/ui/Button.js";
|
|
6
6
|
import { UIInput as jt } from "./components/ui/Input.js";
|
|
7
|
-
import { useScrollModeContext as
|
|
8
|
-
import { useDocumentContext as
|
|
7
|
+
import { useScrollModeContext as Te } from "./contexts/ScrollModeContext.js";
|
|
8
|
+
import { useDocumentContext as re } from "./contexts/RPDocumentContext.js";
|
|
9
9
|
import "./contexts/DarkModeContext.js";
|
|
10
|
-
import { ViewMode as ze, ScrollMode as J, AnnotationSubType as at, SelectionMode as
|
|
10
|
+
import { ViewMode as ze, ScrollMode as J, AnnotationSubType as at, SelectionMode as Vn, ZoomLevel as Be } from "./utils/types.js";
|
|
11
11
|
import { useRotationContext as Ge } from "./contexts/RotationContext.js";
|
|
12
|
-
import { useLayerContext as
|
|
12
|
+
import { useLayerContext as Un } from "./contexts/LayerContext.js";
|
|
13
13
|
import { useZoomContext as Ve } from "./contexts/ZoomContext.js";
|
|
14
14
|
import { useViewModeContext as Ue } from "./contexts/ViewModeContext.js";
|
|
15
15
|
import { useVirtualScrollContext as qe } from "./contexts/VirtualScrollContext.js";
|
|
16
16
|
import { useVirtualGridContext as Bt } from "./contexts/VirtualGridContext.js";
|
|
17
17
|
import { useScrollStateContext as Kt } from "./contexts/ScrollStateContext.js";
|
|
18
|
-
import { useSelectionModeContext as
|
|
19
|
-
import { useInitialStateContext as
|
|
20
|
-
import { useFullScreenContext as
|
|
18
|
+
import { useSelectionModeContext as qn } from "./contexts/SelectionModeContext.js";
|
|
19
|
+
import { useInitialStateContext as Zn } from "./contexts/InitialStateContext.js";
|
|
20
|
+
import { useFullScreenContext as jn } from "./contexts/FullScreenContext.js";
|
|
21
21
|
import "./contexts/FileInputContext.js";
|
|
22
22
|
import "./contexts/DropFileZoneContext.js";
|
|
23
23
|
import { renderPage as st } from "./utils/renderPage.js";
|
|
24
|
-
import { highlightMatches as Xt, findMatches as
|
|
24
|
+
import { highlightMatches as Xt, findMatches as Bn, resetDivs as Kn } from "./utils/highlight.js";
|
|
25
25
|
import * as Jt from "pdfjs-dist";
|
|
26
|
-
import { PixelsPerInch as
|
|
26
|
+
import { PixelsPerInch as Xn, AnnotationMode as Jn, RenderingCancelledException as Yn, AnnotationLayer as Qn } from "pdfjs-dist";
|
|
27
27
|
import { usePageDimension as ht } from "./utils/hooks/usePageDimension.js";
|
|
28
28
|
import { useLayoutContainer as Le } from "./contexts/LayoutContainerContext.js";
|
|
29
29
|
import "./components/RPConfig.js";
|
|
30
|
-
import { ThumbnailIcon as
|
|
31
|
-
import { c as
|
|
30
|
+
import { ThumbnailIcon as er } from "./components/icons/Thumbnail.js";
|
|
31
|
+
import { c as ee } from "./clsx-0c6e471a.js";
|
|
32
32
|
import { LoaderIcon as mt } from "./components/icons/LoaderIcon.js";
|
|
33
|
-
import { useInfiniteScroll as
|
|
34
|
-
import { RPSplitter as
|
|
35
|
-
import { useToolbarComponentContext as de, ToolbarComponentProvider 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 _e, ViewportProvider as
|
|
33
|
+
import { useInfiniteScroll as tr } from "./utils/hooks/useInfiniteScroll.js";
|
|
34
|
+
import { RPSplitter as nr } from "./components/layout/sidebar/RPSplitter.js";
|
|
35
|
+
import { useToolbarComponentContext as de, ToolbarComponentProvider as rr } from "./contexts/ToolbarComponentContext.js";
|
|
36
|
+
import { useIconContext as ce, IconProvider as or } from "./contexts/IconContext.js";
|
|
37
|
+
import te from "./components/ui/RPTooltip.js";
|
|
38
|
+
import { c as be, C as ar } from "./Container-fdb0a71f.js";
|
|
39
|
+
import { WrapperLayout as sr } from "./components/layout/WrapperLayout.js";
|
|
40
|
+
import { RPDropFileZone as ir } from "./components/RPDropFileZone.js";
|
|
41
|
+
import { useViewportContext as _e, ViewportProvider as cr } from "./contexts/ViewportContext.js";
|
|
42
42
|
import "./contexts/ThemeContext.js";
|
|
43
|
-
import { SimpleLinkService as
|
|
43
|
+
import { SimpleLinkService as lr } from "./utils/link_service.js";
|
|
44
44
|
import { dateFormatter as it } from "./utils/dateFormatter.js";
|
|
45
|
-
import { sanitizeExternalUrl as
|
|
46
|
-
import { useWatermark as
|
|
47
|
-
import { useMousePressed as
|
|
48
|
-
import { useGrabScroll as
|
|
49
|
-
import { usePinch as
|
|
45
|
+
import { sanitizeExternalUrl as ur } from "./utils/sanitizeExternalUrl.js";
|
|
46
|
+
import { useWatermark as dr } from "./utils/hooks/useWatermark.js";
|
|
47
|
+
import { useMousePressed as pr } from "./utils/hooks/useMousePressed.js";
|
|
48
|
+
import { useGrabScroll as hr } from "./utils/hooks/useGrabScroll.js";
|
|
49
|
+
import { usePinch as mr } from "./utils/hooks/usePinch.js";
|
|
50
50
|
import { getThumbnailViewport as yt } from "./utils/getThumbnailViewport.js";
|
|
51
|
-
import { useDebounce as
|
|
52
|
-
import { appConsole as
|
|
51
|
+
import { useDebounce as fr } from "./utils/hooks/useDebounce.js";
|
|
52
|
+
import { appConsole as gr } from "./utils/appConsole.js";
|
|
53
53
|
import { FileUploadTool as Yt } from "./components/layout/toolbar/FileUploadTool.js";
|
|
54
|
-
import { DarkModeTool as
|
|
55
|
-
import { ThreeDotIcon as
|
|
54
|
+
import { DarkModeTool as vr } from "./components/layout/toolbar/DarkModeTool.js";
|
|
55
|
+
import { ThreeDotIcon as _r } from "./components/icons/ThreeDotIcon.js";
|
|
56
56
|
import { UIDropDown as ft } from "./components/ui/DropDown.js";
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
57
|
+
import { u as gt, a as Ne, c as xe, b as vt, d as wr, e as br, h as Cr, f as Pr, F as Tr, D as Sr, g as yr, G as Fe } from "./index-316854c1.js";
|
|
58
|
+
import { c as Ir, e as xr, b as Rr } from "./index-71898eb9.js";
|
|
59
|
+
import { e as Ke } from "./floating-ui.react-dom-e6d5fe8f.js";
|
|
60
60
|
import { CloseIcon as Qt } from "./components/icons/CloseIcon.js";
|
|
61
|
-
import { PropertyItem as
|
|
62
|
-
import { useOtherToolContext as
|
|
63
|
-
import { DocumentProperties as
|
|
64
|
-
import { RotateTool as
|
|
65
|
-
import { ScrollModeTool as
|
|
61
|
+
import { PropertyItem as Lr } from "./components/layout/toolbar/PropertyItem.js";
|
|
62
|
+
import { useOtherToolContext as Nr, OtherToolProvider as Mr } from "./contexts/OtherToolContext.js";
|
|
63
|
+
import { DocumentProperties as Er } from "./components/layout/toolbar/DocumentProperties.js";
|
|
64
|
+
import { RotateTool as Or } from "./components/layout/toolbar/RotateTool.js";
|
|
65
|
+
import { ScrollModeTool as Dr } from "./components/layout/toolbar/ScrollModeTool.js";
|
|
66
66
|
import { MenuSeparator as _t } from "./components/layout/toolbar/MenuSeparator.js";
|
|
67
|
-
import { FileDownloadDefaultIcon as
|
|
68
|
-
import { MenuItem as
|
|
69
|
-
import { PrintDefaultTool as
|
|
67
|
+
import { FileDownloadDefaultIcon as Ar } from "./components/icons/FileDownloadDefaultIcon.js";
|
|
68
|
+
import { MenuItem as fe } from "./components/layout/toolbar/MenuItem.js";
|
|
69
|
+
import { PrintDefaultTool as zr } from "./components/icons/PrintDefaultIcon.js";
|
|
70
70
|
import { FullScreenTool as en } from "./components/layout/toolbar/FullScreenTool.js";
|
|
71
71
|
import { GoToDownIcon as tn } from "./components/icons/GoToDownIcon.js";
|
|
72
|
-
import { SelectionModeTool as
|
|
73
|
-
import { ZoomInIcon as
|
|
74
|
-
import { ZoomOutIcon as
|
|
72
|
+
import { SelectionModeTool as Fr } from "./components/layout/toolbar/SelectionModeTool.js";
|
|
73
|
+
import { ZoomInIcon as kr } from "./components/icons/ZoomInIcon.js";
|
|
74
|
+
import { ZoomOutIcon as Wr } from "./components/icons/ZoomOutIcon.js";
|
|
75
75
|
import { PAGE_PADDING as It } from "./utils/constants.js";
|
|
76
|
-
import { getZoomLevel as
|
|
77
|
-
import { SearchIcon as
|
|
76
|
+
import { getZoomLevel as Hr } from "./utils/getZoomLevel.js";
|
|
77
|
+
import { SearchIcon as $r } from "./components/icons/SearchIcon.js";
|
|
78
78
|
import { UICheckbox as xt } from "./components/ui/Checkbox.js";
|
|
79
|
-
import { ClearIcon as
|
|
79
|
+
import { ClearIcon as Gr } from "./components/icons/ClearIcon.js";
|
|
80
80
|
import './assets/RPDefaultLayout.css';const nn = () => {
|
|
81
|
-
const { viewMode: e } = Ue(), { scrollMode: t } =
|
|
82
|
-
|
|
81
|
+
const { viewMode: e } = Ue(), { scrollMode: t } = Te(), { virtualScrollRef: n, pageScrollElementRef: r } = qe(), { setFocusedPage: o } = oe(), a = W(), { columnCount: c } = Bt(), i = ht(), l = W(t), p = W(e);
|
|
82
|
+
z(() => {
|
|
83
83
|
n != null && n.scrollToItem && (a.current = n);
|
|
84
84
|
}, [n]);
|
|
85
|
-
const h =
|
|
85
|
+
const h = x(
|
|
86
86
|
(u) => {
|
|
87
87
|
if (!r)
|
|
88
88
|
return;
|
|
@@ -91,9 +91,9 @@ import './assets/RPDefaultLayout.css';const nn = () => {
|
|
|
91
91
|
},
|
|
92
92
|
[r, i]
|
|
93
93
|
);
|
|
94
|
-
return
|
|
94
|
+
return z(() => {
|
|
95
95
|
l.current = t, p.current = e;
|
|
96
|
-
}, [t, e]), { scrollToPage:
|
|
96
|
+
}, [t, e]), { scrollToPage: x(
|
|
97
97
|
(u, m = "start") => {
|
|
98
98
|
const g = u - 1;
|
|
99
99
|
let _ = g, v = 0;
|
|
@@ -109,25 +109,25 @@ import './assets/RPDefaultLayout.css';const nn = () => {
|
|
|
109
109
|
},
|
|
110
110
|
[c, h, o]
|
|
111
111
|
) };
|
|
112
|
-
},
|
|
113
|
-
const [t, n] =
|
|
112
|
+
}, Vr = (e = 1) => {
|
|
113
|
+
const [t, n] = H(e), [r, o] = H(0), { scrollToPage: a } = nn(), c = W(1), { isScrolling: i } = Kt(), { viewMode: l } = Ue(), { scrollMode: p } = Te(), h = fr(t, 100), f = x(
|
|
114
114
|
(v) => {
|
|
115
115
|
if (!/^[0-9]*$/g.test(v.toString()) || !v)
|
|
116
116
|
return { success: !1, currentPage: c.current };
|
|
117
|
-
const
|
|
118
|
-
return
|
|
117
|
+
const S = +v;
|
|
118
|
+
return S < 0 || S > r ? { success: !1, currentPage: c.current } : (n(S), c.current = S, { success: !0, currentPage: +v });
|
|
119
119
|
},
|
|
120
120
|
[r]
|
|
121
|
-
), u =
|
|
121
|
+
), u = x(f, [f]), m = x(
|
|
122
122
|
(v) => {
|
|
123
123
|
const C = f(v);
|
|
124
124
|
return C.success && (i.current = !0, a(C.currentPage)), C;
|
|
125
125
|
},
|
|
126
126
|
[f, a]
|
|
127
|
-
), g =
|
|
127
|
+
), g = x(() => {
|
|
128
128
|
let v = t - 1;
|
|
129
129
|
m(v);
|
|
130
|
-
}, [m, t, l, p]), _ =
|
|
130
|
+
}, [m, t, l, p]), _ = x(() => {
|
|
131
131
|
let v = t + 1;
|
|
132
132
|
m(v);
|
|
133
133
|
}, [m, t, l, p]);
|
|
@@ -154,12 +154,12 @@ import './assets/RPDefaultLayout.css';const nn = () => {
|
|
|
154
154
|
}
|
|
155
155
|
}), oe = () => {
|
|
156
156
|
const e = He(rn);
|
|
157
|
-
return typeof (e == null ? void 0 : e.focusedPage) > "u" &&
|
|
158
|
-
},
|
|
159
|
-
const { initialPage: t = 1 } =
|
|
160
|
-
return
|
|
157
|
+
return typeof (e == null ? void 0 : e.focusedPage) > "u" && gr.error("Please use this hooks inside children component of RPController or RPLayout"), e;
|
|
158
|
+
}, Us = ({ children: e }) => {
|
|
159
|
+
const { initialPage: t = 1 } = Zn(), { pdf: n } = re(), { focusedPage: r, totalPages: o, setFocusedPage: a, setTotalPages: c, goToPage: i, nextPage: l, prevPage: p } = Vr(t);
|
|
160
|
+
return z(() => {
|
|
161
161
|
n != null && n.numPages && c(n.numPages);
|
|
162
|
-
}, [n, c, o, t]),
|
|
162
|
+
}, [n, c, o, t]), z(() => {
|
|
163
163
|
requestAnimationFrame(() => {
|
|
164
164
|
i(t);
|
|
165
165
|
});
|
|
@@ -179,20 +179,20 @@ import './assets/RPDefaultLayout.css';const nn = () => {
|
|
|
179
179
|
}
|
|
180
180
|
);
|
|
181
181
|
};
|
|
182
|
-
const
|
|
183
|
-
const { pdf: e, pages: t } =
|
|
182
|
+
const Ur = () => {
|
|
183
|
+
const { pdf: e, pages: t } = re(), [n, r] = H({
|
|
184
184
|
loadedPages: 0,
|
|
185
185
|
totalPages: 0,
|
|
186
186
|
percentage: 0
|
|
187
|
-
}), [o, a] =
|
|
188
|
-
|
|
187
|
+
}), [o, a] = H(!1), [c, i] = H(!1), [l, p] = H(null), h = W(!1);
|
|
188
|
+
z(() => {
|
|
189
189
|
h.current;
|
|
190
190
|
}, [h]);
|
|
191
|
-
const f =
|
|
191
|
+
const f = x(() => {
|
|
192
192
|
document.documentElement.classList.remove("rp-print-html-printing"), document.body.classList.remove("rp-print-body-printing");
|
|
193
193
|
const P = document.querySelector(".rp-print-zone");
|
|
194
194
|
P && P.remove();
|
|
195
|
-
}, []), u =
|
|
195
|
+
}, []), u = x(() => {
|
|
196
196
|
h.current = !1, a(!1), i(!1), p(null), r({
|
|
197
197
|
loadedPages: 0,
|
|
198
198
|
totalPages: 0,
|
|
@@ -207,39 +207,39 @@ const Gr = () => {
|
|
|
207
207
|
viewerPdfPage: b,
|
|
208
208
|
printResolution: w,
|
|
209
209
|
optionalContentConfigPromise: T,
|
|
210
|
-
printAnnotationStoragePromise:
|
|
210
|
+
printAnnotationStoragePromise: E
|
|
211
211
|
}) => {
|
|
212
212
|
if (h.current) {
|
|
213
213
|
u();
|
|
214
214
|
return;
|
|
215
215
|
}
|
|
216
|
-
const I = w /
|
|
216
|
+
const I = w / Xn.PDF;
|
|
217
217
|
P.width = Math.floor(b.width * I), P.height = Math.floor(b.height * I);
|
|
218
|
-
const
|
|
219
|
-
|
|
220
|
-
const [
|
|
218
|
+
const y = P.getContext("2d");
|
|
219
|
+
y.save(), y.fillStyle = "rgb(255, 255, 255)", y.fillRect(0, 0, P.width, P.height), y.restore();
|
|
220
|
+
const [D, R] = await Promise.all([
|
|
221
221
|
L.getPage(d),
|
|
222
|
-
|
|
222
|
+
E
|
|
223
223
|
]);
|
|
224
224
|
if (h.current) {
|
|
225
225
|
u();
|
|
226
226
|
return;
|
|
227
227
|
}
|
|
228
228
|
const N = {
|
|
229
|
-
canvasContext:
|
|
229
|
+
canvasContext: y,
|
|
230
230
|
transform: [I, 0, 0, I, 0, 0],
|
|
231
|
-
viewport:
|
|
231
|
+
viewport: D.getViewport({ scale: 1, rotation: b.rotation }),
|
|
232
232
|
intent: "print",
|
|
233
|
-
annotationMode:
|
|
233
|
+
annotationMode: Jn.ENABLE_STORAGE,
|
|
234
234
|
optionalContentConfigPromise: T,
|
|
235
|
-
printAnnotationStorage:
|
|
235
|
+
printAnnotationStorage: R
|
|
236
236
|
};
|
|
237
237
|
try {
|
|
238
|
-
return
|
|
238
|
+
return D.render(N).promise;
|
|
239
239
|
} catch (M) {
|
|
240
|
-
throw M instanceof
|
|
240
|
+
throw M instanceof Yn || console.error(M), M;
|
|
241
241
|
}
|
|
242
|
-
}, _ =
|
|
242
|
+
}, _ = x(() => {
|
|
243
243
|
const P = window.print;
|
|
244
244
|
return new Promise((L) => {
|
|
245
245
|
const d = (T) => {
|
|
@@ -271,11 +271,11 @@ const Gr = () => {
|
|
|
271
271
|
d.classList.add("rp-print-zone");
|
|
272
272
|
const b = document.createElement("style"), w = L.get(1);
|
|
273
273
|
if (w) {
|
|
274
|
-
const { width: T, height:
|
|
275
|
-
b.innerHTML = `@page { size: ${T}px ${
|
|
274
|
+
const { width: T, height: E } = w == null ? void 0 : w.page.getViewport({ scale: 1 });
|
|
275
|
+
b.innerHTML = `@page { size: ${T}px ${E}px }`;
|
|
276
276
|
}
|
|
277
277
|
return d.appendChild(b), d.append(...P), d;
|
|
278
|
-
},
|
|
278
|
+
}, S = x(async () => {
|
|
279
279
|
if (!e)
|
|
280
280
|
return;
|
|
281
281
|
u();
|
|
@@ -285,17 +285,17 @@ const Gr = () => {
|
|
|
285
285
|
const b = e.getOptionalContentConfig({ intent: "print" }), w = Promise.resolve(
|
|
286
286
|
e.annotationStorage.print ?? void 0
|
|
287
287
|
), T = t.size;
|
|
288
|
-
for (const [I,
|
|
288
|
+
for (const [I, y] of t) {
|
|
289
289
|
if (h.current) {
|
|
290
290
|
u();
|
|
291
291
|
return;
|
|
292
292
|
}
|
|
293
|
-
const
|
|
293
|
+
const D = y.page.getViewport({ scale: 1 });
|
|
294
294
|
if (await g({
|
|
295
295
|
scratchCanvas: P,
|
|
296
296
|
pdfDocument: e,
|
|
297
297
|
pageNumber: I,
|
|
298
|
-
viewerPdfPage:
|
|
298
|
+
viewerPdfPage: D,
|
|
299
299
|
printResolution: 150,
|
|
300
300
|
optionalContentConfigPromise: b,
|
|
301
301
|
printAnnotationStoragePromise: w
|
|
@@ -303,8 +303,8 @@ const Gr = () => {
|
|
|
303
303
|
u();
|
|
304
304
|
return;
|
|
305
305
|
}
|
|
306
|
-
const
|
|
307
|
-
L.push(
|
|
306
|
+
const R = await v(P);
|
|
307
|
+
L.push(R);
|
|
308
308
|
const N = parseFloat((L.length / T * 100).toFixed(2));
|
|
309
309
|
r({
|
|
310
310
|
loadedPages: I,
|
|
@@ -316,15 +316,15 @@ const Gr = () => {
|
|
|
316
316
|
u();
|
|
317
317
|
return;
|
|
318
318
|
}
|
|
319
|
-
const
|
|
320
|
-
document.body.appendChild(
|
|
319
|
+
const E = C(L, t);
|
|
320
|
+
document.body.appendChild(E), document.documentElement.classList.add("rp-print-html-printing"), document.body.classList.add("rp-print-body-printing"), a(!0), await _();
|
|
321
321
|
} catch (d) {
|
|
322
322
|
i(!0), d instanceof Error && p(d);
|
|
323
323
|
} finally {
|
|
324
324
|
P.height = 0, P.width = 0;
|
|
325
325
|
}
|
|
326
326
|
}, [e, t, h]);
|
|
327
|
-
return
|
|
327
|
+
return z(() => {
|
|
328
328
|
const P = () => {
|
|
329
329
|
u(), f();
|
|
330
330
|
};
|
|
@@ -332,7 +332,7 @@ const Gr = () => {
|
|
|
332
332
|
window.removeEventListener("afterprint", P, !0);
|
|
333
333
|
};
|
|
334
334
|
}, [f, u]), {
|
|
335
|
-
print:
|
|
335
|
+
print: S,
|
|
336
336
|
cancel: m,
|
|
337
337
|
progress: n,
|
|
338
338
|
isComplete: o,
|
|
@@ -356,24 +356,24 @@ const Gr = () => {
|
|
|
356
356
|
console.error("Error in setOnError callback:", t);
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
|
-
}),
|
|
360
|
-
const [t, n] =
|
|
359
|
+
}), qs = ({ children: e }) => {
|
|
360
|
+
const [t, n] = H(null), [r, o] = H(null), { print: a, cancel: c, progress: i, isComplete: l, isError: p, error: h } = Ur(), f = x((v) => {
|
|
361
361
|
v && typeof v == "function" && o(() => v);
|
|
362
362
|
}, []), u = (v) => {
|
|
363
363
|
h && v(h);
|
|
364
|
-
}, m =
|
|
364
|
+
}, m = x(
|
|
365
365
|
(v) => {
|
|
366
366
|
n(() => v);
|
|
367
367
|
},
|
|
368
368
|
[i, t]
|
|
369
369
|
);
|
|
370
|
-
|
|
370
|
+
z(() => {
|
|
371
371
|
l && r && g();
|
|
372
|
-
}, [l, r]),
|
|
372
|
+
}, [l, r]), z(() => {
|
|
373
373
|
p && u((v) => {
|
|
374
374
|
console.error(v);
|
|
375
375
|
});
|
|
376
|
-
}, [p]),
|
|
376
|
+
}, [p]), z(() => {
|
|
377
377
|
i && t && t(i);
|
|
378
378
|
}, [i, t]);
|
|
379
379
|
const g = () => {
|
|
@@ -392,8 +392,8 @@ const Gr = () => {
|
|
|
392
392
|
if (!e)
|
|
393
393
|
throw new Error("usePrintContext must be used within a PrintProvider");
|
|
394
394
|
return e;
|
|
395
|
-
},
|
|
396
|
-
const [e, t] =
|
|
395
|
+
}, qr = () => {
|
|
396
|
+
const [e, t] = H({}), { pages: n } = re(), { rotate: r } = Ge(), o = A(() => Object.keys(e).length, [e]), a = x(
|
|
397
397
|
(i) => {
|
|
398
398
|
if (!n.size)
|
|
399
399
|
return;
|
|
@@ -434,10 +434,10 @@ const Gr = () => {
|
|
|
434
434
|
},
|
|
435
435
|
[n, r]
|
|
436
436
|
);
|
|
437
|
-
|
|
437
|
+
z(() => {
|
|
438
438
|
a(10);
|
|
439
439
|
}, [a]);
|
|
440
|
-
const c =
|
|
440
|
+
const c = x(
|
|
441
441
|
(i) => {
|
|
442
442
|
if (!n)
|
|
443
443
|
return;
|
|
@@ -480,11 +480,11 @@ const Gr = () => {
|
|
|
480
480
|
setActive: (e) => {
|
|
481
481
|
},
|
|
482
482
|
active: !1
|
|
483
|
-
}), sn = () => He(an),
|
|
483
|
+
}), sn = () => He(an), Zs = ({
|
|
484
484
|
children: e,
|
|
485
485
|
initialThumbnailsVisible: t
|
|
486
486
|
}) => {
|
|
487
|
-
const { thumbnailPages: n, addPage: r, addToPage: o, thumbnailLength: a } =
|
|
487
|
+
const { thumbnailPages: n, addPage: r, addToPage: o, thumbnailLength: a } = qr(), [c, i] = H(t);
|
|
488
488
|
return /* @__PURE__ */ s(
|
|
489
489
|
an.Provider,
|
|
490
490
|
{
|
|
@@ -492,34 +492,34 @@ const Gr = () => {
|
|
|
492
492
|
children: e
|
|
493
493
|
}
|
|
494
494
|
);
|
|
495
|
-
},
|
|
496
|
-
const [n, r] =
|
|
497
|
-
|
|
495
|
+
}, Zr = (e = {}, t = "") => {
|
|
496
|
+
const [n, r] = H(t), [o, a] = H(!1), { pdf: c, pages: i } = re(), l = ht(), p = W(!n), { currentZoom: h } = Ve(), [f, u] = H([]), { setFocusedPage: m } = oe(), [g, _] = H(0), { pageScrollElementRef: v, virtualScrollableElementRef: C } = qe(), { scrollMode: S } = Te(), [P, L] = H(null), d = W({}), b = A(() => g === 0 ? null : f[g - 1], [g, f]), w = A(() => f.length, [f]);
|
|
497
|
+
z(() => {
|
|
498
498
|
if (!b || !i)
|
|
499
499
|
return;
|
|
500
|
-
const
|
|
501
|
-
if (!
|
|
500
|
+
const y = C || v;
|
|
501
|
+
if (!y)
|
|
502
502
|
return;
|
|
503
|
-
const
|
|
504
|
-
let M = 0,
|
|
505
|
-
|
|
506
|
-
let
|
|
507
|
-
if (!
|
|
503
|
+
const D = i.get(b.page), R = y.clientHeight / 2, N = y.clientWidth / 2;
|
|
504
|
+
let M = 0, F = 0;
|
|
505
|
+
S === J.PAGE_SCROLLING && m(b.page), S === J.VERTICAL_SCROLLING && (M = l.heights.slice(0, b.page - 1).reduce((U, Z) => U + Z, 0)), S === J.HORIZONTAL_SCROLLING && (F = l.widths.slice(0, b.page - 1).reduce((U, Z) => U + Z, 0));
|
|
506
|
+
let $;
|
|
507
|
+
if (!D)
|
|
508
508
|
return;
|
|
509
|
-
const q = d.current[b.page],
|
|
510
|
-
|
|
511
|
-
viewport:
|
|
509
|
+
const q = d.current[b.page], K = D.page.getViewport({ scale: 1 });
|
|
510
|
+
$ = new Jt.TextLayer({
|
|
511
|
+
viewport: K,
|
|
512
512
|
textContentSource: q,
|
|
513
513
|
container: document.createElement("div")
|
|
514
|
-
}),
|
|
515
|
-
const U =
|
|
516
|
-
U.style.position = "absolute", U.style.color = "transparent", Y.style.position = "absolute", Y.style.top = "0", Y.style.setProperty("--scale-factor", `${h}`),
|
|
517
|
-
const
|
|
518
|
-
left:
|
|
519
|
-
top:
|
|
514
|
+
}), $.render().then(() => {
|
|
515
|
+
const U = $.textDivs[b.start.idx], [Z] = Xt([b], q, $.textDivs), se = l.widths[b.page - 1], pe = l.heights[b.page - 1], j = document.createElement("div"), Y = document.createElement("div");
|
|
516
|
+
U.style.position = "absolute", U.style.color = "transparent", Y.style.position = "absolute", Y.style.top = "0", Y.style.setProperty("--scale-factor", `${h}`), j.style.position = "relative", j.style.width = `${se}px`, j.style.height = `${pe}px`, j.style.zIndex = "-1", j.appendChild(U), Y.appendChild(j), document.body.prepend(Y);
|
|
517
|
+
const he = Z.element.getBoundingClientRect(), we = M + +he.top - R + he.height / 2, G = {
|
|
518
|
+
left: F + +he.left - N + he.width / 2,
|
|
519
|
+
top: we
|
|
520
520
|
};
|
|
521
|
-
document.body.removeChild(Y),
|
|
522
|
-
...
|
|
521
|
+
document.body.removeChild(Y), y.scrollTo({
|
|
522
|
+
...G
|
|
523
523
|
});
|
|
524
524
|
});
|
|
525
525
|
}, [
|
|
@@ -527,43 +527,43 @@ const Gr = () => {
|
|
|
527
527
|
m,
|
|
528
528
|
l,
|
|
529
529
|
b,
|
|
530
|
-
|
|
530
|
+
S,
|
|
531
531
|
C,
|
|
532
532
|
v
|
|
533
533
|
]);
|
|
534
|
-
const T =
|
|
535
|
-
_((
|
|
536
|
-
}, [w]),
|
|
537
|
-
_((
|
|
538
|
-
}, [w]), I =
|
|
539
|
-
if (!
|
|
534
|
+
const T = x(() => {
|
|
535
|
+
_((y) => w ? y + 1 > w ? 1 : y + 1 : 0);
|
|
536
|
+
}, [w]), E = x(() => {
|
|
537
|
+
_((y) => w ? y - 1 <= 0 ? w : y - 1 : 0);
|
|
538
|
+
}, [w]), I = x(async (y) => {
|
|
539
|
+
if (!y)
|
|
540
540
|
return {};
|
|
541
|
-
const
|
|
542
|
-
for (let N = 1; N <=
|
|
541
|
+
const D = y.numPages, R = {};
|
|
542
|
+
for (let N = 1; N <= D; N++) {
|
|
543
543
|
if (p.current)
|
|
544
544
|
throw "close pop over";
|
|
545
|
-
const M = await
|
|
546
|
-
|
|
545
|
+
const M = await y.getPage(N);
|
|
546
|
+
R[N.toString()] = await M.getTextContent();
|
|
547
547
|
}
|
|
548
|
-
return
|
|
548
|
+
return R;
|
|
549
549
|
}, []);
|
|
550
|
-
return
|
|
550
|
+
return z(() => {
|
|
551
551
|
if (!n) {
|
|
552
552
|
p.current = !0, u([]), _(0);
|
|
553
553
|
return;
|
|
554
554
|
}
|
|
555
|
-
p.current = !1, a(!0), u([]), _(0), I(c).then((
|
|
556
|
-
d.current =
|
|
557
|
-
const
|
|
558
|
-
const
|
|
555
|
+
p.current = !1, a(!0), u([]), _(0), I(c).then((y) => {
|
|
556
|
+
d.current = y;
|
|
557
|
+
const R = Object.keys(y).reduce((N, M) => {
|
|
558
|
+
const F = Bn(
|
|
559
559
|
[n],
|
|
560
|
-
|
|
560
|
+
y[M],
|
|
561
561
|
Number(M) - 1,
|
|
562
562
|
e
|
|
563
|
-
).map((
|
|
564
|
-
return [...N, ...
|
|
563
|
+
).map(($, q) => ({ ...$, page: Number(M), pageMatchIdx: q }));
|
|
564
|
+
return [...N, ...F];
|
|
565
565
|
}, []);
|
|
566
|
-
u(
|
|
566
|
+
u(R), _(R.length ? 1 : 0);
|
|
567
567
|
}).catch(() => {
|
|
568
568
|
u([]), _(0);
|
|
569
569
|
}).finally(() => a(!1));
|
|
@@ -576,7 +576,7 @@ const Gr = () => {
|
|
|
576
576
|
currentMatchPosition: g,
|
|
577
577
|
currentMatch: b,
|
|
578
578
|
nextMatch: T,
|
|
579
|
-
prevMatch:
|
|
579
|
+
prevMatch: E,
|
|
580
580
|
currentMatchElement: P,
|
|
581
581
|
setCurrentMatchElement: L
|
|
582
582
|
};
|
|
@@ -598,11 +598,11 @@ const Gr = () => {
|
|
|
598
598
|
currentMatchElement: null,
|
|
599
599
|
setCurrentMatchElement: (e) => {
|
|
600
600
|
}
|
|
601
|
-
}),
|
|
601
|
+
}), js = ({
|
|
602
602
|
children: e,
|
|
603
603
|
initialSearch: t
|
|
604
604
|
}) => {
|
|
605
|
-
const [n, r] =
|
|
605
|
+
const [n, r] = H({}), {
|
|
606
606
|
loading: o,
|
|
607
607
|
setSearch: a,
|
|
608
608
|
totalMatches: c,
|
|
@@ -614,7 +614,7 @@ const Gr = () => {
|
|
|
614
614
|
prevMatch: u,
|
|
615
615
|
currentMatchElement: m,
|
|
616
616
|
setCurrentMatchElement: g
|
|
617
|
-
} =
|
|
617
|
+
} = Zr(n, t);
|
|
618
618
|
return /* @__PURE__ */ s(
|
|
619
619
|
cn.Provider,
|
|
620
620
|
{
|
|
@@ -648,9 +648,9 @@ const Gr = () => {
|
|
|
648
648
|
"rp-page-wrapper": "_rp-page-wrapper_h7a2q_1",
|
|
649
649
|
"rp-page": "_rp-page_h7a2q_1",
|
|
650
650
|
"rp-loader-wrapper": "_rp-loader-wrapper_h7a2q_14"
|
|
651
|
-
},
|
|
652
|
-
const { pageNumber: t, onLoaded: n, onLoading: r } = e, o =
|
|
653
|
-
return
|
|
651
|
+
}, jr = (e) => {
|
|
652
|
+
const { pageNumber: t, onLoaded: n, onLoading: r } = e, o = W(null), { pages: a } = re(), { rotate: c } = Ge(), i = W(), { currentZoom: l } = Ve();
|
|
653
|
+
return z(() => {
|
|
654
654
|
if (!a || l === 0)
|
|
655
655
|
return;
|
|
656
656
|
const p = a.get(t);
|
|
@@ -669,12 +669,12 @@ const Gr = () => {
|
|
|
669
669
|
}, Je = {
|
|
670
670
|
"rp-text-layer": "_rp-text-layer_1mgyz_1",
|
|
671
671
|
"rp-text-layer-text": "_rp-text-layer-text_1mgyz_9"
|
|
672
|
-
},
|
|
673
|
-
const { pageNumber: t } = e, { pages: n } =
|
|
672
|
+
}, Br = (e) => {
|
|
673
|
+
const { pageNumber: t } = e, { pages: n } = re(), r = W(null), { matches: o, currentMatch: a, setCurrentMatchElement: c } = ln(), [i, l] = H(
|
|
674
674
|
[]
|
|
675
|
-
), p =
|
|
675
|
+
), p = W(), h = W(), f = W(), u = A(() => o.filter((g) => g.pageIndex === t - 1), [o, t]), m = x(
|
|
676
676
|
(g, _, v = !1) => {
|
|
677
|
-
if (v &&
|
|
677
|
+
if (v && Kn(g, _), !u.length) {
|
|
678
678
|
f.current = void 0, l([]);
|
|
679
679
|
return;
|
|
680
680
|
}
|
|
@@ -683,7 +683,7 @@ const Gr = () => {
|
|
|
683
683
|
},
|
|
684
684
|
[u]
|
|
685
685
|
);
|
|
686
|
-
return
|
|
686
|
+
return z(() => {
|
|
687
687
|
var v;
|
|
688
688
|
if ((v = f.current) == null || v.classList.remove("selected"), !i.length || !a || a.pageIndex !== t - 1)
|
|
689
689
|
return;
|
|
@@ -694,7 +694,7 @@ const Gr = () => {
|
|
|
694
694
|
return;
|
|
695
695
|
const _ = i.find((C) => C.index === g);
|
|
696
696
|
_ && (f.current = _.element, c(_.element), _.element.classList.add("selected"));
|
|
697
|
-
}, [a, i, u]),
|
|
697
|
+
}, [a, i, u]), z(() => {
|
|
698
698
|
const g = n.get(t);
|
|
699
699
|
if (!(!g || !r.current))
|
|
700
700
|
return p.current && p.current.cancel(), g.page.getTextContent().then((_) => {
|
|
@@ -706,8 +706,8 @@ const Gr = () => {
|
|
|
706
706
|
}), h.current = _, r.current && (r.current.innerText = ""), p.current.render();
|
|
707
707
|
}).then(() => {
|
|
708
708
|
var C;
|
|
709
|
-
[].slice.call(r.current.children).forEach((
|
|
710
|
-
|
|
709
|
+
[].slice.call(r.current.children).forEach((S) => {
|
|
710
|
+
S.classList.add(Je["rp-text-layer-text"]);
|
|
711
711
|
});
|
|
712
712
|
const v = (C = p.current) == null ? void 0 : C.textDivs;
|
|
713
713
|
v && h.current && m(h.current, v);
|
|
@@ -716,7 +716,7 @@ const Gr = () => {
|
|
|
716
716
|
var _;
|
|
717
717
|
(_ = p.current) == null || _.cancel();
|
|
718
718
|
};
|
|
719
|
-
}, [n, t]),
|
|
719
|
+
}, [n, t]), z(() => {
|
|
720
720
|
var v;
|
|
721
721
|
[].slice.call(r.current.children).forEach((C) => {
|
|
722
722
|
C.classList.add(Je["rp-text-layer-text"]);
|
|
@@ -731,16 +731,16 @@ const Gr = () => {
|
|
|
731
731
|
ref: r
|
|
732
732
|
}
|
|
733
733
|
);
|
|
734
|
-
},
|
|
734
|
+
}, Kr = {
|
|
735
735
|
"rp-annotation-layer": "_rp-annotation-layer_o0ksd_1"
|
|
736
736
|
}, un = ["click", "dblclick", "mouseover", "input", "change"];
|
|
737
|
-
let
|
|
737
|
+
let Xr = "https://unpkg.com/pdfjs-dist@4.4.168/web/images/";
|
|
738
738
|
const ct = /* @__PURE__ */ new Map(), dn = (e, t) => `${e.loadingTask.docId}___${t.num}R${t.gen === 0 ? "" : t.gen}`;
|
|
739
|
-
function
|
|
739
|
+
function Jr(e, t) {
|
|
740
740
|
const n = dn(e, t);
|
|
741
741
|
return ct.has(n) ? ct.get(n) ?? null : null;
|
|
742
742
|
}
|
|
743
|
-
const
|
|
743
|
+
const Yr = (e, t, n) => {
|
|
744
744
|
ct.set(dn(e, t), n);
|
|
745
745
|
}, Rt = (e, t) => {
|
|
746
746
|
switch (t[1].name) {
|
|
@@ -779,26 +779,26 @@ const Xr = (e, t, n) => {
|
|
|
779
779
|
async function pn(e, t) {
|
|
780
780
|
let n;
|
|
781
781
|
if (typeof t == "string" ? n = await e.getDestination(t) : n = t, n && typeof n[0] == "object" && n[0] !== null) {
|
|
782
|
-
const r = n[0], o =
|
|
782
|
+
const r = n[0], o = Jr(e, r);
|
|
783
783
|
if (o === null) {
|
|
784
784
|
const a = await e.getPageIndex(r);
|
|
785
|
-
return
|
|
785
|
+
return Yr(e, r, a), await pn(e, n);
|
|
786
786
|
} else
|
|
787
787
|
return Rt(o, n);
|
|
788
788
|
} else
|
|
789
789
|
return Rt(n[0], n);
|
|
790
790
|
}
|
|
791
|
-
function
|
|
791
|
+
function Qr(e) {
|
|
792
792
|
const { id: t, url: n, unsafeUrl: r } = e;
|
|
793
793
|
new MutationObserver((a, c) => {
|
|
794
794
|
const i = document.querySelector(`[data-annotation-id="${t}"]`);
|
|
795
795
|
if (i) {
|
|
796
|
-
const l = i.querySelector("a"), p =
|
|
796
|
+
const l = i.querySelector("a"), p = ur((n || r) ?? "", "");
|
|
797
797
|
l && (l.setAttribute("target", "_blank"), l.setAttribute("href", p), l.setAttribute("rel", "noopener noreferrer")), c.disconnect();
|
|
798
798
|
}
|
|
799
799
|
}).observe(document.body, { childList: !0, subtree: !0 });
|
|
800
800
|
}
|
|
801
|
-
const
|
|
801
|
+
const eo = (e) => {
|
|
802
802
|
const n = e.target.parentNode;
|
|
803
803
|
if (!n)
|
|
804
804
|
return;
|
|
@@ -836,7 +836,7 @@ const Yr = (e) => {
|
|
|
836
836
|
r(l);
|
|
837
837
|
});
|
|
838
838
|
};
|
|
839
|
-
function
|
|
839
|
+
function to(e, t) {
|
|
840
840
|
for (const n of un)
|
|
841
841
|
e.addEventListener(n, t);
|
|
842
842
|
}
|
|
@@ -844,24 +844,24 @@ function Nt(e, t) {
|
|
|
844
844
|
for (const n of un)
|
|
845
845
|
e.removeEventListener(n, t);
|
|
846
846
|
}
|
|
847
|
-
const
|
|
848
|
-
const { pageNumber: t } = e, n =
|
|
849
|
-
|
|
847
|
+
const no = (e) => {
|
|
848
|
+
const { pageNumber: t } = e, n = W(null), { pages: r, pdf: o } = re(), a = W(), [c, i] = H(), { setFocusedPage: l, goToPage: p } = oe(), { scrollMode: h } = Te(), f = A(() => r.get(t), [r, t]), u = A(() => f == null ? void 0 : f.page.getViewport(), [f]);
|
|
849
|
+
z(() => {
|
|
850
850
|
a.current && (a.current.div.replaceChildren(), a.current = void 0);
|
|
851
851
|
}, [o]);
|
|
852
852
|
const m = A(() => o == null ? void 0 : o.annotationStorage, [o]);
|
|
853
|
-
|
|
853
|
+
z(() => {
|
|
854
854
|
f && f.page.getAnnotations().then((_) => {
|
|
855
855
|
a.current = void 0, i(_), n.current && (n.current.innerText = "");
|
|
856
856
|
});
|
|
857
857
|
}, [f]);
|
|
858
|
-
const g =
|
|
858
|
+
const g = x(
|
|
859
859
|
(_) => {
|
|
860
|
-
|
|
860
|
+
eo(_), !(!c || !o) && (h === J.PAGE_SCROLLING ? Lt(_, c, o, (v) => l(v.pageIndex + 1)) : Lt(_, c, o, (v) => p(v.pageIndex + 1)));
|
|
861
861
|
},
|
|
862
862
|
[o, c, p, l, h]
|
|
863
863
|
);
|
|
864
|
-
return
|
|
864
|
+
return z(() => {
|
|
865
865
|
if (!f || !c)
|
|
866
866
|
return;
|
|
867
867
|
const _ = f.page.getViewport();
|
|
@@ -872,17 +872,17 @@ const eo = (e) => {
|
|
|
872
872
|
return;
|
|
873
873
|
}
|
|
874
874
|
for (const C of c) {
|
|
875
|
-
const { annotationType:
|
|
876
|
-
switch (
|
|
875
|
+
const { annotationType: S } = C;
|
|
876
|
+
switch (S) {
|
|
877
877
|
case at.Link:
|
|
878
|
-
|
|
878
|
+
Qr(C);
|
|
879
879
|
break;
|
|
880
880
|
case at.Widget:
|
|
881
881
|
break;
|
|
882
882
|
}
|
|
883
883
|
}
|
|
884
884
|
return (async () => {
|
|
885
|
-
a.current = new
|
|
885
|
+
a.current = new Qn({
|
|
886
886
|
div: n.current,
|
|
887
887
|
accessibilityManager: void 0,
|
|
888
888
|
annotationCanvasMap: void 0,
|
|
@@ -891,23 +891,23 @@ const eo = (e) => {
|
|
|
891
891
|
page: f.page,
|
|
892
892
|
viewport: _.clone({ dontFlip: !0 })
|
|
893
893
|
}), n.current && Nt(n.current, g);
|
|
894
|
-
const C = await (o == null ? void 0 : o.hasJSActions()),
|
|
894
|
+
const C = await (o == null ? void 0 : o.hasJSActions()), S = await (o == null ? void 0 : o.getFieldObjects());
|
|
895
895
|
return a.current.render({
|
|
896
896
|
annotations: c,
|
|
897
897
|
annotationStorage: m,
|
|
898
898
|
hasJSActions: C,
|
|
899
|
-
fieldObjects:
|
|
899
|
+
fieldObjects: S,
|
|
900
900
|
div: n.current,
|
|
901
901
|
viewport: _.clone({ dontFlip: !0 }),
|
|
902
902
|
page: f.page,
|
|
903
|
-
imageResourcesPath:
|
|
903
|
+
imageResourcesPath: Xr,
|
|
904
904
|
renderForms: !1,
|
|
905
|
-
linkService: new
|
|
905
|
+
linkService: new lr(),
|
|
906
906
|
downloadManager: null,
|
|
907
907
|
enableScripting: !1
|
|
908
908
|
});
|
|
909
909
|
})().then(() => {
|
|
910
|
-
n.current &&
|
|
910
|
+
n.current && to(n.current, g);
|
|
911
911
|
}), () => {
|
|
912
912
|
n.current && Nt(n.current, g);
|
|
913
913
|
};
|
|
@@ -916,16 +916,16 @@ const eo = (e) => {
|
|
|
916
916
|
{
|
|
917
917
|
"data-rp": `page-${t}-annotationLayer`,
|
|
918
918
|
style: { width: `${u == null ? void 0 : u.width}px`, height: `${u == null ? void 0 : u.height}px` },
|
|
919
|
-
className:
|
|
919
|
+
className: Kr["rp-annotation-layer"],
|
|
920
920
|
ref: n
|
|
921
921
|
}
|
|
922
922
|
);
|
|
923
|
-
},
|
|
924
|
-
const { pageNumber: n, style: r, onIntersectRatioChange: o, ...a } = e, { pages: c } =
|
|
923
|
+
}, ro = Array.from({ length: 21 }, (e, t) => Number((t * 0.05).toFixed(2))), bt = $e((e, t) => {
|
|
924
|
+
const { pageNumber: n, style: r, onIntersectRatioChange: o, ...a } = e, { pages: c } = re(), { rotate: i } = Ge(), { textLayer: l } = Un(), { currentZoom: p } = Ve(), h = W(c.get(n)), [f, u] = H(!1), m = W(null), [g, _] = H({
|
|
925
925
|
width: 0,
|
|
926
926
|
height: 0
|
|
927
927
|
});
|
|
928
|
-
Zt(t, () => m.current),
|
|
928
|
+
Zt(t, () => m.current), z(() => {
|
|
929
929
|
if (c && (h.current = c.get(n), h.current)) {
|
|
930
930
|
const P = h.current.page.getViewport({ scale: p, rotation: i });
|
|
931
931
|
_(P);
|
|
@@ -941,17 +941,17 @@ const eo = (e) => {
|
|
|
941
941
|
default:
|
|
942
942
|
return "center";
|
|
943
943
|
}
|
|
944
|
-
}, [i, g]), C =
|
|
944
|
+
}, [i, g]), C = x(() => {
|
|
945
945
|
u(!0);
|
|
946
|
-
}, []),
|
|
946
|
+
}, []), S = x(() => {
|
|
947
947
|
u(!1);
|
|
948
948
|
}, []);
|
|
949
|
-
return
|
|
949
|
+
return z(() => {
|
|
950
950
|
const P = new IntersectionObserver(
|
|
951
951
|
(L) => {
|
|
952
952
|
o && o(n, L[0].intersectionRatio);
|
|
953
953
|
},
|
|
954
|
-
{ threshold:
|
|
954
|
+
{ threshold: ro }
|
|
955
955
|
);
|
|
956
956
|
return m.current && P.observe(m.current), () => {
|
|
957
957
|
P.disconnect(), o && o(n, -1);
|
|
@@ -979,10 +979,10 @@ const eo = (e) => {
|
|
|
979
979
|
},
|
|
980
980
|
className: Xe["rp-page"],
|
|
981
981
|
children: [
|
|
982
|
-
/* @__PURE__ */ s(
|
|
982
|
+
/* @__PURE__ */ s(jr, { onLoading: C, onLoaded: S, pageNumber: n }),
|
|
983
983
|
f && /* @__PURE__ */ s("div", { className: Xe["rp-loader-wrapper"], children: /* @__PURE__ */ s(mt, {}) }),
|
|
984
|
-
l && /* @__PURE__ */ s(
|
|
985
|
-
/* @__PURE__ */ s(
|
|
984
|
+
l && /* @__PURE__ */ s(Br, { pageNumber: n }),
|
|
985
|
+
/* @__PURE__ */ s(no, { pageNumber: n })
|
|
986
986
|
]
|
|
987
987
|
}
|
|
988
988
|
)
|
|
@@ -1009,25 +1009,25 @@ function ut(e, t) {
|
|
|
1009
1009
|
return n.__proto__ = r, n;
|
|
1010
1010
|
}, ut(e, t);
|
|
1011
1011
|
}
|
|
1012
|
-
function
|
|
1012
|
+
function oo(e, t) {
|
|
1013
1013
|
e.prototype = Object.create(t.prototype), e.prototype.constructor = e, ut(e, t);
|
|
1014
1014
|
}
|
|
1015
1015
|
var Et = Number.isNaN || function(t) {
|
|
1016
1016
|
return typeof t == "number" && t !== t;
|
|
1017
1017
|
};
|
|
1018
|
-
function
|
|
1018
|
+
function ao(e, t) {
|
|
1019
1019
|
return !!(e === t || Et(e) && Et(t));
|
|
1020
1020
|
}
|
|
1021
|
-
function
|
|
1021
|
+
function so(e, t) {
|
|
1022
1022
|
if (e.length !== t.length)
|
|
1023
1023
|
return !1;
|
|
1024
1024
|
for (var n = 0; n < e.length; n++)
|
|
1025
|
-
if (!
|
|
1025
|
+
if (!ao(e[n], t[n]))
|
|
1026
1026
|
return !1;
|
|
1027
1027
|
return !0;
|
|
1028
1028
|
}
|
|
1029
1029
|
function Ye(e, t) {
|
|
1030
|
-
t === void 0 && (t =
|
|
1030
|
+
t === void 0 && (t = so);
|
|
1031
1031
|
var n, r = [], o, a = !1;
|
|
1032
1032
|
function c() {
|
|
1033
1033
|
for (var i = [], l = 0; l < arguments.length; l++)
|
|
@@ -1042,13 +1042,13 @@ function Ot(e, t) {
|
|
|
1042
1042
|
var n = {};
|
|
1043
1043
|
for (var r in e)
|
|
1044
1044
|
if ({}.hasOwnProperty.call(e, r)) {
|
|
1045
|
-
if (t.
|
|
1045
|
+
if (t.includes(r))
|
|
1046
1046
|
continue;
|
|
1047
1047
|
n[r] = e[r];
|
|
1048
1048
|
}
|
|
1049
1049
|
return n;
|
|
1050
1050
|
}
|
|
1051
|
-
var
|
|
1051
|
+
var io = typeof performance == "object" && typeof performance.now == "function", Dt = io ? function() {
|
|
1052
1052
|
return performance.now();
|
|
1053
1053
|
} : function() {
|
|
1054
1054
|
return Date.now();
|
|
@@ -1056,7 +1056,7 @@ var ao = typeof performance == "object" && typeof performance.now == "function",
|
|
|
1056
1056
|
function At(e) {
|
|
1057
1057
|
cancelAnimationFrame(e.id);
|
|
1058
1058
|
}
|
|
1059
|
-
function
|
|
1059
|
+
function co(e, t) {
|
|
1060
1060
|
var n = Dt();
|
|
1061
1061
|
function r() {
|
|
1062
1062
|
Dt() - n >= t ? e.call(null) : o.id = requestAnimationFrame(r);
|
|
@@ -1067,35 +1067,35 @@ function so(e, t) {
|
|
|
1067
1067
|
return o;
|
|
1068
1068
|
}
|
|
1069
1069
|
var Qe = -1;
|
|
1070
|
-
function
|
|
1070
|
+
function lo(e) {
|
|
1071
1071
|
if (e === void 0 && (e = !1), Qe === -1 || e) {
|
|
1072
1072
|
var t = document.createElement("div"), n = t.style;
|
|
1073
1073
|
n.width = "50px", n.height = "50px", n.overflow = "scroll", document.body.appendChild(t), Qe = t.offsetWidth - t.clientWidth, document.body.removeChild(t);
|
|
1074
1074
|
}
|
|
1075
1075
|
return Qe;
|
|
1076
1076
|
}
|
|
1077
|
-
var
|
|
1077
|
+
var Ce = null;
|
|
1078
1078
|
function zt(e) {
|
|
1079
|
-
if (e === void 0 && (e = !1),
|
|
1079
|
+
if (e === void 0 && (e = !1), Ce === null || e) {
|
|
1080
1080
|
var t = document.createElement("div"), n = t.style;
|
|
1081
1081
|
n.width = "50px", n.height = "50px", n.overflow = "scroll", n.direction = "rtl";
|
|
1082
1082
|
var r = document.createElement("div"), o = r.style;
|
|
1083
|
-
return o.width = "100px", o.height = "100px", t.appendChild(r), document.body.appendChild(t), t.scrollLeft > 0 ?
|
|
1083
|
+
return o.width = "100px", o.height = "100px", t.appendChild(r), document.body.appendChild(t), t.scrollLeft > 0 ? Ce = "positive-descending" : (t.scrollLeft = 1, t.scrollLeft === 0 ? Ce = "negative" : Ce = "positive-ascending"), document.body.removeChild(t), Ce;
|
|
1084
1084
|
}
|
|
1085
|
-
return
|
|
1085
|
+
return Ce;
|
|
1086
1086
|
}
|
|
1087
|
-
var
|
|
1087
|
+
var uo = 150, po = function(t) {
|
|
1088
1088
|
var n = t.columnIndex;
|
|
1089
1089
|
t.data;
|
|
1090
1090
|
var r = t.rowIndex;
|
|
1091
1091
|
return r + ":" + n;
|
|
1092
1092
|
}, Ee = null, Oe = null, De = null;
|
|
1093
1093
|
process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (Ee = /* @__PURE__ */ new WeakSet(), Oe = /* @__PURE__ */ new WeakSet(), De = /* @__PURE__ */ new WeakSet());
|
|
1094
|
-
function
|
|
1094
|
+
function ho(e) {
|
|
1095
1095
|
var t, n = e.getColumnOffset, r = e.getColumnStartIndexForOffset, o = e.getColumnStopIndexForStartIndex, a = e.getColumnWidth, c = e.getEstimatedTotalHeight, i = e.getEstimatedTotalWidth, l = e.getOffsetForColumnAndAlignment, p = e.getOffsetForRowAndAlignment, h = e.getRowHeight, f = e.getRowOffset, u = e.getRowStartIndexForOffset, m = e.getRowStopIndexForStartIndex, g = e.initInstanceProps, _ = e.shouldResetStyleCacheOnItemSizeChange, v = e.validateProps;
|
|
1096
1096
|
return t = /* @__PURE__ */ function(C) {
|
|
1097
|
-
|
|
1098
|
-
function
|
|
1097
|
+
oo(S, C);
|
|
1098
|
+
function S(L) {
|
|
1099
1099
|
var d;
|
|
1100
1100
|
return d = C.call(this, L) || this, d._instanceProps = g(d.props, Mt(d)), d._resetIsScrollingTimeoutId = null, d._outerRef = void 0, d.state = {
|
|
1101
1101
|
instance: Mt(d),
|
|
@@ -1105,35 +1105,35 @@ function uo(e) {
|
|
|
1105
1105
|
scrollTop: typeof d.props.initialScrollTop == "number" ? d.props.initialScrollTop : 0,
|
|
1106
1106
|
scrollUpdateWasRequested: !1,
|
|
1107
1107
|
verticalScrollDirection: "forward"
|
|
1108
|
-
}, d._callOnItemsRendered = void 0, d._callOnItemsRendered = Ye(function(b, w, T,
|
|
1108
|
+
}, d._callOnItemsRendered = void 0, d._callOnItemsRendered = Ye(function(b, w, T, E, I, y, D, R) {
|
|
1109
1109
|
return d.props.onItemsRendered({
|
|
1110
1110
|
overscanColumnStartIndex: b,
|
|
1111
1111
|
overscanColumnStopIndex: w,
|
|
1112
1112
|
overscanRowStartIndex: T,
|
|
1113
|
-
overscanRowStopIndex:
|
|
1113
|
+
overscanRowStopIndex: E,
|
|
1114
1114
|
visibleColumnStartIndex: I,
|
|
1115
|
-
visibleColumnStopIndex:
|
|
1116
|
-
visibleRowStartIndex:
|
|
1117
|
-
visibleRowStopIndex:
|
|
1115
|
+
visibleColumnStopIndex: y,
|
|
1116
|
+
visibleRowStartIndex: D,
|
|
1117
|
+
visibleRowStopIndex: R
|
|
1118
1118
|
});
|
|
1119
|
-
}), d._callOnScroll = void 0, d._callOnScroll = Ye(function(b, w, T,
|
|
1119
|
+
}), d._callOnScroll = void 0, d._callOnScroll = Ye(function(b, w, T, E, I) {
|
|
1120
1120
|
return d.props.onScroll({
|
|
1121
1121
|
horizontalScrollDirection: T,
|
|
1122
1122
|
scrollLeft: b,
|
|
1123
1123
|
scrollTop: w,
|
|
1124
|
-
verticalScrollDirection:
|
|
1124
|
+
verticalScrollDirection: E,
|
|
1125
1125
|
scrollUpdateWasRequested: I
|
|
1126
1126
|
});
|
|
1127
1127
|
}), d._getItemStyle = void 0, d._getItemStyle = function(b, w) {
|
|
1128
|
-
var T = d.props,
|
|
1129
|
-
if (
|
|
1130
|
-
N =
|
|
1128
|
+
var T = d.props, E = T.columnWidth, I = T.direction, y = T.rowHeight, D = d._getItemStyleCache(_ && E, _ && I, _ && y), R = b + ":" + w, N;
|
|
1129
|
+
if (D.hasOwnProperty(R))
|
|
1130
|
+
N = D[R];
|
|
1131
1131
|
else {
|
|
1132
|
-
var M = n(d.props, w, d._instanceProps),
|
|
1133
|
-
|
|
1132
|
+
var M = n(d.props, w, d._instanceProps), F = I === "rtl";
|
|
1133
|
+
D[R] = N = {
|
|
1134
1134
|
position: "absolute",
|
|
1135
|
-
left:
|
|
1136
|
-
right:
|
|
1135
|
+
left: F ? void 0 : M,
|
|
1136
|
+
right: F ? M : void 0,
|
|
1137
1137
|
top: f(d.props, b, d._instanceProps),
|
|
1138
1138
|
height: h(d.props, b, d._instanceProps),
|
|
1139
1139
|
width: a(d.props, w, d._instanceProps)
|
|
@@ -1143,28 +1143,28 @@ function uo(e) {
|
|
|
1143
1143
|
}, d._getItemStyleCache = void 0, d._getItemStyleCache = Ye(function(b, w, T) {
|
|
1144
1144
|
return {};
|
|
1145
1145
|
}), d._onScroll = function(b) {
|
|
1146
|
-
var w = b.currentTarget, T = w.clientHeight,
|
|
1146
|
+
var w = b.currentTarget, T = w.clientHeight, E = w.clientWidth, I = w.scrollLeft, y = w.scrollTop, D = w.scrollHeight, R = w.scrollWidth;
|
|
1147
1147
|
d.setState(function(N) {
|
|
1148
|
-
if (N.scrollLeft === I && N.scrollTop ===
|
|
1148
|
+
if (N.scrollLeft === I && N.scrollTop === y)
|
|
1149
1149
|
return null;
|
|
1150
|
-
var M = d.props.direction,
|
|
1150
|
+
var M = d.props.direction, F = I;
|
|
1151
1151
|
if (M === "rtl")
|
|
1152
1152
|
switch (zt()) {
|
|
1153
1153
|
case "negative":
|
|
1154
|
-
|
|
1154
|
+
F = -I;
|
|
1155
1155
|
break;
|
|
1156
1156
|
case "positive-descending":
|
|
1157
|
-
|
|
1157
|
+
F = R - E - I;
|
|
1158
1158
|
break;
|
|
1159
1159
|
}
|
|
1160
|
-
|
|
1161
|
-
var
|
|
1160
|
+
F = Math.max(0, Math.min(F, R - E));
|
|
1161
|
+
var $ = Math.max(0, Math.min(y, D - T));
|
|
1162
1162
|
return {
|
|
1163
1163
|
isScrolling: !0,
|
|
1164
1164
|
horizontalScrollDirection: N.scrollLeft < I ? "forward" : "backward",
|
|
1165
|
-
scrollLeft:
|
|
1166
|
-
scrollTop:
|
|
1167
|
-
verticalScrollDirection: N.scrollTop <
|
|
1165
|
+
scrollLeft: F,
|
|
1166
|
+
scrollTop: $,
|
|
1167
|
+
verticalScrollDirection: N.scrollTop < y ? "forward" : "backward",
|
|
1168
1168
|
scrollUpdateWasRequested: !1
|
|
1169
1169
|
};
|
|
1170
1170
|
}, d._resetIsScrollingDebounced);
|
|
@@ -1172,7 +1172,7 @@ function uo(e) {
|
|
|
1172
1172
|
var w = d.props.outerRef;
|
|
1173
1173
|
d._outerRef = b, typeof w == "function" ? w(b) : w != null && typeof w == "object" && w.hasOwnProperty("current") && (w.current = b);
|
|
1174
1174
|
}, d._resetIsScrollingDebounced = function() {
|
|
1175
|
-
d._resetIsScrollingTimeoutId !== null && At(d._resetIsScrollingTimeoutId), d._resetIsScrollingTimeoutId =
|
|
1175
|
+
d._resetIsScrollingTimeoutId !== null && At(d._resetIsScrollingTimeoutId), d._resetIsScrollingTimeoutId = co(d._resetIsScrolling, uo);
|
|
1176
1176
|
}, d._resetIsScrolling = function() {
|
|
1177
1177
|
d._resetIsScrollingTimeoutId = null, d.setState({
|
|
1178
1178
|
isScrolling: !1
|
|
@@ -1181,10 +1181,10 @@ function uo(e) {
|
|
|
1181
1181
|
});
|
|
1182
1182
|
}, d;
|
|
1183
1183
|
}
|
|
1184
|
-
|
|
1185
|
-
return
|
|
1184
|
+
S.getDerivedStateFromProps = function(d, b) {
|
|
1185
|
+
return mo(d, b), v(d), null;
|
|
1186
1186
|
};
|
|
1187
|
-
var P =
|
|
1187
|
+
var P = S.prototype;
|
|
1188
1188
|
return P.scrollTo = function(d) {
|
|
1189
1189
|
var b = d.scrollLeft, w = d.scrollTop;
|
|
1190
1190
|
b !== void 0 && (b = Math.max(0, b)), w !== void 0 && (w = Math.max(0, w)), this.setState(function(T) {
|
|
@@ -1197,12 +1197,12 @@ function uo(e) {
|
|
|
1197
1197
|
};
|
|
1198
1198
|
}, this._resetIsScrollingDebounced);
|
|
1199
1199
|
}, P.scrollToItem = function(d) {
|
|
1200
|
-
var b = d.align, w = b === void 0 ? "auto" : b, T = d.columnIndex,
|
|
1201
|
-
T !== void 0 && (T = Math.max(0, Math.min(T,
|
|
1202
|
-
var
|
|
1200
|
+
var b = d.align, w = b === void 0 ? "auto" : b, T = d.columnIndex, E = d.rowIndex, I = this.props, y = I.columnCount, D = I.height, R = I.rowCount, N = I.width, M = this.state, F = M.scrollLeft, $ = M.scrollTop, q = lo();
|
|
1201
|
+
T !== void 0 && (T = Math.max(0, Math.min(T, y - 1))), E !== void 0 && (E = Math.max(0, Math.min(E, R - 1)));
|
|
1202
|
+
var K = c(this.props, this._instanceProps), U = i(this.props, this._instanceProps), Z = U > N ? q : 0, se = K > D ? q : 0;
|
|
1203
1203
|
this.scrollTo({
|
|
1204
|
-
scrollLeft: T !== void 0 ? l(this.props, T, w,
|
|
1205
|
-
scrollTop:
|
|
1204
|
+
scrollLeft: T !== void 0 ? l(this.props, T, w, F, this._instanceProps, se) : F,
|
|
1205
|
+
scrollTop: E !== void 0 ? p(this.props, E, w, $, this._instanceProps, Z) : $
|
|
1206
1206
|
});
|
|
1207
1207
|
}, P.componentDidMount = function() {
|
|
1208
1208
|
var d = this.props, b = d.initialScrollLeft, w = d.initialScrollTop;
|
|
@@ -1212,8 +1212,8 @@ function uo(e) {
|
|
|
1212
1212
|
}
|
|
1213
1213
|
this._callPropsCallbacks();
|
|
1214
1214
|
}, P.componentDidUpdate = function() {
|
|
1215
|
-
var d = this.props.direction, b = this.state, w = b.scrollLeft, T = b.scrollTop,
|
|
1216
|
-
if (
|
|
1215
|
+
var d = this.props.direction, b = this.state, w = b.scrollLeft, T = b.scrollTop, E = b.scrollUpdateWasRequested;
|
|
1216
|
+
if (E && this._outerRef != null) {
|
|
1217
1217
|
var I = this._outerRef;
|
|
1218
1218
|
if (d === "rtl")
|
|
1219
1219
|
switch (zt()) {
|
|
@@ -1224,8 +1224,8 @@ function uo(e) {
|
|
|
1224
1224
|
I.scrollLeft = w;
|
|
1225
1225
|
break;
|
|
1226
1226
|
default:
|
|
1227
|
-
var
|
|
1228
|
-
I.scrollLeft =
|
|
1227
|
+
var y = I.clientWidth, D = I.scrollWidth;
|
|
1228
|
+
I.scrollLeft = D - y - w;
|
|
1229
1229
|
break;
|
|
1230
1230
|
}
|
|
1231
1231
|
else
|
|
@@ -1236,39 +1236,39 @@ function uo(e) {
|
|
|
1236
1236
|
}, P.componentWillUnmount = function() {
|
|
1237
1237
|
this._resetIsScrollingTimeoutId !== null && At(this._resetIsScrollingTimeoutId);
|
|
1238
1238
|
}, P.render = function() {
|
|
1239
|
-
var d = this.props, b = d.children, w = d.className, T = d.columnCount,
|
|
1240
|
-
if (T > 0 &&
|
|
1241
|
-
for (var
|
|
1242
|
-
for (var
|
|
1243
|
-
|
|
1244
|
-
columnIndex:
|
|
1239
|
+
var d = this.props, b = d.children, w = d.className, T = d.columnCount, E = d.direction, I = d.height, y = d.innerRef, D = d.innerElementType, R = d.innerTagName, N = d.itemData, M = d.itemKey, F = M === void 0 ? po : M, $ = d.outerElementType, q = d.outerTagName, K = d.rowCount, U = d.style, Z = d.useIsScrolling, se = d.width, pe = this.state.isScrolling, j = this._getHorizontalRangeToRender(), Y = j[0], he = j[1], we = this._getVerticalRangeToRender(), k = we[0], G = we[1], B = [];
|
|
1240
|
+
if (T > 0 && K)
|
|
1241
|
+
for (var Q = k; Q <= G; Q++)
|
|
1242
|
+
for (var me = Y; me <= he; me++)
|
|
1243
|
+
B.push(Me(b, {
|
|
1244
|
+
columnIndex: me,
|
|
1245
1245
|
data: N,
|
|
1246
|
-
isScrolling:
|
|
1247
|
-
key:
|
|
1248
|
-
columnIndex:
|
|
1246
|
+
isScrolling: Z ? pe : void 0,
|
|
1247
|
+
key: F({
|
|
1248
|
+
columnIndex: me,
|
|
1249
1249
|
data: N,
|
|
1250
|
-
rowIndex:
|
|
1250
|
+
rowIndex: Q
|
|
1251
1251
|
}),
|
|
1252
|
-
rowIndex:
|
|
1253
|
-
style: this._getItemStyle(
|
|
1252
|
+
rowIndex: Q,
|
|
1253
|
+
style: this._getItemStyle(Q, me)
|
|
1254
1254
|
}));
|
|
1255
1255
|
var Ze = c(this.props, this._instanceProps), je = i(this.props, this._instanceProps);
|
|
1256
|
-
return Me(
|
|
1256
|
+
return Me($ || q || "div", {
|
|
1257
1257
|
className: w,
|
|
1258
1258
|
onScroll: this._onScroll,
|
|
1259
1259
|
ref: this._outerRefSetter,
|
|
1260
1260
|
style: lt({
|
|
1261
1261
|
position: "relative",
|
|
1262
1262
|
height: I,
|
|
1263
|
-
width:
|
|
1263
|
+
width: se,
|
|
1264
1264
|
overflow: "auto",
|
|
1265
1265
|
WebkitOverflowScrolling: "touch",
|
|
1266
1266
|
willChange: "transform",
|
|
1267
|
-
direction:
|
|
1267
|
+
direction: E
|
|
1268
1268
|
}, U)
|
|
1269
|
-
}, Me(
|
|
1270
|
-
children:
|
|
1271
|
-
ref:
|
|
1269
|
+
}, Me(D || R || "div", {
|
|
1270
|
+
children: B,
|
|
1271
|
+
ref: y,
|
|
1272
1272
|
style: {
|
|
1273
1273
|
height: Ze,
|
|
1274
1274
|
pointerEvents: pe ? "none" : void 0,
|
|
@@ -1276,35 +1276,35 @@ function uo(e) {
|
|
|
1276
1276
|
}
|
|
1277
1277
|
}));
|
|
1278
1278
|
}, P._callPropsCallbacks = function() {
|
|
1279
|
-
var d = this.props, b = d.columnCount, w = d.onItemsRendered, T = d.onScroll,
|
|
1280
|
-
if (typeof w == "function" && b > 0 &&
|
|
1281
|
-
var I = this._getHorizontalRangeToRender(),
|
|
1282
|
-
this._callOnItemsRendered(
|
|
1279
|
+
var d = this.props, b = d.columnCount, w = d.onItemsRendered, T = d.onScroll, E = d.rowCount;
|
|
1280
|
+
if (typeof w == "function" && b > 0 && E > 0) {
|
|
1281
|
+
var I = this._getHorizontalRangeToRender(), y = I[0], D = I[1], R = I[2], N = I[3], M = this._getVerticalRangeToRender(), F = M[0], $ = M[1], q = M[2], K = M[3];
|
|
1282
|
+
this._callOnItemsRendered(y, D, F, $, R, N, q, K);
|
|
1283
1283
|
}
|
|
1284
1284
|
if (typeof T == "function") {
|
|
1285
|
-
var U = this.state,
|
|
1286
|
-
this._callOnScroll(
|
|
1285
|
+
var U = this.state, Z = U.horizontalScrollDirection, se = U.scrollLeft, pe = U.scrollTop, j = U.scrollUpdateWasRequested, Y = U.verticalScrollDirection;
|
|
1286
|
+
this._callOnScroll(se, pe, Z, Y, j);
|
|
1287
1287
|
}
|
|
1288
1288
|
}, P._getHorizontalRangeToRender = function() {
|
|
1289
|
-
var d = this.props, b = d.columnCount, w = d.overscanColumnCount, T = d.overscanColumnsCount,
|
|
1289
|
+
var d = this.props, b = d.columnCount, w = d.overscanColumnCount, T = d.overscanColumnsCount, E = d.overscanCount, I = d.rowCount, y = this.state, D = y.horizontalScrollDirection, R = y.isScrolling, N = y.scrollLeft, M = w || T || E || 1;
|
|
1290
1290
|
if (b === 0 || I === 0)
|
|
1291
1291
|
return [0, 0, 0, 0];
|
|
1292
|
-
var
|
|
1293
|
-
return [Math.max(0,
|
|
1292
|
+
var F = r(this.props, N, this._instanceProps), $ = o(this.props, F, N, this._instanceProps), q = !R || D === "backward" ? Math.max(1, M) : 1, K = !R || D === "forward" ? Math.max(1, M) : 1;
|
|
1293
|
+
return [Math.max(0, F - q), Math.max(0, Math.min(b - 1, $ + K)), F, $];
|
|
1294
1294
|
}, P._getVerticalRangeToRender = function() {
|
|
1295
|
-
var d = this.props, b = d.columnCount, w = d.overscanCount, T = d.overscanRowCount,
|
|
1295
|
+
var d = this.props, b = d.columnCount, w = d.overscanCount, T = d.overscanRowCount, E = d.overscanRowsCount, I = d.rowCount, y = this.state, D = y.isScrolling, R = y.verticalScrollDirection, N = y.scrollTop, M = T || E || w || 1;
|
|
1296
1296
|
if (b === 0 || I === 0)
|
|
1297
1297
|
return [0, 0, 0, 0];
|
|
1298
|
-
var
|
|
1299
|
-
return [Math.max(0,
|
|
1300
|
-
},
|
|
1301
|
-
}(
|
|
1298
|
+
var F = u(this.props, N, this._instanceProps), $ = m(this.props, F, N, this._instanceProps), q = !D || R === "backward" ? Math.max(1, M) : 1, K = !D || R === "forward" ? Math.max(1, M) : 1;
|
|
1299
|
+
return [Math.max(0, F - q), Math.max(0, Math.min(I - 1, $ + K)), F, $];
|
|
1300
|
+
}, S;
|
|
1301
|
+
}(Hn), t.defaultProps = {
|
|
1302
1302
|
direction: "ltr",
|
|
1303
1303
|
itemData: void 0,
|
|
1304
1304
|
useIsScrolling: !1
|
|
1305
1305
|
}, t;
|
|
1306
1306
|
}
|
|
1307
|
-
var
|
|
1307
|
+
var mo = function(t, n) {
|
|
1308
1308
|
var r = t.children, o = t.direction, a = t.height, c = t.innerTagName, i = t.outerTagName, l = t.overscanColumnsCount, p = t.overscanCount, h = t.overscanRowsCount, f = t.width, u = n.instance;
|
|
1309
1309
|
if (process.env.NODE_ENV !== "production") {
|
|
1310
1310
|
if (typeof p == "number" && Ee && !Ee.has(u) && (Ee.add(u), console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (typeof l == "number" || typeof h == "number") && Oe && !Oe.has(u) && (Oe.add(u), console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (c != null || i != null) && De && !De.has(u) && (De.add(u), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")), r == null)
|
|
@@ -1359,7 +1359,7 @@ var po = function(t, n) {
|
|
|
1359
1359
|
var a, c;
|
|
1360
1360
|
t === "column" ? (a = r.columnMetadataMap, c = r.lastMeasuredColumnIndex) : (a = r.rowMetadataMap, c = r.lastMeasuredRowIndex);
|
|
1361
1361
|
var i = c > 0 ? a[c].offset : 0;
|
|
1362
|
-
return i >= o ? fn(t, n, r, c, 0, o) :
|
|
1362
|
+
return i >= o ? fn(t, n, r, c, 0, o) : fo(t, n, r, Math.max(0, c), o);
|
|
1363
1363
|
}, fn = function(t, n, r, o, a, c) {
|
|
1364
1364
|
for (; a <= o; ) {
|
|
1365
1365
|
var i = a + Math.floor((o - a) / 2), l = ue(t, n, i, r).offset;
|
|
@@ -1368,7 +1368,7 @@ var po = function(t, n) {
|
|
|
1368
1368
|
l < c ? a = i + 1 : l > c && (o = i - 1);
|
|
1369
1369
|
}
|
|
1370
1370
|
return a > 0 ? a - 1 : 0;
|
|
1371
|
-
},
|
|
1371
|
+
}, fo = function(t, n, r, o, a) {
|
|
1372
1372
|
for (var c = t === "column" ? n.columnCount : n.rowCount, i = 1; o < c && ue(t, n, o, r).offset < a; )
|
|
1373
1373
|
o += i, i *= 2;
|
|
1374
1374
|
return fn(t, n, r, Math.min(o, c - 1), Math.floor(o / 2), a);
|
|
@@ -1385,7 +1385,7 @@ var po = function(t, n) {
|
|
|
1385
1385
|
default:
|
|
1386
1386
|
return a >= u && a <= f ? a : u > f || a < u ? u : f;
|
|
1387
1387
|
}
|
|
1388
|
-
},
|
|
1388
|
+
}, go = /* @__PURE__ */ ho({
|
|
1389
1389
|
getColumnOffset: function(t, n, r) {
|
|
1390
1390
|
return ue("column", t, n, r).offset;
|
|
1391
1391
|
},
|
|
@@ -1467,20 +1467,20 @@ function Ht(e, t) {
|
|
|
1467
1467
|
return !0;
|
|
1468
1468
|
return !1;
|
|
1469
1469
|
}
|
|
1470
|
-
var
|
|
1471
|
-
function
|
|
1472
|
-
var n = e.style, r = Ot(e,
|
|
1470
|
+
var vo = ["style"], _o = ["style"];
|
|
1471
|
+
function wo(e, t) {
|
|
1472
|
+
var n = e.style, r = Ot(e, vo), o = t.style, a = Ot(t, _o);
|
|
1473
1473
|
return !Ht(n, o) && !Ht(r, a);
|
|
1474
1474
|
}
|
|
1475
|
-
const
|
|
1476
|
-
const { viewMode: e } = Ue(), { scrollMode: t } =
|
|
1475
|
+
const bo = () => {
|
|
1476
|
+
const { viewMode: e } = Ue(), { scrollMode: t } = Te(), { setColumnCount: n } = Bt(), { virtualScrollableElementRef: r } = qe(), o = ht(), a = x(
|
|
1477
1477
|
(m) => o.widths[m] || 0,
|
|
1478
1478
|
[o]
|
|
1479
|
-
), c =
|
|
1479
|
+
), c = x(
|
|
1480
1480
|
(m) => o.heights[m] || 0,
|
|
1481
1481
|
[o]
|
|
1482
1482
|
), i = A(() => o.heights.length, [o]), l = A(() => Math.max(...o.widths), [o]), p = A(() => t === J.HORIZONTAL_SCROLLING ? i : e === ze.DUAL_PAGE ? 2 : 1, [e, t, t, i, r, l]);
|
|
1483
|
-
|
|
1483
|
+
z(() => {
|
|
1484
1484
|
n(p);
|
|
1485
1485
|
}, [p, n]);
|
|
1486
1486
|
const h = A(() => t === J.HORIZONTAL_SCROLLING || t === J.PAGE_SCROLLING ? 1 : Math.round(i / p), [p, i, t]), f = A(() => o.heights.reduce((m, g) => m + g, 0) / o.heights.length || 0, [o]), u = A(() => o.widths.reduce((m, g) => m + g, 0) / o.heights.length || 0, [o]);
|
|
@@ -1494,10 +1494,10 @@ const _o = () => {
|
|
|
1494
1494
|
estimatedColumnWidth: u
|
|
1495
1495
|
};
|
|
1496
1496
|
};
|
|
1497
|
-
let
|
|
1498
|
-
typeof window < "u" ?
|
|
1497
|
+
let ne;
|
|
1498
|
+
typeof window < "u" ? ne = window : typeof self < "u" ? ne = self : ne = global;
|
|
1499
1499
|
let dt = null, pt = null;
|
|
1500
|
-
const $t = 20, et =
|
|
1500
|
+
const $t = 20, et = ne.clearTimeout, Gt = ne.setTimeout, tt = ne.cancelAnimationFrame || ne.mozCancelAnimationFrame || ne.webkitCancelAnimationFrame, Vt = ne.requestAnimationFrame || ne.mozRequestAnimationFrame || ne.webkitRequestAnimationFrame;
|
|
1501
1501
|
tt == null || Vt == null ? (dt = et, pt = function(t) {
|
|
1502
1502
|
return Gt(t, $t);
|
|
1503
1503
|
}) : (dt = function([t, n]) {
|
|
@@ -1510,22 +1510,22 @@ tt == null || Vt == null ? (dt = et, pt = function(t) {
|
|
|
1510
1510
|
}, $t);
|
|
1511
1511
|
return [n, r];
|
|
1512
1512
|
});
|
|
1513
|
-
function
|
|
1513
|
+
function Co(e) {
|
|
1514
1514
|
let t, n, r, o, a, c, i;
|
|
1515
1515
|
const l = typeof document < "u" && document.attachEvent;
|
|
1516
1516
|
if (!l) {
|
|
1517
1517
|
c = function(C) {
|
|
1518
|
-
const
|
|
1518
|
+
const S = C.__resizeTriggers__, P = S.firstElementChild, L = S.lastElementChild, d = P.firstElementChild;
|
|
1519
1519
|
L.scrollLeft = L.scrollWidth, L.scrollTop = L.scrollHeight, d.style.width = P.offsetWidth + 1 + "px", d.style.height = P.offsetHeight + 1 + "px", P.scrollLeft = P.scrollWidth, P.scrollTop = P.scrollHeight;
|
|
1520
1520
|
}, a = function(C) {
|
|
1521
1521
|
return C.offsetWidth !== C.__resizeLast__.width || C.offsetHeight !== C.__resizeLast__.height;
|
|
1522
1522
|
}, i = function(C) {
|
|
1523
1523
|
if (C.target.className && typeof C.target.className.indexOf == "function" && C.target.className.indexOf("contract-trigger") < 0 && C.target.className.indexOf("expand-trigger") < 0)
|
|
1524
1524
|
return;
|
|
1525
|
-
const
|
|
1525
|
+
const S = this;
|
|
1526
1526
|
c(this), this.__resizeRAF__ && dt(this.__resizeRAF__), this.__resizeRAF__ = pt(function() {
|
|
1527
|
-
a(
|
|
1528
|
-
d.call(
|
|
1527
|
+
a(S) && (S.__resizeLast__.width = S.offsetWidth, S.__resizeLast__.height = S.offsetHeight, S.__resizeListeners__.forEach(function(d) {
|
|
1528
|
+
d.call(S, C);
|
|
1529
1529
|
}));
|
|
1530
1530
|
});
|
|
1531
1531
|
};
|
|
@@ -1536,9 +1536,9 @@ function wo(e) {
|
|
|
1536
1536
|
{
|
|
1537
1537
|
const C = document.createElement("fakeelement");
|
|
1538
1538
|
if (C.style.animationName !== void 0 && (u = !0), u === !1) {
|
|
1539
|
-
for (let
|
|
1540
|
-
if (C.style[g[
|
|
1541
|
-
v = g[
|
|
1539
|
+
for (let S = 0; S < g.length; S++)
|
|
1540
|
+
if (C.style[g[S] + "AnimationName"] !== void 0) {
|
|
1541
|
+
v = g[S], m = "-" + v.toLowerCase() + "-", r = _[S], u = !0;
|
|
1542
1542
|
break;
|
|
1543
1543
|
}
|
|
1544
1544
|
}
|
|
@@ -1557,7 +1557,7 @@ function wo(e) {
|
|
|
1557
1557
|
u.attachEvent("onresize", m);
|
|
1558
1558
|
else {
|
|
1559
1559
|
if (!u.__resizeTriggers__) {
|
|
1560
|
-
const g = u.ownerDocument, _ =
|
|
1560
|
+
const g = u.ownerDocument, _ = ne.getComputedStyle(u);
|
|
1561
1561
|
_ && _.position === "static" && (u.style.position = "relative"), p(g), u.__resizeLast__ = {}, u.__resizeListeners__ = [], (u.__resizeTriggers__ = g.createElement("div")).className = "resize-triggers";
|
|
1562
1562
|
const v = g.createElement("div");
|
|
1563
1563
|
v.className = "expand-trigger", v.appendChild(g.createElement("div"));
|
|
@@ -1582,7 +1582,7 @@ function wo(e) {
|
|
|
1582
1582
|
}
|
|
1583
1583
|
};
|
|
1584
1584
|
}
|
|
1585
|
-
class
|
|
1585
|
+
class Po extends $n {
|
|
1586
1586
|
constructor(...t) {
|
|
1587
1587
|
super(...t), this.state = {
|
|
1588
1588
|
height: this.props.defaultHeight || 0,
|
|
@@ -1623,7 +1623,7 @@ class bo extends Wn {
|
|
|
1623
1623
|
const r = n.ownerDocument.defaultView.ResizeObserver;
|
|
1624
1624
|
r != null ? (this._resizeObserver = new r(() => {
|
|
1625
1625
|
this._timeoutId = setTimeout(this._onResize, 0);
|
|
1626
|
-
}), this._resizeObserver.observe(n)) : (this._detectElementResize =
|
|
1626
|
+
}), this._resizeObserver.observe(n)) : (this._detectElementResize = Co(t), this._detectElementResize.addResizeListener(n, this._onResize)), this._onResize();
|
|
1627
1627
|
}
|
|
1628
1628
|
}
|
|
1629
1629
|
componentWillUnmount() {
|
|
@@ -1650,18 +1650,18 @@ class bo extends Wn {
|
|
|
1650
1650
|
} = this.state, v = {
|
|
1651
1651
|
overflow: "visible"
|
|
1652
1652
|
}, C = {};
|
|
1653
|
-
let
|
|
1654
|
-
return o || (u === 0 && (
|
|
1653
|
+
let S = !1;
|
|
1654
|
+
return o || (u === 0 && (S = !0), v.height = 0, C.height = u, C.scaledHeight = m), a || (_ === 0 && (S = !0), v.width = 0, C.width = _, C.scaledWidth = g), c && (S = !1), Me(h, {
|
|
1655
1655
|
ref: this._setRef,
|
|
1656
1656
|
style: {
|
|
1657
1657
|
...v,
|
|
1658
1658
|
...p
|
|
1659
1659
|
},
|
|
1660
1660
|
...f
|
|
1661
|
-
}, !
|
|
1661
|
+
}, !S && t(C));
|
|
1662
1662
|
}
|
|
1663
1663
|
}
|
|
1664
|
-
const
|
|
1664
|
+
const To = ({ widths: e, heights: t }) => {
|
|
1665
1665
|
const { focusedPage: n, totalPages: r } = oe(), o = A(() => {
|
|
1666
1666
|
const i = [], l = Math.ceil(n / 2) * 2 - 1;
|
|
1667
1667
|
if (i.push(l), l + 1 < r) {
|
|
@@ -1685,7 +1685,7 @@ const Co = ({ widths: e, heights: t }) => {
|
|
|
1685
1685
|
}
|
|
1686
1686
|
], [e, t, o]), c = A(() => a.reduce((i, l) => i + Number(l.width || 0), 0), [a]);
|
|
1687
1687
|
return /* @__PURE__ */ s("div", { style: { width: c, position: "relative" }, children: o.map((i, l) => /* @__PURE__ */ s(bt, { style: a[l], pageNumber: i }, i)) });
|
|
1688
|
-
},
|
|
1688
|
+
}, So = ({ widths: e, heights: t }) => {
|
|
1689
1689
|
const { focusedPage: n } = oe(), r = A(() => ({
|
|
1690
1690
|
position: "absolute",
|
|
1691
1691
|
width: e(n - 1),
|
|
@@ -1701,7 +1701,7 @@ const Co = ({ widths: e, heights: t }) => {
|
|
|
1701
1701
|
children: /* @__PURE__ */ s(bt, { style: r, pageNumber: n }, n)
|
|
1702
1702
|
}
|
|
1703
1703
|
);
|
|
1704
|
-
},
|
|
1704
|
+
}, yo = Gn(({ columnIndex: e, rowIndex: t, data: n, style: r }) => {
|
|
1705
1705
|
const o = A(() => e + 1 + t * n.columnCount, [e, t, n]);
|
|
1706
1706
|
return /* @__PURE__ */ s(
|
|
1707
1707
|
bt,
|
|
@@ -1712,150 +1712,155 @@ const Co = ({ widths: e, heights: t }) => {
|
|
|
1712
1712
|
},
|
|
1713
1713
|
o
|
|
1714
1714
|
);
|
|
1715
|
-
},
|
|
1716
|
-
const { getContainer: e, container: t } =
|
|
1715
|
+
}, wo), Bs = () => {
|
|
1716
|
+
const { getContainer: e, container: t } = dr(), { scrollToPage: n } = nn(), {
|
|
1717
1717
|
virtualScrollRef: r,
|
|
1718
1718
|
getVirtualScrollRef: o,
|
|
1719
1719
|
getPageScrollElementRef: a,
|
|
1720
1720
|
getVirtualScrollableElementRef: c,
|
|
1721
1721
|
setTotalInnerDimensions: i,
|
|
1722
1722
|
totalInnerDimensions: l
|
|
1723
|
-
} = qe(), { nextPage: p, prevPage: h, setFocusedPage: f, focusedPage: u } = oe(), { scrollMode: m } =
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
}), C = $({
|
|
1723
|
+
} = qe(), { nextPage: p, prevPage: h, setFocusedPage: f, focusedPage: u } = oe(), { scrollMode: m } = Te(), { viewMode: g } = Ue(), _ = W(null), v = W(
|
|
1724
|
+
l
|
|
1725
|
+
), C = W({
|
|
1727
1726
|
viewMode: g,
|
|
1728
1727
|
scrollMode: m
|
|
1729
|
-
}), { isFullScreen:
|
|
1730
|
-
pageDimension:
|
|
1731
|
-
rowCount:
|
|
1732
|
-
rowHeight:
|
|
1733
|
-
columnCount:
|
|
1734
|
-
columnWidth:
|
|
1735
|
-
estimatedColumnWidth:
|
|
1736
|
-
estimatedRowHeight:
|
|
1737
|
-
} =
|
|
1728
|
+
}), S = W(!1), P = W(), { isFullScreen: L } = jn(), {
|
|
1729
|
+
pageDimension: d,
|
|
1730
|
+
rowCount: b,
|
|
1731
|
+
rowHeight: w,
|
|
1732
|
+
columnCount: T,
|
|
1733
|
+
columnWidth: E,
|
|
1734
|
+
estimatedColumnWidth: I,
|
|
1735
|
+
estimatedRowHeight: y
|
|
1736
|
+
} = bo(), [D, R] = H({}), { isScrolling: N } = Kt(), M = W(), F = W({
|
|
1738
1737
|
scrollTop: 0,
|
|
1739
1738
|
scrollLeft: 0
|
|
1740
1739
|
});
|
|
1741
|
-
|
|
1742
|
-
const { isPressed:
|
|
1743
|
-
isPressed:
|
|
1744
|
-
}), Z = A(() =>
|
|
1745
|
-
|
|
1746
|
-
}, []),
|
|
1747
|
-
columnCount:
|
|
1748
|
-
handleIntersectRatioChange:
|
|
1749
|
-
}), [
|
|
1750
|
-
(
|
|
1751
|
-
const
|
|
1752
|
-
!
|
|
1740
|
+
mr(t);
|
|
1741
|
+
const { isPressed: $ } = pr(), { selectionMode: q } = qn(), { initializeGrabScroll: K, scrollBehavior: U } = hr({
|
|
1742
|
+
isPressed: $
|
|
1743
|
+
}), Z = A(() => q === Vn.HAND, [q]), se = x((k, G) => {
|
|
1744
|
+
R((B) => ({ ...B, [k]: Math.round(G * 100) }));
|
|
1745
|
+
}, []), pe = A(() => ({
|
|
1746
|
+
columnCount: T,
|
|
1747
|
+
handleIntersectRatioChange: se
|
|
1748
|
+
}), [T, se]), j = x(
|
|
1749
|
+
(k) => {
|
|
1750
|
+
const G = document.activeElement !== t;
|
|
1751
|
+
!L && G || (["ArrowUp", "ArrowLeft"].includes(k.key) ? (k.preventDefault(), h()) : ["ArrowDown", "ArrowRight"].includes(k.key) && (k.preventDefault(), p()));
|
|
1753
1752
|
},
|
|
1754
|
-
[p, h,
|
|
1755
|
-
),
|
|
1756
|
-
|
|
1757
|
-
scrollTop:
|
|
1758
|
-
scrollLeft:
|
|
1753
|
+
[p, h, L, m]
|
|
1754
|
+
), Y = x((k) => {
|
|
1755
|
+
F.current = {
|
|
1756
|
+
scrollTop: k.scrollTop,
|
|
1757
|
+
scrollLeft: k.scrollLeft
|
|
1759
1758
|
};
|
|
1760
1759
|
}, []);
|
|
1761
|
-
|
|
1762
|
-
window.removeEventListener("keydown",
|
|
1763
|
-
}), [
|
|
1760
|
+
z(() => (window.addEventListener("keydown", j), () => {
|
|
1761
|
+
window.removeEventListener("keydown", j);
|
|
1762
|
+
}), [j]), z(() => {
|
|
1764
1763
|
if (_.current && (_.current.style.position = "relative"), !!r) {
|
|
1765
|
-
v.current =
|
|
1766
|
-
height:
|
|
1767
|
-
|
|
1764
|
+
v.current = {
|
|
1765
|
+
height: l.height,
|
|
1766
|
+
width: l.width
|
|
1767
|
+
}, i({
|
|
1768
|
+
height: Array.from({ length: b }).reduce(
|
|
1769
|
+
(k, G, B) => k + w(B),
|
|
1768
1770
|
0
|
|
1769
1771
|
),
|
|
1770
|
-
width: Array.from({ length:
|
|
1771
|
-
(
|
|
1772
|
+
width: Array.from({ length: T }).reduce(
|
|
1773
|
+
(k, G, B) => k + E(B),
|
|
1772
1774
|
0
|
|
1773
1775
|
)
|
|
1774
1776
|
});
|
|
1775
|
-
for (let
|
|
1776
|
-
for (let
|
|
1777
|
+
for (let k = 0; k < b; k++)
|
|
1778
|
+
for (let G = 0; G < T; G++)
|
|
1777
1779
|
r.resetAfterIndices({
|
|
1778
|
-
columnIndex:
|
|
1779
|
-
rowIndex:
|
|
1780
|
+
columnIndex: G,
|
|
1781
|
+
rowIndex: k,
|
|
1780
1782
|
shouldForceUpdate: !0
|
|
1781
1783
|
});
|
|
1782
1784
|
}
|
|
1783
|
-
}, [
|
|
1784
|
-
if (
|
|
1785
|
+
}, [b, T, d, r, n]), z(() => {
|
|
1786
|
+
if (N.current)
|
|
1785
1787
|
return;
|
|
1786
1788
|
if (C.current.viewMode !== g || C.current.scrollMode !== m) {
|
|
1787
|
-
|
|
1789
|
+
M.current && clearTimeout(M.current), R({}), S.current = !0, n(u), m === J.HORIZONTAL_SCROLLING && (r == null || r.scrollTo({
|
|
1788
1790
|
scrollTop: 0
|
|
1789
|
-
})),
|
|
1791
|
+
})), M.current = setTimeout(() => {
|
|
1790
1792
|
requestAnimationFrame(() => {
|
|
1791
1793
|
C.current = { viewMode: g, scrollMode: m };
|
|
1792
1794
|
});
|
|
1793
1795
|
}, 100);
|
|
1794
1796
|
return;
|
|
1795
1797
|
}
|
|
1796
|
-
const
|
|
1797
|
-
if (l.height
|
|
1798
|
-
|
|
1798
|
+
const G = F.current.scrollTop, B = F.current.scrollLeft;
|
|
1799
|
+
if (l.height && l.width) {
|
|
1800
|
+
S.current = !0;
|
|
1801
|
+
const { height: Q, width: me } = l, { height: Ze, width: je } = v.current, zn = G / Ze * Q, Fn = B / je * me, kn = Math.min(zn, Q) || 0, Wn = Math.min(Fn, me) || 0;
|
|
1799
1802
|
r == null || r.scrollTo({
|
|
1800
|
-
scrollTop:
|
|
1801
|
-
scrollLeft:
|
|
1802
|
-
})
|
|
1803
|
+
scrollTop: kn,
|
|
1804
|
+
scrollLeft: Wn
|
|
1805
|
+
}), P.current && clearTimeout(P.current), P.current = setTimeout(() => {
|
|
1806
|
+
S.current = !1;
|
|
1807
|
+
}, 100);
|
|
1803
1808
|
}
|
|
1804
|
-
}, [l, g, m]),
|
|
1805
|
-
const
|
|
1806
|
-
if (
|
|
1807
|
-
|
|
1809
|
+
}, [l, g, m]), z(() => {
|
|
1810
|
+
const k = Object.entries(D);
|
|
1811
|
+
if (N.current || S.current) {
|
|
1812
|
+
N.current = !1;
|
|
1808
1813
|
return;
|
|
1809
1814
|
}
|
|
1810
|
-
let
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
}),
|
|
1814
|
-
}, [
|
|
1815
|
-
|
|
1815
|
+
let G = 0, B = -1;
|
|
1816
|
+
k.forEach((Q) => {
|
|
1817
|
+
B < Q[1] && (G = Number(Q[0]), B = Q[1]);
|
|
1818
|
+
}), G && f(G);
|
|
1819
|
+
}, [D, f]), z(() => () => {
|
|
1820
|
+
M.current && clearTimeout(M.current), P.current && clearTimeout(P.current);
|
|
1816
1821
|
}, []);
|
|
1817
|
-
const
|
|
1818
|
-
[le["rp-cursor-grab"]]: Z &&
|
|
1819
|
-
[le["rp-cursor-grabbing"]]: Z &&
|
|
1820
|
-
}), [Z,
|
|
1821
|
-
(
|
|
1822
|
-
if (Z &&
|
|
1823
|
-
const
|
|
1824
|
-
|
|
1822
|
+
const he = A(() => ee(le["rp-pages-container"], {
|
|
1823
|
+
[le["rp-cursor-grab"]]: Z && !$,
|
|
1824
|
+
[le["rp-cursor-grabbing"]]: Z && $
|
|
1825
|
+
}), [Z, $]), we = x(
|
|
1826
|
+
(k) => {
|
|
1827
|
+
if (Z && k) {
|
|
1828
|
+
const G = ee(le["rp-pages"]), B = document.querySelector(`.${G}`);
|
|
1829
|
+
K(B);
|
|
1825
1830
|
}
|
|
1826
1831
|
},
|
|
1827
|
-
[Z,
|
|
1832
|
+
[Z, K, le]
|
|
1828
1833
|
);
|
|
1829
|
-
return /* @__PURE__ */ s("div", { ref: e, tabIndex: -1, className:
|
|
1834
|
+
return /* @__PURE__ */ s("div", { ref: e, tabIndex: -1, className: he, children: /* @__PURE__ */ s(Po, { children: ({ width: k, height: G }) => /* @__PURE__ */ s("div", { "data-rp": "pages", ref: we, style: { width: k, height: G, scrollBehavior: U }, children: m === J.PAGE_SCROLLING ? /* @__PURE__ */ s(
|
|
1830
1835
|
"div",
|
|
1831
1836
|
{
|
|
1832
1837
|
ref: a,
|
|
1833
|
-
style: { width:
|
|
1834
|
-
className:
|
|
1835
|
-
children: g === ze.DUAL_PAGE ? /* @__PURE__ */ s(
|
|
1838
|
+
style: { width: k, height: G },
|
|
1839
|
+
className: ee(le["rp-pages"], le["rp-page-scrolling-wrapper"]),
|
|
1840
|
+
children: g === ze.DUAL_PAGE ? /* @__PURE__ */ s(To, { widths: E, heights: w }) : /* @__PURE__ */ s(So, { widths: E, heights: w })
|
|
1836
1841
|
}
|
|
1837
|
-
) :
|
|
1838
|
-
|
|
1842
|
+
) : I ? /* @__PURE__ */ s(
|
|
1843
|
+
go,
|
|
1839
1844
|
{
|
|
1840
1845
|
ref: o,
|
|
1841
|
-
itemData:
|
|
1846
|
+
itemData: pe,
|
|
1842
1847
|
outerRef: c,
|
|
1843
1848
|
innerRef: _,
|
|
1844
|
-
onScroll:
|
|
1845
|
-
columnCount:
|
|
1846
|
-
columnWidth:
|
|
1847
|
-
rowHeight:
|
|
1848
|
-
height:
|
|
1849
|
-
width:
|
|
1850
|
-
estimatedColumnWidth:
|
|
1851
|
-
estimatedRowHeight:
|
|
1852
|
-
rowCount:
|
|
1853
|
-
className:
|
|
1849
|
+
onScroll: Y,
|
|
1850
|
+
columnCount: T,
|
|
1851
|
+
columnWidth: E,
|
|
1852
|
+
rowHeight: w,
|
|
1853
|
+
height: G,
|
|
1854
|
+
width: k,
|
|
1855
|
+
estimatedColumnWidth: I,
|
|
1856
|
+
estimatedRowHeight: y,
|
|
1857
|
+
rowCount: b,
|
|
1858
|
+
className: ee(
|
|
1854
1859
|
le["rp-pages"],
|
|
1855
1860
|
m === J.HORIZONTAL_SCROLLING ? le["rp-pages-horizontal-scroll"] : ""
|
|
1856
1861
|
),
|
|
1857
|
-
style: { scrollBehavior:
|
|
1858
|
-
children:
|
|
1862
|
+
style: { scrollBehavior: U },
|
|
1863
|
+
children: yo
|
|
1859
1864
|
}
|
|
1860
1865
|
) : null }) }) });
|
|
1861
1866
|
}, Se = {
|
|
@@ -1868,26 +1873,26 @@ const Co = ({ widths: e, heights: t }) => {
|
|
|
1868
1873
|
"rp-paginate": "_rp-paginate_1vu6o_1",
|
|
1869
1874
|
"rp-page-input": "_rp-page-input_1vu6o_6",
|
|
1870
1875
|
"rp-total-page": "_rp-total-page_1vu6o_12"
|
|
1871
|
-
},
|
|
1876
|
+
}, Io = () => {
|
|
1872
1877
|
const { prevIcon: e } = ce();
|
|
1873
1878
|
return e || /* @__PURE__ */ s(Re, {});
|
|
1874
|
-
},
|
|
1879
|
+
}, xo = () => {
|
|
1875
1880
|
const { nextIcon: e } = ce();
|
|
1876
1881
|
return e || /* @__PURE__ */ s(Re, { style: { transform: "rotate(180deg" } });
|
|
1877
|
-
},
|
|
1878
|
-
const { focusedPage: e, totalPages: t, setFocusedPage: n, nextPage: r, prevPage: o, goToPage: a } = oe(), [c, i] =
|
|
1879
|
-
|
|
1882
|
+
}, Ro = () => {
|
|
1883
|
+
const { focusedPage: e, totalPages: t, setFocusedPage: n, nextPage: r, prevPage: o, goToPage: a } = oe(), [c, i] = H(e.toString()), { pageNavigationTool: l = !0 } = de(), { isSmallScreen: p } = _e();
|
|
1884
|
+
z(() => {
|
|
1880
1885
|
i(e.toString());
|
|
1881
1886
|
}, [e]);
|
|
1882
|
-
const h =
|
|
1887
|
+
const h = x((g) => {
|
|
1883
1888
|
const _ = g.target.value;
|
|
1884
1889
|
i(_);
|
|
1885
|
-
}, []), f =
|
|
1890
|
+
}, []), f = x(() => {
|
|
1886
1891
|
const g = a(c);
|
|
1887
1892
|
g.success || i(g.currentPage.toString());
|
|
1888
|
-
}, [a, c, t]), u =
|
|
1893
|
+
}, [a, c, t]), u = x(() => {
|
|
1889
1894
|
i(e.toString());
|
|
1890
|
-
}, [e]), m =
|
|
1895
|
+
}, [e]), m = x(
|
|
1891
1896
|
(g) => {
|
|
1892
1897
|
g.key === "Enter" && f();
|
|
1893
1898
|
},
|
|
@@ -1904,7 +1909,7 @@ const Co = ({ widths: e, heights: t }) => {
|
|
|
1904
1909
|
changePage: n
|
|
1905
1910
|
}
|
|
1906
1911
|
) : l ? /* @__PURE__ */ O("div", { className: nt["rp-paginate"], children: [
|
|
1907
|
-
!p && /* @__PURE__ */ s(
|
|
1912
|
+
!p && /* @__PURE__ */ s(te, { content: "Previous page", children: /* @__PURE__ */ s(X, { onClick: o, disabled: e === 1, children: /* @__PURE__ */ s(Io, {}) }) }),
|
|
1908
1913
|
/* @__PURE__ */ s(
|
|
1909
1914
|
jt,
|
|
1910
1915
|
{
|
|
@@ -1919,10 +1924,10 @@ const Co = ({ widths: e, heights: t }) => {
|
|
|
1919
1924
|
"/",
|
|
1920
1925
|
t
|
|
1921
1926
|
] }),
|
|
1922
|
-
!p && /* @__PURE__ */ s(
|
|
1927
|
+
!p && /* @__PURE__ */ s(te, { content: "Next page", children: /* @__PURE__ */ s(X, { onClick: r, disabled: e === t, children: /* @__PURE__ */ s(xo, {}) }) })
|
|
1923
1928
|
] }) : null;
|
|
1924
1929
|
};
|
|
1925
|
-
var Ct = "Dialog", [gn,
|
|
1930
|
+
var Ct = "Dialog", [gn, Ks] = Ir(Ct), [Lo, ae] = gn(Ct), vn = (e) => {
|
|
1926
1931
|
const {
|
|
1927
1932
|
__scopeDialog: t,
|
|
1928
1933
|
children: n,
|
|
@@ -1930,13 +1935,13 @@ var Ct = "Dialog", [gn, js] = vr(Ct), [xo, ae] = gn(Ct), vn = (e) => {
|
|
|
1930
1935
|
defaultOpen: o,
|
|
1931
1936
|
onOpenChange: a,
|
|
1932
1937
|
modal: c = !0
|
|
1933
|
-
} = e, i = V.useRef(null), l = V.useRef(null), [p = !1, h] =
|
|
1938
|
+
} = e, i = V.useRef(null), l = V.useRef(null), [p = !1, h] = Rr({
|
|
1934
1939
|
prop: r,
|
|
1935
1940
|
defaultProp: o,
|
|
1936
1941
|
onChange: a
|
|
1937
1942
|
});
|
|
1938
1943
|
return /* @__PURE__ */ s(
|
|
1939
|
-
|
|
1944
|
+
Lo,
|
|
1940
1945
|
{
|
|
1941
1946
|
scope: t,
|
|
1942
1947
|
triggerRef: i,
|
|
@@ -1953,7 +1958,7 @@ var Ct = "Dialog", [gn, js] = vr(Ct), [xo, ae] = gn(Ct), vn = (e) => {
|
|
|
1953
1958
|
);
|
|
1954
1959
|
};
|
|
1955
1960
|
vn.displayName = Ct;
|
|
1956
|
-
var _n = "DialogTrigger",
|
|
1961
|
+
var _n = "DialogTrigger", No = V.forwardRef(
|
|
1957
1962
|
(e, t) => {
|
|
1958
1963
|
const { __scopeDialog: n, ...r } = e, o = ae(_n, n), a = gt(t, o.triggerRef);
|
|
1959
1964
|
return /* @__PURE__ */ s(
|
|
@@ -1971,28 +1976,28 @@ var _n = "DialogTrigger", Ro = V.forwardRef(
|
|
|
1971
1976
|
);
|
|
1972
1977
|
}
|
|
1973
1978
|
);
|
|
1974
|
-
|
|
1975
|
-
var Pt = "DialogPortal", [
|
|
1979
|
+
No.displayName = _n;
|
|
1980
|
+
var Pt = "DialogPortal", [Mo, wn] = gn(Pt, {
|
|
1976
1981
|
forceMount: void 0
|
|
1977
1982
|
}), bn = (e) => {
|
|
1978
1983
|
const { __scopeDialog: t, forceMount: n, children: r, container: o } = e, a = ae(Pt, t);
|
|
1979
|
-
return /* @__PURE__ */ s(
|
|
1984
|
+
return /* @__PURE__ */ s(Mo, { scope: t, forceMount: n, children: V.Children.map(r, (c) => /* @__PURE__ */ s(vt, { present: n || a.open, children: /* @__PURE__ */ s(yr, { asChild: !0, container: o, children: c }) })) });
|
|
1980
1985
|
};
|
|
1981
1986
|
bn.displayName = Pt;
|
|
1982
1987
|
var ke = "DialogOverlay", Cn = V.forwardRef(
|
|
1983
1988
|
(e, t) => {
|
|
1984
1989
|
const n = wn(ke, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, a = ae(ke, e.__scopeDialog);
|
|
1985
|
-
return a.modal ? /* @__PURE__ */ s(vt, { present: r || a.open, children: /* @__PURE__ */ s(
|
|
1990
|
+
return a.modal ? /* @__PURE__ */ s(vt, { present: r || a.open, children: /* @__PURE__ */ s(Eo, { ...o, ref: t }) }) : null;
|
|
1986
1991
|
}
|
|
1987
1992
|
);
|
|
1988
1993
|
Cn.displayName = ke;
|
|
1989
|
-
var
|
|
1994
|
+
var Eo = V.forwardRef(
|
|
1990
1995
|
(e, t) => {
|
|
1991
1996
|
const { __scopeDialog: n, ...r } = e, o = ae(ke, n);
|
|
1992
1997
|
return (
|
|
1993
1998
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
1994
1999
|
// ie. when `Overlay` and `Content` are siblings
|
|
1995
|
-
/* @__PURE__ */ s(
|
|
2000
|
+
/* @__PURE__ */ s(wr, { as: br, allowPinchZoom: !0, shards: [o.contentRef], children: /* @__PURE__ */ s(
|
|
1996
2001
|
Ne.div,
|
|
1997
2002
|
{
|
|
1998
2003
|
"data-state": St(o.open),
|
|
@@ -2006,17 +2011,17 @@ var No = V.forwardRef(
|
|
|
2006
2011
|
), ve = "DialogContent", Pn = V.forwardRef(
|
|
2007
2012
|
(e, t) => {
|
|
2008
2013
|
const n = wn(ve, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, a = ae(ve, e.__scopeDialog);
|
|
2009
|
-
return /* @__PURE__ */ s(vt, { present: r || a.open, children: a.modal ? /* @__PURE__ */ s(
|
|
2014
|
+
return /* @__PURE__ */ s(vt, { present: r || a.open, children: a.modal ? /* @__PURE__ */ s(Oo, { ...o, ref: t }) : /* @__PURE__ */ s(Do, { ...o, ref: t }) });
|
|
2010
2015
|
}
|
|
2011
2016
|
);
|
|
2012
2017
|
Pn.displayName = ve;
|
|
2013
|
-
var
|
|
2018
|
+
var Oo = V.forwardRef(
|
|
2014
2019
|
(e, t) => {
|
|
2015
2020
|
const n = ae(ve, e.__scopeDialog), r = V.useRef(null), o = gt(t, n.contentRef, r);
|
|
2016
2021
|
return V.useEffect(() => {
|
|
2017
2022
|
const a = r.current;
|
|
2018
2023
|
if (a)
|
|
2019
|
-
return
|
|
2024
|
+
return Cr(a);
|
|
2020
2025
|
}, []), /* @__PURE__ */ s(
|
|
2021
2026
|
Tn,
|
|
2022
2027
|
{
|
|
@@ -2039,7 +2044,7 @@ var Mo = V.forwardRef(
|
|
|
2039
2044
|
}
|
|
2040
2045
|
);
|
|
2041
2046
|
}
|
|
2042
|
-
),
|
|
2047
|
+
), Do = V.forwardRef(
|
|
2043
2048
|
(e, t) => {
|
|
2044
2049
|
const n = ae(ve, e.__scopeDialog), r = V.useRef(!1), o = V.useRef(!1);
|
|
2045
2050
|
return /* @__PURE__ */ s(
|
|
@@ -2065,9 +2070,9 @@ var Mo = V.forwardRef(
|
|
|
2065
2070
|
), Tn = V.forwardRef(
|
|
2066
2071
|
(e, t) => {
|
|
2067
2072
|
const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: a, ...c } = e, i = ae(ve, n), l = V.useRef(null), p = gt(t, l);
|
|
2068
|
-
return
|
|
2073
|
+
return Pr(), /* @__PURE__ */ O(Ae, { children: [
|
|
2069
2074
|
/* @__PURE__ */ s(
|
|
2070
|
-
|
|
2075
|
+
Tr,
|
|
2071
2076
|
{
|
|
2072
2077
|
asChild: !0,
|
|
2073
2078
|
loop: !0,
|
|
@@ -2075,7 +2080,7 @@ var Mo = V.forwardRef(
|
|
|
2075
2080
|
onMountAutoFocus: o,
|
|
2076
2081
|
onUnmountAutoFocus: a,
|
|
2077
2082
|
children: /* @__PURE__ */ s(
|
|
2078
|
-
|
|
2083
|
+
Sr,
|
|
2079
2084
|
{
|
|
2080
2085
|
role: "dialog",
|
|
2081
2086
|
id: i.contentId,
|
|
@@ -2090,8 +2095,8 @@ var Mo = V.forwardRef(
|
|
|
2090
2095
|
}
|
|
2091
2096
|
),
|
|
2092
2097
|
/* @__PURE__ */ O(Ae, { children: [
|
|
2093
|
-
/* @__PURE__ */ s(
|
|
2094
|
-
/* @__PURE__ */ s(
|
|
2098
|
+
/* @__PURE__ */ s(zo, { titleId: i.titleId }),
|
|
2099
|
+
/* @__PURE__ */ s(ko, { contentRef: l, descriptionId: i.descriptionId })
|
|
2095
2100
|
] })
|
|
2096
2101
|
] });
|
|
2097
2102
|
}
|
|
@@ -2102,13 +2107,13 @@ var Mo = V.forwardRef(
|
|
|
2102
2107
|
}
|
|
2103
2108
|
);
|
|
2104
2109
|
Sn.displayName = Tt;
|
|
2105
|
-
var yn = "DialogDescription",
|
|
2110
|
+
var yn = "DialogDescription", Ao = V.forwardRef(
|
|
2106
2111
|
(e, t) => {
|
|
2107
2112
|
const { __scopeDialog: n, ...r } = e, o = ae(yn, n);
|
|
2108
2113
|
return /* @__PURE__ */ s(Ne.p, { id: o.descriptionId, ...r, ref: t });
|
|
2109
2114
|
}
|
|
2110
2115
|
);
|
|
2111
|
-
|
|
2116
|
+
Ao.displayName = yn;
|
|
2112
2117
|
var In = "DialogClose", xn = V.forwardRef(
|
|
2113
2118
|
(e, t) => {
|
|
2114
2119
|
const { __scopeDialog: n, ...r } = e, o = ae(In, n);
|
|
@@ -2127,11 +2132,11 @@ xn.displayName = In;
|
|
|
2127
2132
|
function St(e) {
|
|
2128
2133
|
return e ? "open" : "closed";
|
|
2129
2134
|
}
|
|
2130
|
-
var Rn = "DialogTitleWarning", [
|
|
2135
|
+
var Rn = "DialogTitleWarning", [Xs, Ln] = xr(Rn, {
|
|
2131
2136
|
contentName: ve,
|
|
2132
2137
|
titleName: Tt,
|
|
2133
2138
|
docsSlug: "dialog"
|
|
2134
|
-
}),
|
|
2139
|
+
}), zo = ({ titleId: e }) => {
|
|
2135
2140
|
const t = Ln(Rn), n = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
2136
2141
|
|
|
2137
2142
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
@@ -2140,14 +2145,14 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
2140
2145
|
return V.useEffect(() => {
|
|
2141
2146
|
e && (document.getElementById(e) || console.error(n));
|
|
2142
2147
|
}, [n, e]), null;
|
|
2143
|
-
},
|
|
2144
|
-
const r = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ln(
|
|
2148
|
+
}, Fo = "DialogDescriptionWarning", ko = ({ contentRef: e, descriptionId: t }) => {
|
|
2149
|
+
const r = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ln(Fo).contentName}}.`;
|
|
2145
2150
|
return V.useEffect(() => {
|
|
2146
2151
|
var a;
|
|
2147
2152
|
const o = (a = e.current) == null ? void 0 : a.getAttribute("aria-describedby");
|
|
2148
2153
|
t && o && (document.getElementById(t) || console.warn(r));
|
|
2149
2154
|
}, [r, e, t]), null;
|
|
2150
|
-
},
|
|
2155
|
+
}, Wo = vn, Ho = bn, $o = Cn, Go = Pn, Vo = Sn, Uo = xn;
|
|
2151
2156
|
const ge = {
|
|
2152
2157
|
"rp-dialog-wrapper": "_rp-dialog-wrapper_slqo7_1",
|
|
2153
2158
|
"rp-dialog-overlay": "_rp-dialog-overlay_slqo7_7",
|
|
@@ -2156,8 +2161,8 @@ const ge = {
|
|
|
2156
2161
|
"rp-dialog-title": "_rp-dialog-title_slqo7_39",
|
|
2157
2162
|
"rp-dialog-close": "_rp-dialog-close_slqo7_47",
|
|
2158
2163
|
"rp-properties-divider": "_rp-properties-divider_slqo7_55"
|
|
2159
|
-
},
|
|
2160
|
-
const { pdfProperties: e } =
|
|
2164
|
+
}, qo = () => {
|
|
2165
|
+
const { pdfProperties: e } = re(), { container: t } = Le(), { activeDocumentProperties: n, setActiveDocumentProperties: r } = Nr(), o = A(() => {
|
|
2161
2166
|
if (!e)
|
|
2162
2167
|
return [];
|
|
2163
2168
|
const {
|
|
@@ -2197,45 +2202,45 @@ const ge = {
|
|
|
2197
2202
|
{ label: "Page count", value: v }
|
|
2198
2203
|
];
|
|
2199
2204
|
}, [e]);
|
|
2200
|
-
return /* @__PURE__ */ s(
|
|
2201
|
-
/* @__PURE__ */ s(
|
|
2202
|
-
/* @__PURE__ */ O(
|
|
2203
|
-
/* @__PURE__ */ s(
|
|
2204
|
-
/* @__PURE__ */ s("div", { className: ge["rp-document-properties"], children: o.map((a, c) => /* @__PURE__ */ s("div", { children: a.separate ? /* @__PURE__ */ s("div", { className: ge["rp-properties-divider"] }) : /* @__PURE__ */ s(
|
|
2205
|
-
/* @__PURE__ */ s(
|
|
2205
|
+
return /* @__PURE__ */ s(Wo, { open: n, onOpenChange: r, children: /* @__PURE__ */ s(Ho, { container: t, children: /* @__PURE__ */ O("div", { className: ge["rp-dialog-wrapper"], children: [
|
|
2206
|
+
/* @__PURE__ */ s($o, { className: ge["rp-dialog-overlay"] }),
|
|
2207
|
+
/* @__PURE__ */ O(Go, { className: ge["rp-document-dialog"], children: [
|
|
2208
|
+
/* @__PURE__ */ s(Vo, { className: ge["rp-dialog-title"], children: "Document Properties" }),
|
|
2209
|
+
/* @__PURE__ */ s("div", { className: ge["rp-document-properties"], children: o.map((a, c) => /* @__PURE__ */ s("div", { children: a.separate ? /* @__PURE__ */ s("div", { className: ge["rp-properties-divider"] }) : /* @__PURE__ */ s(Lr, { label: a.label, value: a.value }) }, c)) }),
|
|
2210
|
+
/* @__PURE__ */ s(Uo, { asChild: !0, className: ge["rp-dialog-close"], children: /* @__PURE__ */ s(Qt, {}) })
|
|
2206
2211
|
] })
|
|
2207
2212
|
] }) }) });
|
|
2208
|
-
},
|
|
2213
|
+
}, Zo = {
|
|
2209
2214
|
"rp-other-tool-content": "_rp-other-tool-content_su718_1"
|
|
2210
|
-
},
|
|
2215
|
+
}, jo = (e) => URL.createObjectURL(e), Bo = async (e) => {
|
|
2211
2216
|
const n = await (await fetch(e)).blob();
|
|
2212
|
-
return
|
|
2213
|
-
},
|
|
2214
|
-
const { filename: e, pdfSrc: t } =
|
|
2215
|
-
return { download:
|
|
2217
|
+
return jo(n);
|
|
2218
|
+
}, Ko = () => {
|
|
2219
|
+
const { filename: e, pdfSrc: t } = re();
|
|
2220
|
+
return { download: x(async () => {
|
|
2216
2221
|
if (!e || !t)
|
|
2217
2222
|
throw new Error("There is no PDF source to download");
|
|
2218
2223
|
const r = document.createElement("a");
|
|
2219
|
-
r.href = await
|
|
2224
|
+
r.href = await Bo(t), r.download = e, document.body.appendChild(r), r.click(), document.body.removeChild(r);
|
|
2220
2225
|
}, []) };
|
|
2221
2226
|
}, Nn = () => {
|
|
2222
2227
|
const { downloadIcon: e } = ce();
|
|
2223
|
-
return e || /* @__PURE__ */ s(
|
|
2224
|
-
}, Mn = ({ children: e, className: t }) => /* @__PURE__ */ s(
|
|
2228
|
+
return e || /* @__PURE__ */ s(Ar, {});
|
|
2229
|
+
}, Mn = ({ children: e, className: t }) => /* @__PURE__ */ s(te, { className: t, content: "Download file", children: e }), Xo = ({ download: e }) => /* @__PURE__ */ s(Mn, { children: /* @__PURE__ */ s(X, { onClick: e, children: /* @__PURE__ */ s(Nn, {}) }) }), Jo = ({ download: e }) => /* @__PURE__ */ s(fe, { onClick: e, children: /* @__PURE__ */ O(Mn, { className: "rp-menu-item", children: [
|
|
2225
2230
|
/* @__PURE__ */ s("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ s(Nn, {}) }),
|
|
2226
2231
|
"Download file"
|
|
2227
2232
|
] }) }), En = () => {
|
|
2228
|
-
const { download: e } =
|
|
2229
|
-
return t ? n ? /* @__PURE__ */ s(
|
|
2233
|
+
const { download: e } = Ko(), { downloadTool: t = !0 } = de(), { isSmallScreen: n } = _e();
|
|
2234
|
+
return t ? n ? /* @__PURE__ */ s(Jo, { download: e }) : typeof t == "function" ? /* @__PURE__ */ s(t, { download: e }) : t ? /* @__PURE__ */ s(Xo, { download: e }) : null : null;
|
|
2230
2235
|
}, On = () => {
|
|
2231
2236
|
const { printIcon: e } = ce();
|
|
2232
|
-
return e || /* @__PURE__ */ s(
|
|
2233
|
-
}, Dn = ({ children: e, className: t }) => /* @__PURE__ */ s(
|
|
2237
|
+
return e || /* @__PURE__ */ s(zr, {});
|
|
2238
|
+
}, Dn = ({ children: e, className: t }) => /* @__PURE__ */ s(te, { className: t, content: "Print", children: e }), Yo = ({ print: e }) => /* @__PURE__ */ s(Dn, { children: /* @__PURE__ */ s(X, { onClick: e, children: /* @__PURE__ */ s(On, {}) }) }), Qo = ({ print: e }) => /* @__PURE__ */ s(fe, { onClick: e, children: /* @__PURE__ */ O(Dn, { className: "rp-menu-item", children: [
|
|
2234
2239
|
/* @__PURE__ */ s("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ s(On, {}) }),
|
|
2235
2240
|
"Print"
|
|
2236
2241
|
] }) }), An = () => {
|
|
2237
2242
|
const { print: e, cancel: t, setOnProgress: n, setOnComplete: r, setOnError: o, progress: a } = wt(), { printTool: c = !0 } = de(), { isSmallScreen: i } = _e();
|
|
2238
|
-
return c ? i ? /* @__PURE__ */ s(
|
|
2243
|
+
return c ? i ? /* @__PURE__ */ s(Qo, { print: e }) : typeof c == "function" ? /* @__PURE__ */ s(
|
|
2239
2244
|
c,
|
|
2240
2245
|
{
|
|
2241
2246
|
print: e,
|
|
@@ -2245,33 +2250,33 @@ const ge = {
|
|
|
2245
2250
|
setOnComplete: r,
|
|
2246
2251
|
progress: a
|
|
2247
2252
|
}
|
|
2248
|
-
) : c ? /* @__PURE__ */ s(
|
|
2249
|
-
},
|
|
2253
|
+
) : c ? /* @__PURE__ */ s(Yo, { print: e }) : null : null;
|
|
2254
|
+
}, ea = {
|
|
2250
2255
|
"rp-go-to-Top": "_rp-go-to-Top_4e0yd_1"
|
|
2251
|
-
},
|
|
2256
|
+
}, ta = () => {
|
|
2252
2257
|
const { goToFirstPageIcon: e } = ce();
|
|
2253
|
-
return e || /* @__PURE__ */ s(tn, { className:
|
|
2254
|
-
},
|
|
2258
|
+
return e || /* @__PURE__ */ s(tn, { className: ea["rp-go-to-Top"] });
|
|
2259
|
+
}, na = () => {
|
|
2255
2260
|
const { goToLastPageIcon: e } = ce();
|
|
2256
2261
|
return e || /* @__PURE__ */ s(tn, {});
|
|
2257
|
-
},
|
|
2258
|
-
const { goToPage: e, totalPages: t, focusedPage: n } = oe(), { jumpNavigationTool: r = !0 } = de(), o = A(() => n === 1, [n]), a = A(() => n === t, [n, t]), c =
|
|
2262
|
+
}, ra = () => {
|
|
2263
|
+
const { goToPage: e, totalPages: t, focusedPage: n } = oe(), { jumpNavigationTool: r = !0 } = de(), o = A(() => n === 1, [n]), a = A(() => n === t, [n, t]), c = x(() => {
|
|
2259
2264
|
e(1);
|
|
2260
|
-
}, [e]), i =
|
|
2265
|
+
}, [e]), i = x(() => {
|
|
2261
2266
|
e(t);
|
|
2262
2267
|
}, [e, t]);
|
|
2263
2268
|
return r ? /* @__PURE__ */ O(Fe, { children: [
|
|
2264
|
-
/* @__PURE__ */ s(
|
|
2265
|
-
/* @__PURE__ */ s("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ s(
|
|
2269
|
+
/* @__PURE__ */ s(fe, { disabled: o, onClick: c, children: /* @__PURE__ */ O(te, { className: "rp-menu-item", content: "Go to first page", children: [
|
|
2270
|
+
/* @__PURE__ */ s("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ s(ta, {}) }),
|
|
2266
2271
|
"First page"
|
|
2267
2272
|
] }) }),
|
|
2268
|
-
/* @__PURE__ */ s(
|
|
2269
|
-
/* @__PURE__ */ s("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ s(
|
|
2273
|
+
/* @__PURE__ */ s(fe, { disabled: a, onClick: i, children: /* @__PURE__ */ O(te, { className: "rp-menu-item", content: "Go to last page", children: [
|
|
2274
|
+
/* @__PURE__ */ s("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ s(na, {}) }),
|
|
2270
2275
|
"Last page"
|
|
2271
2276
|
] }) }),
|
|
2272
2277
|
/* @__PURE__ */ s(_t, {})
|
|
2273
2278
|
] }) : null;
|
|
2274
|
-
},
|
|
2279
|
+
}, oa = () => {
|
|
2275
2280
|
const { container: e } = Le(), { isSmallScreen: t } = _e(), {
|
|
2276
2281
|
openFileTool: n,
|
|
2277
2282
|
downloadTool: r,
|
|
@@ -2296,13 +2301,13 @@ const ge = {
|
|
|
2296
2301
|
i,
|
|
2297
2302
|
l,
|
|
2298
2303
|
t
|
|
2299
|
-
]) ? /* @__PURE__ */ O(
|
|
2304
|
+
]) ? /* @__PURE__ */ O(Mr, { children: [
|
|
2300
2305
|
/* @__PURE__ */ s(
|
|
2301
2306
|
ft,
|
|
2302
2307
|
{
|
|
2303
2308
|
container: e,
|
|
2304
|
-
triggerComponent: /* @__PURE__ */ s("div", { role: "button", children: /* @__PURE__ */ s(
|
|
2305
|
-
children: /* @__PURE__ */ O("div", { className:
|
|
2309
|
+
triggerComponent: /* @__PURE__ */ s("div", { role: "button", children: /* @__PURE__ */ s(te, { content: "More options", children: /* @__PURE__ */ s(X, { children: /* @__PURE__ */ s(_r, {}) }) }) }),
|
|
2310
|
+
children: /* @__PURE__ */ O("div", { className: Zo["rp-other-tool-content"], "data-rp": "moreOptionsDropdown", children: [
|
|
2306
2311
|
t && /* @__PURE__ */ O(Fe, { children: [
|
|
2307
2312
|
/* @__PURE__ */ s(Yt, {}),
|
|
2308
2313
|
/* @__PURE__ */ s(En, {}),
|
|
@@ -2310,27 +2315,27 @@ const ge = {
|
|
|
2310
2315
|
/* @__PURE__ */ s(en, {}),
|
|
2311
2316
|
/* @__PURE__ */ s(_t, {})
|
|
2312
2317
|
] }),
|
|
2313
|
-
/* @__PURE__ */ s(
|
|
2314
|
-
/* @__PURE__ */ s(
|
|
2315
|
-
/* @__PURE__ */ s(
|
|
2316
|
-
/* @__PURE__ */ s(
|
|
2317
|
-
/* @__PURE__ */ s(
|
|
2318
|
+
/* @__PURE__ */ s(ra, {}),
|
|
2319
|
+
/* @__PURE__ */ s(Or, {}),
|
|
2320
|
+
/* @__PURE__ */ s(Fr, {}),
|
|
2321
|
+
/* @__PURE__ */ s(Dr, {}),
|
|
2322
|
+
/* @__PURE__ */ s(Er, {})
|
|
2318
2323
|
] })
|
|
2319
2324
|
}
|
|
2320
2325
|
),
|
|
2321
|
-
/* @__PURE__ */ s(
|
|
2326
|
+
/* @__PURE__ */ s(qo, {})
|
|
2322
2327
|
] }) : null;
|
|
2323
|
-
},
|
|
2328
|
+
}, aa = () => {
|
|
2324
2329
|
const { isSmallScreen: e } = _e();
|
|
2325
2330
|
return /* @__PURE__ */ O(Ae, { children: [
|
|
2326
|
-
/* @__PURE__ */ s(
|
|
2331
|
+
/* @__PURE__ */ s(vr, {}),
|
|
2327
2332
|
!e && /* @__PURE__ */ O(Ae, { children: [
|
|
2328
2333
|
/* @__PURE__ */ s(Yt, {}),
|
|
2329
2334
|
/* @__PURE__ */ s(En, {}),
|
|
2330
2335
|
/* @__PURE__ */ s(An, {}),
|
|
2331
2336
|
/* @__PURE__ */ s(en, {})
|
|
2332
2337
|
] }),
|
|
2333
|
-
/* @__PURE__ */ s(
|
|
2338
|
+
/* @__PURE__ */ s(oa, {})
|
|
2334
2339
|
] });
|
|
2335
2340
|
}, ye = {
|
|
2336
2341
|
"rp-zoom-wrapper": "_rp-zoom-wrapper_163s9_1",
|
|
@@ -2338,45 +2343,45 @@ const ge = {
|
|
|
2338
2343
|
"rp-current-zoom-icon": "_rp-current-zoom-icon_163s9_11",
|
|
2339
2344
|
"rp-current-zoom": "_rp-current-zoom_163s9_6",
|
|
2340
2345
|
"rp-zoom-dropdown-content": "_rp-zoom-dropdown-content_163s9_20"
|
|
2341
|
-
},
|
|
2346
|
+
}, sa = 25, rt = 1e3, ia = [50, 75, 100, 125, 150, 200, 300, 400], ca = () => {
|
|
2342
2347
|
const { zoomInIcon: e } = ce();
|
|
2343
|
-
return e || /* @__PURE__ */ s(
|
|
2344
|
-
},
|
|
2348
|
+
return e || /* @__PURE__ */ s(kr, {});
|
|
2349
|
+
}, la = () => {
|
|
2345
2350
|
const { zoomOutIcon: e } = ce();
|
|
2346
|
-
return e || /* @__PURE__ */ s(
|
|
2347
|
-
},
|
|
2348
|
-
const { zoomLevel: e, setZoomLevel: t } = Ve(), { container: n, contentRef: r } = Le(), { zoomTool: o = !0 } = de(), { focusedPage: a } = oe(), { rotate: c } = Ge(), { pages: i } =
|
|
2351
|
+
return e || /* @__PURE__ */ s(Wr, {});
|
|
2352
|
+
}, ua = () => {
|
|
2353
|
+
const { zoomLevel: e, setZoomLevel: t } = Ve(), { container: n, contentRef: r } = Le(), { zoomTool: o = !0 } = de(), { focusedPage: a } = oe(), { rotate: c } = Ge(), { pages: i } = re(), { isSmallScreen: l } = _e(), p = x(() => {
|
|
2349
2354
|
t((v) => {
|
|
2350
2355
|
const C = Math.floor(v / 25) * 25;
|
|
2351
2356
|
return Math.min(C + 25, rt);
|
|
2352
2357
|
});
|
|
2353
|
-
}, [t]), h =
|
|
2358
|
+
}, [t]), h = x(() => {
|
|
2354
2359
|
t((v) => {
|
|
2355
2360
|
const C = Math.ceil(v / 25) * 25;
|
|
2356
2361
|
return Math.min(C - 25, rt);
|
|
2357
2362
|
});
|
|
2358
|
-
}, [t]), f = A(() => e ===
|
|
2363
|
+
}, [t]), f = A(() => e === sa, [e]), u = A(() => e === rt, [e]), m = A(() => {
|
|
2359
2364
|
var v;
|
|
2360
2365
|
return (v = i.get(a)) == null ? void 0 : v.page.getViewport({ scale: 1, rotation: c });
|
|
2361
|
-
}, [i, a, c]), g =
|
|
2366
|
+
}, [i, a, c]), g = x(
|
|
2362
2367
|
(v) => {
|
|
2363
|
-
const C = ((m == null ? void 0 : m.width) || 0) + 2 * It,
|
|
2368
|
+
const C = ((m == null ? void 0 : m.width) || 0) + 2 * It, S = ((m == null ? void 0 : m.height) || 0) + 2 * It, P = (r == null ? void 0 : r.clientWidth) || 0, L = (r == null ? void 0 : r.clientHeight) || 0, d = Hr(v, P, L, C, S);
|
|
2364
2369
|
t(d);
|
|
2365
2370
|
},
|
|
2366
2371
|
[t, m]
|
|
2367
|
-
), _ =
|
|
2372
|
+
), _ = x(
|
|
2368
2373
|
(v) => {
|
|
2369
2374
|
typeof v == "number" ? t(v) : g(v);
|
|
2370
2375
|
},
|
|
2371
2376
|
[t, g]
|
|
2372
2377
|
);
|
|
2373
2378
|
return typeof o != "boolean" ? /* @__PURE__ */ s(o, { zoomLevel: e, setZoomLevel: t }) : o ? /* @__PURE__ */ O("div", { className: ye["rp-zoom-wrapper"], children: [
|
|
2374
|
-
/* @__PURE__ */ s(
|
|
2379
|
+
/* @__PURE__ */ s(te, { content: "Zoom out", children: /* @__PURE__ */ s(X, { disabled: f, onClick: h, children: /* @__PURE__ */ s(la, {}) }) }),
|
|
2375
2380
|
!l && /* @__PURE__ */ s(
|
|
2376
2381
|
ft,
|
|
2377
2382
|
{
|
|
2378
2383
|
container: n,
|
|
2379
|
-
triggerComponent: /* @__PURE__ */ s("div", { role: "button", children: /* @__PURE__ */ s(
|
|
2384
|
+
triggerComponent: /* @__PURE__ */ s("div", { role: "button", children: /* @__PURE__ */ s(te, { content: "Select zoom level", children: /* @__PURE__ */ O(X, { className: ye["rp-current-zoom-wrapper"], children: [
|
|
2380
2385
|
/* @__PURE__ */ O("span", { className: ye["rp-current-zoom"], children: [
|
|
2381
2386
|
e,
|
|
2382
2387
|
" %"
|
|
@@ -2387,19 +2392,19 @@ const ge = {
|
|
|
2387
2392
|
align: "center",
|
|
2388
2393
|
children: /* @__PURE__ */ O("div", { className: ye["rp-zoom-dropdown-content"], children: [
|
|
2389
2394
|
/* @__PURE__ */ O(Fe, { children: [
|
|
2390
|
-
/* @__PURE__ */ s(
|
|
2391
|
-
/* @__PURE__ */ s(
|
|
2392
|
-
/* @__PURE__ */ s(
|
|
2395
|
+
/* @__PURE__ */ s(fe, { onClick: () => _(Be.ACTUAL), children: "Actual size" }),
|
|
2396
|
+
/* @__PURE__ */ s(fe, { onClick: () => _(Be.PAGE_FIT), children: "Page fit" }),
|
|
2397
|
+
/* @__PURE__ */ s(fe, { onClick: () => _(Be.PAGE_WIDTH), children: "Page width" })
|
|
2393
2398
|
] }),
|
|
2394
2399
|
/* @__PURE__ */ s(_t, {}),
|
|
2395
|
-
/* @__PURE__ */ s(Fe, { children:
|
|
2400
|
+
/* @__PURE__ */ s(Fe, { children: ia.map((v) => /* @__PURE__ */ O(fe, { onClick: () => _(v), children: [
|
|
2396
2401
|
v,
|
|
2397
2402
|
" %"
|
|
2398
2403
|
] }, v)) })
|
|
2399
2404
|
] })
|
|
2400
2405
|
}
|
|
2401
2406
|
),
|
|
2402
|
-
/* @__PURE__ */ s(
|
|
2407
|
+
/* @__PURE__ */ s(te, { content: "Zoom in", children: /* @__PURE__ */ s(X, { disabled: u, onClick: p, children: /* @__PURE__ */ s(ca, {}) }) })
|
|
2403
2408
|
] }) : null;
|
|
2404
2409
|
}, ie = {
|
|
2405
2410
|
"rp-search-tool-content": "_rp-search-tool-content_1vxow_1",
|
|
@@ -2412,9 +2417,9 @@ const ge = {
|
|
|
2412
2417
|
"rp-search-input": "_rp-search-input_1vxow_49"
|
|
2413
2418
|
}, Ut = () => {
|
|
2414
2419
|
const { searchIcon: e } = ce();
|
|
2415
|
-
return e || /* @__PURE__ */ s(
|
|
2416
|
-
},
|
|
2417
|
-
const { container: e } = Le(), [t, n] =
|
|
2420
|
+
return e || /* @__PURE__ */ s($r, {});
|
|
2421
|
+
}, da = () => {
|
|
2422
|
+
const { container: e } = Le(), [t, n] = H(!1), { pdf: r } = re(), [o, a] = H(null), {
|
|
2418
2423
|
searchOptions: c,
|
|
2419
2424
|
setSearchOptions: i,
|
|
2420
2425
|
loading: l,
|
|
@@ -2424,42 +2429,42 @@ const ge = {
|
|
|
2424
2429
|
nextMatch: u,
|
|
2425
2430
|
prevMatch: m,
|
|
2426
2431
|
search: g
|
|
2427
|
-
} = ln(), { searchTool: _ = !0 } = de(), [v, C] =
|
|
2432
|
+
} = ln(), { searchTool: _ = !0 } = de(), [v, C] = H(g), S = x(() => {
|
|
2428
2433
|
n(!0);
|
|
2429
|
-
}, []), P =
|
|
2434
|
+
}, []), P = x(() => {
|
|
2430
2435
|
p(""), C(""), n(!1);
|
|
2431
|
-
}, [p]), L =
|
|
2432
|
-
(
|
|
2433
|
-
|
|
2436
|
+
}, [p]), L = x(
|
|
2437
|
+
(R) => {
|
|
2438
|
+
R.key === "Escape" && t && P();
|
|
2434
2439
|
},
|
|
2435
2440
|
[t]
|
|
2436
|
-
), d =
|
|
2437
|
-
(
|
|
2438
|
-
|
|
2441
|
+
), d = x(
|
|
2442
|
+
(R) => {
|
|
2443
|
+
R.shiftKey && R.key === "Enter" ? m() : R.key === "Enter" && g !== v ? p(v) : R.key === "Enter" && u();
|
|
2439
2444
|
},
|
|
2440
2445
|
[v, m, u, p, g]
|
|
2441
2446
|
);
|
|
2442
|
-
|
|
2447
|
+
z(() => (window.addEventListener("keydown", L), () => {
|
|
2443
2448
|
window.removeEventListener("keydown", L);
|
|
2444
|
-
}), [L]),
|
|
2449
|
+
}), [L]), z(() => {
|
|
2445
2450
|
o && o.focus();
|
|
2446
2451
|
}, [o]);
|
|
2447
|
-
const b =
|
|
2448
|
-
C(
|
|
2449
|
-
}, []), w =
|
|
2452
|
+
const b = x((R) => {
|
|
2453
|
+
C(R.target.value);
|
|
2454
|
+
}, []), w = x(() => {
|
|
2450
2455
|
C(""), p("");
|
|
2451
|
-
}, [p]), T = A(() => `${f} / ${h}`, [f, h]), { wholeWords:
|
|
2452
|
-
(
|
|
2453
|
-
i((N) => ({ ...N, matchCase:
|
|
2456
|
+
}, [p]), T = A(() => `${f} / ${h}`, [f, h]), { wholeWords: E, matchCase: I } = A(() => c, [c]), y = x(
|
|
2457
|
+
(R) => {
|
|
2458
|
+
i((N) => ({ ...N, matchCase: R }));
|
|
2454
2459
|
},
|
|
2455
2460
|
[i]
|
|
2456
|
-
),
|
|
2457
|
-
(
|
|
2458
|
-
i((N) => ({ ...N, wholeWords:
|
|
2461
|
+
), D = x(
|
|
2462
|
+
(R) => {
|
|
2463
|
+
i((N) => ({ ...N, wholeWords: R }));
|
|
2459
2464
|
},
|
|
2460
2465
|
[i]
|
|
2461
2466
|
);
|
|
2462
|
-
return
|
|
2467
|
+
return z(() => {
|
|
2463
2468
|
P();
|
|
2464
2469
|
}, [r, P]), _ ? /* @__PURE__ */ s(
|
|
2465
2470
|
ft,
|
|
@@ -2467,7 +2472,7 @@ const ge = {
|
|
|
2467
2472
|
open: t,
|
|
2468
2473
|
container: e,
|
|
2469
2474
|
align: "start",
|
|
2470
|
-
triggerComponent: /* @__PURE__ */ s(
|
|
2475
|
+
triggerComponent: /* @__PURE__ */ s(te, { content: "Search in document", children: /* @__PURE__ */ s(X, { onClick: S, children: /* @__PURE__ */ s(Ut, {}) }) }),
|
|
2471
2476
|
children: /* @__PURE__ */ O("div", { className: ie["rp-search-tool-content"], children: [
|
|
2472
2477
|
/* @__PURE__ */ O("div", { className: ie["rp-search-tool-input-wrapper"], children: [
|
|
2473
2478
|
/* @__PURE__ */ O("div", { className: ie["rp-search-tool-input"], children: [
|
|
@@ -2481,14 +2486,14 @@ const ge = {
|
|
|
2481
2486
|
placeholder: "Enter to Search",
|
|
2482
2487
|
className: ie["rp-search-input"],
|
|
2483
2488
|
ref: a,
|
|
2484
|
-
children: !!v && /* @__PURE__ */ s("span", { className: ie["rp-search-tool-input-clear"], onClick: w, children: /* @__PURE__ */ s(
|
|
2489
|
+
children: !!v && /* @__PURE__ */ s("span", { className: ie["rp-search-tool-input-clear"], onClick: w, children: /* @__PURE__ */ s(Gr, {}) })
|
|
2485
2490
|
}
|
|
2486
2491
|
),
|
|
2487
2492
|
l ? /* @__PURE__ */ s("span", { children: /* @__PURE__ */ s(mt, {}) }) : /* @__PURE__ */ s("span", { children: T })
|
|
2488
2493
|
] }),
|
|
2489
2494
|
/* @__PURE__ */ O("div", { className: ie["rp-search-tool-input-checkboxes"], children: [
|
|
2490
|
-
/* @__PURE__ */ s(xt, { name: "matchCase", value: I, onChange:
|
|
2491
|
-
/* @__PURE__ */ s(xt, { name: "wholeWord", value:
|
|
2495
|
+
/* @__PURE__ */ s(xt, { name: "matchCase", value: I, onChange: y, children: "Match Case" }),
|
|
2496
|
+
/* @__PURE__ */ s(xt, { name: "wholeWord", value: E, onChange: D, children: "Whole Word" })
|
|
2492
2497
|
] })
|
|
2493
2498
|
] }),
|
|
2494
2499
|
/* @__PURE__ */ O("div", { className: ie["rp-search-tool-controls"], children: [
|
|
@@ -2505,39 +2510,39 @@ const ge = {
|
|
|
2505
2510
|
] })
|
|
2506
2511
|
}
|
|
2507
2512
|
) : null;
|
|
2508
|
-
},
|
|
2513
|
+
}, pa = "_loading_1snj5_1", Pe = {
|
|
2509
2514
|
"rp-loading-overlay": "_rp-loading-overlay_1snj5_1",
|
|
2510
2515
|
"rp-loading-modal": "_rp-loading-modal_1snj5_14",
|
|
2511
2516
|
"rp-loading-title": "_rp-loading-title_1snj5_27",
|
|
2512
2517
|
"rp-loading-progress-bar": "_rp-loading-progress-bar_1snj5_35",
|
|
2513
2518
|
"rp-loading-progress": "_rp-loading-progress_1snj5_35",
|
|
2514
2519
|
"rp-loading-cancel-button": "_rp-loading-cancel-button_1snj5_52",
|
|
2515
|
-
loading:
|
|
2516
|
-
},
|
|
2520
|
+
loading: pa
|
|
2521
|
+
}, ha = ({ percentage: e }) => {
|
|
2517
2522
|
const { cancel: t } = wt();
|
|
2518
|
-
return e < 1 ? null : /* @__PURE__ */ s("div", { className:
|
|
2519
|
-
/* @__PURE__ */ s("div", { className:
|
|
2520
|
-
/* @__PURE__ */ s("div", { className:
|
|
2523
|
+
return e < 1 ? null : /* @__PURE__ */ s("div", { className: ee(Pe["rp-loading-overlay"]), children: /* @__PURE__ */ O("div", { className: ee(Pe["rp-loading-modal"]), children: [
|
|
2524
|
+
/* @__PURE__ */ s("div", { className: ee(Pe["rp-loading-title"]), children: "Preparing document..." }),
|
|
2525
|
+
/* @__PURE__ */ s("div", { className: ee(Pe["rp-loading-progress-bar"]), children: /* @__PURE__ */ s(
|
|
2521
2526
|
"div",
|
|
2522
2527
|
{
|
|
2523
|
-
className:
|
|
2528
|
+
className: ee(Pe["rp-loading-progress"]),
|
|
2524
2529
|
style: { width: `${e}%` }
|
|
2525
2530
|
}
|
|
2526
2531
|
) }),
|
|
2527
|
-
/* @__PURE__ */ s("button", { className:
|
|
2532
|
+
/* @__PURE__ */ s("button", { className: ee(Pe["rp-loading-cancel-button"]), onClick: t, children: "Cancel" })
|
|
2528
2533
|
] }) });
|
|
2529
|
-
},
|
|
2534
|
+
}, ma = $e((e, t) => {
|
|
2530
2535
|
const { showPrintProgress: n } = de(), { progress: r } = wt(), { isSmallScreen: o } = _e(), { percentage: a } = r || {}, c = () => o ? { gridTemplateColumns: "25% 60% 15%" } : void 0;
|
|
2531
2536
|
return /* @__PURE__ */ O("div", { children: [
|
|
2532
2537
|
/* @__PURE__ */ s("div", { "data-rp": "topBar", ref: t, className: Se["rp-toolbar-content"], children: /* @__PURE__ */ O("div", { className: Se["rp-toolbar-wrapper"], style: c(), children: [
|
|
2533
2538
|
/* @__PURE__ */ O("div", { "data-rp": "topBarLeft", className: Se["rp-toolbar-start"], children: [
|
|
2534
|
-
/* @__PURE__ */ s(
|
|
2535
|
-
/* @__PURE__ */ s(
|
|
2539
|
+
/* @__PURE__ */ s(da, {}),
|
|
2540
|
+
/* @__PURE__ */ s(Ro, {})
|
|
2536
2541
|
] }),
|
|
2537
|
-
/* @__PURE__ */ s("div", { "data-rp": "topBarCenter", className: Se["rp-toolbar-middle"], children: /* @__PURE__ */ s(
|
|
2538
|
-
/* @__PURE__ */ s("div", { "data-rp": "topBarRight", className: Se["rp-toolbar-end"], children: /* @__PURE__ */ s(
|
|
2542
|
+
/* @__PURE__ */ s("div", { "data-rp": "topBarCenter", className: Se["rp-toolbar-middle"], children: /* @__PURE__ */ s(ua, {}) }),
|
|
2543
|
+
/* @__PURE__ */ s("div", { "data-rp": "topBarRight", className: Se["rp-toolbar-end"], children: /* @__PURE__ */ s(aa, {}) })
|
|
2539
2544
|
] }) }),
|
|
2540
|
-
n && a ? /* @__PURE__ */ s(
|
|
2545
|
+
n && a ? /* @__PURE__ */ s(ha, { percentage: a }) : null
|
|
2541
2546
|
] });
|
|
2542
2547
|
}), ot = {
|
|
2543
2548
|
"rp-sidebar-content-wrapper": "_rp-sidebar-content-wrapper_4wlw3_1",
|
|
@@ -2550,11 +2555,11 @@ const ge = {
|
|
|
2550
2555
|
"rp-thumbnail": "_rp-thumbnail_3fenb_1",
|
|
2551
2556
|
"rp-thumbnail-active": "_rp-thumbnail-active_3fenb_22",
|
|
2552
2557
|
"rp-thumbnail-loader": "_rp-thumbnail-loader_3fenb_31"
|
|
2553
|
-
},
|
|
2558
|
+
}, fa = (e) => {
|
|
2554
2559
|
const { thumbnailSrc: t, pageNumber: n, isFocused: r, viewport: o } = e, { goToPage: a } = oe(), c = A(() => r ? Ie["rp-thumbnail-active"] : "", [r]), i = A(() => ({
|
|
2555
2560
|
width: Math.round(o.width),
|
|
2556
2561
|
height: Math.round(o.height)
|
|
2557
|
-
}), [o]), l =
|
|
2562
|
+
}), [o]), l = x(() => {
|
|
2558
2563
|
n && a(n);
|
|
2559
2564
|
}, [a, n]);
|
|
2560
2565
|
return /* @__PURE__ */ O(
|
|
@@ -2564,7 +2569,7 @@ const ge = {
|
|
|
2564
2569
|
id: `page-${n}`,
|
|
2565
2570
|
className: Ie["rp-thumbnail-wrapper"],
|
|
2566
2571
|
children: [
|
|
2567
|
-
/* @__PURE__ */ s("div", { className:
|
|
2572
|
+
/* @__PURE__ */ s("div", { className: ee(c, Ie["rp-thumbnail"]), children: t ? /* @__PURE__ */ s(
|
|
2568
2573
|
"img",
|
|
2569
2574
|
{
|
|
2570
2575
|
src: t,
|
|
@@ -2590,22 +2595,22 @@ const ge = {
|
|
|
2590
2595
|
}, qt = {
|
|
2591
2596
|
"rp-thumbnails-container": "_rp-thumbnails-container_16vqr_1",
|
|
2592
2597
|
"rp-thumbnails": "_rp-thumbnails_16vqr_1"
|
|
2593
|
-
},
|
|
2598
|
+
}, ga = 16, va = (e, t) => {
|
|
2594
2599
|
const n = e == null ? void 0 : e.querySelector(`#page-${t}`);
|
|
2595
|
-
e && (n != null && n.offsetTop) && (e.scrollTop = (n == null ? void 0 : n.offsetTop) -
|
|
2596
|
-
},
|
|
2597
|
-
const { show: n } = e, { focusedPage: r, totalPages: o } = oe(), { thumbnailPages: a, addPage: c, thumbnailLength: i, addToPage: l } = sn(), p =
|
|
2600
|
+
e && (n != null && n.offsetTop) && (e.scrollTop = (n == null ? void 0 : n.offsetTop) - ga);
|
|
2601
|
+
}, _a = $e((e, t) => {
|
|
2602
|
+
const { show: n } = e, { focusedPage: r, totalPages: o } = oe(), { thumbnailPages: a, addPage: c, thumbnailLength: i, addToPage: l } = sn(), p = W(null), h = W(1);
|
|
2598
2603
|
Zt(t, () => p.current);
|
|
2599
|
-
const f = A(() => Object.values(a), [a]), u =
|
|
2604
|
+
const f = A(() => Object.values(a), [a]), u = x(() => {
|
|
2600
2605
|
const m = i + 1;
|
|
2601
2606
|
m <= o && c(m);
|
|
2602
2607
|
}, [c, o, i]);
|
|
2603
|
-
return
|
|
2604
|
-
r > i ? l(r) : n && h.current !== r && (
|
|
2605
|
-
}, [r, i, l, n, f]),
|
|
2608
|
+
return z(() => {
|
|
2609
|
+
r > i ? l(r) : n && h.current !== r && (va(p.current, r), h.current = r);
|
|
2610
|
+
}, [r, i, l, n, f]), tr(p.current, u), /* @__PURE__ */ s("div", { ref: p, className: qt["rp-thumbnails-container"], children: /* @__PURE__ */ s("div", { className: qt["rp-thumbnails"], children: n ? f.map((m, g) => {
|
|
2606
2611
|
var _, v;
|
|
2607
2612
|
return /* @__PURE__ */ s(
|
|
2608
|
-
|
|
2613
|
+
fa,
|
|
2609
2614
|
{
|
|
2610
2615
|
isFocused: r === ((_ = m.page) == null ? void 0 : _.pageNumber),
|
|
2611
2616
|
pageNumber: (v = m.page) == null ? void 0 : v.pageNumber,
|
|
@@ -2616,13 +2621,13 @@ const ge = {
|
|
|
2616
2621
|
g
|
|
2617
2622
|
);
|
|
2618
2623
|
}) : null }) });
|
|
2619
|
-
}),
|
|
2624
|
+
}), wa = () => {
|
|
2620
2625
|
const { thumbnailIcon: e } = ce();
|
|
2621
|
-
return e || /* @__PURE__ */ s(
|
|
2622
|
-
},
|
|
2623
|
-
const { active: e, setActive: t } = sn(), [n, r] =
|
|
2626
|
+
return e || /* @__PURE__ */ s(er, {});
|
|
2627
|
+
}, ba = () => {
|
|
2628
|
+
const { active: e, setActive: t } = sn(), [n, r] = H(200), o = W(null), { thumbnailTool: a } = de(), c = x(() => {
|
|
2624
2629
|
t((l) => !l);
|
|
2625
|
-
}, []), i = A(() => typeof a != "boolean" && a ? /* @__PURE__ */ s(a, { onClick: c, active: e }) : a ? /* @__PURE__ */ s(
|
|
2630
|
+
}, []), i = A(() => typeof a != "boolean" && a ? /* @__PURE__ */ s(a, { onClick: c, active: e }) : a ? /* @__PURE__ */ s(te, { content: "Thumbnail", children: /* @__PURE__ */ s(X, { onClick: c, active: e, children: /* @__PURE__ */ s(wa, {}) }) }) : null, [a, e, c]);
|
|
2626
2631
|
return /* @__PURE__ */ O(
|
|
2627
2632
|
"div",
|
|
2628
2633
|
{
|
|
@@ -2632,76 +2637,76 @@ const ge = {
|
|
|
2632
2637
|
children: [
|
|
2633
2638
|
/* @__PURE__ */ s("div", { className: ot["rp-sidebar-content"], children: i }),
|
|
2634
2639
|
/* @__PURE__ */ O("div", { "data-rp": "thumbnailSidebar", hidden: !e, className: ot["rp-thumbnails-wrapper"], children: [
|
|
2635
|
-
/* @__PURE__ */ s(
|
|
2636
|
-
/* @__PURE__ */ s(
|
|
2640
|
+
/* @__PURE__ */ s(_a, { show: e, ref: o }),
|
|
2641
|
+
/* @__PURE__ */ s(nr, { onWidthChange: r, thumbnailRef: o })
|
|
2637
2642
|
] })
|
|
2638
2643
|
]
|
|
2639
2644
|
}
|
|
2640
2645
|
);
|
|
2641
|
-
},
|
|
2642
|
-
const { children: n, slots: r, icons: o, style: a, className: c, mobileWidth: i, onLoaded: l, cleanupOnLoaded: p } = e, [h, f] =
|
|
2643
|
-
return
|
|
2646
|
+
}, Js = $e((e, t) => {
|
|
2647
|
+
const { children: n, slots: r, icons: o, style: a, className: c, mobileWidth: i, onLoaded: l, cleanupOnLoaded: p } = e, [h, f] = H(null), { setContainer: u, setContentRef: m } = Le();
|
|
2648
|
+
return z(() => (l && l(), () => {
|
|
2644
2649
|
p && p();
|
|
2645
|
-
}), [l, p]), /* @__PURE__ */ s("div", { ref: t, className:
|
|
2646
|
-
|
|
2650
|
+
}), [l, p]), /* @__PURE__ */ s("div", { ref: t, className: ee(be["rp-theme-variables"], be["rp-container"]), children: /* @__PURE__ */ s(cr, { mobileWidth: i, children: /* @__PURE__ */ s(rr, { slots: r, children: /* @__PURE__ */ s(or, { icons: o, children: /* @__PURE__ */ s(
|
|
2651
|
+
ar,
|
|
2647
2652
|
{
|
|
2648
2653
|
getContainerRef: u,
|
|
2649
2654
|
toolbarRef: h,
|
|
2650
2655
|
style: a,
|
|
2651
2656
|
className: c,
|
|
2652
|
-
children: /* @__PURE__ */ O(
|
|
2653
|
-
/* @__PURE__ */ O("div", { className:
|
|
2654
|
-
/* @__PURE__ */ s(
|
|
2655
|
-
/* @__PURE__ */ O("div", { className:
|
|
2656
|
-
/* @__PURE__ */ s("div", { className:
|
|
2657
|
-
/* @__PURE__ */ s("div", { ref: m, className:
|
|
2657
|
+
children: /* @__PURE__ */ O(sr, { children: [
|
|
2658
|
+
/* @__PURE__ */ O("div", { className: be["rp-layout"], children: [
|
|
2659
|
+
/* @__PURE__ */ s(ma, { ref: f }),
|
|
2660
|
+
/* @__PURE__ */ O("div", { className: be["rp-content"], children: [
|
|
2661
|
+
/* @__PURE__ */ s("div", { className: be["rp-sidebar"], children: /* @__PURE__ */ s(ba, {}) }),
|
|
2662
|
+
/* @__PURE__ */ s("div", { ref: m, className: be["rp-pages"], children: n })
|
|
2658
2663
|
] })
|
|
2659
2664
|
] }),
|
|
2660
|
-
/* @__PURE__ */ s(
|
|
2665
|
+
/* @__PURE__ */ s(ir, {})
|
|
2661
2666
|
] })
|
|
2662
2667
|
}
|
|
2663
2668
|
) }) }) }) });
|
|
2664
2669
|
});
|
|
2665
2670
|
export {
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
+
no as A,
|
|
2672
|
+
fa as B,
|
|
2673
|
+
jr as C,
|
|
2674
|
+
To as D,
|
|
2675
|
+
_a as E,
|
|
2671
2676
|
En as F,
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2677
|
+
ba as G,
|
|
2678
|
+
ha as L,
|
|
2679
|
+
ra as M,
|
|
2680
|
+
oa as O,
|
|
2681
|
+
Us as P,
|
|
2682
|
+
Bs as R,
|
|
2683
|
+
js as S,
|
|
2684
|
+
Zs as T,
|
|
2685
|
+
ua as Z,
|
|
2686
|
+
qs as a,
|
|
2687
|
+
Js as b,
|
|
2688
|
+
Ko as c,
|
|
2684
2689
|
wt as d,
|
|
2685
2690
|
ln as e,
|
|
2686
2691
|
nn as f,
|
|
2687
|
-
|
|
2692
|
+
Vr as g,
|
|
2688
2693
|
rn as h,
|
|
2689
|
-
|
|
2694
|
+
Ur as i,
|
|
2690
2695
|
on as j,
|
|
2691
|
-
|
|
2696
|
+
qr as k,
|
|
2692
2697
|
an as l,
|
|
2693
2698
|
sn as m,
|
|
2694
|
-
|
|
2699
|
+
Zr as n,
|
|
2695
2700
|
cn as o,
|
|
2696
|
-
|
|
2701
|
+
Br as p,
|
|
2697
2702
|
bt as q,
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2703
|
+
bo as r,
|
|
2704
|
+
So as s,
|
|
2705
|
+
Ro as t,
|
|
2701
2706
|
oe as u,
|
|
2702
|
-
|
|
2707
|
+
qo as v,
|
|
2703
2708
|
An as w,
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2709
|
+
aa as x,
|
|
2710
|
+
da as y,
|
|
2711
|
+
ma as z
|
|
2707
2712
|
};
|