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