@pdf-viewer/react 1.11.0 → 1.12.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ToolbarLayout.module-e774f3e1.js → ToolbarLayout.module-e03c451b.js} +1066 -1060
- package/dist/components/RPController.js +1 -1
- package/dist/components/RPPages.js +3 -2
- package/dist/components/RPProvider.js +31 -17
- package/dist/components/layout/LayoutContainer.js +3 -2
- package/dist/components/layout/RPDefaultLayout.js +1 -1
- package/dist/components/layout/RPLayout.js +4 -3
- package/dist/components/layout/sidebar/RPSidebar.js +1 -1
- package/dist/components/layout/sidebar/Thumbnail.js +3 -2
- package/dist/components/layout/sidebar/Thumbnails.js +1 -1
- package/dist/components/layout/toolbar/DocumentDialog.js +3 -2
- package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/MenuItem.js +1 -1
- package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
- package/dist/components/layout/toolbar/MostPageTool.js +4 -3
- package/dist/components/layout/toolbar/OtherTool.js +2 -2
- package/dist/components/layout/toolbar/Paginate.js +1 -1
- package/dist/components/layout/toolbar/PrintTool.js +1 -1
- package/dist/components/layout/toolbar/RPMoreOptions.js +2 -2
- package/dist/components/layout/toolbar/RPToolbar.js +1 -1
- package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
- package/dist/components/layout/toolbar/RotateTool.js +1 -1
- package/dist/components/layout/toolbar/ScrollModeTool.js +1 -1
- package/dist/components/layout/toolbar/SearchResultNavigator.js +1 -1
- package/dist/components/layout/toolbar/SearchTool.js +3 -2
- package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
- package/dist/components/layout/toolbar/ThumbnailTool.js +1 -1
- package/dist/components/layout/toolbar/ToolbarCustom.js +4 -3
- package/dist/components/layout/toolbar/ToolbarDefault.js +4 -3
- package/dist/components/layout/toolbar/ViewModeTool.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/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/tools/InputPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/NextPageTool.js +4 -3
- 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/ThumbnailTool.js +1 -1
- package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +1 -1
- package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +4 -3
- package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +4 -3
- package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +5 -4
- package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +1 -1
- package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +1 -1
- package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +1 -1
- package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +1 -1
- package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +1 -1
- package/dist/components/page/AnnotationLayer.js +3 -2
- package/dist/components/page/CanvasLayer.js +3 -2
- package/dist/components/page/CustomElement.js +7 -7
- package/dist/components/page/DualPage.js +1 -1
- package/dist/components/page/RPPage.js +3 -2
- package/dist/components/page/SinglePage.js +1 -1
- package/dist/components/page/TextHighlightLayer.js +3 -2
- package/dist/components/page/TextLayer.js +3 -2
- package/dist/components/ui/DropDown.js +1 -1
- package/dist/components/ui/LoadingIndicator.js +1 -1
- package/dist/components/ui/RPTooltip.js +430 -200
- package/dist/contexts/ElementPageContext.js +95 -51
- package/dist/contexts/EventCallbackContext.js +30 -0
- package/dist/contexts/GlobalCurrentPage.js +13 -10
- package/dist/contexts/PagesRotateContext.js +23 -17
- package/dist/contexts/PaginationContext.js +1 -1
- package/dist/contexts/PrintContext.js +1 -1
- package/dist/contexts/RPDocumentContext.js +21 -19
- package/dist/contexts/RenderQueueProvider.js +1 -1
- package/dist/contexts/SearchContext.js +1 -1
- package/dist/contexts/ThumbnailsContext.js +1 -1
- package/dist/floating-ui.react-dom-d22a10b4.js +1474 -0
- package/dist/index-3bf64864.js +1886 -0
- package/dist/main.js +1 -1
- package/dist/types/contexts/EventCallbackContext.d.ts +5 -0
- package/dist/types/utils/getElementPositionInPage.d.ts +5 -0
- package/dist/types/utils/types.d.ts +8 -1
- package/dist/utils/getElementPositionInPage.js +41 -0
- package/dist/utils/hooks/useFileDownload.js +3 -2
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/useLoadPdf.js +43 -41
- package/dist/utils/hooks/usePaginate.js +3 -2
- package/dist/utils/hooks/usePresentPage.js +3 -2
- package/dist/utils/hooks/usePrint.js +3 -2
- package/dist/utils/hooks/useScrollToPage.js +3 -2
- package/dist/utils/hooks/useSearch.js +3 -2
- package/dist/utils/hooks/useThumbnail.js +3 -2
- package/dist/utils/hooks/useVirtualReactWindow.js +3 -2
- package/package.json +1 -1
- package/dist/index-808ea7bf.js +0 -1685
- package/dist/index-a48ec088.js +0 -1672
|
@@ -1,165 +1,166 @@
|
|
|
1
|
-
import { jsx as a, Fragment as
|
|
1
|
+
import { jsx as a, Fragment as fe, jsxs as $ } from "react/jsx-runtime";
|
|
2
2
|
import * as X from "react";
|
|
3
|
-
import { useRef as k, useEffect as z, useCallback as E, useState as q, useMemo as W, createContext as
|
|
4
|
-
import { ChevronUpIcon as
|
|
3
|
+
import { useRef as k, useEffect as z, useCallback as E, useState as q, useMemo as W, createContext as qe, useContext as Ge, useImperativeHandle as rn, createElement as Be, PureComponent as or, Component as ir, memo as on, forwardRef as ar } from "react";
|
|
4
|
+
import { ChevronUpIcon as Xe } from "./components/icons/ChevronUpIcon.js";
|
|
5
5
|
import { UIButton as we } from "./components/ui/Button.js";
|
|
6
6
|
import { UIInput as an } from "./components/ui/Input.js";
|
|
7
|
-
import { ViewMode as
|
|
8
|
-
import { useScrollModeContext as
|
|
9
|
-
import { useDocumentContext as
|
|
10
|
-
import { useDocumentPasswordContext as
|
|
11
|
-
import { useDarkModeContext as
|
|
7
|
+
import { ViewMode as Re, ScrollMode as ne, AnnotationSubType as Dt, SelectionMode as sr, ErrorType as cr } from "./utils/types.js";
|
|
8
|
+
import { useScrollModeContext as Ee } from "./contexts/ScrollModeContext.js";
|
|
9
|
+
import { useDocumentContext as re } from "./contexts/RPDocumentContext.js";
|
|
10
|
+
import { useDocumentPasswordContext as lr } from "./contexts/DocumentPasswordContext.js";
|
|
11
|
+
import { useDarkModeContext as dr } from "./contexts/DarkModeContext.js";
|
|
12
12
|
import "./contexts/RotationContext.js";
|
|
13
|
-
import { useLayerContext as
|
|
13
|
+
import { useLayerContext as ur } from "./contexts/LayerContext.js";
|
|
14
14
|
import { useZoomContext as _t } from "./contexts/ZoomContext.js";
|
|
15
|
-
import { useViewModeContext as
|
|
16
|
-
import { useVirtualScrollContext as
|
|
15
|
+
import { useViewModeContext as Me } from "./contexts/ViewModeContext.js";
|
|
16
|
+
import { useVirtualScrollContext as Je } from "./contexts/VirtualScrollContext.js";
|
|
17
17
|
import { useVirtualGridContext as sn } from "./contexts/VirtualGridContext.js";
|
|
18
|
-
import { useSelectionModeContext as
|
|
19
|
-
import { useInitialStateContext as
|
|
20
|
-
import { useFullScreenContext as
|
|
18
|
+
import { useSelectionModeContext as pr } from "./contexts/SelectionModeContext.js";
|
|
19
|
+
import { useInitialStateContext as hr } from "./contexts/InitialStateContext.js";
|
|
20
|
+
import { useFullScreenContext as fr } from "./contexts/FullScreenContext.js";
|
|
21
21
|
import "./contexts/FileInputContext.js";
|
|
22
22
|
import "./contexts/DropFileZoneContext.js";
|
|
23
|
-
import { findMatches as
|
|
23
|
+
import { findMatches as mr, resetDivs as gr, highlightMatches as vr, isMatchEntireWord as wr } from "./utils/highlight.js";
|
|
24
24
|
import { useLayoutContainer as be } from "./contexts/LayoutContainerContext.js";
|
|
25
|
-
import { useDimensionPagesContext as
|
|
26
|
-
import { useLocalizationContext as
|
|
27
|
-
import { useHighlightContext as
|
|
25
|
+
import { useDimensionPagesContext as Ue } from "./contexts/DimensionPagesContext.js";
|
|
26
|
+
import { useLocalizationContext as me } from "./contexts/LocalizationContext.js";
|
|
27
|
+
import { useHighlightContext as _r } from "./contexts/HighlightContext.js";
|
|
28
28
|
import "./contexts/LicenseContext.js";
|
|
29
|
-
import { useDownloadContext as
|
|
29
|
+
import { useDownloadContext as br } from "./contexts/DownloadContext.js";
|
|
30
30
|
import { useSmoothScrollContext as cn } from "./contexts/SmoothScrollContext.js";
|
|
31
31
|
import "./contexts/ElementPageContext.js";
|
|
32
|
-
import { usePagesRotateContext as
|
|
33
|
-
import { Queue as
|
|
34
|
-
import { renderPage as
|
|
35
|
-
import { useGlobalCurrentPage as
|
|
32
|
+
import { usePagesRotateContext as et } from "./contexts/PagesRotateContext.js";
|
|
33
|
+
import { Queue as Tr } from "./utils/Queue.js";
|
|
34
|
+
import { renderPage as Cr } from "./utils/renderPage.js";
|
|
35
|
+
import { useGlobalCurrentPage as Pr } from "./contexts/GlobalCurrentPage.js";
|
|
36
36
|
import { useLoaderContext as bt } from "./contexts/LoaderContext.js";
|
|
37
|
-
import { useToolComponentContext as
|
|
37
|
+
import { useToolComponentContext as Ne } from "./contexts/ToolComponentContext.js";
|
|
38
38
|
import { useIconToolContext as Te } from "./contexts/IconToolContext.js";
|
|
39
|
-
import { useOtherToolContext as
|
|
39
|
+
import { useOtherToolContext as yr } from "./contexts/OtherToolContext.js";
|
|
40
|
+
import { useEventCallbackContext as Sr } from "./contexts/EventCallbackContext.js";
|
|
40
41
|
import "./components/RPConfig.js";
|
|
41
|
-
import { ThumbnailIcon as
|
|
42
|
-
import { c as
|
|
42
|
+
import { ThumbnailIcon as Ir } from "./components/icons/Thumbnail.js";
|
|
43
|
+
import { c as de } from "./clsx-0c6e471a.js";
|
|
43
44
|
import { LoaderIcon as ln } from "./components/icons/LoaderIcon.js";
|
|
44
|
-
import { Container as
|
|
45
|
-
import { useViewportContext as
|
|
46
|
-
import { useToolbarComponentContext as Ce, ToolbarComponentProvider as
|
|
47
|
-
import { RPSplitter as
|
|
48
|
-
import { WrapperLayout as
|
|
49
|
-
import { c as _e, L as
|
|
50
|
-
import { useThemeContext as
|
|
51
|
-
import { RPDropFileZone as
|
|
45
|
+
import { Container as xr } from "./components/layout/Container.js";
|
|
46
|
+
import { useViewportContext as Oe, ViewportProvider as Rr } from "./contexts/ViewportContext.js";
|
|
47
|
+
import { useToolbarComponentContext as Ce, ToolbarComponentProvider as Lr } from "./contexts/ToolbarComponentContext.js";
|
|
48
|
+
import { RPSplitter as Er } from "./components/layout/sidebar/RPSplitter.js";
|
|
49
|
+
import { WrapperLayout as Nr } from "./components/layout/WrapperLayout.js";
|
|
50
|
+
import { c as _e, L as Or } from "./LayoutWrapper-a871c161.js";
|
|
51
|
+
import { useThemeContext as Dr } from "./contexts/ThemeContext.js";
|
|
52
|
+
import { RPDropFileZone as Ar } from "./components/RPDropFileZone.js";
|
|
52
53
|
import { c as te, S as At } from "./SearchCloseButton-cbf182aa.js";
|
|
53
54
|
import { UICheckbox as zt } from "./components/ui/Checkbox.js";
|
|
54
|
-
import { useIconContext as Pe, IconProvider as
|
|
55
|
+
import { useIconContext as Pe, IconProvider as zr } from "./contexts/IconContext.js";
|
|
55
56
|
import Q from "./components/ui/RPTooltip.js";
|
|
56
57
|
import { UIDropDown as dn } from "./components/ui/DropDown.js";
|
|
57
58
|
import "./ZoomTool.module-6c5eabbb.js";
|
|
58
|
-
import { MenuItem as
|
|
59
|
+
import { MenuItem as Qe } from "./components/layout/toolbar/MenuItem.js";
|
|
59
60
|
import { MenuSeparator as un } from "./components/layout/toolbar/MenuSeparator.js";
|
|
60
61
|
import { dateFormatter as Mt } from "./utils/dateFormatter.js";
|
|
61
|
-
import { PropertyItem as
|
|
62
|
+
import { PropertyItem as Mr } from "./components/layout/toolbar/PropertyItem.js";
|
|
62
63
|
import "./RotateTool.module-03987eba.js";
|
|
63
|
-
import { withRef as
|
|
64
|
-
import { useInfiniteScroll as
|
|
65
|
-
import { THUMBNAIL_MIN_WIDTH as
|
|
66
|
-
import * as
|
|
67
|
-
import { PixelsPerInch as
|
|
68
|
-
import { SimpleLinkService as
|
|
69
|
-
import { annotationsEvents as
|
|
70
|
-
import { normalizeSingleKeyword as
|
|
71
|
-
import { CustomElement as
|
|
72
|
-
import { getGridDimension as Tt, getPositionFromPage as
|
|
73
|
-
import { useMousePressed as
|
|
74
|
-
import { useGrabScroll as
|
|
75
|
-
import { usePinch as
|
|
64
|
+
import { withRef as tt } from "./utils/withRef.js";
|
|
65
|
+
import { useInfiniteScroll as Fr } from "./utils/hooks/useInfiniteScroll.js";
|
|
66
|
+
import { THUMBNAIL_MIN_WIDTH as kr } from "./utils/constants.js";
|
|
67
|
+
import * as Wr from "pdfjs-dist";
|
|
68
|
+
import { PixelsPerInch as Hr, AnnotationMode as $r, RenderingCancelledException as qr, AnnotationLayer as Gr } from "pdfjs-dist";
|
|
69
|
+
import { SimpleLinkService as Ur } from "./utils/link_service.js";
|
|
70
|
+
import { annotationsEvents as Vr, annotationEventsHandler as Br, handleClick as Ft, handleAnnotationWidget as jr, handleAnnotationLink as Kr, bindLayerEvents as Zr, unbindLayerEvents as kt } from "./utils/annotations.js";
|
|
71
|
+
import { normalizeSingleKeyword as Xr, sortHighlightPosition as Qr, unwrap as Yr } from "./components/page/searchHighlight.js";
|
|
72
|
+
import { CustomElement as Jr } from "./components/page/CustomElement.js";
|
|
73
|
+
import { getGridDimension as Tt, getPositionFromPage as eo, getPageFromPosition as to } from "./utils/calculatePage.js";
|
|
74
|
+
import { useMousePressed as no } from "./utils/hooks/useMousePressed.js";
|
|
75
|
+
import { useGrabScroll as ro } from "./utils/hooks/useGrabScroll.js";
|
|
76
|
+
import { usePinch as oo } from "./utils/hooks/usePinch.js";
|
|
76
77
|
import { useDebounce as Ct } from "./utils/hooks/useDebounce.js";
|
|
77
|
-
import
|
|
78
|
-
import { getScrollDistance as
|
|
79
|
-
import { getWordPositionInPage as
|
|
80
|
-
import { getThumbnailViewport as
|
|
78
|
+
import io from "./components/ui/PasswordModal.js";
|
|
79
|
+
import { getScrollDistance as ze } from "./utils/getScrollDistance.js";
|
|
80
|
+
import { getWordPositionInPage as ao } from "./utils/getWordPositionInPage.js";
|
|
81
|
+
import { getThumbnailViewport as so } from "./utils/getThumbnailViewport.js";
|
|
81
82
|
import { smoothScrollTo as at } from "./utils/smoothScrollTo.js";
|
|
82
|
-
import { appConsole as
|
|
83
|
+
import { appConsole as co } from "./utils/appConsole.js";
|
|
83
84
|
import { FileUploadTool as pn } from "./components/layout/toolbar/FileUploadTool.js";
|
|
84
|
-
import { DarkModeTool as
|
|
85
|
-
import { ThreeDotIcon as
|
|
86
|
-
import { c as
|
|
87
|
-
import { D as
|
|
88
|
-
import { a as
|
|
89
|
-
import { CloseIcon as
|
|
90
|
-
import { DocumentProperties as
|
|
91
|
-
import { RotateTool as
|
|
92
|
-
import { ViewModeTool as
|
|
93
|
-
import { ScrollModeTool as
|
|
94
|
-
import { FileDownloadDefaultIcon as
|
|
95
|
-
import { PrintDefaultTool as
|
|
85
|
+
import { DarkModeTool as lo } from "./components/layout/toolbar/DarkModeTool.js";
|
|
86
|
+
import { ThreeDotIcon as uo } from "./components/icons/ThreeDotIcon.js";
|
|
87
|
+
import { c as po, u as Pt, P as Ve, a as $e, b as yt, k as ho, e as fo, i as mo } from "./index-c9a2990a.js";
|
|
88
|
+
import { D as go, d as st } from "./floating-ui.react-dom-d22a10b4.js";
|
|
89
|
+
import { a as vo, h as wo, u as _o, F as bo, b as To, G as hn } from "./index-3bf64864.js";
|
|
90
|
+
import { CloseIcon as Co } from "./components/icons/CloseIcon.js";
|
|
91
|
+
import { DocumentProperties as Po } from "./components/layout/toolbar/DocumentProperties.js";
|
|
92
|
+
import { RotateTool as yo } from "./components/layout/toolbar/RotateTool.js";
|
|
93
|
+
import { ViewModeTool as So } from "./components/layout/toolbar/ViewModeTool.js";
|
|
94
|
+
import { ScrollModeTool as Io } from "./components/layout/toolbar/ScrollModeTool.js";
|
|
95
|
+
import { FileDownloadDefaultIcon as xo } from "./components/icons/FileDownloadDefaultIcon.js";
|
|
96
|
+
import { PrintDefaultTool as Ro } from "./components/icons/PrintDefaultIcon.js";
|
|
96
97
|
import { FullScreenTool as fn } from "./components/layout/toolbar/FullScreenTool.js";
|
|
97
98
|
import { GoToDownIcon as mn } from "./components/icons/GoToDownIcon.js";
|
|
98
|
-
import { SelectionModeTool as
|
|
99
|
-
import { ZoomTool as
|
|
99
|
+
import { SelectionModeTool as Lo } from "./components/layout/toolbar/SelectionModeTool.js";
|
|
100
|
+
import { ZoomTool as Eo } from "./components/layout/toolbar/ZoomTool.js";
|
|
100
101
|
import { SearchIcon as gn } from "./components/icons/SearchIcon.js";
|
|
101
|
-
import { ClearIcon as
|
|
102
|
+
import { ClearIcon as No } from "./components/icons/ClearIcon.js";
|
|
102
103
|
import { InfoIcon as Wt } from "./components/icons/InfoIcon.js";
|
|
103
104
|
import './assets/ToolbarLayout.css';const vn = () => {
|
|
104
|
-
const { viewMode: t } =
|
|
105
|
+
const { viewMode: t } = Me(), { scrollMode: e } = Ee(), { virtualScrollRef: n, virtualScrollableElementRef: o, pageScrollElementRef: r } = Je(), { setFocusedPage: i } = pe(), c = k(), { columnCount: l } = sn(), { widths: d, heights: f } = Ue(), m = k(e), P = k(t), u = k(l), { targetScrollPage: T } = cn();
|
|
105
106
|
z(() => {
|
|
106
107
|
n != null && n.scrollToItem && (c.current = n);
|
|
107
108
|
}, [n]), z(() => {
|
|
108
|
-
m.current = e,
|
|
109
|
+
m.current = e, P.current = t;
|
|
109
110
|
}, [e, t]);
|
|
110
|
-
const
|
|
111
|
+
const C = E(
|
|
111
112
|
(g, S) => {
|
|
112
|
-
if (!
|
|
113
|
+
if (!r)
|
|
113
114
|
return;
|
|
114
115
|
const v = Math.ceil(g / 2) * 2 - 1;
|
|
115
116
|
if (g === v + 1) {
|
|
116
|
-
const
|
|
117
|
+
const p = {
|
|
117
118
|
left: d[v],
|
|
118
119
|
top: 0
|
|
119
120
|
};
|
|
120
121
|
return new Promise(
|
|
121
|
-
(s) => at(
|
|
122
|
+
(s) => at(r, p, s)
|
|
122
123
|
);
|
|
123
124
|
}
|
|
124
125
|
const h = {
|
|
125
126
|
left: 0,
|
|
126
127
|
top: 0
|
|
127
128
|
};
|
|
128
|
-
return
|
|
129
|
+
return r == null ? void 0 : r.scrollTo({
|
|
129
130
|
...h,
|
|
130
131
|
behavior: S
|
|
131
132
|
});
|
|
132
133
|
},
|
|
133
|
-
[
|
|
134
|
+
[r, d, at]
|
|
134
135
|
);
|
|
135
136
|
return z(() => {
|
|
136
|
-
m.current = e,
|
|
137
|
+
m.current = e, P.current = t;
|
|
137
138
|
}, [e, t]), z(() => {
|
|
138
|
-
|
|
139
|
+
u.current = l;
|
|
139
140
|
}, [l]), { scrollToPage: E(
|
|
140
141
|
(g, S = "smooth") => {
|
|
141
142
|
i(g);
|
|
142
143
|
const v = g - 1;
|
|
143
|
-
let h = v,
|
|
144
|
-
if (
|
|
145
|
-
|
|
144
|
+
let h = v, p = 0;
|
|
145
|
+
if (P.current === Re.DUAL_PAGE && m.current === ne.PAGE_SCROLLING) {
|
|
146
|
+
C(g, S);
|
|
146
147
|
return;
|
|
147
148
|
}
|
|
148
149
|
if (m.current === ne.PAGE_SCROLLING) {
|
|
149
150
|
i(g);
|
|
150
151
|
return;
|
|
151
152
|
}
|
|
152
|
-
if (!c.current || !
|
|
153
|
+
if (!c.current || !o)
|
|
153
154
|
return;
|
|
154
|
-
const s =
|
|
155
|
+
const s = o;
|
|
155
156
|
S === "smooth" && (T.current = g);
|
|
156
157
|
const { columnsWidth: w, rowsHeight: _ } = Tt(
|
|
157
158
|
{ widths: d, heights: f },
|
|
158
159
|
l
|
|
159
160
|
);
|
|
160
161
|
if (m.current === ne.HORIZONTAL_SCROLLING) {
|
|
161
|
-
|
|
162
|
-
const I =
|
|
162
|
+
p = v;
|
|
163
|
+
const I = ze(w, p), R = {
|
|
163
164
|
left: Math.floor(I),
|
|
164
165
|
top: 0
|
|
165
166
|
};
|
|
@@ -168,9 +169,9 @@ import './assets/ToolbarLayout.css';const vn = () => {
|
|
|
168
169
|
behavior: S
|
|
169
170
|
});
|
|
170
171
|
}
|
|
171
|
-
if (
|
|
172
|
-
|
|
173
|
-
const R =
|
|
172
|
+
if (P.current === Re.DUAL_PAGE) {
|
|
173
|
+
p = v % 2, h = Math.floor(v / 2);
|
|
174
|
+
const R = ze(w, p), L = ze(_, h), N = {
|
|
174
175
|
left: Math.floor(R),
|
|
175
176
|
top: Math.floor(L)
|
|
176
177
|
};
|
|
@@ -179,7 +180,7 @@ import './assets/ToolbarLayout.css';const vn = () => {
|
|
|
179
180
|
behavior: S
|
|
180
181
|
});
|
|
181
182
|
}
|
|
182
|
-
const y =
|
|
183
|
+
const y = ze(_, h), x = {
|
|
183
184
|
left: 0,
|
|
184
185
|
top: Math.floor(y)
|
|
185
186
|
};
|
|
@@ -189,55 +190,55 @@ import './assets/ToolbarLayout.css';const vn = () => {
|
|
|
189
190
|
});
|
|
190
191
|
},
|
|
191
192
|
[
|
|
192
|
-
|
|
193
|
+
o,
|
|
193
194
|
l,
|
|
194
|
-
|
|
195
|
+
C,
|
|
195
196
|
i,
|
|
196
197
|
at,
|
|
197
198
|
f,
|
|
198
199
|
d
|
|
199
200
|
]
|
|
200
201
|
) };
|
|
201
|
-
},
|
|
202
|
-
const [e, n] = q(t), [
|
|
202
|
+
}, Oo = (t = 1) => {
|
|
203
|
+
const [e, n] = q(t), [o, r] = q(0), { scrollToPage: i } = vn(), c = k(1), { viewMode: l } = Me(), { scrollMode: d } = Ee(), { widths: f } = Ue(), { pagesRef: m } = be(), P = Ct(e, 100), u = E(
|
|
203
204
|
(h) => {
|
|
204
205
|
if (!/^[0-9]*$/g.test(h.toString()) || !h)
|
|
205
206
|
return { success: !1, currentPage: c.current };
|
|
206
207
|
const s = +h;
|
|
207
|
-
return s < 0 || s >
|
|
208
|
+
return s < 0 || s > o ? { success: !1, currentPage: c.current } : (n(s), c.current = s, { success: !0, currentPage: +h });
|
|
208
209
|
},
|
|
209
|
-
[
|
|
210
|
-
), T = E(
|
|
210
|
+
[o]
|
|
211
|
+
), T = E(u, [u]), C = E(
|
|
211
212
|
(h) => {
|
|
212
|
-
const
|
|
213
|
-
return
|
|
213
|
+
const p = u(h);
|
|
214
|
+
return p.success && i(p.currentPage), p;
|
|
214
215
|
},
|
|
215
|
-
[
|
|
216
|
+
[u, i]
|
|
216
217
|
), b = E((h) => {
|
|
217
|
-
const
|
|
218
|
-
if (!m ||
|
|
218
|
+
const p = h % 2 === 1;
|
|
219
|
+
if (!m || p)
|
|
219
220
|
return !1;
|
|
220
|
-
const s =
|
|
221
|
-
return l ===
|
|
222
|
-
}, [l, f, m,
|
|
221
|
+
const s = p ? f[h] : f[h - 1], w = p ? f[h + 1] : f[h];
|
|
222
|
+
return l === Re.DUAL_PAGE && s + w < m.clientWidth;
|
|
223
|
+
}, [l, f, m, o]), g = E(() => {
|
|
223
224
|
let h = e - 1;
|
|
224
|
-
b(h) && (h = e - 2),
|
|
225
|
-
}, [
|
|
225
|
+
b(h) && (h = e - 2), C(h);
|
|
226
|
+
}, [C, e, l, d, b]), S = W(() => l === Re.DUAL_PAGE && d === ne.PAGE_SCROLLING ? e === o - 1 : e === o, [e, o, l, d]), v = E(() => {
|
|
226
227
|
if (S)
|
|
227
228
|
return;
|
|
228
229
|
let h = e + 1;
|
|
229
|
-
b(h) && (h = e + 2),
|
|
230
|
-
}, [
|
|
230
|
+
b(h) && (h = e + 2), C(h);
|
|
231
|
+
}, [C, e, b, l, d, S]);
|
|
231
232
|
return {
|
|
232
|
-
focusedPage:
|
|
233
|
-
totalPages:
|
|
233
|
+
focusedPage: P,
|
|
234
|
+
totalPages: o,
|
|
234
235
|
setFocusedPage: T,
|
|
235
|
-
setTotalPages:
|
|
236
|
+
setTotalPages: r,
|
|
236
237
|
nextPage: v,
|
|
237
238
|
prevPage: g,
|
|
238
|
-
goToPage:
|
|
239
|
+
goToPage: C
|
|
239
240
|
};
|
|
240
|
-
}, wn =
|
|
241
|
+
}, wn = qe({
|
|
241
242
|
focusedPage: 0,
|
|
242
243
|
setFocusedPage: (t) => {
|
|
243
244
|
},
|
|
@@ -249,21 +250,21 @@ import './assets/ToolbarLayout.css';const vn = () => {
|
|
|
249
250
|
},
|
|
250
251
|
nextPage: () => {
|
|
251
252
|
}
|
|
252
|
-
}),
|
|
253
|
-
const t =
|
|
254
|
-
return typeof (t == null ? void 0 : t.focusedPage) > "u" &&
|
|
255
|
-
},
|
|
256
|
-
const { pdf: e } =
|
|
253
|
+
}), pe = () => {
|
|
254
|
+
const t = Ge(wn);
|
|
255
|
+
return typeof (t == null ? void 0 : t.focusedPage) > "u" && co.error("Please use this hooks inside children component of RPProvider"), t;
|
|
256
|
+
}, Ys = ({ children: t }) => {
|
|
257
|
+
const { pdf: e } = re(), { setCurrentPage: n } = Pr(), { focusedPage: o, totalPages: r, setFocusedPage: i, setTotalPages: c, goToPage: l, nextPage: d, prevPage: f } = Oo();
|
|
257
258
|
return z(() => {
|
|
258
259
|
e != null && e.numPages && (c(e.numPages), i(1));
|
|
259
260
|
}, [e, c, i]), z(() => {
|
|
260
|
-
n(
|
|
261
|
-
}, [
|
|
261
|
+
n(o);
|
|
262
|
+
}, [o, n]), /* @__PURE__ */ a(
|
|
262
263
|
wn.Provider,
|
|
263
264
|
{
|
|
264
265
|
value: {
|
|
265
|
-
focusedPage:
|
|
266
|
-
totalPages:
|
|
266
|
+
focusedPage: o,
|
|
267
|
+
totalPages: r,
|
|
267
268
|
setFocusedPage: i,
|
|
268
269
|
setTotalPages: c,
|
|
269
270
|
nextPage: d,
|
|
@@ -274,30 +275,30 @@ import './assets/ToolbarLayout.css';const vn = () => {
|
|
|
274
275
|
}
|
|
275
276
|
);
|
|
276
277
|
};
|
|
277
|
-
const
|
|
278
|
-
const { pdf: t, pages: e } =
|
|
278
|
+
const Do = () => {
|
|
279
|
+
const { pdf: t, pages: e } = re(), [n, o] = q({
|
|
279
280
|
loadedPages: 0,
|
|
280
281
|
totalPages: 0,
|
|
281
282
|
percentage: 0
|
|
282
|
-
}), [
|
|
283
|
+
}), [r, i] = q(!1), [c, l] = q(!1), [d, f] = q(null), m = k(!1);
|
|
283
284
|
z(() => {
|
|
284
285
|
m.current;
|
|
285
286
|
}, [m]);
|
|
286
|
-
const
|
|
287
|
+
const P = E(() => {
|
|
287
288
|
document.documentElement.classList.remove("rp-print-html-printing"), document.body.classList.remove("rp-print-body-printing");
|
|
288
289
|
const h = document.querySelector(".rp-print-zone");
|
|
289
290
|
h && h.remove();
|
|
290
|
-
}, []),
|
|
291
|
-
m.current = !1, i(!1), l(!1), f(null),
|
|
291
|
+
}, []), u = E(() => {
|
|
292
|
+
m.current = !1, i(!1), l(!1), f(null), o({
|
|
292
293
|
loadedPages: 0,
|
|
293
294
|
totalPages: 0,
|
|
294
295
|
percentage: 0
|
|
295
296
|
});
|
|
296
297
|
}, []), T = () => {
|
|
297
298
|
m.current = !0;
|
|
298
|
-
},
|
|
299
|
+
}, C = async ({
|
|
299
300
|
scratchCanvas: h,
|
|
300
|
-
pdfDocument:
|
|
301
|
+
pdfDocument: p,
|
|
301
302
|
pageNumber: s,
|
|
302
303
|
viewerPdfPage: w,
|
|
303
304
|
printResolution: _,
|
|
@@ -305,19 +306,19 @@ const Nr = () => {
|
|
|
305
306
|
printAnnotationStoragePromise: x
|
|
306
307
|
}) => {
|
|
307
308
|
if (m.current) {
|
|
308
|
-
|
|
309
|
+
u();
|
|
309
310
|
return;
|
|
310
311
|
}
|
|
311
|
-
const I = _ /
|
|
312
|
+
const I = _ / Hr.PDF;
|
|
312
313
|
h.width = Math.floor(w.width * I), h.height = Math.floor(w.height * I);
|
|
313
314
|
const R = h.getContext("2d");
|
|
314
315
|
R.save(), R.fillStyle = "rgb(255, 255, 255)", R.fillRect(0, 0, h.width, h.height), R.restore();
|
|
315
316
|
const [L, N] = await Promise.all([
|
|
316
|
-
|
|
317
|
+
p.getPage(s),
|
|
317
318
|
x
|
|
318
319
|
]);
|
|
319
320
|
if (m.current) {
|
|
320
|
-
|
|
321
|
+
u();
|
|
321
322
|
return;
|
|
322
323
|
}
|
|
323
324
|
const F = {
|
|
@@ -325,46 +326,46 @@ const Nr = () => {
|
|
|
325
326
|
transform: [I, 0, 0, I, 0, 0],
|
|
326
327
|
viewport: L.getViewport({ scale: 1, rotation: w.rotation }),
|
|
327
328
|
intent: "print",
|
|
328
|
-
annotationMode:
|
|
329
|
+
annotationMode: $r.ENABLE_STORAGE,
|
|
329
330
|
optionalContentConfigPromise: y,
|
|
330
331
|
printAnnotationStorage: N
|
|
331
332
|
};
|
|
332
333
|
try {
|
|
333
334
|
return L.render(F).promise;
|
|
334
335
|
} catch (M) {
|
|
335
|
-
throw M instanceof
|
|
336
|
+
throw M instanceof qr || console.error(M), M;
|
|
336
337
|
}
|
|
337
338
|
}, b = E(() => {
|
|
338
339
|
const h = window.print;
|
|
339
|
-
return new Promise((
|
|
340
|
+
return new Promise((p) => {
|
|
340
341
|
const s = (y) => {
|
|
341
342
|
setTimeout(() => {
|
|
342
343
|
h.call(window), setTimeout(() => y(), 20);
|
|
343
344
|
}, 0);
|
|
344
345
|
};
|
|
345
346
|
if (document.querySelector(".rp-print-zone")) {
|
|
346
|
-
s(
|
|
347
|
+
s(p);
|
|
347
348
|
return;
|
|
348
349
|
}
|
|
349
350
|
const _ = new MutationObserver(() => {
|
|
350
|
-
document.querySelector(".rp-print-zone") && (s(
|
|
351
|
+
document.querySelector(".rp-print-zone") && (s(p), _.disconnect());
|
|
351
352
|
});
|
|
352
353
|
_.observe(document.body, { childList: !0, subtree: !0 });
|
|
353
354
|
});
|
|
354
355
|
}, []), g = async (h) => {
|
|
355
|
-
const
|
|
356
|
+
const p = document.createElement("img"), s = document.createElement("div");
|
|
356
357
|
return s.classList.add("rp-print-page"), await new Promise((w, _) => {
|
|
357
358
|
h.toBlob((y) => {
|
|
358
|
-
y ? (
|
|
359
|
-
URL.revokeObjectURL(
|
|
360
|
-
},
|
|
359
|
+
y ? (p.src = URL.createObjectURL(y), p.onload = () => {
|
|
360
|
+
URL.revokeObjectURL(p.src), w();
|
|
361
|
+
}, p.onerror = _) : _(new Error("Failed to create blob"));
|
|
361
362
|
});
|
|
362
363
|
}).catch(() => {
|
|
363
|
-
}), s.appendChild(
|
|
364
|
-
}, S = (h,
|
|
364
|
+
}), s.appendChild(p), s;
|
|
365
|
+
}, S = (h, p) => {
|
|
365
366
|
const s = document.createElement("div");
|
|
366
367
|
s.classList.add("rp-print-zone");
|
|
367
|
-
const w = document.createElement("style"), _ =
|
|
368
|
+
const w = document.createElement("style"), _ = p.get(1);
|
|
368
369
|
if (_) {
|
|
369
370
|
const { width: y, height: x } = _ == null ? void 0 : _.page.getViewport({ scale: 1 });
|
|
370
371
|
w.innerHTML = `@page { size: ${y}px ${x}px }`;
|
|
@@ -373,8 +374,8 @@ const Nr = () => {
|
|
|
373
374
|
}, v = E(async () => {
|
|
374
375
|
if (!t)
|
|
375
376
|
return;
|
|
376
|
-
|
|
377
|
-
const h = document.createElement("canvas"),
|
|
377
|
+
u();
|
|
378
|
+
const h = document.createElement("canvas"), p = [];
|
|
378
379
|
try {
|
|
379
380
|
t.isPureXfa && console.warn("[rp] XFA Form is not supported at the moment.");
|
|
380
381
|
const w = t.getOptionalContentConfig({ intent: "print" }), _ = Promise.resolve(
|
|
@@ -382,11 +383,11 @@ const Nr = () => {
|
|
|
382
383
|
), y = e.size;
|
|
383
384
|
for (const [I, R] of e) {
|
|
384
385
|
if (m.current) {
|
|
385
|
-
|
|
386
|
+
u();
|
|
386
387
|
return;
|
|
387
388
|
}
|
|
388
389
|
const L = R.page.getViewport({ scale: 1 });
|
|
389
|
-
if (await
|
|
390
|
+
if (await C({
|
|
390
391
|
scratchCanvas: h,
|
|
391
392
|
pdfDocument: t,
|
|
392
393
|
pageNumber: I,
|
|
@@ -395,23 +396,23 @@ const Nr = () => {
|
|
|
395
396
|
optionalContentConfigPromise: w,
|
|
396
397
|
printAnnotationStoragePromise: _
|
|
397
398
|
}), m.current) {
|
|
398
|
-
|
|
399
|
+
u();
|
|
399
400
|
return;
|
|
400
401
|
}
|
|
401
402
|
const N = await g(h);
|
|
402
|
-
|
|
403
|
-
const F = parseFloat((
|
|
404
|
-
|
|
403
|
+
p.push(N);
|
|
404
|
+
const F = parseFloat((p.length / y * 100).toFixed(2));
|
|
405
|
+
o({
|
|
405
406
|
loadedPages: I,
|
|
406
407
|
totalPages: y,
|
|
407
408
|
percentage: F
|
|
408
409
|
});
|
|
409
410
|
}
|
|
410
411
|
if (m.current) {
|
|
411
|
-
|
|
412
|
+
u();
|
|
412
413
|
return;
|
|
413
414
|
}
|
|
414
|
-
const x = S(
|
|
415
|
+
const x = S(p, e);
|
|
415
416
|
document.body.appendChild(x), document.documentElement.classList.add("rp-print-html-printing"), document.body.classList.add("rp-print-body-printing"), i(!0), await b();
|
|
416
417
|
} catch (s) {
|
|
417
418
|
l(!0), s instanceof Error && f(s);
|
|
@@ -421,20 +422,20 @@ const Nr = () => {
|
|
|
421
422
|
}, [t, e, m]);
|
|
422
423
|
return z(() => {
|
|
423
424
|
const h = () => {
|
|
424
|
-
|
|
425
|
+
u(), P();
|
|
425
426
|
};
|
|
426
427
|
return window.addEventListener("afterprint", h, !0), () => {
|
|
427
428
|
window.removeEventListener("afterprint", h, !0);
|
|
428
429
|
};
|
|
429
|
-
}, [
|
|
430
|
+
}, [P, u]), {
|
|
430
431
|
print: v,
|
|
431
432
|
cancel: T,
|
|
432
433
|
progress: n,
|
|
433
|
-
isComplete:
|
|
434
|
+
isComplete: r,
|
|
434
435
|
isError: c,
|
|
435
436
|
error: d
|
|
436
437
|
};
|
|
437
|
-
}, _n =
|
|
438
|
+
}, _n = qe({
|
|
438
439
|
print: () => {
|
|
439
440
|
},
|
|
440
441
|
cancel: () => {
|
|
@@ -451,10 +452,10 @@ const Nr = () => {
|
|
|
451
452
|
console.error("Error in setOnError callback:", e);
|
|
452
453
|
}
|
|
453
454
|
}
|
|
454
|
-
}),
|
|
455
|
-
const [e, n] = q(null), [
|
|
456
|
-
g && typeof g == "function" &&
|
|
457
|
-
}, []),
|
|
455
|
+
}), Js = ({ children: t }) => {
|
|
456
|
+
const [e, n] = q(null), [o, r] = q(null), { print: i, cancel: c, progress: l, isComplete: d, isError: f, error: m } = Do(), P = E((g) => {
|
|
457
|
+
g && typeof g == "function" && r(() => g);
|
|
458
|
+
}, []), u = (g) => {
|
|
458
459
|
m && g(m);
|
|
459
460
|
}, T = E(
|
|
460
461
|
(g) => {
|
|
@@ -463,52 +464,52 @@ const Nr = () => {
|
|
|
463
464
|
[l, e]
|
|
464
465
|
);
|
|
465
466
|
z(() => {
|
|
466
|
-
d &&
|
|
467
|
-
}, [d,
|
|
468
|
-
f &&
|
|
467
|
+
d && o && C();
|
|
468
|
+
}, [d, o]), z(() => {
|
|
469
|
+
f && u((g) => {
|
|
469
470
|
console.error(g);
|
|
470
471
|
});
|
|
471
472
|
}, [f]), z(() => {
|
|
472
473
|
l && e && e(l);
|
|
473
474
|
}, [l, e]);
|
|
474
|
-
const
|
|
475
|
-
|
|
475
|
+
const C = () => {
|
|
476
|
+
o && (o(), r(null));
|
|
476
477
|
}, b = {
|
|
477
478
|
print: i,
|
|
478
479
|
cancel: c,
|
|
479
480
|
setOnProgress: T,
|
|
480
|
-
setOnComplete:
|
|
481
|
-
setOnError:
|
|
481
|
+
setOnComplete: P,
|
|
482
|
+
setOnError: u,
|
|
482
483
|
progress: l
|
|
483
484
|
};
|
|
484
485
|
return /* @__PURE__ */ a(_n.Provider, { value: b, children: t });
|
|
485
|
-
},
|
|
486
|
-
const t =
|
|
486
|
+
}, nt = () => {
|
|
487
|
+
const t = Ge(_n);
|
|
487
488
|
if (!t)
|
|
488
489
|
throw new Error("usePrintContext must be used within a PrintProvider");
|
|
489
490
|
return t;
|
|
490
|
-
},
|
|
491
|
-
const [t, e] = q({}), { pages: n } =
|
|
491
|
+
}, Ao = () => {
|
|
492
|
+
const [t, e] = q({}), { pages: n } = re(), o = W(() => Object.keys(t).length, [t]), r = E(
|
|
492
493
|
(c) => {
|
|
493
494
|
if (!n.size)
|
|
494
495
|
return;
|
|
495
496
|
const l = c > n.size ? n.size : c, f = Array.from(n.values()).slice(0, l).map((m) => {
|
|
496
|
-
const { thumbnailViewport:
|
|
497
|
+
const { thumbnailViewport: P, scale: u } = so(m.page, m.defaultRotation);
|
|
497
498
|
return {
|
|
498
|
-
scale:
|
|
499
|
+
scale: u,
|
|
499
500
|
page: m.page,
|
|
500
501
|
loading: !0,
|
|
501
|
-
viewport:
|
|
502
|
+
viewport: P,
|
|
502
503
|
defaultRotation: m.defaultRotation
|
|
503
504
|
};
|
|
504
|
-
}).reduce((m,
|
|
505
|
+
}).reduce((m, P) => (m[P.page.pageNumber] = P, m), {});
|
|
505
506
|
e(f);
|
|
506
507
|
},
|
|
507
508
|
[n]
|
|
508
509
|
);
|
|
509
510
|
z(() => {
|
|
510
|
-
|
|
511
|
-
}, [
|
|
511
|
+
r(10);
|
|
512
|
+
}, [r]);
|
|
512
513
|
const i = E(
|
|
513
514
|
(c) => {
|
|
514
515
|
if (!n)
|
|
@@ -527,8 +528,8 @@ const Nr = () => {
|
|
|
527
528
|
},
|
|
528
529
|
[n]
|
|
529
530
|
);
|
|
530
|
-
return { thumbnailPages: t, addPage: i, addToPage:
|
|
531
|
-
}, bn =
|
|
531
|
+
return { thumbnailPages: t, addPage: i, addToPage: r, thumbnailLength: o };
|
|
532
|
+
}, bn = qe({
|
|
532
533
|
thumbnailPages: {},
|
|
533
534
|
addPage: (t) => {
|
|
534
535
|
},
|
|
@@ -538,50 +539,50 @@ const Nr = () => {
|
|
|
538
539
|
setActive: (t) => {
|
|
539
540
|
},
|
|
540
541
|
active: !1
|
|
541
|
-
}), Tn = () =>
|
|
542
|
+
}), Tn = () => Ge(bn), ec = ({
|
|
542
543
|
children: t,
|
|
543
544
|
initialThumbnailsVisible: e
|
|
544
545
|
}) => {
|
|
545
|
-
const { thumbnailPages: n, addPage:
|
|
546
|
+
const { thumbnailPages: n, addPage: o, addToPage: r, thumbnailLength: i } = Ao(), [c, l] = q(e);
|
|
546
547
|
return /* @__PURE__ */ a(
|
|
547
548
|
bn.Provider,
|
|
548
549
|
{
|
|
549
|
-
value: { thumbnailPages: n, addPage:
|
|
550
|
+
value: { thumbnailPages: n, addPage: o, addToPage: r, thumbnailLength: i, active: c, setActive: l },
|
|
550
551
|
children: t
|
|
551
552
|
}
|
|
552
553
|
);
|
|
553
|
-
},
|
|
554
|
-
const [n,
|
|
554
|
+
}, zo = (t = {}, e = "") => {
|
|
555
|
+
const [n, o] = q(e), [r, i] = q(!1), { pdf: c, pages: l } = re(), { widths: d, heights: f } = Ue(), m = k(!n), { currentZoom: P } = _t(), [u, T] = q([]), { setFocusedPage: C } = pe(), { columnCount: b } = Me(), { pageRotate: g } = et(), [S, v] = q(0), { pageScrollElementRef: h, virtualScrollableElementRef: p } = Je(), { scrollMode: s } = Ee(), { pagesRef: w } = be(), [_, y] = q(null), x = k({}), I = k(0), R = W(() => S === 0 ? null : u[S - 1], [S, u]), L = W(() => u.length, [u]), N = E(
|
|
555
556
|
(O) => {
|
|
556
557
|
if (O === 0)
|
|
557
558
|
return;
|
|
558
|
-
const A =
|
|
559
|
+
const A = u[O - 1];
|
|
559
560
|
if (!A || !l)
|
|
560
561
|
return;
|
|
561
|
-
const H =
|
|
562
|
+
const H = p || h;
|
|
562
563
|
if (!H || !w)
|
|
563
564
|
return;
|
|
564
565
|
const U = l.get(A.page);
|
|
565
|
-
if (s === ne.PAGE_SCROLLING &&
|
|
566
|
+
if (s === ne.PAGE_SCROLLING && C(A.page), !U)
|
|
566
567
|
return;
|
|
567
568
|
let B = 0, V = 0;
|
|
568
569
|
if (s === ne.VERTICAL_SCROLLING) {
|
|
569
|
-
const
|
|
570
|
-
B =
|
|
570
|
+
const se = A.page - 1, ce = b, ae = se % ce, Fe = Math.floor(se / ce);
|
|
571
|
+
B = ze(f, Fe), V = ze(d, ae);
|
|
571
572
|
}
|
|
572
|
-
s === ne.HORIZONTAL_SCROLLING && (V = d.slice(0, A.page - 1).reduce((
|
|
573
|
-
const
|
|
573
|
+
s === ne.HORIZONTAL_SCROLLING && (V = d.slice(0, A.page - 1).reduce((se, ce) => se + ce, 0));
|
|
574
|
+
const J = {
|
|
574
575
|
height: f[A.page - 1],
|
|
575
576
|
width: d[A.page - 1]
|
|
576
|
-
}, G = g[A.page], { leftInPage:
|
|
577
|
-
|
|
577
|
+
}, G = g[A.page], { leftInPage: K, topInPage: Y } = ao(
|
|
578
|
+
J,
|
|
578
579
|
w,
|
|
579
580
|
A.rect,
|
|
580
|
-
|
|
581
|
+
P,
|
|
581
582
|
G
|
|
582
|
-
),
|
|
583
|
-
left: Math.max(
|
|
584
|
-
top: Math.max(
|
|
583
|
+
), ee = V + K, oe = B + Y, ie = {
|
|
584
|
+
left: Math.max(ee, 0),
|
|
585
|
+
top: Math.max(oe, 0)
|
|
585
586
|
};
|
|
586
587
|
H.scrollTo({
|
|
587
588
|
...ie,
|
|
@@ -590,14 +591,14 @@ const Nr = () => {
|
|
|
590
591
|
},
|
|
591
592
|
[
|
|
592
593
|
l,
|
|
593
|
-
|
|
594
|
+
C,
|
|
594
595
|
d,
|
|
595
596
|
f,
|
|
596
597
|
s,
|
|
597
|
-
|
|
598
|
+
p,
|
|
598
599
|
h,
|
|
599
600
|
w,
|
|
600
|
-
|
|
601
|
+
u
|
|
601
602
|
]
|
|
602
603
|
);
|
|
603
604
|
z(() => {
|
|
@@ -633,12 +634,12 @@ const Nr = () => {
|
|
|
633
634
|
m.current = !1, i(!0), T([]), v(0), D(c).then((O) => {
|
|
634
635
|
x.current = O;
|
|
635
636
|
const H = Object.keys(O).reduce((U, B) => {
|
|
636
|
-
const V =
|
|
637
|
+
const V = mr(
|
|
637
638
|
[n],
|
|
638
639
|
O[B],
|
|
639
640
|
Number(B) - 1,
|
|
640
641
|
t
|
|
641
|
-
).map((
|
|
642
|
+
).map((J, G) => ({ ...J, page: Number(B), pageMatchIdx: G }));
|
|
642
643
|
return [...U, ...V];
|
|
643
644
|
}, []);
|
|
644
645
|
T(H), v(H.length ? 1 : 0);
|
|
@@ -647,9 +648,9 @@ const Nr = () => {
|
|
|
647
648
|
}).finally(() => i(!1));
|
|
648
649
|
}, [n, D, c, t]), {
|
|
649
650
|
search: n,
|
|
650
|
-
setSearch:
|
|
651
|
-
loading:
|
|
652
|
-
matches:
|
|
651
|
+
setSearch: o,
|
|
652
|
+
loading: r,
|
|
653
|
+
matches: u,
|
|
653
654
|
totalMatches: L,
|
|
654
655
|
currentMatchPosition: S,
|
|
655
656
|
currentMatch: R,
|
|
@@ -658,7 +659,7 @@ const Nr = () => {
|
|
|
658
659
|
currentMatchElement: _,
|
|
659
660
|
setCurrentMatchElement: y
|
|
660
661
|
};
|
|
661
|
-
}, Cn =
|
|
662
|
+
}, Cn = qe({
|
|
662
663
|
search: "",
|
|
663
664
|
setSearch: (t) => {
|
|
664
665
|
},
|
|
@@ -676,48 +677,48 @@ const Nr = () => {
|
|
|
676
677
|
currentMatchElement: null,
|
|
677
678
|
setCurrentMatchElement: (t) => {
|
|
678
679
|
}
|
|
679
|
-
}),
|
|
680
|
+
}), tc = ({
|
|
680
681
|
children: t,
|
|
681
682
|
initialSearch: e
|
|
682
683
|
}) => {
|
|
683
|
-
const [n,
|
|
684
|
-
loading:
|
|
684
|
+
const [n, o] = q({}), {
|
|
685
|
+
loading: r,
|
|
685
686
|
setSearch: i,
|
|
686
687
|
totalMatches: c,
|
|
687
688
|
currentMatchPosition: l,
|
|
688
689
|
currentMatch: d,
|
|
689
690
|
search: f,
|
|
690
691
|
matches: m,
|
|
691
|
-
nextMatch:
|
|
692
|
-
prevMatch:
|
|
692
|
+
nextMatch: P,
|
|
693
|
+
prevMatch: u,
|
|
693
694
|
currentMatchElement: T,
|
|
694
|
-
setCurrentMatchElement:
|
|
695
|
-
} =
|
|
695
|
+
setCurrentMatchElement: C
|
|
696
|
+
} = zo(n, e);
|
|
696
697
|
return /* @__PURE__ */ a(
|
|
697
698
|
Cn.Provider,
|
|
698
699
|
{
|
|
699
700
|
value: {
|
|
700
701
|
searchOptions: n,
|
|
701
|
-
setSearchOptions:
|
|
702
|
-
loading:
|
|
702
|
+
setSearchOptions: o,
|
|
703
|
+
loading: r,
|
|
703
704
|
setSearch: i,
|
|
704
705
|
totalMatches: c,
|
|
705
706
|
currentMatchPosition: l,
|
|
706
707
|
currentMatch: d,
|
|
707
|
-
nextMatch:
|
|
708
|
-
prevMatch:
|
|
708
|
+
nextMatch: P,
|
|
709
|
+
prevMatch: u,
|
|
709
710
|
search: f,
|
|
710
711
|
matches: m,
|
|
711
712
|
currentMatchElement: T,
|
|
712
|
-
setCurrentMatchElement:
|
|
713
|
+
setCurrentMatchElement: C
|
|
713
714
|
},
|
|
714
715
|
children: t
|
|
715
716
|
}
|
|
716
717
|
);
|
|
717
|
-
}, St = () =>
|
|
718
|
-
const e = k(!1), [n,
|
|
719
|
-
|
|
720
|
-
}, []), i = W(() => new
|
|
718
|
+
}, St = () => Ge(Cn), Pn = qe(null), nc = ({ children: t }) => {
|
|
719
|
+
const e = k(!1), [n, o] = q([]), r = E((d) => {
|
|
720
|
+
o((f) => [...f, { id: d.page.pageNumber.toString(), data: d, priority: 0 }]);
|
|
721
|
+
}, []), i = W(() => new Tr(r), [r]), { focusedPage: c } = pe(), l = E((d) => (e.current = !0, Cr(
|
|
721
722
|
d.data.page,
|
|
722
723
|
d.data.canvasElem,
|
|
723
724
|
d.data.options
|
|
@@ -735,16 +736,16 @@ const Nr = () => {
|
|
|
735
736
|
const f = i.dequeue();
|
|
736
737
|
f ? l(f).finally(() => {
|
|
737
738
|
d();
|
|
738
|
-
}) : (e.current = !1,
|
|
739
|
+
}) : (e.current = !1, o(i.peekAll()));
|
|
739
740
|
};
|
|
740
741
|
d();
|
|
741
742
|
}, [i, l, n]), /* @__PURE__ */ a(Pn.Provider, { value: i, children: t });
|
|
742
743
|
}, yn = () => {
|
|
743
|
-
const t =
|
|
744
|
+
const t = Ge(Pn);
|
|
744
745
|
if (!t)
|
|
745
746
|
throw new Error("RenderQueue not found");
|
|
746
747
|
return t;
|
|
747
|
-
},
|
|
748
|
+
}, le = {
|
|
748
749
|
"rp-pages": "_rp-pages_u7m2r_1",
|
|
749
750
|
"rp-page-scrolling-wrapper": "_rp-page-scrolling-wrapper_u7m2r_6",
|
|
750
751
|
"rp-pages-horizontal-scroll": "_rp-pages-horizontal-scroll_u7m2r_11",
|
|
@@ -759,21 +760,21 @@ const Nr = () => {
|
|
|
759
760
|
"rp-page-wrapper": "_rp-page-wrapper_ii91u_1",
|
|
760
761
|
"rp-page": "_rp-page_ii91u_1",
|
|
761
762
|
"rp-loader-wrapper": "_rp-loader-wrapper_ii91u_15"
|
|
762
|
-
},
|
|
763
|
-
const { pageNumber: e, onLoaded: n, onLoading:
|
|
763
|
+
}, Mo = (t) => {
|
|
764
|
+
const { pageNumber: e, onLoaded: n, onLoading: o } = t, r = k(null), { pages: i } = re(), { pageRotate: c } = et(), l = k(), { currentZoom: d } = _t(), f = yn(), m = k(`page-${e}`);
|
|
764
765
|
return z(() => {
|
|
765
766
|
if (!i || d === 0)
|
|
766
767
|
return;
|
|
767
|
-
const
|
|
768
|
-
if (
|
|
769
|
-
const
|
|
770
|
-
|
|
768
|
+
const P = i.get(e);
|
|
769
|
+
if (r.current && P) {
|
|
770
|
+
const u = r.current;
|
|
771
|
+
u.hidden = !0;
|
|
771
772
|
const T = l.current;
|
|
772
|
-
T && T.cancel(),
|
|
773
|
+
T && T.cancel(), o && o(), f.enqueue(
|
|
773
774
|
m.current,
|
|
774
775
|
{
|
|
775
|
-
page:
|
|
776
|
-
canvasElem:
|
|
776
|
+
page: P.page,
|
|
777
|
+
canvasElem: u,
|
|
777
778
|
options: {
|
|
778
779
|
scale: d,
|
|
779
780
|
rotate: c[e],
|
|
@@ -787,31 +788,31 @@ const Nr = () => {
|
|
|
787
788
|
return () => {
|
|
788
789
|
f.removeQueue(m.current);
|
|
789
790
|
};
|
|
790
|
-
}, [i, e, c, d,
|
|
791
|
-
},
|
|
791
|
+
}, [i, e, c, d, o, n, f]), /* @__PURE__ */ a("canvas", { "data-rp": `page-${e}-canvas`, ref: r });
|
|
792
|
+
}, Fo = "_selecting_ppr5g_10", ko = "_markedContent_ppr5g_33", ge = {
|
|
792
793
|
"rp-text-layer": "_rp-text-layer_ppr5g_1",
|
|
793
|
-
selecting:
|
|
794
|
-
markedContent:
|
|
794
|
+
selecting: Fo,
|
|
795
|
+
markedContent: ko,
|
|
795
796
|
"rp-text-layer-text": "_rp-text-layer-text_ppr5g_52"
|
|
796
|
-
},
|
|
797
|
-
const { pageNumber: e } = t, { pages: n } =
|
|
797
|
+
}, Wo = (t) => {
|
|
798
|
+
const { pageNumber: e } = t, { pages: n } = re(), o = k(null), { matches: r, currentMatch: i, setCurrentMatchElement: c } = St(), [l, d] = q(
|
|
798
799
|
[]
|
|
799
|
-
), f = k(), m = k(),
|
|
800
|
-
(h,
|
|
801
|
-
if (s &&
|
|
802
|
-
|
|
800
|
+
), f = k(), m = k(), P = k([]), u = W(() => r.filter((h) => h.pageIndex === e - 1), [r, e]), T = E(
|
|
801
|
+
(h, p, s = !1) => {
|
|
802
|
+
if (s && gr(h, p), !u.length) {
|
|
803
|
+
P.current = [], d([]);
|
|
803
804
|
return;
|
|
804
805
|
}
|
|
805
|
-
const w =
|
|
806
|
+
const w = vr(u, h, p);
|
|
806
807
|
d(w);
|
|
807
808
|
},
|
|
808
|
-
[
|
|
809
|
-
),
|
|
809
|
+
[u]
|
|
810
|
+
), C = k(), b = k(!1), g = E(() => Array.from(document.querySelectorAll('[data-rp$="-textLayer"]')), []);
|
|
810
811
|
z(() => ((() => {
|
|
811
|
-
if (
|
|
812
|
+
if (C.current)
|
|
812
813
|
return;
|
|
813
|
-
|
|
814
|
-
const { signal:
|
|
814
|
+
C.current = new AbortController();
|
|
815
|
+
const { signal: p } = C.current, s = () => {
|
|
815
816
|
g().forEach((_) => {
|
|
816
817
|
const y = _.querySelector(".endOfContent");
|
|
817
818
|
y && (_.appendChild(y), y.style.width = "", y.style.height = "", _.classList.remove(ge.selecting));
|
|
@@ -822,25 +823,25 @@ const Nr = () => {
|
|
|
822
823
|
() => {
|
|
823
824
|
b.current = !0;
|
|
824
825
|
},
|
|
825
|
-
{ signal:
|
|
826
|
+
{ signal: p }
|
|
826
827
|
), document.addEventListener(
|
|
827
828
|
"pointerup",
|
|
828
829
|
() => {
|
|
829
830
|
b.current = !1, s();
|
|
830
831
|
},
|
|
831
|
-
{ signal:
|
|
832
|
+
{ signal: p }
|
|
832
833
|
), window.addEventListener(
|
|
833
834
|
"blur",
|
|
834
835
|
() => {
|
|
835
836
|
b.current = !1, s();
|
|
836
837
|
},
|
|
837
|
-
{ signal:
|
|
838
|
+
{ signal: p }
|
|
838
839
|
), document.addEventListener(
|
|
839
840
|
"keyup",
|
|
840
841
|
() => {
|
|
841
842
|
b.current || s();
|
|
842
843
|
},
|
|
843
|
-
{ signal:
|
|
844
|
+
{ signal: p }
|
|
844
845
|
);
|
|
845
846
|
let w = null;
|
|
846
847
|
document.addEventListener(
|
|
@@ -877,52 +878,52 @@ const Nr = () => {
|
|
|
877
878
|
), N = L == null ? void 0 : L.querySelector(".endOfContent");
|
|
878
879
|
N && L && (N.style.width = L.style.width, N.style.height = L.style.height, (M = R.parentElement) == null || M.insertBefore(N, R.nextSibling)), w = x.cloneRange();
|
|
879
880
|
},
|
|
880
|
-
{ signal:
|
|
881
|
+
{ signal: p }
|
|
881
882
|
);
|
|
882
883
|
})(), () => {
|
|
883
|
-
var
|
|
884
|
-
(
|
|
884
|
+
var p;
|
|
885
|
+
(p = C.current) == null || p.abort(), C.current = void 0;
|
|
885
886
|
}), [g]);
|
|
886
887
|
const S = E(() => {
|
|
887
|
-
|
|
888
|
+
o.current && o.current.classList.add(ge.selecting);
|
|
888
889
|
}, []), v = E(() => {
|
|
889
|
-
|
|
890
|
+
o.current && o.current.classList.remove(ge.selecting);
|
|
890
891
|
}, []);
|
|
891
892
|
return z(() => {
|
|
892
|
-
if (
|
|
893
|
+
if (P.current.forEach((s) => {
|
|
893
894
|
s.classList.remove("selected");
|
|
894
895
|
}), !l.length || !i || i.pageIndex !== e - 1)
|
|
895
896
|
return;
|
|
896
|
-
const h =
|
|
897
|
+
const h = u.findIndex(
|
|
897
898
|
(s) => JSON.stringify(s) === JSON.stringify(i)
|
|
898
899
|
);
|
|
899
900
|
if (h === -1)
|
|
900
901
|
return;
|
|
901
|
-
const
|
|
902
|
-
|
|
902
|
+
const p = l.filter((s) => s.index === h);
|
|
903
|
+
p.length && (P.current = p.map((s) => s.element), c(p[0].element), p.forEach((s) => {
|
|
903
904
|
s.element.classList.add("selected");
|
|
904
905
|
}));
|
|
905
|
-
}, [i, l,
|
|
906
|
+
}, [i, l, u]), z(() => {
|
|
906
907
|
const h = n.get(e);
|
|
907
|
-
if (!h || !
|
|
908
|
+
if (!h || !o.current)
|
|
908
909
|
return;
|
|
909
|
-
const
|
|
910
|
+
const p = o.current;
|
|
910
911
|
return f.current && f.current.cancel(), h.page.getTextContent().then((s) => {
|
|
911
912
|
const w = h.page.getViewport({ scale: 1 });
|
|
912
|
-
return f.current = new
|
|
913
|
+
return f.current = new Wr.TextLayer({
|
|
913
914
|
viewport: w,
|
|
914
915
|
textContentSource: s,
|
|
915
|
-
container:
|
|
916
|
-
}), m.current = s,
|
|
916
|
+
container: p
|
|
917
|
+
}), m.current = s, p && (p.innerText = ""), f.current.render();
|
|
917
918
|
}).then(() => {
|
|
918
919
|
var y, x;
|
|
919
|
-
[].slice.call(
|
|
920
|
+
[].slice.call(p.children).forEach((I) => {
|
|
920
921
|
I.classList.add(ge["rp-text-layer-text"]), I.setAttribute("data-rp", "rp-text-layer-text");
|
|
921
922
|
});
|
|
922
923
|
const w = (y = f.current) == null ? void 0 : y.textDivs;
|
|
923
924
|
w && m.current && T(m.current, w);
|
|
924
925
|
const _ = document.createElement("div");
|
|
925
|
-
_.className = "endOfContent", (x =
|
|
926
|
+
_.className = "endOfContent", (x = o.current) == null || x.appendChild(_);
|
|
926
927
|
}).catch(() => {
|
|
927
928
|
}), () => {
|
|
928
929
|
var s;
|
|
@@ -930,43 +931,43 @@ const Nr = () => {
|
|
|
930
931
|
};
|
|
931
932
|
}, [n, e]), z(() => {
|
|
932
933
|
var s;
|
|
933
|
-
[].slice.call(
|
|
934
|
+
[].slice.call(o.current.children).forEach((w) => {
|
|
934
935
|
w.classList.add(ge["rp-text-layer-text"]);
|
|
935
936
|
});
|
|
936
|
-
const
|
|
937
|
-
|
|
937
|
+
const p = (s = f.current) == null ? void 0 : s.textDivs;
|
|
938
|
+
p && m.current && T(m.current, p, !0);
|
|
938
939
|
}, [T]), /* @__PURE__ */ a(
|
|
939
940
|
"div",
|
|
940
941
|
{
|
|
941
942
|
"data-rp-text-layer": !0,
|
|
942
943
|
"data-rp": `page-${e}-textLayer`,
|
|
943
944
|
className: ge["rp-text-layer"],
|
|
944
|
-
ref:
|
|
945
|
+
ref: o,
|
|
945
946
|
onMouseDown: S,
|
|
946
947
|
onMouseUp: v
|
|
947
948
|
}
|
|
948
949
|
);
|
|
949
|
-
},
|
|
950
|
+
}, Ho = {
|
|
950
951
|
"rp-annotation-layer": "_rp-annotation-layer_1udza_1"
|
|
951
952
|
};
|
|
952
|
-
let
|
|
953
|
-
const
|
|
954
|
-
const { pageNumber: e } = t, n = k(null), { pages:
|
|
953
|
+
let $o = "https://unpkg.com/pdfjs-dist@4.4.168/web/images/";
|
|
954
|
+
const qo = (t) => {
|
|
955
|
+
const { pageNumber: e } = t, n = k(null), { pages: o, pdf: r } = re(), i = k(), [c, l] = q(), { setFocusedPage: d, goToPage: f } = pe(), { scrollMode: m } = Ee(), { print: P } = nt(), { download: u } = Gn(), T = W(() => o.get(e), [o, e]), C = W(() => T == null ? void 0 : T.page.getViewport(), [T]);
|
|
955
956
|
z(() => {
|
|
956
957
|
i.current && (i.current.div.replaceChildren(), i.current = void 0);
|
|
957
|
-
}, [
|
|
958
|
+
}, [r]), z(() => {
|
|
958
959
|
T && T.page.getAnnotations().then((g) => {
|
|
959
960
|
i.current = void 0, l(g), n.current && (n.current.innerText = "");
|
|
960
961
|
});
|
|
961
962
|
}, [T]);
|
|
962
963
|
const b = E(
|
|
963
964
|
(g) => {
|
|
964
|
-
!c || !
|
|
965
|
+
!c || !r || (Vr(g), Br(g, r, c).then((S) => {
|
|
965
966
|
var v, h;
|
|
966
|
-
((v = S == null ? void 0 : S.data) == null ? void 0 : v.action) === "Print" ?
|
|
967
|
-
}), m === ne.PAGE_SCROLLING ? Ft(g, c,
|
|
967
|
+
((v = S == null ? void 0 : S.data) == null ? void 0 : v.action) === "Print" ? P() : ((h = S == null ? void 0 : S.data) == null ? void 0 : h.action) === "SaveAs" && u();
|
|
968
|
+
}), m === ne.PAGE_SCROLLING ? Ft(g, c, r, (S) => d(S.pageIndex + 1)) : Ft(g, c, r, (S) => f(S.pageIndex + 1)));
|
|
968
969
|
},
|
|
969
|
-
[
|
|
970
|
+
[r, c, f, d, m, P, u]
|
|
970
971
|
);
|
|
971
972
|
return z(() => {
|
|
972
973
|
if (!T || !c)
|
|
@@ -979,21 +980,21 @@ const Hr = (t) => {
|
|
|
979
980
|
return;
|
|
980
981
|
}
|
|
981
982
|
const S = /* @__PURE__ */ new Map([]);
|
|
982
|
-
for (const
|
|
983
|
-
const { annotationType: s } =
|
|
983
|
+
for (const p of c) {
|
|
984
|
+
const { annotationType: s } = p;
|
|
984
985
|
switch (s) {
|
|
985
986
|
case Dt.Link:
|
|
986
|
-
|
|
987
|
+
Kr(p);
|
|
987
988
|
break;
|
|
988
989
|
case Dt.Widget:
|
|
989
|
-
|
|
990
|
+
jr(p, g, S);
|
|
990
991
|
break;
|
|
991
992
|
}
|
|
992
993
|
}
|
|
993
994
|
const v = new AbortController();
|
|
994
995
|
return (async () => {
|
|
995
996
|
var w;
|
|
996
|
-
i.current && (i.current.div.replaceChildren(), i.current = void 0), n.current && (n.current.innerText = ""), i.current = new
|
|
997
|
+
i.current && (i.current.div.replaceChildren(), i.current = void 0), n.current && (n.current.innerText = ""), i.current = new Gr({
|
|
997
998
|
div: n.current,
|
|
998
999
|
accessibilityManager: void 0,
|
|
999
1000
|
annotationCanvasMap: void 0,
|
|
@@ -1002,85 +1003,85 @@ const Hr = (t) => {
|
|
|
1002
1003
|
page: T.page,
|
|
1003
1004
|
viewport: g.clone({ dontFlip: !0 })
|
|
1004
1005
|
}), n.current && kt(n.current, b);
|
|
1005
|
-
const
|
|
1006
|
+
const p = await (r == null ? void 0 : r.hasJSActions()), s = await (r == null ? void 0 : r.getFieldObjects());
|
|
1006
1007
|
if (v.signal.aborted)
|
|
1007
1008
|
throw "abort";
|
|
1008
1009
|
return (w = i.current) == null ? void 0 : w.render({
|
|
1009
1010
|
annotations: c,
|
|
1010
|
-
annotationStorage:
|
|
1011
|
-
hasJSActions:
|
|
1011
|
+
annotationStorage: r == null ? void 0 : r.annotationStorage,
|
|
1012
|
+
hasJSActions: p,
|
|
1012
1013
|
fieldObjects: s,
|
|
1013
1014
|
div: n.current,
|
|
1014
1015
|
viewport: g.clone({ dontFlip: !0 }),
|
|
1015
1016
|
page: T.page,
|
|
1016
|
-
imageResourcesPath:
|
|
1017
|
+
imageResourcesPath: $o,
|
|
1017
1018
|
renderForms: !0,
|
|
1018
|
-
linkService: new
|
|
1019
|
+
linkService: new Ur(),
|
|
1019
1020
|
downloadManager: null,
|
|
1020
1021
|
enableScripting: !1
|
|
1021
1022
|
});
|
|
1022
1023
|
})().then(() => {
|
|
1023
|
-
n.current &&
|
|
1024
|
-
}).catch((
|
|
1025
|
-
if (
|
|
1026
|
-
throw
|
|
1024
|
+
n.current && Zr(n.current, b);
|
|
1025
|
+
}).catch((p) => {
|
|
1026
|
+
if (p !== "abort")
|
|
1027
|
+
throw p;
|
|
1027
1028
|
}), () => {
|
|
1028
1029
|
v.abort("clear"), n.current && kt(n.current, b);
|
|
1029
1030
|
};
|
|
1030
|
-
}, [
|
|
1031
|
+
}, [r, c, b]), /* @__PURE__ */ a(
|
|
1031
1032
|
"div",
|
|
1032
1033
|
{
|
|
1033
1034
|
"data-rp": `page-${e}-annotationLayer`,
|
|
1034
|
-
style: { width: `${
|
|
1035
|
-
className:
|
|
1035
|
+
style: { width: `${C == null ? void 0 : C.width}px`, height: `${C == null ? void 0 : C.height}px` },
|
|
1036
|
+
className: Ho["rp-annotation-layer"],
|
|
1036
1037
|
ref: n
|
|
1037
1038
|
}
|
|
1038
1039
|
);
|
|
1039
|
-
},
|
|
1040
|
+
}, Go = {
|
|
1040
1041
|
"rp-text-highlight": "_rp-text-highlight_jdkf8_1"
|
|
1041
|
-
},
|
|
1042
|
-
const [n,
|
|
1042
|
+
}, Uo = ({ pageNumber: t, viewport: e }) => {
|
|
1043
|
+
const [n, o] = q(), { pages: r } = re(), { highlightKeywords: i } = _r(), c = !0, l = k(null), [d, f] = q(null), [m, P] = q([]);
|
|
1043
1044
|
z(() => {
|
|
1044
1045
|
l.current && f(l.current.parentElement);
|
|
1045
1046
|
}, [l]), z(() => {
|
|
1046
1047
|
(async () => {
|
|
1047
|
-
const h =
|
|
1048
|
+
const h = r.get(t);
|
|
1048
1049
|
if (!h || !l.current)
|
|
1049
1050
|
return;
|
|
1050
|
-
const
|
|
1051
|
-
|
|
1051
|
+
const p = await h.page.getTextContent();
|
|
1052
|
+
o(p);
|
|
1052
1053
|
})();
|
|
1053
|
-
}, [
|
|
1054
|
-
const
|
|
1055
|
-
var h,
|
|
1054
|
+
}, [r, t]);
|
|
1055
|
+
const u = W(() => i ? i.map((v) => {
|
|
1056
|
+
var h, p;
|
|
1056
1057
|
return {
|
|
1057
|
-
...
|
|
1058
|
+
...Xr(v.keyword, (h = v.options) == null ? void 0 : h.matchCase, (p = v.options) == null ? void 0 : p.wholeWords),
|
|
1058
1059
|
color: v.highlightColor
|
|
1059
1060
|
};
|
|
1060
1061
|
}) : [], [i]);
|
|
1061
1062
|
function T(v, h) {
|
|
1062
1063
|
if (!v)
|
|
1063
1064
|
return;
|
|
1064
|
-
const
|
|
1065
|
+
const p = `[data-rp="page-${h}-textLayer"]`;
|
|
1065
1066
|
return new Promise((s) => {
|
|
1066
|
-
const w = v.querySelector(
|
|
1067
|
+
const w = v.querySelector(p);
|
|
1067
1068
|
if (w) {
|
|
1068
1069
|
s(w);
|
|
1069
1070
|
return;
|
|
1070
1071
|
}
|
|
1071
1072
|
new MutationObserver((y, x) => {
|
|
1072
|
-
const I = v.querySelector(
|
|
1073
|
+
const I = v.querySelector(p);
|
|
1073
1074
|
I && (s(I), x.disconnect());
|
|
1074
1075
|
}).observe(v, { childList: !0, subtree: !0 });
|
|
1075
1076
|
});
|
|
1076
1077
|
}
|
|
1077
|
-
function
|
|
1078
|
+
function C(v) {
|
|
1078
1079
|
return new Promise((h) => {
|
|
1079
|
-
const
|
|
1080
|
+
const p = v.querySelectorAll(
|
|
1080
1081
|
'[data-rp="rp-text-layer-text"]'
|
|
1081
1082
|
);
|
|
1082
|
-
if (
|
|
1083
|
-
h(Array.from(
|
|
1083
|
+
if (p.length) {
|
|
1084
|
+
h(Array.from(p));
|
|
1084
1085
|
return;
|
|
1085
1086
|
}
|
|
1086
1087
|
new MutationObserver((w, _) => {
|
|
@@ -1091,9 +1092,9 @@ const Hr = (t) => {
|
|
|
1091
1092
|
}).observe(v, { childList: !0, subtree: !0 });
|
|
1092
1093
|
});
|
|
1093
1094
|
}
|
|
1094
|
-
const b = (v, h,
|
|
1095
|
+
const b = (v, h, p, s) => {
|
|
1095
1096
|
var U;
|
|
1096
|
-
const w = document.createRange(), _ =
|
|
1097
|
+
const w = document.createRange(), _ = p.firstChild;
|
|
1097
1098
|
if (!_ || _.nodeType !== Node.TEXT_NODE)
|
|
1098
1099
|
return null;
|
|
1099
1100
|
const y = ((U = _.textContent) == null ? void 0 : U.length) ?? 0, x = s[0].charIdxInSpan, I = s.length === 1 ? x : s[s.length - 1].charIdxInSpan;
|
|
@@ -1103,7 +1104,7 @@ const Hr = (t) => {
|
|
|
1103
1104
|
const R = document.createElement("span");
|
|
1104
1105
|
R.style.width = "auto", w.surroundContents(R);
|
|
1105
1106
|
const L = R.getBoundingClientRect(), N = v.getBoundingClientRect(), F = N.height, M = N.width, D = 100 * (L.left - N.left) / M, O = 100 * (L.top - N.top) / F, A = 100 * L.height / F, H = 100 * L.width / M;
|
|
1106
|
-
return
|
|
1107
|
+
return Yr(R), {
|
|
1107
1108
|
keywordStr: h,
|
|
1108
1109
|
left: D,
|
|
1109
1110
|
top: O,
|
|
@@ -1114,10 +1115,10 @@ const Hr = (t) => {
|
|
|
1114
1115
|
};
|
|
1115
1116
|
};
|
|
1116
1117
|
async function g(v, h) {
|
|
1117
|
-
const
|
|
1118
|
-
if (!
|
|
1118
|
+
const p = await T(d, v);
|
|
1119
|
+
if (!p)
|
|
1119
1120
|
return;
|
|
1120
|
-
const s = await
|
|
1121
|
+
const s = await C(p);
|
|
1121
1122
|
if (s.length) {
|
|
1122
1123
|
const w = s.map((y) => y.tagName === "BR" ? " " : y.textContent).reduce(
|
|
1123
1124
|
(y, x, I) => y.concat(
|
|
@@ -1134,16 +1135,16 @@ const Hr = (t) => {
|
|
|
1134
1135
|
spanIdx: 0
|
|
1135
1136
|
}
|
|
1136
1137
|
]
|
|
1137
|
-
).slice(1), _ = S(
|
|
1138
|
-
|
|
1138
|
+
).slice(1), _ = S(p, h, s, w);
|
|
1139
|
+
P(_);
|
|
1139
1140
|
}
|
|
1140
1141
|
}
|
|
1141
|
-
const S = (v, h,
|
|
1142
|
+
const S = (v, h, p, s) => {
|
|
1142
1143
|
const w = h.length;
|
|
1143
1144
|
if (!s.length || !w)
|
|
1144
1145
|
return [];
|
|
1145
1146
|
const _ = [], y = s.map((x) => x.char).join("");
|
|
1146
|
-
return
|
|
1147
|
+
return u.forEach((x) => {
|
|
1147
1148
|
const { keyword: I, regExp: R, wholeWords: L, color: N } = x, F = I;
|
|
1148
1149
|
if (!F.trim())
|
|
1149
1150
|
return;
|
|
@@ -1151,7 +1152,7 @@ const Hr = (t) => {
|
|
|
1151
1152
|
let D;
|
|
1152
1153
|
const O = [];
|
|
1153
1154
|
for (; (D = M.exec(y)) !== null; )
|
|
1154
|
-
L && !
|
|
1155
|
+
L && !wr(y, D.index, D[0].length) || O.push({
|
|
1155
1156
|
keyword: M,
|
|
1156
1157
|
startIndex: D.index,
|
|
1157
1158
|
endIndex: M.lastIndex
|
|
@@ -1168,26 +1169,26 @@ const Hr = (t) => {
|
|
|
1168
1169
|
);
|
|
1169
1170
|
for (const B of Object.values(U))
|
|
1170
1171
|
if (B.length !== 1 || B[0].char.trim() !== "") {
|
|
1171
|
-
const V = B,
|
|
1172
|
+
const V = B, J = p[V[0].spanIdx], G = b(
|
|
1172
1173
|
v,
|
|
1173
1174
|
F,
|
|
1174
|
-
|
|
1175
|
+
J,
|
|
1175
1176
|
V
|
|
1176
1177
|
);
|
|
1177
1178
|
if (G) {
|
|
1178
|
-
const { left:
|
|
1179
|
-
if (_.find((
|
|
1179
|
+
const { left: K, top: Y } = G;
|
|
1180
|
+
if (_.find((oe) => oe.left === K && oe.top === Y))
|
|
1180
1181
|
continue;
|
|
1181
1182
|
_.push({ ...G, highlightColor: H.color });
|
|
1182
1183
|
}
|
|
1183
1184
|
}
|
|
1184
1185
|
}
|
|
1185
|
-
}), _.sort(
|
|
1186
|
+
}), _.sort(Qr), _;
|
|
1186
1187
|
};
|
|
1187
1188
|
return z(() => {
|
|
1188
1189
|
(async () => {
|
|
1189
1190
|
if (!i || i.length === 0) {
|
|
1190
|
-
|
|
1191
|
+
P([]);
|
|
1191
1192
|
return;
|
|
1192
1193
|
}
|
|
1193
1194
|
try {
|
|
@@ -1196,10 +1197,10 @@ const Hr = (t) => {
|
|
|
1196
1197
|
console.error(h);
|
|
1197
1198
|
}
|
|
1198
1199
|
})();
|
|
1199
|
-
}, [c, i, t, n, e]), /* @__PURE__ */ a(
|
|
1200
|
+
}, [c, i, t, n, e]), /* @__PURE__ */ a(fe, { children: /* @__PURE__ */ a("div", { ref: l, "data-rp": `page-${t}-textHighlightLayer`, children: m.map((v, h) => /* @__PURE__ */ a(
|
|
1200
1201
|
"div",
|
|
1201
1202
|
{
|
|
1202
|
-
className:
|
|
1203
|
+
className: Go["rp-text-highlight"],
|
|
1203
1204
|
style: {
|
|
1204
1205
|
top: `${v.top}%`,
|
|
1205
1206
|
left: `${v.left}%`,
|
|
@@ -1210,36 +1211,36 @@ const Hr = (t) => {
|
|
|
1210
1211
|
},
|
|
1211
1212
|
h
|
|
1212
1213
|
)) }) });
|
|
1213
|
-
}, It =
|
|
1214
|
-
const { pageNumber: n, style:
|
|
1214
|
+
}, It = tt((t, e) => {
|
|
1215
|
+
const { pageNumber: n, style: o, ...r } = t, { pages: i } = re(), { pageRotate: c } = et(), { textLayer: l } = ur(), { currentZoom: d } = _t(), { LoaderImageComponent: f } = bt(), m = k(i.get(n)), [P, u] = q(!1), T = k(null), [C, b] = q({
|
|
1215
1216
|
width: 0,
|
|
1216
1217
|
height: 0
|
|
1217
1218
|
});
|
|
1218
|
-
|
|
1219
|
+
rn(e, () => T.current);
|
|
1219
1220
|
const g = W(() => m.current ? c[n] : 0, [n, c]);
|
|
1220
1221
|
z(() => {
|
|
1221
1222
|
if (i && (m.current = i.get(n), m.current)) {
|
|
1222
|
-
const
|
|
1223
|
+
const p = m.current.page.getViewport({
|
|
1223
1224
|
scale: d,
|
|
1224
1225
|
rotation: g
|
|
1225
1226
|
});
|
|
1226
|
-
b(
|
|
1227
|
+
b(p);
|
|
1227
1228
|
}
|
|
1228
1229
|
}, [i, n, g, d]);
|
|
1229
1230
|
const S = W(() => {
|
|
1230
1231
|
switch (g) {
|
|
1231
1232
|
case 90:
|
|
1232
|
-
return `${
|
|
1233
|
+
return `${C.width / 2}px ${C.width / 2}px`;
|
|
1233
1234
|
case -90:
|
|
1234
1235
|
case 270:
|
|
1235
|
-
return `${
|
|
1236
|
+
return `${C.height / 2}px ${C.height / 2}px`;
|
|
1236
1237
|
default:
|
|
1237
1238
|
return "center";
|
|
1238
1239
|
}
|
|
1239
|
-
}, [g,
|
|
1240
|
-
|
|
1240
|
+
}, [g, C]), v = E(() => {
|
|
1241
|
+
u(!0);
|
|
1241
1242
|
}, []), h = E(() => {
|
|
1242
|
-
|
|
1243
|
+
u(!1);
|
|
1243
1244
|
}, []);
|
|
1244
1245
|
return /* @__PURE__ */ a(
|
|
1245
1246
|
"div",
|
|
@@ -1247,9 +1248,9 @@ const Hr = (t) => {
|
|
|
1247
1248
|
ref: T,
|
|
1248
1249
|
id: `page-${n}`,
|
|
1249
1250
|
"data-rp": `page-${n}`,
|
|
1250
|
-
...
|
|
1251
|
+
...r,
|
|
1251
1252
|
style: {
|
|
1252
|
-
...
|
|
1253
|
+
...o,
|
|
1253
1254
|
"--rp-rotate": `${g}deg`,
|
|
1254
1255
|
"--rp-page-rotate-translate": `${S}`,
|
|
1255
1256
|
"--scale-factor": d
|
|
@@ -1259,17 +1260,17 @@ const Hr = (t) => {
|
|
|
1259
1260
|
"div",
|
|
1260
1261
|
{
|
|
1261
1262
|
style: {
|
|
1262
|
-
width: `${
|
|
1263
|
-
height: `${
|
|
1263
|
+
width: `${C.width}px`,
|
|
1264
|
+
height: `${C.height}px`
|
|
1264
1265
|
},
|
|
1265
1266
|
className: ct["rp-page"],
|
|
1266
1267
|
children: [
|
|
1267
|
-
/* @__PURE__ */ a(
|
|
1268
|
-
|
|
1269
|
-
/* @__PURE__ */ a(
|
|
1270
|
-
l && /* @__PURE__ */ a(
|
|
1271
|
-
/* @__PURE__ */ a(
|
|
1272
|
-
/* @__PURE__ */ a(
|
|
1268
|
+
/* @__PURE__ */ a(Mo, { onLoading: v, onLoaded: h, pageNumber: n }),
|
|
1269
|
+
P && f && /* @__PURE__ */ a("div", { className: ct["rp-loader-wrapper"], children: /* @__PURE__ */ a(f, {}) }),
|
|
1270
|
+
/* @__PURE__ */ a(Jr, { pageNumber: n }),
|
|
1271
|
+
l && /* @__PURE__ */ a(Wo, { pageNumber: n }),
|
|
1272
|
+
/* @__PURE__ */ a(Uo, { pageNumber: n, viewport: C }),
|
|
1273
|
+
/* @__PURE__ */ a(qo, { pageNumber: n })
|
|
1273
1274
|
]
|
|
1274
1275
|
}
|
|
1275
1276
|
)
|
|
@@ -1280,8 +1281,8 @@ function mt() {
|
|
|
1280
1281
|
return mt = Object.assign ? Object.assign.bind() : function(t) {
|
|
1281
1282
|
for (var e = 1; e < arguments.length; e++) {
|
|
1282
1283
|
var n = arguments[e];
|
|
1283
|
-
for (var
|
|
1284
|
-
({}).hasOwnProperty.call(n,
|
|
1284
|
+
for (var o in n)
|
|
1285
|
+
({}).hasOwnProperty.call(n, o) && (t[o] = n[o]);
|
|
1285
1286
|
}
|
|
1286
1287
|
return t;
|
|
1287
1288
|
}, mt.apply(null, arguments);
|
|
@@ -1292,34 +1293,34 @@ function Ht(t) {
|
|
|
1292
1293
|
return t;
|
|
1293
1294
|
}
|
|
1294
1295
|
function gt(t, e) {
|
|
1295
|
-
return gt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n,
|
|
1296
|
-
return n.__proto__ =
|
|
1296
|
+
return gt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, o) {
|
|
1297
|
+
return n.__proto__ = o, n;
|
|
1297
1298
|
}, gt(t, e);
|
|
1298
1299
|
}
|
|
1299
|
-
function
|
|
1300
|
+
function Vo(t, e) {
|
|
1300
1301
|
t.prototype = Object.create(e.prototype), t.prototype.constructor = t, gt(t, e);
|
|
1301
1302
|
}
|
|
1302
1303
|
var $t = Number.isNaN || function(e) {
|
|
1303
1304
|
return typeof e == "number" && e !== e;
|
|
1304
1305
|
};
|
|
1305
|
-
function
|
|
1306
|
+
function Bo(t, e) {
|
|
1306
1307
|
return !!(t === e || $t(t) && $t(e));
|
|
1307
1308
|
}
|
|
1308
|
-
function
|
|
1309
|
+
function jo(t, e) {
|
|
1309
1310
|
if (t.length !== e.length)
|
|
1310
1311
|
return !1;
|
|
1311
1312
|
for (var n = 0; n < t.length; n++)
|
|
1312
|
-
if (!
|
|
1313
|
+
if (!Bo(t[n], e[n]))
|
|
1313
1314
|
return !1;
|
|
1314
1315
|
return !0;
|
|
1315
1316
|
}
|
|
1316
1317
|
function lt(t, e) {
|
|
1317
|
-
e === void 0 && (e =
|
|
1318
|
-
var n,
|
|
1318
|
+
e === void 0 && (e = jo);
|
|
1319
|
+
var n, o = [], r, i = !1;
|
|
1319
1320
|
function c() {
|
|
1320
1321
|
for (var l = [], d = 0; d < arguments.length; d++)
|
|
1321
1322
|
l[d] = arguments[d];
|
|
1322
|
-
return i && n === this && e(l,
|
|
1323
|
+
return i && n === this && e(l, o) || (r = t.apply(this, l), i = !0, n = this, o = l), r;
|
|
1323
1324
|
}
|
|
1324
1325
|
return c;
|
|
1325
1326
|
}
|
|
@@ -1327,15 +1328,15 @@ function qt(t, e) {
|
|
|
1327
1328
|
if (t == null)
|
|
1328
1329
|
return {};
|
|
1329
1330
|
var n = {};
|
|
1330
|
-
for (var
|
|
1331
|
-
if ({}.hasOwnProperty.call(t,
|
|
1332
|
-
if (e.indexOf(
|
|
1331
|
+
for (var o in t)
|
|
1332
|
+
if ({}.hasOwnProperty.call(t, o)) {
|
|
1333
|
+
if (e.indexOf(o) !== -1)
|
|
1333
1334
|
continue;
|
|
1334
|
-
n[
|
|
1335
|
+
n[o] = t[o];
|
|
1335
1336
|
}
|
|
1336
1337
|
return n;
|
|
1337
1338
|
}
|
|
1338
|
-
var
|
|
1339
|
+
var Ko = typeof performance == "object" && typeof performance.now == "function", Gt = Ko ? function() {
|
|
1339
1340
|
return performance.now();
|
|
1340
1341
|
} : function() {
|
|
1341
1342
|
return Date.now();
|
|
@@ -1343,48 +1344,48 @@ var Br = typeof performance == "object" && typeof performance.now == "function",
|
|
|
1343
1344
|
function Ut(t) {
|
|
1344
1345
|
cancelAnimationFrame(t.id);
|
|
1345
1346
|
}
|
|
1346
|
-
function
|
|
1347
|
+
function Zo(t, e) {
|
|
1347
1348
|
var n = Gt();
|
|
1348
|
-
function
|
|
1349
|
-
Gt() - n >= e ? t.call(null) :
|
|
1349
|
+
function o() {
|
|
1350
|
+
Gt() - n >= e ? t.call(null) : r.id = requestAnimationFrame(o);
|
|
1350
1351
|
}
|
|
1351
|
-
var
|
|
1352
|
-
id: requestAnimationFrame(
|
|
1352
|
+
var r = {
|
|
1353
|
+
id: requestAnimationFrame(o)
|
|
1353
1354
|
};
|
|
1354
|
-
return
|
|
1355
|
+
return r;
|
|
1355
1356
|
}
|
|
1356
1357
|
var dt = -1;
|
|
1357
|
-
function
|
|
1358
|
+
function Xo(t) {
|
|
1358
1359
|
if (t === void 0 && (t = !1), dt === -1 || t) {
|
|
1359
1360
|
var e = document.createElement("div"), n = e.style;
|
|
1360
1361
|
n.width = "50px", n.height = "50px", n.overflow = "scroll", document.body.appendChild(e), dt = e.offsetWidth - e.clientWidth, document.body.removeChild(e);
|
|
1361
1362
|
}
|
|
1362
1363
|
return dt;
|
|
1363
1364
|
}
|
|
1364
|
-
var
|
|
1365
|
+
var De = null;
|
|
1365
1366
|
function Vt(t) {
|
|
1366
|
-
if (t === void 0 && (t = !1),
|
|
1367
|
+
if (t === void 0 && (t = !1), De === null || t) {
|
|
1367
1368
|
var e = document.createElement("div"), n = e.style;
|
|
1368
1369
|
n.width = "50px", n.height = "50px", n.overflow = "scroll", n.direction = "rtl";
|
|
1369
|
-
var
|
|
1370
|
-
return
|
|
1370
|
+
var o = document.createElement("div"), r = o.style;
|
|
1371
|
+
return r.width = "100px", r.height = "100px", e.appendChild(o), document.body.appendChild(e), e.scrollLeft > 0 ? De = "positive-descending" : (e.scrollLeft = 1, e.scrollLeft === 0 ? De = "negative" : De = "positive-ascending"), document.body.removeChild(e), De;
|
|
1371
1372
|
}
|
|
1372
|
-
return
|
|
1373
|
+
return De;
|
|
1373
1374
|
}
|
|
1374
|
-
var
|
|
1375
|
+
var Qo = 150, Yo = function(e) {
|
|
1375
1376
|
var n = e.columnIndex;
|
|
1376
1377
|
e.data;
|
|
1377
|
-
var
|
|
1378
|
-
return
|
|
1379
|
-
},
|
|
1380
|
-
process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (
|
|
1381
|
-
function
|
|
1382
|
-
var e, n = t.getColumnOffset,
|
|
1378
|
+
var o = e.rowIndex;
|
|
1379
|
+
return o + ":" + n;
|
|
1380
|
+
}, je = null, Ke = null, Ze = null;
|
|
1381
|
+
process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (je = /* @__PURE__ */ new WeakSet(), Ke = /* @__PURE__ */ new WeakSet(), Ze = /* @__PURE__ */ new WeakSet());
|
|
1382
|
+
function Jo(t) {
|
|
1383
|
+
var e, n = t.getColumnOffset, o = t.getColumnStartIndexForOffset, r = t.getColumnStopIndexForStartIndex, i = t.getColumnWidth, c = t.getEstimatedTotalHeight, l = t.getEstimatedTotalWidth, d = t.getOffsetForColumnAndAlignment, f = t.getOffsetForRowAndAlignment, m = t.getRowHeight, P = t.getRowOffset, u = t.getRowStartIndexForOffset, T = t.getRowStopIndexForStartIndex, C = t.initInstanceProps, b = t.shouldResetStyleCacheOnItemSizeChange, g = t.validateProps;
|
|
1383
1384
|
return e = /* @__PURE__ */ function(S) {
|
|
1384
|
-
|
|
1385
|
-
function v(
|
|
1385
|
+
Vo(v, S);
|
|
1386
|
+
function v(p) {
|
|
1386
1387
|
var s;
|
|
1387
|
-
return s = S.call(this,
|
|
1388
|
+
return s = S.call(this, p) || this, s._instanceProps = C(s.props, Ht(s)), s._resetIsScrollingTimeoutId = null, s._outerRef = void 0, s.state = {
|
|
1388
1389
|
instance: Ht(s),
|
|
1389
1390
|
isScrolling: !1,
|
|
1390
1391
|
horizontalScrollDirection: "forward",
|
|
@@ -1421,7 +1422,7 @@ function Qr(t) {
|
|
|
1421
1422
|
position: "absolute",
|
|
1422
1423
|
left: D ? void 0 : M,
|
|
1423
1424
|
right: D ? M : void 0,
|
|
1424
|
-
top:
|
|
1425
|
+
top: P(s.props, w, s._instanceProps),
|
|
1425
1426
|
height: m(s.props, w, s._instanceProps),
|
|
1426
1427
|
width: i(s.props, _, s._instanceProps)
|
|
1427
1428
|
};
|
|
@@ -1459,7 +1460,7 @@ function Qr(t) {
|
|
|
1459
1460
|
var _ = s.props.outerRef;
|
|
1460
1461
|
s._outerRef = w, typeof _ == "function" ? _(w) : _ != null && typeof _ == "object" && _.hasOwnProperty("current") && (_.current = w);
|
|
1461
1462
|
}, s._resetIsScrollingDebounced = function() {
|
|
1462
|
-
s._resetIsScrollingTimeoutId !== null && Ut(s._resetIsScrollingTimeoutId), s._resetIsScrollingTimeoutId =
|
|
1463
|
+
s._resetIsScrollingTimeoutId !== null && Ut(s._resetIsScrollingTimeoutId), s._resetIsScrollingTimeoutId = Zo(s._resetIsScrolling, Qo);
|
|
1463
1464
|
}, s._resetIsScrolling = function() {
|
|
1464
1465
|
s._resetIsScrollingTimeoutId = null, s.setState({
|
|
1465
1466
|
isScrolling: !1
|
|
@@ -1469,7 +1470,7 @@ function Qr(t) {
|
|
|
1469
1470
|
}, s;
|
|
1470
1471
|
}
|
|
1471
1472
|
v.getDerivedStateFromProps = function(s, w) {
|
|
1472
|
-
return
|
|
1473
|
+
return ei(s, w), g(s), null;
|
|
1473
1474
|
};
|
|
1474
1475
|
var h = v.prototype;
|
|
1475
1476
|
return h.scrollTo = function(s) {
|
|
@@ -1484,7 +1485,7 @@ function Qr(t) {
|
|
|
1484
1485
|
};
|
|
1485
1486
|
}, this._resetIsScrollingDebounced);
|
|
1486
1487
|
}, h.scrollToItem = function(s) {
|
|
1487
|
-
var w = s.align, _ = w === void 0 ? "auto" : w, y = s.columnIndex, x = s.rowIndex, I = this.props, R = I.columnCount, L = I.height, N = I.rowCount, F = I.width, M = this.state, D = M.scrollLeft, O = M.scrollTop, A =
|
|
1488
|
+
var w = s.align, _ = w === void 0 ? "auto" : w, y = s.columnIndex, x = s.rowIndex, I = this.props, R = I.columnCount, L = I.height, N = I.rowCount, F = I.width, M = this.state, D = M.scrollLeft, O = M.scrollTop, A = Xo();
|
|
1488
1489
|
y !== void 0 && (y = Math.max(0, Math.min(y, R - 1))), x !== void 0 && (x = Math.max(0, Math.min(x, N - 1)));
|
|
1489
1490
|
var H = c(this.props, this._instanceProps), U = l(this.props, this._instanceProps), B = U > F ? A : 0, V = H > L ? A : 0;
|
|
1490
1491
|
this.scrollTo({
|
|
@@ -1523,24 +1524,24 @@ function Qr(t) {
|
|
|
1523
1524
|
}, h.componentWillUnmount = function() {
|
|
1524
1525
|
this._resetIsScrollingTimeoutId !== null && Ut(this._resetIsScrollingTimeoutId);
|
|
1525
1526
|
}, h.render = function() {
|
|
1526
|
-
var s = this.props, w = s.children, _ = s.className, y = s.columnCount, x = s.direction, I = s.height, R = s.innerRef, L = s.innerElementType, N = s.innerTagName, F = s.itemData, M = s.itemKey, D = M === void 0 ?
|
|
1527
|
+
var s = this.props, w = s.children, _ = s.className, y = s.columnCount, x = s.direction, I = s.height, R = s.innerRef, L = s.innerElementType, N = s.innerTagName, F = s.itemData, M = s.itemKey, D = M === void 0 ? Yo : M, O = s.outerElementType, A = s.outerTagName, H = s.rowCount, U = s.style, B = s.useIsScrolling, V = s.width, J = this.state.isScrolling, G = this._getHorizontalRangeToRender(), K = G[0], Y = G[1], ee = this._getVerticalRangeToRender(), oe = ee[0], ie = ee[1], se = [];
|
|
1527
1528
|
if (y > 0 && H)
|
|
1528
|
-
for (var
|
|
1529
|
-
for (var
|
|
1530
|
-
|
|
1531
|
-
columnIndex:
|
|
1529
|
+
for (var ce = oe; ce <= ie; ce++)
|
|
1530
|
+
for (var ae = K; ae <= Y; ae++)
|
|
1531
|
+
se.push(Be(w, {
|
|
1532
|
+
columnIndex: ae,
|
|
1532
1533
|
data: F,
|
|
1533
|
-
isScrolling: B ?
|
|
1534
|
+
isScrolling: B ? J : void 0,
|
|
1534
1535
|
key: D({
|
|
1535
|
-
columnIndex:
|
|
1536
|
+
columnIndex: ae,
|
|
1536
1537
|
data: F,
|
|
1537
|
-
rowIndex:
|
|
1538
|
+
rowIndex: ce
|
|
1538
1539
|
}),
|
|
1539
|
-
rowIndex:
|
|
1540
|
-
style: this._getItemStyle(
|
|
1540
|
+
rowIndex: ce,
|
|
1541
|
+
style: this._getItemStyle(ce, ae)
|
|
1541
1542
|
}));
|
|
1542
|
-
var
|
|
1543
|
-
return
|
|
1543
|
+
var Fe = c(this.props, this._instanceProps), ke = l(this.props, this._instanceProps);
|
|
1544
|
+
return Be(O || A || "div", {
|
|
1544
1545
|
className: _,
|
|
1545
1546
|
onScroll: this._onScroll,
|
|
1546
1547
|
ref: this._outerRefSetter,
|
|
@@ -1553,13 +1554,13 @@ function Qr(t) {
|
|
|
1553
1554
|
willChange: "transform",
|
|
1554
1555
|
direction: x
|
|
1555
1556
|
}, U)
|
|
1556
|
-
},
|
|
1557
|
-
children:
|
|
1557
|
+
}, Be(L || N || "div", {
|
|
1558
|
+
children: se,
|
|
1558
1559
|
ref: R,
|
|
1559
1560
|
style: {
|
|
1560
|
-
height:
|
|
1561
|
-
pointerEvents:
|
|
1562
|
-
width:
|
|
1561
|
+
height: Fe,
|
|
1562
|
+
pointerEvents: J ? "none" : void 0,
|
|
1563
|
+
width: ke
|
|
1563
1564
|
}
|
|
1564
1565
|
}));
|
|
1565
1566
|
}, h._callPropsCallbacks = function() {
|
|
@@ -1569,150 +1570,150 @@ function Qr(t) {
|
|
|
1569
1570
|
this._callOnItemsRendered(R, L, D, O, N, F, A, H);
|
|
1570
1571
|
}
|
|
1571
1572
|
if (typeof y == "function") {
|
|
1572
|
-
var U = this.state, B = U.horizontalScrollDirection, V = U.scrollLeft,
|
|
1573
|
-
this._callOnScroll(V,
|
|
1573
|
+
var U = this.state, B = U.horizontalScrollDirection, V = U.scrollLeft, J = U.scrollTop, G = U.scrollUpdateWasRequested, K = U.verticalScrollDirection;
|
|
1574
|
+
this._callOnScroll(V, J, B, K, G);
|
|
1574
1575
|
}
|
|
1575
1576
|
}, h._getHorizontalRangeToRender = function() {
|
|
1576
1577
|
var s = this.props, w = s.columnCount, _ = s.overscanColumnCount, y = s.overscanColumnsCount, x = s.overscanCount, I = s.rowCount, R = this.state, L = R.horizontalScrollDirection, N = R.isScrolling, F = R.scrollLeft, M = _ || y || x || 1;
|
|
1577
1578
|
if (w === 0 || I === 0)
|
|
1578
1579
|
return [0, 0, 0, 0];
|
|
1579
|
-
var D =
|
|
1580
|
+
var D = o(this.props, F, this._instanceProps), O = r(this.props, D, F, this._instanceProps), A = !N || L === "backward" ? Math.max(1, M) : 1, H = !N || L === "forward" ? Math.max(1, M) : 1;
|
|
1580
1581
|
return [Math.max(0, D - A), Math.max(0, Math.min(w - 1, O + H)), D, O];
|
|
1581
1582
|
}, h._getVerticalRangeToRender = function() {
|
|
1582
1583
|
var s = this.props, w = s.columnCount, _ = s.overscanCount, y = s.overscanRowCount, x = s.overscanRowsCount, I = s.rowCount, R = this.state, L = R.isScrolling, N = R.verticalScrollDirection, F = R.scrollTop, M = y || x || _ || 1;
|
|
1583
1584
|
if (w === 0 || I === 0)
|
|
1584
1585
|
return [0, 0, 0, 0];
|
|
1585
|
-
var D =
|
|
1586
|
+
var D = u(this.props, F, this._instanceProps), O = T(this.props, D, F, this._instanceProps), A = !L || N === "backward" ? Math.max(1, M) : 1, H = !L || N === "forward" ? Math.max(1, M) : 1;
|
|
1586
1587
|
return [Math.max(0, D - A), Math.max(0, Math.min(I - 1, O + H)), D, O];
|
|
1587
1588
|
}, v;
|
|
1588
|
-
}(
|
|
1589
|
+
}(or), e.defaultProps = {
|
|
1589
1590
|
direction: "ltr",
|
|
1590
1591
|
itemData: void 0,
|
|
1591
1592
|
useIsScrolling: !1
|
|
1592
1593
|
}, e;
|
|
1593
1594
|
}
|
|
1594
|
-
var
|
|
1595
|
-
var
|
|
1595
|
+
var ei = function(e, n) {
|
|
1596
|
+
var o = e.children, r = e.direction, i = e.height, c = e.innerTagName, l = e.outerTagName, d = e.overscanColumnsCount, f = e.overscanCount, m = e.overscanRowsCount, P = e.width, u = n.instance;
|
|
1596
1597
|
if (process.env.NODE_ENV !== "production") {
|
|
1597
|
-
if (typeof f == "number" &&
|
|
1598
|
-
throw Error('An invalid "children" prop has been specified. Value should be a React component. ' + ('"' + (
|
|
1599
|
-
switch (
|
|
1598
|
+
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 d == "number" || typeof m == "number") && Ke && !Ke.has(u) && (Ke.add(u), console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (c != null || l != null) && Ze && !Ze.has(u) && (Ze.add(u), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")), o == null)
|
|
1599
|
+
throw Error('An invalid "children" prop has been specified. Value should be a React component. ' + ('"' + (o === null ? "null" : typeof o) + '" was specified.'));
|
|
1600
|
+
switch (r) {
|
|
1600
1601
|
case "ltr":
|
|
1601
1602
|
case "rtl":
|
|
1602
1603
|
break;
|
|
1603
1604
|
default:
|
|
1604
|
-
throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". ' + ('"' +
|
|
1605
|
+
throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". ' + ('"' + r + '" was specified.'));
|
|
1605
1606
|
}
|
|
1606
|
-
if (typeof
|
|
1607
|
-
throw Error('An invalid "width" prop has been specified. Grids must specify a number for width. ' + ('"' + (
|
|
1607
|
+
if (typeof P != "number")
|
|
1608
|
+
throw Error('An invalid "width" prop has been specified. Grids must specify a number for width. ' + ('"' + (P === null ? "null" : typeof P) + '" was specified.'));
|
|
1608
1609
|
if (typeof i != "number")
|
|
1609
1610
|
throw Error('An invalid "height" prop has been specified. Grids must specify a number for height. ' + ('"' + (i === null ? "null" : typeof i) + '" was specified.'));
|
|
1610
1611
|
}
|
|
1611
1612
|
}, Bt = 50, Sn = function(e, n) {
|
|
1612
|
-
var
|
|
1613
|
-
if (c >=
|
|
1614
|
-
var d =
|
|
1613
|
+
var o = e.rowCount, r = n.rowMetadataMap, i = n.estimatedRowHeight, c = n.lastMeasuredRowIndex, l = 0;
|
|
1614
|
+
if (c >= o && (c = o - 1), c >= 0) {
|
|
1615
|
+
var d = r[c];
|
|
1615
1616
|
l = d.offset + d.size;
|
|
1616
1617
|
}
|
|
1617
|
-
var f =
|
|
1618
|
+
var f = o - c - 1, m = f * i;
|
|
1618
1619
|
return l + m;
|
|
1619
1620
|
}, In = function(e, n) {
|
|
1620
|
-
var
|
|
1621
|
-
if (c >=
|
|
1622
|
-
var d =
|
|
1621
|
+
var o = e.columnCount, r = n.columnMetadataMap, i = n.estimatedColumnWidth, c = n.lastMeasuredColumnIndex, l = 0;
|
|
1622
|
+
if (c >= o && (c = o - 1), c >= 0) {
|
|
1623
|
+
var d = r[c];
|
|
1623
1624
|
l = d.offset + d.size;
|
|
1624
1625
|
}
|
|
1625
|
-
var f =
|
|
1626
|
+
var f = o - c - 1, m = f * i;
|
|
1626
1627
|
return l + m;
|
|
1627
|
-
}, ve = function(e, n,
|
|
1628
|
+
}, ve = function(e, n, o, r) {
|
|
1628
1629
|
var i, c, l;
|
|
1629
|
-
if (e === "column" ? (i =
|
|
1630
|
+
if (e === "column" ? (i = r.columnMetadataMap, c = n.columnWidth, l = r.lastMeasuredColumnIndex) : (i = r.rowMetadataMap, c = n.rowHeight, l = r.lastMeasuredRowIndex), o > l) {
|
|
1630
1631
|
var d = 0;
|
|
1631
1632
|
if (l >= 0) {
|
|
1632
1633
|
var f = i[l];
|
|
1633
1634
|
d = f.offset + f.size;
|
|
1634
1635
|
}
|
|
1635
|
-
for (var m = l + 1; m <=
|
|
1636
|
-
var
|
|
1636
|
+
for (var m = l + 1; m <= o; m++) {
|
|
1637
|
+
var P = c(m);
|
|
1637
1638
|
i[m] = {
|
|
1638
1639
|
offset: d,
|
|
1639
|
-
size:
|
|
1640
|
-
}, d +=
|
|
1640
|
+
size: P
|
|
1641
|
+
}, d += P;
|
|
1641
1642
|
}
|
|
1642
|
-
e === "column" ?
|
|
1643
|
+
e === "column" ? r.lastMeasuredColumnIndex = o : r.lastMeasuredRowIndex = o;
|
|
1643
1644
|
}
|
|
1644
|
-
return i[
|
|
1645
|
-
}, jt = function(e, n,
|
|
1645
|
+
return i[o];
|
|
1646
|
+
}, jt = function(e, n, o, r) {
|
|
1646
1647
|
var i, c;
|
|
1647
|
-
e === "column" ? (i =
|
|
1648
|
+
e === "column" ? (i = o.columnMetadataMap, c = o.lastMeasuredColumnIndex) : (i = o.rowMetadataMap, c = o.lastMeasuredRowIndex);
|
|
1648
1649
|
var l = c > 0 ? i[c].offset : 0;
|
|
1649
|
-
return l >=
|
|
1650
|
-
}, xn = function(e, n,
|
|
1651
|
-
for (; i <=
|
|
1652
|
-
var l = i + Math.floor((
|
|
1650
|
+
return l >= r ? xn(e, n, o, c, 0, r) : ti(e, n, o, Math.max(0, c), r);
|
|
1651
|
+
}, xn = function(e, n, o, r, i, c) {
|
|
1652
|
+
for (; i <= r; ) {
|
|
1653
|
+
var l = i + Math.floor((r - i) / 2), d = ve(e, n, l, o).offset;
|
|
1653
1654
|
if (d === c)
|
|
1654
1655
|
return l;
|
|
1655
|
-
d < c ? i = l + 1 : d > c && (
|
|
1656
|
+
d < c ? i = l + 1 : d > c && (r = l - 1);
|
|
1656
1657
|
}
|
|
1657
1658
|
return i > 0 ? i - 1 : 0;
|
|
1658
|
-
},
|
|
1659
|
-
for (var c = e === "column" ? n.columnCount : n.rowCount, l = 1;
|
|
1660
|
-
|
|
1661
|
-
return xn(e, n,
|
|
1662
|
-
}, Kt = function(e, n,
|
|
1663
|
-
var d = e === "column" ? n.width : n.height, f = ve(e, n,
|
|
1664
|
-
switch (
|
|
1659
|
+
}, ti = function(e, n, o, r, i) {
|
|
1660
|
+
for (var c = e === "column" ? n.columnCount : n.rowCount, l = 1; r < c && ve(e, n, r, o).offset < i; )
|
|
1661
|
+
r += l, l *= 2;
|
|
1662
|
+
return xn(e, n, o, Math.min(r, c - 1), Math.floor(r / 2), i);
|
|
1663
|
+
}, Kt = function(e, n, o, r, i, c, l) {
|
|
1664
|
+
var d = e === "column" ? n.width : n.height, f = ve(e, n, o, c), m = e === "column" ? In(n, c) : Sn(n, c), P = Math.max(0, Math.min(m - d, f.offset)), u = Math.max(0, f.offset - d + l + f.size);
|
|
1665
|
+
switch (r === "smart" && (i >= u - d && i <= P + d ? r = "auto" : r = "center"), r) {
|
|
1665
1666
|
case "start":
|
|
1666
|
-
return
|
|
1667
|
+
return P;
|
|
1667
1668
|
case "end":
|
|
1668
|
-
return
|
|
1669
|
+
return u;
|
|
1669
1670
|
case "center":
|
|
1670
|
-
return Math.round(
|
|
1671
|
+
return Math.round(u + (P - u) / 2);
|
|
1671
1672
|
case "auto":
|
|
1672
1673
|
default:
|
|
1673
|
-
return i >=
|
|
1674
|
+
return i >= u && i <= P ? i : u > P || i < u ? u : P;
|
|
1674
1675
|
}
|
|
1675
|
-
},
|
|
1676
|
-
getColumnOffset: function(e, n,
|
|
1677
|
-
return ve("column", e, n,
|
|
1676
|
+
}, ni = /* @__PURE__ */ Jo({
|
|
1677
|
+
getColumnOffset: function(e, n, o) {
|
|
1678
|
+
return ve("column", e, n, o).offset;
|
|
1678
1679
|
},
|
|
1679
|
-
getColumnStartIndexForOffset: function(e, n,
|
|
1680
|
-
return jt("column", e,
|
|
1680
|
+
getColumnStartIndexForOffset: function(e, n, o) {
|
|
1681
|
+
return jt("column", e, o, n);
|
|
1681
1682
|
},
|
|
1682
|
-
getColumnStopIndexForStartIndex: function(e, n,
|
|
1683
|
-
for (var i = e.columnCount, c = e.width, l = ve("column", e, n,
|
|
1684
|
-
m++, f += ve("column", e, m,
|
|
1683
|
+
getColumnStopIndexForStartIndex: function(e, n, o, r) {
|
|
1684
|
+
for (var i = e.columnCount, c = e.width, l = ve("column", e, n, r), d = o + c, f = l.offset + l.size, m = n; m < i - 1 && f < d; )
|
|
1685
|
+
m++, f += ve("column", e, m, r).size;
|
|
1685
1686
|
return m;
|
|
1686
1687
|
},
|
|
1687
|
-
getColumnWidth: function(e, n,
|
|
1688
|
-
return
|
|
1688
|
+
getColumnWidth: function(e, n, o) {
|
|
1689
|
+
return o.columnMetadataMap[n].size;
|
|
1689
1690
|
},
|
|
1690
1691
|
getEstimatedTotalHeight: Sn,
|
|
1691
1692
|
getEstimatedTotalWidth: In,
|
|
1692
|
-
getOffsetForColumnAndAlignment: function(e, n,
|
|
1693
|
-
return Kt("column", e, n,
|
|
1693
|
+
getOffsetForColumnAndAlignment: function(e, n, o, r, i, c) {
|
|
1694
|
+
return Kt("column", e, n, o, r, i, c);
|
|
1694
1695
|
},
|
|
1695
|
-
getOffsetForRowAndAlignment: function(e, n,
|
|
1696
|
-
return Kt("row", e, n,
|
|
1696
|
+
getOffsetForRowAndAlignment: function(e, n, o, r, i, c) {
|
|
1697
|
+
return Kt("row", e, n, o, r, i, c);
|
|
1697
1698
|
},
|
|
1698
|
-
getRowOffset: function(e, n,
|
|
1699
|
-
return ve("row", e, n,
|
|
1699
|
+
getRowOffset: function(e, n, o) {
|
|
1700
|
+
return ve("row", e, n, o).offset;
|
|
1700
1701
|
},
|
|
1701
|
-
getRowHeight: function(e, n,
|
|
1702
|
-
return
|
|
1702
|
+
getRowHeight: function(e, n, o) {
|
|
1703
|
+
return o.rowMetadataMap[n].size;
|
|
1703
1704
|
},
|
|
1704
|
-
getRowStartIndexForOffset: function(e, n,
|
|
1705
|
-
return jt("row", e,
|
|
1705
|
+
getRowStartIndexForOffset: function(e, n, o) {
|
|
1706
|
+
return jt("row", e, o, n);
|
|
1706
1707
|
},
|
|
1707
|
-
getRowStopIndexForStartIndex: function(e, n,
|
|
1708
|
-
for (var i = e.rowCount, c = e.height, l = ve("row", e, n,
|
|
1709
|
-
m++, f += ve("row", e, m,
|
|
1708
|
+
getRowStopIndexForStartIndex: function(e, n, o, r) {
|
|
1709
|
+
for (var i = e.rowCount, c = e.height, l = ve("row", e, n, r), d = o + c, f = l.offset + l.size, m = n; m < i - 1 && f < d; )
|
|
1710
|
+
m++, f += ve("row", e, m, r).size;
|
|
1710
1711
|
return m;
|
|
1711
1712
|
},
|
|
1712
1713
|
initInstanceProps: function(e, n) {
|
|
1713
|
-
var
|
|
1714
|
+
var o = e, r = o.estimatedColumnWidth, i = o.estimatedRowHeight, c = {
|
|
1714
1715
|
columnMetadataMap: {},
|
|
1715
|
-
estimatedColumnWidth:
|
|
1716
|
+
estimatedColumnWidth: r || Bt,
|
|
1716
1717
|
estimatedRowHeight: i || Bt,
|
|
1717
1718
|
lastMeasuredColumnIndex: -1,
|
|
1718
1719
|
lastMeasuredRowIndex: -1,
|
|
@@ -1729,18 +1730,18 @@ var Yr = function(e, n) {
|
|
|
1729
1730
|
shouldForceUpdate: d
|
|
1730
1731
|
});
|
|
1731
1732
|
}, n.resetAfterIndices = function(l) {
|
|
1732
|
-
var d = l.columnIndex, f = l.rowIndex, m = l.shouldForceUpdate,
|
|
1733
|
-
typeof d == "number" && (c.lastMeasuredColumnIndex = Math.min(c.lastMeasuredColumnIndex, d - 1)), typeof f == "number" && (c.lastMeasuredRowIndex = Math.min(c.lastMeasuredRowIndex, f - 1)), n._getItemStyleCache(-1),
|
|
1733
|
+
var d = l.columnIndex, f = l.rowIndex, m = l.shouldForceUpdate, P = m === void 0 ? !0 : m;
|
|
1734
|
+
typeof d == "number" && (c.lastMeasuredColumnIndex = Math.min(c.lastMeasuredColumnIndex, d - 1)), typeof f == "number" && (c.lastMeasuredRowIndex = Math.min(c.lastMeasuredRowIndex, f - 1)), n._getItemStyleCache(-1), P && n.forceUpdate();
|
|
1734
1735
|
}, c;
|
|
1735
1736
|
},
|
|
1736
1737
|
shouldResetStyleCacheOnItemSizeChange: !1,
|
|
1737
1738
|
validateProps: function(e) {
|
|
1738
|
-
var n = e.columnWidth,
|
|
1739
|
+
var n = e.columnWidth, o = e.rowHeight;
|
|
1739
1740
|
if (process.env.NODE_ENV !== "production") {
|
|
1740
1741
|
if (typeof n != "function")
|
|
1741
1742
|
throw Error('An invalid "columnWidth" prop has been specified. Value should be a function. ' + ('"' + (n === null ? "null" : typeof n) + '" was specified.'));
|
|
1742
|
-
if (typeof
|
|
1743
|
-
throw Error('An invalid "rowHeight" prop has been specified. Value should be a function. ' + ('"' + (
|
|
1743
|
+
if (typeof o != "function")
|
|
1744
|
+
throw Error('An invalid "rowHeight" prop has been specified. Value should be a function. ' + ('"' + (o === null ? "null" : typeof o) + '" was specified.'));
|
|
1744
1745
|
}
|
|
1745
1746
|
}
|
|
1746
1747
|
});
|
|
@@ -1749,21 +1750,21 @@ function Zt(t, e) {
|
|
|
1749
1750
|
for (var n in t)
|
|
1750
1751
|
if (!(n in e))
|
|
1751
1752
|
return !0;
|
|
1752
|
-
for (var
|
|
1753
|
-
if (t[
|
|
1753
|
+
for (var o in e)
|
|
1754
|
+
if (t[o] !== e[o])
|
|
1754
1755
|
return !0;
|
|
1755
1756
|
return !1;
|
|
1756
1757
|
}
|
|
1757
|
-
var
|
|
1758
|
-
function
|
|
1759
|
-
var n = t.style,
|
|
1760
|
-
return !Zt(n,
|
|
1758
|
+
var ri = ["style"], oi = ["style"];
|
|
1759
|
+
function ii(t, e) {
|
|
1760
|
+
var n = t.style, o = qt(t, ri), r = e.style, i = qt(e, oi);
|
|
1761
|
+
return !Zt(n, r) && !Zt(o, i);
|
|
1761
1762
|
}
|
|
1762
|
-
const
|
|
1763
|
-
const { viewMode: t } =
|
|
1763
|
+
const ai = () => {
|
|
1764
|
+
const { viewMode: t } = Me(), { scrollMode: e } = Ee(), { setColumnCount: n } = sn(), { virtualScrollableElementRef: o } = Je(), r = Ue(), i = W(() => r.heights.length, [r.heights]), c = W(() => e === ne.HORIZONTAL_SCROLLING ? i : t === Re.DUAL_PAGE ? 2 : 1, [t, e, e, i, o]), l = W(() => r.widths.reduce((g, S, v) => {
|
|
1764
1765
|
const h = v % c;
|
|
1765
1766
|
return (!g[h] || S > g[h]) && (g[h] = S), g;
|
|
1766
|
-
}, []), [
|
|
1767
|
+
}, []), [r.widths, c]), d = E(
|
|
1767
1768
|
(b) => {
|
|
1768
1769
|
const g = b % l.length;
|
|
1769
1770
|
return l[g] || 0;
|
|
@@ -1773,22 +1774,22 @@ const ri = () => {
|
|
|
1773
1774
|
(b) => {
|
|
1774
1775
|
const g = Array.from({ length: c }, (S, v) => {
|
|
1775
1776
|
const h = b * c + v;
|
|
1776
|
-
return
|
|
1777
|
+
return r.heights[h] || 0;
|
|
1777
1778
|
});
|
|
1778
1779
|
return Math.max(...g);
|
|
1779
1780
|
},
|
|
1780
|
-
[
|
|
1781
|
+
[r.heights, c]
|
|
1781
1782
|
);
|
|
1782
1783
|
z(() => {
|
|
1783
1784
|
n(c);
|
|
1784
1785
|
}, [c, n]);
|
|
1785
|
-
const m = W(() => e === ne.HORIZONTAL_SCROLLING || e === ne.PAGE_SCROLLING ? 1 : Math.round(i / c), [c, i, e]),
|
|
1786
|
-
const { rowsHeight: b, columnsWidth: g } = Tt(
|
|
1786
|
+
const m = W(() => e === ne.HORIZONTAL_SCROLLING || e === ne.PAGE_SCROLLING ? 1 : Math.round(i / c), [c, i, e]), P = W(() => r.heights.reduce((b, g) => b + g, 0) / r.heights.length || 0, [r]), u = W(() => r.widths.reduce((b, g) => b + g, 0) / r.widths.length || 0, [r]), T = W(() => {
|
|
1787
|
+
const { rowsHeight: b, columnsWidth: g } = Tt(r, c);
|
|
1787
1788
|
return {
|
|
1788
1789
|
rowsHeight: b,
|
|
1789
1790
|
columnsWidth: g
|
|
1790
1791
|
};
|
|
1791
|
-
}, [
|
|
1792
|
+
}, [r, c]), C = W(() => ({
|
|
1792
1793
|
width: T.columnsWidth.reduce((b, g) => b + g, 0),
|
|
1793
1794
|
height: T.rowsHeight.reduce((b, g) => b + g, 0)
|
|
1794
1795
|
}), [T]);
|
|
@@ -1797,36 +1798,36 @@ const ri = () => {
|
|
|
1797
1798
|
rowHeight: f,
|
|
1798
1799
|
columnCount: c,
|
|
1799
1800
|
columnWidth: d,
|
|
1800
|
-
pageDimension:
|
|
1801
|
-
estimatedRowHeight:
|
|
1802
|
-
estimatedColumnWidth:
|
|
1801
|
+
pageDimension: r,
|
|
1802
|
+
estimatedRowHeight: P,
|
|
1803
|
+
estimatedColumnWidth: u,
|
|
1803
1804
|
gridDimension: T,
|
|
1804
|
-
totalDimension:
|
|
1805
|
+
totalDimension: C
|
|
1805
1806
|
};
|
|
1806
1807
|
};
|
|
1807
|
-
let
|
|
1808
|
-
typeof window < "u" ?
|
|
1808
|
+
let ue;
|
|
1809
|
+
typeof window < "u" ? ue = window : typeof self < "u" ? ue = self : ue = global;
|
|
1809
1810
|
let vt = null, wt = null;
|
|
1810
|
-
const Xt = 20, ut =
|
|
1811
|
+
const Xt = 20, ut = ue.clearTimeout, Qt = ue.setTimeout, pt = ue.cancelAnimationFrame || ue.mozCancelAnimationFrame || ue.webkitCancelAnimationFrame, Yt = ue.requestAnimationFrame || ue.mozRequestAnimationFrame || ue.webkitRequestAnimationFrame;
|
|
1811
1812
|
pt == null || Yt == null ? (vt = ut, wt = function(e) {
|
|
1812
1813
|
return Qt(e, Xt);
|
|
1813
1814
|
}) : (vt = function([e, n]) {
|
|
1814
1815
|
pt(e), ut(n);
|
|
1815
1816
|
}, wt = function(e) {
|
|
1816
1817
|
const n = Yt(function() {
|
|
1817
|
-
ut(
|
|
1818
|
-
}),
|
|
1818
|
+
ut(o), e();
|
|
1819
|
+
}), o = Qt(function() {
|
|
1819
1820
|
pt(n), e();
|
|
1820
1821
|
}, Xt);
|
|
1821
|
-
return [n,
|
|
1822
|
+
return [n, o];
|
|
1822
1823
|
});
|
|
1823
|
-
function
|
|
1824
|
-
let e, n,
|
|
1824
|
+
function si(t) {
|
|
1825
|
+
let e, n, o, r, i, c, l;
|
|
1825
1826
|
const d = typeof document < "u" && document.attachEvent;
|
|
1826
1827
|
if (!d) {
|
|
1827
1828
|
c = function(S) {
|
|
1828
|
-
const v = S.__resizeTriggers__, h = v.firstElementChild,
|
|
1829
|
-
|
|
1829
|
+
const v = S.__resizeTriggers__, h = v.firstElementChild, p = v.lastElementChild, s = h.firstElementChild;
|
|
1830
|
+
p.scrollLeft = p.scrollWidth, p.scrollTop = p.scrollHeight, s.style.width = h.offsetWidth + 1 + "px", s.style.height = h.offsetHeight + 1 + "px", h.scrollLeft = h.scrollWidth, h.scrollTop = h.scrollHeight;
|
|
1830
1831
|
}, i = function(S) {
|
|
1831
1832
|
return S.offsetWidth !== S.__resizeLast__.width || S.offsetHeight !== S.__resizeLast__.height;
|
|
1832
1833
|
}, l = function(S) {
|
|
@@ -1839,60 +1840,60 @@ function ii(t) {
|
|
|
1839
1840
|
}));
|
|
1840
1841
|
});
|
|
1841
1842
|
};
|
|
1842
|
-
let
|
|
1843
|
-
|
|
1844
|
-
const
|
|
1843
|
+
let u = !1, T = "";
|
|
1844
|
+
o = "animationstart";
|
|
1845
|
+
const C = "Webkit Moz O ms".split(" ");
|
|
1845
1846
|
let b = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "), g = "";
|
|
1846
1847
|
{
|
|
1847
1848
|
const S = document.createElement("fakeelement");
|
|
1848
|
-
if (S.style.animationName !== void 0 && (
|
|
1849
|
-
for (let v = 0; v <
|
|
1850
|
-
if (S.style[
|
|
1851
|
-
g =
|
|
1849
|
+
if (S.style.animationName !== void 0 && (u = !0), u === !1) {
|
|
1850
|
+
for (let v = 0; v < C.length; v++)
|
|
1851
|
+
if (S.style[C[v] + "AnimationName"] !== void 0) {
|
|
1852
|
+
g = C[v], T = "-" + g.toLowerCase() + "-", o = b[v], u = !0;
|
|
1852
1853
|
break;
|
|
1853
1854
|
}
|
|
1854
1855
|
}
|
|
1855
1856
|
}
|
|
1856
|
-
n = "resizeanim", e = "@" + T + "keyframes " + n + " { from { opacity: 0; } to { opacity: 0; } } ",
|
|
1857
|
+
n = "resizeanim", e = "@" + T + "keyframes " + n + " { from { opacity: 0; } to { opacity: 0; } } ", r = T + "animation: 1ms " + n + "; ";
|
|
1857
1858
|
}
|
|
1858
|
-
const f = function(
|
|
1859
|
-
if (!
|
|
1860
|
-
const T = (e || "") + ".resize-triggers { " + (
|
|
1861
|
-
b.id = "detectElementResize", b.type = "text/css", t != null && b.setAttribute("nonce", t), b.styleSheet ? b.styleSheet.cssText = T : b.appendChild(
|
|
1859
|
+
const f = function(u) {
|
|
1860
|
+
if (!u.getElementById("detectElementResize")) {
|
|
1861
|
+
const T = (e || "") + ".resize-triggers { " + (r || "") + 'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }', C = u.head || u.getElementsByTagName("head")[0], b = u.createElement("style");
|
|
1862
|
+
b.id = "detectElementResize", b.type = "text/css", t != null && b.setAttribute("nonce", t), b.styleSheet ? b.styleSheet.cssText = T : b.appendChild(u.createTextNode(T)), C.appendChild(b);
|
|
1862
1863
|
}
|
|
1863
1864
|
};
|
|
1864
1865
|
return {
|
|
1865
|
-
addResizeListener: function(
|
|
1866
|
+
addResizeListener: function(u, T) {
|
|
1866
1867
|
if (d)
|
|
1867
|
-
|
|
1868
|
+
u.attachEvent("onresize", T);
|
|
1868
1869
|
else {
|
|
1869
|
-
if (!
|
|
1870
|
-
const
|
|
1871
|
-
b && b.position === "static" && (
|
|
1872
|
-
const g =
|
|
1873
|
-
g.className = "expand-trigger", g.appendChild(
|
|
1874
|
-
const S =
|
|
1875
|
-
S.className = "contract-trigger",
|
|
1876
|
-
h.animationName === n && c(
|
|
1877
|
-
},
|
|
1870
|
+
if (!u.__resizeTriggers__) {
|
|
1871
|
+
const C = u.ownerDocument, b = ue.getComputedStyle(u);
|
|
1872
|
+
b && b.position === "static" && (u.style.position = "relative"), f(C), u.__resizeLast__ = {}, u.__resizeListeners__ = [], (u.__resizeTriggers__ = C.createElement("div")).className = "resize-triggers";
|
|
1873
|
+
const g = C.createElement("div");
|
|
1874
|
+
g.className = "expand-trigger", g.appendChild(C.createElement("div"));
|
|
1875
|
+
const S = C.createElement("div");
|
|
1876
|
+
S.className = "contract-trigger", u.__resizeTriggers__.appendChild(g), u.__resizeTriggers__.appendChild(S), u.appendChild(u.__resizeTriggers__), c(u), u.addEventListener("scroll", l, !0), o && (u.__resizeTriggers__.__animationListener__ = function(h) {
|
|
1877
|
+
h.animationName === n && c(u);
|
|
1878
|
+
}, u.__resizeTriggers__.addEventListener(o, u.__resizeTriggers__.__animationListener__));
|
|
1878
1879
|
}
|
|
1879
|
-
|
|
1880
|
+
u.__resizeListeners__.push(T);
|
|
1880
1881
|
}
|
|
1881
1882
|
},
|
|
1882
|
-
removeResizeListener: function(
|
|
1883
|
+
removeResizeListener: function(u, T) {
|
|
1883
1884
|
if (d)
|
|
1884
|
-
|
|
1885
|
-
else if (
|
|
1886
|
-
|
|
1885
|
+
u.detachEvent("onresize", T);
|
|
1886
|
+
else if (u.__resizeListeners__.splice(u.__resizeListeners__.indexOf(T), 1), !u.__resizeListeners__.length) {
|
|
1887
|
+
u.removeEventListener("scroll", l, !0), u.__resizeTriggers__.__animationListener__ && (u.__resizeTriggers__.removeEventListener(o, u.__resizeTriggers__.__animationListener__), u.__resizeTriggers__.__animationListener__ = null);
|
|
1887
1888
|
try {
|
|
1888
|
-
|
|
1889
|
+
u.__resizeTriggers__ = !u.removeChild(u.__resizeTriggers__);
|
|
1889
1890
|
} catch {
|
|
1890
1891
|
}
|
|
1891
1892
|
}
|
|
1892
1893
|
}
|
|
1893
1894
|
};
|
|
1894
1895
|
}
|
|
1895
|
-
class
|
|
1896
|
+
class ci extends ir {
|
|
1896
1897
|
constructor(...e) {
|
|
1897
1898
|
super(...e), this.state = {
|
|
1898
1899
|
height: this.props.defaultHeight || 0,
|
|
@@ -1901,28 +1902,28 @@ class ai extends ro {
|
|
|
1901
1902
|
this._timeoutId = null;
|
|
1902
1903
|
const {
|
|
1903
1904
|
disableHeight: n,
|
|
1904
|
-
disableWidth:
|
|
1905
|
-
onResize:
|
|
1905
|
+
disableWidth: o,
|
|
1906
|
+
onResize: r
|
|
1906
1907
|
} = this.props;
|
|
1907
1908
|
if (this._parentNode) {
|
|
1908
|
-
const i = window.getComputedStyle(this._parentNode) || {}, c = parseFloat(i.paddingLeft || "0"), l = parseFloat(i.paddingRight || "0"), d = parseFloat(i.paddingTop || "0"), f = parseFloat(i.paddingBottom || "0"), m = this._parentNode.getBoundingClientRect(),
|
|
1909
|
-
if (!n && this.state.height !==
|
|
1909
|
+
const i = window.getComputedStyle(this._parentNode) || {}, c = parseFloat(i.paddingLeft || "0"), l = parseFloat(i.paddingRight || "0"), d = parseFloat(i.paddingTop || "0"), f = parseFloat(i.paddingBottom || "0"), m = this._parentNode.getBoundingClientRect(), P = m.height - d - f, u = m.width - c - l;
|
|
1910
|
+
if (!n && this.state.height !== P || !o && this.state.width !== u) {
|
|
1910
1911
|
this.setState({
|
|
1911
|
-
height:
|
|
1912
|
-
width:
|
|
1912
|
+
height: P,
|
|
1913
|
+
width: u
|
|
1913
1914
|
});
|
|
1914
1915
|
const T = () => {
|
|
1915
1916
|
this._didLogDeprecationWarning || (this._didLogDeprecationWarning = !0, console.warn("scaledWidth and scaledHeight parameters have been deprecated; use width and height instead"));
|
|
1916
1917
|
};
|
|
1917
|
-
typeof
|
|
1918
|
-
height:
|
|
1919
|
-
width:
|
|
1918
|
+
typeof r == "function" && r({
|
|
1919
|
+
height: P,
|
|
1920
|
+
width: u,
|
|
1920
1921
|
// TODO Remove these params in the next major release
|
|
1921
1922
|
get scaledHeight() {
|
|
1922
|
-
return T(),
|
|
1923
|
+
return T(), P;
|
|
1923
1924
|
},
|
|
1924
1925
|
get scaledWidth() {
|
|
1925
|
-
return T(),
|
|
1926
|
+
return T(), u;
|
|
1926
1927
|
}
|
|
1927
1928
|
});
|
|
1928
1929
|
}
|
|
@@ -1937,10 +1938,10 @@ class ai extends ro {
|
|
|
1937
1938
|
} = this.props, n = this._autoSizer ? this._autoSizer.parentNode : null;
|
|
1938
1939
|
if (n != null && n.ownerDocument && n.ownerDocument.defaultView && n instanceof n.ownerDocument.defaultView.HTMLElement) {
|
|
1939
1940
|
this._parentNode = n;
|
|
1940
|
-
const
|
|
1941
|
-
|
|
1941
|
+
const o = n.ownerDocument.defaultView.ResizeObserver;
|
|
1942
|
+
o != null ? (this._resizeObserver = new o(() => {
|
|
1942
1943
|
this._timeoutId = setTimeout(this._onResize, 0);
|
|
1943
|
-
}), this._resizeObserver.observe(n)) : (this._detectElementResize =
|
|
1944
|
+
}), this._resizeObserver.observe(n)) : (this._detectElementResize = si(e), this._detectElementResize.addResizeListener(n, this._onResize)), this._onResize();
|
|
1944
1945
|
}
|
|
1945
1946
|
}
|
|
1946
1947
|
componentWillUnmount() {
|
|
@@ -1950,42 +1951,42 @@ class ai extends ro {
|
|
|
1950
1951
|
const {
|
|
1951
1952
|
children: e,
|
|
1952
1953
|
defaultHeight: n,
|
|
1953
|
-
defaultWidth:
|
|
1954
|
-
disableHeight:
|
|
1954
|
+
defaultWidth: o,
|
|
1955
|
+
disableHeight: r = !1,
|
|
1955
1956
|
disableWidth: i = !1,
|
|
1956
1957
|
doNotBailOutOnEmptyChildren: c = !1,
|
|
1957
1958
|
nonce: l,
|
|
1958
1959
|
onResize: d,
|
|
1959
1960
|
style: f = {},
|
|
1960
1961
|
tagName: m = "div",
|
|
1961
|
-
...
|
|
1962
|
+
...P
|
|
1962
1963
|
} = this.props, {
|
|
1963
|
-
height:
|
|
1964
|
+
height: u,
|
|
1964
1965
|
width: T
|
|
1965
|
-
} = this.state,
|
|
1966
|
+
} = this.state, C = {
|
|
1966
1967
|
overflow: "visible"
|
|
1967
1968
|
}, b = {};
|
|
1968
1969
|
let g = !1;
|
|
1969
|
-
return
|
|
1970
|
+
return r || (u === 0 && (g = !0), C.height = 0, b.height = u, b.scaledHeight = u), i || (T === 0 && (g = !0), C.width = 0, b.width = T, b.scaledWidth = T), c && (g = !1), Be(m, {
|
|
1970
1971
|
ref: this._setRef,
|
|
1971
1972
|
style: {
|
|
1972
|
-
...
|
|
1973
|
+
...C,
|
|
1973
1974
|
...f
|
|
1974
1975
|
},
|
|
1975
|
-
...
|
|
1976
|
+
...P
|
|
1976
1977
|
}, !g && e(b));
|
|
1977
1978
|
}
|
|
1978
1979
|
}
|
|
1979
|
-
const
|
|
1980
|
-
const { focusedPage: n, totalPages:
|
|
1980
|
+
const li = on(({ widths: t, heights: e }) => {
|
|
1981
|
+
const { focusedPage: n, totalPages: o } = pe(), r = W(() => {
|
|
1981
1982
|
const l = [], d = Math.ceil(n / 2) * 2 - 1;
|
|
1982
|
-
if (l.push(d), d + 1 <=
|
|
1983
|
+
if (l.push(d), d + 1 <= o) {
|
|
1983
1984
|
const f = d + 1;
|
|
1984
1985
|
l.push(f);
|
|
1985
1986
|
}
|
|
1986
1987
|
return l;
|
|
1987
|
-
}, [n,
|
|
1988
|
-
const l = n % 2 === 1 ? n - 1 : n - 2, d = Math.floor(l / 2), f = e(d), m = t(l),
|
|
1988
|
+
}, [n, o]), i = W(() => {
|
|
1989
|
+
const l = n % 2 === 1 ? n - 1 : n - 2, d = Math.floor(l / 2), f = e(d), m = t(l), P = t(l + 1);
|
|
1989
1990
|
return [
|
|
1990
1991
|
{
|
|
1991
1992
|
position: "absolute",
|
|
@@ -1996,39 +1997,39 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
1996
1997
|
{
|
|
1997
1998
|
position: "absolute",
|
|
1998
1999
|
left: m,
|
|
1999
|
-
width:
|
|
2000
|
+
width: P,
|
|
2000
2001
|
height: f
|
|
2001
2002
|
}
|
|
2002
2003
|
];
|
|
2003
|
-
}, [t, e,
|
|
2004
|
-
return /* @__PURE__ */ a("div", { style: { width: c, position: "relative" }, children:
|
|
2005
|
-
}),
|
|
2006
|
-
const { focusedPage: n } =
|
|
2004
|
+
}, [t, e, r]), c = W(() => i.reduce((l, d) => l + Number(d.width || 0), 0), [i]);
|
|
2005
|
+
return /* @__PURE__ */ a("div", { style: { width: c, position: "relative" }, children: r.map((l, d) => /* @__PURE__ */ a(It, { style: i[d], pageNumber: l }, l)) });
|
|
2006
|
+
}), di = ({ widths: t, heights: e }) => {
|
|
2007
|
+
const { focusedPage: n } = pe(), o = W(() => ({
|
|
2007
2008
|
position: "absolute",
|
|
2008
2009
|
width: t(n - 1),
|
|
2009
2010
|
height: e(n - 1)
|
|
2010
|
-
}), [t, e, n]),
|
|
2011
|
+
}), [t, e, n]), r = W(() => t(n - 1), [t]);
|
|
2011
2012
|
return /* @__PURE__ */ a(
|
|
2012
2013
|
"div",
|
|
2013
2014
|
{
|
|
2014
2015
|
style: {
|
|
2015
|
-
width:
|
|
2016
|
+
width: r,
|
|
2016
2017
|
position: "relative"
|
|
2017
2018
|
},
|
|
2018
|
-
children: /* @__PURE__ */ a(It, { style:
|
|
2019
|
+
children: /* @__PURE__ */ a(It, { style: o, pageNumber: n }, n)
|
|
2019
2020
|
}
|
|
2020
2021
|
);
|
|
2021
|
-
},
|
|
2022
|
-
const
|
|
2023
|
-
const { rowsHeight:
|
|
2022
|
+
}, ui = (t, e, n) => {
|
|
2023
|
+
const o = k(), { contentRef: r } = be(), { heights: i, widths: c } = Ue(), { setFocusedPage: l } = pe(), [d, f] = q([]), { targetScrollPage: m } = cn(), P = Ct(d, 0, 500), u = W(() => {
|
|
2024
|
+
const { rowsHeight: C, columnsWidth: b } = Tt({ heights: i, widths: c }, t);
|
|
2024
2025
|
return i.map((g, S) => {
|
|
2025
|
-
const v = c[S], h =
|
|
2026
|
+
const v = c[S], h = eo(S + 1, t), p = b.slice(0, h.columnIndex).reduce((y, x) => y + x, 0), s = C.slice(0, h.rowIndex).reduce((y, x) => y + x, 0), w = p + v, _ = s + g;
|
|
2026
2027
|
return {
|
|
2027
2028
|
pageNumber: S + 1,
|
|
2028
2029
|
...h,
|
|
2029
2030
|
width: v,
|
|
2030
2031
|
height: g,
|
|
2031
|
-
startX:
|
|
2032
|
+
startX: p,
|
|
2032
2033
|
startY: s,
|
|
2033
2034
|
endX: w,
|
|
2034
2035
|
endY: _
|
|
@@ -2037,23 +2038,23 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2037
2038
|
}, [i, c, t, e]);
|
|
2038
2039
|
z(() => {
|
|
2039
2040
|
var b;
|
|
2040
|
-
|
|
2041
|
+
P.length > 0 && !m.current && l(P[0].pageNumber), ((b = P[0]) == null ? void 0 : b.ratio) && P.some((g) => g.pageNumber === m.current) && setTimeout(() => {
|
|
2041
2042
|
m.current = void 0;
|
|
2042
2043
|
}, 500);
|
|
2043
|
-
}, [
|
|
2044
|
+
}, [P, l]);
|
|
2044
2045
|
const T = E(
|
|
2045
|
-
(
|
|
2046
|
-
|
|
2047
|
-
const b =
|
|
2046
|
+
(C) => {
|
|
2047
|
+
o.current && cancelAnimationFrame(o.current), o.current = requestAnimationFrame(() => {
|
|
2048
|
+
const b = C.target, g = {
|
|
2048
2049
|
startTop: b.scrollTop,
|
|
2049
2050
|
startLeft: b.scrollLeft,
|
|
2050
2051
|
endTop: b.scrollTop + b.clientHeight,
|
|
2051
2052
|
endLeft: b.scrollLeft + b.clientWidth
|
|
2052
|
-
}, S =
|
|
2053
|
-
const h = v.endX >= g.startLeft && v.endY >= g.startTop,
|
|
2054
|
-
return h &&
|
|
2053
|
+
}, S = u.filter((v) => {
|
|
2054
|
+
const h = v.endX >= g.startLeft && v.endY >= g.startTop, p = v.startX <= g.endLeft && v.startY <= g.endTop;
|
|
2055
|
+
return h && p;
|
|
2055
2056
|
}).map((v) => {
|
|
2056
|
-
const h = g.startLeft > v.startX ? g.startLeft : v.startX,
|
|
2057
|
+
const h = g.startLeft > v.startX ? g.startLeft : v.startX, p = g.startTop > v.startY ? g.startTop : v.startY, s = g.endLeft < v.endX ? g.endLeft : v.endX, w = g.endTop < v.endY ? g.endTop : v.endY, _ = s - h, y = w - p, I = +(_ * y / (v.width * v.height) * 100).toFixed(2);
|
|
2057
2058
|
return {
|
|
2058
2059
|
pageNumber: v.pageNumber,
|
|
2059
2060
|
ratio: I
|
|
@@ -2062,7 +2063,7 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2062
2063
|
f(S);
|
|
2063
2064
|
});
|
|
2064
2065
|
},
|
|
2065
|
-
[
|
|
2066
|
+
[r, u]
|
|
2066
2067
|
);
|
|
2067
2068
|
z(() => {
|
|
2068
2069
|
if (n)
|
|
@@ -2070,47 +2071,47 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2070
2071
|
n == null || n.removeEventListener("scroll", T);
|
|
2071
2072
|
};
|
|
2072
2073
|
}, [n, T]);
|
|
2073
|
-
}, Rn =
|
|
2074
|
-
const { children: n, toolbarRef:
|
|
2074
|
+
}, Rn = tt((t, e) => {
|
|
2075
|
+
const { children: n, toolbarRef: o, style: r, className: i, ...c } = t, { customVariables: l, customDarkVariables: d } = Dr(), { darkMode: f } = dr();
|
|
2075
2076
|
return /* @__PURE__ */ a(
|
|
2076
2077
|
"div",
|
|
2077
2078
|
{
|
|
2078
2079
|
ref: e,
|
|
2079
2080
|
...c,
|
|
2080
|
-
className:
|
|
2081
|
+
className: de(
|
|
2081
2082
|
_e["rp-theme-variables"],
|
|
2082
2083
|
_e["rp-container"],
|
|
2083
2084
|
f ? _e["rp-dark-mode"] : "",
|
|
2084
2085
|
i
|
|
2085
2086
|
),
|
|
2086
2087
|
style: {
|
|
2087
|
-
"--rp-toolbar-height": `${(
|
|
2088
|
+
"--rp-toolbar-height": `${(o == null ? void 0 : o.clientHeight) || 48}px`,
|
|
2088
2089
|
...l,
|
|
2089
2090
|
...f ? d : {},
|
|
2090
|
-
...
|
|
2091
|
+
...r
|
|
2091
2092
|
},
|
|
2092
2093
|
children: n
|
|
2093
2094
|
}
|
|
2094
2095
|
);
|
|
2095
|
-
}),
|
|
2096
|
-
const
|
|
2097
|
-
return /* @__PURE__ */ a(It, { style:
|
|
2098
|
-
},
|
|
2099
|
-
const { initialPage: t = 1, initialScrollMode: e, instanceId: n } =
|
|
2096
|
+
}), pi = on(({ columnIndex: t, rowIndex: e, data: n, style: o }) => {
|
|
2097
|
+
const r = to(e, t, n.columnCount);
|
|
2098
|
+
return /* @__PURE__ */ a(It, { style: o, pageNumber: r }, r);
|
|
2099
|
+
}, ii), rc = () => {
|
|
2100
|
+
const { initialPage: t = 1, initialScrollMode: e, instanceId: n } = hr(), { pagesRef: o, setPagesRef: r, setContentRef: i } = be(), { scrollToPage: c } = vn(), {
|
|
2100
2101
|
virtualScrollRef: l,
|
|
2101
2102
|
getVirtualScrollRef: d,
|
|
2102
2103
|
getPageScrollElementRef: f,
|
|
2103
2104
|
getVirtualScrollableElementRef: m,
|
|
2104
|
-
setTotalInnerDimensions:
|
|
2105
|
-
virtualScrollableElementRef:
|
|
2105
|
+
setTotalInnerDimensions: P,
|
|
2106
|
+
virtualScrollableElementRef: u,
|
|
2106
2107
|
totalInnerDimensions: T,
|
|
2107
|
-
pageScrollElementRef:
|
|
2108
|
-
} =
|
|
2108
|
+
pageScrollElementRef: C
|
|
2109
|
+
} = Je(), b = k(!0), { nextPage: g, prevPage: S, setFocusedPage: v, focusedPage: h } = pe(), { scrollMode: p } = Ee(), { viewMode: s } = Me(), w = k(null), { loading: _, error: y } = re(), { passwordRequired: x } = lr(), { LoaderImageComponent: I } = bt(), R = k(
|
|
2109
2110
|
T
|
|
2110
2111
|
), L = k({
|
|
2111
2112
|
viewMode: s,
|
|
2112
|
-
scrollMode:
|
|
2113
|
-
}), N = k(!1), F = k(), { isFullScreen: M } =
|
|
2113
|
+
scrollMode: p
|
|
2114
|
+
}), N = k(!1), F = k(), { isFullScreen: M } = fr(), {
|
|
2114
2115
|
pageDimension: D,
|
|
2115
2116
|
rowCount: O,
|
|
2116
2117
|
rowHeight: A,
|
|
@@ -2118,125 +2119,130 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2118
2119
|
columnWidth: U,
|
|
2119
2120
|
estimatedColumnWidth: B,
|
|
2120
2121
|
estimatedRowHeight: V,
|
|
2121
|
-
totalDimension:
|
|
2122
|
-
} =
|
|
2123
|
-
|
|
2124
|
-
const
|
|
2122
|
+
totalDimension: J
|
|
2123
|
+
} = ai(), G = Ct(T, 100), { onScroll: K } = Sr(), Y = k();
|
|
2124
|
+
ui(H, O, u);
|
|
2125
|
+
const ee = k({
|
|
2125
2126
|
scrollTop: 0,
|
|
2126
2127
|
scrollLeft: 0
|
|
2127
2128
|
});
|
|
2128
|
-
|
|
2129
|
-
const { isPressed:
|
|
2130
|
-
isPressed:
|
|
2131
|
-
}),
|
|
2129
|
+
oo(o);
|
|
2130
|
+
const { isPressed: oe } = no(), { selectionMode: ie } = pr(), { initializeGrabScroll: se, resetGrabState: ce } = ro({
|
|
2131
|
+
isPressed: oe
|
|
2132
|
+
}), ae = W(() => ie === sr.HAND, [ie]), Fe = W(() => ({
|
|
2132
2133
|
columnCount: H
|
|
2133
|
-
}), [H]),
|
|
2134
|
+
}), [H]), ke = E(
|
|
2134
2135
|
(j) => {
|
|
2135
|
-
const
|
|
2136
|
-
!M &&
|
|
2136
|
+
const Z = document.activeElement !== o;
|
|
2137
|
+
!M && Z || (["ArrowUp", "ArrowLeft"].includes(j.key) ? (j.preventDefault(), S()) : ["ArrowDown", "ArrowRight"].includes(j.key) && (j.preventDefault(), g()));
|
|
2137
2138
|
},
|
|
2138
|
-
[g, S, M,
|
|
2139
|
+
[g, S, M, p]
|
|
2139
2140
|
);
|
|
2140
|
-
z(() => (window.addEventListener("keydown",
|
|
2141
|
-
window.removeEventListener("keydown",
|
|
2142
|
-
}), [
|
|
2141
|
+
z(() => (window.addEventListener("keydown", ke), () => {
|
|
2142
|
+
window.removeEventListener("keydown", ke);
|
|
2143
|
+
}), [ke]), z(() => {
|
|
2143
2144
|
if (w.current && (w.current.style.position = "relative"), !!l)
|
|
2144
2145
|
for (let j = 0; j < O; j++)
|
|
2145
|
-
for (let
|
|
2146
|
+
for (let Z = 0; Z < H; Z++)
|
|
2146
2147
|
l.resetAfterIndices({
|
|
2147
|
-
columnIndex:
|
|
2148
|
+
columnIndex: Z,
|
|
2148
2149
|
rowIndex: j,
|
|
2149
2150
|
shouldForceUpdate: !0
|
|
2150
2151
|
});
|
|
2151
2152
|
}, [O, H, D, l]);
|
|
2152
|
-
const
|
|
2153
|
-
(j,
|
|
2154
|
-
if (!
|
|
2153
|
+
const Xn = E(
|
|
2154
|
+
(j, Z) => {
|
|
2155
|
+
if (!u)
|
|
2155
2156
|
return { scrollTop: 0, scrollLeft: 0 };
|
|
2156
|
-
const
|
|
2157
|
-
return
|
|
2158
|
-
scrollTop:
|
|
2159
|
-
scrollLeft:
|
|
2157
|
+
const ye = ee.current.scrollTop > Z, Se = ee.current.scrollLeft > j;
|
|
2158
|
+
return ye || Se ? ee.current : {
|
|
2159
|
+
scrollTop: u.scrollTop,
|
|
2160
|
+
scrollLeft: u.scrollLeft
|
|
2160
2161
|
};
|
|
2161
2162
|
},
|
|
2162
|
-
[
|
|
2163
|
+
[u]
|
|
2163
2164
|
), Et = E(
|
|
2164
|
-
(j,
|
|
2165
|
-
if (L.current.viewMode !== s || L.current.scrollMode !==
|
|
2166
|
-
|
|
2165
|
+
(j, Z) => {
|
|
2166
|
+
if (L.current.viewMode !== s || L.current.scrollMode !== p) {
|
|
2167
|
+
Y.current && clearTimeout(Y.current), N.current = !0, c(h, "auto"), Y.current = setTimeout(() => {
|
|
2167
2168
|
requestAnimationFrame(() => {
|
|
2168
|
-
L.current = { viewMode: s, scrollMode:
|
|
2169
|
+
L.current = { viewMode: s, scrollMode: p };
|
|
2169
2170
|
});
|
|
2170
2171
|
}, 100);
|
|
2171
2172
|
return;
|
|
2172
2173
|
}
|
|
2173
|
-
const
|
|
2174
|
-
if (!
|
|
2174
|
+
const Se = j.scrollTop, ot = j.scrollLeft;
|
|
2175
|
+
if (!Z.height || !Z.width)
|
|
2175
2176
|
return;
|
|
2176
2177
|
N.current = !0;
|
|
2177
|
-
const { height:
|
|
2178
|
-
if (Nt ===
|
|
2178
|
+
const { height: Ie, width: it } = Z, { height: Nt, width: Ot } = R.current;
|
|
2179
|
+
if (Nt === Ie && Ot === it)
|
|
2179
2180
|
return;
|
|
2180
|
-
const
|
|
2181
|
+
const er = Se / Nt * Ie, tr = ot / Ot * it, nr = Math.round(Math.min(er, Ie)) || 0, rr = Math.round(Math.min(tr, it)) || 0;
|
|
2181
2182
|
F.current = setTimeout(() => {
|
|
2182
2183
|
requestAnimationFrame(() => {
|
|
2183
|
-
|
|
2184
|
-
top:
|
|
2185
|
-
left:
|
|
2184
|
+
u == null || u.scrollTo({
|
|
2185
|
+
top: nr,
|
|
2186
|
+
left: rr,
|
|
2186
2187
|
behavior: "auto"
|
|
2187
2188
|
});
|
|
2188
2189
|
});
|
|
2189
2190
|
}, 0), R.current = {
|
|
2190
|
-
height:
|
|
2191
|
-
width:
|
|
2191
|
+
height: Z.height,
|
|
2192
|
+
width: Z.width
|
|
2192
2193
|
};
|
|
2193
2194
|
},
|
|
2194
|
-
[
|
|
2195
|
+
[u, s, p, c]
|
|
2195
2196
|
);
|
|
2196
2197
|
z(() => {
|
|
2197
2198
|
clearTimeout(F.current);
|
|
2198
2199
|
const j = Array.from({ length: O }).reduce(
|
|
2199
|
-
(
|
|
2200
|
+
(Se, ot, Ie) => Se + A(Ie),
|
|
2200
2201
|
0
|
|
2201
|
-
),
|
|
2202
|
-
(
|
|
2202
|
+
), Z = Array.from({ length: H }).reduce(
|
|
2203
|
+
(Se, ot, Ie) => Se + U(Ie),
|
|
2203
2204
|
0
|
|
2204
|
-
),
|
|
2205
|
-
|
|
2205
|
+
), ye = Xn(Z, j);
|
|
2206
|
+
ee.current = ye, Et(ye, { height: j, width: Z }), P({
|
|
2206
2207
|
height: j,
|
|
2207
|
-
width:
|
|
2208
|
+
width: Z
|
|
2208
2209
|
});
|
|
2209
2210
|
}, [D, O, H, Et]);
|
|
2210
|
-
const
|
|
2211
|
+
const Qn = E(
|
|
2211
2212
|
(j) => {
|
|
2212
|
-
|
|
2213
|
+
ee.current = {
|
|
2213
2214
|
scrollTop: j.scrollTop,
|
|
2214
2215
|
scrollLeft: j.scrollLeft
|
|
2215
2216
|
};
|
|
2216
2217
|
},
|
|
2217
|
-
[
|
|
2218
|
+
[u]
|
|
2218
2219
|
);
|
|
2219
|
-
z(() =>
|
|
2220
|
-
|
|
2220
|
+
z(() => {
|
|
2221
|
+
if (K)
|
|
2222
|
+
return C && C.addEventListener("scroll", K), u && u.addEventListener("scroll", K), () => {
|
|
2223
|
+
C == null || C.removeEventListener("scroll", K), u == null || u.removeEventListener("scroll", K);
|
|
2224
|
+
};
|
|
2225
|
+
}, [u, C, K]), z(() => () => {
|
|
2226
|
+
Y.current && clearTimeout(Y.current);
|
|
2221
2227
|
}, []);
|
|
2222
|
-
const
|
|
2223
|
-
[
|
|
2224
|
-
[
|
|
2225
|
-
}), [
|
|
2228
|
+
const Yn = W(() => de(le["rp-pages-container"], {
|
|
2229
|
+
[le["rp-cursor-grab"]]: ae && !oe,
|
|
2230
|
+
[le["rp-cursor-grabbing"]]: ae && oe
|
|
2231
|
+
}), [ae, oe]), Jn = E(
|
|
2226
2232
|
(j) => {
|
|
2227
|
-
if (
|
|
2228
|
-
const
|
|
2229
|
-
|
|
2233
|
+
if (ae && j) {
|
|
2234
|
+
const Z = de(le["rp-pages"]), ye = document.querySelector(`.${Z}`);
|
|
2235
|
+
se(ye);
|
|
2230
2236
|
}
|
|
2231
2237
|
},
|
|
2232
|
-
[
|
|
2238
|
+
[ae, se, le]
|
|
2233
2239
|
);
|
|
2234
2240
|
return z(() => {
|
|
2235
|
-
_ &&
|
|
2241
|
+
_ && ce();
|
|
2236
2242
|
}, [_]), z(() => {
|
|
2237
2243
|
if (!(G.height === 0 || !b.current)) {
|
|
2238
2244
|
if (e === ne.PAGE_SCROLLING) {
|
|
2239
|
-
t !== h &&
|
|
2245
|
+
t !== h && C && v(t), b.current = !1;
|
|
2240
2246
|
return;
|
|
2241
2247
|
}
|
|
2242
2248
|
c(t, "auto"), v(t), b.current = !1;
|
|
@@ -2244,57 +2250,57 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2244
2250
|
}, [
|
|
2245
2251
|
c,
|
|
2246
2252
|
e,
|
|
2247
|
-
|
|
2253
|
+
C,
|
|
2248
2254
|
v,
|
|
2249
2255
|
G
|
|
2250
|
-
]), /* @__PURE__ */ $(
|
|
2251
|
-
/* @__PURE__ */ a(
|
|
2256
|
+
]), /* @__PURE__ */ $(fe, { children: [
|
|
2257
|
+
/* @__PURE__ */ a(Or, { ref: i, children: /* @__PURE__ */ a(
|
|
2252
2258
|
Rn,
|
|
2253
2259
|
{
|
|
2254
2260
|
id: n,
|
|
2255
|
-
ref:
|
|
2261
|
+
ref: r,
|
|
2256
2262
|
tabIndex: -1,
|
|
2257
|
-
className:
|
|
2258
|
-
children: /* @__PURE__ */ a(
|
|
2263
|
+
className: Yn,
|
|
2264
|
+
children: /* @__PURE__ */ a(ci, { style: { minHeight: "50px" }, children: ({ width: j, height: Z }) => /* @__PURE__ */ a("div", { "data-rp": "pages", ref: Jn, style: { width: j, height: Z }, children: p === ne.PAGE_SCROLLING ? /* @__PURE__ */ a(
|
|
2259
2265
|
"div",
|
|
2260
2266
|
{
|
|
2261
2267
|
ref: f,
|
|
2262
|
-
style: { width: j, height:
|
|
2263
|
-
className:
|
|
2264
|
-
children: s ===
|
|
2268
|
+
style: { width: j, height: Z },
|
|
2269
|
+
className: de(le["rp-pages"], le["rp-page-scrolling-wrapper"]),
|
|
2270
|
+
children: s === Re.DUAL_PAGE ? /* @__PURE__ */ a(li, { widths: U, heights: A }) : /* @__PURE__ */ a(di, { widths: U, heights: A })
|
|
2265
2271
|
}
|
|
2266
2272
|
) : V ? /* @__PURE__ */ a(
|
|
2267
|
-
|
|
2273
|
+
ni,
|
|
2268
2274
|
{
|
|
2269
2275
|
ref: d,
|
|
2270
|
-
itemData:
|
|
2276
|
+
itemData: Fe,
|
|
2271
2277
|
outerRef: m,
|
|
2272
2278
|
innerRef: w,
|
|
2273
|
-
onScroll:
|
|
2279
|
+
onScroll: Qn,
|
|
2274
2280
|
columnCount: H,
|
|
2275
2281
|
columnWidth: U,
|
|
2276
2282
|
rowHeight: A,
|
|
2277
|
-
height:
|
|
2283
|
+
height: Z,
|
|
2278
2284
|
width: j,
|
|
2279
2285
|
estimatedColumnWidth: B,
|
|
2280
2286
|
estimatedRowHeight: V,
|
|
2281
2287
|
rowCount: O,
|
|
2282
|
-
className:
|
|
2283
|
-
|
|
2284
|
-
|
|
2288
|
+
className: de(
|
|
2289
|
+
le["rp-pages"],
|
|
2290
|
+
p === ne.HORIZONTAL_SCROLLING ? le["rp-pages-horizontal-scroll"] : ""
|
|
2285
2291
|
),
|
|
2286
2292
|
style: {
|
|
2287
|
-
"--rp-pages-height": `${
|
|
2288
|
-
"--rp-pages-width": `${
|
|
2293
|
+
"--rp-pages-height": `${J.height}px`,
|
|
2294
|
+
"--rp-pages-width": `${J.width}px`,
|
|
2289
2295
|
"--rp-row-count": `${O}`,
|
|
2290
2296
|
"--rp-column-count": `${H}`
|
|
2291
2297
|
},
|
|
2292
|
-
children:
|
|
2298
|
+
children: pi
|
|
2293
2299
|
}
|
|
2294
2300
|
) : !_ && !y ? /* @__PURE__ */ a(
|
|
2295
2301
|
"div",
|
|
2296
2302
|
{
|
|
2297
|
-
className:
|
|
2303
|
+
className: le["rp-loader"],
|
|
2298
2304
|
style: {
|
|
2299
2305
|
display: "flex",
|
|
2300
2306
|
justifyContent: "center",
|
|
@@ -2304,7 +2310,7 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2304
2310
|
},
|
|
2305
2311
|
children: I && /* @__PURE__ */ a(I, {})
|
|
2306
2312
|
}
|
|
2307
|
-
) : y ===
|
|
2313
|
+
) : y === cr.NOT_SUPPORTED ? /* @__PURE__ */ a("div", { className: le["rp-not-supported"], children: /* @__PURE__ */ $("div", { className: le["rp-not-supported-content"], children: [
|
|
2308
2314
|
"React PDF is unable to render on this browser. Please use the supported browsers from the list below:",
|
|
2309
2315
|
/* @__PURE__ */ a("div", { children: /* @__PURE__ */ $("ul", { children: [
|
|
2310
2316
|
/* @__PURE__ */ a("li", { children: "Chrome 110+" }),
|
|
@@ -2317,9 +2323,9 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2317
2323
|
] }) }) : null }) })
|
|
2318
2324
|
}
|
|
2319
2325
|
) }),
|
|
2320
|
-
x && /* @__PURE__ */ a(
|
|
2326
|
+
x && /* @__PURE__ */ a(io, {})
|
|
2321
2327
|
] });
|
|
2322
|
-
},
|
|
2328
|
+
}, We = {
|
|
2323
2329
|
"rp-toolbar-content": "_rp-toolbar-content_sz31z_1",
|
|
2324
2330
|
"rp-toolbar-wrapper": "_rp-toolbar-wrapper_sz31z_10",
|
|
2325
2331
|
"rp-toolbar-start": "_rp-toolbar-start_sz31z_33",
|
|
@@ -2329,20 +2335,20 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2329
2335
|
"rp-paginate": "_rp-paginate_1gck0_1",
|
|
2330
2336
|
"rp-page-input": "_rp-page-input_1gck0_6",
|
|
2331
2337
|
"rp-total-page": "_rp-total-page_1gck0_18"
|
|
2332
|
-
},
|
|
2338
|
+
}, hi = () => {
|
|
2333
2339
|
const { prevIcon: t } = Pe(), { prevIcon: e } = Te();
|
|
2334
|
-
return t || e || /* @__PURE__ */ a(
|
|
2335
|
-
},
|
|
2340
|
+
return t || e || /* @__PURE__ */ a(Xe, {});
|
|
2341
|
+
}, fi = () => {
|
|
2336
2342
|
const { nextIcon: t } = Pe(), { nextIcon: e } = Te();
|
|
2337
|
-
return t || e || /* @__PURE__ */ a(
|
|
2338
|
-
},
|
|
2339
|
-
const { focusedPage: t, totalPages: e, setFocusedPage: n, nextPage:
|
|
2343
|
+
return t || e || /* @__PURE__ */ a(Xe, { style: { transform: "rotate(180deg" } });
|
|
2344
|
+
}, mi = () => {
|
|
2345
|
+
const { focusedPage: t, totalPages: e, setFocusedPage: n, nextPage: o, prevPage: r, goToPage: i } = pe(), [c, l] = q(t.toString()), { pageNavigationTool: d = !0 } = Ce(), { pageNavigationTool: f = !0 } = Ne(), { isSmallScreen: m } = Oe(), { viewMode: P } = Me(), { scrollMode: u } = Ee(), { localeMessages: T } = me();
|
|
2340
2346
|
z(() => {
|
|
2341
2347
|
l(t.toString());
|
|
2342
2348
|
}, [t]);
|
|
2343
|
-
const
|
|
2344
|
-
const
|
|
2345
|
-
l(
|
|
2349
|
+
const C = E((h) => {
|
|
2350
|
+
const p = h.target.value;
|
|
2351
|
+
l(p);
|
|
2346
2352
|
}, []), b = E(async () => {
|
|
2347
2353
|
const h = i(c);
|
|
2348
2354
|
h.success || l(h.currentPage.toString());
|
|
@@ -2353,14 +2359,14 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2353
2359
|
h.key === "Enter" && b();
|
|
2354
2360
|
},
|
|
2355
2361
|
[b]
|
|
2356
|
-
), v = W(() =>
|
|
2362
|
+
), v = W(() => P === Re.DUAL_PAGE && u === ne.PAGE_SCROLLING && t === e - 1 || t === e, [t, e, P, u]);
|
|
2357
2363
|
return !d || !f ? null : typeof d != "boolean" ? /* @__PURE__ */ a(
|
|
2358
2364
|
d,
|
|
2359
2365
|
{
|
|
2360
2366
|
total: e,
|
|
2361
2367
|
current: t,
|
|
2362
|
-
nextPage:
|
|
2363
|
-
prevPage:
|
|
2368
|
+
nextPage: o,
|
|
2369
|
+
prevPage: r,
|
|
2364
2370
|
goToPage: i,
|
|
2365
2371
|
changePage: n
|
|
2366
2372
|
}
|
|
@@ -2369,8 +2375,8 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2369
2375
|
{
|
|
2370
2376
|
total: e,
|
|
2371
2377
|
current: t,
|
|
2372
|
-
nextPage:
|
|
2373
|
-
prevPage:
|
|
2378
|
+
nextPage: o,
|
|
2379
|
+
prevPage: r,
|
|
2374
2380
|
goToPage: i,
|
|
2375
2381
|
changePage: n
|
|
2376
2382
|
}
|
|
@@ -2378,10 +2384,10 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2378
2384
|
!m && /* @__PURE__ */ a(Q, { content: T == null ? void 0 : T.previousPageTooltip, children: /* @__PURE__ */ a(
|
|
2379
2385
|
we,
|
|
2380
2386
|
{
|
|
2381
|
-
onClick:
|
|
2387
|
+
onClick: r,
|
|
2382
2388
|
"aria-label": T == null ? void 0 : T.previousPageTooltip,
|
|
2383
2389
|
"aria-disabled": t === 1,
|
|
2384
|
-
children: /* @__PURE__ */ a(
|
|
2390
|
+
children: /* @__PURE__ */ a(hi, {})
|
|
2385
2391
|
}
|
|
2386
2392
|
) }),
|
|
2387
2393
|
/* @__PURE__ */ a(Q, { content: T == null ? void 0 : T.currentPageTooltip, children: /* @__PURE__ */ a(
|
|
@@ -2389,7 +2395,7 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2389
2395
|
{
|
|
2390
2396
|
onKeyDown: S,
|
|
2391
2397
|
onBlur: g,
|
|
2392
|
-
onChange:
|
|
2398
|
+
onChange: C,
|
|
2393
2399
|
value: c,
|
|
2394
2400
|
className: ht["rp-page-input"],
|
|
2395
2401
|
id: "page-input",
|
|
@@ -2403,30 +2409,30 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2403
2409
|
!m && /* @__PURE__ */ a(Q, { content: T == null ? void 0 : T.nextPageTooltip, children: /* @__PURE__ */ a(
|
|
2404
2410
|
we,
|
|
2405
2411
|
{
|
|
2406
|
-
onClick:
|
|
2412
|
+
onClick: o,
|
|
2407
2413
|
"aria-label": T == null ? void 0 : T.nextPageTooltip,
|
|
2408
2414
|
"aria-disabled": v,
|
|
2409
|
-
children: /* @__PURE__ */ a(
|
|
2415
|
+
children: /* @__PURE__ */ a(fi, {})
|
|
2410
2416
|
}
|
|
2411
2417
|
) })
|
|
2412
2418
|
] });
|
|
2413
2419
|
};
|
|
2414
|
-
var
|
|
2420
|
+
var rt = "Dialog", [Ln, oc] = po(rt), [gi, he] = Ln(rt), En = (t) => {
|
|
2415
2421
|
const {
|
|
2416
2422
|
__scopeDialog: e,
|
|
2417
2423
|
children: n,
|
|
2418
|
-
open:
|
|
2419
|
-
defaultOpen:
|
|
2424
|
+
open: o,
|
|
2425
|
+
defaultOpen: r,
|
|
2420
2426
|
onOpenChange: i,
|
|
2421
2427
|
modal: c = !0
|
|
2422
|
-
} = t, l = X.useRef(null), d = X.useRef(null), [f, m] =
|
|
2423
|
-
prop:
|
|
2424
|
-
defaultProp:
|
|
2428
|
+
} = t, l = X.useRef(null), d = X.useRef(null), [f, m] = fo({
|
|
2429
|
+
prop: o,
|
|
2430
|
+
defaultProp: r ?? !1,
|
|
2425
2431
|
onChange: i,
|
|
2426
|
-
caller:
|
|
2432
|
+
caller: rt
|
|
2427
2433
|
});
|
|
2428
2434
|
return /* @__PURE__ */ a(
|
|
2429
|
-
|
|
2435
|
+
gi,
|
|
2430
2436
|
{
|
|
2431
2437
|
scope: e,
|
|
2432
2438
|
triggerRef: l,
|
|
@@ -2436,102 +2442,102 @@ var nt = "Dialog", [Ln, tc] = dr(nt), [fi, pe] = Ln(nt), En = (t) => {
|
|
|
2436
2442
|
descriptionId: st(),
|
|
2437
2443
|
open: f,
|
|
2438
2444
|
onOpenChange: m,
|
|
2439
|
-
onOpenToggle: X.useCallback(() => m((
|
|
2445
|
+
onOpenToggle: X.useCallback(() => m((P) => !P), [m]),
|
|
2440
2446
|
modal: c,
|
|
2441
2447
|
children: n
|
|
2442
2448
|
}
|
|
2443
2449
|
);
|
|
2444
2450
|
};
|
|
2445
|
-
En.displayName =
|
|
2446
|
-
var Nn = "DialogTrigger",
|
|
2451
|
+
En.displayName = rt;
|
|
2452
|
+
var Nn = "DialogTrigger", vi = X.forwardRef(
|
|
2447
2453
|
(t, e) => {
|
|
2448
|
-
const { __scopeDialog: n, ...
|
|
2454
|
+
const { __scopeDialog: n, ...o } = t, r = he(Nn, n), i = Pt(e, r.triggerRef);
|
|
2449
2455
|
return /* @__PURE__ */ a(
|
|
2450
|
-
|
|
2456
|
+
Ve.button,
|
|
2451
2457
|
{
|
|
2452
2458
|
type: "button",
|
|
2453
2459
|
"aria-haspopup": "dialog",
|
|
2454
|
-
"aria-expanded":
|
|
2455
|
-
"aria-controls":
|
|
2456
|
-
"data-state": Lt(
|
|
2457
|
-
...
|
|
2460
|
+
"aria-expanded": r.open,
|
|
2461
|
+
"aria-controls": r.contentId,
|
|
2462
|
+
"data-state": Lt(r.open),
|
|
2463
|
+
...o,
|
|
2458
2464
|
ref: i,
|
|
2459
|
-
onClick:
|
|
2465
|
+
onClick: $e(t.onClick, r.onOpenToggle)
|
|
2460
2466
|
}
|
|
2461
2467
|
);
|
|
2462
2468
|
}
|
|
2463
2469
|
);
|
|
2464
|
-
|
|
2465
|
-
var xt = "DialogPortal", [
|
|
2470
|
+
vi.displayName = Nn;
|
|
2471
|
+
var xt = "DialogPortal", [wi, On] = Ln(xt, {
|
|
2466
2472
|
forceMount: void 0
|
|
2467
2473
|
}), Dn = (t) => {
|
|
2468
|
-
const { __scopeDialog: e, forceMount: n, children:
|
|
2469
|
-
return /* @__PURE__ */ a(
|
|
2474
|
+
const { __scopeDialog: e, forceMount: n, children: o, container: r } = t, i = he(xt, e);
|
|
2475
|
+
return /* @__PURE__ */ a(wi, { scope: e, forceMount: n, children: X.Children.map(o, (c) => /* @__PURE__ */ a(yt, { present: n || i.open, children: /* @__PURE__ */ a(To, { asChild: !0, container: r, children: c }) })) });
|
|
2470
2476
|
};
|
|
2471
2477
|
Dn.displayName = xt;
|
|
2472
|
-
var
|
|
2478
|
+
var Ye = "DialogOverlay", An = X.forwardRef(
|
|
2473
2479
|
(t, e) => {
|
|
2474
|
-
const n = On(
|
|
2475
|
-
return i.modal ? /* @__PURE__ */ a(yt, { present:
|
|
2480
|
+
const n = On(Ye, t.__scopeDialog), { forceMount: o = n.forceMount, ...r } = t, i = he(Ye, t.__scopeDialog);
|
|
2481
|
+
return i.modal ? /* @__PURE__ */ a(yt, { present: o || i.open, children: /* @__PURE__ */ a(bi, { ...r, ref: e }) }) : null;
|
|
2476
2482
|
}
|
|
2477
2483
|
);
|
|
2478
|
-
An.displayName =
|
|
2479
|
-
var
|
|
2484
|
+
An.displayName = Ye;
|
|
2485
|
+
var _i = mo("DialogOverlay.RemoveScroll"), bi = X.forwardRef(
|
|
2480
2486
|
(t, e) => {
|
|
2481
|
-
const { __scopeDialog: n, ...
|
|
2487
|
+
const { __scopeDialog: n, ...o } = t, r = he(Ye, n);
|
|
2482
2488
|
return (
|
|
2483
2489
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
2484
2490
|
// ie. when `Overlay` and `Content` are siblings
|
|
2485
|
-
/* @__PURE__ */ a(
|
|
2486
|
-
|
|
2491
|
+
/* @__PURE__ */ a(vo, { as: _i, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ a(
|
|
2492
|
+
Ve.div,
|
|
2487
2493
|
{
|
|
2488
|
-
"data-state": Lt(
|
|
2489
|
-
...
|
|
2494
|
+
"data-state": Lt(r.open),
|
|
2495
|
+
...o,
|
|
2490
2496
|
ref: e,
|
|
2491
|
-
style: { pointerEvents: "auto", ...
|
|
2497
|
+
style: { pointerEvents: "auto", ...o.style }
|
|
2492
2498
|
}
|
|
2493
2499
|
) })
|
|
2494
2500
|
);
|
|
2495
2501
|
}
|
|
2496
|
-
),
|
|
2502
|
+
), Le = "DialogContent", zn = X.forwardRef(
|
|
2497
2503
|
(t, e) => {
|
|
2498
|
-
const n = On(
|
|
2499
|
-
return /* @__PURE__ */ a(yt, { present:
|
|
2504
|
+
const n = On(Le, t.__scopeDialog), { forceMount: o = n.forceMount, ...r } = t, i = he(Le, t.__scopeDialog);
|
|
2505
|
+
return /* @__PURE__ */ a(yt, { present: o || i.open, children: i.modal ? /* @__PURE__ */ a(Ti, { ...r, ref: e }) : /* @__PURE__ */ a(Ci, { ...r, ref: e }) });
|
|
2500
2506
|
}
|
|
2501
2507
|
);
|
|
2502
|
-
zn.displayName =
|
|
2503
|
-
var
|
|
2508
|
+
zn.displayName = Le;
|
|
2509
|
+
var Ti = X.forwardRef(
|
|
2504
2510
|
(t, e) => {
|
|
2505
|
-
const n =
|
|
2511
|
+
const n = he(Le, t.__scopeDialog), o = X.useRef(null), r = Pt(e, n.contentRef, o);
|
|
2506
2512
|
return X.useEffect(() => {
|
|
2507
|
-
const i =
|
|
2513
|
+
const i = o.current;
|
|
2508
2514
|
if (i)
|
|
2509
|
-
return
|
|
2515
|
+
return wo(i);
|
|
2510
2516
|
}, []), /* @__PURE__ */ a(
|
|
2511
2517
|
Mn,
|
|
2512
2518
|
{
|
|
2513
2519
|
...t,
|
|
2514
|
-
ref:
|
|
2520
|
+
ref: r,
|
|
2515
2521
|
trapFocus: n.open,
|
|
2516
2522
|
disableOutsidePointerEvents: !0,
|
|
2517
|
-
onCloseAutoFocus:
|
|
2523
|
+
onCloseAutoFocus: $e(t.onCloseAutoFocus, (i) => {
|
|
2518
2524
|
var c;
|
|
2519
2525
|
i.preventDefault(), (c = n.triggerRef.current) == null || c.focus();
|
|
2520
2526
|
}),
|
|
2521
|
-
onPointerDownOutside:
|
|
2527
|
+
onPointerDownOutside: $e(t.onPointerDownOutside, (i) => {
|
|
2522
2528
|
const c = i.detail.originalEvent, l = c.button === 0 && c.ctrlKey === !0;
|
|
2523
2529
|
(c.button === 2 || l) && i.preventDefault();
|
|
2524
2530
|
}),
|
|
2525
|
-
onFocusOutside:
|
|
2531
|
+
onFocusOutside: $e(
|
|
2526
2532
|
t.onFocusOutside,
|
|
2527
2533
|
(i) => i.preventDefault()
|
|
2528
2534
|
)
|
|
2529
2535
|
}
|
|
2530
2536
|
);
|
|
2531
2537
|
}
|
|
2532
|
-
),
|
|
2538
|
+
), Ci = X.forwardRef(
|
|
2533
2539
|
(t, e) => {
|
|
2534
|
-
const n =
|
|
2540
|
+
const n = he(Le, t.__scopeDialog), o = X.useRef(!1), r = X.useRef(!1);
|
|
2535
2541
|
return /* @__PURE__ */ a(
|
|
2536
2542
|
Mn,
|
|
2537
2543
|
{
|
|
@@ -2541,31 +2547,31 @@ var _i = X.forwardRef(
|
|
|
2541
2547
|
disableOutsidePointerEvents: !1,
|
|
2542
2548
|
onCloseAutoFocus: (i) => {
|
|
2543
2549
|
var c, l;
|
|
2544
|
-
(c = t.onCloseAutoFocus) == null || c.call(t, i), i.defaultPrevented || (
|
|
2550
|
+
(c = t.onCloseAutoFocus) == null || c.call(t, i), i.defaultPrevented || (o.current || (l = n.triggerRef.current) == null || l.focus(), i.preventDefault()), o.current = !1, r.current = !1;
|
|
2545
2551
|
},
|
|
2546
2552
|
onInteractOutside: (i) => {
|
|
2547
2553
|
var d, f;
|
|
2548
|
-
(d = t.onInteractOutside) == null || d.call(t, i), i.defaultPrevented || (
|
|
2554
|
+
(d = t.onInteractOutside) == null || d.call(t, i), i.defaultPrevented || (o.current = !0, i.detail.originalEvent.type === "pointerdown" && (r.current = !0));
|
|
2549
2555
|
const c = i.target;
|
|
2550
|
-
((f = n.triggerRef.current) == null ? void 0 : f.contains(c)) && i.preventDefault(), i.detail.originalEvent.type === "focusin" &&
|
|
2556
|
+
((f = n.triggerRef.current) == null ? void 0 : f.contains(c)) && i.preventDefault(), i.detail.originalEvent.type === "focusin" && r.current && i.preventDefault();
|
|
2551
2557
|
}
|
|
2552
2558
|
}
|
|
2553
2559
|
);
|
|
2554
2560
|
}
|
|
2555
2561
|
), Mn = X.forwardRef(
|
|
2556
2562
|
(t, e) => {
|
|
2557
|
-
const { __scopeDialog: n, trapFocus:
|
|
2558
|
-
return
|
|
2563
|
+
const { __scopeDialog: n, trapFocus: o, onOpenAutoFocus: r, onCloseAutoFocus: i, ...c } = t, l = he(Le, n), d = X.useRef(null), f = Pt(e, d);
|
|
2564
|
+
return _o(), /* @__PURE__ */ $(fe, { children: [
|
|
2559
2565
|
/* @__PURE__ */ a(
|
|
2560
|
-
|
|
2566
|
+
bo,
|
|
2561
2567
|
{
|
|
2562
2568
|
asChild: !0,
|
|
2563
2569
|
loop: !0,
|
|
2564
|
-
trapped:
|
|
2565
|
-
onMountAutoFocus:
|
|
2570
|
+
trapped: o,
|
|
2571
|
+
onMountAutoFocus: r,
|
|
2566
2572
|
onUnmountAutoFocus: i,
|
|
2567
2573
|
children: /* @__PURE__ */ a(
|
|
2568
|
-
|
|
2574
|
+
go,
|
|
2569
2575
|
{
|
|
2570
2576
|
role: "dialog",
|
|
2571
2577
|
id: l.contentId,
|
|
@@ -2579,36 +2585,36 @@ var _i = X.forwardRef(
|
|
|
2579
2585
|
)
|
|
2580
2586
|
}
|
|
2581
2587
|
),
|
|
2582
|
-
/* @__PURE__ */ $(
|
|
2583
|
-
/* @__PURE__ */ a(
|
|
2584
|
-
/* @__PURE__ */ a(
|
|
2588
|
+
/* @__PURE__ */ $(fe, { children: [
|
|
2589
|
+
/* @__PURE__ */ a(yi, { titleId: l.titleId }),
|
|
2590
|
+
/* @__PURE__ */ a(Ii, { contentRef: d, descriptionId: l.descriptionId })
|
|
2585
2591
|
] })
|
|
2586
2592
|
] });
|
|
2587
2593
|
}
|
|
2588
2594
|
), Rt = "DialogTitle", Fn = X.forwardRef(
|
|
2589
2595
|
(t, e) => {
|
|
2590
|
-
const { __scopeDialog: n, ...
|
|
2591
|
-
return /* @__PURE__ */ a(
|
|
2596
|
+
const { __scopeDialog: n, ...o } = t, r = he(Rt, n);
|
|
2597
|
+
return /* @__PURE__ */ a(Ve.h2, { id: r.titleId, ...o, ref: e });
|
|
2592
2598
|
}
|
|
2593
2599
|
);
|
|
2594
2600
|
Fn.displayName = Rt;
|
|
2595
|
-
var kn = "DialogDescription",
|
|
2601
|
+
var kn = "DialogDescription", Pi = X.forwardRef(
|
|
2596
2602
|
(t, e) => {
|
|
2597
|
-
const { __scopeDialog: n, ...
|
|
2598
|
-
return /* @__PURE__ */ a(
|
|
2603
|
+
const { __scopeDialog: n, ...o } = t, r = he(kn, n);
|
|
2604
|
+
return /* @__PURE__ */ a(Ve.p, { id: r.descriptionId, ...o, ref: e });
|
|
2599
2605
|
}
|
|
2600
2606
|
);
|
|
2601
|
-
|
|
2607
|
+
Pi.displayName = kn;
|
|
2602
2608
|
var Wn = "DialogClose", Hn = X.forwardRef(
|
|
2603
2609
|
(t, e) => {
|
|
2604
|
-
const { __scopeDialog: n, ...
|
|
2610
|
+
const { __scopeDialog: n, ...o } = t, r = he(Wn, n);
|
|
2605
2611
|
return /* @__PURE__ */ a(
|
|
2606
|
-
|
|
2612
|
+
Ve.button,
|
|
2607
2613
|
{
|
|
2608
2614
|
type: "button",
|
|
2609
|
-
...
|
|
2615
|
+
...o,
|
|
2610
2616
|
ref: e,
|
|
2611
|
-
onClick:
|
|
2617
|
+
onClick: $e(t.onClick, () => r.onOpenChange(!1))
|
|
2612
2618
|
}
|
|
2613
2619
|
);
|
|
2614
2620
|
}
|
|
@@ -2617,11 +2623,11 @@ Hn.displayName = Wn;
|
|
|
2617
2623
|
function Lt(t) {
|
|
2618
2624
|
return t ? "open" : "closed";
|
|
2619
2625
|
}
|
|
2620
|
-
var $n = "DialogTitleWarning", [
|
|
2621
|
-
contentName:
|
|
2626
|
+
var $n = "DialogTitleWarning", [ic, qn] = ho($n, {
|
|
2627
|
+
contentName: Le,
|
|
2622
2628
|
titleName: Rt,
|
|
2623
2629
|
docsSlug: "dialog"
|
|
2624
|
-
}),
|
|
2630
|
+
}), yi = ({ titleId: t }) => {
|
|
2625
2631
|
const e = qn($n), n = `\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
|
|
2626
2632
|
|
|
2627
2633
|
If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
@@ -2630,15 +2636,15 @@ For more information, see https://radix-ui.com/primitives/docs/components/${e.do
|
|
|
2630
2636
|
return X.useEffect(() => {
|
|
2631
2637
|
t && (document.getElementById(t) || console.error(n));
|
|
2632
2638
|
}, [n, t]), null;
|
|
2633
|
-
},
|
|
2634
|
-
const
|
|
2639
|
+
}, Si = "DialogDescriptionWarning", Ii = ({ contentRef: t, descriptionId: e }) => {
|
|
2640
|
+
const o = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${qn(Si).contentName}}.`;
|
|
2635
2641
|
return X.useEffect(() => {
|
|
2636
2642
|
var i;
|
|
2637
|
-
const
|
|
2638
|
-
e &&
|
|
2639
|
-
}, [
|
|
2640
|
-
},
|
|
2641
|
-
const
|
|
2643
|
+
const r = (i = t.current) == null ? void 0 : i.getAttribute("aria-describedby");
|
|
2644
|
+
e && r && (document.getElementById(e) || console.warn(o));
|
|
2645
|
+
}, [o, t, e]), null;
|
|
2646
|
+
}, xi = En, Ri = Dn, Li = An, Ei = zn, Ni = Fn, Oi = Hn;
|
|
2647
|
+
const xe = {
|
|
2642
2648
|
"rp-dialog-wrapper": "_rp-dialog-wrapper_slqo7_1",
|
|
2643
2649
|
"rp-dialog-overlay": "_rp-dialog-overlay_slqo7_7",
|
|
2644
2650
|
"rp-document-dialog": "_rp-document-dialog_slqo7_13",
|
|
@@ -2646,8 +2652,8 @@ const Re = {
|
|
|
2646
2652
|
"rp-dialog-title": "_rp-dialog-title_slqo7_39",
|
|
2647
2653
|
"rp-dialog-close": "_rp-dialog-close_slqo7_47",
|
|
2648
2654
|
"rp-properties-divider": "_rp-properties-divider_slqo7_55"
|
|
2649
|
-
},
|
|
2650
|
-
const { pdfProperties: t } =
|
|
2655
|
+
}, Di = () => {
|
|
2656
|
+
const { pdfProperties: t } = re(), { container: e } = be(), { activeDocumentProperties: n, setActiveDocumentProperties: o } = yr(), { localeMessages: r } = me(), i = W(() => {
|
|
2651
2657
|
if (!t)
|
|
2652
2658
|
return [];
|
|
2653
2659
|
const {
|
|
@@ -2656,52 +2662,52 @@ const Re = {
|
|
|
2656
2662
|
title: d,
|
|
2657
2663
|
author: f,
|
|
2658
2664
|
subject: m,
|
|
2659
|
-
createdOn:
|
|
2660
|
-
creator:
|
|
2665
|
+
createdOn: P,
|
|
2666
|
+
creator: u,
|
|
2661
2667
|
keywords: T,
|
|
2662
|
-
modifiedOn:
|
|
2668
|
+
modifiedOn: C,
|
|
2663
2669
|
pdfProducer: b,
|
|
2664
2670
|
pdfVersion: g,
|
|
2665
2671
|
pageCount: S
|
|
2666
2672
|
} = t;
|
|
2667
2673
|
return [
|
|
2668
|
-
{ label:
|
|
2669
|
-
{ label:
|
|
2674
|
+
{ label: r == null ? void 0 : r.propertiesFilenameLabel, value: l },
|
|
2675
|
+
{ label: r == null ? void 0 : r.propertiesFileSizeLabel, value: c },
|
|
2670
2676
|
{ separate: !0 },
|
|
2671
|
-
{ label:
|
|
2672
|
-
{ label:
|
|
2673
|
-
{ label:
|
|
2674
|
-
{ label:
|
|
2675
|
-
{ label:
|
|
2677
|
+
{ label: r == null ? void 0 : r.propertiesTitleLabel, value: d },
|
|
2678
|
+
{ label: r == null ? void 0 : r.propertiesAuthorLabel, value: f },
|
|
2679
|
+
{ label: r == null ? void 0 : r.propertiesSubjectLabel, value: m },
|
|
2680
|
+
{ label: r == null ? void 0 : r.propertiesKeywordLabel, value: T },
|
|
2681
|
+
{ label: r == null ? void 0 : r.propertiesCreatorLabel, value: u },
|
|
2676
2682
|
{
|
|
2677
|
-
label:
|
|
2678
|
-
value:
|
|
2683
|
+
label: r == null ? void 0 : r.propertiesCreateOnLabel,
|
|
2684
|
+
value: P ? Mt(P) : ""
|
|
2679
2685
|
},
|
|
2680
2686
|
{
|
|
2681
|
-
label:
|
|
2682
|
-
value:
|
|
2687
|
+
label: r == null ? void 0 : r.propertiesModifiedOnLabel,
|
|
2688
|
+
value: C ? Mt(C) : ""
|
|
2683
2689
|
},
|
|
2684
2690
|
{ separate: !0 },
|
|
2685
|
-
{ label:
|
|
2686
|
-
{ label:
|
|
2687
|
-
{ label:
|
|
2691
|
+
{ label: r == null ? void 0 : r.propertiesPDFProducerLabel, value: b },
|
|
2692
|
+
{ label: r == null ? void 0 : r.propertiesPDFVersionLabel, value: g },
|
|
2693
|
+
{ label: r == null ? void 0 : r.propertiesPageCountLabel, value: S }
|
|
2688
2694
|
];
|
|
2689
|
-
}, [t,
|
|
2690
|
-
return /* @__PURE__ */ a(
|
|
2691
|
-
/* @__PURE__ */ a(
|
|
2692
|
-
/* @__PURE__ */ $(
|
|
2693
|
-
/* @__PURE__ */ a(
|
|
2694
|
-
/* @__PURE__ */ a("div", { className:
|
|
2695
|
-
/* @__PURE__ */ a(
|
|
2695
|
+
}, [t, r]);
|
|
2696
|
+
return /* @__PURE__ */ a(xi, { open: n, onOpenChange: o, children: /* @__PURE__ */ a(Ri, { container: e, children: /* @__PURE__ */ $("div", { className: xe["rp-dialog-wrapper"], children: [
|
|
2697
|
+
/* @__PURE__ */ a(Li, { className: xe["rp-dialog-overlay"] }),
|
|
2698
|
+
/* @__PURE__ */ $(Ei, { className: xe["rp-document-dialog"], children: [
|
|
2699
|
+
/* @__PURE__ */ a(Ni, { className: xe["rp-dialog-title"], children: r == null ? void 0 : r.documentPropertiesLabel }),
|
|
2700
|
+
/* @__PURE__ */ a("div", { className: xe["rp-document-properties"], children: i.map((c, l) => /* @__PURE__ */ a("div", { children: c.separate ? /* @__PURE__ */ a("div", { className: xe["rp-properties-divider"] }) : /* @__PURE__ */ a(Mr, { label: c.label, value: c.value }) }, l)) }),
|
|
2701
|
+
/* @__PURE__ */ a(Oi, { asChild: !0, className: xe["rp-dialog-close"], children: /* @__PURE__ */ a(Co, {}) })
|
|
2696
2702
|
] })
|
|
2697
2703
|
] }) }) });
|
|
2698
|
-
},
|
|
2704
|
+
}, Ai = {
|
|
2699
2705
|
"rp-other-tool-content": "_rp-other-tool-content_su718_1"
|
|
2700
|
-
}, Jt = ".pdf",
|
|
2706
|
+
}, Jt = ".pdf", zi = (t) => URL.createObjectURL(t), Mi = async (t) => {
|
|
2701
2707
|
const n = await (await fetch(t)).blob();
|
|
2702
|
-
return
|
|
2708
|
+
return zi(n);
|
|
2703
2709
|
}, Gn = () => {
|
|
2704
|
-
const { filename: t, pdfSrc: e } =
|
|
2710
|
+
const { filename: t, pdfSrc: e } = re(), { downloadFilename: n } = br(), o = (i) => {
|
|
2705
2711
|
const c = n || i;
|
|
2706
2712
|
return c.endsWith(Jt) ? c : `${c}${Jt}`;
|
|
2707
2713
|
};
|
|
@@ -2709,33 +2715,33 @@ const Re = {
|
|
|
2709
2715
|
if (!t || !e)
|
|
2710
2716
|
throw new Error("There is no PDF source to download");
|
|
2711
2717
|
const i = document.createElement("a");
|
|
2712
|
-
i.href = await
|
|
2718
|
+
i.href = await Mi(e), i.download = o(t), document.body.appendChild(i), i.click(), document.body.removeChild(i);
|
|
2713
2719
|
}, [t, e]) };
|
|
2714
2720
|
}, Un = () => {
|
|
2715
2721
|
const { downloadIcon: t } = Pe(), { downloadIcon: e } = Te();
|
|
2716
|
-
return t || e || /* @__PURE__ */ a(
|
|
2717
|
-
}, Vn = ({ children: t, className: e, localeMessages: n }) => /* @__PURE__ */ a(Q, { className: e, content: n == null ? void 0 : n.downloadFileTooltip, children: t }),
|
|
2722
|
+
return t || e || /* @__PURE__ */ a(xo, {});
|
|
2723
|
+
}, Vn = ({ children: t, className: e, localeMessages: n }) => /* @__PURE__ */ a(Q, { className: e, content: n == null ? void 0 : n.downloadFileTooltip, children: t }), Fi = ({ download: t, localeMessages: e }) => /* @__PURE__ */ a(Vn, { localeMessages: e, children: /* @__PURE__ */ a(we, { onClick: t, "aria-label": e == null ? void 0 : e.downloadFileTooltip, children: /* @__PURE__ */ a(Un, {}) }) }), ki = ({ download: t, localeMessages: e }) => /* @__PURE__ */ a(Qe, { onClick: t, children: /* @__PURE__ */ $(Vn, { className: "rp-menu-item", localeMessages: e, children: [
|
|
2718
2724
|
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(Un, {}) }),
|
|
2719
2725
|
e == null ? void 0 : e.downloadFileLabel
|
|
2720
2726
|
] }) }), Bn = () => {
|
|
2721
|
-
const { download: t } = Gn(), { downloadTool: e = !0 } = Ce(), { downloadTool: n = !0 } =
|
|
2722
|
-
return !e || !n ? null :
|
|
2727
|
+
const { download: t } = Gn(), { downloadTool: e = !0 } = Ce(), { downloadTool: n = !0 } = Ne(), { isSmallScreen: o } = Oe(), { localeMessages: r } = me(), i = r == null ? void 0 : r.downloadFileTooltip;
|
|
2728
|
+
return !e || !n ? null : o ? /* @__PURE__ */ a(ki, { download: t, localeMessages: r }) : typeof e == "function" ? /* @__PURE__ */ a(Q, { content: i, children: /* @__PURE__ */ a(e, { download: t }) }) : typeof n == "function" ? /* @__PURE__ */ a(Q, { content: i, children: /* @__PURE__ */ a(n, { download: t }) }) : /* @__PURE__ */ a(Fi, { download: t, localeMessages: r });
|
|
2723
2729
|
}, jn = () => {
|
|
2724
2730
|
const { printIcon: t } = Pe(), { printIcon: e } = Te();
|
|
2725
|
-
return t || e || /* @__PURE__ */ a(
|
|
2726
|
-
}, Kn = ({ children: t, className: e, localeMessages: n }) => /* @__PURE__ */ a(Q, { className: e, content: n == null ? void 0 : n.printTooltip, children: t }),
|
|
2731
|
+
return t || e || /* @__PURE__ */ a(Ro, {});
|
|
2732
|
+
}, Kn = ({ children: t, className: e, localeMessages: n }) => /* @__PURE__ */ a(Q, { className: e, content: n == null ? void 0 : n.printTooltip, children: t }), Wi = ({ print: t, localeMessages: e }) => /* @__PURE__ */ a(Kn, { localeMessages: e, children: /* @__PURE__ */ a(we, { onClick: t, "aria-label": e == null ? void 0 : e.printTooltip, children: /* @__PURE__ */ a(jn, {}) }) }), Hi = ({ print: t, localeMessages: e }) => /* @__PURE__ */ a(Qe, { onClick: t, children: /* @__PURE__ */ $(Kn, { className: "rp-menu-item", localeMessages: e, children: [
|
|
2727
2733
|
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(jn, {}) }),
|
|
2728
2734
|
e == null ? void 0 : e.printLabel
|
|
2729
2735
|
] }) }), Zn = () => {
|
|
2730
|
-
const { print: t, cancel: e, setOnProgress: n, setOnComplete:
|
|
2731
|
-
return !c || !l ? null : d ? /* @__PURE__ */ a(
|
|
2736
|
+
const { print: t, cancel: e, setOnProgress: n, setOnComplete: o, setOnError: r, progress: i } = nt(), { printTool: c = !0 } = Ce(), { printTool: l = !0 } = Ne(), { isSmallScreen: d } = Oe(), { localeMessages: f } = me(), m = f == null ? void 0 : f.printTooltip;
|
|
2737
|
+
return !c || !l ? null : d ? /* @__PURE__ */ a(Hi, { print: t, localeMessages: f }) : typeof c == "function" ? /* @__PURE__ */ a(Q, { content: m, children: /* @__PURE__ */ a(
|
|
2732
2738
|
c,
|
|
2733
2739
|
{
|
|
2734
2740
|
print: t,
|
|
2735
2741
|
cancel: e,
|
|
2736
2742
|
setOnProgress: n,
|
|
2737
|
-
setOnError:
|
|
2738
|
-
setOnComplete:
|
|
2743
|
+
setOnError: r,
|
|
2744
|
+
setOnComplete: o,
|
|
2739
2745
|
progress: i
|
|
2740
2746
|
}
|
|
2741
2747
|
) }) : typeof l == "function" ? /* @__PURE__ */ a(Q, { content: m, children: /* @__PURE__ */ a(
|
|
@@ -2744,75 +2750,75 @@ const Re = {
|
|
|
2744
2750
|
print: t,
|
|
2745
2751
|
cancel: e,
|
|
2746
2752
|
setOnProgress: n,
|
|
2747
|
-
setOnError:
|
|
2748
|
-
setOnComplete:
|
|
2753
|
+
setOnError: r,
|
|
2754
|
+
setOnComplete: o,
|
|
2749
2755
|
progress: i
|
|
2750
2756
|
}
|
|
2751
|
-
) }) : /* @__PURE__ */ a(
|
|
2752
|
-
},
|
|
2757
|
+
) }) : /* @__PURE__ */ a(Wi, { print: t, localeMessages: f });
|
|
2758
|
+
}, $i = {
|
|
2753
2759
|
"rp-go-to-Top": "_rp-go-to-Top_4e0yd_1"
|
|
2754
|
-
},
|
|
2760
|
+
}, qi = () => {
|
|
2755
2761
|
const { goToFirstPageIcon: t } = Pe(), { goToFirstPageIcon: e } = Te();
|
|
2756
|
-
return t || e || /* @__PURE__ */ a(mn, { className:
|
|
2757
|
-
},
|
|
2762
|
+
return t || e || /* @__PURE__ */ a(mn, { className: $i["rp-go-to-Top"] });
|
|
2763
|
+
}, Gi = () => {
|
|
2758
2764
|
const { goToLastPageIcon: t } = Pe(), { goToLastPageIcon: e } = Te();
|
|
2759
2765
|
return t || e || /* @__PURE__ */ a(mn, {});
|
|
2760
|
-
}, en = { width: "100%" },
|
|
2761
|
-
const { goToPage: t, totalPages: e, focusedPage: n } =
|
|
2766
|
+
}, en = { width: "100%" }, Ui = () => {
|
|
2767
|
+
const { goToPage: t, totalPages: e, focusedPage: n } = pe(), { jumpNavigationTool: o = !0 } = Ce(), { jumpNavigationTool: r = !0 } = Ne(), { localeMessages: i } = me(), c = W(() => n === 1, [n]), l = W(() => n === e, [n, e]), d = E(() => {
|
|
2762
2768
|
t(1);
|
|
2763
2769
|
}, [t]), f = E(() => {
|
|
2764
2770
|
t(e);
|
|
2765
2771
|
}, [t, e]);
|
|
2766
|
-
return !
|
|
2767
|
-
/* @__PURE__ */ a(
|
|
2768
|
-
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(
|
|
2772
|
+
return !o || !r ? null : /* @__PURE__ */ $(hn, { children: [
|
|
2773
|
+
/* @__PURE__ */ a(Qe, { onClick: d, children: /* @__PURE__ */ a(Q, { content: i == null ? void 0 : i.firstPageTooltip, style: en, children: /* @__PURE__ */ $("div", { className: "rp-menu-item", "aria-disabled": c, children: [
|
|
2774
|
+
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(qi, {}) }),
|
|
2769
2775
|
/* @__PURE__ */ a("span", { children: i == null ? void 0 : i.firstPageLabel })
|
|
2770
2776
|
] }) }) }),
|
|
2771
|
-
/* @__PURE__ */ a(
|
|
2772
|
-
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(
|
|
2777
|
+
/* @__PURE__ */ a(Qe, { onClick: f, children: /* @__PURE__ */ a(Q, { content: i == null ? void 0 : i.lastPageTooltip, style: en, children: /* @__PURE__ */ $("div", { className: "rp-menu-item", "aria-disabled": l, children: [
|
|
2778
|
+
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(Gi, {}) }),
|
|
2773
2779
|
/* @__PURE__ */ a("span", { children: i == null ? void 0 : i.lastPageLabel })
|
|
2774
2780
|
] }) }) }),
|
|
2775
2781
|
/* @__PURE__ */ a(un, {})
|
|
2776
2782
|
] });
|
|
2777
|
-
},
|
|
2778
|
-
const [t, e] = q(!1), { container: n, pagesRef:
|
|
2783
|
+
}, Vi = () => {
|
|
2784
|
+
const [t, e] = q(!1), { container: n, pagesRef: o } = be(), { isSmallScreen: r } = Oe(), {
|
|
2779
2785
|
openFileTool: i,
|
|
2780
2786
|
downloadTool: c,
|
|
2781
2787
|
documentProperties: l,
|
|
2782
2788
|
scrollModeTool: d,
|
|
2783
2789
|
rotateTool: f,
|
|
2784
2790
|
selectionModeTool: m,
|
|
2785
|
-
jumpNavigationTool:
|
|
2786
|
-
printTool:
|
|
2791
|
+
jumpNavigationTool: P,
|
|
2792
|
+
printTool: u,
|
|
2787
2793
|
fullscreenTool: T,
|
|
2788
|
-
viewModeTool:
|
|
2794
|
+
viewModeTool: C
|
|
2789
2795
|
} = Ce(), {
|
|
2790
2796
|
openFileTool: b,
|
|
2791
2797
|
downloadTool: g,
|
|
2792
2798
|
documentProperties: S,
|
|
2793
2799
|
scrollModeTool: v,
|
|
2794
2800
|
rotateTool: h,
|
|
2795
|
-
selectionModeTool:
|
|
2801
|
+
selectionModeTool: p,
|
|
2796
2802
|
jumpNavigationTool: s,
|
|
2797
2803
|
printTool: w,
|
|
2798
2804
|
fullscreenTool: _,
|
|
2799
2805
|
viewModeTool: y
|
|
2800
|
-
} =
|
|
2806
|
+
} = Ne(), { localeMessages: x } = me(), [I, R] = q(0), L = k(
|
|
2801
2807
|
new ResizeObserver((M) => {
|
|
2802
2808
|
R(M[0].contentRect.height);
|
|
2803
2809
|
})
|
|
2804
|
-
), N = W(() =>
|
|
2810
|
+
), N = W(() => P || f || m || d || l || C || r && (i || c || u || T), [
|
|
2805
2811
|
i,
|
|
2806
2812
|
c,
|
|
2807
|
-
|
|
2813
|
+
u,
|
|
2808
2814
|
T,
|
|
2809
2815
|
l,
|
|
2810
2816
|
d,
|
|
2811
2817
|
f,
|
|
2812
2818
|
m,
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
]), F = W(() => s || h ||
|
|
2819
|
+
P,
|
|
2820
|
+
r
|
|
2821
|
+
]), F = W(() => s || h || p || v || S || y || r && (b || g || w || _), [
|
|
2816
2822
|
b,
|
|
2817
2823
|
g,
|
|
2818
2824
|
w,
|
|
@@ -2820,70 +2826,70 @@ const Re = {
|
|
|
2820
2826
|
S,
|
|
2821
2827
|
v,
|
|
2822
2828
|
h,
|
|
2823
|
-
|
|
2829
|
+
p,
|
|
2824
2830
|
s,
|
|
2825
|
-
|
|
2831
|
+
r
|
|
2826
2832
|
]);
|
|
2827
|
-
return z(() => (
|
|
2833
|
+
return z(() => (o && L.current.observe(o), () => {
|
|
2828
2834
|
L.current.disconnect();
|
|
2829
|
-
}), [
|
|
2835
|
+
}), [o]), !N || !F ? null : /* @__PURE__ */ $(fe, { children: [
|
|
2830
2836
|
/* @__PURE__ */ a(
|
|
2831
2837
|
dn,
|
|
2832
2838
|
{
|
|
2833
2839
|
container: n,
|
|
2834
2840
|
onOpenChange: e,
|
|
2835
|
-
triggerComponent: /* @__PURE__ */ a("div", { role: "button", children: /* @__PURE__ */ a(Q, { content: x == null ? void 0 : x.moreOptionTooltip, children: /* @__PURE__ */ a(we, { active: t, "aria-label": x == null ? void 0 : x.moreOptionTooltip, children: /* @__PURE__ */ a(
|
|
2841
|
+
triggerComponent: /* @__PURE__ */ a("div", { role: "button", children: /* @__PURE__ */ a(Q, { content: x == null ? void 0 : x.moreOptionTooltip, children: /* @__PURE__ */ a(we, { active: t, "aria-label": x == null ? void 0 : x.moreOptionTooltip, children: /* @__PURE__ */ a(uo, {}) }) }) }),
|
|
2836
2842
|
side: "bottom",
|
|
2837
2843
|
avoidCollisions: !1,
|
|
2838
2844
|
children: /* @__PURE__ */ $(
|
|
2839
2845
|
"div",
|
|
2840
2846
|
{
|
|
2841
2847
|
style: { maxHeight: `${I}px`, overflow: "auto" },
|
|
2842
|
-
className:
|
|
2848
|
+
className: Ai["rp-other-tool-content"],
|
|
2843
2849
|
"data-rp": "moreOptionsDropdown",
|
|
2844
2850
|
children: [
|
|
2845
|
-
|
|
2851
|
+
r && /* @__PURE__ */ $(hn, { children: [
|
|
2846
2852
|
/* @__PURE__ */ a(pn, {}),
|
|
2847
2853
|
/* @__PURE__ */ a(Bn, {}),
|
|
2848
2854
|
/* @__PURE__ */ a(Zn, {}),
|
|
2849
2855
|
/* @__PURE__ */ a(fn, {}),
|
|
2850
2856
|
/* @__PURE__ */ a(un, {})
|
|
2851
2857
|
] }),
|
|
2852
|
-
/* @__PURE__ */ a(
|
|
2853
|
-
/* @__PURE__ */ a(
|
|
2854
|
-
/* @__PURE__ */ a(
|
|
2855
|
-
/* @__PURE__ */ a(
|
|
2856
|
-
/* @__PURE__ */ a(
|
|
2857
|
-
/* @__PURE__ */ a(
|
|
2858
|
+
/* @__PURE__ */ a(Ui, {}),
|
|
2859
|
+
/* @__PURE__ */ a(yo, {}),
|
|
2860
|
+
/* @__PURE__ */ a(Lo, {}),
|
|
2861
|
+
/* @__PURE__ */ a(So, {}),
|
|
2862
|
+
/* @__PURE__ */ a(Io, {}),
|
|
2863
|
+
/* @__PURE__ */ a(Po, {})
|
|
2858
2864
|
]
|
|
2859
2865
|
}
|
|
2860
2866
|
)
|
|
2861
2867
|
}
|
|
2862
2868
|
),
|
|
2863
|
-
/* @__PURE__ */ a(
|
|
2869
|
+
/* @__PURE__ */ a(Di, {})
|
|
2864
2870
|
] });
|
|
2865
|
-
},
|
|
2866
|
-
const { isSmallScreen: t } =
|
|
2867
|
-
return /* @__PURE__ */ $(
|
|
2868
|
-
/* @__PURE__ */ a(
|
|
2869
|
-
!t && /* @__PURE__ */ $(
|
|
2871
|
+
}, Bi = () => {
|
|
2872
|
+
const { isSmallScreen: t } = Oe();
|
|
2873
|
+
return /* @__PURE__ */ $(fe, { children: [
|
|
2874
|
+
/* @__PURE__ */ a(lo, {}),
|
|
2875
|
+
!t && /* @__PURE__ */ $(fe, { children: [
|
|
2870
2876
|
/* @__PURE__ */ a(pn, {}),
|
|
2871
2877
|
/* @__PURE__ */ a(Bn, {}),
|
|
2872
2878
|
/* @__PURE__ */ a(Zn, {}),
|
|
2873
2879
|
/* @__PURE__ */ a(fn, {})
|
|
2874
2880
|
] }),
|
|
2875
|
-
/* @__PURE__ */ a(
|
|
2881
|
+
/* @__PURE__ */ a(Vi, {})
|
|
2876
2882
|
] });
|
|
2877
2883
|
}, tn = () => {
|
|
2878
|
-
const { totalMatches: t, nextMatch: e, prevMatch: n } = St(), { localeMessages:
|
|
2879
|
-
return /* @__PURE__ */ $(
|
|
2884
|
+
const { totalMatches: t, nextMatch: e, prevMatch: n } = St(), { localeMessages: o } = me();
|
|
2885
|
+
return /* @__PURE__ */ $(fe, { children: [
|
|
2880
2886
|
/* @__PURE__ */ a(
|
|
2881
2887
|
Q,
|
|
2882
2888
|
{
|
|
2883
|
-
content:
|
|
2889
|
+
content: o == null ? void 0 : o.searchPrevTooltip,
|
|
2884
2890
|
className: te["rp-search-tool-result-navigator"],
|
|
2885
|
-
children: /* @__PURE__ */ a(we, { tabIndex: 0, onClick: n, "aria-label":
|
|
2886
|
-
|
|
2891
|
+
children: /* @__PURE__ */ a(we, { tabIndex: 0, onClick: n, "aria-label": o == null ? void 0 : o.searchPrevTooltip, children: /* @__PURE__ */ a(
|
|
2892
|
+
Xe,
|
|
2887
2893
|
{
|
|
2888
2894
|
className: te["rp-search-tool-input-icon"],
|
|
2889
2895
|
"aria-disabled": !t
|
|
@@ -2894,10 +2900,10 @@ const Re = {
|
|
|
2894
2900
|
/* @__PURE__ */ a(
|
|
2895
2901
|
Q,
|
|
2896
2902
|
{
|
|
2897
|
-
content:
|
|
2903
|
+
content: o == null ? void 0 : o.searchNextTooltip,
|
|
2898
2904
|
className: te["rp-search-tool-result-navigator"],
|
|
2899
|
-
children: /* @__PURE__ */ a(we, { tabIndex: 0, onClick: e, "aria-label":
|
|
2900
|
-
|
|
2905
|
+
children: /* @__PURE__ */ a(we, { tabIndex: 0, onClick: e, "aria-label": o == null ? void 0 : o.searchNextTooltip, children: /* @__PURE__ */ a(
|
|
2906
|
+
Xe,
|
|
2901
2907
|
{
|
|
2902
2908
|
style: { transform: "rotate(180deg" },
|
|
2903
2909
|
className: te["rp-search-tool-input-icon"],
|
|
@@ -2907,27 +2913,27 @@ const Re = {
|
|
|
2907
2913
|
}
|
|
2908
2914
|
)
|
|
2909
2915
|
] });
|
|
2910
|
-
},
|
|
2916
|
+
}, ji = () => {
|
|
2911
2917
|
const { searchIcon: t } = Pe(), { searchIcon: e } = Te();
|
|
2912
2918
|
return t || e || /* @__PURE__ */ a(gn, {});
|
|
2913
|
-
},
|
|
2914
|
-
const { container: e } = be(), [n,
|
|
2919
|
+
}, Ki = ({ icon: t }) => {
|
|
2920
|
+
const { container: e } = be(), [n, o] = q(!1), { pdf: r } = re(), [i, c] = q(null), {
|
|
2915
2921
|
searchOptions: l,
|
|
2916
2922
|
setSearchOptions: d,
|
|
2917
2923
|
loading: f,
|
|
2918
2924
|
setSearch: m,
|
|
2919
|
-
totalMatches:
|
|
2920
|
-
currentMatchPosition:
|
|
2925
|
+
totalMatches: P,
|
|
2926
|
+
currentMatchPosition: u,
|
|
2921
2927
|
nextMatch: T,
|
|
2922
|
-
prevMatch:
|
|
2928
|
+
prevMatch: C,
|
|
2923
2929
|
search: b
|
|
2924
|
-
} = St(), { searchTool: g = !0 } = Ce(), { searchTool: S = !0 } =
|
|
2925
|
-
|
|
2930
|
+
} = St(), { searchTool: g = !0 } = Ce(), { searchTool: S = !0 } = Ne(), [v, h] = q(b), { localeMessages: p } = me(), { isSmallScreen: s } = Oe(), [w, _] = q(null), [y, x] = q(!1), I = E(() => {
|
|
2931
|
+
o(!0);
|
|
2926
2932
|
}, []), R = E(() => {
|
|
2927
|
-
m(""), h(""),
|
|
2933
|
+
m(""), h(""), o(!1);
|
|
2928
2934
|
}, [m]), L = (G) => {
|
|
2929
|
-
const
|
|
2930
|
-
(
|
|
2935
|
+
const K = G.key === "Enter", Y = G.key === " ";
|
|
2936
|
+
(K || Y) && R();
|
|
2931
2937
|
}, N = E(
|
|
2932
2938
|
(G) => {
|
|
2933
2939
|
G.key === "Escape" && n && R();
|
|
@@ -2935,15 +2941,15 @@ const Re = {
|
|
|
2935
2941
|
[n]
|
|
2936
2942
|
), F = E(
|
|
2937
2943
|
(G) => {
|
|
2938
|
-
G.shiftKey && G.key === "Enter" ?
|
|
2944
|
+
G.shiftKey && G.key === "Enter" ? C() : G.key === "Enter" && b !== v ? m(v) : G.key === "Enter" && T();
|
|
2939
2945
|
},
|
|
2940
|
-
[v,
|
|
2946
|
+
[v, C, T, m, b]
|
|
2941
2947
|
);
|
|
2942
2948
|
z(() => {
|
|
2943
2949
|
h(b);
|
|
2944
2950
|
}, [b]), z(() => {
|
|
2945
|
-
b &&
|
|
2946
|
-
}, [b,
|
|
2951
|
+
b && r && x(!0);
|
|
2952
|
+
}, [b, r]), z(() => {
|
|
2947
2953
|
b && b.trim() !== "" && (h(b), m(b));
|
|
2948
2954
|
}, []), z(() => (window.addEventListener("keydown", N), () => {
|
|
2949
2955
|
window.removeEventListener("keydown", N);
|
|
@@ -2956,34 +2962,34 @@ const Re = {
|
|
|
2956
2962
|
h(G.target.value);
|
|
2957
2963
|
}, []), D = E(() => {
|
|
2958
2964
|
h(""), m("");
|
|
2959
|
-
}, [m]), O = W(() => `${
|
|
2965
|
+
}, [m]), O = W(() => `${u} / ${P}`, [u, P]), { wholeWords: A, matchCase: H } = W(() => l, [l]), U = E(
|
|
2960
2966
|
(G) => {
|
|
2961
|
-
d((
|
|
2967
|
+
d((K) => ({ ...K, matchCase: G }));
|
|
2962
2968
|
},
|
|
2963
2969
|
[d]
|
|
2964
2970
|
), B = E(
|
|
2965
2971
|
(G) => {
|
|
2966
|
-
d((
|
|
2972
|
+
d((K) => ({ ...K, wholeWords: G }));
|
|
2967
2973
|
},
|
|
2968
2974
|
[d]
|
|
2969
2975
|
);
|
|
2970
2976
|
z(() => {
|
|
2971
|
-
|
|
2972
|
-
}, [
|
|
2973
|
-
const V = W(() => (w == null ? void 0 : w.querySelectorAll('[tabindex]:not([tabindex="-1"])')) || [], [w]),
|
|
2977
|
+
r && y && R();
|
|
2978
|
+
}, [r, R]);
|
|
2979
|
+
const V = W(() => (w == null ? void 0 : w.querySelectorAll('[tabindex]:not([tabindex="-1"])')) || [], [w]), J = E(
|
|
2974
2980
|
(G) => {
|
|
2975
2981
|
if (G.key === "Tab") {
|
|
2976
|
-
const
|
|
2982
|
+
const K = document.activeElement;
|
|
2977
2983
|
let Y = 0;
|
|
2978
|
-
V.forEach((ie,
|
|
2979
|
-
ie ===
|
|
2984
|
+
V.forEach((ie, se) => {
|
|
2985
|
+
ie === K && (Y = se);
|
|
2980
2986
|
});
|
|
2981
|
-
let
|
|
2982
|
-
G.shiftKey && (
|
|
2983
|
-
const
|
|
2984
|
-
if (
|
|
2985
|
-
|
|
2986
|
-
else if (
|
|
2987
|
+
let ee = Y + 1;
|
|
2988
|
+
G.shiftKey && (ee = Y - 1);
|
|
2989
|
+
const oe = V[ee];
|
|
2990
|
+
if (oe)
|
|
2991
|
+
oe.focus();
|
|
2992
|
+
else if (ee > V.length - 1) {
|
|
2987
2993
|
const ie = V[0];
|
|
2988
2994
|
ie && ie.focus();
|
|
2989
2995
|
} else {
|
|
@@ -2994,7 +3000,7 @@ const Re = {
|
|
|
2994
3000
|
},
|
|
2995
3001
|
[V]
|
|
2996
3002
|
);
|
|
2997
|
-
return !g || !S ? null : /* @__PURE__ */ a(
|
|
3003
|
+
return !g || !S ? null : /* @__PURE__ */ a(fe, { children: /* @__PURE__ */ a(
|
|
2998
3004
|
dn,
|
|
2999
3005
|
{
|
|
3000
3006
|
open: n,
|
|
@@ -3003,13 +3009,13 @@ const Re = {
|
|
|
3003
3009
|
align: "start",
|
|
3004
3010
|
tabIndex: 0,
|
|
3005
3011
|
avoidCollisions: !1,
|
|
3006
|
-
triggerComponent: /* @__PURE__ */ a(Q, { content:
|
|
3012
|
+
triggerComponent: /* @__PURE__ */ a(Q, { content: p == null ? void 0 : p.searchButtonTooltip, children: /* @__PURE__ */ a(
|
|
3007
3013
|
we,
|
|
3008
3014
|
{
|
|
3009
3015
|
active: n,
|
|
3010
3016
|
onClick: I,
|
|
3011
|
-
"aria-label":
|
|
3012
|
-
children: t || /* @__PURE__ */ a(
|
|
3017
|
+
"aria-label": p == null ? void 0 : p.searchButtonTooltip,
|
|
3018
|
+
children: t || /* @__PURE__ */ a(ji, {})
|
|
3013
3019
|
}
|
|
3014
3020
|
) }),
|
|
3015
3021
|
children: /* @__PURE__ */ $(
|
|
@@ -3018,24 +3024,24 @@ const Re = {
|
|
|
3018
3024
|
ref: _,
|
|
3019
3025
|
className: te["rp-search-tool-content"],
|
|
3020
3026
|
tabIndex: 0,
|
|
3021
|
-
onKeyDown:
|
|
3027
|
+
onKeyDown: J,
|
|
3022
3028
|
children: [
|
|
3023
3029
|
/* @__PURE__ */ $("div", { className: te["rp-search-tool-input-wrapper"], children: [
|
|
3024
3030
|
/* @__PURE__ */ $("div", { className: te["rp-search-tool-input"], children: [
|
|
3025
|
-
/* @__PURE__ */ a(Q, { content:
|
|
3031
|
+
/* @__PURE__ */ a(Q, { content: p == null ? void 0 : p.searchInputTooltip, children: /* @__PURE__ */ a(
|
|
3026
3032
|
an,
|
|
3027
3033
|
{
|
|
3028
3034
|
value: v,
|
|
3029
3035
|
onKeyDown: F,
|
|
3030
3036
|
onChange: M,
|
|
3031
3037
|
icon: /* @__PURE__ */ a(gn, {}),
|
|
3032
|
-
placeholder:
|
|
3038
|
+
placeholder: p == null ? void 0 : p.searchInputPlaceholder,
|
|
3033
3039
|
className: te["rp-search-input"],
|
|
3034
3040
|
ref: c,
|
|
3035
3041
|
id: "search-input",
|
|
3036
3042
|
name: "search-input",
|
|
3037
3043
|
tabIndex: 0,
|
|
3038
|
-
children: !!v && /* @__PURE__ */ a("span", { className: te["rp-search-tool-input-clear"], onClick: D, children: /* @__PURE__ */ a(
|
|
3044
|
+
children: !!v && /* @__PURE__ */ a("span", { className: te["rp-search-tool-input-clear"], onClick: D, children: /* @__PURE__ */ a(No, {}) })
|
|
3039
3045
|
}
|
|
3040
3046
|
) }),
|
|
3041
3047
|
f ? /* @__PURE__ */ a("span", { children: /* @__PURE__ */ a(ln, { className: te["rp-search-loader-icon"] }) }) : /* @__PURE__ */ a("span", { children: O }),
|
|
@@ -3050,10 +3056,10 @@ const Re = {
|
|
|
3050
3056
|
name: "matchCase",
|
|
3051
3057
|
value: H,
|
|
3052
3058
|
onChange: U,
|
|
3053
|
-
children:
|
|
3059
|
+
children: p == null ? void 0 : p.searchMatchCaseLabel
|
|
3054
3060
|
}
|
|
3055
3061
|
),
|
|
3056
|
-
!s && /* @__PURE__ */ a(Q, { content:
|
|
3062
|
+
!s && /* @__PURE__ */ a(Q, { content: p == null ? void 0 : p.searchMatchCaseTooltip, children: /* @__PURE__ */ a("div", { className: te["rp-search-icon-info"], tabIndex: 0, children: /* @__PURE__ */ a(Wt, {}) }) }),
|
|
3057
3063
|
/* @__PURE__ */ a(
|
|
3058
3064
|
zt,
|
|
3059
3065
|
{
|
|
@@ -3061,10 +3067,10 @@ const Re = {
|
|
|
3061
3067
|
name: "wholeWord",
|
|
3062
3068
|
value: A,
|
|
3063
3069
|
onChange: B,
|
|
3064
|
-
children:
|
|
3070
|
+
children: p == null ? void 0 : p.searchWholeWordsLabel
|
|
3065
3071
|
}
|
|
3066
3072
|
),
|
|
3067
|
-
!s && /* @__PURE__ */ a(Q, { content:
|
|
3073
|
+
!s && /* @__PURE__ */ a(Q, { content: p == null ? void 0 : p.searchWholeWordsTooltip, children: /* @__PURE__ */ a("div", { tabIndex: 0, className: te["rp-search-icon-info"], children: /* @__PURE__ */ a(Wt, {}) }) })
|
|
3068
3074
|
] })
|
|
3069
3075
|
] }),
|
|
3070
3076
|
!s && /* @__PURE__ */ $("div", { className: te["rp-search-tool-controls"], children: [
|
|
@@ -3076,43 +3082,43 @@ const Re = {
|
|
|
3076
3082
|
)
|
|
3077
3083
|
}
|
|
3078
3084
|
) });
|
|
3079
|
-
},
|
|
3085
|
+
}, Zi = "_loading_wazy2_1", Ae = {
|
|
3080
3086
|
"rp-loading-overlay": "_rp-loading-overlay_wazy2_1",
|
|
3081
3087
|
"rp-loading-modal": "_rp-loading-modal_wazy2_14",
|
|
3082
3088
|
"rp-loading-title": "_rp-loading-title_wazy2_27",
|
|
3083
3089
|
"rp-loading-progress-bar": "_rp-loading-progress-bar_wazy2_35",
|
|
3084
3090
|
"rp-loading-progress": "_rp-loading-progress_wazy2_35",
|
|
3085
3091
|
"rp-loading-cancel-button": "_rp-loading-cancel-button_wazy2_55",
|
|
3086
|
-
loading:
|
|
3087
|
-
},
|
|
3088
|
-
const { cancel: e } =
|
|
3089
|
-
return t < 1 ? null : /* @__PURE__ */ a("div", { className:
|
|
3090
|
-
/* @__PURE__ */ $("div", { className:
|
|
3092
|
+
loading: Zi
|
|
3093
|
+
}, Xi = ({ percentage: t }) => {
|
|
3094
|
+
const { cancel: e } = nt(), { localeMessages: n } = me();
|
|
3095
|
+
return t < 1 ? null : /* @__PURE__ */ a("div", { className: de(Ae["rp-loading-overlay"]), children: /* @__PURE__ */ $("div", { className: de(Ae["rp-loading-modal"]), children: [
|
|
3096
|
+
/* @__PURE__ */ $("div", { className: de(Ae["rp-loading-title"]), children: [
|
|
3091
3097
|
n == null ? void 0 : n.printLoadingMessage,
|
|
3092
3098
|
"..."
|
|
3093
3099
|
] }),
|
|
3094
|
-
/* @__PURE__ */ a("div", { className:
|
|
3100
|
+
/* @__PURE__ */ a("div", { className: de(Ae["rp-loading-progress-bar"]), children: /* @__PURE__ */ a(
|
|
3095
3101
|
"div",
|
|
3096
3102
|
{
|
|
3097
|
-
className:
|
|
3103
|
+
className: de(Ae["rp-loading-progress"]),
|
|
3098
3104
|
style: { width: `${t}%` }
|
|
3099
3105
|
}
|
|
3100
3106
|
) }),
|
|
3101
|
-
/* @__PURE__ */ a("button", { className:
|
|
3107
|
+
/* @__PURE__ */ a("button", { className: de(Ae["rp-loading-cancel-button"]), onClick: e, children: n == null ? void 0 : n.printCancelLabel })
|
|
3102
3108
|
] }) });
|
|
3103
|
-
},
|
|
3104
|
-
const { showPrintProgress: n = !0 } = Ce(), { showPrintProgress:
|
|
3105
|
-
if (!(!n || !
|
|
3106
|
-
return /* @__PURE__ */ a(
|
|
3109
|
+
}, Qi = tt((t, e) => {
|
|
3110
|
+
const { showPrintProgress: n = !0 } = Ce(), { showPrintProgress: o = !0 } = Ne(), { progress: r } = nt(), { isSmallScreen: i } = Oe(), { percentage: c } = r || {}, l = () => i ? { gridTemplateColumns: "25% 60% 15%" } : void 0, d = () => {
|
|
3111
|
+
if (!(!n || !o || !c))
|
|
3112
|
+
return /* @__PURE__ */ a(Xi, { percentage: c });
|
|
3107
3113
|
};
|
|
3108
3114
|
return /* @__PURE__ */ $("div", { children: [
|
|
3109
|
-
/* @__PURE__ */ a("div", { "data-rp": "topBar", ref: e, className:
|
|
3110
|
-
/* @__PURE__ */ $("div", { "data-rp": "topBarLeft", className:
|
|
3111
|
-
/* @__PURE__ */ a(
|
|
3112
|
-
/* @__PURE__ */ a(
|
|
3115
|
+
/* @__PURE__ */ a("div", { "data-rp": "topBar", ref: e, className: We["rp-toolbar-content"], children: /* @__PURE__ */ $("div", { className: We["rp-toolbar-wrapper"], style: l(), children: [
|
|
3116
|
+
/* @__PURE__ */ $("div", { "data-rp": "topBarLeft", className: We["rp-toolbar-start"], children: [
|
|
3117
|
+
/* @__PURE__ */ a(Ki, {}),
|
|
3118
|
+
/* @__PURE__ */ a(mi, {})
|
|
3113
3119
|
] }),
|
|
3114
|
-
/* @__PURE__ */ a("div", { "data-rp": "topBarCenter", className:
|
|
3115
|
-
/* @__PURE__ */ a("div", { "data-rp": "topBarRight", className:
|
|
3120
|
+
/* @__PURE__ */ a("div", { "data-rp": "topBarCenter", className: We["rp-toolbar-middle"], children: /* @__PURE__ */ a(Eo, {}) }),
|
|
3121
|
+
/* @__PURE__ */ a("div", { "data-rp": "topBarRight", className: We["rp-toolbar-end"], children: /* @__PURE__ */ a(Bi, {}) })
|
|
3116
3122
|
] }) }),
|
|
3117
3123
|
/* @__PURE__ */ a(d, {})
|
|
3118
3124
|
] });
|
|
@@ -3120,44 +3126,44 @@ const Re = {
|
|
|
3120
3126
|
"rp-sidebar-content-wrapper": "_rp-sidebar-content-wrapper_1bqgz_1",
|
|
3121
3127
|
"rp-sidebar-content": "_rp-sidebar-content_1bqgz_1",
|
|
3122
3128
|
"rp-thumbnails-wrapper": "_rp-thumbnails-wrapper_1bqgz_16"
|
|
3123
|
-
},
|
|
3129
|
+
}, He = {
|
|
3124
3130
|
"rp-thumbnail-wrapper": "_rp-thumbnail-wrapper_3fenb_1",
|
|
3125
3131
|
"rp-thumbnail-text": "_rp-thumbnail-text_3fenb_10",
|
|
3126
3132
|
"rp-thumbnail": "_rp-thumbnail_3fenb_1",
|
|
3127
3133
|
"rp-thumbnail-active": "_rp-thumbnail-active_3fenb_22",
|
|
3128
3134
|
"rp-thumbnail-loader": "_rp-thumbnail-loader_3fenb_31"
|
|
3129
|
-
},
|
|
3130
|
-
const { pageNumber: e, isFocused: n, viewport:
|
|
3131
|
-
width: Math.round(
|
|
3132
|
-
height: Math.round(
|
|
3133
|
-
}), [
|
|
3134
|
-
e &&
|
|
3135
|
-
}, [
|
|
3135
|
+
}, Yi = (t) => {
|
|
3136
|
+
const { pageNumber: e, isFocused: n, viewport: o } = t, { goToPage: r } = pe(), { pageRotate: i } = et(), c = k(null), l = yn(), { pages: d } = re(), [f, m] = q(null), P = k(!1), u = k(), T = W(() => n ? He["rp-thumbnail-active"] : "", [n]), C = W(() => ({
|
|
3137
|
+
width: Math.round(o.width),
|
|
3138
|
+
height: Math.round(o.height)
|
|
3139
|
+
}), [o]), b = E(() => {
|
|
3140
|
+
e && r(e);
|
|
3141
|
+
}, [r, e]);
|
|
3136
3142
|
return z(() => {
|
|
3137
3143
|
const g = d.get(e);
|
|
3138
|
-
|
|
3144
|
+
u.current === g || (m(null), u.current = g);
|
|
3139
3145
|
}, [d, e]), z(() => {
|
|
3140
3146
|
const g = d.get(e);
|
|
3141
3147
|
if (!c.current || !e || !g || f)
|
|
3142
3148
|
return;
|
|
3143
3149
|
const S = new IntersectionObserver((v) => {
|
|
3144
3150
|
v.forEach((h) => {
|
|
3145
|
-
if (
|
|
3146
|
-
|
|
3151
|
+
if (P.current) {
|
|
3152
|
+
P.current = !1, l.removeQueue(`thumbnail-${e}`);
|
|
3147
3153
|
return;
|
|
3148
3154
|
}
|
|
3149
3155
|
if (h.isIntersecting) {
|
|
3150
|
-
const
|
|
3151
|
-
|
|
3156
|
+
const p = document.createElement("canvas");
|
|
3157
|
+
P.current = !0, l.enqueue(
|
|
3152
3158
|
`thumbnail-${e}`,
|
|
3153
3159
|
{
|
|
3154
3160
|
page: g.page,
|
|
3155
|
-
canvasElem:
|
|
3161
|
+
canvasElem: p,
|
|
3156
3162
|
options: {
|
|
3157
3163
|
scale: 1
|
|
3158
3164
|
},
|
|
3159
3165
|
onLoaded: () => {
|
|
3160
|
-
|
|
3166
|
+
p.toBlob((s) => {
|
|
3161
3167
|
if (!s)
|
|
3162
3168
|
return;
|
|
3163
3169
|
const w = URL.createObjectURL(s);
|
|
@@ -3178,7 +3184,7 @@ const Re = {
|
|
|
3178
3184
|
{
|
|
3179
3185
|
onClick: b,
|
|
3180
3186
|
id: `page-${e}`,
|
|
3181
|
-
className:
|
|
3187
|
+
className: He["rp-thumbnail-wrapper"],
|
|
3182
3188
|
ref: c,
|
|
3183
3189
|
children: [
|
|
3184
3190
|
/* @__PURE__ */ a(
|
|
@@ -3187,77 +3193,77 @@ const Re = {
|
|
|
3187
3193
|
style: {
|
|
3188
3194
|
transform: `rotate(${i[e || 0]}deg)`
|
|
3189
3195
|
},
|
|
3190
|
-
className:
|
|
3196
|
+
className: de(T, He["rp-thumbnail"]),
|
|
3191
3197
|
children: f ? /* @__PURE__ */ a(
|
|
3192
3198
|
"img",
|
|
3193
3199
|
{
|
|
3194
3200
|
src: f,
|
|
3195
|
-
width:
|
|
3196
|
-
height:
|
|
3201
|
+
width: C.width,
|
|
3202
|
+
height: C.height,
|
|
3197
3203
|
alt: "thumbnail"
|
|
3198
3204
|
}
|
|
3199
3205
|
) : /* @__PURE__ */ a(
|
|
3200
3206
|
"div",
|
|
3201
3207
|
{
|
|
3202
|
-
className:
|
|
3208
|
+
className: He["rp-thumbnail-loader"],
|
|
3203
3209
|
style: {
|
|
3204
|
-
width: `${
|
|
3205
|
-
height: `${
|
|
3210
|
+
width: `${C.width}px`,
|
|
3211
|
+
height: `${C.height}px`
|
|
3206
3212
|
},
|
|
3207
3213
|
children: /* @__PURE__ */ a(ln, {})
|
|
3208
3214
|
}
|
|
3209
3215
|
)
|
|
3210
3216
|
}
|
|
3211
3217
|
),
|
|
3212
|
-
/* @__PURE__ */ a("div", { className:
|
|
3218
|
+
/* @__PURE__ */ a("div", { className: He["rp-thumbnail-text"], children: e })
|
|
3213
3219
|
]
|
|
3214
3220
|
}
|
|
3215
3221
|
);
|
|
3216
3222
|
}, nn = {
|
|
3217
3223
|
"rp-thumbnails-container": "_rp-thumbnails-container_16vqr_1",
|
|
3218
3224
|
"rp-thumbnails": "_rp-thumbnails_16vqr_1"
|
|
3219
|
-
},
|
|
3225
|
+
}, Ji = 16, ea = (t, e) => {
|
|
3220
3226
|
const n = t == null ? void 0 : t.querySelector(`#page-${e}`);
|
|
3221
|
-
t && (n != null && n.offsetTop) && (t.scrollTop = (n == null ? void 0 : n.offsetTop) -
|
|
3222
|
-
},
|
|
3223
|
-
const { show: n, width:
|
|
3224
|
-
|
|
3225
|
-
const
|
|
3226
|
-
const
|
|
3227
|
-
|
|
3227
|
+
t && (n != null && n.offsetTop) && (t.scrollTop = (n == null ? void 0 : n.offsetTop) - Ji);
|
|
3228
|
+
}, ta = tt((t, e) => {
|
|
3229
|
+
const { show: n, width: o } = t, { focusedPage: r, totalPages: i } = pe(), { thumbnailPages: c, addPage: l, thumbnailLength: d, addToPage: f } = Tn(), m = k(null), P = k(1);
|
|
3230
|
+
rn(e, () => m.current);
|
|
3231
|
+
const u = W(() => Object.values(c), [c]), T = E(() => {
|
|
3232
|
+
const C = d + 1;
|
|
3233
|
+
C <= i && l(C);
|
|
3228
3234
|
}, [l, i, d]);
|
|
3229
3235
|
return z(() => {
|
|
3230
|
-
|
|
3231
|
-
}, [
|
|
3236
|
+
r > d && i > d ? f(r) : n && P.current !== r && (ea(m.current, r), P.current = r);
|
|
3237
|
+
}, [r, d, f, n, u]), Fr(m.current, T), /* @__PURE__ */ a("div", { ref: m, className: nn["rp-thumbnails-container"], style: { width: o }, children: /* @__PURE__ */ a("div", { className: nn["rp-thumbnails"], children: n ? u.map((C, b) => {
|
|
3232
3238
|
var g, S;
|
|
3233
3239
|
return /* @__PURE__ */ a(
|
|
3234
|
-
|
|
3240
|
+
Yi,
|
|
3235
3241
|
{
|
|
3236
|
-
isFocused:
|
|
3237
|
-
pageNumber: (S =
|
|
3238
|
-
loading:
|
|
3239
|
-
viewport:
|
|
3240
|
-
defaultRotation:
|
|
3242
|
+
isFocused: r === ((g = C.page) == null ? void 0 : g.pageNumber),
|
|
3243
|
+
pageNumber: (S = C.page) == null ? void 0 : S.pageNumber,
|
|
3244
|
+
loading: C.loading,
|
|
3245
|
+
viewport: C.viewport,
|
|
3246
|
+
defaultRotation: C.defaultRotation
|
|
3241
3247
|
},
|
|
3242
3248
|
b
|
|
3243
3249
|
);
|
|
3244
3250
|
}) : null }) });
|
|
3245
|
-
}),
|
|
3251
|
+
}), na = () => {
|
|
3246
3252
|
const { thumbnailIcon: t } = Pe(), { thumbnailIcon: e } = Te();
|
|
3247
|
-
return t || e || /* @__PURE__ */ a(
|
|
3248
|
-
},
|
|
3249
|
-
const { active: t, setActive: e } = Tn(), [n,
|
|
3250
|
-
e((
|
|
3253
|
+
return t || e || /* @__PURE__ */ a(Ir, {});
|
|
3254
|
+
}, ra = () => {
|
|
3255
|
+
const { active: t, setActive: e } = Tn(), [n, o] = q(kr), r = k(null), i = k(null), { thumbnailTool: c, sidebarEnable: l } = Ce(), { localeMessages: d } = me(), f = E(() => {
|
|
3256
|
+
e((P) => !P);
|
|
3251
3257
|
}, []), m = W(() => typeof c != "boolean" && c ? /* @__PURE__ */ a(c, { onClick: f, active: t }) : c ? /* @__PURE__ */ a(Q, { content: d == null ? void 0 : d.thumbnailTooltip, children: /* @__PURE__ */ a(
|
|
3252
3258
|
we,
|
|
3253
3259
|
{
|
|
3254
3260
|
onClick: f,
|
|
3255
3261
|
active: t,
|
|
3256
3262
|
"aria-label": d == null ? void 0 : d.thumbnailTooltip,
|
|
3257
|
-
children: /* @__PURE__ */ a(
|
|
3263
|
+
children: /* @__PURE__ */ a(na, {})
|
|
3258
3264
|
}
|
|
3259
3265
|
) }) : null, [c, t, f, d]);
|
|
3260
|
-
return /* @__PURE__ */ a(
|
|
3266
|
+
return /* @__PURE__ */ a(fe, { children: l && /* @__PURE__ */ $(
|
|
3261
3267
|
"div",
|
|
3262
3268
|
{
|
|
3263
3269
|
style: { "--rp-thumbnail-width": `${n}px` },
|
|
@@ -3272,12 +3278,12 @@ const Re = {
|
|
|
3272
3278
|
hidden: !t,
|
|
3273
3279
|
className: ft["rp-thumbnails-wrapper"],
|
|
3274
3280
|
children: [
|
|
3275
|
-
/* @__PURE__ */ a(
|
|
3281
|
+
/* @__PURE__ */ a(ta, { show: t, ref: r }),
|
|
3276
3282
|
/* @__PURE__ */ a(
|
|
3277
|
-
|
|
3283
|
+
Er,
|
|
3278
3284
|
{
|
|
3279
|
-
onWidthChange:
|
|
3280
|
-
thumbnailRef:
|
|
3285
|
+
onWidthChange: o,
|
|
3286
|
+
thumbnailRef: r,
|
|
3281
3287
|
leftSidebarRef: i
|
|
3282
3288
|
}
|
|
3283
3289
|
)
|
|
@@ -3287,36 +3293,36 @@ const Re = {
|
|
|
3287
3293
|
]
|
|
3288
3294
|
}
|
|
3289
3295
|
) });
|
|
3290
|
-
},
|
|
3296
|
+
}, ac = ar((t, e) => {
|
|
3291
3297
|
const {
|
|
3292
3298
|
children: n,
|
|
3293
|
-
slots:
|
|
3294
|
-
icons:
|
|
3299
|
+
slots: o,
|
|
3300
|
+
icons: r,
|
|
3295
3301
|
style: i,
|
|
3296
3302
|
className: c,
|
|
3297
3303
|
mobileWidth: l,
|
|
3298
3304
|
onLoaded: d,
|
|
3299
3305
|
cleanupOnLoaded: f,
|
|
3300
3306
|
onLayoutWidthChange: m
|
|
3301
|
-
} = t, [
|
|
3307
|
+
} = t, [P, u] = q(null), { setContainer: T, setContentRef: C } = be(), { loading: b } = re(), { LoaderImageComponent: g } = bt();
|
|
3302
3308
|
return z(() => (d && d(), () => {
|
|
3303
3309
|
f && f();
|
|
3304
3310
|
}), [d, f]), // TODO: deprecated in v2.0.0, remove later ~
|
|
3305
|
-
/* @__PURE__ */ a(Rn, { toolbarRef:
|
|
3306
|
-
/* @__PURE__ */ $(
|
|
3311
|
+
/* @__PURE__ */ a(Rn, { toolbarRef: P, ref: e, children: /* @__PURE__ */ a(Rr, { mobileWidth: l, onLayoutWidthChange: m, children: /* @__PURE__ */ a(Lr, { slots: o, children: /* @__PURE__ */ a(zr, { icons: r, children: /* @__PURE__ */ $(xr, { getContainerRef: T, style: i, className: c, children: [
|
|
3312
|
+
/* @__PURE__ */ $(Nr, { children: [
|
|
3307
3313
|
/* @__PURE__ */ $("div", { className: _e["rp-layout"], children: [
|
|
3308
3314
|
/* @__PURE__ */ a(
|
|
3309
|
-
|
|
3315
|
+
Qi,
|
|
3310
3316
|
{
|
|
3311
|
-
ref:
|
|
3317
|
+
ref: u
|
|
3312
3318
|
}
|
|
3313
3319
|
),
|
|
3314
3320
|
/* @__PURE__ */ $("div", { className: _e["rp-content"], children: [
|
|
3315
|
-
/* @__PURE__ */ a("div", { className: _e["rp-sidebar"], children: /* @__PURE__ */ a(
|
|
3316
|
-
/* @__PURE__ */ a("div", { ref:
|
|
3321
|
+
/* @__PURE__ */ a("div", { className: _e["rp-sidebar"], children: /* @__PURE__ */ a(ra, {}) }),
|
|
3322
|
+
/* @__PURE__ */ a("div", { ref: C, className: _e["rp-pages"], children: n })
|
|
3317
3323
|
] })
|
|
3318
3324
|
] }),
|
|
3319
|
-
/* @__PURE__ */ a(
|
|
3325
|
+
/* @__PURE__ */ a(Ar, {})
|
|
3320
3326
|
] }),
|
|
3321
3327
|
b ? /* @__PURE__ */ a(
|
|
3322
3328
|
"div",
|
|
@@ -3347,7 +3353,7 @@ const Re = {
|
|
|
3347
3353
|
}
|
|
3348
3354
|
) : null
|
|
3349
3355
|
] }) }) }) }) });
|
|
3350
|
-
}),
|
|
3356
|
+
}), sc = {
|
|
3351
3357
|
"rp-toolbar-layout": "_rp-toolbar-layout_vwobs_1",
|
|
3352
3358
|
"rp-content": "_rp-content_vwobs_7",
|
|
3353
3359
|
"rp-topbar-content": "_rp-topbar-content_vwobs_13",
|
|
@@ -3359,53 +3365,53 @@ export {
|
|
|
3359
3365
|
Cn as A,
|
|
3360
3366
|
Pn as B,
|
|
3361
3367
|
yn as C,
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3368
|
+
Di as D,
|
|
3369
|
+
Mo as E,
|
|
3370
|
+
Wo as F,
|
|
3371
|
+
qo as G,
|
|
3372
|
+
Uo as H,
|
|
3367
3373
|
It as I,
|
|
3368
|
-
|
|
3369
|
-
|
|
3374
|
+
ai as J,
|
|
3375
|
+
li as K,
|
|
3370
3376
|
Rn as L,
|
|
3371
|
-
|
|
3372
|
-
|
|
3377
|
+
di as M,
|
|
3378
|
+
ui as N,
|
|
3373
3379
|
Bn as O,
|
|
3374
|
-
|
|
3380
|
+
Ys as P,
|
|
3375
3381
|
Zn as Q,
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3382
|
+
rc as R,
|
|
3383
|
+
Ki as S,
|
|
3384
|
+
ec as T,
|
|
3385
|
+
Ui as U,
|
|
3386
|
+
Vi as V,
|
|
3381
3387
|
tn as W,
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3388
|
+
Qi as X,
|
|
3389
|
+
Yi as Y,
|
|
3390
|
+
ra as Z,
|
|
3391
|
+
ac as a,
|
|
3386
3392
|
Gn as b,
|
|
3387
|
-
|
|
3393
|
+
nt as c,
|
|
3388
3394
|
St as d,
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3395
|
+
tc as e,
|
|
3396
|
+
nc as f,
|
|
3397
|
+
Js as g,
|
|
3392
3398
|
Tn as h,
|
|
3393
3399
|
ht as i,
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3400
|
+
We as j,
|
|
3401
|
+
mi as k,
|
|
3402
|
+
Bi as l,
|
|
3403
|
+
sc as m,
|
|
3404
|
+
ta as n,
|
|
3405
|
+
Xi as o,
|
|
3406
|
+
Ai as p,
|
|
3407
|
+
$i as q,
|
|
3402
3408
|
vn as r,
|
|
3403
|
-
|
|
3409
|
+
Oo as s,
|
|
3404
3410
|
wn as t,
|
|
3405
|
-
|
|
3406
|
-
|
|
3411
|
+
pe as u,
|
|
3412
|
+
Do as v,
|
|
3407
3413
|
_n as w,
|
|
3408
|
-
|
|
3414
|
+
Ao as x,
|
|
3409
3415
|
bn as y,
|
|
3410
|
-
|
|
3416
|
+
zo as z
|
|
3411
3417
|
};
|