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