@pdf-viewer/react 1.18.0-beta.0 → 1.18.0-beta.2
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/{ToolbarLayout.module-3f4e0f88.js → ToolbarLayout.module-4a9a9362.js} +1061 -1047
- package/dist/components/RPController.js +1 -1
- package/dist/components/RPPages.js +1 -1
- package/dist/components/RPProvider.js +1 -1
- package/dist/components/layout/LayoutContainer.js +1 -1
- package/dist/components/layout/RPDefaultLayout.js +1 -1
- package/dist/components/layout/RPLayout.js +1 -1
- package/dist/components/layout/SkipLink.js +3 -2
- package/dist/components/layout/sidebar/RPSidebar.js +1 -1
- package/dist/components/layout/sidebar/Thumbnail.js +1 -1
- package/dist/components/layout/sidebar/Thumbnails.js +1 -1
- package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
- package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/MostPageTool.js +1 -1
- package/dist/components/layout/toolbar/OtherTool.js +1 -1
- package/dist/components/layout/toolbar/Paginate.js +1 -1
- package/dist/components/layout/toolbar/PrintTool.js +1 -1
- package/dist/components/layout/toolbar/RPMoreOptions.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/SearchResultNavigator.js +1 -1
- package/dist/components/layout/toolbar/SearchTool.js +1 -1
- package/dist/components/layout/toolbar/ThumbnailTool.js +1 -1
- package/dist/components/layout/toolbar/ToolbarCustom.js +1 -1
- package/dist/components/layout/toolbar/ToolbarDefault.js +1 -1
- package/dist/components/layout/toolbar/ToolbarLayout.js +1 -1
- package/dist/components/layout/toolbar/ZoomTool.js +1 -1
- package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +1 -1
- package/dist/components/layout/toolbar/tools/DualPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/DualPageWithCoverTool.js +1 -1
- package/dist/components/layout/toolbar/tools/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/tools/FirstPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/InputPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/LastPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/NextPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/PreviousPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/PrintTool.js +1 -1
- package/dist/components/layout/toolbar/tools/SinglePageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/ThumbnailTool.js +1 -1
- package/dist/components/layout/toolbar/tools/ZoomLevelDisplay.js +1 -1
- package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +1 -1
- package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +1 -1
- package/dist/components/layout/toolbar/tools/defaults/RPVerticalBar.js +1 -1
- package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +1 -1
- package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +1 -1
- package/dist/components/page/AnnotationLayer.js +1 -1
- package/dist/components/page/CanvasLayer.js +1 -1
- package/dist/components/page/DualPage.js +1 -1
- package/dist/components/page/DualPageWithCover.js +1 -1
- package/dist/components/page/RPPage.js +1 -1
- package/dist/components/page/SinglePage.js +1 -1
- package/dist/components/page/TextHighlightLayer.js +1 -1
- package/dist/components/page/TextLayer.js +1 -1
- 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/RenderQueueProvider.js +1 -1
- package/dist/contexts/SearchContext.js +1 -1
- package/dist/contexts/ThumbnailsContext.js +1 -1
- package/dist/main.js +1 -1
- package/dist/types/utils/types.d.ts +1 -0
- package/dist/utils/highlight.js +139 -139
- package/dist/utils/hooks/useFileDownload.js +1 -1
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/usePaginate.js +1 -1
- package/dist/utils/hooks/usePresentPage.js +1 -1
- package/dist/utils/hooks/usePrint.js +1 -1
- package/dist/utils/hooks/useScrollToPage.js +1 -1
- package/dist/utils/hooks/useSearch.js +1 -1
- package/dist/utils/hooks/useThumbnail.js +1 -1
- package/dist/utils/hooks/useVirtualReactWindow.js +1 -1
- package/package.json +1 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { jsx as i, Fragment as
|
|
1
|
+
import { jsx as i, Fragment as ge, jsxs as k } from "react/jsx-runtime";
|
|
2
2
|
import * as X from "react";
|
|
3
|
-
import { useRef as M, useEffect as
|
|
4
|
-
import { ChevronUpIcon as
|
|
5
|
-
import { UIButton as
|
|
3
|
+
import { useRef as M, useEffect as z, useCallback as O, useState as H, useMemo as W, createContext as je, useContext as Ze, useImperativeHandle as mn, createElement as Ye, PureComponent as ho, Component as fo, memo as It, Fragment as mo, forwardRef as go } from "react";
|
|
4
|
+
import { ChevronUpIcon as Be } from "./components/icons/ChevronUpIcon.js";
|
|
5
|
+
import { UIButton as pe } from "./components/ui/Button.js";
|
|
6
6
|
import { UIInput as gn } from "./components/ui/Input.js";
|
|
7
|
-
import { ViewMode as
|
|
7
|
+
import { ViewMode as ee, ScrollMode as ae, AnnotationSubType as $t, SelectionMode as vo, ErrorType as wo, ZoomLevel as He } from "./utils/types.js";
|
|
8
8
|
import { useScrollModeContext as Ae } from "./contexts/ScrollModeContext.js";
|
|
9
|
-
import { useDocumentContext as
|
|
10
|
-
import { useDocumentPasswordContext as
|
|
11
|
-
import { useDarkModeContext as
|
|
9
|
+
import { useDocumentContext as re } from "./contexts/RPDocumentContext.js";
|
|
10
|
+
import { useDocumentPasswordContext as _o } from "./contexts/DocumentPasswordContext.js";
|
|
11
|
+
import { useDarkModeContext as bo } from "./contexts/DarkModeContext.js";
|
|
12
12
|
import "./contexts/RotationContext.js";
|
|
13
13
|
import { useLayerContext as Po } from "./contexts/LayerContext.js";
|
|
14
|
-
import { useZoomContext as
|
|
15
|
-
import { useViewModeContext as
|
|
16
|
-
import { useVirtualScrollContext as
|
|
14
|
+
import { useZoomContext as rt } from "./contexts/ZoomContext.js";
|
|
15
|
+
import { useViewModeContext as Ge } from "./contexts/ViewModeContext.js";
|
|
16
|
+
import { useVirtualScrollContext as it } from "./contexts/VirtualScrollContext.js";
|
|
17
17
|
import { useVirtualGridContext as vn } from "./contexts/VirtualGridContext.js";
|
|
18
18
|
import { useSelectionModeContext as To } from "./contexts/SelectionModeContext.js";
|
|
19
19
|
import { useInitialStateContext as xt } from "./contexts/InitialStateContext.js";
|
|
@@ -21,21 +21,21 @@ import { useFullScreenContext as Co } from "./contexts/FullScreenContext.js";
|
|
|
21
21
|
import "./contexts/FileInputContext.js";
|
|
22
22
|
import "./contexts/DropFileZoneContext.js";
|
|
23
23
|
import { findMatches as yo, resetDivs as Io, highlightMatches as xo, isMatchEntireWord as So } from "./utils/highlight.js";
|
|
24
|
-
import { useLayoutContainer as
|
|
25
|
-
import { useDimensionPagesContext as
|
|
26
|
-
import { useLocalizationContext as
|
|
24
|
+
import { useLayoutContainer as Ce } from "./contexts/LayoutContainerContext.js";
|
|
25
|
+
import { useDimensionPagesContext as Ke } from "./contexts/DimensionPagesContext.js";
|
|
26
|
+
import { useLocalizationContext as fe } from "./contexts/LocalizationContext.js";
|
|
27
27
|
import { useHighlightContext as Ro } from "./contexts/HighlightContext.js";
|
|
28
28
|
import "./contexts/LicenseContext.js";
|
|
29
29
|
import { useDownloadContext as Lo } from "./contexts/DownloadContext.js";
|
|
30
30
|
import { useSmoothScrollContext as wn } from "./contexts/SmoothScrollContext.js";
|
|
31
31
|
import "./contexts/ElementPageContext.js";
|
|
32
|
-
import { usePagesRotateContext as
|
|
32
|
+
import { usePagesRotateContext as at } from "./contexts/PagesRotateContext.js";
|
|
33
33
|
import { Queue as Eo } from "./utils/Queue.js";
|
|
34
34
|
import { renderPage as No } from "./utils/renderPage.js";
|
|
35
35
|
import { useGlobalCurrentPage as Oo } from "./contexts/GlobalCurrentPage.js";
|
|
36
36
|
import { useLoaderContext as St } from "./contexts/LoaderContext.js";
|
|
37
37
|
import { useToolComponentContext as Se } from "./contexts/ToolComponentContext.js";
|
|
38
|
-
import { useIconToolContext as
|
|
38
|
+
import { useIconToolContext as we } from "./contexts/IconToolContext.js";
|
|
39
39
|
import { useOtherToolContext as Do } from "./contexts/OtherToolContext.js";
|
|
40
40
|
import { useEventCallbackContext as Ao } from "./contexts/EventCallbackContext.js";
|
|
41
41
|
import { useThemeContext as zo } from "./contexts/ThemeContext.js";
|
|
@@ -43,19 +43,19 @@ import "./contexts/ConfigContext.js";
|
|
|
43
43
|
import * as Wo from "pdfjs-dist";
|
|
44
44
|
import { PixelsPerInch as Fo, AnnotationMode as ko, RenderingCancelledException as Mo, AnnotationLayer as Ho } from "pdfjs-dist";
|
|
45
45
|
import { ThumbnailIcon as $o } from "./components/icons/Thumbnail.js";
|
|
46
|
-
import { c as
|
|
47
|
-
import { c as
|
|
48
|
-
import { LoaderIcon as
|
|
46
|
+
import { c as Qe, R as Go } from "./RPSplitter-f6acf13b.js";
|
|
47
|
+
import { c as le } from "./clsx-0c6e471a.js";
|
|
48
|
+
import { LoaderIcon as _n } from "./components/icons/LoaderIcon.js";
|
|
49
49
|
import { Container as Uo } from "./components/layout/Container.js";
|
|
50
50
|
import { useViewportContext as Re, ViewportProvider as Vo } from "./contexts/ViewportContext.js";
|
|
51
|
-
import { useToolbarComponentContext as
|
|
51
|
+
import { useToolbarComponentContext as ye, ToolbarComponentProvider as qo } from "./contexts/ToolbarComponentContext.js";
|
|
52
52
|
import { WrapperLayout as Bo } from "./components/layout/WrapperLayout.js";
|
|
53
|
-
import { RPDropFileZone as
|
|
54
|
-
import { c as Ie, L as
|
|
53
|
+
import { RPDropFileZone as jo } from "./components/RPDropFileZone.js";
|
|
54
|
+
import { c as Ie, L as Zo } from "./LayoutWrapper-60db8675.js";
|
|
55
55
|
import { SkipLink as Gt } from "./components/layout/SkipLink.js";
|
|
56
|
-
import { c as
|
|
56
|
+
import { c as oe, S as Ut } from "./SearchCloseButton-08d57275.js";
|
|
57
57
|
import { UICheckbox as Vt } from "./components/ui/Checkbox.js";
|
|
58
|
-
import { useIconContext as
|
|
58
|
+
import { useIconContext as _e, IconProvider as Ko } from "./contexts/IconContext.js";
|
|
59
59
|
import K from "./components/ui/RPTooltip.js";
|
|
60
60
|
import { UIDropDown as Rt } from "./components/ui/DropDown.js";
|
|
61
61
|
import { MenuItem as xe } from "./components/layout/toolbar/MenuItem.js";
|
|
@@ -63,11 +63,11 @@ import { MenuSeparator as Lt } from "./components/layout/toolbar/MenuSeparator.j
|
|
|
63
63
|
import { dateFormatter as qt } from "./utils/dateFormatter.js";
|
|
64
64
|
import { PropertyItem as Xo } from "./components/layout/toolbar/PropertyItem.js";
|
|
65
65
|
import "./RotateTool.module-67946714.js";
|
|
66
|
-
import { withRef as
|
|
66
|
+
import { withRef as st } from "./utils/withRef.js";
|
|
67
67
|
import { useInfiniteScroll as Qo } from "./utils/hooks/useInfiniteScroll.js";
|
|
68
68
|
import { MAX_ZOOM_SCALE as Bt, THUMBNAIL_MIN_WIDTH as Yo } from "./utils/constants.js";
|
|
69
69
|
import { SimpleLinkService as Jo } from "./utils/link_service.js";
|
|
70
|
-
import { annotationsEvents as er, annotationEventsHandler as tr, handleAnnotationWidget as nr, handleAnnotationLink as or, bindLayerEvents as rr, fixTabIndexAccessibility as
|
|
70
|
+
import { annotationsEvents as er, annotationEventsHandler as tr, handleAnnotationWidget as nr, handleAnnotationLink as or, bindLayerEvents as rr, fixTabIndexAccessibility as jt, enhanceLinkAccessibility as Zt, unbindLayerEvents as Kt } from "./utils/annotations.js";
|
|
71
71
|
import { normalizeSingleKeyword as ir, sortHighlightPosition as ar, unwrap as sr } from "./components/page/searchHighlight.js";
|
|
72
72
|
import { CustomElement as cr } from "./components/page/CustomElement.js";
|
|
73
73
|
import { getGridDimension as Et, getPositionFromPage as lr, getPageFromPosition as dr } from "./utils/calculatePage.js";
|
|
@@ -78,17 +78,17 @@ import { useDebounce as Nt } from "./utils/hooks/useDebounce.js";
|
|
|
78
78
|
import fr from "./components/ui/PasswordModal.js";
|
|
79
79
|
import { useCopyText as mr } from "./utils/hooks/useCopyText.js";
|
|
80
80
|
import { useTextSelection as gr } from "./utils/hooks/useTextSelection.js";
|
|
81
|
-
import { getScrollDistance as
|
|
81
|
+
import { getScrollDistance as Me } from "./utils/getScrollDistance.js";
|
|
82
82
|
import { getWordPositionInPage as vr } from "./utils/getWordPositionInPage.js";
|
|
83
83
|
import { getThumbnailViewport as wr } from "./utils/getThumbnailViewport.js";
|
|
84
84
|
import { smoothScrollTo as ht } from "./utils/smoothScrollTo.js";
|
|
85
|
-
import { appConsole as
|
|
86
|
-
import { FileUploadTool as
|
|
87
|
-
import { DarkModeTool as
|
|
85
|
+
import { appConsole as _r } from "./utils/appConsole.js";
|
|
86
|
+
import { FileUploadTool as bn } from "./components/layout/toolbar/FileUploadTool.js";
|
|
87
|
+
import { DarkModeTool as br } from "./components/layout/toolbar/DarkModeTool.js";
|
|
88
88
|
import { ThreeDotIcon as Pr } from "./components/icons/ThreeDotIcon.js";
|
|
89
|
-
import { c as Tr, u as Ot, P as
|
|
89
|
+
import { c as Tr, u as Ot, P as Xe, a as qe, b as Dt, k as Cr, e as yr, i as Ir } from "./index-c9a2990a.js";
|
|
90
90
|
import { D as xr, d as ft } from "./floating-ui.react-dom-d22a10b4.js";
|
|
91
|
-
import { a as Sr, h as Rr, u as Lr, F as Er, b as Nr, G as
|
|
91
|
+
import { a as Sr, h as Rr, u as Lr, F as Er, b as Nr, G as nt } from "./index-3bf64864.js";
|
|
92
92
|
import { CloseIcon as Or } from "./components/icons/CloseIcon.js";
|
|
93
93
|
import { DocumentProperties as Dr } from "./components/layout/toolbar/DocumentProperties.js";
|
|
94
94
|
import { RotateTool as Ar } from "./components/layout/toolbar/RotateTool.js";
|
|
@@ -106,14 +106,14 @@ import { SearchIcon as Cn } from "./components/icons/SearchIcon.js";
|
|
|
106
106
|
import { ClearIcon as Vr } from "./components/icons/ClearIcon.js";
|
|
107
107
|
import { InfoIcon as Xt } from "./components/icons/InfoIcon.js";
|
|
108
108
|
const yn = () => {
|
|
109
|
-
const { viewMode: t } =
|
|
110
|
-
|
|
109
|
+
const { viewMode: t } = Ge(), { scrollMode: e } = Ae(), { virtualScrollRef: n, virtualScrollableElementRef: r, pageScrollElementRef: o } = it(), { setFocusedPage: a } = de(), c = M(), { columnCount: d } = vn(), { widths: s, heights: f } = Ke(), m = M(e), T = M(t), u = M(d), { targetScrollPage: C } = wn();
|
|
110
|
+
z(() => {
|
|
111
111
|
n != null && n.scrollToItem && (c.current = n);
|
|
112
|
-
}, [n]),
|
|
113
|
-
m.current = e,
|
|
112
|
+
}, [n]), z(() => {
|
|
113
|
+
m.current = e, T.current = t;
|
|
114
114
|
}, [e, t]);
|
|
115
|
-
const
|
|
116
|
-
(y,
|
|
115
|
+
const w = O(
|
|
116
|
+
(y, b) => {
|
|
117
117
|
if (!o)
|
|
118
118
|
return;
|
|
119
119
|
const g = Math.ceil(y / 2) * 2 - 1;
|
|
@@ -132,71 +132,71 @@ const yn = () => {
|
|
|
132
132
|
};
|
|
133
133
|
return o == null ? void 0 : o.scrollTo({
|
|
134
134
|
...h,
|
|
135
|
-
behavior:
|
|
135
|
+
behavior: b
|
|
136
136
|
});
|
|
137
137
|
},
|
|
138
138
|
[o, s, ht]
|
|
139
139
|
);
|
|
140
|
-
return
|
|
141
|
-
m.current = e,
|
|
142
|
-
}, [e, t]),
|
|
140
|
+
return z(() => {
|
|
141
|
+
m.current = e, T.current = t;
|
|
142
|
+
}, [e, t]), z(() => {
|
|
143
143
|
u.current = d;
|
|
144
|
-
}, [d]), { scrollToPage:
|
|
145
|
-
(y,
|
|
144
|
+
}, [d]), { scrollToPage: O(
|
|
145
|
+
(y, b = "smooth") => {
|
|
146
146
|
a(y);
|
|
147
147
|
const g = y - 1;
|
|
148
148
|
let h = g, p = 0;
|
|
149
|
-
if (
|
|
150
|
-
|
|
149
|
+
if (T.current === ee.DUAL_PAGE && m.current === ae.PAGE_SCROLLING) {
|
|
150
|
+
w(y, b);
|
|
151
151
|
return;
|
|
152
152
|
}
|
|
153
|
-
if (m.current ===
|
|
153
|
+
if (m.current === ae.PAGE_SCROLLING) {
|
|
154
154
|
a(y);
|
|
155
155
|
return;
|
|
156
156
|
}
|
|
157
157
|
if (!c.current || !r)
|
|
158
158
|
return;
|
|
159
159
|
const l = r;
|
|
160
|
-
|
|
160
|
+
b === "smooth" && (C.current = y);
|
|
161
161
|
const { columnsWidth: v, rowsHeight: _ } = Et(
|
|
162
162
|
{ widths: s, heights: f },
|
|
163
163
|
d
|
|
164
164
|
);
|
|
165
|
-
if (m.current ===
|
|
165
|
+
if (m.current === ae.HORIZONTAL_SCROLLING) {
|
|
166
166
|
p = g;
|
|
167
|
-
const
|
|
168
|
-
left: Math.floor(
|
|
167
|
+
const S = Me(v, p), R = {
|
|
168
|
+
left: Math.floor(S),
|
|
169
169
|
top: 0
|
|
170
170
|
};
|
|
171
171
|
return l.scrollTo({
|
|
172
172
|
...R,
|
|
173
|
-
behavior:
|
|
173
|
+
behavior: b
|
|
174
174
|
});
|
|
175
175
|
}
|
|
176
|
-
if (
|
|
176
|
+
if (T.current === ee.DUAL_PAGE) {
|
|
177
177
|
p = g % 2, h = Math.floor(g / 2);
|
|
178
|
-
const R =
|
|
178
|
+
const R = Me(v, p), N = Me(_, h), A = {
|
|
179
179
|
left: Math.floor(R),
|
|
180
|
-
top: Math.floor(
|
|
180
|
+
top: Math.floor(N)
|
|
181
181
|
};
|
|
182
182
|
return l.scrollTo({
|
|
183
|
-
...
|
|
184
|
-
behavior:
|
|
183
|
+
...A,
|
|
184
|
+
behavior: b
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
|
-
const I =
|
|
187
|
+
const I = Me(_, h), x = {
|
|
188
188
|
left: 0,
|
|
189
189
|
top: Math.floor(I)
|
|
190
190
|
};
|
|
191
191
|
return l.scrollTo({
|
|
192
|
-
...
|
|
193
|
-
behavior:
|
|
192
|
+
...x,
|
|
193
|
+
behavior: b
|
|
194
194
|
});
|
|
195
195
|
},
|
|
196
196
|
[
|
|
197
197
|
r,
|
|
198
198
|
d,
|
|
199
|
-
|
|
199
|
+
w,
|
|
200
200
|
a,
|
|
201
201
|
ht,
|
|
202
202
|
f,
|
|
@@ -204,7 +204,7 @@ const yn = () => {
|
|
|
204
204
|
]
|
|
205
205
|
) };
|
|
206
206
|
}, qr = (t = 1) => {
|
|
207
|
-
const [e, n] = H(t), [r, o] = H(0), { scrollToPage: a } = yn(), c = M(1), { viewMode: d } =
|
|
207
|
+
const [e, n] = H(t), [r, o] = H(0), { scrollToPage: a } = yn(), c = M(1), { viewMode: d } = Ge(), { scrollMode: s } = Ae(), { widths: f } = Ke(), { pagesRef: m } = Ce(), T = Nt(e, 100), u = O(
|
|
208
208
|
(h) => {
|
|
209
209
|
if (!/^[0-9]*$/g.test(h.toString()) || !h)
|
|
210
210
|
return { success: !1, currentPage: c.current };
|
|
@@ -212,37 +212,37 @@ const yn = () => {
|
|
|
212
212
|
return l < 0 || l > r ? { success: !1, currentPage: c.current } : (n(l), c.current = l, { success: !0, currentPage: +h });
|
|
213
213
|
},
|
|
214
214
|
[r]
|
|
215
|
-
),
|
|
215
|
+
), C = O(u, [u]), w = O(
|
|
216
216
|
(h) => {
|
|
217
217
|
const p = u(h);
|
|
218
218
|
return p.success && a(p.currentPage), p;
|
|
219
219
|
},
|
|
220
220
|
[u, a]
|
|
221
|
-
), P =
|
|
221
|
+
), P = O((h) => {
|
|
222
222
|
const p = h % 2 === 1;
|
|
223
223
|
if (!m || p)
|
|
224
224
|
return !1;
|
|
225
225
|
const l = p ? f[h] : f[h - 1], v = p ? f[h + 1] : f[h];
|
|
226
|
-
return d ===
|
|
227
|
-
}, [d, f, m, r]), y =
|
|
226
|
+
return d === ee.DUAL_PAGE && l + v < m.clientWidth;
|
|
227
|
+
}, [d, f, m, r]), y = O(() => {
|
|
228
228
|
let h = e - 1;
|
|
229
|
-
P(h) && (h = e - 2),
|
|
230
|
-
}, [
|
|
231
|
-
if (
|
|
229
|
+
P(h) && (h = e - 2), w(h);
|
|
230
|
+
}, [w, e, d, s, P]), b = W(() => d === ee.DUAL_PAGE && s === ae.PAGE_SCROLLING ? e === r - 1 : e === r, [e, r, d, s]), g = O(() => {
|
|
231
|
+
if (b)
|
|
232
232
|
return;
|
|
233
233
|
let h = e + 1;
|
|
234
|
-
P(h) && (h = e + 2),
|
|
235
|
-
}, [
|
|
234
|
+
P(h) && (h = e + 2), w(h);
|
|
235
|
+
}, [w, e, P, d, s, b]);
|
|
236
236
|
return {
|
|
237
|
-
focusedPage:
|
|
237
|
+
focusedPage: T,
|
|
238
238
|
totalPages: r,
|
|
239
|
-
setFocusedPage:
|
|
239
|
+
setFocusedPage: C,
|
|
240
240
|
setTotalPages: o,
|
|
241
241
|
nextPage: g,
|
|
242
242
|
prevPage: y,
|
|
243
|
-
goToPage:
|
|
243
|
+
goToPage: w
|
|
244
244
|
};
|
|
245
|
-
}, In =
|
|
245
|
+
}, In = je({
|
|
246
246
|
focusedPage: 0,
|
|
247
247
|
setFocusedPage: (t) => {
|
|
248
248
|
},
|
|
@@ -254,14 +254,14 @@ const yn = () => {
|
|
|
254
254
|
},
|
|
255
255
|
nextPage: () => {
|
|
256
256
|
}
|
|
257
|
-
}),
|
|
257
|
+
}), de = () => {
|
|
258
258
|
const t = Ze(In);
|
|
259
|
-
return typeof (t == null ? void 0 : t.focusedPage) > "u" &&
|
|
259
|
+
return typeof (t == null ? void 0 : t.focusedPage) > "u" && _r.error("Please use this hooks inside children component of RPProvider"), t;
|
|
260
260
|
}, Tc = ({ children: t }) => {
|
|
261
|
-
const { pdf: e } =
|
|
262
|
-
return
|
|
261
|
+
const { pdf: e } = re(), { setCurrentPage: n } = Oo(), { focusedPage: r, totalPages: o, setFocusedPage: a, setTotalPages: c, goToPage: d, nextPage: s, prevPage: f } = qr();
|
|
262
|
+
return z(() => {
|
|
263
263
|
e != null && e.numPages && (c(e.numPages), a(1));
|
|
264
|
-
}, [e, c, a]),
|
|
264
|
+
}, [e, c, a]), z(() => {
|
|
265
265
|
n(r);
|
|
266
266
|
}, [r, n]), /* @__PURE__ */ i(
|
|
267
267
|
In.Provider,
|
|
@@ -279,20 +279,20 @@ const yn = () => {
|
|
|
279
279
|
}
|
|
280
280
|
);
|
|
281
281
|
}, Br = () => {
|
|
282
|
-
const { pdf: t, pages: e } =
|
|
282
|
+
const { pdf: t, pages: e } = re(), [n, r] = H({
|
|
283
283
|
loadedPages: 0,
|
|
284
284
|
totalPages: 0,
|
|
285
285
|
percentage: 0
|
|
286
|
-
}), [o, a] = H(!1), [c, d] = H(!1), [s, f] = H(null), [m,
|
|
287
|
-
|
|
286
|
+
}), [o, a] = H(!1), [c, d] = H(!1), [s, f] = H(null), [m, T] = H(void 0), u = M(!1);
|
|
287
|
+
z(() => {
|
|
288
288
|
u.current;
|
|
289
289
|
}, [u]);
|
|
290
|
-
const
|
|
290
|
+
const C = O(() => {
|
|
291
291
|
document.documentElement.classList.remove("rp-print-html-printing"), document.body.classList.remove("rp-print-body-printing");
|
|
292
292
|
const l = document.querySelector(".rp-print-zone");
|
|
293
293
|
l && l.remove();
|
|
294
|
-
}, []),
|
|
295
|
-
u.current = !1, a(!1), d(!1), f(null),
|
|
294
|
+
}, []), w = O(() => {
|
|
295
|
+
u.current = !1, a(!1), d(!1), f(null), T(void 0), r({
|
|
296
296
|
loadedPages: 0,
|
|
297
297
|
totalPages: 0,
|
|
298
298
|
percentage: 0
|
|
@@ -304,138 +304,138 @@ const yn = () => {
|
|
|
304
304
|
pdfDocument: v,
|
|
305
305
|
pageNumber: _,
|
|
306
306
|
viewerPdfPage: I,
|
|
307
|
-
printResolution:
|
|
308
|
-
optionalContentConfigPromise:
|
|
307
|
+
printResolution: x,
|
|
308
|
+
optionalContentConfigPromise: S,
|
|
309
309
|
printAnnotationStoragePromise: R
|
|
310
310
|
}) => {
|
|
311
311
|
if (u.current) {
|
|
312
|
-
|
|
312
|
+
w();
|
|
313
313
|
return;
|
|
314
314
|
}
|
|
315
|
-
const
|
|
316
|
-
l.width = Math.floor(I.width *
|
|
317
|
-
const
|
|
318
|
-
|
|
319
|
-
const [
|
|
315
|
+
const N = x / Fo.PDF;
|
|
316
|
+
l.width = Math.floor(I.width * N), l.height = Math.floor(I.height * N);
|
|
317
|
+
const A = l.getContext("2d");
|
|
318
|
+
A.save(), A.fillStyle = "rgb(255, 255, 255)", A.fillRect(0, 0, l.width, l.height), A.restore();
|
|
319
|
+
const [F, D] = await Promise.all([
|
|
320
320
|
v.getPage(_),
|
|
321
321
|
R
|
|
322
322
|
]);
|
|
323
323
|
if (u.current) {
|
|
324
|
-
|
|
324
|
+
w();
|
|
325
325
|
return;
|
|
326
326
|
}
|
|
327
327
|
const L = {
|
|
328
|
-
canvasContext:
|
|
329
|
-
transform: [
|
|
330
|
-
viewport:
|
|
328
|
+
canvasContext: A,
|
|
329
|
+
transform: [N, 0, 0, N, 0, 0],
|
|
330
|
+
viewport: F.getViewport({ scale: 1, rotation: I.rotation }),
|
|
331
331
|
intent: "print",
|
|
332
332
|
annotationMode: ko.ENABLE_STORAGE,
|
|
333
|
-
optionalContentConfigPromise:
|
|
334
|
-
printAnnotationStorage:
|
|
333
|
+
optionalContentConfigPromise: S,
|
|
334
|
+
printAnnotationStorage: D
|
|
335
335
|
};
|
|
336
336
|
try {
|
|
337
|
-
return
|
|
338
|
-
} catch (
|
|
339
|
-
throw
|
|
337
|
+
return F.render(L).promise;
|
|
338
|
+
} catch (E) {
|
|
339
|
+
throw E instanceof Mo || console.error(E), E;
|
|
340
340
|
}
|
|
341
|
-
},
|
|
341
|
+
}, b = O(() => {
|
|
342
342
|
const l = window.print;
|
|
343
343
|
return new Promise((v) => {
|
|
344
|
-
const _ = (
|
|
344
|
+
const _ = (S) => {
|
|
345
345
|
setTimeout(() => {
|
|
346
|
-
l.call(window), setTimeout(() =>
|
|
346
|
+
l.call(window), setTimeout(() => S(), 20);
|
|
347
347
|
}, 0);
|
|
348
348
|
};
|
|
349
349
|
if (document.querySelector(".rp-print-zone")) {
|
|
350
350
|
_(v);
|
|
351
351
|
return;
|
|
352
352
|
}
|
|
353
|
-
const
|
|
354
|
-
document.querySelector(".rp-print-zone") && (_(v),
|
|
353
|
+
const x = new MutationObserver(() => {
|
|
354
|
+
document.querySelector(".rp-print-zone") && (_(v), x.disconnect());
|
|
355
355
|
});
|
|
356
|
-
|
|
356
|
+
x.observe(document.body, { childList: !0, subtree: !0 });
|
|
357
357
|
});
|
|
358
358
|
}, []), g = async (l) => {
|
|
359
359
|
const v = document.createElement("img"), _ = document.createElement("div");
|
|
360
|
-
return _.classList.add("rp-print-page"), await new Promise((I,
|
|
361
|
-
l.toBlob((
|
|
362
|
-
|
|
360
|
+
return _.classList.add("rp-print-page"), await new Promise((I, x) => {
|
|
361
|
+
l.toBlob((S) => {
|
|
362
|
+
S ? (v.src = URL.createObjectURL(S), v.onload = () => {
|
|
363
363
|
URL.revokeObjectURL(v.src), I();
|
|
364
|
-
}, v.onerror =
|
|
364
|
+
}, v.onerror = x) : x(new Error("Failed to create blob"));
|
|
365
365
|
});
|
|
366
366
|
}).catch(() => {
|
|
367
367
|
}), _.appendChild(v), _;
|
|
368
368
|
}, h = (l, v) => {
|
|
369
369
|
const _ = document.createElement("div");
|
|
370
370
|
_.classList.add("rp-print-zone");
|
|
371
|
-
const I = document.createElement("style"),
|
|
372
|
-
if (
|
|
373
|
-
const { width:
|
|
374
|
-
I.innerHTML = `@page { size: ${
|
|
371
|
+
const I = document.createElement("style"), x = v.get(1);
|
|
372
|
+
if (x) {
|
|
373
|
+
const { width: S, height: R } = x == null ? void 0 : x.page.getViewport({ scale: 1 });
|
|
374
|
+
I.innerHTML = `@page { size: ${S}px ${R}px }`;
|
|
375
375
|
}
|
|
376
376
|
return _.appendChild(I), _.append(...l), _;
|
|
377
|
-
}, p =
|
|
377
|
+
}, p = O(
|
|
378
378
|
async (l) => {
|
|
379
379
|
if (!t)
|
|
380
380
|
return;
|
|
381
|
-
|
|
381
|
+
w();
|
|
382
382
|
const v = l && "visibleDefaultProgress" in l ? l : void 0;
|
|
383
|
-
(v == null ? void 0 : v.visibleDefaultProgress) !== void 0 ?
|
|
383
|
+
(v == null ? void 0 : v.visibleDefaultProgress) !== void 0 ? T(v.visibleDefaultProgress) : T(!0);
|
|
384
384
|
const _ = document.createElement("canvas"), I = [];
|
|
385
385
|
try {
|
|
386
386
|
t.isPureXfa && console.warn("[rp] XFA Form is not supported at the moment.");
|
|
387
|
-
const
|
|
387
|
+
const S = t.getOptionalContentConfig({ intent: "print" }), R = Promise.resolve(
|
|
388
388
|
t.annotationStorage.print ?? void 0
|
|
389
|
-
),
|
|
390
|
-
for (const [
|
|
389
|
+
), N = e.size;
|
|
390
|
+
for (const [F, D] of e) {
|
|
391
391
|
if (u.current) {
|
|
392
|
-
|
|
392
|
+
w();
|
|
393
393
|
return;
|
|
394
394
|
}
|
|
395
|
-
const L =
|
|
395
|
+
const L = D.page.getViewport({ scale: 1 });
|
|
396
396
|
if (await y({
|
|
397
397
|
scratchCanvas: _,
|
|
398
398
|
pdfDocument: t,
|
|
399
|
-
pageNumber:
|
|
399
|
+
pageNumber: F,
|
|
400
400
|
viewerPdfPage: L,
|
|
401
401
|
printResolution: 150,
|
|
402
|
-
optionalContentConfigPromise:
|
|
402
|
+
optionalContentConfigPromise: S,
|
|
403
403
|
printAnnotationStoragePromise: R
|
|
404
404
|
}), u.current) {
|
|
405
|
-
|
|
405
|
+
w();
|
|
406
406
|
return;
|
|
407
407
|
}
|
|
408
|
-
const
|
|
409
|
-
I.push(
|
|
410
|
-
const
|
|
408
|
+
const E = await g(_);
|
|
409
|
+
I.push(E);
|
|
410
|
+
const U = parseFloat((I.length / N * 100).toFixed(2));
|
|
411
411
|
r({
|
|
412
|
-
loadedPages:
|
|
413
|
-
totalPages:
|
|
414
|
-
percentage:
|
|
412
|
+
loadedPages: F,
|
|
413
|
+
totalPages: N,
|
|
414
|
+
percentage: U
|
|
415
415
|
});
|
|
416
416
|
}
|
|
417
417
|
if (u.current) {
|
|
418
|
-
|
|
418
|
+
w();
|
|
419
419
|
return;
|
|
420
420
|
}
|
|
421
|
-
const
|
|
422
|
-
document.body.appendChild(
|
|
423
|
-
} catch (
|
|
424
|
-
d(!0),
|
|
421
|
+
const A = h(I, e);
|
|
422
|
+
document.body.appendChild(A), document.documentElement.classList.add("rp-print-html-printing"), document.body.classList.add("rp-print-body-printing"), a(!0), await b();
|
|
423
|
+
} catch (x) {
|
|
424
|
+
d(!0), x instanceof Error && f(x);
|
|
425
425
|
} finally {
|
|
426
426
|
_.height = 0, _.width = 0;
|
|
427
427
|
}
|
|
428
428
|
},
|
|
429
|
-
[t, e, u,
|
|
429
|
+
[t, e, u, w, h, b]
|
|
430
430
|
);
|
|
431
|
-
return
|
|
431
|
+
return z(() => {
|
|
432
432
|
const l = () => {
|
|
433
|
-
|
|
433
|
+
w(), C();
|
|
434
434
|
};
|
|
435
435
|
return window.addEventListener("afterprint", l, !0), () => {
|
|
436
436
|
window.removeEventListener("afterprint", l, !0);
|
|
437
437
|
};
|
|
438
|
-
}, [
|
|
438
|
+
}, [C, w]), {
|
|
439
439
|
print: p,
|
|
440
440
|
cancel: P,
|
|
441
441
|
progress: n,
|
|
@@ -444,7 +444,7 @@ const yn = () => {
|
|
|
444
444
|
error: s,
|
|
445
445
|
showDefaultProgress: m
|
|
446
446
|
};
|
|
447
|
-
}, xn =
|
|
447
|
+
}, xn = je({
|
|
448
448
|
print: async () => {
|
|
449
449
|
},
|
|
450
450
|
cancel: () => {
|
|
@@ -462,23 +462,23 @@ const yn = () => {
|
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
464
|
}), Cc = ({ children: t }) => {
|
|
465
|
-
const [e, n] = H(null), [r, o] = H(null), { print: a, cancel: c, progress: d, isComplete: s, isError: f, error: m, showDefaultProgress:
|
|
466
|
-
|
|
467
|
-
}, []),
|
|
468
|
-
m &&
|
|
469
|
-
},
|
|
470
|
-
(
|
|
471
|
-
n(() =>
|
|
465
|
+
const [e, n] = H(null), [r, o] = H(null), { print: a, cancel: c, progress: d, isComplete: s, isError: f, error: m, showDefaultProgress: T } = Br(), u = O((b) => {
|
|
466
|
+
b && typeof b == "function" && o(() => b);
|
|
467
|
+
}, []), C = (b) => {
|
|
468
|
+
m && b(m);
|
|
469
|
+
}, w = O(
|
|
470
|
+
(b) => {
|
|
471
|
+
n(() => b);
|
|
472
472
|
},
|
|
473
473
|
[d, e]
|
|
474
474
|
);
|
|
475
|
-
|
|
475
|
+
z(() => {
|
|
476
476
|
s && r && P();
|
|
477
|
-
}, [s, r]),
|
|
478
|
-
f &&
|
|
479
|
-
console.error(
|
|
477
|
+
}, [s, r]), z(() => {
|
|
478
|
+
f && C((b) => {
|
|
479
|
+
console.error(b);
|
|
480
480
|
});
|
|
481
|
-
}, [f]),
|
|
481
|
+
}, [f]), z(() => {
|
|
482
482
|
d && e && e(d);
|
|
483
483
|
}, [d, e]);
|
|
484
484
|
const P = () => {
|
|
@@ -486,41 +486,41 @@ const yn = () => {
|
|
|
486
486
|
}, y = {
|
|
487
487
|
print: a,
|
|
488
488
|
cancel: c,
|
|
489
|
-
setOnProgress:
|
|
489
|
+
setOnProgress: w,
|
|
490
490
|
setOnComplete: u,
|
|
491
|
-
setOnError:
|
|
491
|
+
setOnError: C,
|
|
492
492
|
progress: d,
|
|
493
|
-
showDefaultProgress:
|
|
493
|
+
showDefaultProgress: T
|
|
494
494
|
};
|
|
495
495
|
return /* @__PURE__ */ i(xn.Provider, { value: y, children: t });
|
|
496
|
-
},
|
|
496
|
+
}, ct = () => {
|
|
497
497
|
const t = Ze(xn);
|
|
498
498
|
if (!t)
|
|
499
499
|
throw new Error("usePrintContext must be used within a PrintProvider");
|
|
500
500
|
return t;
|
|
501
|
-
},
|
|
502
|
-
const [t, e] = H({}), { pages: n } =
|
|
501
|
+
}, jr = () => {
|
|
502
|
+
const [t, e] = H({}), { pages: n } = re(), r = W(() => Object.keys(t).length, [t]), o = O(
|
|
503
503
|
(c) => {
|
|
504
504
|
if (!n.size)
|
|
505
505
|
return;
|
|
506
506
|
const d = c > n.size ? n.size : c, f = Array.from(n.values()).slice(0, d).map((m) => {
|
|
507
|
-
const { thumbnailViewport:
|
|
507
|
+
const { thumbnailViewport: T, scale: u } = wr(m.page, m.defaultRotation);
|
|
508
508
|
return {
|
|
509
509
|
scale: u,
|
|
510
510
|
page: m.page,
|
|
511
511
|
loading: !0,
|
|
512
|
-
viewport:
|
|
512
|
+
viewport: T,
|
|
513
513
|
defaultRotation: m.defaultRotation
|
|
514
514
|
};
|
|
515
|
-
}).reduce((m,
|
|
515
|
+
}).reduce((m, T) => (m[T.page.pageNumber] = T, m), {});
|
|
516
516
|
e(f);
|
|
517
517
|
},
|
|
518
518
|
[n]
|
|
519
519
|
);
|
|
520
|
-
|
|
520
|
+
z(() => {
|
|
521
521
|
o(10);
|
|
522
522
|
}, [o]);
|
|
523
|
-
const a =
|
|
523
|
+
const a = O(
|
|
524
524
|
(c) => {
|
|
525
525
|
if (!n)
|
|
526
526
|
return;
|
|
@@ -539,7 +539,7 @@ const yn = () => {
|
|
|
539
539
|
[n]
|
|
540
540
|
);
|
|
541
541
|
return { thumbnailPages: t, addPage: a, addToPage: o, thumbnailLength: r };
|
|
542
|
-
}, Sn =
|
|
542
|
+
}, Sn = je({
|
|
543
543
|
thumbnailPages: {},
|
|
544
544
|
addPage: (t) => {
|
|
545
545
|
},
|
|
@@ -553,7 +553,7 @@ const yn = () => {
|
|
|
553
553
|
children: t,
|
|
554
554
|
initialThumbnailsVisible: e
|
|
555
555
|
}) => {
|
|
556
|
-
const { thumbnailPages: n, addPage: r, addToPage: o, thumbnailLength: a } =
|
|
556
|
+
const { thumbnailPages: n, addPage: r, addToPage: o, thumbnailLength: a } = jr(), [c, d] = H(e);
|
|
557
557
|
return /* @__PURE__ */ i(
|
|
558
558
|
Sn.Provider,
|
|
559
559
|
{
|
|
@@ -561,114 +561,128 @@ const yn = () => {
|
|
|
561
561
|
children: t
|
|
562
562
|
}
|
|
563
563
|
);
|
|
564
|
-
},
|
|
565
|
-
const [n, r] = H(e), [o, a] = H(!1), { pdf: c, pages: d } =
|
|
566
|
-
(
|
|
567
|
-
if (
|
|
564
|
+
}, Zr = (t = {}, e = "") => {
|
|
565
|
+
const [n, r] = H(e), [o, a] = H(!1), { pdf: c, pages: d } = re(), { widths: s, heights: f } = Ke(), m = M(!n), { currentZoom: T } = rt(), [u, C] = H([]), { setFocusedPage: w } = de(), { columnCount: P, viewMode: y } = Ge(), { pageRotate: b } = at(), [g, h] = H(0), { pageScrollElementRef: p, virtualScrollableElementRef: l } = it(), { scrollMode: v } = Ae(), { pagesRef: _ } = Ce(), I = M({}), x = M(0), S = W(() => g === 0 ? null : u[g - 1], [g, u]), R = W(() => u.length, [u]), N = O(
|
|
566
|
+
(L) => {
|
|
567
|
+
if (L === 0)
|
|
568
568
|
return;
|
|
569
|
-
const
|
|
570
|
-
if (!
|
|
569
|
+
const E = u[L - 1];
|
|
570
|
+
if (!E || !d)
|
|
571
571
|
return;
|
|
572
|
-
const
|
|
573
|
-
if (!
|
|
572
|
+
const U = l || p;
|
|
573
|
+
if (!U || !_)
|
|
574
574
|
return;
|
|
575
|
-
const
|
|
576
|
-
if (
|
|
575
|
+
const V = d.get(E.page);
|
|
576
|
+
if (v === ae.PAGE_SCROLLING && w(E.page), !V)
|
|
577
577
|
return;
|
|
578
|
-
let
|
|
579
|
-
if (
|
|
580
|
-
const
|
|
581
|
-
|
|
578
|
+
let $ = 0, q = 0;
|
|
579
|
+
if (v === ae.VERTICAL_SCROLLING) {
|
|
580
|
+
const Q = E.page - 1, ie = P;
|
|
581
|
+
let se, ce;
|
|
582
|
+
if (y === ee.DUAL_PAGE_WITH_COVER)
|
|
583
|
+
if (E.page === 1)
|
|
584
|
+
se = 0, ce = 0;
|
|
585
|
+
else {
|
|
586
|
+
const ze = E.page - 2;
|
|
587
|
+
se = ze % 2, ce = Math.floor(ze / 2) + 1;
|
|
588
|
+
}
|
|
589
|
+
else
|
|
590
|
+
se = Q % ie, ce = Math.floor(Q / ie);
|
|
591
|
+
$ = Me(f, ce), q = Me(s, se);
|
|
582
592
|
}
|
|
583
|
-
|
|
584
|
-
const
|
|
585
|
-
height: f[
|
|
586
|
-
width: s[
|
|
587
|
-
},
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
),
|
|
594
|
-
left: Math.max(
|
|
595
|
-
top: Math.max(
|
|
593
|
+
v === ae.HORIZONTAL_SCROLLING && (q = s.slice(0, E.page - 1).reduce((Q, ie) => Q + ie, 0));
|
|
594
|
+
const j = {
|
|
595
|
+
height: f[E.page - 1],
|
|
596
|
+
width: s[E.page - 1]
|
|
597
|
+
}, te = b[E.page], { leftInPage: G, topInPage: Y } = vr(
|
|
598
|
+
j,
|
|
599
|
+
_,
|
|
600
|
+
E.rect,
|
|
601
|
+
T,
|
|
602
|
+
te
|
|
603
|
+
), J = q + G, me = $ + Y, ne = {
|
|
604
|
+
left: Math.max(J, 0),
|
|
605
|
+
top: Math.max(me, 0)
|
|
596
606
|
};
|
|
597
|
-
|
|
598
|
-
...
|
|
607
|
+
U.scrollTo({
|
|
608
|
+
...ne,
|
|
599
609
|
behavior: "smooth"
|
|
600
610
|
});
|
|
601
611
|
},
|
|
602
612
|
[
|
|
603
613
|
d,
|
|
604
|
-
|
|
614
|
+
w,
|
|
605
615
|
s,
|
|
606
616
|
f,
|
|
617
|
+
v,
|
|
618
|
+
y,
|
|
619
|
+
P,
|
|
607
620
|
l,
|
|
608
621
|
p,
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
622
|
+
_,
|
|
623
|
+
u,
|
|
624
|
+
T,
|
|
625
|
+
b
|
|
612
626
|
]
|
|
613
627
|
);
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
}, [
|
|
617
|
-
const
|
|
618
|
-
|
|
619
|
-
let
|
|
620
|
-
return
|
|
621
|
-
}),
|
|
622
|
-
}, [
|
|
623
|
-
|
|
624
|
-
let
|
|
625
|
-
return
|
|
626
|
-
}),
|
|
627
|
-
}, [
|
|
628
|
-
if (!
|
|
628
|
+
z(() => {
|
|
629
|
+
g && N(g);
|
|
630
|
+
}, [g]);
|
|
631
|
+
const A = O(() => {
|
|
632
|
+
h((L) => {
|
|
633
|
+
let E;
|
|
634
|
+
return R ? L + 1 > R ? E = 1 : E = L + 1 : E = 0, x.current = E, E;
|
|
635
|
+
}), x.current === 1 && N(x.current);
|
|
636
|
+
}, [R, N]), F = O(() => {
|
|
637
|
+
h((L) => {
|
|
638
|
+
let E;
|
|
639
|
+
return R ? L - 1 <= 0 ? E = R : E = L - 1 : E = 0, x.current = E, E;
|
|
640
|
+
}), x.current === 1 && N(x.current);
|
|
641
|
+
}, [R, N]), D = O(async (L) => {
|
|
642
|
+
if (!L)
|
|
629
643
|
return {};
|
|
630
|
-
const
|
|
631
|
-
for (let
|
|
644
|
+
const E = L.numPages, U = {};
|
|
645
|
+
for (let V = 1; V <= E; V++) {
|
|
632
646
|
if (m.current)
|
|
633
647
|
throw "close pop over";
|
|
634
|
-
const
|
|
635
|
-
|
|
648
|
+
const $ = await L.getPage(V);
|
|
649
|
+
U[V.toString()] = await $.getTextContent();
|
|
636
650
|
}
|
|
637
|
-
return
|
|
651
|
+
return U;
|
|
638
652
|
}, []);
|
|
639
|
-
return
|
|
653
|
+
return z(() => {
|
|
640
654
|
if (!n) {
|
|
641
|
-
m.current = !0,
|
|
655
|
+
m.current = !0, C([]), h(0);
|
|
642
656
|
return;
|
|
643
657
|
}
|
|
644
|
-
m.current = !1, a(!0),
|
|
645
|
-
|
|
646
|
-
const
|
|
647
|
-
const
|
|
658
|
+
m.current = !1, a(!0), C([]), h(0), D(c).then((L) => {
|
|
659
|
+
I.current = L;
|
|
660
|
+
const U = Object.keys(L).reduce((V, $) => {
|
|
661
|
+
const q = yo(
|
|
648
662
|
[n],
|
|
649
|
-
|
|
650
|
-
Number(
|
|
663
|
+
L[$],
|
|
664
|
+
Number($) - 1,
|
|
651
665
|
t
|
|
652
|
-
).map((
|
|
653
|
-
return [...
|
|
666
|
+
).map((j, te) => ({ ...j, page: Number($), pageMatchIdx: te }));
|
|
667
|
+
return [...V, ...q];
|
|
654
668
|
}, []);
|
|
655
|
-
|
|
669
|
+
C(U), h(U.length ? 1 : 0);
|
|
656
670
|
}).catch(() => {
|
|
657
|
-
|
|
671
|
+
C([]), h(0);
|
|
658
672
|
}).finally(() => a(!1));
|
|
659
|
-
}, [n,
|
|
673
|
+
}, [n, D, c, t]), {
|
|
660
674
|
search: n,
|
|
661
675
|
setSearch: r,
|
|
662
676
|
loading: o,
|
|
663
677
|
matches: u,
|
|
664
|
-
totalMatches:
|
|
665
|
-
currentMatchPosition:
|
|
678
|
+
totalMatches: R,
|
|
679
|
+
currentMatchPosition: g,
|
|
666
680
|
currentMatch: S,
|
|
667
|
-
nextMatch:
|
|
668
|
-
prevMatch:
|
|
669
|
-
setCurrentMatchPosition:
|
|
681
|
+
nextMatch: A,
|
|
682
|
+
prevMatch: F,
|
|
683
|
+
setCurrentMatchPosition: h
|
|
670
684
|
};
|
|
671
|
-
}, Ln =
|
|
685
|
+
}, Ln = je({
|
|
672
686
|
search: "",
|
|
673
687
|
setSearch: (t) => {
|
|
674
688
|
},
|
|
@@ -696,10 +710,10 @@ const yn = () => {
|
|
|
696
710
|
currentMatch: s,
|
|
697
711
|
search: f,
|
|
698
712
|
matches: m,
|
|
699
|
-
nextMatch:
|
|
713
|
+
nextMatch: T,
|
|
700
714
|
prevMatch: u,
|
|
701
|
-
setCurrentMatchPosition:
|
|
702
|
-
} =
|
|
715
|
+
setCurrentMatchPosition: C
|
|
716
|
+
} = Zr(n, e);
|
|
703
717
|
return /* @__PURE__ */ i(
|
|
704
718
|
Ln.Provider,
|
|
705
719
|
{
|
|
@@ -711,19 +725,19 @@ const yn = () => {
|
|
|
711
725
|
totalMatches: c,
|
|
712
726
|
currentMatchPosition: d,
|
|
713
727
|
currentMatch: s,
|
|
714
|
-
nextMatch:
|
|
728
|
+
nextMatch: T,
|
|
715
729
|
prevMatch: u,
|
|
716
730
|
search: f,
|
|
717
731
|
matches: m,
|
|
718
|
-
setCurrentMatchPosition:
|
|
732
|
+
setCurrentMatchPosition: C
|
|
719
733
|
},
|
|
720
734
|
children: t
|
|
721
735
|
}
|
|
722
736
|
);
|
|
723
|
-
}, At = () => Ze(Ln), En =
|
|
724
|
-
const e = M(!1), [n, r] = H([]), o =
|
|
737
|
+
}, At = () => Ze(Ln), En = je(null), xc = ({ children: t }) => {
|
|
738
|
+
const e = M(!1), [n, r] = H([]), o = O((s) => {
|
|
725
739
|
r((f) => [...f, { id: s.page.pageNumber.toString(), data: s, priority: 0 }]);
|
|
726
|
-
}, []), a = W(() => new Eo(o), [o]), { focusedPage: c } =
|
|
740
|
+
}, []), a = W(() => new Eo(o), [o]), { focusedPage: c } = de(), d = O((s) => (e.current = !0, No(
|
|
727
741
|
s.data.page,
|
|
728
742
|
s.data.canvasElem,
|
|
729
743
|
s.data.options
|
|
@@ -732,9 +746,9 @@ const yn = () => {
|
|
|
732
746
|
}).finally(() => {
|
|
733
747
|
s.data.onLoaded && s.data.onLoaded();
|
|
734
748
|
})), []);
|
|
735
|
-
return
|
|
749
|
+
return z(() => {
|
|
736
750
|
c && (a.changePagePriority(`^page-${c}`, 0), a.changePagePriority(`^thumbnail-${c}`, 1));
|
|
737
|
-
}, [c]),
|
|
751
|
+
}, [c]), z(() => {
|
|
738
752
|
if (a.isEmpty() || e.current)
|
|
739
753
|
return;
|
|
740
754
|
const s = () => {
|
|
@@ -750,7 +764,7 @@ const yn = () => {
|
|
|
750
764
|
if (!t)
|
|
751
765
|
throw new Error("RenderQueue not found");
|
|
752
766
|
return t;
|
|
753
|
-
},
|
|
767
|
+
}, ue = {
|
|
754
768
|
"rp-pages": "_rp-pages_u7m2r_1",
|
|
755
769
|
"rp-page-scrolling-wrapper": "_rp-page-scrolling-wrapper_u7m2r_6",
|
|
756
770
|
"rp-pages-horizontal-scroll": "_rp-pages-horizontal-scroll_u7m2r_11",
|
|
@@ -766,20 +780,20 @@ const yn = () => {
|
|
|
766
780
|
"rp-page": "_rp-page_ii91u_1",
|
|
767
781
|
"rp-loader-wrapper": "_rp-loader-wrapper_ii91u_15"
|
|
768
782
|
}, Kr = (t) => {
|
|
769
|
-
const { pageNumber: e, onLoaded: n, onLoading: r } = t, o = M(null), { pages: a } =
|
|
770
|
-
return
|
|
783
|
+
const { pageNumber: e, onLoaded: n, onLoading: r } = t, o = M(null), { pages: a } = re(), { pageRotate: c } = at(), d = M(), { currentZoom: s } = rt(), { interactiveForm: f } = xt(), m = Nn(), T = M(`page-${e}`);
|
|
784
|
+
return z(() => {
|
|
771
785
|
if (!a || s === 0)
|
|
772
786
|
return;
|
|
773
787
|
const u = a.get(e);
|
|
774
788
|
if (o.current && u) {
|
|
775
|
-
const
|
|
776
|
-
|
|
777
|
-
const
|
|
778
|
-
|
|
779
|
-
|
|
789
|
+
const C = o.current;
|
|
790
|
+
C.hidden = !0;
|
|
791
|
+
const w = d.current;
|
|
792
|
+
w && w.cancel(), r && r(), m.enqueue(
|
|
793
|
+
T.current,
|
|
780
794
|
{
|
|
781
795
|
page: u.page,
|
|
782
|
-
canvasElem:
|
|
796
|
+
canvasElem: C,
|
|
783
797
|
options: {
|
|
784
798
|
scale: s,
|
|
785
799
|
rotate: c[e],
|
|
@@ -792,60 +806,60 @@ const yn = () => {
|
|
|
792
806
|
);
|
|
793
807
|
}
|
|
794
808
|
return () => {
|
|
795
|
-
m.removeQueue(
|
|
809
|
+
m.removeQueue(T.current);
|
|
796
810
|
};
|
|
797
811
|
}, [a, e, c, s, r, n, m, f]), /* @__PURE__ */ i("canvas", { "data-rp": `page-${e}-canvas`, ref: o });
|
|
798
|
-
}, Xr = "_selecting_1oep2_10", Qr = "_markedContent_1oep2_33",
|
|
812
|
+
}, Xr = "_selecting_1oep2_10", Qr = "_markedContent_1oep2_33", Pe = {
|
|
799
813
|
"rp-text-layer": "_rp-text-layer_1oep2_1",
|
|
800
814
|
selecting: Xr,
|
|
801
815
|
markedContent: Qr,
|
|
802
816
|
"rp-text-layer-text": "_rp-text-layer-text_1oep2_52"
|
|
803
817
|
}, Yr = (t) => {
|
|
804
|
-
const { pageNumber: e } = t, { pages: n } =
|
|
818
|
+
const { pageNumber: e } = t, { pages: n } = re(), r = M(null), { matches: o, currentMatch: a } = At(), [c, d] = H(
|
|
805
819
|
[]
|
|
806
|
-
), s = M(), f = M(), m = M([]),
|
|
820
|
+
), s = M(), f = M(), m = M([]), T = W(() => o.filter((g) => g.pageIndex === e - 1), [o, e]), u = O(
|
|
807
821
|
(g, h, p = !1) => {
|
|
808
|
-
if (p && Io(g, h), !
|
|
822
|
+
if (p && Io(g, h), !T.length) {
|
|
809
823
|
m.current = [], d([]);
|
|
810
824
|
return;
|
|
811
825
|
}
|
|
812
|
-
const l = xo(
|
|
826
|
+
const l = xo(T, g, h);
|
|
813
827
|
d(l);
|
|
814
828
|
},
|
|
815
|
-
[
|
|
816
|
-
),
|
|
817
|
-
|
|
818
|
-
if (
|
|
829
|
+
[T]
|
|
830
|
+
), C = M(), w = M(!1), P = O(() => Array.from(document.querySelectorAll('[data-rp$="-textLayer"]')), []);
|
|
831
|
+
z(() => ((() => {
|
|
832
|
+
if (C.current)
|
|
819
833
|
return;
|
|
820
|
-
|
|
821
|
-
const { signal: h } =
|
|
834
|
+
C.current = new AbortController();
|
|
835
|
+
const { signal: h } = C.current, p = () => {
|
|
822
836
|
P().forEach((v) => {
|
|
823
837
|
const _ = v.querySelector(".endOfContent");
|
|
824
|
-
_ && (v.appendChild(_), _.style.width = "", _.style.height = "", v.classList.remove(
|
|
838
|
+
_ && (v.appendChild(_), _.style.width = "", _.style.height = "", v.classList.remove(Pe.selecting));
|
|
825
839
|
});
|
|
826
840
|
};
|
|
827
841
|
document.addEventListener(
|
|
828
842
|
"pointerdown",
|
|
829
843
|
() => {
|
|
830
|
-
|
|
844
|
+
w.current = !0;
|
|
831
845
|
},
|
|
832
846
|
{ signal: h }
|
|
833
847
|
), document.addEventListener(
|
|
834
848
|
"pointerup",
|
|
835
849
|
() => {
|
|
836
|
-
|
|
850
|
+
w.current = !1, p();
|
|
837
851
|
},
|
|
838
852
|
{ signal: h }
|
|
839
853
|
), window.addEventListener(
|
|
840
854
|
"blur",
|
|
841
855
|
() => {
|
|
842
|
-
|
|
856
|
+
w.current = !1, p();
|
|
843
857
|
},
|
|
844
858
|
{ signal: h }
|
|
845
859
|
), document.addEventListener(
|
|
846
860
|
"keyup",
|
|
847
861
|
() => {
|
|
848
|
-
|
|
862
|
+
w.current || p();
|
|
849
863
|
},
|
|
850
864
|
{ signal: h }
|
|
851
865
|
);
|
|
@@ -853,7 +867,7 @@ const yn = () => {
|
|
|
853
867
|
document.addEventListener(
|
|
854
868
|
"selectionchange",
|
|
855
869
|
() => {
|
|
856
|
-
var
|
|
870
|
+
var A, F;
|
|
857
871
|
const v = document.getSelection();
|
|
858
872
|
if (!v)
|
|
859
873
|
return;
|
|
@@ -862,45 +876,45 @@ const yn = () => {
|
|
|
862
876
|
return;
|
|
863
877
|
}
|
|
864
878
|
const _ = /* @__PURE__ */ new Set();
|
|
865
|
-
for (let
|
|
866
|
-
const L = v.getRangeAt(
|
|
867
|
-
P().forEach((
|
|
868
|
-
L.intersectsNode(
|
|
879
|
+
for (let D = 0; D < v.rangeCount; D++) {
|
|
880
|
+
const L = v.getRangeAt(D);
|
|
881
|
+
P().forEach((E) => {
|
|
882
|
+
L.intersectsNode(E) && !_.has(E) && _.add(E);
|
|
869
883
|
});
|
|
870
884
|
}
|
|
871
|
-
P().forEach((
|
|
872
|
-
if (_.has(
|
|
873
|
-
|
|
885
|
+
P().forEach((D) => {
|
|
886
|
+
if (_.has(D))
|
|
887
|
+
D.classList.add(Pe.selecting);
|
|
874
888
|
else {
|
|
875
|
-
const L =
|
|
876
|
-
L && (
|
|
889
|
+
const L = D.querySelector(".endOfContent");
|
|
890
|
+
L && (D.appendChild(L), L.style.width = "", L.style.height = "", D.classList.remove(Pe.selecting));
|
|
877
891
|
}
|
|
878
892
|
});
|
|
879
893
|
const I = v.getRangeAt(0);
|
|
880
|
-
let
|
|
881
|
-
|
|
882
|
-
const R = (
|
|
883
|
-
|
|
884
|
-
),
|
|
885
|
-
|
|
894
|
+
let S = l && (I.compareBoundaryPoints(Range.END_TO_END, l) === 0 || I.compareBoundaryPoints(Range.START_TO_END, l) === 0) ? I.startContainer : I.endContainer;
|
|
895
|
+
S.nodeType === Node.TEXT_NODE && (S = S.parentNode);
|
|
896
|
+
const R = (A = S.parentElement) == null ? void 0 : A.closest(
|
|
897
|
+
Pe["rp-text-layer"]
|
|
898
|
+
), N = R == null ? void 0 : R.querySelector(".endOfContent");
|
|
899
|
+
N && R && (N.style.width = R.style.width, N.style.height = R.style.height, (F = S.parentElement) == null || F.insertBefore(N, S.nextSibling)), l = I.cloneRange();
|
|
886
900
|
},
|
|
887
901
|
{ signal: h }
|
|
888
902
|
);
|
|
889
903
|
})(), () => {
|
|
890
904
|
var h;
|
|
891
|
-
(h =
|
|
905
|
+
(h = C.current) == null || h.abort(), C.current = void 0;
|
|
892
906
|
}), [P]);
|
|
893
|
-
const y =
|
|
894
|
-
r.current && r.current.classList.add(
|
|
895
|
-
}, []),
|
|
896
|
-
r.current && r.current.classList.remove(
|
|
907
|
+
const y = O(() => {
|
|
908
|
+
r.current && r.current.classList.add(Pe.selecting);
|
|
909
|
+
}, []), b = O(() => {
|
|
910
|
+
r.current && r.current.classList.remove(Pe.selecting);
|
|
897
911
|
}, []);
|
|
898
|
-
return
|
|
912
|
+
return z(() => {
|
|
899
913
|
if (m.current.forEach((p) => {
|
|
900
914
|
p.classList.remove("selected");
|
|
901
915
|
}), !c.length || !a || a.pageIndex !== e - 1)
|
|
902
916
|
return;
|
|
903
|
-
const g =
|
|
917
|
+
const g = T.findIndex(
|
|
904
918
|
(p) => JSON.stringify(p) === JSON.stringify(a)
|
|
905
919
|
);
|
|
906
920
|
if (g === -1)
|
|
@@ -909,7 +923,7 @@ const yn = () => {
|
|
|
909
923
|
h.length && (m.current = h.map((p) => p.element), h.forEach((p) => {
|
|
910
924
|
p.element.classList.add("selected");
|
|
911
925
|
}));
|
|
912
|
-
}, [a, c,
|
|
926
|
+
}, [a, c, T]), z(() => {
|
|
913
927
|
const g = n.get(e);
|
|
914
928
|
if (!g || !r.current)
|
|
915
929
|
return;
|
|
@@ -923,8 +937,8 @@ const yn = () => {
|
|
|
923
937
|
}), f.current = p, h && (h.innerText = ""), s.current.render();
|
|
924
938
|
}).then(() => {
|
|
925
939
|
var _, I;
|
|
926
|
-
[].slice.call(h.children).forEach((
|
|
927
|
-
|
|
940
|
+
[].slice.call(h.children).forEach((x) => {
|
|
941
|
+
x.classList.add(Pe["rp-text-layer-text"]), x.setAttribute("data-rp", "rp-text-layer-text");
|
|
928
942
|
});
|
|
929
943
|
const l = (_ = s.current) == null ? void 0 : _.textDivs;
|
|
930
944
|
l && f.current && u(f.current, l);
|
|
@@ -935,10 +949,10 @@ const yn = () => {
|
|
|
935
949
|
var p;
|
|
936
950
|
(p = s.current) == null || p.cancel();
|
|
937
951
|
};
|
|
938
|
-
}, [n, e]),
|
|
952
|
+
}, [n, e]), z(() => {
|
|
939
953
|
var p;
|
|
940
954
|
[].slice.call(r.current.children).forEach((l) => {
|
|
941
|
-
l.classList.add(
|
|
955
|
+
l.classList.add(Pe["rp-text-layer-text"]);
|
|
942
956
|
});
|
|
943
957
|
const h = (p = s.current) == null ? void 0 : p.textDivs;
|
|
944
958
|
h && f.current && u(f.current, h, !0);
|
|
@@ -947,10 +961,10 @@ const yn = () => {
|
|
|
947
961
|
{
|
|
948
962
|
"data-rp-text-layer": !0,
|
|
949
963
|
"data-rp": `page-${e}-textLayer`,
|
|
950
|
-
className:
|
|
964
|
+
className: Pe["rp-text-layer"],
|
|
951
965
|
ref: r,
|
|
952
966
|
onMouseDown: y,
|
|
953
|
-
onMouseUp:
|
|
967
|
+
onMouseUp: b
|
|
954
968
|
}
|
|
955
969
|
);
|
|
956
970
|
}, Jr = {
|
|
@@ -958,30 +972,30 @@ const yn = () => {
|
|
|
958
972
|
};
|
|
959
973
|
let ei = "https://unpkg.com/pdfjs-dist@4.4.168/web/images/";
|
|
960
974
|
const ti = (t) => {
|
|
961
|
-
const { pageNumber: e } = t, n = M(null), { pages: r, pdf: o } =
|
|
962
|
-
|
|
975
|
+
const { pageNumber: e } = t, n = M(null), { pages: r, pdf: o } = re(), { interactiveForm: a } = xt(), c = M(), [d, s] = H(), { goToPage: f } = de(), { scrollMode: m } = Ae(), { print: T } = ct(), { download: u } = Xn(), C = M(null), w = W(() => r.get(e), [r, e]), P = W(() => w == null ? void 0 : w.page.getViewport(), [w]);
|
|
976
|
+
z(() => {
|
|
963
977
|
c.current && (c.current.div.replaceChildren(), c.current = void 0);
|
|
964
|
-
}, [o]),
|
|
965
|
-
|
|
966
|
-
c.current = void 0, s(
|
|
978
|
+
}, [o]), z(() => {
|
|
979
|
+
w && w.page.getAnnotations().then((b) => {
|
|
980
|
+
c.current = void 0, s(b), n.current && (n.current.innerText = "");
|
|
967
981
|
});
|
|
968
|
-
}, [
|
|
969
|
-
const y =
|
|
970
|
-
(
|
|
971
|
-
!d || !o || (er(
|
|
982
|
+
}, [w]);
|
|
983
|
+
const y = O(
|
|
984
|
+
(b) => {
|
|
985
|
+
!d || !o || (er(b), tr(b, o, d).then((g) => {
|
|
972
986
|
var h, p;
|
|
973
|
-
((h = g == null ? void 0 : g.data) == null ? void 0 : h.action) === "Print" ?
|
|
987
|
+
((h = g == null ? void 0 : g.data) == null ? void 0 : h.action) === "Print" ? T() : ((p = g == null ? void 0 : g.data) == null ? void 0 : p.action) === "SaveAs" && u();
|
|
974
988
|
}));
|
|
975
989
|
},
|
|
976
|
-
[o, d, m,
|
|
990
|
+
[o, d, m, T, u]
|
|
977
991
|
);
|
|
978
|
-
return
|
|
979
|
-
if (!
|
|
992
|
+
return z(() => {
|
|
993
|
+
if (!w || !d)
|
|
980
994
|
return;
|
|
981
|
-
const
|
|
995
|
+
const b = w.page.getViewport();
|
|
982
996
|
if (c.current) {
|
|
983
997
|
c.current.update({
|
|
984
|
-
viewport:
|
|
998
|
+
viewport: b.clone({ dontFlip: !0 })
|
|
985
999
|
});
|
|
986
1000
|
return;
|
|
987
1001
|
}
|
|
@@ -993,7 +1007,7 @@ const ti = (t) => {
|
|
|
993
1007
|
or(l);
|
|
994
1008
|
break;
|
|
995
1009
|
case $t.Widget:
|
|
996
|
-
nr(l,
|
|
1010
|
+
nr(l, b, g);
|
|
997
1011
|
break;
|
|
998
1012
|
}
|
|
999
1013
|
}
|
|
@@ -1006,8 +1020,8 @@ const ti = (t) => {
|
|
|
1006
1020
|
annotationCanvasMap: void 0,
|
|
1007
1021
|
annotationEditorUIManager: void 0,
|
|
1008
1022
|
structTreeLayer: null,
|
|
1009
|
-
page:
|
|
1010
|
-
viewport:
|
|
1023
|
+
page: w.page,
|
|
1024
|
+
viewport: b.clone({ dontFlip: !0 })
|
|
1011
1025
|
}), n.current && Kt(n.current, y);
|
|
1012
1026
|
const l = await (o == null ? void 0 : o.hasJSActions()), v = await (o == null ? void 0 : o.getFieldObjects());
|
|
1013
1027
|
if (h.signal.aborted)
|
|
@@ -1018,8 +1032,8 @@ const ti = (t) => {
|
|
|
1018
1032
|
hasJSActions: l,
|
|
1019
1033
|
fieldObjects: v,
|
|
1020
1034
|
div: n.current,
|
|
1021
|
-
viewport:
|
|
1022
|
-
page:
|
|
1035
|
+
viewport: b.clone({ dontFlip: !0 }),
|
|
1036
|
+
page: w.page,
|
|
1023
1037
|
imageResourcesPath: ei,
|
|
1024
1038
|
renderForms: a ?? !0,
|
|
1025
1039
|
linkService: new Jo(o, f),
|
|
@@ -1027,9 +1041,9 @@ const ti = (t) => {
|
|
|
1027
1041
|
enableScripting: !1
|
|
1028
1042
|
});
|
|
1029
1043
|
})().then(() => {
|
|
1030
|
-
n.current && (rr(n.current, y),
|
|
1031
|
-
n.current && (
|
|
1032
|
-
}),
|
|
1044
|
+
n.current && (rr(n.current, y), jt(n.current), Zt(n.current), C.current && C.current.disconnect(), C.current = new MutationObserver(() => {
|
|
1045
|
+
n.current && (jt(n.current), Zt(n.current));
|
|
1046
|
+
}), C.current.observe(n.current, {
|
|
1033
1047
|
childList: !0,
|
|
1034
1048
|
subtree: !0,
|
|
1035
1049
|
attributes: !0,
|
|
@@ -1041,7 +1055,7 @@ const ti = (t) => {
|
|
|
1041
1055
|
}).finally(() => {
|
|
1042
1056
|
c.current = void 0;
|
|
1043
1057
|
}), () => {
|
|
1044
|
-
h.abort("clear"), n.current && Kt(n.current, y),
|
|
1058
|
+
h.abort("clear"), n.current && Kt(n.current, y), C.current && (C.current.disconnect(), C.current = null);
|
|
1045
1059
|
};
|
|
1046
1060
|
}, [o, d, y, f]), /* @__PURE__ */ i(
|
|
1047
1061
|
"div",
|
|
@@ -1055,10 +1069,10 @@ const ti = (t) => {
|
|
|
1055
1069
|
}, ni = {
|
|
1056
1070
|
"rp-text-highlight": "_rp-text-highlight_jdkf8_1"
|
|
1057
1071
|
}, oi = ({ pageNumber: t, viewport: e }) => {
|
|
1058
|
-
const [n, r] = H(), { pages: o } =
|
|
1059
|
-
|
|
1072
|
+
const [n, r] = H(), { pages: o } = re(), { highlightKeywords: a } = Ro(), c = !0, d = M(null), [s, f] = H(null), [m, T] = H([]);
|
|
1073
|
+
z(() => {
|
|
1060
1074
|
d.current && f(d.current.parentElement);
|
|
1061
|
-
}, [d]),
|
|
1075
|
+
}, [d]), z(() => {
|
|
1062
1076
|
(async () => {
|
|
1063
1077
|
const h = o.get(t);
|
|
1064
1078
|
if (!h || !d.current)
|
|
@@ -1074,7 +1088,7 @@ const ti = (t) => {
|
|
|
1074
1088
|
color: g.highlightColor
|
|
1075
1089
|
};
|
|
1076
1090
|
}) : [], [a]);
|
|
1077
|
-
function
|
|
1091
|
+
function C(g, h) {
|
|
1078
1092
|
if (!g)
|
|
1079
1093
|
return;
|
|
1080
1094
|
const p = `[data-rp="page-${h}-textLayer"]`;
|
|
@@ -1084,13 +1098,13 @@ const ti = (t) => {
|
|
|
1084
1098
|
l(v);
|
|
1085
1099
|
return;
|
|
1086
1100
|
}
|
|
1087
|
-
new MutationObserver((I,
|
|
1088
|
-
const
|
|
1089
|
-
|
|
1101
|
+
new MutationObserver((I, x) => {
|
|
1102
|
+
const S = g.querySelector(p);
|
|
1103
|
+
S && (l(S), x.disconnect());
|
|
1090
1104
|
}).observe(g, { childList: !0, subtree: !0 });
|
|
1091
1105
|
});
|
|
1092
1106
|
}
|
|
1093
|
-
function
|
|
1107
|
+
function w(g) {
|
|
1094
1108
|
return new Promise((h) => {
|
|
1095
1109
|
const p = g.querySelectorAll(
|
|
1096
1110
|
'[data-rp="rp-text-layer-text"]'
|
|
@@ -1108,39 +1122,39 @@ const ti = (t) => {
|
|
|
1108
1122
|
});
|
|
1109
1123
|
}
|
|
1110
1124
|
const P = (g, h, p, l) => {
|
|
1111
|
-
var
|
|
1125
|
+
var $;
|
|
1112
1126
|
const v = document.createRange(), _ = p.firstChild;
|
|
1113
1127
|
if (!_ || _.nodeType !== Node.TEXT_NODE)
|
|
1114
1128
|
return null;
|
|
1115
|
-
const I = ((
|
|
1116
|
-
if (
|
|
1129
|
+
const I = (($ = _.textContent) == null ? void 0 : $.length) ?? 0, x = l[0].charIdxInSpan, S = l.length === 1 ? x : l[l.length - 1].charIdxInSpan;
|
|
1130
|
+
if (x > I || S + 1 > I)
|
|
1117
1131
|
return null;
|
|
1118
|
-
v.setStart(_,
|
|
1132
|
+
v.setStart(_, x), v.setEnd(_, S + 1);
|
|
1119
1133
|
const R = document.createElement("span");
|
|
1120
1134
|
R.style.width = "auto", v.surroundContents(R);
|
|
1121
|
-
const
|
|
1135
|
+
const N = R.getBoundingClientRect(), A = g.getBoundingClientRect(), F = A.height, D = A.width, L = 100 * (N.left - A.left) / D, E = 100 * (N.top - A.top) / F, U = 100 * N.height / F, V = 100 * N.width / D;
|
|
1122
1136
|
return sr(R), {
|
|
1123
1137
|
keywordStr: h,
|
|
1124
1138
|
left: L,
|
|
1125
|
-
top:
|
|
1126
|
-
height:
|
|
1127
|
-
width:
|
|
1128
|
-
pageHeight:
|
|
1129
|
-
pageWidth:
|
|
1139
|
+
top: E,
|
|
1140
|
+
height: U,
|
|
1141
|
+
width: V,
|
|
1142
|
+
pageHeight: F,
|
|
1143
|
+
pageWidth: D
|
|
1130
1144
|
};
|
|
1131
1145
|
};
|
|
1132
1146
|
async function y(g, h) {
|
|
1133
|
-
const p = await
|
|
1147
|
+
const p = await C(s, g);
|
|
1134
1148
|
if (!p)
|
|
1135
1149
|
return;
|
|
1136
|
-
const l = await
|
|
1150
|
+
const l = await w(p);
|
|
1137
1151
|
if (l.length) {
|
|
1138
1152
|
const v = l.map((I) => I.tagName === "BR" ? " " : I.textContent).reduce(
|
|
1139
|
-
(I,
|
|
1140
|
-
|
|
1153
|
+
(I, x, S) => I.concat(
|
|
1154
|
+
x.split("").map((R, N) => ({
|
|
1141
1155
|
char: R,
|
|
1142
|
-
charIdxInSpan:
|
|
1143
|
-
spanIdx:
|
|
1156
|
+
charIdxInSpan: N,
|
|
1157
|
+
spanIdx: S
|
|
1144
1158
|
}))
|
|
1145
1159
|
),
|
|
1146
1160
|
[
|
|
@@ -1150,60 +1164,60 @@ const ti = (t) => {
|
|
|
1150
1164
|
spanIdx: 0
|
|
1151
1165
|
}
|
|
1152
1166
|
]
|
|
1153
|
-
).slice(1), _ =
|
|
1154
|
-
|
|
1167
|
+
).slice(1), _ = b(p, h, l, v);
|
|
1168
|
+
T(_);
|
|
1155
1169
|
}
|
|
1156
1170
|
}
|
|
1157
|
-
const
|
|
1171
|
+
const b = (g, h, p, l) => {
|
|
1158
1172
|
const v = h.length;
|
|
1159
1173
|
if (!l.length || !v)
|
|
1160
1174
|
return [];
|
|
1161
|
-
const _ = [], I = l.map((
|
|
1162
|
-
return u.forEach((
|
|
1163
|
-
const { keyword:
|
|
1164
|
-
if (!
|
|
1175
|
+
const _ = [], I = l.map((x) => x.char).join("");
|
|
1176
|
+
return u.forEach((x) => {
|
|
1177
|
+
const { keyword: S, regExp: R, wholeWords: N, color: A } = x, F = S;
|
|
1178
|
+
if (!F.trim())
|
|
1165
1179
|
return;
|
|
1166
|
-
const
|
|
1180
|
+
const D = R.flags.indexOf("g") === -1 ? new RegExp(R, `${R.flags}g`) : R;
|
|
1167
1181
|
let L;
|
|
1168
|
-
const
|
|
1169
|
-
for (; (L =
|
|
1170
|
-
|
|
1171
|
-
keyword:
|
|
1182
|
+
const E = [];
|
|
1183
|
+
for (; (L = D.exec(I)) !== null; )
|
|
1184
|
+
N && !So(I, L.index, L[0].length) || E.push({
|
|
1185
|
+
keyword: D,
|
|
1172
1186
|
startIndex: L.index,
|
|
1173
|
-
endIndex:
|
|
1187
|
+
endIndex: D.lastIndex
|
|
1174
1188
|
});
|
|
1175
|
-
const
|
|
1176
|
-
keyword:
|
|
1177
|
-
indexes: l.slice(
|
|
1178
|
-
color:
|
|
1189
|
+
const U = E.map((V) => ({
|
|
1190
|
+
keyword: V.keyword,
|
|
1191
|
+
indexes: l.slice(V.startIndex, V.endIndex),
|
|
1192
|
+
color: A
|
|
1179
1193
|
}));
|
|
1180
|
-
for (const
|
|
1181
|
-
const
|
|
1182
|
-
(
|
|
1194
|
+
for (const V of U) {
|
|
1195
|
+
const $ = V.indexes.reduce(
|
|
1196
|
+
(q, j) => (q[j.spanIdx] = (q[j.spanIdx] || []).concat([j]), q),
|
|
1183
1197
|
{}
|
|
1184
1198
|
);
|
|
1185
|
-
for (const
|
|
1186
|
-
if (
|
|
1187
|
-
const
|
|
1199
|
+
for (const q of Object.values($))
|
|
1200
|
+
if (q.length !== 1 || q[0].char.trim() !== "") {
|
|
1201
|
+
const j = q, te = p[j[0].spanIdx], G = P(
|
|
1188
1202
|
g,
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1203
|
+
F,
|
|
1204
|
+
te,
|
|
1205
|
+
j
|
|
1192
1206
|
);
|
|
1193
|
-
if (
|
|
1194
|
-
const { left: Y, top: J } =
|
|
1195
|
-
if (_.find((
|
|
1207
|
+
if (G) {
|
|
1208
|
+
const { left: Y, top: J } = G;
|
|
1209
|
+
if (_.find((ne) => ne.left === Y && ne.top === J))
|
|
1196
1210
|
continue;
|
|
1197
|
-
_.push({
|
|
1211
|
+
_.push({ ...G, highlightColor: V.color });
|
|
1198
1212
|
}
|
|
1199
1213
|
}
|
|
1200
1214
|
}
|
|
1201
1215
|
}), _.sort(ar), _;
|
|
1202
1216
|
};
|
|
1203
|
-
return
|
|
1217
|
+
return z(() => {
|
|
1204
1218
|
(async () => {
|
|
1205
1219
|
if (!a || a.length === 0) {
|
|
1206
|
-
|
|
1220
|
+
T([]);
|
|
1207
1221
|
return;
|
|
1208
1222
|
}
|
|
1209
1223
|
try {
|
|
@@ -1212,7 +1226,7 @@ const ti = (t) => {
|
|
|
1212
1226
|
console.error(h);
|
|
1213
1227
|
}
|
|
1214
1228
|
})();
|
|
1215
|
-
}, [c, a, t, n, e]), /* @__PURE__ */ i(
|
|
1229
|
+
}, [c, a, t, n, e]), /* @__PURE__ */ i(ge, { children: /* @__PURE__ */ i("div", { ref: d, "data-rp": `page-${t}-textHighlightLayer`, children: m.map((g, h) => /* @__PURE__ */ i(
|
|
1216
1230
|
"div",
|
|
1217
1231
|
{
|
|
1218
1232
|
className: ni["rp-text-highlight"],
|
|
@@ -1226,14 +1240,14 @@ const ti = (t) => {
|
|
|
1226
1240
|
},
|
|
1227
1241
|
h
|
|
1228
1242
|
)) }) });
|
|
1229
|
-
},
|
|
1230
|
-
const { pageNumber: n, style: r, ...o } = t, { pages: a } =
|
|
1243
|
+
}, $e = st((t, e) => {
|
|
1244
|
+
const { pageNumber: n, style: r, ...o } = t, { pages: a } = re(), { pageRotate: c } = at(), { textLayer: d } = Po(), { currentZoom: s } = rt(), { LoaderImageComponent: f } = St(), m = M(a.get(n)), [T, u] = H(!1), C = M(null), [w, P] = H({
|
|
1231
1245
|
width: 0,
|
|
1232
1246
|
height: 0
|
|
1233
1247
|
});
|
|
1234
|
-
mn(e, () =>
|
|
1248
|
+
mn(e, () => C.current);
|
|
1235
1249
|
const y = W(() => m.current ? c[n] : 0, [n, c]);
|
|
1236
|
-
|
|
1250
|
+
z(() => {
|
|
1237
1251
|
if (a && (m.current = a.get(n), m.current)) {
|
|
1238
1252
|
const p = m.current.page.getViewport({
|
|
1239
1253
|
scale: s,
|
|
@@ -1242,32 +1256,32 @@ const ti = (t) => {
|
|
|
1242
1256
|
P(p);
|
|
1243
1257
|
}
|
|
1244
1258
|
}, [a, n, y, s]);
|
|
1245
|
-
const
|
|
1259
|
+
const b = W(() => {
|
|
1246
1260
|
switch (y) {
|
|
1247
1261
|
case 90:
|
|
1248
|
-
return `${
|
|
1262
|
+
return `${w.width / 2}px ${w.width / 2}px`;
|
|
1249
1263
|
case -90:
|
|
1250
1264
|
case 270:
|
|
1251
|
-
return `${
|
|
1265
|
+
return `${w.height / 2}px ${w.height / 2}px`;
|
|
1252
1266
|
default:
|
|
1253
1267
|
return "center";
|
|
1254
1268
|
}
|
|
1255
|
-
}, [y,
|
|
1269
|
+
}, [y, w]), g = O(() => {
|
|
1256
1270
|
u(!0);
|
|
1257
|
-
}, []), h =
|
|
1271
|
+
}, []), h = O(() => {
|
|
1258
1272
|
u(!1);
|
|
1259
1273
|
}, []);
|
|
1260
1274
|
return /* @__PURE__ */ i(
|
|
1261
1275
|
"div",
|
|
1262
1276
|
{
|
|
1263
|
-
ref:
|
|
1277
|
+
ref: C,
|
|
1264
1278
|
id: `page-${n}`,
|
|
1265
1279
|
"data-rp": `page-${n}`,
|
|
1266
1280
|
...o,
|
|
1267
1281
|
style: {
|
|
1268
1282
|
...r,
|
|
1269
1283
|
"--rp-rotate": `${y}deg`,
|
|
1270
|
-
"--rp-page-rotate-translate": `${
|
|
1284
|
+
"--rp-page-rotate-translate": `${b}`,
|
|
1271
1285
|
"--scale-factor": s
|
|
1272
1286
|
},
|
|
1273
1287
|
className: mt["rp-page-wrapper"],
|
|
@@ -1275,16 +1289,16 @@ const ti = (t) => {
|
|
|
1275
1289
|
"div",
|
|
1276
1290
|
{
|
|
1277
1291
|
style: {
|
|
1278
|
-
width: `${
|
|
1279
|
-
height: `${
|
|
1292
|
+
width: `${w.width}px`,
|
|
1293
|
+
height: `${w.height}px`
|
|
1280
1294
|
},
|
|
1281
1295
|
className: mt["rp-page"],
|
|
1282
1296
|
children: [
|
|
1283
1297
|
/* @__PURE__ */ i(Kr, { onLoading: g, onLoaded: h, pageNumber: n }),
|
|
1284
|
-
|
|
1298
|
+
T && f && /* @__PURE__ */ i("div", { className: mt["rp-loader-wrapper"], children: /* @__PURE__ */ i(f, {}) }),
|
|
1285
1299
|
/* @__PURE__ */ i(cr, { pageNumber: n }),
|
|
1286
1300
|
d && /* @__PURE__ */ i(Yr, { pageNumber: n }),
|
|
1287
|
-
/* @__PURE__ */ i(oi, { pageNumber: n, viewport:
|
|
1301
|
+
/* @__PURE__ */ i(oi, { pageNumber: n, viewport: w }),
|
|
1288
1302
|
/* @__PURE__ */ i(ti, { pageNumber: n })
|
|
1289
1303
|
]
|
|
1290
1304
|
}
|
|
@@ -1377,30 +1391,30 @@ function li(t) {
|
|
|
1377
1391
|
}
|
|
1378
1392
|
return vt;
|
|
1379
1393
|
}
|
|
1380
|
-
var
|
|
1394
|
+
var We = null;
|
|
1381
1395
|
function nn(t) {
|
|
1382
|
-
if (t === void 0 && (t = !1),
|
|
1396
|
+
if (t === void 0 && (t = !1), We === null || t) {
|
|
1383
1397
|
var e = document.createElement("div"), n = e.style;
|
|
1384
1398
|
n.width = "50px", n.height = "50px", n.overflow = "scroll", n.direction = "rtl";
|
|
1385
1399
|
var r = document.createElement("div"), o = r.style;
|
|
1386
|
-
return o.width = "100px", o.height = "100px", e.appendChild(r), document.body.appendChild(e), e.scrollLeft > 0 ?
|
|
1400
|
+
return o.width = "100px", o.height = "100px", e.appendChild(r), document.body.appendChild(e), e.scrollLeft > 0 ? We = "positive-descending" : (e.scrollLeft = 1, e.scrollLeft === 0 ? We = "negative" : We = "positive-ascending"), document.body.removeChild(e), We;
|
|
1387
1401
|
}
|
|
1388
|
-
return
|
|
1402
|
+
return We;
|
|
1389
1403
|
}
|
|
1390
1404
|
var di = 150, ui = function(e) {
|
|
1391
1405
|
var n = e.columnIndex;
|
|
1392
1406
|
e.data;
|
|
1393
1407
|
var r = e.rowIndex;
|
|
1394
1408
|
return r + ":" + n;
|
|
1395
|
-
},
|
|
1396
|
-
process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (
|
|
1409
|
+
}, Je = null, et = null, tt = null;
|
|
1410
|
+
process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (Je = /* @__PURE__ */ new WeakSet(), et = /* @__PURE__ */ new WeakSet(), tt = /* @__PURE__ */ new WeakSet());
|
|
1397
1411
|
function pi(t) {
|
|
1398
|
-
var e, n = t.getColumnOffset, r = t.getColumnStartIndexForOffset, o = t.getColumnStopIndexForStartIndex, a = t.getColumnWidth, c = t.getEstimatedTotalHeight, d = t.getEstimatedTotalWidth, s = t.getOffsetForColumnAndAlignment, f = t.getOffsetForRowAndAlignment, m = t.getRowHeight,
|
|
1399
|
-
return e = /* @__PURE__ */ function(
|
|
1400
|
-
ri(g,
|
|
1412
|
+
var e, n = t.getColumnOffset, r = t.getColumnStartIndexForOffset, o = t.getColumnStopIndexForStartIndex, a = t.getColumnWidth, c = t.getEstimatedTotalHeight, d = t.getEstimatedTotalWidth, s = t.getOffsetForColumnAndAlignment, f = t.getOffsetForRowAndAlignment, m = t.getRowHeight, T = t.getRowOffset, u = t.getRowStartIndexForOffset, C = t.getRowStopIndexForStartIndex, w = t.initInstanceProps, P = t.shouldResetStyleCacheOnItemSizeChange, y = t.validateProps;
|
|
1413
|
+
return e = /* @__PURE__ */ function(b) {
|
|
1414
|
+
ri(g, b);
|
|
1401
1415
|
function g(p) {
|
|
1402
1416
|
var l;
|
|
1403
|
-
return l =
|
|
1417
|
+
return l = b.call(this, p) || this, l._instanceProps = w(l.props, Qt(l)), l._resetIsScrollingTimeoutId = null, l._outerRef = void 0, l.state = {
|
|
1404
1418
|
instance: Qt(l),
|
|
1405
1419
|
isScrolling: !1,
|
|
1406
1420
|
horizontalScrollDirection: "forward",
|
|
@@ -1408,66 +1422,66 @@ function pi(t) {
|
|
|
1408
1422
|
scrollTop: typeof l.props.initialScrollTop == "number" ? l.props.initialScrollTop : 0,
|
|
1409
1423
|
scrollUpdateWasRequested: !1,
|
|
1410
1424
|
verticalScrollDirection: "forward"
|
|
1411
|
-
}, l._callOnItemsRendered = void 0, l._callOnItemsRendered = gt(function(v, _, I,
|
|
1425
|
+
}, l._callOnItemsRendered = void 0, l._callOnItemsRendered = gt(function(v, _, I, x, S, R, N, A) {
|
|
1412
1426
|
return l.props.onItemsRendered({
|
|
1413
1427
|
overscanColumnStartIndex: v,
|
|
1414
1428
|
overscanColumnStopIndex: _,
|
|
1415
1429
|
overscanRowStartIndex: I,
|
|
1416
|
-
overscanRowStopIndex:
|
|
1417
|
-
visibleColumnStartIndex:
|
|
1430
|
+
overscanRowStopIndex: x,
|
|
1431
|
+
visibleColumnStartIndex: S,
|
|
1418
1432
|
visibleColumnStopIndex: R,
|
|
1419
|
-
visibleRowStartIndex:
|
|
1420
|
-
visibleRowStopIndex:
|
|
1433
|
+
visibleRowStartIndex: N,
|
|
1434
|
+
visibleRowStopIndex: A
|
|
1421
1435
|
});
|
|
1422
|
-
}), l._callOnScroll = void 0, l._callOnScroll = gt(function(v, _, I,
|
|
1436
|
+
}), l._callOnScroll = void 0, l._callOnScroll = gt(function(v, _, I, x, S) {
|
|
1423
1437
|
return l.props.onScroll({
|
|
1424
1438
|
horizontalScrollDirection: I,
|
|
1425
1439
|
scrollLeft: v,
|
|
1426
1440
|
scrollTop: _,
|
|
1427
|
-
verticalScrollDirection:
|
|
1428
|
-
scrollUpdateWasRequested:
|
|
1441
|
+
verticalScrollDirection: x,
|
|
1442
|
+
scrollUpdateWasRequested: S
|
|
1429
1443
|
});
|
|
1430
1444
|
}), l._getItemStyle = void 0, l._getItemStyle = function(v, _) {
|
|
1431
|
-
var I = l.props,
|
|
1432
|
-
if (
|
|
1433
|
-
|
|
1445
|
+
var I = l.props, x = I.columnWidth, S = I.direction, R = I.rowHeight, N = l._getItemStyleCache(P && x, P && S, P && R), A = v + ":" + _, F;
|
|
1446
|
+
if (N.hasOwnProperty(A))
|
|
1447
|
+
F = N[A];
|
|
1434
1448
|
else {
|
|
1435
|
-
var
|
|
1436
|
-
|
|
1449
|
+
var D = n(l.props, _, l._instanceProps), L = S === "rtl";
|
|
1450
|
+
N[A] = F = {
|
|
1437
1451
|
position: "absolute",
|
|
1438
|
-
left: L ? void 0 :
|
|
1439
|
-
right: L ?
|
|
1440
|
-
top:
|
|
1452
|
+
left: L ? void 0 : D,
|
|
1453
|
+
right: L ? D : void 0,
|
|
1454
|
+
top: T(l.props, v, l._instanceProps),
|
|
1441
1455
|
height: m(l.props, v, l._instanceProps),
|
|
1442
1456
|
width: a(l.props, _, l._instanceProps)
|
|
1443
1457
|
};
|
|
1444
1458
|
}
|
|
1445
|
-
return
|
|
1459
|
+
return F;
|
|
1446
1460
|
}, l._getItemStyleCache = void 0, l._getItemStyleCache = gt(function(v, _, I) {
|
|
1447
1461
|
return {};
|
|
1448
1462
|
}), l._onScroll = function(v) {
|
|
1449
|
-
var _ = v.currentTarget, I = _.clientHeight,
|
|
1450
|
-
l.setState(function(
|
|
1451
|
-
if (
|
|
1463
|
+
var _ = v.currentTarget, I = _.clientHeight, x = _.clientWidth, S = _.scrollLeft, R = _.scrollTop, N = _.scrollHeight, A = _.scrollWidth;
|
|
1464
|
+
l.setState(function(F) {
|
|
1465
|
+
if (F.scrollLeft === S && F.scrollTop === R)
|
|
1452
1466
|
return null;
|
|
1453
|
-
var
|
|
1454
|
-
if (
|
|
1467
|
+
var D = l.props.direction, L = S;
|
|
1468
|
+
if (D === "rtl")
|
|
1455
1469
|
switch (nn()) {
|
|
1456
1470
|
case "negative":
|
|
1457
|
-
L = -
|
|
1471
|
+
L = -S;
|
|
1458
1472
|
break;
|
|
1459
1473
|
case "positive-descending":
|
|
1460
|
-
L =
|
|
1474
|
+
L = A - x - S;
|
|
1461
1475
|
break;
|
|
1462
1476
|
}
|
|
1463
|
-
L = Math.max(0, Math.min(L,
|
|
1464
|
-
var
|
|
1477
|
+
L = Math.max(0, Math.min(L, A - x));
|
|
1478
|
+
var E = Math.max(0, Math.min(R, N - I));
|
|
1465
1479
|
return {
|
|
1466
1480
|
isScrolling: !0,
|
|
1467
|
-
horizontalScrollDirection:
|
|
1481
|
+
horizontalScrollDirection: F.scrollLeft < S ? "forward" : "backward",
|
|
1468
1482
|
scrollLeft: L,
|
|
1469
|
-
scrollTop:
|
|
1470
|
-
verticalScrollDirection:
|
|
1483
|
+
scrollTop: E,
|
|
1484
|
+
verticalScrollDirection: F.scrollTop < R ? "forward" : "backward",
|
|
1471
1485
|
scrollUpdateWasRequested: !1
|
|
1472
1486
|
};
|
|
1473
1487
|
}, l._resetIsScrollingDebounced);
|
|
@@ -1500,12 +1514,12 @@ function pi(t) {
|
|
|
1500
1514
|
};
|
|
1501
1515
|
}, this._resetIsScrollingDebounced);
|
|
1502
1516
|
}, h.scrollToItem = function(l) {
|
|
1503
|
-
var v = l.align, _ = v === void 0 ? "auto" : v, I = l.columnIndex,
|
|
1504
|
-
I !== void 0 && (I = Math.max(0, Math.min(I, R - 1))),
|
|
1505
|
-
var
|
|
1517
|
+
var v = l.align, _ = v === void 0 ? "auto" : v, I = l.columnIndex, x = l.rowIndex, S = this.props, R = S.columnCount, N = S.height, A = S.rowCount, F = S.width, D = this.state, L = D.scrollLeft, E = D.scrollTop, U = li();
|
|
1518
|
+
I !== void 0 && (I = Math.max(0, Math.min(I, R - 1))), x !== void 0 && (x = Math.max(0, Math.min(x, A - 1)));
|
|
1519
|
+
var V = c(this.props, this._instanceProps), $ = d(this.props, this._instanceProps), q = $ > F ? U : 0, j = V > N ? U : 0;
|
|
1506
1520
|
this.scrollTo({
|
|
1507
|
-
scrollLeft: I !== void 0 ? s(this.props, I, _, L, this._instanceProps,
|
|
1508
|
-
scrollTop:
|
|
1521
|
+
scrollLeft: I !== void 0 ? s(this.props, I, _, L, this._instanceProps, j) : L,
|
|
1522
|
+
scrollTop: x !== void 0 ? f(this.props, x, _, E, this._instanceProps, q) : E
|
|
1509
1523
|
});
|
|
1510
1524
|
}, h.componentDidMount = function() {
|
|
1511
1525
|
var l = this.props, v = l.initialScrollLeft, _ = l.initialScrollTop;
|
|
@@ -1515,91 +1529,91 @@ function pi(t) {
|
|
|
1515
1529
|
}
|
|
1516
1530
|
this._callPropsCallbacks();
|
|
1517
1531
|
}, h.componentDidUpdate = function() {
|
|
1518
|
-
var l = this.props.direction, v = this.state, _ = v.scrollLeft, I = v.scrollTop,
|
|
1519
|
-
if (
|
|
1520
|
-
var
|
|
1532
|
+
var l = this.props.direction, v = this.state, _ = v.scrollLeft, I = v.scrollTop, x = v.scrollUpdateWasRequested;
|
|
1533
|
+
if (x && this._outerRef != null) {
|
|
1534
|
+
var S = this._outerRef;
|
|
1521
1535
|
if (l === "rtl")
|
|
1522
1536
|
switch (nn()) {
|
|
1523
1537
|
case "negative":
|
|
1524
|
-
|
|
1538
|
+
S.scrollLeft = -_;
|
|
1525
1539
|
break;
|
|
1526
1540
|
case "positive-ascending":
|
|
1527
|
-
|
|
1541
|
+
S.scrollLeft = _;
|
|
1528
1542
|
break;
|
|
1529
1543
|
default:
|
|
1530
|
-
var R =
|
|
1531
|
-
|
|
1544
|
+
var R = S.clientWidth, N = S.scrollWidth;
|
|
1545
|
+
S.scrollLeft = N - R - _;
|
|
1532
1546
|
break;
|
|
1533
1547
|
}
|
|
1534
1548
|
else
|
|
1535
|
-
|
|
1536
|
-
|
|
1549
|
+
S.scrollLeft = Math.max(0, _);
|
|
1550
|
+
S.scrollTop = Math.max(0, I);
|
|
1537
1551
|
}
|
|
1538
1552
|
this._callPropsCallbacks();
|
|
1539
1553
|
}, h.componentWillUnmount = function() {
|
|
1540
1554
|
this._resetIsScrollingTimeoutId !== null && tn(this._resetIsScrollingTimeoutId);
|
|
1541
1555
|
}, h.render = function() {
|
|
1542
|
-
var l = this.props, v = l.children, _ = l.className, I = l.columnCount,
|
|
1543
|
-
if (I > 0 &&
|
|
1544
|
-
for (var
|
|
1545
|
-
for (var
|
|
1546
|
-
|
|
1547
|
-
columnIndex:
|
|
1548
|
-
data:
|
|
1549
|
-
isScrolling:
|
|
1556
|
+
var l = this.props, v = l.children, _ = l.className, I = l.columnCount, x = l.direction, S = l.height, R = l.innerRef, N = l.innerElementType, A = l.innerTagName, F = l.itemData, D = l.itemKey, L = D === void 0 ? ui : D, E = l.outerElementType, U = l.outerTagName, V = l.rowCount, $ = l.style, q = l.useIsScrolling, j = l.width, te = this.state.isScrolling, G = this._getHorizontalRangeToRender(), Y = G[0], J = G[1], me = this._getVerticalRangeToRender(), ne = me[0], Q = me[1], ie = [];
|
|
1557
|
+
if (I > 0 && V)
|
|
1558
|
+
for (var se = ne; se <= Q; se++)
|
|
1559
|
+
for (var ce = Y; ce <= J; ce++)
|
|
1560
|
+
ie.push(Ye(v, {
|
|
1561
|
+
columnIndex: ce,
|
|
1562
|
+
data: F,
|
|
1563
|
+
isScrolling: q ? te : void 0,
|
|
1550
1564
|
key: L({
|
|
1551
|
-
columnIndex:
|
|
1552
|
-
data:
|
|
1553
|
-
rowIndex:
|
|
1565
|
+
columnIndex: ce,
|
|
1566
|
+
data: F,
|
|
1567
|
+
rowIndex: se
|
|
1554
1568
|
}),
|
|
1555
|
-
rowIndex:
|
|
1556
|
-
style: this._getItemStyle(
|
|
1569
|
+
rowIndex: se,
|
|
1570
|
+
style: this._getItemStyle(se, ce)
|
|
1557
1571
|
}));
|
|
1558
|
-
var
|
|
1559
|
-
return
|
|
1572
|
+
var ze = c(this.props, this._instanceProps), Le = d(this.props, this._instanceProps);
|
|
1573
|
+
return Ye(E || U || "div", {
|
|
1560
1574
|
className: _,
|
|
1561
1575
|
onScroll: this._onScroll,
|
|
1562
1576
|
ref: this._outerRefSetter,
|
|
1563
1577
|
style: Pt({
|
|
1564
1578
|
position: "relative",
|
|
1565
|
-
height:
|
|
1566
|
-
width:
|
|
1579
|
+
height: S,
|
|
1580
|
+
width: j,
|
|
1567
1581
|
overflow: "auto",
|
|
1568
1582
|
WebkitOverflowScrolling: "touch",
|
|
1569
1583
|
willChange: "transform",
|
|
1570
|
-
direction:
|
|
1571
|
-
},
|
|
1572
|
-
},
|
|
1573
|
-
children:
|
|
1584
|
+
direction: x
|
|
1585
|
+
}, $)
|
|
1586
|
+
}, Ye(N || A || "div", {
|
|
1587
|
+
children: ie,
|
|
1574
1588
|
ref: R,
|
|
1575
1589
|
style: {
|
|
1576
|
-
height:
|
|
1577
|
-
pointerEvents:
|
|
1590
|
+
height: ze,
|
|
1591
|
+
pointerEvents: te ? "none" : void 0,
|
|
1578
1592
|
width: Le
|
|
1579
1593
|
}
|
|
1580
1594
|
}));
|
|
1581
1595
|
}, h._callPropsCallbacks = function() {
|
|
1582
|
-
var l = this.props, v = l.columnCount, _ = l.onItemsRendered, I = l.onScroll,
|
|
1583
|
-
if (typeof _ == "function" && v > 0 &&
|
|
1584
|
-
var
|
|
1585
|
-
this._callOnItemsRendered(R,
|
|
1596
|
+
var l = this.props, v = l.columnCount, _ = l.onItemsRendered, I = l.onScroll, x = l.rowCount;
|
|
1597
|
+
if (typeof _ == "function" && v > 0 && x > 0) {
|
|
1598
|
+
var S = this._getHorizontalRangeToRender(), R = S[0], N = S[1], A = S[2], F = S[3], D = this._getVerticalRangeToRender(), L = D[0], E = D[1], U = D[2], V = D[3];
|
|
1599
|
+
this._callOnItemsRendered(R, N, L, E, A, F, U, V);
|
|
1586
1600
|
}
|
|
1587
1601
|
if (typeof I == "function") {
|
|
1588
|
-
var
|
|
1589
|
-
this._callOnScroll(
|
|
1602
|
+
var $ = this.state, q = $.horizontalScrollDirection, j = $.scrollLeft, te = $.scrollTop, G = $.scrollUpdateWasRequested, Y = $.verticalScrollDirection;
|
|
1603
|
+
this._callOnScroll(j, te, q, Y, G);
|
|
1590
1604
|
}
|
|
1591
1605
|
}, h._getHorizontalRangeToRender = function() {
|
|
1592
|
-
var l = this.props, v = l.columnCount, _ = l.overscanColumnCount, I = l.overscanColumnsCount,
|
|
1593
|
-
if (v === 0 ||
|
|
1606
|
+
var l = this.props, v = l.columnCount, _ = l.overscanColumnCount, I = l.overscanColumnsCount, x = l.overscanCount, S = l.rowCount, R = this.state, N = R.horizontalScrollDirection, A = R.isScrolling, F = R.scrollLeft, D = _ || I || x || 1;
|
|
1607
|
+
if (v === 0 || S === 0)
|
|
1594
1608
|
return [0, 0, 0, 0];
|
|
1595
|
-
var L = r(this.props,
|
|
1596
|
-
return [Math.max(0, L -
|
|
1609
|
+
var L = r(this.props, F, this._instanceProps), E = o(this.props, L, F, this._instanceProps), U = !A || N === "backward" ? Math.max(1, D) : 1, V = !A || N === "forward" ? Math.max(1, D) : 1;
|
|
1610
|
+
return [Math.max(0, L - U), Math.max(0, Math.min(v - 1, E + V)), L, E];
|
|
1597
1611
|
}, h._getVerticalRangeToRender = function() {
|
|
1598
|
-
var l = this.props, v = l.columnCount, _ = l.overscanCount, I = l.overscanRowCount,
|
|
1599
|
-
if (v === 0 ||
|
|
1612
|
+
var l = this.props, v = l.columnCount, _ = l.overscanCount, I = l.overscanRowCount, x = l.overscanRowsCount, S = l.rowCount, R = this.state, N = R.isScrolling, A = R.verticalScrollDirection, F = R.scrollTop, D = I || x || _ || 1;
|
|
1613
|
+
if (v === 0 || S === 0)
|
|
1600
1614
|
return [0, 0, 0, 0];
|
|
1601
|
-
var L = u(this.props,
|
|
1602
|
-
return [Math.max(0, L -
|
|
1615
|
+
var L = u(this.props, F, this._instanceProps), E = C(this.props, L, F, this._instanceProps), U = !N || A === "backward" ? Math.max(1, D) : 1, V = !N || A === "forward" ? Math.max(1, D) : 1;
|
|
1616
|
+
return [Math.max(0, L - U), Math.max(0, Math.min(S - 1, E + V)), L, E];
|
|
1603
1617
|
}, g;
|
|
1604
1618
|
}(ho), e.defaultProps = {
|
|
1605
1619
|
direction: "ltr",
|
|
@@ -1608,9 +1622,9 @@ function pi(t) {
|
|
|
1608
1622
|
}, e;
|
|
1609
1623
|
}
|
|
1610
1624
|
var hi = function(e, n) {
|
|
1611
|
-
var r = e.children, o = e.direction, a = e.height, c = e.innerTagName, d = e.outerTagName, s = e.overscanColumnsCount, f = e.overscanCount, m = e.overscanRowsCount,
|
|
1625
|
+
var r = e.children, o = e.direction, a = e.height, c = e.innerTagName, d = e.outerTagName, s = e.overscanColumnsCount, f = e.overscanCount, m = e.overscanRowsCount, T = e.width, u = n.instance;
|
|
1612
1626
|
if (process.env.NODE_ENV !== "production") {
|
|
1613
|
-
if (typeof f == "number" &&
|
|
1627
|
+
if (typeof f == "number" && Je && !Je.has(u) && (Je.add(u), console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (typeof s == "number" || typeof m == "number") && et && !et.has(u) && (et.add(u), console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (c != null || d != null) && tt && !tt.has(u) && (tt.add(u), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")), r == null)
|
|
1614
1628
|
throw Error('An invalid "children" prop has been specified. Value should be a React component. ' + ('"' + (r === null ? "null" : typeof r) + '" was specified.'));
|
|
1615
1629
|
switch (o) {
|
|
1616
1630
|
case "ltr":
|
|
@@ -1619,8 +1633,8 @@ var hi = function(e, n) {
|
|
|
1619
1633
|
default:
|
|
1620
1634
|
throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". ' + ('"' + o + '" was specified.'));
|
|
1621
1635
|
}
|
|
1622
|
-
if (typeof
|
|
1623
|
-
throw Error('An invalid "width" prop has been specified. Grids must specify a number for width. ' + ('"' + (
|
|
1636
|
+
if (typeof T != "number")
|
|
1637
|
+
throw Error('An invalid "width" prop has been specified. Grids must specify a number for width. ' + ('"' + (T === null ? "null" : typeof T) + '" was specified.'));
|
|
1624
1638
|
if (typeof a != "number")
|
|
1625
1639
|
throw Error('An invalid "height" prop has been specified. Grids must specify a number for height. ' + ('"' + (a === null ? "null" : typeof a) + '" was specified.'));
|
|
1626
1640
|
}
|
|
@@ -1640,7 +1654,7 @@ var hi = function(e, n) {
|
|
|
1640
1654
|
}
|
|
1641
1655
|
var f = r - c - 1, m = f * a;
|
|
1642
1656
|
return d + m;
|
|
1643
|
-
},
|
|
1657
|
+
}, Te = function(e, n, r, o) {
|
|
1644
1658
|
var a, c, d;
|
|
1645
1659
|
if (e === "column" ? (a = o.columnMetadataMap, c = n.columnWidth, d = o.lastMeasuredColumnIndex) : (a = o.rowMetadataMap, c = n.rowHeight, d = o.lastMeasuredRowIndex), r > d) {
|
|
1646
1660
|
var s = 0;
|
|
@@ -1649,11 +1663,11 @@ var hi = function(e, n) {
|
|
|
1649
1663
|
s = f.offset + f.size;
|
|
1650
1664
|
}
|
|
1651
1665
|
for (var m = d + 1; m <= r; m++) {
|
|
1652
|
-
var
|
|
1666
|
+
var T = c(m);
|
|
1653
1667
|
a[m] = {
|
|
1654
1668
|
offset: s,
|
|
1655
|
-
size:
|
|
1656
|
-
}, s +=
|
|
1669
|
+
size: T
|
|
1670
|
+
}, s += T;
|
|
1657
1671
|
}
|
|
1658
1672
|
e === "column" ? o.lastMeasuredColumnIndex = r : o.lastMeasuredRowIndex = r;
|
|
1659
1673
|
}
|
|
@@ -1665,39 +1679,39 @@ var hi = function(e, n) {
|
|
|
1665
1679
|
return d >= o ? An(e, n, r, c, 0, o) : fi(e, n, r, Math.max(0, c), o);
|
|
1666
1680
|
}, An = function(e, n, r, o, a, c) {
|
|
1667
1681
|
for (; a <= o; ) {
|
|
1668
|
-
var d = a + Math.floor((o - a) / 2), s =
|
|
1682
|
+
var d = a + Math.floor((o - a) / 2), s = Te(e, n, d, r).offset;
|
|
1669
1683
|
if (s === c)
|
|
1670
1684
|
return d;
|
|
1671
1685
|
s < c ? a = d + 1 : s > c && (o = d - 1);
|
|
1672
1686
|
}
|
|
1673
1687
|
return a > 0 ? a - 1 : 0;
|
|
1674
1688
|
}, fi = function(e, n, r, o, a) {
|
|
1675
|
-
for (var c = e === "column" ? n.columnCount : n.rowCount, d = 1; o < c &&
|
|
1689
|
+
for (var c = e === "column" ? n.columnCount : n.rowCount, d = 1; o < c && Te(e, n, o, r).offset < a; )
|
|
1676
1690
|
o += d, d *= 2;
|
|
1677
1691
|
return An(e, n, r, Math.min(o, c - 1), Math.floor(o / 2), a);
|
|
1678
1692
|
}, an = function(e, n, r, o, a, c, d) {
|
|
1679
|
-
var s = e === "column" ? n.width : n.height, f =
|
|
1680
|
-
switch (o === "smart" && (a >= u - s && a <=
|
|
1693
|
+
var s = e === "column" ? n.width : n.height, f = Te(e, n, r, c), m = e === "column" ? Dn(n, c) : On(n, c), T = Math.max(0, Math.min(m - s, f.offset)), u = Math.max(0, f.offset - s + d + f.size);
|
|
1694
|
+
switch (o === "smart" && (a >= u - s && a <= T + s ? o = "auto" : o = "center"), o) {
|
|
1681
1695
|
case "start":
|
|
1682
|
-
return
|
|
1696
|
+
return T;
|
|
1683
1697
|
case "end":
|
|
1684
1698
|
return u;
|
|
1685
1699
|
case "center":
|
|
1686
|
-
return Math.round(u + (
|
|
1700
|
+
return Math.round(u + (T - u) / 2);
|
|
1687
1701
|
case "auto":
|
|
1688
1702
|
default:
|
|
1689
|
-
return a >= u && a <=
|
|
1703
|
+
return a >= u && a <= T ? a : u > T || a < u ? u : T;
|
|
1690
1704
|
}
|
|
1691
1705
|
}, mi = /* @__PURE__ */ pi({
|
|
1692
1706
|
getColumnOffset: function(e, n, r) {
|
|
1693
|
-
return
|
|
1707
|
+
return Te("column", e, n, r).offset;
|
|
1694
1708
|
},
|
|
1695
1709
|
getColumnStartIndexForOffset: function(e, n, r) {
|
|
1696
1710
|
return rn("column", e, r, n);
|
|
1697
1711
|
},
|
|
1698
1712
|
getColumnStopIndexForStartIndex: function(e, n, r, o) {
|
|
1699
|
-
for (var a = e.columnCount, c = e.width, d =
|
|
1700
|
-
m++, f +=
|
|
1713
|
+
for (var a = e.columnCount, c = e.width, d = Te("column", e, n, o), s = r + c, f = d.offset + d.size, m = n; m < a - 1 && f < s; )
|
|
1714
|
+
m++, f += Te("column", e, m, o).size;
|
|
1701
1715
|
return m;
|
|
1702
1716
|
},
|
|
1703
1717
|
getColumnWidth: function(e, n, r) {
|
|
@@ -1712,7 +1726,7 @@ var hi = function(e, n) {
|
|
|
1712
1726
|
return an("row", e, n, r, o, a, c);
|
|
1713
1727
|
},
|
|
1714
1728
|
getRowOffset: function(e, n, r) {
|
|
1715
|
-
return
|
|
1729
|
+
return Te("row", e, n, r).offset;
|
|
1716
1730
|
},
|
|
1717
1731
|
getRowHeight: function(e, n, r) {
|
|
1718
1732
|
return r.rowMetadataMap[n].size;
|
|
@@ -1721,8 +1735,8 @@ var hi = function(e, n) {
|
|
|
1721
1735
|
return rn("row", e, r, n);
|
|
1722
1736
|
},
|
|
1723
1737
|
getRowStopIndexForStartIndex: function(e, n, r, o) {
|
|
1724
|
-
for (var a = e.rowCount, c = e.height, d =
|
|
1725
|
-
m++, f +=
|
|
1738
|
+
for (var a = e.rowCount, c = e.height, d = Te("row", e, n, o), s = r + c, f = d.offset + d.size, m = n; m < a - 1 && f < s; )
|
|
1739
|
+
m++, f += Te("row", e, m, o).size;
|
|
1726
1740
|
return m;
|
|
1727
1741
|
},
|
|
1728
1742
|
initInstanceProps: function(e, n) {
|
|
@@ -1745,8 +1759,8 @@ var hi = function(e, n) {
|
|
|
1745
1759
|
shouldForceUpdate: s
|
|
1746
1760
|
});
|
|
1747
1761
|
}, n.resetAfterIndices = function(d) {
|
|
1748
|
-
var s = d.columnIndex, f = d.rowIndex, m = d.shouldForceUpdate,
|
|
1749
|
-
typeof s == "number" && (c.lastMeasuredColumnIndex = Math.min(c.lastMeasuredColumnIndex, s - 1)), typeof f == "number" && (c.lastMeasuredRowIndex = Math.min(c.lastMeasuredRowIndex, f - 1)), n._getItemStyleCache(-1),
|
|
1762
|
+
var s = d.columnIndex, f = d.rowIndex, m = d.shouldForceUpdate, T = m === void 0 ? !0 : m;
|
|
1763
|
+
typeof s == "number" && (c.lastMeasuredColumnIndex = Math.min(c.lastMeasuredColumnIndex, s - 1)), typeof f == "number" && (c.lastMeasuredRowIndex = Math.min(c.lastMeasuredRowIndex, f - 1)), n._getItemStyleCache(-1), T && n.forceUpdate();
|
|
1750
1764
|
}, c;
|
|
1751
1765
|
},
|
|
1752
1766
|
shouldResetStyleCacheOnItemSizeChange: !1,
|
|
@@ -1775,148 +1789,148 @@ function wi(t, e) {
|
|
|
1775
1789
|
var n = t.style, r = Jt(t, gi), o = e.style, a = Jt(e, vi);
|
|
1776
1790
|
return !sn(n, o) && !sn(r, a);
|
|
1777
1791
|
}
|
|
1778
|
-
const
|
|
1779
|
-
const { viewMode: t } =
|
|
1780
|
-
if (t ===
|
|
1781
|
-
const
|
|
1792
|
+
const _i = () => {
|
|
1793
|
+
const { viewMode: t } = Ge(), { scrollMode: e } = Ae(), { setColumnCount: n } = vn(), { virtualScrollableElementRef: r } = it(), o = Ke(), a = W(() => o.heights.length, [o.heights]), c = W(() => e === ae.HORIZONTAL_SCROLLING ? a : t === ee.DUAL_PAGE || t === ee.DUAL_PAGE_WITH_COVER ? 2 : 1, [t, e, e, a, r]), d = W(() => {
|
|
1794
|
+
if (t === ee.DUAL_PAGE_WITH_COVER && o.widths.length > 0) {
|
|
1795
|
+
const b = [0, 0];
|
|
1782
1796
|
return o.widths.forEach((g, h) => {
|
|
1783
1797
|
const p = h + 1;
|
|
1784
1798
|
if (p === 1)
|
|
1785
1799
|
return;
|
|
1786
1800
|
const l = p % 2 === 0 ? 0 : 1;
|
|
1787
|
-
|
|
1788
|
-
}),
|
|
1801
|
+
b[l] = Math.max(b[l] || 0, g);
|
|
1802
|
+
}), b;
|
|
1789
1803
|
}
|
|
1790
|
-
return o.widths.reduce((
|
|
1804
|
+
return o.widths.reduce((b, g, h) => {
|
|
1791
1805
|
const p = h % c;
|
|
1792
|
-
return (!
|
|
1806
|
+
return (!b[p] || g > b[p]) && (b[p] = g), b;
|
|
1793
1807
|
}, []);
|
|
1794
|
-
}, [o.widths, c, t]), s =
|
|
1808
|
+
}, [o.widths, c, t]), s = O(
|
|
1795
1809
|
(P) => {
|
|
1796
1810
|
const y = P % d.length;
|
|
1797
1811
|
return d[y] || 0;
|
|
1798
1812
|
},
|
|
1799
1813
|
[d]
|
|
1800
|
-
), f =
|
|
1814
|
+
), f = O(
|
|
1801
1815
|
(P) => {
|
|
1802
|
-
if (t ===
|
|
1816
|
+
if (t === ee.DUAL_PAGE_WITH_COVER) {
|
|
1803
1817
|
if (P === 0)
|
|
1804
1818
|
return o.heights[0] || 0;
|
|
1805
1819
|
const g = 1 + (P - 1) * c + 1, p = Array.from({ length: c }, (l, v) => g + v - 1).filter((l) => l < o.heights.length).map((l) => o.heights[l] || 0);
|
|
1806
1820
|
return Math.max(...p, 0);
|
|
1807
1821
|
}
|
|
1808
|
-
const
|
|
1822
|
+
const b = Array.from({ length: c }, (g, h) => {
|
|
1809
1823
|
const p = P * c + h;
|
|
1810
1824
|
return o.heights[p] || 0;
|
|
1811
1825
|
});
|
|
1812
|
-
return Math.max(...
|
|
1826
|
+
return Math.max(...b);
|
|
1813
1827
|
},
|
|
1814
1828
|
[o.heights, c, t]
|
|
1815
1829
|
);
|
|
1816
|
-
|
|
1830
|
+
z(() => {
|
|
1817
1831
|
n(c);
|
|
1818
1832
|
}, [c, n]);
|
|
1819
|
-
const m = W(() => e ===
|
|
1820
|
-
const P = t ===
|
|
1833
|
+
const m = W(() => e === ae.HORIZONTAL_SCROLLING || e === ae.PAGE_SCROLLING ? 1 : t === ee.DUAL_PAGE_WITH_COVER && a > 0 ? 1 + Math.ceil((a - 1) / c) : Math.round(a / c), [c, a, e, t]), T = W(() => o.heights.reduce((P, y) => P + y, 0) / o.heights.length || 0, [o]), u = W(() => o.widths.reduce((P, y) => P + y, 0) / o.widths.length || 0, [o]), C = W(() => {
|
|
1834
|
+
const P = t === ee.DUAL_PAGE_WITH_COVER, { rowsHeight: y, columnsWidth: b } = Et(o, c, P);
|
|
1821
1835
|
return {
|
|
1822
1836
|
rowsHeight: y,
|
|
1823
|
-
columnsWidth:
|
|
1837
|
+
columnsWidth: b
|
|
1824
1838
|
};
|
|
1825
|
-
}, [o, c, t]),
|
|
1826
|
-
width:
|
|
1827
|
-
height:
|
|
1828
|
-
}), [
|
|
1839
|
+
}, [o, c, t]), w = W(() => ({
|
|
1840
|
+
width: C.columnsWidth.reduce((P, y) => P + y, 0),
|
|
1841
|
+
height: C.rowsHeight.reduce((P, y) => P + y, 0)
|
|
1842
|
+
}), [C]);
|
|
1829
1843
|
return {
|
|
1830
1844
|
rowCount: m,
|
|
1831
1845
|
rowHeight: f,
|
|
1832
1846
|
columnCount: c,
|
|
1833
1847
|
columnWidth: s,
|
|
1834
1848
|
pageDimension: o,
|
|
1835
|
-
estimatedRowHeight:
|
|
1849
|
+
estimatedRowHeight: T,
|
|
1836
1850
|
estimatedColumnWidth: u,
|
|
1837
|
-
gridDimension:
|
|
1838
|
-
totalDimension:
|
|
1851
|
+
gridDimension: C,
|
|
1852
|
+
totalDimension: w
|
|
1839
1853
|
};
|
|
1840
1854
|
};
|
|
1841
|
-
let
|
|
1842
|
-
typeof window < "u" ?
|
|
1855
|
+
let he;
|
|
1856
|
+
typeof window < "u" ? he = window : typeof self < "u" ? he = self : he = global;
|
|
1843
1857
|
let Ct = null, yt = null;
|
|
1844
|
-
const cn = 20, wt =
|
|
1845
|
-
|
|
1858
|
+
const cn = 20, wt = he.clearTimeout, ln = he.setTimeout, _t = he.cancelAnimationFrame || he.mozCancelAnimationFrame || he.webkitCancelAnimationFrame, dn = he.requestAnimationFrame || he.mozRequestAnimationFrame || he.webkitRequestAnimationFrame;
|
|
1859
|
+
_t == null || dn == null ? (Ct = wt, yt = function(e) {
|
|
1846
1860
|
return ln(e, cn);
|
|
1847
1861
|
}) : (Ct = function([e, n]) {
|
|
1848
|
-
|
|
1862
|
+
_t(e), wt(n);
|
|
1849
1863
|
}, yt = function(e) {
|
|
1850
1864
|
const n = dn(function() {
|
|
1851
1865
|
wt(r), e();
|
|
1852
1866
|
}), r = ln(function() {
|
|
1853
|
-
|
|
1867
|
+
_t(n), e();
|
|
1854
1868
|
}, cn);
|
|
1855
1869
|
return [n, r];
|
|
1856
1870
|
});
|
|
1857
|
-
function
|
|
1871
|
+
function bi(t) {
|
|
1858
1872
|
let e, n, r, o, a, c, d;
|
|
1859
1873
|
const s = typeof document < "u" && document.attachEvent;
|
|
1860
1874
|
if (!s) {
|
|
1861
|
-
c = function(
|
|
1862
|
-
const g =
|
|
1875
|
+
c = function(b) {
|
|
1876
|
+
const g = b.__resizeTriggers__, h = g.firstElementChild, p = g.lastElementChild, l = h.firstElementChild;
|
|
1863
1877
|
p.scrollLeft = p.scrollWidth, p.scrollTop = p.scrollHeight, l.style.width = h.offsetWidth + 1 + "px", l.style.height = h.offsetHeight + 1 + "px", h.scrollLeft = h.scrollWidth, h.scrollTop = h.scrollHeight;
|
|
1864
|
-
}, a = function(
|
|
1865
|
-
return
|
|
1866
|
-
}, d = function(
|
|
1867
|
-
if (
|
|
1878
|
+
}, a = function(b) {
|
|
1879
|
+
return b.offsetWidth !== b.__resizeLast__.width || b.offsetHeight !== b.__resizeLast__.height;
|
|
1880
|
+
}, d = function(b) {
|
|
1881
|
+
if (b.target.className && typeof b.target.className.indexOf == "function" && b.target.className.indexOf("contract-trigger") < 0 && b.target.className.indexOf("expand-trigger") < 0)
|
|
1868
1882
|
return;
|
|
1869
1883
|
const g = this;
|
|
1870
1884
|
c(this), this.__resizeRAF__ && Ct(this.__resizeRAF__), this.__resizeRAF__ = yt(function() {
|
|
1871
1885
|
a(g) && (g.__resizeLast__.width = g.offsetWidth, g.__resizeLast__.height = g.offsetHeight, g.__resizeListeners__.forEach(function(l) {
|
|
1872
|
-
l.call(g,
|
|
1886
|
+
l.call(g, b);
|
|
1873
1887
|
}));
|
|
1874
1888
|
});
|
|
1875
1889
|
};
|
|
1876
|
-
let u = !1,
|
|
1890
|
+
let u = !1, C = "";
|
|
1877
1891
|
r = "animationstart";
|
|
1878
|
-
const
|
|
1892
|
+
const w = "Webkit Moz O ms".split(" ");
|
|
1879
1893
|
let P = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "), y = "";
|
|
1880
1894
|
{
|
|
1881
|
-
const
|
|
1882
|
-
if (
|
|
1883
|
-
for (let g = 0; g <
|
|
1884
|
-
if (
|
|
1885
|
-
y =
|
|
1895
|
+
const b = document.createElement("fakeelement");
|
|
1896
|
+
if (b.style.animationName !== void 0 && (u = !0), u === !1) {
|
|
1897
|
+
for (let g = 0; g < w.length; g++)
|
|
1898
|
+
if (b.style[w[g] + "AnimationName"] !== void 0) {
|
|
1899
|
+
y = w[g], C = "-" + y.toLowerCase() + "-", r = P[g], u = !0;
|
|
1886
1900
|
break;
|
|
1887
1901
|
}
|
|
1888
1902
|
}
|
|
1889
1903
|
}
|
|
1890
|
-
n = "resizeanim", e = "@" +
|
|
1904
|
+
n = "resizeanim", e = "@" + C + "keyframes " + n + " { from { opacity: 0; } to { opacity: 0; } } ", o = C + "animation: 1ms " + n + "; ";
|
|
1891
1905
|
}
|
|
1892
1906
|
const f = function(u) {
|
|
1893
1907
|
if (!u.getElementById("detectElementResize")) {
|
|
1894
|
-
const
|
|
1895
|
-
P.id = "detectElementResize", P.type = "text/css", t != null && P.setAttribute("nonce", t), P.styleSheet ? P.styleSheet.cssText =
|
|
1908
|
+
const C = (e || "") + ".resize-triggers { " + (o || "") + 'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }', w = u.head || u.getElementsByTagName("head")[0], P = u.createElement("style");
|
|
1909
|
+
P.id = "detectElementResize", P.type = "text/css", t != null && P.setAttribute("nonce", t), P.styleSheet ? P.styleSheet.cssText = C : P.appendChild(u.createTextNode(C)), w.appendChild(P);
|
|
1896
1910
|
}
|
|
1897
1911
|
};
|
|
1898
1912
|
return {
|
|
1899
|
-
addResizeListener: function(u,
|
|
1913
|
+
addResizeListener: function(u, C) {
|
|
1900
1914
|
if (s)
|
|
1901
|
-
u.attachEvent("onresize",
|
|
1915
|
+
u.attachEvent("onresize", C);
|
|
1902
1916
|
else {
|
|
1903
1917
|
if (!u.__resizeTriggers__) {
|
|
1904
|
-
const
|
|
1905
|
-
P && P.position === "static" && (u.style.position = "relative"), f(
|
|
1906
|
-
const y =
|
|
1907
|
-
y.className = "expand-trigger", y.appendChild(
|
|
1908
|
-
const
|
|
1909
|
-
|
|
1918
|
+
const w = u.ownerDocument, P = he.getComputedStyle(u);
|
|
1919
|
+
P && P.position === "static" && (u.style.position = "relative"), f(w), u.__resizeLast__ = {}, u.__resizeListeners__ = [], (u.__resizeTriggers__ = w.createElement("div")).className = "resize-triggers";
|
|
1920
|
+
const y = w.createElement("div");
|
|
1921
|
+
y.className = "expand-trigger", y.appendChild(w.createElement("div"));
|
|
1922
|
+
const b = w.createElement("div");
|
|
1923
|
+
b.className = "contract-trigger", u.__resizeTriggers__.appendChild(y), u.__resizeTriggers__.appendChild(b), u.appendChild(u.__resizeTriggers__), c(u), u.addEventListener("scroll", d, !0), r && (u.__resizeTriggers__.__animationListener__ = function(h) {
|
|
1910
1924
|
h.animationName === n && c(u);
|
|
1911
1925
|
}, u.__resizeTriggers__.addEventListener(r, u.__resizeTriggers__.__animationListener__));
|
|
1912
1926
|
}
|
|
1913
|
-
u.__resizeListeners__.push(
|
|
1927
|
+
u.__resizeListeners__.push(C);
|
|
1914
1928
|
}
|
|
1915
1929
|
},
|
|
1916
|
-
removeResizeListener: function(u,
|
|
1930
|
+
removeResizeListener: function(u, C) {
|
|
1917
1931
|
if (s)
|
|
1918
|
-
u.detachEvent("onresize",
|
|
1919
|
-
else if (u.__resizeListeners__.splice(u.__resizeListeners__.indexOf(
|
|
1932
|
+
u.detachEvent("onresize", C);
|
|
1933
|
+
else if (u.__resizeListeners__.splice(u.__resizeListeners__.indexOf(C), 1), !u.__resizeListeners__.length) {
|
|
1920
1934
|
u.removeEventListener("scroll", d, !0), u.__resizeTriggers__.__animationListener__ && (u.__resizeTriggers__.removeEventListener(r, u.__resizeTriggers__.__animationListener__), u.__resizeTriggers__.__animationListener__ = null);
|
|
1921
1935
|
try {
|
|
1922
1936
|
u.__resizeTriggers__ = !u.removeChild(u.__resizeTriggers__);
|
|
@@ -1939,24 +1953,24 @@ class Pi extends fo {
|
|
|
1939
1953
|
onResize: o
|
|
1940
1954
|
} = this.props;
|
|
1941
1955
|
if (this._parentNode) {
|
|
1942
|
-
const a = window.getComputedStyle(this._parentNode) || {}, c = parseFloat(a.paddingLeft || "0"), d = parseFloat(a.paddingRight || "0"), s = parseFloat(a.paddingTop || "0"), f = parseFloat(a.paddingBottom || "0"), m = this._parentNode.getBoundingClientRect(),
|
|
1943
|
-
if (!n && this.state.height !==
|
|
1956
|
+
const a = window.getComputedStyle(this._parentNode) || {}, c = parseFloat(a.paddingLeft || "0"), d = parseFloat(a.paddingRight || "0"), s = parseFloat(a.paddingTop || "0"), f = parseFloat(a.paddingBottom || "0"), m = this._parentNode.getBoundingClientRect(), T = m.height - s - f, u = m.width - c - d;
|
|
1957
|
+
if (!n && this.state.height !== T || !r && this.state.width !== u) {
|
|
1944
1958
|
this.setState({
|
|
1945
|
-
height:
|
|
1959
|
+
height: T,
|
|
1946
1960
|
width: u
|
|
1947
1961
|
});
|
|
1948
|
-
const
|
|
1962
|
+
const C = () => {
|
|
1949
1963
|
this._didLogDeprecationWarning || (this._didLogDeprecationWarning = !0, console.warn("scaledWidth and scaledHeight parameters have been deprecated; use width and height instead"));
|
|
1950
1964
|
};
|
|
1951
1965
|
typeof o == "function" && o({
|
|
1952
|
-
height:
|
|
1966
|
+
height: T,
|
|
1953
1967
|
width: u,
|
|
1954
1968
|
// TODO Remove these params in the next major release
|
|
1955
1969
|
get scaledHeight() {
|
|
1956
|
-
return
|
|
1970
|
+
return C(), T;
|
|
1957
1971
|
},
|
|
1958
1972
|
get scaledWidth() {
|
|
1959
|
-
return
|
|
1973
|
+
return C(), u;
|
|
1960
1974
|
}
|
|
1961
1975
|
});
|
|
1962
1976
|
}
|
|
@@ -1974,7 +1988,7 @@ class Pi extends fo {
|
|
|
1974
1988
|
const r = n.ownerDocument.defaultView.ResizeObserver;
|
|
1975
1989
|
r != null ? (this._resizeObserver = new r(() => {
|
|
1976
1990
|
this._timeoutId = setTimeout(this._onResize, 0);
|
|
1977
|
-
}), this._resizeObserver.observe(n)) : (this._detectElementResize =
|
|
1991
|
+
}), this._resizeObserver.observe(n)) : (this._detectElementResize = bi(e), this._detectElementResize.addResizeListener(n, this._onResize)), this._onResize();
|
|
1978
1992
|
}
|
|
1979
1993
|
}
|
|
1980
1994
|
componentWillUnmount() {
|
|
@@ -1992,26 +2006,26 @@ class Pi extends fo {
|
|
|
1992
2006
|
onResize: s,
|
|
1993
2007
|
style: f = {},
|
|
1994
2008
|
tagName: m = "div",
|
|
1995
|
-
...
|
|
2009
|
+
...T
|
|
1996
2010
|
} = this.props, {
|
|
1997
2011
|
height: u,
|
|
1998
|
-
width:
|
|
1999
|
-
} = this.state,
|
|
2012
|
+
width: C
|
|
2013
|
+
} = this.state, w = {
|
|
2000
2014
|
overflow: "visible"
|
|
2001
2015
|
}, P = {};
|
|
2002
2016
|
let y = !1;
|
|
2003
|
-
return o || (u === 0 && (y = !0),
|
|
2017
|
+
return o || (u === 0 && (y = !0), w.height = 0, P.height = u, P.scaledHeight = u), a || (C === 0 && (y = !0), w.width = 0, P.width = C, P.scaledWidth = C), c && (y = !1), Ye(m, {
|
|
2004
2018
|
ref: this._setRef,
|
|
2005
2019
|
style: {
|
|
2006
|
-
...
|
|
2020
|
+
...w,
|
|
2007
2021
|
...f
|
|
2008
2022
|
},
|
|
2009
|
-
...
|
|
2023
|
+
...T
|
|
2010
2024
|
}, !y && e(P));
|
|
2011
2025
|
}
|
|
2012
2026
|
}
|
|
2013
2027
|
const Ti = It(({ widths: t, heights: e }) => {
|
|
2014
|
-
const { focusedPage: n, totalPages: r } =
|
|
2028
|
+
const { focusedPage: n, totalPages: r } = de(), o = W(() => {
|
|
2015
2029
|
const d = [], s = Math.ceil(n / 2) * 2 - 1;
|
|
2016
2030
|
if (d.push(s), s + 1 <= r) {
|
|
2017
2031
|
const f = s + 1;
|
|
@@ -2019,7 +2033,7 @@ const Ti = It(({ widths: t, heights: e }) => {
|
|
|
2019
2033
|
}
|
|
2020
2034
|
return d;
|
|
2021
2035
|
}, [n, r]), a = W(() => {
|
|
2022
|
-
const d = n % 2 === 1 ? n - 1 : n - 2, s = Math.floor(d / 2), f = e(s), m = t(d),
|
|
2036
|
+
const d = n % 2 === 1 ? n - 1 : n - 2, s = Math.floor(d / 2), f = e(s), m = t(d), T = t(d + 1);
|
|
2023
2037
|
return [
|
|
2024
2038
|
{
|
|
2025
2039
|
position: "absolute",
|
|
@@ -2030,14 +2044,14 @@ const Ti = It(({ widths: t, heights: e }) => {
|
|
|
2030
2044
|
{
|
|
2031
2045
|
position: "absolute",
|
|
2032
2046
|
left: m,
|
|
2033
|
-
width:
|
|
2047
|
+
width: T,
|
|
2034
2048
|
height: f
|
|
2035
2049
|
}
|
|
2036
2050
|
];
|
|
2037
2051
|
}, [t, e, o]), c = W(() => a.reduce((d, s) => d + Number(s.width || 0), 0), [a]);
|
|
2038
|
-
return /* @__PURE__ */ i("div", { style: { width: c, position: "relative" }, children: o.map((d, s) => /* @__PURE__ */ i(
|
|
2052
|
+
return /* @__PURE__ */ i("div", { style: { width: c, position: "relative" }, children: o.map((d, s) => /* @__PURE__ */ i($e, { style: a[s], pageNumber: d }, d)) });
|
|
2039
2053
|
}), Ci = It(({ widths: t, heights: e }) => {
|
|
2040
|
-
const { focusedPage: n, totalPages: r } =
|
|
2054
|
+
const { focusedPage: n, totalPages: r } = de(), o = W(() => {
|
|
2041
2055
|
const d = [];
|
|
2042
2056
|
if (n === 1)
|
|
2043
2057
|
return d.push(1), d;
|
|
@@ -2045,14 +2059,14 @@ const Ti = It(({ widths: t, heights: e }) => {
|
|
|
2045
2059
|
return d.push(m), m + 1 <= r && d.push(m + 1), d;
|
|
2046
2060
|
}, [n, r]), a = W(() => {
|
|
2047
2061
|
if (o.length === 1) {
|
|
2048
|
-
const
|
|
2049
|
-
let P =
|
|
2062
|
+
const C = o[0] - 1, w = t(C);
|
|
2063
|
+
let P = w * 2;
|
|
2050
2064
|
if (r >= 3) {
|
|
2051
|
-
const y = t(1),
|
|
2052
|
-
P = y +
|
|
2065
|
+
const y = t(1), b = t(2);
|
|
2066
|
+
P = y + b;
|
|
2053
2067
|
} else if (r >= 2) {
|
|
2054
2068
|
const y = t(1);
|
|
2055
|
-
P =
|
|
2069
|
+
P = w + y;
|
|
2056
2070
|
}
|
|
2057
2071
|
return {
|
|
2058
2072
|
width: P,
|
|
@@ -2069,7 +2083,7 @@ const Ti = It(({ widths: t, heights: e }) => {
|
|
|
2069
2083
|
};
|
|
2070
2084
|
}, [t, o, r]), c = W(() => {
|
|
2071
2085
|
if (o.length === 1) {
|
|
2072
|
-
const
|
|
2086
|
+
const w = o[0], P = w - 1, y = e(w === 1 ? 0 : Math.floor((w - 2) / 2) + 1);
|
|
2073
2087
|
return [{
|
|
2074
2088
|
width: t(P),
|
|
2075
2089
|
height: y,
|
|
@@ -2077,25 +2091,25 @@ const Ti = It(({ widths: t, heights: e }) => {
|
|
|
2077
2091
|
// Use relative for flexbox centering
|
|
2078
2092
|
}];
|
|
2079
2093
|
}
|
|
2080
|
-
const d = o[0], s = d - 1, f = Math.floor((d - 2) / 2) + 1, m = e(f),
|
|
2094
|
+
const d = o[0], s = d - 1, f = Math.floor((d - 2) / 2) + 1, m = e(f), T = t(s), u = t(s + 1);
|
|
2081
2095
|
return [
|
|
2082
2096
|
{
|
|
2083
2097
|
position: "absolute",
|
|
2084
2098
|
left: 0,
|
|
2085
|
-
width:
|
|
2099
|
+
width: T,
|
|
2086
2100
|
height: m
|
|
2087
2101
|
},
|
|
2088
2102
|
{
|
|
2089
2103
|
position: "absolute",
|
|
2090
|
-
left:
|
|
2104
|
+
left: T,
|
|
2091
2105
|
width: u,
|
|
2092
2106
|
height: m
|
|
2093
2107
|
}
|
|
2094
2108
|
];
|
|
2095
2109
|
}, [t, e, o]);
|
|
2096
|
-
return /* @__PURE__ */ i("div", { style: a, children: o.map((d, s) => /* @__PURE__ */ i(
|
|
2110
|
+
return /* @__PURE__ */ i("div", { style: a, children: o.map((d, s) => /* @__PURE__ */ i($e, { style: c[s], pageNumber: d }, d)) });
|
|
2097
2111
|
}), yi = ({ widths: t, heights: e }) => {
|
|
2098
|
-
const { focusedPage: n } =
|
|
2112
|
+
const { focusedPage: n } = de(), r = W(() => ({
|
|
2099
2113
|
position: "absolute",
|
|
2100
2114
|
width: t(n - 1),
|
|
2101
2115
|
height: e(n - 1)
|
|
@@ -2107,14 +2121,14 @@ const Ti = It(({ widths: t, heights: e }) => {
|
|
|
2107
2121
|
width: o,
|
|
2108
2122
|
position: "relative"
|
|
2109
2123
|
},
|
|
2110
|
-
children: /* @__PURE__ */ i(
|
|
2124
|
+
children: /* @__PURE__ */ i($e, { style: r, pageNumber: n }, n)
|
|
2111
2125
|
}
|
|
2112
2126
|
);
|
|
2113
2127
|
}, Ii = (t, e, n, r) => {
|
|
2114
|
-
const o = M(), { contentRef: a } =
|
|
2115
|
-
const P = r ===
|
|
2128
|
+
const o = M(), { contentRef: a } = Ce(), { heights: c, widths: d } = Ke(), { setFocusedPage: s } = de(), [f, m] = H([]), { targetScrollPage: T } = wn(), u = Nt(f, 0, 500), C = W(() => {
|
|
2129
|
+
const P = r === ee.DUAL_PAGE_WITH_COVER, { rowsHeight: y, columnsWidth: b } = Et({ heights: c, widths: d }, t, P);
|
|
2116
2130
|
return c.map((g, h) => {
|
|
2117
|
-
const p = d[h], l = lr(h + 1, t, P), v =
|
|
2131
|
+
const p = d[h], l = lr(h + 1, t, P), v = b.slice(0, l.columnIndex).reduce((S, R) => S + R, 0), _ = y.slice(0, l.rowIndex).reduce((S, R) => S + R, 0), I = v + p, x = _ + g;
|
|
2118
2132
|
return {
|
|
2119
2133
|
pageNumber: h + 1,
|
|
2120
2134
|
...l,
|
|
@@ -2123,29 +2137,29 @@ const Ti = It(({ widths: t, heights: e }) => {
|
|
|
2123
2137
|
startX: v,
|
|
2124
2138
|
startY: _,
|
|
2125
2139
|
endX: I,
|
|
2126
|
-
endY:
|
|
2140
|
+
endY: x
|
|
2127
2141
|
};
|
|
2128
2142
|
});
|
|
2129
2143
|
}, [c, d, t, e, r]);
|
|
2130
|
-
|
|
2144
|
+
z(() => {
|
|
2131
2145
|
var y;
|
|
2132
|
-
u.length > 0 && !
|
|
2133
|
-
|
|
2146
|
+
u.length > 0 && !T.current && s(u[0].pageNumber), ((y = u[0]) == null ? void 0 : y.ratio) && u.some((b) => b.pageNumber === T.current) && setTimeout(() => {
|
|
2147
|
+
T.current = void 0;
|
|
2134
2148
|
}, 500);
|
|
2135
2149
|
}, [u, s]);
|
|
2136
|
-
const
|
|
2150
|
+
const w = O(
|
|
2137
2151
|
(P) => {
|
|
2138
2152
|
o.current && cancelAnimationFrame(o.current), o.current = requestAnimationFrame(() => {
|
|
2139
|
-
const y = P.target,
|
|
2153
|
+
const y = P.target, b = {
|
|
2140
2154
|
startTop: y.scrollTop,
|
|
2141
2155
|
startLeft: y.scrollLeft,
|
|
2142
2156
|
endTop: y.scrollTop + y.clientHeight,
|
|
2143
2157
|
endLeft: y.scrollLeft + y.clientWidth
|
|
2144
|
-
}, g =
|
|
2145
|
-
const p = h.endX >=
|
|
2158
|
+
}, g = C.filter((h) => {
|
|
2159
|
+
const p = h.endX >= b.startLeft && h.endY >= b.startTop, l = h.startX <= b.endLeft && h.startY <= b.endTop;
|
|
2146
2160
|
return p && l;
|
|
2147
2161
|
}).map((h) => {
|
|
2148
|
-
const p =
|
|
2162
|
+
const p = b.startLeft > h.startX ? b.startLeft : h.startX, l = b.startTop > h.startY ? b.startTop : h.startY, v = b.endLeft < h.endX ? b.endLeft : h.endX, _ = b.endTop < h.endY ? b.endTop : h.endY, I = v - p, x = _ - l, R = +(I * x / (h.width * h.height) * 100).toFixed(2);
|
|
2149
2163
|
return {
|
|
2150
2164
|
pageNumber: h.pageNumber,
|
|
2151
2165
|
ratio: R
|
|
@@ -2154,22 +2168,22 @@ const Ti = It(({ widths: t, heights: e }) => {
|
|
|
2154
2168
|
m(g);
|
|
2155
2169
|
});
|
|
2156
2170
|
},
|
|
2157
|
-
[a,
|
|
2171
|
+
[a, C]
|
|
2158
2172
|
);
|
|
2159
|
-
|
|
2173
|
+
z(() => {
|
|
2160
2174
|
if (n)
|
|
2161
|
-
return n == null || n.addEventListener("scroll",
|
|
2162
|
-
n == null || n.removeEventListener("scroll",
|
|
2175
|
+
return n == null || n.addEventListener("scroll", w), () => {
|
|
2176
|
+
n == null || n.removeEventListener("scroll", w);
|
|
2163
2177
|
};
|
|
2164
|
-
}, [n,
|
|
2165
|
-
}, zn =
|
|
2166
|
-
const { children: n, toolbarRef: r, style: o, className: a, ...c } = t, { customVariables: d, customDarkVariables: s } = zo(), { darkMode: f } =
|
|
2178
|
+
}, [n, w]);
|
|
2179
|
+
}, zn = st((t, e) => {
|
|
2180
|
+
const { children: n, toolbarRef: r, style: o, className: a, ...c } = t, { customVariables: d, customDarkVariables: s } = zo(), { darkMode: f } = bo();
|
|
2167
2181
|
return /* @__PURE__ */ i(
|
|
2168
2182
|
"div",
|
|
2169
2183
|
{
|
|
2170
2184
|
ref: e,
|
|
2171
2185
|
...c,
|
|
2172
|
-
className:
|
|
2186
|
+
className: le(
|
|
2173
2187
|
Ie["rp-theme-variables"],
|
|
2174
2188
|
Ie["rp-container"],
|
|
2175
2189
|
f ? Ie["rp-dark-mode"] : "",
|
|
@@ -2207,7 +2221,7 @@ const Ti = It(({ widths: t, heights: e }) => {
|
|
|
2207
2221
|
justifyContent: "center",
|
|
2208
2222
|
alignItems: "flex-start"
|
|
2209
2223
|
},
|
|
2210
|
-
children: /* @__PURE__ */ i(
|
|
2224
|
+
children: /* @__PURE__ */ i($e, { style: { position: "relative" }, pageNumber: o }, o)
|
|
2211
2225
|
}
|
|
2212
2226
|
);
|
|
2213
2227
|
}
|
|
@@ -2221,103 +2235,103 @@ const Ti = It(({ widths: t, heights: e }) => {
|
|
|
2221
2235
|
justifyContent: t === 0 ? "flex-end" : "flex-start",
|
|
2222
2236
|
alignItems: "flex-start"
|
|
2223
2237
|
},
|
|
2224
|
-
children: /* @__PURE__ */ i(
|
|
2238
|
+
children: /* @__PURE__ */ i($e, { style: { position: "relative" }, pageNumber: o }, o)
|
|
2225
2239
|
}
|
|
2226
|
-
) : /* @__PURE__ */ i(
|
|
2240
|
+
) : /* @__PURE__ */ i($e, { style: r, pageNumber: o }, o);
|
|
2227
2241
|
}, wi), Sc = () => {
|
|
2228
|
-
const { initialPage: t = 1, initialScrollMode: e, instanceId: n } = xt(), { pagesRef: r, setPagesRef: o, setContentRef: a } =
|
|
2242
|
+
const { initialPage: t = 1, initialScrollMode: e, instanceId: n } = xt(), { pagesRef: r, setPagesRef: o, setContentRef: a } = Ce(), { scrollToPage: c } = yn();
|
|
2229
2243
|
mr(r);
|
|
2230
2244
|
const {
|
|
2231
2245
|
virtualScrollRef: d,
|
|
2232
2246
|
getVirtualScrollRef: s,
|
|
2233
2247
|
getPageScrollElementRef: f,
|
|
2234
2248
|
getVirtualScrollableElementRef: m,
|
|
2235
|
-
setTotalInnerDimensions:
|
|
2249
|
+
setTotalInnerDimensions: T,
|
|
2236
2250
|
virtualScrollableElementRef: u,
|
|
2237
|
-
totalInnerDimensions:
|
|
2238
|
-
pageScrollElementRef:
|
|
2239
|
-
} =
|
|
2240
|
-
|
|
2241
|
-
),
|
|
2251
|
+
totalInnerDimensions: C,
|
|
2252
|
+
pageScrollElementRef: w
|
|
2253
|
+
} = it(), P = M(!0), { nextPage: y, prevPage: b, setFocusedPage: g, focusedPage: h, totalPages: p } = de(), { scrollMode: l } = Ae(), { viewMode: v } = Ge(), _ = M(null), { loading: I, error: x } = re(), { passwordRequired: S } = _o(), { LoaderImageComponent: R } = St(), N = M(
|
|
2254
|
+
C
|
|
2255
|
+
), A = M({
|
|
2242
2256
|
viewMode: v,
|
|
2243
2257
|
scrollMode: l
|
|
2244
|
-
}),
|
|
2245
|
-
pageDimension:
|
|
2246
|
-
rowCount:
|
|
2247
|
-
rowHeight:
|
|
2248
|
-
columnCount:
|
|
2249
|
-
columnWidth:
|
|
2250
|
-
estimatedColumnWidth:
|
|
2251
|
-
estimatedRowHeight:
|
|
2252
|
-
totalDimension:
|
|
2253
|
-
} =
|
|
2254
|
-
gr({ onTextSelect:
|
|
2255
|
-
const
|
|
2256
|
-
Ii(
|
|
2258
|
+
}), F = M(!1), D = M(), { isFullScreen: L } = Co(), {
|
|
2259
|
+
pageDimension: E,
|
|
2260
|
+
rowCount: U,
|
|
2261
|
+
rowHeight: V,
|
|
2262
|
+
columnCount: $,
|
|
2263
|
+
columnWidth: q,
|
|
2264
|
+
estimatedColumnWidth: j,
|
|
2265
|
+
estimatedRowHeight: te,
|
|
2266
|
+
totalDimension: G
|
|
2267
|
+
} = _i(), Y = Nt(C, 100), { onScroll: J, onTextSelect: me } = Ao();
|
|
2268
|
+
gr({ onTextSelect: me, pagesRef: r });
|
|
2269
|
+
const ne = M();
|
|
2270
|
+
Ii($, U, u, v);
|
|
2257
2271
|
const Q = M({
|
|
2258
2272
|
scrollTop: 0,
|
|
2259
2273
|
scrollLeft: 0
|
|
2260
2274
|
});
|
|
2261
2275
|
hr(r);
|
|
2262
|
-
const { isPressed:
|
|
2263
|
-
isPressed:
|
|
2264
|
-
}), Le = W(() =>
|
|
2265
|
-
const
|
|
2276
|
+
const { isPressed: ie } = ur(), { selectionMode: se } = To(), { initializeGrabScroll: ce, resetGrabState: ze } = pr({
|
|
2277
|
+
isPressed: ie
|
|
2278
|
+
}), Le = W(() => se === vo.HAND, [se]), oo = W(() => {
|
|
2279
|
+
const B = Array.from({ length: $ }, (Z, be) => q(be));
|
|
2266
2280
|
return {
|
|
2267
|
-
columnCount:
|
|
2268
|
-
isDualPageWithCover: v ===
|
|
2269
|
-
columnWidths:
|
|
2281
|
+
columnCount: $,
|
|
2282
|
+
isDualPageWithCover: v === ee.DUAL_PAGE_WITH_COVER,
|
|
2283
|
+
columnWidths: B,
|
|
2270
2284
|
totalPages: p
|
|
2271
2285
|
};
|
|
2272
|
-
}, [
|
|
2273
|
-
(
|
|
2274
|
-
const
|
|
2275
|
-
!L &&
|
|
2286
|
+
}, [$, v, q, p]), dt = O(
|
|
2287
|
+
(B) => {
|
|
2288
|
+
const Z = document.activeElement !== r;
|
|
2289
|
+
!L && Z || (["ArrowUp", "ArrowLeft"].includes(B.key) ? (B.preventDefault(), b()) : ["ArrowDown", "ArrowRight"].includes(B.key) && (B.preventDefault(), y()));
|
|
2276
2290
|
},
|
|
2277
|
-
[y,
|
|
2291
|
+
[y, b, L, l]
|
|
2278
2292
|
);
|
|
2279
|
-
|
|
2293
|
+
z(() => (window.addEventListener("keydown", dt), () => {
|
|
2280
2294
|
window.removeEventListener("keydown", dt);
|
|
2281
|
-
}), [dt]),
|
|
2295
|
+
}), [dt]), z(() => {
|
|
2282
2296
|
if (_.current && (_.current.style.position = "relative"), !!d)
|
|
2283
|
-
for (let
|
|
2284
|
-
for (let
|
|
2297
|
+
for (let B = 0; B < U; B++)
|
|
2298
|
+
for (let Z = 0; Z < $; Z++)
|
|
2285
2299
|
d.resetAfterIndices({
|
|
2286
|
-
columnIndex:
|
|
2287
|
-
rowIndex:
|
|
2300
|
+
columnIndex: Z,
|
|
2301
|
+
rowIndex: B,
|
|
2288
2302
|
shouldForceUpdate: !0
|
|
2289
2303
|
});
|
|
2290
|
-
}, [
|
|
2291
|
-
const ro =
|
|
2292
|
-
(
|
|
2304
|
+
}, [U, $, E, d]);
|
|
2305
|
+
const ro = O(
|
|
2306
|
+
(B, Z) => {
|
|
2293
2307
|
if (!u)
|
|
2294
2308
|
return { scrollTop: 0, scrollLeft: 0 };
|
|
2295
|
-
const be = Q.current.scrollTop >
|
|
2309
|
+
const be = Q.current.scrollTop > Z, Ee = Q.current.scrollLeft > B;
|
|
2296
2310
|
return be || Ee ? Q.current : {
|
|
2297
2311
|
scrollTop: u.scrollTop,
|
|
2298
2312
|
scrollLeft: u.scrollLeft
|
|
2299
2313
|
};
|
|
2300
2314
|
},
|
|
2301
2315
|
[u]
|
|
2302
|
-
), kt =
|
|
2303
|
-
(
|
|
2304
|
-
if (
|
|
2305
|
-
|
|
2316
|
+
), kt = O(
|
|
2317
|
+
(B, Z) => {
|
|
2318
|
+
if (A.current.viewMode !== v || A.current.scrollMode !== l) {
|
|
2319
|
+
ne.current && clearTimeout(ne.current), F.current = !0, c(h, "auto"), ne.current = setTimeout(() => {
|
|
2306
2320
|
requestAnimationFrame(() => {
|
|
2307
|
-
|
|
2321
|
+
A.current = { viewMode: v, scrollMode: l };
|
|
2308
2322
|
});
|
|
2309
2323
|
}, 100);
|
|
2310
2324
|
return;
|
|
2311
2325
|
}
|
|
2312
|
-
const Ee =
|
|
2313
|
-
if (!
|
|
2326
|
+
const Ee = B.scrollTop, ut = B.scrollLeft;
|
|
2327
|
+
if (!Z.height || !Z.width)
|
|
2314
2328
|
return;
|
|
2315
|
-
|
|
2316
|
-
const { height: Ne, width: pt } =
|
|
2329
|
+
F.current = !0;
|
|
2330
|
+
const { height: Ne, width: pt } = Z, { height: Mt, width: Ht } = N.current;
|
|
2317
2331
|
if (Mt === Ne && Ht === pt)
|
|
2318
2332
|
return;
|
|
2319
2333
|
const co = Ee / Mt * Ne, lo = ut / Ht * pt, uo = Math.round(Math.min(co, Ne)) || 0, po = Math.round(Math.min(lo, pt)) || 0;
|
|
2320
|
-
|
|
2334
|
+
D.current = setTimeout(() => {
|
|
2321
2335
|
requestAnimationFrame(() => {
|
|
2322
2336
|
u == null || u.scrollTo({
|
|
2323
2337
|
top: uo,
|
|
@@ -2325,62 +2339,62 @@ const Ti = It(({ widths: t, heights: e }) => {
|
|
|
2325
2339
|
behavior: "auto"
|
|
2326
2340
|
});
|
|
2327
2341
|
});
|
|
2328
|
-
}, 0),
|
|
2329
|
-
height:
|
|
2330
|
-
width:
|
|
2342
|
+
}, 0), N.current = {
|
|
2343
|
+
height: Z.height,
|
|
2344
|
+
width: Z.width
|
|
2331
2345
|
};
|
|
2332
2346
|
},
|
|
2333
2347
|
[u, v, l, c]
|
|
2334
2348
|
);
|
|
2335
|
-
|
|
2336
|
-
clearTimeout(
|
|
2337
|
-
const
|
|
2338
|
-
(Ee, ut, Ne) => Ee +
|
|
2349
|
+
z(() => {
|
|
2350
|
+
clearTimeout(D.current);
|
|
2351
|
+
const B = Array.from({ length: U }).reduce(
|
|
2352
|
+
(Ee, ut, Ne) => Ee + V(Ne),
|
|
2339
2353
|
0
|
|
2340
|
-
),
|
|
2341
|
-
(Ee, ut, Ne) => Ee +
|
|
2354
|
+
), Z = Array.from({ length: $ }).reduce(
|
|
2355
|
+
(Ee, ut, Ne) => Ee + q(Ne),
|
|
2342
2356
|
0
|
|
2343
|
-
), be = ro(
|
|
2344
|
-
Q.current = be, kt(be, { height:
|
|
2345
|
-
height:
|
|
2346
|
-
width:
|
|
2357
|
+
), be = ro(Z, B);
|
|
2358
|
+
Q.current = be, kt(be, { height: B, width: Z }), T({
|
|
2359
|
+
height: B,
|
|
2360
|
+
width: Z
|
|
2347
2361
|
});
|
|
2348
|
-
}, [
|
|
2349
|
-
const io =
|
|
2350
|
-
(
|
|
2362
|
+
}, [E, U, $, kt]);
|
|
2363
|
+
const io = O(
|
|
2364
|
+
(B) => {
|
|
2351
2365
|
Q.current = {
|
|
2352
|
-
scrollTop:
|
|
2353
|
-
scrollLeft:
|
|
2366
|
+
scrollTop: B.scrollTop,
|
|
2367
|
+
scrollLeft: B.scrollLeft
|
|
2354
2368
|
};
|
|
2355
2369
|
},
|
|
2356
2370
|
[u]
|
|
2357
2371
|
);
|
|
2358
|
-
|
|
2372
|
+
z(() => {
|
|
2359
2373
|
if (J)
|
|
2360
|
-
return
|
|
2361
|
-
|
|
2374
|
+
return w && w.addEventListener("scroll", J), u && u.addEventListener("scroll", J), () => {
|
|
2375
|
+
w == null || w.removeEventListener("scroll", J), u == null || u.removeEventListener("scroll", J);
|
|
2362
2376
|
};
|
|
2363
|
-
}, [u,
|
|
2364
|
-
|
|
2377
|
+
}, [u, w, J]), z(() => () => {
|
|
2378
|
+
ne.current && clearTimeout(ne.current);
|
|
2365
2379
|
}, []);
|
|
2366
|
-
const ao = W(() =>
|
|
2367
|
-
[
|
|
2368
|
-
[
|
|
2369
|
-
}), [Le,
|
|
2370
|
-
(
|
|
2371
|
-
if (Le &&
|
|
2372
|
-
const
|
|
2373
|
-
|
|
2380
|
+
const ao = W(() => le(ue["rp-pages-container"], {
|
|
2381
|
+
[ue["rp-cursor-grab"]]: Le && !ie,
|
|
2382
|
+
[ue["rp-cursor-grabbing"]]: Le && ie
|
|
2383
|
+
}), [Le, ie]), so = O(
|
|
2384
|
+
(B) => {
|
|
2385
|
+
if (Le && B) {
|
|
2386
|
+
const Z = le(ue["rp-pages"]), be = document.querySelector(`.${Z}`);
|
|
2387
|
+
ce(be);
|
|
2374
2388
|
}
|
|
2375
2389
|
},
|
|
2376
|
-
[Le,
|
|
2390
|
+
[Le, ce, ue]
|
|
2377
2391
|
);
|
|
2378
|
-
return
|
|
2379
|
-
I &&
|
|
2380
|
-
}, [I]),
|
|
2392
|
+
return z(() => {
|
|
2393
|
+
I && ze();
|
|
2394
|
+
}, [I]), z(() => {
|
|
2381
2395
|
if (!(Y.height === 0 || !P.current)) {
|
|
2382
|
-
if (e ===
|
|
2383
|
-
t !== h &&
|
|
2396
|
+
if (e === ae.PAGE_SCROLLING) {
|
|
2397
|
+
t !== h && w && g(t), P.current = !1;
|
|
2384
2398
|
return;
|
|
2385
2399
|
}
|
|
2386
2400
|
c(t, "auto"), g(t), P.current = !1;
|
|
@@ -2388,26 +2402,26 @@ const Ti = It(({ widths: t, heights: e }) => {
|
|
|
2388
2402
|
}, [
|
|
2389
2403
|
c,
|
|
2390
2404
|
e,
|
|
2391
|
-
|
|
2405
|
+
w,
|
|
2392
2406
|
g,
|
|
2393
2407
|
Y
|
|
2394
|
-
]), /* @__PURE__ */ k(
|
|
2395
|
-
/* @__PURE__ */ i(
|
|
2408
|
+
]), /* @__PURE__ */ k(ge, { children: [
|
|
2409
|
+
/* @__PURE__ */ i(Zo, { ref: a, children: /* @__PURE__ */ i(
|
|
2396
2410
|
zn,
|
|
2397
2411
|
{
|
|
2398
2412
|
id: n,
|
|
2399
2413
|
ref: o,
|
|
2400
2414
|
tabIndex: -1,
|
|
2401
2415
|
className: ao,
|
|
2402
|
-
children: /* @__PURE__ */ i(Pi, { style: { minHeight: "50px" }, children: ({ width:
|
|
2416
|
+
children: /* @__PURE__ */ i(Pi, { style: { minHeight: "50px" }, children: ({ width: B, height: Z }) => /* @__PURE__ */ i("div", { "data-rp": "pages", ref: so, style: { width: B, height: Z }, children: l === ae.PAGE_SCROLLING ? /* @__PURE__ */ i(
|
|
2403
2417
|
"div",
|
|
2404
2418
|
{
|
|
2405
2419
|
ref: f,
|
|
2406
|
-
style: { width:
|
|
2407
|
-
className:
|
|
2408
|
-
children: v ===
|
|
2420
|
+
style: { width: B, height: Z },
|
|
2421
|
+
className: le(ue["rp-pages"], ue["rp-page-scrolling-wrapper"]),
|
|
2422
|
+
children: v === ee.DUAL_PAGE ? /* @__PURE__ */ i(Ti, { widths: q, heights: V }) : v === ee.DUAL_PAGE_WITH_COVER ? /* @__PURE__ */ i(Ci, { widths: q, heights: V }) : /* @__PURE__ */ i(yi, { widths: q, heights: V })
|
|
2409
2423
|
}
|
|
2410
|
-
) :
|
|
2424
|
+
) : te ? /* @__PURE__ */ i(
|
|
2411
2425
|
mi,
|
|
2412
2426
|
{
|
|
2413
2427
|
ref: s,
|
|
@@ -2415,30 +2429,30 @@ const Ti = It(({ widths: t, heights: e }) => {
|
|
|
2415
2429
|
outerRef: m,
|
|
2416
2430
|
innerRef: _,
|
|
2417
2431
|
onScroll: io,
|
|
2418
|
-
columnCount:
|
|
2419
|
-
columnWidth:
|
|
2420
|
-
rowHeight:
|
|
2421
|
-
height:
|
|
2422
|
-
width:
|
|
2423
|
-
estimatedColumnWidth:
|
|
2424
|
-
estimatedRowHeight:
|
|
2425
|
-
rowCount:
|
|
2426
|
-
className:
|
|
2427
|
-
|
|
2428
|
-
l ===
|
|
2432
|
+
columnCount: $,
|
|
2433
|
+
columnWidth: q,
|
|
2434
|
+
rowHeight: V,
|
|
2435
|
+
height: Z,
|
|
2436
|
+
width: B,
|
|
2437
|
+
estimatedColumnWidth: j,
|
|
2438
|
+
estimatedRowHeight: te,
|
|
2439
|
+
rowCount: U,
|
|
2440
|
+
className: le(
|
|
2441
|
+
ue["rp-pages"],
|
|
2442
|
+
l === ae.HORIZONTAL_SCROLLING ? ue["rp-pages-horizontal-scroll"] : ""
|
|
2429
2443
|
),
|
|
2430
2444
|
style: {
|
|
2431
|
-
"--rp-pages-height": `${
|
|
2432
|
-
"--rp-pages-width": `${
|
|
2433
|
-
"--rp-row-count": `${
|
|
2434
|
-
"--rp-column-count": `${
|
|
2445
|
+
"--rp-pages-height": `${G.height}px`,
|
|
2446
|
+
"--rp-pages-width": `${G.width}px`,
|
|
2447
|
+
"--rp-row-count": `${U}`,
|
|
2448
|
+
"--rp-column-count": `${$}`
|
|
2435
2449
|
},
|
|
2436
2450
|
children: xi
|
|
2437
2451
|
}
|
|
2438
|
-
) : !I && !
|
|
2452
|
+
) : !I && !x ? /* @__PURE__ */ i(
|
|
2439
2453
|
"div",
|
|
2440
2454
|
{
|
|
2441
|
-
className:
|
|
2455
|
+
className: ue["rp-loader"],
|
|
2442
2456
|
style: {
|
|
2443
2457
|
display: "flex",
|
|
2444
2458
|
justifyContent: "center",
|
|
@@ -2448,7 +2462,7 @@ const Ti = It(({ widths: t, heights: e }) => {
|
|
|
2448
2462
|
},
|
|
2449
2463
|
children: R && /* @__PURE__ */ i(R, {})
|
|
2450
2464
|
}
|
|
2451
|
-
) :
|
|
2465
|
+
) : x === wo.NOT_SUPPORTED ? /* @__PURE__ */ i("div", { className: ue["rp-not-supported"], children: /* @__PURE__ */ k("div", { className: ue["rp-not-supported-content"], children: [
|
|
2452
2466
|
"React PDF is unable to render on this browser. Please use the supported browsers from the list below:",
|
|
2453
2467
|
/* @__PURE__ */ i("div", { children: /* @__PURE__ */ k("ul", { children: [
|
|
2454
2468
|
/* @__PURE__ */ i("li", { children: "Chrome 119+" }),
|
|
@@ -2461,43 +2475,43 @@ const Ti = It(({ widths: t, heights: e }) => {
|
|
|
2461
2475
|
] }) }) : null }) })
|
|
2462
2476
|
}
|
|
2463
2477
|
) }),
|
|
2464
|
-
|
|
2478
|
+
S && /* @__PURE__ */ i(fr, {})
|
|
2465
2479
|
] });
|
|
2466
|
-
},
|
|
2480
|
+
}, Ue = {
|
|
2467
2481
|
"rp-toolbar-content": "_rp-toolbar-content_sz31z_1",
|
|
2468
2482
|
"rp-toolbar-wrapper": "_rp-toolbar-wrapper_sz31z_10",
|
|
2469
2483
|
"rp-toolbar-start": "_rp-toolbar-start_sz31z_33",
|
|
2470
2484
|
"rp-toolbar-middle": "_rp-toolbar-middle_sz31z_39",
|
|
2471
2485
|
"rp-toolbar-end": "_rp-toolbar-end_sz31z_46"
|
|
2472
|
-
},
|
|
2486
|
+
}, bt = {
|
|
2473
2487
|
"rp-paginate": "_rp-paginate_1yinm_1",
|
|
2474
2488
|
"rp-page-input": "_rp-page-input_1yinm_6",
|
|
2475
2489
|
"rp-total-page": "_rp-total-page_1yinm_29"
|
|
2476
2490
|
}, Si = () => {
|
|
2477
|
-
const { prevIcon: t } =
|
|
2478
|
-
return t || e || /* @__PURE__ */ i(
|
|
2491
|
+
const { prevIcon: t } = _e(), { prevIcon: e } = we();
|
|
2492
|
+
return t || e || /* @__PURE__ */ i(Be, {});
|
|
2479
2493
|
}, Ri = () => {
|
|
2480
|
-
const { nextIcon: t } =
|
|
2481
|
-
return t || e || /* @__PURE__ */ i(
|
|
2494
|
+
const { nextIcon: t } = _e(), { nextIcon: e } = we();
|
|
2495
|
+
return t || e || /* @__PURE__ */ i(Be, { style: { transform: "rotate(180deg" } });
|
|
2482
2496
|
}, Li = () => {
|
|
2483
|
-
const { focusedPage: t, totalPages: e, setFocusedPage: n, nextPage: r, prevPage: o, goToPage: a } =
|
|
2484
|
-
|
|
2497
|
+
const { focusedPage: t, totalPages: e, setFocusedPage: n, nextPage: r, prevPage: o, goToPage: a } = de(), [c, d] = H(t.toString()), { pageNavigationTool: s = !0 } = ye(), { pageNavigationTool: f = !0 } = Se(), { isSmallScreen: m } = Re(), { viewMode: T } = Ge(), { scrollMode: u } = Ae(), { localeMessages: C } = fe();
|
|
2498
|
+
z(() => {
|
|
2485
2499
|
d(t.toString());
|
|
2486
2500
|
}, [t]);
|
|
2487
|
-
const
|
|
2501
|
+
const w = O((h) => {
|
|
2488
2502
|
const p = h.target.value;
|
|
2489
2503
|
d(p);
|
|
2490
|
-
}, []), P =
|
|
2504
|
+
}, []), P = O(async () => {
|
|
2491
2505
|
const h = a(c);
|
|
2492
2506
|
h.success || d(h.currentPage.toString());
|
|
2493
|
-
}, [a, c, e]), y =
|
|
2507
|
+
}, [a, c, e]), y = O(() => {
|
|
2494
2508
|
d(t.toString());
|
|
2495
|
-
}, [t]),
|
|
2509
|
+
}, [t]), b = O(
|
|
2496
2510
|
(h) => {
|
|
2497
2511
|
h.key === "Enter" && P();
|
|
2498
2512
|
},
|
|
2499
2513
|
[P]
|
|
2500
|
-
), g = W(() =>
|
|
2514
|
+
), g = W(() => T === ee.DUAL_PAGE && u === ae.PAGE_SCROLLING && t === e - 1 || t === e, [t, e, T, u]);
|
|
2501
2515
|
return !s || !f ? null : typeof s != "boolean" ? /* @__PURE__ */ i(
|
|
2502
2516
|
s,
|
|
2503
2517
|
{
|
|
@@ -2518,27 +2532,27 @@ const Ti = It(({ widths: t, heights: e }) => {
|
|
|
2518
2532
|
goToPage: a,
|
|
2519
2533
|
changePage: n
|
|
2520
2534
|
}
|
|
2521
|
-
) : /* @__PURE__ */ k("div", { className:
|
|
2522
|
-
!m && /* @__PURE__ */ i(K, { content:
|
|
2523
|
-
|
|
2535
|
+
) : /* @__PURE__ */ k("div", { className: bt["rp-paginate"], children: [
|
|
2536
|
+
!m && /* @__PURE__ */ i(K, { content: C == null ? void 0 : C.previousPageTooltip, children: /* @__PURE__ */ i(
|
|
2537
|
+
pe,
|
|
2524
2538
|
{
|
|
2525
2539
|
onClick: o,
|
|
2526
|
-
"aria-label":
|
|
2540
|
+
"aria-label": C == null ? void 0 : C.previousPageTooltip,
|
|
2527
2541
|
"aria-disabled": t === 1,
|
|
2528
2542
|
children: /* @__PURE__ */ i(Si, {})
|
|
2529
2543
|
}
|
|
2530
2544
|
) }),
|
|
2531
|
-
/* @__PURE__ */ i(K, { content:
|
|
2545
|
+
/* @__PURE__ */ i(K, { content: C == null ? void 0 : C.currentPageTooltip, children: /* @__PURE__ */ i(
|
|
2532
2546
|
gn,
|
|
2533
2547
|
{
|
|
2534
|
-
onKeyDown:
|
|
2548
|
+
onKeyDown: b,
|
|
2535
2549
|
onBlur: y,
|
|
2536
|
-
onChange:
|
|
2550
|
+
onChange: w,
|
|
2537
2551
|
value: c,
|
|
2538
|
-
className:
|
|
2552
|
+
className: bt["rp-page-input"],
|
|
2539
2553
|
id: "page-input",
|
|
2540
2554
|
name: "page-input",
|
|
2541
|
-
"aria-label":
|
|
2555
|
+
"aria-label": C == null ? void 0 : C.currentPageTooltip,
|
|
2542
2556
|
"aria-valuemin": 1,
|
|
2543
2557
|
"aria-valuemax": e,
|
|
2544
2558
|
"aria-valuenow": parseInt(c) || t,
|
|
@@ -2547,22 +2561,22 @@ const Ti = It(({ widths: t, heights: e }) => {
|
|
|
2547
2561
|
max: e
|
|
2548
2562
|
}
|
|
2549
2563
|
) }),
|
|
2550
|
-
/* @__PURE__ */ k("span", { className:
|
|
2564
|
+
/* @__PURE__ */ k("span", { className: bt["rp-total-page"], children: [
|
|
2551
2565
|
"/",
|
|
2552
2566
|
e
|
|
2553
2567
|
] }),
|
|
2554
|
-
!m && /* @__PURE__ */ i(K, { content:
|
|
2555
|
-
|
|
2568
|
+
!m && /* @__PURE__ */ i(K, { content: C == null ? void 0 : C.nextPageTooltip, children: /* @__PURE__ */ i(
|
|
2569
|
+
pe,
|
|
2556
2570
|
{
|
|
2557
2571
|
onClick: r,
|
|
2558
|
-
"aria-label":
|
|
2572
|
+
"aria-label": C == null ? void 0 : C.nextPageTooltip,
|
|
2559
2573
|
"aria-disabled": g,
|
|
2560
2574
|
children: /* @__PURE__ */ i(Ri, {})
|
|
2561
2575
|
}
|
|
2562
2576
|
) })
|
|
2563
2577
|
] });
|
|
2564
2578
|
};
|
|
2565
|
-
var
|
|
2579
|
+
var lt = "Dialog", [Wn, Rc] = Tr(lt), [Ei, ve] = Wn(lt), Fn = (t) => {
|
|
2566
2580
|
const {
|
|
2567
2581
|
__scopeDialog: e,
|
|
2568
2582
|
children: n,
|
|
@@ -2574,7 +2588,7 @@ var ct = "Dialog", [Wn, Rc] = Tr(ct), [Ei, me] = Wn(ct), Fn = (t) => {
|
|
|
2574
2588
|
prop: r,
|
|
2575
2589
|
defaultProp: o ?? !1,
|
|
2576
2590
|
onChange: a,
|
|
2577
|
-
caller:
|
|
2591
|
+
caller: lt
|
|
2578
2592
|
});
|
|
2579
2593
|
return /* @__PURE__ */ i(
|
|
2580
2594
|
Ei,
|
|
@@ -2587,18 +2601,18 @@ var ct = "Dialog", [Wn, Rc] = Tr(ct), [Ei, me] = Wn(ct), Fn = (t) => {
|
|
|
2587
2601
|
descriptionId: ft(),
|
|
2588
2602
|
open: f,
|
|
2589
2603
|
onOpenChange: m,
|
|
2590
|
-
onOpenToggle: X.useCallback(() => m((
|
|
2604
|
+
onOpenToggle: X.useCallback(() => m((T) => !T), [m]),
|
|
2591
2605
|
modal: c,
|
|
2592
2606
|
children: n
|
|
2593
2607
|
}
|
|
2594
2608
|
);
|
|
2595
2609
|
};
|
|
2596
|
-
Fn.displayName =
|
|
2610
|
+
Fn.displayName = lt;
|
|
2597
2611
|
var kn = "DialogTrigger", Ni = X.forwardRef(
|
|
2598
2612
|
(t, e) => {
|
|
2599
|
-
const { __scopeDialog: n, ...r } = t, o =
|
|
2613
|
+
const { __scopeDialog: n, ...r } = t, o = ve(kn, n), a = Ot(e, o.triggerRef);
|
|
2600
2614
|
return /* @__PURE__ */ i(
|
|
2601
|
-
|
|
2615
|
+
Xe.button,
|
|
2602
2616
|
{
|
|
2603
2617
|
type: "button",
|
|
2604
2618
|
"aria-haspopup": "dialog",
|
|
@@ -2607,7 +2621,7 @@ var kn = "DialogTrigger", Ni = X.forwardRef(
|
|
|
2607
2621
|
"data-state": Ft(o.open),
|
|
2608
2622
|
...r,
|
|
2609
2623
|
ref: a,
|
|
2610
|
-
onClick:
|
|
2624
|
+
onClick: qe(t.onClick, o.onOpenToggle)
|
|
2611
2625
|
}
|
|
2612
2626
|
);
|
|
2613
2627
|
}
|
|
@@ -2616,25 +2630,25 @@ Ni.displayName = kn;
|
|
|
2616
2630
|
var zt = "DialogPortal", [Oi, Mn] = Wn(zt, {
|
|
2617
2631
|
forceMount: void 0
|
|
2618
2632
|
}), Hn = (t) => {
|
|
2619
|
-
const { __scopeDialog: e, forceMount: n, children: r, container: o } = t, a =
|
|
2633
|
+
const { __scopeDialog: e, forceMount: n, children: r, container: o } = t, a = ve(zt, e);
|
|
2620
2634
|
return /* @__PURE__ */ i(Oi, { scope: e, forceMount: n, children: X.Children.map(r, (c) => /* @__PURE__ */ i(Dt, { present: n || a.open, children: /* @__PURE__ */ i(Nr, { asChild: !0, container: o, children: c }) })) });
|
|
2621
2635
|
};
|
|
2622
2636
|
Hn.displayName = zt;
|
|
2623
|
-
var
|
|
2637
|
+
var ot = "DialogOverlay", $n = X.forwardRef(
|
|
2624
2638
|
(t, e) => {
|
|
2625
|
-
const n = Mn(
|
|
2639
|
+
const n = Mn(ot, t.__scopeDialog), { forceMount: r = n.forceMount, ...o } = t, a = ve(ot, t.__scopeDialog);
|
|
2626
2640
|
return a.modal ? /* @__PURE__ */ i(Dt, { present: r || a.open, children: /* @__PURE__ */ i(Ai, { ...o, ref: e }) }) : null;
|
|
2627
2641
|
}
|
|
2628
2642
|
);
|
|
2629
|
-
$n.displayName =
|
|
2643
|
+
$n.displayName = ot;
|
|
2630
2644
|
var Di = Ir("DialogOverlay.RemoveScroll"), Ai = X.forwardRef(
|
|
2631
2645
|
(t, e) => {
|
|
2632
|
-
const { __scopeDialog: n, ...r } = t, o =
|
|
2646
|
+
const { __scopeDialog: n, ...r } = t, o = ve(ot, n);
|
|
2633
2647
|
return (
|
|
2634
2648
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
2635
2649
|
// ie. when `Overlay` and `Content` are siblings
|
|
2636
2650
|
/* @__PURE__ */ i(Sr, { as: Di, allowPinchZoom: !0, shards: [o.contentRef], children: /* @__PURE__ */ i(
|
|
2637
|
-
|
|
2651
|
+
Xe.div,
|
|
2638
2652
|
{
|
|
2639
2653
|
"data-state": Ft(o.open),
|
|
2640
2654
|
...r,
|
|
@@ -2646,14 +2660,14 @@ var Di = Ir("DialogOverlay.RemoveScroll"), Ai = X.forwardRef(
|
|
|
2646
2660
|
}
|
|
2647
2661
|
), De = "DialogContent", Gn = X.forwardRef(
|
|
2648
2662
|
(t, e) => {
|
|
2649
|
-
const n = Mn(De, t.__scopeDialog), { forceMount: r = n.forceMount, ...o } = t, a =
|
|
2663
|
+
const n = Mn(De, t.__scopeDialog), { forceMount: r = n.forceMount, ...o } = t, a = ve(De, t.__scopeDialog);
|
|
2650
2664
|
return /* @__PURE__ */ i(Dt, { present: r || a.open, children: a.modal ? /* @__PURE__ */ i(zi, { ...o, ref: e }) : /* @__PURE__ */ i(Wi, { ...o, ref: e }) });
|
|
2651
2665
|
}
|
|
2652
2666
|
);
|
|
2653
2667
|
Gn.displayName = De;
|
|
2654
2668
|
var zi = X.forwardRef(
|
|
2655
2669
|
(t, e) => {
|
|
2656
|
-
const n =
|
|
2670
|
+
const n = ve(De, t.__scopeDialog), r = X.useRef(null), o = Ot(e, n.contentRef, r);
|
|
2657
2671
|
return X.useEffect(() => {
|
|
2658
2672
|
const a = r.current;
|
|
2659
2673
|
if (a)
|
|
@@ -2665,15 +2679,15 @@ var zi = X.forwardRef(
|
|
|
2665
2679
|
ref: o,
|
|
2666
2680
|
trapFocus: n.open,
|
|
2667
2681
|
disableOutsidePointerEvents: !0,
|
|
2668
|
-
onCloseAutoFocus:
|
|
2682
|
+
onCloseAutoFocus: qe(t.onCloseAutoFocus, (a) => {
|
|
2669
2683
|
var c;
|
|
2670
2684
|
a.preventDefault(), (c = n.triggerRef.current) == null || c.focus();
|
|
2671
2685
|
}),
|
|
2672
|
-
onPointerDownOutside:
|
|
2686
|
+
onPointerDownOutside: qe(t.onPointerDownOutside, (a) => {
|
|
2673
2687
|
const c = a.detail.originalEvent, d = c.button === 0 && c.ctrlKey === !0;
|
|
2674
2688
|
(c.button === 2 || d) && a.preventDefault();
|
|
2675
2689
|
}),
|
|
2676
|
-
onFocusOutside:
|
|
2690
|
+
onFocusOutside: qe(
|
|
2677
2691
|
t.onFocusOutside,
|
|
2678
2692
|
(a) => a.preventDefault()
|
|
2679
2693
|
)
|
|
@@ -2682,7 +2696,7 @@ var zi = X.forwardRef(
|
|
|
2682
2696
|
}
|
|
2683
2697
|
), Wi = X.forwardRef(
|
|
2684
2698
|
(t, e) => {
|
|
2685
|
-
const n =
|
|
2699
|
+
const n = ve(De, t.__scopeDialog), r = X.useRef(!1), o = X.useRef(!1);
|
|
2686
2700
|
return /* @__PURE__ */ i(
|
|
2687
2701
|
Un,
|
|
2688
2702
|
{
|
|
@@ -2705,8 +2719,8 @@ var zi = X.forwardRef(
|
|
|
2705
2719
|
}
|
|
2706
2720
|
), Un = X.forwardRef(
|
|
2707
2721
|
(t, e) => {
|
|
2708
|
-
const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: a, ...c } = t, d =
|
|
2709
|
-
return Lr(), /* @__PURE__ */ k(
|
|
2722
|
+
const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: a, ...c } = t, d = ve(De, n), s = X.useRef(null), f = Ot(e, s);
|
|
2723
|
+
return Lr(), /* @__PURE__ */ k(ge, { children: [
|
|
2710
2724
|
/* @__PURE__ */ i(
|
|
2711
2725
|
Er,
|
|
2712
2726
|
{
|
|
@@ -2730,7 +2744,7 @@ var zi = X.forwardRef(
|
|
|
2730
2744
|
)
|
|
2731
2745
|
}
|
|
2732
2746
|
),
|
|
2733
|
-
/* @__PURE__ */ k(
|
|
2747
|
+
/* @__PURE__ */ k(ge, { children: [
|
|
2734
2748
|
/* @__PURE__ */ i(ki, { titleId: d.titleId }),
|
|
2735
2749
|
/* @__PURE__ */ i(Hi, { contentRef: s, descriptionId: d.descriptionId })
|
|
2736
2750
|
] })
|
|
@@ -2738,42 +2752,42 @@ var zi = X.forwardRef(
|
|
|
2738
2752
|
}
|
|
2739
2753
|
), Wt = "DialogTitle", Vn = X.forwardRef(
|
|
2740
2754
|
(t, e) => {
|
|
2741
|
-
const { __scopeDialog: n, ...r } = t, o =
|
|
2742
|
-
return /* @__PURE__ */ i(
|
|
2755
|
+
const { __scopeDialog: n, ...r } = t, o = ve(Wt, n);
|
|
2756
|
+
return /* @__PURE__ */ i(Xe.h2, { id: o.titleId, ...r, ref: e });
|
|
2743
2757
|
}
|
|
2744
2758
|
);
|
|
2745
2759
|
Vn.displayName = Wt;
|
|
2746
2760
|
var qn = "DialogDescription", Fi = X.forwardRef(
|
|
2747
2761
|
(t, e) => {
|
|
2748
|
-
const { __scopeDialog: n, ...r } = t, o =
|
|
2749
|
-
return /* @__PURE__ */ i(
|
|
2762
|
+
const { __scopeDialog: n, ...r } = t, o = ve(qn, n);
|
|
2763
|
+
return /* @__PURE__ */ i(Xe.p, { id: o.descriptionId, ...r, ref: e });
|
|
2750
2764
|
}
|
|
2751
2765
|
);
|
|
2752
2766
|
Fi.displayName = qn;
|
|
2753
|
-
var Bn = "DialogClose",
|
|
2767
|
+
var Bn = "DialogClose", jn = X.forwardRef(
|
|
2754
2768
|
(t, e) => {
|
|
2755
|
-
const { __scopeDialog: n, ...r } = t, o =
|
|
2769
|
+
const { __scopeDialog: n, ...r } = t, o = ve(Bn, n);
|
|
2756
2770
|
return /* @__PURE__ */ i(
|
|
2757
|
-
|
|
2771
|
+
Xe.button,
|
|
2758
2772
|
{
|
|
2759
2773
|
type: "button",
|
|
2760
2774
|
...r,
|
|
2761
2775
|
ref: e,
|
|
2762
|
-
onClick:
|
|
2776
|
+
onClick: qe(t.onClick, () => o.onOpenChange(!1))
|
|
2763
2777
|
}
|
|
2764
2778
|
);
|
|
2765
2779
|
}
|
|
2766
2780
|
);
|
|
2767
|
-
|
|
2781
|
+
jn.displayName = Bn;
|
|
2768
2782
|
function Ft(t) {
|
|
2769
2783
|
return t ? "open" : "closed";
|
|
2770
2784
|
}
|
|
2771
|
-
var
|
|
2785
|
+
var Zn = "DialogTitleWarning", [Lc, Kn] = Cr(Zn, {
|
|
2772
2786
|
contentName: De,
|
|
2773
2787
|
titleName: Wt,
|
|
2774
2788
|
docsSlug: "dialog"
|
|
2775
2789
|
}), ki = ({ titleId: t }) => {
|
|
2776
|
-
const e = Kn(
|
|
2790
|
+
const e = Kn(Zn), n = `\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
|
|
2777
2791
|
|
|
2778
2792
|
If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
2779
2793
|
|
|
@@ -2788,7 +2802,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${e.do
|
|
|
2788
2802
|
const o = (a = t.current) == null ? void 0 : a.getAttribute("aria-describedby");
|
|
2789
2803
|
e && o && (document.getElementById(e) || console.warn(r));
|
|
2790
2804
|
}, [r, t, e]), null;
|
|
2791
|
-
}, $i = Fn, Gi = Hn, Ui = $n, Vi = Gn, qi = Vn, Bi =
|
|
2805
|
+
}, $i = Fn, Gi = Hn, Ui = $n, Vi = Gn, qi = Vn, Bi = jn;
|
|
2792
2806
|
const Oe = {
|
|
2793
2807
|
"rp-dialog-wrapper": "_rp-dialog-wrapper_slqo7_1",
|
|
2794
2808
|
"rp-dialog-overlay": "_rp-dialog-overlay_slqo7_7",
|
|
@@ -2797,8 +2811,8 @@ const Oe = {
|
|
|
2797
2811
|
"rp-dialog-title": "_rp-dialog-title_slqo7_39",
|
|
2798
2812
|
"rp-dialog-close": "_rp-dialog-close_slqo7_47",
|
|
2799
2813
|
"rp-properties-divider": "_rp-properties-divider_slqo7_55"
|
|
2800
|
-
},
|
|
2801
|
-
const { pdfProperties: t } =
|
|
2814
|
+
}, ji = () => {
|
|
2815
|
+
const { pdfProperties: t } = re(), { container: e } = Ce(), { activeDocumentProperties: n, setActiveDocumentProperties: r } = Do(), { localeMessages: o } = fe(), a = W(() => {
|
|
2802
2816
|
if (!t)
|
|
2803
2817
|
return [];
|
|
2804
2818
|
const {
|
|
@@ -2807,13 +2821,13 @@ const Oe = {
|
|
|
2807
2821
|
title: s,
|
|
2808
2822
|
author: f,
|
|
2809
2823
|
subject: m,
|
|
2810
|
-
createdOn:
|
|
2824
|
+
createdOn: T,
|
|
2811
2825
|
creator: u,
|
|
2812
|
-
keywords:
|
|
2813
|
-
modifiedOn:
|
|
2826
|
+
keywords: C,
|
|
2827
|
+
modifiedOn: w,
|
|
2814
2828
|
pdfProducer: P,
|
|
2815
2829
|
pdfVersion: y,
|
|
2816
|
-
pageCount:
|
|
2830
|
+
pageCount: b
|
|
2817
2831
|
} = t;
|
|
2818
2832
|
return [
|
|
2819
2833
|
{ label: o == null ? void 0 : o.propertiesFilenameLabel, value: d },
|
|
@@ -2822,20 +2836,20 @@ const Oe = {
|
|
|
2822
2836
|
{ label: o == null ? void 0 : o.propertiesTitleLabel, value: s },
|
|
2823
2837
|
{ label: o == null ? void 0 : o.propertiesAuthorLabel, value: f },
|
|
2824
2838
|
{ label: o == null ? void 0 : o.propertiesSubjectLabel, value: m },
|
|
2825
|
-
{ label: o == null ? void 0 : o.propertiesKeywordLabel, value:
|
|
2839
|
+
{ label: o == null ? void 0 : o.propertiesKeywordLabel, value: C },
|
|
2826
2840
|
{ label: o == null ? void 0 : o.propertiesCreatorLabel, value: u },
|
|
2827
2841
|
{
|
|
2828
2842
|
label: o == null ? void 0 : o.propertiesCreateOnLabel,
|
|
2829
|
-
value:
|
|
2843
|
+
value: T ? qt(T) : ""
|
|
2830
2844
|
},
|
|
2831
2845
|
{
|
|
2832
2846
|
label: o == null ? void 0 : o.propertiesModifiedOnLabel,
|
|
2833
|
-
value:
|
|
2847
|
+
value: w ? qt(w) : ""
|
|
2834
2848
|
},
|
|
2835
2849
|
{ separate: !0 },
|
|
2836
2850
|
{ label: o == null ? void 0 : o.propertiesPDFProducerLabel, value: P },
|
|
2837
2851
|
{ label: o == null ? void 0 : o.propertiesPDFVersionLabel, value: y },
|
|
2838
|
-
{ label: o == null ? void 0 : o.propertiesPageCountLabel, value:
|
|
2852
|
+
{ label: o == null ? void 0 : o.propertiesPageCountLabel, value: b }
|
|
2839
2853
|
];
|
|
2840
2854
|
}, [t, o]);
|
|
2841
2855
|
return /* @__PURE__ */ i($i, { open: n, onOpenChange: r, children: /* @__PURE__ */ i(Gi, { container: e, children: /* @__PURE__ */ k("div", { className: Oe["rp-dialog-wrapper"], children: [
|
|
@@ -2846,40 +2860,40 @@ const Oe = {
|
|
|
2846
2860
|
/* @__PURE__ */ i(Bi, { asChild: !0, className: Oe["rp-dialog-close"], "aria-label": (o == null ? void 0 : o.searchCloseButtonTooltip) || "Close dialog", children: /* @__PURE__ */ i(Or, { "aria-hidden": "true" }) })
|
|
2847
2861
|
] })
|
|
2848
2862
|
] }) }) });
|
|
2849
|
-
},
|
|
2863
|
+
}, Zi = {
|
|
2850
2864
|
"rp-other-tool-content": "_rp-other-tool-content_su718_1"
|
|
2851
2865
|
}, un = ".pdf", Ki = (t) => URL.createObjectURL(t), Xi = async (t) => {
|
|
2852
2866
|
const n = await (await fetch(t)).blob();
|
|
2853
2867
|
return Ki(n);
|
|
2854
2868
|
}, Xn = () => {
|
|
2855
|
-
const { filename: t, pdfSrc: e } =
|
|
2869
|
+
const { filename: t, pdfSrc: e } = re(), { downloadFilename: n } = Lo(), r = (a) => {
|
|
2856
2870
|
const c = n || a;
|
|
2857
2871
|
return c.endsWith(un) ? c : `${c}${un}`;
|
|
2858
2872
|
};
|
|
2859
|
-
return { download:
|
|
2873
|
+
return { download: O(async () => {
|
|
2860
2874
|
if (!t || !e)
|
|
2861
2875
|
throw new Error("There is no PDF source to download");
|
|
2862
2876
|
const a = document.createElement("a");
|
|
2863
2877
|
a.href = await Xi(e), a.download = r(t), document.body.appendChild(a), a.click(), document.body.removeChild(a);
|
|
2864
2878
|
}, [t, e]) };
|
|
2865
2879
|
}, Qn = () => {
|
|
2866
|
-
const { downloadIcon: t } =
|
|
2880
|
+
const { downloadIcon: t } = _e(), { downloadIcon: e } = we();
|
|
2867
2881
|
return t || e || /* @__PURE__ */ i(Fr, {});
|
|
2868
|
-
}, Yn = ({ children: t, className: e, localeMessages: n }) => /* @__PURE__ */ i(K, { className: e, content: n == null ? void 0 : n.downloadFileTooltip, children: t }), Qi = ({ download: t, localeMessages: e }) => /* @__PURE__ */ i(Yn, { localeMessages: e, children: /* @__PURE__ */ i(
|
|
2882
|
+
}, Yn = ({ children: t, className: e, localeMessages: n }) => /* @__PURE__ */ i(K, { className: e, content: n == null ? void 0 : n.downloadFileTooltip, children: t }), Qi = ({ download: t, localeMessages: e }) => /* @__PURE__ */ i(Yn, { localeMessages: e, children: /* @__PURE__ */ i(pe, { onClick: t, "aria-label": e == null ? void 0 : e.downloadFileTooltip, children: /* @__PURE__ */ i(Qn, {}) }) }), Yi = ({ download: t, localeMessages: e }) => /* @__PURE__ */ i(xe, { onClick: t, children: /* @__PURE__ */ k(Yn, { className: "rp-menu-item", localeMessages: e, children: [
|
|
2869
2883
|
/* @__PURE__ */ i("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ i(Qn, {}) }),
|
|
2870
2884
|
e == null ? void 0 : e.downloadFileLabel
|
|
2871
2885
|
] }) }), Jn = () => {
|
|
2872
|
-
const { download: t } = Xn(), { downloadTool: e = !0 } =
|
|
2886
|
+
const { download: t } = Xn(), { downloadTool: e = !0 } = ye(), { downloadTool: n = !0 } = Se(), { isSmallScreen: r } = Re(), { localeMessages: o } = fe(), a = o == null ? void 0 : o.downloadFileTooltip;
|
|
2873
2887
|
return !e || !n ? null : r ? /* @__PURE__ */ i(Yi, { download: t, localeMessages: o }) : typeof e == "function" ? /* @__PURE__ */ i(K, { content: a, children: /* @__PURE__ */ i(e, { download: t }) }) : typeof n == "function" ? /* @__PURE__ */ i(K, { content: a, children: /* @__PURE__ */ i(n, { download: t }) }) : /* @__PURE__ */ i(Qi, { download: t, localeMessages: o });
|
|
2874
2888
|
}, eo = () => {
|
|
2875
|
-
const { printIcon: t } =
|
|
2889
|
+
const { printIcon: t } = _e(), { printIcon: e } = we();
|
|
2876
2890
|
return t || e || /* @__PURE__ */ i(kr, {});
|
|
2877
|
-
}, to = ({ children: t, className: e, localeMessages: n }) => /* @__PURE__ */ i(K, { className: e, content: n == null ? void 0 : n.printTooltip, children: t }), Ji = ({ print: t, localeMessages: e }) => /* @__PURE__ */ i(to, { localeMessages: e, children: /* @__PURE__ */ i(
|
|
2891
|
+
}, to = ({ children: t, className: e, localeMessages: n }) => /* @__PURE__ */ i(K, { className: e, content: n == null ? void 0 : n.printTooltip, children: t }), Ji = ({ print: t, localeMessages: e }) => /* @__PURE__ */ i(to, { localeMessages: e, children: /* @__PURE__ */ i(pe, { onClick: t, "aria-label": e == null ? void 0 : e.printTooltip, children: /* @__PURE__ */ i(eo, {}) }) }), ea = ({ print: t, localeMessages: e }) => /* @__PURE__ */ i(xe, { onClick: t, children: /* @__PURE__ */ k(to, { className: "rp-menu-item", localeMessages: e, children: [
|
|
2878
2892
|
/* @__PURE__ */ i("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ i(eo, {}) }),
|
|
2879
2893
|
e == null ? void 0 : e.printLabel
|
|
2880
2894
|
] }) }), no = () => {
|
|
2881
|
-
const { print: t, cancel: e, setOnProgress: n, setOnComplete: r, setOnError: o, progress: a, showDefaultProgress: c } =
|
|
2882
|
-
return !d || !s ? null : f ? /* @__PURE__ */ i(ea, { print: t, localeMessages: m }) : typeof d == "function" ? /* @__PURE__ */ i(K, { content:
|
|
2895
|
+
const { print: t, cancel: e, setOnProgress: n, setOnComplete: r, setOnError: o, progress: a, showDefaultProgress: c } = ct(), { printTool: d = !0 } = ye(), { printTool: s = !0 } = Se(), { isSmallScreen: f } = Re(), { localeMessages: m } = fe(), T = m == null ? void 0 : m.printTooltip;
|
|
2896
|
+
return !d || !s ? null : f ? /* @__PURE__ */ i(ea, { print: t, localeMessages: m }) : typeof d == "function" ? /* @__PURE__ */ i(K, { content: T, children: /* @__PURE__ */ i(
|
|
2883
2897
|
d,
|
|
2884
2898
|
{
|
|
2885
2899
|
print: t,
|
|
@@ -2890,7 +2904,7 @@ const Oe = {
|
|
|
2890
2904
|
progress: a,
|
|
2891
2905
|
showDefaultProgress: c
|
|
2892
2906
|
}
|
|
2893
|
-
) }) : typeof s == "function" ? /* @__PURE__ */ i(K, { content:
|
|
2907
|
+
) }) : typeof s == "function" ? /* @__PURE__ */ i(K, { content: T, children: /* @__PURE__ */ i(
|
|
2894
2908
|
s,
|
|
2895
2909
|
{
|
|
2896
2910
|
print: t,
|
|
@@ -2905,18 +2919,18 @@ const Oe = {
|
|
|
2905
2919
|
}, ta = {
|
|
2906
2920
|
"rp-go-to-Top": "_rp-go-to-Top_4e0yd_1"
|
|
2907
2921
|
}, na = () => {
|
|
2908
|
-
const { goToFirstPageIcon: t } =
|
|
2922
|
+
const { goToFirstPageIcon: t } = _e(), { goToFirstPageIcon: e } = we();
|
|
2909
2923
|
return t || e || /* @__PURE__ */ i(Tn, { className: ta["rp-go-to-Top"] });
|
|
2910
2924
|
}, oa = () => {
|
|
2911
|
-
const { goToLastPageIcon: t } =
|
|
2925
|
+
const { goToLastPageIcon: t } = _e(), { goToLastPageIcon: e } = we();
|
|
2912
2926
|
return t || e || /* @__PURE__ */ i(Tn, {});
|
|
2913
2927
|
}, pn = { width: "100%" }, ra = () => {
|
|
2914
|
-
const { goToPage: t, totalPages: e, focusedPage: n } =
|
|
2928
|
+
const { goToPage: t, totalPages: e, focusedPage: n } = de(), { jumpNavigationTool: r = !0 } = ye(), { jumpNavigationTool: o = !0 } = Se(), { localeMessages: a } = fe(), c = W(() => n === 1, [n]), d = W(() => n === e, [n, e]), s = O(() => {
|
|
2915
2929
|
t(1);
|
|
2916
|
-
}, [t]), f =
|
|
2930
|
+
}, [t]), f = O(() => {
|
|
2917
2931
|
t(e);
|
|
2918
2932
|
}, [t, e]);
|
|
2919
|
-
return !r || !o ? null : /* @__PURE__ */ k(
|
|
2933
|
+
return !r || !o ? null : /* @__PURE__ */ k(nt, { children: [
|
|
2920
2934
|
/* @__PURE__ */ i(xe, { onClick: s, children: /* @__PURE__ */ i(K, { content: a == null ? void 0 : a.firstPageTooltip, style: pn, children: /* @__PURE__ */ k("div", { className: "rp-menu-item", "aria-disabled": c, children: [
|
|
2921
2935
|
/* @__PURE__ */ i("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ i(na, {}) }),
|
|
2922
2936
|
/* @__PURE__ */ i("span", { children: a == null ? void 0 : a.firstPageLabel })
|
|
@@ -2928,21 +2942,21 @@ const Oe = {
|
|
|
2928
2942
|
/* @__PURE__ */ i(Lt, {})
|
|
2929
2943
|
] });
|
|
2930
2944
|
}, ia = () => {
|
|
2931
|
-
const [t, e] = H(!1), { container: n, pagesRef: r } =
|
|
2945
|
+
const [t, e] = H(!1), { container: n, pagesRef: r } = Ce(), { isSmallScreen: o } = Re(), {
|
|
2932
2946
|
openFileTool: a,
|
|
2933
2947
|
downloadTool: c,
|
|
2934
2948
|
documentProperties: d,
|
|
2935
2949
|
scrollModeTool: s,
|
|
2936
2950
|
rotateTool: f,
|
|
2937
2951
|
selectionModeTool: m,
|
|
2938
|
-
jumpNavigationTool:
|
|
2952
|
+
jumpNavigationTool: T,
|
|
2939
2953
|
printTool: u,
|
|
2940
|
-
fullscreenTool:
|
|
2941
|
-
viewModeTool:
|
|
2942
|
-
} =
|
|
2954
|
+
fullscreenTool: C,
|
|
2955
|
+
viewModeTool: w
|
|
2956
|
+
} = ye(), {
|
|
2943
2957
|
openFileTool: P,
|
|
2944
2958
|
downloadTool: y,
|
|
2945
|
-
documentProperties:
|
|
2959
|
+
documentProperties: b,
|
|
2946
2960
|
scrollModeTool: g,
|
|
2947
2961
|
rotateTool: h,
|
|
2948
2962
|
selectionModeTool: p,
|
|
@@ -2950,46 +2964,46 @@ const Oe = {
|
|
|
2950
2964
|
printTool: v,
|
|
2951
2965
|
fullscreenTool: _,
|
|
2952
2966
|
viewModeTool: I
|
|
2953
|
-
} = Se(), { localeMessages:
|
|
2954
|
-
new ResizeObserver((
|
|
2955
|
-
R(
|
|
2967
|
+
} = Se(), { localeMessages: x } = fe(), [S, R] = H(0), N = M(
|
|
2968
|
+
new ResizeObserver((D) => {
|
|
2969
|
+
R(D[0].contentRect.height);
|
|
2956
2970
|
})
|
|
2957
|
-
),
|
|
2971
|
+
), A = W(() => T || f || m || s || d || w || o && (a || c || u || C), [
|
|
2958
2972
|
a,
|
|
2959
2973
|
c,
|
|
2960
2974
|
u,
|
|
2961
|
-
|
|
2975
|
+
C,
|
|
2962
2976
|
d,
|
|
2963
2977
|
s,
|
|
2964
2978
|
f,
|
|
2965
2979
|
m,
|
|
2966
|
-
|
|
2980
|
+
T,
|
|
2967
2981
|
o
|
|
2968
|
-
]),
|
|
2982
|
+
]), F = W(() => l || h || p || g || b || I || o && (P || y || v || _), [
|
|
2969
2983
|
P,
|
|
2970
2984
|
y,
|
|
2971
2985
|
v,
|
|
2972
2986
|
_,
|
|
2973
|
-
|
|
2987
|
+
b,
|
|
2974
2988
|
g,
|
|
2975
2989
|
h,
|
|
2976
2990
|
p,
|
|
2977
2991
|
l,
|
|
2978
2992
|
o
|
|
2979
2993
|
]);
|
|
2980
|
-
return
|
|
2981
|
-
|
|
2982
|
-
}), [r]), !
|
|
2994
|
+
return z(() => (r && N.current.observe(r), () => {
|
|
2995
|
+
N.current.disconnect();
|
|
2996
|
+
}), [r]), !A || !F ? null : /* @__PURE__ */ k(ge, { children: [
|
|
2983
2997
|
/* @__PURE__ */ i(
|
|
2984
2998
|
Rt,
|
|
2985
2999
|
{
|
|
2986
3000
|
container: n,
|
|
2987
3001
|
onOpenChange: e,
|
|
2988
|
-
triggerComponent: /* @__PURE__ */ i("div", { role: "button", "aria-haspopup": "menu", children: /* @__PURE__ */ i(K, { content:
|
|
2989
|
-
|
|
3002
|
+
triggerComponent: /* @__PURE__ */ i("div", { role: "button", "aria-haspopup": "menu", children: /* @__PURE__ */ i(K, { content: x == null ? void 0 : x.moreOptionTooltip, children: /* @__PURE__ */ i(
|
|
3003
|
+
pe,
|
|
2990
3004
|
{
|
|
2991
3005
|
active: t,
|
|
2992
|
-
"aria-label":
|
|
3006
|
+
"aria-label": x == null ? void 0 : x.moreOptionTooltip,
|
|
2993
3007
|
"aria-expanded": t,
|
|
2994
3008
|
children: /* @__PURE__ */ i(Pr, { "aria-hidden": "true" })
|
|
2995
3009
|
}
|
|
@@ -2999,12 +3013,12 @@ const Oe = {
|
|
|
2999
3013
|
children: /* @__PURE__ */ k(
|
|
3000
3014
|
"div",
|
|
3001
3015
|
{
|
|
3002
|
-
style: { maxHeight: `${
|
|
3003
|
-
className:
|
|
3016
|
+
style: { maxHeight: `${S}px`, overflow: "auto" },
|
|
3017
|
+
className: Zi["rp-other-tool-content"],
|
|
3004
3018
|
"data-rp": "moreOptionsDropdown",
|
|
3005
3019
|
children: [
|
|
3006
|
-
o && /* @__PURE__ */ k(
|
|
3007
|
-
/* @__PURE__ */ i(
|
|
3020
|
+
o && /* @__PURE__ */ k(nt, { children: [
|
|
3021
|
+
/* @__PURE__ */ i(bn, {}),
|
|
3008
3022
|
/* @__PURE__ */ i(Jn, {}),
|
|
3009
3023
|
/* @__PURE__ */ i(no, {}),
|
|
3010
3024
|
/* @__PURE__ */ i(Pn, {}),
|
|
@@ -3021,21 +3035,21 @@ const Oe = {
|
|
|
3021
3035
|
)
|
|
3022
3036
|
}
|
|
3023
3037
|
),
|
|
3024
|
-
/* @__PURE__ */ i(
|
|
3038
|
+
/* @__PURE__ */ i(ji, {})
|
|
3025
3039
|
] });
|
|
3026
3040
|
}, aa = () => {
|
|
3027
3041
|
const { isSmallScreen: t } = Re();
|
|
3028
|
-
return /* @__PURE__ */ k(
|
|
3029
|
-
/* @__PURE__ */ i(
|
|
3030
|
-
!t && /* @__PURE__ */ k(
|
|
3031
|
-
/* @__PURE__ */ i(
|
|
3042
|
+
return /* @__PURE__ */ k(ge, { children: [
|
|
3043
|
+
/* @__PURE__ */ i(br, {}),
|
|
3044
|
+
!t && /* @__PURE__ */ k(ge, { children: [
|
|
3045
|
+
/* @__PURE__ */ i(bn, {}),
|
|
3032
3046
|
/* @__PURE__ */ i(Jn, {}),
|
|
3033
3047
|
/* @__PURE__ */ i(no, {}),
|
|
3034
3048
|
/* @__PURE__ */ i(Pn, {})
|
|
3035
3049
|
] }),
|
|
3036
3050
|
/* @__PURE__ */ i(ia, {})
|
|
3037
3051
|
] });
|
|
3038
|
-
}, sa = "_active_1yldl_11",
|
|
3052
|
+
}, sa = "_active_1yldl_11", Fe = {
|
|
3039
3053
|
"rp-zoom-wrapper": "_rp-zoom-wrapper_1yldl_1",
|
|
3040
3054
|
"rp-current-zoom-wrapper": "_rp-current-zoom-wrapper_1yldl_6",
|
|
3041
3055
|
active: sa,
|
|
@@ -3044,48 +3058,48 @@ const Oe = {
|
|
|
3044
3058
|
"rp-current-zoom-text": "_rp-current-zoom-text_1yldl_24",
|
|
3045
3059
|
"rp-zoom-dropdown-content": "_rp-zoom-dropdown-content_1yldl_28"
|
|
3046
3060
|
}, ca = ({ zoomLevel: t, className: e }) => {
|
|
3047
|
-
const { localeMessages: n } =
|
|
3061
|
+
const { localeMessages: n } = fe(), r = W(() => {
|
|
3048
3062
|
switch (t) {
|
|
3049
|
-
case
|
|
3063
|
+
case He.ACTUAL:
|
|
3050
3064
|
return n == null ? void 0 : n.zoomActualSize;
|
|
3051
|
-
case
|
|
3065
|
+
case He.PAGE_FIT:
|
|
3052
3066
|
return n == null ? void 0 : n.zoomPageFit;
|
|
3053
|
-
case
|
|
3067
|
+
case He.PAGE_WIDTH:
|
|
3054
3068
|
return n == null ? void 0 : n.zoomPageWidth;
|
|
3055
3069
|
}
|
|
3056
3070
|
return t.toString();
|
|
3057
3071
|
}, [t, n]);
|
|
3058
|
-
return /* @__PURE__ */ i(
|
|
3072
|
+
return /* @__PURE__ */ i(ge, { children: typeof t == "number" ? /* @__PURE__ */ k(mo, { children: [
|
|
3059
3073
|
/* @__PURE__ */ i("span", { className: e, children: t }),
|
|
3060
3074
|
/* @__PURE__ */ i("span", { className: e, children: "%" })
|
|
3061
3075
|
] }) : /* @__PURE__ */ i("span", { className: e, children: r }) });
|
|
3062
3076
|
}, la = [50, 75, 100, 125, 150, 200, 300, 400], da = () => {
|
|
3063
|
-
const { zoomInIcon: t } =
|
|
3077
|
+
const { zoomInIcon: t } = _e(), { zoomInIcon: e } = we();
|
|
3064
3078
|
return t || e || /* @__PURE__ */ i(Hr, {});
|
|
3065
3079
|
}, ua = () => {
|
|
3066
|
-
const { zoomOutIcon: t } =
|
|
3080
|
+
const { zoomOutIcon: t } = _e(), { zoomOutIcon: e } = we();
|
|
3067
3081
|
return t || e || /* @__PURE__ */ i($r, {});
|
|
3068
3082
|
}, pa = () => {
|
|
3069
|
-
const { zoomLevel: t, setZoomLevel: e, currentZoom: n } =
|
|
3083
|
+
const { zoomLevel: t, setZoomLevel: e, currentZoom: n } = rt(), { container: r, pagesRef: o } = Ce(), { zoomTool: a = !0 } = ye(), { zoomTool: c = !0 } = Se(), { isSmallScreen: d } = Re(), { localeMessages: s } = fe(), [f, m] = H(0), [T, u] = H(!1), C = M(
|
|
3070
3084
|
new ResizeObserver((g) => {
|
|
3071
3085
|
m(g[0].contentRect.height);
|
|
3072
3086
|
})
|
|
3073
|
-
),
|
|
3087
|
+
), w = O(() => {
|
|
3074
3088
|
e(() => {
|
|
3075
3089
|
const g = Math.floor(n * 100 / 25) * 25;
|
|
3076
3090
|
return Math.min(g + 25, Bt);
|
|
3077
3091
|
});
|
|
3078
|
-
}, [e, n]), P =
|
|
3092
|
+
}, [e, n]), P = O(() => {
|
|
3079
3093
|
e(() => {
|
|
3080
3094
|
const g = Math.ceil(n * 100 / 25) * 25;
|
|
3081
3095
|
return Math.min(g - 25, Bt);
|
|
3082
3096
|
});
|
|
3083
|
-
}, [e, n]), y = W(() => Gr(n), [n]),
|
|
3084
|
-
return
|
|
3085
|
-
|
|
3086
|
-
}), [o]), !a || !c ? null : typeof a == "function" ? /* @__PURE__ */ i(a, { zoomLevel: t, setZoomLevel: e }) : typeof c == "function" ? /* @__PURE__ */ i(c, { zoomLevel: t, setZoomLevel: e }) : /* @__PURE__ */ k("div", { className:
|
|
3097
|
+
}, [e, n]), y = W(() => Gr(n), [n]), b = W(() => Ur(n), [n]);
|
|
3098
|
+
return z(() => (o && C.current.observe(o), () => {
|
|
3099
|
+
C.current.disconnect();
|
|
3100
|
+
}), [o]), !a || !c ? null : typeof a == "function" ? /* @__PURE__ */ i(a, { zoomLevel: t, setZoomLevel: e }) : typeof c == "function" ? /* @__PURE__ */ i(c, { zoomLevel: t, setZoomLevel: e }) : /* @__PURE__ */ k("div", { className: Fe["rp-zoom-wrapper"], children: [
|
|
3087
3101
|
/* @__PURE__ */ i(K, { content: s == null ? void 0 : s.zoomOutTooltip, children: /* @__PURE__ */ i(
|
|
3088
|
-
|
|
3102
|
+
pe,
|
|
3089
3103
|
{
|
|
3090
3104
|
disabled: y,
|
|
3091
3105
|
onClick: P,
|
|
@@ -3097,14 +3111,14 @@ const Oe = {
|
|
|
3097
3111
|
Rt,
|
|
3098
3112
|
{
|
|
3099
3113
|
container: r,
|
|
3100
|
-
open:
|
|
3114
|
+
open: T,
|
|
3101
3115
|
onOpenChange: u,
|
|
3102
3116
|
triggerComponent: /* @__PURE__ */ i("div", { role: "button", children: /* @__PURE__ */ i(K, { content: s == null ? void 0 : s.zoomSelectTooltip, children: /* @__PURE__ */ k(
|
|
3103
|
-
|
|
3117
|
+
pe,
|
|
3104
3118
|
{
|
|
3105
|
-
className:
|
|
3106
|
-
|
|
3107
|
-
|
|
3119
|
+
className: le(
|
|
3120
|
+
Fe["rp-current-zoom-wrapper"],
|
|
3121
|
+
T && Fe.active
|
|
3108
3122
|
),
|
|
3109
3123
|
"aria-label": s == null ? void 0 : s.zoomSelectTooltip,
|
|
3110
3124
|
children: [
|
|
@@ -3112,10 +3126,10 @@ const Oe = {
|
|
|
3112
3126
|
ca,
|
|
3113
3127
|
{
|
|
3114
3128
|
zoomLevel: t,
|
|
3115
|
-
className:
|
|
3129
|
+
className: Fe["rp-current-zoom-text"]
|
|
3116
3130
|
}
|
|
3117
3131
|
),
|
|
3118
|
-
/* @__PURE__ */ i(
|
|
3132
|
+
/* @__PURE__ */ i(Be, { className: Fe["rp-current-zoom-icon"] })
|
|
3119
3133
|
]
|
|
3120
3134
|
}
|
|
3121
3135
|
) }) }),
|
|
@@ -3127,15 +3141,15 @@ const Oe = {
|
|
|
3127
3141
|
"div",
|
|
3128
3142
|
{
|
|
3129
3143
|
style: { maxHeight: `${f}px`, overflow: "auto" },
|
|
3130
|
-
className:
|
|
3144
|
+
className: Fe["rp-zoom-dropdown-content"],
|
|
3131
3145
|
children: [
|
|
3132
|
-
/* @__PURE__ */ k(
|
|
3133
|
-
/* @__PURE__ */ i(xe, { onClick: () => e(
|
|
3134
|
-
/* @__PURE__ */ i(xe, { onClick: () => e(
|
|
3135
|
-
/* @__PURE__ */ i(xe, { onClick: () => e(
|
|
3146
|
+
/* @__PURE__ */ k(nt, { children: [
|
|
3147
|
+
/* @__PURE__ */ i(xe, { onClick: () => e(He.ACTUAL), children: s == null ? void 0 : s.zoomActualSize }),
|
|
3148
|
+
/* @__PURE__ */ i(xe, { onClick: () => e(He.PAGE_FIT), children: s == null ? void 0 : s.zoomPageFit }),
|
|
3149
|
+
/* @__PURE__ */ i(xe, { onClick: () => e(He.PAGE_WIDTH), children: s == null ? void 0 : s.zoomPageWidth })
|
|
3136
3150
|
] }),
|
|
3137
3151
|
/* @__PURE__ */ i(Lt, {}),
|
|
3138
|
-
/* @__PURE__ */ i(
|
|
3152
|
+
/* @__PURE__ */ i(nt, { children: la.map((g) => /* @__PURE__ */ k(xe, { onClick: () => e(g), children: [
|
|
3139
3153
|
g,
|
|
3140
3154
|
" %"
|
|
3141
3155
|
] }, g)) })
|
|
@@ -3145,25 +3159,25 @@ const Oe = {
|
|
|
3145
3159
|
}
|
|
3146
3160
|
),
|
|
3147
3161
|
/* @__PURE__ */ i(K, { content: s == null ? void 0 : s.zoomInTooltip, children: /* @__PURE__ */ i(
|
|
3148
|
-
|
|
3162
|
+
pe,
|
|
3149
3163
|
{
|
|
3150
|
-
disabled:
|
|
3151
|
-
onClick:
|
|
3164
|
+
disabled: b,
|
|
3165
|
+
onClick: w,
|
|
3152
3166
|
"aria-label": s == null ? void 0 : s.zoomInTooltip,
|
|
3153
3167
|
children: /* @__PURE__ */ i(da, {})
|
|
3154
3168
|
}
|
|
3155
3169
|
) })
|
|
3156
3170
|
] });
|
|
3157
3171
|
}, hn = () => {
|
|
3158
|
-
const { totalMatches: t, nextMatch: e, prevMatch: n } = At(), { localeMessages: r } =
|
|
3159
|
-
return /* @__PURE__ */ k(
|
|
3172
|
+
const { totalMatches: t, nextMatch: e, prevMatch: n } = At(), { localeMessages: r } = fe(), o = !t || t === 0;
|
|
3173
|
+
return /* @__PURE__ */ k(ge, { children: [
|
|
3160
3174
|
/* @__PURE__ */ i(
|
|
3161
3175
|
K,
|
|
3162
3176
|
{
|
|
3163
3177
|
content: r == null ? void 0 : r.searchPrevTooltip,
|
|
3164
|
-
className:
|
|
3178
|
+
className: oe["rp-search-tool-result-navigator"],
|
|
3165
3179
|
children: /* @__PURE__ */ i(
|
|
3166
|
-
|
|
3180
|
+
pe,
|
|
3167
3181
|
{
|
|
3168
3182
|
tabIndex: 0,
|
|
3169
3183
|
onClick: n,
|
|
@@ -3171,9 +3185,9 @@ const Oe = {
|
|
|
3171
3185
|
disabled: o,
|
|
3172
3186
|
"aria-disabled": o,
|
|
3173
3187
|
children: /* @__PURE__ */ i(
|
|
3174
|
-
|
|
3188
|
+
Be,
|
|
3175
3189
|
{
|
|
3176
|
-
className:
|
|
3190
|
+
className: oe["rp-search-tool-input-icon"],
|
|
3177
3191
|
"aria-hidden": "true"
|
|
3178
3192
|
}
|
|
3179
3193
|
)
|
|
@@ -3185,9 +3199,9 @@ const Oe = {
|
|
|
3185
3199
|
K,
|
|
3186
3200
|
{
|
|
3187
3201
|
content: r == null ? void 0 : r.searchNextTooltip,
|
|
3188
|
-
className:
|
|
3202
|
+
className: oe["rp-search-tool-result-navigator"],
|
|
3189
3203
|
children: /* @__PURE__ */ i(
|
|
3190
|
-
|
|
3204
|
+
pe,
|
|
3191
3205
|
{
|
|
3192
3206
|
tabIndex: 0,
|
|
3193
3207
|
onClick: e,
|
|
@@ -3195,10 +3209,10 @@ const Oe = {
|
|
|
3195
3209
|
disabled: o,
|
|
3196
3210
|
"aria-disabled": o,
|
|
3197
3211
|
children: /* @__PURE__ */ i(
|
|
3198
|
-
|
|
3212
|
+
Be,
|
|
3199
3213
|
{
|
|
3200
3214
|
style: { transform: "rotate(180deg" },
|
|
3201
|
-
className:
|
|
3215
|
+
className: oe["rp-search-tool-input-icon"],
|
|
3202
3216
|
"aria-hidden": "true"
|
|
3203
3217
|
}
|
|
3204
3218
|
)
|
|
@@ -3208,93 +3222,93 @@ const Oe = {
|
|
|
3208
3222
|
)
|
|
3209
3223
|
] });
|
|
3210
3224
|
}, ha = () => {
|
|
3211
|
-
const { searchIcon: t } =
|
|
3225
|
+
const { searchIcon: t } = _e(), { searchIcon: e } = we();
|
|
3212
3226
|
return t || e || /* @__PURE__ */ i(Cn, {});
|
|
3213
3227
|
}, fa = ({ icon: t }) => {
|
|
3214
|
-
const { container: e } =
|
|
3228
|
+
const { container: e } = Ce(), [n, r] = H(!1), { pdf: o } = re(), [a, c] = H(null), {
|
|
3215
3229
|
searchOptions: d,
|
|
3216
3230
|
setSearchOptions: s,
|
|
3217
3231
|
loading: f,
|
|
3218
3232
|
setSearch: m,
|
|
3219
|
-
totalMatches:
|
|
3233
|
+
totalMatches: T,
|
|
3220
3234
|
currentMatchPosition: u,
|
|
3221
|
-
nextMatch:
|
|
3222
|
-
prevMatch:
|
|
3235
|
+
nextMatch: C,
|
|
3236
|
+
prevMatch: w,
|
|
3223
3237
|
search: P
|
|
3224
|
-
} = At(), { searchTool: y = !0 } =
|
|
3238
|
+
} = At(), { searchTool: y = !0 } = ye(), { searchTool: b = !0 } = Se(), [g, h] = H(P), { localeMessages: p } = fe(), { isSmallScreen: l } = Re(), [v, _] = H(null), [I, x] = H(!1), S = O(() => {
|
|
3225
3239
|
r(!0);
|
|
3226
|
-
}, []), R =
|
|
3240
|
+
}, []), R = O(() => {
|
|
3227
3241
|
m(""), h(""), r(!1);
|
|
3228
|
-
}, [m]),
|
|
3229
|
-
const Y =
|
|
3242
|
+
}, [m]), N = (G) => {
|
|
3243
|
+
const Y = G.key === "Enter", J = G.key === " ";
|
|
3230
3244
|
(Y || J) && R();
|
|
3231
|
-
},
|
|
3232
|
-
(
|
|
3233
|
-
|
|
3245
|
+
}, A = O(
|
|
3246
|
+
(G) => {
|
|
3247
|
+
G.key === "Escape" && n && R();
|
|
3234
3248
|
},
|
|
3235
3249
|
[n]
|
|
3236
|
-
),
|
|
3237
|
-
(
|
|
3238
|
-
|
|
3250
|
+
), F = O(
|
|
3251
|
+
(G) => {
|
|
3252
|
+
G.shiftKey && G.key === "Enter" ? w() : G.key === "Enter" && P !== g ? m(g) : G.key === "Enter" && C();
|
|
3239
3253
|
},
|
|
3240
|
-
[g,
|
|
3254
|
+
[g, w, C, m, P]
|
|
3241
3255
|
);
|
|
3242
|
-
|
|
3256
|
+
z(() => {
|
|
3243
3257
|
h(P);
|
|
3244
|
-
}, [P]),
|
|
3245
|
-
P && o &&
|
|
3246
|
-
}, [P, o]),
|
|
3258
|
+
}, [P]), z(() => {
|
|
3259
|
+
P && o && x(!0);
|
|
3260
|
+
}, [P, o]), z(() => {
|
|
3247
3261
|
P && P.trim() !== "" && (h(P), m(P));
|
|
3248
|
-
}, []),
|
|
3249
|
-
window.removeEventListener("keydown",
|
|
3250
|
-
}), [
|
|
3262
|
+
}, []), z(() => (window.addEventListener("keydown", A), () => {
|
|
3263
|
+
window.removeEventListener("keydown", A);
|
|
3264
|
+
}), [A]), z(() => {
|
|
3251
3265
|
a && setTimeout(() => {
|
|
3252
3266
|
a.focus();
|
|
3253
3267
|
}, 0);
|
|
3254
3268
|
}, [a]);
|
|
3255
|
-
const
|
|
3256
|
-
h(
|
|
3257
|
-
}, []), L =
|
|
3269
|
+
const D = O((G) => {
|
|
3270
|
+
h(G.target.value);
|
|
3271
|
+
}, []), L = O(() => {
|
|
3258
3272
|
h(""), m("");
|
|
3259
|
-
}, [m]),
|
|
3260
|
-
(
|
|
3261
|
-
s((Y) => ({ ...Y, matchCase:
|
|
3273
|
+
}, [m]), E = W(() => `${u} / ${T}`, [u, T]), { wholeWords: U, matchCase: V } = W(() => d, [d]), $ = O(
|
|
3274
|
+
(G) => {
|
|
3275
|
+
s((Y) => ({ ...Y, matchCase: G }));
|
|
3262
3276
|
},
|
|
3263
3277
|
[s]
|
|
3264
|
-
),
|
|
3265
|
-
(
|
|
3266
|
-
s((Y) => ({ ...Y, wholeWords:
|
|
3278
|
+
), q = O(
|
|
3279
|
+
(G) => {
|
|
3280
|
+
s((Y) => ({ ...Y, wholeWords: G }));
|
|
3267
3281
|
},
|
|
3268
3282
|
[s]
|
|
3269
3283
|
);
|
|
3270
|
-
|
|
3284
|
+
z(() => {
|
|
3271
3285
|
o && I && R();
|
|
3272
3286
|
}, [o, R]);
|
|
3273
|
-
const
|
|
3274
|
-
(
|
|
3275
|
-
if (
|
|
3287
|
+
const j = W(() => (v == null ? void 0 : v.querySelectorAll('[tabindex]:not([tabindex="-1"])')) || [], [v]), te = O(
|
|
3288
|
+
(G) => {
|
|
3289
|
+
if (G.key === "Tab") {
|
|
3276
3290
|
const Y = document.activeElement;
|
|
3277
3291
|
let J = 0;
|
|
3278
|
-
|
|
3279
|
-
Q === Y && (J =
|
|
3292
|
+
j.forEach((Q, ie) => {
|
|
3293
|
+
Q === Y && (J = ie);
|
|
3280
3294
|
});
|
|
3281
|
-
let
|
|
3282
|
-
|
|
3283
|
-
const
|
|
3284
|
-
if (
|
|
3285
|
-
|
|
3286
|
-
else if (
|
|
3287
|
-
const Q =
|
|
3295
|
+
let me = J + 1;
|
|
3296
|
+
G.shiftKey && (me = J - 1);
|
|
3297
|
+
const ne = j[me];
|
|
3298
|
+
if (ne)
|
|
3299
|
+
ne.focus();
|
|
3300
|
+
else if (me > j.length - 1) {
|
|
3301
|
+
const Q = j[0];
|
|
3288
3302
|
Q && Q.focus();
|
|
3289
3303
|
} else {
|
|
3290
|
-
const Q =
|
|
3304
|
+
const Q = j[j.length - 1];
|
|
3291
3305
|
Q && Q.focus();
|
|
3292
3306
|
}
|
|
3293
3307
|
}
|
|
3294
3308
|
},
|
|
3295
|
-
[
|
|
3309
|
+
[j]
|
|
3296
3310
|
);
|
|
3297
|
-
return !y || !
|
|
3311
|
+
return !y || !b ? null : /* @__PURE__ */ i(ge, { children: /* @__PURE__ */ i(
|
|
3298
3312
|
Rt,
|
|
3299
3313
|
{
|
|
3300
3314
|
open: n,
|
|
@@ -3304,10 +3318,10 @@ const Oe = {
|
|
|
3304
3318
|
tabIndex: 0,
|
|
3305
3319
|
avoidCollisions: !1,
|
|
3306
3320
|
triggerComponent: /* @__PURE__ */ i(K, { content: p == null ? void 0 : p.searchButtonTooltip, children: /* @__PURE__ */ i(
|
|
3307
|
-
|
|
3321
|
+
pe,
|
|
3308
3322
|
{
|
|
3309
3323
|
active: n,
|
|
3310
|
-
onClick:
|
|
3324
|
+
onClick: S,
|
|
3311
3325
|
"aria-label": p == null ? void 0 : p.searchButtonTooltip,
|
|
3312
3326
|
"aria-expanded": n,
|
|
3313
3327
|
"aria-haspopup": "dialog",
|
|
@@ -3318,23 +3332,23 @@ const Oe = {
|
|
|
3318
3332
|
"div",
|
|
3319
3333
|
{
|
|
3320
3334
|
ref: _,
|
|
3321
|
-
className:
|
|
3335
|
+
className: oe["rp-search-tool-content"],
|
|
3322
3336
|
tabIndex: 0,
|
|
3323
|
-
onKeyDown:
|
|
3337
|
+
onKeyDown: te,
|
|
3324
3338
|
role: "dialog",
|
|
3325
3339
|
"aria-label": (p == null ? void 0 : p.searchInputTooltip) || "Search dialog",
|
|
3326
3340
|
children: [
|
|
3327
|
-
/* @__PURE__ */ k("div", { className:
|
|
3328
|
-
/* @__PURE__ */ k("div", { className:
|
|
3341
|
+
/* @__PURE__ */ k("div", { className: oe["rp-search-tool-input-wrapper"], children: [
|
|
3342
|
+
/* @__PURE__ */ k("div", { className: oe["rp-search-tool-input"], children: [
|
|
3329
3343
|
/* @__PURE__ */ i(K, { content: p == null ? void 0 : p.searchInputTooltip, children: /* @__PURE__ */ i(
|
|
3330
3344
|
gn,
|
|
3331
3345
|
{
|
|
3332
3346
|
value: g,
|
|
3333
|
-
onKeyDown:
|
|
3334
|
-
onChange:
|
|
3347
|
+
onKeyDown: F,
|
|
3348
|
+
onChange: D,
|
|
3335
3349
|
icon: /* @__PURE__ */ i(Cn, {}),
|
|
3336
3350
|
placeholder: p == null ? void 0 : p.searchInputPlaceholder,
|
|
3337
|
-
className:
|
|
3351
|
+
className: oe["rp-search-input"],
|
|
3338
3352
|
ref: c,
|
|
3339
3353
|
id: "search-input",
|
|
3340
3354
|
name: "search-input",
|
|
@@ -3344,60 +3358,60 @@ const Oe = {
|
|
|
3344
3358
|
children: !!g && /* @__PURE__ */ i(
|
|
3345
3359
|
"span",
|
|
3346
3360
|
{
|
|
3347
|
-
className:
|
|
3361
|
+
className: oe["rp-search-tool-input-clear"],
|
|
3348
3362
|
onClick: L,
|
|
3349
3363
|
role: "button",
|
|
3350
3364
|
tabIndex: 0,
|
|
3351
3365
|
"aria-label": (p == null ? void 0 : p.searchCloseButtonTooltip) || "Clear search",
|
|
3352
|
-
onKeyDown: (
|
|
3353
|
-
(
|
|
3366
|
+
onKeyDown: (G) => {
|
|
3367
|
+
(G.key === "Enter" || G.key === " ") && (G.preventDefault(), L());
|
|
3354
3368
|
},
|
|
3355
3369
|
children: /* @__PURE__ */ i(Vr, {})
|
|
3356
3370
|
}
|
|
3357
3371
|
)
|
|
3358
3372
|
}
|
|
3359
3373
|
) }),
|
|
3360
|
-
f ? /* @__PURE__ */ i("span", { "aria-live": "polite", "aria-label": "Searching", children: /* @__PURE__ */ i(
|
|
3361
|
-
l && /* @__PURE__ */ i("div", { className:
|
|
3374
|
+
f ? /* @__PURE__ */ i("span", { "aria-live": "polite", "aria-label": "Searching", children: /* @__PURE__ */ i(_n, { className: oe["rp-search-loader-icon"], "aria-hidden": "true" }) }) : /* @__PURE__ */ i("span", { id: "search-results-count", "aria-live": "polite", children: E }),
|
|
3375
|
+
l && /* @__PURE__ */ i("div", { className: oe["rp-search-tool-controls"], children: /* @__PURE__ */ i(Ut, { onKeyPress: N, handleClose: R }) })
|
|
3362
3376
|
] }),
|
|
3363
|
-
/* @__PURE__ */ k("div", { className:
|
|
3377
|
+
/* @__PURE__ */ k("div", { className: oe["rp-search-tool-input-checkboxes"], children: [
|
|
3364
3378
|
l && /* @__PURE__ */ i(hn, {}),
|
|
3365
3379
|
/* @__PURE__ */ i(
|
|
3366
3380
|
Vt,
|
|
3367
3381
|
{
|
|
3368
3382
|
tabIndex: 0,
|
|
3369
3383
|
name: "matchCase",
|
|
3370
|
-
value:
|
|
3371
|
-
onChange:
|
|
3384
|
+
value: V,
|
|
3385
|
+
onChange: $,
|
|
3372
3386
|
"aria-label": p == null ? void 0 : p.searchMatchCaseLabel,
|
|
3373
3387
|
children: p == null ? void 0 : p.searchMatchCaseLabel
|
|
3374
3388
|
}
|
|
3375
3389
|
),
|
|
3376
|
-
!l && /* @__PURE__ */ i(K, { content: p == null ? void 0 : p.searchMatchCaseTooltip, children: /* @__PURE__ */ i("div", { className:
|
|
3390
|
+
!l && /* @__PURE__ */ i(K, { content: p == null ? void 0 : p.searchMatchCaseTooltip, children: /* @__PURE__ */ i("div", { className: oe["rp-search-icon-info"], tabIndex: 0, children: /* @__PURE__ */ i(Xt, {}) }) }),
|
|
3377
3391
|
/* @__PURE__ */ i(
|
|
3378
3392
|
Vt,
|
|
3379
3393
|
{
|
|
3380
3394
|
tabIndex: 0,
|
|
3381
3395
|
name: "wholeWord",
|
|
3382
|
-
value:
|
|
3383
|
-
onChange:
|
|
3396
|
+
value: U,
|
|
3397
|
+
onChange: q,
|
|
3384
3398
|
"aria-label": p == null ? void 0 : p.searchWholeWordsLabel,
|
|
3385
3399
|
children: p == null ? void 0 : p.searchWholeWordsLabel
|
|
3386
3400
|
}
|
|
3387
3401
|
),
|
|
3388
|
-
!l && /* @__PURE__ */ i(K, { content: p == null ? void 0 : p.searchWholeWordsTooltip, children: /* @__PURE__ */ i("div", { tabIndex: 0, className:
|
|
3402
|
+
!l && /* @__PURE__ */ i(K, { content: p == null ? void 0 : p.searchWholeWordsTooltip, children: /* @__PURE__ */ i("div", { tabIndex: 0, className: oe["rp-search-icon-info"], children: /* @__PURE__ */ i(Xt, {}) }) })
|
|
3389
3403
|
] })
|
|
3390
3404
|
] }),
|
|
3391
|
-
!l && /* @__PURE__ */ k("div", { className:
|
|
3405
|
+
!l && /* @__PURE__ */ k("div", { className: oe["rp-search-tool-controls"], children: [
|
|
3392
3406
|
/* @__PURE__ */ i(hn, {}),
|
|
3393
|
-
/* @__PURE__ */ i(Ut, { onKeyPress:
|
|
3407
|
+
/* @__PURE__ */ i(Ut, { onKeyPress: N, handleClose: R })
|
|
3394
3408
|
] })
|
|
3395
3409
|
]
|
|
3396
3410
|
}
|
|
3397
3411
|
)
|
|
3398
3412
|
}
|
|
3399
3413
|
) });
|
|
3400
|
-
}, ma = "_loading_wazy2_1",
|
|
3414
|
+
}, ma = "_loading_wazy2_1", ke = {
|
|
3401
3415
|
"rp-loading-overlay": "_rp-loading-overlay_wazy2_1",
|
|
3402
3416
|
"rp-loading-modal": "_rp-loading-modal_wazy2_14",
|
|
3403
3417
|
"rp-loading-title": "_rp-loading-title_wazy2_27",
|
|
@@ -3406,66 +3420,66 @@ const Oe = {
|
|
|
3406
3420
|
"rp-loading-cancel-button": "_rp-loading-cancel-button_wazy2_55",
|
|
3407
3421
|
loading: ma
|
|
3408
3422
|
}, ga = ({ percentage: t }) => {
|
|
3409
|
-
const { cancel: e } =
|
|
3410
|
-
return t < 1 ? null : /* @__PURE__ */ i("div", { className:
|
|
3411
|
-
/* @__PURE__ */ k("div", { className:
|
|
3423
|
+
const { cancel: e } = ct(), { localeMessages: n } = fe();
|
|
3424
|
+
return t < 1 ? null : /* @__PURE__ */ i("div", { className: le(ke["rp-loading-overlay"]), children: /* @__PURE__ */ k("div", { className: le(ke["rp-loading-modal"]), children: [
|
|
3425
|
+
/* @__PURE__ */ k("div", { className: le(ke["rp-loading-title"]), children: [
|
|
3412
3426
|
n == null ? void 0 : n.printLoadingMessage,
|
|
3413
3427
|
"..."
|
|
3414
3428
|
] }),
|
|
3415
|
-
/* @__PURE__ */ i("div", { className:
|
|
3429
|
+
/* @__PURE__ */ i("div", { className: le(ke["rp-loading-progress-bar"]), children: /* @__PURE__ */ i(
|
|
3416
3430
|
"div",
|
|
3417
3431
|
{
|
|
3418
|
-
className:
|
|
3432
|
+
className: le(ke["rp-loading-progress"]),
|
|
3419
3433
|
style: { width: `${t}%` }
|
|
3420
3434
|
}
|
|
3421
3435
|
) }),
|
|
3422
|
-
/* @__PURE__ */ i("button", { className:
|
|
3436
|
+
/* @__PURE__ */ i("button", { className: le(ke["rp-loading-cancel-button"]), onClick: e, children: n == null ? void 0 : n.printCancelLabel })
|
|
3423
3437
|
] }) });
|
|
3424
|
-
}, va =
|
|
3425
|
-
const { showPrintProgress: n = !0 } =
|
|
3438
|
+
}, va = st((t, e) => {
|
|
3439
|
+
const { showPrintProgress: n = !0 } = ye(), { showPrintProgress: r = !0 } = Se(), { progress: o, showDefaultProgress: a } = ct(), { isSmallScreen: c } = Re(), { percentage: d } = o || {}, s = () => c ? { gridTemplateColumns: "25% 60% 15%" } : void 0, f = () => {
|
|
3426
3440
|
if (!(!(a ?? (n && r)) || !d))
|
|
3427
3441
|
return /* @__PURE__ */ i(ga, { percentage: d });
|
|
3428
3442
|
};
|
|
3429
3443
|
return /* @__PURE__ */ k("div", { children: [
|
|
3430
|
-
/* @__PURE__ */ i("div", { "data-rp": "topBar", ref: e, className:
|
|
3431
|
-
/* @__PURE__ */ k("div", { "data-rp": "topBarLeft", className:
|
|
3444
|
+
/* @__PURE__ */ i("div", { "data-rp": "topBar", ref: e, className: Ue["rp-toolbar-content"], children: /* @__PURE__ */ k("div", { className: Ue["rp-toolbar-wrapper"], style: s(), children: [
|
|
3445
|
+
/* @__PURE__ */ k("div", { "data-rp": "topBarLeft", className: Ue["rp-toolbar-start"], children: [
|
|
3432
3446
|
/* @__PURE__ */ i(fa, {}),
|
|
3433
3447
|
/* @__PURE__ */ i(Li, {})
|
|
3434
3448
|
] }),
|
|
3435
|
-
/* @__PURE__ */ i("div", { "data-rp": "topBarCenter", className:
|
|
3436
|
-
/* @__PURE__ */ i("div", { "data-rp": "topBarRight", className:
|
|
3449
|
+
/* @__PURE__ */ i("div", { "data-rp": "topBarCenter", className: Ue["rp-toolbar-middle"], children: /* @__PURE__ */ i(pa, {}) }),
|
|
3450
|
+
/* @__PURE__ */ i("div", { "data-rp": "topBarRight", className: Ue["rp-toolbar-end"], children: /* @__PURE__ */ i(aa, {}) })
|
|
3437
3451
|
] }) }),
|
|
3438
3452
|
/* @__PURE__ */ i(f, {})
|
|
3439
3453
|
] });
|
|
3440
|
-
}),
|
|
3454
|
+
}), Ve = {
|
|
3441
3455
|
"rp-thumbnail-wrapper": "_rp-thumbnail-wrapper_3fenb_1",
|
|
3442
3456
|
"rp-thumbnail-text": "_rp-thumbnail-text_3fenb_10",
|
|
3443
3457
|
"rp-thumbnail": "_rp-thumbnail_3fenb_1",
|
|
3444
3458
|
"rp-thumbnail-active": "_rp-thumbnail-active_3fenb_22",
|
|
3445
3459
|
"rp-thumbnail-loader": "_rp-thumbnail-loader_3fenb_31"
|
|
3446
3460
|
}, wa = (t) => {
|
|
3447
|
-
const { pageNumber: e, isFocused: n, viewport: r } = t, { goToPage: o } =
|
|
3461
|
+
const { pageNumber: e, isFocused: n, viewport: r } = t, { goToPage: o } = de(), { pageRotate: a } = at(), c = M(null), d = Nn(), { pages: s } = re(), [f, m] = H(null), T = M(!1), u = M(), C = W(() => n ? Ve["rp-thumbnail-active"] : "", [n]), w = W(() => ({
|
|
3448
3462
|
width: Math.round(r.width),
|
|
3449
3463
|
height: Math.round(r.height)
|
|
3450
|
-
}), [r]), P =
|
|
3464
|
+
}), [r]), P = O(() => {
|
|
3451
3465
|
e && o(e);
|
|
3452
3466
|
}, [o, e]);
|
|
3453
|
-
return
|
|
3467
|
+
return z(() => {
|
|
3454
3468
|
const y = s.get(e);
|
|
3455
3469
|
u.current === y || (m(null), u.current = y);
|
|
3456
|
-
}, [s, e]),
|
|
3470
|
+
}, [s, e]), z(() => {
|
|
3457
3471
|
const y = s.get(e);
|
|
3458
3472
|
if (!c.current || !e || !y || f)
|
|
3459
3473
|
return;
|
|
3460
|
-
const
|
|
3474
|
+
const b = new IntersectionObserver((g) => {
|
|
3461
3475
|
g.forEach((h) => {
|
|
3462
|
-
if (
|
|
3463
|
-
|
|
3476
|
+
if (T.current) {
|
|
3477
|
+
T.current = !1, d.removeQueue(`thumbnail-${e}`);
|
|
3464
3478
|
return;
|
|
3465
3479
|
}
|
|
3466
3480
|
if (h.isIntersecting) {
|
|
3467
3481
|
const p = document.createElement("canvas");
|
|
3468
|
-
|
|
3482
|
+
T.current = !0, d.enqueue(
|
|
3469
3483
|
`thumbnail-${e}`,
|
|
3470
3484
|
{
|
|
3471
3485
|
page: y.page,
|
|
@@ -3487,8 +3501,8 @@ const Oe = {
|
|
|
3487
3501
|
}
|
|
3488
3502
|
});
|
|
3489
3503
|
});
|
|
3490
|
-
return c.current &&
|
|
3491
|
-
|
|
3504
|
+
return c.current && b.observe(c.current), () => {
|
|
3505
|
+
b.disconnect(), d.removeQueue(`thumbnail-${e}`);
|
|
3492
3506
|
};
|
|
3493
3507
|
}, [d, e, s, f]), /* @__PURE__ */ k(
|
|
3494
3508
|
"div",
|
|
@@ -3498,7 +3512,7 @@ const Oe = {
|
|
|
3498
3512
|
(y.key === "Enter" || y.key === " ") && (y.preventDefault(), P());
|
|
3499
3513
|
},
|
|
3500
3514
|
id: `page-${e}`,
|
|
3501
|
-
className:
|
|
3515
|
+
className: Ve["rp-thumbnail-wrapper"],
|
|
3502
3516
|
ref: c,
|
|
3503
3517
|
role: "button",
|
|
3504
3518
|
tabIndex: 0,
|
|
@@ -3511,71 +3525,71 @@ const Oe = {
|
|
|
3511
3525
|
style: {
|
|
3512
3526
|
transform: `rotate(${a[e || 0]}deg)`
|
|
3513
3527
|
},
|
|
3514
|
-
className:
|
|
3528
|
+
className: le(C, Ve["rp-thumbnail"]),
|
|
3515
3529
|
"aria-hidden": "true",
|
|
3516
3530
|
children: f ? /* @__PURE__ */ i(
|
|
3517
3531
|
"img",
|
|
3518
3532
|
{
|
|
3519
3533
|
src: f,
|
|
3520
|
-
width:
|
|
3521
|
-
height:
|
|
3534
|
+
width: w.width,
|
|
3535
|
+
height: w.height,
|
|
3522
3536
|
alt: `Page ${e} thumbnail`,
|
|
3523
3537
|
"aria-hidden": "true"
|
|
3524
3538
|
}
|
|
3525
3539
|
) : /* @__PURE__ */ i(
|
|
3526
3540
|
"div",
|
|
3527
3541
|
{
|
|
3528
|
-
className:
|
|
3542
|
+
className: Ve["rp-thumbnail-loader"],
|
|
3529
3543
|
style: {
|
|
3530
|
-
width: `${
|
|
3531
|
-
height: `${
|
|
3544
|
+
width: `${w.width}px`,
|
|
3545
|
+
height: `${w.height}px`
|
|
3532
3546
|
},
|
|
3533
|
-
children: /* @__PURE__ */ i(
|
|
3547
|
+
children: /* @__PURE__ */ i(_n, { "aria-hidden": "true" })
|
|
3534
3548
|
}
|
|
3535
3549
|
)
|
|
3536
3550
|
}
|
|
3537
3551
|
),
|
|
3538
|
-
/* @__PURE__ */ i("div", { className:
|
|
3552
|
+
/* @__PURE__ */ i("div", { className: Ve["rp-thumbnail-text"], "aria-hidden": "true", children: e })
|
|
3539
3553
|
]
|
|
3540
3554
|
}
|
|
3541
3555
|
);
|
|
3542
3556
|
}, fn = {
|
|
3543
3557
|
"rp-thumbnails-container": "_rp-thumbnails-container_70k68_1",
|
|
3544
3558
|
"rp-thumbnails": "_rp-thumbnails_70k68_1"
|
|
3545
|
-
},
|
|
3559
|
+
}, _a = 16, ba = (t, e) => {
|
|
3546
3560
|
const n = t == null ? void 0 : t.querySelector(`#page-${e}`);
|
|
3547
|
-
t && (n != null && n.offsetTop) && (t.scrollTop = (n == null ? void 0 : n.offsetTop) -
|
|
3548
|
-
}, Pa =
|
|
3549
|
-
const { show: n, width: r } = t, { focusedPage: o, totalPages: a } =
|
|
3561
|
+
t && (n != null && n.offsetTop) && (t.scrollTop = (n == null ? void 0 : n.offsetTop) - _a);
|
|
3562
|
+
}, Pa = st((t, e) => {
|
|
3563
|
+
const { show: n, width: r } = t, { focusedPage: o, totalPages: a } = de(), { thumbnailPages: c, addPage: d, thumbnailLength: s, addToPage: f } = Rn(), m = M(null), T = M(1);
|
|
3550
3564
|
mn(e, () => m.current);
|
|
3551
|
-
const u = W(() => Object.values(c), [c]),
|
|
3552
|
-
const
|
|
3553
|
-
|
|
3565
|
+
const u = W(() => Object.values(c), [c]), C = O(() => {
|
|
3566
|
+
const w = s + 1;
|
|
3567
|
+
w <= a && d(w);
|
|
3554
3568
|
}, [d, a, s]);
|
|
3555
|
-
return
|
|
3556
|
-
o > s && a > s ? f(o) : n &&
|
|
3557
|
-
}, [o, s, f, n, u]), Qo(m.current,
|
|
3558
|
-
var y,
|
|
3569
|
+
return z(() => {
|
|
3570
|
+
o > s && a > s ? f(o) : n && T.current !== o && (ba(m.current, o), T.current = o);
|
|
3571
|
+
}, [o, s, f, n, u]), Qo(m.current, C), /* @__PURE__ */ i("div", { ref: m, className: fn["rp-thumbnails-container"], style: { width: r }, children: /* @__PURE__ */ i("div", { className: fn["rp-thumbnails"], children: n ? u.map((w, P) => {
|
|
3572
|
+
var y, b;
|
|
3559
3573
|
return /* @__PURE__ */ i(
|
|
3560
3574
|
wa,
|
|
3561
3575
|
{
|
|
3562
|
-
isFocused: o === ((y =
|
|
3563
|
-
pageNumber: (
|
|
3564
|
-
loading:
|
|
3565
|
-
viewport:
|
|
3566
|
-
defaultRotation:
|
|
3576
|
+
isFocused: o === ((y = w.page) == null ? void 0 : y.pageNumber),
|
|
3577
|
+
pageNumber: (b = w.page) == null ? void 0 : b.pageNumber,
|
|
3578
|
+
loading: w.loading,
|
|
3579
|
+
viewport: w.viewport,
|
|
3580
|
+
defaultRotation: w.defaultRotation
|
|
3567
3581
|
},
|
|
3568
3582
|
P
|
|
3569
3583
|
);
|
|
3570
3584
|
}) : null }) });
|
|
3571
3585
|
}), Ta = () => {
|
|
3572
|
-
const { thumbnailIcon: t } =
|
|
3586
|
+
const { thumbnailIcon: t } = _e(), { thumbnailIcon: e } = we();
|
|
3573
3587
|
return t || e || /* @__PURE__ */ i($o, {});
|
|
3574
3588
|
}, Ca = () => {
|
|
3575
|
-
const { active: t, setActive: e } = Rn(), [n, r] = H(Yo), o = M(null), a = M(null), { thumbnailTool: c, sidebarEnable: d } =
|
|
3576
|
-
e((
|
|
3589
|
+
const { active: t, setActive: e } = Rn(), [n, r] = H(Yo), o = M(null), a = M(null), { thumbnailTool: c, sidebarEnable: d } = ye(), { localeMessages: s } = fe(), f = O(() => {
|
|
3590
|
+
e((T) => !T);
|
|
3577
3591
|
}, []), m = W(() => typeof c != "boolean" && c ? /* @__PURE__ */ i(c, { onClick: f, active: t }) : c ? /* @__PURE__ */ i(K, { content: s == null ? void 0 : s.thumbnailTooltip, children: /* @__PURE__ */ i(
|
|
3578
|
-
|
|
3592
|
+
pe,
|
|
3579
3593
|
{
|
|
3580
3594
|
onClick: f,
|
|
3581
3595
|
active: t,
|
|
@@ -3583,19 +3597,19 @@ const Oe = {
|
|
|
3583
3597
|
children: /* @__PURE__ */ i(Ta, {})
|
|
3584
3598
|
}
|
|
3585
3599
|
) }) : null, [c, t, f, s]);
|
|
3586
|
-
return /* @__PURE__ */ i(
|
|
3600
|
+
return /* @__PURE__ */ i(ge, { children: d && /* @__PURE__ */ k(
|
|
3587
3601
|
"div",
|
|
3588
3602
|
{
|
|
3589
3603
|
style: { "--rp-thumbnail-width": `${n}px` },
|
|
3590
|
-
className:
|
|
3604
|
+
className: Qe["rp-sidebar-content-wrapper"],
|
|
3591
3605
|
"data-rp": "sidebar",
|
|
3592
3606
|
children: [
|
|
3593
|
-
/* @__PURE__ */ i("div", { ref: a, className:
|
|
3607
|
+
/* @__PURE__ */ i("div", { ref: a, className: Qe["rp-sidebar-content"], children: m }),
|
|
3594
3608
|
/* @__PURE__ */ k(
|
|
3595
3609
|
"div",
|
|
3596
3610
|
{
|
|
3597
3611
|
"data-rp": "thumbnailSidebar",
|
|
3598
|
-
className: `${
|
|
3612
|
+
className: `${Qe["rp-thumbnails-wrapper"]} ${t ? "" : Qe["rp-thumbnails-wrapper-hidden"]}`,
|
|
3599
3613
|
children: [
|
|
3600
3614
|
/* @__PURE__ */ i(Pa, { show: t, ref: o }),
|
|
3601
3615
|
/* @__PURE__ */ i(
|
|
@@ -3623,11 +3637,11 @@ const Oe = {
|
|
|
3623
3637
|
onLoaded: s,
|
|
3624
3638
|
cleanupOnLoaded: f,
|
|
3625
3639
|
onLayoutWidthChange: m
|
|
3626
|
-
} = t, [
|
|
3627
|
-
return
|
|
3640
|
+
} = t, [T, u] = H(null), { setContainer: C, setContentRef: w } = Ce(), { loading: P } = re(), { LoaderImageComponent: y } = St();
|
|
3641
|
+
return z(() => (s && s(), () => {
|
|
3628
3642
|
f && f();
|
|
3629
3643
|
}), [s, f]), // TODO: deprecated in v2.0.0, remove later ~
|
|
3630
|
-
/* @__PURE__ */ i(zn, { toolbarRef:
|
|
3644
|
+
/* @__PURE__ */ i(zn, { toolbarRef: T, ref: e, children: /* @__PURE__ */ i(Vo, { mobileWidth: d, onLayoutWidthChange: m, children: /* @__PURE__ */ i(qo, { slots: r, children: /* @__PURE__ */ i(Ko, { icons: o, children: /* @__PURE__ */ k(Uo, { getContainerRef: C, style: a, className: c, children: [
|
|
3631
3645
|
/* @__PURE__ */ i(Gt, { href: "#rp-menu", label: "Skip to Menu" }),
|
|
3632
3646
|
/* @__PURE__ */ i(Gt, { href: "#rp-main-content", label: "Skip to Main Content" }),
|
|
3633
3647
|
/* @__PURE__ */ k(Bo, { children: [
|
|
@@ -3652,7 +3666,7 @@ const Oe = {
|
|
|
3652
3666
|
"main",
|
|
3653
3667
|
{
|
|
3654
3668
|
id: "rp-main-content",
|
|
3655
|
-
ref:
|
|
3669
|
+
ref: w,
|
|
3656
3670
|
className: Ie["rp-pages"],
|
|
3657
3671
|
role: "main",
|
|
3658
3672
|
"aria-label": "PDF document pages",
|
|
@@ -3661,7 +3675,7 @@ const Oe = {
|
|
|
3661
3675
|
)
|
|
3662
3676
|
] })
|
|
3663
3677
|
] }),
|
|
3664
|
-
/* @__PURE__ */ i(
|
|
3678
|
+
/* @__PURE__ */ i(jo, {})
|
|
3665
3679
|
] }),
|
|
3666
3680
|
P ? /* @__PURE__ */ i(
|
|
3667
3681
|
"div",
|
|
@@ -3704,18 +3718,18 @@ const Oe = {
|
|
|
3704
3718
|
export {
|
|
3705
3719
|
va as $,
|
|
3706
3720
|
Sn as A,
|
|
3707
|
-
|
|
3721
|
+
Zr as B,
|
|
3708
3722
|
Ln as C,
|
|
3709
|
-
|
|
3723
|
+
ji as D,
|
|
3710
3724
|
En as E,
|
|
3711
3725
|
Nn as F,
|
|
3712
3726
|
Kr as G,
|
|
3713
3727
|
Yr as H,
|
|
3714
3728
|
ti as I,
|
|
3715
3729
|
oi as J,
|
|
3716
|
-
|
|
3730
|
+
$e as K,
|
|
3717
3731
|
zn as L,
|
|
3718
|
-
|
|
3732
|
+
_i as M,
|
|
3719
3733
|
Ti as N,
|
|
3720
3734
|
Ci as O,
|
|
3721
3735
|
Li as P,
|
|
@@ -3734,12 +3748,12 @@ export {
|
|
|
3734
3748
|
wa as a0,
|
|
3735
3749
|
Ca as a1,
|
|
3736
3750
|
Xn as b,
|
|
3737
|
-
|
|
3751
|
+
ct as c,
|
|
3738
3752
|
At as d,
|
|
3739
3753
|
Rn as e,
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3754
|
+
bt as f,
|
|
3755
|
+
Fe as g,
|
|
3756
|
+
Ue as h,
|
|
3743
3757
|
pa as i,
|
|
3744
3758
|
aa as j,
|
|
3745
3759
|
ta as k,
|
|
@@ -3750,12 +3764,12 @@ export {
|
|
|
3750
3764
|
Nc as p,
|
|
3751
3765
|
Pa as q,
|
|
3752
3766
|
ga as r,
|
|
3753
|
-
|
|
3767
|
+
Zi as s,
|
|
3754
3768
|
yn as t,
|
|
3755
|
-
|
|
3769
|
+
de as u,
|
|
3756
3770
|
qr as v,
|
|
3757
3771
|
In as w,
|
|
3758
3772
|
Br as x,
|
|
3759
3773
|
xn as y,
|
|
3760
|
-
|
|
3774
|
+
jr as z
|
|
3761
3775
|
};
|