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